@kidlat-dakila/flightplan 0.1.7 → 0.1.8
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/backend/main.js +826 -1336
- package/backend/plugin/skills/live/SKILL.md +79 -0
- package/backend/plugin/skills/review/SKILL.md +8 -5
- package/frontend/assets/_branchId-Caxyy__g.js +1 -0
- package/frontend/assets/{_branchId-438YLxpk.js → _branchId-IJ4VEzEl.js} +1 -1
- package/frontend/assets/{_id-yAHjl11v.js → _id-3L9ONe4W.js} +1 -1
- package/frontend/assets/_id-CvORsoNj.js +1 -0
- package/frontend/assets/{agents-CUULznCR.js → agents-DnjhKMUc.js} +1 -1
- package/frontend/assets/agents-bla75JmI.js +1 -0
- package/frontend/assets/{create-Byti8N1q.js → create-B82q7ZMu.js} +1 -1
- package/frontend/assets/create-C9yw-thL.js +1 -0
- package/frontend/assets/{create-t6MxPYs8.js → create-CEpA1s8S.js} +1 -1
- package/frontend/assets/{create-DHjp2cB6.js → create-D0h6PRxn.js} +1 -1
- package/frontend/assets/{download-kIOYm7yl.js → download-CwWMZwNG.js} +1 -1
- package/frontend/assets/forges-BH3uXIQL.js +1 -0
- package/frontend/assets/{forges-5NgJFexV.js → forges-uSh1-w20.js} +1 -1
- package/frontend/assets/{index-DVMDfdCW.js → index--nj01XKS.js} +1 -1
- package/frontend/assets/index-0VAWT0gs.js +1 -0
- package/frontend/assets/{index-Dq71dq4Z.js → index-B0zuYONu.js} +1 -1
- package/frontend/assets/{index-WOMODjD2.js → index-BQaZ5gZR.js} +1 -1
- package/frontend/assets/{index-BUtsWXGk.js → index-BZ6iL63Z.js} +1 -1
- package/frontend/assets/{index-CRQLJ5uq.js → index-Bar8NyIm.js} +1 -1
- package/frontend/assets/{index-EFsgiJx1.js → index-BlTfCkr5.js} +1 -1
- package/frontend/assets/{index-Dz-E4Hhc.js → index-BvuPClj3.js} +1 -1
- package/frontend/assets/index-C9xsdcXo.js +1 -0
- package/frontend/assets/{index-Cjx98rmL.js → index-CJDNq1TA.js} +1 -1
- package/frontend/assets/{index-N0J0txvy.js → index-CJslcuJ0.js} +1 -1
- package/frontend/assets/index-CTKqkqZN.css +1 -0
- package/frontend/assets/{index-CAt5Gv5u.js → index-CXyB0ld0.js} +1 -1
- package/frontend/assets/{index-BDhIIxnY.js → index-CcORd1N6.js} +1 -1
- package/frontend/assets/{index-EItMs0kz.js → index-CrAQ5_e4.js} +1 -1
- package/frontend/assets/{index-CmW92SdM.js → index-DG0FDX8u.js} +1 -1
- package/frontend/assets/index-DKnoo-kT.js +455 -0
- package/frontend/assets/{index-BrL94etp.js → index-DKzDkR6v.js} +1 -1
- package/frontend/assets/{index-9MPLrKh9.js → index-DfKNJbUM.js} +40 -40
- package/frontend/assets/{index-CBObEG9P.js → index-DlUHisPA.js} +1 -1
- package/frontend/assets/{index-DYy-kFEi.js → index-Dv5cF6qF.js} +1 -1
- package/frontend/assets/{index-Qxg2C8CP.js → index-JPWJ3IiN.js} +1 -1
- package/frontend/assets/{index-RYSZy-Ra.js → index-V1avMli5.js} +1 -1
- package/frontend/assets/{index-Dk3p64fP.js → index-iRAoFOv3.js} +1 -1
- package/frontend/assets/repositories-DqGU7W63.js +1 -0
- package/frontend/assets/{repositories-VWl6aq7K.js → repositories-DuObN8PJ.js} +1 -1
- package/frontend/assets/review-BbbMUFsk.js +1 -0
- package/frontend/assets/{review-CXzRf1jk.js → review-C3k0h5Vl.js} +1 -1
- package/frontend/assets/{route--z3gnt4z.js → route-D8s8AylJ.js} +1 -1
- package/frontend/index.html +2 -2
- package/package.json +1 -2
- package/published-review/app.css +1 -1
- package/published-review/app.js +94 -96
- package/frontend/assets/_branchId-PhBseeXo.js +0 -1
- package/frontend/assets/_id-z15a_Wqg.js +0 -1
- package/frontend/assets/agents-CF_BNYuU.js +0 -1
- package/frontend/assets/create-DiPNM_Jx.js +0 -1
- package/frontend/assets/forges-Dz31lZmK.js +0 -1
- package/frontend/assets/index-BDgPH-og.js +0 -1
- package/frontend/assets/index-C8_4U9zA.js +0 -457
- package/frontend/assets/index-CSy69oc4.js +0 -1
- package/frontend/assets/index-Cmg8rxUj.css +0 -1
- package/frontend/assets/repositories-BrbB16PW.js +0 -1
- package/frontend/assets/review-BMO-QDpl.js +0 -1
|
@@ -1,457 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BrL94etp.js","assets/index-s0xxzhVW.js","assets/index-CAt5Gv5u.js","assets/index-DYy-kFEi.js","assets/index-Dz-E4Hhc.js","assets/agents-CF_BNYuU.js","assets/index-WOMODjD2.js","assets/agents-CUULznCR.js","assets/index-BUtsWXGk.js","assets/index-BDgPH-og.js","assets/index-RYSZy-Ra.js","assets/index-EFsgiJx1.js","assets/forges-Dz31lZmK.js","assets/forges-5NgJFexV.js","assets/index-Dk3p64fP.js","assets/repositories-BrbB16PW.js","assets/repositories-VWl6aq7K.js","assets/index-CmW92SdM.js","assets/review-BMO-QDpl.js","assets/review-CXzRf1jk.js","assets/index-DVMDfdCW.js","assets/index-BDhIIxnY.js","assets/index-CqVakH8R.js","assets/index-N0J0txvy.js","assets/index-Qxg2C8CP.js","assets/index-9MPLrKh9.js","assets/index-Dq71dq4Z.js","assets/index-EItMs0kz.js","assets/index-CRQLJ5uq.js","assets/index-CBObEG9P.js","assets/index-CSy69oc4.js","assets/index-Cjx98rmL.js","assets/_id-z15a_Wqg.js","assets/_id-yAHjl11v.js","assets/create-DiPNM_Jx.js","assets/create-DHjp2cB6.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var bV=Object.defineProperty;var jk=e=>{throw TypeError(e)};var vV=(e,t,n)=>t in e?bV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Dt=(e,t,n)=>vV(e,typeof t!="symbol"?t+"":t,n),u1=(e,t,n)=>t.has(e)||jk("Cannot "+n);var Z=(e,t,n)=>(u1(e,t,"read from private field"),n?n.call(e):t.get(e)),Qe=(e,t,n)=>t.has(e)?jk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),He=(e,t,n,r)=>(u1(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),gt=(e,t,n)=>(u1(e,t,"access private method"),n);var m0=(e,t,n,r)=>({set _(s){He(e,t,s,n)},get _(){return Z(e,t,r)}});function SV(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(r,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function e2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var d1={exports:{}},Ah={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var Pk;function wV(){if(Pk)return Ah;Pk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,o){var l=null;if(o!==void 0&&(l=""+o),s.key!==void 0&&(l=""+s.key),"key"in s){o={};for(var c in s)c!=="key"&&(o[c]=s[c])}else o=s;return s=o.ref,{$$typeof:e,type:r,key:l,ref:s!==void 0?s:null,props:o}}return Ah.Fragment=t,Ah.jsx=n,Ah.jsxs=n,Ah}var zk;function EV(){return zk||(zk=1,d1.exports=wV()),d1.exports}var g=EV(),f1={exports:{}},at={};/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react.production.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var Bk;function CV(){if(Bk)return at;Bk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),y=Symbol.for("react.view_transition"),x=Symbol.iterator;function b($){return $===null||typeof $!="object"?null:($=x&&$[x]||$["@@iterator"],typeof $=="function"?$:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,C={};function R($,Y,J){this.props=$,this.context=Y,this.refs=C,this.updater=J||S}R.prototype.isReactComponent={},R.prototype.setState=function($,Y){if(typeof $!="object"&&typeof $!="function"&&$!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,$,Y,"setState")},R.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function T(){}T.prototype=R.prototype;function O($,Y,J){this.props=$,this.context=Y,this.refs=C,this.updater=J||S}var k=O.prototype=new T;k.constructor=O,E(k,R.prototype),k.isPureReactComponent=!0;var M=Array.isArray;function A(){}var L={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function j($,Y,J){var ne=J.ref;return{$$typeof:e,type:$,key:Y,ref:ne!==void 0?ne:null,props:J}}function P($,Y){return j($.type,Y,$.props)}function B($){return typeof $=="object"&&$!==null&&$.$$typeof===e}function H($){var Y={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(J){return Y[J]})}var D=/\/+/g;function F($,Y){return typeof $=="object"&&$!==null&&$.key!=null?H(""+$.key):Y.toString(36)}function z($){switch($.status){case"fulfilled":return $.value;case"rejected":throw $.reason;default:switch(typeof $.status=="string"?$.then(A,A):($.status="pending",$.then(function(Y){$.status==="pending"&&($.status="fulfilled",$.value=Y)},function(Y){$.status==="pending"&&($.status="rejected",$.reason=Y)})),$.status){case"fulfilled":return $.value;case"rejected":throw $.reason}}throw $}function q($,Y,J,ne,W){var ce=typeof $;(ce==="undefined"||ce==="boolean")&&($=null);var ye=!1;if($===null)ye=!0;else switch(ce){case"bigint":case"string":case"number":ye=!0;break;case"object":switch($.$$typeof){case e:case t:ye=!0;break;case h:return ye=$._init,q(ye($._payload),Y,J,ne,W)}}if(ye)return W=W($),ye=ne===""?"."+F($,0):ne,M(W)?(J="",ye!=null&&(J=ye.replace(D,"$&/")+"/"),q(W,Y,J,"",function(re){return re})):W!=null&&(B(W)&&(W=P(W,J+(W.key==null||$&&$.key===W.key?"":(""+W.key).replace(D,"$&/")+"/")+ye)),Y.push(W)),1;ye=0;var pe=ne===""?".":ne+":";if(M($))for(var le=0;le<$.length;le++)ne=$[le],ce=pe+F(ne,le),ye+=q(ne,Y,J,ce,W);else if(le=b($),typeof le=="function")for($=le.call($),le=0;!(ne=$.next()).done;)ne=ne.value,ce=pe+F(ne,le++),ye+=q(ne,Y,J,ce,W);else if(ce==="object"){if(typeof $.then=="function")return q(z($),Y,J,ne,W);throw Y=String($),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return ye}function V($,Y,J){if($==null)return $;var ne=[],W=0;return q($,ne,"","",function(ce){return Y.call(J,ce,W++)}),ne}function G($){if($._status===-1){var Y=$._result,J=Y();J.then(function(ne){($._status===0||$._status===-1)&&($._status=1,$._result=ne,J.status===void 0&&(J.status="fulfilled",J.value=ne))},function(ne){($._status===0||$._status===-1)&&($._status=2,$._result=ne,J.status===void 0&&(J.status="rejected",J.reason=ne))}),$._status===-1&&($._status=0,$._result=J)}if($._status===1)return $._result.default;throw $._result}var K=typeof reportError=="function"?reportError:function($){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof $=="object"&&$!==null&&typeof $.message=="string"?String($.message):String($),error:$});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",$);return}console.error($)};function X($){var Y=L.T,J={};J.types=Y!==null?Y.types:null,L.T=J;try{var ne=$(),W=L.S;W!==null&&W(J,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(A,K)}catch(ce){K(ce)}finally{Y!==null&&J.types!==null&&(Y.types=J.types),L.T=Y}}function ee($){var Y=L.T;if(Y!==null){var J=Y.types;J===null?Y.types=[$]:J.indexOf($)===-1&&J.push($)}else X(ee.bind(null,$))}var ae={map:V,forEach:function($,Y,J){V($,function(){Y.apply(this,arguments)},J)},count:function($){var Y=0;return V($,function(){Y++}),Y},toArray:function($){return V($,function(Y){return Y})||[]},only:function($){if(!B($))throw Error("React.Children.only expected to receive a single React element child.");return $}};return at.Activity=p,at.Children=ae,at.Component=R,at.Fragment=n,at.Profiler=s,at.PureComponent=O,at.StrictMode=r,at.Suspense=u,at.ViewTransition=y,at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,at.__COMPILER_RUNTIME={__proto__:null,c:function($){return L.H.useMemoCache($)}},at.addTransitionType=ee,at.cache=function($){return function(){return $.apply(null,arguments)}},at.cacheSignal=function(){return null},at.cloneElement=function($,Y,J){if($==null)throw Error("The argument must be a React element, but you passed "+$+".");var ne=E({},$.props),W=$.key;if(Y!=null)for(ce in Y.key!==void 0&&(W=""+Y.key),Y)!I.call(Y,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&Y.ref===void 0||(ne[ce]=Y[ce]);var ce=arguments.length-2;if(ce===1)ne.children=J;else if(1<ce){for(var ye=Array(ce),pe=0;pe<ce;pe++)ye[pe]=arguments[pe+2];ne.children=ye}return j($.type,W,ne)},at.createContext=function($){return $={$$typeof:l,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null},$.Provider=$,$.Consumer={$$typeof:o,_context:$},$},at.createElement=function($,Y,J){var ne,W={},ce=null;if(Y!=null)for(ne in Y.key!==void 0&&(ce=""+Y.key),Y)I.call(Y,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(W[ne]=Y[ne]);var ye=arguments.length-2;if(ye===1)W.children=J;else if(1<ye){for(var pe=Array(ye),le=0;le<ye;le++)pe[le]=arguments[le+2];W.children=pe}if($&&$.defaultProps)for(ne in ye=$.defaultProps,ye)W[ne]===void 0&&(W[ne]=ye[ne]);return j($,ce,W)},at.createRef=function(){return{current:null}},at.forwardRef=function($){return{$$typeof:c,render:$}},at.isValidElement=B,at.lazy=function($){return{$$typeof:h,_payload:{_status:-1,_result:$},_init:G}},at.memo=function($,Y){return{$$typeof:f,type:$,compare:Y===void 0?null:Y}},at.startTransition=X,at.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},at.use=function($){return L.H.use($)},at.useActionState=function($,Y,J){return L.H.useActionState($,Y,J)},at.useCallback=function($,Y){return L.H.useCallback($,Y)},at.useContext=function($){return L.H.useContext($)},at.useDebugValue=function(){},at.useDeferredValue=function($,Y){return L.H.useDeferredValue($,Y)},at.useEffect=function($,Y){return L.H.useEffect($,Y)},at.useEffectEvent=function($){return L.H.useEffectEvent($)},at.useId=function(){return L.H.useId()},at.useImperativeHandle=function($,Y,J){return L.H.useImperativeHandle($,Y,J)},at.useInsertionEffect=function($,Y){return L.H.useInsertionEffect($,Y)},at.useLayoutEffect=function($,Y){return L.H.useLayoutEffect($,Y)},at.useMemo=function($,Y){return L.H.useMemo($,Y)},at.useOptimistic=function($,Y){return L.H.useOptimistic($,Y)},at.useReducer=function($,Y,J){return L.H.useReducer($,Y,J)},at.useRef=function($){return L.H.useRef($)},at.useState=function($){return L.H.useState($)},at.useSyncExternalStore=function($,Y,J){return L.H.useSyncExternalStore($,Y,J)},at.useTransition=function(){return L.H.useTransition()},at.version="19.3.0",at}var Hk;function im(){return Hk||(Hk=1,f1.exports=CV()),f1.exports}var N=im();const si=e2(N),TV=SV({__proto__:null,default:si},[N]),OP=N.createContext(void 0),_o=e=>{const t=N.useContext(OP);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},NV=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(OP.Provider,{value:e,children:t})),RV={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var fa,JC,gP,OV=(gP=class{constructor(){Qe(this,fa,RV);Qe(this,JC,!1)}setTimeoutProvider(e){He(this,fa,e)}setTimeout(e,t){return Z(this,fa).setTimeout(e,t)}clearTimeout(e){Z(this,fa).clearTimeout(e)}setInterval(e,t){return Z(this,fa).setInterval(e,t)}clearInterval(e){Z(this,fa).clearInterval(e)}},fa=new WeakMap,JC=new WeakMap,gP);const Lc=new OV;function AV(e){setTimeout(e,0)}const kV=typeof window>"u"||"Deno"in globalThis;function Jr(){}function _V(e,t){return typeof e=="function"?e(t):e}function AP(e){return typeof e=="number"&&e>=0&&e!==1/0}function kP(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fn(e,t){return typeof e=="function"?e(t):e}function Fk(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==t2(l,t.options))return!1}else if(!rf(t.queryKey,l))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||s&&s!==t.state.fetchStatus||o&&!o(t))}function $k(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Da(t.options.mutationKey)!==Da(o))return!1}else if(!rf(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function t2(e,t){return((t==null?void 0:t.queryKeyHashFn)||Da)(e)}function Da(e){return JSON.stringify(e,(t,n)=>Pw(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function rf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(!rf(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!rf(e[r],t[r]))return!1;return!0}return!1}const MV=Object.prototype.hasOwnProperty;function _P(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=Uk(e)&&Uk(t);if(!r&&!(Pw(e)&&Pw(t)))return t;const s=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),l=o.length,c=r?new Array(l):{};let u=0;for(let f=0;f<l;f++){const h=r?f:o[f],p=e[h],y=t[h];if(p===y){c[h]=p,(r?f<s:MV.call(e,h))&&u++;continue}if(p===null||y===null||typeof p!="object"||typeof y!="object"){c[h]=y;continue}const x=_P(p,y,n+1);c[h]=x,x===p&&u++}return s===l&&u===s?e:c}function ay(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Uk(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Pw(e){if(!Vk(e))return!1;const t=Object.getPrototypeOf(e),n=t==null?void 0:t.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!Vk(r)||!r.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function Vk(e){return Object.prototype.toString.call(e)==="[object Object]"}function IV(e){return new Promise(t=>{Lc.setTimeout(t,e)})}function zw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?_P(e,t):t}function Mx(e){return e}function LV(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function DV(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}const ao=Symbol();function MP(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ao?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function n2(e,t){return typeof e=="function"?e(...t):!!e}function jV(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}let PV=()=>kV;const r2=()=>PV();var Tf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Fc,ha,Vd,yP,zV=(yP=class extends Tf{constructor(){super();Qe(this,Fc);Qe(this,ha);Qe(this,Vd);He(this,Vd,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Z(this,ha)||this.setEventListener(Z(this,Vd))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,ha))==null||t.call(this),He(this,ha,void 0))}setEventListener(t){var n;He(this,Vd,t),(n=Z(this,ha))==null||n.call(this),He(this,ha,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Z(this,Fc)!==t&&(He(this,Fc,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Z(this,Fc)=="boolean"?Z(this,Fc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Fc=new WeakMap,ha=new WeakMap,Vd=new WeakMap,yP);const s2=new zV,BV=AV;function HV(){let e=[],t=0,n=c=>{c()},r=c=>{c()},s=BV;const o=c=>{t?e.push(c):s(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&s(()=>{r(()=>{c.forEach(u=>{n(u)})})})};return{batch:c=>{let u;t++;try{u=c()}finally{t--,t||l()}return u},batchCalls:c=>(...u)=>{o(()=>{c(...u)})},schedule:o,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{s=c}}}const Zn=HV();var qd,pa,Gd,xP,FV=(xP=class extends Tf{constructor(){super();Qe(this,qd,!0);Qe(this,pa);Qe(this,Gd);He(this,Gd,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Z(this,pa)||this.setEventListener(Z(this,Gd))}onUnsubscribe(){var t;this.hasListeners()||((t=Z(this,pa))==null||t.call(this),He(this,pa,void 0))}setEventListener(t){var n;He(this,Gd,t),(n=Z(this,pa))==null||n.call(this),He(this,pa,t(this.setOnline.bind(this)))}setOnline(t){Z(this,qd)!==t&&(He(this,qd,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return Z(this,qd)}},qd=new WeakMap,pa=new WeakMap,Gd=new WeakMap,xP);const _y=new FV;function $V(e){return Math.min(1e3*2**e,3e4)}function IP(e){return(e??"online")==="online"?_y.isOnline():!0}var Bw=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function LP(e){let t=!1,n=0,r,s="pending",o,l;const c=new Promise((R,T)=>{o=R,l=T});c.catch(Jr);const u=()=>s!=="pending",f=R=>{var T;if(!u()){const O=new Bw(R);S(O),(T=e.onCancel)==null||T.call(e,O)}},h=()=>{t=!0},p=()=>{t=!1},y=()=>s2.isFocused()&&(e.networkMode==="always"||_y.isOnline())&&e.canRun(),x=()=>IP(e.networkMode)&&e.canRun(),b=R=>{u()||(r==null||r(),s="resolved",o(R))},S=R=>{u()||(r==null||r(),s="rejected",l(R))},E=()=>new Promise(R=>{var T;r=O=>{(u()||y())&&R(O)},(T=e.onPause)==null||T.call(e)}).then(()=>{var R;r=void 0,u()||(R=e.onContinue)==null||R.call(e)}),C=()=>{if(u())return;let R;const T=n===0?e.initialPromise:void 0;try{R=T??e.fn()}catch(O){R=Promise.reject(O)}Promise.resolve(R).then(b).catch(O=>{var I;if(u())return;const k=e.retry??(r2()?0:3),M=e.retryDelay??$V,A=typeof M=="function"?M(n,O):M,L=k===!0||typeof k=="number"&&n<k||typeof k=="function"&&k(n,O);if(t||!L){S(O);return}n++,(I=e.onFail)==null||I.call(e,n,O),IV(A).then(()=>y()?void 0:E()).then(()=>{t?S(O):C()})})};return{promise:c,status:()=>s,cancel:f,continue:()=>(r==null||r(),c),cancelRetry:h,continueRetry:p,canStart:x,start:()=>(x()?C():E().then(C),c)}}var $c,bP,DP=(bP=class{constructor(){Qe(this,$c)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),AP(this.gcTime)&&He(this,$c,Lc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(r2()?1/0:3e5))}clearGcTimeout(){Z(this,$c)!==void 0&&(Lc.clearTimeout(Z(this,$c)),He(this,$c,void 0))}},$c=new WeakMap,bP);function UV(e){return{onFetch:(t,n)=>{var h,p,y,x,b;const r=t.options,s=(y=(p=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:p.fetchMore)==null?void 0:y.direction,o=((x=t.state.data)==null?void 0:x.pages)||[],l=((b=t.state.data)==null?void 0:b.pageParams)||[];let c={pages:[],pageParams:[]},u=0;const f=async()=>{let S=!1;const E=T=>{jV(T,()=>t.signal,()=>S=!0)},C=MP(t.options,t.fetchOptions),R=async(T,O,k)=>{if(S)return Promise.reject(t.signal.reason);if(O==null&&T.pages.length)return Promise.resolve(T);const A=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:O,direction:k?"backward":"forward",meta:t.options.meta};return E(P),P})(),L=await C(A),{maxPages:I}=t.options,j=k?DV:LV;return{pages:j(T.pages,L,I),pageParams:j(T.pageParams,O,I)}};if(s&&o.length){const T=s==="backward",O=T?VV:qk,k={pages:o,pageParams:l};c=await R(k,O(r,k),T)}else{const T=e??o.length;do{const O=u===0?l[0]??r.initialPageParam:qk(r,c);if(u>0&&O==null)break;c=await R(c,O),u++}while(u<T)}return c};t.options.persister?t.fetchFn=()=>{var S,E;return(E=(S=t.options).persister)==null?void 0:E.call(S,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=f}}}function qk(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function VV(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Kd,Uc,Yd,no,Vc,Qn,tm,qc,vo,Pi,vP,qV=(vP=class extends DP{constructor(t){super();Qe(this,vo);Qe(this,Kd);Qe(this,Uc);Qe(this,Yd);Qe(this,no);Qe(this,Vc);Qe(this,Qn);Qe(this,tm);Qe(this,qc);He(this,qc,!1),He(this,tm,t.defaultOptions),this.setOptions(t.options),this.observers=[],He(this,Vc,t.client),He(this,no,Z(this,Vc).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,He(this,Uc,Kk(this.options)),this.state=t.state??Z(this,Uc),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return Z(this,Kd)}get promise(){var t;return(t=Z(this,Qn))==null?void 0:t.promise}setOptions(t){if(this.options={...Z(this,tm),...t},t!=null&&t._type&&He(this,Kd,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Kk(this.options);n.data!==void 0&&(this.setState(Gk(n.data,n.dataUpdatedAt)),He(this,Uc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Z(this,no).remove(this)}setData(t,n){const r=zw(this.state.data,t,this.options);return gt(this,vo,Pi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){gt(this,vo,Pi).call(this,{type:"setState",state:t})}cancel(t){var r,s;const n=(r=Z(this,Qn))==null?void 0:r.promise;return(s=Z(this,Qn))==null||s.cancel(t),n?n.then(Jr).catch(Jr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return Z(this,Uc)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>fn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ao||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>fn(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!kP(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=Z(this,Qn))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=Z(this,Qn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Z(this,no).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(Z(this,Qn)&&(Z(this,qc)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?Z(this,Qn).cancel({revert:!0}):Z(this,Qn).cancelRetry()),this.scheduleGc()),Z(this,no).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||gt(this,vo,Pi).call(this,{type:"invalidate"})}async fetch(t,n){var f,h,p,y,x,b,S,E,C,R,T,O;if(this.state.fetchStatus!=="idle"&&((f=Z(this,Qn))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Z(this,Qn))return Z(this,Qn).continueRetry(),Z(this,Qn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const k=this.observers.find(M=>M.options.queryFn);k&&this.setOptions(k.options)}const r=new AbortController,s=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(He(this,qc,!0),r.signal)})},o=()=>{const k=MP(this.options,n),A=(()=>{const L={client:Z(this,Vc),queryKey:this.queryKey,meta:this.meta};return s(L),L})();return He(this,qc,!1),this.options.persister?this.options.persister(k,A,this):k(A)},c=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Z(this,Vc),state:this.state,fetchFn:o};return s(k),k})();(h=Z(this,Kd)==="infinite"?UV(this.options.pages):this.options.behavior)==null||h.onFetch(c,this),He(this,Yd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=c.fetchOptions)==null?void 0:p.meta))&>(this,vo,Pi).call(this,{type:"fetch",meta:(y=c.fetchOptions)==null?void 0:y.meta});const u=He(this,Qn,LP({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:k=>{k instanceof Bw&&k.revert&&this.setState({...Z(this,Yd),fetchStatus:"idle"}),r.abort()},onFail:(k,M)=>{gt(this,vo,Pi).call(this,{type:"failed",failureCount:k,error:M})},onPause:()=>{gt(this,vo,Pi).call(this,{type:"pause"})},onContinue:()=>{gt(this,vo,Pi).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const k=await u.start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(b=(x=Z(this,no).config).onSuccess)==null||b.call(x,k,this),(E=(S=Z(this,no).config).onSettled)==null||E.call(S,k,this.state.error,this),k}catch(k){if(k instanceof Bw){if(k.silent)return Z(this,Qn).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw gt(this,vo,Pi).call(this,{type:"error",error:k}),(R=(C=Z(this,no).config).onError)==null||R.call(C,k,this),(O=(T=Z(this,no).config).onSettled)==null||O.call(T,this.state.data,k,this),k}finally{Z(this,Qn)===u&&He(this,Qn,void 0),this.scheduleGc()}}},Kd=new WeakMap,Uc=new WeakMap,Yd=new WeakMap,no=new WeakMap,Vc=new WeakMap,Qn=new WeakMap,tm=new WeakMap,qc=new WeakMap,vo=new WeakSet,Pi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...jP(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...Gk(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return He(this,Yd,t.manual?s:void 0),s;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Zn.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),Z(this,no).notify({query:this,type:"updated",action:t})})},vP);function jP(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:IP(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Gk(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Kk(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Qr,At,nm,Zr,Gc,Wd,Hi,rm,Xd,Qd,Kc,Yc,ma,Zd,Bt,Vh,Hw,Fw,$w,Uw,Vw,qw,Gw,Kw,SP,PP=(SP=class extends Tf{constructor(t,n){super();Qe(this,Bt);Qe(this,Qr);Qe(this,At);Qe(this,nm);Qe(this,Zr);Qe(this,Gc);Qe(this,Wd);Qe(this,Hi);Qe(this,rm);Qe(this,Xd);Qe(this,Qd);Qe(this,Kc);Qe(this,Yc);Qe(this,ma);Qe(this,Zd,new Set);this.options=n,He(this,Qr,t),He(this,Hi,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Z(this,At).addObserver(this),Yk(Z(this,At),this.options)?gt(this,Bt,Vh).call(this):this.updateResult(),gt(this,Bt,Vw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Yw(Z(this,At),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Yw(Z(this,At),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,gt(this,Bt,qw).call(this),gt(this,Bt,Gw).call(this),Z(this,At).removeObserver(this)}setOptions(t){const n=this.options,r=Z(this,At);if(this.options=Z(this,Qr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof fn(this.options.enabled,Z(this,At))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");gt(this,Bt,Kw).call(this),Z(this,At).setOptions(this.options),n._defaulted&&!ay(this.options,n)&&Z(this,Qr).getQueryCache().notify({type:"observerOptionsUpdated",query:Z(this,At),observer:this});const s=this.hasListeners();s&&Wk(Z(this,At),r,this.options,n)&>(this,Bt,Vh).call(this),this.updateResult(),s&&(Z(this,At)!==r||fn(this.options.enabled,Z(this,At))!==fn(n.enabled,Z(this,At))||fn(this.options.staleTime,Z(this,At))!==fn(n.staleTime,Z(this,At)))&>(this,Bt,Fw).call(this);const o=gt(this,Bt,$w).call(this);s&&(Z(this,At)!==r||fn(this.options.enabled,Z(this,At))!==fn(n.enabled,Z(this,At))||o!==Z(this,ma))&>(this,Bt,Uw).call(this,o)}getOptimisticResult(t){const n=Z(this,Qr).getQueryCache().build(Z(this,Qr),t),r=this.createResult(n,t);return ay(this.getCurrentResult(),r)||(He(this,Zr,r),He(this,Wd,this.options),He(this,Gc,Z(this,At).state)),r}getCurrentResult(){return Z(this,Zr)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),Reflect.get(r,s))})}trackProp(t){Z(this,Zd).add(t)}getCurrentQuery(){return Z(this,At)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Z(this,Qr).defaultQueryOptions(t),r=Z(this,Qr).getQueryCache().build(Z(this,Qr),n);let s=()=>{},o;const l=new Promise(c=>{o=c,s=Z(this,Qr).getQueryCache().subscribe(u=>{u.type==="updated"&&u.query.queryHash===r.queryHash&&r.state.data!==void 0&&(s(),c(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const c=this.createResult(r,n);return o==null||o(c),c}).finally(()=>{s()}),l])}fetch(t){return gt(this,Bt,Vh).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Z(this,Zr)))}createResult(t,n){var M;const r=Z(this,At),s=this.options,o=Z(this,Zr),l=Z(this,Gc),c=Z(this,Wd),u=t!==r?t.state:Z(this,nm),{state:f}=t;let h={...f},p=!1,y;if(n._optimisticResults){const A=this.hasListeners(),L=!A&&Yk(t,n),I=A&&Wk(t,r,n,s);(L||I)&&(h={...h,...jP(f.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:x,errorUpdatedAt:b,status:S}=h;y=h.data;let E=!1;if(n.placeholderData!==void 0&&y===void 0&&S==="pending"){let A;o!=null&&o.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(A=o.data,E=!0):A=typeof n.placeholderData=="function"?n.placeholderData((M=Z(this,Qd))==null?void 0:M.state.data,Z(this,Qd)):n.placeholderData,A!==void 0&&(S="success",y=zw(o==null?void 0:o.data,A,n),p=!0)}if(n.select&&y!==void 0&&!E)if(o&&y===(l==null?void 0:l.data)&&n.select===Z(this,rm))y=Z(this,Xd);else try{He(this,rm,n.select),y=n.select(y),y=zw(o==null?void 0:o.data,y,n),He(this,Xd,y),He(this,Hi,null)}catch(A){He(this,Hi,A)}else y===void 0&&He(this,Hi,null);Z(this,Hi)&&(x=Z(this,Hi),y=Z(this,Xd),b=Date.now(),S="error",p=!1);const C=h.fetchStatus==="fetching",R=S==="pending",T=S==="error",O=R&&C,k=y!==void 0;return{status:S,fetchStatus:h.fetchStatus,isPending:R,isSuccess:S==="success",isError:T,isInitialLoading:O,isLoading:O,data:y,dataUpdatedAt:h.dataUpdatedAt,error:x,errorUpdatedAt:b,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:C,isRefetching:C&&!R,isLoadingError:T&&!k,isPaused:h.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:T&&k,isStale:o2(t,n),refetch:this.refetch,isEnabled:fn(n.enabled,t)!==!1}}updateResult(){const t=Z(this,Zr),n=this.createResult(Z(this,At),this.options);if(He(this,Gc,Z(this,At).state),He(this,Wd,this.options),Z(this,Gc).data!==void 0&&He(this,Qd,Z(this,At)),ay(n,t))return;He(this,Zr,n);const s=(()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!Z(this,Zd).size)return!0;const c=new Set(l??Z(this,Zd));return this.options.throwOnError&&c.add("error"),Object.keys(Z(this,Zr)).some(u=>{const f=u;return Z(this,Zr)[f]!==t[f]&&c.has(f)})})();Zn.batch(()=>{s&&this.listeners.forEach(o=>{o(Z(this,Zr))}),Z(this,Qr).getQueryCache().notify({query:Z(this,At),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&>(this,Bt,Vw).call(this)}},Qr=new WeakMap,At=new WeakMap,nm=new WeakMap,Zr=new WeakMap,Gc=new WeakMap,Wd=new WeakMap,Hi=new WeakMap,rm=new WeakMap,Xd=new WeakMap,Qd=new WeakMap,Kc=new WeakMap,Yc=new WeakMap,ma=new WeakMap,Zd=new WeakMap,Bt=new WeakSet,Vh=function(t){gt(this,Bt,Kw).call(this);let n=Z(this,At).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Jr)),n},Hw=function(t){return!r2()&&fn(this.options.enabled,Z(this,At))!==!1&&AP(t)},Fw=function(){gt(this,Bt,qw).call(this);const t=fn(this.options.staleTime,Z(this,At));if(Z(this,Zr).isStale||!gt(this,Bt,Hw).call(this,t))return;const n=kP(Z(this,Zr).dataUpdatedAt,t)+1;He(this,Kc,Lc.setTimeout(()=>{Z(this,Zr).isStale||this.updateResult()},n))},$w=function(){return fn(this.options.refetchInterval,Z(this,At))??!1},Uw=function(t){gt(this,Bt,Gw).call(this),He(this,ma,t),!(Z(this,ma)===0||!gt(this,Bt,Hw).call(this,Z(this,ma)))&&He(this,Yc,Lc.setInterval(()=>{(this.options.refetchIntervalInBackground||s2.isFocused())&>(this,Bt,Vh).call(this)},Z(this,ma)))},Vw=function(){gt(this,Bt,Fw).call(this),gt(this,Bt,Uw).call(this,gt(this,Bt,$w).call(this))},qw=function(){Z(this,Kc)!==void 0&&(Lc.clearTimeout(Z(this,Kc)),He(this,Kc,void 0))},Gw=function(){Z(this,Yc)!==void 0&&(Lc.clearInterval(Z(this,Yc)),He(this,Yc,void 0))},Kw=function(){const t=Z(this,Qr).getQueryCache().build(Z(this,Qr),this.options);if(t===Z(this,At))return;const n=Z(this,At);He(this,At,t),He(this,nm,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},SP);function GV(e,t){return fn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&fn(t.retryOnMount,e)===!1)}function Yk(e,t){return GV(e,t)||e.state.data!==void 0&&Yw(e,t,t.refetchOnMount)}function Yw(e,t,n){if(fn(t.enabled,e)!==!1&&fn(t.staleTime,e)!=="static"){const r=fn(n,e);return r==="always"||r!==!1&&o2(e,t)}return!1}function Wk(e,t,n,r){return(e!==t||fn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&o2(e,n)}function o2(e,t){return fn(t.enabled,e)!==!1&&e.isStaleByTime(fn(t.staleTime,e))}var sm,Zo,Ir,Wc,Jo,sa,wP,KV=(wP=class extends DP{constructor(t){super();Qe(this,Jo);Qe(this,sm);Qe(this,Zo);Qe(this,Ir);Qe(this,Wc);He(this,sm,t.client),this.mutationId=t.mutationId,He(this,Ir,t.mutationCache),He(this,Zo,[]),this.state=t.state||zP(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Z(this,Zo).includes(t)||(Z(this,Zo).push(t),this.clearGcTimeout(),Z(this,Ir).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){He(this,Zo,Z(this,Zo).filter(n=>n!==t)),this.scheduleGc(),Z(this,Ir).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Z(this,Zo).length||(this.state.status==="pending"?this.scheduleGc():Z(this,Ir).remove(this))}continue(){var t;return((t=Z(this,Wc))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var c,u,f,h,p,y,x,b,S,E,C,R,T,O,k,M,A,L;const n=()=>{gt(this,Jo,sa).call(this,{type:"continue"})},r={client:Z(this,sm),meta:this.options.meta,mutationKey:this.options.mutationKey},s=He(this,Wc,LP({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(I,j)=>{gt(this,Jo,sa).call(this,{type:"failed",failureCount:I,error:j})},onPause:()=>{gt(this,Jo,sa).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Z(this,Ir).canRun(this)})),o=this.state.status==="pending",l=!s.canStart();try{if(o)n();else{gt(this,Jo,sa).call(this,{type:"pending",variables:t,isPaused:l}),Z(this,Ir).config.onMutate&&await Z(this,Ir).config.onMutate(t,this,r);const j=await((u=(c=this.options).onMutate)==null?void 0:u.call(c,t,r));j!==this.state.context&>(this,Jo,sa).call(this,{type:"pending",context:j,variables:t,isPaused:l})}const I=await s.start();return await((h=(f=Z(this,Ir).config).onSuccess)==null?void 0:h.call(f,I,t,this.state.context,this,r)),await((y=(p=this.options).onSuccess)==null?void 0:y.call(p,I,t,this.state.context,r)),await((b=(x=Z(this,Ir).config).onSettled)==null?void 0:b.call(x,I,null,this.state.variables,this.state.context,this,r)),await((E=(S=this.options).onSettled)==null?void 0:E.call(S,I,null,t,this.state.context,r)),gt(this,Jo,sa).call(this,{type:"success",data:I}),I}catch(I){try{await((R=(C=Z(this,Ir).config).onError)==null?void 0:R.call(C,I,t,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((O=(T=this.options).onError)==null?void 0:O.call(T,I,t,this.state.context,r))}catch(j){Promise.reject(j)}try{await((M=(k=Z(this,Ir).config).onSettled)==null?void 0:M.call(k,void 0,I,this.state.variables,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((L=(A=this.options).onSettled)==null?void 0:L.call(A,void 0,I,t,this.state.context,r))}catch(j){Promise.reject(j)}throw gt(this,Jo,sa).call(this,{type:"error",error:I}),I}finally{Z(this,Wc)===s&&He(this,Wc,void 0),Z(this,Ir).runNext(this)}}},sm=new WeakMap,Zo=new WeakMap,Ir=new WeakMap,Wc=new WeakMap,Jo=new WeakSet,sa=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Zn.batch(()=>{Z(this,Zo).forEach(r=>{r.onMutationUpdate(t)}),Z(this,Ir).notify({mutation:this,type:"updated",action:t})})},wP);function zP(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Fi,So,om,EP,YV=(EP=class extends Tf{constructor(t={}){super();Qe(this,Fi);Qe(this,So);Qe(this,om);this.config=t,He(this,Fi,new Set),He(this,So,new Map),He(this,om,0)}build(t,n,r){const s=new KV({client:t,mutationCache:this,mutationId:++m0(this,om)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){Z(this,Fi).add(t);const n=g0(t);if(typeof n=="string"){const r=Z(this,So).get(n);r?r.push(t):Z(this,So).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Z(this,Fi).delete(t)){const n=g0(t);if(typeof n=="string"){const r=Z(this,So).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&Z(this,So).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=g0(t);if(typeof n=="string"){const s=(r=Z(this,So).get(n))==null?void 0:r.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r,s;const n=g0(t);return typeof n=="string"?((s=(r=Z(this,So).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused))==null?void 0:s.continue())??Promise.resolve():Promise.resolve()}clear(){Zn.batch(()=>{Z(this,Fi).forEach(t=>{this.notify({type:"removed",mutation:t})}),Z(this,Fi).clear(),Z(this,So).clear()})}getAll(){return Array.from(Z(this,Fi))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>$k(n,r))}findAll(t={}){return this.getAll().filter(n=>$k(t,n))}notify(t){Zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Zn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Jr))))}},Fi=new WeakMap,So=new WeakMap,om=new WeakMap,EP);function g0(e){var t;return(t=e.options.scope)==null?void 0:t.id}var $i,ga,Lr,Ui,ii,qh,Ww,CP,WV=(CP=class extends Tf{constructor(n,r){super();Qe(this,ii);Qe(this,$i);Qe(this,ga);Qe(this,Lr);Qe(this,Ui);He(this,$i,n),this.setOptions(r),this.bindMethods(),gt(this,ii,qh).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=Z(this,$i).defaultMutationOptions(n),ay(this.options,r)||Z(this,$i).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Z(this,Lr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Da(r.mutationKey)!==Da(this.options.mutationKey)?this.reset():((s=Z(this,Lr))==null?void 0:s.state.status)==="pending"&&Z(this,Lr).setOptions(this.options)}onSubscribe(){this.listeners.size===1&&Z(this,Lr)&&(Z(this,Lr).addObserver(this),gt(this,ii,qh).call(this))}onUnsubscribe(){var n;this.hasListeners()||(n=Z(this,Lr))==null||n.removeObserver(this)}onMutationUpdate(n){gt(this,ii,qh).call(this),gt(this,ii,Ww).call(this,n)}getCurrentResult(){return Z(this,ga)}reset(){var n;(n=Z(this,Lr))==null||n.removeObserver(this),He(this,Lr,void 0),gt(this,ii,qh).call(this),gt(this,ii,Ww).call(this)}mutate(n,r){var s;return He(this,Ui,r),(s=Z(this,Lr))==null||s.removeObserver(this),He(this,Lr,Z(this,$i).getMutationCache().build(Z(this,$i),this.options)),Z(this,Lr).addObserver(this),Z(this,Lr).execute(n)}},$i=new WeakMap,ga=new WeakMap,Lr=new WeakMap,Ui=new WeakMap,ii=new WeakSet,qh=function(){var r;const n=((r=Z(this,Lr))==null?void 0:r.state)??zP();He(this,ga,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Ww=function(n){Zn.batch(()=>{var r,s,o,l,c,u,f,h;if(Z(this,Ui)&&this.hasListeners()){const p=Z(this,ga).variables,y=Z(this,ga).context,x={client:Z(this,$i),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(r=Z(this,Ui)).onSuccess)==null||s.call(r,n.data,p,y,x)}catch(b){Promise.reject(b)}try{(l=(o=Z(this,Ui)).onSettled)==null||l.call(o,n.data,null,p,y,x)}catch(b){Promise.reject(b)}}else if((n==null?void 0:n.type)==="error"){try{(u=(c=Z(this,Ui)).onError)==null||u.call(c,n.error,p,y,x)}catch(b){Promise.reject(b)}try{(h=(f=Z(this,Ui)).onSettled)==null||h.call(f,void 0,n.error,p,y,x)}catch(b){Promise.reject(b)}}}this.listeners.forEach(p=>{p(Z(this,ga))})})},CP),ei,TP,XV=(TP=class extends Tf{constructor(t={}){super();Qe(this,ei);this.config=t,He(this,ei,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??t2(s,n);let l=this.get(o);return l||(l=new qV({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(l)),l}add(t){Z(this,ei).has(t.queryHash)||(Z(this,ei).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){Z(this,ei).get(t.queryHash)===t&&(t.destroy(),Z(this,ei).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Zn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Z(this,ei).get(t)}getAll(){return[...Z(this,ei).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Fk(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Fk(t,r)):n}notify(t){Zn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Zn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Zn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},ei=new WeakMap,TP),Sn,ya,xa,Jd,ef,ba,tf,nf,NP,QV=(NP=class{constructor(e={}){Qe(this,Sn);Qe(this,ya);Qe(this,xa);Qe(this,Jd);Qe(this,ef);Qe(this,ba);Qe(this,tf);Qe(this,nf);He(this,Sn,e.queryCache||new XV),He(this,ya,e.mutationCache||new YV),He(this,xa,e.defaultOptions||{}),He(this,Jd,new Map),He(this,ef,new Map),He(this,ba,0)}mount(){m0(this,ba)._++,Z(this,ba)===1&&(He(this,tf,s2.subscribe(async e=>{e&&(await this.resumePausedMutations(),Z(this,Sn).onFocus())})),He(this,nf,_y.subscribe(async e=>{e&&(await this.resumePausedMutations(),Z(this,Sn).onOnline())})))}unmount(){var e,t;m0(this,ba)._--,Z(this,ba)===0&&((e=Z(this,tf))==null||e.call(this),He(this,tf,void 0),(t=Z(this,nf))==null||t.call(this),He(this,nf,void 0))}isFetching(e){return Z(this,Sn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Z(this,ya).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Z(this,Sn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Z(this,Sn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(fn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Z(this,Sn).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var l;const r=this.defaultQueryOptions({queryKey:e}),s=(l=Z(this,Sn).get(r.queryHash))==null?void 0:l.state.data,o=_V(t,s);if(o!==void 0)return Z(this,Sn).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Zn.batch(()=>Z(this,Sn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Z(this,Sn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Z(this,Sn);Zn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Z(this,Sn);return Zn.batch(()=>{const r=n.findAll(e),s=new Set(r);return r.forEach(o=>{o.reset()}),this.refetchQueries({type:"active",predicate:o=>s.has(o)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},r=Zn.batch(()=>Z(this,Sn).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Jr).catch(Jr)}invalidateQueries(e,t={}){return Zn.batch(()=>(Z(this,Sn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Zn.batch(()=>Z(this,Sn).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(Jr)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Jr)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Z(this,Sn).build(this,t),r=n.isStaleByTime(fn(t.staleTime,n))?await n.fetch(t):n.state.data,s=t.select;return s?s(r):r}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Z(this,Sn).build(this,t);return n.isStaleByTime(fn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jr).catch(Jr)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jr).catch(Jr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return _y.isOnline()?Z(this,ya).resumePausedMutations():Promise.resolve()}getQueryCache(){return Z(this,Sn)}getMutationCache(){return Z(this,ya)}getDefaultOptions(){return Z(this,xa)}setDefaultOptions(e){He(this,xa,e)}setQueryDefaults(e,t){Z(this,Jd).set(Da(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Z(this,Jd).values()],n={};return t.forEach(r=>{rf(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Z(this,ef).set(Da(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Z(this,ef).values()],n={};return t.forEach(r=>{rf(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Z(this,xa).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=t2(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ao&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Z(this,xa).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Z(this,Sn).clear(),Z(this,ya).clear()}},Sn=new WeakMap,ya=new WeakMap,xa=new WeakMap,Jd=new WeakMap,ef=new WeakMap,ba=new WeakMap,tf=new WeakMap,nf=new WeakMap,NP);const BP=N.createContext(!1),ZV=()=>N.useContext(BP);BP.Provider;function JV(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const eq=N.createContext(JV()),tq=()=>N.useContext(eq),nq=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?n2(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},rq=e=>{N.useEffect(()=>{e.clearReset()},[e])},sq=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||n2(n,[e.error,r])),oq=(e,t)=>t.state.data===void 0,iq=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},lq=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,aq=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function HP(e,t,n){const r=ZV(),s=tq(),o=_o(),l=o.defaultQueryOptions(e),c=o.getQueryCache().get(l.queryHash),u=e.subscribed!==!1;l._optimisticResults=r?"isRestoring":u?"optimistic":void 0,iq(l),nq(l,s,c),rq(s);const[f]=N.useState(()=>new t(o,l)),h=f.getOptimisticResult(l),p=!r&&u;if(N.useSyncExternalStore(N.useCallback(y=>{const x=p?f.subscribe(Zn.batchCalls(y)):Jr;return f.updateResult(),x},[f,p]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),N.useEffect(()=>{f.setOptions(l)},[l,f]),lq(l,h))throw aq(l,f,s);if(sq({result:h,errorResetBoundary:s,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw h.error;return l.notifyOnChangeProps?h:f.trackResult(h)}function Ga(e,t){return HP(e,PP)}function cq(e,t){return HP({...e,enabled:!0,suspense:!0,throwOnError:oq,placeholderData:void 0},PP)}function kn(e,t){const n=_o(),[r]=N.useState(()=>new WV(n,e));N.useEffect(()=>{r.setOptions(e)},[r,e]);const s=N.useSyncExternalStore(N.useCallback(l=>r.subscribe(Zn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=N.useCallback((...l)=>{r.mutate(l[0],l[1]).catch(Jr)},[r]);if(s.error&&n2(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}var h1={exports:{}},kh={},p1={exports:{}},m1={};/**
|
|
19
|
-
* @license React
|
|
20
|
-
* scheduler.production.js
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var Xk;function uq(){return Xk||(Xk=1,(function(e){function t(z,q){var V=z.length;z.push(q);e:for(;0<V;){var G=V-1>>>1,K=z[G];if(0<s(K,q))z[G]=q,z[V]=K,V=G;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var q=z[0],V=z.pop();if(V!==q){z[0]=V;e:for(var G=0,K=z.length,X=K>>>1;G<X;){var ee=2*(G+1)-1,ae=z[ee],$=ee+1,Y=z[$];if(0>s(ae,V))$<K&&0>s(Y,ae)?(z[G]=Y,z[$]=V,G=$):(z[G]=ae,z[ee]=V,G=ee);else if($<K&&0>s(Y,V))z[G]=Y,z[$]=V,G=$;else break e}}return q}function s(z,q){var V=z.sortIndex-q.sortIndex;return V!==0?V:z.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var u=[],f=[],h=1,p=null,y=3,x=!1,b=!1,S=!1,E=!1,C=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function O(z){for(var q=n(f);q!==null;){if(q.callback===null)r(f);else if(q.startTime<=z)r(f),q.sortIndex=q.expirationTime,t(u,q);else break;q=n(f)}}function k(z){if(S=!1,O(z),!b)if(n(u)!==null)b=!0,M||(M=!0,B());else{var q=n(f);q!==null&&F(k,q.startTime-z)}}var M=!1,A=-1,L=5,I=-1;function j(){return E?!0:!(e.unstable_now()-I<L)}function P(){if(E=!1,M){var z=e.unstable_now();I=z;var q=!0;try{e:{b=!1,S&&(S=!1,R(A),A=-1),x=!0;var V=y;try{t:{for(O(z),p=n(u);p!==null&&!(p.expirationTime>z&&j());){var G=p.callback;if(typeof G=="function"){p.callback=null,y=p.priorityLevel;var K=G(p.expirationTime<=z);if(z=e.unstable_now(),typeof K=="function"){p.callback=K,O(z),q=!0;break t}p===n(u)&&r(u),O(z)}else r(u);p=n(u)}if(p!==null)q=!0;else{var X=n(f);X!==null&&F(k,X.startTime-z),q=!1}}break e}finally{p=null,y=V,x=!1}q=void 0}}finally{q?B():M=!1}}}var B;if(typeof T=="function")B=function(){T(P)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,D=H.port2;H.port1.onmessage=P,B=function(){D.postMessage(null)}}else B=function(){C(P,0)};function F(z,q){A=C(function(){z(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(z){switch(y){case 1:case 2:case 3:var q=3;break;default:q=y}var V=y;y=q;try{return z()}finally{y=V}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(z,q){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var V=y;y=z;try{return q()}finally{y=V}},e.unstable_scheduleCallback=function(z,q,V){var G=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?G+V:G):V=G,z){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=V+K,z={id:h++,callback:q,priorityLevel:z,startTime:V,expirationTime:K,sortIndex:-1},V>G?(z.sortIndex=V,t(f,z),n(u)===null&&z===n(f)&&(S?(R(A),A=-1):S=!0,F(k,V-G))):(z.sortIndex=K,t(u,z),b||x||(b=!0,M||(M=!0,B()))),z},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(z){var q=y;return function(){var V=y;y=q;try{return z.apply(this,arguments)}finally{y=V}}}})(m1)),m1}var Qk;function dq(){return Qk||(Qk=1,p1.exports=uq()),p1.exports}var g1={exports:{}},vr={};/**
|
|
27
|
-
* @license React
|
|
28
|
-
* react-dom.production.js
|
|
29
|
-
*
|
|
30
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the MIT license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var Zk;function fq(){if(Zk)return vr;Zk=1;var e=im();function t(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal"),o=Symbol.for("react.recoverable"),l=Symbol.for("react.optimistic_key");function c(h,p,y){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:x==null?null:x===l?l:""+x,children:h,containerInfo:p,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return vr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,vr.browser=function(h){return{$$typeof:o,_reason:h}},vr.createPortal=function(h,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return c(h,p,null,y)},vr.flushSync=function(h){var p=u.T,y=r.p;try{if(u.T=null,r.p=2,h)return h()}finally{u.T=p,r.p=y,r.d.f()}},vr.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(h,p))},vr.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},vr.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var y=p.as,x=f(y,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?r.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:x,integrity:b,fetchPriority:S}):y==="script"&&r.d.X(h,{crossOrigin:x,integrity:b,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},vr.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=f(p.as,p.crossOrigin);r.d.M(h,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}}else p==null&&r.d.M(h)},vr.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,x=f(y,p.crossOrigin);r.d.L(h,y,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},vr.preloadModule=function(h,p){if(typeof h=="string")if(p){var y=f(p.as,p.crossOrigin);r.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0})}else r.d.m(h)},vr.requestFormReset=function(h){r.d.r(h)},vr.unstable_batchedUpdates=function(h,p){return h(p)},vr.useFormState=function(h,p,y){return u.H.useFormState(h,p,y)},vr.useFormStatus=function(){return u.H.useHostTransitionStatus()},vr.version="19.3.0",vr}var Jk;function FP(){if(Jk)return g1.exports;Jk=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),g1.exports=fq(),g1.exports}/**
|
|
35
|
-
* @license React
|
|
36
|
-
* react-dom-client.production.js
|
|
37
|
-
*
|
|
38
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the MIT license found in the
|
|
41
|
-
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/var e_;function hq(){if(e_)return kh;e_=1;var e=dq(),t=im(),n=FP();function r(i){var a="https://react.dev/errors/"+i;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)a+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+i+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){for(var a=i,d=a;d&&!d.alternate;)a=d,(a.flags&4098)!==0&&(i=a.return),d=a.return;for(;a.return;)a=a.return;return a.tag===3?i:null}function l(i){if(i.tag===13){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function c(i){if(i.tag===31){var a=i.memoizedState;if(a===null&&(i=i.alternate,i!==null&&(a=i.memoizedState)),a!==null)return a.dehydrated}return null}function u(i){if(o(i)!==i)throw Error(r(188))}function f(i){var a=i.alternate;if(!a){if(a=o(i),a===null)throw Error(r(188));return a!==i?null:i}for(var d=i,m=a;;){var v=d.return;if(v===null)break;var w=v.alternate;if(w===null){if(m=v.return,m!==null){d=m;continue}break}if(v.child===w.child){for(w=v.child;w;){if(w===d)return u(v),i;if(w===m)return u(v),a;w=w.sibling}throw Error(r(188))}if(d.return!==m.return)d=v,m=w;else{for(var _=!1,U=v.child;U;){if(U===d){_=!0,d=v,m=w;break}if(U===m){_=!0,m=v,d=w;break}U=U.sibling}if(!_){for(U=w.child;U;){if(U===d){_=!0,d=w,m=v;break}if(U===m){_=!0,m=w,d=v;break}U=U.sibling}if(!_)throw Error(r(189))}}if(d.alternate!==m)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?i:a}function h(i){var a=i.tag;if(a===5||a===26||a===27||a===6)return i;for(i=i.child;i!==null;){if(a=h(i),a!==null)return a;i=i.sibling}return null}function p(i,a,d,m,v,w){for(;i!==null;){if((i.tag===5||i.tag===27||i.tag===6)&&d(i,m,v,w)||(i.tag!==22||i.memoizedState===null)&&(a||i.tag!==5&&i.tag!==27)&&p(i.child,a,d,m,v,w))return!0;i=i.sibling}return!1}function y(i){for(i=i.return;i!==null;){if(i.tag===3||i.tag===5||i.tag===27)return i;i=i.return}return null}function x(i){var a=!1;for(i=i.return;i!==null&&(i.tag===4&&(a=!0),!(i.tag===3||i.tag===5||i.tag===27));)i=i.return;return a}function b(i){var a=[null,null],d=y(i);return d===null||S(a,i,d.child,{foundSelf:!1}),a}function S(i,a,d,m){for(;d!==null;){if(d===a)m.foundSelf=!0;else if(d.tag===5||d.tag===27||d.tag===6){if(m.foundSelf)return i[1]=d,!0;i[0]=d}else if((d.tag!==22||d.memoizedState===null)&&S(i,a,d.child,m))return!0;d=d.sibling}return!1}function E(i){switch(i.tag){case 5:case 27:case 6:return i.stateNode;case 3:return i.stateNode.containerInfo;default:throw Error(r(559))}}var C=null,R=null;function T(i,a,d){return i===d?!0:i===a?(C=i,!0):!1}function O(i,a,d){return i===d?(R=i,!1):i===a?(R!==null&&(C=i),!0):!1}function k(i){if(i===null)return null;do i=i===null?null:i.return;while(i&&i.tag!==5&&i.tag!==27&&i.tag!==3);return i||null}function M(i,a,d){for(var m=0,v=i;v;v=d(v))m++;v=0;for(var w=a;w;w=d(w))v++;for(;0<m-v;)i=d(i),m--;for(;0<v-m;)a=d(a),v--;for(;m--;){if(i===a||a!==null&&i===a.alternate)return i;i=d(i),a=d(a)}return null}var A=Object.assign,L=Symbol.for("react.element"),I=Symbol.for("react.transitional.element"),j=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),F=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),q=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),ee=Symbol.for("react.legacy_hidden"),ae=Symbol.for("react.memo_cache_sentinel"),$=Symbol.for("react.view_transition"),Y=Symbol.for("react.recoverable"),J=Symbol.iterator;function ne(i){return i===null||typeof i!="object"?null:(i=J&&i[J]||i["@@iterator"],typeof i=="function"?i:null)}var W=Symbol.for("react.client.reference");function ce(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===W?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case P:return"Fragment";case H:return"Profiler";case B:return"StrictMode";case q:return"Suspense";case V:return"SuspenseList";case X:return"Activity";case $:return"ViewTransition"}if(typeof i=="object")switch(i.$$typeof){case j:return"Portal";case F:return i.displayName||"Context";case D:return(i._context.displayName||"Context")+".Consumer";case z:var a=i.render;return i=i.displayName,i||(i=a.displayName||a.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case G:return a=i.displayName||null,a!==null?a:ce(i.type)||"Memo";case K:a=i._payload,i=i._init;try{return ce(i(a))}catch{}}return null}var ye=Array.isArray,pe=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re={pending:!1,data:null,method:null,action:null},he=[],Se=-1;function _e(i){return{current:i}}function be(i){0>Se||(i.current=he[Se],he[Se]=null,Se--)}function Ae(i,a){Se++,he[Se]=i.current,i.current=a}var Me=_e(null),Le=_e(null),ue=_e(null),Re=_e(null);function ze(i,a){switch(Ae(ue,a),Ae(Le,i),Ae(Me,null),a.nodeType){case 9:case 11:i=(i=a.documentElement)&&(i=i.namespaceURI)?qA(i):0;break;default:if(i=a.tagName,a=a.namespaceURI)a=qA(a),i=GA(a,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}be(Me),Ae(Me,i)}function ke(){be(Me),be(Le),be(ue)}function je(i){var a=i.memoizedState;a!==null&&(ud._currentValue=a.memoizedState,Ae(Re,i)),a=Me.current;var d=GA(a,i.type);a!==d&&(Ae(Le,i),Ae(Me,d))}function Ne(i){Le.current===i&&(be(Me),be(Le)),Re.current===i&&(be(Re),ud._currentValue=re)}var ve,Fe;function Ye(i){if(ve===void 0)try{throw Error()}catch(d){var a=d.stack.trim().match(/\n( *(at )?)/);ve=a&&a[1]||"",Fe=-1<d.stack.indexOf(`
|
|
43
|
-
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+ve+i+Fe}var xt=!1;function nn(i,a){if(!i||xt)return"";xt=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(a){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(Pe){var se=Pe}Reflect.construct(i,[],Ee)}else{try{Ee.call()}catch(Pe){se=Pe}Ee=!1;try{var fe=Object.getOwnPropertyDescriptor(i.prototype,"props");Object.defineProperty(i.prototype,"props",{configurable:!0,set:function(){throw Error()}}),Ee=!0,new i}finally{Ee&&(fe!==void 0?Object.defineProperty(i.prototype,"props",fe):delete i.prototype.props)}}}else{try{throw Error()}catch(Pe){se=Pe}(Ee=i())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(Pe){if(Pe&&se&&typeof Pe.stack=="string")return[Pe.stack,se.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=m.DetermineComponentFrameRoot(),_=w[0],U=w[1];if(_&&U){var Q=_.split(`
|
|
45
|
-
`),ie=U.split(`
|
|
46
|
-
`);for(v=m=0;m<Q.length&&!Q[m].includes("DetermineComponentFrameRoot");)m++;for(;v<ie.length&&!ie[v].includes("DetermineComponentFrameRoot");)v++;if(m===Q.length||v===ie.length)for(m=Q.length-1,v=ie.length-1;1<=m&&0<=v&&Q[m]!==ie[v];)v--;for(;1<=m&&0<=v;m--,v--)if(Q[m]!==ie[v]){if(m!==1||v!==1)do if(m--,v--,0>v||Q[m]!==ie[v]){var ge=`
|
|
47
|
-
`+Q[m].replace(" at new "," at ");return i.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",i.displayName)),ge}while(1<=m&&0<=v);break}}}finally{xt=!1,Error.prepareStackTrace=d}return(d=i?i.displayName||i.name:"")?Ye(d):""}function Ce(i,a){switch(i.tag){case 26:case 27:case 5:return Ye(i.type);case 16:return Ye("Lazy");case 13:return i.child!==a&&a!==null?Ye("Suspense Fallback"):Ye("Suspense");case 19:return Ye("SuspenseList");case 0:case 15:return nn(i.type,!1);case 11:return nn(i.type.render,!1);case 1:return nn(i.type,!0);case 31:return Ye("Activity");case 30:return Ye("ViewTransition");default:return""}}function De(i){try{var a="",d=null;do a+=Ce(i,d),d=i,i=i.return;while(i);return a}catch(m){return`
|
|
48
|
-
Error generating stack: `+m.message+`
|
|
49
|
-
`+m.stack}}var tt=Object.prototype.hasOwnProperty,Ot=e.unstable_scheduleCallback,gn=e.unstable_cancelCallback,yn=e.unstable_shouldYield,Fr=e.unstable_requestPaint,cn=e.unstable_now,ar=e.unstable_getCurrentPriorityLevel,$r=e.unstable_ImmediatePriority,Es=e.unstable_UserBlockingPriority,qn=e.unstable_NormalPriority,yt=e.unstable_LowPriority,un=e.unstable_IdlePriority,Gn=e.log,Rn=e.unstable_setDisableYieldValue,On=null,Ht=null;function Zt(i){if(typeof Gn=="function"&&Rn(i),Ht&&typeof Ht.setStrictMode=="function")try{Ht.setStrictMode(On,i)}catch{}}var Jt=Math.clz32?Math.clz32:Ln,Ur=Math.log,Kn=Math.LN2;function Ln(i){return i>>>=0,i===0?32:31-(Ur(i)/Kn|0)|0}var cr=256,ur=262144,dr=4194304;function ls(i){var a=i&42;if(a!==0)return a;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&-i;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Ar(i,a,d){var m=i.pendingLanes;if(m===0)return 0;var v=0,w=i.suspendedLanes,_=i.pingedLanes;i=i.warmLanes;var U=m&134217727;return U!==0?(m=U&~w,m!==0?v=ls(m):(_&=U,_!==0?v=ls(_):d||(d=U&~i,d!==0&&(v=ls(d))))):(U=m&~w,U!==0?v=ls(U):_!==0?v=ls(_):d||(d=m&~i,d!==0&&(v=ls(d)))),v===0?0:a!==0&&a!==v&&(a&w)===0&&(w=v&-v,d=a&-a,w>=d||w===32&&(d&4194048)!==0)?a:v}function kr(i,a){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&a)===0}function as(i,a){(a&8)!==0&&(a|=a&32);var d=i.entangledLanes;if(d!==0)for(i=i.entanglements,d&=a;0<d;){var m=31-Jt(d),v=1<<m;a|=i[m],d&=~v}return a}function fo(i,a){switch(i){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function fr(){var i=dr;return dr<<=1,(dr&62914560)===0&&(dr=4194304),i}function Do(i){for(var a=[],d=0;31>d;d++)a.push(i);return a}function Cs(i,a){i.pendingLanes|=a,a!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function wl(i,a,d,m,v,w){var _=i.pendingLanes;i.pendingLanes=d,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=d,i.entangledLanes&=d,i.errorRecoveryDisabledLanes&=d,i.shellSuspendCounter=0;var U=i.entanglements,Q=i.expirationTimes,ie=i.hiddenUpdates;for(d=_&~d;0<d;){var ge=31-Jt(d),Ee=1<<ge;U[ge]=0,Q[ge]=-1;var se=ie[ge];if(se!==null)for(ie[ge]=null,ge=0;ge<se.length;ge++){var fe=se[ge];fe!==null&&(fe.lane&=-536870913)}d&=~Ee}m!==0&&Ts(i,m,0),w!==0&&v===0&&i.tag!==0&&(i.suspendedLanes|=w&~(_&~a))}function Ts(i,a,d){i.pendingLanes|=a,i.suspendedLanes&=~a;var m=31-Jt(a);i.entangledLanes|=a,i.entanglements[m]=i.entanglements[m]|1073741824|d&261930}function El(i,a){var d=i.entangledLanes|=a;for(i=i.entanglements;d;){var m=31-Jt(d),v=1<<m;v&a|i[m]&a&&(i[m]|=a),d&=~v}}function mi(i,a){var d=a&-a;return d=(d&42)!==0?1:ho(d),(d&(i.suspendedLanes|a))!==0?0:d}function ho(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function cs(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function us(){var i=le.p;return i!==0?i:(i=window.event,i===void 0?32:Ak(i.type))}function gi(i,a){var d=le.p;try{return le.p=i,a()}finally{le.p=d}}var xn=Math.random().toString(36).slice(2),on="__reactFiber$"+xn,Yn="__reactProps$"+xn,Vr="__reactContainer$"+xn,ec="__reactEvents$"+xn,yi="__reactListeners$"+xn,Cl="__reactHandles$"+xn,jo="__reactResources$"+xn,xi="__reactMarker$"+xn,Tl="__reactLoad$"+xn;function Nl(i){delete i[on],delete i[Yn],delete i[yi],delete i[Cl]}function Ns(i){var a;if(a=i[on])return a;for(var d=i.parentNode;d;){if(a=d[Vr]||d[on]){if(d=a.alternate,a.child!==null||d!==null&&d.child!==null)for(i=ck(i);i!==null;){if(d=i[on])return d;i=ck(i)}return a}i=d,d=i.parentNode}return null}function bi(i){if(i=i[on]||i[Vr]){var a=i.tag;if(a===5||a===6||a===13||a===31||a===26||a===27||a===3)return i}return null}function me(i){var a=i.tag;if(a===5||a===26||a===27||a===6)return i.stateNode;throw Error(r(33))}function Te(i){var a=i[jo];return a||(a=i[jo]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function Oe(i){i[xi]=!0}function Ke(i){i[Tl]=void 0}var lt=new Set,it={};function ut(i,a){Ft(i,a),Ft(i+"Capture",a)}function Ft(i,a){for(it[i]=a,i=0;i<a.length;i++)lt.add(a[i])}var Pt=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ze={},ft={};function Lt(i){return tt.call(ft,i)?!0:tt.call(Ze,i)?!1:Pt.test(i)?ft[i]=!0:(Ze[i]=!0,!1)}var rt=!1;function Wn(){var i=rt;return rt=!1,i}function bn(i,a,d){if(Lt(a))if(d===null)i.removeAttribute(a);else{switch(typeof d){case"undefined":case"function":case"symbol":i.removeAttribute(a);return;case"boolean":var m=a.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){i.removeAttribute(a);return}}i.setAttribute(a,d)}}function Rs(i,a,d){if(d===null)i.removeAttribute(a);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttribute(a,d)}}function Dn(i,a,d,m){if(m===null)i.removeAttribute(d);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(d);return}i.setAttributeNS(a,d,m)}}function jn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Ou(i){var a=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function zf(i,a,d){var m=Object.getOwnPropertyDescriptor(i.constructor.prototype,a);if(!i.hasOwnProperty(a)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var v=m.get,w=m.set;return Object.defineProperty(i,a,{configurable:!0,get:function(){return v.call(this)},set:function(_){d=""+_,w.call(this,_)}}),Object.defineProperty(i,a,{enumerable:m.enumerable}),{getValue:function(){return d},setValue:function(_){d=""+_},stopTracking:function(){i._valueTracker=null,delete i[a]}}}}function vi(i){if(!i._valueTracker){var a=Ou(i)?"checked":"value";i._valueTracker=zf(i,a,""+i[a])}}function Au(i){if(!i)return!1;var a=i._valueTracker;if(!a)return!0;var d=a.getValue(),m="";return i&&(m=Ou(i)?i.checked?"true":"false":i.value),i=m,i!==d?(a.setValue(i),!0):!1}var Qm=/[\n"\\]/g;function ln(i){return i.replace(Qm,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function _r(i,a,d,m,v,w,_,U){i.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?i.type=_:i.removeAttribute("type"),a!=null?_==="number"?(a===0&&i.value===""||i.value!=a)&&(i.value=""+jn(a)):i.value!==""+jn(a)&&(i.value=""+jn(a)):_!=="submit"&&_!=="reset"||i.removeAttribute("value"),a!=null?_==="number"&&i.value==a?ku(i,jn(i.value)):ku(i,jn(a)):d!=null?ku(i,jn(d)):m!=null&&i.removeAttribute("value"),v==null&&w!=null&&(i.defaultChecked=!!w),v!=null&&(i.checked=v&&typeof v!="function"&&typeof v!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?i.name=""+jn(U):i.removeAttribute("name")}function Rl(i,a,d,m,v,w,_,U){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.type=w),a!=null||d!=null){if(!(w!=="submit"&&w!=="reset"||a!=null)){vi(i);return}d=d!=null?""+jn(d):"",a=a!=null?""+jn(a):d,U||a===i.value||(i.value=a),i.defaultValue=a}m=m??v,m=typeof m!="function"&&typeof m!="symbol"&&!!m,i.checked=U?i.checked:!!m,i.defaultChecked=!!m,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(i.name=_),vi(i)}function ku(i,a){i.defaultValue!==""+a&&(i.defaultValue=""+a)}function ds(i,a,d,m){if(i=i.options,a){a={};for(var v=0;v<d.length;v++)a["$"+d[v]]=!0;for(d=0;d<i.length;d++)v=a.hasOwnProperty("$"+i[d].value),i[d].selected!==v&&(i[d].selected=v),v&&m&&(i[d].defaultSelected=!0)}else{for(d=""+jn(d),a=null,v=0;v<i.length;v++){if(i[v].value===d){i[v].selected=!0,m&&(i[v].defaultSelected=!0);return}a!==null||i[v].disabled||(a=i[v])}a!==null&&(a.selected=!0)}}function _u(i,a,d){if(a!=null&&(a=""+jn(a),a!==i.value&&(i.value=a),d==null)){i.defaultValue!==a&&(i.defaultValue=a);return}i.defaultValue=d!=null?""+jn(d):""}function Os(i,a,d,m){if(a==null){if(m!=null){if(d!=null)throw Error(r(92));if(ye(m)){if(1<m.length)throw Error(r(93));m=m[0]}d=m}d==null&&(d=""),a=d}d=jn(a),i.defaultValue=d,m=i.textContent,m===d&&m!==""&&m!==null&&(i.value=m),vi(i)}function qr(i,a){if(a){var d=i.firstChild;if(d&&d===i.lastChild&&d.nodeType===3){d.nodeValue=a;return}}i.textContent=a}var Ol=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Bf(i,a,d){var m=a.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?m?i.setProperty(a,""):a==="float"?i.cssFloat="":i[a]="":m?i.setProperty(a,d):typeof d!="number"||d===0||Ol.has(a)?a==="float"?i.cssFloat=d:i[a]=(""+d).trim():i[a]=d+"px"}function As(i,a,d){if(a!=null&&typeof a!="object")throw Error(r(62));if(i=i.style,d!=null){for(var m in d)!d.hasOwnProperty(m)||a!=null&&a.hasOwnProperty(m)||(m.indexOf("--")===0?i.setProperty(m,""):m==="float"?i.cssFloat="":i[m]="",rt=!0);for(var v in a)m=a[v],a.hasOwnProperty(v)&&d[v]!==m&&(Bf(i,v,m),rt=!0)}else for(var w in a)a.hasOwnProperty(w)&&Bf(i,w,a[w])}function tc(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Hf=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["maskType","mask-type"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ff=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function hr(i){return Ff.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Gr(){}var nc=null;function rc(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var kt=null,er=null;function Ks(i){var a=bi(i);if(a&&(i=a.stateNode)){var d=i[Yn]||null;e:switch(i=a.stateNode,a.type){case"input":if(_r(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),a=d.name,d.type==="radio"&&a!=null){for(d=i;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+ln(""+a)+'"][type="radio"]'),a=0;a<d.length;a++){var m=d[a];if(m!==i&&m.form===i.form){var v=m[Yn]||null;if(!v)throw Error(r(90));_r(m,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(a=0;a<d.length;a++)m=d[a],m.form===i.form&&Au(m)}break e;case"textarea":_u(i,d.value,d.defaultValue);break e;case"select":a=d.value,a!=null&&ds(i,!!d.multiple,a,!1)}}}var ks=!1;function sc(i,a,d){if(ks)return i(a,d);ks=!0;try{var m=i(a);return m}finally{if(ks=!1,(kt!==null||er!==null)&&(Qg(),kt&&(a=kt,i=er,er=kt=null,Ks(a),i)))for(a=0;a<i.length;a++)Ks(i[a])}}function Si(i,a){var d=i.stateNode;if(d===null)return null;var m=d[Yn]||null;if(m===null)return null;d=m[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(i=i.type,m=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!m;break e;default:i=!1}if(i)return null;if(d&&typeof d!="function")throw Error(r(231,a,typeof d));return d}var pr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oc=!1;if(pr)try{var $f={};Object.defineProperty($f,"passive",{get:function(){oc=!0}}),window.addEventListener("test",$f,$f),window.removeEventListener("test",$f,$f)}catch{oc=!1}var Al=null,Yb=null,Zm=null;function FN(){if(Zm)return Zm;var i,a=Yb,d=a.length,m,v="value"in Al?Al.value:Al.textContent,w=v.length;for(i=0;i<d&&a[i]===v[i];i++);var _=d-i;for(m=1;m<=_&&a[d-m]===v[w-m];m++);return Zm=v.slice(i,1<m?1-m:void 0)}function Jm(i){var a=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&a===13&&(i=13)):i=a,i===10&&(i=13),32<=i||i===13?i:0}function eg(){return!0}function $N(){return!1}function Kr(i){function a(d,m,v,w,_){this._reactName=d,this._targetInst=v,this.type=m,this.nativeEvent=w,this.target=_,this.currentTarget=null;for(var U in i)i.hasOwnProperty(U)&&(d=i[U],this[U]=d?d(w):w[U]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?eg:$N,this.isPropagationStopped=$N,this}return A(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=eg)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=eg)},persist:function(){},isPersistent:eg}),a}var kl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},tg=Kr(kl),Uf=A({},kl,{view:0,detail:0}),V7=Kr(Uf),Wb,Xb,Vf,ng=A({},Uf,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zb,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Vf&&(Vf&&i.type==="mousemove"?(Wb=i.screenX-Vf.screenX,Xb=i.screenY-Vf.screenY):Xb=Wb=0,Vf=i),Wb)},movementY:function(i){return"movementY"in i?i.movementY:Xb}}),UN=Kr(ng),q7=A({},ng,{dataTransfer:0}),G7=Kr(q7),K7=A({},Uf,{relatedTarget:0}),Qb=Kr(K7),Y7=A({},kl,{animationName:0,elapsedTime:0,pseudoElement:0}),W7=Kr(Y7),X7=A({},kl,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Q7=Kr(X7),Z7=A({},kl,{data:0}),VN=Kr(Z7),J7={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eU={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},tU={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nU(i){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(i):(i=tU[i])?!!a[i]:!1}function Zb(){return nU}var rU=A({},Uf,{key:function(i){if(i.key){var a=J7[i.key]||i.key;if(a!=="Unidentified")return a}return i.type==="keypress"?(i=Jm(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?eU[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zb,charCode:function(i){return i.type==="keypress"?Jm(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Jm(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),sU=Kr(rU),oU=A({},ng,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qN=Kr(oU),iU=A({},kl,{submitter:0}),lU=Kr(iU),aU=A({},Uf,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zb}),cU=Kr(aU),uU=A({},kl,{propertyName:0,elapsedTime:0,pseudoElement:0}),dU=Kr(uU),fU=A({},ng,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),hU=Kr(fU),pU=A({},kl,{newState:0,oldState:0,source:0}),mU=Kr(pU),gU=[9,13,27,32],Jb=pr&&"CompositionEvent"in window,qf=null;pr&&"documentMode"in document&&(qf=document.documentMode);var yU=pr&&"TextEvent"in window&&!qf,GN=pr&&(!Jb||qf&&8<qf&&11>=qf),KN=" ",YN=!1;function WN(i,a){switch(i){case"keyup":return gU.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function XN(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Mu=!1;function xU(i,a){switch(i){case"compositionend":return XN(a);case"keypress":return a.which!==32?null:(YN=!0,KN);case"textInput":return i=a.data,i===KN&&YN?null:i;default:return null}}function bU(i,a){if(Mu)return i==="compositionend"||!Jb&&WN(i,a)?(i=FN(),Zm=Yb=Al=null,Mu=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return GN&&a.locale!=="ko"?null:a.data;default:return null}}var vU={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function QN(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a==="input"?!!vU[i.type]:a==="textarea"}function ZN(i,a,d,m){kt?er?er.push(m):er=[m]:kt=m,a=r0(a,"onChange"),0<a.length&&(d=new tg("onChange","change",null,d,m),i.push({event:d,listeners:a}))}var Gf=null,Kf=null;function SU(i){BA(i,0)}function rg(i){var a=me(i);if(Au(a))return i}function JN(i,a){if(i==="change")return a}var eR=!1;if(pr){var ev;if(pr){var tv="oninput"in document;if(!tv){var tR=document.createElement("div");tR.setAttribute("oninput","return;"),tv=typeof tR.oninput=="function"}ev=tv}else ev=!1;eR=ev&&(!document.documentMode||9<document.documentMode)}function nR(){Gf&&(Gf.detachEvent("onpropertychange",rR),Kf=Gf=null)}function rR(i){if(i.propertyName==="value"&&rg(Kf)){var a=[];ZN(a,Kf,i,rc(i)),sc(SU,a)}}function wU(i,a,d){i==="focusin"?(nR(),Gf=a,Kf=d,Gf.attachEvent("onpropertychange",rR)):i==="focusout"&&nR()}function EU(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return rg(Kf)}function CU(i,a){if(i==="click")return rg(a)}function TU(i,a){if(i==="input"||i==="change")return rg(a)}function NU(i,a){return i===a&&(i!==0||1/i===1/a)||i!==i&&a!==a}var _s=typeof Object.is=="function"?Object.is:NU;function Yf(i,a){if(_s(i,a))return!0;if(typeof i!="object"||i===null||typeof a!="object"||a===null)return!1;var d=Object.keys(i),m=Object.keys(a);if(d.length!==m.length)return!1;for(m=0;m<d.length;m++){var v=d[m];if(!tt.call(a,v)||!_s(i[v],a[v]))return!1}return!0}function nv(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function sR(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function oR(i,a){var d=sR(i);i=0;for(var m;d;){if(d.nodeType===3){if(m=i+d.textContent.length,i<=a&&m>=a)return{node:d,offset:a-i};i=m}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=sR(d)}}function iR(i,a){return i&&a?i===a?!0:i&&i.nodeType===3?!1:a&&a.nodeType===3?iR(i,a.parentNode):"contains"in i?i.contains(a):i.compareDocumentPosition?!!(i.compareDocumentPosition(a)&16):!1:!1}function lR(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var a=nv(i.document);a instanceof i.HTMLIFrameElement;){try{var d=typeof a.contentWindow.location.href=="string"}catch{d=!1}if(d)i=a.contentWindow;else break;a=nv(i.document)}return a}function rv(i){var a=i&&i.nodeName&&i.nodeName.toLowerCase();return a&&(a==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||a==="textarea"||i.contentEditable==="true")}var RU=pr&&"documentMode"in document&&11>=document.documentMode,Iu=null,sv=null,Wf=null,ov=!1;function aR(i,a,d){var m=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;ov||Iu==null||Iu!==nv(m)||(m=Iu,"selectionStart"in m&&rv(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Wf&&Yf(Wf,m)||(Wf=m,m=r0(sv,"onSelect"),0<m.length&&(a=new tg("onSelect","select",null,a,d),i.push({event:a,listeners:m}),a.target=Iu)))}function ic(i,a){var d={};return d[i.toLowerCase()]=a.toLowerCase(),d["Webkit"+i]="webkit"+a,d["Moz"+i]="moz"+a,d}var Lu={animationend:ic("Animation","AnimationEnd"),animationiteration:ic("Animation","AnimationIteration"),animationstart:ic("Animation","AnimationStart"),transitionrun:ic("Transition","TransitionRun"),transitionstart:ic("Transition","TransitionStart"),transitioncancel:ic("Transition","TransitionCancel"),transitionend:ic("Transition","TransitionEnd")},iv={},cR={};pr&&(cR=document.createElement("div").style,"AnimationEvent"in window||(delete Lu.animationend.animation,delete Lu.animationiteration.animation,delete Lu.animationstart.animation),"TransitionEvent"in window||delete Lu.transitionend.transition);function lc(i){if(iv[i])return iv[i];if(!Lu[i])return i;var a=Lu[i],d;for(d in a)if(a.hasOwnProperty(d)&&d in cR)return iv[i]=a[d];return i}var uR=lc("animationend"),dR=lc("animationiteration"),fR=lc("animationstart"),OU=lc("transitionrun"),AU=lc("transitionstart"),kU=lc("transitioncancel"),hR=lc("transitionend"),pR=new Map,lv="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");lv.push("scrollEnd");function po(i,a){pR.set(i,a),ut(a,[i])}var _U=0;function wi(i,a){if(i.name!=null&&i.name!=="auto")return i.name;if(a.autoName!==null)return a.autoName;i=xo.identifierPrefix;var d=_U++;return i="_"+i+"t_"+d.toString(32)+"_",a.autoName=i}function mR(i){if(i==null||typeof i=="string")return i;var a=null,d=ed;if(d!==null)for(var m=0;m<d.length;m++){var v=i[d[m]];if(v!=null){if(v==="none")return"none";a=a==null?v:a+(" "+v)}}return a??i.default}function Ei(i,a){return i=mR(i),a=mR(a),a==null?i==="auto"?null:i:a==="auto"?null:a}var sg=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Ys=[],Du=0,av=0;function og(){for(var i=Du,a=av=Du=0;a<i;){var d=Ys[a];Ys[a++]=null;var m=Ys[a];Ys[a++]=null;var v=Ys[a];Ys[a++]=null;var w=Ys[a];if(Ys[a++]=null,m!==null&&v!==null){var _=m.pending;_===null?v.next=v:(v.next=_.next,_.next=v),m.pending=v}w!==0&&gR(d,v,w)}}function ig(i,a,d,m){Ys[Du++]=i,Ys[Du++]=a,Ys[Du++]=d,Ys[Du++]=m,av|=m,i.lanes|=m,i=i.alternate,i!==null&&(i.lanes|=m)}function cv(i,a,d,m){return ig(i,a,d,m),lg(i)}function ac(i,a){return ig(i,null,null,a),lg(i)}function gR(i,a,d){i.lanes|=d;var m=i.alternate;m!==null&&(m.lanes|=d);for(var v=!1,w=i.return;w!==null;)w.childLanes|=d,m=w.alternate,m!==null&&(m.childLanes|=d),w.tag===22&&(i=w.stateNode,i===null||i._visibility&1||(v=!0)),i=w,w=w.return;return i.tag===3?(w=i.stateNode,v&&a!==null&&(v=31-Jt(d),i=w.hiddenUpdates,m=i[v],m===null?i[v]=[a]:m.push(a),a.lane=d|536870912),w):null}function lg(i){if(50<yh)throw yh=0,Xg=null,Error(r(185));for(var a=i.return;a!==null;)i=a,a=i.return;return i.tag===3?i.stateNode:null}var ju={};function MU(i,a,d,m){this.tag=i,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fs(i,a,d,m){return new MU(i,a,d,m)}function uv(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Ci(i,a){var d=i.alternate;return d===null?(d=fs(i.tag,a,i.key,i.mode),d.elementType=i.elementType,d.type=i.type,d.stateNode=i.stateNode,d.alternate=i,i.alternate=d):(d.pendingProps=a,d.type=i.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=i.flags&1206910976,d.childLanes=i.childLanes,d.lanes=i.lanes,d.child=i.child,d.memoizedProps=i.memoizedProps,d.memoizedState=i.memoizedState,d.updateQueue=i.updateQueue,a=i.dependencies,d.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},d.sibling=i.sibling,d.index=i.index,d.ref=i.ref,d.refCleanup=i.refCleanup,d}function yR(i,a){i.flags&=1206910978;var d=i.alternate;return d===null?(i.childLanes=0,i.lanes=a,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=d.childLanes,i.lanes=d.lanes,i.child=d.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=d.memoizedProps,i.memoizedState=d.memoizedState,i.updateQueue=d.updateQueue,i.type=d.type,a=d.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),i}function ag(i,a,d,m,v,w){var _=0;if(m=i,typeof m=="function")uv(m)&&(_=1);else if(typeof m=="string")_=iV(i,d,Me.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(m){case X:return i=fs(31,d,a,v),i.elementType=X,i.lanes=w,i;case P:return cc(d.children,v,w,a);case B:_=8,v|=24;break;case H:return i=fs(12,d,a,v|2),i.elementType=H,i.lanes=w,i;case q:return i=fs(13,d,a,v),i.elementType=q,i.lanes=w,i;case V:return i=fs(19,d,a,v),i.elementType=V,i.lanes=w,i;case ee:case $:return i=v|32,i=fs(30,d,a,i),i.elementType=$,i.lanes=w,i.stateNode={autoName:null,paired:null,clones:null,ref:null},i;default:if(typeof m=="object"&&m!==null)switch(m.$$typeof){case F:_=10;break e;case D:_=9;break e;case z:_=11;break e;case G:_=14;break e;case K:_=16,m=null;break e}_=29,d=Error(r(130,i===null?"null":typeof i,"")),m=null}return a=fs(_,d,a,v),a.elementType=i,a.type=m,a.lanes=w,a}function cc(i,a,d,m){return i=fs(7,i,m,a),i.lanes=d,i}function dv(i,a,d){return i=fs(6,i,null,a),i.lanes=d,i}function xR(i){var a=fs(18,null,null,0);return a.stateNode=i,a}function fv(i,a,d){return a=fs(4,i.children!==null?i.children:[],i.key,a),a.lanes=d,a.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},a}var bR=new WeakMap;function Ws(i,a){if(typeof i=="object"&&i!==null){var d=bR.get(i);return d!==void 0?d:(a={value:i,source:a,stack:De(a)},bR.set(i,a),a)}return{value:i,source:a,stack:De(a)}}var Pu=[],zu=0,cg=null,Xf=0,Xs=[],Qs=0,_l=null,Po=1,zo="";function Ti(i,a){Pu[zu++]=Xf,Pu[zu++]=cg,cg=i,Xf=a}function vR(i,a,d){Xs[Qs++]=Po,Xs[Qs++]=zo,Xs[Qs++]=_l,_l=i;var m=Po;i=zo;var v=32-Jt(m)-1;m&=~(1<<v),d+=1;var w=32-Jt(a)+v;if(30<w){var _=v-v%5;w=(m&(1<<_)-1).toString(32),m>>=_,v-=_,Po=1<<32-Jt(a)+v|d<<v|m,zo=w+i}else Po=1<<w|d<<v|m,zo=i}function ug(i){i.return!==null&&(Ti(i,1),vR(i,1,0))}function hv(i){for(;i===cg;)cg=Pu[--zu],Pu[zu]=null,Xf=Pu[--zu],Pu[zu]=null;for(;i===_l;)_l=Xs[--Qs],Xs[Qs]=null,zo=Xs[--Qs],Xs[Qs]=null,Po=Xs[--Qs],Xs[Qs]=null}function SR(i,a){Xs[Qs++]=Po,Xs[Qs++]=zo,Xs[Qs++]=_l,Po=a.id,zo=a.overflow,_l=i}var tr=null,rn=null,vt=!1,Ml=null,Zs=!1,pv=Error(r(519));function Il(i){var a=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qf(Ws(a,i)),pv}function wR(i){var a=i.stateNode,d=i.type,m=i.memoizedProps;switch(a[on]=i,a[Yn]=m,d){case"dialog":Et("cancel",a),Et("close",a);break;case"iframe":case"object":case"embed":Et("load",a);break;case"video":case"audio":for(d=0;d<bh.length;d++)Et(bh[d],a);break;case"source":Et("error",a);break;case"img":case"image":case"link":Et("error",a),Et("load",a);break;case"details":Et("toggle",a);break;case"input":Et("invalid",a),Rl(a,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Et("invalid",a);break;case"textarea":Et("invalid",a),Os(a,m.value,m.defaultValue,m.children)}d=m.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||a.textContent===""+d||m.suppressHydrationWarning===!0||UA(a.textContent,d)?(m.popover!=null&&(Et("beforetoggle",a),Et("toggle",a)),m.onScroll!=null&&Et("scroll",a),m.onScrollEnd!=null&&Et("scrollend",a),m.onClick!=null&&(a.onclick=Gr),a=!0):a=!1,a||Il(i,!0)}function dg(i){for(tr=i.return;tr;)switch(tr.tag){case 5:case 31:case 13:Zs=!1;return;case 27:case 3:Zs=!0;return;default:tr=tr.return}}function Bu(i){if(i!==tr)return!1;if(!vt)return dg(i),vt=!0,!1;var a=i.tag,d;if((d=a!==3&&a!==27)&&((d=a===5)&&(d=i.type,d=!(d!=="form"&&d!=="button")||VS(i.type,i.memoizedProps)),d=!d),d&&rn&&Il(i),dg(i),a===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));rn=ak(i)}else if(a===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));rn=ak(i)}else a===27?(a=rn,Wl(i.type)?(i=JS,JS=null,rn=i):rn=a):rn=tr?eo(i.stateNode.nextSibling):null;return!0}function uc(){rn=tr=null,vt=!1}function mv(){var i=Ml;return i!==null&&(ms===null?ms=i:ms.push.apply(ms,i),Ml=null),i}function Qf(i){Ml===null?Ml=[i]:Ml.push(i)}var gv=_e(null),dc=null,Ni=null;function Ll(i,a,d){Ae(gv,a._currentValue),a._currentValue=d}function Ri(i){i._currentValue=gv.current,be(gv)}function fg(i,a,d){for(;i!==null;){var m=i.alternate;if((i.childLanes&a)!==a?(i.childLanes|=a,m!==null&&(m.childLanes|=a)):m!==null&&(m.childLanes&a)!==a&&(m.childLanes|=a),i===d)break;i=i.return}}function yv(i,a,d,m){var v=i.child;for(v!==null&&(v.return=i);v!==null;){var w=v.dependencies;if(w!==null){var _=v.child;w=w.firstContext;e:for(;w!==null;){var U=w;w=v;for(var Q=0;Q<a.length;Q++)if(U.context===a[Q]){w.lanes|=d,U=w.alternate,U!==null&&(U.lanes|=d),fg(w.return,d,i),m||(_=null);break e}w=U.next}}else if(v.tag===18){if(_=v.return,_===null)throw Error(r(341));_.lanes|=d,w=_.alternate,w!==null&&(w.lanes|=d),fg(_,d,i),_=null}else v.tag===13&&v.memoizedState!==null&&v.memoizedState.dehydrated===null?(v.lanes|=d,_=v.alternate,_!==null&&(_.lanes|=d),fg(v.return,d,i),_=v.child,_=_!==null?_.sibling:null):_=v.child;if(_!==null)_.return=v;else for(_=v;_!==null;){if(_===i){_=null;break}if(v=_.sibling,v!==null){v.return=_.return,_=v;break}_=_.return}v=_}}function fc(i,a,d,m){i=null;for(var v=a,w=!1;v!==null;){if(!w){if((v.flags&524288)!==0)w=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var _=v.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var U=v.type;_s(v.pendingProps.value,_.value)||(i!==null?i.push(U):i=[U])}}else if(v===Re.current){if(_=v.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(i!==null?i.push(ud):i=[ud])}v=v.return}return i!==null&&yv(a,i,d,m),a.flags|=262144,i!==null}function hg(i){for(i=i.firstContext;i!==null;){if(!_s(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function hc(i){dc=i,Ni=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function mr(i){return ER(dc,i)}function pg(i,a){return dc===null&&hc(i),ER(i,a)}function ER(i,a){var d=a._currentValue;if(a={context:a,memoizedValue:d,next:null},Ni===null){if(i===null)throw Error(r(308));Ni=a,i.dependencies={lanes:0,firstContext:a},i.flags|=524288}else Ni=Ni.next=a;return d}var IU=typeof AbortController<"u"?AbortController:function(){var i=[],a=this.signal={aborted:!1,addEventListener:function(d,m){i.push(m)}};this.abort=function(){a.aborted=!0,i.forEach(function(d){return d()})}},LU=e.unstable_scheduleCallback,DU=e.unstable_NormalPriority,Pn={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function xv(){return{controller:new IU,data:new Map,refCount:0}}function Zf(i){i.refCount--,i.refCount===0&&LU(DU,function(){i.controller.abort()})}function CR(i,a){if((i.pendingLanes&4194048)!==0){var d=i.transitionTypes;for(d===null&&(d=i.transitionTypes=[]),i=0;i<a.length;i++){var m=a[i];d.indexOf(m)===-1&&d.push(m)}}}var Jf=null;function jU(i){var a=i.transitionTypes;return i.transitionTypes=null,a}var eh=null,bv=0,pc=0,Hu=null;function PU(i,a){if(eh===null){var d=eh=[];bv=0,pc=DS(),Hu={status:"pending",value:void 0,then:function(m){d.push(m)}}}return bv++,a.then(TR,TR),a}function TR(){if(--bv===0&&(Jf=null,eh!==null)){Hu!==null&&(Hu.status="fulfilled");var i=eh;eh=null,pc=0,Hu=null;for(var a=0;a<i.length;a++)(0,i[a])()}}function zU(i,a){var d=[],m={status:"pending",value:null,reason:null,then:function(v){d.push(v)}};return i.then(function(){m.status="fulfilled",m.value=a;for(var v=0;v<d.length;v++)(0,d[v])(a)},function(v){for(m.status="rejected",m.reason=v,v=0;v<d.length;v++)(0,d[v])(void 0)}),m}var NR=pe.S;pe.S=function(i,a){if(xA=cn(),typeof a=="object"&&a!==null&&typeof a.then=="function"&&PU(i,a),Jf!==null)for(var d=sd;d!==null;)CR(d,Jf),d=d.next;if(d=i.types,d!==null){for(var m=sd;m!==null;)CR(m,d),m=m.next;if(pc!==0){m=Jf,m===null&&(m=Jf=[]);for(var v=0;v<d.length;v++){var w=d[v];m.indexOf(w)===-1&&m.push(w)}}}NR!==null&&NR(i,a)};var mc=_e(null);function vv(){var i=mc.current;return i!==null?i:en.pooledCache}function mg(i,a){a===null?Ae(mc,mc.current):Ae(mc,a.pool)}function RR(){var i=vv();return i===null?null:{parent:Pn._currentValue,pool:i}}var Fu=Error(r(460)),Sv=Error(r(474)),gg=Error(r(542)),yg={then:function(){}};function OR(i){return i=i.status,i==="fulfilled"||i==="rejected"}function AR(i,a,d){switch(d=i[d],d===void 0?i.push(a):d!==a&&(a.then(Gr,Gr),a=d),a.status){case"fulfilled":return a.value;case"rejected":throw i=a.reason,_R(i),i===void 0&&!("reason"in a)?Error(r(600)):i;default:if(typeof a.status=="string")a.then(Gr,Gr);else{if(i=en,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=a,i.status="pending",i.then(function(m){if(a.status==="pending"){var v=a;v.status="fulfilled",v.value=m}},function(m){if(a.status==="pending"){var v=a;v.status="rejected",v.reason=m}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw i=a.reason,_R(i),i}throw yc=a,Fu}}function gc(i){try{var a=i._init;return a(i._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(yc=d,Fu):d}}var yc=null;function kR(){if(yc===null)throw Error(r(459));var i=yc;return yc=null,i}function _R(i){if(i===Fu||i===gg)throw Error(r(483))}var $u=null,th=0;function xg(i){var a=th;return th+=1,$u===null&&($u=[]),AR($u,i,a)}function Dl(i,a){a=a.props.ref,i.ref=a!==void 0?a:null}function bg(i,a){throw a.$$typeof===L?Error(r(525)):(i=Object.prototype.toString.call(a),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":i)))}function MR(i){function a(oe,te){if(i){var de=oe.deletions;de===null?(oe.deletions=[te],oe.flags|=16):de.push(te)}}function d(oe,te){if(!i)return null;for(;te!==null;)a(oe,te),te=te.sibling;return null}function m(oe){for(var te=new Map;oe!==null;)oe.key===null?te.set(oe.index,oe):te.set(oe.key,oe),oe=oe.sibling;return te}function v(oe,te){return oe=Ci(oe,te),oe.index=0,oe.sibling=null,oe}function w(oe,te,de){return oe.index=de,i?(de=oe.alternate,de!==null?(de=de.index,de<te?(oe.flags|=2,te):de):(oe.flags|=134217730,te)):(oe.flags|=1048576,te)}function _(oe){return i&&oe.alternate===null&&(oe.flags|=134217730),oe}function U(oe,te,de,we){return te===null||te.tag!==6?(te=dv(de,oe.mode,we),te.return=oe,te):(te=v(te,de),te.return=oe,te)}function Q(oe,te,de,we){var $e=de.type;return $e===P?(oe=ge(oe,te,de.props.children,we,de.key),Dl(oe,de),oe):te!==null&&(te.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===K&&gc($e)===te.type)?(te=v(te,de.props),Dl(te,de),te.return=oe,te):(te=ag(de.type,de.key,de.props,null,oe.mode,we),Dl(te,de),te.return=oe,te)}function ie(oe,te,de,we){return te===null||te.tag!==4||te.stateNode.containerInfo!==de.containerInfo||te.stateNode.implementation!==de.implementation?(te=fv(de,oe.mode,we),te.return=oe,te):(te=v(te,de.children||[]),te.return=oe,te)}function ge(oe,te,de,we,$e){return te===null||te.tag!==7?(te=cc(de,oe.mode,we,$e),te.return=oe,te):(te=v(te,de),te.return=oe,te)}function Ee(oe,te,de){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=dv(""+te,oe.mode,de),te.return=oe,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case I:return de=ag(te.type,te.key,te.props,null,oe.mode,de),Dl(de,te),de.return=oe,de;case j:return te=fv(te,oe.mode,de),te.return=oe,te;case K:return te=gc(te),Ee(oe,te,de)}if(ye(te)||ne(te))return te=cc(te,oe.mode,de,null),te.return=oe,te;if(typeof te.then=="function")return Ee(oe,xg(te),de);if(te.$$typeof===F)return Ee(oe,pg(oe,te),de);bg(oe,te)}return null}function se(oe,te,de,we){var $e=te!==null?te.key:null;if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return $e!==null?null:U(oe,te,""+de,we);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case I:return de.key===$e?Q(oe,te,de,we):null;case j:return de.key===$e?ie(oe,te,de,we):null;case K:return de=gc(de),se(oe,te,de,we)}if(ye(de)||ne(de))return $e!==null?null:ge(oe,te,de,we,null);if(typeof de.then=="function")return se(oe,te,xg(de),we);if(de.$$typeof===F)return se(oe,te,pg(oe,de),we);bg(oe,de)}return null}function fe(oe,te,de,we,$e){if(typeof we=="string"&&we!==""||typeof we=="number"||typeof we=="bigint")return oe=oe.get(de)||null,U(te,oe,""+we,$e);if(typeof we=="object"&&we!==null){switch(we.$$typeof){case I:return oe=oe.get(we.key===null?de:we.key)||null,Q(te,oe,we,$e);case j:return oe=oe.get(we.key===null?de:we.key)||null,ie(te,oe,we,$e);case K:return we=gc(we),fe(oe,te,de,we,$e)}if(ye(we)||ne(we))return oe=oe.get(de)||null,ge(te,oe,we,$e,null);if(typeof we.then=="function")return fe(oe,te,de,xg(we),$e);if(we.$$typeof===F)return fe(oe,te,de,pg(te,we),$e);bg(te,we)}return null}function Pe(oe,te,de,we){for(var $e=null,Nt=null,Xe=te,ot=te=0,Hn=null;Xe!==null&&ot<de.length;ot++){Xe.index>ot?(Hn=Xe,Xe=null):Hn=Xe.sibling;var _t=se(oe,Xe,de[ot],we);if(_t===null){Xe===null&&(Xe=Hn);break}i&&Xe&&_t.alternate===null&&a(oe,Xe),te=w(_t,te,ot),Nt===null?$e=_t:Nt.sibling=_t,Nt=_t,Xe=Hn}if(ot===de.length)return d(oe,Xe),vt&&Ti(oe,ot),$e;if(Xe===null){for(;ot<de.length;ot++)Xe=Ee(oe,de[ot],we),Xe!==null&&(te=w(Xe,te,ot),Nt===null?$e=Xe:Nt.sibling=Xe,Nt=Xe);return vt&&Ti(oe,ot),$e}for(Xe=m(Xe);ot<de.length;ot++)Hn=fe(Xe,oe,ot,de[ot],we),Hn!==null&&(i&&(_t=Hn.alternate,_t!==null&&Xe.delete(_t.key===null?ot:_t.key)),te=w(Hn,te,ot),Nt===null?$e=Hn:Nt.sibling=Hn,Nt=Hn);return i&&Xe.forEach(function(ea){return a(oe,ea)}),vt&&Ti(oe,ot),$e}function qe(oe,te,de,we){if(de==null)throw Error(r(151));for(var $e=null,Nt=null,Xe=te,ot=te=0,Hn=null,_t=de.next();Xe!==null&&!_t.done;ot++,_t=de.next()){Xe.index>ot?(Hn=Xe,Xe=null):Hn=Xe.sibling;var ea=se(oe,Xe,_t.value,we);if(ea===null){Xe===null&&(Xe=Hn);break}i&&Xe&&ea.alternate===null&&a(oe,Xe),te=w(ea,te,ot),Nt===null?$e=ea:Nt.sibling=ea,Nt=ea,Xe=Hn}if(_t.done)return d(oe,Xe),vt&&Ti(oe,ot),$e;if(Xe===null){for(;!_t.done;ot++,_t=de.next())_t=Ee(oe,_t.value,we),_t!==null&&(te=w(_t,te,ot),Nt===null?$e=_t:Nt.sibling=_t,Nt=_t);return vt&&Ti(oe,ot),$e}for(Xe=m(Xe);!_t.done;ot++,_t=de.next())_t=fe(Xe,oe,ot,_t.value,we),_t!==null&&(i&&(Hn=_t.alternate,Hn!==null&&Xe.delete(Hn.key===null?ot:Hn.key)),te=w(_t,te,ot),Nt===null?$e=_t:Nt.sibling=_t,Nt=_t);return i&&Xe.forEach(function(xV){return a(oe,xV)}),vt&&Ti(oe,ot),$e}function mt(oe,te,de,we){if(typeof de=="object"&&de!==null&&de.type===P&&de.key===null&&de.props.ref===void 0&&(de=de.props.children),typeof de=="object"&&de!==null){switch(de.$$typeof){case I:e:{for(var $e=de.key;te!==null;){if(te.key===$e){if($e=de.type,$e===P){if(te.tag===7){d(oe,te.sibling),we=v(te,de.props.children),Dl(we,de),we.return=oe,oe=we;break e}}else if(te.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===K&&gc($e)===te.type){d(oe,te.sibling),we=v(te,de.props),Dl(we,de),we.return=oe,oe=we;break e}d(oe,te);break}else a(oe,te);te=te.sibling}de.type===P?(we=cc(de.props.children,oe.mode,we,de.key),Dl(we,de),we.return=oe,oe=we):(we=ag(de.type,de.key,de.props,null,oe.mode,we),Dl(we,de),we.return=oe,oe=we)}return _(oe);case j:e:{for($e=de.key;te!==null;){if(te.key===$e)if(te.tag===4&&te.stateNode.containerInfo===de.containerInfo&&te.stateNode.implementation===de.implementation){d(oe,te.sibling),we=v(te,de.children||[]),we.return=oe,oe=we;break e}else{d(oe,te);break}else a(oe,te);te=te.sibling}we=fv(de,oe.mode,we),we.return=oe,oe=we}return _(oe);case K:return de=gc(de),mt(oe,te,de,we)}if(ye(de))return Pe(oe,te,de,we);if(ne(de)){if($e=ne(de),typeof $e!="function")throw Error(r(150));return de=$e.call(de),qe(oe,te,de,we)}if(typeof de.then=="function")return mt(oe,te,xg(de),we);if(de.$$typeof===F)return mt(oe,te,pg(oe,de),we);bg(oe,de)}return typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint"?(de=""+de,te!==null&&te.tag===6?(d(oe,te.sibling),we=v(te,de),we.return=oe,oe=we):(d(oe,te),we=dv(de,oe.mode,we),we.return=oe,oe=we),_(oe)):d(oe,te)}return function(oe,te,de,we){try{th=0;var $e=mt(oe,te,de,we);return $u=null,$e}catch(Xe){if(Xe===Fu||Xe===gg)throw Xe;var Nt=fs(29,Xe,null,oe.mode);return Nt.lanes=we,Nt.return=oe,Nt}finally{}}}var xc=MR(!0),IR=MR(!1),jl=!1;function wv(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ev(i,a){i=i.updateQueue,a.updateQueue===i&&(a.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Pl(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function zl(i,a,d){var m=i.updateQueue;if(m===null)return null;if(m=m.shared,(zt&2)!==0){var v=m.pending;return v===null?a.next=a:(a.next=v.next,v.next=a),m.pending=a,a=lg(i),gR(i,null,d),a}return ig(i,m,a,d),lg(i)}function nh(i,a,d){if(a=a.updateQueue,a!==null&&(a=a.shared,(d&4194048)!==0)){var m=a.lanes;m&=i.pendingLanes,d|=m,a.lanes=d,El(i,d)}}function Cv(i,a){var d=i.updateQueue,m=i.alternate;if(m!==null&&(m=m.updateQueue,d===m)){var v=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var _={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?v=w=_:w=w.next=_,d=d.next}while(d!==null);w===null?v=w=a:w=w.next=a}else v=w=a;d={baseState:m.baseState,firstBaseUpdate:v,lastBaseUpdate:w,shared:m.shared,callbacks:m.callbacks},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=a:i.next=a,d.lastBaseUpdate=a}var Tv=!1;function rh(){if(Tv){var i=Hu;if(i!==null)throw i}}function sh(i,a,d,m){Tv=!1;var v=i.updateQueue;jl=!1;var w=v.firstBaseUpdate,_=v.lastBaseUpdate,U=v.shared.pending;if(U!==null){v.shared.pending=null;var Q=U,ie=Q.next;Q.next=null,_===null?w=ie:_.next=ie,_=Q;var ge=i.alternate;ge!==null&&(ge=ge.updateQueue,U=ge.lastBaseUpdate,U!==_&&(U===null?ge.firstBaseUpdate=ie:U.next=ie,ge.lastBaseUpdate=Q))}if(w!==null){var Ee=v.baseState;_=0,ge=ie=Q=null,U=w;do{var se=U.lane&-536870913,fe=se!==U.lane;if(fe?(Tt&se)===se:(m&se)===se){se!==0&&se===pc&&(Tv=!0),ge!==null&&(ge=ge.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Pe=i,qe=U;se=a;var mt=d;switch(qe.tag){case 1:if(Pe=qe.payload,typeof Pe=="function"){Ee=Pe.call(mt,Ee,se);break e}Ee=Pe;break e;case 3:Pe.flags=Pe.flags&-65537|128;case 0:if(Pe=qe.payload,se=typeof Pe=="function"?Pe.call(mt,Ee,se):Pe,se==null)break e;Ee=A({},Ee,se);break e;case 2:jl=!0}}se=U.callback,se!==null&&(i.flags|=64,fe&&(i.flags|=8192),fe=v.callbacks,fe===null?v.callbacks=[se]:fe.push(se))}else fe={lane:se,tag:U.tag,payload:U.payload,callback:U.callback,next:null},ge===null?(ie=ge=fe,Q=Ee):ge=ge.next=fe,_|=se;if(U=U.next,U===null){if(U=v.shared.pending,U===null)break;fe=U,U=fe.next,fe.next=null,v.lastBaseUpdate=fe,v.shared.pending=null}}while(!0);ge===null&&(Q=Ee),v.baseState=Q,v.firstBaseUpdate=ie,v.lastBaseUpdate=ge,w===null&&(v.shared.lanes=0),ql|=_,i.lanes=_,i.memoizedState=Ee}}function LR(i,a){if(typeof i!="function")throw Error(r(191,i));i.call(a)}function DR(i,a){var d=i.callbacks;if(d!==null)for(i.callbacks=null,i=0;i<d.length;i++)LR(d[i],a)}var Bl=_e(null),vg=_e(0);function jR(i,a){i=Mi,Ae(vg,i),Ae(Bl,a),Mi=i|a.baseLanes}function Nv(){Ae(vg,Mi),Ae(Bl,Bl.current)}function Rv(){Mi=vg.current,be(Bl),be(vg)}var gr=_e(null),Mr=null;function Hl(i){var a=i.alternate;Ae(yr,yr.current&1),Ae(gr,i),Mr===null&&(a===null||Bl.current!==null||a.memoizedState!==null)&&(Mr=i)}function Ov(i){Ae(yr,yr.current),Ae(gr,i),Mr===null&&(Mr=i)}function PR(i){i.tag===22?(Ae(yr,yr.current),Ae(gr,i),Mr===null&&(Mr=i)):Fl()}function Fl(){Ae(yr,yr.current),Ae(gr,gr.current)}function Ms(i){be(gr),Mr===i&&(Mr=null),be(yr)}var yr=_e(0);function oh(i,a){Ae(gr,gr.current),Ae(yr,a)}function Av(i){be(yr),be(gr),Mr===i&&(Mr=null)}function Sg(i){for(var a=i;a!==null;){if(a.tag===13){var d=a.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||QS(d)||ZS(d)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!=="independent"){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var Oi=0,pt=null,Wt=null,zn=null,wg=!1,Uu=!1,bc=!1,Eg=0,ih=0,Vu=null,BU=0;function Tn(){throw Error(r(321))}function kv(i,a){if(a===null)return!1;for(var d=0;d<a.length&&d<i.length;d++)if(!_s(i[d],a[d]))return!1;return!0}function _v(i,a,d,m,v,w){return Oi=w,pt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,pe.H=i===null||i.memoizedState===null?vO:SO,bc=!1,w=d(m,v),bc=!1,Uu&&(w=BR(a,d,m,v)),zR(i),w}function zR(i){pe.H=kg;var a=Wt!==null&&Wt.next!==null;if(Oi=0,zn=Wt=pt=null,wg=!1,ih=0,Vu=null,a)throw Error(r(300));i===null||Bn||(i=i.dependencies,i!==null&&hg(i)&&(Bn=!0))}function BR(i,a,d,m){pt=i;var v=0;do{if(Uu&&(Vu=null),ih=0,Uu=!1,25<=v)throw Error(r(301));if(v+=1,zn=Wt=null,i.updateQueue!=null){var w=i.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}pe.H=KU,w=a(d,m)}while(Uu);return w}function HU(){var i=pe.H,a=i.useState()[0];return a=typeof a.then=="function"?lh(a):a,i=i.useState()[0],(Wt!==null?Wt.memoizedState:null)!==i&&(pt.flags|=1024),a}function Mv(){var i=Eg!==0;return Eg=0,i}function Iv(i,a,d){a.updateQueue=i.updateQueue,a.flags&=-2053,i.lanes&=~d}function Lv(i){if(wg){for(i=i.memoizedState;i!==null;){var a=i.queue;a!==null&&(a.pending=null),i=i.next}wg=!1}Oi=0,zn=Wt=pt=null,Uu=!1,ih=Eg=0,Vu=null}function Yr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zn===null?pt.memoizedState=zn=i:zn=zn.next=i,zn}function An(){if(Wt===null){var i=pt.alternate;i=i!==null?i.memoizedState:null}else i=Wt.next;var a=zn===null?pt.memoizedState:zn.next;if(a!==null)zn=a,Wt=i;else{if(i===null)throw pt.alternate===null?Error(r(467)):Error(r(310));Wt=i,i={memoizedState:Wt.memoizedState,baseState:Wt.baseState,baseQueue:Wt.baseQueue,queue:Wt.queue,next:null},zn===null?pt.memoizedState=zn=i:zn=zn.next=i}return zn}function Cg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lh(i){var a=ih;return ih+=1,Vu===null&&(Vu=[]),i=AR(Vu,i,a),a=pt,(zn===null?a.memoizedState:zn.next)===null&&(a=a.alternate,pe.H=a===null||a.memoizedState===null?vO:SO),i}function Tg(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return lh(i);if(i.$$typeof===Y)return;if(i.$$typeof===F)return mr(i)}throw Error(r(438,String(i)))}function Dv(i){var a=null,d=pt.updateQueue;if(d!==null&&(a=d.memoCache),a==null){var m=pt.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(a={data:m.data.map(function(v){return v.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),d===null&&(d=Cg(),pt.updateQueue=d),d.memoCache=a,d=a.data[a.index],d===void 0)for(d=a.data[a.index]=Array(i),m=0;m<i;m++)d[m]=ae;return a.index++,d}function Ai(i,a){return typeof a=="function"?a(i):a}function Ng(i){var a=An();return jv(a,Wt,i)}function jv(i,a,d){var m=i.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=d;var v=i.baseQueue,w=m.pending;if(w!==null){if(v!==null){var _=v.next;v.next=w.next,w.next=_}a.baseQueue=v=w,m.pending=null}if(w=i.baseState,v===null)i.memoizedState=w;else{a=v.next;var U=_=null,Q=null,ie=a,ge=!1;do{var Ee=ie.lane&-536870913;if(Ee!==ie.lane?(Tt&Ee)===Ee:(Oi&Ee)===Ee){var se=ie.revertLane;if(se===0)Q!==null&&(Q=Q.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),Ee===pc&&(ge=!0);else if((Oi&se)===se){ie=ie.next,se===pc&&(ge=!0);continue}else Ee={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},Q===null?(U=Q=Ee,_=w):Q=Q.next=Ee,pt.lanes|=se,ql|=se;Ee=ie.action,bc&&d(w,Ee),w=ie.hasEagerState?ie.eagerState:d(w,Ee)}else se={lane:Ee,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},Q===null?(U=Q=se,_=w):Q=Q.next=se,pt.lanes|=Ee,ql|=Ee;ie=ie.next}while(ie!==null&&ie!==a);if(Q===null?_=w:Q.next=U,!_s(w,i.memoizedState)&&(Bn=!0,ge&&(d=Hu,d!==null)))throw d;i.memoizedState=w,i.baseState=_,i.baseQueue=Q,m.lastRenderedState=w}return v===null&&(m.lanes=0),[i.memoizedState,m.dispatch]}function Pv(i){var a=An(),d=a.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=i;var m=d.dispatch,v=d.pending,w=a.memoizedState;if(v!==null){d.pending=null;var _=v=v.next;do w=i(w,_.action),_=_.next;while(_!==v);_s(w,a.memoizedState)||(Bn=!0),a.memoizedState=w,a.baseQueue===null&&(a.baseState=w),d.lastRenderedState=w}return[w,m]}function HR(i,a,d){var m=pt,v=An(),w=vt;if(w){if(d===void 0)throw Error(r(407));d=d()}else d=a();var _=!_s((Wt||v).memoizedState,d);if(_&&(v.memoizedState=d,Bn=!0),v=v.queue,Hv(UR.bind(null,m,v,i),[i]),i=v.getSnapshot!==a||_||zn!==null&&(zn.memoizedState.tag&1)!==0,qu(i?9:8,{destroy:void 0},$R.bind(null,m,v,d,a),null),i){if(m.flags|=2048,en===null)throw Error(r(349));w||(Oi&127)!==0||FR(m,a,d)}return d}function FR(i,a,d){i.flags|=16384,i={getSnapshot:a,value:d},a=pt.updateQueue,a===null?(a=Cg(),pt.updateQueue=a,a.stores=[i]):(d=a.stores,d===null?a.stores=[i]:d.push(i))}function $R(i,a,d,m){a.value=d,a.getSnapshot=m,VR(a)&&qR(i)}function UR(i,a,d){return d(function(){VR(a)&&qR(i)})}function VR(i){var a=i.getSnapshot;i=i.value;try{var d=a();return!_s(i,d)}catch{return!0}}function qR(i){var a=ac(i,2);a!==null&&gs(a,i,2)}function zv(i){var a=Yr();if(typeof i=="function"){var d=i;if(i=d(),bc){Zt(!0);try{d()}finally{Zt(!1)}}}return a.memoizedState=a.baseState=i,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:i},a}function GR(i,a,d,m){return i.baseState=d,jv(i,Wt,typeof m=="function"?m:Ai)}function FU(i,a,d,m,v){if(Ag(i))throw Error(r(485));if(i=a.action,i!==null){var w={payload:v,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){w.listeners.push(_)}};pe.T!==null?d(!0):w.isTransition=!1,m(w),d=a.pending,d===null?(w.next=a.pending=w,KR(a,w)):(w.next=d.next,a.pending=d.next=w)}}function KR(i,a){var d=a.action,m=a.payload,v=i.state;if(a.isTransition){var w=pe.T,_={};_.types=w!==null?w.types:null,pe.T=_;try{var U=d(v,m),Q=pe.S;Q!==null&&Q(_,U),YR(i,a,U)}catch(ie){Bv(i,a,ie)}finally{w!==null&&_.types!==null&&(w.types=_.types),pe.T=w}}else try{w=d(v,m),YR(i,a,w)}catch(ie){Bv(i,a,ie)}}function YR(i,a,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(m){WR(i,a,m)},function(m){return Bv(i,a,m)}):WR(i,a,d)}function WR(i,a,d){a.status="fulfilled",a.value=d,XR(a),i.state=d,a=i.pending,a!==null&&(d=a.next,d===a?i.pending=null:(d=d.next,a.next=d,KR(i,d)))}function Bv(i,a,d){var m=i.pending;if(i.pending=null,m!==null){m=m.next;do a.status="rejected",a.reason=d,XR(a),a=a.next;while(a!==m)}i.action=null}function XR(i){i=i.listeners;for(var a=0;a<i.length;a++)(0,i[a])()}function QR(i,a){return a}function ZR(i,a){if(vt){var d=en.formState;if(d!==null){e:{var m=pt;if(vt){if(rn){t:{for(var v=rn,w=Zs;v.nodeType!==8;){if(!w){v=null;break t}if(v=eo(v.nextSibling),v===null){v=null;break t}}w=v.data,v=w==="F!"||w==="F"?v:null}if(v){rn=eo(v.nextSibling),m=v.data==="F!";break e}}Il(m)}m=!1}m&&(a=d[0])}}return d=Yr(),d.memoizedState=d.baseState=a,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:QR,lastRenderedState:a},d.queue=m,d=yO.bind(null,pt,m),m.dispatch=d,m=zv(!1),w=qv.bind(null,pt,!1,m.queue),m=Yr(),v={state:a,dispatch:null,action:i,pending:null},m.queue=v,d=FU.bind(null,pt,v,w,d),v.dispatch=d,m.memoizedState=i,[a,d,!1]}function JR(i){var a=An();return eO(a,Wt,i)}function eO(i,a,d){if(a=jv(i,a,QR)[0],i=Ng(Ai)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var m=lh(a)}catch(_){throw _===Fu?gg:_}else m=a;a=An();var v=a.queue,w=v.dispatch;return d!==a.memoizedState&&(pt.flags|=2048,qu(9,{destroy:void 0},$U.bind(null,v,d),null)),[m,w,i]}function $U(i,a){i.action=a}function tO(i){var a=An(),d=Wt;if(d!==null)return eO(a,d,i);An(),a=a.memoizedState,d=An();var m=d.queue.dispatch;return d.memoizedState=i,[a,m,!1]}function qu(i,a,d,m){return i={tag:i,create:d,deps:m,inst:a,next:null},a=pt.updateQueue,a===null&&(a=Cg(),pt.updateQueue=a),d=a.lastEffect,d===null?a.lastEffect=i.next=i:(m=d.next,d.next=i,i.next=m,a.lastEffect=i),i}function nO(){return An().memoizedState}function Rg(i,a,d,m){var v=Yr();pt.flags|=i,v.memoizedState=qu(1|a,{destroy:void 0},d,m===void 0?null:m)}function Og(i,a,d,m){var v=An();m=m===void 0?null:m;var w=v.memoizedState.inst;Wt!==null&&m!==null&&kv(m,Wt.memoizedState.deps)?v.memoizedState=qu(a,w,d,m):(pt.flags|=i,v.memoizedState=qu(1|a,w,d,m))}function rO(i,a){Rg(8390656,8,i,a)}function Hv(i,a){Og(2048,8,i,a)}function UU(i){pt.flags|=4;var a=pt.updateQueue;if(a===null)a=Cg(),pt.updateQueue=a,a.events=[i];else{var d=a.events;d===null?a.events=[i]:d.push(i)}}function sO(i){var a=An().memoizedState;return UU({ref:a,nextImpl:i}),function(){if((zt&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}function oO(i,a){return Og(4,2,i,a)}function iO(i,a){return Og(4,4,i,a)}function lO(i,a){if(typeof a=="function"){i=i();var d=a(i);return function(){typeof d=="function"?d():a(null)}}if(a!=null)return i=i(),a.current=i,function(){a.current=null}}function aO(i,a,d){d=d!=null?d.concat([i]):null,Og(4,4,lO.bind(null,a,i),d)}function Fv(){}function cO(i,a){var d=An();a=a===void 0?null:a;var m=d.memoizedState;return a!==null&&kv(a,m[1])?m[0]:(d.memoizedState=[i,a],i)}function uO(i,a){var d=An();a=a===void 0?null:a;var m=d.memoizedState;if(a!==null&&kv(a,m[1]))return m[0];if(m=i(),bc){Zt(!0);try{i()}finally{Zt(!1)}}return d.memoizedState=[m,a],m}function $v(i,a,d){return d===void 0||(Oi&1073741824)!==0&&(Tt&261930)===0?i.memoizedState=a:(i.memoizedState=d,i=vA(),pt.lanes|=i,ql|=i,d)}function dO(i,a,d,m){return _s(d,a)?d:Bl.current!==null?(i=$v(i,d,m),_s(i,a)||(Bn=!0),i):(Oi&106)===0||(Oi&1073741824)!==0&&(Tt&261930)===0?(Bn=!0,i.memoizedState=d):(i=vA(),pt.lanes|=i,ql|=i,a)}function fO(i,a,d,m,v){var w=le.p;le.p=w!==0&&8>w?w:8;var _=pe.T,U={};U.types=_!==null?_.types:null,pe.T=U,qv(i,!1,a,d);try{var Q=v(),ie=pe.S;if(ie!==null&&ie(U,Q),Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var ge=zU(Q,m);ah(i,a,ge,js(i))}else ah(i,a,m,js(i))}catch(Ee){ah(i,a,{then:function(){},status:"rejected",reason:Ee},js())}finally{le.p=w,_!==null&&U.types!==null&&(_.types=U.types),pe.T=_}}function VU(){}function Uv(i,a,d,m){if(i.tag!==5)throw Error(r(476));var v=hO(i).queue;fO(i,v,a,re,d===null?VU:function(){return pO(i),d(m)})}function hO(i){var a=i.memoizedState;if(a!==null)return a;a={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:re},next:null};var d={};return a.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:d},next:null},i.memoizedState=a,i=i.alternate,i!==null&&(i.memoizedState=a),a}function pO(i){var a=hO(i);a.next===null&&(a=i.alternate.memoizedState),ah(i,a.next.queue,{},js())}function Vv(){return mr(ud)}function mO(){return An().memoizedState}function gO(){return An().memoizedState}function qU(i){for(var a=i.return;a!==null;){switch(a.tag){case 24:case 3:var d=js();i=Pl(d);var m=zl(a,i,d);m!==null&&(gs(m,a,d),nh(m,a,d)),a={cache:xv()},i.payload=a;return}a=a.return}}function GU(i,a,d){var m=js();d={lane:m,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},Ag(i)?xO(a,d):(d=cv(i,a,d,m),d!==null&&(gs(d,i,m),bO(d,a,m)))}function yO(i,a,d){var m=js();ah(i,a,d,m)}function ah(i,a,d,m){var v={lane:m,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(Ag(i))xO(a,v);else{var w=i.alternate;if(i.lanes===0&&(w===null||w.lanes===0)&&(w=a.lastRenderedReducer,w!==null))try{var _=a.lastRenderedState,U=w(_,d);if(v.hasEagerState=!0,v.eagerState=U,_s(U,_))return ig(i,a,v,0),en===null&&og(),!1}catch{}finally{}if(d=cv(i,a,v,m),d!==null)return gs(d,i,m),bO(d,a,m),!0}return!1}function qv(i,a,d,m){if(m={lane:2,revertLane:DS(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Ag(i)){if(a)throw Error(r(479))}else a=cv(i,d,m,2),a!==null&&gs(a,i,2)}function Ag(i){var a=i.alternate;return i===pt||a!==null&&a===pt}function xO(i,a){Uu=wg=!0;var d=i.pending;d===null?a.next=a:(a.next=d.next,d.next=a),i.pending=a}function bO(i,a,d){if((d&4194048)!==0){var m=a.lanes;m&=i.pendingLanes,d|=m,a.lanes=d,El(i,d)}}var kg={readContext:mr,use:Tg,useCallback:Tn,useContext:Tn,useEffect:Tn,useImperativeHandle:Tn,useLayoutEffect:Tn,useInsertionEffect:Tn,useMemo:Tn,useReducer:Tn,useRef:Tn,useState:Tn,useDebugValue:Tn,useDeferredValue:Tn,useTransition:Tn,useSyncExternalStore:Tn,useId:Tn,useHostTransitionStatus:Tn,useFormState:Tn,useActionState:Tn,useOptimistic:Tn,useMemoCache:Tn,useCacheRefresh:Tn,useEffectEvent:Tn},vO={readContext:mr,use:Tg,useCallback:function(i,a){return Yr().memoizedState=[i,a===void 0?null:a],i},useContext:mr,useEffect:rO,useImperativeHandle:function(i,a,d){d=d!=null?d.concat([i]):null,Rg(4194308,4,lO.bind(null,a,i),d)},useLayoutEffect:function(i,a){return Rg(4194308,4,i,a)},useInsertionEffect:function(i,a){Rg(4,2,i,a)},useMemo:function(i,a){var d=Yr();a=a===void 0?null:a;var m=i();if(bc){Zt(!0);try{i()}finally{Zt(!1)}}return d.memoizedState=[m,a],m},useReducer:function(i,a,d){var m=Yr();if(d!==void 0){var v=d(a);if(bc){Zt(!0);try{d(a)}finally{Zt(!1)}}}else v=a;return m.memoizedState=m.baseState=v,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:v},m.queue=i,i=i.dispatch=GU.bind(null,pt,i),[m.memoizedState,i]},useRef:function(i){var a=Yr();return i={current:i},a.memoizedState=i},useState:function(i){i=zv(i);var a=i.queue,d=yO.bind(null,pt,a);return a.dispatch=d,[i.memoizedState,d]},useDebugValue:Fv,useDeferredValue:function(i,a){var d=Yr();return $v(d,i,a)},useTransition:function(){var i=zv(!1);return i=fO.bind(null,pt,i.queue,!0,!1),Yr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,a,d){var m=pt,v=Yr();if(vt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=a(),en===null)throw Error(r(349));(Tt&127)!==0||FR(m,a,d)}v.memoizedState=d;var w={value:d,getSnapshot:a};return v.queue=w,rO(UR.bind(null,m,w,i),[i]),m.flags|=2048,qu(9,{destroy:void 0},$R.bind(null,m,w,d,a),null),d},useId:function(){var i=Yr(),a=en.identifierPrefix;if(vt){var d=zo,m=Po;d=(m&~(1<<32-Jt(m)-1)).toString(32)+d,a="_"+a+"R_"+d,d=Eg++,0<d&&(a+="H"+d.toString(32)),a+="_"}else d=BU++,a="_"+a+"r_"+d.toString(32)+"_";return i.memoizedState=a},useHostTransitionStatus:Vv,useFormState:ZR,useActionState:ZR,useOptimistic:function(i){var a=Yr();a.memoizedState=a.baseState=i;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=d,a=qv.bind(null,pt,!0,d),d.dispatch=a,[i,a]},useMemoCache:Dv,useCacheRefresh:function(){return Yr().memoizedState=qU.bind(null,pt)},useEffectEvent:function(i){var a=Yr(),d={impl:i};return a.memoizedState=d,function(){if((zt&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}},SO={readContext:mr,use:Tg,useCallback:cO,useContext:mr,useEffect:Hv,useImperativeHandle:aO,useInsertionEffect:oO,useLayoutEffect:iO,useMemo:uO,useReducer:Ng,useRef:nO,useState:function(){return Ng(Ai)},useDebugValue:Fv,useDeferredValue:function(i,a){var d=An();return dO(d,Wt.memoizedState,i,a)},useTransition:function(){var i=Ng(Ai)[0],a=An().memoizedState;return[typeof i=="boolean"?i:lh(i),a]},useSyncExternalStore:HR,useId:mO,useHostTransitionStatus:Vv,useFormState:JR,useActionState:JR,useOptimistic:function(i,a){var d=An();return GR(d,Wt,i,a)},useMemoCache:Dv,useCacheRefresh:gO,useEffectEvent:sO},KU={readContext:mr,use:Tg,useCallback:cO,useContext:mr,useEffect:Hv,useImperativeHandle:aO,useInsertionEffect:oO,useLayoutEffect:iO,useMemo:uO,useReducer:Pv,useRef:nO,useState:function(){return Pv(Ai)},useDebugValue:Fv,useDeferredValue:function(i,a){var d=An();return Wt===null?$v(d,i,a):dO(d,Wt.memoizedState,i,a)},useTransition:function(){var i=Pv(Ai)[0],a=An().memoizedState;return[typeof i=="boolean"?i:lh(i),a]},useSyncExternalStore:HR,useId:mO,useHostTransitionStatus:Vv,useFormState:tO,useActionState:tO,useOptimistic:function(i,a){var d=An();return Wt!==null?GR(d,Wt,i,a):(d.baseState=i,[i,d.queue.dispatch])},useMemoCache:Dv,useCacheRefresh:gO,useEffectEvent:sO};function Gv(i,a,d,m){a=i.memoizedState,d=d(m,a),d=d==null?a:A({},a,d),i.memoizedState=d,i.lanes===0&&(i.updateQueue.baseState=d)}var Kv={enqueueSetState:function(i,a,d){i=i._reactInternals;var m=js(),v=Pl(m);v.payload=a,d!=null&&(v.callback=d),a=zl(i,v,m),a!==null&&(gs(a,i,m),nh(a,i,m))},enqueueReplaceState:function(i,a,d){i=i._reactInternals;var m=js(),v=Pl(m);v.tag=1,v.payload=a,d!=null&&(v.callback=d),a=zl(i,v,m),a!==null&&(gs(a,i,m),nh(a,i,m))},enqueueForceUpdate:function(i,a){i=i._reactInternals;var d=js(),m=Pl(d);m.tag=2,a!=null&&(m.callback=a),a=zl(i,m,d),a!==null&&(gs(a,i,d),nh(a,i,d))}};function wO(i,a,d,m,v,w,_){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(m,w,_):a.prototype&&a.prototype.isPureReactComponent?!Yf(d,m)||!Yf(v,w):!0}function EO(i,a,d,m){i=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(d,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(d,m),a.state!==i&&Kv.enqueueReplaceState(a,a.state,null)}function vc(i,a){var d=a;if("ref"in a){d={};for(var m in a)m!=="ref"&&(d[m]=a[m])}if(i=i.defaultProps){d===a&&(d=A({},d));for(var v in i)d[v]===void 0&&(d[v]=i[v])}return d}function CO(i){sg(i)}function TO(i){console.error(i)}function NO(i){sg(i)}function _g(i,a){try{var d=i.onUncaughtError;d(a.value,{componentStack:a.stack})}catch(m){setTimeout(function(){throw m})}}function RO(i,a,d){try{var m=i.onCaughtError;m(d.value,{componentStack:d.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Yv(i,a,d){return d=Pl(d),d.tag=3,d.payload={element:null},d.callback=function(){_g(i,a)},d}function OO(i){return i=Pl(i),i.tag=3,i}function AO(i,a,d,m){var v=d.type.getDerivedStateFromError;if(typeof v=="function"){var w=m.value;i.payload=function(){return v(w)},i.callback=function(){RO(a,d,m)}}var _=d.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(i.callback=function(){RO(a,d,m),typeof v!="function"&&(Gl===null?Gl=new Set([this]):Gl.add(this));var U=m.stack;this.componentDidCatch(m.value,{componentStack:U!==null?U:""})})}function YU(i,a,d,m,v){if(d.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(a=d.alternate,a!==null&&fc(a,d,v,!0),d=gr.current,d!==null){switch(d.tag){case 31:case 13:case 19:return Mr===null?Zg():d.alternate===null&&Nn===0&&(Nn=3),d.flags&=-257,d.flags|=65536,d.lanes=v,m===yg?d.flags|=16384:(a=d.updateQueue,a===null?d.updateQueue=new Set([m]):a.add(m),MS(i,m,v)),!1;case 22:return d.flags|=65536,m===yg?d.flags|=16384:(a=d.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([m])},d.updateQueue=a):(d=a.retryQueue,d===null?a.retryQueue=new Set([m]):d.add(m)),MS(i,m,v)),!1}throw Error(r(435,d.tag))}return MS(i,m,v),Zg(),!1}if(vt)return a=gr.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=v,m!==pv&&(i=Error(r(422),{cause:m}),Qf(Ws(i,d)))):(m!==pv&&(a=Error(r(423),{cause:m}),Qf(Ws(a,d))),i=i.current.alternate,i.flags|=65536,v&=-v,i.lanes|=v,m=Ws(m,d),v=Yv(i.stateNode,m,v),Cv(i,v),Nn!==4&&(Nn=2)),!1;var w=Error(r(520),{cause:m});if(w=Ws(w,d),gh===null?gh=[w]:gh.push(w),Nn!==4&&(Nn=2),a===null)return!0;m=Ws(m,d),d=a;do{switch(d.tag){case 3:return d.flags|=65536,i=v&-v,d.lanes|=i,i=Yv(d.stateNode,m,i),Cv(d,i),!1;case 1:if(a=d.type,w=d.stateNode,(d.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Gl===null||!Gl.has(w))))return d.flags|=65536,v&=-v,d.lanes|=v,v=OO(v),AO(v,i,d,m),Cv(d,v),!1;break;case 22:if(d.memoizedState!==null)return d.flags|=65536,!1}d=d.return}while(d!==null);return!1}var Wv=Error(r(461)),Bn=!1;function Xn(i,a,d,m){a.child=i===null?IR(a,null,d,m):xc(a,i.child,d,m)}function kO(i,a,d,m,v){d=d.render;var w=a.ref;if("ref"in m){var _={};for(var U in m)U!=="ref"&&(_[U]=m[U])}else _=m;return hc(a),m=_v(i,a,d,_,w,v),U=Mv(),i!==null&&!Bn?(Iv(i,a,v),ki(i,a,v)):(vt&&U&&ug(a),a.flags|=1,Xn(i,a,m,v),a.child)}function _O(i,a,d,m,v){if(i===null){var w=d.type;return typeof w=="function"&&!uv(w)&&w.defaultProps===void 0&&d.compare===null?(a.tag=15,a.type=w,MO(i,a,w,m,v)):(i=ag(d.type,null,m,a,a.mode,v),i.ref=a.ref,i.return=a,a.child=i)}if(w=i.child,!rS(i,v)){var _=w.memoizedProps;if(d=d.compare,d=d!==null?d:Yf,d(_,m)&&i.ref===a.ref)return ki(i,a,v)}return a.flags|=1,i=Ci(w,m),i.ref=a.ref,i.return=a,a.child=i}function MO(i,a,d,m,v){if(i!==null){var w=i.memoizedProps;if(Yf(w,m)&&i.ref===a.ref)if(Bn=!1,a.pendingProps=m=w,rS(i,v))(i.flags&131072)!==0&&(Bn=!0);else return a.lanes=i.lanes,ki(i,a,v)}return Xv(i,a,d,m,v)}function IO(i,a,d,m){var v=m.children,w=i!==null?i.memoizedState:null;if(i===null&&a.stateNode===null&&(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((a.flags&128)!==0){if(w=w!==null?w.baseLanes|d:d,i!==null){for(m=a.child=i.child,v=0;m!==null;)v=v|m.lanes|m.childLanes,m=m.sibling;m=v&~w}else m=0,a.child=null;return LO(i,a,w,d,m)}if((d&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},i!==null&&mg(a,w!==null?w.cachePool:null),w!==null?jR(a,w):Nv(),PR(a);else return m=a.lanes=536870912,LO(i,a,w!==null?w.baseLanes|d:d,d,m)}else w!==null?(mg(a,w.cachePool),jR(a,w),Fl(),a.memoizedState=null):(i!==null&&mg(a,null),Nv(),Fl());return Xn(i,a,v,d),a.child}function ch(i,a){return i!==null&&i.tag===22||a.stateNode!==null||(a.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.sibling}function LO(i,a,d,m,v){var w=vv();return w=w===null?null:{parent:Pn._currentValue,pool:w},a.memoizedState={baseLanes:d,cachePool:w},i!==null&&mg(a,null),Nv(),PR(a),i!==null&&fc(i,a,m,!0),a.childLanes=v,null}function Mg(i,a){return a=Ig({mode:a.mode,children:a.children},i.mode),a.ref=i.ref,i.child=a,a.return=i,a}function DO(i,a,d){return xc(a,i.child,null,d),i=Mg(a,a.pendingProps),i.flags|=2,Ms(a),a.memoizedState=null,i}function WU(i,a,d){var m=a.pendingProps,v=(a.flags&128)!==0;if(a.flags&=-129,i===null){if(vt){if(m.mode==="hidden")return i=Mg(a,m),a.lanes=536870912,i.memoizedState={baseLanes:0,cachePool:null},ch(null,i);if(Ov(a),(i=rn)?(i=lk(i,Zs),i=i!==null&&i.data==="&"?i:null,i!==null&&(a.memoizedState={dehydrated:i,treeContext:_l!==null?{id:Po,overflow:zo}:null,retryLane:536870912,hydrationErrors:null},d=xR(i),d.return=a,a.child=d,tr=a,rn=null)):i=null,i===null)throw Il(a);return a.lanes=536870912,null}return Mg(a,m)}var w=i.memoizedState;if(w!==null){var _=w.dehydrated;if(Ov(a),v)if(a.flags&256)a.flags&=-257,a=DO(i,a,d);else if(a.memoizedState!==null)a.child=i.child,a.flags|=128,a=null;else throw Error(r(558));else if(Bn||fc(i,a,d,!1),v=(d&i.childLanes)!==0,Bn||v){if(Bl.current===null){if(m=en,m!==null&&(_=mi(m,d),_!==0&&_!==w.retryLane))throw w.retryLane=_,ac(i,_),gs(m,i,_),Wv;Zg()}a=DO(i,a,d)}else i=w.treeContext,rn=eo(_.nextSibling),tr=a,vt=!0,Ml=null,Zs=!1,i!==null&&SR(a,i),a=Mg(a,m),a.flags|=134221824;return a}return i=Ci(i.child,{mode:m.mode,children:m.children}),i.ref=a.ref,a.child=i,i.return=a,i}function Gu(i,a){var d=a.ref;if(d===null)i!==null&&i.ref!==null&&(a.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(i===null||i.ref!==d)&&(a.flags|=4194816)}}function Xv(i,a,d,m,v){return hc(a),d=_v(i,a,d,m,void 0,v),m=Mv(),i!==null&&!Bn?(Iv(i,a,v),ki(i,a,v)):(vt&&m&&ug(a),a.flags|=1,Xn(i,a,d,v),a.child)}function jO(i,a,d,m,v,w){return hc(a),a.updateQueue=null,d=BR(a,m,d,v),zR(i),m=Mv(),i!==null&&!Bn?(Iv(i,a,w),ki(i,a,w)):(vt&&m&&ug(a),a.flags|=1,Xn(i,a,d,w),a.child)}function PO(i,a,d,m,v){if(hc(a),a.stateNode===null){var w=ju,_=d.contextType;typeof _=="object"&&_!==null&&(w=mr(_)),w=new d(m,w),a.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Kv,a.stateNode=w,w._reactInternals=a,w=a.stateNode,w.props=m,w.state=a.memoizedState,w.refs={},wv(a),_=d.contextType,w.context=typeof _=="object"&&_!==null?mr(_):ju,w.state=a.memoizedState,_=d.getDerivedStateFromProps,typeof _=="function"&&(Gv(a,d,_,m),w.state=a.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(_=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),_!==w.state&&Kv.enqueueReplaceState(w,w.state,null),sh(a,m,w,v),rh(),w.state=a.memoizedState),typeof w.componentDidMount=="function"&&(a.flags|=4194308),m=!0}else if(i===null){w=a.stateNode;var U=a.memoizedProps,Q=vc(d,U);w.props=Q;var ie=w.context,ge=d.contextType;_=ju,typeof ge=="object"&&ge!==null&&(_=mr(ge));var Ee=d.getDerivedStateFromProps;ge=typeof Ee=="function"||typeof w.getSnapshotBeforeUpdate=="function",U=a.pendingProps!==U,ge||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(U||ie!==_)&&EO(a,w,m,_),jl=!1;var se=a.memoizedState;w.state=se,sh(a,m,w,v),rh(),ie=a.memoizedState,U||se!==ie||jl?(typeof Ee=="function"&&(Gv(a,d,Ee,m),ie=a.memoizedState),(Q=jl||wO(a,d,Q,m,se,ie,_))?(ge||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(a.flags|=4194308)):(typeof w.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=m,a.memoizedState=ie),w.props=m,w.state=ie,w.context=_,m=Q):(typeof w.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{w=a.stateNode,Ev(i,a),_=a.memoizedProps,ge=vc(d,_),w.props=ge,Ee=a.pendingProps,se=w.context,ie=d.contextType,Q=ju,typeof ie=="object"&&ie!==null&&(Q=mr(ie)),U=d.getDerivedStateFromProps,(ie=typeof U=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(_!==Ee||se!==Q)&&EO(a,w,m,Q),jl=!1,se=a.memoizedState,w.state=se,sh(a,m,w,v),rh();var fe=a.memoizedState;_!==Ee||se!==fe||jl||i!==null&&i.dependencies!==null&&hg(i.dependencies)?(typeof U=="function"&&(Gv(a,d,U,m),fe=a.memoizedState),(ge=jl||wO(a,d,ge,m,se,fe,Q)||i!==null&&i.dependencies!==null&&hg(i.dependencies))?(ie||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(m,fe,Q),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(m,fe,Q)),typeof w.componentDidUpdate=="function"&&(a.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof w.componentDidUpdate!="function"||_===i.memoizedProps&&se===i.memoizedState||(a.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===i.memoizedProps&&se===i.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=fe),w.props=m,w.state=fe,w.context=Q,m=ge):(typeof w.componentDidUpdate!="function"||_===i.memoizedProps&&se===i.memoizedState||(a.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||_===i.memoizedProps&&se===i.memoizedState||(a.flags|=1024),m=!1)}return w=m,Gu(i,a),m=(a.flags&128)!==0,w||m?(w=a.stateNode,d=m&&typeof d.getDerivedStateFromError!="function"?null:w.render(),a.flags|=1,i!==null&&m?(a.child=xc(a,i.child,null,v),a.child=xc(a,null,d,v)):Xn(i,a,d,v),a.memoizedState=w.state,i=a.child):i=ki(i,a,v),i}function zO(i,a,d,m){return uc(),a.flags|=256,Xn(i,a,d,m),a.child}var Qv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zv(i){return{baseLanes:i,cachePool:RR()}}function Jv(i,a,d){return i=i!==null?i.childLanes&~d:0,a&&(i|=Ds),i}function BO(i,a,d){var m=a.pendingProps,v=!1,w=(a.flags&128)!==0,_;if((_=w)||(_=i!==null&&i.memoizedState===null?!1:(yr.current&2)!==0),_&&(v=!0,a.flags&=-129),_=(a.flags&32)!==0,a.flags&=-33,i===null){if(vt){if(v?Hl(a):Fl(),(i=rn)?(i=lk(i,Zs),i=i!==null&&i.data!=="&"?i:null,i!==null&&(a.memoizedState={dehydrated:i,treeContext:_l!==null?{id:Po,overflow:zo}:null,retryLane:536870912,hydrationErrors:null},d=xR(i),d.return=a,a.child=d,tr=a,rn=null)):i=null,i===null)throw Il(a);return ZS(i)?a.lanes=32:a.lanes=536870912,null}return w=m.children,m=m.fallback,v?(Fl(),v=a.mode,w=Ig({mode:"hidden",children:w},v),m=cc(m,v,d,null),w.return=a,m.return=a,w.sibling=m,a.child=w,m=a.child,m.memoizedState=Zv(d),m.childLanes=Jv(i,_,d),a.memoizedState=Qv,ch(null,m)):(Hl(a),eS(a,w))}var U=i.memoizedState;if(U!==null){var Q=U.dehydrated;if(Q!==null)return XU(i,a,w,_,m,Q,U,d)}return v?(Fl(),v=m.fallback,w=a.mode,U=i.child,Q=U.sibling,m=Ci(U,{mode:"hidden",children:m.children}),m.subtreeFlags=U.subtreeFlags&1206910976,Q!==null?v=Ci(Q,v):(v=cc(v,w,d,null),v.flags|=2),v.return=a,m.return=a,m.sibling=v,a.child=m,ch(null,m),m=a.child,v=i.child.memoizedState,v===null?v=Zv(d):(w=v.cachePool,w!==null?(U=Pn._currentValue,w=w.parent!==U?{parent:U,pool:U}:w):w=RR(),v={baseLanes:v.baseLanes|d,cachePool:w}),m.memoizedState=v,m.childLanes=Jv(i,_,d),a.memoizedState=Qv,ch(i.child,m)):(Hl(a),d=i.child,i=d.sibling,d=Ci(d,{mode:"visible",children:m.children}),d.return=a,d.sibling=null,i!==null&&(_=a.deletions,_===null?(a.deletions=[i],a.flags|=16):_.push(i)),a.child=d,a.memoizedState=null,d)}function eS(i,a){return a=Ig({mode:"visible",children:a},i.mode),a.return=i,i.child=a}function Ig(i,a){return i=fs(22,i,null,a),i.lanes=0,i}function Lg(i,a,d){return xc(a,i.child,null,d),i=eS(a,a.pendingProps.children),i.flags|=2,a.memoizedState=null,i}function XU(i,a,d,m,v,w,_,U){if(d)return a.flags&256?(Hl(a),a.flags&=-257,Lg(i,a,U)):a.memoizedState!==null?(Fl(),a.child=i.child,a.flags|=128,null):(Fl(),w=v.fallback,_=a.mode,v=Ig({mode:"visible",children:v.children},_),w=cc(w,_,U,null),w.flags|=2,v.return=a,w.return=a,v.sibling=w,a.child=v,xc(a,i.child,null,U),v=a.child,v.memoizedState=Zv(U),v.childLanes=Jv(i,m,U),a.memoizedState=Qv,ch(null,v));if(Hl(a),ZS(w)){if(m=w.nextSibling&&w.nextSibling.dataset,m)var Q=m.dgst;return m=Q,m!==""&&(v=Error(r(419)),v.stack="",v.digest=m,Qf({value:v,source:null,stack:null})),Lg(i,a,U)}if(Bn||fc(i,a,U,!1),m=(U&i.childLanes)!==0,Bn||m){if(Bl.current!==null)return Lg(i,a,U);if(m=en,m!==null&&(v=mi(m,U),v!==0&&v!==_.retryLane))throw _.retryLane=v,ac(i,v),gs(m,i,v),Wv;return QS(w)||Zg(),Lg(i,a,U)}return QS(w)?(a.flags|=192,a.child=i.child,null):(i=_.treeContext,rn=eo(w.nextSibling),tr=a,vt=!0,Ml=null,Zs=!1,i!==null&&SR(a,i),a=eS(a,v.children),a.flags|=134221824,a)}function HO(i,a,d){i.lanes|=a;var m=i.alternate;m!==null&&(m.lanes|=a),fg(i.return,a,d)}function FO(i){for(var a=null;i!==null;){var d=i.alternate;d!==null&&Sg(d)===null&&(a=i),i=i.sibling}return a}function Dg(i,a,d,m,v,w){var _=i.memoizedState;_===null?i.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:m,tail:d,tailMode:v,treeForkCount:w}:(_.isBackwards=a,_.rendering=null,_.renderingStartTime=0,_.last=m,_.tail=d,_.tailMode=v,_.treeForkCount=w)}function tS(i){var a=i.child;for(i.child=null;a!==null;){var d=a.sibling;a.sibling=i.child,i.child=a,a=d}}function nS(i,a,d){var m=a.pendingProps,v=m.revealOrder,w=m.tail;m=m.children;var _=yr.current;if(a.flags&128)return oh(a,_),null;var U=(_&2)!==0;if(U?(_=_&1|2,a.flags|=128):_&=1,oh(a,_),v==="backwards"&&i!==null?(tS(i),Xn(i,a,m,d),tS(i)):Xn(i,a,m,d),m=vt?Xf:0,!U&&i!==null&&(i.flags&128)!==0)e:for(i=a.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&HO(i,d,a);else if(i.tag===19)HO(i,d,a);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(v){case"backwards":d=FO(a.child),d===null?(v=a.child,a.child=null):(v=d.sibling,d.sibling=null,tS(a)),Dg(a,!0,v,null,w,m);break;case"unstable_legacy-backwards":for(d=null,v=a.child,a.child=null;v!==null;){if(i=v.alternate,i!==null&&Sg(i)===null){a.child=v;break}i=v.sibling,v.sibling=d,d=v,v=i}Dg(a,!0,d,null,w,m);break;case"together":Dg(a,!1,null,null,void 0,m);break;case"independent":a.memoizedState=null;break;default:d=FO(a.child),d===null?(v=a.child,a.child=null):(v=d.sibling,d.sibling=null),Dg(a,!1,v,d,w,m)}return a.child}function $O(i,a,d){var m=a.pendingProps;return Ll(a,a.type,m.value),Xn(i,a,m.children,d),a.child}function ki(i,a,d){if(i!==null&&(a.dependencies=i.dependencies),ql|=a.lanes,(d&a.childLanes)===0)if(i!==null){if(fc(i,a,d,!1),(d&a.childLanes)===0)return null}else return null;if(i!==null&&a.child!==i.child)throw Error(r(153));if(a.child!==null){for(i=a.child,d=Ci(i,i.pendingProps),a.child=d,d.return=a;i.sibling!==null;)i=i.sibling,d=d.sibling=Ci(i,i.pendingProps),d.return=a;d.sibling=null}return a.child}function rS(i,a){return(i.lanes&a)!==0?!0:(i=i.dependencies,!!(i!==null&&hg(i)))}function QU(i,a,d){switch(a.tag){case 3:ze(a,a.stateNode.containerInfo),Ll(a,Pn,i.memoizedState.cache),uc();break;case 27:case 5:je(a);break;case 4:ze(a,a.stateNode.containerInfo);break;case 10:Ll(a,a.type,a.memoizedProps.value);break;case 31:if(a.memoizedState!==null)return a.flags|=128,Ov(a),null;break;case 13:var m=a.memoizedState;if(m!==null){if(m.dehydrated!==null)return Hl(a),a.flags|=128,null;m=fc(i,a,d,!1);var v=a.child.childLanes;return m||(d&v)!==0?BO(i,a,d):(Hl(a),i=ki(i,a,d),i!==null?i.sibling:null)}Hl(a);break;case 19:if(a.flags&128)return nS(i,a,d);if(v=(i.flags&128)!==0,m=(d&a.childLanes)!==0,m||(fc(i,a,d,!1),m=(d&a.childLanes)!==0),v){if(m)return nS(i,a,d);a.flags|=128}if(v=a.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),oh(a,yr.current),m)break;return null;case 22:return a.lanes=0,IO(i,a,d,a.pendingProps);case 24:Ll(a,Pn,i.memoizedState.cache)}return ki(i,a,d)}function UO(i,a,d){if(i!==null)if(i.memoizedProps!==a.pendingProps)Bn=!0;else{if(!rS(i,d)&&(a.flags&128)===0)return Bn=!1,QU(i,a,d);Bn=(i.flags&131072)!==0}else Bn=!1,vt&&(a.flags&1048576)!==0&&vR(a,Xf,a.index);switch(a.lanes=0,a.tag){case 16:e:{var m=a.pendingProps;if(i=gc(a.elementType),a.type=i,typeof i=="function")uv(i)?(m=vc(i,m),a.tag=1,a=PO(null,a,i,m,d)):(a.tag=0,a=Xv(null,a,i,m,d));else{if(i!=null){var v=i.$$typeof;if(v===z){a.tag=11,a=kO(null,a,i,m,d);break e}else if(v===G){a.tag=14,a=_O(null,a,i,m,d);break e}else if(v===F){a.tag=10,a.type=i,a=$O(null,a,d);break e}}throw a=ce(i)||i,Error(r(306,a,""))}}return a;case 0:return Xv(i,a,a.type,a.pendingProps,d);case 1:return m=a.type,v=vc(m,a.pendingProps),PO(i,a,m,v,d);case 3:e:{if(ze(a,a.stateNode.containerInfo),i===null)throw Error(r(387));m=a.pendingProps;var w=a.memoizedState;v=w.element,Ev(i,a),sh(a,m,null,d);var _=a.memoizedState;if(m=_.cache,Ll(a,Pn,m),m!==w.cache&&yv(a,[Pn],d,!0),rh(),m=_.element,w.isDehydrated)if(w={element:m,isDehydrated:!1,cache:_.cache},a.updateQueue.baseState=w,a.memoizedState=w,a.flags&256){a=zO(i,a,m,d);break e}else if(m!==v){v=Ws(Error(r(424)),a),Qf(v),a=zO(i,a,m,d);break e}else{switch(i=a.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(rn=eo(i.firstChild),tr=a,vt=!0,Ml=null,Zs=!0,d=IR(a,null,m,d),a.child=d;d;)d.flags=d.flags&-3|134221824,d=d.sibling}else{if(uc(),m===v){a=ki(i,a,d);break e}Xn(i,a,m,d)}a=a.child}return a;case 26:return Gu(i,a),i===null?(d=pk(a.type,null,a.pendingProps,null))?a.memoizedState=d:vt||(a.stateNode=KA(a.type,a.pendingProps,ue.current,a)):a.memoizedState=pk(a.type,i.memoizedProps,a.pendingProps,i.memoizedState),null;case 27:return je(a),i===null&&vt&&(m=a.stateNode=uk(a.type,a.pendingProps,ue.current),tr=a,Zs=!0,v=rn,Wl(a.type)?(JS=v,rn=eo(m.firstChild)):rn=v),Xn(i,a,a.pendingProps.children,d),Gu(i,a),i===null&&(a.flags|=4194304),a.child;case 5:return i===null&&vt&&((v=m=rn)&&(m=q9(m,a.type,a.pendingProps,Zs),m!==null?(a.stateNode=m,tr=a,rn=eo(m.firstChild),Zs=!1,v=!0):v=!1),v||Il(a)),je(a),v=a.type,w=a.pendingProps,_=i!==null?i.memoizedProps:null,m=w.children,VS(v,w)?m=null:_!==null&&VS(v,_)&&(a.flags|=32),a.memoizedState!==null&&(v=_v(i,a,HU,null,null,d),ud._currentValue=v),Gu(i,a),Xn(i,a,m,d),a.child;case 6:return i===null&&vt&&((i=d=rn)&&(d=G9(d,a.pendingProps,Zs),d!==null?(a.stateNode=d,tr=a,rn=null,i=!0):i=!1),i||Il(a)),null;case 13:return BO(i,a,d);case 4:return ze(a,a.stateNode.containerInfo),m=a.pendingProps,i===null?a.child=xc(a,null,m,d):Xn(i,a,m,d),a.child;case 11:return kO(i,a,a.type,a.pendingProps,d);case 7:return m=a.pendingProps,Gu(i,a),Xn(i,a,m,d),a.child;case 8:return Xn(i,a,a.pendingProps.children,d),a.child;case 12:return Xn(i,a,a.pendingProps.children,d),a.child;case 10:return $O(i,a,d);case 9:return v=a.type._context,m=a.pendingProps.children,hc(a),v=mr(v),m=m(v),a.flags|=1,Xn(i,a,m,d),a.child;case 14:return _O(i,a,a.type,a.pendingProps,d);case 15:return MO(i,a,a.type,a.pendingProps,d);case 19:return nS(i,a,d);case 31:return WU(i,a,d);case 22:return IO(i,a,d,a.pendingProps);case 24:return hc(a),m=mr(Pn),i===null?(v=vv(),v===null&&(v=en,w=xv(),v.pooledCache=w,w.refCount++,w!==null&&(v.pooledCacheLanes|=d),v=w),a.memoizedState={parent:m,cache:v},wv(a),Ll(a,Pn,v)):((i.lanes&d)!==0&&(Ev(i,a),sh(a,null,null,d),rh()),v=i.memoizedState,w=a.memoizedState,v.parent!==m?(v={parent:m,cache:m},a.memoizedState=v,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=v),Ll(a,Pn,m)):(m=w.cache,Ll(a,Pn,m),m!==v.cache&&yv(a,[Pn],d,!0))),Xn(i,a,a.pendingProps.children,d),a.child;case 30:return a.stateNode===null&&(a.stateNode={autoName:null,paired:null,clones:null,ref:null}),m=a.pendingProps,m.name!=null&&m.name!=="auto"?a.flags|=i===null?18882560:18874368:vt&&ug(a),i!==null&&i.memoizedProps.name!==m.name?a.flags|=4194816:Gu(i,a),Xn(i,a,m.children,d),a.child;case 29:throw a.pendingProps}throw Error(r(156,a.tag))}function _i(i){i.flags|=4}function sS(i,a,d,m,v){var w;if((w=(i.mode&32)!==0)&&(w=d===null?xk(a,m):xk(a,m)&&(m.src!==d.src||m.srcSet!==d.srcSet)),w){if(i.flags|=16777216,(v&335544128)===v)if(i.stateNode.complete)i.flags|=8192;else if(CA())i.flags|=8192;else throw yc=yg,Sv}else i.flags&=-16777217}function VO(i,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!bk(a))if(CA())i.flags|=8192;else throw yc=yg,Sv}function jg(i,a){a!==null&&(i.flags|=4),i.flags&16384&&(a=i.tag!==22?fr():536870912,i.lanes|=a,Qu|=a)}function uh(i,a){if(!vt)switch(i.tailMode){case"visible":break;case"collapsed":for(var d=i.tail,m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?a||i.tail===null?i.tail=null:i.tail.sibling=null:m.sibling=null;break;default:for(a=i.tail,d=null;a!==null;)a.alternate!==null&&(d=a),a=a.sibling;d===null?i.tail=null:d.sibling=null}}function sn(i){var a=i.alternate!==null&&i.alternate.child===i.child,d=0,m=0;if(a)for(var v=i.child;v!==null;)d|=v.lanes|v.childLanes,m|=v.subtreeFlags&1206910976,m|=v.flags&1206910976,v.return=i,v=v.sibling;else for(v=i.child;v!==null;)d|=v.lanes|v.childLanes,m|=v.subtreeFlags,m|=v.flags,v.return=i,v=v.sibling;return i.subtreeFlags|=m,i.childLanes=d,a}function ZU(i,a,d){var m=a.pendingProps;switch(hv(a),a.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sn(a),null;case 1:return sn(a),null;case 3:return d=a.stateNode,m=null,i!==null&&(m=i.memoizedState.cache),a.memoizedState.cache!==m&&(a.flags|=2048),Ri(Pn),ke(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(i===null||i.child===null)&&(Bu(a)?_i(a):i===null||i.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,mv())),sn(a),null;case 26:var v=a.type,w=a.memoizedState;return i===null?(_i(a),w!==null?(sn(a),VO(a,w)):(sn(a),sS(a,v,null,m,d))):w?w!==i.memoizedState?(_i(a),sn(a),VO(a,w)):(sn(a),a.flags&=-16777217):(i=i.memoizedProps,i!==m&&_i(a),sn(a),sS(a,v,i,m,d)),null;case 27:if(Ne(a),d=ue.current,v=a.type,i!==null&&a.stateNode!=null)i.memoizedProps!==m&&_i(a);else{if(!m){if(a.stateNode===null)throw Error(r(166));return sn(a),a.subtreeFlags&=-33554433,null}i=Me.current,Bu(a)?wR(a):(i=uk(v,m,d),a.stateNode=i,_i(a))}return sn(a),a.subtreeFlags&=-33554433,null;case 5:if(Ne(a),v=a.type,i!==null&&a.stateNode!=null)i.memoizedProps!==m&&_i(a);else{if(!m){if(a.stateNode===null)throw Error(r(166));return sn(a),a.subtreeFlags&=-33554433,null}if(w=Me.current,Bu(a))wR(a);else{var _=Sh(ue.current);switch(w){case 1:w=_.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:w=_.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":w=_.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":w=_.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":w=_.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof m.is=="string"?_.createElement("select",{is:m.is}):_.createElement("select"),m.multiple?w.multiple=!0:m.size&&(w.size=m.size);break;default:w=typeof m.is=="string"?_.createElement(v,{is:m.is}):_.createElement(v)}}w[on]=a,w[Yn]=m;e:for(_=a.child;_!==null;){if(_.tag===5||_.tag===6)w.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===a)break e;for(;_.sibling===null;){if(_.return===null||_.return===a)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}a.stateNode=w;e:switch(br(w,v,m),v){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&_i(a)}}return sn(a),a.subtreeFlags&=-33554433,sS(a,a.type,i===null?null:i.memoizedProps,a.pendingProps,d),null;case 6:if(i&&a.stateNode!=null)i.memoizedProps!==m&&_i(a);else{if(typeof m!="string"&&a.stateNode===null)throw Error(r(166));if(i=ue.current,Bu(a)){if(i=a.stateNode,d=a.memoizedProps,m=null,v=tr,v!==null)switch(v.tag){case 27:case 5:m=v.memoizedProps}i[on]=a,i=!!(i.nodeValue===d||m!==null&&m.suppressHydrationWarning===!0||UA(i.nodeValue,d)),i||Il(a,!0)}else i=Sh(i).createTextNode(m),i[on]=a,a.stateNode=i}return sn(a),null;case 31:if(d=a.memoizedState,i===null||i.memoizedState!==null){if(m=Bu(a),d!==null){if(i===null){if(!m)throw Error(r(318));if(i=a.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[on]=a}else uc(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;sn(a),i=!1}else d=mv(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=d),i=!0;if(!i)return a.flags&256?(Ms(a),a):(Ms(a),null);if((a.flags&128)!==0)throw Error(r(558))}return sn(a),null;case 13:if(m=a.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(v=Bu(a),m!==null&&m.dehydrated!==null){if(i===null){if(!v)throw Error(r(318));if(v=a.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[on]=a}else uc(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;sn(a),v=!1}else v=mv(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=v),v=!0;if(!v)return a.flags&256?(Ms(a),a):(Ms(a),null)}return Ms(a),(a.flags&128)!==0?(a.lanes=d,a):(d=m!==null,i=i!==null&&i.memoizedState!==null,d&&(m=a.child,v=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(v=m.alternate.memoizedState.cachePool.pool),w=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(w=m.memoizedState.cachePool.pool),w!==v&&(m.flags|=2048)),d!==i&&d&&(a.child.flags|=8192),jg(a,a.updateQueue),sn(a),null);case 4:return ke(),i===null&&BS(a.stateNode.containerInfo),a.flags|=67108864,sn(a),null;case 10:return Ri(a.type),sn(a),null;case 19:if(Av(a),m=a.memoizedState,m===null)return sn(a),null;if(v=(a.flags&128)!==0,w=m.rendering,w===null)if(v)uh(m,!1);else{if(Nn!==0||i!==null&&(i.flags&128)!==0)for(i=a.child;i!==null;){if(w=Sg(i),w!==null){for(a.flags|=128,uh(m,!1),i=w.updateQueue,a.updateQueue=i,jg(a,i),a.subtreeFlags=0,i=d,d=a.child;d!==null;)yR(d,i),d=d.sibling;return oh(a,yr.current&1|2),vt&&Ti(a,m.treeForkCount),a.child}i=i.sibling}m.tail!==null&&cn()>Yg&&(a.flags|=128,v=!0,uh(m,!1),a.lanes=4194304)}else{if(!v)if(i=Sg(w),i!==null){if(a.flags|=128,v=!0,i=i.updateQueue,a.updateQueue=i,jg(a,i),uh(m,!0),m.tail===null&&m.tailMode!=="collapsed"&&m.tailMode!=="visible"&&!w.alternate&&!vt)return sn(a),null}else 2*cn()-m.renderingStartTime>Yg&&d!==536870912&&(a.flags|=128,v=!0,uh(m,!1),a.lanes=4194304);m.isBackwards?(w.sibling=a.child,a.child=w):(i=m.last,i!==null?i.sibling=w:a.child=w,m.last=w)}if(m.tail!==null){i=m.tail;e:{for(d=i;d!==null;){if(d.alternate!==null){d=!1;break e}d=d.sibling}d=!0}return m.rendering=i,m.tail=i.sibling,m.renderingStartTime=cn(),i.sibling=null,w=yr.current,w=v?w&1|2:w&1,m.tailMode==="visible"||m.tailMode==="collapsed"||!d||vt?oh(a,w):(d=w,Ae(gr,a),Ae(yr,d),Mr===null&&(Mr=a)),vt&&Ti(a,m.treeForkCount),i}return sn(a),null;case 22:case 23:return Ms(a),Rv(),m=a.memoizedState!==null,i!==null?i.memoizedState!==null!==m&&(a.flags|=8192):m&&(a.flags|=8192),m?(d&536870912)!==0&&(a.flags&128)===0&&(sn(a),a.subtreeFlags&6&&(a.flags|=8192)):sn(a),d=a.updateQueue,d!==null&&jg(a,d.retryQueue),d=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),m=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(m=a.memoizedState.cachePool.pool),m!==d&&(a.flags|=2048),i!==null&&be(mc),null;case 24:return d=null,i!==null&&(d=i.memoizedState.cache),a.memoizedState.cache!==d&&(a.flags|=2048),Ri(Pn),sn(a),null;case 25:return null;case 30:return a.flags|=33554432,sn(a),null}throw Error(r(156,a.tag))}function JU(i,a){switch(hv(a),a.tag){case 1:return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 3:return Ri(Pn),ke(),i=a.flags,(i&65536)!==0&&(i&128)===0?(a.flags=i&-65537|128,a):null;case 26:case 27:case 5:return Ne(a),null;case 31:if(a.memoizedState!==null){if(Ms(a),a.alternate===null)throw Error(r(340));uc()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 13:if(Ms(a),i=a.memoizedState,i!==null&&i.dehydrated!==null){if(a.alternate===null)throw Error(r(340));uc()}return i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 19:return Av(a),i=a.flags,i&65536?(a.flags=i&-65537|128,i=a.memoizedState,i!==null&&(i.rendering=null,i.tail=null),a.flags|=4,a):null;case 4:return ke(),null;case 10:return Ri(a.type),null;case 22:case 23:return Ms(a),Rv(),i!==null&&be(mc),i=a.flags,i&65536?(a.flags=i&-65537|128,a):null;case 24:return Ri(Pn),null;case 25:return null;default:return null}}function qO(i,a){switch(hv(a),a.tag){case 3:Ri(Pn),ke();break;case 26:case 27:case 5:Ne(a);break;case 4:ke();break;case 31:a.memoizedState!==null&&Ms(a);break;case 13:Ms(a);break;case 19:Av(a);break;case 10:Ri(a.type);break;case 22:case 23:Ms(a),Rv(),i!==null&&be(mc);break;case 24:Ri(Pn)}}function dh(i,a){try{var d=a.updateQueue,m=d!==null?d.lastEffect:null;if(m!==null){var v=m.next;d=v;do{if((d.tag&i)===i){m=void 0;var w=d.create,_=d.inst;m=w(),_.destroy=m}d=d.next}while(d!==v)}}catch(U){qt(a,a.return,U)}}function $l(i,a,d){try{var m=a.updateQueue,v=m!==null?m.lastEffect:null;if(v!==null){var w=v.next;m=w;do{if((m.tag&i)===i){var _=m.inst,U=_.destroy;if(U!==void 0){_.destroy=void 0,v=a;var Q=d,ie=U;try{ie()}catch(ge){qt(v,Q,ge)}}}m=m.next}while(m!==w)}}catch(ge){qt(a,a.return,ge)}}function GO(i){var a=i.updateQueue;if(a!==null){var d=i.stateNode;try{DR(a,d)}catch(m){qt(i,i.return,m)}}}function KO(i,a,d){d.props=vc(i.type,i.memoizedProps),d.state=i.memoizedState;try{d.componentWillUnmount()}catch(m){qt(i,a,m)}}function Bo(i,a){try{var d=i.ref;if(d!==null){switch(i.tag){case 26:case 27:case 5:var m=i.stateNode;break;case 30:var v=i.stateNode,w=wi(i.memoizedProps,v);(v.ref===null||v.ref.name!==w)&&(v.ref=ek(w)),m=v.ref;break;case 7:if(i.stateNode===null){var _=new Ps(i);p(i.child,!1,U9,_,void 0,void 0),i.stateNode=_}m=i.stateNode;break;default:m=i.stateNode}typeof d=="function"?i.refCleanup=d(m):d.current=m}}catch(U){qt(i,a,U)}}function xr(i,a){var d=i.ref,m=i.refCleanup;if(d!==null)if(typeof m=="function")try{m()}catch(v){qt(i,a,v)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(v){qt(i,a,v)}else d.current=null}function Pg(i,a){if((i.tag===5||i.tag===27||i.tag===6)&&i.alternate===null&&a!==null)for(var d=0;d<a.length;d++)ik(i.stateNode,a[d])}function YO(i){for(var a=i.return;a!==null&&(iS(a)&&ik(i.stateNode,a.stateNode),!oS(a));)a=a.return}function fh(i){for(var a=i.return;a!==null&&(iS(a)&&V9(i.stateNode,a.stateNode),!oS(a));)a=a.return}function oS(i){return i.tag===5||i.tag===3||i.tag===27}function iS(i){return i&&i.tag===7&&i.stateNode!==null}function lS(i){var a=i.type,d=i.memoizedProps,m=i.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":d.autoFocus&&m.focus();break e;case"img":d.src?m.src=d.src:d.srcSet&&(m.srcset=d.srcSet)}}catch(v){qt(i,i.return,v)}}function aS(i,a,d){try{var m=i.stateNode;T9(m,i.type,d,a),m[Yn]=a}catch(v){qt(i,i.return,v)}}function WO(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Wl(i.type)||i.tag===4}function cS(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||WO(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Wl(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function uS(i,a,d,m){var v=i.tag;if(v===5||v===6)v=i.stateNode,a?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(v,a):(a=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,a.appendChild(v),d=d._reactRootContainer,d!=null||a.onclick!==null||(a.onclick=Gr)),Pg(i,m),rt=!0;else if(v!==4&&(v===27&&(Pg(i,m),m=null,Wl(i.type)&&(d=i.stateNode,a=null)),i=i.child,i!==null))for(uS(i,a,d,m),i=i.sibling;i!==null;)uS(i,a,d,m),i=i.sibling}function zg(i,a,d,m){var v=i.tag;if(v===5||v===6)v=i.stateNode,a?d.insertBefore(v,a):d.appendChild(v),Pg(i,m),rt=!0;else if(v!==4&&(v===27&&(Pg(i,m),m=null,Wl(i.type)&&(d=i.stateNode)),i=i.child,i!==null))for(zg(i,a,d,m),i=i.sibling;i!==null;)zg(i,a,d,m),i=i.sibling}function XO(i){var a=i.stateNode,d=i.memoizedProps;try{for(var m=i.type,v=a.attributes;v.length;)a.removeAttributeNode(v[0]);br(a,m,d),a[on]=i,a[Yn]=d}catch(w){qt(i,i.return,w)}}var Bg=!1,Is=null;function QO(i){(i.tag===30||(i.subtreeFlags&33554432)!==0)&&(Bg=!0)}var Ho=null;function ZO(){var i=Ho;return Ho=null,i}var hs=0;function Ku(i,a,d,m,v){return hs=0,JO(i.child,a,d,m,v)}function JO(i,a,d,m,v){for(var w=!1;i!==null;){if(i.tag===5){var _=i.stateNode;if(m!==null){var U=KS(_);m.push(U),U.view&&(w=!0)}else w||KS(_).view&&(w=!0);Bg=!0,ZA(_,hs===0?a:a+"_"+hs,d),hs++}else(i.tag!==22||i.memoizedState===null)&&(i.tag===30&&v||JO(i.child,a,d,m,v)&&(w=!0));i=i.sibling}return w}function Fo(i,a){for(;i!==null;)i.tag===5?JA(i.stateNode,i.memoizedProps):(i.tag!==22||i.memoizedState===null)&&(i.tag===30&&a||Fo(i.child,a)),i=i.sibling}function Hg(i){if((i.subtreeFlags&18874368)!==0)for(i=i.child;i!==null;){if((i.tag!==22||i.memoizedState===null)&&(Hg(i),i.tag===30&&(i.flags&18874368)!==0&&i.stateNode.paired)){var a=i.memoizedProps;if(a.name==null||a.name==="auto")throw Error(r(544));var d=a.name;a=Ei(a.default,a.share),a!=="none"&&(Ku(i,d,a,null,!1)||Fo(i.child,!1))}i=i.sibling}}function dS(i,a){if(i.tag===30){var d=i.stateNode,m=i.memoizedProps,v=wi(m,d),w=Ei(m.default,d.paired?m.share:m.enter);w!=="none"?Ku(i,v,w,null,!1)?(Hg(i),d.paired||a||td(i,m.onEnter)):Fo(i.child,!1):Hg(i)}else if((i.subtreeFlags&33554432)!==0)for(i=i.child;i!==null;)dS(i,a),i=i.sibling;else Hg(i)}function fS(i){if(Is!==null&&Is.size!==0){var a=Is;if((i.subtreeFlags&18874368)!==0)for(i=i.child;i!==null;){if(i.tag!==22||i.memoizedState===null){if(i.tag===30&&(i.flags&18874368)!==0){var d=i.memoizedProps,m=d.name;if(m!=null&&m!=="auto"){var v=a.get(m);if(v!==void 0){var w=Ei(d.default,d.share);if(w!=="none"&&(Ku(i,m,w,null,!1)?(w=i.stateNode,v.paired=w,w.paired=v,td(i,d.onShare)):Fo(i.child,!1)),a.delete(m),a.size===0)break}}}fS(i)}i=i.sibling}}}function hS(i){if(i.tag===30){var a=i.memoizedProps,d=wi(a,i.stateNode),m=Is!==null?Is.get(d):void 0,v=Ei(a.default,m!==void 0?a.share:a.exit);v!=="none"&&(Ku(i,d,v,null,!1)?m!==void 0?(v=i.stateNode,m.paired=v,v.paired=m,Is.delete(d),td(i,a.onShare)):td(i,a.onExit):Fo(i.child,!1)),Is!==null&&fS(i)}else if((i.subtreeFlags&33554432)!==0)for(i=i.child;i!==null;)hS(i),i=i.sibling;else Is!==null&&fS(i)}function eA(i){for(i=i.child;i!==null;){if(i.tag===30){var a=i.memoizedProps,d=wi(a,i.stateNode);a=Ei(a.default,a.update),i.flags&=-5,a!=="none"&&Ku(i,d,a,i.memoizedState=[],!1)}else(i.subtreeFlags&33554432)!==0&&eA(i);i=i.sibling}}function pS(i){if((i.subtreeFlags&18874368)!==0)for(i=i.child;i!==null;){if(i.tag!==22||i.memoizedState===null){if(i.tag===30&&(i.flags&18874368)!==0){var a=i.stateNode;a.paired!==null&&(a.paired=null,Fo(i.child,!1))}pS(i)}i=i.sibling}}function Fg(i){if(i.tag===30)i.stateNode.paired=null,Fo(i.child,!1),pS(i);else if((i.subtreeFlags&33554432)!==0)for(i=i.child;i!==null;)Fg(i),i=i.sibling;else pS(i)}function tA(i){for(i=i.child;i!==null;)i.tag===30?Fo(i.child,!1):(i.subtreeFlags&33554432)!==0&&tA(i),i=i.sibling}function mS(i,a,d,m,v,w,_){for(var U=!1;a!==null;){if(a.tag===5){var Q=a.stateNode;if(w!==null&&hs<w.length){var ie=w[hs],ge=KS(Q);(ie.view||ge.view)&&(U=!0);var Ee;if(Ee=(i.flags&4)===0)if(ge.clip)Ee=!0;else{Ee=ie.rect;var se=ge.rect;Ee=Ee.y!==se.y||Ee.x!==se.x||Ee.height!==se.height||Ee.width!==se.width}Ee&&(i.flags|=4),ge.abs?ge=!ie.abs:(ie=ie.rect,ge=ge.rect,ge=ie.height!==ge.height||ie.width!==ge.width),ge&&(i.flags|=32)}else i.flags|=32;(i.flags&4)!==0&&ZA(Q,hs===0?d:d+"_"+hs,v),U&&(i.flags&4)!==0||(Ho===null&&(Ho=[]),Ho.push(Q,hs===0?m:m+"_"+hs,a.memoizedProps)),hs++}else(a.tag!==22||a.memoizedState===null)&&(a.tag===30&&_?i.flags|=a.flags&32:mS(i,a.child,d,m,v,w,_)&&(U=!0));a=a.sibling}return U}function nA(i,a){for(i=i.child;i!==null;){if(i.tag===30){var d=i.memoizedProps,m=i.stateNode,v=wi(d,m),w=Ei(d.default,d.update),_;_=i.memoizedState,i.memoizedState=null,m=i;var U=i.child;hs=0,v=mS(m,U,v,v,w,_,!1),(i.flags&4)!==0&&v&&td(i,d.onUpdate)}else(i.subtreeFlags&33554432)!==0&&nA(i);i=i.sibling}}var nr=!1,$t=!1,$o=!1,gS=!1,rA=typeof WeakSet=="function"?WeakSet:Set,rr=null,Uo=!1,hh=!1,$g=!1,yS=!1;function e9(i,a,d){if(i=i.containerInfo,$S=dd,i=lR(i),rv(i)){if("selectionStart"in i)var m={start:i.selectionStart,end:i.selectionEnd};else e:{m=(m=i.ownerDocument)&&m.defaultView||window;var v=m.getSelection&&m.getSelection();if(v&&v.rangeCount!==0){m=v.anchorNode;var w=v.anchorOffset,_=v.focusNode;v=v.focusOffset;try{m.nodeType,_.nodeType}catch{m=null;break e}var U=0,Q=-1,ie=-1,ge=0,Ee=0,se=i,fe=null;t:for(;;){for(var Pe;se!==m||w!==0&&se.nodeType!==3||(Q=U+w),se!==_||v!==0&&se.nodeType!==3||(ie=U+v),se.nodeType===3&&(U+=se.nodeValue.length),(Pe=se.firstChild)!==null;)fe=se,se=Pe;for(;;){if(se===i)break t;if(fe===m&&++ge===w&&(Q=U),fe===_&&++Ee===v&&(ie=U),(Pe=se.nextSibling)!==null)break;se=fe,fe=se.parentNode}se=Pe}m=Q===-1||ie===-1?null:{start:Q,end:ie}}else m=null}m=m||{start:0,end:0}}else m=null;for(US={focusedElem:i,selectionRange:m},dd=!1,d=(d&335544064)===d,rr=a,a=d?9270:1024;rr!==null;){if(i=rr,d&&(m=i.deletions,m!==null))for(w=0;w<m.length;w++)d&&hS(m[w]);if(i.alternate===null&&(i.flags&2)!==0)d&&QO(i),Ug(d);else{if(i.tag===22){if(m=i.alternate,i.memoizedState!==null){m!==null&&m.memoizedState===null&&d&&hS(m),Ug(d);continue}else if(m!==null&&m.memoizedState!==null){d&&QO(i),Ug(d);continue}}m=i.child,(i.subtreeFlags&a)!==0&&m!==null?(m.return=i,rr=m):(d&&eA(i),Ug(d))}}Is=null}function Ug(i){for(;rr!==null;){var a=rr,d=i,m=a.alternate,v=a.flags;switch(a.tag){case 0:case 11:case 15:break;case 1:if((v&1024)!==0&&m!==null){d=void 0,v=m.memoizedProps,m=m.memoizedState;var w=a.stateNode;try{var _=vc(a.type,v);d=w.getSnapshotBeforeUpdate(_,m),w.__reactInternalSnapshotBeforeUpdate=d}catch(U){qt(a,a.return,U)}}break;case 3:if((v&1024)!==0){if(m=a.stateNode.containerInfo,d=m.nodeType,d===9)XS(m);else if(d===1)switch(m.nodeName){case"HEAD":case"HTML":case"BODY":XS(m);break;default:m.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:d&&m!==null&&(d=wi(m.memoizedProps,m.stateNode),v=a.memoizedProps,v=Ei(v.default,v.update),v!=="none"&&Ku(m,d,v,m.memoizedState=[],!0));break;default:if((v&1024)!==0)throw Error(r(163))}if(m=a.sibling,m!==null){m.return=a.return,rr=m;break}rr=a.return}}function sA(i,a,d){var m=d.flags;switch(d.tag){case 0:case 11:case 15:Vo(i,d),m&4&&dh(5,d);break;case 1:if(Vo(i,d),m&4)if(i=d.stateNode,a===null)try{i.componentDidMount()}catch(_){qt(d,d.return,_)}else{var v=vc(d.type,a.memoizedProps);a=a.memoizedState;try{i.componentDidUpdate(v,a,i.__reactInternalSnapshotBeforeUpdate)}catch(_){qt(d,d.return,_)}}m&64&&GO(d),m&512&&Bo(d,d.return);break;case 3:if(Vo(i,d),m&64&&(i=d.updateQueue,i!==null)){if(a=null,d.child!==null)switch(d.child.tag){case 27:case 5:a=d.child.stateNode;break;case 1:a=d.child.stateNode}try{DR(i,a)}catch(_){qt(d,d.return,_)}}break;case 27:a===null&&m&4&&XO(d);case 26:case 5:Vo(i,d),a===null&&m&4&&lS(d),m&512&&Bo(d,d.return);break;case 12:Vo(i,d);break;case 31:Vo(i,d),m&4&&aA(i,d);break;case 13:Vo(i,d),m&4&&cA(i,d),m&64&&(i=d.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(d=f9.bind(null,d),K9(i,d))));break;case 22:if(m=d.memoizedState!==null||nr,!m){var w=a!==null&&a.memoizedState!==null||$t;a=nr,v=$t,nr=m,($t=w)&&!v?(m=2,(d.subtreeFlags&8772)!==0&&(m|=1),yo(i,d,m)):Vo(i,d),nr=a,$t=v}break;case 30:Vo(i,d),m&512&&Bo(d,d.return);break;case 7:m&512&&Bo(d,d.return);default:Vo(i,d)}}function xS(i,a){for(i=i.child;i!==null;)oA(i,a),i=i.sibling}function oA(i,a){switch(i.tag){case 5:case 26:try{var d=i.stateNode;if(a){var m=d.style;typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none"}else{var v=i.stateNode,w=i.memoizedProps.style,_=w!=null&&w.hasOwnProperty("display")?w.display:null;v.style.display=_==null||typeof _=="boolean"?"":(""+_).trim()}}catch(Q){qt(i,i.return,Q)}bS(i,a);break;case 6:try{i.stateNode.nodeValue=a?"":i.memoizedProps,rt=!0}catch(Q){qt(i,i.return,Q)}break;case 18:try{var U=i.stateNode;a?QA(U,!0):QA(i.stateNode,!1)}catch(Q){qt(i,i.return,Q)}break;case 22:case 23:i.memoizedState===null&&xS(i,a);break;default:xS(i,a)}}function bS(i,a){if(i.subtreeFlags&67108864)for(i=i.child;i!==null;){e:{var d=i,m=a;switch(d.tag){case 4:oA(d,m);break e;case 22:d.memoizedState===null&&bS(d,m);break e;default:bS(d,m)}}i=i.sibling}}function iA(i){var a=i.alternate;a!==null&&(i.alternate=null,iA(a)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(a=i.stateNode,a!==null&&Nl(a)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var dn=null,ps=!1;function mo(i,a,d){for(d=d.child;d!==null;)lA(i,a,d),d=d.sibling}function lA(i,a,d){if(Ht&&typeof Ht.onCommitFiberUnmount=="function")try{Ht.onCommitFiberUnmount(On,d)}catch{}switch(d.tag){case 26:$t||xr(d,a),mo(i,a,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&!$t&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:$t||xr(d,a),fh(d);var m=dn,v=ps;Wl(d.type)&&(dn=d.stateNode,ps=!1),mo(i,a,d),dk(d.stateNode,d.type,d.memoizedProps),dn=m,ps=v;break;case 5:$t||xr(d,a),fh(d);case 6:if(d.tag===6&&fh(d),m=dn,v=ps,dn=null,mo(i,a,d),dn=m,ps=v,dn!==null)if(ps)try{(dn.nodeType===9?dn.body:dn.nodeName==="HTML"?dn.ownerDocument.body:dn).removeChild(d.stateNode),rt=!0}catch(w){qt(d,a,w)}else try{dn.removeChild(d.stateNode),rt=!0}catch(w){qt(d,a,w)}break;case 18:dn!==null&&(ps?(i=dn,XA(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,d.stateNode),fd(i)):XA(dn,d.stateNode));break;case 4:m=dn,v=ps,dn=d.stateNode.containerInfo,ps=!0,mo(i,a,d),dn=m,ps=v;break;case 0:case 11:case 14:case 15:$l(2,d,a),$t||$l(4,d,a),mo(i,a,d);break;case 1:$t||(xr(d,a),m=d.stateNode,typeof m.componentWillUnmount=="function"&&KO(d,a,m)),mo(i,a,d);break;case 21:mo(i,a,d);break;case 22:$t=(m=$t)||d.memoizedState!==null,mo(i,a,d),$t=m;break;case 30:xr(d,a),mo(i,a,d);break;case 7:$t||xr(d,a),mo(i,a,d);break;default:mo(i,a,d)}}function aA(i,a){if(a.memoizedState===null&&(i=a.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{fd(i)}catch(d){qt(a,a.return,d)}}}function cA(i,a){if(a.memoizedState===null&&(i=a.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{fd(i)}catch(d){qt(a,a.return,d)}}function t9(i){switch(i.tag){case 31:case 13:case 19:var a=i.stateNode;return a===null&&(a=i.stateNode=new rA),a;case 22:return i=i.stateNode,a=i._retryCache,a===null&&(a=i._retryCache=new rA),a;default:throw Error(r(435,i.tag))}}function Vg(i,a){var d=t9(i);a.forEach(function(m){if(!d.has(m)){d.add(m);var v=h9.bind(null,i,m);m.then(v,v)}})}function Wr(i,a,d){var m=a.deletions;if(m!==null)for(var v=0;v<m.length;v++){var w=m[v],_=i,U=a,Q=U;e:for(;Q!==null;){switch(Q.tag){case 27:if(Wl(Q.type)){dn=Q.stateNode,ps=!1;break e}break;case 5:dn=Q.stateNode,ps=!1;break e;case 3:case 4:dn=Q.stateNode.containerInfo,ps=!0;break e}Q=Q.return}if(dn===null)throw Error(r(160));lA(_,U,w),dn=null,ps=!1,_=w.alternate,_!==null&&(_.return=null),w.return=null}if(a.subtreeFlags&13886)for(a=a.child;a!==null;)uA(a,i,d),a=a.sibling}var go=null;function uA(i,a,d){var m=i.alternate,v=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(v&4&&(m=i.updateQueue,m=m!==null?m.events:null,m!==null))for(var w=0;w<m.length;w++){var _=m[w];_.ref.impl=_.nextImpl}Wr(a,i,d),Xr(i),v&4&&($l(3,i,i.return),dh(3,i),$l(5,i,i.return));break;case 1:Wr(a,i,d),Xr(i),v&512&&($t||m===null||xr(m,m.return)),v&64&&nr&&(i=i.updateQueue,i!==null&&(a=i.callbacks,a!==null&&(d=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=d===null?a:d.concat(a))));break;case 26:if(w=go,Wr(a,i,d),Xr(i),v&512&&($t||m===null||xr(m,m.return)),v&4)if(v=m!==null?m.memoizedState:null,d=i.memoizedState,m===null)if(d===null)if(i.stateNode===null)if(nr)i.stateNode=KA(i.type,i.memoizedProps,a.containerInfo,i);else{e:{a=i.type,d=i.memoizedProps,v=w.ownerDocument||w;t:switch(a){case"title":m=v.getElementsByTagName("title")[0],(!m||m[xi]||m[on]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=v.createElement(a),v.head.insertBefore(m,v.querySelector("head > title"))),br(m,a,d),m[on]=i,Oe(m),a=m;break e;case"link":if(w=yk("link","href",v).get(a+(d.href||""))){for(_=0;_<w.length;_++)if(m=w[_],m.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&m.getAttribute("rel")===(d.rel==null?null:d.rel)&&m.getAttribute("title")===(d.title==null?null:d.title)&&m.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){w.splice(_,1);break t}}m=v.createElement(a),br(m,a,d),v.head.appendChild(m);break;case"meta":if(w=yk("meta","content",v).get(a+(d.content||""))){for(_=0;_<w.length;_++)if(m=w[_],m.getAttribute("content")===(d.content==null?null:""+d.content)&&m.getAttribute("name")===(d.name==null?null:d.name)&&m.getAttribute("property")===(d.property==null?null:d.property)&&m.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&m.getAttribute("charset")===(d.charSet==null?null:d.charSet)){w.splice(_,1);break t}}m=v.createElement(a),br(m,a,d),v.head.appendChild(m);break;default:throw Error(r(468,a))}m[on]=i,Oe(m),a=m}i.stateNode=a}else nr||r1(w,i.type,i.stateNode);else i.stateNode=gk(w,d,i.memoizedProps);else v!==d?(v===null?(a=m.stateNode,a===null||$t||a.parentNode.removeChild(a)):v.count--,d===null?nr||r1(w,i.type,i.stateNode):gk(w,d,i.memoizedProps)):d===null&&i.stateNode!==null&&aS(i,i.memoizedProps,m.memoizedProps);break;case 27:Wr(a,i,d),Xr(i),v&512&&($t||m===null||xr(m,m.return)),m!==null&&v&4&&aS(i,i.memoizedProps,m.memoizedProps);break;case 5:if(w=$o,$o=!1,Wr(a,i,d),$o=w,Xr(i),v&512&&($t||m===null||xr(m,m.return)),i.flags&32){a=i.stateNode;try{qr(a,""),rt=!0}catch(ge){qt(i,i.return,ge)}}v&4&&i.stateNode!=null&&(a=i.memoizedProps,aS(i,a,m!==null?m.memoizedProps:a)),v&1024&&(gS=!0);break;case 6:if(Wr(a,i,d),Xr(i),v&4){if(i.stateNode===null)throw Error(r(162));a=i.memoizedProps,d=i.stateNode;try{d.nodeValue=a,rt=!0}catch(ge){qt(i,i.return,ge)}}break;case 3:if(rt=!1,o0=null,w=go,go=wh(a.containerInfo),Wr(a,i,d),go=w,Xr(i),v&4&&m!==null&&m.memoizedState.isDehydrated)try{fd(a.containerInfo)}catch(ge){qt(i,i.return,ge)}gS&&(gS=!1,dA(i)),rt=!1;break;case 4:v=$o,$o=nr,m=Wn(),w=go,go=wh(i.stateNode.containerInfo),Wr(a,i,d),Xr(i),go=w,rt&&hh&&($g=!0),rt=m,$o=v;break;case 12:Wr(a,i,d),Xr(i);break;case 31:Wr(a,i,d),Xr(i),v&4&&(a=i.updateQueue,a!==null&&(i.updateQueue=null,Vg(i,a)));break;case 13:Wr(a,i,d),Xr(i),i.child.flags&8192&&i.memoizedState!==null!=(m!==null&&m.memoizedState!==null)&&(Kg=cn()),v&4&&(a=i.updateQueue,a!==null&&(i.updateQueue=null,Vg(i,a)));break;case 22:w=i.memoizedState!==null,_=m!==null&&m.memoizedState!==null;var U=nr,Q=$t,ie=$o;nr=U||w,$o=ie||w,$t=Q||_,Wr(a,i,d),$t=Q,$o=ie,nr=U,Xr(i),v&8192&&(a=i.stateNode,a._visibility=w?a._visibility&-2:a._visibility|1,!w||m===null||_||nr||$t||(a=_||$t,d=nr,m=$t,nr=w||nr,$t=a,Ul(i,2),nr=d,$t=m),!w&&$o||xS(i,w)),v&4&&(a=i.updateQueue,a!==null&&(d=a.retryQueue,d!==null&&(a.retryQueue=null,Vg(i,d))));break;case 19:Wr(a,i,d),Xr(i),v&4&&(a=i.updateQueue,a!==null&&(i.updateQueue=null,Vg(i,a)));break;case 30:v&512&&($t||m===null||xr(m,m.return)),v=Wn(),w=hh,_=(d&335544064)===d,U=i.memoizedProps,hh=_&&Ei(U.default,U.update)!=="none",Wr(a,i,d),Xr(i),_&&m!==null&&rt&&(i.flags|=4),hh=w,rt=v;break;case 21:break;case 7:v&512&&($t||m===null||xr(m,m.return)),m&&m.stateNode!==null&&(m.stateNode._fragmentFiber=i);default:Wr(a,i,d),Xr(i)}}function Xr(i){var a=i.flags;if(a&2){try{for(var d,m=i.return;m!==null;){if(WO(m)){d=m;break}m=m.return}m=null;for(var v=i.return;v!==null;){if(iS(v)){var w=v.stateNode;m===null?m=[w]:m.push(w)}if(oS(v))break;v=v.return}var _=m;if(d==null)throw Error(r(160));switch(d.tag){case 27:var U=d.stateNode,Q=cS(i);zg(i,Q,U,_);break;case 5:var ie=d.stateNode;d.flags&32&&(qr(ie,""),d.flags&=-33);var ge=cS(i);zg(i,ge,ie,_);break;case 3:case 4:var Ee=d.stateNode.containerInfo,se=cS(i);uS(i,se,Ee,_);break;default:throw Error(r(161))}}catch(fe){qt(i,i.return,fe)}i.flags&=-3}a&4096&&(i.flags&=-4097)}function dA(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var a=i;dA(a),a.tag===5&&a.flags&1024&&(a=a.stateNode,dd=!0,a.reset(),dd=!1),i=i.sibling}}function Yu(i,a){if(a.subtreeFlags&9270)for(a=a.child;a!==null;)fA(a,i),a=a.sibling;else nA(a)}function fA(i,a){var d=i.alternate;if(d===null)dS(i,!1);else switch(i.tag){case 3:if(yS=Uo=!1,ZO(),Yu(a,i),!Uo&&!$g){if(i=Ho,i!==null)for(var m=0;m<i.length;m+=3){d=i[m];var v=i[m+1];JA(d,i[m+2]),d=d.ownerDocument.documentElement,d!==null&&d.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+v+")"})}i=a.containerInfo,i=i.nodeType===9?i.documentElement:i.ownerDocument.documentElement,i!==null&&i.style.viewTransitionName===""&&(i.style.viewTransitionName="none",i.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),i.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),yS=!0}Ho=null;break;case 5:Yu(a,i);break;case 4:m=Uo,Uo=!1,Yu(a,i),Uo&&($g=!0),Uo=m;break;case 22:i.memoizedState===null&&(d.memoizedState!==null?dS(i,!1):Yu(a,i));break;case 30:m=Uo,v=ZO(),Uo=!1,Yu(a,i),Uo&&(i.flags|=4);var w=i.memoizedProps,_=i.stateNode;a=wi(w,_),_=wi(d.memoizedProps,_);var U=Ei(w.default,w.update);U==="none"?a=!1:(w=d.memoizedState,d.memoizedState=null,d=i.child,hs=0,a=mS(i,d,a,_,U,w,!0),hs!==(w===null?0:w.length)&&(i.flags|=32)),(i.flags&4)!==0&&a?(td(i,i.memoizedProps.onUpdate),Ho=v):v!==null&&(v.push.apply(v,Ho),Ho=v),Uo=(i.flags&32)!==0?!0:m;break;default:Yu(a,i)}}function Vo(i,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)sA(i,a.alternate,a),a=a.sibling}function Ul(i,a){for(i=i.child;i!==null;){var d=i,m=a;switch(d.tag){case 0:case 11:case 14:case 15:$l(4,d,d.return),Ul(d,m);break;case 1:xr(d,d.return);var v=d.stateNode;typeof v.componentWillUnmount=="function"&&KO(d,d.return,v),Ul(d,m);break;case 27:(m&2)!==0&&dk(d.stateNode,d.type,d.memoizedProps);case 5:xr(d,d.return),d.tag!==5&&d.tag!==27||fh(d),Ul(d,m);break;case 6:fh(d);break;case 26:xr(d,d.return),v=d.stateNode,d.memoizedState!==null||v===null||$t||v.parentNode.removeChild(v),Ul(d,m);break;case 22:d.memoizedState===null&&Ul(d,m);break;case 30:xr(d,d.return),Ul(d,m);break;case 7:xr(d,d.return);default:Ul(d,m)}i=i.sibling}}function yo(i,a,d){for(d=(a.subtreeFlags&8772)!==0?d:d&-2,a=a.child;a!==null;){var m=a.alternate,v=i,w=a,_=w.flags,U=(d&1)!==0;switch(w.tag){case 0:case 11:case 15:yo(v,w,d),dh(4,w);break;case 1:if(yo(v,w,d),m=w,v=m.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(ge){qt(m,m.return,ge)}if(m=w,v=m.updateQueue,v!==null){var Q=m.stateNode;try{var ie=v.shared.hiddenCallbacks;if(ie!==null)for(v.shared.hiddenCallbacks=null,v=0;v<ie.length;v++)LR(ie[v],Q)}catch(ge){qt(m,m.return,ge)}}U&&_&64&&GO(w),Bo(w,w.return);break;case 27:(d&2)!==0&&XO(w);case 5:w.tag!==5&&w.tag!==27||YO(w),yo(v,w,d),U&&m===null&&_&4&&lS(w),Bo(w,w.return);break;case 6:YO(w);break;case 26:Q=w.stateNode,w.memoizedState!==null||Q===null||nr||r1(wh(Q.ownerDocument),w.type,Q),yo(v,w,d),U&&m===null&&_&4&&lS(w),Bo(w,w.return);break;case 12:yo(v,w,d);break;case 31:yo(v,w,d),U&&_&4&&aA(v,w);break;case 13:yo(v,w,d),U&&_&4&&cA(v,w);break;case 22:w.memoizedState===null&&yo(v,w,d),Bo(w,w.return);break;case 30:yo(v,w,d),Bo(w,w.return);break;case 7:Bo(w,w.return);default:yo(v,w,d)}a=a.sibling}}function vS(i,a){var d=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),i=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(i=a.memoizedState.cachePool.pool),i!==d&&(i!=null&&i.refCount++,d!=null&&Zf(d))}function SS(i,a){i=null,a.alternate!==null&&(i=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==i&&(a.refCount++,i!=null&&Zf(i))}function Js(i,a,d,m){var v=(d&335544064)===d;if(a.subtreeFlags&(v?10262:10256))for(a=a.child;a!==null;)hA(i,a,d,m),a=a.sibling;else v&&tA(a)}function hA(i,a,d,m){var v=(d&335544064)===d;v&&a.alternate===null&&a.return!==null&&a.return.alternate!==null&&Fg(a);var w=a.flags;switch(a.tag){case 0:case 11:case 15:Js(i,a,d,m),w&2048&&dh(9,a);break;case 1:Js(i,a,d,m);break;case 3:Js(i,a,d,m),v&&yS&&(i=i.containerInfo,i=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,i.style.viewTransitionName==="root"&&(i.style.viewTransitionName=""),i=i.ownerDocument.documentElement,i!==null&&i.style.viewTransitionName==="none"&&(i.style.viewTransitionName="")),w&2048&&(w=null,a.alternate!==null&&(w=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==w&&(a.refCount++,w!=null&&Zf(w)));break;case 12:if(w&2048){Js(i,a,d,m),w=a.stateNode;try{var _=a.memoizedProps,U=_.id,Q=_.onPostCommit;typeof Q=="function"&&Q(U,a.alternate===null?"mount":"update",w.passiveEffectDuration,-0)}catch(ie){qt(a,a.return,ie)}}else Js(i,a,d,m);break;case 31:Js(i,a,d,m);break;case 13:Js(i,a,d,m);break;case 23:break;case 22:_=a.stateNode,U=a.alternate,a.memoizedState!==null?(v&&U!==null&&U.memoizedState===null&&Fg(U),_._visibility&2?Js(i,a,d,m):ph(i,a)):(v&&U!==null&&U.memoizedState!==null&&Fg(a),_._visibility&2?Js(i,a,d,m):(_._visibility|=2,Wu(i,a,d,m,(a.subtreeFlags&10256)!==0||!1))),w&2048&&vS(U,a);break;case 24:Js(i,a,d,m),w&2048&&SS(a.alternate,a);break;case 30:v&&(w=a.alternate,w!==null&&(Fo(w.child,!0),Fo(a.child,!0))),Js(i,a,d,m);break;default:Js(i,a,d,m)}}function Wu(i,a,d,m,v){for(v=v&&((a.subtreeFlags&10256)!==0||!1),a=a.child;a!==null;){var w=i,_=a,U=d,Q=m,ie=_.flags;switch(_.tag){case 0:case 11:case 15:Wu(w,_,U,Q,v),dh(8,_);break;case 23:break;case 22:var ge=_.stateNode;_.memoizedState!==null?ge._visibility&2?Wu(w,_,U,Q,v):ph(w,_):(ge._visibility|=2,Wu(w,_,U,Q,v)),v&&ie&2048&&vS(_.alternate,_);break;case 24:Wu(w,_,U,Q,v),v&&ie&2048&&SS(_.alternate,_);break;default:Wu(w,_,U,Q,v)}a=a.sibling}}function ph(i,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var d=i,m=a,v=m.flags;switch(m.tag){case 22:ph(d,m),v&2048&&vS(m.alternate,m);break;case 24:ph(d,m),v&2048&&SS(m.alternate,m);break;default:ph(d,m)}a=a.sibling}}var Sc=8192;function wc(i,a,d){if(i.subtreeFlags&Sc)for(i=i.child;i!==null;)pA(i,a,d),i=i.sibling}function pA(i,a,d){switch(i.tag){case 26:wc(i,a,d),i.flags&Sc&&(i.memoizedState!==null?lV(d,go,i.memoizedState,i.memoizedProps):(i=i.stateNode,(a&335544128)===a&&Sk(d,i)));break;case 5:wc(i,a,d),i.flags&Sc&&(i=i.stateNode,(a&335544128)===a&&Sk(d,i));break;case 3:case 4:var m=go;go=wh(i.stateNode.containerInfo),wc(i,a,d),go=m;break;case 22:i.memoizedState===null&&(m=i.alternate,m!==null&&m.memoizedState!==null?(m=Sc,Sc=16777216,wc(i,a,d),Sc=m):wc(i,a,d));break;case 30:if((i.flags&Sc)!==0&&(m=i.memoizedProps.name,m!=null&&m!=="auto")){var v=i.stateNode;v.paired=null,Is===null&&(Is=new Map),Is.set(m,v)}wc(i,a,d);break;default:wc(i,a,d)}}function mA(i){var a=i.alternate;if(a!==null&&(i=a.child,i!==null)){a.child=null;do a=i.sibling,i.sibling=null,i=a;while(i!==null)}}function mh(i){var a=i.deletions;if((i.flags&16)!==0){if(a!==null)for(var d=0;d<a.length;d++){var m=a[d];rr=m,yA(m,i)}mA(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)gA(i),i=i.sibling}function gA(i){switch(i.tag){case 0:case 11:case 15:mh(i),i.flags&2048&&$l(9,i,i.return);break;case 3:mh(i);break;case 12:mh(i);break;case 22:var a=i.stateNode;i.memoizedState!==null&&a._visibility&2&&(i.return===null||i.return.tag!==13)?(a._visibility&=-3,qg(i)):mh(i);break;default:mh(i)}}function qg(i){var a=i.deletions;if((i.flags&16)!==0){if(a!==null)for(var d=0;d<a.length;d++){var m=a[d];rr=m,yA(m,i)}mA(i)}for(i=i.child;i!==null;){switch(a=i,a.tag){case 0:case 11:case 15:$l(8,a,a.return),qg(a);break;case 22:d=a.stateNode,d._visibility&2&&(d._visibility&=-3,qg(a));break;default:qg(a)}i=i.sibling}}function yA(i,a){for(;rr!==null;){var d=rr;switch(d.tag){case 0:case 11:case 15:$l(8,d,a);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var m=d.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Zf(d.memoizedState.cache)}if(m=d.child,m!==null)m.return=d,rr=m;else e:for(d=i;rr!==null;){m=rr;var v=m.sibling,w=m.return;if(iA(m),m===d){rr=null;break e}if(v!==null){v.return=w,rr=v;break e}rr=w}}}var n9={getCacheForType:function(i){var a=mr(Pn),d=a.data.get(i);return d===void 0&&(d=i(),a.data.set(i,d)),d},cacheSignal:function(){return mr(Pn).controller.signal}},r9=typeof WeakMap=="function"?WeakMap:Map,zt=0,en=null,wt=null,Tt=0,Vt=0,Ls=null,Vl=!1,Xu=!1,wS=!1,Mi=0,Nn=0,ql=0,Ec=0,Gg=0,Ds=0,Qu=0,gh=null,ms=null,ES=!1,Kg=0,xA=0,Yg=1/0,Wg=null,Gl=null,vn=0,xo=null,Cc=null,qo=0,CS=0,TS=null,bA=null,Zu=null,Ju=null,ed=null,yh=0,Xg=null;function js(){return(zt&2)!==0&&Tt!==0?Tt&-Tt:pe.T!==null?DS():us()}function vA(){if(Ds===0)if((Tt&536870912)===0||vt){var i=ur;ur<<=1,(ur&3932160)===0&&(ur=262144),Ds=i}else Ds=536870912;return i=gr.current,i!==null&&(i.flags|=32),Ds}function td(i,a){if(a!=null){var d=i.stateNode,m=d.ref;m===null&&(m=d.ref=ek(wi(i.memoizedProps,d))),Ju===null&&(Ju=[]),Ju.push(a.bind(null,m))}}function gs(i,a,d){(i===en&&(Vt===2||Vt===9)||i.cancelPendingCommit!==null)&&(nd(i,0),Kl(i,Tt,Ds,!1)),Cs(i,d),((zt&2)===0||i!==en)&&(i===en&&((zt&2)===0&&(Ec|=d),Nn===4&&Kl(i,Tt,Ds,!1)),Go(i))}function SA(i,a,d){if((zt&6)!==0)throw Error(r(327));var m=!d&&(a&127)===0&&(a&i.expiredLanes)===0||kr(i,a),v=m?i9(i,a):RS(i,a,!0),w=m;do{if(v===0){Xu&&!m&&Kl(i,a,0,!1);break}else{if(d=i.current.alternate,w&&!s9(d)){v=RS(i,a,!1),w=!1;continue}if(v===2){if(w=a,i.errorRecoveryDisabledLanes&w)var _=0;else _=i.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){a=_;e:{var U=i;v=gh;var Q=U.current.memoizedState.isDehydrated;if(Q&&(nd(U,_).flags|=256),_=RS(U,_,!1),_!==2&&_!==6){if(wS&&!Q){U.errorRecoveryDisabledLanes|=w,Ec|=w,v=4;break e}w=ms,ms=v,w!==null&&(ms===null?ms=w:ms.push.apply(ms,w))}v=_}if(w=!1,v!==2)continue}}if(v===1){nd(i,0),Kl(i,a,0,!0);break}e:{switch(m=i,w=v,w){case 0:case 1:throw Error(r(345));case 4:if((a&4194048)!==a&&(a&62914560)!==a)break;case 6:Kl(m,a,Ds,!Vl);break e;case 2:ms=null;break;case 3:case 5:break;default:throw Error(r(329))}if((a&62914560)===a&&(v=Kg+300-cn(),10<v)){if(Kl(m,a,Ds,!Vl),Ar(m,0,!0)!==0)break e;qo=a,m.timeoutHandle=GS(wA.bind(null,m,d,ms,Wg,ES,a,Ds,Ec,Qu,Vl,w,"Throttled",-0,0),v);break e}wA(m,d,ms,Wg,ES,a,Ds,Ec,Qu,Vl,w,null,-0,0)}}break}while(!0);Go(i)}function wA(i,a,d,m,v,w,_,U,Q,ie,ge,Ee,se,fe){i.timeoutHandle=-1;var Pe=a.subtreeFlags,qe=(w&335544064)===w;if(Ee=null,(qe||Pe&8192||(Pe&16785408)===16785408)&&(Ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Gr},Is=null,pA(a,w,Ee),qe&&(Pe=Ee,qe=i.containerInfo,qe=(qe.nodeType===9?qe:qe.ownerDocument).__reactViewTransition,qe!=null&&(Pe.count++,Pe.waitingForViewTransition=!0,Pe=Th.bind(Pe),qe.finished.then(Pe,Pe))),Pe=(w&62914560)===w?Kg-cn():(w&4194048)===w?xA-cn():0,Pe=aV(Ee,Pe),Pe!==null)){qo=w,i.cancelPendingCommit=Pe(kA.bind(null,i,a,w,d,m,v,_,U,Q,ie,ge,Ee,null,se,fe)),Kl(i,w,_,!ie);return}kA(i,a,w,d,m,v,_,U,Q,ie,ge,Ee)}function s9(i){for(var a=i;;){var d=a.tag;if((d===0||d===11||d===15)&&a.flags&16384&&(d=a.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var m=0;m<d.length;m++){var v=d[m],w=v.getSnapshot;v=v.value;try{if(!_s(w(),v))return!1}catch{return!1}}if(d=a.child,a.subtreeFlags&16384&&d!==null)d.return=a,a=d;else{if(a===i)break;for(;a.sibling===null;){if(a.return===null||a.return===i)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function Kl(i,a,d,m){a=as(i,a),a&=~Gg,a&=~Ec,i.suspendedLanes|=a,i.pingedLanes&=~a,m&&(i.warmLanes|=a),m=i.expirationTimes;for(var v=a;0<v;){var w=31-Jt(v),_=1<<w;m[w]=-1,v&=~_}d!==0&&Ts(i,d,a)}function Qg(){return(zt&6)===0?(xh(0),!1):!0}function NS(){if(wt!==null){if(Vt===0)var i=wt.return;else i=wt,Ni=dc=null,Lv(i),$u=null,th=0,i=wt;for(;i!==null;)qO(i.alternate,i),i=i.return;wt=null}}function nd(i,a){var d=i.timeoutHandle;return d!==-1&&(i.timeoutHandle=-1,O9(d)),d=i.cancelPendingCommit,d!==null&&(i.cancelPendingCommit=null,d()),qo=0,NS(),en=i,wt=d=Ci(i.current,null),Tt=a,Vt=0,Ls=null,Vl=!1,Xu=kr(i,a),wS=!1,Qu=Ds=Gg=Ec=ql=Nn=0,ms=gh=null,ES=!1,Mi=as(i,a),og(),d}function EA(i,a){pt=null,pe.H=kg,a===Fu||a===gg?(a=kR(),Vt=3):a===Sv?(a=kR(),Vt=4):Vt=a===Wv?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,Ls=a,wt===null&&(Nn=1,_g(i,Ws(a,i.current)))}function CA(){var i=gr.current;return i===null?!0:(Tt&4194048)===Tt?Mr===null:(Tt&62914560)===Tt||(Tt&536870912)!==0?i===Mr:!1}function TA(){var i=pe.H;return pe.H=kg,i===null?kg:i}function NA(){var i=pe.A;return pe.A=n9,i}function Zg(){Nn=4,Vl||(Tt&4194048)!==Tt&&gr.current!==null||(Xu=!0),(ql&134217727)===0&&(Ec&134217727)===0||en===null||Kl(en,Tt,Ds,!1)}function RS(i,a,d){var m=zt;zt|=2;var v=TA(),w=NA();(en!==i||Tt!==a)&&(Wg=null,nd(i,a)),a=!1;var _=Nn;e:do try{if(Vt!==0&&wt!==null){var U=wt,Q=Ls;switch(Vt){case 8:NS(),_=6;break e;case 3:case 2:case 9:case 6:gr.current===null&&(a=!0);var ie=Vt;if(Vt=0,Ls=null,rd(i,U,Q,ie),d&&Xu){_=0;break e}break;default:ie=Vt,Vt=0,Ls=null,rd(i,U,Q,ie)}}o9(),_=Nn;break}catch(ge){EA(i,ge)}while(!0);return a&&i.shellSuspendCounter++,Ni=dc=null,zt=m,pe.H=v,pe.A=w,wt===null&&(en=null,Tt=0,og()),_}function o9(){for(;wt!==null;)RA(wt)}function i9(i,a){var d=zt;zt|=2;var m=TA(),v=NA();en!==i||Tt!==a?(Wg=null,Yg=cn()+500,nd(i,a)):Xu=kr(i,a);e:do try{if(Vt!==0&&wt!==null){a=wt;var w=Ls;t:switch(Vt){case 1:Vt=0,Ls=null,rd(i,a,w,1);break;case 2:case 9:if(OR(w)){Vt=0,Ls=null,OA(a);break}a=function(){Vt!==2&&Vt!==9||en!==i||(Vt=7),Go(i)},w.then(a,a);break e;case 3:Vt=7;break e;case 4:Vt=5;break e;case 7:OR(w)?(Vt=0,Ls=null,OA(a)):(Vt=0,Ls=null,rd(i,a,w,7));break;case 5:var _=null;switch(wt.tag){case 26:_=wt.memoizedState;case 5:case 27:var U=wt;if(_?bk(_):U.stateNode.complete){Vt=0,Ls=null;var Q=U.sibling;if(Q!==null)wt=Q;else{var ie=U.return;ie!==null?(wt=ie,Jg(ie)):wt=null}break t}}Vt=0,Ls=null,rd(i,a,w,5);break;case 6:Vt=0,Ls=null,rd(i,a,w,6);break;case 8:NS(),Nn=6;break e;default:throw Error(r(462))}}l9();break}catch(ge){EA(i,ge)}while(!0);return Ni=dc=null,pe.H=m,pe.A=v,zt=d,wt!==null?0:(en=null,Tt=0,og(),Nn)}function l9(){for(;wt!==null&&!yn();)RA(wt)}function RA(i){var a=UO(i.alternate,i,Mi);i.memoizedProps=i.pendingProps,a===null?Jg(i):wt=a}function OA(i){var a=i,d=a.alternate;switch(a.tag){case 15:case 0:a=jO(d,a,a.pendingProps,a.type,void 0,Tt);break;case 11:a=jO(d,a,a.pendingProps,a.type.render,a.ref,Tt);break;case 5:Lv(a);var m=a;m===tr&&(vt?(dg(m),m.tag===5&&m.stateNode!=null&&(rn=m.stateNode)):(dg(m),vt=!0));default:qO(d,a),a=wt=yR(a,Mi),a=UO(d,a,Mi)}i.memoizedProps=i.pendingProps,a===null?Jg(i):wt=a}function rd(i,a,d,m){Ni=dc=null,Lv(a),$u=null,th=0;var v=a.return;try{if(YU(i,v,a,d,Tt)){Nn=1,_g(i,Ws(d,i.current)),wt=null;return}}catch(w){if(v!==null)throw wt=v,w;Nn=1,_g(i,Ws(d,i.current)),wt=null;return}a.flags&32768?(vt||m===1?i=!0:Xu||(Tt&536870912)!==0?i=!1:(Vl=i=!0,(m===2||m===9||m===3||m===6)&&(m=gr.current,m!==null&&m.tag===13&&(m.flags|=16384))),AA(a,i)):Jg(a)}function Jg(i){var a=i;do{if((a.flags&32768)!==0){AA(a,Vl);return}i=a.return;var d=ZU(a.alternate,a,Mi);if(d!==null){wt=d;return}if(a=a.sibling,a!==null){wt=a;return}wt=a=i}while(a!==null);Nn===0&&(Nn=5)}function AA(i,a){do{var d=JU(i.alternate,i);if(d!==null){d.flags&=32767,wt=d;return}if(d=i.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!a&&(i=i.sibling,i!==null)){wt=i;return}wt=i=d}while(i!==null);Nn=6,wt=null}function kA(i,a,d,m,v,w,_,U,Q,ie,ge,Ee){i.cancelPendingCommit=null;do e0();while(vn!==0);if((zt&6)!==0)throw Error(r(327));if(a!==null){if(a===i.current)throw Error(r(177));i===en&&(wt=en=null,Tt=0),Cc=a,xo=i,qo=d,TS=v,bA=m,a9(i,a,d,_,U,Q,Ee)}}function a9(i,a,d,m,v,w,_){var U=a.lanes|a.childLanes;if(CS=U,U|=av,wl(i,d,U,m,v,w),Ju=null,(d&335544064)===d?(ed=jU(i),m=10262):(ed=null,m=10256),(a.subtreeFlags&m)!==0||(a.flags&m)!==0?(i.callbackNode=null,i.callbackPriority=0,p9(qn,function(){return _S(),null})):(i.callbackNode=null,i.callbackPriority=0),Bg=!1,m=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||m){m=pe.T,pe.T=null,v=le.p,le.p=2,w=zt,zt|=4;try{e9(i,a,d)}finally{zt=w,le.p=v,pe.T=m}}vn=1,Bg?Zu=L9(_,i.containerInfo,ed,OS,AS,u9,kS,_S,c9):(OS(),AS(),kS())}function c9(i){if(vn!==0){var a=xo.onRecoverableError;a(i,{componentStack:null})}}function u9(){vn===3&&(vn=0,fA(Cc,xo),vn=4)}function OS(){if(vn===1){vn=0;var i=xo,a=Cc,d=qo,m=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||m){m=pe.T,pe.T=null;var v=le.p;le.p=2;var w=zt;zt|=4;try{hh=$g=!1,uA(a,i,d),d=US;var _=lR(i.containerInfo),U=d.focusedElem,Q=d.selectionRange;if(_!==U&&U&&U.ownerDocument&&iR(U.ownerDocument.documentElement,U)){if(Q!==null&&rv(U)){var ie=Q.start,ge=Q.end;if(ge===void 0&&(ge=ie),"selectionStart"in U)U.selectionStart=ie,U.selectionEnd=Math.min(ge,U.value.length);else{var Ee=U.ownerDocument||document,se=Ee&&Ee.defaultView||window;if(se.getSelection){var fe=se.getSelection(),Pe=U.textContent.length,qe=Math.min(Q.start,Pe),mt=Q.end===void 0?qe:Math.min(Q.end,Pe);!fe.extend&&qe>mt&&(_=mt,mt=qe,qe=_);var oe=oR(U,qe),te=oR(U,mt);if(oe&&te&&(fe.rangeCount!==1||fe.anchorNode!==oe.node||fe.anchorOffset!==oe.offset||fe.focusNode!==te.node||fe.focusOffset!==te.offset)){var de=Ee.createRange();de.setStart(oe.node,oe.offset),fe.removeAllRanges(),qe>mt?(fe.addRange(de),fe.extend(te.node,te.offset)):(de.setEnd(te.node,te.offset),fe.addRange(de))}}}}for(Ee=[],fe=U;fe=fe.parentNode;)fe.nodeType===1&&Ee.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<Ee.length;U++){var we=Ee[U];we.element.scrollLeft=we.left,we.element.scrollTop=we.top}}dd=!!$S,US=$S=null}finally{zt=w,le.p=v,pe.T=m}}i.current=a,vn=2}}function AS(){if(vn===2){vn=0;var i=xo,a=Cc,d=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||d){d=pe.T,pe.T=null;var m=le.p;le.p=2;var v=zt;zt|=4;try{sA(i,a.alternate,a)}finally{zt=v,le.p=m,pe.T=d}}vn=3}}function kS(){if(vn===4||vn===3){vn=0;var i=Zu;Zu=null,Fr();var a=xo,d=Cc,m=qo,v=bA,w=(m&335544064)===m?10262:10256;if((d.subtreeFlags&w)!==0||(d.flags&w)!==0?vn=5:(vn=0,Cc=xo=null,_A(a,a.pendingLanes)),w=a.pendingLanes,w===0&&(Gl=null),cs(m),d=d.stateNode,Ht&&typeof Ht.onCommitFiberRoot=="function")try{Ht.onCommitFiberRoot(On,d,void 0,(d.current.flags&128)===128)}catch{}if(v!==null){d=pe.T,w=le.p,le.p=2,pe.T=null;try{for(var _=a.onRecoverableError,U=0;U<v.length;U++){var Q=v[U];_(Q.value,{componentStack:Q.stack})}}finally{pe.T=d,le.p=w}}if(v=Ju,_=ed,ed=null,v!==null&&(Ju=null,_===null&&(_=[]),i!==null))for(Q=0;Q<v.length;Q++)d=(0,v[Q])(_),d!==void 0&&i.finished.finally(d);(qo&3)!==0&&e0(),Go(a),w=a.pendingLanes,(m&261930)!==0&&(w&42)!==0?a===Xg?yh++:(yh=0,Xg=a):(yh=0,Xg=null),xh(0)}}function _A(i,a){(i.pooledCacheLanes&=a)===0&&(a=i.pooledCache,a!=null&&(i.pooledCache=null,Zf(a)))}function e0(){return Zu!==null&&(Zu.skipTransition(),Zu=null),OS(),AS(),kS(),_S()}function _S(){if(vn!==5)return!1;var i=xo,a=CS;CS=0;var d=cs(qo),m=pe.T,v=le.p;try{le.p=32>d?32:d,pe.T=null,d=TS,TS=null;var w=xo,_=qo;if(vn=0,Cc=xo=null,qo=0,(zt&6)!==0)throw Error(r(331));var U=zt;if(zt|=4,gA(w.current),hA(w,w.current,_,d),zt=U,xh(0,!1),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(On,w)}catch{}return!0}finally{le.p=v,pe.T=m,_A(i,a)}}function MA(i,a,d){a=Ws(d,a),a=Yv(i.stateNode,a,2),i=zl(i,a,2),i!==null&&(Cs(i,2),Go(i))}function qt(i,a,d){if(i.tag===3)MA(i,i,d);else for(;a!==null;){if(a.tag===3){MA(a,i,d);break}else if(a.tag===1){var m=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Gl===null||!Gl.has(m))){i=Ws(d,i),d=OO(2),m=zl(a,d,2),m!==null&&(AO(d,m,a,i),Cs(m,2),Go(m));break}}a=a.return}}function MS(i,a,d){var m=i.pingCache;if(m===null){m=i.pingCache=new r9;var v=new Set;m.set(a,v)}else v=m.get(a),v===void 0&&(v=new Set,m.set(a,v));v.has(d)||(wS=!0,v.add(d),i=d9.bind(null,i,a,d),a.then(i,i))}function d9(i,a,d){var m=i.pingCache;m!==null&&m.delete(a),i.pingedLanes|=i.suspendedLanes&d,i.warmLanes&=~d,en===i&&(Tt&d)===d&&((Nn===4||Nn===3&&(Tt&62914560)===Tt&&300>cn()-Kg)&&(zt&2)===0?nd(i,0):Gg|=d,Qu===Tt&&(Qu=0)),Go(i)}function IA(i,a){a===0&&(a=fr()),i=ac(i,a),i!==null&&(Cs(i,a),Go(i))}function f9(i){var a=i.memoizedState,d=0;a!==null&&(d=a.retryLane),IA(i,d)}function h9(i,a){var d=0;switch(i.tag){case 31:case 13:var m=i.stateNode,v=i.memoizedState;v!==null&&(d=v.retryLane);break;case 19:m=i.stateNode;break;case 22:m=i.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(a),IA(i,d)}function p9(i,a){return Ot(i,a)}var sd=null,od=null,IS=!1,t0=!1,LS=!1,Yl=0;function Go(i){i!==od&&i.next===null&&(od===null?sd=od=i:od=od.next=i),t0=!0,IS||(IS=!0,g9())}function xh(i,a){if(!LS&&t0){LS=!0;do for(var d=!1,m=sd;m!==null;){if(i!==0){var v=m.pendingLanes;if(v===0)var w=0;else{var _=m.suspendedLanes,U=m.pingedLanes;w=(1<<31-Jt(42|i)+1)-1,w&=v&~(_&~U),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,PA(m,w))}else w=Tt,w=Ar(m,m===en?w:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(w&3)===0||kr(m,w)||(d=!0,PA(m,w));m=m.next}while(d);LS=!1}}function m9(){LA()}function LA(){t0=IS=!1;var i=0;Yl!==0&&R9()&&(i=Yl);for(var a=cn(),d=null,m=sd;m!==null;){var v=m.next,w=DA(m,a);w===0?(m.next=null,d===null?sd=v:d.next=v,v===null&&(od=d)):(d=m,(i!==0||(w&3)!==0)&&(t0=!0)),m=v}vn!==0&&vn!==5||xh(i),Yl!==0&&(Yl=0)}function DA(i,a){for(var d=i.suspendedLanes,m=i.pingedLanes,v=i.expirationTimes,w=i.pendingLanes&-62914561;0<w;){var _=31-Jt(w),U=1<<_,Q=v[_];Q===-1?((U&d)===0||(U&m)!==0)&&(v[_]=fo(U,a)):Q<=a&&(i.expiredLanes|=U),w&=~U}if(a=en,d=Tt,d=Ar(i,i===a?d:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),m=i.callbackNode,d===0||i===a&&(Vt===2||Vt===9)||i.cancelPendingCommit!==null)return m!==null&&m!==null&&gn(m),i.callbackNode=null,i.callbackPriority=0;if((d&3)===0||kr(i,d)){if(a=d&-d,a===i.callbackPriority)return a;switch(m!==null&&gn(m),cs(d)){case 2:case 8:d=Es;break;case 32:d=qn;break;case 268435456:d=un;break;default:d=qn}return m=jA.bind(null,i),d=Ot(d,m),i.callbackPriority=a,i.callbackNode=d,a}return m!==null&&m!==null&&gn(m),i.callbackPriority=2,i.callbackNode=null,2}function jA(i,a){if(vn!==0&&vn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var d=i.callbackNode;if(e0()&&i.callbackNode!==d)return null;var m=Tt;return m=Ar(i,i===en?m:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),m===0?null:(SA(i,m,a),DA(i,cn()),i.callbackNode!=null&&i.callbackNode===d?jA.bind(null,i):null)}function PA(i,a){if(e0())return null;SA(i,a,!0)}function g9(){A9(function(){(zt&6)!==0?Ot($r,m9):LA()})}function DS(){if(Yl===0){var i=pc;i===0&&(i=cr,cr<<=1,(cr&261888)===0&&(cr=256)),Yl=i}return Yl}function zA(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:hr(i)}function y9(i,a,d,m,v){if(a==="submit"&&d&&d.stateNode===v){var w=zA((v[Yn]||null).action),_=m.submitter;_&&(a=(a=_[Yn]||null)?zA(a.formAction):_.getAttribute("formAction"),a!==null&&(w=a,_=null));var U=new tg("action","action",null,m,v);i.push({event:U,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Yl!==0){var Q=new FormData(v,_);Uv(d,{pending:!0,data:Q,method:v.method,action:w},null,Q)}}else typeof w=="function"&&(U.preventDefault(),Q=new FormData(v,_),Uv(d,{pending:!0,data:Q,method:v.method,action:w},w,Q))},currentTarget:v}]})}}for(var jS=0;jS<lv.length;jS++){var PS=lv[jS],x9=PS.toLowerCase(),b9=PS[0].toUpperCase()+PS.slice(1);po(x9,"on"+b9)}po(uR,"onAnimationEnd"),po(dR,"onAnimationIteration"),po(fR,"onAnimationStart"),po("dblclick","onDoubleClick"),po("focusin","onFocus"),po("focusout","onBlur"),po(OU,"onTransitionRun"),po(AU,"onTransitionStart"),po(kU,"onTransitionCancel"),po(hR,"onTransitionEnd"),Ft("onMouseEnter",["mouseout","mouseover"]),Ft("onMouseLeave",["mouseout","mouseover"]),Ft("onPointerEnter",["pointerout","pointerover"]),Ft("onPointerLeave",["pointerout","pointerover"]),ut("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ut("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ut("onBeforeInput",["compositionend","keypress","textInput","paste"]),ut("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ut("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ut("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bh="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),v9=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bh));function BA(i,a){a=(a&4)!==0;for(var d=0;d<i.length;d++){var m=i[d],v=m.event;m=m.listeners;e:{var w=void 0;if(a)for(var _=m.length-1;0<=_;_--){var U=m[_],Q=U.instance,ie=U.currentTarget;if(U=U.listener,Q!==w&&v.isPropagationStopped())break e;w=U,v.currentTarget=ie;try{w(v)}catch(ge){sg(ge)}v.currentTarget=null,w=Q}else for(_=0;_<m.length;_++){if(U=m[_],Q=U.instance,ie=U.currentTarget,U=U.listener,Q!==w&&v.isPropagationStopped())break e;w=U,v.currentTarget=ie;try{w(v)}catch(ge){sg(ge)}v.currentTarget=null,w=Q}}}}function Et(i,a){var d=a[ec];d===void 0&&(d=a[ec]=new Set);var m=i+"__bubble";d.has(m)||(HA(a,i,2,!1),d.add(m))}function zS(i,a,d){var m=0;a&&(m|=4),HA(d,i,m,a)}var n0="_reactListening"+Math.random().toString(36).slice(2);function BS(i){if(!i[n0]){i[n0]=!0,lt.forEach(function(d){d!=="selectionchange"&&(v9.has(d)||zS(d,!1,i),zS(d,!0,i))});var a=i.nodeType===9?i:i.ownerDocument;a===null||a[n0]||(a[n0]=!0,zS("selectionchange",!1,a))}}function HA(i,a,d,m){switch(Ak(a)){case 2:var v=fV;break;case 8:v=hV;break;default:v=o1}d=v.bind(null,a,d,i),v=void 0,!oc||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(v=!0),m?v!==void 0?i.addEventListener(a,d,{capture:!0,passive:v}):i.addEventListener(a,d,!0):v!==void 0?i.addEventListener(a,d,{passive:v}):i.addEventListener(a,d,!1)}function HS(i,a,d,m,v){var w=m;if((a&1)===0&&(a&2)===0&&m!==null)e:for(;;){if(m===null)return;var _=m.tag;if(_===3||_===4){var U=m.stateNode.containerInfo;if(U===v)break;if(_===4)for(_=m.return;_!==null;){var Q=_.tag;if((Q===3||Q===4)&&_.stateNode.containerInfo===v)return;_=_.return}for(;U!==null;){if(_=Ns(U),_===null)return;if(Q=_.tag,Q===5||Q===6||Q===26||Q===27){m=w=_;continue e}U=U.parentNode}}m=m.return}sc(function(){var ie=w,ge=rc(d),Ee=[];e:{var se=pR.get(i);if(se!==void 0){var fe=tg,Pe=i;switch(i){case"keypress":if(Jm(d)===0)break e;case"keydown":case"keyup":fe=sU;break;case"focusin":Pe="focus",fe=Qb;break;case"focusout":Pe="blur",fe=Qb;break;case"beforeblur":case"afterblur":fe=Qb;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=UN;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=G7;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=cU;break;case uR:case dR:case fR:fe=W7;break;case hR:fe=dU;break;case"scroll":case"scrollend":fe=V7;break;case"wheel":fe=hU;break;case"copy":case"cut":case"paste":fe=Q7;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=qN;break;case"submit":fe=lU;break;case"toggle":case"beforetoggle":fe=mU}var qe=(a&4)!==0,mt=!qe&&(i==="scroll"||i==="scrollend"),oe=qe?se!==null?se+"Capture":null:se;qe=[];for(var te=ie,de;te!==null;){var we=te;if(de=we.stateNode,we=we.tag,we!==5&&we!==26&&we!==27||de===null||oe===null||(we=Si(te,oe),we!=null&&qe.push(vh(te,we,de))),mt)break;te=te.return}0<qe.length&&(se=new fe(se,Pe,null,d,ge),Ee.push({event:se,listeners:qe}))}}if((a&7)===0){e:{if(fe=i==="mouseover"||i==="pointerover",se=i==="mouseout"||i==="pointerout",fe&&d!==nc&&(Pe=d.relatedTarget||d.fromElement)&&(Ns(Pe)||Pe[Vr]))break e;(se||fe)&&(Pe=ge.window===ge?ge:(fe=ge.ownerDocument)?fe.defaultView||fe.parentWindow:window,se?(fe=d.relatedTarget||d.toElement,se=ie,fe=fe?Ns(fe):null,fe!==null&&(mt=o(fe),qe=fe.tag,fe!==mt||qe!==5&&qe!==27&&qe!==6)&&(fe=null)):(se=null,fe=ie),se!==fe&&(qe=UN,we="onMouseLeave",oe="onMouseEnter",te="mouse",(i==="pointerout"||i==="pointerover")&&(qe=qN,we="onPointerLeave",oe="onPointerEnter",te="pointer"),mt=se==null?Pe:me(se),de=fe==null?Pe:me(fe),Pe=new qe(we,te+"leave",se,d,ge),Pe.target=mt,Pe.relatedTarget=de,we=null,Ns(ge)===ie&&(qe=new qe(oe,te+"enter",fe,d,ge),qe.target=de,qe.relatedTarget=mt,we=qe),mt=we,qe=se&&fe?M(se,fe,S9):null,se!==null&&FA(Ee,Pe,se,qe,!1),fe!==null&&mt!==null&&FA(Ee,mt,fe,qe,!0)))}e:{if(se=ie?me(ie):window,fe=se.nodeName&&se.nodeName.toLowerCase(),fe==="select"||fe==="input"&&se.type==="file")var $e=JN;else if(QN(se))if(eR)$e=TU;else{$e=EU;var Nt=wU}else fe=se.nodeName,!fe||fe.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?ie&&tc(ie.elementType)&&($e=JN):$e=CU;if($e&&($e=$e(i,ie))){ZN(Ee,$e,d,ge);break e}Nt&&Nt(i,se,ie)}switch(Nt=ie?me(ie):window,i){case"focusin":(QN(Nt)||Nt.contentEditable==="true")&&(Iu=Nt,sv=ie,Wf=null);break;case"focusout":Wf=sv=Iu=null;break;case"mousedown":ov=!0;break;case"contextmenu":case"mouseup":case"dragend":ov=!1,aR(Ee,d,ge);break;case"selectionchange":if(RU)break;case"keydown":case"keyup":aR(Ee,d,ge)}var Xe;if(Jb)e:{switch(i){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else Mu?WN(i,d)&&(ot="onCompositionEnd"):i==="keydown"&&d.keyCode===229&&(ot="onCompositionStart");ot&&(GN&&d.locale!=="ko"&&(Mu||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&Mu&&(Xe=FN()):(Al=ge,Yb="value"in Al?Al.value:Al.textContent,Mu=!0)),Nt=r0(ie,ot),0<Nt.length&&(ot=new VN(ot,i,null,d,ge),Ee.push({event:ot,listeners:Nt}),Xe?ot.data=Xe:(Xe=XN(d),Xe!==null&&(ot.data=Xe)))),(Xe=yU?xU(i,d):bU(i,d))&&(ot=r0(ie,"onBeforeInput"),0<ot.length&&(Nt=new VN("onBeforeInput","beforeinput",null,d,ge),Ee.push({event:Nt,listeners:ot}),Nt.data=Xe)),y9(Ee,i,ie,d,ge)}BA(Ee,a)})}function vh(i,a,d){return{instance:i,listener:a,currentTarget:d}}function r0(i,a){for(var d=a+"Capture",m=[];i!==null;){var v=i,w=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||w===null||(v=Si(i,d),v!=null&&m.unshift(vh(i,v,w)),v=Si(i,a),v!=null&&m.push(vh(i,v,w))),i.tag===3)return m;i=i.return}return[]}function S9(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function FA(i,a,d,m,v){for(var w=a._reactName,_=[];d!==null&&d!==m;){var U=d,Q=U.alternate,ie=U.stateNode;if(U=U.tag,Q!==null&&Q===m)break;U!==5&&U!==26&&U!==27||ie===null||(Q=ie,v?(ie=Si(d,w),ie!=null&&_.unshift(vh(d,ie,Q))):v||(ie=Si(d,w),ie!=null&&_.push(vh(d,ie,Q)))),d=d.return}_.length!==0&&i.push({event:a,listeners:_})}var w9=/\r\n?/g,E9=/\u0000|\uFFFD/g;function $A(i){return(typeof i=="string"?i:""+i).replace(w9,`
|
|
50
|
-
`).replace(E9,"")}function UA(i,a){return a=$A(a),$A(i)===a}function Gt(i,a,d,m,v,w){switch(d){case"children":if(typeof m=="string")a==="body"||a==="textarea"&&m===""||qr(i,m);else if(typeof m=="number"||typeof m=="bigint")a!=="body"&&qr(i,""+m);else return;break;case"className":Rs(i,"class",m);break;case"tabIndex":Rs(i,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Rs(i,d,m);break;case"style":As(i,m,w);return;case"data":if(a!=="object"){Rs(i,"data",m);break}case"src":case"href":if(m===""&&(a!=="a"||d!=="href")){i.removeAttribute(d);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){i.removeAttribute(d);break}m=hr(m),i.setAttribute(d,m);break;case"action":case"formAction":if(typeof m=="function"){i.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(d==="formAction"?(a!=="input"&&Gt(i,a,"name",v.name,v,null),Gt(i,a,"formEncType",v.formEncType,v,null),Gt(i,a,"formMethod",v.formMethod,v,null),Gt(i,a,"formTarget",v.formTarget,v,null)):(Gt(i,a,"encType",v.encType,v,null),Gt(i,a,"method",v.method,v,null),Gt(i,a,"target",v.target,v,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){i.removeAttribute(d);break}m=hr(m),i.setAttribute(d,m);break;case"onClick":m!=null&&(i.onclick=Gr);return;case"onScroll":m!=null&&Et("scroll",i);return;case"onScrollEnd":m!=null&&Et("scrollend",i);return;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(d=m.__html,d!=null){if(v.children!=null)throw Error(r(60));(w!=null?w.__html:void 0)!==d&&(i.innerHTML=d)}}break;case"multiple":i.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":i.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){i.removeAttribute("xlink:href");break}d=hr(m),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?i.setAttribute(d,m):i.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?i.setAttribute(d,""):i.removeAttribute(d);break;case"capture":case"download":m===!0?i.setAttribute(d,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?i.setAttribute(d,m):i.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?i.setAttribute(d,m):i.removeAttribute(d);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?i.removeAttribute(d):i.setAttribute(d,m);break;case"popover":Et("beforetoggle",i),Et("toggle",i),bn(i,"popover",m);break;case"xlinkActuate":Dn(i,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Dn(i,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Dn(i,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Dn(i,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Dn(i,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Dn(i,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Dn(i,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Dn(i,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Dn(i,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":bn(i,"is",m);break;case"innerText":case"textContent":return;default:if(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")d=Hf.get(d)||d,bn(i,d,m);else return}rt=!0}function FS(i,a,d,m,v,w){switch(d){case"style":As(i,m,w);return;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(d=m.__html,d!=null){if(v.children!=null)throw Error(r(60));(w!=null?w.__html:void 0)!==d&&(i.innerHTML=d)}}break;case"children":if(typeof m=="string")qr(i,m);else if(typeof m=="number"||typeof m=="bigint")qr(i,""+m);else return;break;case"onScroll":m!=null&&Et("scroll",i);return;case"onScrollEnd":m!=null&&Et("scrollend",i);return;case"onClick":m!=null&&(i.onclick=Gr);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!it.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(v=d.endsWith("Capture"),w=d.slice(2,v?d.length-7:void 0),a=i[Yn]||null,a=a!=null?a[d]:null,typeof a=="function"&&i.removeEventListener(w,a,v),typeof m=="function")){typeof a!="function"&&a!==null&&(d in i?i[d]=null:i.hasAttribute(d)&&i.removeAttribute(d)),i.addEventListener(w,m,v);break e}rt=!0,d in i?i[d]=m:m===!0?i.setAttribute(d,""):bn(i,d,m)}return}rt=!0}function br(i,a,d){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Et("error",i),Et("load",i);var m=!1,v=!1,w;for(w in d)if(d.hasOwnProperty(w)){var _=d[w];if(_!=null)switch(w){case"src":m=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Gt(i,a,w,_,d,null)}}v&&Gt(i,a,"srcSet",d.srcSet,d,null),m&&Gt(i,a,"src",d.src,d,null);return;case"input":Et("invalid",i);var U=w=_=v=null,Q=null,ie=null;for(m in d)if(d.hasOwnProperty(m)){var ge=d[m];if(ge!=null)switch(m){case"name":v=ge;break;case"type":_=ge;break;case"checked":Q=ge;break;case"defaultChecked":ie=ge;break;case"value":w=ge;break;case"defaultValue":U=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(r(137,a));break;default:Gt(i,a,m,ge,d,null)}}Rl(i,w,U,Q,ie,_,v,!1);return;case"select":Et("invalid",i),m=_=w=null;for(v in d)if(d.hasOwnProperty(v)&&(U=d[v],U!=null))switch(v){case"value":w=U;break;case"defaultValue":_=U;break;case"multiple":m=U;default:Gt(i,a,v,U,d,null)}a=w,d=_,i.multiple=!!m,a!=null?ds(i,!!m,a,!1):d!=null&&ds(i,!!m,d,!0);return;case"textarea":Et("invalid",i),w=v=m=null;for(_ in d)if(d.hasOwnProperty(_)&&(U=d[_],U!=null))switch(_){case"value":m=U;break;case"defaultValue":v=U;break;case"children":w=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(91));break;default:Gt(i,a,_,U,d,null)}Os(i,m,v,w);return;case"option":for(Q in d)if(d.hasOwnProperty(Q)&&(m=d[Q],m!=null))switch(Q){case"selected":i.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:Gt(i,a,Q,m,d,null)}return;case"dialog":Et("beforetoggle",i),Et("toggle",i),Et("cancel",i),Et("close",i);break;case"iframe":case"object":Et("load",i);break;case"video":case"audio":for(m=0;m<bh.length;m++)Et(bh[m],i);break;case"image":Et("error",i),Et("load",i);break;case"details":Et("toggle",i);break;case"embed":case"source":case"link":Et("error",i),Et("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in d)if(d.hasOwnProperty(ie)&&(m=d[ie],m!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,a));default:Gt(i,a,ie,m,d,null)}return;default:if(tc(a)){for(ge in d)d.hasOwnProperty(ge)&&(m=d[ge],m!==void 0&&FS(i,a,ge,m,d,void 0));return}}for(U in d)d.hasOwnProperty(U)&&(m=d[U],m!=null&&Gt(i,a,U,m,d,null))}var C9={};function T9(i,a,d,m){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,w=null,_=null,U=null,Q=null,ie=null,ge=null;for(fe in d){var Ee=d[fe];if(d.hasOwnProperty(fe)&&Ee!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":Q=Ee;default:m.hasOwnProperty(fe)||Gt(i,a,fe,null,m,Ee)}}for(var se in m){var fe=m[se];if(Ee=d[se],m.hasOwnProperty(se)&&(fe!=null||Ee!=null))switch(se){case"type":fe!==Ee&&(rt=!0),w=fe;break;case"name":fe!==Ee&&(rt=!0),v=fe;break;case"checked":fe!==Ee&&(rt=!0),ie=fe;break;case"defaultChecked":fe!==Ee&&(rt=!0),ge=fe;break;case"value":fe!==Ee&&(rt=!0),_=fe;break;case"defaultValue":fe!==Ee&&(rt=!0),U=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,a));break;default:fe!==Ee&&Gt(i,a,se,fe,m,Ee)}}_r(i,_,U,Q,ie,ge,w,v);return;case"select":fe=_=U=se=null;for(w in d)if(Q=d[w],d.hasOwnProperty(w)&&Q!=null)switch(w){case"value":break;case"multiple":fe=Q;default:m.hasOwnProperty(w)||Gt(i,a,w,null,m,Q)}for(v in m)if(w=m[v],Q=d[v],m.hasOwnProperty(v)&&(w!=null||Q!=null))switch(v){case"value":w!==Q&&(rt=!0),se=w;break;case"defaultValue":w!==Q&&(rt=!0),U=w;break;case"multiple":w!==Q&&(rt=!0),_=w;default:w!==Q&&Gt(i,a,v,w,m,Q)}a=U,d=_,m=fe,se!=null?ds(i,!!d,se,!1):!!m!=!!d&&(a!=null?ds(i,!!d,a,!0):ds(i,!!d,d?[]:"",!1));return;case"textarea":fe=se=null;for(U in d)if(v=d[U],d.hasOwnProperty(U)&&v!=null&&!m.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:Gt(i,a,U,null,m,v)}for(_ in m)if(v=m[_],w=d[_],m.hasOwnProperty(_)&&(v!=null||w!=null))switch(_){case"value":v!==w&&(rt=!0),se=v;break;case"defaultValue":v!==w&&(rt=!0),fe=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==w&&Gt(i,a,_,v,m,w)}_u(i,se,fe);return;case"option":for(var Pe in d)if(se=d[Pe],d.hasOwnProperty(Pe)&&se!=null&&!m.hasOwnProperty(Pe))switch(Pe){case"selected":i.selected=!1;break;default:Gt(i,a,Pe,null,m,se)}for(Q in m)if(se=m[Q],fe=d[Q],m.hasOwnProperty(Q)&&se!==fe&&(se!=null||fe!=null))switch(Q){case"selected":se!==fe&&(rt=!0),i.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:Gt(i,a,Q,se,m,fe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var qe in d)se=d[qe],d.hasOwnProperty(qe)&&se!=null&&!m.hasOwnProperty(qe)&&Gt(i,a,qe,null,m,se);for(ie in m)if(se=m[ie],fe=d[ie],m.hasOwnProperty(ie)&&se!==fe&&(se!=null||fe!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,a));break;default:Gt(i,a,ie,se,m,fe)}return;default:if(tc(a)){for(var mt in d)se=d[mt],d.hasOwnProperty(mt)&&se!==void 0&&!m.hasOwnProperty(mt)&&FS(i,a,mt,void 0,m,se);for(ge in m)se=m[ge],fe=d[ge],!m.hasOwnProperty(ge)||se===fe||se===void 0&&fe===void 0||FS(i,a,ge,se,m,fe);return}}for(var oe in d)se=d[oe],d.hasOwnProperty(oe)&&se!=null&&!m.hasOwnProperty(oe)&&Gt(i,a,oe,null,m,se);for(Ee in m)se=m[Ee],fe=d[Ee],!m.hasOwnProperty(Ee)||se===fe||se==null&&fe==null||Gt(i,a,Ee,se,m,fe)}function VA(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function N9(){if(typeof performance.getEntriesByType=="function"){for(var i=0,a=0,d=performance.getEntriesByType("resource"),m=0;m<d.length;m++){var v=d[m],w=v.transferSize,_=v.initiatorType,U=v.duration;if(w&&U&&VA(_)){for(_=0,U=v.responseEnd,m+=1;m<d.length;m++){var Q=d[m],ie=Q.startTime;if(ie>U)break;var ge=Q.transferSize,Ee=Q.initiatorType;ge&&VA(Ee)&&(Q=Q.responseEnd,_+=ge*(Q<U?1:(U-ie)/(Q-ie)))}if(--m,a+=8*(w+_)/(v.duration/1e3),i++,10<i)break}}if(0<i)return a/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var $S=null,US=null;function Sh(i){return i.nodeType===9?i:i.ownerDocument}function qA(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function GA(i,a){if(i===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&a==="foreignObject"?0:i}function KA(i,a,d,m){return d=Sh(d).createElement(i),d[on]=m,d[Yn]=a,br(d,i,a),Oe(d),d}function VS(i,a){return i==="textarea"||i==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var qS=null;function R9(){var i=window.event;return i&&i.type==="popstate"?i===qS?!1:(qS=i,!0):(qS=null,!1)}var GS=typeof setTimeout=="function"?setTimeout:void 0,O9=typeof clearTimeout=="function"?clearTimeout:void 0,YA=typeof Promise=="function"?Promise:void 0,WA=typeof requestAnimationFrame=="function"?requestAnimationFrame:GS,A9=typeof queueMicrotask=="function"?queueMicrotask:typeof YA<"u"?function(i){return YA.resolve(null).then(i).catch(k9)}:GS;function k9(i){setTimeout(function(){throw i})}function Wl(i){return i==="head"}function XA(i,a){var d=a,m=0;do{var v=d.nextSibling;if(i.removeChild(d),v&&v.nodeType===8)if(d=v.data,d==="/$"||d==="/&"){if(m===0){i.removeChild(v),fd(a);return}m--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")m++;else if(d==="html")e1(i.ownerDocument.documentElement);else if(d==="head"){d=i.ownerDocument.head,e1(d);for(var w=d.firstChild;w;){var _=w.nextSibling,U=w.nodeName;w[xi]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&w.rel.toLowerCase()==="stylesheet"||d.removeChild(w),w=_}}else d==="body"&&e1(i.ownerDocument.body);d=v}while(d);fd(a)}function QA(i,a){var d=i;i=0;do{var m=d.nextSibling;if(d.nodeType===1?a?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(a?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),m&&m.nodeType===8)if(d=m.data,d==="/$"){if(i===0)break;i--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||i++;d=m}while(d)}function ZA(i,a,d){if(a=CSS.escape(a)!==a?"r-"+btoa(a).replace(/=/g,""):a,i.style.viewTransitionName=a,d!=null&&(i.style.viewTransitionClass=d),d=getComputedStyle(i),d.display==="inline"){if(a=i.getClientRects(),a.length===1)var m=1;else for(var v=m=0;v<a.length;v++){var w=a[v];0<w.width&&0<w.height&&m++}m===1&&(i=i.style,i.display=a.length===1?"inline-block":"block",i.marginTop="-"+d.paddingTop,i.marginBottom="-"+d.paddingBottom)}}function JA(i,a){i=i.style,a=a.style;var d=a!=null?a.hasOwnProperty("viewTransitionName")?a.viewTransitionName:a.hasOwnProperty("view-transition-name")?a["view-transition-name"]:null:null;i.viewTransitionName=d==null||typeof d=="boolean"?"":(""+d).trim(),d=a!=null?a.hasOwnProperty("viewTransitionClass")?a.viewTransitionClass:a.hasOwnProperty("view-transition-class")?a["view-transition-class"]:null:null,i.viewTransitionClass=d==null||typeof d=="boolean"?"":(""+d).trim(),i.display==="inline-block"&&(a==null?i.display=i.margin="":(d=a.display,i.display=d==null||typeof d=="boolean"?"":d,d=a.margin,d!=null?i.margin=d:(d=a.hasOwnProperty("marginTop")?a.marginTop:a["margin-top"],i.marginTop=d==null||typeof d=="boolean"?"":d,a=a.hasOwnProperty("marginBottom")?a.marginBottom:a["margin-bottom"],i.marginBottom=a==null||typeof a=="boolean"?"":a)))}function _9(i,a,d){return d=d.ownerDocument.defaultView,{rect:i,abs:a.position==="absolute"||a.position==="fixed",clip:a.clipPath!=="none"||a.overflow!=="visible"||a.filter!=="none"||a.mask!=="none"||a.mask!=="none"||a.borderRadius!=="0px",view:0<=i.bottom&&0<=i.right&&i.top<=d.innerHeight&&i.left<=d.innerWidth}}function KS(i){var a=i.getBoundingClientRect(),d=getComputedStyle(i);return _9(a,d,i)}function M9(i){return i.documentElement.clientHeight}function I9(i){this.addEventListener("load",i),this.addEventListener("error",i)}function L9(i,a,d,m,v,w,_,U,Q){var ie=a.nodeType===9?a:a.ownerDocument;try{var ge=ie.startViewTransition({update:function(){var se=ie.defaultView,fe=se.navigation&&se.navigation.transition,Pe=ie.fonts.status;m();var qe=[];if(Pe==="loaded"&&(M9(ie),ie.fonts.status==="loading"&&qe.push(ie.fonts.ready)),Pe=qe.length,i!==null)for(var mt=i.suspenseyImages,oe=0,te=0;te<mt.length;te++){var de=mt[te];if(!de.complete){var we=de.getBoundingClientRect();if(0<we.bottom&&0<we.right&&we.top<se.innerHeight&&we.left<se.innerWidth){if(oe+=vk(de),oe>i0){qe.length=Pe;break}de=new Promise(I9.bind(de)),qe.push(de)}}}if(0<qe.length)return se=Promise.race([Promise.all(qe),new Promise(function($e){return setTimeout($e,500)})]).then(v,v),(fe?Promise.allSettled([fe.finished,se]):se).then(w,w);if(v(),fe)return fe.finished.then(w,w);w()},types:d});ie.__reactViewTransition=ge;var Ee=[];return ge.ready.then(function(){for(var se=ie.documentElement.getAnimations({subtree:!0}),fe=0;fe<se.length;fe++){var Pe=se[fe],qe=Pe.effect,mt=qe.pseudoElement;if(mt!=null&&mt.startsWith("::view-transition")){Ee.push(Pe),Pe=qe.getKeyframes();for(var oe=mt=void 0,te=!0,de=0;de<Pe.length;de++){var we=Pe[de],$e=we.width;if(mt===void 0)mt=$e;else if(mt!==$e){te=!1;break}if($e=we.height,oe===void 0)oe=$e;else if(oe!==$e){te=!1;break}delete we.width,delete we.height,we.transform==="none"&&delete we.transform}te&&mt!==void 0&&oe!==void 0&&(qe.setKeyframes(Pe),te=getComputedStyle(qe.target,qe.pseudoElement),te.width!==mt||te.height!==oe)&&(te=Pe[0],te.width=mt,te.height=oe,te=Pe[Pe.length-1],te.width=mt,te.height=oe,qe.setKeyframes(Pe))}}_()},function(se){ie.__reactViewTransition===ge&&(ie.__reactViewTransition=null);try{if(typeof se=="object"&&se!==null)switch(se.name){case"InvalidStateError":(se.message==="View transition was skipped because document visibility state is hidden."||se.message==="Skipping view transition because document visibility state has become hidden."||se.message==="Skipping view transition because viewport size changed."||se.message==="Transition was aborted because of invalid state")&&(se=null)}se!==null&&Q(se)}finally{m(),v(),_()}}),ge.finished.finally(function(){for(var se=0;se<Ee.length;se++)Ee[se].cancel();ie.__reactViewTransition===ge&&(ie.__reactViewTransition=null),U()}),ge}catch{return m(),v(),_(),null}}function Tc(i,a){this._scope=document.documentElement,this._selector="::view-transition-"+i+"("+a+")"}Tc.prototype.animate=function(i,a){return a=typeof a=="number"?{duration:a}:A({},a),a.pseudoElement=this._selector,this._scope.animate(i,a)},Tc.prototype.getAnimations=function(){for(var i=this._scope,a=this._selector,d=i.getAnimations({subtree:!0}),m=[],v=0;v<d.length;v++){var w=d[v].effect;w!==null&&w.target===i&&w.pseudoElement===a&&m.push(d[v])}return m},Tc.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function ek(i){return{name:i,group:new Tc("group",i),imagePair:new Tc("image-pair",i),old:new Tc("old",i),new:new Tc("new",i)}}function Ps(i){this._fragmentFiber=i,this._observers=this._eventListeners=null}Ps.prototype.addEventListener=function(i,a,d){var m=null,v=null;if(!(d!=null&&typeof d!="boolean"&&(m=d.signal||null,m!==null&&m.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var w=this._eventListeners;if(nk(w,i,a,d)===-1){var _=this,U=a;d!=null&&typeof d!="boolean"&&d.once===!0&&(U=function(Q){_.removeEventListener(i,a,d),typeof a=="function"?a.call(this,Q):a.handleEvent(Q)}),m!==null&&(v=_.removeEventListener.bind(_,i,a,d),m.addEventListener("abort",v,{once:!0}),v=m.removeEventListener.bind(m,"abort",v)),m=id(d),w.push({type:i,listener:a,optionsOrUseCapture:d,attachedListener:U,cleanup:v}),p(this._fragmentFiber.child,!1,D9,i,U,m)}this._eventListeners=w}};function D9(i,a,d,m){return E(i).addEventListener(a,d,m),!1}Ps.prototype.removeEventListener=function(i,a,d){var m=this._eventListeners;if(m!==null&&(a=nk(m,i,a,d),a!==-1)){var v=m[a];d=v.attachedListener;var w=v.cleanup;v=id(v.optionsOrUseCapture),p(this._fragmentFiber.child,!1,j9,i,d,v),m.splice(a,1),w!==null&&w()}};function j9(i,a,d,m){return E(i).removeEventListener(a,d,m),!1}function id(i){return i!=null&&typeof i!="boolean"&&(i.once===!0||i.signal instanceof AbortSignal)?{capture:i.capture,passive:i.passive}:i}function tk(i){return i==null?"c=0":typeof i=="boolean"?"c="+(i?"1":"0"):"c="+(i.capture?"1":"0")}function nk(i,a,d,m){if(i.length===0)return-1;m=tk(m);for(var v=0;v<i.length;v++){var w=i[v];if(w.type===a&&w.listener===d&&tk(w.optionsOrUseCapture)===m)return v}return-1}Ps.prototype.dispatchEvent=function(i){var a=y(this._fragmentFiber);if(a===null)return!0;a=E(a);var d=this._eventListeners;if(d!==null&&0<d.length||!i.bubbles){var m=a.nodeType===9?a.createComment(""):document.createTextNode("");if(d)for(var v=0;v<d.length;v++){var w=d[v];m.addEventListener(w.type,w.attachedListener,id(w.optionsOrUseCapture))}if(a.appendChild(m),i=m.dispatchEvent(i),d)for(v=0;v<d.length;v++)w=d[v],m.removeEventListener(w.type,w.attachedListener,id(w.optionsOrUseCapture));return a.removeChild(m),i}return a.dispatchEvent(i)},Ps.prototype.focus=function(i){p(this._fragmentFiber.child,!0,rk,i,void 0,void 0)};function rk(i,a){return i.tag===6?!1:(i=E(i),Y9(i,a))}Ps.prototype.focusLast=function(i){var a=[];p(this._fragmentFiber.child,!0,YS,a,void 0,void 0);for(var d=a.length-1;0<=d&&!rk(a[d],i);d--);};function YS(i,a){return a.push(i),!1}Ps.prototype.blur=function(){var i=y(this._fragmentFiber);i!==null&&(i=E(i),i=Sh(i).activeElement,i!==null&&p(this._fragmentFiber.child,!1,P9,i,void 0,void 0))};function P9(i,a){return i.tag===6?!1:(i=E(i),i===a||i.contains(a)?(a.blur(),!0):!1)}Ps.prototype.observeUsing=function(i){this._observers===null&&(this._observers=new Set),this._observers.add(i),p(this._fragmentFiber.child,!1,z9,i,void 0,void 0)};function z9(i,a){return i.tag===6||(i=E(i),a.observe(i)),!1}Ps.prototype.unobserveUsing=function(i){var a=this._observers;if(a!==null&&a.has(i)){a.delete(i),p(this._fragmentFiber.child,!1,B9,i,void 0,void 0);for(var d=a=0;d<bo.length;d++){var m=bo[d];m.fragmentInstance===this&&m.observer===i?i.unobserve(m.instance):bo[a++]=m}bo.length=a}};function B9(i,a){return i.tag===6||(i=E(i),a.unobserve(i)),!1}var bo=[],WS=!1;function H9(i,a,d){bo.push({fragmentInstance:i,observer:a,instance:d}),WS||(WS=!0,W9(function(){WS=!1;var m=bo;bo=[];for(var v=0;v<m.length;v++){var w=m[v];w.observer.unobserve(w.instance)}}))}Ps.prototype.getClientRects=function(){var i=[];return p(this._fragmentFiber.child,!1,F9,i,void 0,void 0),i};function F9(i,a){if(i.tag===6){i=i.stateNode;var d=i.ownerDocument.createRange();d.selectNodeContents(i),a.push.apply(a,d.getClientRects())}else i=E(i),a.push.apply(a,i.getClientRects());return!1}Ps.prototype.getRootNode=function(i){var a=y(this._fragmentFiber);return a===null?this:E(a).getRootNode(i)},Ps.prototype.compareDocumentPosition=function(i){var a=y(this._fragmentFiber);if(a===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var d=[];p(this._fragmentFiber.child,!1,YS,d,void 0,void 0);var m=E(a);if(d.length===0){if(d=m,x(this._fragmentFiber)){e:{for(a=this._fragmentFiber.return;a!==null;){if(a.tag===4){a=a.stateNode.containerInfo;break e}if(a.tag===3||a.tag===5||a.tag===27)break;a=a.return}a=null}a!=null&&(d=a)}a=this._fragmentFiber;var v=m=d.compareDocumentPosition(i);return d===i?v=Node.DOCUMENT_POSITION_CONTAINS:m&Node.DOCUMENT_POSITION_CONTAINED_BY&&(d=b(a)[1],d===null?v=Node.DOCUMENT_POSITION_PRECEDING:(i=E(d).compareDocumentPosition(i),v=i===0||i&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),v|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}a=E(d[0]),v=E(d[d.length-1]);var w=x(this._fragmentFiber)?a.parentElement:m;if(w==null)return Node.DOCUMENT_POSITION_DISCONNECTED;m=w.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY,w=w.compareDocumentPosition(v)&Node.DOCUMENT_POSITION_CONTAINED_BY;var _=a.compareDocumentPosition(i),U=v.compareDocumentPosition(i),Q=_&Node.DOCUMENT_POSITION_CONTAINED_BY||U&Node.DOCUMENT_POSITION_CONTAINED_BY;return U=m&&w&&_&Node.DOCUMENT_POSITION_FOLLOWING&&U&Node.DOCUMENT_POSITION_PRECEDING,a=m&&a===i||w&&v===i||Q||U?Node.DOCUMENT_POSITION_CONTAINED_BY:!m&&a===i||!w&&v===i?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:_,a&Node.DOCUMENT_POSITION_DISCONNECTED||a&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||$9(a,this._fragmentFiber,d[0],d[d.length-1],i)?a:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function $9(i,a,d,m,v){var w=Ns(v);if(i&Node.DOCUMENT_POSITION_CONTAINED_BY){if(d=!!w)e:{for(;w!==null;){if(w.tag===7&&(w===a||w.alternate===a)){d=!0;break e}w=w.return}d=!1}return d}if(i&Node.DOCUMENT_POSITION_CONTAINS){if(w===null)return w=v.ownerDocument,v===w||v===w.documentElement||v===w.body;e:{for(w=a,a=y(a);w!==null;){if(!(w.tag!==5&&w.tag!==3&&w.tag!==27||w!==a&&w.alternate!==a)){w=!0;break e}w=w.return}w=!1}return w}return i&Node.DOCUMENT_POSITION_PRECEDING?((a=!!w)&&!(a=w===d)&&(a=M(d,w,k),a===null?a=!1:(p(a,!0,T,w,d),w=C,C=null,a=w!==null)),a):i&Node.DOCUMENT_POSITION_FOLLOWING?((a=!!w)&&!(a=w===m)&&(a=M(m,w,k),a===null?a=!1:(p(a,!0,O,w,m),w=C,R=C=null,a=w!==null)),a):!1}function sk(i,a){var d=i.ownerDocument.createRange();d.selectNodeContents(i),i=d.getBoundingClientRect(),window.scrollTo(window.scrollX+i.left,a?window.scrollY+i.top:window.scrollY+i.bottom-window.innerHeight)}Ps.prototype.scrollIntoView=function(i){if(typeof i=="object")throw Error(r(566));var a=[];p(this._fragmentFiber.child,!1,YS,a,void 0,void 0);var d=i!==!1;if(a.length===0){var m=b(this._fragmentFiber);if(m=d?m[1]||m[0]||y(this._fragmentFiber):m[0]||m[1],m===null)return;if(m.tag===6){i=E(m),sk(i,d);return}if(m=E(m),m.nodeType!==9){if(m.nodeType===11){d="host"in m?m.host:null,d!==null&&d.scrollIntoView(i);return}m.scrollIntoView(i)}}for(m=d?a.length-1:0;m!==(d?-1:a.length);){var v=a[m];v.tag===6?(v=E(v),sk(v,d)):E(v).scrollIntoView(i),m+=d?-1:1}};function U9(i,a){return i=E(i),ok(i,a),!1}function ok(i,a){i.reactFragments==null&&(i.reactFragments=new Set),i.reactFragments.add(a)}function ik(i,a){var d=a._eventListeners;if(d!==null)for(var m=0;m<d.length;m++){var v=d[m];i.addEventListener(v.type,v.attachedListener,id(v.optionsOrUseCapture))}i.nodeType!==3&&(d=a._observers,d!==null&&d.forEach(function(w){for(var _=0,U=0;U<bo.length;U++){var Q=bo[U];(Q.fragmentInstance!==a||Q.observer!==w||Q.instance!==i)&&(bo[_++]=Q)}bo.length=_,w.observe(i)}),ok(i,a))}function V9(i,a){var d=a._eventListeners;if(d!==null)for(var m=0;m<d.length;m++){var v=d[m];i.removeEventListener(v.type,v.attachedListener,id(v.optionsOrUseCapture))}i.nodeType!==3&&(d=a._observers,d!==null&&d.forEach(function(w){typeof w.rootMargin=="string"?H9(a,w,i):w.unobserve(i)}),i.reactFragments!=null&&i.reactFragments.delete(a))}function XS(i){var a=i.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var d=a;switch(a=a.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":XS(d),Nl(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}i.removeChild(d)}}function q9(i,a,d,m){for(;i.nodeType===1;){var v=d;if(i.nodeName.toLowerCase()!==a.toLowerCase()){if(!m&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(m){if(!i[xi])switch(a){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(w=i.getAttribute("rel"),w==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(w!==v.rel||i.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||i.getAttribute("title")!==(v.title==null?null:v.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(w=i.getAttribute("src"),(w!==(v.src==null?null:v.src)||i.getAttribute("type")!==(v.type==null?null:v.type)||i.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&w&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(a==="input"&&i.type==="hidden"){var w=v.name==null?null:""+v.name;if(v.type==="hidden"&&i.getAttribute("name")===w)return i}else return i;if(i=eo(i.nextSibling),i===null)break}return null}function G9(i,a,d){if(a==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!d||(i=eo(i.nextSibling),i===null))return null;return i}function lk(i,a){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!a||(i=eo(i.nextSibling),i===null))return null;return i}function QS(i){return i.data==="$?"||i.data==="$~"}function ZS(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function K9(i,a){var d=i.ownerDocument;if(i.data==="$~")i._reactRetry=a;else if(i.data!=="$?"||d.readyState!=="loading")a();else{var m=function(){a(),d.removeEventListener("DOMContentLoaded",m)};d.addEventListener("DOMContentLoaded",m),i._reactRetry=m}}function eo(i){for(;i!=null;i=i.nextSibling){var a=i.nodeType;if(a===1||a===3)break;if(a===8){if(a=i.data,a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"||a==="F!"||a==="F")break;if(a==="/$"||a==="/&")return null}}return i}var JS=null;function ak(i){i=i.nextSibling;for(var a=0;i;){if(i.nodeType===8){var d=i.data;if(d==="/$"||d==="/&"){if(a===0)return eo(i.nextSibling);a--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||a++}i=i.nextSibling}return null}function ck(i){i=i.previousSibling;for(var a=0;i;){if(i.nodeType===8){var d=i.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(a===0)return i;a--}else d!=="/$"&&d!=="/&"||a++}i=i.previousSibling}return null}function Y9(i,a){function d(){m=!0}if(i.ownerDocument.activeElement===i)return!0;var m=!1;try{i.ownerDocument.addEventListener("focus",d,!0),(i.focus||HTMLElement.prototype.focus).call(i,a)}finally{i.ownerDocument.removeEventListener("focus",d,!0)}return m}function W9(i){WA(function(){WA(function(a){return i(a)})})}function uk(i,a,d){switch(a=Sh(d),i){case"html":if(i=a.documentElement,!i)throw Error(r(452));return i;case"head":if(i=a.head,!i)throw Error(r(453));return i;case"body":if(i=a.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function dk(i,a,d){for(var m in d){var v=d[m];d.hasOwnProperty(m)&&v!=null&&Gt(i,a,m,null,C9,v)}d.dangerouslySetInnerHTML!=null&&(i.textContent=""),i.onclick===Gr&&(i.onclick=null),Nl(i)}function e1(i){for(var a=i.attributes;a.length;)i.removeAttributeNode(a[0]);Nl(i)}var to=new Map,fk=new Set;function wh(i){if(typeof i.getRootNode=="function"){var a=i.getRootNode();if(a.nodeType===9||a.nodeType===11)return a}return i.nodeType===9?i:i.ownerDocument}var Ii=le.d;le.d={f:X9,r:Q9,D:Z9,C:J9,L:eV,m:tV,X:rV,S:nV,M:sV};function X9(){var i=Ii.f(),a=Qg();return i||a}function Q9(i){var a=bi(i);a!==null&&a.tag===5&&a.type==="form"?pO(a):Ii.r(i)}var ld=typeof document>"u"?null:document;function hk(i,a,d){var m=ld;if(m&&typeof a=="string"&&a){var v=ln(a);v='link[rel="'+i+'"][href="'+v+'"]',typeof d=="string"&&(v+='[crossorigin="'+d+'"]'),fk.has(v)||(fk.add(v),i={rel:i,crossOrigin:d,href:a},m.querySelector(v)===null&&(a=m.createElement("link"),br(a,"link",i),Oe(a),m.head.appendChild(a)))}}function Z9(i){Ii.D(i),hk("dns-prefetch",i,null)}function J9(i,a){Ii.C(i,a),hk("preconnect",i,a)}function eV(i,a,d){Ii.L(i,a,d);var m=ld;if(m&&i&&a){var v='link[rel="preload"][as="'+ln(a)+'"]';a==="image"&&d&&d.imageSrcSet?(v+='[imagesrcset="'+ln(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(v+='[imagesizes="'+ln(d.imageSizes)+'"]')):v+='[href="'+ln(i)+'"]';var w=v;switch(a){case"style":w=ad(i);break;case"script":w=cd(i)}if(!(to.has(w)||(i=A({rel:"preload",href:a==="image"&&d&&d.imageSrcSet?void 0:i,as:a},d),to.set(w,i),m.querySelector(v)!==null||a==="style"&&m.querySelector(Eh(w))||a==="script"&&m.querySelector(Ch(w))))){var _=m.createElement("link");br(_,"link",i),a==="style"&&(_[Tl]=!0,_.onload=_.onerror=function(){Ke(_)}),Oe(_),m.head.appendChild(_)}}}function tV(i,a){Ii.m(i,a);var d=ld;if(d&&i){var m=a&&typeof a.as=="string"?a.as:"script",v='link[rel="modulepreload"][as="'+ln(m)+'"][href="'+ln(i)+'"]',w=v;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=cd(i)}if(!to.has(w)&&(i=A({rel:"modulepreload",href:i},a),to.set(w,i),d.querySelector(v)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Ch(w)))return}m=d.createElement("link"),br(m,"link",i),Oe(m),d.head.appendChild(m)}}}function nV(i,a,d){Ii.S(i,a,d);var m=ld;if(m&&i){var v=Te(m).hoistableStyles,w=ad(i);a=a||"default";var _=v.get(w);if(!_){var U={loading:0,preload:null};if(_=m.querySelector(Eh(w)))U.loading=5;else{i=A({rel:"stylesheet",href:i,"data-precedence":a},d),(d=to.get(w))&&t1(i,d);var Q=_=m.createElement("link");Oe(Q),br(Q,"link",i),Q._p=new Promise(function(ie,ge){Q.onload=ie,Q.onerror=ge}),Q.addEventListener("load",function(){U.loading|=1}),Q.addEventListener("error",function(){U.loading|=2}),U.loading|=4,s0(_,a,m)}_={type:"stylesheet",instance:_,count:1,state:U},v.set(w,_)}}}function rV(i,a){Ii.X(i,a);var d=ld;if(d&&i){var m=Te(d).hoistableScripts,v=cd(i),w=m.get(v);w||(w=d.querySelector(Ch(v)),w||(i=A({src:i,async:!0},a),(a=to.get(v))&&n1(i,a),w=d.createElement("script"),Oe(w),br(w,"link",i),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},m.set(v,w))}}function sV(i,a){Ii.M(i,a);var d=ld;if(d&&i){var m=Te(d).hoistableScripts,v=cd(i),w=m.get(v);w||(w=d.querySelector(Ch(v)),w||(i=A({src:i,async:!0,type:"module"},a),(a=to.get(v))&&n1(i,a),w=d.createElement("script"),Oe(w),br(w,"link",i),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},m.set(v,w))}}function pk(i,a,d,m){var v=(v=ue.current)?wh(v):null;if(!v)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(d=ad(d.href),a=Te(v).hoistableStyles,m=a.get(d),m||(m={type:"style",instance:null,count:0,state:null},a.set(d,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){i=ad(d.href);var w=Te(v).hoistableStyles,_=w.get(i);if(_||(v=v.ownerDocument||v,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(i,_),(w=v.querySelector(Eh(i)))?w._p||(_.instance=w,_.state.loading=5):(w=to.get(i),w||(w={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},to.set(i,w)),oV(v,i,w,_.state))),a&&m===null)throw Error(r(528,""));return _}if(a&&m!==null)throw Error(r(529,""));return null;case"script":return a=d.async,d=d.src,typeof d=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(d=cd(d),a=Te(v).hoistableScripts,m=a.get(d),m||(m={type:"script",instance:null,count:0,state:null},a.set(d,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function ad(i){return'href="'+ln(i)+'"'}function Eh(i){return'link[rel="stylesheet"]['+i+"]"}function mk(i){return A({},i,{"data-precedence":i.precedence,precedence:null})}function oV(i,a,d,m){if(a=i.querySelector('link[rel="preload"][as="style"]['+a+"]")){if(a[Tl]!==!0){m.loading=1;return}}else a=i.createElement("link"),a[Tl]=!0,a.onload=a.onerror=Ke.bind(null,a),br(a,"link",d),Oe(a),i.head.appendChild(a);m.preload=a,a.addEventListener("load",function(){return m.loading|=1}),a.addEventListener("error",function(){return m.loading|=2})}function cd(i){return'[src="'+ln(i)+'"]'}function Ch(i){return"script[async]"+i}function gk(i,a,d){if(a.count++,a.instance===null)switch(a.type){case"style":var m=i.querySelector('style[data-href~="'+ln(d.href)+'"]');if(m)return a.instance=m,Oe(m),m;var v=A({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return m=(i.ownerDocument||i).createElement("style"),Oe(m),br(m,"style",v),s0(m,d.precedence,i),a.instance=m;case"stylesheet":v=ad(d.href);var w=i.querySelector(Eh(v));if(w)return a.state.loading|=4,a.instance=w,Oe(w),w;m=mk(d),(v=to.get(v))&&t1(m,v),w=(i.ownerDocument||i).createElement("link"),Oe(w);var _=w;return _._p=new Promise(function(U,Q){_.onload=U,_.onerror=Q}),br(w,"link",m),a.state.loading|=4,s0(w,d.precedence,i),a.instance=w;case"script":return w=cd(d.src),(v=i.querySelector(Ch(w)))?(a.instance=v,Oe(v),v):(m=d,(v=to.get(w))&&(m=A({},d),n1(m,v)),i=i.ownerDocument||i,v=i.createElement("script"),Oe(v),br(v,"link",m),i.head.appendChild(v),a.instance=v);case"void":return null;default:throw Error(r(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(m=a.instance,a.state.loading|=4,s0(m,d.precedence,i));return a.instance}function s0(i,a,d){for(var m=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=m.length?m[m.length-1]:null,w=v,_=0;_<m.length;_++){var U=m[_];if(U.dataset.precedence===a)w=U;else if(w!==v)break}w?w.parentNode.insertBefore(i,w.nextSibling):(a=d.nodeType===9?d.head:d,a.insertBefore(i,a.firstChild))}function t1(i,a){i.crossOrigin==null&&(i.crossOrigin=a.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=a.referrerPolicy),i.title==null&&(i.title=a.title)}function n1(i,a){i.crossOrigin==null&&(i.crossOrigin=a.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=a.referrerPolicy),i.integrity==null&&(i.integrity=a.integrity)}var o0=null;function yk(i,a,d){if(o0===null){var m=new Map,v=o0=new Map;v.set(d,m)}else v=o0,m=v.get(d),m||(m=new Map,v.set(d,m));if(m.has(i))return m;for(m.set(i,null),d=d.getElementsByTagName(i),v=0;v<d.length;v++){var w=d[v];if(!(w[xi]||w[on]||i==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var _=w.getAttribute(a)||"";_=i+_;var U=m.get(_);U?U.push(w):m.set(_,[w])}}return m}function r1(i,a,d){i=i.ownerDocument||i,i.head.insertBefore(d,a==="title"?i.querySelector("head > title"):null)}function iV(i,a,d){if(d===1||a.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return i=a.disabled,typeof a.precedence=="string"&&i==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function xk(i,a){return i==="img"&&a.src!=null&&a.src!==""&&a.onLoad==null&&a.loading!=="lazy"}function bk(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function vk(i){return(i.width||100)*(i.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Sk(i,a){typeof a.decode=="function"&&(i.imgCount++,a.complete||(i.imgBytes+=vk(a),i.suspenseyImages.push(a)),i=cV.bind(i),a.decode().then(i,i))}function lV(i,a,d,m){if(d.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var v=ad(m.href),w=a.querySelector(Eh(v));if(w){a=w._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(i.count++,i=Th.bind(i),a.then(i,i)),d.state.loading|=4,d.instance=w,Oe(w);return}w=a.ownerDocument||a,m=mk(m),(v=to.get(v))&&t1(m,v),w=w.createElement("link"),Oe(w);var _=w;_._p=new Promise(function(U,Q){_.onload=U,_.onerror=Q}),br(w,"link",m),d.instance=w}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(d,a),(a=d.state.preload)&&(d.state.loading&3)===0&&(i.count++,d=Th.bind(i),a.addEventListener("load",d),a.addEventListener("error",d))}}var i0=0;function aV(i,a){return i.stylesheets&&i.count===0&&a0(i,i.stylesheets),0<i.count||0<i.imgCount?function(d){var m=setTimeout(function(){if(i.stylesheets&&a0(i,i.stylesheets),i.unsuspend){var w=i.unsuspend;i.unsuspend=null,w()}},6e4+a);0<i.imgBytes&&i0===0&&(i0=62500*N9());var v=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&a0(i,i.stylesheets),i.unsuspend)){var w=i.unsuspend;i.unsuspend=null,w()}},(i.imgBytes>i0?50:800)+a);return i.unsuspend=d,function(){i.unsuspend=null,clearTimeout(m),clearTimeout(v)}}:null}function wk(i){if(i.count===0&&(i.imgCount===0||!i.waitingForImages)){if(i.stylesheets)a0(i,i.stylesheets);else if(i.unsuspend){var a=i.unsuspend;i.unsuspend=null,a()}}}function Th(){this.count--,wk(this)}function cV(){this.imgCount--,wk(this)}var l0=null;function a0(i,a){i.stylesheets=null,i.unsuspend!==null&&(i.count++,l0=new Map,a.forEach(uV,i),l0=null,Th.call(i))}function uV(i,a){if(!(a.state.loading&4)){var d=l0.get(i);if(d)var m=d.get(null);else{d=new Map,l0.set(i,d);for(var v=i.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<v.length;w++){var _=v[w];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(d.set(_.dataset.precedence,_),m=_)}m&&d.set(null,m)}v=a.instance,_=v.getAttribute("data-precedence"),w=d.get(_)||m,w===m&&d.set(null,v),d.set(_,v),this.count++,m=Th.bind(this),v.addEventListener("load",m),v.addEventListener("error",m),w?w.parentNode.insertBefore(v,w.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(v,i.firstChild)),a.state.loading|=4}}var ud={$$typeof:F,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function dV(i,a,d,m,v,w,_,U,Q){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Do(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Do(0),this.hiddenUpdates=Do(null),this.identifierPrefix=m,this.onUncaughtError=v,this.onCaughtError=w,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Q,this.transitionTypes=null,this.incompleteTransitions=new Map}function Ek(i,a,d,m,v,w,_,U,Q,ie,ge,Ee){return i=new dV(i,a,d,_,Q,ie,ge,Ee,U),a=1,w===!0&&(a|=24),w=fs(3,null,null,a),i.current=w,w.stateNode=i,a=xv(),a.refCount++,i.pooledCache=a,a.refCount++,w.memoizedState={element:m,isDehydrated:d,cache:a},wv(w),i}function Ck(i){return i?(i=ju,i):ju}function Tk(i,a,d,m,v,w){v=Ck(v),m.context===null?m.context=v:m.pendingContext=v,m=Pl(a),m.payload={element:d},w=w===void 0?null:w,w!==null&&(m.callback=w),d=zl(i,m,a),d!==null&&(gs(d,i,a),nh(d,i,a))}function Nk(i,a){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var d=i.retryLane;i.retryLane=d!==0&&d<a?d:a}}function s1(i,a){Nk(i,a),(i=i.alternate)&&Nk(i,a)}function Rk(i){if(i.tag===13||i.tag===31){var a=ac(i,67108864);a!==null&&gs(a,i,67108864),s1(i,67108864)}}function Ok(i){if(i.tag===13||i.tag===31){var a=js();a=ho(a);var d=ac(i,a);d!==null&&gs(d,i,a),s1(i,a)}}var dd=!0;function fV(i,a,d,m){var v=pe.T;pe.T=null;var w=le.p;try{le.p=2,o1(i,a,d,m)}finally{le.p=w,pe.T=v}}function hV(i,a,d,m){var v=pe.T;pe.T=null;var w=le.p;try{le.p=8,o1(i,a,d,m)}finally{le.p=w,pe.T=v}}function o1(i,a,d,m){if(dd){var v=i1(m);if(v===null)HS(i,a,m,c0,d),kk(i,m);else if(mV(v,i,a,d,m))m.stopPropagation();else if(kk(i,m),a&4&&-1<pV.indexOf(i)){for(;v!==null;){var w=bi(v);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var _=ls(w.pendingLanes);if(_!==0){var U=w;for(U.pendingLanes|=2,U.entangledLanes|=2;_;){var Q=1<<31-Jt(_);U.entanglements[1]|=Q,_&=~Q}Go(w),(zt&6)===0&&(Yg=cn()+500,xh(0))}}break;case 31:case 13:U=ac(w,2),U!==null&&gs(U,w,2),Qg(),s1(w,2)}if(w=i1(m),w===null&&HS(i,a,m,c0,d),w===v)break;v=w}v!==null&&m.stopPropagation()}else HS(i,a,m,null,d)}}function i1(i){return i=rc(i),l1(i)}var c0=null;function l1(i){if(c0=null,i=Ns(i),i!==null){var a=o(i);if(a===null)i=null;else{var d=a.tag;if(d===13){if(i=l(a),i!==null)return i;i=null}else if(d===31){if(i=c(a),i!==null)return i;i=null}else if(d===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;i=null}else a!==i&&(i=null)}}return c0=i,null}function Ak(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"fullscreenerror":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ar()){case $r:return 2;case Es:return 8;case qn:case yt:return 32;case un:return 268435456;default:return 32}default:return 32}}var a1=!1,Xl=null,Ql=null,Zl=null,Nh=new Map,Rh=new Map,Jl=[],pV="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function kk(i,a){switch(i){case"focusin":case"focusout":Xl=null;break;case"dragenter":case"dragleave":Ql=null;break;case"mouseover":case"mouseout":Zl=null;break;case"pointerover":case"pointerout":Nh.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rh.delete(a.pointerId)}}function Oh(i,a,d,m,v,w){return i===null||i.nativeEvent!==w?(i={blockedOn:a,domEventName:d,eventSystemFlags:m,nativeEvent:w,targetContainers:[v]},a!==null&&(a=bi(a),a!==null&&Rk(a)),i):(i.eventSystemFlags|=m,a=i.targetContainers,v!==null&&a.indexOf(v)===-1&&a.push(v),i)}function mV(i,a,d,m,v){switch(a){case"focusin":return Xl=Oh(Xl,i,a,d,m,v),!0;case"dragenter":return Ql=Oh(Ql,i,a,d,m,v),!0;case"mouseover":return Zl=Oh(Zl,i,a,d,m,v),!0;case"pointerover":var w=v.pointerId;return Nh.set(w,Oh(Nh.get(w)||null,i,a,d,m,v)),!0;case"gotpointercapture":return w=v.pointerId,Rh.set(w,Oh(Rh.get(w)||null,i,a,d,m,v)),!0}return!1}function _k(i){var a=Ns(i.target);if(a!==null){var d=o(a);if(d!==null){if(a=d.tag,a===13){if(a=l(d),a!==null){i.blockedOn=a,gi(i.priority,function(){Ok(d)});return}}else if(a===31){if(a=c(d),a!==null){i.blockedOn=a,gi(i.priority,function(){Ok(d)});return}}else if(a===3&&d.stateNode.current.memoizedState.isDehydrated){i.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}i.blockedOn=null}function u0(i){if(i.blockedOn!==null)return!1;for(var a=i.targetContainers;0<a.length;){var d=i1(i.nativeEvent);if(d===null){d=i.nativeEvent;var m=new d.constructor(d.type,d);nc=m,d.target.dispatchEvent(m),nc=null}else return a=bi(d),a!==null&&Rk(a),i.blockedOn=d,!1;a.shift()}return!0}function Mk(i,a,d){u0(i)&&d.delete(a)}function gV(){a1=!1,Xl!==null&&u0(Xl)&&(Xl=null),Ql!==null&&u0(Ql)&&(Ql=null),Zl!==null&&u0(Zl)&&(Zl=null),Nh.forEach(Mk),Rh.forEach(Mk)}function d0(i,a){i.blockedOn===a&&(i.blockedOn=null,a1||(a1=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,gV)))}var f0=null;function Ik(i){f0!==i&&(f0=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){f0===i&&(f0=null);for(var a=0;a<i.length;a+=3){var d=i[a],m=i[a+1],v=i[a+2];if(typeof m!="function"){if(l1(m||d)===null)continue;break}var w=bi(d);w!==null&&(i.splice(a,3),a-=3,Uv(w,{pending:!0,data:v,method:d.method,action:m},m,v))}}))}function fd(i){function a(Q){return d0(Q,i)}Xl!==null&&d0(Xl,i),Ql!==null&&d0(Ql,i),Zl!==null&&d0(Zl,i),Nh.forEach(a),Rh.forEach(a);for(var d=0;d<Jl.length;d++){var m=Jl[d];m.blockedOn===i&&(m.blockedOn=null)}for(;0<Jl.length&&(d=Jl[0],d.blockedOn===null);)_k(d),d.blockedOn===null&&Jl.shift();if(d=(i.ownerDocument||i).$$reactFormReplay,d!=null)for(m=0;m<d.length;m+=3){var v=d[m],w=d[m+1],_=v[Yn]||null;if(typeof w=="function")_||Ik(d);else if(_){var U=null;if(w&&w.hasAttribute("formAction")){if(v=w,_=w[Yn]||null)U=_.formAction;else if(l1(v)!==null)continue}else U=_.action;typeof U=="function"?d[m+1]=U:(d.splice(m,3),m-=3),Ik(d)}}}function Lk(){function i(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(_){return v=_})},focusReset:"manual",scroll:"manual"})}function a(){v!==null&&(v(),v=null),m||setTimeout(d,20)}function d(){if(!m&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,v=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",a),navigation.addEventListener("navigateerror",a),setTimeout(d,100),function(){m=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",a),navigation.removeEventListener("navigateerror",a),v!==null&&(v(),v=null)}}}function c1(i){this._internalRoot=i}h0.prototype.render=c1.prototype.render=function(i){var a=this._internalRoot;if(a===null)throw Error(r(409));var d=a.current,m=js();Tk(d,m,i,a,null,null)},h0.prototype.unmount=c1.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var a=i.containerInfo;Tk(i.current,2,null,i,null,null),Qg(),a[Vr]=null}};function h0(i){this._internalRoot=i}h0.prototype.unstable_scheduleHydration=function(i){if(i){var a=us();i={blockedOn:null,target:i,priority:a};for(var d=0;d<Jl.length&&a!==0&&a<Jl[d].priority;d++);Jl.splice(d,0,i),d===0&&_k(i)}};var Dk=t.version;if(Dk!=="19.3.0")throw Error(r(527,Dk,"19.3.0"));le.findDOMNode=function(i){var a=i._reactInternals;if(a===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=f(a),i=i!==null?h(i):null,i=i===null?null:i.stateNode,i};var yV={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:pe,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var p0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!p0.isDisabled&&p0.supportsFiber)try{On=p0.inject(yV),Ht=p0}catch{}}return kh.createRoot=function(i,a){if(!s(i))throw Error(r(299));var d=!1,m="",v=CO,w=TO,_=NO;return a!=null&&(a.unstable_strictMode===!0&&(d=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onUncaughtError!==void 0&&(v=a.onUncaughtError),a.onCaughtError!==void 0&&(w=a.onCaughtError),a.onRecoverableError!==void 0&&(_=a.onRecoverableError)),a=Ek(i,1,!1,null,null,d,m,null,v,w,_,Lk),i[Vr]=a.current,BS(i),new c1(a)},kh.hydrateRoot=function(i,a,d){if(!s(i))throw Error(r(299));var m=!1,v="",w=CO,_=TO,U=NO,Q=null;return d!=null&&(d.unstable_strictMode===!0&&(m=!0),d.identifierPrefix!==void 0&&(v=d.identifierPrefix),d.onUncaughtError!==void 0&&(w=d.onUncaughtError),d.onCaughtError!==void 0&&(_=d.onCaughtError),d.onRecoverableError!==void 0&&(U=d.onRecoverableError),d.formState!==void 0&&(Q=d.formState)),a=Ek(i,1,!0,a,d??null,m,v,Q,w,_,U,Lk),a.context=Ck(null),d=a.current,m=js(),m=ho(m),v=Pl(m),v.callback=null,zl(d,v,m),d=m,a.current.lanes=d,Cs(a,d),Go(a),i[Vr]=a.current,BS(i),new h0(a)},kh.version="19.3.0",kh}var t_;function pq(){if(t_)return h1.exports;t_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),h1.exports=hq(),h1.exports}var mq=pq();const n_=!1;var r_=N.use,i2=N.useLayoutEffect;function ja(e){return e[e.length-1]}function $P(e,t){return typeof e=="function"?e(t):e}const l2=Object.prototype.hasOwnProperty;function UP(e){for(const t in e)if(l2.call(e,t))return!0;return!1}const cy=()=>Object.create(null),hd=(e,t)=>Ta(e,t,!0);function Ta(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;const s=Array.isArray(e)&&Array.isArray(t);if(!s&&!(My(e)&&My(t)))return t;const o=Object.keys(e),l=o.length,c=Object.keys(t),u=c.length;if(s?l!==e.length||u!==t.length||l&&ja(o)!==`${l-1}`||u&&ja(c)!==`${u-1}`:l!==Object.getOwnPropertyNames(e).length||u!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let f=0,h,p,y;if(s){for(;f<u&&(y=f,p=e[y],h=t[y],h=p===h?p:typeof p=="object"?Ta(p,h,n,r):h,h===p);f++);if(f===u&&l===u)return e}else{let b=l===u,S=!0;for(;f<u;f++){y=c[f],p=e[y];const E=t[y];h=p===E?p:typeof p=="object"?Ta(p,E,n,r):E,b&&(b=h===p&&(o[f]===y||l2.call(e,y))),S&&(S=Object.is(h,E)),o[f]=h}if(b)return Object.getOwnPropertySymbols(e).length?t:e;if(S)return t}const x=s?c.fill(0):n?cy():{};for(let b=0;b<u;b++)y=s?b:c[b],s?(p=e[y],b>f&&(h=t[y],h=p===h?p:typeof p=="object"?Ta(p,h,n,r):h),x[y]=b<f?p:h):x[y]=o[b];return x}function My(e){var t;return!e||typeof e!="object"?!1:(((t=Object.getPrototypeOf(e))==null?void 0:t.constructor)??Object)===Object}function Xi(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let s=0,o=e.length;s<o;s++){const l=e[s],c=t[s];if(l!==c&&!Xi(l,c,n,r))return!1}return!0}if(My(e)&&My(t)){if(n){for(const o in t)if((r||t[o]!==void 0)&&!Xi(e[o],t[o],n,r))return!1;return!0}let s=0;if(r)s=Object.keys(e).length;else for(const o in e)e[o]!==void 0&&s++;for(const o in t)if((r||t[o]!==void 0)&&(s--===0||!Xi(e[o],t[o],n,r)))return!1;return s===0}return!1}function gq(e){return typeof(e==null?void 0:e.message)!="string"?!1:e.message.startsWith("Failed to fetch dynamically imported module")||e.message.startsWith("error loading dynamically imported module")||e.message.startsWith("Importing a module script failed")}const yq=/[\x00-\x1f\x7f"<>`{}]/g;function xq(e){return e.replace(yq,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}function s_(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return xq(t)}const bq=["http:","https:","mailto:","tel:"];function yp(e){var t,n;if(e[0]!=="/"&&e.includes(":"))return(n=(t=/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e))==null?void 0:t[1])==null?void 0:n.replace(/[\t\n\r]/g,"").toLowerCase()}const VP=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function qP(e,t){if(!e)return!1;if(VP.test(e))return!0;const n=yp(e);return n?!t.has(n):!1}function _h(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){const n=/%25|%5C/gi;let r=0,s;for(t="";(s=n.exec(e))!==null;)t+=s_(e.slice(r,s.index))+s[0],r=n.lastIndex;t+=s_(r?e.slice(r):e)}return t}function vq(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function Sq(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function a2(){throw new Error("Invariant failed")}function kd(e){return e.replace(/\/{2,}/g,"/")}function GP(e){return e==="/"?e:e.replace(/^\/+/,"")}function ni(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/+$/,""):e}function KP(e){return ni(GP(e))}function o_(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function i_(e,t,n="never",r){if(t.includes("//")&&(t=kd(t)),t.startsWith("/"))return t.length===1||n==="preserve"?t:n==="always"?t.endsWith("/")?t:`${t}/`:t.endsWith("/")?t.slice(0,-1):t;const s=t===".";let o;if(r){o=s?e:e+"\0"+t;const f=r.get(o);if(f)return f}let l;if(s)l=e.split("/");else{for(e.includes("//")&&(e=kd(e)),l=e.split("/");l.length>1&&ja(l)==="";)l.pop();const f=t.split("/");for(let h=0,p=f.length;h<p;h++){const y=f[h];y===""?h?h===p-1&&l.push(y):l=[y]:y===".."?l.length>1?l.pop():l=[""]:y==="."||l.push(y)}}l.length>1&&(ja(l)===""?n==="never"&&l.pop():n==="always"&&l.push(""));const c=l.join("/"),u=(s?kd(c):c)||"/";return o&&r&&r.set(o,u),u}function wq(e){const t=new Map(e.map(r=>[encodeURIComponent(r),r])),n=new RegExp([...t.keys()].join("|").replace(/[.*()]/g,"\\$&"),"g");return r=>r.replace(n,s=>t.get(s)??s)}function Eq(e){return e==null||e===""}function Cq(e,t,n){if(typeof t!="string")return""+(t??void 0);const r=e==="_splat";if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let s=encodeURIComponent(t);return r&&(s=s.replaceAll("%2F","/")),n?n(s):s}function l_(e,t,n,r,s){const o=e.endsWith("/")?"/":"";let l="";for(const c of t){if(typeof c=="string"){l+=c;continue}const[u,f,h,p]=c,y=u===2,x=y&&p!==void 0?p+o:p;let b=n[f];if(!(u===3&&b==null)){if(s&&(s[f]=b,y&&(s["*"]=b)),y&&Eq(b)){if(h==="/"&&!x)continue;b=""}l+=h+Cq(f,b,r)+(x||"")}}return l+o||"/"}function sf(e){return(e==null?void 0:e.isNotFound)===!0}function Tq(){try{return sessionStorage}catch{return}}const Nq="tsr-scroll-restoration-v1_3",_d=Tq();function Rq(){try{return JSON.parse((_d==null?void 0:_d.getItem("tsr-scroll-restoration-v1_3"))||"{}")}catch{return{}}}function Oq(){try{_d==null||_d.setItem(Nq,JSON.stringify(oa))}catch{}}const oa=Rq(),a_="data-scroll-restoration-id",Aq=e=>e.state.__TSR_key||e.href;function kq(e){const t=e.getAttribute(a_);if(t)return`[${a_}="${t}"]`;let n="",r=e,s;for(;s=r.parentNode;){let o=1,l=r;for(;l=l.previousElementSibling;)o++;const c=`${r.localName}:nth-child(${o})`;n=n?`${c} > ${n}`:c,r=s}return n}let y0=!1;const uy="window";function Xw(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function c_(e){const t=new Set;for(const n of e){if(n===uy)continue;const r=Xw(n);r&&t.add(r)}return t}function _q(e,t){const n=e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);const s=e.options.getScrollRestorationKey||Aq,o=new Set,l=c=>{const u=oa[c]||(oa[c]={});for(const f of o)f===document?u[uy]={scrollX,scrollY}:f.isConnected&&(u[kq(f)]={scrollX:f.scrollLeft,scrollY:f.scrollTop})};n&&!r.restoration&&(r.restoration=!0,y0=!1,history.scrollRestoration="manual",document.addEventListener("scroll",c=>{y0||o.add(c.target)},!0),e.subscribe("onBeforeLoad",c=>{c.fromLocation&&l(s(c.fromLocation)),o.clear()}),addEventListener("pagehide",()=>{l(s(e.stores.resolvedLocation.get()??e.stores.location.get())),Oq()})),!r.reset&&(r.reset=!0,e.subscribe("onRendered",c=>{var S;const u=e.options.scrollRestorationBehavior,f=e.options.scrollToTopSelectors,h=r.next,p=r.hash;let y;if(o.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const x=s(c.toLocation),b=c.fromLocation&&s(c.fromLocation);if(r.restoring&&b&&b!==x){const E=oa[b];if(E){let C=oa[x];for(const R in E){if(R===uy){if(h)continue}else{const T=Xw(R);if(!T||h&&f&&(y??(y=c_(f)),y.has(T)))continue}C||(C=oa[x]={}),C[R]??(C[R]=E[R])}}}y0=!0;try{const E=c.toLocation.hash,C=c.toLocation.state.__hashScrollIntoViewOptions??!0;let R=!1;if(h){!E&&f&&(y??(y=c_(f)));const T=E&&C&&p,O=r.restoring?oa[x]:void 0;if(O)for(const k in O){const{scrollX:M,scrollY:A}=O[k];if(k===uy){if(T)continue;scrollTo({top:A,left:M,behavior:u}),R=!0}else{const L=Xw(k);L&&(L.scrollLeft=M,L.scrollTop=A,y==null||y.delete(L))}}if(!E){const k={top:0,left:0,behavior:u};if(R||scrollTo(k),y)for(const M of y)M.scrollTo(k)}}!R&&E&&C&&((S=document.getElementById(E))==null||S.scrollIntoView(C))}finally{y0=!1}}))}function Mq(e,t=String){let n;for(const r in e){const s=e[r];s!==void 0&&(n||(n=new URLSearchParams)).set(r,t(s))}return n?n.toString():""}function y1(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Iq(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[r,s]of t.entries()){const o=n[r];o==null?n[r]=y1(s):Array.isArray(o)?o.push(y1(s)):n[r]=[o,y1(s)]}return n}const YP=/^(?:\s|["[{\d-]|fa|nu|tr)/,Lq=jq(JSON.parse),Dq=Pq(JSON.stringify,JSON.parse);function jq(e){const t=e===JSON.parse;return n=>{n[0]==="?"&&(n=n.substring(1));const r=Iq(n);for(const s in r){const o=r[s];if(typeof o=="string"){if(t&&!YP.test(o))continue;try{r[s]=e(o)}catch{}}}return r}}function Pq(e,t){const n=t===JSON.parse;function r(s){if(s&&typeof s=="object")try{return e(s)}catch{}else if(t&&typeof s=="string"){if(n&&!YP.test(s))return s;try{return t(s),e(s)}catch{}}return s}return s=>{const o=Mq(s,r);return o?`?${o}`:""}}const Md="__root__";function Ix(e){e.statusCode=e.statusCode||e.code||307;const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function WP(e){return e instanceof Response&&!!e.options}function Iy(e){const t=new Map;let n,r;return{get(s){const o=t.get(s);if(o)return o.visited=!0,o.value},set(s,o){const l=t.get(s);if(l){l.value=o;return}if(t.size>=e){let u=n==null?void 0:n.next().value;for(;!u||u.visited;)u?u.visited=!1:n=t.values(),u=n.next().value;u===r&&(n=void 0),t.delete(u.key)}const c={key:s,value:o,visited:!1};r=c,t.set(s,c)},clear(){t.clear(),n=void 0,r=void 0}}}const va=4,XP=5;function zq(e){const t=e.names;if(t)return t;const n=[];for(const r of e)typeof r!="string"&&n.push(r[1]);return e.names=n}function Bq(e,t,n){const r=e.substring(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,"_splat","",void 0]:[1,r.substring(1),"",""];const s=r.indexOf("{");if(s>=0){const o=r.indexOf("}",s),l=r.charCodeAt(s+1)===45,c=s+(l?3:2);if(o>=0&&r.charCodeAt(c-1)===36&&(!l||c<o)){const u=r.substring(c,o);return[l?3:u?1:2,u||"_splat",r.substring(0,s),e.substring(t+o+1,u?n:e.length)]}}return r}function xp(e,t,n,r,s,o){var C,R;let l=n;const c=t.fullPath??t.from,u=t.options,f=c.length,h=c.endsWith("/")?f-1:f,p=(u==null?void 0:u.caseSensitive)??e,y=((C=u==null?void 0:u.params)==null?void 0:C.parse)??(u==null?void 0:u.parseParams);let x,b=o?n-1:0;if(!r||c.includes("$")){x=(o==null?void 0:o.slice())??[];const T=ja(x);T&&typeof T!="string"&&T[0]===2&&(x[x.length-1]=[T[0],T[1],T[2],T[3]===void 0?void 0:T[3]+c.substring(n-(c[n-2]==="/"?2:1),h)],b=f)}for(;l<f;){const T=l,O=c.indexOf("/",T);let k=O===-1?f:O;const M=Bq(c,T,k);l=k+1;let A;if(typeof M=="string"){if(!r)continue;let L=M,I;p?I=r.static??(r.static=new Map):(L=M.toLowerCase(),I=r.staticInsensitive??(r.staticInsensitive=new Map));const j=I.get(L);if(j)A=j;else{const P=Dc(r);A=P,I.set(L,P)}}else{const L=M[0];let I=M[2],j=M[3]??"";if(L===2&&(k=f,l=k+1),x&&b<k&&(b<T-1&&x.push(c.substring(b,T-1)),M[2]="/"+I,L===2&&M[3]!==void 0&&h<f&&(M[3]=j.slice(0,-1)),x.push(M),b=k),!r)continue;const P=p&&!!(I||j);p||(I=I.toLowerCase(),j=j.toLowerCase());const B=L===1?r.dynamic??(r.dynamic=[]):L===3?r.optional??(r.optional=[]):r.wildcard??(r.wildcard=[]),H=L!==2&&!y&&B.find(D=>!D.parse&&D.caseSensitive===P&&D.prefix===I&&D.suffix===j);if(H)A=H;else{const D=Dc(r,L,P,I,j);A=D,B.push(D),B.length===2&&(s==null||s.push(B))}}r=A}x&&b<h&&x.push(c.substring(b,h));const S=x==null?void 0:x.slice();if(!r)return S;if(y&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf("/")+1)===95){const T=Dc(r,XP);(r.pathless??(r.pathless=[])).push(T),r=T}const E=(t.path||!t.children)&&!t.isRoot;if(E&&h<f){const T=Dc(r,va);r.index=T,r=T}return r.parse=y??null,r.priority=((R=u==null?void 0:u.params)==null?void 0:R.priority)??0,r.route||(r.data=S,E&&(r.route=t)),[r,l,S]}function QP(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Dc(e,t=0,n,r,s){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:s}}function Hq(e,t){const n=Dc(),r=[];function s(o,l,c,u){const[f,h,p]=xp(!1,o,l,c,r,u);if(o.children)for(const y of o.children)s(y,h,f,p)}for(const o of e)s(o,1,n);for(const o of r)o.sort(QP);t.masksTree=n,t.flatCache=Iy(1e3)}function Fq(e,t){e||(e="/");const n=t.flatCache.get(e);if(n!==void 0)return n;const r=c2(e,t.masksTree);return t.flatCache.set(e,r),r}function $q(e,t,n,r,s){e||(e="/"),r||(r="/");const o=t?`case\0${e}`:e;let l=s.singleCache.get(o);return l||(l=Dc(),xp(t,{from:e},1,l),s.singleCache.set(o,l)),c2(r,l,n)}function Uq(e,t,n=!1){const r=n?e:`nofuzz\0${e}`,s=t.matchCache.get(r);if(s!==void 0)return s;e||(e="/");let o;try{o=c2(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)o=null;else throw l}return o&&(o.branch=JP(o.route)),t.matchCache.set(r,o),o}function Vq(e,t=!1){const n=Dc(),r=[],s={},o={};let l=0;function c(u,f,h,p){if(u.init(l),u.id in s&&a2(),s[u.id]=u,l!==0&&u.path){const S=ni(u.fullPath);(!o[S]||u.fullPath.endsWith("/"))&&(o[S]=u)}l++;const[y,x,b]=xp(t,u,f,h,r,p);if(u._interpolation=b,u.children)for(const S of u.children)c(S,x,y,b)}c(e,1,n);for(const u of r)u.sort(QP);return{processedTree:{segmentTree:n,singleCache:Iy(1e3),matchCache:Iy(1e3),flatCache:null,masksTree:null},routesById:s,routesByPath:o}}function c2(e,t,n=!1){const r=e.split("/"),s=Gq(e,r,t,n);if(!s)return null;const[o]=ZP(e,r,s);return{route:s.node.route,rawParams:o}}function ZP(e,t,n){var h,p,y,x;const r=qq(n.node),s=n.node.data&&zq(n.node.data),o=Object.create(null);let l=((h=n.extract)==null?void 0:h.part)??0,c=((p=n.extract)==null?void 0:p.node)??0,u=((y=n.extract)==null?void 0:y.path)??0,f=((x=n.extract)==null?void 0:x.param)??0;for(;c<r.length;l++,c++,u++){const b=r[c];if(b.kind===va)break;if(b.kind===XP){l--,u--;continue}const S=t[l],E=u;if(S&&(u+=S.length),b.kind===1||b.kind===3){const C=s[f++];if(b.kind===3&&n.skipped&1<<c){l--,u=E-1;continue}const R=b.suffix||b.prefix?S.substring(b.prefix.length,S.length-b.suffix.length):S;(R||b.kind===1)&&(o[C]=decodeURIComponent(R))}else if(b.kind===2){const C=b,R=e.substring(E+C.prefix.length,e.length-C.suffix.length),T=decodeURIComponent(R);o["*"]=T,o._splat=T;break}}return n.rawParams&&Object.assign(o,n.rawParams),[o,{part:l,node:c,path:u,param:f}]}function JP(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function qq(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Gq(e,t,n,r){if(e==="/"&&n.index)return{node:n.index,skipped:0};const s=!ja(t),o=s&&e!=="/",l=t.length-(s?1:0),c=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}];let u=null,f=null;for(;c.length;){const h=c.pop(),{node:p,index:y,skipped:x,statics:b,dynamics:S,optionals:E}=h;let{extract:C,rawParams:R}=h;if(p.kind===2&&p.route&&!b0(f,h))continue;if(p.parse){if(!u_(e,t,h))continue;R=h.rawParams,C=h.extract}r&&p.route&&p.kind!==va&&b0(u,h)&&(u=h);const T=y===l;if(T&&(p.route&&(!o||p.kind===va||p.kind===2)&&b0(f,h)&&(f=h),!p.optional&&!p.wildcard&&!p.index&&!p.pathless))continue;const O=T?void 0:t[y];let k;if(T&&p.index){const M={node:p.index,index:y,skipped:x,statics:b,dynamics:S,optionals:E,extract:C,rawParams:R};let A=!0;if(p.index.parse&&(u_(e,t,M)||(A=!1)),A){if(!S&&!E&&!x&&Kq(b,l))return M;b0(f,M)&&(f=M)}}if(p.wildcard)for(let M=p.wildcard.length-1;M>=0;M--){const A=p.wildcard[M],{prefix:L,suffix:I}=A;if(!(L&&(T||!(A.caseSensitive?O:k??(k=O.toLowerCase())).startsWith(L)))){if(I){if(T)continue;const j=t.slice(y).join("/"),P=j.slice(-I.length);if((A.caseSensitive?P:P.toLowerCase())!==I||j.length-I.length<L.length)continue}c.push({node:A,index:l,skipped:x,statics:b,dynamics:S,optionals:E,extract:C,rawParams:R})}}if(p.optional){const M=x|1<<p.depth+1;for(let A=p.optional.length-1;A>=0;A--){const L=p.optional[A];c.push({node:L,index:y,skipped:M,statics:b,dynamics:S,optionals:E,extract:C,rawParams:R})}if(!T)for(let A=p.optional.length-1;A>=0;A--){const L=p.optional[A],{prefix:I,suffix:j}=L;if(I||j){const P=L.caseSensitive?O:k??(k=O.toLowerCase());if(I&&!P.startsWith(I)||j&&P.indexOf(j,P.length-j.length)<I.length)continue}c.push({node:L,index:y+1,skipped:x,statics:b,dynamics:S,optionals:E+x0(l,y),extract:C,rawParams:R})}}if(!T&&p.dynamic&&O)for(let M=p.dynamic.length-1;M>=0;M--){const A=p.dynamic[M],{prefix:L,suffix:I}=A;if(L||I){const j=A.caseSensitive?O:k??(k=O.toLowerCase());if(L&&!j.startsWith(L)||I&&j.indexOf(I,j.length-I.length)<L.length)continue}c.push({node:A,index:y+1,skipped:x,statics:b,dynamics:S+x0(l,y),optionals:E,extract:C,rawParams:R})}if(!T&&p.staticInsensitive){const M=p.staticInsensitive.get(k??(k=O.toLowerCase()));M&&c.push({node:M,index:y+1,skipped:x,statics:b+x0(l,y),dynamics:S,optionals:E,extract:C,rawParams:R})}if(!T&&p.static){const M=p.static.get(O);M&&c.push({node:M,index:y+1,skipped:x,statics:b+x0(l,y),dynamics:S,optionals:E,extract:C,rawParams:R})}if(p.pathless)for(let M=p.pathless.length-1;M>=0;M--){const A=p.pathless[M];c.push({node:A,index:y,skipped:x,statics:b,dynamics:S,optionals:E,extract:C,rawParams:R})}}if(f)return f;if(r&&u){let h=u.index;for(let y=0;y<u.index;y++)h+=t[y].length;const p=h===e.length?"/":e.slice(h);return u.rawParams??(u.rawParams=Object.create(null)),u.rawParams["**"]=decodeURIComponent(p),u}return null}function x0(e,t){return 2**(e-t-1)}function Kq(e,t){return e===2**(t-1)-1}function u_(e,t,n){let r,s;try{[r,s]=ZP(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=s,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function b0(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===va)>(e.node.kind===va)||t.node.kind===va==(e.node.kind===va)&&t.node.depth>e.node.depth))):!0}function Yq(e,t,n){const r=KP(e),s=`/${r}`,o=t?s:s.toLowerCase(),l=`${o}/`,c={input:({url:u})=>{const f=t?u.pathname:u.pathname.toLowerCase();return f===o?u.pathname="/":f.startsWith(l)&&(u.pathname=u.pathname.slice(s.length)),u},output:({url:u})=>(u.pathname=kd(`/${r}${u.pathname}`),u)};return n?{input:({url:u})=>Qw(n,c.input({url:u})),output:({url:u})=>c.output({url:e4(n,u)})}:c}function Qw(e,t){var r;const n=(r=e==null?void 0:e.input)==null?void 0:r.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function e4(e,t){var r;const n=(r=e==null?void 0:e.output)==null?void 0:r.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Wq(e,t){const{createMutableStore:n,createReadonlyStore:r,batch:s}=t,o=new Map,l=n("idle"),c=n(e),u=n(void 0),f=n([]),h=r(()=>f.get().map(S=>o.get(S).get())),p=r(()=>({status:l.get(),isLoading:l.get()==="pending",matches:h.get(),location:c.get(),resolvedLocation:u.get()}));function y(S){let E=o.get(S);return E||(E=n(void 0),o.set(S,E)),E}const x={status:l,location:c,resolvedLocation:u,ids:f,matches:h,byRoute:o,__store:p,getMatchStore:y,setMatches:b};function b(S){const E=f.get(),C=S.map(R=>R.routeId);s(()=>{Sq(E,C)||f.set(C);for(const R of E)C.includes(R)||o.get(R).set(()=>{});for(const R of S){const T=y(R.routeId);T.get()!==R&&T.set(R)}})}return x}var Na="__TSR_index",d_="popstate",f_="beforeunload",Xq=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function dy(e){const t=Xq.exec(e);return t?"/"+e.slice(t[0].length):e}function t4(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,t=>`
|
|
51
|
-
\r`.includes(t)?"":encodeURIComponent(t))),dy(e)}function Qq(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(c=>c({location:t,action:l}))},s=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},o=async({task:l,navigateOpts:c,...u})=>{var p,y;if((c==null?void 0:c.ignoreBlocker)??!1){l();return}const f=((p=e.getBlockers)==null?void 0:p.call(e))??[],h=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&f.length&&h)for(const x of f){const b=Ly(u.path,u.state);if(await x.blockerFn({currentLocation:t,nextLocation:b,action:u.type})){(y=e.onBlocked)==null||y.call(e);return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,c,u)=>{const f=t.state[Na];c=h_(f+1,c),o({task:()=>{e.pushState(l,c),r({type:"PUSH"})},navigateOpts:u,type:"PUSH",path:l,state:c})},replace:(l,c,u)=>{const f=t.state[Na];c=h_(f,c),o({task:()=>{e.replaceState(l,c),r({type:"REPLACE"})},navigateOpts:u,type:"REPLACE",path:l,state:c})},go:(l,c)=>{o({task:()=>{e.go(l,(c==null?void 0:c.ignoreBlocker)??!1),s({type:"GO",index:l})},navigateOpts:c,type:"GO"})},back:l=>{o({task:()=>{e.back((l==null?void 0:l.ignoreBlocker)??!1),s({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{o({task:()=>{e.forward((l==null?void 0:l.ignoreBlocker)??!1),s({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[Na]!==0,createHref:l=>e.createHref(l),block:l=>{var u;if(!e.setBlockers)return()=>{};const c=((u=e.getBlockers)==null?void 0:u.call(e))??[];return e.setBlockers([...c,l]),()=>{var h,p;const f=((h=e.getBlockers)==null?void 0:h.call(e))??[];(p=e.setBlockers)==null||p.call(e,f.filter(y=>y!==l))}},flush:()=>{var l;return(l=e.flush)==null?void 0:l.call(e)},destroy:()=>{var l;return(l=e.destroy)==null?void 0:l.call(e)},notify:r,_getBlockers:()=>{var l;return((l=e.getBlockers)==null?void 0:l.call(e))??[]}}}function h_(e,t){const n=u2();return{...t,key:n,__TSR_key:n,[Na]:e}}function Zq(e){var A,L;const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let s=[];const o=()=>s,l=I=>s=I,c=I=>t4(I),u=(()=>Ly(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!((A=t.history.state)!=null&&A.__TSR_key)&&!((L=t.history.state)!=null&&L.key)){const I=u2();t.history.replaceState({[Na]:0,key:I,__TSR_key:I},"")}let f=u(),h,p=!1,y=!1,x=!1,b=!1;const S=()=>f;let E;const C=()=>{E&&(M._ignoreSubscribers=!0,(E[2]?t.history.pushState:t.history.replaceState)(E[1],"",E[0]),M._ignoreSubscribers=!1,E=void 0,h=void 0)},R=(I,j,P)=>{const B=!!E;B||(h=f),f=Ly(j,P),E=[f.href,P,(E==null?void 0:E[2])||I],B||queueMicrotask(()=>C())},T=I=>{f=u(),M.notify({type:I})},O=async()=>{if(b=!1,y){y=!1;return}const I=u(),j=I.state[Na]-f.state[Na],P=j===1,B=j===-1,H=!P&&!B||p;p=!1;const D=H?"GO":B?"BACK":"FORWARD",F=H?{type:"GO",index:j}:{type:B?"BACK":"FORWARD"};if(x)x=!1;else{const z=o();if(typeof document<"u"&&z.length){for(const q of z)if(await q.blockerFn({currentLocation:f,nextLocation:I,action:D})){y=!0,t.history.go(-j),M.notify(F);return}}}f=u(),M.notify(F)},k=I=>{if(b){b=!1;return}let j=!1;const P=o();if(typeof document<"u"&&P.length)for(const B of P){const H=B.enableBeforeUnload??!0;if(H===!0){j=!0;break}if(typeof H=="function"&&H()===!0){j=!0;break}}if(j)return I.preventDefault(),I.returnValue=""},M=Qq({getLocation:S,getLength:()=>t.history.length,pushState:(I,j)=>R(!0,I,j),replaceState:(I,j)=>R(!1,I,j),back:I=>(I&&(x=!0,b=!0),t.history.back()),forward:I=>{I&&(x=!0,b=!0),t.history.forward()},go:(I,j)=>{p=!0,j&&(x=!0,b=!0),t.history.go(I)},createHref:I=>c(I),flush:C,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(f_,k,{capture:!0}),t.removeEventListener(d_,O)},onBlocked:()=>{h&&f!==h&&(f=h)},getBlockers:o,setBlockers:l,notifyOnIndexChange:!1});return M._ignoreNextBeforeUnload=I=>{b=!1;try{I=new URL(I,t.document.baseURI).href,b=/^https?:/.test(I)&&(!I.includes("#")||I.split("#")[0]!==t.location.href.split("#")[0])}catch{}},t.addEventListener(f_,k,{capture:!0}),t.addEventListener(d_,O),t.history.pushState=function(...I){const j=n.apply(t.history,I);return M._ignoreSubscribers||T("PUSH"),j},t.history.replaceState=function(...I){const j=r.apply(t.history,I);return M._ignoreSubscribers||T("REPLACE"),j},M}function Ly(e,t){const n=t4(e),r=n.indexOf("#"),s=n.indexOf("?");if(!t){const o=u2();t={[Na]:0,key:o,__TSR_key:o}}return{href:n,pathname:n.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:n.length),hash:r>-1?n.substring(r):"",search:s>-1?n.slice(s,r===-1?void 0:r):"",state:t}}function u2(){return(Math.random()+1).toString(36).substring(7)}function x1(e,t){return e.protocol!=="http:"&&e.protocol!=="https:"||e.origin!==t||!!e.username||!!e.password}function b1(e){return e.pathname+e.search+e.hash}function p_(e){var t,n;return e.options.loader||e.options.beforeLoad||e.lazyFn||((t=e.options.component)==null?void 0:t.preload)||((n=e.options.pendingComponent)==null?void 0:n.preload)}function Lx(e,t){return{fromLocation:t,toLocation:e,pathChanged:(t==null?void 0:t.pathname)!==e.pathname,hrefChanged:(t==null?void 0:t.href)!==e.href,hashChanged:(t==null?void 0:t.hash)!==e.hash}}function m_({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...s}){return s}function Jq(e){return e.findIndex(t=>t.status==="error"||t.status==="notFound"||t._notFound)+1}function eG(e,t,n,r,s,o){var l,c,u,f;r&&(t=t.slice(0,r)),s&&(n=n.slice(0,s));for(const h of t){if(o&&e._tx!==o)return;n.some(p=>p.routeId===h.routeId)||(c=(l=e.routesById[h.routeId].options).onLeave)==null||c.call(l,h)}for(const h of n){if(o&&e._tx!==o)return;(f=(u=e.routesById[h.routeId].options)[t.some(p=>p.routeId===h.routeId)?"onStay":"onEnter"])==null||f.call(u,h)}}var tG=class{constructor(e,t){var n;this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async r=>(r(),!1),this.update=r=>{const s=this.options;this.options={...s,...r},this.isServer=this.options.isServer??n_??typeof document>"u",this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Zq()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost");const o=this.options.basepath??"/",l=this.options.rewrite,c=this.basepath!==o||(s==null?void 0:s.rewrite)!==l||(s==null?void 0:s.caseSensitive)!==this.options.caseSensitive;if(c&&(this.basepath=o,this.rewrite=o!=="/"&&KP(o)?Yq(o,this.options.caseSensitive,l):l),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree||n_){this.routeTree=this.options.routeTree;let u;u=this.buildRouteTree(),this.setRoutes(u)}if(this.stores)c&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){const u=this.getStoreConfig(this);this.batch=u.batch,this.stores=Wq(this.latestLocation,u),_q(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const r=Vq(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&Hq(this.options.routeMasks,r.processedTree),{...r,resolvePathCache:Iy(1e3)}},this.subscribe=(r,s)=>{const o={eventType:r,fn:s};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=r=>{for(const s of this.subscribers)if(s.eventType===r.type)try{s.fn(r)}catch(o){console.error(o)}},this.parseLocation=(r,s)=>{const o=({pathname:f,search:h,hash:p,href:y},x)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(f)){const C=this.options.parseSearch(h),R=this.options.stringifySearch(C);return{href:f+R+p,publicHref:f+R+p,pathname:_h(f),external:!1,searchStr:R,search:hd(s==null?void 0:s.search,C),hash:_h(p.slice(1)),state:Ta(s==null?void 0:s.state,x)}}const b=Qw(this.rewrite,new URL(y,this.origin)),S=this.options.parseSearch(b.search),E=this.options.stringifySearch(S);return b.search=E,{href:b.href.replace(b.origin,""),publicHref:y,pathname:_h(dy(b.pathname)),external:!!this.rewrite&&x1(b,this.origin),searchStr:E,search:hd(s==null?void 0:s.search,S),hash:_h(b.hash.slice(1)),state:Ta(s==null?void 0:s.state,x)}},l=o(r,r.state),{__tempLocation:c,__tempKey:u}=l.state;if(c&&(!u||u===this.tempLocationKey)){const f=o(c,{...c.state,__tempLocation:void 0,key:l.state.key,__TSR_key:l.state.__TSR_key});return f.maskedLocation=l,f}return l},this.matchRoutes=(r,s,o)=>typeof r=="string"?this.matchRoutesInternal({pathname:r,search:s},o):this.matchRoutesInternal(r,s),this.getMatchedRoutes=r=>{const s=Object.create(null),o=Uq(ni(r),this.processedTree,!0);return o&&Object.assign(s,o.rawParams),[(o==null?void 0:o.branch)||[this.routesById.__root__],s,o==null?void 0:o.route]},this.buildLocation=r=>{{const c=this.staticLocations.get(r);if(c)return c}let s=!1;const o=(c={})=>{var F;if(c.href){const z=Ly(c.href,{});c={...c,to:Qw(this.rewrite,new URL(z.pathname,this.origin)).pathname,search:this.options.parseSearch(z.search),hash:z.hash.slice(1)}}const u=c._fromLocation||this._pendingLocation||this.latestLocation;let f;const h=()=>(s=!0,u),p=()=>(s=!0,f??(f=this.matchRoutesLightweight(u))),y=c.to?`${c.to}`:".",x=i_(y[0]==="/"?"":c.unsafeRelative==="path"?h().pathname:c.from??p()[1],y,this.options.trailingSlash,this.resolvePathCache),b=this.routesByPath[ni(x)],S=x.includes("$");let E;if(b)E=b._branch??(b._branch=JP(b));else if(S)E=[];else{const[z,q,V]=this.getMatchedRoutes(x);E=z,this.options.notFoundRoute&&(!V||V.path!=="/"&&q["**"])&&(E=[...E,this.options.notFoundRoute])}const C=S?(b==null?void 0:b._interpolation)??xp(!1,{fullPath:x},0):void 0;let R;for(const z of E){const q=((F=z.options.params)==null?void 0:F.stringify)??z.options.stringifyParams;if(q){const V=p()[3];if(R??(R=v1(c.params,V)),!UP(R))break;R===V&&(R=Object.assign(cy(),R));try{Object.assign(R,q(R))}catch{}}}R??(R=v1(c.params,rG(c.params,C)?p()[3]:S1));const T=r.leaveParams?x:dy(_h(C?l_(x,C,R,this.pathParamsDecoder):x)),O=sG(E,r._includeValidateSearch),k=()=>{var q;let z=p()[2];if(r._includeValidateSearch&&((q=this.options.search)!=null&&q.strict)){const V={};E.forEach(G=>{if(G.options.validateSearch)try{Object.assign(V,fy(G.options.validateSearch,{...V,...z}))}catch{}}),z=V}return z},M=O.length?oG(O,k(),c):c.search===!0?k():typeof c.search=="function"?c.search(k()):c.search||S1,A=this.options.stringifySearch(M),L=c.hash===!0?h().hash:typeof c.hash=="function"?c.hash(h().hash):c.hash||void 0,I=L?`#${L}`:"",j=c.state?c.state===!0?h().state:typeof c.state=="function"?c.state(h().state):c.state:S1,P=`${T}${A}${I}`;let B,H,D=!1;if(this.rewrite){const z=new URL(P,this.origin),q=z.origin,V=e4(this.rewrite,z);B=b1(z),x1(V,q)?(H=V.href,D=!0):H=dy(b1(V))}else B=vq(P),H=B;return{publicHref:H,href:B,pathname:T,search:M,searchStr:A,state:j,hash:L??"",external:D,unmaskOnReload:c.unmaskOnReload}},l=o(r);if(r.mask)l.maskedLocation=o({from:r.from,...r.mask});else if(this.options.routeMasks){const c=Fq(l.pathname,this.processedTree);if(c){const u=Object.assign(cy(),c.rawParams),{from:f,params:h,...p}=c.route,y=v1(h,u);l.maskedLocation=o({from:r.from,...p,params:y})}}return!s&&r._fromLocation&&!l.maskedLocation&&this.staticLocations.set(r,l),l},this.commitLocation=async({viewTransition:r,ignoreBlocker:s,...o})=>{const l=o.maskedLocation??o;if(l.external)return g_(this,l.publicHref,{replace:o.replace,ignoreBlocker:s});let c;const u=ni(this.latestLocation.href)===ni(o.href)&&Xi(m_(o.state),m_(this.latestLocation.state)),f=this._commitPromise;let h;const p=new Promise(y=>{h=y});if(p.resolve=()=>{h(),f==null||f.resolve()},this._commitPromise=p,u)this.load();else{let{maskedLocation:y,hashScrollIntoView:x,...b}=o;y&&(b={...y,state:{...y.state,__tempKey:void 0,__tempLocation:{...b,search:b.searchStr,state:{...b.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(b.unmaskOnReload??this.options.unmaskOnReload??!1)&&(b.state.__tempKey=this.tempLocationKey)),b.state={...b.state,__hashScrollIntoViewOptions:x??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=r,c=o.replace?"REPLACE":"PUSH",this.history[c==="REPLACE"?"replace":"push"](b.publicHref,b.state,{ignoreBlocker:s}),this.history.subscribers.size||this.load({action:{type:c}})}return this._scroll.next=o.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:r,resetScroll:s,hashScrollIntoView:o,viewTransition:l,ignoreBlocker:c,...u}={})=>{const f=this.buildLocation({...u,_includeValidateSearch:!0});this._pendingLocation=f;const h=this.commitLocation({...f,viewTransition:l,replace:r,resetScroll:s,hashScrollIntoView:o,ignoreBlocker:c});return queueMicrotask(()=>{this._pendingLocation===f&&(this._pendingLocation=void 0)}),h},this.navigate=async({to:r,reloadDocument:s,href:o,publicHref:l,...c})=>{const u=o?yp(o):void 0;if(u||s){if(r!==void 0||!o){const h=this.buildLocation({to:r,...c}),p=h.maskedLocation??h;o??(o=p.publicHref),l??(l=p.publicHref)}return g_(this,!u&&l?l:o,c)}return this.buildAndCommitLocation({...c,href:o,to:r,_isNavigate:!0})},this.load=async r=>{this.updateLatestLocation(),r!=null&&r.action&&(this._scroll.hash=r.action.type==="PUSH"||r.action.type==="REPLACE"),await pG(this,r)},this.startViewTransition=r=>{var o,l;const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document.startViewTransition=="function"){let c;if(typeof s=="object"&&((l=(o=window.CSS)==null?void 0:o.supports)!=null&&l.call(o,"selector(:active-view-transition-type(a))"))){const u=this.latestLocation,f=this.stores.resolvedLocation.get(),h=typeof s.types=="function"?s.types(Lx(u,f)):s.types;if(h===!1)return r();c={update:r,types:h}}else c=r;return document.startViewTransition(c).updateCallbackDone}return r()},this.invalidate=r=>{var p,y;const s=this._committed,o=r==null?void 0:r.filter,l=this._preloads,c=new Set,u=x=>{(!o||o(x))&&c.add(x.id)};s.forEach(u),this._cache.forEach(u),l==null||l.forEach(x=>x.forEach(u)),(p=this._tx)==null||p[3].forEach(u);const f=[];for(const[x,b]of l??[])b.some(S=>c.has(S.id))&&(l.delete(x),f.push(x));const h=x=>{if(c.has(x.id)){const b=this.routesById[x.routeId],S={...x,invalid:!0,...(r!=null&&r.forcePending||x.status==="error"||x.status==="notFound")&&p_(b)?{status:"pending",error:void 0}:void 0};return x._flight=void 0,S}return x};this._committed=s.map(h);for(const[x,b]of this._cache)c.has(x)&&(b.invalid=!0,r!=null&&r.forcePending&&(b.status="pending"));for(const x of c)(y=this._flights)==null||y.delete(x);for(const x of f)x.abort();return this.shouldViewTransition=!1,this.load({sync:r==null?void 0:r.sync})},this.resolveRedirect=r=>{const s=r.options;let o=r.headers.get("Location")||s.href;if(!o){const c=this.buildLocation(s);o=(c.maskedLocation??c).publicHref||"/"}let l;if(VP.test(o)||(l=yp(o))&&!this.protocolAllowlist.has(l))throw new Error("Redirect blocked: unsafe protocol");if(l==="http:"||l==="https:"){const c=new URL(o);c.pathname.startsWith("//")?o=c.href:x1(c,this.origin)||(o=b1(c),l=void 0)}return l&&(s.reloadDocument=!0),s.href=o,r.headers.set("Location",o),r},this.clearCache=r=>{var h;const s=this._cache,o=this._preloads,l=r==null?void 0:r.filter,c=[],u=[];for(const[p,y]of s)(!l||l(y))&&(u.push(p),c.push(y));const f=[];for(const[p,y]of o??[])(!l||y.some(l))&&(f.push(p),c.push(...y));for(const p of u)s.delete(p);for(const p of f)o.delete(p);for(const p of c){const y=p._flight;p._flight=void 0,y&&!--y[2]&&(((h=this._flights)==null?void 0:h.get(p.id))===y&&this._flights.delete(p.id),f.push(y[1]))}for(const p of f)p.abort()},this.loadRouteChunk=Id,this.preloadRoute=r=>mG(this,r),this.matchRoute=(r,s)=>{const o={...r,to:r.to?i_(r.from||"",r.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:r.params||{},leaveParams:!0},l=this.buildLocation(o),c=this.stores.status.get()==="pending";if(s!=null&&s.pending&&!c)return!1;const u=(s==null?void 0:s.pending)??!c?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),f=$q(l.pathname,(s==null?void 0:s.caseSensitive)??!1,(s==null?void 0:s.fuzzy)??!1,u.pathname,this.processedTree);return!f||r.params&&!Xi(f.rawParams,r.params,!0)?!1:(s==null?void 0:s.includeSearch)??!0?Xi(u.search,l.search,!0)?f.rawParams:!1:f.rawParams},this.getStoreConfig=t,(n=e.pathParamsAllowedCharacters)!=null&&n.length&&(this.pathParamsDecoder=wq(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??Dq,parseSearch:e.parseSearch??Lq,protocolAllowlist:e.protocolAllowlist??bq}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;const t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=xp(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){var y,x;const[n,r,s]=this.getMatchedRoutes(e.pathname);let o=n,l=!1;(s?s.path!=="/"&&r["**"]:ni(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:l=!0);const c=l?iG(this.options.notFoundMode,o):void 0,u=new Array(o.length),f=this._committed,h=(b,S)=>{const E=f[S];return(E==null?void 0:E.routeId)===b.id?E:b===this.options.notFoundRoute?f.find(C=>C.routeId===b.id):void 0};let p;for(let b=0;b<o.length;b++){const S=o[b],E=u[b-1];let C,R,T;{const F=(E==null?void 0:E.search)??e.search,z=(E==null?void 0:E._strictSearch)??void 0;try{const q=fy(S.options.validateSearch,{...F})??void 0;C={...F,...q},R={...z,...q}}catch(q){let V=q;if(q instanceof Dy||(V=new Dy(q.message,{cause:q})),t!=null&&t.throwOnError)throw V;C=F,R={},T=V}}let O="",k="";try{O=((x=(y=S.options).loaderDeps)==null?void 0:x.call(y,{search:C}))??"",k=O&&JSON.stringify(O)||""}catch(F){if(t!=null&&t.throwOnError)throw F;T??(T=F)}const M=cy(),A=S._interpolation?l_(S.fullPath,S._interpolation,r,this.pathParamsDecoder,M):S.fullPath,L=S.id+A+k,I=h(S,b),j=this._cache.get(L)??((I==null?void 0:I.id)===L?I:void 0);p=(j==null?void 0:j._strictParams)??Object.assign(M,p);let P;if(!j)try{y_(S,p)}catch(F){if(sf(F)||WP(F)?P=F:P=new nG(F.message,{cause:F}),t!=null&&t.throwOnError)throw P}const B=I?"stay":"enter";let H;if(j)H={...j,cause:B,search:hd(I?I.search:j.search,C),_strictSearch:R,searchError:T};else{const F=p_(S)?"pending":"success";H={id:L,ssr:S.options.ssr,index:b,routeId:S.id,params:(I==null?void 0:I.params)??p,_strictParams:p,pathname:A,updatedAt:Date.now(),search:I?hd(I.search,C):C,_strictSearch:R,searchError:T,status:F,isFetching:!1,error:void 0,paramsError:P,context:{},abortController:(t==null?void 0:t._controller)??new AbortController,cause:B,loaderDeps:I?Ta(I.loaderDeps,O):O,invalid:!1,preload:!1,staticData:S.options.staticData||{},fullPath:S.fullPath}}const D=c===S.id;H._notFound&&!D&&(H.error=void 0),H._notFound=D,u[b]=H}for(let b=0;b<u.length;b++){const S=u[b];S.params=S.cause==="stay"?hd(S.params,p):p,t!=null&&t._controller&&(S.context={})}return u}matchRoutesLightweight(e){const t=ja(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n==null?void 0:n.id,s=this.lightweightCache.get(e);if(s&&s[0]===r)return s[1];const[o,l]=this.getMatchedRoutes(e.pathname),c=ja(o),u={...e.search};for(const y of o)try{Object.assign(u,fy(y.options.validateSearch,u))}catch{}const f=n&&n.routeId===c.id&&n.pathname===e.pathname;let h;if(f)h=n.params;else{const y=l;for(const x of o)try{y_(x,y)}catch{}h=y}const p=[o,c.fullPath,u,h];return this.lightweightCache.set(e,[r,p]),p}};async function g_(e,t,{replace:n,ignoreBlocker:r}){var s,o;if(!qP(t,e.protocolAllowlist)){if(!r){const l=e.history._getBlockers();for(const c of l)if(c!=null&&c.blockerFn&&await c.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?"REPLACE":"PUSH"}))return}(o=(s=e.history)._ignoreNextBeforeUnload)==null||o.call(s,t),n?window.location.replace(t):window.location.href=t}}var Dy=class extends Error{},nG=class extends Error{};function fy(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Dy("Async validation not supported");if(n.issues)throw new Dy(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function v1(e,t){if(e===void 0||e===!0)return t;const n=Object.create(null);return e===!1||e===null?n:typeof e=="function"?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function rG(e,t){return typeof e=="function"?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(n=>typeof n!="string"&&!l2.call(e,n[1]))}const S1=Object.freeze({});function sG(e,t){var r;const n=[];for(let s=0;s<e.length;s++){const o=e[s].options;if("search"in o)(r=o.search)!=null&&r.middlewares&&n.push(...o.search.middlewares);else if(o.preSearchFilters||o.postSearchFilters){const c=({search:u,next:f})=>{const h=f(o.preSearchFilters?o.preSearchFilters.reduce((p,y)=>y(p),u):u);return o.postSearchFilters?o.postSearchFilters.reduce((p,y)=>y(p),h):h};n.push(c)}const l=o.validateSearch;if(t&&l){const c=({search:u,next:f,meta:h})=>{const p=f(u);try{const y=fy(l,p);if(h&&y)for(const x in y)x in p||(h.defaulted||(h.defaulted=new Map)).set(x,y[x]);return{...p,...y}}catch{}return p};n.push(c)}}return n}function oG(e,t,n){const r=(s,o,l)=>{if(s>=e.length){if(!n.search)return{};if(n.search===!0)return o;const u=$P(n.search,o);return l&&(l.explicit=u),u}const c=(u,f)=>{if(f){const h=l||{};return{search:r(s+1,u,h),meta:h}}return r(s+1,u,l)};return e[s]({search:o,next:c,meta:l})};return r(0,t)}function iG(e,t){if(e!=="root"){let n;for(let r=t.length-1;r>=0;r--){const s=t[r];if(s.options.notFoundComponent)return s.id;n||(n=s.children&&s.id)}if(n)return n}return Md}function y_(e,t){var r;const n=((r=e.options.params)==null?void 0:r.parse)??e.options.parseParams;n&&Object.assign(t,n(t))}function Zw(e,t){var n,r;return(r=(n=e.options[t])==null?void 0:n.preload)==null?void 0:r.call(n)}function lG(e,t){const n=Zw(e,"component");let r=Zw(e,"pendingComponent");return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Id(e,t,n){const r=()=>t===!1?void 0:t?Zw(e,t):lG(e,n),s=e._lazy;if(s)return s===!0?r():s.then(r);if(!e.lazyFn)return r();const o=e.lazyFn().then(l=>{{const{id:c,...u}=l.options;Object.assign(e.options,u),e._lazy=!0}},l=>{throw e._lazy=void 0,l});return e._lazy=o,o.then(r)}function d2(e){const t=e.findIndex(n=>n.status!=="success"||n._notFound)+1;return t&&t<e.length?e.slice(0,t):e}const li=0,Qi=1,Dx=2,ts=3,Pa=[4];function bp(e){return typeof e[0]=="number"}function yu(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{const s=()=>r(t);t.addEventListener("abort",s,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener("abort",s))})}function xu(e,t){return e.routesById[t.routeId]}function vp(e,t,n){return WP(e)?[ts,e]:sf(e)?(e.routeId||(e.routeId=n),[Dx,e]):t?(typeof(e==null?void 0:e.then)=="function"&&(e=new Error("A Promise was thrown",{cause:e})),[Qi,e]):[li,e]}function f2(e,t){var r,s;let n=vp(t,!0,e.id);if(n[0]!==Qi)return n;try{(s=(r=e.options).onError)==null||s.call(r,n[1])}catch(o){n=vp(o,!0,e.id)}return n}function rp(e,t,n,r,s){return s[0].signal.aborted?Pa:m2(e,t,n,f2(n,r),s)}async function aG(e,t,n,r,s,o){var h,p;const[l,c]=t,u=n[0].signal,f=!!n[3];for(let y=n[6]??0;y<r;y++){const x=c[y],b=xu(e,x);x.abortController=n[0];const S=((h=c[y-1])==null?void 0:h.context)??e.options.context??{},E={params:x.params,location:l,navigate:O=>e.navigate({...O,_fromLocation:l}),buildLocation:e.buildLocation,cause:f?"preload":x.cause,abortController:n[0],preload:f,matches:c,routeId:b.id};try{const O=x._ctx||(x._ctx=b.options.context?b.options.context({...E,deps:x.loaderDeps,context:S})||{}:void 0);x.context={...S,...O}}catch(O){return Vi(e,x),[y,rp(e,t,b,O,n)]}if(u.aborted)return[y,Pa];const C=x.paramsError??x.searchError;if(C!==void 0)return Vi(e,x),[y,rp(e,t,b,C,n)];const R=b.options.beforeLoad;if(!R)continue;const T=x.status;y>=o&&(x.status="pending",(p=n[7])==null||p.call(n));try{Sp(e,x,"beforeLoad",n[0]);const O=R({...E,search:x.search,context:x.context,...e.options.additionalContext}),k=await(typeof(O==null?void 0:O.then)=="function"?yu(O,u):O);if(u.aborted)return[y,Pa];const M=m2(e,t,b,vp(k,!1,b.id),n);if(M[0]!==li)return Vi(e,x),[y,M];x.context={...x.context,...k}}catch(O){return Vi(e,x),[y,rp(e,t,b,O,n)]}finally{x.status=T,Sp(e,x,!1,n[0])}}s()}function h2(e,t,n){var r;if(!(!n||--n[2])){if(((r=e._flights)==null?void 0:r.get(t.id))===n){const s=e._tx;if(s&&!s[0].signal.aborted&&!s[3].includes(t)&&s[3].some(o=>o.id===t.id)&&s[3].some(o=>o.isFetching==="beforeLoad"))return;e._flights.delete(t.id)}return n[1]}}function Vi(e,t){var r;const n=t._flight;t._flight=void 0,(r=h2(e,t,n))==null||r.abort()}function xs(e,t,n,r){var o;const s=[];for(const l of t)if(!(n!=null&&n.includes(l))){const c=l._flight;if(l._flight=void 0,r&&(c==null?void 0:c[2])===1&&((o=e._flights)==null?void 0:o.get(l.id))===c&&(n!=null&&n.some(u=>u.id===l.id)))c[2]=0;else{const u=h2(e,l,c);u&&s.push(u)}}for(const l of s)l.abort()}function p2(e){for(const t of e){const n=t._flight;n&&n[2]++}}function Sp(e,t,n,r){var l;if(t.isFetching=n,r&&((l=e._tx)==null?void 0:l[0])!==r)return;const s=e.stores.byRoute.get(t.routeId),o=s==null?void 0:s.get();(o==null?void 0:o.id)===t.id&&s.set({...o,isFetching:n})}function n4(e,t,n,r,s,o,l){const c=t[0];return{params:n.params,location:c,navigate:u=>e.navigate({...u,_fromLocation:c}),cause:l?"preload":n.cause,abortController:s,preload:l,deps:n.loaderDeps,parentMatchPromise:o,context:n.context,route:r,...e.options.additionalContext}}async function x_(e,t,n,r,s,o,l){const c=l[0],u=c.signal;if(u.aborted)return Pa;if(!s)return[li,void 0];let f=n._flight;Sp(e,n,"loader",c);try{if(!f){const h=new AbortController;f=[Promise.resolve().then(()=>s(n4(e,t,n,r,h,o,!!l[3]))).then(p=>vp(p,!1,r.id),p=>vp(p,!0,r.id)).then(p=>{var y;return p[0]!==li&&((y=e._flights)==null?void 0:y.get(n.id))===f&&(e._flights.delete(n.id),f[2]||h.abort()),p[0]===Qi&&f[2]?f2(r,p[1]):p}),h,1],(e._flights??(e._flights=new Map)).set(n.id,f)}return n._flight=f,n.abortController=f[1],m2(e,t,r,await yu(f[0],u),l)}catch(h){if(h!==u||!u.aborted)throw h;return Vi(e,n),Pa}finally{Sp(e,n,!1,c)}}function b_(e,t,n){t[0]!==ts&&(e.status="success",e.error=void 0,t[0]===li?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function cG(e,t,n){const r=e._cache.get(t.id);if(r!==n||e._committed.some(o=>o.id===t.id&&o._flight===t._flight))return;const s={...t,_notFound:void 0,context:{}};s._flight&&s._flight[2]++,e._cache.set(t.id,s),r&&Vi(e,r)}function v_(e,t){return t[0]===Qi||t[0]===Dx?{...e,status:t[0]===Qi?"error":"notFound",error:t[1],_flight:void 0}:e}function uG(e,t,n,r,s,o,l){var B,H;const c=t[1][n],u=xu(e,c),f=!!o[3],h=e._cache.get(c.id);let p,y=!1,x;try{if(c.status==="success"&&(p=u.options.shouldReload,typeof p=="function"&&(p=p(n4(e,t,c,u,o[0],s,f))),o[0].signal.aborted&&(x=Pa)),!x)if(c.status!=="success")y=!0;else{const D=f||c.preload?u.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:u.options.staleTime??e.options.defaultStaleTime??0;y=!!(c.invalid||p||p===void 0&&Date.now()-c.updatedAt>=D&&(o[5]||c.cause==="enter"||o[2].some(F=>F.routeId===c.routeId&&F.id!==c.id)))}}catch(D){c.invalid=!0,Vi(e,c),x=rp(e,t,u,D,o)}const b=u.options.loader,S=typeof b=="function",E=S?b:b==null?void 0:b.handler,C=!f||u.options.preload!==!1;let R=C&&b?(B=e._flights)==null?void 0:B.get(c.id):void 0;R===c._flight||x?R=void 0:R&&!y&&!f&&p===void 0?y=!0:y||(R=void 0);const T=!!(b&&y&&c.status==="success"&&!f&&!o[4]&&((S?void 0:b.staleReloadMode)??e.options.defaultStaleReloadMode)!=="blocking"),O=y&&C,k=O&&!T&&(c.status!=="success"||!!b),M=n>=l?o[7]:void 0,A=u.lazyFn&&u._lazy!==!0?M:void 0;if(O&&!b&&(c.invalid=!1,c.updatedAt=Date.now()),R&&R[2]++,k){const D=c._flight;c._flight=R,(H=h2(e,c,D))==null||H.abort(),n>=l&&(c.status="pending"),M==null||M()}O||(c.isFetching=!1);const L=!x&&k?x_(e,t,c,u,E,s,o).then(D=>(b_(c,D,f),D[0]===li&&(b&&!o[0].signal.aborted&&cG(e,c,h),n>=l&&(c.status="pending")),D)):Promise.resolve(x??[li,c.loaderData]),I=(async()=>{try{const F=Id(u,void 0,A);F&&await yu(F,o[0].signal)}catch(F){if(!t[1].some((z,q)=>q<=n&&(z.status==="error"||z.status==="notFound"||z._notFound)))return[n,rp(e,t,u,F,o)]}const D=await L;k&&D[0]===li&&c.status==="pending"&&!o[0].signal.aborted&&(c.status="success",M==null||M())})();if(r.push([n,L,I]),!T)return L.then(D=>v_(c,D));const j={...c,status:"pending",preload:!1,_flight:R};c.invalid=!1,c.isFetching="loader";const P=x_(e,t,j,u,E,s,o).then(D=>(c.isFetching=!1,b_(j,D,!1),D));return(t[2]??(t[2]=[])).push([n,P,I,j]),P.then(D=>v_(j,D))}async function Jw(e,t,n,r,s=0){const o=n==null?void 0:n[1][1];let l=o!=null&&o.routeId?t.findIndex(c=>c.routeId===o.routeId):(n==null?void 0:n[0])??t.length-1;l<0&&(l=0);for(let c=l;c>=0;c--){const u=xu(e,t[c]);try{const f=Id(u,!1);f&&await yu(f,r)}catch(f){if(f===r&&r.aborted)throw f}if(u.options.notFoundComponent)return c}return o!=null&&o.routeId?l:s}function Xc(e,t){t[2]&&(xs(e,t[2].map(n=>n[3])),t[2]=void 0)}async function S_(e,t,n,r){let s;try{await Promise.all(e.map(o=>o[1].then(async l=>{const c=o[0];if(!(r&&c>=await r)){if(l[0]>=ts)throw[c,l];!s&&l[0]!==li&&(s=[c,l],await Promise.all((n??[]).map(u=>{if(!(u[0]<=c))return u[1].then(f=>{if(f[0]===ts)throw[u[0],f]})})))}})))}catch(o){return o}return t??s}function m2(e,t,n,r,s,o){for(;r[0]===ts;){const l=r[1],c=l.options;try{if((c.href||l.headers.has("Location"))&&(e.resolveRedirect(l),c.reloadDocument)||(c.reloadDocument?s[3]:s[1]>=20))return r;const u=e.buildLocation({...c,_fromLocation:t[0],_includeValidateSearch:!0}),f=u.maskedLocation??u;if(f.external){const h=l.clone();return h.options={...c},h.headers.set("Location",f.publicHref),e.resolveRedirect(h),s[3]?[ts,h]:[ts,h,f]}return[ts,l,u]}catch(u){r=o?[Qi,u]:f2(n,u),o=!0}}return r}async function r4(e,t,n,r,s,o){const l=t[1];let c=await s,u=!1;const f=l.findIndex(x=>x._notFound),h=x=>x[1][0]===Dx?Jw(e,l,x,r.signal):x[0];let p=f<0?l.length:f;if(((c==null?void 0:c[1][0])??0)>=ts)p=0;else if(c){p=c[2]??(c[2]=await h(c));for(const x of n){if(x[0]>=p)break;const b=await x[1];if(b[0]!==li&&b[0]<ts&&!("loaderData"in l[x[0]])){c=[x[0],b],p=c[2]=await h(c);break}}}for(const x of n){if(x[0]>=p)break;const b=await x[2];if(b){c=b;break}}if(((c==null?void 0:c[1][0])??0)>=ts){const x=c[1];if(x[0]!==ts||x[1].options.reloadDocument||x[2])return Xc(e,t),x;u=!0,c=[0,[Qi,new Error("Too many redirects")]]}const y=c?c[2]??await h(c):f;if(y>=0){const x=c==null?void 0:c[1],b=x==null?void 0:x[0],S=l[y],E=x==null?void 0:x[1],C=()=>{x&&(S._notFound=void 0,b===Qi?S.status="error":(E.routeId=S.routeId,S.routeId===e.routeTree.id?(S.status="success",S._notFound=!0):S.status="notFound"),S.error=E,S.isFetching=!1)};C(),x||o==null||o();const R=xu(e,S);try{await yu(x?Promise.resolve().then(()=>Id(R,b===Qi?"errorComponent":"notFoundComponent")):Promise.all([Id(R),Id(R,"notFoundComponent")]),r.signal)}catch(T){if(T===r.signal&&r.signal.aborted)return Xc(e,t),Pa}x?u&&(r.abort(),await Promise.all([...n.map(T=>T[1]),...n.map(T=>T[2]),...(t[2]??[]).map(T=>T[1])]),Xc(e,t),xs(e,l),C()):S.status="success"}return t}async function s4(e,t,n,r=0,s=t[1].length){var l,c;const o=t[1];for(let u=r;u<s;u++){const f=o[u],h=xu(e,f).options;if(h.head||h.scripts)try{const p={ssr:e.options.ssr,matches:o,match:f,params:f.params,loaderData:f.loaderData},[y,x]=await yu(Promise.all([(l=h.head)==null?void 0:l.call(h,p),(c=h.scripts)==null?void 0:c.call(h,p)]),n);f.meta=y==null?void 0:y.meta,f.links=y==null?void 0:y.links,f.headScripts=y==null?void 0:y.scripts,f.styles=y==null?void 0:y.styles,f.scripts=x}catch(p){if(p===n&&n.aborted)break;console.error(p)}if(f.status!=="success"||f._notFound)break}return t}async function o4(e,t,n,r){var c;const s=[t,n],o=r[0].signal;let l;try{const u=e.stores.matches.get();let f=n.findIndex(R=>R._notFound);if(e.options.notFoundMode!=="root"&&f>=0){const R=await Jw(e,n,void 0,o,f);n[f]._notFound=void 0,n[R]._notFound=!0,f=R}let h=f<0?n.length:f+1,p=0;for(;p<h&&p!==f;){const R=n[p],T=r[2][p],O=u[p];if((T==null?void 0:T.id)!==R.id||T.status!=="success"||R.preload||(O==null?void 0:O.id)!==R.id||O.status!=="success"||(p++,T._notFound||O._notFound))break}const y=[],x=r[6]??0;let b=x?Promise.resolve(n[x-1]):void 0;const S=()=>{for(let R=x;R<h&&!o.aborted;R++)b=uG(e,s,R,y,b,r,p)},E=await aG(e,s,r,h,S,p);if(E){if(r[4]=!0,h=E[0],E[1][0]===Dx){const R=await Jw(e,n,E,o);E[2]=R,h=Math.min(h,R+1)}else E[1][0]>=ts&&(h=0);S()}if(!o.aborted&&!r[3]){const R=[];for(const[T,O]of e._flights??[])O[2]||(e._flights.delete(T),R.push(O[1]));for(const T of R)T.abort()}const C=r4(e,s,y,r[0],S_(y,E,s[2]),r[7]);(c=s[2])!=null&&c.length&&(s[3]=S_(s[2],void 0,void 0,C.then(R=>bp(R)?0:d2(n).length,()=>0))),l=await C}catch(u){if(Xc(e,s),u===o&&o.aborted)return Pa;throw u}return bp(l)?l:s4(e,l,o,r[6]===n.length?r[6]:0)}function eE(e,t){var o,l;if(e._tx!==t)return;const n=t[3],r=e.stores.matches.get();let s=e._pending;for(let c=0;c<n.length;c++){const u=n[c],f=u.status==="success"&&!u._notFound,h=((o=r[c])==null?void 0:o.id)===u.id&&((l=r[c])==null?void 0:l.status)==="pending";if(f&&!h)continue;const p=xu(e,u),y=f||u.invalid?0:p.options.pendingMs??e.options.defaultPendingMs,x=p.options.pendingComponent??e.options.defaultPendingComponent;if(!x||typeof y!="number"||y===1/0){s&&(s[0]=t,s[2]=0,s[4]=!0);return}const b=p.options.pendingMinMs??e.options.defaultPendingMinMs??0;let S=!1;if((s==null?void 0:s[1])===u.id?(S=s[0]!==t,s[0]=t):(clearTimeout(s==null?void 0:s[3]),e._pending=s=void 0),s||(e._pending=s=[t,u.id,h?Date.now()+b:t[4]+y,void 0,h||void 0,x]),s[4]&&!S&&s[5]===x)return;if(s[5]=x,!s[4]){clearTimeout(s[3]);const R=s[2]-Date.now();if(R>0){s[3]=setTimeout(()=>eE(e,t),R);return}s[2]=0}const E=n.map(R=>({...R,_flight:void 0}));E[c].status="pending";const C=s[4]=e.startTransition(()=>e.stores.setMatches(E),E).then(R=>(R&&e._pending===s&&s[4]===C&&!s[2]&&(s[2]=Date.now()+b),R));return}}function Mh(e,t){var r;const n=e._pending;(e._tx===t||!((r=e._tx)!=null&&r[3].some(s=>s.id===(n==null?void 0:n[1]))))&&(clearTimeout(n==null?void 0:n[3]),e._pending=void 0)}async function w_(e,t){const n=e._pending;if(!n)return;clearTimeout(n[3]);const r=n[2]-Date.now();if(!n[4]||r<=0||!d2(t[3]).some(o=>o.id===n[1]))return;let s;try{await yu(new Promise(o=>{s=setTimeout(o,r)}),t[0].signal)}catch{}clearTimeout(s)}function i4(e,t){e._committed=t,e.stores.setMatches(t)}function dG(e,t,n,r){const s=e._committed,o=e._lifecycleEnd,l=e._cache;for(const h of n)h.preload=!1,r&&(h._assetEnd=void 0);const c=d2(n).length,u=new Map;{const h=Date.now(),p=new Set;for(let y=0;y<n.length;y++){const x=n[y];(y<c||x.status==="success")&&p.add(x.id)}for(const y of[...s,...l.values()]){if(y.status!=="success"||p.has(y.id))continue;const x=xu(e,y);!x.options.loader||h-y.updatedAt>=(y.preload?x.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:x.options.gcTime??e.options.defaultGcTime??3e5)||u.set(y.id,l.get(y.id)===y?y:{...y,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=u;const f=e._lifecycleEnd=Jq(n);i4(e,n),xs(e,[...l.values(),...s].filter(h=>h._flight&&u.get(h.id)!==h),n),eG(e,s,n,o,f,t)}async function v0(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function l4(e,t,n){const r=n[1].options,s=n[2];if(!s)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(s.maskedLocation??s).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});s._redirects=t[1]+1,e._pendingLocation=s;const o=e.commitLocation({...s,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===s&&(e._pendingLocation=void 0)}),o}async function fG(e,t,n,r,s){const o=n.map(u=>({...u}));p2(o);for(const u of r)Vi(e,o[u[0]]),o[u[0]]=u[3];const l=[t[2],o];let c;try{c=await r4(e,l,r,t[0],s)}catch(u){throw xs(e,o),u}if(bp(c)){xs(e,o),c[0]===ts&&e._tx===t&&e._committed===n&&await l4(e,t,c);return}if(await s4(e,c,t[0].signal),e._tx!==t||e._committed!==n){xs(e,o);return}for(const u of o){const f=e._cache.get(u.id);f!=null&&f._flight&&f._flight===u._flight&&(e._cache.delete(u.id),Vi(e,f))}i4(e,o),xs(e,n,o)}async function hG(e,t,n,r,s,o){const l=await o4(e,t[2],t[3],[t[0],t[1],e._committed,void 0,s,n,o,r]);if(bp(l)){const p=l[0]===ts&&e._tx===t;if((!p||l[1].options.reloadDocument)&&Mh(e,t),xs(e,t[3]),t[3]=[],!p)return;if(e._tx!==t){Mh(e,t);return}await l4(e,t,l);return}const c=l[1];if(e._tx===t&&await w_(e,t),e._tx!==t){Mh(e,t),xs(e,c),Xc(e,l);return}const u=t[2],f=Lx(u,e.stores.resolvedLocation.get()),h=l[2];await e.startViewTransition(async()=>{var x;if(e._tx===t&&await w_(e,t),e._tx!==t){Mh(e,t),xs(e,c),Xc(e,l);return}const p=()=>{Mh(e,t),dG(e,t,c,o),e._tx===t&&(e.emit({type:"onLoad",...f}),e._tx===t&&e.emit({type:"onBeforeRouteMount",...f}))},y=await e.startTransition(p,c);if(e._tx!==t){Xc(e,l);return}h!=null&&h.length&&fG(e,t,c,h,l[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(u),e.stores.status.set("idle"),e._tx===t&&e.emit({type:"onResolved",...f}),y&&e._tx===t&&e.emit({type:"onRendered",...f})}),e._tx===t&&((x=e._commitPromise)==null||x.resolve(),e._commitPromise=void 0)})}async function pG(e,t){var O;const n=e._tx,r=e.stores.resolvedLocation.get(),s=r??e.stores.location.get(),o=e.latestLocation,l=e._pendingLocation,c=(l==null?void 0:l.href)===o.href?l._redirects??0:0,u=e._handoff,f=u==null?void 0:u[0](),h=new AbortController,p=e._preflight;if(e._preflight=h,f||u==null||u[1](),p==null||p.abort(),!h.signal.aborted){const k=Lx(o,r);e.emit({type:"onBeforeNavigate",...k}),h.signal.aborted||e.emit({type:"onBeforeLoad",...k})}if(h.signal.aborted){await v0(e,n);return}const y=s.href===o.href;let x=h;const b=e.matchRoutes(o,{_controller:h});p2(b);const S=f?u[1](b):void 0;if(S?x=f:f==null||f.abort(),h.signal.aborted){xs(e,b),await v0(e,n);return}e._preflight=void 0;let E;const C=()=>hG(e,T,y,()=>eE(e,T),t==null?void 0:t.sync,S),R=t!=null&&t.sync?new Promise(k=>E=k):Promise.resolve().then(C),T=[x,c,o,b,Date.now(),R.then(()=>v0(e,T))];if(e._tx=T,n){for(const k of e.stores.matches.get()){if(e._tx!==T)break;k.isFetching&&Sp(e,k,!1)}n[0].abort(),xs(e,n[3],T[3],!0)}if(e._tx!==T){xs(e,T[3]),T[3]=[],E==null||E(),await v0(e,T);return}e.batch(()=>{e.stores.status.set("pending"),e.stores.location.set(o)}),(S||!e._committed.length&&((O=b[0])==null?void 0:O.status)!=="success"&&!b.some(k=>k._notFound))&&eE(e,T),E==null||E(C()),await T[5]}async function mG(e,t){let n=e.buildLocation(t);for(let r=0;;r++){const s=e._committed,o=new AbortController;let l,c,u;try{try{l=e.matchRoutes(n,{_controller:o}),p2(l),c=(e._preloads??(e._preloads=new Map)).set(o,l),u=await o4(e,n,l,[o,r,s,!0])}finally{c&&(c=c.delete(o),xs(e,l)),o.abort()}if(!bp(u))return u[1];if(!c||u.length<3)return;n=u[2]}catch(f){sf(f)||console.error(f);return}}}const gG="Error preloading route! ☝️";var a4=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{var u,f;this.originalIndex=t,this._branch=void 0;const n=this.options,r=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(f=(u=this.options).getParentRoute)==null?void 0:f.call(u),r?this._path=Md:this.parentRoute||a2();let s=r?Md:n==null?void 0:n.path;s&&s!=="/"&&(s=GP(s));const o=(n==null?void 0:n.id)||s,l=r?Md:kd((this.parentRoute.id==="__root__"?"":this.parentRoute.id)+"/"+(o??""));s==="__root__"&&(s="/");const c=l==="__root__"?"/":s===void 0?this.parentRoute.fullPath:kd(this.parentRoute.fullPath+"/"+s);this._path=s,this._id=l,this._fullPath=c,this._to=ni(c)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>Ix({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},yG=class extends a4{constructor(e){super(e)}},g2=class extends N.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){var n,r;(r=(n=this.props).onCatch)==null||r.call(n,e,t)}render(){const e=this.state.error;return e?N.createElement(this.props.errorComponent??xG,{error:e[0],reset:this.reset}):this.props.children}};function xG({error:e}){const[t,n]=N.useState(!1);return g.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[g.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),g.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),g.jsx("div",{style:{height:".25rem"}}),t?g.jsx("div",{children:g.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e!=null&&e.message?g.jsx("code",{children:e.message}):null})}):null]})}var bG=()=>!0,vG=()=>!1;function SG({children:e,fallback:t=null}){return g.jsx(si.Fragment,{children:c4()?e:t})}function c4(){return si.useSyncExternalStore(wG,bG,vG)}function wG(){return()=>{}}var u4=N.createContext(null);function qs(e){return N.useContext(u4)}var jx=N.createContext(void 0),EG=N.createContext(void 0);function CG({update:e,notify:t,unwatched:n}){return{link:r,unlink:s,propagate:o,checkDirty:l,shallowPropagate:c};function r(f,h,p){const y=h.depsTail;if(y!==void 0&&y.dep===f)return;const x=y!==void 0?y.nextDep:h.deps;if(x!==void 0&&x.dep===f){x.version=p,h.depsTail=x;return}const b=f.subsTail;if(b!==void 0&&b.version===p&&b.sub===h)return;const S=h.depsTail=f.subsTail={version:p,dep:f,sub:h,prevDep:y,nextDep:x,prevSub:b,nextSub:void 0};x!==void 0&&(x.prevDep=S),y!==void 0?y.nextDep=S:h.deps=S,b!==void 0?b.nextSub=S:f.subs=S}function s(f,h=f.sub){const p=f.dep,y=f.prevDep,x=f.nextDep,b=f.nextSub,S=f.prevSub;return x!==void 0?x.prevDep=y:h.depsTail=y,y!==void 0?y.nextDep=x:h.deps=x,b!==void 0?b.prevSub=S:p.subsTail=S,S!==void 0?S.nextSub=b:(p.subs=b)===void 0&&n(p),x}function o(f){let h=f.nextSub,p;e:do{const y=f.sub;let x=y.flags;if(x&60?x&12?x&4?!(x&48)&&u(f,y)?(y.flags=x|40,x&=1):x=0:y.flags=x&-9|32:x=0:y.flags=x|32,x&2&&t(y),x&1){const b=y.subs;if(b!==void 0){const S=(f=b).nextSub;S!==void 0&&(p={value:h,prev:p},h=S);continue}}if((f=h)!==void 0){h=f.nextSub;continue}for(;p!==void 0;)if(f=p.value,p=p.prev,f!==void 0){h=f.nextSub;continue e}break}while(!0)}function l(f,h){let p,y=0,x=!1;e:do{const b=f.dep,S=b.flags;if(h.flags&16)x=!0;else if((S&17)===17){if(e(b)){const E=b.subs;E.nextSub!==void 0&&c(E),x=!0}}else if((S&33)===33){(f.nextSub!==void 0||f.prevSub!==void 0)&&(p={value:f,prev:p}),f=b.deps,h=b,++y;continue}if(!x){const E=f.nextDep;if(E!==void 0){f=E;continue}}for(;y--;){const E=h.subs,C=E.nextSub!==void 0;if(C?(f=p.value,p=p.prev):f=E,x){if(e(h)){C&&c(E),h=f.sub;continue}x=!1}else h.flags&=-33;h=f.sub;const R=f.nextDep;if(R!==void 0){f=R;continue e}}return x}while(!0)}function c(f){do{const h=f.sub,p=h.flags;(p&48)===32&&(h.flags=p|16,(p&6)===2&&t(h))}while((f=f.nextSub)!==void 0)}function u(f,h){let p=h.depsTail;for(;p!==void 0;){if(p===f)return!0;p=p.prevDep}return!1}}function TG(e,t,n){var o,l,c;const r=typeof e=="object",s=r?e:void 0;return{next:(o=r?e.next:e)==null?void 0:o.bind(s),error:(l=r?e.error:t)==null?void 0:l.bind(s),complete:(c=r?e.complete:n)==null?void 0:c.bind(s)}}const tE=[];let hy=0;const{link:E_,unlink:NG,propagate:RG,checkDirty:d4,shallowPropagate:C_}=CG({update(e){return e._update()},notify(e){tE[nE++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,jy(e))}});let S0=0,nE=0,Xo,rE=0;function OG(e){try{++rE,e()}finally{--rE||f4()}}function jy(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=NG(n,e)}function f4(){if(!(rE>0)){for(;S0<nE;){const e=tE[S0];tE[S0++]=void 0,e.notify()}S0=0,nE=0}}function T_(e,t){const n=typeof e=="function",r=e,s={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?0:1,get(){return Xo!==void 0&&E_(s,Xo,hy),s._snapshot},subscribe(o){const l=TG(o),c={current:!1},u=AG(()=>{var f;s.get(),c.current?(f=l.next)==null||f.call(l,s._snapshot):c.current=!0});return{unsubscribe:()=>{u.stop()}}},_update(o){const l=Xo,c=(t==null?void 0:t.compare)??Object.is;if(n)Xo=s,++hy,s.depsTail=void 0;else if(o===void 0)return!1;n&&(s.flags=5);try{const u=s._snapshot,f=typeof o=="function"?o(u):o===void 0&&n?r(u):o;return u===void 0||!c(u,f)?(s._snapshot=f,!0):!1}finally{Xo=l,n&&(s.flags&=-5),jy(s)}}};return n?(s.flags=17,s.get=function(){const o=s.flags;if(o&16||o&32&&d4(s.deps,s)){if(s._update()){const l=s.subs;l!==void 0&&C_(l)}}else o&32&&(s.flags=o&-33);return Xo!==void 0&&E_(s,Xo,hy),s._snapshot}):s.set=function(o){if(s._update(o)){const l=s.subs;l!==void 0&&(RG(l),C_(l),f4())}},s}function AG(e){const t=()=>{const r=Xo;Xo=n,++hy,n.depsTail=void 0,n.flags=6;try{return e()}finally{Xo=r,n.flags&=-5,jy(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){const r=this.flags;r&16||r&32&&d4(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,jy(this)}};return t(),n}var w1={exports:{}},E1={},C1={exports:{}},T1={};/**
|
|
52
|
-
* @license React
|
|
53
|
-
* use-sync-external-store-shim.production.js
|
|
54
|
-
*
|
|
55
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
56
|
-
*
|
|
57
|
-
* This source code is licensed under the MIT license found in the
|
|
58
|
-
* LICENSE file in the root directory of this source tree.
|
|
59
|
-
*/var N_;function kG(){if(N_)return T1;N_=1;var e=im();function t(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function c(p,y){var x=y(),b=r({inst:{value:x,getSnapshot:y}}),S=b[0].inst,E=b[1];return o(function(){S.value=x,S.getSnapshot=y,u(S)&&E({inst:S})},[p,x,y]),s(function(){return u(S)&&E({inst:S}),p(function(){u(S)&&E({inst:S})})},[p]),l(x),x}function u(p){var y=p.getSnapshot;p=p.value;try{var x=y();return!n(p,x)}catch{return!0}}function f(p,y){return y()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return T1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,T1}var R_;function h4(){return R_||(R_=1,C1.exports=kG()),C1.exports}/**
|
|
60
|
-
* @license React
|
|
61
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
62
|
-
*
|
|
63
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
64
|
-
*
|
|
65
|
-
* This source code is licensed under the MIT license found in the
|
|
66
|
-
* LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/var O_;function _G(){if(O_)return E1;O_=1;var e=im(),t=h4();function n(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,o=e.useRef,l=e.useEffect,c=e.useMemo,u=e.useDebugValue;return E1.useSyncExternalStoreWithSelector=function(f,h,p,y,x){var b=o(null);if(b.current===null){var S={hasValue:!1,value:null};b.current=S}else S=b.current;b=c(function(){function C(M){if(!R){if(R=!0,T=M,M=y(M),x!==void 0&&S.hasValue){var A=S.value;if(x(A,M))return O=A}return O=M}if(A=O,r(T,M))return A;var L=y(M);return x!==void 0&&x(A,L)?(T=M,A):(T=M,O=L)}var R=!1,T,O,k=p===void 0?null:p;return[function(){return C(h())},k===null?void 0:function(){return C(k())}]},[h,p,y,x]);var E=s(f,b[0],b[1]);return l(function(){S.hasValue=!0,S.value=E},[E]),u(E),E},E1}var A_;function MG(){return A_||(A_=1,w1.exports=_G()),w1.exports}var y2=MG();const IG=e2(y2);function LG(e,t){return e===t}function il(e,t=r=>r,n){const r=(n==null?void 0:n.compare)??LG,s=N.useCallback(l=>{const{unsubscribe:c}=e.subscribe(l);return c},[e]),o=N.useCallback(()=>e.get(),[e]);return y2.useSyncExternalStoreWithSelector(s,o,o,t,r)}var k_={};function p4(e,t){const n=N.useRef();return r=>{const s=e!=null&&e.select?e.select(r):r;return(e==null?void 0:e.structuralSharing)??t.options.defaultStructuralSharing?n.current=Ta(n.current,s):s}}function bu(e){const t=qs(),n=N.useContext(e.from?EG:jx),r=e.from??n,s=t.stores.getMatchStore(r),o=p4(e,t),l=il(s,c=>c?o(c):k_);if(l!==k_)return l;(e.shouldThrow??!0)&&a2()}function m4(e){return bu({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function g4(e){const{select:t,...n}=e;return bu({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function y4(e){return bu({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function x4(e){return bu({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function lm(e){const t=qs();return N.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function xke(e){const t=qs(),n=lm(),r=N.useRef(null);return i2(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function b4(e){return bu({...e,select:t=>e.select?e.select(t.context):t.context})}function DG(...e){const t=N.useRef(e),n=t.current;return e.forEach((r,s)=>{Xi(n[s],r,!1,!0)||(n[s]=r)}),t.current}function w0(e,t){e.preloadRoute(t).catch(n=>{console.warn(n),console.warn(gG)})}var jG={compare:(e,t)=>e[0]===t[0]&&e[1]===t[1]};function PG(e,t){const n=typeof e=="string"&&yp(e);if(n)return t.has(n)?e:null}function zG(e,t,n,r,s){const o=o_(e.pathname,r),l=o_(t.pathname,r);return(n!=null&&n.exact?o!==l:!(o.startsWith(l)&&(o.length===l.length||o[l.length]==="/")))||((n==null?void 0:n.includeSearch)??!0)&&!Xi(e.search,t.search,!(n!=null&&n.exact),n==null?void 0:n.explicitUndefined)?!1:n!=null&&n.includeHash?s&&e.hash===t.hash:!0}function BG(e,t,n){const r=qs(),s=N.useRef(null),o=N.useCallback(ne=>{if(s.current=ne,typeof t=="function")return t(ne);t&&(t.current=ne)},[t]),{activeOptions:l,to:c,preload:u,preloadDelay:f,hashScrollIntoView:h,replace:p,startTransition:y,resetScroll:x,viewTransition:b,ignoreBlocker:S,disabled:E,target:C,onClick:R,onBlur:T,onFocus:O,onMouseEnter:k,onMouseLeave:M,onTouchStart:A}=e,L=c4(),[I,j,P]=DG(e.search,e.params,l),[B,H]=N.useMemo(()=>[e,{...e}],[r,e.from,e._fromLocation,e.hash,e.to,I,j,e.state,e.mask,e.unsafeRelative]),D=N.useCallback(ne=>{const W=PG(c,r.protocolAllowlist);if(W!==void 0)return[W??void 0];B._fromLocation||(H._fromLocation=ne);const ce=r.buildLocation(H),ye=VG(ce,r,E);return[ye,!E&&(!ye||yp(ye))?void 0:zG(ne,ce,P,r.basepath,L)]},[P,E,L,B,H,r,c]),[F,z]=il(r.stores.location,D,jG),q=z===void 0?F:void 0,V=E||F===void 0,G=N.useRef(!1),K=e.reloadDocument||q||V?!1:u??r.options.defaultPreload,X=f??r.options.defaultPreloadDelay??0,ee=N.useCallback(ne=>{const W=ne==null?void 0:ne.isIntersecting;if(!(W??K==="intent")){W===!1&&N1(s);return}if(!X){w0(r,B);return}sp.has(s)||sp.set(s,setTimeout(()=>{sp.delete(s),w0(r,B)},X))},[r,B,s,K,X]);N.useEffect(()=>{K==="render"&&!G.current&&(G.current=!0,w0(r,B));let ne;return K==="viewport"&&s.current&&typeof IntersectionObserver=="function"&&(ne=new IntersectionObserver(W=>ee(W.pop()),{rootMargin:"100px"}),ne.observe(s.current)),()=>{ne==null||ne.disconnect(),N1(s)}},[r,B,K,ee,s]);const ae=$G(e,n);if(ae.ref=t?o:s,q)return ae.href=q,ae;const $=ne=>{const W=C??ne.currentTarget.getAttribute("target");!V&&!(ne.metaKey||ne.altKey||ne.ctrlKey||ne.shiftKey)&&!ne.defaultPrevented&&(!W||W==="_self")&&ne.button===0&&(ne.preventDefault(),r.navigate({...B,replace:p,resetScroll:x,hashScrollIntoView:h,startTransition:y,viewTransition:b,ignoreBlocker:S}))},Y=()=>{K==="intent"&&w0(r,B)},J=()=>{K==="intent"&&N1(s)};return ae.onClick=pd(R,$),ae.onBlur=pd(T,J),ae.onFocus=pd(O,ee),ae.onMouseEnter=pd(k,ee),ae.onMouseLeave=pd(M,J),ae.onTouchStart=pd(A,Y),UG(ae,e,z,F,V,n)}var HG={},FG={className:"active"},v4=new Set(["to","params","search","hash","state","mask","from","unsafeRelative","_fromLocation","reloadDocument","preload","preloadDelay","preloadIntentProximity","hashScrollIntoView","replace","startTransition","resetScroll","viewTransition","ignoreBlocker","activeProps","inactiveProps","activeOptions","_asChild"]);function $G(e,t){const n={};for(const r in e)v4.has(r)||r==="type"&&t!==void 0||r==="disabled"&&t==="a"||(n[r]=e[r]);return n}function UG(e,t,n,r,s,o){const{activeProps:l,inactiveProps:c,className:u,style:f,target:h}=t,p=$P(n?l:c,{})??(n?FG:HG);Object.assign(e,p),e.href=r,o!=="a"&&(e.disabled=s),e.target=h;const y=p.style;(f||y)&&(e.style=f&&y?{...f,...y}:f||y);const x=p.className;return(u||x)&&(e.className=u?x?`${u} ${x}`:u:x),s&&(e.role="link",e["aria-disabled"]=!0),n&&(e["data-status"]="active",e["aria-current"]="page"),e}var sp=new WeakMap,N1=e=>{clearTimeout(sp.get(e)),sp.delete(e)},pd=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function VG(e,t,n){if(n)return;const r=e.maskedLocation??e,s=r.external?r.publicHref:t.history.createHref(r.publicHref)||"/";if(!((r.external||s!==r.publicHref)&&qP(s,t.protocolAllowlist)))return s}var ri=N.memo(N.forwardRef((e,t)=>{const n=e._asChild||"a",r=BG(e,t,n),s=typeof e.children=="function"?e.children({isActive:r["data-status"]==="active"}):e.children;return N.createElement(n,r,s)}),qG);function qG(e,t){let n=0;for(const r in t)if(n++,e[r]!==t[r]&&(!v4.has(r)||!Xi(e[r],t[r],!1,!0)))return!1;for(const r in e)n--;return n===0}var GG=class extends a4{constructor(t){super(t),this.useMatch=n=>bu({...n,from:this.id}),this.useRouteContext=n=>b4({...n,from:this.id}),this.useSearch=n=>x4({...n,from:this.id}),this.useParams=n=>y4({...n,from:this.id}),this.useLoaderDeps=n=>g4({...n,from:this.id}),this.useLoaderData=n=>m4({...n,from:this.id}),this.useNavigate=()=>lm({from:this.fullPath}),this.Link=si.forwardRef((n,r)=>g.jsx(ri,{ref:r,from:this.fullPath,...n}))}};function KG(e){return new GG(e)}function YG(){return e=>XG(e)}var WG=class extends yG{constructor(e){super(e),this.useMatch=t=>bu({...t,from:this.id}),this.useRouteContext=t=>b4({...t,from:this.id}),this.useSearch=t=>x4({...t,from:this.id}),this.useParams=t=>y4({...t,from:this.id}),this.useLoaderDeps=t=>g4({...t,from:this.id}),this.useLoaderData=t=>m4({...t,from:this.id}),this.useNavigate=()=>lm({from:this.fullPath}),this.Link=si.forwardRef((t,n)=>g.jsx(ri,{ref:n,from:this.fullPath,...t}))}};function XG(e){return new WG(e)}function Ss(e){return t=>{const n=KG(t);return n.isRoot=!1,n}}function mn(e,t){let n,r,s;const o=()=>(n||(s=void 0,n=e().then(c=>{n=void 0,l.preload=void 0,r=c[t??"default"]}).catch(c=>{n=void 0,s=c})),n),l=function(u){if(s){if(gq(s)&&typeof sessionStorage<"u"){const f=`tanstack_router_reload:${s.message}`;if(!sessionStorage.getItem(f))throw sessionStorage.setItem(f,"1"),window.location.reload(),new Promise(()=>{})}throw s}if(!r)if(r_)r_(o());else throw o();return N.createElement(r,u)};return l.preload=o,l}function QG(e){const t=qs(),n=`not-found-${il(t.stores.location,r=>r.pathname)}-${il(t.stores.status)}`;return g.jsx(g2,{getResetKey:()=>n,onCatch:(r,s)=>{var o;if(sf(r))(o=e.onCatch)==null||o.call(e,r,s);else throw r},errorComponent:({error:r})=>{var s;if(sf(r))return(s=e.fallback)==null?void 0:s.call(e,r);throw r},children:e.children})}function ZG(){return g.jsx("p",{children:"Not Found"})}function Sd(e){return g.jsx(g.Fragment,{children:e.children})}function S4(e,t,n){return t.options.notFoundComponent?g.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?g.jsx(e.options.defaultNotFoundComponent,{...n}):g.jsx(ZG,{})}function Px(e,t){const n=(t==null?void 0:t.options.pendingComponent)??e.options.defaultPendingComponent;return n?g.jsx(n,{}):null}var JG=(e,t)=>e[0]===t[0]&&e[1]===t[1],w4=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n==="data-only"||!e.ssr,E4=N.memo(function({routeId:t}){const n=qs();return g.jsx(eK,{router:n,match:il(n.stores.getMatchStore(t))})});function eK({router:e,match:t}){var p,y;const n=e.routesById[t.routeId],r=Px(e,n),s=n.options.errorComponent??e.options.defaultErrorComponent,o=n.options.onCatch??e.options.defaultOnCatch,l=n.isRoot?n.options.notFoundComponent??((p=e.options.notFoundRoute)==null?void 0:p.options.component):n.options.notFoundComponent,c=t.ssr===!1||t.ssr==="data-only",u=w4(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(((y=n.options.errorComponent)==null?void 0:y.preload)||c))?N.Suspense:Sd,f=s?g2:Sd,h=l?QG:Sd;return g.jsxs(n.isRoot?n.options.shellComponent??Sd:Sd,{children:[g.jsx(jx.Provider,{value:t.routeId,children:g.jsx(u,{fallback:r,children:g.jsx(f,{getResetKey:()=>t,errorComponent:s,onCatch:(x,b)=>{if(sf(x))throw x.routeId??(x.routeId=t.routeId),x;o==null||o(x,b)},children:g.jsx(h,{fallback:x=>{if(x.routeId??(x.routeId=t.routeId),x.routeId!==t.routeId)throw x;return N.createElement(l,x)},children:c?g.jsx(SG,{fallback:r,children:g.jsx(__,{match:t})}):g.jsx(__,{match:t})})})})}),null]})}var __=N.memo(function({match:t}){const n=qs(),r=t.routeId,s=n.routesById[r],o=N.useMemo(()=>{var u;const c=(u=s.options.remountDeps??n.options.defaultRemountDeps)==null?void 0:u({routeId:r,loaderDeps:t.loaderDeps,params:t._strictParams,search:t._strictSearch});return c?JSON.stringify(c):void 0},[r,t.loaderDeps,t._strictParams,t._strictSearch,s.options.remountDeps,n.options.defaultRemountDeps]),l=N.useMemo(()=>{const c=s.options.component??n.options.defaultComponent;return c?g.jsx(c,{},o):g.jsx(C4,{})},[o,s.options.component,n.options.defaultComponent]);if(t.status==="pending"){if(n.ssr&&!w4(n,s,t.ssr))return l;if(n._tx)throw n._tx[5];return Px(n,s)}if(t.status==="notFound")return S4(n,s,t.error);if(t.status==="error")throw t.error;return l}),C4=N.memo(function(){const t=qs(),n=N.useContext(jx);let r,s,o;{const c=t.stores.getMatchStore(n);[r,s]=il(c,u=>[!!u._notFound,u.error],{compare:JG}),o=il(t.stores.ids,u=>u[u.indexOf(n)+1])}if(r)return S4(t,t.routesById[n],s);if(!o)return null;const l=g.jsx(E4,{routeId:o});return n===Md?g.jsx(N.Suspense,{fallback:Px(t),children:l}):l});function T4(e,t){const n=e[1];e.length=0,n==null||n(t)}function tK({t:e}){const t=qs(),n=t._rendered??(t._rendered=[]);return t.startTransition=(r,s)=>new Promise(o=>{T4(n,!1),n.push(s,o),e(t),N.startTransition(r)}),i2(()=>{const r=t.history.subscribe(t.load);t.updateLatestLocation();const s=t.latestLocation,o=t.buildLocation({to:s.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(ni(s.publicHref)!==ni(o.publicHref))return t.commitLocation({...o,replace:!0,ignoreBlocker:!0}),r;const l=t.stores.resolvedLocation.get();return(l==null?void 0:l.href)===s.href&&l.state.__TSR_key===s.state.__TSR_key?n.push(t.stores.matches.get(),c=>{c&&t.emit({type:"onRendered",...Lx(l,l)})}):t._tx||t.load({sync:!0}).catch(console.error),r},[t,t.history]),null}function nK(){const e=qs(),t=e.routesById[Md],n=Px(e,t),r=e.ssr?Sd:N.Suspense,s=g.jsxs(g.Fragment,{children:[g.jsx(tK,{t:N.useState()[1]}),g.jsx(r,{fallback:n,children:g.jsx(rK,{})})]});return e.options.InnerWrap?g.jsx(e.options.InnerWrap,{children:s}):s}function rK(){const e=qs(),t=e._rendered,n=il(e.stores.matches,l=>t[0]??l),r=n[0],s=r==null?void 0:r.routeId;i2(()=>{t[0]===n&&T4(t,!0)},[t,n]);const o=s?g.jsx(E4,{routeId:s}):null;return g.jsx(jx.Provider,{value:s,children:e.options.disableGlobalCatchBoundary?o:g.jsx(g2,{getResetKey:()=>r,onCatch:void 0,children:o})})}function R1(e){const t=qs();return il(t.stores.matches,p4(e,t))}var sK=e=>({createMutableStore:T_,createReadonlyStore:T_,batch:OG}),oK=e=>new iK(e),iK=class extends tG{constructor(e){super(e,sK)}};function lK({router:e,children:t,...n}){UP(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=g.jsx(u4.Provider,{value:e,children:t});return e.options.Wrap?g.jsx(e.options.Wrap,{children:r}):r}function aK({router:e,...t}){return g.jsx(lK,{router:e,...t,children:g.jsx(nK,{})})}const N4=N.createContext(null),R4="flightplan.color-theme",O4="(prefers-color-scheme: dark)",cK=e=>e==="light"||e==="dark",uK=()=>{try{const e=localStorage.getItem(R4);return cK(e)?e:null}catch{return null}},dK=e=>{try{return localStorage.setItem(R4,e),!0}catch{return!1}},fK=e=>{document.documentElement.setAttribute("data-theme",e)},hK=e=>e==="dark"?"light":"dark",pK=e=>{const t=window.matchMedia(O4);return t.addEventListener("change",e),()=>{t.removeEventListener("change",e)}},mK=()=>window.matchMedia(O4).matches?"dark":"light",sE=()=>{const[e,t]=N.useState(uK),n=N.useSyncExternalStore(pK,mK),r=e??n;return{theme:r,onToggle:()=>{const s=hK(r);dK(s),fK(s),t(s)}}},M_=160,A4=({src:e})=>g.jsx("img",{src:e,alt:"",width:M_,height:M_,className:"size-40"});function zx(){return typeof window<"u"}function Rr(e){return x2(e)?(e.nodeName||"").toLowerCase():"#document"}function pn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dl(e){var t;return(t=(x2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function x2(e){return zx()?e instanceof Node||e instanceof pn(e).Node:!1}function St(e){return zx()?e instanceof Element||e instanceof pn(e).Element:!1}function Yt(e){return zx()?e instanceof HTMLElement||e instanceof pn(e).HTMLElement:!1}function of(e){return!zx()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pn(e).ShadowRoot}function am(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=$s(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&s!=="inline"&&s!=="contents"}function gK(e){return/^(table|td|th)$/.test(Rr(e))}function Bx(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const yK=/transform|translate|scale|rotate|perspective|filter/,xK=/paint|layout|strict|content/,Nc=e=>!!e&&e!=="none";let O1;function b2(e){const t=St(e)?$s(e):e;return Nc(t.transform)||Nc(t.translate)||Nc(t.scale)||Nc(t.rotate)||Nc(t.perspective)||!v2()&&(Nc(t.backdropFilter)||Nc(t.filter))||yK.test(t.willChange||"")||xK.test(t.contain||"")}function bK(e){let t=ll(e);for(;Yt(t)&&!Zi(t);){if(b2(t))return t;if(Bx(t))return null;t=ll(t)}return null}function v2(){return O1==null&&(O1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),O1}function Zi(e){return/^(html|body|#document)$/.test(Rr(e))}function $s(e){return pn(e).getComputedStyle(e)}function Hx(e){return St(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ll(e){if(Rr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||of(e)&&e.host||dl(e);return of(t)?t.host:t}function k4(e){const t=ll(e);return Zi(t)?(e.ownerDocument||e).body:Yt(t)&&am(t)?t:k4(t)}function wp(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=k4(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),l=pn(s);if(o){const c=oE(l);return t.concat(l,l.visualViewport||[],am(s)?s:[],c&&n?wp(c):[])}else return t.concat(s,wp(s,[],n))}function oE(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const S2={...TV},I_={};function Or(e,t){const n=N.useRef(I_);return n.current===I_&&(n.current=e(t)),n}const A1=S2.useInsertionEffect,vK=A1&&A1!==S2.useLayoutEffect?A1:e=>e();function Ve(e){const t=Or(SK).current;return t.next=e,vK(t.effect),t.trampoline}function SK(){const e={next:void 0,callback:wK,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function wK(){}const EK=()=>{},Be=typeof document<"u"?N.useLayoutEffect:EK;function iE(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const w2={};function Ji(e,t,n,r,s){if(!n&&!r&&!s&&!e)return Py(t);let o=Py(e);return t&&(o=Gh(o,t)),n&&(o=Gh(o,n)),r&&(o=Gh(o,r)),s&&(o=Gh(o,s)),o}function CK(e){if(e.length===0)return w2;if(e.length===1)return Py(e[0]);let t=Py(e[0]);for(let n=1;n<e.length;n+=1)t=Gh(t,e[n]);return t}function Py(e){return E2(e)?{...M4(e,w2)}:TK(e)}function Gh(e,t){return E2(t)?M4(t,e):NK(e,t)}function TK(e){const t={...e};for(const n in t){const r=t[n];_4(n,r)&&(t[n]=I4(r))}return t}function NK(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=iE(e.style,r);break}case"className":{e[n]=L4(e.className,r);break}default:_4(n,r)?e[n]=RK(e[n],r):e[n]=r}}return e}function _4(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&r===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function E2(e){return typeof e=="function"}function M4(e,t){return E2(e)?e(t):e??w2}function RK(e,t){return t?e?(...n)=>{const r=n[0];if(D4(r)){const o=r;zy(o);const l=t(...n);return o.baseUIHandlerPrevented||e==null||e(...n),l}const s=t(...n);return e==null||e(...n),s}:I4(t):e}function I4(e){return e&&((...t)=>{const n=t[0];return D4(n)&&zy(n),e(...t)})}function zy(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function L4(e,t){return t?e?t+" "+e:t:e}function D4(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function OK(e,t){return function(r,...s){const o=new URL(e);return o.searchParams.set("code",r.toString()),s.forEach(l=>o.searchParams.append("args[]",l)),`${t} error #${r}; visit ${o} for the full message.`}}const Qt=OK("https://base-ui.com/production-error","Base UI"),j4=N.createContext(void 0);function C2(e=!1){const t=N.useContext(j4);if(t===void 0&&!e)throw new Error(Qt(16));return t}function AK(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:s=0,isNativeButton:o}=e,l=r&&t!==!1,c=r&&t===!1;return{props:N.useMemo(()=>{const f={onKeyDown(h){n&&t&&h.key!=="Tab"&&h.preventDefault()}};return r||(f.tabIndex=s,!o&&n&&(f.tabIndex=t?s:-1)),(o&&(t||l)||!o&&n)&&(f["aria-disabled"]=n),o&&(!t||c)&&(f.disabled=n),f},[r,n,t,l,c,o,s])}}function jt(e){return(e==null?void 0:e.ownerDocument)||document}function py(e,t,{detail:n=0}={}){e.dispatchEvent(new(pn(e)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function vu(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:s=!0,composite:o}=e,l=N.useRef(null),c=C2(!0),u=o??c!==void 0,{props:f}=AK({focusableWhenDisabled:n,disabled:t,composite:u,tabIndex:r,isNativeButton:s}),h=N.useCallback(()=>{const x=l.current;k1(x)&&u&&t&&f.disabled===void 0&&x.disabled&&(x.disabled=!1)},[t,f.disabled,u]);Be(h,[h]);const p=N.useCallback((x={})=>{const{onClick:b,onMouseDown:S,onKeyUp:E,onKeyDown:C,onPointerDown:R,...T}=x;return Ji({onClick(O){if(t){O.preventDefault();return}b==null||b(O)},onMouseDown(O){t||S==null||S(O)},onKeyDown(O){if(t||(zy(O),C==null||C(O),O.baseUIHandlerPrevented))return;const k=O.target===O.currentTarget,M=O.currentTarget,A=k1(M),L=!s&&kK(M),I=k&&(s?A:!L),j=O.key==="Enter",P=O.key===" ",B=M.getAttribute("role"),H=(B==null?void 0:B.startsWith("menuitem"))||B==="option"||B==="gridcell";if(k&&u&&P){if(O.defaultPrevented&&H)return;O.preventDefault(),(!s||A)&&(O.preventBaseUIHandler(),py(M,O));return}if(!I||s||!P&&!j){k&&L&&P&&O.preventDefault();return}O.defaultPrevented||(O.preventDefault(),j&&(O.preventBaseUIHandler(),py(M,O)))},onKeyUp(O){if(!t){if(zy(O),E==null||E(O),O.target===O.currentTarget&&s&&u&&k1(O.currentTarget)&&O.key===" "){O.preventDefault();return}O.baseUIHandlerPrevented||O.target===O.currentTarget&&!s&&!u&&!O.defaultPrevented&&O.key===" "&&(O.preventBaseUIHandler(),py(O.currentTarget,O))}},onPointerDown(O){if(t){O.preventDefault();return}R==null||R(O)}},s?{type:"button"}:{role:"button"},f,T)},[t,f,u,s]),y=Ve(x=>{l.current=x,h()});return{getButtonProps:p,buttonRef:y}}function k1(e){return Yt(e)&&e.tagName==="BUTTON"}function kK(e){return Yt(e)&&e.tagName==="A"&&!!e.href}function za(e,t,n,r){const s=Or(P4).current;return MK(s,e,t,n,r)&&z4(s,[e,t,n,r]),s.callback}function _K(e){const t=Or(P4).current;return IK(t,e)&&z4(t,e),t.callback}function P4(){return{callback:null,cleanup:null,refs:[]}}function MK(e,t,n,r,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==s}function IK(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function z4(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const l=o(n);typeof l=="function"&&(r[s]=l);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const o=t[s];if(o!=null)switch(typeof o){case"function":{const l=r[s];typeof l=="function"?l():o(null);break}case"object":{o.current=null;break}}}}}}}const LK=parseInt(N.version,10);function T2(e){return LK>=e}function L_(e){if(!N.isValidElement(e))return null;const t=e,n=t.props;return(T2(19)?n==null?void 0:n.ref:t.ref)??null}function Fn(){}const Ba=Object.freeze([]),hn=Object.freeze({});function DK(e,t){const n={};for(const r in e){const s=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](s);o!=null&&Object.assign(n,o);continue}s===!0?n[`data-${r.toLowerCase()}`]="":s&&(n[`data-${r.toLowerCase()}`]=s.toString())}return n}function jK(e,t){return typeof e=="function"?e(t):e}function B4(e,t){return typeof e=="function"?e(t):e}function It(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=HK(r));const s=PK(t,n,r);if(n.enabled===!1)return null;const o=n.state??hn;return FK(e,r,s,o)}function PK(e,t,n){const{className:r,style:s}=e,{state:o=hn,ref:l,props:c,stateAttributesMapping:u,enabled:f=!0}=t,h=f?jK(r,o):void 0,p=f?B4(s,o):void 0,y=f?DK(o,u):hn,x=f&&c?zK(c):void 0,b=f?iE(y,x)??{}:hn;return typeof document<"u"&&(f?Array.isArray(l)?b.ref=_K([b.ref,L_(n),...l]):b.ref=za(b.ref,L_(n),l):za(null,null)),f?(h!==void 0&&(b.className=L4(b.className,h)),p!==void 0&&(b.style=iE(b.style,p)),b):hn}function zK(e){return Array.isArray(e)?CK(e):Ji(void 0,e)}const BK=Symbol.for("react.lazy");function HK(e){if((e==null?void 0:e.$$typeof)!==BK)return e;const t=N.Children.toArray(e)[0];return N.isValidElement(t)?t:e}function FK(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const s=Ji(n,t.props);return s.ref=n.ref,N.cloneElement(t,s)}if(e&&typeof e=="string")return $K(e,n);throw new Error(Qt(8))}function $K(e,t){return e==="button"?N.createElement("button",{type:"button",...t,key:t.key}):e==="img"?N.createElement("img",{alt:"",...t,key:t.key}):N.createElement(e,t)}const UK=N.forwardRef(function(t,n){const{render:r,className:s,disabled:o=!1,focusableWhenDisabled:l=!1,nativeButton:c=!0,style:u,...f}=t,{getButtonProps:h,buttonRef:p}=vu({disabled:o,focusableWhenDisabled:l,native:c});return It("button",t,{state:{disabled:o},ref:[n,p],props:[f,h]})});function H4(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=H4(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function VK(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=H4(e))&&(r&&(r+=" "),r+=t);return r}const D_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,j_=VK,qK=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return j_(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,l=Object.keys(s).map(f=>{const h=n==null?void 0:n[f],p=o==null?void 0:o[f];if(h===null)return null;const y=D_(h)||D_(p);return s[f][y]}),c=n&&Object.entries(n).reduce((f,h)=>{let[p,y]=h;return y===void 0||(f[p]=y),f},{}),u=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((f,h)=>{let{class:p,className:y,...x}=h;return Object.entries(x).every(b=>{let[S,E]=b;return Array.isArray(E)?E.includes({...o,...c}[S]):{...o,...c}[S]===E})?[...f,p,y]:f},[]);return j_(e,l,u,n==null?void 0:n.class,n==null?void 0:n.className)},F4=48,fi=(e,t=0)=>{const n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-F4-t;return n},Fx=e=>{const t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},Ha=e=>{const t=new Int32Array(e.length);let n=0;for(let r=0;r<e.length;r++){const s=e.charCodeAt(r)-F4;n+=s>>>1^-(s&1),t[r]=n}return t},GK=384,KK=[],Ac=Fx(fi("E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010")),YK=Fx(fi(":11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3")),WK="@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom",XK=(()=>{const e=Ac.length-1,t=new Int32Array(e);for(let s=e-1;s>=0;s--){let o=1,l=s+1;for(let c=Ac[s];c<Ac[s+1];c++)o+=t[l],l+=t[l];t[s]=o}const n=new Int32Array(Ac[e]);let r=0;for(let s=0;s<e;s++){let o=s+1;for(let l=Ac[s];l<Ac[s+1];l++)n[r++]=o,o+=t[o]}return n})(),QK=fi("02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000
ŏ0000000ŏ00000000000000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000",1),ZK=Fx(fi("123333359346463635126536711576")),JK=fi("93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032"),eY=fi("012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199"),tY=Ha("020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200"),nY=(()=>{const e=new Int32Array(319).fill(-1),t=Ha("02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222"),n=Ha("02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222");for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),rY="container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform".split("|").map(e=>{const t=e.split(" "),n=t.shift();for(let r=0;r<t.length;r++)t[r]=n+t[r];return t}),P_=Ha("0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422"),sY=Ha("ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622"),oY=Ha("02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~22
:22|22222222222G000qOVI00000}2>40000B00000I¨©000¬00000000000000021M®00°000000000000000000000222HGHa1º222¿2À2222ÉÌ000°2±"),$4=new Int32Array(995),U4=new Int32Array(995),V4=new Int32Array(995);let lE="";const aE=new Int32Array(1038);{const e=new Map;let t=0,n=0;for(let r=0;r<P_.length;r++)for(const s of rY[oY[r]]){let o=e.get(s);o===void 0&&(o=t++,e.set(s,o),aE[o*2]=lE.length,aE[o*2+1]=s.length,lE+=s),$4[n]=P_[r],U4[n]=sY[r],V4[n]=o,n++}}const iY=Ha("0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p"),lY=Fx(fi("1::24444432:442:44:44>222222:44:4421322511111311111114")),aY=Ha("24A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅŇ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=ƧNž2Đå242L222290000f22500ɛ000ǘ222"),cY=fi("ij"),uY=fi(""),dY=fi("1"),fY="* ** after backdrop before details-content file first-letter first-line marker placeholder selection";var hY={GROUP_COUNT:GK,customValidatorNames:KK,edgeStart:Ac,labelStart:YK,labelText:WK,edgeTarget:XK,nodeGroup:QK,nodeVlist:nY,vlistPat:ZK,vlistOps:JK,vlistRef:eY,vlistGroup:tY,litAnchor:$4,litGroup:U4,litPool:V4,poolOffsets:aE,poolText:lE,adjGid:iY,adjStart:lY,adjTgt:aY,patGid:cY,patTgt:uY,postfixLookupGroups:dY,orderSensitiveModifiers:fY};const pY="line"in new Error,Ko=-1,Rc=-1,_1=(e,t,n)=>{let r=2166136261;for(let s=t;s<n;s++)r=Math.imul(r^e.charCodeAt(s),16777619);return r},my=(e,t,n)=>{const r=n-t;let s=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){const o=r>>2,l=r>>1;s=Math.imul(s^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+o),2246822507),s=Math.imul(s^e.charCodeAt(t+l)<<8^e.charCodeAt(t+l+o)<<16^e.charCodeAt(n-3),3266489909),s^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let c=t+3,u=n-4;c<t+8&&c<u;c++,u--)s=Math.imul(s^e.charCodeAt(c)^e.charCodeAt(u)<<8,16777619)}return s^s>>>15|0},mY=(e,t,n={})=>{const{GROUP_COUNT:r,edgeStart:s,labelStart:o,labelText:l,edgeTarget:c,nodeGroup:u,nodeVlist:f,vlistPat:h,vlistOps:p,vlistRef:y,vlistGroup:x,litAnchor:b,litGroup:S,litPool:E,poolOffsets:C,poolText:R,adjGid:T,adjStart:O,adjTgt:k,patGid:M,patTgt:A,postfixLookupGroups:L,customValidatorNames:I,orderSensitiveModifiers:j}=e,P=new Int32Array(r).fill(-1);for(let me=0;me<T.length;me++)P[T[me]]=me;let B=0;for(let me=0;me+1<O.length;me++){const Te=O[me+1]-O[me];Te>B&&(B=Te)}let H=32;for(;H<2*(1+B+M.length);)H<<=1;const D=new Int32Array(y.length+1);for(let me=0;me<y.length;me++)D[me+1]=D[me]+h[y[me]+1]-h[y[me]];const F=new Uint8Array(r);for(let me=0;me<L.length;me++)F[L[me]]=1;const z=s.length-1,q=new Uint8Array(z);let V=0,G=!0;for(let me=0;me<b.length;me++){q[b[me]]=1;const Te=C[E[me]*2+1];Te>V&&(V=Te);const Oe=R.charCodeAt(C[E[me]*2]);(Oe===91||Oe===40)&&(G=!1)}let K=1;for(;K<b.length*2;)K<<=1;const X=new Int32Array(K).fill(-1);for(let me=0;me<b.length;me++){const Te=C[E[me]*2];let Oe=(_1(R,Te,Te+C[E[me]*2+1])^Math.imul(b[me],2654435761)|0)&K-1;for(;X[Oe]!==-1;)Oe=Oe+1&K-1;X[Oe]=me}const ee=(me,Te,Oe,Ke)=>{let lt=(_1(Te,Oe,Ke)^Math.imul(me,2654435761)|0)&K-1;const it=Ke-Oe;for(;;){const ut=X[lt];if(ut===-1)return-1;if(b[ut]===me&&C[E[ut]*2+1]===it){const Ft=C[E[ut]*2];let Pt=!0;for(let Ze=0;Ze<it;Ze++)if(R.charCodeAt(Ft+Ze)!==Te.charCodeAt(Oe+Ze)){Pt=!1;break}if(Pt)return S[ut]}lt=lt+1&K-1}},ae=n.cacheSize??8192,$=n.prefix??e.prefix??"",Y=$===""?"":$+":",J=Y.length,ne=(I??[]).map(me=>{throw new Error("cn: missing validator "+me)}),W=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ce=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ye=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;let le=0,re=-1,he=-1,Se=-1,_e=-1;const be=me=>me>=97&&me<=122||me>=65&&me<=90||me>=48&&me<=57||me===95,Ae=me=>/\s/.test(String.fromCharCode(me)),Me=(me,Te,Oe)=>{if(le=0,re=-1,Oe-Te<3)return;const Ke=me.charCodeAt(Te),lt=me.charCodeAt(Oe-1);if(Ke===91&<===93)le=1;else if(Ke===40&<===41)le=2;else return;Se=Te+1,_e=Oe-1;let it=Te+1;if(be(me.charCodeAt(it))){for(it++;it<Oe-1;){const ut=me.charCodeAt(it);if(!be(ut)&&ut!==45)break;it++}it<Oe-2&&me.charCodeAt(it)===58&&(re=Te+1,he=it,Se=it+1)}},Le=(me,Te,Oe,Ke)=>{if(Oe-Te!==Ke.length)return!1;for(let lt=0;lt<Ke.length;lt++)if(me.charCodeAt(Te+lt)!==Ke.charCodeAt(lt))return!1;return!0},ue=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Re=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ze=me=>!!me&&!Number.isNaN(Number(me)),ke=(me,Te,Oe)=>{if(Oe-Te<11||!Le(me,Te,Te+10,"@container"))return!1;if(me.charCodeAt(Te+10)===47)return Oe-Te>=12;const Ke=me.charCodeAt(Te+11);return Ke===115&&Oe-Te>=17&&Le(me,Te+10,Te+16,"-size/")||Ke===110&&Oe-Te>=19&&Le(me,Te+10,Te+18,"-normal/")},je=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],Ne="length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight".split("|").map(me=>me.split(" ")),ve=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Fe=(me,Te,Oe,Ke)=>{if(me>=10){if(me>=25)return ne[me-25](Te.slice(Oe,Ke));const lt=me-10;if(le!==je[lt])return!1;if(re>=0){for(const it of Ne[lt])if(Le(Te,re,he,it))return!0;return!1}switch(ve[lt]){case 0:return!1;case 1:return!0;case 2:{const it=Te.slice(Se,_e);return W.test(it)&&!ce.test(it)}case 3:return ze(Te.slice(Se,_e));case 4:return pe.test(Te.slice(Se,_e));default:return ye.test(Te.slice(Se,_e))}}switch(me){case 0:return!0;case 1:return le===0;case 2:return le===1;case 3:return le===2;case 4:return ue.test(Te.slice(Oe,Ke));case 5:return ze(Te.slice(Oe,Ke));case 6:{const lt=Te.slice(Oe,Ke);return!!lt&&Number.isInteger(Number(lt))}case 7:return Ke>Oe&&Te.charCodeAt(Ke-1)===37&&ze(Te.slice(Oe,Ke-1));case 8:return Re.test(Te.slice(Oe,Ke));default:return ke(Te,Oe,Ke)}},Ye=new Set(typeof j=="string"?j.split(" "):j),xt=(me,Te,Oe,Ke,lt,it)=>{const ut=_1(Te,Oe,Ke)^(lt?2654435769:0)|0;let Ft=me.get(ut);if(Ft!==void 0)e:for(let ft=0;ft<Ft.length;ft++){const Lt=Ft[ft];if(!(Lt.imp!==lt||Lt.k.length!==Ke-Oe)){for(let rt=0;rt<Lt.k.length;rt++)if(Lt.k.charCodeAt(rt)!==Te.charCodeAt(Oe+rt))continue e;return Lt.id}}else me.set(ut,Ft=[]);const Pt=Te.slice(Oe,Ke),Ze=it(Pt);return Ft.push({k:Pt,imp:lt,id:Ze}),Ze};let nn=new Map,Ce=new Map,De=2;const tt=4096,Ot=(me,Te)=>{const Oe=[];let Ke=0,lt=0,it=0;for(let Ze=0;Ze<me.length;Ze++){const ft=me.charCodeAt(Ze);Ke===0&<===0&&ft===58?(Oe.push(me.slice(it,Ze)),it=Ze+1):ft===91?Ke++:ft===93?Ke--:ft===40?lt++:ft===41&<--}Oe.push(me.slice(it));let ut=Oe[0];if(Oe.length>1){const Ze=[];let ft=[];for(const Lt of Oe)Lt.charCodeAt(0)===91||Ye.has(Lt)?(ft.length&&(Ze.push(...ft.sort()),ft=[]),Ze.push(Lt)):ft.push(Lt);ft.length&&Ze.push(...ft.sort()),ut=Ze.join(":")}const Ft=Te?ut+" !":ut;let Pt=Ce.get(Ft);return Pt===void 0&&Ce.set(Ft,Pt=De++),Pt};let gn=new Map,yn=r;const Fr=r+4096,cn=()=>yn++,ar=2097152,$r=8192,Es=new Int32Array($r),qn=new Array($r).fill(null),yt=new Int32Array($r),un=new Int32Array($r),Gn=new Uint8Array($r);let Rn=0;const On=(me,Te,Oe,Ke,lt,it,ut,Ft)=>{let Pt=me;if(qn[me]!==null)if(qn[me|1]===null)Pt=me|1;else if((Rn++&3)===0)Pt=me|Rn>>2&1;else return;qn[Pt]=Te.slice(Oe,Ke),Es[Pt]=lt,yt[Pt]=it,un[Pt]=ut,Gn[Pt]=Ft},Ht=()=>qn.fill(null);let Zt=256,Jt=[new Int32Array(Zt),new Int32Array(Zt),new Int32Array(Zt),new Int32Array(Zt)],[Ur,Kn,Ln,cr]=Jt,ur=new Uint8Array(Zt),dr=new Uint8Array(Zt);const ls=()=>{Zt*=2,Jt=Jt.map(Te=>{const Oe=new Int32Array(Zt);return Oe.set(Te),Oe}),[Ur,Kn,Ln,cr]=Jt;const me=new Uint8Array(Zt);me.set(ur),ur=me,dr=new Uint8Array(Zt)};let Ar=64,kr=new Int32Array(Ar),as=new Int32Array(Ar);const fo=new Int32Array(r);let fr=2048,Do=21,Cs=new Float64Array(fr),wl=new Int32Array(fr),Ts=0;const El=(me,Te)=>{if(me===0&&Te<r)return fo[Te]===Ts?1:(fo[Te]=Ts,0);const Oe=me*2097152+Te+1;let Ke=Math.imul(Oe,2654435761)>>>Do;for(;wl[Ke]===Ts;){if(Cs[Ke]===Oe)return 1;Ke=Ke+1&fr-1}return Cs[Ke]=Oe,wl[Ke]=Ts,0},mi=(me,Te,Oe,Ke,lt)=>{if(Oe-Te>=2&&me.charCodeAt(Te)===91&&me.charCodeAt(Oe-1)===93){let it=-1;for(let ut=Te+1;ut<Oe-1;ut++)if(me.charCodeAt(ut)===58){it=ut;break}return it===-1||it===Te+1?Ko:xt(gn,me,Te+1,it,0,cn)}if(Ke>=0&&u[Ke]>=0)return u[Ke];for(let it=lt-1;it>=0;it--){const ut=as[it];if(ut>Oe)continue;const Ft=kr[it],Pt=Oe-ut;if(q[Ft]===1&&Pt>0&&Pt<=V){const bn=me.charCodeAt(ut);if(G===!1||bn!==91&&bn!==40){const Rs=ee(Ft,me,ut,Oe);if(Rs>=0)return Rs}}const Ze=f[Ft];if(Ze<0)continue;const ft=y[Ze],Lt=h[ft],rt=h[ft+1];if(Lt===rt)continue;Me(me,ut,Oe);const Wn=D[Ze]-Lt;for(let bn=Lt;bn<rt;bn++)if(Fe(p[bn],me,ut,Oe))return x[Wn+bn]}return Ko},ho=me=>{const Te=me.length;let Oe=0,Ke=0,lt=!1;(De>tt||nn.size>tt)&&(nn=new Map,Ce=new Map,De=2,Ht()),yn>Fr&&(gn=new Map,yn=r,Ht());let it=0;for(;it<Te;){let Ze=me.charCodeAt(it);if(Ze===32||Ze>=9&&Ze<=13||Ze>=160&&Ae(Ze)){Ze!==32&&(lt=!0),it++;continue}const ft=it;let Lt=0;for(;it<Te;){if(Ze=me.charCodeAt(it),Ze<=32){if(Ze===32)break;if(Ze>=9&&Ze<=13){lt=!0;break}}else if(Ze>=160&&Ae(Ze)){lt=!0;break}Lt=Math.imul(Lt^Ze,16777619),it++}const rt=it,Wn=rt-ft;Oe===Zt&&ls();const bn=Oe++;Ur[bn]=ft,Kn[bn]=rt,Ke+=Wn,Lt^=Math.imul(Wn,2654435761);const Rs=Lt^Lt>>>15|0,Dn=Rs&8190;{let kt=-1;if(Es[Dn]===Rs&&qn[Dn]!==null&&qn[Dn].length===Wn?kt=Dn:Es[Dn|1]===Rs&&qn[Dn|1]!==null&&qn[Dn|1].length===Wn&&(kt=Dn|1),kt>=0){const er=qn[kt];let Ks=!0;for(let ks=0;ks<Wn;ks++)if(er.charCodeAt(ks)!==me.charCodeAt(ft+ks)){Ks=!1;break}if(Ks){Ln[bn]=yt[kt],cr[bn]=un[kt],ur[bn]=Gn[kt];continue}}}let jn=ft;if(J!==0){if(rt-ft<=J||!me.startsWith(Y,ft)){Ln[bn]=Ko,On(Dn,me,ft,rt,Rs,Ko,0,0);continue}jn=ft+J}let Ou=0,zf=0,vi=-1,Au=-1;for(let kt=jn;kt<rt;kt++){const er=me.charCodeAt(kt);if(Ou===0&&zf===0){if(er===58){vi=kt;continue}if(er===47){Au=kt;continue}}er===91?Ou++:er===93?Ou--:er===40?zf++:er===41&&zf--}const Qm=vi>=jn?vi+1:jn;let ln=Qm,_r=rt,Rl=!1,ku=0;_r>ln&&me.charCodeAt(_r-1)===33?(Rl=!0,_r--):_r>ln&&me.charCodeAt(ln)===33&&(Rl=!0,ln++,ku=1);let ds=-1;Au>Qm&&(ds=Au+ku,ds>=_r&&(ds=-1));let _u=ln;_r-ln>1&&me.charCodeAt(ln)===45&&(_u=ln+1);let Os=0,qr=0,Ol=0,Bf=-1,As=0;(f[0]>=0||q[0]===1)&&(kr[0]=0,as[0]=_u,As=1);let tc=Rc,Hf=0;for(let kt=_u;kt<_r;kt++)if(kt===ds&&(tc=qr<Ol?Rc:Os,Hf=As),Os!==Rc){const er=me.charCodeAt(kt);let Ks=-1;if(qr<Ol)l.charCodeAt(qr)===er?(qr++,qr===Ol&&(Ks=Os=Bf)):Os=Rc;else{const ks=s[Os],sc=s[Os+1];let Si=Rc;for(let pr=ks;pr<sc;pr++){const oc=o[pr];if(l.charCodeAt(oc)===er){o[pr+1]-oc===1?Ks=Si=c[pr]:(qr=oc+1,Ol=o[pr+1],Bf=c[pr],Si=Os);break}}Os=Si}if(Ks>=0&&(f[Ks]>=0||q[Ks]===1)&&kt+1<_r&&me.charCodeAt(kt+1)===45){if(As===Ar){Ar*=2;const ks=new Int32Array(Ar);ks.set(kr),kr=ks;const sc=new Int32Array(Ar);sc.set(as),as=sc}kr[As]=Ks,as[As]=kt+2,As++}}ds===_r&&(tc=qr<Ol?Rc:Os,Hf=As);const Ff=qr<Ol?Rc:Os;let hr,Gr=!1;if(ds>=0)if(Gr=!0,hr=mi(me,ln,ds,tc,Hf),hr!==Ko&&hr<r&&F[hr]){const kt=mi(me,ln,_r,Ff,As);kt!==Ko&&kt!==hr&&(hr=kt,Gr=!1)}else hr===Ko&&(hr=mi(me,ln,_r,Ff,As),Gr=!1);else hr=mi(me,ln,_r,Ff,As);let nc=0,rc=0;hr===Ko?Ln[bn]=Ko:(rc=Gr?1:0,nc=jn>=vi?Rl?1:0:xt(nn,me,jn,vi,Rl?1:0,kt=>Ot(kt,Rl)),Ln[bn]=hr,ur[bn]=rc,cr[bn]=nc),On(Dn,me,ft,rt,Rs,hr,nc,rc)}if(Oe===0)return"";if(Oe===1)return Ur[0]===0&&Kn[0]===Te?me:me.slice(Ur[0],Kn[0]);if(Oe*H>fr){for(;Oe*H>fr;)fr<<=1,Do--;Cs=new Float64Array(fr),wl=new Int32Array(fr)}if(De>=ar||yn>=ar)throw new Error("cn: too many distinct classes in one merge");Ts=Ts+1|0,Ts===0&&(fo.fill(0),wl.fill(0),Ts=1);let ut=!1;for(let Ze=Oe-1;Ze>=0;Ze--){const ft=Ln[Ze];if(ft===Ko){dr[Ze]=1;continue}const Lt=cr[Ze];if(El(Lt,ft)===1){dr[Ze]=0,ut=!0;continue}if(dr[Ze]=1,ft<r){const rt=P[ft];if(rt>=0)for(let Wn=O[rt];Wn<O[rt+1];Wn++)El(Lt,k[Wn]);if(ur[Ze]&1)for(let Wn=0;Wn<M.length;Wn++)M[Wn]===ft&&El(Lt,A[Wn])}}if(!ut&&!lt&&Te===Ke+Oe-1)return me;let Ft="",Pt=0;for(;Pt<Oe;){if(!dr[Pt]){Pt++;continue}const Ze=Ur[Pt];let ft=Kn[Pt],Lt=Pt+1;for(;Lt<Oe&&dr[Lt]&&Ur[Lt]===ft+1&&me.charCodeAt(ft)===32;)ft=Kn[Lt],Lt++;Ft.length>0&&(Ft+=" "),Ft+=me.slice(Ze,ft),Pt=Lt}return Ft},cs=16384,us=new Int32Array(cs*2);let gi=0,xn=1,on=Object.create(null),Yn=Object.create(null),Vr=new Map,ec=new Map,yi=0,Cl=0;const jo=()=>{gi^=cs,xn=xn+1|0,Cl=0},xi=me=>{let Te=on[me];if(Te!==void 0)return Te;const Oe=my(me,0,me.length),Ke=(Oe&16383)+gi,lt=us[Ke]===(Oe^xn)||us[Ke^cs]===(Oe^xn-1);return lt&&(Te=Yn[me],Te!==void 0)?(on[me]=Te,Te):(Te=ho(me),lt?(on[me]=Te,++yi>ae&&(yi=0,Yn=on,on=Object.create(null),jo())):(us[Ke]=Oe^xn,++Cl>cs&&jo()),Te)},Tl=me=>{let Te=Vr.get(me);if(Te!==void 0)return Te;const Oe=my(me,0,me.length),Ke=(Oe&16383)+gi,lt=us[Ke]===(Oe^xn)||us[Ke^cs]===(Oe^xn-1);return lt&&(Te=ec.get(me),Te!==void 0)?(Vr.set(me,Te),Te):(Te=ho(me),lt?(Vr.set(me,Te),++yi>ae&&(yi=0,ec=Vr,Vr=new Map,jo())):(us[Ke]=Oe^xn,++Cl>cs&&jo()),Te)},Nl=me=>{const Te=my(me,0,me.length),Oe=(Te&16383)+gi;return us[Oe]===(Te^xn)||us[Oe^cs]===(Te^xn-1)?!0:(us[Oe]=Te^xn,++Cl>cs&&jo(),!1)},Ns=ae===0?ho:pY?me=>{const Te=Vr.get(me);return Te!==void 0?Te:Tl(me)}:xi;return{merge:function(){return arguments.length===1&&typeof arguments[0]=="string"?Ns(arguments[0]):Ns(yY.apply(null,arguments))},mergeString:Ns,seenBefore:ae===0?()=>!1:Nl,mergeUncached:ho}},By=(e,t)=>{if(!e)return"";if(typeof e=="string")return e;let n="";if(typeof e.length=="number"&&(!t||Array.isArray(e))){const r=e;for(let s=0;s<r.length;s++){const o=r[s];if(!o)continue;const l=typeof o=="string"?o:By(o,t);l&&(n&&(n+=" "),n+=l)}return n}if(t){if(typeof e=="number")return""+e;if(typeof e=="object")for(const r in e)e[r]&&(n&&(n+=" "),n+=r)}return n},gY=(e,t)=>{let n="";for(let r=0;r<e.length;r++){const s=e[r];if(!s)continue;const o=typeof s=="string"?s:By(s,t);o&&(n&&(n+=" "),n+=o)}return n},yY=function(){return gY(arguments,!1)},xY=256,z_=16,bY=1024,M1=4096,vY=(e,t)=>{const n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached;let s=new Map,o=new Map,l=0,c=null,u=null,f=[],h=[],p=0;const y=(C,R,T)=>{u===null&&(u=new Array(M1).fill(""),f=new Array(M1).fill(""),h=new Array(M1).fill(""));const O=my(C,0,C.length)&4094;if(u[O]===C&&f[O]===R)return h[O];if(u[O|1]===C&&f[O|1]===R)return h[O|1];const k=e(T?R+" "+C:C),M=u[O]===""?O:O|(u[O|1]===""?1:p++&1);return u[M]=C,f[M]=R,h[M]=k,k},x=(C,R,T,O)=>{let k=0;if(R){if(R!==C.a0)return!1;k=1}if(T){if(T!==(k===0?C.a0:C.a1))return!1;k++}if(O){if(O!==(k===0?C.a0:k===1?C.a1:C.a2))return!1;k++}return k===C.t},b=(C,R)=>{const T=C.a;let O=0;for(let k=0;k<R.length;k++){const M=R[k];if(M){if(M!==T[O])return!1;O++}}return O===C.t},S=(C,R)=>{const T=C.length,O=c===null?null:c.n;if(!R){if(O!==null&&b(O,C))return c=O,O.r;if(c!==null&&c!==O&&b(c,C))return c.r}let k="",M=-1,A=0,L=!1;for(let P=0;P<T;P++){let B=C[P];if(B){if(typeof B!="string"){if(B=C[P]=By(B,!0),!B)continue;L=!0}M<0&&(k=B,M=P),A++}}if(A===0)return"";if(A===1)return e(k);if(L){if(O!==null&&b(O,C))return c=O,O.r;if(c!==null&&c!==O&&b(c,C))return c.r}let I=s.get(k);I===void 0&&(I=o.get(k),I!==void 0&&s.set(k,I));let j=null;if(I!==void 0){if(I.skip>0){I.skip--,c=null;let B=k;for(let H=M+1;H<T;H++){const D=C[H];D&&(B+=" "+D)}return y(B,"",!1)}const P=I.e;e:for(let B=0;B<P.length;B++){const H=P[B];if(H.t!==A)continue;const D=H.a;let F=1;for(let z=M+1;z<T;z++){const q=C[z];if(q&&q!==D[F++])continue e}j=H;break}j!==null&&(I.miss=0)}if(j===null){let P=k;const B=[k];for(let D=M+1;D<T;D++){const F=C[D];F&&(P+=" "+F,B.push(F))}if(!n(P))return r(P);j={r:e(P),t:B.length,a0:B[0],a1:B[1],a2:B[2]??"",a:B,n:null},I===void 0?s.set(k,I={e:[],miss:0,skip:0,at:0}):++I.miss>z_&&(I.miss=z_,I.skip=bY,I.e.length=0,I.at=0);const H=I.e;H.length<xY?H.push(j):(H[I.at]=j,I.at=I.at+1&255),++l>1e3&&(l=0,o=s,s=new Map)}return c!==null&&c!==j&&(c.n=j),c=j,j.r},E=C=>Array.isArray(C)?S(C.slice(),!1):e(By(C,!0));return function(C,R,T){const O=arguments.length;if((O|1)===3){const A=c;if(A!==null){const L=A.n;if(L!==null&&x(L,C,R,T))return c=L,L.r;if(A!==L&&x(A,C,R,T))return A.r}if(O===2&&typeof R=="string"&&R!==""){const L=s.get(C);if(L!==void 0&&L.skip>0)return L.skip--,c=null,y(R,C,!0)}return S([C,R,T],!0)}if(O===1)return typeof C=="string"?e(C):E(C);const k=c;if(k!==null){const A=k.n;if(A!==null){const L=A.a;let I=0,j=!0;for(let P=0;P<O;P++){const B=arguments[P];if(B){if(B!==L[I]){j=!1;break}I++}}if(j&&I===A.t)return c=A,A.r}if(k!==A){const L=k.a;let I=0,j=!0;for(let P=0;P<O;P++){const B=arguments[P];if(B){if(B!==L[I]){j=!1;break}I++}}if(j&&I===k.t)return k.r}}const M=[];for(let A=0;A<O;A++)M.push(arguments[A]);return S(M,!0)}},B_=mY(hY),xe=vY(B_.mergeString,B_),SY=qK("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-normal whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary font-bold text-primary-foreground hover:bg-[color-mix(in_oklch,var(--primary),var(--foreground)_12%)]",outline:"border-input bg-card hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-foreground underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function st({className:e,variant:t="default",size:n="default",children:r,...s}){return g.jsx(UK,{"data-slot":"button",className:xe(SY({variant:t,size:n,className:e})),...s,children:typeof r=="string"?g.jsx("span",{className:"text-box-cap",children:r}):r})}const wY="/server-error.svg",EY="The backend did not say what went wrong.",CY=e=>e instanceof Error?e.message:EY,q4=({heading:e,error:t,className:n,children:r})=>{const s=qs();return g.jsxs("section",{role:"alert",className:xe("mx-auto flex max-w-prose flex-col items-center text-center",n),children:[g.jsx(A4,{src:wY}),g.jsx("h1",{className:"mt-4 text-2xl font-bold tracking-[-0.01em]",children:e}),g.jsx("p",{className:"mt-2 text-muted-foreground",children:CY(t)}),g.jsxs("div",{className:"mt-4 flex items-center gap-4",children:[g.jsx(st,{onClick:()=>{s.invalidate()},children:"Try again"}),r]})]})};function Nf(e){const t={subscribe(n){let r=null,s=!1,o=!1,l=!1;function c(){if(r===null){l=!0;return}o||(o=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=e({next(u){var f;s||(f=n.next)===null||f===void 0||f.call(n,u)},error(u){var f;s||(s=!0,(f=n.error)===null||f===void 0||f.call(n,u),c())},complete(){var u;s||(s=!0,(u=n.complete)===null||u===void 0||u.call(n),c())}}),l&&c(),{unsubscribe:c}},pipe(...n){return n.reduce(TY,t)}};return t}function TY(e,t){return t(e)}function NY(e){const t=new AbortController;return new Promise((n,r)=>{let s=!1;function o(){s||(s=!0,l.unsubscribe())}t.signal.addEventListener("abort",()=>{r(t.signal.reason)});const l=e.subscribe({next(c){s=!0,n(c),o()},error(c){r(c)},complete(){t.abort(),o()}})})}function RY(e){return t=>{let n=0,r=null;const s=[];function o(){r||(r=t.subscribe({next(c){for(const f of s){var u;(u=f.next)===null||u===void 0||u.call(f,c)}},error(c){for(const f of s){var u;(u=f.error)===null||u===void 0||u.call(f,c)}},complete(){for(const u of s){var c;(c=u.complete)===null||c===void 0||c.call(u)}}}))}function l(){if(n===0&&r){const c=r;r=null,c.unsubscribe()}}return Nf(c=>(n++,s.push(c),o(),{unsubscribe(){n--,l();const u=s.findIndex(f=>f===c);u>-1&&s.splice(u,1)}}))}}function G4(e){let t=e;const n=[],r=l=>{t!==void 0&&l.next(t),n.push(l)},s=l=>{n.splice(n.indexOf(l),1)},o=Nf(l=>(r(l),()=>{s(l)}));return o.next=l=>{if(t!==l){t=l;for(const c of n)c.next(l)}},o.get=()=>t,o}function K4(e){return Nf(t=>{function n(r=0,s=e.op){const o=e.links[r];if(!o)throw new Error("No more links to execute - did you forget to add an ending link?");return o({op:s,next(l){return n(r+1,l)}})}return n().subscribe(t)})}function H_(e){return Array.isArray(e)?e:[e]}function OY(e){return t=>{const n=H_(e.true).map(s=>s(t)),r=H_(e.false).map(s=>s(t));return s=>Nf(o=>{const l=e.condition(s.op)?n:r;return K4({op:s.op,links:l}).subscribe(o)})}}function Ep(e){"@babel/helpers - typeof";return Ep=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ep(e)}function AY(e,t){if(Ep(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ep(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kY(e){var t=AY(e,"string");return Ep(t)=="symbol"?t:t+""}function jr(e,t,n){return(t=kY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Mn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F_(Object(n),!0).forEach(function(r){jr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fa(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function _Y(e){return typeof e=="function"}function Y4(){return Object.create(null)}const MY=typeof Symbol=="function"&&!!Symbol.asyncIterator;function IY(e){return MY&&Fa(e)&&Symbol.asyncIterator in e}const N2=e=>e(),E0={INTERNAL_SERVER_ERROR:-32603,BAD_GATEWAY:-32603,SERVICE_UNAVAILABLE:-32603,GATEWAY_TIMEOUT:-32603},LY=[E0.BAD_GATEWAY,E0.SERVICE_UNAVAILABLE,E0.GATEWAY_TIMEOUT,E0.INTERNAL_SERVER_ERROR],W4=()=>{},$_=e=>{Object.freeze&&Object.freeze(e)};function X4(e,t,n){var r;const s=t.join(".");return(r=n[s])!==null&&r!==void 0||(n[s]=new Proxy(W4,{get(o,l){if(!(typeof l!="string"||l==="then"))return X4(e,[...t,l],n)},apply(o,l,c){const u=t[t.length-1];if(u==="valueOf"||u==="toString"||u==="toJSON")return`tRPC.proxy(${t.slice(0,-1).join(".")})`;let f={args:c,path:t};return u==="call"?f={args:c.length>=2?[c[1]]:[],path:t.slice(0,-1)}:u==="apply"&&(f={args:c.length>=2?c[1]:[],path:t.slice(0,-1)}),$_(f.args),$_(f.path),e(f)}})),n[s]}const Q4=e=>X4(e,[],Y4()),DY=e=>new Proxy(W4,{get(t,n){if(n!=="then")return e(n)}});function Cp(e){"@babel/helpers - typeof";return Cp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cp(e)}function jY(e,t){if(Cp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Cp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function PY(e){var t=jY(e,"string");return Cp(t)=="symbol"?t:t+""}function jc(e,t,n){return(t=PY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function U_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function C0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U_(Object(n),!0).forEach(function(r){jc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var zY=class extends Error{constructor(e){super(BY(e)),Object.assign(this,e)}};function BY(e){if("message"in e)return String(e.message)}function HY(e){if(e instanceof Error)return e;const t=typeof e;if(!(t==="undefined"||t==="function"||e===null)){if(t!=="object")return new Error(String(e));if(Fa(e))return new zY(e)}}var V_=class extends Error{constructor(e){var t,n,r;const s=HY(e.cause),o=(t=(n=e.message)!==null&&n!==void 0?n:s==null?void 0:s.message)!==null&&t!==void 0?t:e.code;super(o,{cause:s}),jc(this,"cause",void 0),jc(this,"code",void 0),this.code=e.code,this.name="TRPCError",(r=this.cause)!==null&&r!==void 0||(this.cause=s)}};function FY(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:C0(C0({},e),{},{error:n})}}return{ok:!0,result:C0(C0({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var I1=class extends Error{constructor(){super("Unable to transform response from server")}};function $Y(e,t){let n;try{n=FY(e,t)}catch{throw new I1}if(!n.ok&&(!Fa(n.error.error)||typeof n.error.error.code!="number"))throw new I1;if(n.ok&&!Fa(n.result))throw new I1;return n}function UY(e){return typeof e=="function"}async function VY(e,t){const{_def:n}=e;let r=n.procedures[t];for(;!r;){const s=Object.keys(n.lazy).find(o=>t===o||t.startsWith(o+"."));if(!s)return null;await n.lazy[s].load(),r=n.procedures[t]}return r}async function qY(e){const{type:t,path:n}=e,r=await VY(e.router,n);if(!r||!UY(r)||r._def.type!==t&&!e.allowMethodOverride)throw new V_({code:"NOT_FOUND",message:`No "${t}"-procedure on path "${n}"`});/* istanbul ignore if -- @preserve */if(r._def.type!==t&&e.allowMethodOverride&&r._def.type==="subscription")throw new V_({code:"METHOD_NOT_SUPPORTED",message:"Method override is not supported for subscriptions"});return r(e)}let Z4;const L1=new WeakMap,GY=()=>{};Z4=Symbol.toStringTag;var J4=class kc{constructor(t){jc(this,"promise",void 0),jc(this,"subscribers",[]),jc(this,"settlement",null),jc(this,Z4,"Unpromise"),typeof t=="function"?this.promise=new Promise(t):this.promise=t;const n=this.promise.then(r=>{const{subscribers:s}=this;this.subscribers=null,this.settlement={status:"fulfilled",value:r},s==null||s.forEach(({resolve:o})=>{o(r)})});"catch"in n&&n.catch(r=>{const{subscribers:s}=this;this.subscribers=null,this.settlement={status:"rejected",reason:r},s==null||s.forEach(({reject:o})=>{o(r)})})}subscribe(){let t,n;const{settlement:r}=this;if(r===null){if(this.subscribers===null)throw new Error("Unpromise settled but still has subscribers");const s=YY();this.subscribers=WY(this.subscribers,s),t=s.promise,n=()=>{this.subscribers!==null&&(this.subscribers=QY(this.subscribers,s))}}else{const{status:s}=r;s==="fulfilled"?t=Promise.resolve(r.value):t=Promise.reject(r.reason),n=GY}return Object.assign(t,{unsubscribe:n})}then(t,n){const r=this.subscribe(),{unsubscribe:s}=r;return Object.assign(r.then(t,n),{unsubscribe:s})}catch(t){const n=this.subscribe(),{unsubscribe:r}=n;return Object.assign(n.catch(t),{unsubscribe:r})}finally(t){const n=this.subscribe(),{unsubscribe:r}=n;return Object.assign(n.finally(t),{unsubscribe:r})}static proxy(t){const n=kc.getSubscribablePromise(t);return typeof n<"u"?n:kc.createSubscribablePromise(t)}static createSubscribablePromise(t){const n=new kc(t);return L1.set(t,n),L1.set(n,n),n}static getSubscribablePromise(t){return L1.get(t)}static resolve(t){const n=typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"?t:Promise.resolve(t);return kc.proxy(n).subscribe()}static async any(t){const n=(Array.isArray(t)?t:[...t]).map(kc.resolve);try{return await Promise.any(n)}finally{n.forEach(({unsubscribe:r})=>{r()})}}static async race(t){const n=(Array.isArray(t)?t:[...t]).map(kc.resolve);try{return await Promise.race(n)}finally{n.forEach(({unsubscribe:r})=>{r()})}}static async raceReferences(t){const n=t.map(KY);try{return await Promise.race(n)}finally{for(const r of n)r.unsubscribe()}}};function KY(e){return J4.proxy(e).then(()=>[e])}function YY(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function WY(e,t){return[...e,t]}function XY(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function QY(e,t){const n=e.indexOf(t);return n!==-1?XY(e,n):e}var q_,G_,K_,Y_;(G_=(q_=Symbol).dispose)!==null&&G_!==void 0||(q_.dispose=Symbol());(Y_=(K_=Symbol).asyncDispose)!==null&&Y_!==void 0||(K_.asyncDispose=Symbol());function ZY(e,t){const n=e,r=n[Symbol.dispose];return n[Symbol.dispose]=()=>{t(),r==null||r.call(n)},n}function JY(e,t){const n=e,r=n[Symbol.asyncDispose];return n[Symbol.asyncDispose]=async()=>{await t(),await(r==null?void 0:r.call(n))},n}const e3=Symbol();function eW(e){let t=null;return ZY({start(){if(t)throw new Error("Timer already started");return new Promise(n=>{t=setTimeout(()=>n(e3),e)})}},()=>{t&&clearTimeout(t)})}function t3(){var e=typeof SuppressedError=="function"?SuppressedError:function(s,o){var l=Error();return l.name="SuppressedError",l.error=s,l.suppressed=o,l},t={},n=[];function r(s,o){if(o!=null){if(Object(o)!==o)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(s)var l=o[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(l===void 0&&(l=o[Symbol.dispose||Symbol.for("Symbol.dispose")],s))var c=l;if(typeof l!="function")throw new TypeError("Object is not disposable.");c&&(l=function(){try{c.call(o)}catch(f){return Promise.reject(f)}}),n.push({v:o,d:l,a:s})}else s&&n.push({d:o,a:s});return o}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var o,l=this.e,c=0;function u(){for(;o=n.pop();)try{if(!o.a&&c===1)return c=0,n.push(o),Promise.resolve().then(u);if(o.d){var h=o.d.call(o.v);if(o.a)return c|=2,Promise.resolve(h).then(u,f)}else c|=1}catch(p){return f(p)}if(c===1)return l!==t?Promise.reject(l):Promise.resolve();if(l!==t)throw l}function f(h){return l=l!==t?new e(h,l):h,u()}return u()}}}function n3(e,t){this.v=e,this.k=t}function W_(e){return new n3(e,0)}function tW(e){return function(){return new Kh(e.apply(this,arguments))}}function Kh(e){var t,n;function r(o,l){try{var c=e[o](l),u=c.value,f=u instanceof n3;Promise.resolve(f?u.v:u).then(function(h){if(f){var p=o==="return"?"return":"next";if(!u.k||h.done)return r(p,h);h=e[p](h).value}s(c.done?"return":"normal",h)},function(h){r("throw",h)})}catch(h){s("throw",h)}}function s(o,l){switch(o){case"return":t.resolve({value:l,done:!0});break;case"throw":t.reject(l);break;default:t.resolve({value:l,done:!1})}(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(o,l){return new Promise(function(c,u){var f={key:o,arg:l,resolve:c,reject:u,next:null};n?n=n.next=f:(t=n=f,r(o,l))})},typeof e.return!="function"&&(this.return=void 0)}Kh.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Kh.prototype.next=function(e){return this._invoke("next",e)},Kh.prototype.throw=function(e){return this._invoke("throw",e)},Kh.prototype.return=function(e){return this._invoke("return",e)};const nW="ping",rW="serialized-error",sW="connected",oW="return";async function iW(e){try{var t=t3();const n=t.u(eW(e.timeoutMs)),r=await J4.race([e.promise,n.start()]);return r===e3?await e.onTimeout():r}catch(n){t.e=n}finally{t.d()}}function lW(e){const{deserialize:t=c=>c}=e;let n=Y4();const r=e.signal;let s=null;const o=()=>new ReadableStream({async start(c){const[u,f]=await Promise.all([e.url(),e.init()]),h=s=new e.EventSource(u,f);c.enqueue({type:"connecting",eventSource:s,event:null}),h.addEventListener(sW,y=>{const x=JSON.parse(y.data);n=x,c.enqueue({type:"connected",options:x,eventSource:h})}),h.addEventListener(rW,y=>{const x=y;c.enqueue({type:"serialized-error",error:t(JSON.parse(x.data)),eventSource:h})}),h.addEventListener(nW,()=>{c.enqueue({type:"ping",eventSource:h})}),h.addEventListener(oW,()=>{h.close(),c.close(),s=null}),h.addEventListener("error",y=>{h.readyState===h.CLOSED?c.error(y):c.enqueue({type:"connecting",eventSource:h,event:y})}),h.addEventListener("message",y=>{const x=y,b={data:t(JSON.parse(x.data))};x.lastEventId&&(b.id=x.lastEventId),c.enqueue({type:"data",data:b,eventSource:h})});const p=()=>{try{h.close(),c.close()}catch{}};r.aborted?p():r.addEventListener("abort",p)},cancel(){s==null||s.close()}}),l=()=>{let c=o(),u=c.getReader();async function f(){await u.cancel(),s=null}return JY({read(){return u.read()},async recreate(){await f(),c=o(),u=c.getReader()}},f)};return N2(tW(function*(){try{var c=t3();const u=c.a(l());for(;;){let f=u.read();const h=n.reconnectAfterInactivityMs;h&&(f=iW({promise:f,timeoutMs:h,onTimeout:async()=>{const y={value:{type:"timeout",ms:h,eventSource:s},done:!1};return await u.recreate(),y}}));const p=yield W_(f);if(p.done)return p.value;yield p.value}}catch(u){c.e=u}finally{yield W_(c.d())}}))}function aW(e){return e instanceof Sa}function cW(e){return Fa(e)&&Fa(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function uW(e,t){return typeof e=="string"?e:Fa(e)&&typeof e.message=="string"?e.message:t}var Sa=class gy extends Error{constructor(t,n){var r,s;const o=n==null?void 0:n.cause;super(t,{cause:o}),jr(this,"cause",void 0),jr(this,"shape",void 0),jr(this,"data",void 0),jr(this,"meta",void 0),this.meta=n==null?void 0:n.meta,this.cause=o,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(s=n.result)===null||s===void 0?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,gy.prototype)}static from(t,n={}){const r=t;return aW(r)?(n.meta&&(r.meta=Mn(Mn({},r.meta),n.meta)),r):cW(r)?new gy(r.error.message,Mn(Mn({},n),{},{result:r,cause:n.cause})):new gy(uW(r,"Unknown error"),Mn(Mn({},n),{},{cause:r}))}};function r3(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const X_=e=>typeof e=="function";function dW(e){if(e)return e;if(typeof window<"u"&&X_(window.fetch))return window.fetch.bind(window);if(typeof globalThis<"u"&&X_(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}function fW(...e){const t=new AbortController,n=e.length;let r=0;const s=()=>{++r===n&&t.abort()};for(const o of e)o!=null&&o.aborted?s():o==null||o.addEventListener("abort",s,{once:!0});return t.signal}function s3(...e){const t=new AbortController;for(const n of e)n!=null&&n.aborted?t.abort():n==null||n.addEventListener("abort",()=>t.abort(),{once:!0});return t.signal}function hW(e){return{url:e.url.toString(),fetch:e.fetch,transformer:r3(e.transformer),methodOverride:e.methodOverride}}function pW(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}const mW={query:"GET",mutation:"POST",subscription:"PATCH"};function o3(e){return"input"in e?e.transformer.input.serialize(e.input):pW(e.inputs.map(t=>e.transformer.input.serialize(t)))}const R2=e=>{const t=e.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+e.path;const r=[];if(t[1]&&r.push(t[1]),"inputs"in e&&r.push("batch=1"),e.type==="query"||e.type==="subscription"){const s=o3(e);s!==void 0&&e.methodOverride!=="POST"&&r.push(`input=${encodeURIComponent(JSON.stringify(s))}`)}return r.length&&(n+="?"+r.join("&")),n},gW=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=o3(e);return t!==void 0?JSON.stringify(t):void 0},yW=e=>SW(Mn(Mn({},e),{},{contentTypeHeader:"application/json",getUrl:R2,getBody:gW}));var xW=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const bW=e=>{var t;if(e!=null&&e.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new xW};async function vW(e){var t,n;bW(e.signal);const r=e.getUrl(e),s=e.getBody(e),o=(t=e.methodOverride)!==null&&t!==void 0?t:mW[e.type],l=await(async()=>{const u=await e.headers();return Symbol.iterator in u?Object.fromEntries(u):u})(),c=Mn(Mn(Mn({},e.contentTypeHeader&&o!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[(n=e.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:e.trpcAcceptHeader}:void 0),l);return dW(e.fetch)(r,{method:o,signal:e.signal,body:s,headers:c})}async function SW(e){const t={},n=await vW(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}const Q_=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Z_(e){let t=null,n=null;const r=()=>{clearTimeout(n),n=null,t=null};function s(c){const u=[[]];let f=0;for(;;){const y=c[f];if(!y)break;const x=u[u.length-1];if(y.aborted){var h;(h=y.reject)===null||h===void 0||h.call(y,new Error("Aborted")),f++;continue}if(e.validate(x.concat(y).map(b=>b.key))){x.push(y),f++;continue}if(x.length===0){var p;(p=y.reject)===null||p===void 0||p.call(y,new Error("Input is too big for a single dispatch")),f++;continue}u.push([])}return u}function o(){const c=s(t);r();for(const u of c){if(!u.length)continue;const f={items:u};for(const h of u)h.batch=f;e.fetch(f.items.map(h=>h.key)).then(async h=>{await Promise.all(h.map(async(y,x)=>{const b=f.items[x];try{var S;const C=await Promise.resolve(y);(S=b.resolve)===null||S===void 0||S.call(b,C)}catch(C){var E;(E=b.reject)===null||E===void 0||E.call(b,C)}b.batch=null,b.reject=null,b.resolve=null}));for(const y of f.items){var p;(p=y.reject)===null||p===void 0||p.call(y,new Error("Missing result")),y.batch=null}}).catch(h=>{for(const y of f.items){var p;(p=y.reject)===null||p===void 0||p.call(y,h),y.batch=null}})}}function l(c){var u;const f={aborted:!1,key:c,batch:null,resolve:Q_,reject:Q_},h=new Promise((p,y)=>{var x;f.reject=y,f.resolve=p,(x=t)!==null&&x!==void 0||(t=[]),t.push(f)});return(u=n)!==null&&u!==void 0||(n=setTimeout(o)),h}return{load:l}}function wW(e){var t,n;const r=hW(e),s=(t=e.maxURLLength)!==null&&t!==void 0?t:1/0,o=(n=e.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const l=u=>({validate(f){if(s===1/0&&o===1/0)return!0;if(f.length>o)return!1;const h=f.map(y=>y.path).join(","),p=f.map(y=>y.input);return R2(Mn(Mn({},r),{},{type:u,path:h,inputs:p,signal:null})).length<=s},async fetch(f){const h=f.map(b=>b.path).join(","),p=f.map(b=>b.input),y=fW(...f.map(b=>b.signal)),x=await yW(Mn(Mn({},r),{},{path:h,inputs:p,type:u,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:f}):e.headers:{}},signal:y}));return(Array.isArray(x.json)?x.json:f.map(()=>x.json)).map(b=>({meta:x.meta,json:b}))}}),c={query:Z_(l("query")),mutation:Z_(l("mutation"))};return({op:u})=>Nf(f=>{/* istanbul ignore if -- @preserve */if(u.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const h=new AbortController,p=c[u.type].load(Mn(Mn({},u),{},{signal:s3(u.signal,h.signal)}));let y=!1,x;return p.then(b=>{y=!0,x=b;const S=$Y(b.json,r.transformer.output);if(!S.ok){f.error(Sa.from(S.error,{meta:b.meta}));return}f.next({context:b.meta,result:S.result}),f.complete()}).catch(b=>{y=!0,f.error(Sa.from(b,{meta:x==null?void 0:x.meta}))}),()=>{y||h.abort()}})}}const Tp=(e,...t)=>typeof e=="function"?e(...t):e;function EW(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}async function CW(e){const t=await Tp(e.url);return e.connectionParams?t+`${t.includes("?")?"&":"?"}connectionParams=1`:t}async function TW(e,t){const n={method:"connectionParams",data:await Tp(e)};return t.encode(n)}function NW(e){const{promise:t,resolve:n,reject:r}=EW();return e.addEventListener("open",()=>{e.removeEventListener("error",r),n()}),e.addEventListener("error",r),t}function RW(e,{intervalMs:t,pongTimeoutMs:n}){let r,s;function o(){r=setTimeout(()=>{e.send("PING"),s=setTimeout(()=>{e.close()},n)},t)}function l(){clearTimeout(r),o()}function c(){clearTimeout(s),l()}e.addEventListener("open",o),e.addEventListener("message",({data:u})=>{clearTimeout(r),o(),u==="PONG"&&c()}),e.addEventListener("close",()=>{clearTimeout(r),clearTimeout(s)})}var OW=class cE{constructor(t){var n;if(jr(this,"id",++cE.connectCount),jr(this,"WebSocketPonyfill",void 0),jr(this,"urlOptions",void 0),jr(this,"keepAliveOpts",void 0),jr(this,"encoder",void 0),jr(this,"wsObservable",G4(null)),jr(this,"openPromise",null),this.WebSocketPonyfill=(n=t.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++cE.connectCount;const t=CW(this.urlOptions).then(n=>new this.WebSocketPonyfill(n));this.openPromise=t.then(async n=>{this.ws=n,n.binaryType="arraybuffer",n.addEventListener("message",function({data:r}){r==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&RW(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await NW(n),this.urlOptions.connectionParams&&n.send(await TW(this.urlOptions.connectionParams,this.encoder))});try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{var t;(t=this.ws)===null||t===void 0||t.close()}}};jr(OW,"connectCount",0);var i3=class{constructor(e){jr(this,"links",void 0),jr(this,"runtime",void 0),jr(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return K4({links:this.links,op:Mn(Mn({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(RY())}async requestAsPromise(e){try{const t=this.$request(e);return(await NY(t)).result.data}catch(t){throw Sa.from(t)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(r){switch(r.result.type){case"state":var s;(s=n.onConnectionStateChange)===null||s===void 0||s.call(n,r.result);break;case"started":var o;(o=n.onStarted)===null||o===void 0||o.call(n,{context:r.context});break;case"stopped":var l;(l=n.onStopped)===null||l===void 0||l.call(n);break;case"data":case void 0:var c;(c=n.onData)===null||c===void 0||c.call(n,r.result.data)}},error(r){var s;(s=n.onError)===null||s===void 0||s.call(n,r)},complete(){var r;(r=n.onComplete)===null||r===void 0||r.call(n)}})}};const l3=Symbol.for("trpc_untypedClient"),AW={query:"query",mutate:"mutation",subscribe:"subscription"},kW=e=>AW[e];function _W(e){const t=Q4(({path:n,args:r})=>{const s=[...n],o=kW(s.pop()),l=s.join(".");return e[o](l,...r)});return DY(n=>n===l3?e:t[n])}function MW(e){return _W(new i3(e))}function IW(e){return e[l3]}function LW(e,t){return!t||e!=null&&typeof e!="object"?e:Mn(Mn({},e??{}),{},{lastEventId:t})}function DW(e){var t,n,r,s=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new yy(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function yy(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(s){return{value:s,done:r}})}return yy=function(r){this.s=r,this.n=r.next},yy.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(r){var s=this.s.return;return s===void 0?Promise.resolve({value:r,done:!0}):t(s.apply(this.s,arguments))},throw:function(r){var s=this.s.return;return s===void 0?Promise.reject(r):t(s.apply(this.s,arguments))}},new yy(e)}async function jW(e){let t=await Tp(e.url);if(e.connectionParams){const n=await Tp(e.connectionParams),r=t.includes("?")?"&":"?";t+=r+"connectionParams="+encodeURIComponent(JSON.stringify(n))}return t}function PW(e){const t=r3(e.transformer);return()=>({op:n})=>Nf(r=>{var s;const{type:o,path:l,input:c}=n;/* istanbul ignore if -- @preserve */if(o!=="subscription")throw new Error("httpSubscriptionLink only supports subscriptions");let u;const f=new AbortController,h=s3(n.signal,f.signal),p=lW({url:async()=>R2({transformer:t,url:await jW(e),input:LW(c,u),path:l,type:o,signal:null}),init:()=>Tp(e.eventSourceOptions,{op:n}),signal:h,deserialize:b=>t.output.deserialize(b),EventSource:(s=e.EventSource)!==null&&s!==void 0?s:globalThis.EventSource}),y=G4({type:"state",state:"connecting",error:null}),x=y.subscribe({next(b){r.next({result:b})}});return N2(async()=>{var b=!1,S=!1,E;try{for(var C=DW(p),R;b=!(R=await C.next()).done;b=!1){const T=R.value;switch(T.type){case"ping":break;case"data":const O=T.data;let k;O.id?(u=O.id,k={id:O.id,data:O}):k={data:O.data},r.next({result:k,context:{eventSource:T.eventSource}});break;case"connected":r.next({result:{type:"started"},context:{eventSource:T.eventSource}}),y.next({type:"state",state:"pending",error:null});break;case"serialized-error":{const M=Sa.from({error:T.error});if(LY.includes(T.error.code)){y.next({type:"state",state:"connecting",error:M});break}throw M}case"connecting":{const M=y.get(),A=T.event&&Sa.from(T.event);if(!A&&M.state==="connecting")break;y.next({type:"state",state:"connecting",error:A});break}case"timeout":y.next({type:"state",state:"connecting",error:new Sa(`Timeout of ${T.ms}ms reached while waiting for a response`)})}}}catch(T){S=!0,E=T}finally{try{b&&C.return!=null&&await C.return()}finally{if(S)throw E}}r.next({result:{type:"stopped"}}),y.next({type:"state",state:"idle",error:null}),r.complete()}).catch(b=>{r.error(Sa.from(b))}),()=>{r.complete(),f.abort(),x.unsubscribe()}})}function Np(e){"@babel/helpers - typeof";return Np=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Np(e)}function zW(e,t){if(Np(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Np(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function BW(e){var t=zW(e,"string");return Np(t)=="symbol"?t:t+""}function HW(e,t,n){return(t=BW(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J_(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ct(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J_(Object(n),!0).forEach(function(r){HW(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FW(e){var t,n,r,s=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);s--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new xy(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function xy(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(s){return{value:s,done:r}})}return xy=function(r){this.s=r,this.n=r.next},xy.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(r){var s=this.s.return;return s===void 0?Promise.resolve({value:r,done:!0}):t(s.apply(this.s,arguments))},throw:function(r){var s=this.s.return;return s===void 0?Promise.reject(r):t(s.apply(this.s,arguments))}},new xy(e)}function $W(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}function UW(e,t){if(e==null)return{};var n,r,s=$W(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}const VW=["cursor","direction"];function $x(e){return{path:e.path.join(".")}}function qW(e){return e.length>=3}function GW(e){return qW(e)?{type:"prefixed",prefix:e[0],path:e[1],args:e[2]}:{type:"unprefixed",prefix:void 0,path:e[0],args:e[1]}}function O2(e,t,n){var r;const s=GW(e);let o=(r=s.args)===null||r===void 0?void 0:r.input;if(n){var l,c;o=Ct(Ct(Ct({},(l=(c=s.args)===null||c===void 0?void 0:c.input)!==null&&l!==void 0?l:{}),n.pageParam!==void 0?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[s.path.join("."),o,t==null?void 0:t.trpc]}async function KW(e,t,n){const r=t.getQueryCache().build(t,{queryKey:n});r.setState({data:[],status:"success"});const s=[];var o=!1,l=!1,c;try{for(var u=FW(e),f;o=!(f=await u.next()).done;o=!1){const h=f.value;s.push(h),r.setState({data:[...s]})}}catch(h){l=!0,c=h}finally{try{o&&u.return!=null&&await u.return()}finally{if(l)throw c}}return s}function Li(e){const t=N2(()=>{const{input:n,type:r}=e,s=e.path.flatMap(o=>o.split("."));if(!n&&r==="any")return s.length?[s]:[];if(r==="infinite"&&Fa(n)&&("direction"in n||"cursor"in n)){const{cursor:o,direction:l}=n;return[s,{input:UW(n,VW),type:"infinite"}]}return[s,Ct(Ct({},typeof n<"u"&&n!==ao&&{input:n}),r&&r!=="any"&&{type:r})]});return e.prefix&&t.unshift([e.prefix]),t}function a3(e){const t=[e.path.flatMap(n=>n.split("."))];return e.prefix&&t.unshift([e.prefix]),t}function A2(e){return _Y(e)?e():e}function YW(e){var t;const{input:n,query:r,path:s,queryKey:o,opts:l}=e,c=n===ao,u=async f=>{var h;const p=Ct(Ct({},l),{},{trpc:Ct(Ct({},l==null?void 0:l.trpc),!(l==null||(h=l.trpc)===null||h===void 0)&&h.abortOnUnmount?{signal:f.signal}:{signal:null})});return await r(...O2(o,p,{direction:f.direction,pageParam:f.pageParam}))};return Object.assign(Ct(Ct({},l??{}),{},{queryKey:o,queryFn:c?ao:u,initialPageParam:(t=l==null?void 0:l.initialCursor)!==null&&t!==void 0?t:n==null?void 0:n.cursor}),{trpc:$x({path:s})})}function WW(e){var t,n;const{mutate:r,path:s,prefix:o,opts:l,overrides:c}=e,u=A2(e.queryClient),f=a3({path:s,prefix:(t=l==null?void 0:l.keyPrefix)!==null&&t!==void 0?t:o}),h=u.defaultMutationOptions(u.getMutationDefaults(f)),p=(n=c==null?void 0:c.onSuccess)!==null&&n!==void 0?n:(x=>x.originalFn()),y=async x=>await r(...O2([...f,{input:x}],l));return Ct(Ct({},l),{},{mutationKey:f,mutationFn:y,onSuccess(...x){var b,S;return p({originalFn:()=>{var C,R,T;return(C=l==null||(R=l.onSuccess)===null||R===void 0?void 0:R.call(l,...x))!==null&&C!==void 0?C:h==null||(T=h.onSuccess)===null||T===void 0?void 0:T.call(h,...x)},queryClient:u,meta:(b=(S=l==null?void 0:l.meta)!==null&&S!==void 0?S:h==null?void 0:h.meta)!==null&&b!==void 0?b:{}})},trpc:$x({path:s})})}function XW(e){const{input:t,query:n,path:r,queryKey:s,opts:o}=e,l=A2(e.queryClient),c=t===ao,u=async f=>{var h;const p=Ct(Ct({},o),{},{trpc:Ct(Ct({},o==null?void 0:o.trpc),!(o==null||(h=o.trpc)===null||h===void 0)&&h.abortOnUnmount?{signal:f.signal}:{signal:null})}),y=f.queryKey,x=await n(...O2(y,p));return IY(x)?KW(x,l,y):x};return Object.assign(Ct(Ct({},o),{},{queryKey:s,queryFn:c?ao:u}),{trpc:$x({path:r})})}const QW=e=>{const{subscribe:t,path:n,queryKey:r,input:s,opts:o={}}=e,l="enabled"in o?!!o.enabled:s!==ao,c=u=>t(n.join("."),s===ao?void 0:s,u);return Ct(Ct({},o),{},{enabled:l,subscribe:c,queryKey:r,trpc:$x({path:n})})};function ZW(e){const t=N.useRef(e);t.current=e;const n=N.useRef(new Set([])),r=N.useCallback(p=>{n.current.add(p)},[]),s=N.useRef(()=>{}),o=N.useCallback(()=>{var p;if((p=s.current)===null||p===void 0||p.call(s),h(l),!e.enabled)return;const y=e.subscribe({onStarted:()=>{var x,b;(x=(b=t.current).onStarted)===null||x===void 0||x.call(b),h(S=>Ct(Ct({},S),{},{status:"pending",error:null}))},onData:x=>{var b,S;(b=(S=t.current).onData)===null||b===void 0||b.call(S,x),h(E=>Ct(Ct({},E),{},{status:"pending",data:x,error:null}))},onError:x=>{var b,S;(b=(S=t.current).onError)===null||b===void 0||b.call(S,x),h(E=>Ct(Ct({},E),{},{status:"error",error:x}))},onConnectionStateChange:x=>{var b,S;(b=(S=t.current).onConnectionStateChange)===null||b===void 0||b.call(S,x),h(E=>{switch(x.state){case"connecting":return Ct(Ct({},E),{},{status:"connecting",error:x.error});case"pending":return E;case"idle":return Ct(Ct({},E),{},{status:"idle",data:void 0,error:null})}})}});s.current=()=>{y.unsubscribe()}},[Da(e.queryKey),e.enabled]),l=N.useCallback(()=>e.enabled?{data:void 0,error:null,status:"connecting",reset:o}:{data:void 0,error:null,status:"idle",reset:o},[e.enabled,o]),c=N.useRef(l()),[u,f]=N.useState(eM(c,r));u.reset=o;const h=N.useCallback(p=>{const y=c.current,x=c.current=p(y);let b=!1;for(const S of n.current)if(y[S]!==x[S]){b=!0;break}b&&f(eM(c,r))},[r]);return N.useEffect(()=>{if(e.enabled)return o(),()=>{var p;(p=s.current)===null||p===void 0||p.call(s)}},[o,e.enabled]),u}function eM(e,t){return new Proxy(e.current,{get(n,r){return t(r),e.current[r]}})}function c3(e){const t=e.keyPrefix,n=r=>(s,o,l)=>"router"in e?Promise.resolve(A2(e.ctx)).then(c=>qY({router:e.router,path:s,getRawInput:async()=>o,ctx:c,type:r,signal:void 0,batchIndex:0})):(e.client instanceof i3?e.client:IW(e.client))[r](s,o,l);return Q4(({args:r,path:s})=>{const o=[...s],l=o.pop(),[c,u]=r;return{"~types":void 0,pathKey:()=>Li({path:o,type:"any",prefix:t}),pathFilter:()=>Ct(Ct({},c),{},{queryKey:Li({path:o,type:"any",prefix:t})}),queryOptions:()=>XW({input:c,opts:u,path:o,queryClient:e.queryClient,queryKey:Li({path:o,input:c,type:"query",prefix:t}),query:n("query")}),queryKey:()=>Li({path:o,input:c,type:"query",prefix:t}),queryFilter:()=>Ct(Ct({},u),{},{queryKey:Li({path:o,input:c,type:"query",prefix:t})}),infiniteQueryOptions:()=>YW({input:c,opts:u,path:o,queryClient:e.queryClient,queryKey:Li({path:o,input:c,type:"infinite",prefix:t}),query:n("query")}),infiniteQueryKey:()=>Li({path:o,input:c,type:"infinite",prefix:t}),infiniteQueryFilter:()=>Ct(Ct({},u),{},{queryKey:Li({path:o,input:c,type:"infinite",prefix:t})}),mutationOptions:()=>{var f;return WW({opts:c,path:o,prefix:t,queryClient:e.queryClient,mutate:n("mutation"),overrides:(f=e.overrides)===null||f===void 0?void 0:f.mutations})},mutationKey:()=>a3({path:o,prefix:t}),subscriptionOptions:()=>QW({opts:u,path:o,input:c,queryKey:Li({path:o,input:c,type:"any",prefix:t}),subscribe:n("subscription")})}[l]()})}function JW(){const e=N.createContext(null),t=N.createContext(null),n=o=>{const l=N.useMemo(()=>c3({client:o.trpcClient,queryClient:o.queryClient,keyPrefix:o.keyPrefix}),[o.trpcClient,o.queryClient,o.keyPrefix]);return N.createElement(e.Provider,{value:o.trpcClient},N.createElement(t.Provider,{value:l},o.children))};n.displayName="TRPCProvider";function r(){const o=N.useContext(t);if(!o)throw new Error("useTRPC() can only be used inside of a <TRPCProvider>");return o}function s(){const o=N.useContext(e);if(!o)throw new Error("useTRPCClient() can only be used inside of a <TRPCProvider>");return o}return{TRPCProvider:n,useTRPC:r,useTRPCClient:s}}const tM="/api/trpc",{TRPCProvider:eX,useTRPC:ws}=JW(),tX=()=>[OY({condition:e=>e.type==="subscription",true:PW({url:tM}),false:wW({url:tM})})],nX=e=>MW({links:e}),rX=(e,t)=>c3({client:e,queryClient:t}),sX=2e4,oX=()=>{const e=ws(),t=Ga({...e.updateNotice.queryOptions({}),staleTime:"static"}).data??null,[n,r]=N.useState(!1),[s,o]=N.useState(!1),l=t!==null&&!n;N.useEffect(()=>{if(!l)return;const f=window.setTimeout(()=>{r(!0)},sX);return()=>{window.clearTimeout(f)}},[l]);const c=N.useCallback(()=>{t!==null&&navigator.clipboard.writeText(t.command).then(()=>{o(!0)},()=>{o(!1)})},[t]),u=N.useCallback(()=>{r(!0)},[]);return{notice:l?t:null,isCopied:s,copy:c,close:u}},uE=[{label:"Agent integration",icon:"agents",link:g.jsx(ri,{to:"/settings/agents"})},{label:"Git integration",icon:"forges",link:g.jsx(ri,{to:"/settings/forges"})},{label:"Prompt configurations",icon:"configurations",link:g.jsx(ri,{to:"/settings/profiles"})},{label:"Repositories",icon:"repositories",link:g.jsx(ri,{to:"/settings/repositories"})},{label:"Review configuration",icon:"review",link:g.jsx(ri,{to:"/settings/review"})}],iX=({logoSrc:e,name:t})=>g.jsx("img",{src:e,alt:t,width:"32",height:"32",className:"size-8"});/**
|
|
68
|
-
* @license lucide-react v1.49.0 - ISC
|
|
69
|
-
*
|
|
70
|
-
* This source code is licensed under the ISC license.
|
|
71
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/const lX=e=>e==null?void 0:e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
73
|
-
* @license lucide-react v1.49.0 - ISC
|
|
74
|
-
*
|
|
75
|
-
* This source code is licensed under the ISC license.
|
|
76
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/function aX(e,t,n=[]){if(t==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:lX(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}/**
|
|
78
|
-
* @license lucide-react v1.49.0 - ISC
|
|
79
|
-
*
|
|
80
|
-
* This source code is licensed under the ISC license.
|
|
81
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/const cX=e=>{let t="",n=!1;for(const r of e){if(r==="-"||r==="_"||r<=" "){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t};/**
|
|
83
|
-
* @license lucide-react v1.49.0 - ISC
|
|
84
|
-
*
|
|
85
|
-
* This source code is licensed under the ISC license.
|
|
86
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/const uX=e=>{const t=cX(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
88
|
-
* @license lucide-react v1.49.0 - ISC
|
|
89
|
-
*
|
|
90
|
-
* This source code is licensed under the ISC license.
|
|
91
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const dE=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
93
|
-
* @license lucide-react v1.49.0 - ISC
|
|
94
|
-
*
|
|
95
|
-
* This source code is licensed under the ISC license.
|
|
96
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const Oc={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
98
|
-
* @license lucide-react v1.49.0 - ISC
|
|
99
|
-
*
|
|
100
|
-
* This source code is licensed under the ISC license.
|
|
101
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/function D1(e){return e!=null}function dX(e,t={}){var y,x;const n=t.attributeNames??{},r=b=>n[b]??b,s=e.size??e.width??Oc.width,o=e.size??e.height??Oc.height,l=((y=e.aliases)==null?void 0:y.filter(b=>typeof b=="string"&&b.trim()!=="").map(b=>`lucide-${b}`))??[],c=[...e.name?[`lucide-${e.name}`]:[],...l],u=((x=t.className)==null?void 0:x.split(" ").filter(Boolean))??[],f=t.includeDefaultClasses===!1?dE(...u):dE("lucide",...c,...u),h=t.absoluteStrokeWidth?Number(t.strokeWidth??Oc["stroke-width"])*Number(e.size??e.width??Oc.width)/Number(t.size??t.width??Oc.width):t.strokeWidth??Oc["stroke-width"];return["svg",{...Object.entries(Oc).reduce((b,[S,E])=>(b[r(S)]=E,b),{}),..."color"in t&&t.color&&{[r("stroke")]:t.color},..."size"in t&&D1(t.size)&&{[r("width")]:t.size,[r("height")]:t.size},..."width"in t&&D1(t.width)&&{[r("width")]:t.width},..."height"in t&&D1(t.height)&&{[r("height")]:t.height},[r("stroke-width")]:h,...f&&{[r("class")]:f},[r("viewBox")]:`0 0 ${s} ${o}`,...t.hasA11yProp===!1?{[r("aria-hidden")]:"true"}:{},..."attributes"in t&&t.attributes},e.node.map(b=>{const[S,E,C]=b,R=t.nonScalingStroke?{[r("vector-effect")]:"non-scaling-stroke",...E}:E;return C?[S,R,C]:[S,R]})]}/**
|
|
103
|
-
* @license lucide-react v1.49.0 - ISC
|
|
104
|
-
*
|
|
105
|
-
* This source code is licensed under the ISC license.
|
|
106
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
-
*/function fX(e,t={}){return dX(e,{...t,attributeNames:{...t.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
|
|
108
|
-
* @license lucide-react v1.49.0 - ISC
|
|
109
|
-
*
|
|
110
|
-
* This source code is licensed under the ISC license.
|
|
111
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/const hX=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},pX=N.createContext({}),mX=()=>N.useContext(pX),gX=N.forwardRef(({color:e,size:t,width:n,height:r,strokeWidth:s,absoluteStrokeWidth:o,nonScalingStroke:l,className:c="",children:u,iconNode:f=[],icon:h={node:f,aliases:[],size:24},...p},y)=>{const{size:x=24,strokeWidth:b=2,absoluteStrokeWidth:S=!1,nonScalingStroke:E=!1,color:C="currentColor",className:R=""}=mX()??{},T=!!u||hX(p),[O,k,M=[]]=fX(h,{color:e??C,width:n??t??x,height:r??t??x,strokeWidth:s??b,absoluteStrokeWidth:o??S,nonScalingStroke:l??E,className:dE(R,c),hasA11yProp:T,attributes:p});return N.createElement(O,{ref:y,...k},[...M.map(([A,L])=>N.createElement(A,L)),...Array.isArray(u)?u:[u]])});/**
|
|
113
|
-
* @license lucide-react v1.49.0 - ISC
|
|
114
|
-
*
|
|
115
|
-
* This source code is licensed under the ISC license.
|
|
116
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/function ct(e,t=[],n=[]){const r=typeof e=="string"?aX(e,t,n):e,s=N.forwardRef(({className:o,...l},c)=>N.createElement(gX,{ref:c,icon:r,className:o,...l}));return r.name&&(s.displayName=uX(r.name)),s}/**
|
|
118
|
-
* @license lucide-react v1.49.0 - ISC
|
|
119
|
-
*
|
|
120
|
-
* This source code is licensed under the ISC license.
|
|
121
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const u3={name:"anchor",size:24,node:[["path",{d:"M12 6v16",key:"nqf5sj"}],["path",{d:"m19 13 2-1a9 9 0 0 1-18 0l2 1",key:"y7qv08"}],["path",{d:"M9 11h6",key:"1fldmi"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}]]};u3.node;const d3=ct(u3);/**
|
|
123
|
-
* @license lucide-react v1.49.0 - ISC
|
|
124
|
-
*
|
|
125
|
-
* This source code is licensed under the ISC license.
|
|
126
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const f3={name:"app-window",size:24,node:[["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}],["path",{d:"M10 4v4",key:"pp8u80"}],["path",{d:"M2 8h20",key:"d11cs7"}],["path",{d:"M6 4v4",key:"1svtjw"}]]};f3.node;const yX=ct(f3);/**
|
|
128
|
-
* @license lucide-react v1.49.0 - ISC
|
|
129
|
-
*
|
|
130
|
-
* This source code is licensed under the ISC license.
|
|
131
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/const h3={name:"arrow-up-down",size:24,node:[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]};h3.node;const xX=ct(h3);/**
|
|
133
|
-
* @license lucide-react v1.49.0 - ISC
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the ISC license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const p3={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};p3.node;const fE=ct(p3);/**
|
|
138
|
-
* @license lucide-react v1.49.0 - ISC
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the ISC license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const m3={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};m3.node;const bX=ct(m3);/**
|
|
143
|
-
* @license lucide-react v1.49.0 - ISC
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the ISC license.
|
|
146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/const g3={name:"braces",size:24,node:[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],aliases:["curly-braces"]};g3.node;const vX=ct(g3);/**
|
|
148
|
-
* @license lucide-react v1.49.0 - ISC
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the ISC license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const y3={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};y3.node;const Su=ct(y3);/**
|
|
153
|
-
* @license lucide-react v1.49.0 - ISC
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the ISC license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/const x3={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};x3.node;const su=ct(x3);/**
|
|
158
|
-
* @license lucide-react v1.49.0 - ISC
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the ISC license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/const b3={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};b3.node;const Ux=ct(b3);/**
|
|
163
|
-
* @license lucide-react v1.49.0 - ISC
|
|
164
|
-
*
|
|
165
|
-
* This source code is licensed under the ISC license.
|
|
166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/const v3={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};v3.node;const S3=ct(v3);/**
|
|
168
|
-
* @license lucide-react v1.49.0 - ISC
|
|
169
|
-
*
|
|
170
|
-
* This source code is licensed under the ISC license.
|
|
171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/const w3={name:"chevrons-down-up",size:24,node:[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]};w3.node;const SX=ct(w3);/**
|
|
173
|
-
* @license lucide-react v1.49.0 - ISC
|
|
174
|
-
*
|
|
175
|
-
* This source code is licensed under the ISC license.
|
|
176
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/const E3={name:"chevrons-up-down",size:24,node:[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]};E3.node;const C3=ct(E3);/**
|
|
178
|
-
* @license lucide-react v1.49.0 - ISC
|
|
179
|
-
*
|
|
180
|
-
* This source code is licensed under the ISC license.
|
|
181
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/const T3={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};T3.node;const wX=ct(T3);/**
|
|
183
|
-
* @license lucide-react v1.49.0 - ISC
|
|
184
|
-
*
|
|
185
|
-
* This source code is licensed under the ISC license.
|
|
186
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
-
*/const N3={name:"circle-dashed",size:24,node:[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]};N3.node;const EX=ct(N3);/**
|
|
188
|
-
* @license lucide-react v1.49.0 - ISC
|
|
189
|
-
*
|
|
190
|
-
* This source code is licensed under the ISC license.
|
|
191
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
-
*/const R3={name:"circle-x",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],aliases:["x-circle"]};R3.node;const CX=ct(R3);/**
|
|
193
|
-
* @license lucide-react v1.49.0 - ISC
|
|
194
|
-
*
|
|
195
|
-
* This source code is licensed under the ISC license.
|
|
196
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
-
*/const O3={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};O3.node;const TX=ct(O3);/**
|
|
198
|
-
* @license lucide-react v1.49.0 - ISC
|
|
199
|
-
*
|
|
200
|
-
* This source code is licensed under the ISC license.
|
|
201
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
-
*/const A3={name:"crosshair",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]};A3.node;const NX=ct(A3);/**
|
|
203
|
-
* @license lucide-react v1.49.0 - ISC
|
|
204
|
-
*
|
|
205
|
-
* This source code is licensed under the ISC license.
|
|
206
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/const k3={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};k3.node;const wd=ct(k3);/**
|
|
208
|
-
* @license lucide-react v1.49.0 - ISC
|
|
209
|
-
*
|
|
210
|
-
* This source code is licensed under the ISC license.
|
|
211
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
-
*/const _3={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};_3.node;const M3=ct(_3);/**
|
|
213
|
-
* @license lucide-react v1.49.0 - ISC
|
|
214
|
-
*
|
|
215
|
-
* This source code is licensed under the ISC license.
|
|
216
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
-
*/const I3={name:"file-text",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};I3.node;const RX=ct(I3);/**
|
|
218
|
-
* @license lucide-react v1.49.0 - ISC
|
|
219
|
-
*
|
|
220
|
-
* This source code is licensed under the ISC license.
|
|
221
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
-
*/const L3={name:"folder-git-2",size:24,node:[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]};L3.node;const OX=ct(L3);/**
|
|
223
|
-
* @license lucide-react v1.49.0 - ISC
|
|
224
|
-
*
|
|
225
|
-
* This source code is licensed under the ISC license.
|
|
226
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
-
*/const D3={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};D3.node;const AX=ct(D3);/**
|
|
228
|
-
* @license lucide-react v1.49.0 - ISC
|
|
229
|
-
*
|
|
230
|
-
* This source code is licensed under the ISC license.
|
|
231
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
-
*/const j3={name:"git-merge",size:24,node:[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]};j3.node;const kX=ct(j3);/**
|
|
233
|
-
* @license lucide-react v1.49.0 - ISC
|
|
234
|
-
*
|
|
235
|
-
* This source code is licensed under the ISC license.
|
|
236
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
-
*/const P3={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};P3.node;const nM=ct(P3);/**
|
|
238
|
-
* @license lucide-react v1.49.0 - ISC
|
|
239
|
-
*
|
|
240
|
-
* This source code is licensed under the ISC license.
|
|
241
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
-
*/const z3={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};z3.node;const _X=ct(z3);/**
|
|
243
|
-
* @license lucide-react v1.49.0 - ISC
|
|
244
|
-
*
|
|
245
|
-
* This source code is licensed under the ISC license.
|
|
246
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
-
*/const B3={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};B3.node;const MX=ct(B3);/**
|
|
248
|
-
* @license lucide-react v1.49.0 - ISC
|
|
249
|
-
*
|
|
250
|
-
* This source code is licensed under the ISC license.
|
|
251
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
-
*/const H3={name:"messages-square",size:24,node:[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]};H3.node;const IX=ct(H3);/**
|
|
253
|
-
* @license lucide-react v1.49.0 - ISC
|
|
254
|
-
*
|
|
255
|
-
* This source code is licensed under the ISC license.
|
|
256
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
-
*/const F3={name:"minimize-2",size:24,node:[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]};F3.node;const LX=ct(F3);/**
|
|
258
|
-
* @license lucide-react v1.49.0 - ISC
|
|
259
|
-
*
|
|
260
|
-
* This source code is licensed under the ISC license.
|
|
261
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
-
*/const $3={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};$3.node;const DX=ct($3);/**
|
|
263
|
-
* @license lucide-react v1.49.0 - ISC
|
|
264
|
-
*
|
|
265
|
-
* This source code is licensed under the ISC license.
|
|
266
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
-
*/const U3={name:"mouse-pointer-click",size:24,node:[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]};U3.node;const rM=ct(U3);/**
|
|
268
|
-
* @license lucide-react v1.49.0 - ISC
|
|
269
|
-
*
|
|
270
|
-
* This source code is licensed under the ISC license.
|
|
271
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
-
*/const V3={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};V3.node;const jX=ct(V3);/**
|
|
273
|
-
* @license lucide-react v1.49.0 - ISC
|
|
274
|
-
*
|
|
275
|
-
* This source code is licensed under the ISC license.
|
|
276
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
-
*/const q3={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};q3.node;const G3=ct(q3);/**
|
|
278
|
-
* @license lucide-react v1.49.0 - ISC
|
|
279
|
-
*
|
|
280
|
-
* This source code is licensed under the ISC license.
|
|
281
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
-
*/const K3={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};K3.node;const k2=ct(K3);/**
|
|
283
|
-
* @license lucide-react v1.49.0 - ISC
|
|
284
|
-
*
|
|
285
|
-
* This source code is licensed under the ISC license.
|
|
286
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
-
*/const Y3={name:"route",size:24,node:[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]};Y3.node;const j1=ct(Y3);/**
|
|
288
|
-
* @license lucide-react v1.49.0 - ISC
|
|
289
|
-
*
|
|
290
|
-
* This source code is licensed under the ISC license.
|
|
291
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
-
*/const W3={name:"settings",size:24,node:[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};W3.node;const X3=ct(W3);/**
|
|
293
|
-
* @license lucide-react v1.49.0 - ISC
|
|
294
|
-
*
|
|
295
|
-
* This source code is licensed under the ISC license.
|
|
296
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
-
*/const Q3={name:"sliders-horizontal",size:24,node:[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]};Q3.node;const Ld=ct(Q3);/**
|
|
298
|
-
* @license lucide-react v1.49.0 - ISC
|
|
299
|
-
*
|
|
300
|
-
* This source code is licensed under the ISC license.
|
|
301
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
-
*/const Z3={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};Z3.node;const PX=ct(Z3);/**
|
|
303
|
-
* @license lucide-react v1.49.0 - ISC
|
|
304
|
-
*
|
|
305
|
-
* This source code is licensed under the ISC license.
|
|
306
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
-
*/const J3={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};J3.node;const _2=ct(J3);/**
|
|
308
|
-
* @license lucide-react v1.49.0 - ISC
|
|
309
|
-
*
|
|
310
|
-
* This source code is licensed under the ISC license.
|
|
311
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
-
*/const e5={name:"triangle-alert",size:24,node:[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],aliases:["alert-triangle"]};e5.node;const zX=ct(e5);/**
|
|
313
|
-
* @license lucide-react v1.49.0 - ISC
|
|
314
|
-
*
|
|
315
|
-
* This source code is licensed under the ISC license.
|
|
316
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
-
*/const t5={name:"user-plus",size:24,node:[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]};t5.node;const BX=ct(t5);/**
|
|
318
|
-
* @license lucide-react v1.49.0 - ISC
|
|
319
|
-
*
|
|
320
|
-
* This source code is licensed under the ISC license.
|
|
321
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
-
*/const n5={name:"workflow",size:24,node:[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]};n5.node;const M2=ct(n5);/**
|
|
323
|
-
* @license lucide-react v1.49.0 - ISC
|
|
324
|
-
*
|
|
325
|
-
* This source code is licensed under the ISC license.
|
|
326
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
-
*/const r5={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};r5.node;const Vx=ct(r5);/**
|
|
328
|
-
* @license lucide-react v1.49.0 - ISC
|
|
329
|
-
*
|
|
330
|
-
* This source code is licensed under the ISC license.
|
|
331
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
-
*/const s5={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};s5.node;const hE=ct(s5);/**
|
|
333
|
-
* @license lucide-react v1.49.0 - ISC
|
|
334
|
-
*
|
|
335
|
-
* This source code is licensed under the ISC license.
|
|
336
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
-
*/const o5={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};o5.node;const HX=ct(o5);/**
|
|
338
|
-
* @license lucide-react v1.49.0 - ISC
|
|
339
|
-
*
|
|
340
|
-
* This source code is licensed under the ISC license.
|
|
341
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
-
*/const i5={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]};i5.node;const FX=ct(i5),l5=N.createContext(void 0);function qx(e){const t=N.useContext(l5);if(t===void 0&&!e)throw new Error(Qt(33));return t}const a5=N.createContext(void 0);function fl(e){const t=N.useContext(a5);if(t===void 0&&!e)throw new Error(Qt(36));return t}const I2="data-starting-style",$X="data-ending-style",UX={[I2]:""},VX={[$X]:""},cm={transitionStatus(e){return e==="starting"?UX:e==="ending"?VX:null}},qX="data-open",GX="data-closed",KX="data-anchor-hidden",c5="data-popup-open",YX="data-pressed",WX={[c5]:""},XX={[c5]:"",[YX]:""},QX={[qX]:""},ZX={[GX]:""},JX={[KX]:""},um={open(e){return e?WX:null}},pE={open(e){return e?XX:null}},Rf={open(e){return e?QX:ZX},anchorHidden(e){return e?JX:null}},dm={...Rf,...cm},eQ=N.createContext(void 0);function L2(e=!0){const t=N.useContext(eQ);if(t===void 0&&!e)throw new Error(Qt(25));return t}const fm="none",ui="trigger-press",wn="trigger-hover",Dd="trigger-focus",D2="outside-press",j2="item-press",u5="close-press",ou="focus-out",hm="escape-key",Rp="list-navigation",tQ="cancel-open",Nd="sibling-open",nQ="disabled",pm="imperative-action";function P2({controlled:e,default:t,name:n,state:r="value"}){const{current:s}=N.useRef(e!==void 0),[o,l]=N.useState(t),c=s&&e!==void 0?e:o,u=N.useCallback(f=>{s||l(f)},[]);return[c,u]}const d5=N.createContext(void 0);function rQ(){const e=N.useContext(d5);if(e===void 0)throw new Error(Qt(30));return e}function sQ(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:oQ,platform:iQ,maxTouchPoints:lQ}=sQ(),Gx=oQ.toLowerCase(),Op=iQ.toLowerCase(),Kx=/^i(os$|p)/.test(Op)||Op==="macintel"&&lQ>1,sM="android",mE=Op===sM||Gx.includes(sM),z2=!Kx&&Op.startsWith("mac");Op.startsWith("win");const aQ=z2||Kx;var RP;const Ka=typeof CSS<"u"&&!!((RP=CSS.supports)!=null&&RP.call(CSS,"-webkit-backdrop-filter:none"));!Ka&&Gx.includes("firefox");!Ka&&Gx.includes("chrom");const f5=aQ,B2=/jsdom|happydom/.test(Gx);function cQ(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:s,store:o,typingRef:l,itemRef:c,itemMetadata:u}=e,{events:f}=o.useState("floatingTreeRoot"),h=o.useState("open"),p=L2(!0),y=p!==void 0;return N.useMemo(()=>({id:r,role:"menuitem",tabIndex:h&&n?0:-1,onKeyDown(x){x.key===" "&&(l!=null&&l.current)&&x.preventDefault()},onMouseMove(x){s&&f.emit("itemhover",{nodeId:s,target:x.currentTarget})},onClick(x){t&&f.emit("close",{domEvent:x,reason:j2})},onMouseUp(x){if(p){const b=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,y&&b&&Math.abs(x.clientX-b.x)<=1&&Math.abs(x.clientY-b.y)<=1||y&&!z2&&x.button===2)return}c.current&&o.context.allowMouseUpTriggerRef.current&&(!y||x.button===2)&&u.type==="regular-item"&&py(c.current,x,{detail:1})}}),[t,n,r,f,s,h,o,l,c,p,y,u])}const h5={type:"regular-item"};function H2(e){const{closeOnClick:t,disabled:n,highlighted:r,id:s,store:o,typingRef:l=o.context.typingRef,nativeButton:c,itemMetadata:u,nodeId:f}=e,h=N.useRef(null),{getButtonProps:p,buttonRef:y}=vu({disabled:n,focusableWhenDisabled:!0,native:c,composite:!0}),x=cQ({closeOnClick:t,highlighted:r,id:s,nodeId:f,store:o,typingRef:l,itemRef:h,itemMetadata:u}),b=N.useCallback(E=>Ji(x,{onMouseEnter(){u.type==="submenu-trigger"&&u.setActive()}},E,p),[x,p,u]),S=za(h,y);return N.useMemo(()=>({getItemProps:b,itemRef:S}),[b,S])}const p5=N.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function uQ(){return N.useContext(p5)}function Yx(e={}){const{guess:t,label:n,metadata:r,textRef:s,index:o}=e,{register:l,unregister:c,subscribeMapChange:u,nextIndexRef:f}=uQ(),h=N.useRef(-1),[p,y]=N.useState(o==null&&t?()=>{if(h.current===-1){const E=f.current;f.current+=1,h.current=E}return h.current}:-1),x=o??p,b=N.useRef(null),S=N.useCallback(E=>{const C=b.current;C&&c(C),b.current=E,E&&l(E,{metadata:r??null,index:o??null,label:n,textRef:s})},[o,l,c,r,n,s]);return Be(()=>{if(o==null)return u(E=>{var R;const C=b.current?(R=E.get(b.current))==null?void 0:R.index:null;C!=null&&y(C)})},[o,u]),{ref:S,index:x}}let oM=0;function dQ(e,t="mui"){const[n,r]=N.useState(e),s=e||n;return N.useEffect(()=>{n==null&&(oM+=1,r(`${t}-${oM}`))},[n,t]),s}const iM=S2.useId;function lf(e,t){if(iM!==void 0){const n=iM();return e??(t?`${t}-${n}`:n)}return dQ(e,t)}function is(e){return lf(e,"base-ui")}const fQ="data-checked",hQ="data-unchecked",m5={checked(e){return e?{[fQ]:""}:{[hQ]:""}},...cm};function ht(e,t,n,r){let s=!1,o=!1;const l=r??hn;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){o=!0},get isCanceled(){return s},get isPropagationAllowed(){return o},trigger:n,...l}}const g5=N.forwardRef(function(t,n){const{render:r,className:s,id:o,label:l,nativeButton:c=!1,disabled:u=!1,closeOnClick:f=!1,checked:h,defaultChecked:p,onCheckedChange:y,style:x,...b}=t,S=Yx({guess:!0,label:l}),E=qx(!0),C=is(o),{store:R}=fl(),T=R.useState("disabled"),O=u||T,k=R.useState("isActive",S.index),M=R.useState("itemProps"),[A,L]=P2({controlled:h,default:p??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:I,itemRef:j}=H2({closeOnClick:f,disabled:O,highlighted:k,id:C,store:R,nativeButton:c,nodeId:E==null?void 0:E.context.nodeId,itemMetadata:h5}),P=N.useMemo(()=>({disabled:O,highlighted:k,checked:A}),[O,k,A]);function B(D){const F=ht(j2,D.nativeEvent,void 0,{preventUnmountOnClose:Fn});y==null||y(!A,F),!F.isCanceled&&L(z=>!z)}const H=It("div",t,{state:P,stateAttributesMapping:m5,props:[M,{role:"menuitemcheckbox","aria-checked":A,onClick:B},b,I],ref:[j,n,S.ref]});return g.jsx(d5.Provider,{value:P,children:H})});function F2(e){N.useEffect(e,Ba)}const T0=null;class pQ{constructor(){Dt(this,"callbacks",[]);Dt(this,"callbacksCount",0);Dt(this,"nextId",1);Dt(this,"startId",1);Dt(this,"isScheduled",!1);Dt(this,"tick",t=>{var s;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)(s=n[o])==null||s.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}}let N0=new pQ;class ys{constructor(){Dt(this,"currentId",T0);Dt(this,"cancel",()=>{this.currentId!==T0&&(N0.cancel(this.currentId),this.currentId=T0)});Dt(this,"disposeEffect",()=>this.cancel)}static create(){return new ys}static request(t){return N0.request(t)}static cancel(t){return N0.cancel(t)}request(t){this.cancel(),this.currentId=N0.request(()=>{this.currentId=T0,t()})}}function Ap(){const e=Or(ys.create).current;return F2(e.disposeEffect),e}function $2(e,t=!1,n=!1,r=!1){const[s,o]=N.useState(e&&t?"idle":void 0),[l,c]=N.useState(e&&!r);return e&&!l&&(c(!0),o("starting")),!e&&l&&s!=="ending"&&!n&&o("ending"),!e&&!l&&s==="ending"&&o(void 0),Be(()=>{if(!e&&l&&s!=="ending"&&n){const u=ys.request(()=>{o("ending")});return()=>{ys.cancel(u)}}},[e,l,s,n]),Be(()=>{if(!e||t)return;const u=ys.request(()=>{o(void 0)});return()=>{ys.cancel(u)}},[t,e]),Be(()=>{if(!e||!t)return;e&&l&&s!=="idle"&&o("starting");const u=ys.request(()=>{o("idle")});return()=>{ys.cancel(u)}},[t,e,l,s]),{mounted:l,setMounted:c,transitionStatus:s}}var Us=FP();const vke=e2(Us);function zi(e){return e==null?e:"current"in e?e.current:e}let R0=null;function mQ(e){if(!R0){const t=[];R0=t,queueMicrotask(()=>{R0=null,Us.flushSync(()=>{for(const n of t)n()})})}R0.push(e)}function mm(e,t=!1,n=!1){const r=Ap();return Ve((s,o=null)=>{r.cancel();const l=zi(e);if(l==null)return;const c=l,u=()=>{if(!n){Us.flushSync(s);return}mQ(()=>{o!=null&&o.aborted||s()})};if(typeof c.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function f(){Promise.all(c.getAnimations().map(h=>h.finished)).then(()=>{o!=null&&o.aborted||u()},()=>{if(o!=null&&o.aborted)return;if(c.getAnimations().some(p=>p.pending||p.playState!=="finished")){f();return}u()})}if(t){const h=I2;if(!c.hasAttribute(h)){r.request(f);return}const p=new MutationObserver(()=>{c.hasAttribute(h)||(p.disconnect(),f())});p.observe(c,{attributes:!0,attributeFilter:[h]}),o==null||o.addEventListener("abort",()=>p.disconnect(),{once:!0});return}r.request(f)})}function Ya(e){const{enabled:t=!0,open:n,ref:r,batch:s=!1,onComplete:o}=e,l=Ve(o),c=mm(r,n,s);N.useEffect(()=>{if(!t)return;const u=new AbortController;return c(l,u.signal),()=>{u.abort()}},[t,n,l,c])}const y5=N.forwardRef(function(t,n){const{render:r,className:s,style:o,keepMounted:l=!1,...c}=t,u=rQ(),f=N.useRef(null),{transitionStatus:h,mounted:p,setMounted:y}=$2(u.checked);Ya({batch:!0,enabled:!u.checked,open:u.checked,ref:f,onComplete(){u.checked||y(!1)}});const x={checked:u.checked,disabled:u.disabled,highlighted:u.highlighted,transitionStatus:h};return It("span",t,{state:x,ref:[n,f],stateAttributesMapping:m5,props:{"aria-hidden":!0,...c},enabled:l||p})}),x5=N.createContext(void 0);function gQ(){const e=N.useContext(x5);if(e===void 0)throw new Error(Qt(31));return e}const yQ=N.forwardRef(function(t,n){const{render:r,className:s,style:o,...l}=t,[c,u]=N.useState(void 0),f=It("div",t,{ref:n,props:{role:"group","aria-labelledby":c,...l}});return g.jsx(x5.Provider,{value:u,children:f})}),xQ=N.forwardRef(function(t,n){const{render:r,className:s,style:o,id:l,...c}=t,u=is(l),f=gQ();return Be(()=>(f(u),()=>{f(h=>h===u?void 0:h)}),[f,u]),It("div",t,{ref:n,props:{id:u,"aria-hidden":!0,...c}})}),b5=N.forwardRef(function(t,n){const{render:r,className:s,id:o,label:l,nativeButton:c=!1,disabled:u=!1,closeOnClick:f=!0,style:h,...p}=t,y=Yx({guess:!0,label:l}),x=qx(!0),b=is(o),{store:S}=fl(),E=S.useState("disabled"),C=u||E,R=S.useState("isActive",y.index),T=S.useState("itemProps"),{getItemProps:O,itemRef:k}=H2({closeOnClick:f,disabled:C,highlighted:R,id:b,store:S,nativeButton:c,nodeId:x==null?void 0:x.context.nodeId,itemMetadata:h5});return It("div",t,{state:{disabled:C,highlighted:R},props:[T,p,O],ref:[k,n,y.ref]})}),Ih=0;class co{constructor(){Dt(this,"currentId",Ih);Dt(this,"clear",()=>{this.currentId!==Ih&&(clearTimeout(this.currentId),this.currentId=Ih)});Dt(this,"disposeEffect",()=>this.clear)}static create(){return new co}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Ih,n()},t)}isStarted(){return this.currentId!==Ih}}function ns(){const e=Or(co.create).current;return F2(e.disposeEffect),e}function Qo(e){e.preventDefault(),e.stopPropagation()}function bQ(e){return"nativeEvent"in e}function U2(e){return e.pointerType===""&&e.isTrusted?!0:mE&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function V2(e){return B2?!1:!mE&&e.width===0&&e.height===0||mE&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Ra(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function vQ(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function es(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function Je(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&of(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Tr(e){return"composedPath"in e?e.composedPath()[0]??e.target:e.target}const gE="data-base-ui-focusable",v5="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Wx="ArrowLeft",Xx="ArrowRight",S5="ArrowUp",q2="ArrowDown",yE="data-trigger-disabled";function Hy(e,t){if(!St(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute(yE);for(const[,r]of t.entries())if(Je(r,n))return!r.hasAttribute(yE);return!1}function P1(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function SQ(e){return e.matches("html,body")}function Qx(e){return Yt(e)&&e.matches(v5)}function wQ(e){return(e==null?void 0:e.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${v5}`))!=null}function xE(e){return e?e.getAttribute("role")==="combobox"&&Qx(e):!1}function EQ(e){if(!e||B2)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function bE(e){return e?e.hasAttribute(gE)?e:e.querySelector(`[${gE}]`)||e:null}function CQ(e,t){return t!=null&&!Ra(t)?0:typeof e=="function"?e():e}function kp(e,t,n){const r=CQ(e,n);return typeof r=="number"?r:r==null?void 0:r[t]}function lM(e){return typeof e=="function"?e():e}function w5(e,t){return t||e==="click"||e==="mousedown"}function TQ(e){return(e==null?void 0:e.includes("mouse"))&&e!=="mousedown"}const NQ=N.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new co,currentIdRef:{current:null},currentContextRef:{current:null}});function RQ(e,t){e.current=t.current}function OQ(e,t={open:!1}){const{open:n}=t,r="rootStore"in e?e.rootStore:e,s=r.useState("floatingId"),o=N.useContext(NQ),{currentIdRef:l,delayRef:c,timeoutMs:u,initialDelayRef:f,currentContextRef:h,hasProvider:p,timeout:y}=o,[x,b]=N.useState(!1),S=N.useRef(n);return Be(()=>{S.current=n},[n]),Be(()=>{function E(){var C;(C=h.current)==null||C.setIsInstantPhase(!1),l.current=null,h.current=null,c.current=f.current,y.clear()}if(l.current&&!n&&l.current===s){if(b(!1),u){const C=s;return y.start(u,()=>{r.select("open")||l.current&&l.current!==C||E()}),()=>{(S.current||l.current!==C)&&y.clear()}}E()}},[n,s,l,c,u,f,h,y,r]),Be(()=>{if(!n)return;const E=h.current,C=l.current;y.clear(),h.current={onOpenChange:r.setOpen,setIsInstantPhase:b},l.current=s,c.current={open:0,close:kp(f.current,"close")},C!==null&&C!==s?(b(!0),E==null||E.setIsInstantPhase(!0),E==null||E.onOpenChange(!1,ht(fm))):(b(!1),E==null||E.setIsInstantPhase(!1))},[n,s,r,l,c,f,h,y]),Be(()=>()=>{if(l.current===s){if(h.current=null,!S.current)return;l.current=null,RQ(c,f),y.clear()}},[h,l,c,s,f,y]),N.useMemo(()=>({activeIdRef:l,hasProvider:p,delayRef:c,isInstantPhase:x}),[l,p,c,x])}function bt(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function ai(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function In(e){const t=Or(AQ,e).current;return t.next=e,Be(t.effect),t}function AQ(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const kQ={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},_Q={...kQ,position:"fixed",top:0,left:0},$a=N.forwardRef(function(t,n){const[r,s]=N.useState();Be(()=>{f5&&Ka&&s("button")},[]);const o={tabIndex:0,role:r};return g.jsx("span",{...t,ref:n,style:_Q,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})}),af=Math.min,el=Math.max,Fy=Math.round,O0=Math.floor,tl=e=>({x:e,y:e}),MQ={left:"right",right:"left",bottom:"top",top:"bottom"};function E5(e,t,n){return el(e,af(t,n))}function Ua(e,t){return typeof e=="function"?e(t):e}function oo(e){return e.split("-")[0]}function al(e){return e.split("-")[1]}function G2(e){return e==="x"?"y":"x"}function K2(e){return e==="y"?"height":"width"}function so(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Y2(e){return G2(so(e))}function IQ(e,t,n){n===void 0&&(n=!1);const r=al(e),s=Y2(e),o=K2(s);let l=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=$y(l)),[l,$y(l)]}function LQ(e){const t=$y(e);return[vE(e),t,vE(t)]}function vE(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const aM=["left","right"],cM=["right","left"],DQ=["top","bottom"],jQ=["bottom","top"];function PQ(e,t,n){switch(e){case"top":case"bottom":return n?t?cM:aM:t?aM:cM;case"left":case"right":return t?DQ:jQ;default:return[]}}function zQ(e,t,n,r){const s=al(e);let o=PQ(oo(e),n==="start",r);return s&&(o=o.map(l=>l+"-"+s),t&&(o=o.concat(o.map(vE)))),o}function $y(e){const t=oo(e);return MQ[t]+e.slice(t.length)}function BQ(e){var t,n,r,s;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(s=e.left)!=null?s:0}}function C5(e){return typeof e!="number"?BQ(e):{top:e,right:e,bottom:e,left:e}}function Uy(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function op(e,t){return t<0||t>=e.length}function by(e,t){return qi(e.current,{disabledIndices:t})}function SE(e,t){return qi(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function qi(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:s=1}={}){let o=t;do o+=n?-s:s;while(o>=0&&o<=e.length-1&&jd(e,o,r));return o}function jd(e,t,n){if(typeof n=="function"?n(t):(n==null?void 0:n.includes(t))??!1)return!0;const s=e[t];return s?!Zx(s)||s.matches(":disabled")?!0:!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!1}function HQ(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Zx(e,t=e?$s(e):null){return!e||!e.isConnected||!t||HQ(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const FQ='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function $Q(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return of(n)?n.host:null}function wE(e){for(const t of Array.from(e.children))if(Rr(t)==="summary")return t;return null}function UQ(e,t){const n=wE(t);return!!n&&(e===n||Je(n,e))}function T5(e){const t=e?Rr(e):"";return e!=null&&e.matches(FQ)&&(t!=="summary"||e.parentElement!=null&&Rr(e.parentElement)==="details"&&wE(e.parentElement)===e)&&(t!=="details"||wE(e)==null)&&(t!=="input"||e.type!=="hidden")}function N5(e){if(!T5(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=$Q(t)){const n=t!==e,r=Rr(t)==="slot";if(t.hasAttribute("inert")||n&&Rr(t)==="details"&&!t.open&&!UQ(e,t)||t.hasAttribute("hidden")||!r&&!VQ(t,n))return!1}return!0}function VQ(e,t){const n=$s(e);return t?n.display!=="none":Zx(e,n)}function R5(e){const t=e.tabIndex;if(t<0){const n=Rr(e);if(n==="details"||n==="audio"||n==="video"||Yt(e)&&e.isContentEditable)return 0}return t}function z1(e){if(Rr(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function qQ(e,t){const n=z1(e);if(!n)return!0;const r=t.find(s=>{const o=z1(s);return(o==null?void 0:o.name)===n.name&&o.form===n.form&&o.checked});return r?r===n:t.find(s=>{const o=z1(s);return(o==null?void 0:o.name)===n.name&&o.form===n.form})===n}function O5(e){if(Yt(e)&&Rr(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Yt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function A5(e,t){O5(e).forEach(n=>{T5(n)&&t.push(n),A5(n,t)})}function k5(e,t,n){O5(e).forEach(r=>{Yt(r)&&r.matches(t)&&n.push(r),k5(r,t,n)})}function W2(e){return N5(e)&&R5(e)>=0}function _5(e){const t=[];return A5(e,t),t.filter(N5)}function gm(e){const t=_5(e);return t.filter(n=>R5(n)>=0&&qQ(n,t))}function M5(e,t){const n=gm(e),r=n.length;if(r===0)return;const s=es(jt(e)),o=n.indexOf(s),l=o===-1?t===1?0:r-1:o+t;return n[l]}function X2(e){return M5(jt(e).body,1)||e}function I5(e){return M5(jt(e).body,-1)||e}function L5(e,t){if(!e)return null;const n=gm(jt(e).body),r=n.length;if(r===0)return null;const s=n.indexOf(e);if(s===-1)return null;const o=(s+t+r)%r;return n[o]}function GQ(e){return L5(e,1)}function KQ(e){return L5(e,-1)}function Pd(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Je(n,r)}function YQ(e){gm(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function uM(e){const t=[];k5(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Va(e,t,n=!0){return e.filter(s=>s.parentId===t).flatMap(s=>{var o;return[...!n||(o=s.context)!=null&&o.open?[s]:[],...Va(e,s.id,n)]})}function dM(e,t){var s;let n=[],r=(s=e.find(o=>o.id===t))==null?void 0:s.parentId;for(;r;){const o=e.find(l=>l.id===r);r=o==null?void 0:o.parentId,o&&(n=n.concat(o))}return n}function _p(e){return`data-base-ui-${e}`}let A0=0;function vy(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:s}=t;cancelAnimationFrame(A0);function o(){s&&!s()||e==null||e.focus({preventScroll:n})}if(r)return o(),Fn;const l=requestAnimationFrame(o);return A0=l,()=>{A0===l&&(cancelAnimationFrame(l),A0=0)}}const B1={inert:new WeakMap,"aria-hidden":new WeakMap},fM="data-base-ui-inert",EE={inert:new WeakSet,"aria-hidden":new WeakSet};let Lh=new WeakMap,H1=0;function WQ(e){return EE[e]}function D5(e){return e?of(e)?e.host:D5(e.parentNode):null}const hM=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=D5(n);return e.contains(r)?r:null}).filter(n=>n!=null),pM=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},mM=(e,t,n)=>{const r=[],s=o=>{!o||n.has(o)||Array.from(o.children).forEach(l=>{Rr(l)!=="script"&&(t.has(l)?s(l):r.push(l))})};return s(e),r};function XQ(e,t,n,r,{mark:s=!0}){let o=null;r?o="inert":n&&(o="aria-hidden");let l=null,c=null;const u=hM(t,e),f=s?mM(t,pM(u),new Set(u)):[],h=[],p=[];if(o){const y=B1[o],x=WQ(o);c=x,l=y;const b=hM(t,Array.from(t.querySelectorAll("[aria-live]"))),S=u.concat(b);mM(t,pM(S),new Set(S)).forEach(C=>{const R=C.getAttribute(o),T=R!==null&&R!=="false",O=(y.get(C)||0)+1;y.set(C,O),h.push(C),O===1&&T&&x.add(C),T||C.setAttribute(o,o==="inert"?"":"true")})}return s&&f.forEach(y=>{const x=(Lh.get(y)||0)+1;Lh.set(y,x),p.push(y),x===1&&y.setAttribute(fM,"")}),H1+=1,()=>{l&&h.forEach(y=>{const b=(l.get(y)||0)-1;l.set(y,b),b||(!(c!=null&&c.has(y))&&o&&y.removeAttribute(o),c==null||c.delete(y))}),s&&p.forEach(y=>{const x=(Lh.get(y)||0)-1;Lh.set(y,x),x||y.removeAttribute(fM)}),H1-=1,H1||(B1.inert=new WeakMap,B1["aria-hidden"]=new WeakMap,EE.inert=new WeakSet,EE["aria-hidden"]=new WeakSet,Lh=new WeakMap)}}function gM(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:s=!0}=t,o=jt(e[0]).body;return XQ(e,o,n,r,{mark:s})}const QQ=500,j5=500,ZQ={style:{transition:"none"}},Q2="data-base-ui-click-trigger",JQ={fallbackAxisSide:"none"},Jx={fallbackAxisSide:"end"},eZ={clipPath:"inset(50%)",position:"fixed",top:0,left:0},P5=N.createContext(null),z5=()=>N.useContext(P5),tZ=_p("portal");function B5(e={}){const{ref:t,container:n,componentProps:r=hn,elementProps:s}=e,o=lf(),l=z5(),c=l==null?void 0:l.portalNode,[u,f]=N.useState(null),[h,p]=N.useState(null),y=Ve(E=>{E!==null&&p(E)}),x=N.useRef(null);Be(()=>{if(n===null){x.current&&(x.current=null,p(null),f(null));return}const E=(n&&(x2(n)?n:n.current))??c??document.body;if(E==null){x.current&&(x.current=null,p(null),f(null));return}x.current!==E&&(x.current=E,p(null),f(E))},[n,c]);const b=It("div",r,{ref:[t,y],props:[{id:o,[tZ]:""},s]}),S=u&&b?Us.createPortal(b,u):null;return{node:h,nodeId:N.isValidElement(b)?b.props.id:void 0,subtree:S}}const Z2=N.forwardRef(function(t,n){const{render:r,className:s,style:o,children:l,container:c,portalOwnerRole:u,...f}=t,{node:h,nodeId:p,subtree:y}=B5({container:c,ref:n,componentProps:t,elementProps:f}),x=N.useRef(null),b=N.useRef(null),S=N.useRef(null),E=N.useRef(null),[C,R]=N.useState(null),T=N.useRef(!1),O=C==null?void 0:C.modal,k=C==null?void 0:C.open,M=!!C&&!C.modal&&C.open&&!!h;N.useEffect(()=>{if(!h||O)return;function L(I){h&&I.relatedTarget&&Pd(I)&&(I.type==="focusin"?T.current&&(uM(h),T.current=!1):(YQ(h),T.current=!0))}return ai(bt(h,"focusin",L,!0),bt(h,"focusout",L,!0))},[h,O]),Be(()=>{!h||k!==!0||!T.current||(uM(h),T.current=!1)},[k,h]);const A=N.useMemo(()=>({beforeOutsideRef:x,afterOutsideRef:b,beforeInsideRef:S,afterInsideRef:E,portalNode:h,setFocusManagerState:R}),[h]);return g.jsxs(N.Fragment,{children:[y,g.jsxs(P5.Provider,{value:A,children:[M&&h&&g.jsx($a,{"data-type":"outside",ref:x,onFocus:L=>{var I;if(Pd(L,h))(I=S.current)==null||I.focus();else{const j=C?C.domReference:null,P=I5(j);P==null||P.focus()}}}),M&&h&&g.jsx("span",{role:u,"aria-owns":p,style:eZ}),h&&Us.createPortal(l,h),M&&h&&g.jsx($a,{"data-type":"outside",ref:b,onFocus:L=>{var I;if(Pd(L,h))(I=E.current)==null||I.focus();else{const j=C?C.domReference:null,P=X2(j);P==null||P.focus(),C!=null&&C.closeOnFocusOut&&(C==null||C.onOpenChange(!1,ht(ou,L.nativeEvent)))}}})]})]})});function H5(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}class J2{constructor(){Dt(this,"nodesRef",{current:[]});Dt(this,"events",H5())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const F5=N.createContext(null),$5=N.createContext(null),wu=()=>{var e;return((e=N.useContext(F5))==null?void 0:e.id)||null},hl=e=>{const t=N.useContext($5);return e??t};function ym(e){const t=lf(),n=hl(e),r=wu();return Be(()=>{if(!t)return;const s={id:t,parentId:r};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,r]),t}function eb(e){const{children:t,id:n}=e,r=wu();return g.jsx(F5.Provider,{value:N.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function tb(e){const{children:t,externalTree:n}=e,r=Or(()=>n??new J2).current;return g.jsx($5.Provider,{value:r,children:t})}function nZ(e,t){const n=pn(Tr(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const yM=20;let wa=[];function eT(){wa=wa.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function xM(e){eT(),e&&Rr(e)!=="body"&&(wa.push(new WeakRef(e)),wa.length>yM&&(wa=wa.slice(-yM)))}function bM(){var e;return eT(),(e=wa[wa.length-1])==null?void 0:e.deref()}function rZ(e){return e?W2(e)?e:gm(e)[0]||e:null}function vM(e){var s;if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!((s=e.getAttribute("role"))!=null&&s.includes("dialog")))return;const n=_5(e).filter(o=>{const l=o.getAttribute("data-tabindex")||"";return W2(o)||o.hasAttribute("data-tabindex")&&!l.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function tT(e){const{context:t,children:n,disabled:r=!1,initialFocus:s=!0,returnFocus:o=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:f="",nextFocusableElement:h,previousFocusableElement:p,beforeContentFocusGuardRef:y,externalTree:x,getInsideElements:b}=e,S="rootStore"in t?t.rootStore:t,E=S.useState("open"),C=S.useState("domReferenceElement"),R=S.useState("floatingElement"),{events:T,dataRef:O}=S.context,k=Ve(()=>{var le;return(le=O.current.floatingContext)==null?void 0:le.nodeId}),M=s===!1,A=xE(C)&&M,L=In(s),I=In(o),j=In(f),P=In(E),B=hl(x),H=z5(),D=N.useRef(!1),F=N.useRef(!1),z=N.useRef(!1),q=N.useRef(null),V=N.useRef(""),G=N.useRef(""),K=N.useRef(null),X=N.useRef(null),ee=za(K,y,H==null?void 0:H.beforeInsideRef),ae=za(X,H==null?void 0:H.afterInsideRef),$=ns(),Y=ns(),J=Ap(),ne=H!=null,W=bE(R),ce=Ve((le=W)=>le?gm(le):[]),ye=Ve(()=>(b==null?void 0:b().filter(le=>le!=null))??[]);N.useEffect(()=>{if(r||!c)return;function le(he){he.key==="Tab"&&Je(W,es(jt(W)))&&ce().length===0&&!A&&Qo(he)}const re=jt(W);return bt(re,"keydown",le)},[r,W,c,A,ce]),N.useEffect(()=>{if(r||!E)return;const le=jt(W);function re(){z.current=!1}function he(_e){const be=Tr(_e),Ae=ye(),Me=Je(R,be)||Je(C,be)||Je(H==null?void 0:H.portalNode,be)||Ae.some(Le=>Le===be||Je(Le,be));z.current=!Me,G.current=_e.pointerType||"keyboard",be!=null&&be.closest(`[${Q2}]`)&&(F.current=!0,Y.start(0,()=>{F.current=!1}))}function Se(){G.current="keyboard"}return ai(bt(le,"pointerdown",he,!0),bt(le,"pointerup",re,!0),bt(le,"pointercancel",re,!0),bt(le,"keydown",Se,!0),re)},[r,R,C,W,E,H,Y,ye]),N.useEffect(()=>{if(r||!u)return;const le=jt(W);function re(){F.current=!0,Y.start(0,()=>{F.current=!1})}function he(Ae){const Me=Tr(Ae);W2(Me)&&(q.current=Me)}function Se(Ae){const Me=Ae.relatedTarget,Le=Ae.currentTarget,ue=Tr(Ae);c&&Me==null&&ue!=null&&Je(R,ue)&&xM(ue),queueMicrotask(()=>{const Re=k(),ze=S.context.triggerElements,ke=ye(),je=(Me==null?void 0:Me.hasAttribute(_p("focus-guard")))&&[K.current,X.current,H==null?void 0:H.beforeInsideRef.current,H==null?void 0:H.afterInsideRef.current,H==null?void 0:H.beforeOutsideRef.current,H==null?void 0:H.afterOutsideRef.current,zi(p),zi(h)].includes(Me),Ne=!(Je(C,Me)||Je(R,Me)||Je(Me,R)||Je(H==null?void 0:H.portalNode,Me)||ke.some(ve=>ve===Me||Je(ve,Me))||ze.hasMatchingElement(ve=>Je(ve,Me))||je||B&&(Va(B.nodesRef.current,Re).find(ve=>{var Fe,Ye;return Je((Fe=ve.context)==null?void 0:Fe.elements.floating,Me)||Je((Ye=ve.context)==null?void 0:Ye.elements.domReference,Me)})||dM(B.nodesRef.current,Re).find(ve=>{var Fe,Ye,xt;return[(Fe=ve.context)==null?void 0:Fe.elements.floating,bE((Ye=ve.context)==null?void 0:Ye.elements.floating)].includes(Me)||((xt=ve.context)==null?void 0:xt.elements.domReference)===Me})));if(Le===C&&W&&vM(W),l&&Le!==C&&!Zx(ue)&&es(le)===le.body){if(Yt(W)&&(W.focus(),l==="popup")){J.request(()=>{W.focus()});return}const ve=ce(),Fe=q.current,Ye=(Fe&&ve.includes(Fe)?Fe:null)||ve[ve.length-1]||W;Yt(Ye)&&Ye.focus()}if(O.current.insideReactTree){O.current.insideReactTree=!1;return}(A||!c)&&Me&&Ne&&!F.current&&(A||Me!==bM())&&(D.current=!0,S.setOpen(!1,ht(ou,Ae)))})}function _e(){z.current||(O.current.insideReactTree=!0,$.start(0,()=>{O.current.insideReactTree=!1}))}const be=Yt(C)?C:null;if(!(!R&&!be))return ai(be&&bt(be,"focusout",Se),be&&bt(be,"pointerdown",re),R&&bt(R,"focusin",he),R&&bt(R,"focusout",Se),R&&H&&bt(R,"focusout",_e,!0))},[r,C,R,W,c,B,H,S,u,l,ce,A,k,O,$,Y,J,h,p,ye]),N.useEffect(()=>{var Le,ue,Re;if(r||!R||!E)return;const le=Array.from(((Le=H==null?void 0:H.portalNode)==null?void 0:Le.querySelectorAll(`[${_p("portal")}]`))||[]),he=(Re=(ue=(B?dM(B.nodesRef.current,k()):[]).find(ze=>{var ke;return xE(((ke=ze.context)==null?void 0:ke.elements.domReference)||null)}))==null?void 0:ue.context)==null?void 0:Re.elements.domReference,_e=[...[R,...le,K.current,X.current,H==null?void 0:H.beforeOutsideRef.current,H==null?void 0:H.afterOutsideRef.current,...ye()],he,zi(p),zi(h),A?C:null].filter(ze=>ze!=null),be=gM(_e,{ariaHidden:c||A,mark:!1}),Ae=[R,...le].filter(ze=>ze!=null),Me=gM(Ae);return()=>{Me(),be()}},[E,r,C,R,c,H,A,B,k,h,p,ye]),Be(()=>{if(!E||r||!Yt(W))return;V.current="",G.current="";const le=jt(W),re=es(le);queueMicrotask(()=>{const he=L.current,Se=typeof he=="function"?he(j.current||""):he;if(Se===void 0||Se===!1||Je(W,re))return;let be=null;const Ae=()=>(be==null&&(be=ce(W)),be[0]||W);let Me;Se===!0||Se===null?Me=Ae():Me=zi(Se),Me=Me||Ae();const Le=Je(W,es(le));vy(Me,{preventScroll:Me===W,shouldFocus(){if(!P.current)return!1;if(Le)return!0;const ue=es(le);return!(ue!==Me&&Je(W,ue))}})})},[r,E,W,ce,L,j,P]),Be(()=>{if(r||!W)return;const le=jt(W),re=es(le),he=j.current==null;xM(re);function Se(be){if(be.open||(V.current=nZ(be.nativeEvent,G.current)),be.reason===wn&&be.nativeEvent.type==="mouseleave"&&(D.current=!0),be.reason===D2)if(be.nested)D.current=!1;else if(U2(be.nativeEvent)||V2(be.nativeEvent))D.current=!1;else{let Ae=!1;jt(W).createElement("div").focus({get preventScroll(){return Ae=!0,!1}}),Ae?D.current=!1:D.current=!0}}T.on("openchange",Se);function _e(be){const Ae=I.current;let Me=typeof Ae=="function"?Ae(be):Ae;if(Me===void 0||Me===!1)return null;Me===null&&(Me=!0);const Le=C!=null&&C.isConnected?C:null,ue=re!=null&&re.isConnected&&Rr(re)!=="body"?re:null;let Re=he?ue||Le:Le||ue;return Re||(Re=bM()||null),typeof Me=="boolean"?Re:zi(Me)||Re||null}return()=>{T.off("openchange",Se);const be=es(le),Ae=ye(),Me=Je(R,be)||Ae.some(ze=>ze===be||Je(ze,be))||B&&Va(B.nodesRef.current,k(),!1).some(ze=>{var ke;return Je((ke=ze.context)==null?void 0:ke.elements.floating,be)}),Le=I.current,ue=V.current,Re=_e(ue);queueMicrotask(()=>{const ze=rZ(Re),ke=typeof Le!="boolean";if(Le&&!D.current&&Yt(ze)&&(!(!ke&&ze!==be&&be!==le.body)||Me)){const je={preventScroll:!0};ue==="keyboard"&&(je.focusVisible=!0),ze.focus(je)}D.current=!1})}},[r,R,W,I,j,T,B,C,k,ye]),Be(()=>{if(!Ka||E||!R)return;const le=es(jt(R));!Yt(le)||!Qx(le)||Je(R,le)&&le.blur()},[E,R]),Be(()=>{if(!(r||!H))return H.setFocusManagerState({modal:c,closeOnFocusOut:u,open:E,onOpenChange:S.setOpen,domReference:C}),()=>{H.setFocusManagerState(null)}},[r,H,c,E,S,u,C]),Be(()=>{if(!(r||!W))return vM(W),()=>{queueMicrotask(eT)}},[r,W]);const pe=!r&&(c?!A:!0)&&(ne||c);return g.jsxs(N.Fragment,{children:[pe&&g.jsx($a,{"data-type":"inside",ref:ee,onFocus:le=>{var re;if(c){const he=ce();vy(he[he.length-1])}else if(H!=null&&H.portalNode)if(D.current=!1,Pd(le,H.portalNode)){const he=X2(C);he==null||he.focus()}else(re=zi(p??H.beforeOutsideRef))==null||re.focus()}}),n,pe&&g.jsx($a,{"data-type":"inside",ref:ae,onFocus:le=>{var re;if(c)vy(ce()[0]);else if(H!=null&&H.portalNode)if(u&&(D.current=!0),Pd(le,H.portalNode)){const he=I5(C);he==null||he.focus()}else(re=zi(h??H.afterOutsideRef))==null||re.focus()}})]})}function nb(e,t={}){const{enabled:n=!0,event:r="click",toggle:s=!0,ignoreMouse:o=!1,stickIfOpen:l=!0,touchOpenDelay:c=0,reason:u=ui}=t,f="rootStore"in e?e.rootStore:e,h=f.context.dataRef,p=N.useRef(void 0),y=Ap(),x=ns(),b=N.useMemo(()=>{function S(C,R,T,O){const k=ht(u,R,T);C&&O==="touch"&&c>0?x.start(c,()=>{f.setOpen(!0,k)}):f.setOpen(C,k)}function E(C,R,T){const O=h.current.openEvent,k=f.select("domReferenceElement")!==R;return C&&k||!C||!s?!0:O&&l?!T(O.type):!1}return{onPointerDown(C){p.current=Ra(C.pointerType,!0)&&V2(C.nativeEvent)?"virtual":C.pointerType},onMouseDown(C){const R=p.current,T=C.nativeEvent,O=f.select("open");if(C.button!==0||r==="click"||Ra(R,!0)&&o)return;const k=E(O,C.currentTarget,L=>L==="click"||L==="mousedown"),M=Tr(T);if(Qx(M)){S(k,T,M,R);return}const A=C.currentTarget;y.request(()=>{S(k,T,A,R)})},onClick(C){if(r==="mousedown-only")return;const R=p.current;if(r==="mousedown"&&R){p.current=void 0;return}if(Ra(R,!0)&&o)return;const T=f.select("open"),O=E(T,C.currentTarget,k=>k==="click"||k==="mousedown"||k==="keydown"||k==="keyup");S(O,C.nativeEvent,C.currentTarget,R)},onKeyDown(){p.current=void 0}}},[h,r,o,u,f,l,s,y,x,c]);return N.useMemo(()=>n?{reference:b}:hn,[n,b])}function sZ(e,t){let n=null,r=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){var x;const o=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",u=["mouseenter","mousemove"].includes(((x=t.dataRef.current.openEvent)==null?void 0:x.type)||"")&&t.pointerType!=="touch";let f=o.width,h=o.height,p=o.x,y=o.y;return n==null&&t.x&&l&&(n=o.x-t.x),r==null&&t.y&&c&&(r=o.y-t.y),p-=n||0,y-=r||0,f=0,h=0,!s||u?(f=t.axis==="y"?o.width:0,h=t.axis==="x"?o.height:0,p=l&&t.x!=null?t.x:p,y=c&&t.y!=null?t.y:y):s&&!u&&(h=t.axis==="x"?o.height:h,f=t.axis==="y"?o.width:f),s=!0,{width:f,height:h,x:p,y,top:y,right:p+f,bottom:y+h,left:p}}}}function SM(e){return e!=null&&e.clientX!=null}function oZ(e,t={}){const{enabled:n=!0,axis:r="both"}=t,s="rootStore"in e?e.rootStore:e,o=s.useState("open"),l=s.useState("floatingElement"),c=s.useState("domReferenceElement"),u=s.context.dataRef,f=N.useRef(!1),h=N.useRef(null),[p,y]=N.useState(),[x,b]=N.useState([]),S=Ve(O=>{s.set("positionReference",O)}),E=Ve((O,k,M)=>{f.current||u.current.openEvent&&!SM(u.current.openEvent)||s.set("positionReference",sZ(M??c,{x:O,y:k,axis:r,dataRef:u,pointerType:p}))}),C=Ve(O=>{o?h.current||(E(O.clientX,O.clientY,O.currentTarget),b([])):E(O.clientX,O.clientY,O.currentTarget)}),R=Ra(p)?l:o;N.useEffect(()=>{if(!n){S(c);return}if(!R)return;function O(){var A;(A=h.current)==null||A.call(h),h.current=null}const k=pn(l);function M(A){const L=Tr(A);Je(l,L)?O():E(A.clientX,A.clientY)}return!u.current.openEvent||SM(u.current.openEvent)?h.current=bt(k,"mousemove",M):S(c),O},[R,n,l,u,c,s,E,S,x]),N.useEffect(()=>()=>{s.set("positionReference",null)},[s]),N.useEffect(()=>{n&&!l&&(f.current=!1)},[n,l]),N.useEffect(()=>{!n&&o&&(f.current=!0)},[n,o]);const T=N.useMemo(()=>{function O(k){y(k.pointerType)}return{onPointerDown:O,onPointerEnter:O,onMouseMove:C,onMouseEnter:C}},[C]);return N.useMemo(()=>n?{reference:T,trigger:T}:{},[n,T])}function iZ(){return!1}function lZ(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function xm(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:s=!0,outsidePressEvent:o="sloppy",referencePress:l=iZ,bubbles:c,externalTree:u}=t,f="rootStore"in e?e.rootStore:e,h=f.useState("open"),p=f.useState("floatingElement"),{dataRef:y,events:x}=f.context,b=hl(u),S=Ve(typeof s=="function"?s:()=>!1),E=typeof s=="function"?S:s,C=E!==!1,R=Ve(()=>o),{escapeKey:T,outsidePress:O}=lZ(c),k=N.useRef(!1),M=N.useRef(!1),A=N.useRef(!1),L=N.useRef(!1),I=N.useRef(!1),j=N.useRef(""),P=N.useRef(null),B=ns(),H=ns(),D=Ve(()=>{H.clear(),y.current.insideReactTree=!1}),F=Ve($=>{var ne;const Y=(ne=y.current.floatingContext)==null?void 0:ne.nodeId;return(b?Va(b.nodesRef.current,Y):[]).some(W=>{var ce;return((ce=W.context)==null?void 0:ce.open)&&!W.context.dataRef.current[$]})}),z=Ve($=>P1($,f.select("floatingElement"))||P1($,f.select("domReferenceElement"))),q=Ve($=>{l()&&f.setOpen(!1,ht(ui,$.nativeEvent))}),V=Ve($=>{if(!h||!n||!r||$.key!=="Escape"||I.current||!T&&F("__escapeKeyBubbles"))return;const Y=bQ($)?$.nativeEvent:$,J=ht(hm,Y);f.setOpen(!1,J),J.isCanceled||$.preventDefault(),!T&&!J.isPropagationAllowed&&$.stopPropagation()}),G=Ve(()=>{y.current.insideReactTree=!0,H.start(0,D)}),K=Ve($=>{if(!h||!n||$.button!==0)return;const Y=Tr($.nativeEvent);Je(f.select("floatingElement"),Y)&&(k.current||(k.current=!0,M.current=!1))}),X=Ve($=>{!h||!n||($.defaultPrevented||$.nativeEvent.defaultPrevented)&&k.current&&(M.current=!0)});N.useEffect(()=>{function $(Y){Y.open||(L.current=!1)}return x.on("openchange",$),()=>{x.off("openchange",$)}},[x]),N.useEffect(()=>{if(!h||!n)return h||(L.current=!1),D;y.current.__escapeKeyBubbles=T,y.current.__outsidePressBubbles=O;const $=new co,Y=new co,J=jt(p);function ne(){$.clear(),I.current=!0}function W(){$.start(Ka?5:0,()=>{I.current=!1})}function ce(){A.current=!0,Y.start(0,()=>{A.current=!1})}function ye(){k.current=!1,M.current=!1}function pe(){const Ne=j.current,ve=Ne==="pen"||!Ne?"mouse":Ne,Fe=R(),Ye=typeof Fe=="function"?Fe():Fe;return typeof Ye=="string"?Ye:Ye[ve]}function le(Ne){const ve=pe();return ve==="intentional"&&Ne.type!=="click"||ve==="sloppy"&&Ne.type==="click"}function re(Ne){var Ye;const ve=(Ye=y.current.floatingContext)==null?void 0:Ye.nodeId,Fe=b&&Va(b.nodesRef.current,ve).some(xt=>{var nn;return P1(Ne,(nn=xt.context)==null?void 0:nn.elements.floating)});return z(Ne)||Fe}function he(Ne){if(le(Ne)){Ne.type!=="click"&&!z(Ne)&&(Y.clear(),A.current=!1),D();return}if(y.current.insideReactTree){D();return}const ve=Tr(Ne),Fe=`[${_p("inert")}]`,Ye=St(ve)?ve.getRootNode():null,xt=Array.from((of(Ye)?Ye:jt(f.select("floatingElement"))).querySelectorAll(Fe)),nn=f.context.triggerElements;if(ve&&(nn.hasElement(ve)||nn.hasMatchingElement(De=>Je(De,ve))))return;let Ce=St(ve)?ve:null;for(;Ce&&!Zi(Ce);){const De=ll(Ce);if(Zi(De)||!St(De))break;Ce=De}if(!(xt.length&&St(ve)&&!SQ(ve)&&!Je(ve,f.select("floatingElement"))&&xt.every(De=>!Je(Ce,De)))){if(Yt(ve)&&!("touches"in Ne)){const De=Zi(ve),tt=$s(ve),Ot=/auto|scroll/,gn=De||Ot.test(tt.overflowX),yn=De||Ot.test(tt.overflowY),Fr=gn&&ve.clientWidth>0&&ve.scrollWidth>ve.clientWidth,cn=yn&&ve.clientHeight>0&&ve.scrollHeight>ve.clientHeight,ar=tt.direction==="rtl",$r=cn&&(ar?Ne.offsetX<=ve.offsetWidth-ve.clientWidth:Ne.offsetX>ve.clientWidth),Es=Fr&&Ne.offsetY>ve.clientHeight;if($r||Es)return}if(!re(Ne)){if(pe()==="intentional"){if(Ne.detail!==0&&!U2(Ne)&&!L.current)return;if(A.current){Y.clear(),A.current=!1;return}}typeof E=="function"&&!E(Ne)||F("__outsidePressBubbles")||(f.setOpen(!1,ht(D2,Ne)),D())}}}function Se(Ne){pe()!=="sloppy"||Ne.pointerType==="touch"||!f.select("open")||!n||z(Ne)||he(Ne)}function _e(Ne){if(pe()!=="sloppy"||!f.select("open")||!n||z(Ne))return;const ve=Ne.touches[0];ve&&(P.current={startTime:Date.now(),startX:ve.clientX,startY:ve.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},B.start(1e3,()=>{P.current&&(P.current.dismissOnTouchEnd=!1,P.current.dismissOnMouseDown=!1)}))}function be(Ne,ve){const Fe=Tr(Ne);if(!Fe)return;const Ye=bt(Fe,Ne.type,()=>{ve(Ne),Ye()})}function Ae(Ne){j.current="touch",be(Ne,_e)}function Me(Ne){B.clear(),Ne.type==="pointerdown"&&(Ne.button===0&&(L.current=!0),j.current=Ne.pointerType),!(Ne.type==="mousedown"&&P.current&&!P.current.dismissOnMouseDown)&&be(Ne,ve=>{ve.type==="pointerdown"?Se(ve):he(ve)})}function Le(Ne){if(Ne.type==="pointercancel"&&(L.current=!1),!k.current)return;const ve=M.current;if(ye(),pe()==="intentional"){if(Ne.type==="pointercancel"){ve&&ce();return}if(!re(Ne)){if(ve){ce();return}typeof E=="function"&&!E(Ne)||(Y.clear(),A.current=!0,D())}}}function ue(Ne){if(pe()!=="sloppy"||!P.current||z(Ne))return;const ve=Ne.touches[0];if(!ve)return;const Fe=Math.abs(ve.clientX-P.current.startX),Ye=Math.abs(ve.clientY-P.current.startY),xt=Math.sqrt(Fe*Fe+Ye*Ye);xt>5&&(P.current.dismissOnTouchEnd=!0),xt>10&&(he(Ne),B.clear(),P.current=null)}function Re(Ne){be(Ne,ue)}function ze(Ne){pe()!=="sloppy"||!P.current||z(Ne)||(P.current.dismissOnTouchEnd&&he(Ne),B.clear(),P.current=null)}function ke(Ne){be(Ne,ze)}const je=ai(r&&ai(bt(J,"keydown",V),bt(J,"compositionstart",ne),bt(J,"compositionend",W)),C&&ai(bt(J,"click",Me,!0),bt(J,"pointerdown",Me,!0),bt(J,"pointerup",Le,!0),bt(J,"pointercancel",Le,!0),bt(J,"mousedown",Me,!0),bt(J,"mouseup",Le,!0),bt(J,"touchstart",Ae,{capture:!0,passive:!0}),bt(J,"touchmove",Re,{capture:!0,passive:!0}),bt(J,"touchend",ke,{capture:!0,passive:!0})));return()=>{je(),$.clear(),Y.clear(),ye(),A.current=!1,D()}},[y,p,r,C,E,h,n,T,O,V,D,R,F,z,b,f,B]);const ee=N.useMemo(()=>({onKeyDown:V,onPointerDown:q,onClick:q}),[V,q]),ae=N.useMemo(()=>({onKeyDown:V,onPointerDown:X,onMouseDown:X,onClickCapture:G,onMouseDownCapture($){G(),K($)},onPointerDownCapture($){G(),K($)},onMouseUpCapture:G,onTouchEndCapture:G,onTouchMoveCapture:G}),[V,G,K,X]);return N.useMemo(()=>n?{reference:ee,floating:ae,trigger:ee}:{},[n,ee,ae])}function wM(e,t,n){let{reference:r,floating:s}=e;const o=so(t),l=Y2(t),c=K2(l),u=oo(t),f=o==="y",h=r.x+r.width/2-s.width/2,p=r.y+r.height/2-s.height/2,y=r[c]/2-s[c]/2;let x;switch(u){case"top":x={x:h,y:r.y-s.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:p};break;case"left":x={x:r.x-s.width,y:p};break;default:x={x:r.x,y:r.y}}const b=al(t);return b&&(x[l]+=y*(b==="end"?1:-1)*(n&&f?-1:1)),x}async function aZ(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:l,elements:c,strategy:u}=e,{boundary:f="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:y=!1,padding:x=0}=Ua(t,e),b=C5(x),E=c[y?p==="floating"?"reference":"floating":p],C=Uy(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(E)))==null||n?E:E.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:f,rootBoundary:h,strategy:u})),R=p==="floating"?{x:r,y:s,width:l.floating.width,height:l.floating.height}:l.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),O=await(o.isElement==null?void 0:o.isElement(T))&&await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1},k=Uy(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:R,offsetParent:T,strategy:u}):R);return{top:(C.top-k.top+b.top)/O.y,bottom:(k.bottom-C.bottom+b.bottom)/O.y,left:(C.left-k.left+b.left)/O.x,right:(k.right-C.right+b.right)/O.x}}const cZ=50,uZ=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:l}=n,c=l.detectOverflow?l:{...l,detectOverflow:aZ},u=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:p}=wM(f,r,u),y=r,x=0;const b={};for(let S=0;S<o.length;S++){const E=o[S];if(!E)continue;const{name:C,fn:R}=E,{x:T,y:O,data:k,reset:M}=await R({x:h,y:p,initialPlacement:r,placement:y,strategy:s,middlewareData:b,rects:f,platform:c,elements:{reference:e,floating:t}});h=T??h,p=O??p,b[C]={...b[C],...k},M&&x<cZ&&(x++,typeof M=="object"&&(M.placement&&(y=M.placement),M.rects&&(f=M.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):M.rects),{x:h,y:p}=wM(f,y,u)),S=-1)}return{x:h,y:p,placement:y,strategy:s,middlewareData:b}},dZ=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:l,initialPlacement:c,platform:u,elements:f}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:y,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:S=!0,...E}=Ua(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const C=oo(s),R=so(c),T=oo(c)===c,O=await(u.isRTL==null?void 0:u.isRTL(f.floating)),k=y||(T||!S?[$y(c)]:LQ(c)),M=b!=="none";!y&&M&&k.push(...zQ(c,S,b,O));const A=[c,...k],L=await u.detectOverflow(t,E),I=[];let j=((r=o.flip)==null?void 0:r.overflows)||[];if(h&&I.push(L[C]),p){const D=IQ(s,l,O);I.push(L[D[0]],L[D[1]])}if(j=[...j,{placement:s,overflows:I}],!I.every(D=>D<=0)){var P,B;const D=(((P=o.flip)==null?void 0:P.index)||0)+1,F=A[D];if(F&&(!(p==="alignment"?R!==so(F):!1)||j.every(V=>so(V.placement)===R?V.overflows[0]>0:!0)))return{data:{index:D,overflows:j},reset:{placement:F}};let z=(B=j.filter(q=>q.overflows[0]<=0).sort((q,V)=>q.overflows[1]-V.overflows[1])[0])==null?void 0:B.placement;if(!z)switch(x){case"bestFit":{var H;const q=(H=j.filter(V=>{if(M){const G=so(V.placement);return G===R||G==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(G=>G>0).reduce((G,K)=>G+K,0)]).sort((V,G)=>V[1]-G[1])[0])==null?void 0:H[0];q&&(z=q);break}case"initialPlacement":z=c;break}if(s!==z)return{reset:{placement:z}}}return{}}}},U5=new Set(["left","top"]);async function fZ(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),l=oo(n),c=al(n),u=so(n)==="y",f=U5.has(l)?-1:1,h=o&&u?-1:1,p=Ua(t,e);let{mainAxis:y,crossAxis:x,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof b=="number"&&(x=c==="end"?b*-1:b),u?{x:x*h,y:y*f}:{x:y*f,y:x*h}}const hZ=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:l,middlewareData:c}=t,u=await fZ(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:l}}}}},pZ=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:o}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:u={fn:R=>{let{x:T,y:O}=R;return{x:T,y:O}}},...f}=Ua(e,t),h={x:n,y:r},p=await o.detectOverflow(t,f),y=so(s),x=G2(y);let b=h[x],S=h[y];const E=(R,T)=>E5(T+p[R==="y"?"top":"left"],T,T-p[R==="y"?"bottom":"right"]);l&&(b=E(x,b)),c&&(S=E(y,S));const C=u.fn({...t,[x]:b,[y]:S});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[x]:l,[y]:c}}}}}},mZ=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:s,y:o,placement:l,rects:c,middlewareData:u}=t,{offset:f=0,mainAxis:h=!0,crossAxis:p=!0}=Ua(e,t),y={x:s,y:o},x=so(l),b=G2(x);let S=y[b],E=y[x];const C=Ua(f,t),R=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(n=C.mainAxis)!=null?n:0,crossAxis:(r=C.crossAxis)!=null?r:0};if(h){const k=b==="y"?"height":"width",M=c.reference[b]-c.floating[k]+R.mainAxis,A=c.reference[b]+c.reference[k]-R.mainAxis;S<M?S=M:S>A&&(S=A)}if(p){var T,O;const k=b==="y"?"width":"height",M=U5.has(oo(l)),A=c.reference[x]-c.floating[k]+(M&&((T=u.offset)==null?void 0:T[x])||0)+(M?0:R.crossAxis),L=c.reference[x]+c.reference[k]+(M?0:((O=u.offset)==null?void 0:O[x])||0)-(M?R.crossAxis:0);E<A?E=A:E>L&&(E=L)}return{[b]:S,[x]:E}}}},gZ=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:s,elements:o}=t,{apply:l=()=>{},...c}=Ua(e,t),u=await s.detectOverflow(t,c),f=oo(n),h=al(n),p=so(n)==="y",{width:y,height:x}=r.floating;let b,S;f==="top"||f==="bottom"?(b=f,S=h===(await(s.isRTL==null?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(S=f,b=h==="end"?"top":"bottom");const E=x-u.top-u.bottom,C=y-u.left-u.right,R=af(x-u[b],E),T=af(y-u[S],C),O=t.middlewareData.shift,k=!O;let M=R,A=T;O!=null&&O.enabled.x&&(A=C),O!=null&&O.enabled.y&&(M=E),k&&!h&&(p?A=y-2*el(u.left,u.right):M=x-2*el(u.top,u.bottom)),await l({...t,availableWidth:A,availableHeight:M});const L=await s.getDimensions(o.floating);return y!==L.width||x!==L.height?{reset:{rects:!0}}:{}}}};function V5(e){const t=$s(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Yt(e),o=s?e.offsetWidth:n,l=s?e.offsetHeight:r,c=Fy(n)!==o||Fy(r)!==l;return c&&(n=o,r=l),{width:n,height:r,$:c}}function nT(e){return St(e)?e:e.contextElement}function zd(e){const t=nT(e);if(!Yt(t))return tl(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=V5(t);let l=(o?Fy(n.width):n.width)/r,c=(o?Fy(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const yZ=tl(0);function q5(e){const t=pn(e);return!v2()||!t.visualViewport?yZ:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xZ(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===pn(e)}function iu(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=nT(e);let l=tl(1);t&&(r?St(r)&&(l=zd(r)):l=zd(e));const c=xZ(o,n,r)?q5(o):tl(0);let u=(s.left+c.x)/l.x,f=(s.top+c.y)/l.y,h=s.width/l.x,p=s.height/l.y;if(o&&r){const y=pn(o),x=St(r)?pn(r):r;let b=y,S=oE(b);for(;S&&x!==b;){const E=zd(S),C=S.getBoundingClientRect(),R=$s(S),T=C.left+(S.clientLeft+parseFloat(R.paddingLeft))*E.x,O=C.top+(S.clientTop+parseFloat(R.paddingTop))*E.y;u*=E.x,f*=E.y,h*=E.x,p*=E.y,u+=T,f+=O,b=pn(S),S=oE(b)}}return Uy({width:h,height:p,x:u,y:f})}function rb(e,t){const n=Hx(e).scrollLeft;return t?t.left+n:iu(dl(e)).left+n}function G5(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-rb(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function bZ(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",l=dl(r),c=t?Bx(t.floating):!1;if(r===l||c&&o)return n;let u={scrollLeft:0,scrollTop:0},f=tl(1);const h=tl(0),p=Yt(r);if((p||!o)&&((Rr(r)!=="body"||am(l))&&(u=Hx(r)),p)){const x=iu(r);f=zd(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const y=l&&!p&&!o?G5(l,u):tl(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-u.scrollLeft*f.x+h.x+y.x,y:n.y*f.y-u.scrollTop*f.y+h.y+y.y}}function vZ(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function SZ(e){const t=Hx(e),n=e.ownerDocument.body,r=el(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=el(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+rb(e);const l=-t.scrollTop;return $s(n).direction==="rtl"&&(o+=el(e.clientWidth,n.clientWidth)-r),{width:r,height:s,x:o,y:l}}const wZ=25;function EZ(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",s=pn(e),o=dl(e),l=s.visualViewport;let c=o.clientWidth,u=o.clientHeight,f=0,h=0;if(l){const y=!v2()||t==="fixed";r?y||(f=-l.offsetLeft,h=-l.offsetTop):(c=l.width,u=l.height,y&&(f=l.offsetLeft,h=l.offsetTop))}if(rb(o)<=0){const y=o.ownerDocument,x=y.body,b=getComputedStyle(x),S=y.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,E=Math.abs(o.clientWidth-x.clientWidth-S),C=getComputedStyle(o).scrollbarGutter==="stable both-edges"?E/2:E;C<=wZ&&(c-=C)}return{width:c,height:u,x:f,y:h}}function CZ(e,t){const n=iu(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=zd(e),l=e.clientWidth*o.x,c=e.clientHeight*o.y,u=s*o.x,f=r*o.y;return{width:l,height:c,x:u,y:f}}function EM(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=EZ(e,n,t);else if(t==="document")r=SZ(dl(e));else if(St(t))r=CZ(t,n);else{const s=q5(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Uy(r)}function TZ(e,t){const n=t.get(e);if(n)return n;let r=wp(e,[],!1).filter(c=>St(c)&&Rr(c)!=="body"),s=null;const o=$s(e).position==="fixed";let l=o?ll(e):e;for(;St(l)&&!Zi(l);){const c=$s(l),u=b2(l),f=s?s.position:o?"fixed":"";!u&&(f==="fixed"||f==="absolute"&&c.position==="static")?r=r.filter(p=>p!==l):s=c,l=ll(l)}return t.set(e,r),r}function NZ(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const l=[...n==="clippingAncestors"?Bx(t)?[]:TZ(t,this._c):[].concat(n),r],c=EM(t,l[0],s);let u=c.top,f=c.right,h=c.bottom,p=c.left;for(let y=1;y<l.length;y++){const x=EM(t,l[y],s);u=el(x.top,u),f=af(x.right,f),h=af(x.bottom,h),p=el(x.left,p)}return{width:f-p,height:h-u,x:p,y:u}}function RZ(e){const{width:t,height:n}=V5(e);return{width:t,height:n}}function OZ(e,t,n){const r=Yt(t),s=dl(t),o=n==="fixed",l=iu(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const u=tl(0);if((r||!o)&&((Rr(t)!=="body"||am(s))&&(c=Hx(t)),r)){const y=iu(t,!0,o,t);u.x=y.x+t.clientLeft,u.y=y.y+t.clientTop}!r&&s&&(u.x=rb(s));const f=s&&!r&&!o?G5(s,c):tl(0),h=l.left+c.scrollLeft-u.x-f.x,p=l.top+c.scrollTop-u.y-f.y;return{x:h,y:p,width:l.width,height:l.height}}function F1(e){return $s(e).position==="static"}function CM(e,t){if(!Yt(e)||$s(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return dl(e)===n&&(n=n.ownerDocument.body),n}function K5(e,t){const n=pn(e);if(Bx(e))return n;if(!Yt(e)){let s=ll(e);for(;s&&!Zi(s);){if(St(s)&&!F1(s))return s;s=ll(s)}return n}let r=CM(e,t);for(;r&&gK(r)&&F1(r);)r=CM(r,t);return r&&Zi(r)&&F1(r)&&!b2(r)?n:r||bK(e)||n}const AZ=async function(e){const t=this.getOffsetParent||K5,n=this.getDimensions,r=await n(e.floating);return{reference:OZ(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function kZ(e){return $s(e).direction==="rtl"}const _Z={convertOffsetParentRelativeRectToViewportRelativeRect:bZ,getDocumentElement:dl,getClippingRect:NZ,getOffsetParent:K5,getElementRects:AZ,getClientRects:vZ,getDimensions:RZ,getScale:zd,isElement:St,isRTL:kZ};function Y5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function MZ(e,t,n){let r=null,s;const o=dl(e);function l(){var h;clearTimeout(s),(h=r)==null||h.disconnect(),r=null}function c(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),l();const y=e.getBoundingClientRect(),{left:x,top:b,width:S,height:E}=y;if(h||t(),!S||!E)return;const C=O0(b),R=O0(o.clientWidth-(x+S)),T=O0(o.clientHeight-(b+E)),O=O0(x),M={rootMargin:-C+"px "+-R+"px "+-T+"px "+-O+"px",threshold:el(0,af(1,p))||1};let A=!0;function L(I){const j=I[0].intersectionRatio;if(!Y5(y,e.getBoundingClientRect()))return c();if(j!==p){if(!A)return c();j?c(!1,j):s=setTimeout(()=>{c(!1,1e-7)},1e3)}A=!1}try{r=new IntersectionObserver(L,{...M,root:o.ownerDocument})}catch{r=new IntersectionObserver(L,M)}r.observe(e)}const u=pn(e),f=()=>c(n);return u.addEventListener("resize",f),c(!0),()=>{u.removeEventListener("resize",f),l()}}function TM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,f=nT(e),h=s||o?[...f?wp(f):[],...t?wp(t):[]]:[];h.forEach(C=>{s&&C.addEventListener("scroll",n),o&&C.addEventListener("resize",n)});const p=f&&c?MZ(f,n,o):null;let y=-1,x=null;l&&(x=new ResizeObserver(C=>{let[R]=C;R&&R.target===f&&x&&t&&(x.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var T;(T=x)==null||T.observe(t)})),n()}),f&&!u&&x.observe(f),t&&x.observe(t));let b,S=u?iu(e):null;u&&E();function E(){const C=iu(e);S&&!Y5(S,C)&&n(),S=C,b=requestAnimationFrame(E)}return n(),()=>{var C;h.forEach(R=>{s&&R.removeEventListener("scroll",n),o&&R.removeEventListener("resize",n)}),p==null||p(),(C=x)==null||C.disconnect(),x=null,u&&cancelAnimationFrame(b)}}const IZ=hZ,LZ=pZ,DZ=dZ,jZ=gZ,PZ=mZ,zZ=(e,t,n)=>{const r=new Map,s=n??{},o={..._Z,...s.platform,_c:r};return uZ(e,t,{...s,platform:o})};var BZ=typeof document<"u",HZ=function(){},Sy=BZ?N.useLayoutEffect:HZ;function Vy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Vy(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!Vy(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function W5(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function NM(e,t){const n=W5(e);return Math.round(t*n)/n}function $1(e){const t=N.useRef(e);return Sy(()=>{t.current=e}),t}function FZ(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:l}={},transform:c=!0,whileElementsMounted:u,open:f}=e,[h,p]=N.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,x]=N.useState(r);Vy(y,r)||x(r);const[b,S]=N.useState(null),[E,C]=N.useState(null),R=N.useCallback(V=>{V!==M.current&&(M.current=V,S(V))},[]),T=N.useCallback(V=>{V!==A.current&&(A.current=V,C(V))},[]),O=o||b,k=l||E,M=N.useRef(null),A=N.useRef(null),L=N.useRef(h),I=u!=null,j=$1(u),P=$1(s),B=$1(f),H=N.useCallback(()=>{if(!M.current||!A.current)return;const V={placement:t,strategy:n,middleware:y};P.current&&(V.platform=P.current),zZ(M.current,A.current,V).then(G=>{const K={...G,isPositioned:B.current!==!1};D.current&&!Vy(L.current,K)&&(L.current=K,Us.flushSync(()=>{p(K)}))})},[y,t,n,P,B]);Sy(()=>{f===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,p(V=>({...V,isPositioned:!1})))},[f]);const D=N.useRef(!1);Sy(()=>(D.current=!0,()=>{D.current=!1}),[]),Sy(()=>{if(O&&(M.current=O),k&&(A.current=k),O&&k){if(j.current)return j.current(O,k,H);H()}},[O,k,H,j,I]);const F=N.useMemo(()=>({reference:M,floating:A,setReference:R,setFloating:T}),[R,T]),z=N.useMemo(()=>({reference:O,floating:k}),[O,k]),q=N.useMemo(()=>{const V={position:n,left:0,top:0};if(!z.floating)return V;const G=NM(z.floating,h.x),K=NM(z.floating,h.y);return c?{...V,transform:"translate("+G+"px, "+K+"px)",...W5(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:G,top:K}},[n,c,z.floating,h.x,h.y]);return N.useMemo(()=>({...h,update:H,refs:F,elements:z,floatingStyles:q}),[h,H,F,z,q])}const $Z=(e,t)=>{const n=IZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},UZ=(e,t)=>{const n=LZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},VZ=(e,t)=>({fn:PZ(e).fn,options:[e,t]}),qZ=(e,t)=>{const n=DZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},GZ=(e,t)=>{const n=jZ(e);return{name:n.name,fn:n.fn,options:[e,t]}};function qy(e,t,n,r){return{left:e,top:t,right:n,bottom:r,x:e,y:t,width:n-e,height:r-t}}function KZ(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function X5(e){const t=[];let n,r=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(const c of Array.from(e).sort((u,f)=>u.top-f.top)){if(r=Math.min(r,c.left),s=Math.min(s,c.top),o=Math.max(o,c.right),l=Math.max(l,c.bottom),!n||c.top-n.top>n.height/2)t.push(KZ(c));else{const u=t[t.length-1];u.left=Math.min(u.left,c.left),u.right=Math.max(u.right,c.right),u.bottom=Math.max(u.bottom,c.bottom),u.width=u.right-u.left,u.height=u.bottom-u.top}n=c}return{lines:t,fallback:qy(r,s,o,l)}}function Q5(e,t,n){return e.findIndex(r=>t>r.left-2&&t<r.right+2&&n>r.top-2&&n<r.bottom+2)}function RM(e){return qy(e.left,e.top,e.right,e.bottom)}function YZ(e,t,n){const{lines:r}=X5(e.getClientRects());if(r.length<2)return;const s=Q5(r,t,n);return{x:t,y:n,lineIndex:s===-1?void 0:s,element:e}}function WZ(e,t,n){const{lines:r,fallback:s}=X5(e.getClientRects());if(r.length<2)return null;const o=n==null?void 0:n.x,l=n==null?void 0:n.y,c=t[0];if((n==null?void 0:n.lineIndex)!=null&&r[n.lineIndex])return RM(r[n.lineIndex]);if(o!=null&&l!=null){const b=Q5(r,o,l);if(b!==-1)return RM(r[b])}if(r.length===2&&r[0].left>r[1].right&&o!=null&&l!=null)return s;if(c==="t"||c==="b"){const b=r[0],S=r[r.length-1],E=c==="t"?b:S;return qy(E.left,b.top,E.right,S.bottom)}const u=c==="l";let f=r[0].left,h=r[0].right,p=u?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY,y=r[0],x=r[0];for(const b of r){f=Math.min(f,b.left),h=Math.max(h,b.right);const S=u?b.left:b.right;u&&S<p||!u&&S>p?(p=S,y=b,x=b):S===p&&(x=b)}return qy(f,y.top,h,x.bottom)}function XZ(e){return"contextElement"in e&&e.contextElement?e.contextElement:St(e)?e:void 0}function QZ(e,t){function n(s){Z5(e,s.currentTarget,s.clientX,s.clientY)}function r(s){t||n(s)}return{onFocus(){e.current=void 0},onMouseEnter:r,onMouseMove:r}}function Z5(e,t,n,r){const s=YZ(t,n,r);return e.current=s,s}function ZZ(e){return{name:"inline",async fn(t){const n=t.elements.reference;if(typeof(n==null?void 0:n.getClientRects)!="function")return{};const r=XZ(n),s=e.current,o=(s==null?void 0:s.element)===n||(s==null?void 0:s.element)===r?s:void 0,l=WZ(n,t.placement,o);if(!l||typeof t.platform.getElementRects!="function")return{};const c=await t.platform.getElementRects({reference:{contextElement:r,getBoundingClientRect(){return l}},floating:t.elements.floating,strategy:t.strategy});return t.rects.reference.x===c.reference.x&&t.rects.reference.y===c.reference.y&&t.rects.reference.width===c.reference.width&&t.rects.reference.height===c.reference.height?{}:{reset:{rects:c}}}}}var rT=h4();const CE=[];let TE;function JZ(){return TE}function eJ(e){CE.push(e)}function Of(e){const t=(n,r)=>{const s=Or(tJ).current;let o;try{TE=s;for(const l of CE)l.before(s);o=e(n,r);for(const l of CE)l.after(s);s.didInitialize=!0}finally{TE=void 0}return o};return t.displayName=e.displayName||e.name,t}function bm(e){return N.forwardRef(Of(e))}function tJ(){return{didInitialize:!1}}const nJ=T2(19),rJ=nJ?oJ:iJ;function J5(e,t,n,r,s){return rJ(e,t,n,r,s)}function sJ(e,t,n,r,s){const o=N.useCallback(()=>t(e.getSnapshot(),n,r,s),[e,t,n,r,s]);return rT.useSyncExternalStore(e.subscribe,o,o)}eJ({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],s=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,s)||(t=!0,r.value=s)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const s of e.syncHooks)n.add(s.store);const r=[];for(const s of n)r.push(s.subscribe(t));return()=>{for(const s of r)s()}}),rT.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function oJ(e,t,n,r,s){const o=JZ();if(!o)return sJ(e,t,n,r,s);const l=o.syncIndex;o.syncIndex+=1;let c;return o.didInitialize?(c=o.syncHooks[l],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,s))&&(c.store!==e&&(o.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=s,c.value=t(e.getSnapshot(),n,r,s))):(c={store:e,selector:t,a1:n,a2:r,a3:s,value:t(e.getSnapshot(),n,r,s)},o.syncHooks.push(c)),c.value}function iJ(e,t,n,r,s){return y2.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,s))}class lJ{constructor(t){Dt(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));Dt(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new this(t)}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,s){return J5(this,t,n,r,s)}}class Af extends lJ{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){N.useDebugValue(t);const r=this;Be(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;Be(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);Be(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){N.useDebugValue(t);const r=this,s=n!==void 0;Be(()=>{s&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,s])}select(t,n,r,s){const o=this.selectors[t];return o(this.state,n,r,s)}useState(t,n,r,s){return N.useDebugValue(t),J5(this,this.selectors[t],n,r,s)}useContextCallback(t,n){N.useDebugValue(t);const r=Ve(n??Fn);this.context[t]=r}useStateSetter(t){const n=N.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let s=r(this.state);return n(s,s,this),this.subscribe(o=>{const l=r(o);if(!Object.is(s,l)){const c=s;s=l,n(l,c,this)}})}}const aJ={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class ez extends Af{constructor(n){const{syncOnly:r,nested:s,onOpenChange:o,triggerElements:l,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:H5(),nested:s,triggerElements:l},aJ);Dt(this,"syncOpenEvent",(n,r)=>{(!n||!this.state.open||r!=null&&vQ(r))&&(this.context.dataRef.current.openEvent=n?r:void 0)});Dt(this,"dispatchOpenChange",(n,r)=>{this.syncOpenEvent(n,r.event);const s={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",s)});Dt(this,"setOpen",(n,r)=>{var s,o,l,c;if(this.syncOnly){(o=(s=this.context).onOpenChange)==null||o.call(s,n,r);return}this.dispatchOpenChange(n,r),(c=(l=this.context).onOpenChange)==null||c.call(l,n,r)});this.syncOnly=r}}function tz(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:s,nested:o,onOpenChange:l}=e,c=t.useState("open"),u=t.useState("activeTriggerElement"),f=t.useState(n?"popupElement":"positionerElement"),h=t.context.triggerElements,p=l,y=N.useRef(null);r===void 0&&y.current===null&&(y.current=new ez({open:c,transitionStatus:void 0,referenceElement:u,floatingElement:f,triggerElements:h,onOpenChange:p,floatingId:s,syncOnly:!0,nested:o}));const x=r??y.current;return t.useSyncedValue("floatingId",s),Be(()=>{const b={open:c,floatingId:s,referenceElement:u,floatingElement:f};St(u)&&(b.domReferenceElement=u),x.state.positionReference===x.state.referenceElement&&(b.positionReference=u),x.update(b)},[c,s,u,f,x]),x.context.onOpenChange=p,x.context.nested=o,x}const vm={tabIndex:-1,[gE]:""};function nz(e){return t=>t==="touch"?e.current:!0}function sb(e,t=!1){const n=lf(),r=wu()!=null,s=Or(()=>e(n,r)).current;return tz({popupStore:s,treatPopupAsFloatingElement:t,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:s.setOpen}),s}function Sm({handle:e,store:t}){return Be(()=>e.attachStore(t),[e,t]),null}function OM(e){const t=e.context.triggerElements.size;e.select("open")&&e.state.triggerCount!==t&&e.set("triggerCount",t)}function rz(e,t){const n=N.useRef(null);return Ve(r=>{const s=n.current;if(s!==null){if(s.element===r&&s.store===t&&s.id===e)return;n.current=null;const o=s.store;o.context.triggerElements.getById(s.id)===s.element&&(o.context.triggerElements.delete(s.id),OM(o))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),OM(t))})}function ob(e,t,n,r=!1){let s=e.preventUnmountingOnClose;t?s=!1:r&&(s=!0);const o=(n==null?void 0:n.id)??null;let l=e.activeTriggerId,c=e.activeTriggerElement;return(o||t)&&(l=o,c=n??null),{open:t,preventUnmountingOnClose:s,activeTriggerId:l,activeTriggerElement:c}}function sT(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function sz(e,t,n,r={}){var h,p,y;const s=n.reason,o=s===wn,l=t&&s===Dd,c=!t&&(s===ui||s===hm),u=sT(n);if((p=(h=e.context).onOpenChange)==null||p.call(h,t,n),n.isCanceled)return;(y=r.onBeforeDispatch)==null||y.call(r),e.state.floatingRootContext.dispatchOpenChange(t,n);const f=()=>{const x=ob(e.state,t,n.trigger,u()),b={...r.extraState,...x};l?b.instantType="focus":c?b.instantType="dismiss":o&&(b.instantType=void 0),e.update(b)};o?Us.flushSync(f):f()}function wm(e,t,n,r){const s=n.useState("isMountedByTrigger",e),o=rz(e,n),l=Ve(u=>{const f=n.select("open"),h=n.select("activeTriggerId");if(h===e){const p={activeTriggerElement:u,...f?r:null};n.update(p);return}if(h==null&&f){const p={activeTriggerId:e??null,activeTriggerElement:u,...r};n.update(p)}}),c=Ve(u=>{o(u),u&&l(u)});return Be(()=>(c(t.current),()=>c(null)),[c,t,n,e]),Be(()=>{if(s){const u={activeTriggerElement:t.current,...r};n.update(u)}},[s,n,t,...Object.values(r)]),{registerTrigger:c,isMountedByThisTrigger:s}}function Em(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=N.useRef(null),s=e.useState("open"),o=e.useState("triggerCount"),l=e.useState("activeTriggerId"),c=e.useState("activeTriggerElement");Be(()=>{if(!s){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const u=e.context.triggerElements.size,f={};e.state.triggerCount!==u&&(f.triggerCount=u);const h=e.select("activeTriggerId");let p=null;if(h){const y=e.context.triggerElements.getById(h);if(y)r.current=h,y!==e.state.activeTriggerElement&&(f.activeTriggerElement=y);else{for(const[x,b]of e.context.triggerElements.entries())if(b===e.state.activeTriggerElement){f.activeTriggerId=x,f.activeTriggerElement=b,r.current=x;break}f.activeTriggerId===void 0&&(r.current===h?p=h:r.current=null)}}else r.current=null;if(!p&&!h&&u===1){const y=e.context.triggerElements.entries().next();if(!y.done){const[x,b]=y.value;f.activeTriggerId=x,f.activeTriggerElement=b,r.current=x}}(f.triggerCount!==void 0||f.activeTriggerId!==void 0||f.activeTriggerElement!==void 0)&&e.update(f),p&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===p&&!e.context.triggerElements.getById(p)){const y=ht(fm);e.setOpen(!1,y),y.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,e,o,l,c,n])}function Cm(e,t,n,r){const{mounted:s,setMounted:o,transitionStatus:l}=$2(e,!1,!1,r),c=t.useState("preventUnmountingOnClose"),u=e?!1:c;t.useSyncedValues({mounted:s,transitionStatus:l,preventUnmountingOnClose:u});const f=Ve(()=>{var h,p;o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n==null||n(),(p=(h=t.context).onOpenChangeComplete)==null||p.call(h,!1)});return Ya({enabled:s&&!e&&!u,open:e,ref:t.context.popupRef,onComplete(){e||f()}}),{forceUnmount:f,transitionStatus:l}}function Tm(e,t){e.useSyncedValues(t),Be(()=>()=>{e.update({activeTriggerProps:hn,inactiveTriggerProps:hn,popupProps:hn})},[e])}function oz(e,t){Be(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),Be(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class Nm{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function Rm(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new ez({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:hn,inactiveTriggerProps:hn,popupProps:hn}}const ip=e=>e.triggerIdProp??e.activeTriggerId,oT=e=>e.openProp??e.open,AM=e=>{var n;return(((n=e.popupElement)==null?void 0:n.id)??e.floatingId)||void 0};function iz(e,t){return t!==void 0&&oT(e)&&ip(e)===t}function cJ(e,t){return iz(e,t)?!0:t!==void 0&&oT(e)&&ip(e)==null&&e.triggerCount===1}const Om={open:oT,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:ip,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:AM,isTriggerActive:(e,t)=>t!==void 0&&ip(e)===t,isOpenedByTrigger:(e,t)=>iz(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&ip(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>cJ(e,t)?AM(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Am(e){const t=N.useCallback(r=>e===void 0?Fn:e.subscribeStore(r),[e]),n=N.useCallback(()=>e===void 0?void 0:e.store,[e]);return rT.useSyncExternalStore(t,n,()=>e==null?void 0:e.serverStore)}function uJ(e){return dJ(e,e.rootContext)}function dJ(e,t){const{nodeId:n,externalTree:r}=e,s=t.useState("referenceElement"),o=t.useState("floatingElement"),l=t.useState("domReferenceElement"),c=t.useState("open"),u=t.useState("floatingId"),[f,h]=N.useState(null),[p,y]=N.useState(void 0),[x,b]=N.useState(void 0),S=N.useRef(null),E=hl(r),C=N.useMemo(()=>({reference:s,floating:o,domReference:l}),[s,o,l]),R=FZ({...e,elements:{...C,...f&&{reference:f}}}),T=St(p)?p:null,O=x===void 0?t.state.floatingElement:x;t.useSyncedValue("referenceElement",p??null),t.useSyncedValue("domReferenceElement",p===void 0?l:T),t.useSyncedValue("floatingElement",O);const k=N.useCallback(P=>{const B=St(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),getClientRects:()=>P.getClientRects(),contextElement:P}:P;h(B),R.refs.setReference(B)},[R.refs]),M=N.useCallback(P=>{(St(P)||P===null)&&(S.current=P,y(P)),(St(R.refs.reference.current)||R.refs.reference.current===null||P!==null&&!St(P))&&R.refs.setReference(P)},[R.refs,y]),A=N.useCallback(P=>{b(P),R.refs.setFloating(P)},[R.refs]),L=N.useMemo(()=>({...R.refs,setReference:M,setFloating:A,setPositionReference:k,domReference:S}),[R.refs,M,A,k]),I=N.useMemo(()=>({...R.elements,domReference:l}),[R.elements,l]),j=N.useMemo(()=>({...R,dataRef:t.context.dataRef,open:c,onOpenChange:t.setOpen,events:t.context.events,floatingId:u,refs:L,elements:I,nodeId:n,rootStore:t}),[R,L,I,n,t,c,u]);return Be(()=>{l&&(S.current=l)},[l]),Be(()=>{t.context.dataRef.current.floatingContext=j;const P=E==null?void 0:E.nodesRef.current.find(B=>B.id===n);P&&(P.context=j)}),N.useMemo(()=>({...R,context:j,refs:L,elements:I,rootStore:t}),[R,L,I,j,t])}const U1=z2&&Ka;function iT(e,t={}){const{enabled:n=!0,delay:r}=t,s="rootStore"in e?e.rootStore:e,{events:o,dataRef:l}=s.context,c=N.useRef(!1),u=N.useRef(null),f=N.useRef(!0),h=ns();N.useEffect(()=>{const y=s.select("domReferenceElement");if(!n)return;const x=pn(y);function b(){const C=s.select("domReferenceElement");!s.select("open")&&Yt(C)&&C===es(jt(C))&&(c.current=!0,u.current=C)}function S(){f.current=!0}function E(){f.current=!1}return ai(bt(x,"blur",b),U1&&bt(x,"keydown",S,!0),U1&&bt(x,"pointerdown",E,!0))},[s,n]),N.useEffect(()=>{if(!n)return;function y(x){if(x.reason===ui||x.reason===hm){const b=s.select("domReferenceElement");St(b)&&(u.current=b,c.current=!0)}}return o.on("openchange",y),()=>{o.off("openchange",y)}},[o,n,s]);const p=N.useMemo(()=>{function y(){c.current=!1,u.current=null}return{onMouseLeave(){y()},onFocus(x){const b=x.currentTarget;if(c.current){if(u.current===b)return;y()}const S=Tr(x.nativeEvent);if(St(S)){if(U1&&!x.relatedTarget){if(!f.current&&!Qx(S))return}else if(!EQ(S))return}const E=Hy(x.relatedTarget,s.context.triggerElements),{nativeEvent:C,currentTarget:R}=x,T=typeof r=="function"?r():r;if(s.select("open")&&E||T===0||T===void 0){s.setOpen(!0,ht(Dd,C,R));return}h.start(T,()=>{c.current||s.setOpen(!0,ht(Dd,C,R))})},onBlur(x){y();const b=x.relatedTarget,S=x.nativeEvent,E=St(b)&&b.hasAttribute(_p("focus-guard"))&&b.getAttribute("data-type")==="outside";h.start(0,()=>{var O;const C=s.select("domReferenceElement"),R=es(jt(C));!b&&R===C||Je((O=l.current.floatingContext)==null?void 0:O.refs.floating.current,R)||Je(C,R)||E||Hy(b??R,s.context.triggerElements)||s.setOpen(!1,ht(Dd,S))})}}},[l,r,s,h]);return N.useMemo(()=>n?{reference:p,trigger:p}:{},[n,p])}class lT{constructor(){Dt(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});Dt(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new co,this.restTimeout=new co,this.handleCloseOptions=void 0}static create(){return new lT}}const Gy=new WeakMap;function Ky(e){var n,r,s;if(!e.performedPointerEventsMutation)return;const t=e.pointerEventsScopeElement;t&&Gy.get(t)===e&&((n=e.pointerEventsScopeElement)==null||n.style.removeProperty("pointer-events"),(r=e.pointerEventsReferenceElement)==null||r.style.removeProperty("pointer-events"),(s=e.pointerEventsFloatingElement)==null||s.style.removeProperty("pointer-events"),Gy.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function lz(e,t){const{scopeElement:n,referenceElement:r,floatingElement:s}=t,o=Gy.get(n);o&&o!==e&&Ky(o),Ky(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=s,Gy.set(n,e),n.style.pointerEvents="none",r.style.pointerEvents="auto",s.style.pointerEvents="auto"}function aT(e){const t=e.context.dataRef.current,n=Or(()=>t.hoverInteractionState??lT.create()).current;return t.hoverInteractionState||(t.hoverInteractionState=n),F2(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function ib(e,t={}){const{enabled:n=!0,closeDelay:r=0,nodeId:s}=t,o="rootStore"in e?e.rootStore:e,l=o.useState("open"),c=o.useState("floatingElement"),u=o.useState("domReferenceElement"),{dataRef:f}=o.context,h=hl(),p=wu(),y=aT(o),x=ns(),b=Ve(()=>{var C;return w5((C=f.current.openEvent)==null?void 0:C.type,y.interactedInside)}),S=Ve(()=>{var C;return TQ((C=f.current.openEvent)==null?void 0:C.type)}),E=Ve(()=>{Ky(y)});Be(()=>{l||(y.pointerType=void 0,y.restTimeoutPending=!1,y.interactedInside=!1,E())},[l,y,E]),N.useEffect(()=>E,[E]),Be(()=>{var C,R,T,O,k;if(n&&l&&(C=y.handleCloseOptions)!=null&&C.blockPointerEvents&&S()&&St(u)&&c){const M=u,A=c,L=jt(c),I=(T=(R=h==null?void 0:h.nodesRef.current.find(H=>H.id===p))==null?void 0:R.context)==null?void 0:T.elements.floating;I&&(I.style.pointerEvents="");const j=y.pointerEventsScopeElement!==A?y.pointerEventsScopeElement:null,P=I!==A?I:null,B=((k=(O=y.handleCloseOptions)==null?void 0:O.getScope)==null?void 0:k.call(O))??j??P??M.closest("[data-rootownerid]")??L.body;return lz(y,{scopeElement:B,referenceElement:M,floatingElement:A}),()=>{E()}}},[n,l,u,c,y,S,h,p,E]),N.useEffect(()=>{if(!n)return;function C(){return!!(h&&p&&Va(h.nodesRef.current,p).length>0)}function R(L){const I=kp(r,"close",y.pointerType),j=()=>{o.setOpen(!1,ht(wn,L)),h==null||h.events.emit("floating.closed",L)};I?y.openChangeTimeout.start(I,j):(y.openChangeTimeout.clear(),j())}function T(L){const I=Tr(L);if(!wQ(I)){y.interactedInside=!1;return}y.interactedInside=(I==null?void 0:I.closest("[aria-haspopup]"))!=null}function O(){y.openChangeTimeout.clear(),x.clear(),h==null||h.events.off("floating.closed",M),E()}function k(L){var B;if(C()&&h){h.events.on("floating.closed",M);return}if(Hy(L.relatedTarget,o.context.triggerElements))return;const I=((B=f.current.floatingContext)==null?void 0:B.nodeId)??s,j=L.relatedTarget;if(!(h&&I&&St(j)&&Va(h.nodesRef.current,I,!1).some(H=>{var D;return Je((D=H.context)==null?void 0:D.elements.floating,j)}))){if(y.handler){y.handler(L);return}E(),S()&&!b()&&R(L)}}function M(L){!h||!p||C()||x.start(0,()=>{h.events.off("floating.closed",M),o.setOpen(!1,ht(wn,L)),h.events.emit("floating.closed",L)})}const A=c;return ai(A&&bt(A,"mouseenter",O),A&&bt(A,"mouseleave",k),A&&bt(A,"pointerdown",T,!0),()=>{h==null||h.events.off("floating.closed",M)})},[n,c,o,f,r,s,S,b,E,y,h,p,x])}const fJ={current:null};function km(e,t={}){const{enabled:n=!0,delay:r=0,handleClose:s=null,mouseOnly:o=!1,restMs:l=0,move:c=!0,triggerElementRef:u=fJ,externalTree:f,isActiveTrigger:h=!0,getHandleCloseContext:p,isClosing:y,shouldOpen:x,guardStaleOpen:b=!1}=t,S="rootStore"in e?e.rootStore:e,{dataRef:E,events:C}=S.context,R=hl(f),T=aT(S),O=N.useRef(!1),k=In(s),M=In(r),A=In(l),L=In(n),I=In(x),j=In(y),P=Ve(()=>{var z;return w5((z=E.current.openEvent)==null?void 0:z.type,T.interactedInside)}),B=Ve(()=>{var z;return((z=I.current)==null?void 0:z.call(I))!==!1}),H=Ve((z,q,V)=>{const G=S.context.triggerElements;if(G.hasElement(q))return!z||!Je(z,q);if(!St(V))return!1;const K=V;return G.hasMatchingElement(X=>Je(X,K))&&(!z||!Je(z,K))}),D=Ve(()=>{if(!T.handler)return;jt(S.select("domReferenceElement")).removeEventListener("mousemove",T.handler),T.handler=void 0}),F=Ve(()=>{Ky(T)});return h&&(T.handleCloseOptions=s==null?void 0:s.__options),N.useEffect(()=>D,[D]),N.useEffect(()=>{if(!n)return;function z(q){q.open?O.current=!1:(O.current=q.reason===wn,D(),T.openChangeTimeout.clear(),T.restTimeout.clear(),T.blockMouseMove=!0,T.restTimeoutPending=!1)}return C.on("openchange",z),()=>{C.off("openchange",z)}},[n,C,T,D]),N.useEffect(()=>{if(!n)return;function z(ee,ae=!0){const $=kp(M.current,"close",T.pointerType);$?T.openChangeTimeout.start($,()=>{S.setOpen(!1,ht(wn,ee)),R==null||R.events.emit("floating.closed",ee)}):ae&&(T.openChangeTimeout.clear(),S.setOpen(!1,ht(wn,ee)),R==null||R.events.emit("floating.closed",ee))}const q=u.current??(h?S.select("domReferenceElement"):null);if(!St(q))return;function V(ee){var be;if(T.openChangeTimeout.clear(),T.blockMouseMove=!1,o&&!Ra(T.pointerType))return;const ae=lM(A.current),$=kp(M.current,"open",T.pointerType),Y=Tr(ee),J=ee.currentTarget??null,ne=S.select("domReferenceElement");let W=J;if(St(Y)&&!S.context.triggerElements.hasElement(Y)){for(const Ae of S.context.triggerElements.elements())if(Je(Ae,Y)){W=Ae;break}}St(J)&&St(ne)&&!S.context.triggerElements.hasElement(J)&&Je(J,ne)&&(W=ne);const ce=W==null?!1:H(ne,W,Y),ye=S.select("open"),pe=((be=j.current)==null?void 0:be.call(j))??S.select("transitionStatus")==="ending",le=!ye&&pe&&O.current,re=!ce&&St(W)&&St(ne)&&Je(ne,W)&&le,he=ae>0&&!$,Se=ce&&(ye||le)||re,_e=!ye||ce;if(Se){B()&&S.setOpen(!0,ht(wn,ee,W));return}he||($?T.openChangeTimeout.start($,()=>{_e&&B()&&S.setOpen(!0,ht(wn,ee,W))}):_e&&B()&&S.setOpen(!0,ht(wn,ee,W)))}function G(ee){if(P()){F();return}D();const ae=S.select("domReferenceElement"),$=jt(ae);T.restTimeout.clear(),T.restTimeoutPending=!1;const Y=E.current.floatingContext??(p==null?void 0:p());if(Hy(ee.relatedTarget,S.context.triggerElements))return;if(k.current&&Y){S.select("open")||T.openChangeTimeout.clear();const ne=u.current;T.handler=k.current({...Y,tree:R,x:ee.clientX,y:ee.clientY,onClose(){F(),D(),L.current&&!P()&&ne===S.select("domReferenceElement")&&z(ee,!0)}}),$.addEventListener("mousemove",T.handler),T.handler(ee);return}(T.pointerType==="touch"?!Je(S.select("floatingElement"),ee.relatedTarget):!0)&&z(ee)}function K(ee){Je(q,ee.relatedTarget)||(T.openChangeTimeout.clear(),T.restTimeout.clear(),T.restTimeoutPending=!1)}const X=b?bt(q,"mouseout",K):void 0;return c?ai(bt(q,"mousemove",V,{once:!0}),bt(q,"mouseenter",V),bt(q,"mouseleave",G),X):ai(bt(q,"mouseenter",V),bt(q,"mouseleave",G),X)},[D,F,E,M,S,n,k,T,h,H,P,o,c,A,u,R,L,p,j,B,b]),N.useMemo(()=>{if(!n)return;function z(q){T.pointerType=q.pointerType}return{onPointerDown:z,onPointerEnter:z,onMouseMove(q){var Y,J,ne;const{nativeEvent:V}=q,G=q.currentTarget,K=S.select("domReferenceElement"),X=S.select("open"),ee=H(K,G,q.target);if(o&&!Ra(T.pointerType))return;if(X&&ee&&((Y=T.handleCloseOptions)!=null&&Y.blockPointerEvents)){const W=S.select("floatingElement");if(W){const ce=((ne=(J=T.handleCloseOptions)==null?void 0:J.getScope)==null?void 0:ne.call(J))??G.ownerDocument.body;lz(T,{scopeElement:ce,referenceElement:G,floatingElement:W})}}const ae=lM(A.current);if(X&&!ee||ae===0||!ee&&T.restTimeoutPending&&q.movementX**2+q.movementY**2<2)return;T.restTimeout.clear();function $(){if(T.restTimeoutPending=!1,P())return;const W=S.select("open");!T.blockMouseMove&&(!W||ee)&&B()&&S.setOpen(!0,ht(wn,V,G))}T.pointerType==="touch"?Us.flushSync(()=>{$()}):ee&&X?$():(T.restTimeoutPending=!0,T.restTimeout.start(ae,$))}}},[n,T,P,H,o,S,A,B])}const hJ="Escape";function kM(e){return Ka&&e.movementX===0&&e.movementY===0}function lb(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function k0(e,t){return lb(t,e===S5||e===q2,e===Wx||e===Xx)}function V1(e,t,n){return lb(t,e===q2,n?e===Wx:e===Xx)||e==="Enter"||e===" "||e===""}function pJ(e,t,n){return lb(t,n?e===Wx:e===Xx,e===q2)}function mJ(e,t,n,r){const s=n?e===Xx:e===Wx,o=e===S5;return t==="both"||t==="horizontal"&&r?e===hJ:lb(t,s,o)}function gJ(e,t){const{listRef:n,activeIndex:r,onNavigate:s=()=>{},enabled:o=!0,selectedIndex:l=null,allowEscape:c=!1,loopFocus:u=!1,nested:f=!1,rtl:h=!1,virtual:p=!1,focusItemOnOpen:y="auto",focusItemOnHover:x=!0,openOnArrowKeyDown:b=!0,disabledIndices:S=void 0,orientation:E="vertical",parentOrientation:C,id:R,resetOnPointerLeave:T=!0,externalTree:O,grid:k}=t,M=k!=null,A="rootStore"in e?e.rootStore:e,L=A.useState("open"),I=A.useState("floatingElement"),j=A.useState("domReferenceElement"),P=A.context.dataRef,B=bE(I),H=xE(j),D=In(B),F=wu(),z=hl(O),q=N.useRef(y),V=N.useRef(l??-1),G=N.useRef(null),K=N.useRef(!0),X=Ve(ke=>{s(V.current===-1?null:V.current,ke)}),ee=N.useRef(!!I),ae=N.useRef(L),$=N.useRef(!1),Y=N.useRef(!1),J=N.useRef(null),ne=In(S),W=In(L),ce=In(l),ye=In(T),pe=Ap(),le=Ap(),re=Ve(()=>{function ke(Fe){p?z==null||z.events.emit("virtualfocus",Fe):J.current=vy(Fe,{sync:$.current,preventScroll:!0})}const je=n.current[V.current],Ne=Y.current;je&&ke(je),($.current?Fe=>Fe():Fe=>pe.request(Fe))(()=>{var xt;const Fe=n.current[V.current]||je;if(!Fe)return;je||ke(Fe),Me&&(Ne||!K.current)&&((xt=Fe.scrollIntoView)==null||xt.call(Fe,{block:"nearest",inline:"nearest"}))})});Be(()=>{P.current.orientation=E},[P,E]),Be(()=>{o&&(L&&I?(V.current=l??-1,q.current&&l!=null&&(Y.current=!0,X())):ee.current&&(V.current=-1,X()))},[o,L,I,l,X]),Be(()=>{if(o){if(!L){$.current=!1;return}if(I)if(r==null){if($.current=!1,ce.current!=null)return;if(ee.current&&(V.current=-1,re()),(!ae.current||!ee.current)&&q.current&&(G.current!=null||q.current===!0&&G.current==null)){let ke=0;const je=()=>{n.current[0]==null?(ke<2&&(ke?ve=>le.request(ve):queueMicrotask)(je),ke+=1):(V.current=G.current==null||V1(G.current,E,h)||f?by(n):SE(n),G.current=null,X())};je()}}else op(n.current,r)||(V.current=r,re(),Y.current=!1)}},[o,L,I,r,ce,f,n,E,h,X,re,le]),Be(()=>{var Fe,Ye;if(!o||I||!z||p||!ee.current)return;const ke=z.nodesRef.current,je=(Ye=(Fe=ke.find(xt=>xt.id===F))==null?void 0:Fe.context)==null?void 0:Ye.elements.floating,Ne=es(jt(j??je??null)),ve=ke.some(xt=>xt.context&&Je(xt.context.elements.floating,Ne));je&&!ve&&K.current&&je.focus({preventScroll:!0})},[o,I,j,z,F,p]),Be(()=>{ae.current=L,ee.current=!!I}),Be(()=>{L||(G.current=null,q.current=y)},[L,y]);const he=r!=null,Se=Ve(ke=>{if(!W.current)return;const je=n.current.indexOf(ke.currentTarget);je!==-1&&(V.current!==je||r!==je)&&(V.current=je,X(ke))}),_e=Ve(()=>{var ke,je,Ne;return C??((Ne=(je=(ke=z==null?void 0:z.nodesRef.current.find(ve=>ve.id===F))==null?void 0:ke.context)==null?void 0:je.dataRef)==null?void 0:Ne.current.orientation)}),be=Ve(()=>by(n,ne.current)),Ae=Ve(ke=>{if(K.current=!1,$.current=!0,ke.which===229||!W.current&&ke.currentTarget===D.current)return;if(f&&mJ(ke.key,E,h,M)){k0(ke.key,_e())||Qo(ke),A.setOpen(!1,ht(Rp,ke.nativeEvent)),Yt(j)&&(p?z==null||z.events.emit("virtualfocus",j):j.focus());return}const je=V.current,Ne=by(n,S),ve=SE(n,S);if(H||(ke.key==="Home"&&(Qo(ke),V.current=Ne,X(ke)),ke.key==="End"&&(Qo(ke),V.current=ve,X(ke))),k!=null){const Fe=k(ke,V.current,n,E,u,h,S,Ne,ve);if(Fe!=null&&(V.current=Fe,X(ke)),E==="both")return}if(k0(ke.key,E)){if(Qo(ke),L&&!p&&es(ke.currentTarget.ownerDocument)===ke.currentTarget){V.current=V1(ke.key,E,h)?Ne:ve,X(ke);return}V1(ke.key,E,h)?u?je>=ve?c&&je!==n.current.length?V.current=-1:($.current=!1,V.current=Ne):V.current=qi(n.current,{startingIndex:je,disabledIndices:S}):V.current=Math.min(ve,qi(n.current,{startingIndex:je,disabledIndices:S})):u?je<=Ne?c&&je!==-1?V.current=n.current.length:($.current=!1,V.current=ve):V.current=qi(n.current,{startingIndex:je,decrement:!0,disabledIndices:S}):V.current=Math.max(Ne,qi(n.current,{startingIndex:je,decrement:!0,disabledIndices:S})),op(n.current,V.current)&&(V.current=-1),X(ke)}}),Me=N.useMemo(()=>({onFocus(je){$.current=!0,Se(je)},onClick:({currentTarget:je})=>je.focus({preventScroll:!0}),onMouseMove(je){kM(je)||($.current=!0,Y.current=!1,x&&Se(je))},onPointerLeave(je){var ve;if(!W.current||!K.current||je.pointerType==="touch")return;$.current=!0;const Ne=je.relatedTarget;if(!(!x||n.current.includes(Ne))&&ye.current&&((ve=J.current)==null||ve.call(J),J.current=null,V.current=-1,X(je),!p)){const Fe=D.current,Ye=es(jt(Fe));Fe&&Je(Fe,Ye)&&Fe.focus({preventScroll:!0})}}}),[Se,W,D,x,n,X,ye,p]),Le=N.useMemo(()=>p&&L&&he&&{"aria-activedescendant":`${R}-${r}`},[p,L,he,R,r]),ue=N.useMemo(()=>({...H?{}:Le,onKeyDown(ke){if(ke.key==="Tab"&&ke.shiftKey&&L&&!p){const je=Tr(ke.nativeEvent);if(je&&!Je(D.current,je))return;Qo(ke),A.setOpen(!1,ht(ou,ke.nativeEvent)),Yt(j)&&j.focus();return}Ae(ke)},onPointerMove(ke){kM(ke)||(K.current=!0)}}),[Le,Ae,D,H,A,L,p,j]),Re=N.useMemo(()=>{function ke(ve){A.setOpen(!0,ht(Rp,ve.nativeEvent,ve.currentTarget))}function je(ve){y==="auto"&&U2(ve.nativeEvent)&&(q.current=!p)}function Ne(ve){q.current=y,y==="auto"&&V2(ve.nativeEvent)&&(q.current=!0)}return{onKeyDown(ve){const Fe=A.select("open");K.current=!1;const Ye=ve.key.startsWith("Arrow"),xt=pJ(ve.key,_e(),h),nn=k0(ve.key,E),Ce=(f?xt:nn)||ve.key==="Enter"||ve.key.trim()==="";if(p&&Fe)return Ae(ve);if(!(!Fe&&!b&&Ye)){if(Ce){const De=k0(ve.key,_e());G.current=f&&De?null:ve.key}if(f){xt&&(Qo(ve),Fe?(V.current=be(),X(ve)):ke(ve));return}nn&&(ce.current!=null&&(V.current=ce.current),Qo(ve),!Fe&&b?ke(ve):Ae(ve),Fe&&X(ve))}},onFocus(ve){A.select("open")&&!p&&(V.current=-1,X(ve))},onPointerDown:Ne,onPointerEnter:Ne,onMouseDown:je,onClick:je}},[Ae,y,be,f,X,A,b,E,_e,h,ce,p]),ze=N.useMemo(()=>({...Le,...Re}),[Le,Re]);return N.useMemo(()=>o?{reference:ze,floating:ue,item:Me,trigger:Re}:{},[o,ze,ue,Re,Me])}function yJ(e,t){const{listRef:n,elementsRef:r,activeIndex:s,onMatch:o,disabledIndices:l,onTyping:c,enabled:u=!0,resetMs:f=750,selectedIndex:h=null}=t,p="rootStore"in e?e.rootStore:e,y=p.useState("open"),x=ns(),b=N.useRef(""),S=N.useRef(h??s??-1),E=N.useRef(null),C=Ve(O=>{function k(D){return r==null?void 0:r.current[D]}function M(D){const F=k(D);return F&&!Zx(F)||F!=null&&F.matches(":disabled")?!1:l==null||!jd(Ba,D,l)}function A(D,F,z=0){if(D.length===0)return-1;const q=(z%D.length+D.length)%D.length,V=F.toLowerCase();for(let G=0;G<D.length;G+=1){const K=(q+G)%D.length,X=D[K];if(!(!(X!=null&&X.toLowerCase().startsWith(V))||!M(K)))return K}return-1}const L=n.current;if(b.current.length>0&&O.key===" "&&(Qo(O),c==null||c(!0)),b.current.length>0&&b.current[0]!==" "&&A(L,b.current)===-1&&O.key!==" "&&(c==null||c(!1)),L==null||O.key.length!==1||O.ctrlKey||O.metaKey||O.altKey)return;y&&O.key!==" "&&(Qo(O),c==null||c(!0));const I=b.current==="";I&&(S.current=h??s??-1),L.every((D,F)=>{var z,q;return D&&M(F)?((z=D[0])==null?void 0:z.toLowerCase())!==((q=D[1])==null?void 0:q.toLowerCase()):!0})&&b.current===O.key&&(b.current="",S.current=E.current),b.current+=O.key,x.start(f,()=>{b.current="",S.current=E.current,c==null||c(!1)});const B=((I?h??s??-1:S.current)??0)+1,H=A(L,b.current,B);H!==-1?(o==null||o(H),E.current=H):O.key!==" "&&(b.current="",c==null||c(!1))}),R=Ve(O=>{const k=O.relatedTarget,M=p.select("domReferenceElement"),A=p.select("floatingElement");Je(M,k)||Je(A,k)||(x.clear(),b.current="",S.current=E.current,c==null||c(!1))});Be(()=>{!y&&h!==null||(x.clear(),E.current=null,b.current!==""&&(b.current=""))},[y,h,x]);const T=N.useMemo(()=>({onKeyDown:C,onBlur:R}),[C,R]);return N.useMemo(()=>u?{reference:T,floating:T}:{},[u,T])}const _M=.1,xJ=_M*_M,Xt=.5;function _0(e,t,n,r,s,o){return r>=t!=o>=t&&e<=(s-n)*(t-r)/(o-r)+n}function M0(e,t,n,r,s,o,l,c,u,f){let h=!1;return _0(e,t,n,r,s,o)&&(h=!h),_0(e,t,s,o,l,c)&&(h=!h),_0(e,t,l,c,u,f)&&(h=!h),_0(e,t,u,f,n,r)&&(h=!h),h}function bJ(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function I0(e,t,n,r,s,o){const l=Math.min(n,s),c=Math.max(n,s),u=Math.min(r,o),f=Math.max(r,o);return e>=l&&e<=c&&t>=u&&t<=f}function _m(e={}){const{blockPointerEvents:t=!1}=e,n=new co,r=({x:s,y:o,placement:l,elements:c,onClose:u,nodeId:f,tree:h})=>{const p=l==null?void 0:l.split("-")[0];let y=!1,x=null,b=null,S=typeof performance<"u"?performance.now():0;function E(R,T){const O=performance.now(),k=O-S;if(x===null||b===null||k===0)return x=R,b=T,S=O,!1;const M=R-x,A=T-b,L=M*M+A*A,I=k*k*xJ;return x=R,b=T,S=O,L<I}function C(){n.clear(),u()}return function(T){n.clear();const O=c.domReference,k=c.floating;if(!O||!k||p==null||s==null||o==null)return;const{clientX:M,clientY:A}=T,L=Tr(T),I=T.type==="mouseleave",j=Je(k,L),P=Je(O,L);if(j&&(y=!0,!I))return;if(P&&(y=!1,!I)){y=!0;return}if(I&&St(T.relatedTarget)&&Je(k,T.relatedTarget))return;function B(){return!!(h&&Va(h.nodesRef.current,f).length>0)}function H(){B()||C()}if(B())return;const D=O.getBoundingClientRect(),F=k.getBoundingClientRect(),z=s>F.right-F.width/2,q=o>F.bottom-F.height/2,V=F.width>D.width,G=F.height>D.height,K=(V?D:F).left,X=(V?D:F).right,ee=(G?D:F).top,ae=(G?D:F).bottom;if(p==="top"&&o>=D.bottom-1||p==="bottom"&&o<=D.top+1||p==="left"&&s>=D.right-1||p==="right"&&s<=D.left+1){H();return}let $=!1;switch(p){case"top":$=I0(M,A,K,D.top+1,X,F.bottom-1);break;case"bottom":$=I0(M,A,K,F.top+1,X,D.bottom-1);break;case"left":$=I0(M,A,F.right-1,ae,D.left+1,ee);break;case"right":$=I0(M,A,D.right-1,ae,F.left+1,ee);break}if($)return;if(y&&!bJ(M,A,D)){H();return}if(!I&&E(M,A)){H();return}let Y=!1;switch(p){case"top":{const J=V?Xt/2:Xt*4,ne=V||z?s+J:s-J,W=V?s-J:z?s+J:s-J,ce=o+Xt+1,ye=z||V?F.bottom-Xt:F.top,pe=z?V?F.bottom-Xt:F.top:F.bottom-Xt;Y=M0(M,A,ne,ce,W,ce,F.left,ye,F.right,pe);break}case"bottom":{const J=V?Xt/2:Xt*4,ne=V||z?s+J:s-J,W=V?s-J:z?s+J:s-J,ce=o-Xt,ye=z||V?F.top+Xt:F.bottom,pe=z?V?F.top+Xt:F.bottom:F.top+Xt;Y=M0(M,A,ne,ce,W,ce,F.left,ye,F.right,pe);break}case"left":{const J=G?Xt/2:Xt*4,ne=G||q?o+J:o-J,W=G?o-J:q?o+J:o-J,ce=s+Xt+1,ye=q||G?F.right-Xt:F.left,pe=q?G?F.right-Xt:F.left:F.right-Xt;Y=M0(M,A,ye,F.top,pe,F.bottom,ce,ne,ce,W);break}case"right":{const J=G?Xt/2:Xt*4,ne=G||q?o+J:o-J,W=G?o-J:q?o+J:o-J,ce=s-Xt,ye=q||G?F.left+Xt:F.right,pe=q?G?F.left+Xt:F.right:F.left+Xt;Y=M0(M,A,ce,ne,ce,W,ye,F.top,pe,F.bottom);break}}Y?y||n.start(40,H):H()}};return r.__options={...e,blockPointerEvents:t},r}const vJ=N.createContext(void 0);function az(e){return N.useContext(vJ)}const NE="ArrowUp",RE="ArrowDown",OE="ArrowLeft",AE="ArrowRight",kE="Home",_E="End",ab=new Set([NE,RE,OE,AE,kE,_E]),SJ="Shift",wJ=[SJ,"Control","Alt","Meta"];function EJ(e){return Yt(e)&&e.tagName==="INPUT"}function MM(e){return!!(EJ(e)&&e.selectionStart!=null||Yt(e)&&e.tagName==="TEXTAREA")}function IM(e,t,n,r){if(!e||!t||!t.scrollTo)return;let s=e.scrollLeft,o=e.scrollTop;const l=e.clientWidth<e.scrollWidth,c=e.clientHeight<e.scrollHeight;if(l&&r!=="vertical"){const u=LM(e,t,"left"),f=L0(e),h=L0(t);n==="ltr"&&(u+t.offsetWidth+h.scrollMarginRight>e.scrollLeft+e.clientWidth-f.scrollPaddingRight?s=u+t.offsetWidth+h.scrollMarginRight-e.clientWidth+f.scrollPaddingRight:u-h.scrollMarginLeft<e.scrollLeft+f.scrollPaddingLeft&&(s=u-h.scrollMarginLeft-f.scrollPaddingLeft)),n==="rtl"&&(u-h.scrollMarginLeft<e.scrollLeft+f.scrollPaddingLeft?s=u-h.scrollMarginLeft-f.scrollPaddingLeft:u+t.offsetWidth+h.scrollMarginRight>e.scrollLeft+e.clientWidth-f.scrollPaddingRight&&(s=u+t.offsetWidth+h.scrollMarginRight-e.clientWidth+f.scrollPaddingRight))}if(c&&r!=="horizontal"){const u=LM(e,t,"top"),f=L0(e),h=L0(t);u-h.scrollMarginTop<e.scrollTop+f.scrollPaddingTop?o=u-h.scrollMarginTop-f.scrollPaddingTop:u+t.offsetHeight+h.scrollMarginBottom>e.scrollTop+e.clientHeight-f.scrollPaddingBottom&&(o=u+t.offsetHeight+h.scrollMarginBottom-e.clientHeight+f.scrollPaddingBottom)}e.scrollTo({left:s,top:o,behavior:"auto"})}function LM(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let s=0;for(;t.offsetParent&&(s+=t[r],t.offsetParent!==e);)t=t.offsetParent;return s}function L0(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function Mm(e){return e==="starting"?ZQ:hn}const cT=N.forwardRef(function(t,n){const{render:r,className:s,style:o,finalFocus:l,...c}=t,{store:u}=fl(),{side:f,align:h}=qx(),p=az()!=null,y=u.useState("open"),x=u.useState("transitionStatus"),b=u.useState("popupProps"),S=u.useState("mounted"),E=u.useState("instantType"),C=u.useState("activeTriggerElement"),R=u.useState("parent"),T=u.useState("lastOpenChangeReason"),O=u.useState("rootId"),k=u.useState("floatingRootContext"),M=u.useState("floatingTreeRoot"),A=u.useState("closeDelay"),L=u.useState("hoverEnabled"),I=u.useState("disabled"),j=u.useState("openMethod"),P=R.type==="context-menu";Ya({open:y,ref:u.context.popupRef,onComplete(){var z,q;y&&((q=(z=u.context).onOpenChangeComplete)==null||q.call(z,!0))}}),N.useEffect(()=>{function z(q){u.setOpen(!1,ht(q.reason,q.domEvent))}return M.events.on("close",z),()=>{M.events.off("close",z)}},[M.events,u]),ib(k,{enabled:L&&!I&&!P&&R.type!=="menubar",closeDelay:A});const B=u.useStateSetter("popupElement"),H={transitionStatus:x,side:f,align:h,open:y,nested:R.type==="menu",instant:E},D=It("div",t,{state:H,ref:[n,u.context.popupRef,B],stateAttributesMapping:dm,props:[b,{onKeyDown(z){p&&ab.has(z.key)&&z.stopPropagation()}},Mm(x),c,{"data-rootownerid":O}]});let F=R.type===void 0||P;return(C||R.type==="menubar"&&T!==D2)&&(F=!0),g.jsx(tT,{context:k,openInteractionType:j,modal:P,disabled:!S,returnFocus:l===void 0?F:l,initialFocus:R.type!=="menu",restoreFocus:!0,externalTree:R.type!=="menubar"?M:void 0,previousFocusableElement:C,nextFocusableElement:R.type===void 0?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:R.type===void 0?u.context.beforeContentFocusGuardRef:void 0,children:D})}),cz=N.createContext(void 0);function CJ(){const e=N.useContext(cz);if(e===void 0)throw new Error(Qt(32));return e}const uT=N.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,{store:o,parent:l}=fl();if(!(o.useState("mounted")||r))return null;const f=l.type==="menu"||l.type==="menubar"?"group":void 0;return g.jsx(cz.Provider,{value:r,children:g.jsx(Z2,{ref:n,...s,portalOwnerRole:f})})});function dT(e){return T2(19)?e:e?"true":void 0}const TJ=N.createContext(void 0);function fT(){const e=N.useContext(TJ);return(e==null?void 0:e.direction)??"ltr"}const NJ=e=>({name:"arrow",options:e,async fn(t){var G,K;const{x:n,y:r,placement:s,rects:o,platform:l,elements:c,middlewareData:u}=t,{element:f,padding:h=0,offsetParent:p="real"}=Ua(e,t)||{};if(f==null)return{};const y=C5(h),x={x:n,y:r},b=Y2(s),S=K2(b),E=await l.getDimensions(f),C=b==="y",R=C?"top":"left",T=C?"bottom":"right",O=C?"clientHeight":"clientWidth",k=o.reference[S]+o.reference[b]-x[b]-o.floating[S],M=x[b]-o.reference[b],A=p==="real"?await((G=l.getOffsetParent)==null?void 0:G.call(l,f)):c.floating;let L=c.floating[O]||o.floating[S];(!L||!await((K=l.isElement)==null?void 0:K.call(l,A)))&&(L=c.floating[O]||o.floating[S]);const I=k/2-M/2,j=L/2-E[S]/2-1,P=Math.min(y[R],j),B=Math.min(y[T],j),H=P,D=L-E[S]-B,F=L/2-E[S]/2+I,z=E5(H,F,D),q=!u.arrow&&al(s)!=null&&F!==z&&o.reference[S]/2-(F<H?P:B)-E[S]/2<0,V=q?F<H?F-H:F-D:0;return{[b]:x[b]+V,data:{[b]:z,centerOffset:F-z-V,...q&&{alignmentOffset:V}},reset:q}}}),RJ=(e,t)=>{const{name:n,fn:r}=NJ(e);return{name:n,fn:r,options:[e,t]}},OJ={name:"hide",async fn(e){const{width:t,height:n,x:r,y:s}=e.rects.reference,o=t===0&&n===0&&r===0&&s===0,l=await e.platform.detectOverflow(e,{elementContext:"reference"});return{data:{referenceHidden:l.top-n>=0||l.right-t>=0||l.bottom-n>=0||l.left-t>=0||o}}}},AJ={sideX:"left",sideY:"top"},kJ="--available-width",_J="--available-height",MJ="--anchor-width",IJ="--anchor-height",LJ="--transform-origin",DM=kJ,jM=_J;function uz(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function PM(e,t,n){const{rects:r,placement:s}=e;return{side:uz(t,oo(s),n),align:al(s)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function cb(e){return DJ(e,uJ)}function DJ(e,t){var Es,qn;const{anchor:n,positionMethod:r="absolute",side:s="bottom",sideOffset:o=0,align:l="center",alignOffset:c=0,collisionBoundary:u,collisionPadding:f=5,sticky:h=!1,arrowPadding:p=5,disableAnchorTracking:y=!1,inline:x,keepMounted:b=!1,floatingRootContext:S,mounted:E,collisionAvoidance:C,shift:R,nodeId:T,adaptiveOrigin:O,lazyFlip:k=!1,externalTree:M}=e,[A,L]=N.useState(null);!E&&A!==null&&L(null);const I=C.side||"flip",j=C.align||"flip",P=C.fallbackAxisSide||"end",B=(R==null?void 0:R.crossAxis)??!1,H=R==null?void 0:R.rootBoundary,D=typeof n=="function"?n:void 0,F=Ve(D),z=D?F:n,q=In(n),V=In(E),K=fT()==="rtl",X=A||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":K?"left":"right","inline-start":K?"right":"left"}[s],ee=l==="center"?X:`${X}-${l}`;let ae=f;typeof ae=="number"?ae={top:ae,right:ae,bottom:ae,left:ae}:ae&&(ae={top:ae.top||0,right:ae.right||0,bottom:ae.bottom||0,left:ae.left||0});const $=1,Y=s==="bottom"?$:0,J=s==="top"?$:0,ne=s==="right"?$:0,W=s==="left"?$:0,ce={boundary:u==="clipping-ancestors"?"clippingAncestors":u,padding:ae},ye=N.useRef(null),pe=In(o),le=In(c),re=typeof o!="function"?o:0,he=typeof c!="function"?c:0,Se=[];x&&Se.push(x),Se.push($Z(yt=>{const un=PM(yt,s,K),Gn=typeof pe.current=="function"?pe.current(un):pe.current,Rn=typeof le.current=="function"?le.current(un):le.current;return{mainAxis:Gn,crossAxis:Rn,alignmentAxis:Rn}},[re,he,K,s]));const _e=j==="none"&&I!=="shift",be=!_e&&(h||B||I==="shift"),Ae=I==="none"?null:qZ({...ce,padding:{top:ae.top+$+Y,right:ae.right+$+W,bottom:ae.bottom+$+J,left:ae.left+$+ne},mainAxis:!B&&I==="flip",crossAxis:j==="flip"?"alignment":!1,fallbackAxisSideDirection:P}),Me=_e?null:UZ({...ce,rootBoundary:H,mainAxis:j!=="none",crossAxis:be,limiter:h||B?void 0:VZ(yt=>{if(!ye.current)return{};const{width:un,height:Gn}=ye.current.getBoundingClientRect(),Rn=so(oo(yt.placement)),On=Rn==="y"?un:Gn,Ht=Rn==="y"?ae.left+ae.right:ae.top+ae.bottom;return{offset:On/2+Ht/2}})},[ce,h,B,H,ae,j]);I==="shift"||j==="shift"||l==="center"?Se.push(Me,Ae):Se.push(Ae,Me),Se.push(GZ({...ce,apply({elements:{floating:yt},availableWidth:un,availableHeight:Gn,rects:Rn}){if(!V.current)return;const On=yt.style;On.setProperty(DM,`${un}px`),On.setProperty(jM,`${Gn}px`);const Ht=pn(yt).devicePixelRatio||1,{x:Zt,y:Jt,width:Ur,height:Kn}=Rn.reference,Ln=(Math.round((Zt+Ur)*Ht)-Math.round(Zt*Ht))/Ht,cr=(Math.round((Jt+Kn)*Ht)-Math.round(Jt*Ht))/Ht;On.setProperty(MJ,`${Ln}px`),On.setProperty(IJ,`${cr}px`)}}),RJ(yt=>({element:ye.current||jt(yt.elements.floating).createElement("div"),padding:ye.current?p:0,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(yt){var ls,Ar,kr,as,fo,fr;const{elements:{floating:un},middlewareData:Gn,placement:Rn,platform:On,rects:Ht,y:Zt}=yt,Jt=oo(Rn),Ur=al(Rn),Kn=so(Jt)==="y",Ln=ye.current,cr=typeof o=="function"?o(PM(yt,s,K)):o;let ur;if(!Ln&&Ur&&Math.abs(Kn?((ls=Gn.shift)==null?void 0:ls.x)||0:((Ar=Gn.shift)==null?void 0:Ar.y)||0)<=1)ur=Ur==="start"===(Kn&&((kr=On.isRTL)==null?void 0:kr.call(On,un))===!0)?"100%":"0%";else{const Do=Kn?((as=Gn.arrow)==null?void 0:as.x)||0:((fo=Gn.arrow)==null?void 0:fo.y)||0,Cs=Kn?(Ln==null?void 0:Ln.clientWidth)||0:(Ln==null?void 0:Ln.clientHeight)||0;ur=`${Do+Cs/2}px`}let dr=Jt==="top"||Jt==="left"?`calc(100% + ${cr}px)`:`${-cr}px`;return be&&Kn&&Math.abs(((fr=Gn.shift)==null?void 0:fr.y)||0)>cr&&(dr=`${Ht.reference.y+Ht.reference.height/2-Zt}px`),un.style.setProperty(LJ,Kn?`${ur} ${dr}`:`${dr} ${ur}`),{}}},OJ,O),Be(()=>{!E&&S&&S.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[E,S]);const Le=N.useMemo(()=>({ancestorScroll:!y,elementResize:!y&&typeof ResizeObserver<"u",layoutShift:!y&&typeof IntersectionObserver<"u"}),[y]),{refs:ue,elements:Re,x:ze,y:ke,middlewareData:je,update:Ne,placement:ve,context:Fe,isPositioned:Ye,floatingStyles:xt}=t({rootContext:S,open:b?E:void 0,placement:ee,middleware:Se,strategy:r,whileElementsMounted:b?void 0:(...yt)=>TM(...yt,Le),nodeId:T,externalTree:M}),{sideX:nn,sideY:Ce}=je.adaptiveOrigin||AJ,De=Ye?r:"fixed",tt=N.useMemo(()=>{let yt;return Ye?O?yt={position:De,[nn]:ze,[Ce]:ke}:yt={...xt,position:De}:yt={position:De,top:0,left:0},yt[DM]="100vw",yt[jM]="100vh",Ye||(yt.opacity=0),yt},[O,De,nn,ze,Ce,ke,xt,Ye]),Ot=N.useRef(null);Be(()=>{if(!E)return;const yt=q.current,un=typeof yt=="function"?yt():yt,Rn=(zM(un)?un.current:un)||null||null;Rn!==Ot.current&&(ue.setPositionReference(Rn),Ot.current=Rn)},[E,ue,z,q]),N.useEffect(()=>{if(!E)return;const yt=q.current;typeof yt!="function"&&zM(yt)&&yt.current!==Ot.current&&(ue.setPositionReference(yt.current),Ot.current=yt.current)},[E,ue,z,q]),N.useEffect(()=>{if(b&&E&&Re.reference&&Re.floating)return TM(Re.reference,Re.floating,Ne,Le)},[b,E,Re,Ne,Le]);const gn=oo(ve),yn=uz(s,gn,K),Fr=al(ve)||"center",cn=!!((Es=je.hide)!=null&&Es.referenceHidden);Be(()=>{k&&E&&Ye&&gn!==X&&L(gn)},[k,E,Ye,gn,X]);const ar=N.useMemo(()=>{var yt,un;return{position:"absolute",top:(yt=je.arrow)==null?void 0:yt.y,left:(un=je.arrow)==null?void 0:un.x}},[je.arrow]),$r=((qn=je.arrow)==null?void 0:qn.centerOffset)!==0;return N.useMemo(()=>({positionerStyles:tt,arrowStyles:ar,arrowRef:ye,arrowUncentered:$r,side:yn,align:Fr,physicalSide:gn,anchorHidden:cn,refs:ue,context:Fe,isPositioned:Ye,update:Ne}),[tt,ar,ye,$r,yn,Fr,gn,cn,ue,Fe,Ye,Ne])}function zM(e){return e!=null&&"current"in e}function dz(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:s}=e,o=Ve(s),[,l]=N.useState(!1),c=Or(PJ).current,u=Or(jJ).current,f=N.useRef(0),h=N.useRef(!0),p=N.useRef(null),y=N.useRef(null),x=Ve(()=>{h.current||(h.current=!0,l(k=>!k))}),b=Ve((k,M)=>{u.set(k,M),x()}),S=Ve(k=>{u.delete(k),x()}),E=Ve(k=>{const M=new Map;return n.current.length=0,r&&(r.current.length=0),k.forEach(A=>{var L,I;M.set(A.element,{...A.registration.metadata??{},index:A.index}),n.current[A.index]=A.element,r&&(r.current[A.index]=A.registration.label!==void 0?A.registration.label:((I=(L=A.registration.textRef)==null?void 0:L.current)==null?void 0:I.textContent)??A.element.textContent)}),f.current=n.current.length,M});function C(k){var L;if((L=y.current)==null||L.disconnect(),y.current=null,typeof MutationObserver!="function"||k.length<2)return;const M=new MutationObserver(I=>{if(!HJ(I))return;let j=null;for(const P of k)if(P.isConnected){if(j&&fz(j,P)>0){M.disconnect(),x();return}j=P}});y.current=M;const A=new Set;for(let I=1;I<k.length;I+=1){const j=BJ(k[I-1],k[I]);j&&A.add(j)}A.forEach(I=>M.observe(I,{childList:!0}))}const R=Ve(()=>{const[k,M]=zJ(u),A=E(k),L=p.current,I=!L||L.length!==k.length||k.some((j,P)=>{const B=L[P];return j.index!==B.index||j.element!==B.element||j.registration.index!==B.registration.index||j.registration.metadata!==B.registration.metadata});C(M),p.current=k,h.current=!1,I&&(c.forEach(j=>j(A)),o(A))});Be(()=>(!h.current&&p.current&&E(p.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,E]),Be(()=>{h.current&&R()}),Be(()=>()=>{var k;(k=y.current)==null||k.disconnect(),h.current=!0},[]);const T=Ve(k=>(c.add(k),()=>{c.delete(k)})),O=N.useMemo(()=>({register:b,unregister:S,subscribeMapChange:T,nextIndexRef:f}),[b,S,T,f]);return g.jsx(p5.Provider,{value:O,children:t})}function jJ(){return new Map}function PJ(){return new Set}function zJ(e){const t=new Set,n=[],r=[];e.forEach((o,l)=>{if(!l.isConnected)return;const c=o.index,u={index:c??-1,element:l,registration:o};c===null?r.push(u):c>=0&&(t.add(c),n.push(u))});let s=0;return r.sort((o,l)=>fz(o.element,l.element)),r.forEach(o=>{for(;t.has(s);)s+=1;o.index=s,n.push(o),s+=1}),t.size>0&&n.sort((o,l)=>o.index-l.index),[n,r.map(o=>o.element)]}function BJ(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function HJ(e){for(const t of e)for(let n=0;n<t.removedNodes.length;n+=1)if(t.removedNodes[n].isConnected)return!0;return!1}function fz(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const hT=N.forwardRef(function(t,n){const{cutout:r,...s}=t;let o;if(r){const l=r.getBoundingClientRect();o=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${l.left}px ${l.top}px,${l.left}px ${l.bottom}px,${l.right}px ${l.bottom}px,${l.right}px ${l.top}px,${l.left}px ${l.top}px)`}return g.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});function ub(e,t,{styles:n,transitionStatus:r,props:s,refs:o,hidden:l,inert:c=!1}){const u={...n};return c&&(u.pointerEvents="none"),It("div",e,{state:t,ref:o,props:[{role:"presentation",hidden:l,style:u},Mm(r),s],stateAttributesMapping:Rf})}let BM={},HM={},FM="";function db(e,t){return am(e)?e:t}function $M(e,t,n){return/hidden|clip/.test(e.getComputedStyle(db(t,n)).overflowY)}function FJ(e){if(typeof document>"u")return!1;const t=jt(e);return pn(t).innerWidth-t.documentElement.clientWidth>0}function $J(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=jt(e),r=n.documentElement,s=n.body,o=db(r,s),l=o.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const u=o.offsetWidth;o.style.overflowY="hidden";const f=o.offsetWidth;return o.style.overflowY=l,r.style.scrollbarGutter=c,u===f}function UJ(e){const t=jt(e),n=t.documentElement,r=t.body,s=db(n,r),o={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,o)}}function VJ(e){var x;const t=jt(e),n=t.documentElement,r=t.body,s=pn(n);let o=0,l=0,c=!1;const u=ys.create();if(Ka&&(((x=s.visualViewport)==null?void 0:x.scale)??1)!==1)return()=>{};function f(){const b=s.getComputedStyle(n),S=s.getComputedStyle(r),R=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,l=n.scrollLeft,BM={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},FM=n.style.scrollBehavior,HM={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const T=n.scrollHeight>n.clientHeight,O=n.scrollWidth>n.clientWidth,k=b.overflowY==="scroll"||S.overflowY==="scroll",M=b.overflowX==="scroll"||S.overflowX==="scroll",A=Math.max(0,s.innerWidth-r.clientWidth),L=Math.max(0,s.innerHeight-r.clientHeight),I=parseFloat(S.marginTop)+parseFloat(S.marginBottom),j=parseFloat(S.marginLeft)+parseFloat(S.marginRight),P=db(n,r);if(c=$J(e),c){n.style.scrollbarGutter=R,P.style.overflowY="hidden",P.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:R,overflowY:"hidden",overflowX:"hidden"}),(T||k)&&(n.style.overflowY="scroll"),(O||M)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:I||L?`calc(100dvh - ${I+L}px)`:"100dvh",width:j||A?`calc(100vw - ${j+A}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function h(){Object.assign(n.style,BM),Object.assign(r.style,HM),c||(n.scrollTop=o,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=FM)}function p(){h(),u.request(f)}f();const y=bt(s,"resize",p);return()=>{u.cancel(),h(),typeof s.removeEventListener=="function"&&y()}}class qJ{constructor(){Dt(this,"lockCount",0);Dt(this,"restore",null);Dt(this,"timeoutLock",co.create());Dt(this,"timeoutUnlock",co.create());Dt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Dt(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const n=jt(t),r=n.documentElement,s=n.body,o=pn(r);if($M(o,r,s)){const c=new o.MutationObserver(()=>{$M(o,r,s)||(c.disconnect(),this.restore=null,this.lock(t))}),u={attributes:!0};c.observe(r,u),c.observe(s,u),this.restore=()=>c.disconnect();return}const l=Kx||!FJ(t);this.restore=l?UJ(t):VJ(t)}}const GJ=new qJ;function hz(e=!0,t=null){Be(()=>{if(e)return GJ.acquire(t)},[e,t])}const KJ=20;function pz(e,t,n,r){const[s,o]=N.useState(!1);Be(()=>{if(!e||!t||n==null){o(!1);return}const l=jt(n).documentElement.clientWidth,c=n.offsetWidth;o(l>0&&c>0&&c>=l-KJ)},[e,t,n]),hz(e&&(!t||s),r)}const pT=N.forwardRef(function(t,n){var Le;const{anchor:r,positionMethod:s="absolute",className:o,render:l,side:c,align:u,sideOffset:f=0,alignOffset:h=0,collisionBoundary:p="clipping-ancestors",collisionPadding:y=5,arrowPadding:x=5,sticky:b=!1,disableAnchorTracking:S=!1,collisionAvoidance:E=JQ,style:C,...R}=t,{store:T}=fl(),O=CJ(),k=L2(!0),M=T.useState("parent"),A=T.useState("floatingRootContext"),L=T.useState("floatingTreeRoot"),I=T.useState("mounted"),j=T.useState("open"),P=T.useState("modal"),B=T.useState("openMethod"),H=T.useState("activeTriggerElement"),D=T.useState("transitionStatus"),F=T.useState("positionerElement"),z=T.useState("instantType"),q=T.useState("adaptiveOrigin"),V=T.useState("lastOpenChangeReason"),G=T.useState("floatingNodeId"),K=T.useState("floatingParentNodeId"),X=A.useState("domReferenceElement"),ee=N.useRef(null),ae=mm(F);let $=r,Y=f,J=h,ne=u,W=E;M.type==="context-menu"&&($=r??((Le=M.context)==null?void 0:Le.anchor),ne=ne??"start",!c&&ne!=="center"&&(J=t.alignOffset??2,Y=t.sideOffset??-5));let ce=c,ye=ne;M.type==="menu"?(ce=ce??"inline-end",ye=ye??"start",W=t.collisionAvoidance??Jx):M.type==="menubar"&&(ce=ce??(M.context.orientation==="vertical"?"inline-end":"bottom"),ye=ye??"start");const pe=M.type==="context-menu",le=cb({anchor:$,floatingRootContext:A,positionMethod:k?"fixed":s,mounted:I,side:ce,sideOffset:Y,align:ye,alignOffset:J,arrowPadding:pe?0:x,collisionBoundary:p,collisionPadding:y,sticky:b,nodeId:G,keepMounted:O,disableAnchorTracking:S,collisionAvoidance:W,shift:pe?{crossAxis:!("side"in W&&W.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:L,adaptiveOrigin:q});N.useEffect(()=>{function ue(Re){Re.open&&(Re.parentNodeId===G&&T.set("hoverEnabled",!1),Re.nodeId!==G&&Re.parentNodeId===T.select("floatingParentNodeId")&&T.setOpen(!1,ht(Nd)))}return L.events.on("menuopenchange",ue),()=>{L.events.off("menuopenchange",ue)}},[T,L.events,G]),N.useEffect(()=>{if(T.select("floatingParentNodeId")==null)return;function ue(Re){if(Re.open||Re.nodeId!==T.select("floatingParentNodeId"))return;const ze=Re.reason??Nd;T.setOpen(!1,ht(ze))}return L.events.on("menuopenchange",ue),()=>{L.events.off("menuopenchange",ue)}},[L.events,T]);const re=ns();N.useEffect(()=>{j||re.clear()},[j,re]),N.useEffect(()=>{function ue(Re){if(!(!j||Re.nodeId!==T.select("floatingParentNodeId")))if(Re.target&&H&&H!==Re.target){const ze=T.select("closeDelay");ze>0?re.isStarted()||re.start(ze,()=>{T.setOpen(!1,ht(Nd))}):T.setOpen(!1,ht(Nd))}else re.clear()}return L.events.on("itemhover",ue),()=>{L.events.off("itemhover",ue)}},[L.events,j,H,T,re]),N.useEffect(()=>{const ue={open:j,nodeId:G,parentNodeId:K,reason:T.select("lastOpenChangeReason")};L.events.emit("menuopenchange",ue)},[L.events,j,T,G,K]),Be(()=>{const ue=X,Re=ee.current;if(ue&&(ee.current=ue),Re&&ue&&ue!==Re){T.set("instantType",void 0);const ze=new AbortController;return ae(()=>{T.set("instantType","trigger-change")},ze.signal),()=>{ze.abort()}}},[X,ae,T]);const he={open:j,side:le.side,align:le.align,anchorHidden:le.anchorHidden,nested:M.type==="menu",instant:z},Se=M.type==="menubar"&&M.context.modal;pz(j&&(Se||P&&V!==wn),B==="touch",F,H);const be=ub(t,he,{styles:le.positionerStyles,transitionStatus:D,props:R,refs:[n,T.useStateSetter("positionerElement")],hidden:!I,inert:!j}),Ae=I&&M.type!=="menu"&&(M.type!=="menubar"&&P&&V!==wn||M.type==="menubar"&&M.context.modal);let Me=null;return M.type==="menubar"?Me=M.context.contentElement:M.type===void 0&&(Me=H),g.jsxs(l5.Provider,{value:le,children:[Ae&&g.jsx(hT,{ref:M.type==="context-menu"||M.type==="nested-context-menu"?M.context.internalBackdropRef:null,inert:dT(!j),cutout:Me}),g.jsx(eb,{id:G,children:g.jsx(dz,{elementsRef:T.context.itemDomElements,labelsRef:T.context.itemLabels,children:be})})]})}),mz=N.createContext(null);function mT(e){const t=N.useContext(mz);if(t===null&&!e)throw new Error(Qt(5));return t}function YJ(e){const t=N.useRef(""),n=N.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:N.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function gz(e,t){const n=N.useRef(e),r=Ve(t);Be(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function gT(e,t){const n=Ve((o,l)=>{(typeof e=="function"?e():e)||t(l||(Kx?"touch":""))}),{onClick:r,onPointerDown:s}=YJ(n);return N.useMemo(()=>({onClick:r,onPointerDown:s}),[r,s])}function WJ(e){const[t,n]=N.useState(null),r=gT(e,n);return gz(e,s=>{s&&!e&&n(null)}),N.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}const XJ={...Om,disabled:e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0),openMethod:e=>e.openMethod,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId,activeIndex:e=>e.activeIndex,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")}};class QJ extends Af{constructor(n,r,s=!1){const o=new Nm,l=JJ(o,r,s,n);super(l,ZJ(o),XJ);Dt(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",c=>{var u;if((u=this.unsubscribeParentListener)==null||u.call(this),c.type==="menu"){let f=c.store.select("rootId"),h=c.store.select("floatingTreeRoot"),p=c.store.select("keyboardEventRelay");this.unsubscribeParentListener=c.store.subscribe(()=>{const y=c.store.select("rootId"),x=c.store.select("floatingTreeRoot"),b=c.store.select("keyboardEventRelay");f===y&&h===x&&p===b||(f=y,h=x,p=b,this.notifyAll())}),this.context.allowMouseUpTriggerRef=c.store.context.allowMouseUpTriggerRef;return}c.type!==void 0&&(this.context.allowMouseUpTriggerRef=c.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(n,r){this.state.floatingRootContext.context.events.emit("setOpen",{open:n,eventDetails:r})}}function ZJ(e){return{positionerRef:N.createRef(),popupRef:N.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:N.createRef(),beforeContentFocusGuardRef:N.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function JJ(e,t,n=!1,r){return{...Rm(e,t,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new J2,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:hn,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}const yz=N.createContext(void 0);function xz(){return N.useContext(yz)}const yT=Of(function(t){const{children:n,open:r,onOpenChange:s,onOpenChangeComplete:o,defaultOpen:l=!1,disabled:c=!1,modal:u,loopFocus:f=!0,orientation:h="vertical",actionsRef:p,closeParentOnEsc:y=!1,handle:x,triggerId:b,defaultTriggerId:S=null,highlightItemOnHover:E=!0}=t,C=L2(!0),R=fl(!0),T=mT(!0),O=xz(),k=N.useMemo(()=>O&&R?{type:"menu",store:R.store}:T?{type:"menubar",context:T}:C&&!R?{type:"context-menu",context:C}:{type:void 0},[C,R,T,O]),M=lf(),A=lf(),L=wu(),I=k.type==="menu"?k.store:void 0,j=(r??l)&&(I==null?void 0:I.state.transitionStatus)==="starting",P=Or(()=>j?I==null?void 0:I.state.instantType:void 0).current,B=eee({open:l,openProp:r,activeTriggerId:S,triggerIdProp:b,parent:k,disabled:c,highlightItemOnHover:E,modal:k.type===void 0?u:void 0,rootId:M,instantType:P},A,L!=null);B.useControlledProp("openProp",r),B.useControlledProp("triggerIdProp",b),B.useContextCallback("onOpenChangeComplete",o);const H=B.useState("floatingTreeRoot"),D=ym(H),F=B.useState("open"),z=B.useState("activeTriggerElement"),q=B.useState("positionerElement"),V=B.useState("hoverEnabled"),G=B.useState("disabled"),K=B.useState("lastOpenChangeReason"),X=B.useState("parent"),ee=B.useState("activeIndex"),ae=B.useState("payload"),$=B.useState("floatingParentNodeId"),Y=N.useRef(null),J=N.useRef(X.type!=="context-menu"),ne=ns(),W=N.useRef(!0),ce=ns(),ye=$!=null,{openMethod:pe,triggerProps:le}=WJ(F);B.useSyncedValues({disabled:c,highlightItemOnHover:E,modal:X.type===void 0?u:void 0,openMethod:pe,rootId:M}),Em(B);const{forceUnmount:re,transitionStatus:he}=Cm(F,B,()=>{B.set("allowMouseEnter",!1)},j),Se=mm(B.context.popupRef);N.useEffect(()=>{if(P===void 0)return;const De=()=>{B.state.instantType===P&&B.set("instantType",void 0)};if(!F){De();return}if(he!==void 0)return;if(B.context.popupRef.current==null){De();return}const tt=new AbortController;return Se(De,tt.signal),()=>{tt.abort()}},[P,F,he,Se,B]),Be(()=>{C&&!R?B.update({parent:{type:"context-menu",context:C},floatingNodeId:D,floatingParentNodeId:L}):R&&B.update({floatingNodeId:D,floatingParentNodeId:L})},[C,R,D,L,B]),N.useEffect(()=>{if(F||(Y.current=null),X.type==="context-menu"){if(!F){ne.clear(),J.current=!1;return}ne.start(500,()=>{J.current=!0})}},[ne,F,X.type]),Be(()=>{!F&&!V&&B.set("hoverEnabled",!0)},[F,V,B]);const _e=Ve((De,tt)=>{const Ot=tt.reason;if(!De&&!B.select("open")||F===De&&tt.trigger===z&&K===Ot)return;const gn=sT(tt);if(!De&&tt.trigger==null&&(tt.trigger=z??void 0),s==null||s(De,tt),tt.isCanceled)return;B.state.floatingRootContext.dispatchOpenChange(De,tt);const yn=tt.event;if(De===!1&&(yn==null?void 0:yn.type)==="click"&&yn.pointerType==="touch"&&!W.current)return;De&&Ot===Dd?(W.current=!1,ce.start(300,()=>{W.current=!0})):(W.current=!0,ce.clear());const Fr=(Ot===ui||Ot===j2)&&yn.detail===0,cn=!De&&(Ot===hm||Ot==null);Y.current=tt.event;const ar=ob(B.state,De,tt.trigger,gn());ar.openChangeReason=Ot,X.type==="menubar"&&(Ot===Dd||Ot===ou||Ot===wn||Ot===Rp||Ot===Nd)?ar.instantType="group":Fr||cn?ar.instantType=Fr?"click":"dismiss":ar.instantType=void 0,B.update(ar)}),be=tz({popupStore:B,floatingRootContext:B.state.floatingRootContext,floatingId:A,nested:L!=null,onOpenChange:_e}),Ae=be.context.events;Be(()=>{const De=({open:tt,eventDetails:Ot})=>_e(tt,Ot);return Ae.on("setOpen",De),()=>{Ae==null||Ae.off("setOpen",De)}},[Ae,_e]);const Me=N.useCallback(()=>{B.setOpen(!1,ht(pm))},[B]);N.useImperativeHandle(p,()=>({unmount:re,close:Me}),[re,Me]);let Le;X.type==="context-menu"&&(Le=X.context),N.useImperativeHandle(Le==null?void 0:Le.positionerRef,()=>q,[q]),N.useImperativeHandle(Le==null?void 0:Le.actionsRef,()=>({setOpen:_e}),[_e]);const ue=xm(be,{enabled:!G,bubbles:{escapeKey:y&&X.type==="menu"},outsidePress(){var De;return X.type!=="context-menu"||((De=Y.current)==null?void 0:De.type)==="contextmenu"?!0:J.current},externalTree:ye?H:void 0}),Re=fT(),ze=N.useCallback(De=>{B.select("activeIndex")!==De&&B.set("activeIndex",De)},[B]),ke=gJ(be,{enabled:!G,listRef:B.context.itemDomElements,activeIndex:ee,nested:X.type!==void 0,loopFocus:f,orientation:h,parentOrientation:X.type==="menubar"?X.context.orientation:void 0,rtl:Re==="rtl",disabledIndices:Ba,onNavigate:ze,openOnArrowKeyDown:X.type!=="context-menu",externalTree:ye?H:void 0,focusItemOnHover:E}),je=N.useCallback(De=>{B.context.typingRef.current=De},[B]),Ne=yJ(be,{enabled:!G,listRef:B.context.itemLabels,elementsRef:B.context.itemDomElements,activeIndex:ee,resetMs:QQ,onMatch:De=>{F&&De!==ee&&B.set("activeIndex",De)},onTyping:je}),ve=N.useMemo(()=>{const De=Ji(Ne.reference,ke.reference,ue.reference,{onMouseMove(){B.set("allowMouseEnter",!0)}},le);return De["aria-haspopup"]="menu",De["aria-expanded"]=F,De},[B,Ne.reference,ke.reference,ue.reference,le,F]),Fe=N.useMemo(()=>{const De=Ji(ke.trigger,ue.trigger,le);return De["aria-haspopup"]="menu",De["aria-expanded"]=!1,De},[ke.trigger,ue.trigger,le]);Or(()=>(B.update({inactiveTriggerProps:Fe}),null));const Ye=N.useMemo(()=>Ji(vm,{id:A,role:"menu","aria-orientation":h==="horizontal"?"horizontal":void 0,"aria-labelledby":z==null?void 0:z.id,onMouseMove(){B.set("allowMouseEnter",!0),X.type==="menu"&&B.set("hoverEnabled",!1)},onClick(){B.select("hoverEnabled")&&B.set("hoverEnabled",!1)},onKeyDown(De){const tt=B.select("keyboardEventRelay");tt&&!De.isPropagationStopped()&&tt(De)}},Ne.floating,ke.floating,ue.floating),[z,A,h,X.type,B,Ne.floating,ke.floating,ue.floating]),xt=ke.item??hn;Tm(B,{floatingRootContext:be,activeTriggerProps:ve,inactiveTriggerProps:Fe,popupProps:Ye,itemProps:xt});const nn=N.useMemo(()=>({store:B,parent:k}),[B,k]),Ce=g.jsxs(a5.Provider,{value:nn,children:[x&&g.jsx(Sm,{handle:x,store:B}),typeof n=="function"?n({payload:ae}):n]});return X.type===void 0||X.type==="context-menu"?g.jsx(tb,{externalTree:H,children:Ce}):Ce});function eee(e,t,n){return Or(()=>new QJ(e,t,n)).current}function tee(e){const t=fl().store,n=N.useMemo(()=>({parentMenu:t}),[t]);return g.jsx(yz.Provider,{value:n,children:g.jsx(yT,{...e})})}const D0=5;function nee(e,t){const n=ree(t);return e.clientX>=n.left-D0&&e.clientX<=n.right+D0&&e.clientY>=n.top-D0&&e.clientY<=n.bottom+D0}function ree(e){const t=e.getBoundingClientRect(),n=pn(e);if(B2)return t;const r=n.getComputedStyle(e,"::before"),s=n.getComputedStyle(e,"::after");if(!(r.content!=="none"||s.content!=="none"))return t;const l=parseFloat(r.width)||0,c=parseFloat(r.height)||0,u=parseFloat(s.width)||0,f=parseFloat(s.height)||0,h=Math.max(t.width,l,u),p=Math.max(t.height,c,f),y=h-t.width,x=p-t.height;return{left:t.left-y/2,right:t.right+y/2,top:t.top-x/2,bottom:t.bottom+x/2}}function see(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=C2(),{ref:s,index:o}=Yx(e),l=n===o,c=N.useRef(null),u=za(s,c);return{compositeProps:{tabIndex:l?0:-1,onFocus(){r(o)},onMouseMove(){const h=c.current;if(!t||!h)return;const p=h.hasAttribute("disabled")||h.ariaDisabled==="true";!l&&!p&&h.focus()}},compositeRef:u,index:o}}function oee(e){const{render:t,className:n,style:r,state:s=hn,props:o=Ba,refs:l=Ba,metadata:c,stateAttributesMapping:u,tag:f="div",...h}=e,{compositeProps:p,compositeRef:y}=see({metadata:c});return It(f,e,{state:s,ref:[y,...l],props:[p,...o,h],stateAttributesMapping:u})}function bz(e){if(Yt(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid");if(!Zi(e))return bz(ll(e))}function vz(e,t){const n=N.useRef(null);function r(o){Us.flushSync(()=>{e.setOpen(!1,ht(ou,o.nativeEvent,o.currentTarget))});const l=KQ(n.current);l==null||l.focus()}function s(o){var c;const l=e.select("positionerElement");if(l&&Pd(o,l))(c=e.context.beforeContentFocusGuardRef.current)==null||c.focus();else{Us.flushSync(()=>{e.setOpen(!1,ht(ou,o.nativeEvent,o.currentTarget))});let u=GQ(e.context.triggerFocusTargetRef.current||t.current);for(;u!==null&&Je(l,u);){const f=u;if(u=X2(u),u===f)break}u==null||u.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:s}}function iee(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,s=N.useRef(!1);return N.useMemo(()=>t?{onMouseDown:o=>{(n==="open"&&!r||n==="close"&&r)&&(s.current=!0,jt(o.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:o=>{s.current&&(s.current=!1,o.preventBaseUIHandler())}}:hn,[t,n,r])}const Sz=bm(function(t,n){const{render:r,className:s,style:o,disabled:l=!1,nativeButton:c=!0,id:u,openOnHover:f,delay:h=100,closeDelay:p=0,handle:y,payload:x,...b}=t,S=fl(!0),C=Am(y)??(S==null?void 0:S.store);if(!C)throw new Error(Qt(85));const R=is(u),T=C.useState("isTriggerActive",R),O=C.useState("floatingRootContext"),k=C.useState("isOpenedByTrigger",R),M=C.useState("triggerPopupId",R),A=N.useRef(null),L=aee(),I=C2(!0),j=hl(),P=N.useMemo(()=>j??new J2,[j]),B=ym(P),H=wu(),{registerTrigger:D,isMountedByThisTrigger:F}=wm(R,A,C,{payload:x,closeDelay:p,parent:L,floatingTreeRoot:P,floatingNodeId:B,floatingParentNodeId:H,keyboardEventRelay:I==null?void 0:I.relayKeyboardEvent}),z=L.type==="menubar",q=C.useState("disabled"),V=l||q||z&&L.context.disabled,{getButtonProps:G,buttonRef:K}=vu({disabled:V,native:c});N.useEffect(()=>{!k&&L.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,k,L.type]);const X=N.useRef(null),ee=ns(),ae=Ve(Le=>{if(!X.current)return;ee.clear(),C.context.allowMouseUpTriggerRef.current=!1;const ue=Le.target;Je(X.current,ue)||Je(C.select("positionerElement"),ue)||ue===X.current||ue!=null&&bz(ue)===C.select("rootId")||nee(Le,X.current)||P.events.emit("close",{domEvent:Le,reason:tQ})});N.useEffect(()=>{k&&C.select("lastOpenChangeReason")===wn&&jt(X.current).addEventListener("mouseup",ae,{once:!0})},[k,ae,C]);const $=z&&L.context.hasSubmenuOpen,J=km(O,{enabled:(f??$)&&!V&&(!z||$&&!F),handleClose:_m({blockPointerEvents:!z}),mouseOnly:!0,move:!1,restMs:L.type===void 0?h:void 0,delay:{close:p},triggerElementRef:A,externalTree:P,isActiveTrigger:T,isClosing:()=>C.select("transitionStatus")==="ending"}),ne=lee(k,C.select("lastOpenChangeReason")),W=nb(O,{enabled:!V,event:k&&z?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:L.type===void 0?ne:!1}),ce=iT(O,{enabled:!V&&$}),ye=iee({open:k,enabled:z,mouseDownAction:"open"}),pe=N.useMemo(()=>Ji(ce.reference,W.reference),[ce.reference,W.reference]),le=C.useState("triggerProps",F),{preFocusGuardRef:re,handlePreFocusGuardFocus:he,handleFocusTargetFocus:Se}=vz(C,A),_e={disabled:V,open:k},be=[X,n,K,D,A],Ae=[pe,J??hn,le,{"aria-haspopup":"menu","aria-controls":M,id:R,onMouseDown:Le=>{if(C.select("open"))return;ee.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),jt(Le.currentTarget).addEventListener("mouseup",ae,{once:!0})}},z?{role:"menuitem"}:{},ye,b,G],Me=It("button",t,{enabled:!z,stateAttributesMapping:pE,state:_e,ref:be,props:Ae});return z?g.jsx(oee,{tag:"button",render:r,className:s,style:o,state:_e,refs:be,props:Ae,stateAttributesMapping:pE}):k?g.jsxs(N.Fragment,{children:[g.jsx($a,{ref:re,onFocus:he},`${R}-pre-focus-guard`),g.jsx(N.Fragment,{children:Me},R),g.jsx($a,{ref:C.context.triggerFocusTargetRef,onFocus:Se},`${R}-post-focus-guard`)]}):g.jsx(N.Fragment,{children:Me},R)});function lee(e,t){const n=ns(),[r,s]=N.useState(!1);return Be(()=>{e&&t===wn?(s(!0),n.start(j5,()=>{s(!1)})):e||(n.clear(),s(!1))},[e,t,n]),r}function aee(){const e=mT(!0);return N.useMemo(()=>e?{type:"menubar",context:e}:{type:void 0},[e])}const wz=N.forwardRef(function(t,n){const{className:r,render:s,orientation:o="horizontal",style:l,...c}=t;return It("div",t,{state:{orientation:o},ref:n,props:[{role:"separator","aria-orientation":o},c]})});function cee(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const uee={"aria-expanded":void 0},dee=N.forwardRef(function(t,n){const{render:r,className:s,style:o,label:l,id:c,nativeButton:u=!1,openOnHover:f=!0,delay:h=100,closeDelay:p=0,disabled:y=!1,...x}=t,b=xz();if(!(b!=null&&b.parentMenu))throw new Error(Qt(37));const S=Yx({guess:!0,label:l}),E=qx(),{store:C}=fl(),R=is(c),T=C.useState("open"),O=C.useState("floatingRootContext"),k=C.useState("floatingTreeRoot"),M=C.useState("triggerPopupId",R),A=rz(R,C),L=Ve(pe=>{A(pe),pe!==null&&C.select("open")&&C.select("activeTriggerId")==null&&C.update({activeTriggerId:R??null,activeTriggerElement:pe,closeDelay:p})}),I=N.useRef(null),j=N.useCallback(pe=>{I.current=pe,C.set("activeTriggerElement",pe)},[C]);Be(()=>(L(I.current),()=>L(null)),[L,R,C]),C.useSyncedValue("closeDelay",p);const P=b.parentMenu,B=C.useState("disabled"),H=P.useState("disabled"),D=y||B||H,F=P.useState("itemProps"),z=P.useState("isActive",S.index),q=N.useMemo(()=>({type:"submenu-trigger",setActive(){P.select("highlightItemOnHover")&&P.set("activeIndex",S.index)}}),[P,S.index]),{getItemProps:V,itemRef:G}=H2({closeOnClick:!1,disabled:D,highlighted:z,id:R,store:C,typingRef:P.context.typingRef,nativeButton:u,itemMetadata:q,nodeId:E==null?void 0:E.context.nodeId}),K=C.useState("hoverEnabled"),X=km(O,{enabled:K&&f&&!D,handleClose:_m({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:h,delay:{open:h,close:p},shouldOpen:h>0?()=>P.select("allowMouseEnter"):void 0,triggerElementRef:I,externalTree:k,isClosing:()=>C.select("transitionStatus")==="ending",guardStaleOpen:!0}),ae=nb(O,{enabled:!D,event:"mousedown",toggle:!f,ignoreMouse:f,stickIfOpen:!1}).reference??hn,$=C.useState("triggerProps",!0);delete $.id;const Y={disabled:D,highlighted:z,open:T},J=C.useState("openMethod"),W=C.useState("lastOpenChangeReason")===Rp||J==="keyboard";return It("div",t,{state:Y,stateAttributesMapping:um,props:[ae,X,$,F,T&&W&&f5?uee:void 0,{"aria-controls":M,tabIndex:T||z?0:-1,onBlur(){z&&P.set("activeIndex",null)}},x,V],ref:[n,S.ref,G,L,j]})}),Ez="relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden select-none focus:bg-muted data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0";function Cz({...e}){return g.jsx(yT,{"data-slot":"dropdown-menu",...e})}function Tz({...e}){return g.jsx(Sz,{"data-slot":"dropdown-menu-trigger",...e})}function Nz({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:s,...o}){return g.jsx(uT,{children:g.jsx(pT,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:g.jsx(cT,{"data-slot":"dropdown-menu-content",className:xe("z-50 max-h-(--available-height) min-w-56 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border border-foreground bg-popover p-1 text-popover-foreground outline-none duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",s),...o})})})}function Bd({className:e,...t}){return g.jsx(b5,{"data-slot":"dropdown-menu-item",className:xe(Ez,e),...t})}function Ske({className:e,children:t,checked:n,...r}){return g.jsxs(g5,{"data-slot":"dropdown-menu-checkbox-item",className:xe(Ez,e),checked:n,...r,children:[g.jsx("span",{className:"pointer-events-none flex size-4 shrink-0 items-center justify-center rounded-sm border border-input bg-card","data-slot":"dropdown-menu-checkbox-item-indicator",children:g.jsx(y5,{children:g.jsx(Su,{className:"size-3",strokeWidth:3})})}),t]})}function Rz({className:e,...t}){return g.jsx(wz,{"data-slot":"dropdown-menu-separator",className:xe("-mx-1 my-1 h-px bg-border",e),...t})}const UM="Settings",fee="Explain this review",hee="Delete",pee="Switch to dark mode",mee="Switch to light mode",gee="flex size-8 shrink-0 items-center justify-center rounded-md text-sign-muted hover:bg-sign-foreground/10 hover:text-sign-foreground focus-visible:outline-2 focus-visible:outline-sign-foreground aria-expanded:bg-sign-foreground/15 aria-expanded:text-sign-foreground",yee={agents:bX,forges:kX,configurations:RX,repositories:OX,review:Ld},xee=({useThemeToggle:e})=>{const{theme:t,onToggle:n}=e(),r=t==="dark"?PX:DX;return g.jsxs(Bd,{onClick:n,children:[g.jsx(r,{"aria-hidden":"true",className:"size-3.5"}),t==="dark"?mee:pee]})},bee=({actions:e})=>g.jsxs(g.Fragment,{children:[e.forgeLink===null?null:g.jsxs(Bd,{render:g.jsx("a",{href:e.forgeLink.href,target:"_blank",rel:"noreferrer","aria-label":e.forgeLink.label}),children:[g.jsx(M3,{"aria-hidden":"true",className:"size-3.5"}),e.forgeLink.label]}),e.onWriteUp===null?null:g.jsxs(Bd,{onClick:e.onWriteUp,children:[g.jsx(jX,{"aria-hidden":"true",className:"size-3.5"}),fee]}),g.jsxs(Bd,{className:"text-destructive focus:bg-destructive/10",onClick:e.onDelete,children:[g.jsx(_2,{"aria-hidden":"true",className:"size-3.5"}),hee]}),g.jsx(Rz,{})]}),ME=({links:e,useThemeToggle:t,reviewActions:n=null})=>g.jsxs(Cz,{children:[g.jsx(Tz,{"aria-label":UM,title:UM,className:gee,children:g.jsx(X3,{"aria-hidden":"true",className:"size-4"})}),g.jsxs(Nz,{align:"end",children:[n===null?null:g.jsx(bee,{actions:n}),g.jsx(xee,{useThemeToggle:t}),g.jsx(Rz,{}),e.map(({label:r,icon:s,link:o})=>{const l=yee[s];return g.jsxs(Bd,{render:o,children:[g.jsx(l,{"aria-hidden":"true",className:"size-3.5"}),r]},r)})]})]}),vee={column:"max-w-5xl px-4 sm:px-6",full:"px-6"},See=({brand:e,width:t="column",children:n})=>g.jsx("header",{className:"sticky top-0 z-40 bg-sign text-sign-foreground",children:g.jsxs("div",{className:xe("mx-auto flex h-14 w-full items-center justify-between gap-6",vee[t]),children:[e,n]})}),Oz=N.createContext(void 0);function Im(e){const t=N.useContext(Oz);if(t===void 0&&!e)throw new Error(Qt(72));return t}const wee={...Om,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class Eee extends Af{constructor(n,r,s){const o=new Nm;super(Cee(n,o,r,s),Tee(o),wee);Dt(this,"setOpen",(n,r)=>{sz(this,n,r,{extraState:{openChangeReason:r.reason}})})}cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,ht(ui,n))}}function Cee(e,t,n,r=!1){return{...Rm(t,n,r),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e}}function Tee(e){return{popupRef:N.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const Nee=Of(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:s,disableHoverablePopup:o=!1,trackCursorAxis:l="none",actionsRef:c,onOpenChange:u,onOpenChangeComplete:f,handle:h,triggerId:p,defaultTriggerId:y=null,children:x}=t,b=sb((P,B)=>new Eee({open:r,openProp:s,activeTriggerId:y,triggerIdProp:p},P,B));b.useControlledProp("openProp",s),b.useControlledProp("triggerIdProp",p),b.useContextCallback("onOpenChange",u),b.useContextCallback("onOpenChangeComplete",f);const S=b.useState("open"),E=!n&&S,C=b.useState("activeTriggerId"),R=b.useState("mounted"),T=b.useState("payload");b.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:o,disabled:n}),Em(b,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:O,transitionStatus:k}=Cm(E,b),M=b.useState("isInstantPhase"),A=b.useState("instantType"),L=b.useState("lastOpenChangeReason"),I=N.useRef(null);Be(()=>{S&&n&&b.setOpen(!1,ht(nQ))},[S,n,b]),Be(()=>{k==="ending"&&L===fm||k!=="ending"&&M?(A!=="delay"&&(I.current=A),b.set("instantType","delay")):I.current!==null&&(b.set("instantType",I.current),I.current=null)},[k,M,L,A,b]),Be(()=>{E&&C==null&&b.set("payload",void 0)},[b,C,E]),N.useImperativeHandle(c,()=>({unmount:O,close:()=>b.setOpen(!1,ht(pm))}),[O,b]);const j=E||R||!n&&l!=="none";return g.jsxs(Oz.Provider,{value:b,children:[h&&g.jsx(Sm,{handle:h,store:b}),j&&g.jsx(Ree,{store:b,disabled:n,trackCursorAxis:l}),typeof x=="function"?x({payload:T}):x]})});function Ree({store:e,disabled:t,trackCursorAxis:n}){const r=e.useState("floatingRootContext"),s=xm(r,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),o=oZ(r,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),l=N.useMemo(()=>Ji(o.reference,s.reference),[o.reference,s.reference]);return Tm(e,{activeTriggerProps:l,inactiveTriggerProps:l,popupProps:s.floating??hn}),null}const Oee=N.createContext(void 0);function Aee(){return N.useContext(Oee)}const kee=600,Az="data-base-ui-tooltip-trigger";function VM(e){if("composedPath"in e){const n=e.composedPath();for(let r=0;r<n.length;r+=1){const s=n[r];if(St(s))return s}}const t=e.target;return St(t)?t:null}function _ee(e){let t=e;for(;t;){const n=t.closest(`[${Az}]`);if(n)return n;const r=t.getRootNode();t="host"in r&&St(r.host)?r.host:null}return null}const Mee=bm(function(t,n){const{render:r,className:s,style:o,handle:l,payload:c,disabled:u,delay:f,closeOnClick:h=!0,closeDelay:p,id:y,...x}=t,b=Im(!0),E=Am(l)??b;if(!E)throw new Error(Qt(82));const C=is(y),R=E.useState("isTriggerActive",C),T=E.useState("isOpenedByTrigger",C),O=E.useState("floatingRootContext"),k=N.useRef(null),M=p??0,{registerTrigger:A,isMountedByThisTrigger:L}=wm(C,k,E,{payload:c,closeOnClick:h,closeDelay:M}),I=Aee(),{activeIdRef:j,delayRef:P,isInstantPhase:B,hasProvider:H}=OQ(O,{open:T}),D=aT(O);E.useSyncedValue("isInstantPhase",B);const F=E.useState("disabled"),z=u??F,q=In(z),V=E.useState("trackCursorAxis"),G=E.useState("disableHoverablePopup"),K=N.useRef(!1),X=ns(),ee=N.useRef(void 0);function ae(){return H&&j.current!=null?0:f??I??kee}function $(re){const he=k.current;if(!he||!re)return!1;const Se=_ee(re);return Se!==null&&Se!==he&&Je(he,Se)}function Y(re){const he=$(re);return K.current=he,he&&(D.openChangeTimeout.clear(),D.restTimeout.clear(),D.restTimeoutPending=!1,X.clear()),he}const J=km(O,{enabled:!z,mouseOnly:!0,move:!1,handleClose:!G&&V!=="both"?_m():null,restMs:ae,delay(){return p==null&&H?{close:kp(P.current,"close")}:{close:M}},triggerElementRef:k,isActiveTrigger:R,isClosing:()=>E.select("transitionStatus")==="ending",shouldOpen(){return!K.current}}),ne=iT(O,{enabled:!z}).reference,W=re=>{const he=K.current,Se=VM(re),_e=Y(Se),be=k.current,Ae=be&&Se&&Je(be,Se);if(_e&&E.select("open")&&E.select("lastOpenChangeReason")===wn){E.setOpen(!1,ht(wn,re));return}if(he&&!_e&&Ae&&!q.current&&!E.select("open")&&be&&Ra(ee.current)){const Me=()=>{!K.current&&!q.current&&!E.select("open")&&E.setOpen(!0,ht(wn,re,be))},Le=ae();Le===0?(X.clear(),Me()):X.start(Le,Me)}},ce=E.useState("triggerProps",L);return It("button",t,{state:{open:T},ref:[n,A,k],props:[J,ne,L||V!=="none"?ce:void 0,{onMouseOver(re){W(re.nativeEvent)},onFocus(re){$(VM(re.nativeEvent))&&re.preventBaseUIHandler()},onMouseLeave(){K.current=!1,X.clear(),ee.current=void 0},onPointerEnter(re){ee.current=re.pointerType},onPointerDown(re){ee.current=re.pointerType,E.set("closeOnClick",h),h&&!E.select("open")&&E.cancelPendingOpen(re.nativeEvent)},onClick(re){h&&!E.select("open")&&E.cancelPendingOpen(re.nativeEvent)},id:C,[yE]:z?"":void 0,[Az]:z?void 0:""},x],stateAttributesMapping:um})}),kz=N.createContext(void 0);function Iee(){const e=N.useContext(kz);if(e===void 0)throw new Error(Qt(70));return e}const _z=N.forwardRef(function(t,n){const{children:r,container:s,className:o,render:l,style:c,...u}=t,{node:f,subtree:h}=B5({container:s,ref:n,componentProps:t,elementProps:u});return!h&&!f?null:g.jsxs(N.Fragment,{children:[h,f&&Us.createPortal(r,f)]})}),Lee=N.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Im().useState("mounted")||r?g.jsx(kz.Provider,{value:r,children:g.jsx(_z,{ref:n,...s})}):null}),Mz=N.createContext(void 0);function Iz(){const e=N.useContext(Mz);if(e===void 0)throw new Error(Qt(71));return e}const Dee=N.forwardRef(function(t,n){const{render:r,className:s,anchor:o,positionMethod:l="absolute",side:c="top",align:u="center",sideOffset:f=0,alignOffset:h=0,collisionBoundary:p="clipping-ancestors",collisionPadding:y=5,arrowPadding:x=5,sticky:b=!1,disableAnchorTracking:S=!1,collisionAvoidance:E=Jx,style:C,...R}=t,T=Im(),O=Iee(),k=T.useState("open"),M=T.useState("mounted"),A=T.useState("trackCursorAxis"),L=T.useState("disableHoverablePopup"),I=T.useState("floatingRootContext"),j=T.useState("instantType"),P=T.useState("transitionStatus"),B=T.useState("adaptiveOrigin"),H=cb({anchor:o,positionMethod:l,floatingRootContext:I,mounted:M,side:c,sideOffset:f,align:u,alignOffset:h,collisionBoundary:p,collisionPadding:y,sticky:b,arrowPadding:x,disableAnchorTracking:S,keepMounted:O,collisionAvoidance:E,adaptiveOrigin:B}),D=N.useMemo(()=>({open:k,side:H.side,align:H.align,anchorHidden:H.anchorHidden,instant:A!=="none"?"tracking-cursor":j}),[k,H.side,H.align,H.anchorHidden,A,j]),F=ub(t,D,{styles:H.positionerStyles,transitionStatus:P,props:R,refs:[n,T.useStateSetter("positionerElement")],hidden:!M,inert:!k||A==="both"||L});return g.jsx(Mz.Provider,{value:H,children:F})}),jee=N.forwardRef(function(t,n){const{render:r,className:s,style:o,...l}=t,c=Im(),{side:u,align:f}=Iz(),h=c.useState("open"),p=c.useState("instantType"),y=c.useState("transitionStatus"),x=c.useState("popupProps"),b=c.useState("floatingRootContext"),S=c.useState("disabled"),E=c.useState("closeDelay");Ya({open:h,ref:c.context.popupRef,onComplete(){var O,k;h&&((k=(O=c.context).onOpenChangeComplete)==null||k.call(O,!0))}}),ib(b,{enabled:!S,closeDelay:E});const C=c.useStateSetter("popupElement");return It("div",t,{state:{open:h,side:u,align:f,instant:p,transitionStatus:y},ref:[n,c.context.popupRef,C],props:[vm,x,Mm(y),l],stateAttributesMapping:dm})}),Pee=N.forwardRef(function(t,n){const{render:r,className:s,style:o,...l}=t,c=Im(),{arrowRef:u,side:f,align:h,arrowUncentered:p,arrowStyles:y}=Iz(),x=c.useState("open"),b=c.useState("instantType");return It("div",t,{state:{open:x,side:f,align:h,uncentered:p,instant:b},ref:[n,u],props:[{style:y,"aria-hidden":!0},l],stateAttributesMapping:Rf})});function Lz({...e}){return g.jsx(Nee,{"data-slot":"tooltip",...e})}function Dz({...e}){return g.jsx(Mee,{"data-slot":"tooltip-trigger",...e})}function jz({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:s=0,children:o,...l}){return g.jsx(Lee,{children:g.jsx(Dee,{align:r,alignOffset:s,side:t,sideOffset:n,className:"isolate z-50",children:g.jsxs(jee,{"data-slot":"tooltip-content",className:xe("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...l,children:[o,g.jsx(Pee,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const zee={previous:S3,next:su,fold:su,unfold:Ux,close:Vx,settings:X3,edit:G3,delete:_2,add:k2,remove:CX,copy:TX,copied:Su,zoomIn:HX,zoomOut:FX,fullScreen:_X,leaveFullScreen:LX},Bee=/[A-Z]/g,Hee=e=>`${e.replace(Bee,t=>`-${t.toLowerCase()}`)}-icon-action`,Nr=({icon:e,label:t,isDisabled:n=!1,variant:r="ghost",className:s,actionId:o,onClick:l})=>{const c=zee[e];return g.jsxs(Lz,{children:[g.jsx(Dz,{render:g.jsx(st,{variant:r,size:"icon-sm","aria-label":t,disabled:n,"data-user-action-id":o??Hee(e),className:s,onClick:l}),children:g.jsx(c,{"aria-hidden":"true"})}),g.jsx(jz,{children:t})]})},Wa=({href:e,label:t,className:n})=>g.jsxs("a",{href:e,target:"_blank",rel:"noreferrer",className:xe("inline-flex items-center gap-1 rounded-sm text-sm text-[var(--line,var(--muted-foreground))] hover:text-foreground",n),children:[g.jsx("span",{children:t}),g.jsx(M3,{"aria-hidden":"true",className:"size-3.5"})]}),Fee=({notice:e,isCopied:t,onCopy:n,onClose:r})=>g.jsxs("section",{role:"status","aria-label":e.title,className:"fixed right-4 bottom-4 z-[60] flex w-[min(24rem,calc(100vw-2rem))] flex-col gap-2 rounded-lg border border-foreground bg-popover p-3 text-sm text-popover-foreground duration-150 animate-in fade-in-0",children:[g.jsxs("div",{className:"flex items-start gap-2",children:[g.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[g.jsx("p",{className:"font-bold",children:e.title}),g.jsx("p",{className:"text-muted-foreground",children:e.description})]}),g.jsx(Nr,{icon:"close",label:e.closeLabel,actionId:"close-update-toast",onClick:r})]}),g.jsxs("div",{className:"flex items-center gap-2 rounded-sm bg-muted py-1 pr-1 pl-3",children:[g.jsx("pre",{className:"min-w-0 flex-1 overflow-x-auto font-mono text-[0.8125rem] leading-5 select-all",children:g.jsx("code",{children:e.command})}),g.jsx(Nr,{icon:t?"copied":"copy",label:t?e.copiedLabel:e.copyLabel,actionId:"copy-update-command",onClick:n})]}),g.jsx(Wa,{href:e.releaseNotesUrl,label:e.releaseNotesLabel,className:"self-start"})]}),$ee="/logo.svg",Uee="Flight Plan",Vee="/setup/",qee="mx-auto max-w-5xl px-4 pt-8 pb-16 sm:px-6",Gee="/not-found.svg",Kee=()=>{const[e,t]=N.useState(null),n=R1({select:l=>l.some(c=>c.staticData.isFullWidth===!0)}),r=R1({select:l=>l.some(c=>c.routeId===Vee)}),s=R1({select:l=>l.some(c=>c.staticData.hasPageSettingsMenu===!0)}),o=oX();return g.jsx(N4,{value:e,children:g.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[g.jsxs(See,{width:n?"full":"column",brand:g.jsx(ri,{to:"/",className:"shrink-0 rounded-sm",children:g.jsx(iX,{logoSrc:$ee,name:Uee})}),children:[g.jsx("div",{ref:t,className:"flex min-w-0 flex-1 items-center border-l border-sign-foreground/20 pl-6 empty:hidden"}),r||s?null:g.jsx(ME,{links:uE,useThemeToggle:sE})]}),g.jsx("main",{className:xe("w-full",n?"":qee),children:g.jsx(C4,{})}),o.notice===null?null:g.jsx(Fee,{notice:o.notice,isCopied:o.isCopied,onCopy:o.copy,onClose:o.close})]})})},Yee=()=>g.jsxs("section",{className:"mx-auto flex max-w-prose flex-col items-center text-center",children:[g.jsx(A4,{src:Gee}),g.jsx("h1",{className:"mt-4 text-2xl font-bold tracking-[-0.01em]",children:"PAN-PAN! We couldn't locate this page!"}),g.jsx("p",{className:"mt-2 text-muted-foreground",children:"The address does not match any page of Flight Plan."}),g.jsx(ri,{to:"/",className:"mt-4 inline-block underline",children:"Go to your repositories"})]}),Wee=({error:e})=>g.jsx("main",{className:"min-h-screen bg-background px-4 pt-16 text-foreground",children:g.jsx(q4,{heading:"MAYDAY! MAYDAY! Flight Plan could not start",error:e})}),Eu=YG()({beforeLoad:async({context:{queryClient:e,trpc:t},location:n})=>{const r=await e.query({...t.setup.gate.queryOptions({path:n.pathname}),staleTime:"static"});r.redirectTo!==null&&Ix({to:r.redirectTo,throw:!0})},component:Kee,notFoundComponent:Yee,errorComponent:Wee}),Xee="modulepreload",Qee=function(e){return"/"+e},qM={},Ut=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));s=l(n.map(f=>{if(f=Qee(f),f in qM)return;qM[f]=!0;const h=f.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${p}`))return;const y=document.createElement("link");if(y.rel=h?"stylesheet":Xee,h||(y.as="script"),y.crossOrigin="",y.href=f,u&&y.setAttribute("nonce",u),document.head.appendChild(y),h)return new Promise((x,b)=>{y.addEventListener("load",x),y.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return s.then(l=>{for(const c of l||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})},Zee=[{id:"first",stopWidths:["w-3/5","w-2/5","w-1/2"]},{id:"second",stopWidths:["w-2/5","w-3/5"]}],Jee=()=>g.jsxs("div",{role:"status","aria-busy":"true",children:[g.jsx("span",{className:"sr-only",children:"Loading your repositories"}),g.jsxs("div",{"aria-hidden":"true",className:"motion-safe:animate-pulse",children:[g.jsx("div",{className:"mb-6 h-9 w-48 rounded-sm bg-muted"}),Zee.map(e=>g.jsxs("div",{className:"grid grid-cols-[2.5rem_minmax(0,1fr)] border-t-2 border-foreground pt-5 pb-6",children:[g.jsxs("span",{className:"flex flex-col items-center",children:[g.jsx("span",{className:"size-7 rounded-full bg-muted"}),g.jsx("span",{className:"w-1 flex-1 bg-muted"})]}),g.jsxs("div",{className:"flex flex-col gap-4 pb-1",children:[g.jsx("span",{className:"h-6 w-40 rounded-sm bg-muted"}),e.stopWidths.map(t=>g.jsx("span",{className:`h-5 rounded-sm bg-muted ${t}`},t))]})]},e.id))]})]}),ete=()=>Ut(()=>import("./index-BrL94etp.js"),__vite__mapDeps([0,1])),tte=()=>Ut(()=>import("./index-CAt5Gv5u.js"),__vite__mapDeps([2,1,3,4])),GM=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):void 0,nte=Ss()({validateSearch:e=>({status:GM(e.status),author:GM(e.author),fixtureCase:typeof e.fixtureCase=="string"?e.fixtureCase:void 0}),loaderDeps:({search:e})=>({statuses:e.status??null,authors:e.author??null,fixtureCase:e.fixtureCase}),loader:async({context:{queryClient:e,trpc:t},deps:n})=>{await e.query({...t.repository.list.queryOptions(n),staleTime:"static"})},component:mn(tte,"component"),pendingComponent:Jee,errorComponent:mn(ete,"errorComponent")}),rte=()=>Ut(()=>import("./route--z3gnt4z.js"),[]),ste=Ss()({component:mn(rte,"component")}),ote=Ss()({beforeLoad:()=>{Ix({to:"/settings/agents",throw:!0})}}),ite={section:"agents"},lte=["w-2/5","w-3/5","w-1/2"],Cu=()=>g.jsxs("div",{role:"status","aria-busy":"true",children:[g.jsx("span",{className:"sr-only",children:"Loading the settings"}),g.jsxs("div",{"aria-hidden":"true",className:"flex flex-col gap-4 motion-safe:animate-pulse",children:[g.jsx("span",{className:"h-8 w-56 rounded-sm bg-muted"}),g.jsx("span",{className:"h-5 w-4/5 rounded-sm bg-muted"}),lte.map(e=>g.jsx("span",{className:`h-6 rounded-sm bg-muted ${e}`},e))]})]}),ate=()=>Ut(()=>import("./agents-CF_BNYuU.js"),__vite__mapDeps([5,6])),cte=()=>Ut(()=>import("./agents-CUULznCR.js"),__vite__mapDeps([7,8,9,10,4,11])),ute=Ss()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(ite),staleTime:"static"})},component:mn(cte,"component"),pendingComponent:Cu,errorComponent:mn(ate,"errorComponent")}),dte={section:"forges"},fte=()=>Ut(()=>import("./forges-Dz31lZmK.js"),__vite__mapDeps([12,6])),hte=()=>Ut(()=>import("./forges-5NgJFexV.js"),__vite__mapDeps([13,8,14,11])),pte=Ss()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(dte),staleTime:"static"})},component:mn(hte,"component"),pendingComponent:Cu,errorComponent:mn(fte,"errorComponent")}),mte={section:"repositories"},gte=()=>Ut(()=>import("./repositories-BrbB16PW.js"),__vite__mapDeps([15,6])),yte=()=>Ut(()=>import("./repositories-VWl6aq7K.js"),__vite__mapDeps([16,3,4,17,11])),xte=Ss()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(mte),staleTime:"static"})},component:mn(yte,"component"),pendingComponent:Cu,errorComponent:mn(gte,"errorComponent")}),bte={section:"review"},vte=()=>Ut(()=>import("./review-BMO-QDpl.js"),__vite__mapDeps([18,6])),Ste=()=>Ut(()=>import("./review-CXzRf1jk.js"),__vite__mapDeps([19,8,20,10,11])),wte=Ss()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.settings.get.queryOptions(bte),staleTime:"static"})},component:mn(Ste,"component"),pendingComponent:Cu,errorComponent:mn(vte,"errorComponent")}),Ete=["first","second","third","fourth"],Cte=["w-2/5","w-3/5","w-1/2"],Tte=()=>g.jsxs("div",{role:"status","aria-busy":"true",children:[g.jsx("span",{className:"sr-only",children:"Loading the setup"}),g.jsxs("div",{"aria-hidden":"true",className:"grid gap-x-10 gap-y-8 motion-safe:animate-pulse lg:grid-cols-[17rem_minmax(0,1fr)]",children:[g.jsx("span",{className:"h-9 w-64 rounded-sm bg-muted lg:col-span-2"}),g.jsx("div",{children:Ete.map(e=>g.jsxs("div",{className:"grid min-h-22 grid-cols-[2.5rem_minmax(0,1fr)]",children:[g.jsxs("span",{className:"flex flex-col items-center",children:[g.jsx("span",{className:"size-5 rounded-full bg-muted"}),g.jsx("span",{className:"w-1 flex-1 bg-muted"})]}),g.jsx("span",{className:"h-5 w-32 rounded-sm bg-muted"})]},e))}),g.jsxs("div",{className:"flex flex-col gap-4",children:[g.jsx("span",{className:"h-8 w-56 rounded-sm bg-muted"}),g.jsx("span",{className:"h-5 w-4/5 rounded-sm bg-muted"}),Cte.map(e=>g.jsx("span",{className:`h-6 rounded-sm bg-muted ${e}`},e))]})]})]}),Nte=()=>Ut(()=>import("./index-BDhIIxnY.js"),__vite__mapDeps([21,22])),Rte=()=>Ut(()=>import("./index-N0J0txvy.js"),__vite__mapDeps([23,22,3,4,17,9,10,20,14])),Ote=Ss()({validateSearch:e=>({step:typeof e.step=="string"?e.step:void 0}),loaderDeps:({search:e})=>({step:e.step??null}),loader:async({context:{queryClient:e,trpc:t},deps:n})=>{const r=await e.query({...t.setup.get.queryOptions(n),staleTime:"static"});n.step!==r.form.step&&(e.setQueryData(t.setup.get.queryKey({step:r.form.step}),r),Ix({to:"/setup",search:{step:r.form.step},replace:!0,throw:!0}))},component:mn(Rte,"component"),pendingComponent:Tte,errorComponent:mn(Nte,"errorComponent")}),Ate=e=>({artifactUrl:e.artifact,repositoryName:e.repository,targetId:e.target}),kte=()=>Ut(()=>import("./download-kIOYm7yl.js"),[]),q1=e=>typeof e=="string"?e:"",_te=Ss()({validateSearch:e=>({artifact:q1(e.artifact),repository:q1(e.repository),target:q1(e.target)}),loaderDeps:({search:e})=>e,loader:async({context:{queryClient:e,trpc:t},deps:n})=>{const r=Ate(n),s=await e.query({...t.review.importForm.queryOptions(r),staleTime:"static"});if(!s.startsAtOnce)return{importId:s.isImporting?s.importId:null,refusal:null};const o=await e.getMutationCache().build(e,t.review.import.mutationOptions()).execute(r);return await e.invalidateQueries(t.review.importForm.pathFilter()),{importId:o.importId,refusal:o.importId===null?o.message:null}},component:mn(kte,"component")}),Yo="rounded-sm bg-muted motion-safe:animate-pulse",Mte=()=>g.jsxs("div",{"aria-busy":"true","aria-label":"Opening the review",className:"grid grid-cols-[13rem_minmax(0,1fr)] gap-x-8 px-6 pt-4",children:[g.jsx("div",{className:"col-span-2 border-b pb-3",children:g.jsx("div",{className:`h-5 w-64 ${Yo}`})}),g.jsxs("div",{className:"flex flex-col gap-4 pt-6",children:[g.jsx("div",{className:`h-5 w-28 ${Yo}`}),g.jsx("div",{className:`h-5 w-40 ${Yo}`}),g.jsx("div",{className:`h-5 w-32 ${Yo}`}),g.jsx("div",{className:`h-5 w-36 ${Yo}`})]}),g.jsxs("div",{className:"flex flex-col gap-3 pt-6",children:[g.jsx("div",{className:`h-6 w-32 ${Yo}`}),g.jsx("div",{className:`h-5 w-full max-w-[70ch] ${Yo}`}),g.jsx("div",{className:`h-5 w-full max-w-[64ch] ${Yo}`}),g.jsx("div",{className:`h-5 w-full max-w-[52ch] ${Yo}`}),g.jsx("div",{className:`mt-8 h-64 w-full ${Yo}`})]})]}),Ite={blue:"[--line:var(--line-blue)]",green:"[--line:var(--line-green)]",magenta:"[--line:var(--line-magenta)]",violet:"[--line:var(--line-violet)]",teal:"[--line:var(--line-teal)]",lime:"[--line:var(--line-lime)]"},Lte={...Ite,primary:"[--line:var(--primary)]"},Dte=({lineColor:e})=>g.jsx("span",{"aria-hidden":"true",className:xe("pointer-events-none absolute inset-x-0 bottom-0 h-1 bg-(--line)",Lte[e])}),Pz=3,jte=1,kf=2,xT=.5,Pte=.3,zte=1.5,G1={added:"var(--diff-added)",modified:"var(--line-blue)",deleted:"var(--diff-removed)"},zz=e=>(e+Pz+jte)*kf,KM=e=>e==="plain",Bte=e=>Math.max(zte,e*Pte),Bz=({centre:e,radius:t})=>{const n=t*xT;return`M${String(e-n)} ${String(e)}h${String(n*kf)}`},Hte=e=>{const t=e.radius*xT;return`${Bz(e)}M${String(e.centre)} ${String(e.centre-t)}v${String(t*kf)}`},Fte=({centre:e,radius:t})=>{const n=t*xT,r=n*kf;return`M${String(e-n)} ${String(e-n)}l${String(r)} ${String(r)}m0 ${String(-r)}l${String(-r)} ${String(r)}`},$te=({centre:e,radius:t})=>`M${String(e)} ${String(e-t)}a${String(t)} ${String(t)} 0 0 1 0 ${String(t*kf)}z`,K1=({path:e,radius:t})=>g.jsx("path",{d:e,strokeWidth:Bte(t),className:"fill-none stroke-background [stroke-linecap:round]"}),Y1=({shape:{centre:e,radius:t},ink:n,children:r=null})=>g.jsxs(g.Fragment,{children:[g.jsx("circle",{cx:e,cy:e,r:t,fill:n}),g.jsx("circle",{cx:e,cy:e,r:t+Pz,stroke:n,className:"fill-none [stroke-width:1.5]"}),r]}),Ute=(e,t)=>{const{centre:n,radius:r}=t;switch(e){case"added":return g.jsx(Y1,{shape:t,ink:G1.added,children:g.jsx(K1,{path:Hte(t),radius:r})});case"modified":return g.jsx(Y1,{shape:t,ink:G1.modified});case"deleted":return g.jsx(Y1,{shape:t,ink:G1.deleted,children:g.jsx(K1,{path:Bz(t),radius:r})});case"breaks":return g.jsxs(g.Fragment,{children:[g.jsx("circle",{cx:n,cy:n,r,className:"fill-destructive"}),g.jsx(K1,{path:Fte(t),radius:r})]});case"behaviour-changes":return g.jsxs(g.Fragment,{children:[g.jsx("circle",{cx:n,cy:n,r,className:"fill-background stroke-foreground [stroke-width:2]"}),g.jsx("path",{d:$te(t),className:"fill-foreground"})]});case"plain":return g.jsx("circle",{cx:n,cy:n,r,className:"fill-muted-foreground"})}},bT=({mark:e,radius:t,className:n})=>{const r=zz(t);return g.jsx("svg",{"aria-hidden":"true",width:r,height:r,viewBox:`0 0 ${String(r)} ${String(r)}`,"data-mark":e,className:xe("shrink-0",n),children:Ute(e,{centre:r/kf,radius:t})})},Hz=N.createContext(void 0);function Xa(e){const t=N.useContext(Hz);if(!e&&t===void 0)throw new Error(Qt(27));return t}const Vte=N.forwardRef(function(t,n){const{render:r,className:s,style:o,forceRender:l=!1,...c}=t,u=Xa(),f=u.useState("open"),h=u.useState("nested"),p=u.useState("mounted"),y=u.useState("transitionStatus");return It("div",t,{state:{open:f,transitionStatus:y},ref:[u.context.backdropRef,n],stateAttributesMapping:dm,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:l||!h})}),vT=N.forwardRef(function(t,n){const{render:r,className:s,style:o,disabled:l=!1,nativeButton:c=!0,...u}=t,f=Xa(),h=f.useState("open"),{getButtonProps:p,buttonRef:y}=vu({disabled:l,native:c}),x={disabled:l};function b(S){h&&f.setOpen(!1,ht(u5,S.nativeEvent))}return It("button",t,{state:x,ref:[n,y],props:[{onClick:b},u,p]})}),qte=N.forwardRef(function(t,n){const{render:r,className:s,style:o,id:l,...c}=t,u=Xa(),f=is(l);return u.useSyncedValueWithCleanup("descriptionElementId",f),It("p",t,{ref:n,props:[{id:f},c]})}),Fz=N.createContext(void 0);function Gte(){const e=N.useContext(Fz);if(e===void 0)throw new Error(Qt(26));return e}const Kte="--nested-dialogs",Yte="data-nested-dialog-open",Wte={...Rf,...cm,nestedDialogOpen(e){return e?{[Yte]:""}:null}},$z=N.forwardRef(function(t,n){const{render:r,className:s,style:o,finalFocus:l,initialFocus:c,...u}=t,f=Xa(),h=f.useState("descriptionElementId"),p=f.useState("disablePointerDismissal"),y=f.useState("floatingRootContext"),x=f.useState("popupProps"),b=f.useState("modal"),S=f.useState("mounted"),E=f.useState("nested"),C=f.useState("nestedOpenDialogCount"),R=f.useState("open"),T=f.useState("openMethod"),O=f.useState("titleElementId"),k=f.useState("transitionStatus"),M=f.useState("role"),A=y.useState("floatingId");Gte(),Ya({open:R,ref:f.context.popupRef,onComplete(){var H,D;R&&((D=(H=f.context).onOpenChangeComplete)==null||D.call(H,!0))}});const L=c===void 0?nz(f.context.popupRef):c,I=C>0,j=f.useStateSetter("popupElement"),B=It("div",t,{state:{open:R,nested:E,transitionStatus:k,nestedDialogOpen:I},props:[x,{id:A,"aria-labelledby":O,"aria-describedby":h,role:M,...vm,hidden:!S,onKeyDown(H){ab.has(H.key)&&H.stopPropagation()},style:{[Kte]:C}},u],ref:[n,f.context.popupRef,j],stateAttributesMapping:Wte});return g.jsx(tT,{context:y,openInteractionType:T,disabled:!S,closeOnFocusOut:!p,initialFocus:L,returnFocus:l,modal:b!==!1,restoreFocus:"popup",children:B})}),Uz=N.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t,o=Xa(),l=o.useState("mounted"),c=o.useState("modal"),u=o.useState("open");return l||r?g.jsx(Fz.Provider,{value:r,children:g.jsxs(Z2,{ref:n,...s,children:[l&&c===!0&&g.jsx(hT,{ref:o.context.internalBackdropRef,inert:dT(!u)}),t.children]})}):null});function Xte({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),s=e.useState("disablePointerDismissal"),o=e.useState("modal"),l=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,f]=N.useState(0),[h,p]=N.useState(0),y=u===0,x=xm(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:o==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(b){if(!e.context.outsidePressEnabledRef.current||"button"in b&&b.button!==0)return!1;if("touches"in b){if(b.type==="touchend"){if(b.changedTouches.length!==1||b.touches.length!==0)return!1}else if(b.touches.length!==1)return!1}const S=Tr(b);if(y&&!s){if(o){const E=e.context.internalBackdropRef.current,C=e.context.backdropRef.current;return E||C?E===S||C===S||Je(S,l)&&!(S!=null&&S.hasAttribute("data-base-ui-portal")):!0}return!0}return!1},escapeKey:y});return hz(r&&o===!0,l),e.useContextCallback("onNestedDialogOpen",(b,S)=>{f(b),p(S)}),Be(()=>(t!=null&&t.onNestedDialogOpen&&(r?t.onNestedDialogOpen(u+1,h+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t!=null&&t.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,h,t]),Tm(e,{activeTriggerProps:x.reference,inactiveTriggerProps:x.trigger,popupProps:x.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:h}),null}const Qte={...Om,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class Zte extends Af{constructor(n,r,s){const o=new Nm,l=Jte(n,o,r,s);super(l,ene(o),Qte);Dt(this,"setOpen",(n,r)=>{var s,o;r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(o=(s=this.context).onOpenChange)==null||o.call(s,n,r),!r.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(n,r),this.update(ob(this.state,n,r.trigger)))})}}function Jte(e,t,n,r=!1){return{...Rm(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}function ene(e){return{popupRef:N.createRef(),backdropRef:N.createRef(),internalBackdropRef:N.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function tne(e,t){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:l,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:f,handle:h,triggerId:p,defaultTriggerId:y=null}=t,x=e==="drawer",b=u,S=c,E="dialog",C=Xa(!0),R=C!=null,T={modal:b,disablePointerDismissal:S,nested:R,role:E},O=sb((j,P)=>new Zte({open:s,openProp:r,activeTriggerId:y,triggerIdProp:p,...T},j,P),!0);O.useControlledProp("openProp",r),O.useControlledProp("triggerIdProp",p),O.useSyncedValues(T),O.useContextCallback("onOpenChange",o),O.useContextCallback("onOpenChangeComplete",l);const k=O.useState("open"),M=O.useState("mounted"),A=O.useState("payload");oz(O,k),Em(O);const{forceUnmount:L}=Cm(k,O);N.useImperativeHandle(f,()=>({unmount:L,close:()=>O.setOpen(!1,ht(pm))}),[L,O]);const I=k||M;return g.jsxs(Hz.Provider,{value:O,children:[h&&g.jsx(Sm,{handle:h,store:O}),I&&g.jsx(Xte,{store:O,parentContext:C==null?void 0:C.context,isDrawer:x}),typeof n=="function"?n({payload:A}):n]})}const Vz=Of(function(t){return tne("dialog",t)}),nne=N.forwardRef(function(t,n){const{render:r,className:s,style:o,id:l,...c}=t,u=Xa(),f=is(l);return u.useSyncedValueWithCleanup("titleElementId",f),It("h2",t,{ref:n,props:[{id:f},c]})}),rne=bm(function(t,n){const{render:r,className:s,style:o,disabled:l=!1,nativeButton:c=!0,id:u,payload:f,handle:h,...p}=t,y=Xa(!0),b=Am(h)??y;if(!b)throw new Error(Qt(79));const S=is(u),E=b.useState("floatingRootContext"),C=b.useState("isOpenedByTrigger",S),R=b.useState("triggerPopupId",S),T=N.useRef(null),{registerTrigger:O,isMountedByThisTrigger:k}=wm(S,T,b,{payload:f}),{getButtonProps:M,buttonRef:A}=vu({disabled:l,native:c}),L=nb(E),I=gT(()=>b.select("open"),B=>{b.set("openMethod",B)}),j={disabled:l,open:C},P=b.useState("triggerProps",k);return It("button",t,{state:j,ref:[A,n,O,T],props:[L.reference,P,I,{[Q2]:"",id:S,"aria-haspopup":"dialog","aria-expanded":C,"aria-controls":R},p,M],stateAttributesMapping:um})}),qz="data-composite-item-active";function sne(e){const{loopFocus:t=!0,orientation:n="both",grid:r,onLoop:s,direction:o,highlightedIndex:l,onHighlightedIndexChange:c,rootRef:u,enableHomeAndEndKeys:f=!1,stopEventPropagation:h,disabledIndices:p,modifierKeys:y=Ba}=e,[x,b]=N.useState(0),S=r!=null,E=N.useRef(null),C=za(E,u),R=N.useRef([]),T=N.useRef(!1),O=N.useRef(null),k=l??x,M=Ve((P,B=!1)=>{if(O.current=R.current[P]??null,(c??b)(P),B){const H=R.current[P];IM(E.current,H,o,n)}}),A=Ve(P=>{var F;if(P.size===0)return;if(T.current){const z=R.current,q=z.indexOf(O.current);if(q===-1){const V=z[k];!V||jd(z,k,p)?M(one(z,p)):O.current=V}else q!==k&&M(q);return}T.current=!0;const B=Array.from(P.keys()),H=B.find(z=>z==null?void 0:z.hasAttribute(qz))??null,D=H?((F=P.get(H))==null?void 0:F.index)??-1:-1;if(D!==-1)M(D);else if(jd(B,k,p)){const z=qi(B,{disabledIndices:p});op(B,z)||M(z)}IM(E.current,H,o,n)});Be(()=>{if(p==null||l!=null||!T.current)return;const P=R.current;if(jd(P,k,p)){const B=qi(P,{disabledIndices:p});op(P,B)||M(B)}},[p,l,k,R,M]);const L=Ve((P,B,H)=>s?s(P,B,H,R):H),I=Ve(P=>{const B=P.key===kE||P.key===_E;if(!ab.has(P.key)||!f&&B||ine(P,y)||!E.current)return;const D=o==="rtl",F=D?OE:AE,z=D?AE:OE,q=n==="vertical"?RE:F,V=n==="vertical"?NE:z,G=Tr(P.nativeEvent);if(G!=null&&MM(G)&&!cee(G)){const Y=G.selectionStart,J=G.selectionEnd,ne=G.value;if(Y==null||P.shiftKey||Y!==J||P.key!==V&&Y<ne.length||P.key!==q&&Y>0)return}let K=k;const X=by(R,p),ee=SE(R,p);r!=null&&(K=r({disabledIndices:p,elementsRef:R,event:P,highlightedIndex:k,loopFocus:t,maxIndex:ee,minIndex:X,onLoop:L,orientation:n,rtl:D}));const ae=n!=="vertical"&&P.key===F||n!=="horizontal"&&P.key===RE,$=n!=="vertical"&&P.key===z||n!=="horizontal"&&P.key===NE;f&&(P.key===kE?K=X:P.key===_E&&(K=ee)),K===k&&(ae||$)&&(t&&K===ee&&ae?(K=X,s&&(K=s(P,k,K,R))):t&&K===X&&$?(K=ee,s&&(K=s(P,k,K,R))):K=qi(R.current,{startingIndex:K,decrement:$,disabledIndices:p})),K!==k&&!op(R.current,K)&&(h&&P.stopPropagation(),(S||B||ae||$)&&P.preventDefault(),M(K,!0),queueMicrotask(()=>{var Y;(Y=R.current[K])==null||Y.focus()}))});return{props:{ref:C,onFocus(P){const B=E.current,H=Tr(P.nativeEvent);!B||H==null||!MM(H)||H.setSelectionRange(0,H.value.length)},onKeyDown:I},highlightedIndex:k,onHighlightedIndexChange:M,elementsRef:R,onMapChange:A,relayKeyboardEvent:I}}function one(e,t){let n=-1;for(let r=0;r<e.length;r+=1){const s=e[r];if(!(!s||jd(e,r,t))){if(s.hasAttribute(qz))return r;n===-1&&(n=r)}}return Math.max(n,0)}function ine(e,t){for(const n of wJ)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function lne(e){const{render:t,className:n,style:r,refs:s=Ba,props:o=Ba,state:l=hn,stateAttributesMapping:c,highlightedIndex:u,onHighlightedIndexChange:f,orientation:h,grid:p,loopFocus:y,onLoop:x,enableHomeAndEndKeys:b,onMapChange:S,stopEventPropagation:E=!0,rootRef:C,disabledIndices:R,modifierKeys:T,highlightItemOnHover:O=!1,tag:k="div",...M}=e,A=fT(),{props:L,highlightedIndex:I,onHighlightedIndexChange:j,elementsRef:P,onMapChange:B,relayKeyboardEvent:H}=sne({grid:p,loopFocus:y,onLoop:x,orientation:h,highlightedIndex:u,onHighlightedIndexChange:f,rootRef:C,stopEventPropagation:E,enableHomeAndEndKeys:b,direction:A,disabledIndices:R,modifierKeys:T}),D=It(k,e,{state:l,ref:s,props:[L,...o,M],stateAttributesMapping:c}),F=N.useMemo(()=>({highlightedIndex:I,onHighlightedIndexChange:j,highlightItemOnHover:O,relayKeyboardEvent:H}),[I,j,O,H]);return g.jsx(j4.Provider,{value:F,children:g.jsx(dz,{elementsRef:P,onMapChange:z=>{S==null||S(z),B(z)},children:D})})}const ane="data-has-submenu-open",cne={hasSubmenuOpen(e){return e?{[ane]:""}:null}},une=N.forwardRef(function(t,n){const{orientation:r="horizontal",loopFocus:s=!0,render:o,className:l,modal:c=!0,disabled:u=!1,id:f,style:h,...p}=t,[y,x]=N.useState(null),[b,S]=N.useState(!1),E=is(f),C={orientation:r,modal:c,hasSubmenuOpen:b},R=N.useRef(null),T=N.useRef(!1),O=N.useMemo(()=>({contentElement:y,setContentElement:x,setHasSubmenuOpen:S,hasSubmenuOpen:b,modal:c,disabled:u,orientation:r,allowMouseUpTriggerRef:T,rootId:E}),[y,b,c,u,r,E]);return g.jsx(mz.Provider,{value:O,children:g.jsx(tb,{children:g.jsx(dne,{children:g.jsx(lne,{render:o,className:l,style:h,state:C,stateAttributesMapping:cne,refs:[n,x,R],props:[{role:"menubar",id:E,"aria-orientation":r},p],orientation:r,loopFocus:s,enableHomeAndEndKeys:!0,highlightItemOnHover:b})})})})});function dne(e){const t=ym(),{events:n}=hl(),r=mT();return N.useEffect(()=>{function s(o){!o.nodeId||o.parentNodeId!==t||(o.open?r.hasSubmenuOpen||r.setHasSubmenuOpen(!0):o.reason!==Nd&&o.reason!==Rp&&r.setHasSubmenuOpen(!1))}return n.on("menuopenchange",s),()=>{n.off("menuopenchange",s)}},[n,t,r]),g.jsx(eb,{id:t,children:e.children})}const ST="relative flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden select-none data-highlighted:bg-muted data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",Gz="z-50 max-h-(--available-height) min-w-56 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border border-foreground bg-popover p-1 text-popover-foreground outline-none duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0";function Kz({className:e,...t}){return g.jsx(une,{"data-slot":"menubar",className:xe("flex items-center",e),...t})}function Yz({...e}){return g.jsx(yT,{"data-slot":"menubar-menu",...e})}function Wz({...e}){return g.jsx(Sz,{"data-slot":"menubar-trigger",...e})}function Xz({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=8,className:s,...o}){return g.jsx(uT,{children:g.jsx(pT,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:g.jsx(cT,{"data-slot":"menubar-content",className:xe(Gz,s),...o})})})}function lp({...e}){return g.jsx(yQ,{"data-slot":"menubar-group",...e})}function ap({className:e,...t}){return g.jsx(xQ,{"data-slot":"menubar-label",className:xe("truncate px-2 pt-2 pb-1 text-xs text-muted-foreground",e),...t})}function fne({className:e,...t}){return g.jsx(b5,{"data-slot":"menubar-item",className:xe(ST,e),...t})}function hne({className:e,children:t,checked:n,...r}){return g.jsxs(g5,{"data-slot":"menubar-checkbox-item",className:xe(ST,"group/checkbox",e),checked:n,...r,children:[g.jsx("span",{className:"pointer-events-none flex size-4 shrink-0 items-center justify-center rounded-sm border border-input bg-card group-data-checked/checkbox:border-(--line,var(--primary-text)) group-data-checked/checkbox:bg-(--line,var(--primary-text)) group-data-checked/checkbox:text-line-foreground","data-slot":"menubar-checkbox-item-indicator",children:g.jsx(y5,{children:g.jsx(Su,{className:"size-3",strokeWidth:3})})}),t]})}function IE({className:e,...t}){return g.jsx(wz,{"data-slot":"menubar-separator",className:xe("-mx-1 my-1 h-px bg-border",e),...t})}function Qz({...e}){return g.jsx(tee,{"data-slot":"menubar-sub",...e})}function Zz({className:e,children:t,...n}){return g.jsxs(dee,{"data-slot":"menubar-sub-trigger",className:xe(ST,"data-popup-open:bg-muted",e),...n,children:[t,g.jsx(Ux,{"aria-hidden":"true",className:"ml-auto size-4 text-muted-foreground"})]})}function Jz({className:e,...t}){return g.jsx(uT,{children:g.jsx(pT,{className:"isolate z-50 outline-none",side:"right",align:"start",sideOffset:4,alignOffset:-4,children:g.jsx(cT,{"data-slot":"menubar-sub-content",className:xe(Gz,e),...t})})})}function eB({className:e,...t}){return g.jsx("kbd",{"data-slot":"menubar-shortcut",className:xe("inline-grid h-[1.125rem] min-w-[1.125rem] place-items-center rounded-sm border border-b-2 border-current/35 px-1 font-mono text-[0.6875rem] leading-none font-bold uppercase opacity-80",e),...t})}const pne=e=>{let t;const n=new Set,r=(f,h)=>{const p=typeof f=="function"?f(t):f;if(!Object.is(p,t)){const y=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(x=>x(t,y))}},s=()=>t,c={setState:r,getState:s,getInitialState:()=>u,subscribe:f=>(n.add(f),()=>n.delete(f))},u=t=e(r,s,c);return c},mne=(e=>pne),gne=e=>e;function yne(e,t=gne){const n=si.useSyncExternalStore(e.subscribe,si.useCallback(()=>t(e.getState()),[e,t]),si.useCallback(()=>t(e.getInitialState()),[e,t]));return si.useDebugValue(n),n}function tB(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var o;const l=u=>u===null?null:JSON.parse(u,void 0),c=(o=n.getItem(s))!=null?o:null;return c instanceof Promise?c.then(l):l(c)},setItem:(s,o)=>n.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>n.removeItem(s)}}const LE=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return LE(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return LE(r)(n)}}}},xne=(e,t)=>(n,r,s)=>{let o={storage:tB(()=>window.localStorage),partialize:E=>E,version:0,merge:(E,C)=>({...C,...E}),...t},l=!1,c=0;const u=new Set,f=new Set;let h=o.storage;if(!h)return e((...E)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...E)},r,s);const p=()=>{const E=o.partialize({...r()});return h.setItem(o.name,{state:E,version:o.version})},y=s.setState;s.setState=(E,C)=>(y(E,C),p());const x=e((...E)=>(n(...E),p()),r,s);s.getInitialState=()=>x;let b;const S=()=>{var E,C;if(!h)return;const R=++c;l=!1,u.forEach(O=>{var k;return O((k=r())!=null?k:x)});const T=((C=o.onRehydrateStorage)==null?void 0:C.call(o,(E=r())!=null?E:x))||void 0;return LE(h.getItem.bind(h))(o.name).then(O=>{if(O)if(typeof O.version=="number"&&O.version!==o.version){if(o.migrate){const k=o.migrate(O.state,O.version);return k instanceof Promise?k.then(M=>[!0,M]):[!0,k]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,O.state];return[!1,void 0]}).then(O=>{var k;if(R!==c)return;const[M,A]=O;if(b=o.merge(A,(k=r())!=null?k:x),n(b,!0),M)return p()}).then(()=>{R===c&&(T==null||T(r(),void 0),b=r(),l=!0,f.forEach(O=>O(b)))}).catch(O=>{R===c&&(T==null||T(void 0,O))})};return s.persist={setOptions:E=>{o={...o,...E},E.storage&&(h=E.storage)},clearStorage:()=>{++c,h==null||h.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>S(),hasHydrated:()=>l,onHydrate:E=>(u.add(E),()=>{u.delete(E)}),onFinishHydration:E=>(f.add(E),()=>{f.delete(E)})},o.skipHydration||S(),b||x},bne=xne,nB="teammate",vne=864e5,Sne={firstSeenAt:null,isOff:!1,tooltips:{},deferredAt:{},actions:{}},wne={clickCount:0,hoverCount:0,firstClickedAt:null,firstHoveredAt:null},rB="click",Ene=1,Cne="days",Tne=["viewVisible","tooltipDependent","preFeatureUse","postFeatureUse","dayBound","tooltipAndDay","reviewMode","dependsOnValues","userDeferred"],sB=e=>"actionIds"in e?e:{actionIds:e},wT=(e,t)=>e.actions[t]??wne,Nne=(e,t)=>t==="click"?e.clickCount:t==="hover"?e.hoverCount:e.clickCount+e.hoverCount,Rne=(e,t)=>{if(t==="click")return e.firstClickedAt;if(t==="hover")return e.firstHoveredAt;const n=[e.firstClickedAt,e.firstHoveredAt].filter(r=>r!==null);return n.length===0?null:Math.min(...n)},fb=(e,t,n,r)=>{var s,o;return((o=(s=e.tooltips[t])==null?void 0:s[n])==null?void 0:o[r])===!0},DE=(e,t,n,r)=>{const{actionIds:s,use:o=rB,times:l=Ene}=sB(r);return s.some(u=>fb(e,t,n,u))?!0:s.reduce((u,f)=>u+Nne(wT(e,f),o),0)>=l},One=(e,t)=>{const{actionIds:n,use:r=rB}=sB(t),s=n.map(o=>Rne(wT(e,o),r)).filter(o=>o!==null);return s.length===0?null:Math.min(...s)},Ane=(e,t,n,r)=>{const s=wT(e,t),o=n==="click"?{...s,clickCount:s.clickCount+1,firstClickedAt:s.firstClickedAt??r}:{...s,hoverCount:s.hoverCount+1,firstHoveredAt:s.firstHoveredAt??r};return{...e,actions:{...e.actions,[t]:o}}},oB=(e,t,n)=>{const r=e.tooltips[t]??{},s=Object.fromEntries(Tne.flatMap(o=>{const l=n[o];return l===void 0?[]:[[o,{...r[o],...l}]]}));return{...e,tooltips:{...e.tooltips,[t]:{...r,...s}}}},kne=(e,t,n,r)=>({...oB(e,t,{userDeferred:{[n]:!0}}),deferredAt:{...e.deferredAt,[t]:e.deferredAt[t]??r}}),_ne=(e,t)=>e.firstSeenAt===null?{...e,firstSeenAt:t}:e,iB=(e,t)=>{var n;return Object.values(((n=e.tooltips[t])==null?void 0:n.userDeferred)??{}).some(r=>r)},lB=(e,t,n)=>iB(e,t)||(n==null?void 0:n.preFeatureUse)!==void 0&&DE(e,t,"preFeatureUse",n.preFeatureUse),Mne=(e,t,n)=>{if(!lB(e,t,n))return null;const r=[e.deferredAt[t]??null,(n==null?void 0:n.preFeatureUse)===void 0?null:One(e,n.preFeatureUse)].filter(s=>s!==null);return r.length===0?e.firstSeenAt:Math.min(...r)},aB=(e,t,n)=>e!==null&&n-e>=t*vne,Ine=(e,t,n,r)=>n.some(s=>r.visibleViewIds.includes(s)||fb(e,t,"viewVisible",s)),cB=(e,t,n,r,s)=>r.every(o=>fb(e,t,n,o)||lB(e,o,s.triggersById[o])),Lne=(e,t,n,r)=>{if(!cB(e,t,"tooltipAndDay",n.tooltipDependent,r))return!1;const s=n.tooltipDependent.map(l=>Mne(e,l,r.triggersById[l])),o=s.some(l=>l===null)?null:Math.max(...s.filter(l=>l!==null));return aB(o,n.dayBound,r.now)},Dne=e=>Object.values(e).every(t=>t),jne=(e,t,n,r)=>[["userDeferred",!iB(e,t)],["viewVisible",n.viewVisible===void 0||Ine(e,t,n.viewVisible,r)],["tooltipDependent",n.tooltipDependent===void 0||cB(e,t,"tooltipDependent",n.tooltipDependent,r)],["preFeatureUse",n.preFeatureUse===void 0||!DE(e,t,"preFeatureUse",n.preFeatureUse)],["postFeatureUse",n.postFeatureUse===void 0||DE(e,t,"postFeatureUse",n.postFeatureUse)],["dayBound",n.dayBound===void 0||fb(e,t,"dayBound",Cne)||aB(e.firstSeenAt,n.dayBound,r.now)],["tooltipAndDay",n.tooltipAndDay===void 0||Lne(e,t,n.tooltipAndDay,r)],["reviewMode",(n.reviewMode??nB)===r.reviewMode],["dependsOnValues",n.dependsOnValues===void 0||Dne(n.dependsOnValues)]].filter(([,o])=>!o).map(([o])=>o),Pne=(e,t,n,r)=>!e.isOff&&jne(e,t,n,r).length===0,zne="flightplan-guide-tooltips",Bne=1,Hne=e=>{try{return window.localStorage.getItem(e)}catch{return null}},Fne=(e,t)=>{try{return window.localStorage.setItem(e,t),!0}catch{return!1}},$ne=e=>{try{return window.localStorage.removeItem(e),!0}catch{return!1}},Une={getItem:Hne,setItem:Fne,removeItem:$ne},Dh=e=>({firstSeenAt:e.firstSeenAt,isOff:e.isOff,tooltips:e.tooltips,deferredAt:e.deferredAt,actions:e.actions}),Vne=(e,t)=>Object.fromEntries(Object.entries(e).filter(([n])=>n!==t)),qne=(e,t)=>e.includes(t)?e:[...e,t],Gne=(e,t)=>e.length===t.length&&e.every((n,r)=>n===t[r]),zr=mne()(bne((e,t)=>({...Sne,visibleViewIds:[],reviewMode:nB,triggersById:{},shownTooltipIds:[],sendEvent:(n,r)=>{if(n==="view"){e(s=>({visibleViewIds:qne(s.visibleViewIds,r)}));return}e(s=>Ane(Dh(s),r,n==="user-action"?"click":"hover",Date.now()))},updateTooltipState:(n,r)=>{e(s=>oB(Dh(s),n,r))},deferTooltip:(n,r)=>{e(s=>kne(Dh(s),n,r,Date.now()))},turnTipsOff:()=>{e({isOff:!0})},recordFirstVisit:()=>{t().firstSeenAt===null&&e(n=>_ne(Dh(n),Date.now()))},setVisibleViewIds:n=>{Gne(t().visibleViewIds,n)||e({visibleViewIds:n})},setReviewMode:n=>{e({reviewMode:n})},registerTriggers:(n,r)=>{e(s=>({triggersById:{...s.triggersById,[n]:r}}))},unregisterTriggers:n=>{e(r=>({triggersById:Vne(r.triggersById,n)}))},showTooltip:n=>{e(r=>({shownTooltipIds:[...r.shownTooltipIds.filter(s=>s!==n),n]}))},hideTooltip:n=>{e(r=>({shownTooltipIds:r.shownTooltipIds.filter(s=>s!==n)}))}}),{name:zne,version:Bne,storage:tB(()=>Une),partialize:Dh})),uB=5e3,Kne=6e4,Yne="[data-user-action-id]",Wne="data-user-action-id",Xne=()=>{const[e,t]=N.useState(()=>Date.now());return N.useEffect(()=>{const n=setInterval(()=>{t(Date.now())},Kne);return()=>{clearInterval(n)}},[]),e},Qne=(e,t)=>{const[n,r]=N.useState(!1);return N.useEffect(()=>{if(!e)return;const s=setTimeout(()=>{r(!0)},t);return()=>{clearTimeout(s),r(!1)}},[e,t]),e&&n},Zne=(e,{delay:t=uB,triggers:n})=>{const r=Xne(),s=N.useRef(n),o=JSON.stringify(n);N.useLayoutEffect(()=>{s.current=n}),N.useEffect(()=>(zr.getState().registerTriggers(e,s.current),()=>{zr.getState().unregisterTriggers(e)}),[e,o]);const l=yne(zr,c=>Pne(c,e,n,{now:r,visibleViewIds:c.visibleViewIds,reviewMode:c.reviewMode,triggersById:c.triggersById}));return{showTooltip:Qne(l,t),updateTooltipState:c=>{zr.getState().updateTooltipState(e,c)}}},jE=e=>e instanceof Element?e.closest(Yne):null,dB=e=>(e==null?void 0:e.getAttribute(Wne))??null,YM=e=>{const t=dB(jE(e.target));t!==null&&zr.getState().sendEvent("user-action",t)},WM=e=>{const t=jE(e.target);if(t===null||t===jE(e.relatedTarget))return;const n=dB(t);n!==null&&zr.getState().sendEvent("user-hover",n)},W1=e=>{e!==null&&zr.getState().sendEvent("user-action",e)},Jne=e=>{N.useEffect(()=>{zr.getState().setReviewMode(e)},[e]),N.useEffect(()=>(zr.getState().recordFirstVisit(),document.addEventListener("click",YM,!0),document.addEventListener("pointerover",WM,!0),()=>{document.removeEventListener("click",YM,!0),document.removeEventListener("pointerover",WM,!0)}),[])},j0=0,XM=(e,t,n,r)=>Math.max(0,Math.min(t,r)-Math.max(e,n)),fB=(e,t)=>{const n=(e.bottom-e.top)*(e.right-e.left);return n<=0?0:XM(e.top,e.bottom,t.top,t.bottom)*XM(e.left,e.right,t.left,t.right)/n},hB=(e,t)=>fB(e,t)>0,ere=(e,t)=>e.reduce((n,r,s)=>{const o=fB(r,t);return o>n.share?{index:s,share:o}:n},{index:null,share:0}).index,tre=e=>e.placement==="dominant"||e.isOnScreen&&(e.placement==="inside-dominant"||e.placement==="free"),nre=e=>[...new Set(e.filter(tre).map(t=>t.viewId))],pB=()=>({top:0,bottom:window.innerHeight,left:0,right:window.innerWidth}),PE=e=>{const{top:t,bottom:n,left:r,right:s}=e.getBoundingClientRect();return{top:t,bottom:n,left:r,right:s}},mB=(e,t,n="")=>{const r=N.useEffectEvent(t),s=N.useRef(j0);N.useEffect(()=>{if(!e)return;const o=()=>{s.current=j0,r()},l=()=>{s.current===j0&&(s.current=requestAnimationFrame(o))},c=new MutationObserver(l);return c.observe(document.body,{childList:!0,subtree:!0}),window.addEventListener("scroll",l,{passive:!0,capture:!0}),window.addEventListener("resize",l),l(),()=>{cancelAnimationFrame(s.current),s.current=j0,c.disconnect(),window.removeEventListener("scroll",l,{capture:!0}),window.removeEventListener("resize",l)}},[e,n])},zE="[data-view-section-id]",rre="data-view-section-id",X1=`
|
|
343
|
-
`,sre=(e,t)=>t!==""&&e.contains(document.getElementById(t)),ore=(e,t)=>t.has(e.id)||[...t].some(n=>sre(e,n)),ire=(e,t,n)=>{var s;return e===t?"dominant":(t==null?void 0:t.contains(e))===!0?"inside-dominant":(((s=e.parentElement)==null?void 0:s.closest(zE))??null)===null&&!ore(e,n)?"free":"elsewhere"},lre=(e,t)=>{var s;const n=e===null?null:((s=document.getElementById(e))==null?void 0:s.closest(zE))??null,r=pB();return[...document.querySelectorAll(zE)].map(o=>({viewId:o.getAttribute(rre)??"",placement:ire(o,n,t),isOnScreen:hB(PE(o),r)}))},are=(e,t)=>{const n=t.join(X1);mB(!0,()=>{const r=new Set(n.split(X1));zr.getState().setVisibleViewIds(nre(lre(e,r)))},`${e??""}${X1}${n}`)},Un=({key:e,actionId:t=null,label:n,shortLabel:r=null,description:s=null,isPressed:o=!1,isPrimary:l=!1,isDisabled:c=!1,disabledHint:u=null,onRun:f})=>({kind:"button",key:e,actionId:t,label:n,shortLabel:r,description:s,isPressed:o,isPrimary:l,isDisabled:c,disabledHint:u,onRun:f}),QM=e=>[e.id,e.label,e.detailLabel,e.detailTone,e.isChecked,e.isDisabled].join("|"),cre=e=>e.kind==="choice"?QM(e):["submenu",e.id,e.label,e.heading,e.valueLabel,...e.choices.map(QM)].join("|"),ure=e=>{var t;return e.kind==="position"?`position|${e.label}`:e.kind==="button"?["button",e.key,e.label,e.shortLabel,e.description,e.isPressed,e.isPrimary,e.isDisabled,e.disabledHint].join("|"):["menu",e.key,e.label,(t=e.badge)==null?void 0:t.label,e.heading,...e.itemGroups.flat().map(cre)].join("|")},gB=e=>e.map(t=>t.map(ure).join(`
|
|
344
|
-
`)).join(`
|
|
345
|
-
|
|
346
|
-
`),ET=(e,t)=>e.flat().find(n=>n.kind!=="position"&&n.key===t)??null,dre={anchorId:null,share:0,height:0},fre=(e,t)=>Math.max(0,Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top)),hre=(e,t)=>{const n=fre(e,t),r=n/Math.max(1,t.bottom-t.top),s=n/Math.max(1,e.bottom-e.top);return{anchorId:e.anchorId,share:Math.max(r,s),height:n}},pre=(e,t)=>e.share>t.share||e.share===t.share&&e.height>t.height,mre=(e,t)=>e.map(n=>hre(n,t)).filter(n=>n.height>0).reduce((n,r)=>pre(r,n)?r:n,dre).anchorId,gre=e=>[...e.groups.flatMap(t=>t.sections.map(n=>n.anchorId)),...e.sections.map(t=>t.anchorId)],ZM=e=>t=>({...t,isHere:t.anchorId===e}),yre=(e,t)=>{const n=e.groups.find(r=>r.sections.some(s=>s.anchorId===t))??e.groups.at(0)??null;return{heading:(n==null?void 0:n.label)??null,sections:((n==null?void 0:n.sections)??[]).map(ZM(t)),otherGroups:e.groups.filter(r=>r!==n),looseSections:e.sections.map(ZM(t))}},yB="a",CT="d",_f="g",xre="ctrl+g",bre="Back",vre="Next",xB={back:null,next:null},Sre="Segment",wre=(e,t)=>`${Sre} (${String(e+1)}/${String(t)})`,Ere=e=>[...e.groups.flatMap((t,n)=>t.sections.map(r=>({section:r,segmentLabel:wre(n,e.groups.length)}))),...e.sections.map(t=>({section:t,segmentLabel:null}))],Cre=(e,t)=>e.segmentLabel!==t.segmentLabel&&e.segmentLabel!==null?e.segmentLabel:e.section.label,Tre={key:yB,prefix:bre,actionId:"back-section-action"},Nre={key:CT,prefix:vre,actionId:"next-section-action"},JM=({key:e,prefix:t,actionId:n},r,s,o)=>s===void 0?null:Un({key:e,actionId:n,label:`${t}: ${Cre(s,r)}`,shortLabel:t,onRun:()=>{o(s.section.anchorId)}}),bB=(e,t,n)=>{const r=Ere(e),s=r.findIndex(l=>l.section.anchorId===t);if(s===-1)return xB;const o=r[s];return{back:JM(Tre,o,r[s-1],n),next:JM(Nre,o,r[s+1],n)}},Rre=(e,t)=>{const n=[t.back,t.next].filter(r=>r!==null).filter(r=>ET(e,r.key)===null);return n.length===0?[...e]:[n,...e]},TT=N.createContext(null),hb=N.createContext(null),NT=(e,t)=>{const n=N.use(TT),r=N.useRef(t),s=gB(t);N.useLayoutEffect(()=>{r.current=t}),N.useEffect(()=>{if(!(n===null||e===null))return n.register(e,()=>r.current)},[n,e]),N.useEffect(()=>{n==null||n.notify()},[n,s])},Ore=(e,t,n)=>{var o;const r=((o=N.use(TT))==null?void 0:o.onFullScreenOwnerChange)??null,s=N.useRef(n);N.useLayoutEffect(()=>{s.current=n}),N.useEffect(()=>{if(!(r===null||e===null||!t))return r({anchorId:e,onLeave:()=>{s.current()}}),()=>{r(null)}},[r,e,t])},Are=e=>{const t=N.use(hb);return t===null?xB:bB(t.rail,e,t.onJump)},kre="input, textarea, select, [contenteditable]:not([contenteditable='false']), [role='textbox'], [role='searchbox'], [role='combobox']",_re="[role='dialog']:not([data-navigator-scope]), [role='alertdialog']",Mre="[aria-modal='true']:not([data-navigator-scope])",Ire="ctrl+",Lre=e=>e instanceof Element&&e.closest(kre)!==null,Dre=e=>e instanceof Element&&e.closest(_re)!==null,vB=e=>!e.defaultPrevented&&!e.repeat&&!e.isComposing&&!e.metaKey&&!e.altKey&&!Lre(e.target)&&!Dre(e.target)&&document.querySelector(Mre)===null,jre=e=>e.ctrlKey?`${Ire}${e.key.toLowerCase()}`:e.key.toLowerCase(),Pre=56,zre="[data-pinned-row]",Bre={"data-pinned-row":""},RT=()=>Math.max(Pre,...[...document.querySelectorAll(zre)].map(e=>e.getBoundingClientRect().bottom)),Rd="w",eI="Jump to",SB="jump-to-action",Hre="Review navigator",Fre="Here",$re="Other segments",Ure=180,Vre=3e3,P0=0,BE=`
|
|
347
|
-
`,qre=[[["↑","↓"],"move"],[["→"],"sections"],[["↵"],"jump"],[["esc"],"close"]],Gre=[[["↑","↓"],"move"],[["space"],"tick"],[["esc"],"close"]],Kre=[[["↑","↓"],"move"],[["→"],"open"],[["space"],"tick"],[["esc"],"close"]],Yre=new Map,Wre=[],pb="inline-flex h-[1.875rem] shrink-0 cursor-pointer items-center gap-1.5 rounded-[0.3rem] px-[0.4375rem] outline-none transition-colors duration-[180ms] ease-out hover:bg-sign-foreground/10 focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-45 aria-pressed:bg-sign-foreground aria-pressed:font-bold aria-pressed:text-sign data-[flash=true]:bg-sign-foreground/25",wB="bg-primary font-bold text-primary-foreground hover:bg-[color-mix(in_oklab,var(--primary)_88%,var(--primary-foreground))]",Xre="h-4 min-w-4 text-[0.625rem] normal-case",Qre={added:"font-semibold text-diff-added",modified:"font-semibold text-line-blue",deleted:"font-semibold text-diff-removed"},Zre=(e,t,n)=>new Map([...e,[t,n]]),Jre=(e,t,n)=>e.get(t)===n?new Map([...e].filter(([r])=>r!==t)):e,ese=e=>e.flatMap(t=>{const n=document.getElementById(t);if(n===null)return[];const{top:r,bottom:s}=n.getBoundingClientRect();return[{anchorId:t,top:r,bottom:s}]}),tse=e=>{const[t,n]=N.useState(null),r=N.useRef(P0),s=e.join(BE);return N.useEffect(()=>{const o=s===""?[]:s.split(BE),l=()=>{r.current=P0,n(mre(ese(o),{top:RT(),bottom:window.innerHeight}))},c=()=>{r.current===P0&&(r.current=requestAnimationFrame(l))},u=new ResizeObserver(c);return u.observe(document.body),c(),window.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{cancelAnimationFrame(r.current),r.current=P0,u.disconnect(),window.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[s]),t},tI=e=>{var t;(t=document.getElementById(e))==null||t.scrollIntoView({block:"start"})},nse=({rail:e,onSectionJump:t,children:n})=>{const[r,s]=N.useState(null),[o,l]=N.useState(Yre),[c,u]=N.useState(null),[f,h]=N.useState(null),[p,y]=N.useState(null),[x]=N.useState(()=>({register:(I,j)=>(l(P=>Zre(P,I,j)),()=>{l(P=>Jre(P,I,j))}),notify:()=>{l(I=>new Map(I))},onFullScreenOwnerChange:u})),b=gre(e),S=tse(b),E=(c==null?void 0:c.anchorId)??S;are(E,b);const C=E===null?void 0:o.get(E),R=(C==null?void 0:C())??Wre,T=N.useCallback(I=>{if(h(null),t==null||t(I),c===null){tI(I);return}c.onLeave(),requestAnimationFrame(()=>{tI(I)})},[c,t]),O=N.useMemo(()=>Rre(R,bB(e,E,T)),[R,e,E,T]),k=I=>{y(I),setTimeout(()=>{y(j=>j===I?null:j)},Ure)},M=I=>{s(I),setTimeout(()=>{s(j=>j===I?null:j)},Vre)},A=N.useEffectEvent(I=>{if(!vB(I))return;const j=jre(I);if(f!==null){if(j!==f)return;I.preventDefault(),h(null);return}if(j===Rd){I.preventDefault(),k(j),h(Rd),W1(SB);return}const P=ET(O,j);P!==null&&(I.preventDefault(),k(j),P.kind==="menu"?(h(P.key),W1(P.actionId??null)):P.isDisabled?P.disabledHint!==null&&M(P.key):(P.onRun(),W1(P.actionId)))});N.useEffect(()=>{const I=j=>{A(j)};return window.addEventListener("keydown",I,!0),()=>{window.removeEventListener("keydown",I,!0)}},[]);const L=N.useMemo(()=>({rail:e,dominantAnchorId:E,groups:O,fullScreenOwner:c,openMenuKey:f,flashedKey:p,hintedKey:r,onHintedKeyChange:s,onHint:M,onOpenMenuKeyChange:h,onJump:T}),[e,E,O,c,f,p,r,T]);return g.jsx(TT,{value:x,children:g.jsx(hb,{value:L,children:n})})},Lm=({label:e,className:t})=>g.jsx(eB,{"aria-hidden":"true",className:t,children:e}),nI=["full","short","keys"],mb=({label:e,shortLabel:t,density:n})=>n==="full"?g.jsx("span",{children:e}):n==="keys"?g.jsx("span",{className:"sr-only",children:e}):g.jsxs(g.Fragment,{children:[g.jsx("span",{"aria-hidden":"true",children:t??e}),g.jsx("span",{className:"sr-only",children:e})]}),OT=(e,t)=>t==="full"?void 0:e,EB=({hints:e})=>g.jsx("div",{className:"-mx-1 mt-1 flex max-w-[21rem] flex-wrap items-center gap-x-3 gap-y-1.5 border-t px-3 pt-2 pb-1.5 text-[0.6875rem] text-muted-foreground",children:e.map(([t,n])=>g.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.map(r=>g.jsx(Lm,{label:r,className:Xre},r)),n]},n))}),rse=()=>g.jsx("span",{"aria-hidden":"true",className:"mx-1 h-5 w-px shrink-0 bg-sign-foreground/20"}),sse=({isHere:e})=>g.jsx("span",{"aria-hidden":"true",className:xe("size-3.5 shrink-0 rounded-full border-[2.5px] border-muted-foreground",e&&"border-(--line,var(--primary-text)) bg-(--line,var(--primary-text))")}),ose=()=>g.jsx("span",{"aria-hidden":"true",className:"size-[11px] shrink-0 rounded-[2px] bg-(--line,var(--primary-text))"}),Q1=({section:e,onJump:t})=>g.jsxs(fne,{onClick:()=>{t(e.anchorId)},children:[g.jsx(sse,{isHere:e.isHere}),g.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.label}),e.isHere?g.jsx("span",{className:"text-xs text-muted-foreground",children:Fre}):null]}),ise=({navigator:e,density:t})=>{const n=yre(e.rail,e.dominantAnchorId),r=e.openMenuKey===Rd;return g.jsx(Kz,{modal:!1,children:g.jsxs(Yz,{open:r,onOpenChange:s=>{e.onOpenMenuKeyChange(s?Rd:null)},children:[g.jsxs(Wz,{"data-flash":e.flashedKey===Rd,"data-user-action-id":SB,title:OT(eI,t),className:xe(pb,"pl-2.5 data-popup-open:bg-sign-foreground/15"),children:[g.jsx(mb,{label:eI,shortLabel:null,density:t}),g.jsx(S3,{"aria-hidden":"true",className:"size-3.5"}),g.jsx(Lm,{label:Rd})]}),g.jsxs(Xz,{side:"top",sideOffset:12,className:"max-w-[21rem] min-w-[17rem]",children:[g.jsxs(lp,{children:[n.heading===null?null:g.jsx(ap,{children:n.heading}),n.sections.map(s=>g.jsx(Q1,{section:s,onJump:e.onJump},s.anchorId))]}),n.otherGroups.length===0?null:g.jsxs(g.Fragment,{children:[g.jsx(IE,{}),g.jsxs(lp,{children:[g.jsx(ap,{children:$re}),n.otherGroups.map(s=>g.jsxs(Qz,{children:[g.jsxs(Zz,{children:[g.jsx(ose,{}),g.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.label})]}),g.jsx(Jz,{className:"max-w-[21rem] min-w-[15rem]",children:g.jsxs(lp,{children:[s.label===null?null:g.jsx(ap,{children:s.label}),s.sections.map(o=>g.jsx(Q1,{section:{...o,isHere:!1},onJump:e.onJump},o.anchorId))]})})]},s.anchorId))]})]}),n.looseSections.length===0?null:g.jsxs(g.Fragment,{children:[g.jsx(IE,{}),n.looseSections.map(s=>g.jsx(Q1,{section:s,onJump:e.onJump},s.anchorId))]}),g.jsx(EB,{hints:qre})]})]})})},lse=({control:e,isFlashed:t,density:n})=>g.jsxs("button",{type:"button","aria-pressed":e.isPrimary?void 0:e.isPressed,disabled:e.isDisabled,title:e.description??OT(e.label,n),"data-flash":t,"data-user-action-id":e.actionId??void 0,className:xe(pb,e.isPrimary&&wB),onClick:e.onRun,children:[g.jsx(mb,{label:e.label,shortLabel:e.shortLabel,density:n}),g.jsx(Lm,{label:e.key})]}),ase=({control:e,isFlashed:t,density:n,hint:r,navigator:s})=>{const o=N.useId();return g.jsxs(g.Fragment,{children:[g.jsx("span",{id:o,hidden:!0,children:r}),g.jsxs(Lz,{open:s.hintedKey===e.key,onOpenChange:l=>{s.onHintedKeyChange(l?e.key:null)},children:[g.jsxs(Dz,{closeOnClick:!1,render:g.jsx("button",{type:"button","aria-pressed":e.isPrimary?void 0:e.isPressed,"aria-disabled":"true","aria-describedby":o,"data-flash":t,"data-user-action-id":e.actionId??void 0,className:xe(pb,e.isPrimary&&wB,"aria-disabled:cursor-default aria-disabled:opacity-45"),onClick:()=>{s.onHint(e.key)}}),children:[g.jsx(mb,{label:e.label,shortLabel:e.shortLabel,density:n}),g.jsx(Lm,{label:e.key})]}),g.jsx(jz,{sideOffset:12,children:r})]})]})},CB=({choice:e})=>g.jsxs(hne,{checked:e.isChecked,disabled:e.isDisabled,onCheckedChange:e.onToggle,children:[e.marker,g.jsx("span",{className:"flex-1",children:e.label}),g.jsx("span",{className:xe("text-xs tabular-nums",e.detailTone===null?"text-muted-foreground":Qre[e.detailTone]),children:e.detailLabel})]}),cse=({submenu:e})=>g.jsxs(Qz,{children:[g.jsxs(Zz,{children:[g.jsx("span",{className:"flex-1",children:e.label}),e.valueLabel===null?null:g.jsx("span",{className:"max-w-32 truncate text-xs text-muted-foreground",children:e.valueLabel})]}),g.jsx(Jz,{className:"min-w-[15rem]",children:g.jsxs(lp,{children:[g.jsx(ap,{children:e.heading}),e.choices.map(t=>g.jsx(CB,{choice:t},t.id))]})})]}),use=({badge:e})=>g.jsxs(g.Fragment,{children:[g.jsx("span",{"aria-hidden":"true",className:"inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-sign-foreground px-1 text-[0.625rem] leading-none font-bold text-sign tabular-nums group-data-popup-open:bg-sign group-data-popup-open:text-sign-foreground",children:e.count}),g.jsx("span",{className:"sr-only",children:e.label})]}),dse=e=>e.itemGroups.flat().some(t=>t.kind==="submenu"),fse=({control:e,navigator:t,density:n})=>g.jsx(Kz,{modal:!1,children:g.jsxs(Yz,{open:t.openMenuKey===e.key,onOpenChange:r=>{t.onOpenMenuKeyChange(r?e.key:null)},children:[g.jsxs(Wz,{"data-flash":t.flashedKey===e.key,"data-user-action-id":e.actionId,title:OT(e.label,n),className:xe(pb,"group data-popup-open:bg-sign-foreground data-popup-open:font-bold data-popup-open:text-sign"),children:[g.jsx(mb,{label:e.label,shortLabel:null,density:n}),e.badge===null?null:g.jsx(use,{badge:e.badge}),g.jsx(Lm,{label:e.key})]}),g.jsxs(Xz,{side:"top",sideOffset:12,className:"min-w-[17rem]",children:[g.jsxs(lp,{children:[g.jsx(ap,{children:e.heading}),e.itemGroups.map((r,s)=>g.jsxs("div",{children:[s===0?null:g.jsx(IE,{}),r.map(o=>o.kind==="choice"?g.jsx(CB,{choice:o},o.id):g.jsx(cse,{submenu:o},o.id))]},r.map(o=>o.id).join(BE)))]}),g.jsx(EB,{hints:dse(e)?Kre:Gre})]})]})}),hse=({control:e,navigator:t,density:n})=>{if(e.kind==="position")return g.jsx("span",{className:"min-w-16 px-1 text-center tabular-nums",children:e.label});if(e.kind==="menu")return g.jsx(fse,{control:e,navigator:t,density:n});const r=t.flashedKey===e.key;return e.isDisabled&&e.disabledHint!==null?g.jsx(ase,{control:e,isFlashed:r,density:n,hint:e.disabledHint,navigator:t}):g.jsx(lse,{control:e,isFlashed:r,density:n})},HE="position",rI=e=>e.kind==="position"?HE:e.key,sI="calc(var(--navigator-inset-left, 0px) + (100% - var(--navigator-inset-left, 0px) - var(--navigator-inset-right, 0px)) / 2)",pse="1.5rem",mse=2,gse="100% - var(--navigator-inset-right, 1.5rem)",yse=e=>{if(e===null)return sI;const t=`${String(e/mse)}px`;return`clamp(calc(${pse} + ${t}), ${sI}, calc(${gse} - ${t}))`},oI=e=>{const[t,n]=N.useState(null);return N.useEffect(()=>{if(e===null)return;const r=new ResizeObserver(()=>{n(e.offsetWidth)});return r.observe(e),()=>{r.disconnect()}},[e]),t},xse={signature:"",densityIndex:0},bse=(e,t,n)=>{const[r,s]=N.useState(xse),o=`${n}|${String(t)}`,l=r.signature===o?r.densityIndex:0;return N.useEffect(()=>{if(e===null||t===null||l===nI.length-1)return;const c=new ResizeObserver(()=>{e.offsetWidth>t&&s({signature:o,densityIndex:l+1})});return c.observe(e),()=>{c.disconnect()}},[e,t,o,l]),nI[l]},TB=({place:e="page",...t})=>{const n=N.use(hb),[r,s]=N.useState(null),[o,l]=N.useState(null),c=oI(r),u=oI(o),f=((n==null?void 0:n.groups)??[]).filter(p=>p.length>0),h=bse(r,u,gB(f));return n===null||e==="page"&&n.fullScreenOwner!==null?null:g.jsxs(g.Fragment,{children:[g.jsx("div",{"aria-hidden":"true",ref:l,className:"pointer-events-none fixed bottom-0 left-6 h-0 right-[var(--navigator-inset-right,1.5rem)]"}),g.jsx("div",{"aria-hidden":"true",className:"fixed bottom-0 left-0 right-[var(--navigator-band-right,0px)] z-40 h-11 bg-sign",children:g.jsx("span",{className:"absolute inset-x-0 top-0 h-1 bg-(--line,var(--primary-text))"})}),g.jsxs("div",{ref:s,role:"toolbar","aria-label":Hre,...t,style:{...t.style,left:yse(c)},className:xe("fixed bottom-0 z-40 flex h-10 -translate-x-1/2 items-center px-1 text-[0.8rem] whitespace-nowrap text-sign-foreground transition-[left] duration-200 ease-out",t.className),children:[g.jsx(ise,{navigator:n,density:h}),g.jsx("div",{className:"flex items-center duration-[180ms] animate-in fade-in-0",children:f.map(p=>g.jsxs("div",{className:"flex items-center gap-0.5",children:[g.jsx(rse,{}),p.map(y=>g.jsx(hse,{control:y,navigator:n,density:h},rI(y)))]},p.map(rI).find(y=>y!==HE)??HE))},n.dominantAnchorId??"")]})]})},gb=1.25,vse=1,Sse=3,NB=gb**-4,RB=gb**Sse,wse=.002,Ese=16,Cse=1,Tse=2,iI=2,AT=e=>Math.min(RB,Math.max(NB,e)),Nse=e=>AT(e*gb),Rse=e=>AT(e/gb),Ose=({deltaY:e,deltaMode:t},n)=>t===Cse?e*Ese:t===Tse?e*n:e,Ase=(e,t)=>AT(e*Math.exp(-t*wse)),lI=({paneWidth:e,paneHeight:t,width:n,height:r,isCentred:s},o)=>{const l=(e-n*o)/iI,c=(t-r*o)/iI;return s?{x:l,y:c}:{x:Math.max(0,l),y:0}},kse=(e,t,n,r,s)=>{const o=lI(s,n),l=lI(s,r),c=r/n,u=(f,h,p)=>f-(f-h)*c-p;return{x:u(e.x,o.x+t.x,l.x),y:u(e.y,o.y+t.y,l.y)}},OB="escape-key",_se=e=>e instanceof HTMLElement&&e.getAttribute("aria-expanded")==="true",wke=e=>(t,n)=>{t||(n.reason===OB&&_se(n.event.target)?n.cancel():e())},Mse={x:0,y:0},Ise=0,Lse=4,aI=["pointerup","pointercancel"],Dse=(e,t)=>({x:t.x-e.x,y:t.y-e.y}),jse=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),Pse=({x:e,y:t})=>Math.hypot(e,t)>=Lse,cI=({clientX:e,clientY:t})=>({x:e,y:t}),zse=()=>{const[e,t]=N.useState(Mse),[n,r]=N.useState(!1),s=N.useRef(!1);return{offset:e,isDragging:n,startDrag:c=>{if(c.button!==Ise)return;s.current=!1;const u=cI(c),f=e,h=y=>{const x=Dse(u,cI(y));!s.current&&!Pse(x)||(s.current=!0,r(!0),t(jse(f,x)))},p=()=>{window.removeEventListener("pointermove",h),aI.forEach(y=>{window.removeEventListener(y,p)}),r(!1)};window.addEventListener("pointermove",h),aI.forEach(y=>{window.addEventListener(y,p)})},swallowClickAfterDrag:c=>{s.current&&(s.current=!1,c.stopPropagation(),c.preventDefault())},panTo:t}},AB="flight-plan:layout:v1",kB="flight-plan:layout-saved",uI=[kB,"storage"],Yy={diagramPanelWidthPx:null},Bse=e=>{if(typeof e!="object"||e===null||!("diagramPanelWidthPx"in e))return Yy;const{diagramPanelWidthPx:t}=e;return typeof t=="number"&&Number.isFinite(t)?{diagramPanelWidthPx:t}:Yy},Hse=e=>{try{return e===null?Yy:Bse(JSON.parse(e))}catch{return Yy}},Fse=()=>{try{return window.localStorage.getItem(AB)}catch{return null}},$se=()=>null,Use=e=>(uI.forEach(t=>{window.addEventListener(t,e)}),()=>{uI.forEach(t=>{window.removeEventListener(t,e)})}),Vse=e=>{try{window.localStorage.setItem(AB,JSON.stringify(e))}catch{return}window.dispatchEvent(new Event(kB))},qse=()=>{const e=N.useSyncExternalStore(Use,Fse,$se);return N.useMemo(()=>Hse(e),[e])},Gse=0,kT=320,Kse=.8,dI=32,fI=["pointerup","pointercancel"],hI={ArrowLeft:dI,ArrowRight:-dI},_B=e=>Math.max(kT,Math.round(e*Kse)),pI=(e,t)=>Math.round(Math.min(_B(t),Math.max(kT,e))),Yse=e=>{const{diagramPanelWidthPx:t}=qse(),[n,r]=N.useState(null),s=n!==null,o=f=>{Vse({diagramPanelWidthPx:f})};return{widthPx:n??t,isResizing:s,narrowestPx:kT,startResize:f=>{if(f.button!==Gse)return;f.preventDefault();const h=f.clientX,p=e(),y=S=>pI(p+h-S,window.innerWidth),x=S=>{r(y(S.clientX))},b=S=>{window.removeEventListener("pointermove",x),fI.forEach(E=>{window.removeEventListener(E,b)}),r(null),o(y(S.clientX))};r(Math.round(p)),window.addEventListener("pointermove",x),fI.forEach(S=>{window.addEventListener(S,b)})},resizeByKey:f=>{Object.hasOwn(hI,f.key)&&(f.preventDefault(),o(pI(e()+hI[f.key],window.innerWidth)))},resetWidth:()=>{o(null)}}},Wse=2,Xse=160,Qse="70vh",Zse="Side panel width",Jse=669,eoe="Its own width",toe="Drag to resize, double-click to reset",noe="Zoom in",roe="Zoom out",mI="Full screen",gI="Leave full screen",soe="f",MB="--line",ooe=e=>e===null?"":getComputedStyle(e).getPropertyValue(MB),ioe=e=>t=>{const n=ooe(e.current);t!==null&&n!==""&&t.style.setProperty(MB,n)},loe=({label:e,width:t,height:n,zoom:r,offset:s,isDragging:o,isCentred:l,children:c,onDragStart:u,onClickCapture:f})=>g.jsx("div",{role:"group","aria-label":e,"data-dragging":o,className:xe("size-full cursor-grab touch-none overflow-clip bg-[radial-gradient(circle,var(--border)_1px,transparent_1px)] bg-size-[16px_16px] select-none data-[dragging=true]:cursor-grabbing",l&&"flex items-center justify-center"),style:{backgroundPosition:`${String(s.x)}px ${String(s.y)}px`},onPointerDown:u,onClickCapture:f,children:g.jsx("div",{className:l?"shrink-0":"mx-auto",style:{width:t*r,height:n*r,transform:`translate(${String(s.x)}px, ${String(s.y)}px)`},children:g.jsx("div",{className:"relative origin-top-left",style:{width:t,height:n,transform:`scale(${String(r)})`},children:c})})}),IB="pointer-events-none z-10 flex justify-end px-2",aoe=`${IB} sticky top-[calc(var(--pinned-height,var(--band-height,0px))+0.5rem)] mt-2`,coe=`${IB} absolute inset-x-0 top-2`,LB=({label:e,width:t,height:n,isFullScreen:r,isCentred:s=!1,panel:o,actions:l=null,navigation:c=null,renderCanvas:u=null,children:f=null,onFullScreenChange:h,onPanelClose:p})=>{const[y,x]=N.useState(vse),{offset:b,isDragging:S,startDrag:E,swallowClickAfterDrag:C,panTo:R}=zse(),T=N.useRef(null),O=N.useRef(null),k=N.useRef(null),M=K=>{k.current=K,ioe(T)(K)},A=()=>{var K;return((K=O.current)==null?void 0:K.getBoundingClientRect().width)??0},{widthPx:L,isResizing:I,narrowestPx:j,startResize:P,resizeByKey:B,resetWidth:H}=Yse(A),D=(K,X)=>{K.preventDefault();const ee=X.getBoundingClientRect(),ae=Ase(y,Ose(K,ee.height));if(ae===y)return;const $={x:K.clientX-ee.left,y:K.clientY-ee.top};R(kse($,b,y,ae,{paneWidth:ee.width,paneHeight:ee.height,width:t,height:n,isCentred:s})),x(ae)},F=K=>{if(K===null)return;const X=ee=>{D(ee,K)};return K.addEventListener("wheel",X,{passive:!1}),()=>{K.removeEventListener("wheel",X)}},z=(K,X)=>{!K&&X.reason===OB&&o!==null?p():h(K)},q=[Un({key:soe,actionId:"full-screen-action",label:r?gI:mI,isPressed:r,onRun:()=>{h(!r)}})];NT((c==null?void 0:c.anchorId)??null,c===null?[]:[...c.groups,q]),Ore((c==null?void 0:c.anchorId)??null,r,()=>{h(!1)});const V=g.jsxs("div",{className:"pointer-events-auto flex items-center gap-0.5 rounded-md border border-input bg-card p-0.5",children:[l===null?null:g.jsxs(g.Fragment,{children:[l,g.jsx("span",{"aria-hidden":"true",className:"mx-0.5 h-4 w-px bg-border"})]}),g.jsx(Nr,{icon:"zoomIn",label:noe,isDisabled:y>=RB,onClick:()=>{x(Nse)}}),g.jsx(Nr,{icon:"zoomOut",label:roe,isDisabled:y<=NB,onClick:()=>{x(Rse)}}),g.jsx(Nr,{icon:r?"leaveFullScreen":"fullScreen",label:r?gI:mI,onClick:()=>{h(!r)}})]}),G=u===null?g.jsx(loe,{label:e,width:t,height:n,zoom:y,offset:b,isDragging:S,isCentred:s,onDragStart:E,onClickCapture:C,children:f}):u({zoom:y,offset:b,onPan:R});return g.jsxs(g.Fragment,{children:[g.jsx("div",{ref:T,className:"relative flex flex-col justify-start rounded-md border",style:{height:Math.max(Xse,n*y+Wse),maxHeight:Qse},children:r?null:g.jsxs(g.Fragment,{children:[g.jsx("div",{ref:F,className:"absolute inset-0",children:G}),g.jsx("div",{className:aoe,children:V})]})}),g.jsx(Vz,{open:r,onOpenChange:z,children:g.jsx(Uz,{children:g.jsxs($z,{ref:M,initialFocus:k,"aria-label":e,"data-navigator-scope":"",className:"fixed inset-0 z-50 flex bg-background text-foreground outline-none duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",children:[g.jsxs("div",{ref:F,className:"relative min-w-0 flex-1",children:[g.jsx("div",{className:coe,children:V}),G,g.jsx(TB,{place:"full-screen"})]}),o===null?null:g.jsx("div",{role:"slider",tabIndex:0,"aria-orientation":"horizontal","aria-label":Zse,"aria-valuemin":j,"aria-valuemax":_B(window.innerWidth),"aria-valuenow":L??Jse,"aria-valuetext":L===null?eoe:`${String(L)} pixels`,title:toe,"data-resizing":I,className:"relative z-10 w-px shrink-0 cursor-col-resize touch-none bg-border transition-colors duration-[180ms] ease-out after:absolute after:inset-y-0 after:-right-1 after:-left-1 hover:bg-foreground focus-visible:bg-ring focus-visible:outline-2 focus-visible:outline-ring data-[resizing=true]:bg-foreground",onPointerDown:P,onKeyDown:B,onDoubleClick:H}),g.jsx("aside",{ref:O,style:L===null?void 0:{width:L},className:xe("w-[min(41.8rem,52.8vw)] max-w-[80vw] min-w-80 shrink-0 overflow-y-auto bg-background duration-200 ease-out animate-in slide-in-from-right-8",o===null?"hidden":""),children:o})]})})})]})};function uoe(e){return!DB(e)}function DB(e){return e.hasOwnProperty("lineNumber")}function doe(e,t,n){if(t==="children")e.children=n||e.children;else if(t==="_ref")e._ref=n||e._ref;else if(t==="data")e.data=e.data?{...e.data,...n}:n;else if(t==="className")e.className=[e.className,n].join(" ").trim();else if(t==="style")e.style={...e.style,...n};else if(typeof n=="function"){const r=e[t];e[t]=r?(...s)=>{r(...s),n(...s)}:n}else{if(n===void 0||typeof n!="object"&&n===e[t])return;if(!(t in e))e[t]=n;else throw new Error(`Didn’t know how to merge prop '${t}'. Only 'className', 'style', and event handlers are supported`)}}function _T(...e){return e.length===1?e[0]:e.reduce((t,n)=>{for(const r in n)doe(t,r,n[r]);return t},{})}const jB=({merge:e,...t})=>{const{_stack:n,...r}=_T(e,t),[s,...o]=n;if(s)return g.jsx(s,{_stack:o,...r});{const{_ref:l,data:c,children:u,...f}=r;return g.jsx("pre",{...f,ref:l,"data-ch":!0,children:g.jsx("div",{style:{minWidth:"fit-content"},children:u})})}},Wy=({merge:e,...t})=>{const{_stack:n,...r}=_T(e,t),[s,...o]=n;if(s){const{Component:l,annotation:c}=s;return g.jsx(l,{_stack:o,...r,annotation:c})}else{const{lineNumber:l,totalLines:c,indentation:u,data:f,annotation:h,...p}=r;return g.jsx("div",{...p})}},foe=({merge:e,...t})=>{const{_stack:n,...r}=_T(e,t),[s,...o]=n;if(s){const{Component:l,annotation:c}=s;return g.jsx(l,{_stack:o,...r,annotation:c})}else{const{value:l,data:c,...u}=r;return g.jsx("span",{...u,children:l})}},hoe=e=>{const t=N.useRef(null),n=e._ref||t;return g.jsx(jB,{merge:e,_ref:n})};function poe(e,t){let n=e;for(let r=t.length-1;r>=0;r--){const s=t[r];n=moe(n,s)}return n}function moe(e,t){const{fromColumn:n,toColumn:r}=t,s=[n,r];let o=FE(e,s[0]);o=FE(o,s[1]+1);let l=[],c=[],u=[];return o.forEach(f=>{f.range[1]<s[0]?l.push(f):f.range[0]>s[1]?u.push(f):c.push(f)}),[...l,{annotation:t,content:c,range:[c[0].range[0],c[c.length-1].range[1]]},...u]}function FE(e,t){const n=e.findIndex(s=>s.range[0]<t&&t<=s.range[1]);if(n===-1)return e;const r=e[n];if(PB(r)){const s=FE(r.content,t);let o=[],l=[];for(const c of s)c.range[1]<t?o.push(c):l.push(c);return[...e.slice(0,n),{...r,content:o,range:[r.range[0],t-1]},{...r,content:l,range:[t,r.range[1]]},...e.slice(n+1)]}return[...e.slice(0,n),{...r,value:r.value.slice(0,t-r.range[0]),range:[r.range[0],t-1]},{...r,value:r.value.slice(t-r.range[0]),range:[t,r.range[1]]},...e.slice(n+1)]}function PB(e){return e.content!==void 0}function zB({content:e,handlers:t,annotationStack:n}){return e.map((r,s)=>PB(r)?g.jsx(yoe,{annotationStack:n,handlers:t,group:r},s):r.style?g.jsx(goe,{annotationStack:n,handlers:t,token:r},s):r.value)}function goe({handlers:e,token:t,annotationStack:n}){const r=xoe(e,n);return g.jsx(foe,{merge:{_stack:r,style:t.style,value:t.value}})}function yoe({group:e,handlers:t,annotationStack:n}){var r;const{annotation:s,content:o}=e,{name:l}=s,c=zB({content:o,handlers:t,annotationStack:[...n,s]}),u=(r=t.find(f=>f.name===l))===null||r===void 0?void 0:r.Inline;return u?g.jsx(u,{annotation:s,children:c}):c}function xoe(e,t){const n=[];return e.forEach(({name:r,Token:s,AnnotatedToken:o})=>{const l=t.filter(c=>c.name===r);o&&l.forEach(c=>n.push({Component:o,annotation:c})),s&&(l.length||n.push({Component:s}),l.forEach(c=>n.push({Component:s,annotation:c})))}),n}const boe=" ";function voe(e){const t=[[]],n=e.slice();let r=1;for(;n.length;){const o=n.shift();if(typeof o=="string"){const[l,...c]=o.split(`
|
|
348
|
-
`);if(l){let u=r;r+=l.length,t[t.length-1].push({value:l,range:[u,r]})}c.length&&(t[t.length-1].push({value:`
|
|
349
|
-
`,range:[r,r+1]}),t.push([]),r=1,n.unshift(c.join(`
|
|
350
|
-
`)))}else{const[l,c,u={}]=o;let f=r;r+=l.length,t[t.length-1].push({value:l,style:{color:c,...u},range:[f,r]})}}const s=t.length;return t.map((o,l)=>{var c,u,f;return{tokens:o,range:[l+1,l+1],lineNumber:l+1,indentation:((f=(u=(c=o[0])===null||c===void 0?void 0:c.value)===null||u===void 0?void 0:u.replace(/\t/g,boe).match(/^\s*/))===null||f===void 0?void 0:f[0].length)||0,totalLines:s}})}function Soe(e,t){let n=e;for(let r=t.length-1;r>=0;r--){const s=t[r];n=woe(n,s)}return n}function woe(e,t){const{fromLineNumber:n,toLineNumber:r}=t,s=[n,r];let o=$E(e,s[0]);o=$E(o,s[1]+1);let l=[],c=[],u=[];return o.forEach(f=>{f.range[1]<s[0]?l.push(f):f.range[0]>s[1]?u.push(f):c.push(f)}),[...l,{annotation:t,lines:c,range:[c[0].range[0],c[c.length-1].range[1]]},...u]}function $E(e,t){const n=e.findIndex(c=>BB(c)&&c.range[0]<t&&t<=c.range[1]);if(n===-1)return e;const r=e[n],s=$E(r.lines,t);let o=[],l=[];return s.forEach(c=>{c.range[1]<t?o.push(c):l.push(c)}),[...e.slice(0,n),{...r,lines:o,range:[r.range[0],t-1]},{...r,lines:l,range:[t,r.range[1]]},...e.slice(n+1)]}function BB(e){return e.annotation!==void 0}function HB({linesOrGroups:e,handlers:t,inlineAnnotations:n,annotationStack:r=[]}){return e.map(s=>BB(s)?g.jsx(Coe,{group:s,handlers:t,inlineAnnotations:n,annotationStack:r},s.range[0]):g.jsx(Eoe,{line:s,handlers:t,inlineAnnotations:n,annotationStack:r},s.lineNumber))}function Eoe({line:e,handlers:t,inlineAnnotations:n,annotationStack:r=[]}){const{lineNumber:s,totalLines:o,indentation:l}=e,c=n.filter(y=>y.lineNumber===s),u=poe(e.tokens,c),f=Toe(t,r);let h=zB({content:u,handlers:t,annotationStack:r});const p={lineNumber:s,indentation:l,totalLines:o,_stack:f};return g.jsx(Wy,{merge:p,children:h},s)}function Coe({group:e,handlers:t,inlineAnnotations:n,annotationStack:r}){var s;const{annotation:o,lines:l}=e,{name:c}=o,u=(s=t.find(h=>h.name===c))===null||s===void 0?void 0:s.Block,f=HB({linesOrGroups:l,handlers:t,inlineAnnotations:n,annotationStack:[...r,o]});return u?g.jsx(u,{annotation:o,children:f}):f}function Toe(e,t){const n=[];return e.forEach(({name:r,Line:s,AnnotatedLine:o})=>{const l=t.filter(c=>c.name===r);o&&l.forEach(c=>{n.push({Component:o,annotation:c})}),s&&(l.length||n.push({Component:s}),l.forEach(c=>{n.push({Component:s,annotation:c})}))}),n}const Noe=N.forwardRef(({code:e,handlers:t=[],...n},r)=>{let{tokens:s,themeName:o,lang:l,annotations:c}=e;if(!s)throw new Error("Missing tokens in code block. Use the `highlight` function to generate the tokens.");t.filter(y=>y.transform).forEach(y=>{c=c.flatMap(x=>y.name!=x.name?x:y.transform(x)||[])});const u=new Set(c.map(y=>y.name)),f=t.filter(y=>!y.onlyIfAnnotated||u.has(y.name)),p={_stack:Ooe(f),_ref:r};return g.jsx(jB,{merge:p,"data-theme":o,"data-lang":l,...n,children:g.jsx(Roe,{tokens:s,handlers:f,annotations:c})})});function Roe({tokens:e,handlers:t,annotations:n}){const r=voe(e),s=n.filter(uoe),o=n.filter(DB),l=Soe(r,s);return HB({linesOrGroups:l,handlers:t,inlineAnnotations:o})}function Ooe(e){const t=e.map(({Pre:r})=>r).filter(Boolean),n=e.map(({PreWithRef:r})=>r).filter(Boolean);return n.length>0&&n.unshift(hoe),[...t,...n]}function Aoe(e){const{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:s}=e,[o,l]=P2({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:c,setMounted:u,transitionStatus:f}=$2(o,!0,!0),h=is(),[p,y]=N.useState(),x=p===null?void 0:p??h,b=Ve(S=>{const E=!o,C=ht(ui,S.nativeEvent);r(E,C),!C.isCanceled&&l(E)});return N.useMemo(()=>({defaultPanelId:h,disabled:s,handleTrigger:b,mounted:c,open:o,panelId:x,setMounted:u,setOpen:l,setPanelIdState:y,transitionStatus:f}),[h,s,b,c,o,x,u,l,y,f])}const FB=N.createContext(void 0);function $B(){const e=N.useContext(FB);if(e===void 0)throw new Error(Qt(15));return e}const koe="data-open",_oe="data-closed",Moe=I2,Ioe="data-panel-open",Loe={[koe]:""},Doe={[_oe]:""},joe={open(e){return e?{[Ioe]:""}:null}},Poe={open(e){return e?Loe:Doe}},UB={...Poe,...cm},zoe=N.forwardRef(function(t,n){const{render:r,className:s,defaultOpen:o=!1,disabled:l=!1,onOpenChange:c,open:u,style:f,...h}=t,p=Ve(c),y=Aoe({open:u,defaultOpen:o,onOpenChange:p,disabled:l}),x=N.useMemo(()=>({open:y.open,disabled:y.disabled,transitionStatus:y.transitionStatus}),[y.open,y.disabled,y.transitionStatus]),b=N.useMemo(()=>({...y,onOpenChange:p,state:x}),[y,p,x]),S=It("div",t,{state:x,ref:n,props:h,stateAttributesMapping:UB});return g.jsx(FB.Provider,{value:b,children:S})}),Boe={...joe,...cm},Hoe=N.forwardRef(function(t,n){const{panelId:r,open:s,handleTrigger:o,state:l,disabled:c}=$B(),{className:u,disabled:f=c,render:h,nativeButton:p=!0,style:y,...x}=t,{getButtonProps:b,buttonRef:S}=vu({disabled:f,focusableWhenDisabled:!0,native:p});return It("button",t,{state:l,ref:[n,S],props:[{"aria-controls":s?r:void 0,"aria-expanded":s,onClick:o},x,b],stateAttributesMapping:Boe})}),jh={height:void 0,width:void 0};function Foe(e){const{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:s,mounted:o,onOpenChange:l,open:c,setMounted:u,setOpen:f,transitionStatus:h}=e,p=N.useRef(null),y=N.useRef(null),[x,b]=N.useState(jh),S=N.useRef(jh),E=N.useRef(!1),C=N.useRef(c),R=N.useRef(!1),[T,O]=N.useState(!1),k=N.useRef(null),M=za(t,p),A=In(c),L=mm(p),I=!c&&!o,j=T?"idle":h,P=c&&(C.current||R.current),B=!c&&o&&y.current==="css-animation"&&x.height===void 0&&x.width===void 0?S.current:x,H=n&&I&&y.current!=="css-animation",D=Ve((G,K=!0)=>{K&&(S.current=G),b(G)}),F=Ve(()=>{var G;(G=k.current)==null||G.call(k),k.current=null}),z=Ve(G=>{F(),k.current=()=>{k.current=null,G()}}),q=Ve(()=>{c&&o&&y.current==="css-animation"&&(R.current=!0)});Be(()=>{!T||h==="starting"||O(!1)},[T,h]),N.useEffect(()=>()=>{q(),F()},[q,F]),Be(()=>{const G=p.current;if(!G)return;!c&&k.current&&F();const K=$oe(G,P);if(y.current=K,c&&h==="idle"&&C.current&&K==="css-animation"){S.current=md(G);return}if(c&&h==="starting"){const ae=E.current;if(E.current=!1,K==="none"){D(md(G)),O(!0);return}if(K==="css-transition"){const J=Uoe(G);if(D(md(G)),!ae)return J;const ne=z0(G,"transition-duration","0s");return z(ne),O(!0),J}D(md(G));const $=z0(G,"animation-name","none");if(!ae){$();return}const Y=z0(G,"animation-duration","0s");$(),z(Y),O(!0);return}if(!c&&o&&(h==="idle"||h==="starting")){if(C.current=!1,R.current=!1,K==="none"){D(jh,!1),u(!1);return}D(md(G));return}if(h!=="ending")return;if(K==="none"){u(!1);return}const X=md(G);if(!(X.height>0||X.width>0)){u(!1);return}D(X),K==="css-animation"&&z0(G,"animation-name","none")()},[o,c,F,D,u,z,P,h]),Ya({enabled:c&&o&&j==="idle",open:!0,ref:p,onComplete(){c&&D(jh,!1)}}),N.useEffect(()=>{if(c||!o||j!=="ending"||!p.current)return;const K=new AbortController;let X=-1;function ee(){A.current||(u(!1),D(jh,!1))}return X=ys.request(()=>{L(ee,K.signal)}),()=>{ys.cancel(X),K.abort()}},[A,o,c,j,L,D,u]),Be(()=>{const G=p.current;!G||!n||!I||G.setAttribute("hidden","until-found")},[I,n]),N.useEffect(function(){const K=p.current;if(!K)return;function X(ee){const ae=ht(fm,ee);l(!0,ae),!ae.isCanceled&&(E.current=!0,f(!0))}return bt(K,"beforematch",X)},[l,f]);const V=s||n||o||c;return{height:B.height,props:{...H?{[Moe]:""}:void 0,hidden:I,id:r},ref:M,shouldPreventOpenAnimation:P,shouldRender:V,transitionStatus:j,width:B.width}}function md(e){return{height:e.scrollHeight,width:e.scrollWidth}}function $oe(e,t){const n=pn(e).getComputedStyle(e),r=(n.animationName.split(",").map(o=>o.trim()).some(o=>o!==""&&o!=="none")||t)&&yI(n.animationDuration),s=yI(n.transitionDuration);return r&&s||s?"css-transition":r?"css-animation":"none"}function yI(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function z0(e,t,n){const r=e.style.getPropertyValue(t),s=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(r===""){e.style.removeProperty(t);return}e.style.setProperty(t,r,s)}}function Uoe(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(s=>{e.style.setProperty(s,"initial","important")});function n(){Object.entries(t).forEach(([s,o])=>{if(o===""){e.style.removeProperty(s);return}e.style.setProperty(s,o)})}const r=ys.request(n);return()=>{ys.cancel(r),n()}}const Voe="--collapsible-panel-height",qoe="--collapsible-panel-width",Goe=N.forwardRef(function(t,n){const{className:r,hiddenUntilFound:s,keepMounted:o,render:l,id:c,style:u,...f}=t,{defaultPanelId:h,mounted:p,onOpenChange:y,open:x,setMounted:b,setPanelIdState:S,setOpen:E,state:C,transitionStatus:R}=$B(),T=s??!1,O=o??!1,k=c||void 0,M=k??h;Be(()=>(S(q=>k??(q===null?void 0:q)),()=>{S(q=>q===k?null:q)}),[k,S]);const{height:A,props:L,ref:I,shouldPreventOpenAnimation:j,shouldRender:P,transitionStatus:B,width:H}=Foe({externalRef:n,hiddenUntilFound:T,id:M,keepMounted:O,mounted:p,onOpenChange:y,open:x,setMounted:b,setOpen:E,transitionStatus:R}),D={...C,transitionStatus:B},F=B4(u,D),z=It("div",{...t,style:void 0},{state:D,ref:I,props:[L,{style:{[Voe]:A===void 0?"auto":`${A}px`,[qoe]:H===void 0?"auto":`${H}px`}},f,F?{style:F}:void 0,j?{style:{animationName:"none"}}:void 0],stateAttributesMapping:UB});return P?z:null});function Koe({...e}){return g.jsx(zoe,{"data-slot":"collapsible",...e})}function Yoe({...e}){return g.jsx(Hoe,{"data-slot":"collapsible-trigger",...e})}function Woe({...e}){return g.jsx(Goe,{"data-slot":"collapsible-content",...e})}const VB=N.createContext(void 0);function Mf(e){const t=N.useContext(VB);if(t===void 0&&!e)throw new Error(Qt(50));return t}const Xoe=600,qB=300,Qoe={...Om,instantType:e=>e.instantType,adaptiveOrigin:e=>e.adaptiveOrigin,closeDelay:e=>e.closeDelay};class Zoe extends Af{constructor(n,r,s){const o=new Nm;super(Joe(n,o,r,s),eie(o),Qoe);Dt(this,"setOpen",(n,r)=>{const{inlineRectCoordsRef:s}=this.context;sz(this,n,r,{onBeforeDispatch(){var l;const o=r.event;n&&r.reason===wn&&r.trigger&&"clientX"in o&&"clientY"in o&&((l=s.current)==null?void 0:l.element)!==r.trigger&&Z5(s,r.trigger,o.clientX,o.clientY)}})})}}function Joe(e,t,n,r=!1){return{...Rm(t,n,r),instantType:void 0,adaptiveOrigin:void 0,closeDelay:qB,...e}}function eie(e){return{popupRef:N.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e,inlineRectCoordsRef:{current:void 0}}}function xI(e){const{open:t,defaultOpen:n=!1,onOpenChange:r,onOpenChangeComplete:s,actionsRef:o,handle:l,triggerId:c,defaultTriggerId:u=null,children:f}=e,h=sb((C,R)=>new Zoe({open:n,openProp:t,activeTriggerId:u,triggerIdProp:c},C,R));h.useControlledProp("openProp",t),h.useControlledProp("triggerIdProp",c),h.useContextCallback("onOpenChange",r),h.useContextCallback("onOpenChangeComplete",s);const p=h.useState("open"),y=h.useState("activeTriggerId"),x=h.useState("mounted"),b=h.useState("payload");Em(h,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:S}=Cm(p,h,()=>{h.context.inlineRectCoordsRef.current=void 0});Be(()=>{p&&y==null&&h.set("payload",void 0)},[h,y,p]),N.useImperativeHandle(o,()=>({unmount:S,close:()=>h.setOpen(!1,ht(pm))}),[S,h]);const E=p||x;return g.jsxs(VB.Provider,{value:h,children:[l&&g.jsx(Sm,{handle:l,store:h}),E&&g.jsx(tie,{store:h}),typeof f=="function"?f({payload:b}):f]})}function tie({store:e}){const t=e.useState("floatingRootContext"),n=xm(t);return Tm(e,{activeTriggerProps:n.reference,inactiveTriggerProps:n.trigger,popupProps:n.floating}),null}const nie=Of(function(t){return Mf(!0)?g.jsx(xI,{...t}):g.jsx(tb,{children:g.jsx(xI,{...t})})}),GB=N.createContext(void 0);function rie(){const e=N.useContext(GB);if(e===void 0)throw new Error(Qt(48));return e}const sie=N.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Mf().useState("mounted")||r?g.jsx(GB.Provider,{value:r,children:g.jsx(_z,{ref:n,...s})}):null}),oie=bm(function(t,n){const{render:r,className:s,delay:o,closeDelay:l,id:c,payload:u,handle:f,style:h,...p}=t,y=Mf(!0),b=Am(f)??y;if(!b)throw new Error(Qt(89));const S=is(c),E=b.useState("isTriggerActive",S),C=b.useState("isOpenedByTrigger",S),R=b.useState("floatingRootContext"),T=b.context.inlineRectCoordsRef,O=N.useRef(null),k=o??Xoe,M=l??qB,{registerTrigger:A,isMountedByThisTrigger:L}=wm(S,O,b,{payload:u,closeDelay:M}),I=km(R,{mouseOnly:!0,move:!1,handleClose:_m(),delay:()=>({open:k,close:M}),triggerElementRef:O,isActiveTrigger:E,isClosing:()=>b.select("transitionStatus")==="ending"}),j=iT(R,{delay:k}),P={open:C},B=b.useState("triggerProps",L),H=QZ(T,C);return It("a",t,{state:P,ref:[n,A,O],props:[I,j.reference,B,H,{id:S},p],stateAttributesMapping:um})}),KB=N.createContext(void 0);function YB(){const e=N.useContext(KB);if(e===void 0)throw new Error(Qt(49));return e}const iie=N.forwardRef(function(t,n){const{render:r,className:s,anchor:o,positionMethod:l="absolute",side:c="bottom",align:u="center",sideOffset:f=0,alignOffset:h=0,collisionBoundary:p="clipping-ancestors",collisionPadding:y=5,arrowPadding:x=5,sticky:b=!1,disableAnchorTracking:S=!1,collisionAvoidance:E=Jx,style:C,...R}=t,T=Mf(),O=rie(),k=ym(),M=T.useState("open"),A=T.useState("mounted"),L=T.useState("floatingRootContext"),I=T.useState("instantType"),j=T.useState("transitionStatus"),P=T.useState("adaptiveOrigin"),B=T.context.inlineRectCoordsRef,H=cb({anchor:o,floatingRootContext:L,positionMethod:l,mounted:A,side:c,sideOffset:f,align:u,alignOffset:h,arrowPadding:x,collisionBoundary:p,collisionPadding:y,sticky:b,disableAnchorTracking:S,keepMounted:O,nodeId:k,collisionAvoidance:E,adaptiveOrigin:P,inline:ZZ(B)}),D=H.update;Be(()=>{M&&A&&D()},[M,A,D]);const F={open:M,side:H.side,align:H.align,anchorHidden:H.anchorHidden,instant:I},z=ub(t,F,{styles:H.positionerStyles,transitionStatus:j,props:R,refs:[n,T.useStateSetter("positionerElement")],hidden:!A,inert:!M});return g.jsx(KB.Provider,{value:H,children:g.jsx(eb,{id:k,children:z})})}),lie=N.forwardRef(function(t,n){const{className:r,render:s,style:o,...l}=t,c=Mf(),{side:u,align:f}=YB(),h=c.useState("open"),p=c.useState("instantType"),y=c.useState("transitionStatus"),x=c.useState("popupProps"),b=c.useState("floatingRootContext"),S=c.useState("closeDelay");return Ya({open:h,ref:c.context.popupRef,onComplete(){var R,T;h&&((T=(R=c.context).onOpenChangeComplete)==null||T.call(R,!0))}}),ib(b,{closeDelay:S}),It("div",t,{state:{open:h,side:u,align:f,instant:p,transitionStatus:y},ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],props:[vm,x,Mm(y),l],stateAttributesMapping:dm})}),aie=N.forwardRef(function(t,n){const{render:r,className:s,style:o,...l}=t,c=Mf(),{arrowRef:u,side:f,align:h,arrowUncentered:p,arrowStyles:y}=YB(),b={open:c.useState("open"),side:f,align:h,uncentered:p};return It("div",t,{state:b,ref:[u,n],props:[{style:y,"aria-hidden":!0},l],stateAttributesMapping:Rf})});function Dm({...e}){return g.jsx(nie,{"data-slot":"hover-card",...e})}function jm({...e}){return g.jsx(oie,{"data-slot":"hover-card-trigger",...e})}function yb({className:e,side:t="bottom",sideOffset:n=6,align:r="start",alignOffset:s=0,anchor:o,collisionAvoidance:l,collisionPadding:c=8,...u}){return g.jsx(sie,{"data-slot":"hover-card-portal",children:g.jsx(iie,{align:r,alignOffset:s,side:t,sideOffset:n,anchor:o,collisionAvoidance:l,collisionPadding:c,className:"isolate z-50",children:g.jsx(lie,{"data-slot":"hover-card-content",className:xe("z-50 origin-(--transform-origin) rounded-lg border border-foreground bg-popover text-sm text-popover-foreground outline-hidden duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...u})})})}function WB({className:e,...t}){return g.jsx(aie,{"data-slot":"hover-card-arrow",className:xe("size-2.5 rotate-45 border-foreground bg-popover data-[side=bottom]:-top-[5px] data-[side=bottom]:border-t data-[side=bottom]:border-l data-[side=top]:-bottom-[5px] data-[side=top]:border-r data-[side=top]:border-b",e),...t})}const cie={plain:void 0,keyword:"var(--color-syntax-keyword)",string:"var(--color-syntax-string)",number:"var(--color-syntax-number)",comment:"var(--color-syntax-quiet)",function:"var(--color-syntax-function)",type:"var(--color-syntax-type)",property:void 0,constant:"var(--color-syntax-number)",tag:"var(--color-syntax-type)",punctuation:void 0},uie={context:"",added:"bg-diff-added/12",removed:"bg-diff-removed/10"},die={context:"",added:"+",removed:"-"},fie={context:"",added:"text-diff-added",removed:"text-diff-removed"},bI={context:"",added:"added",removed:"removed"},XB=`
|
|
351
|
-
`,hie="line",QB="mark",ZB="definition",JB="collapse",e6="collapseTrigger",t6="collapseContent",n6="col-[-2/-1] row-start-1",pie=xe(n6,"sticky right-2 flex items-center gap-1 self-center justify-self-end rounded-md bg-code pl-1 font-sans","opacity-0 transition-opacity duration-[180ms] ease-out group-hover/line:opacity-100 focus-within:opacity-100","data-[open=false]:opacity-100 has-[[aria-pressed=true]]:opacity-100"),mie=150,gie={},yie="group-has-data-[focused=true]/code:opacity-55 data-[focused=true]:opacity-100",xie="flex size-4 items-center justify-center rounded-sm bg-(--line) text-line-foreground opacity-0 group-hover/line:opacity-100 focus-visible:opacity-100",bie="absolute top-0.5 left-1",vie="mt-1",Sie="grid-cols-[3.25rem_1.25rem_1fr]",wie="grid-cols-[1.25rem_1.25rem_3.25rem_1.25rem_1fr]",Eie=xe("-ml-1 pl-2 transition-[background-color,box-shadow] duration-[180ms] ease-out","data-[marked=true]:bg-[color-mix(in_oklab,var(--line,var(--color-primary))_6%,transparent)]","data-[marked=true]:shadow-[inset_2px_0_0_color-mix(in_oklab,var(--line,var(--color-primary))_70%,transparent)]"),Cie="rounded-sm bg-[color-mix(in_oklab,var(--line,var(--color-primary))_22%,transparent)] outline outline-1 outline-[var(--line,var(--color-primary))]",Tie="max-h-48 shrink-0 overflow-y-auto border-b px-3 py-2.5 text-foreground [contain:inline-size]",Nie="rounded-sm underline decoration-muted-foreground decoration-dotted underline-offset-[0.25em] hover:bg-muted focus-visible:bg-muted",Rie="flex max-h-[30rem] w-max min-w-[min(20rem,calc(100vw-2rem))] max-w-[min(64rem,calc(100vw-2rem))] flex-col overflow-hidden font-sans whitespace-normal",r6="flex items-baseline justify-between gap-4 border-b px-3 py-2",Oie="flex flex-wrap items-baseline gap-x-4 gap-y-1 border-t px-3 py-1.5 text-xs [contain:inline-size]",Aie="[data-reference]",kie="[data-code-block]",_ie="[data-reference-scope]",Mie=":",Iie=new Map([["ArrowLeft",-1],["ArrowRight",1]]),Lie="data-[selected=true]:bg-primary/20",Die="data-[commented=true]:shadow-[inset_3px_0_0_var(--line,var(--color-primary))]",UE="pr-2 text-right text-syntax-quiet tabular-nums select-none",jie="cursor-pointer hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring aria-pressed:font-bold aria-pressed:text-foreground",s6={},Xy=new Set,o6=new Set,Pie=[],i6=new Set,zie={lines:[],definitions:s6,isWrapped:!1,selectedLineLabels:Xy,commentedLineKeys:Xy,markedLines:o6,openRootBlockIds:i6,tabStopReferenceKey:null},Bie=":",l6=({side:e,lineLabel:t})=>`${e}${Bie}${t}`,VE=e=>e.mark==="removed"?e.removedNumberLabel===""?null:{side:"old",lineLabel:e.removedNumberLabel}:e.numberLabel===""?null:{side:"new",lineLabel:e.numberLabel},If=N.createContext(zie),a6=(e,t)=>`${String(e)}${Mie}${String(t)}`,c6=(e,t)=>e.flatMap((n,r)=>n.references.filter(s=>Object.hasOwn(t,s.definitionId)).map(s=>a6(r+1,s.fromColumn))),Hie=(e,t)=>c6(e,t).length>0,Fie=e=>{const t=Iie.get(e.key),n=e.currentTarget.closest(_ie)??e.currentTarget.closest(kie);if(t===void 0||n===null)return;const r=[...n.querySelectorAll(Aie)],s=r.indexOf(e.currentTarget)+t;s<0||s>=r.length||(e.preventDefault(),r[s].focus())},$ie=e=>e.kind==="usages"?e.countLabel:`Defined in ${e.pathLabel}, ${e.rangeLabel}`,Uie=({text:e,kind:t})=>[e,cie[t]],Vie=e=>e.flatMap((t,n)=>[...t.tokens.map(Uie),...n===e.length-1?[]:[XB]]),qie=({rootBlockId:e,fromLine:t,toLine:n,hasTrigger:r})=>({name:JB,query:e,fromLineNumber:t,toLineNumber:n,data:{hasTrigger:r}}),Gie=(e,t)=>[...t.map(qie),...e.flatMap((n,r)=>[...n.marks.map(s=>({name:QB,query:"",lineNumber:r+1,...s})),...n.references.map(({definitionId:s,...o})=>({name:ZB,query:s,lineNumber:r+1,...o}))])],Kie=(e,t)=>{const n=e.map(r=>r.tokens.map(s=>s.text).join("")).join(XB);return{value:n,code:n,annotations:Gie(e,t),tokens:Vie(e),lang:"",meta:"",themeName:"",style:gie}},vI=e=>{const t=e.data;return typeof t=="object"&&t!==null&&"hasTrigger"in t&&t.hasTrigger===!0},Yie=e=>{const{fromLineNumber:t,toLineNumber:n}=e,r=vI(e)?t+1:t;return[e,...vI(e)?[{...e,name:e6,toLineNumber:t}]:[],...r>n?[]:[{...e,name:t6,fromLineNumber:r}]]},Wie=({annotation:e,children:t})=>{const{openRootBlockIds:n,onRootBlockOpenChange:r}=N.use(If);return g.jsx(Koe,{open:n.has(e.query),className:"contents",onOpenChange:s=>{r==null||r(e.query,s)},children:t})},Xie={name:JB,transform:Yie,Block:Wie},Qie={name:e6,AnnotatedLine:({annotation:e,...t})=>g.jsx(Wy,{merge:t,data:{...t.data,triggeredRootBlockId:e.query}})},Zie={name:t6,Block:({children:e})=>g.jsx(Woe,{children:e})},Jie=e=>typeof(e==null?void 0:e.triggeredRootBlockId)=="string"?e.triggeredRootBlockId:null,ele=({numberLabel:e,isSelected:t})=>{const{selectLineLabel:n,onSelectLine:r}=N.use(If);return r===void 0||n===void 0||e===""?g.jsx("span",{className:UE,children:e}):g.jsx("button",{type:"button","aria-label":`${n} ${e}`,"aria-pressed":t,className:xe(UE,jie),onClick:s=>{r(e,s.shiftKey)},children:e})},tle={name:hie,Line:e=>{const{lines:t,isWrapped:n,addCommentLabel:r,selectedLineLabels:s,commentedLineKeys:o,markedLines:l,renderLineExtra:c,renderLineThreads:u,renderWaypointLane:f,renderThreadMark:h,renderCollapseControls:p,openRootBlockIds:y,onAddComment:x}=N.use(If),b=t.find((M,A)=>A===e.lineNumber-1),S=Jie(e.data);if(b===void 0)return g.jsx(Wy,{merge:e});const E=s.has(b.numberLabel),C=VE(b),R=C===null?"":`${bI[b.mark]} ${C.lineLabel}`.trim(),T=f!==void 0,O=C===null||h===void 0?null:h(C),k=x===void 0||r===void 0||C===null?null:g.jsx("button",{type:"button","aria-label":`${r} ${R}`,title:r,className:xe(xie,T?vie:bie),onClick:M=>{x(C,M.shiftKey)},children:g.jsx(k2,{"aria-hidden":"true",className:"size-3",strokeWidth:3})});return g.jsxs(g.Fragment,{children:[g.jsxs("div",{"data-line":b.numberLabel,"data-mark":b.mark,"data-focused":b.isFocused,"data-selected":E,"data-commented":C!==null&&o.has(l6(C)),"data-comment-side":x===void 0||C==null?void 0:C.side,"data-comment-line":x===void 0||C==null?void 0:C.lineLabel,className:xe("group/line relative grid min-h-6 pr-4",T?wie:Sie,uie[b.mark],yie,Lie,Die),children:[T?g.jsxs(g.Fragment,{children:[f(b),g.jsx("span",{className:"flex justify-center",children:O??k})]}):null,b.mark==="removed"&&b.removedNumberLabel!==""?g.jsx("span",{className:UE,children:b.removedNumberLabel}):g.jsx(ele,{numberLabel:b.numberLabel,isSelected:E}),g.jsxs("span",{"data-diff-mark":"",className:xe("text-center font-bold select-none",fie[b.mark]),children:[g.jsx("span",{"aria-hidden":"true",children:die[b.mark]}),g.jsx("span",{className:"sr-only",children:bI[b.mark]})]}),g.jsx(Wy,{merge:e,"data-marked":l.has(b),className:xe(n6,Eie,n?"wrap-anywhere whitespace-pre-wrap":"whitespace-pre")}),T?null:k,S===null||p===void 0?null:g.jsx("span",{"data-collapse-controls":"","data-open":y.has(S),className:pie,children:p(S)})]}),c===void 0||b.numberLabel===""?null:c(b.numberLabel),u===void 0||C===null?null:u(C)]})}},nle={name:QB,Inline:({children:e})=>g.jsx("mark",{className:xe("text-inherit",Cie),children:e})},rle=({declaration:e})=>{const{renderDefinitionDescription:t}=N.use(If),n=`${e.pathLabel}, ${e.rangeLabel}`;return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:r6,children:[g.jsx("span",{className:"min-w-0 font-mono text-[0.8125rem] wrap-anywhere",children:e.pathLabel}),g.jsx("span",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:e.rangeLabel})]}),e.description===null||t===void 0?null:g.jsx("div",{className:Tie,children:t(e.description)}),e.lines.length===0?null:g.jsx(Tu,{lines:e.lines,label:n,className:"flex-1 overflow-y-auto"}),e.note===null&&e.forgeLink===null?null:g.jsxs("div",{className:Oie,children:[e.note===null?null:g.jsx("span",{className:"text-muted-foreground",children:e.note}),e.forgeLink===null?null:g.jsx(Wa,{href:e.forgeLink.href,label:e.forgeLink.label})]})]})},sle=({usages:e})=>g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:r6,children:[g.jsx("span",{className:"min-w-0 font-mono text-[0.8125rem] wrap-anywhere",children:e.nameLabel}),g.jsx("span",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:e.countLabel})]}),e.files.length===0?null:g.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.files.map(t=>g.jsxs("section",{"aria-label":t.pathLabel,className:"border-b last:border-b-0",children:[g.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 px-3 py-1.5 text-xs",children:[g.jsx("span",{className:"min-w-0 font-mono wrap-anywhere",children:t.pathLabel}),t.forgeLink===null?null:g.jsx(Wa,{href:t.forgeLink.href,label:t.forgeLink.label})]}),g.jsx(Tu,{lines:t.lines,label:`${e.nameLabel} in ${t.pathLabel}`})]},t.pathLabel))}),e.note===null?null:g.jsx("p",{className:"px-3 py-2 text-xs text-muted-foreground [contain:inline-size]",children:e.note})]}),ole={name:ZB,Inline:({annotation:e,children:t})=>{const{definitions:n,tabStopReferenceKey:r}=N.use(If);if(!Object.hasOwn(n,e.query))return g.jsx(g.Fragment,{children:t});const s=n[e.query],o=a6(e.lineNumber,e.fromColumn)===r;return g.jsxs(Dm,{children:[g.jsx(jm,{delay:mie,render:g.jsx("span",{}),tabIndex:o?0:-1,"data-reference":"","aria-description":$ie(s),onKeyDown:Fie,className:Nie,children:t}),g.jsx(yb,{className:Rie,children:s.kind==="usages"?g.jsx(sle,{usages:s}):g.jsx(rle,{declaration:s})})]})}},ile=[Xie,Zie,Qie,tle,nle,ole];function Tu({lines:e,definitions:t=s6,label:n,path:r,className:s,isWrapped:o=!1,hasReferenceTabStop:l=!0,addCommentLabel:c,selectLineLabel:u,selectedLineLabels:f=Xy,commentedLineKeys:h=Xy,markedLines:p=o6,renderLineExtra:y,renderLineThreads:x,renderWaypointLane:b,renderThreadMark:S,renderDefinitionDescription:E,collapses:C=Pie,openRootBlockIds:R=i6,renderCollapseControls:T,onRootBlockOpenChange:O,onAddComment:k,onSelectLine:M}){const A=N.useMemo(()=>l?c6(e,t).at(0)??null:null,[l,e,t]),L=N.useMemo(()=>({lines:e,definitions:t,tabStopReferenceKey:A,isWrapped:o,addCommentLabel:c,selectLineLabel:u,selectedLineLabels:f,commentedLineKeys:h,markedLines:p,renderLineExtra:y,renderLineThreads:x,renderWaypointLane:b,renderThreadMark:S,renderDefinitionDescription:E,openRootBlockIds:R,renderCollapseControls:T,onRootBlockOpenChange:O,onAddComment:k,onSelectLine:M}),[e,t,A,o,c,u,f,h,p,y,x,b,S,E,R,T,O,k,M]),I=N.useMemo(()=>Kie(e,C),[e,C]);return g.jsx("div",{role:"group","aria-label":n,"data-path":r,"data-code-block":"",className:xe("group/code overflow-x-auto bg-code py-2 font-mono text-sm leading-6",s),children:g.jsx(If,{value:L,children:g.jsx(Noe,{code:I,handlers:ile,className:xe("m-0 grid",o?"":"min-w-max")})})})}const u6=({title:e,titleKind:t="plain",kindLabel:n,target:r,codeViews:s=null,children:o,onClose:l})=>g.jsxs("section",{"aria-label":e,className:"flex min-h-full flex-col",children:[g.jsxs("div",{className:"sticky top-0 z-10 flex items-start gap-3 border-b bg-background px-4 py-3",children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("p",{className:"text-xs text-muted-foreground",children:n}),g.jsx("h3",{className:xe("text-base leading-6 font-bold wrap-anywhere",t==="code"&&"font-mono text-[0.8125rem] leading-5"),children:e})]}),g.jsx(Nr,{icon:"close",label:"Close the code panel",onClick:l})]}),g.jsx("div",{className:"flex flex-col gap-3 px-4 py-4 text-sm empty:hidden",children:o}),s,r===null?null:g.jsxs("div",{className:"border-t",children:[g.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 px-4 py-2",children:[g.jsx("span",{className:"min-w-0 font-mono text-[0.8125rem] wrap-anywhere",children:r.pathLabel}),g.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:r.rangeLabel})]}),g.jsx(Tu,{lines:r.lines,label:`${r.pathLabel}, ${r.rangeLabel}`,isWrapped:!0,className:"border-y"}),r.forgeLink===null?null:g.jsx(Wa,{href:r.forgeLink.href,label:r.forgeLink.label,className:"mx-4 my-2 text-xs"})]})]}),d6=150,lle="rounded-sm underline decoration-primary-text/60 decoration-1 underline-offset-[0.3em] transition-colors duration-[180ms] ease-out hover:text-primary-text hover:decoration-primary-text",ale="font-mono text-[0.875em]",cle=e=>{var t;return e.anchorId===null?(t=e.forgeLink)==null?void 0:t.href:`#${e.anchorId}`},f6=({target:e})=>g.jsxs(yb,{className:"flex max-h-[26.25rem] w-[min(42.5rem,calc(100vw-2rem))] flex-col overflow-hidden",children:[g.jsxs("div",{className:"flex items-baseline justify-between gap-4 border-b px-3 py-2",children:[g.jsx("span",{className:"min-w-0 font-mono text-[0.8125rem] wrap-anywhere",children:e.pathLabel}),g.jsx("span",{className:"shrink-0 text-xs text-muted-foreground tabular-nums",children:e.rangeLabel})]}),g.jsx(Tu,{lines:e.lines,label:`${e.pathLabel}, ${e.rangeLabel}`,className:"min-h-0 flex-1 overflow-y-auto"}),e.forgeLink===null?null:g.jsx("div",{className:"border-t px-3 py-1.5",children:g.jsx(Wa,{href:e.forgeLink.href,label:e.forgeLink.label,className:"text-xs"})})]}),ule=({target:e,isCode:t,children:n,onOpen:r})=>{const{anchorId:s}=e;return g.jsxs(Dm,{children:[g.jsx(jm,{delay:d6,href:cle(e),target:s===null?"_blank":void 0,rel:s===null?"noreferrer":void 0,className:xe(lle,t?ale:""),onClick:o=>{s!==null&&(o.preventDefault(),r(s))},children:n}),g.jsx(f6,{target:e})]})},h6=N.createContext(null),dle="Expand all",fle="Collapse all",hle="q",SI=new Set,p6=e=>e.kind==="accordion"?e.sections.map(t=>t.label):e.kind==="quote"?e.blocks.flatMap(p6):[],ple=e=>e.flatMap(p6),mle=(e,t)=>new Set(e.has(t)?[...e].filter(n=>n!==t):[...e,t]),gle=(e,t)=>{const[n,r]=N.useState(SI),s=ple(t),o=s.length>0&&s.every(c=>n.has(c)),l=s.length===0?[]:[[Un({key:hle,actionId:"expand-context-action",label:o?fle:dle,onRun:()=>{r(o?SI:new Set(s))}})]];return NT(e,l),{openLabels:n,onToggle:c=>{r(u=>mle(u,c))}}},Lf=e=>e.map((t,n)=>({key:String(n),item:t})),wI=4,yle=e=>e.inlines.flatMap(t=>t.kind==="code-link"?[t.text]:[]),xle=e=>e.inlines.flatMap(t=>t.kind==="code"?[t.text]:[]),ble=e=>[...yle(e),...xle(e)].slice(0,1),vle=e=>{const t=e.flatMap(r=>r.kind==="list"?r.items:[]);if(t.length===0)return null;const n=t.flatMap(ble);return{names:n.slice(0,wI),moreCount:Math.max(0,n.length-wI)}},m6="flex flex-wrap items-end gap-x-6 border-b border-border",g6="-mb-px cursor-pointer border-b-2 border-transparent pb-2 text-sm font-bold text-muted-foreground transition-colors duration-[180ms] ease-out hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring aria-selected:border-[var(--line,var(--color-primary))] aria-selected:text-foreground",Z1=0,y6=(e,t,n)=>{const r=n-1;return e==="ArrowRight"?t===r?Z1:t+1:e==="ArrowLeft"?t===Z1?r:t-1:e==="Home"?Z1:e==="End"?r:null},Sle="pt-4 text-[1.1875rem] leading-7 font-semibold tracking-[-0.01em] text-foreground first:pt-0",EI="flex flex-col gap-2 pl-5",CI="rounded-sm bg-muted box-decoration-clone px-1.5 py-0.5 font-mono text-[0.875em]",wle="rounded-sm underline decoration-1 underline-offset-[0.3em] hover:text-primary-text",Ele="flex flex-col gap-4 border-l-2 border-border pl-4 text-muted-foreground",Cle="overflow-x-auto rounded-md bg-code px-4 py-3 font-mono text-sm leading-6",Tle=({inline:e,codeLinks:t,onOpenCodeLink:n})=>e.kind==="text"?e.text:e.kind==="strong"?g.jsx("strong",{className:"font-bold",children:e.text}):e.kind==="emphasis"?g.jsx("em",{children:e.text}):e.kind==="code"?g.jsx("code",{className:CI,children:e.text}):e.kind==="link"?g.jsx("a",{href:e.href,target:"_blank",rel:"noreferrer",className:wle,children:e.text}):e.linkId===null||!Object.hasOwn(t,e.linkId)?e.isCode?g.jsx("code",{className:CI,children:e.text}):e.text:g.jsx(ule,{target:t[e.linkId],isCode:e.isCode,onOpen:n,children:e.text}),cf=({inlines:e,codeLinks:t,onOpenCodeLink:n})=>Lf(e).map(({key:r,item:s})=>g.jsx(Tle,{inline:s,codeLinks:t,onOpenCodeLink:n},r)),Pm=({blocks:e,codeLinks:t,onOpenCodeLink:n})=>Lf(e).map(({key:r,item:s})=>g.jsx(Lle,{block:s,codeLinks:t,onOpenCodeLink:n},r)),Nle=({item:e,codeLinks:t,onOpenCodeLink:n})=>g.jsxs("li",{className:e.blocks.length===0?"":"space-y-2",children:[e.inlines.length===0?null:g.jsx("span",{children:g.jsx(cf,{inlines:e.inlines,codeLinks:t,onOpenCodeLink:n})}),g.jsx(Pm,{blocks:e.blocks,codeLinks:t,onOpenCodeLink:n})]}),TI=(e,t)=>`${e}-tab-${String(t)}`,NI=(e,t)=>`${e}-panel-${String(t)}`,Rle=({tabs:e,codeLinks:t,onOpenCodeLink:n})=>{const r=N.useId(),[s,o]=N.useState(0),l=N.useRef([]),c=e.at(s)??e[0],u=f=>{var p;const h=y6(f.key,s,e.length);h!==null&&(f.preventDefault(),o(h),(p=l.current[h])==null||p.focus())};return g.jsxs("div",{className:"flex flex-col gap-4",children:[g.jsx("div",{role:"tablist",className:m6,children:Lf(e).map(({key:f,item:h},p)=>g.jsx("button",{ref:y=>{l.current[p]=y},type:"button",role:"tab",id:TI(r,p),"aria-selected":p===s,"aria-controls":NI(r,p),tabIndex:p===s?0:-1,className:g6,onClick:()=>{o(p)},onKeyDown:u,children:h.label},f))}),g.jsx("div",{role:"tabpanel",id:NI(r,s),"aria-labelledby":TI(r,s),className:"flex flex-col gap-4",children:g.jsx(Pm,{blocks:c.blocks,codeLinks:t,onOpenCodeLink:n})})]})},Ole="See change details",Ale="Hide change details",kle="cursor-pointer rounded-sm text-sm text-foreground underline decoration-1 underline-offset-[0.3em] hover:text-primary-text focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",_le=({summary:e})=>g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"font-mono text-[0.875em]",children:e.names.join(", ")}),e.moreCount>0?g.jsx("span",{children:`+ ${String(e.moreCount)} more`}):null]}),Mle=({section:e,codeLinks:t,onOpenCodeLink:n})=>{const r=N.useId(),s=N.use(h6),[o,l]=N.useState(!1),c=s===null?o:s.openLabels.has(e.label),u=`${r}-name`,f=`${r}-panel`,h=vle(e.blocks),p=g.jsx("button",{type:"button","aria-expanded":c,"aria-controls":f,className:kle,onClick:()=>{s===null?l(y=>!y):s.onToggle(e.label)},children:c?Ale:Ole});return g.jsxs("section",{"aria-labelledby":u,className:"flex flex-col gap-2 py-3",children:[g.jsx("h4",{id:u,className:"text-sm font-bold text-foreground",children:e.label}),g.jsxs("p",{className:"flex flex-wrap items-baseline gap-x-2 text-sm text-muted-foreground",children:[!c&&h!==null?g.jsx(_le,{summary:h}):null,p]}),c?g.jsx("div",{id:f,className:"flex flex-col gap-4",children:g.jsx(Pm,{blocks:e.blocks,codeLinks:t,onOpenCodeLink:n})}):null]})},Ile=({sections:e,codeLinks:t,onOpenCodeLink:n})=>g.jsx("div",{className:"flex flex-col divide-y divide-border border-y border-border",children:Lf(e).map(({key:r,item:s})=>g.jsx(Mle,{section:s,codeLinks:t,onOpenCodeLink:n},r))});function Lle({block:e,codeLinks:t,onOpenCodeLink:n}){if(e.kind==="heading")return g.jsx("h3",{className:Sle,children:g.jsx(cf,{inlines:e.inlines,codeLinks:t,onOpenCodeLink:n})});if(e.kind==="paragraph")return g.jsx("p",{children:g.jsx(cf,{inlines:e.inlines,codeLinks:t,onOpenCodeLink:n})});if(e.kind==="quote")return g.jsx("blockquote",{className:Ele,children:g.jsx(Pm,{blocks:e.blocks,codeLinks:t,onOpenCodeLink:n})});if(e.kind==="accordion")return g.jsx(Ile,{sections:e.sections,codeLinks:t,onOpenCodeLink:n});if(e.kind==="tabs")return g.jsx(Rle,{tabs:e.tabs,codeLinks:t,onOpenCodeLink:n});if(e.kind==="code-block")return g.jsx("pre",{"data-language":e.language??void 0,className:Cle,children:g.jsx("code",{children:e.text})});const r=Lf(e.items).map(({key:s,item:o})=>g.jsx(Nle,{item:o,codeLinks:t,onOpenCodeLink:n},s));return e.isOrdered?g.jsx("ol",{className:xe(EI,"list-decimal"),children:r}):g.jsx("ul",{className:xe(EI,"list-disc"),children:r})}const uo=({blocks:e,codeLinks:t,onOpenCodeLink:n,className:r})=>g.jsx("div",{className:xe("flex max-w-[68ch] flex-col gap-4 text-base leading-[1.7] text-pretty",r),children:g.jsx(Pm,{blocks:e,codeLinks:t,onOpenCodeLink:n})}),Dle=({blocks:e,codeLinks:t,onOpenCodeLink:n})=>g.jsx(uo,{blocks:e,codeLinks:t,onOpenCodeLink:n,className:"gap-2 text-sm leading-6"}),x6=N.createContext(null),jle="block h-[0.7em] rounded-[0.225rem] bg-foreground/10 motion-safe:animate-pulse",Ple="w-3/5",b6=({label:e,lineCount:t=1,className:n,caption:r=null})=>{const s=Array.from({length:t},(o,l)=>l);return g.jsxs("span",{"data-unwritten":"true",className:xe("flex min-w-0 flex-col justify-center gap-[0.6em] py-[0.3em]",n),children:[g.jsx("span",{className:"sr-only",children:e}),s.map(o=>g.jsx("span",{"aria-hidden":"true",className:xe(jle,t>1&&o===t-1?Ple:"")},o)),r]})},cl=({isPending:e,lineCount:t,className:n,caption:r,children:s})=>{const o=N.use(x6);return!e||o===null?g.jsx(g.Fragment,{children:s}):g.jsx(b6,{label:o,lineCount:t,className:n,caption:r})},zle=3,Ble=({className:e})=>g.jsx(EX,{"aria-hidden":"true",className:xe("size-3.5 shrink-0 text-muted-foreground",e)}),Df=({label:e,className:t})=>g.jsxs("span",{className:xe("inline-flex items-center gap-1.5 text-sm text-muted-foreground",t),children:[g.jsx(Ble,{}),e]}),Mp=({label:e,keyLabel:t,icon:n=null,variant:r="outline",actionId:s,onClick:o})=>g.jsxs(st,{type:"button",variant:r,size:"xs","data-user-action-id":s,onClick:o,children:[n,e,t===null?null:g.jsx("kbd",{"aria-hidden":"true",className:"inline-grid h-4 min-w-4 place-items-center rounded-sm border border-b-2 border-current/35 px-1 font-mono text-[0.625rem] leading-none font-bold uppercase opacity-80",children:t})]}),v6=({label:e})=>g.jsx(b6,{label:e,lineCount:zle,className:"text-sm"}),S6=({hint:e,label:t,isBeingWritten:n,buttonLabel:r,onWriteUp:s})=>g.jsxs("div",{className:"flex flex-col gap-2",children:[e===null?null:g.jsx("p",{className:"text-foreground",children:e}),n?g.jsx(v6,{label:t}):g.jsxs(g.Fragment,{children:[g.jsx(Df,{label:t}),s===null?null:g.jsx("div",{children:g.jsx(Mp,{label:r,keyLabel:_f,actionId:"explain-part-action",onClick:s})})]})]}),Hle=({x:e,y:t})=>`${String(e)} ${String(t)}`,qE=e=>e.map((t,n)=>`${n===0?"M":"L"} ${Hle(t)}`).join(" "),Fle={nodeIds:new Set,edgeIds:new Set},GE=(e,t)=>{if(t===null)return Fle;const n=e.filter(r=>r.from===t||r.to===t);return{nodeIds:new Set([t,...n.flatMap(r=>[r.from,r.to])]),edgeIds:new Set(n.map(r=>r.id))}},w6=(e,t,n)=>{if(n.length===0)return t;const r=[...new Set(e.filter(s=>n.includes(s.from)).map(s=>s.to))].filter(s=>!t.has(s));return w6(e,new Set([...t,...r]),r)},Qy=(e,t)=>w6(e,new Set(t),t),$le=e=>e.map(({id:t,from:n,to:r})=>({id:t,from:r,to:n})),Ule=(e,t)=>new Set([...Qy($le(e),[t]),...Qy(e,[t])]),Vle=(e,t,n)=>{const r=e.filter(o=>!t.includes(o.from)&&!t.includes(o.to)),s=Qy(r,n.filter(o=>!t.includes(o)));return new Set([...Qy(e,t)].filter(o=>!s.has(o)))},qle=2,Gle="M1 1.5 8 5 1 8.5z",Kle="group absolute flex -translate-x-1/2 flex-col items-center rounded-sm text-center transition-opacity duration-[180ms] ease-out data-[standing=far]:opacity-25",Yle="mt-0.5 rounded-sm bg-background px-1 font-mono text-[0.6875rem] leading-4 whitespace-nowrap text-muted-foreground transition-colors duration-[180ms] ease-out group-hover:text-foreground group-data-[quiet=false]:text-foreground group-data-[standing=focal]:font-bold group-data-[standing=focal]:text-foreground group-data-[standing=near]:text-foreground",Wle="fill-none stroke-current opacity-55 transition-[color,opacity] duration-[180ms] ease-out [stroke-width:1.25] data-[standing=far]:opacity-15 data-[standing=near]:text-foreground data-[standing=near]:opacity-100",Xle="Not assessed yet.",Qle="The agent is assessing this file.",E6="Assess this file",Zle="block w-full rounded-sm px-2 py-1 text-left font-mono text-[0.8125rem] leading-5 wrap-anywhere hover:bg-muted",RI=(e,t,n)=>n?e?"focal":t?"near":"far":"plain",OI=({list:e,onSelect:t})=>g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsx("h4",{className:"text-xs font-bold text-muted-foreground tabular-nums",children:e.heading}),e.files.length===0?g.jsx("p",{className:"text-muted-foreground",children:e.emptyLabel}):g.jsx("ul",{className:"-mx-2 flex flex-col",children:e.files.map(n=>g.jsx("li",{children:g.jsx("button",{type:"button",className:Zle,onClick:()=>{t(n.id)},children:n.label})},n.id))})]}),KE=e=>e.isUnassessed&&e.assessment!==null,Jle=(e,t)=>e===null||t===null||!KE(e)||e.isBeingWritten?[]:[Un({key:_f,actionId:"explain-blast-file-action",label:E6,onRun:()=>{t(e.path)}})],eae=(e,t)=>e.length===0?[t]:[...e.slice(0,-1),[...e[e.length-1],...t]],tae=({title:e,board:t,codeLinks:n,authoring:r,navigation:s=null,onWriteUpFile:o=null,onOpenCodeLink:l,onOpenFile:c})=>{const u=N.useId(),[f,h]=N.useState(null),[p,y]=N.useState(null),[x,b]=N.useState(!1),[S,E]=N.useState(null),C=t.nodes.find(j=>j.id===f)??null,R=p??f,T=t.edges.map(j=>({id:j.id,from:j.importerId,to:j.importedId})),O=GE(T,R),k=R!==null,M=r!==null&&(C==null?void 0:C.assessment)!=null,A=M&&S===f,L=()=>{E(null)},I=()=>{h(null),L()};return g.jsxs(LB,{label:e,width:t.width,height:t.height,isFullScreen:x,isCentred:!0,navigation:s===null?null:{...s,groups:eae(s.groups,Jle(C,o))},onFullScreenChange:j=>{b(j),j||I()},onPanelClose:I,panel:C===null?null:g.jsxs(u6,{title:C.path,titleKind:"code",kindLabel:C.markLabel,target:null,onClose:I,children:[A?r.renderImpactEditor(C,L):null,A||!KE(C)?null:g.jsx(S6,{hint:C.impactNote,label:C.isBeingWritten?Qle:Xle,isBeingWritten:C.isBeingWritten,buttonLabel:E6,onWriteUp:o===null?null:()=>{o(C.path)}}),A||KE(C)||C.impactNote===null?null:g.jsx(cl,{isPending:C.isUnassessed,lineCount:2,children:g.jsx("p",{className:"text-muted-foreground",children:C.impactNote})}),A||C.impactReason===null?null:g.jsx(uo,{blocks:C.impactReason,codeLinks:n,onOpenCodeLink:l}),M&&!A?g.jsx(st,{variant:"link",size:"sm",className:"self-start px-0",onClick:()=>{E(C.id)},children:r.editLabel}):null,g.jsx(OI,{list:C.importers,onSelect:h}),g.jsx(OI,{list:C.imports,onSelect:h}),C.fileLink===null?null:g.jsx("button",{type:"button",className:"self-start rounded-md border border-input bg-card px-2.5 py-1 text-[0.8rem] hover:bg-muted",onClick:()=>{const{anchorId:j}=C.fileLink??{anchorId:null};b(!1),I(),j!==null&&c(j)},children:C.fileLink.label})]}),children:[g.jsxs("svg",{"aria-hidden":"true",width:t.width,height:t.height,viewBox:`0 0 ${String(t.width)} ${String(t.height)}`,className:"pointer-events-none absolute inset-0 text-muted-foreground",children:[g.jsx("defs",{children:g.jsx("marker",{id:u,viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:g.jsx("path",{d:Gle,fill:"context-stroke"})})}),t.edges.map(j=>g.jsx("path",{d:qE(j.points),"data-standing":RI(!1,O.edgeIds.has(j.id),k),markerEnd:`url(#${u})`,className:Wle},j.id))]}),t.nodes.map(j=>g.jsxs("button",{type:"button",title:j.path,"aria-pressed":j.id===f,"data-user-action-id":"blast-diagram-card-action","data-mark":j.mark,"data-quiet":KM(j.mark),"data-standing":RI(j.id===R,O.nodeIds.has(j.id),k),className:Kle,style:{left:j.x,top:j.y-zz(j.radius)/qle},onPointerEnter:()=>{y(j.id)},onPointerLeave:()=>{y(null)},onFocus:()=>{y(j.id)},onBlur:()=>{y(null)},onClick:()=>{h(j.id),b(!0)},children:[g.jsx(bT,{mark:j.mark,radius:j.radius}),g.jsx("span",{className:Yle,children:j.label}),KM(j.mark)?null:g.jsx("span",{className:"rounded-sm bg-background px-1 text-[0.6875rem] leading-4 text-muted-foreground",children:j.markLabel})]},j.id))]})},nae={plain:"",code:"font-mono text-[0.94em]"},rae="not-last:after:ml-[0.5em] not-last:after:font-sans not-last:after:content-['•']",uf=({segments:e,className:t})=>g.jsx("span",{className:xe("flex flex-wrap gap-x-[0.5em]",t),children:e.map(n=>g.jsx("span",{className:xe("min-w-0 wrap-anywhere",rae,nae[n.kind]),children:n.text},`${n.kind}:${n.text}`))}),sae=4,oae=2,iae={"export-bound":"e","import-bound":"q"},lae=({anchorId:e,heading:t,defaultViewId:n,assessmentForm:r,views:s,codeLinks:o,writeUpNotice:l=null,onWriteUpFile:c=null,renderImpactEditor:u,onOpenCodeLink:f,onOpenFile:h})=>{const[p,y]=N.useState(null),x=s.find(b=>b.id===(p??n))??s.at(0);return x===void 0?null:g.jsxs("section",{id:e,"aria-labelledby":`${e}-heading`,"data-view-section-id":"blast-diagram-section",className:"scroll-mt-(--section-scroll-margin) border-t pt-6 pb-8",children:[g.jsxs("div",{className:"flex items-center gap-3 pb-4",children:[g.jsx("h2",{id:`${e}-heading`,className:"text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:t}),l===null?null:g.jsx(Df,{label:l})]}),g.jsxs("div",{className:"flex flex-col gap-y-1 pb-2 text-sm",children:[g.jsx(uf,{segments:x.summary.map(b=>({text:b,kind:"plain"})),className:"tabular-nums"}),g.jsxs("ul",{className:"flex flex-wrap items-center gap-x-5 gap-y-1 text-muted-foreground",children:[x.legend.map(b=>g.jsxs("li",{className:"flex items-center gap-1.5",children:[g.jsx(bT,{mark:b.mark,radius:sae}),b.label]},b.mark)),g.jsxs("li",{className:"flex items-center gap-1.5",children:[g.jsxs("svg",{"aria-hidden":"true",width:"22",height:"10",viewBox:"0 0 22 10",className:"shrink-0",children:[g.jsx("path",{d:"M1 5h14",className:"fill-none stroke-current [stroke-width:1.25]"}),g.jsx("path",{d:"M14 1.5 21 5 14 8.5z",className:"fill-current"})]}),x.edgeLegendLabel]})]})]}),g.jsx(tae,{title:t,board:x.board,codeLinks:o,onWriteUpFile:c,navigation:{anchorId:e,groups:s.length<oae?[]:[s.map(b=>Un({key:iae[b.id],actionId:"blast-view-action",label:b.label,description:b.description,isPressed:b.id===x.id,onRun:()=>{y(b.id)}}))]},authoring:u===null?null:{editLabel:r.editLabel,renderImpactEditor:(b,S)=>b.assessment===null?null:u({path:b.path,assessment:b.assessment,form:r,onClose:S})},onOpenCodeLink:f,onOpenFile:h})]})},aae={pickedLabels:[],text:""},cae="No answer",uae="mt-0.5 size-4 shrink-0 accent-(--primary)",dae="min-h-12 w-full resize-none rounded-lg border border-input bg-card px-2.5 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40",fae="max-h-40 overflow-auto rounded-sm bg-muted px-1.5 py-1 font-mono text-[0.6875rem] leading-4 whitespace-pre-wrap wrap-anywhere",hae={open:"font-bold text-signal-text",answered:"text-muted-foreground",withdrawn:"text-muted-foreground italic"},pae=(e,t,n,r)=>{if(!n.allowsMultiple)return r?[t]:[];const s=e.filter(o=>o!==t);return r?[...s,t]:s},mae=(e,t)=>({questionId:e.id,pickedLabels:t.pickedLabels,text:t.text.trim()===""?null:t.text}),C6=({detail:e})=>e===null?null:g.jsx("pre",{className:fae,children:e}),gae=({question:e,draft:t,onDraftChange:n})=>{const r=N.useId(),s=N.useId();return g.jsxs("fieldset",{className:"flex flex-col gap-2",children:[g.jsx("legend",{className:"pb-1 text-sm font-bold",children:e.prompt}),g.jsx(C6,{detail:e.detail}),e.options.map(o=>g.jsxs("label",{className:"flex cursor-pointer items-start gap-2 text-sm",children:[g.jsx("input",{type:e.allowsMultiple?"checkbox":"radio",name:r,checked:t.pickedLabels.includes(o.label),className:uae,onChange:l=>{n({...t,pickedLabels:pae(t.pickedLabels,o.label,e,l.target.checked)})}}),g.jsxs("span",{className:"min-w-0",children:[g.jsx("span",{className:"block",children:o.label}),o.description===""?null:g.jsx("span",{className:"block text-xs text-muted-foreground",children:o.description})]})]},o.label)),g.jsx("label",{htmlFor:s,className:"text-xs text-muted-foreground",children:e.textLabel}),g.jsx("textarea",{id:s,value:t.text,className:dae,onChange:o=>{n({...t,text:o.target.value})}})]})},yae=({question:e})=>g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsx("p",{className:"text-sm font-bold",children:e.prompt}),g.jsx(C6,{detail:e.detail}),g.jsx("p",{className:"text-sm",children:e.answerLabel??cae})]}),xae=({batch:e,isAnswering:t,problem:n,onAnswer:r})=>{const[s,o]=N.useState({}),l=u=>s[u.id]??aae,c=e.status==="open";return g.jsxs("section",{"aria-label":e.heading,"data-status":e.status,className:xe("flex flex-col gap-3 rounded-lg border px-3 py-2.5 text-sm",c?"border-signal":""),children:[g.jsxs("div",{className:"flex flex-col",children:[g.jsxs("p",{className:"flex items-baseline gap-2",children:[g.jsx("span",{className:"font-bold",children:e.heading}),g.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:e.timeLabel})]}),g.jsx("p",{className:xe("text-xs",hae[e.status]),children:e.statusLabel})]}),c?g.jsxs("form",{className:"flex flex-col gap-4",onSubmit:u=>{u.preventDefault(),r(e.questions.map(f=>mae(f,l(f))))},children:[e.questions.map(u=>g.jsx(gae,{question:u,draft:l(u),onDraftChange:f=>{o(h=>({...h,[u.id]:f}))}},u.id)),n===null?null:g.jsx("p",{role:"alert",className:"text-sm text-destructive",children:n}),g.jsx(st,{type:"submit",size:"sm",disabled:t,className:"self-end",children:e.submitLabel})]}):e.questions.map(u=>g.jsx(yae,{question:u},u.id))]})},bae=({label:e,options:t,value:n,className:r,errorMessage:s=null,isLabelHidden:o=!1,onChange:l})=>{const c=N.useId(),u=N.useId();return g.jsxs("div",{className:xe("grid gap-1.5",r),children:[g.jsx("label",{htmlFor:c,className:o?"sr-only":"text-sm font-bold",children:e}),g.jsxs("div",{className:"relative",children:[g.jsx("select",{id:c,value:n,"aria-invalid":s!==null,"aria-describedby":s===null?void 0:u,className:"h-8 w-full cursor-pointer appearance-none rounded-lg border border-input bg-card pr-8 pl-2.5 text-sm transition-colors duration-[180ms] ease-out outline-none hover:bg-muted focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20",onChange:f=>{l(f.target.value)},children:t.map(f=>g.jsx("option",{value:f.value,children:f.label},f.value))}),g.jsx(su,{"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground"})]}),s===null?null:g.jsx("p",{id:u,role:"alert",className:"text-sm text-destructive",children:s})]})},vae="Remove the reference",Sae="min-h-16 w-full resize-none rounded-lg border border-input bg-card px-2.5 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40",T6="self-start rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[0.6875rem] leading-4 wrap-anywhere",wae={"not-running":"fill-background stroke-muted-foreground [stroke-width:2]",starting:"fill-background stroke-(--line) [stroke-dasharray:3_2.5] [stroke-width:2] motion-safe:animate-pulse",working:"fill-(--line) stroke-(--line) [stroke-width:2]","waiting-for-reviewer":"fill-signal stroke-signal [stroke-width:2]",listening:"fill-background stroke-(--line) [stroke-width:2]",failed:"fill-background stroke-destructive [stroke-width:2]"},Eae=({message:e,codeLinks:t,onOpenCodeLink:n})=>g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"flex items-baseline gap-2",children:[g.jsx("span",{className:"font-bold",children:e.authorLabel}),g.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:e.timeLabel})]}),e.reference===null?null:g.jsx("p",{className:T6,children:e.reference}),g.jsx(uo,{blocks:e.body,codeLinks:t,onOpenCodeLink:n})]}),Cae=({conversation:e,modelChoice:t,codeLinks:n,reference:r,isSending:s,sendProblem:o,answering:l,onSend:c,onAnswer:u,onChooseModel:f,onClearReference:h,onOpenCodeLink:p,onClose:y})=>{var T;const[x,b]=N.useState(""),S=N.useRef(null),E=((T=e.entries.at(-1))==null?void 0:T.id)??null,C=t!==null;N.useEffect(()=>{const O=S.current;O==null||O.scrollTo({top:O.scrollHeight})},[E,C]);const R=()=>{c(x),b("")};return g.jsxs("aside",{"aria-label":e.heading,className:"fixed top-14 right-0 bottom-0 z-30 flex w-(--chat-width) flex-col border-l bg-background duration-200 ease-out animate-in slide-in-from-right-8",children:[g.jsxs("div",{className:"flex items-start gap-3 border-b px-4 py-3",children:[g.jsxs("div",{className:"min-w-0 flex-1",children:[g.jsx("h2",{className:"text-base leading-6 font-bold",children:e.heading}),g.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[g.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 12 12","data-state":e.agentState,className:"size-3",children:g.jsx("circle",{cx:"6",cy:"6",r:"4",className:xe("transition-[fill,stroke] duration-[180ms] ease-out",wae[e.agentState])})}),g.jsx("span",{role:"status",children:e.agentStateLabel})]})]}),g.jsx(Nr,{icon:"close",label:e.closeLabel,onClick:y})]}),e.problem===null?null:g.jsx("p",{role:"alert",className:"max-h-24 overflow-y-auto border-b px-4 py-2 text-xs text-destructive",children:e.problem}),t===null?null:g.jsxs("div",{className:"flex flex-col gap-1 border-b px-4 py-2",children:[g.jsx(bae,{label:t.label,options:t.options,value:t.selectedModel,onChange:f}),g.jsx("p",{className:"text-xs text-muted-foreground",children:t.hint})]}),g.jsxs("ol",{ref:S,"aria-live":"polite",className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-4 py-4",children:[e.emptyMessage===null?null:g.jsx("li",{className:"text-sm text-muted-foreground",children:e.emptyMessage}),e.entries.map(O=>{var k;return g.jsx("li",{"data-author":O.kind==="message"?O.author:void 0,className:"flex flex-col gap-1 text-sm",children:O.kind==="message"?g.jsx(Eae,{message:O,codeLinks:n,onOpenCodeLink:p}):g.jsx(xae,{batch:O,isAnswering:l.pendingBatchId===O.id,problem:((k=l.rejection)==null?void 0:k.batchId)===O.id?l.rejection.message:null,onAnswer:M=>{u(O.id,M)}})},O.id)})]}),g.jsxs("form",{className:"flex flex-col gap-2 border-t px-4 py-3",onSubmit:O=>{O.preventDefault(),R()},children:[r===null?null:g.jsxs("p",{className:"flex items-start gap-1",children:[g.jsx("span",{className:xe(T6,"flex-1"),children:r}),g.jsx(Nr,{icon:"close",label:vae,className:"size-5",onClick:h})]}),g.jsx("textarea",{"aria-label":e.placeholder,placeholder:e.placeholder,value:x,className:Sae,onChange:O=>{b(O.target.value)},onKeyDown:O=>{O.key!=="Enter"||O.shiftKey||x.trim()===""||(O.preventDefault(),R())}}),o===null?null:g.jsx("p",{role:"alert",className:"text-xs text-destructive",children:o}),g.jsx(st,{type:"submit",size:"sm",disabled:s||x.trim()==="",className:"self-end",children:e.sendLabel})]})]})},Tae={bug:"text-destructive",risk:"text-risk-text",nit:"text-nit",question:"text-muted-foreground","core-change":"text-signal-text"},Nae="M8 1a7 7 0 1 0 0 14A7 7 0 1 0 8 1z",Rae="M8 4 4 8l4 4 4-4z",Oae="M8 4.25 4.5 10.5h7z",Aae="M8 5.6 10.4 8 8 10.4 5.6 8z",kae="M6.45 6.55a1.6 1.6 0 1 1 2.25 1.45c-.45.2-.7.5-.7.95",_ae="M5.9 10.1 10.1 5.9",J1=5.75,AI=({hole:e,className:t})=>g.jsx("path",{d:`${Nae}${e}`,fillRule:"evenodd",className:t}),N6=({kind:e})=>e==="bug"?g.jsx(AI,{hole:Rae,className:"fill-destructive"}):e==="core-change"?g.jsx(AI,{hole:Oae,className:"fill-signal"}):e==="risk"?g.jsxs(g.Fragment,{children:[g.jsx("circle",{cx:"8",cy:"8",r:J1,className:"fill-none stroke-risk [stroke-width:2.5]"}),g.jsx("path",{d:Aae,className:"fill-risk"})]}):e==="question"?g.jsxs(g.Fragment,{children:[g.jsx("circle",{cx:"8",cy:"8",r:J1,className:"fill-none stroke-foreground [stroke-width:2]"}),g.jsx("path",{d:kae,className:"fill-none stroke-foreground [stroke-linecap:round] [stroke-width:1.5]"}),g.jsx("circle",{cx:"8",cy:"11.05",r:"0.8",className:"fill-foreground"})]}):g.jsxs(g.Fragment,{children:[g.jsx("circle",{cx:"8",cy:"8",r:J1,className:"fill-none stroke-nit [stroke-width:1.5]"}),g.jsx("path",{d:_ae,className:"fill-none stroke-nit [stroke-linecap:round] [stroke-width:2]"})]}),R6=({kind:e,className:t})=>g.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 16 16","data-kind":e,className:xe("size-3.5 shrink-0",t),children:g.jsx(N6,{kind:e})}),Oa=({kind:e,label:t,className:n})=>g.jsxs("span",{className:xe("inline-flex shrink-0 items-center gap-1 text-xs font-bold",Tae[e],n),children:[g.jsx(R6,{kind:e}),g.jsx("span",{className:"text-box-cap",children:t})]}),Mae=["core-change","bug","risk","nit","question"],Zy="explain-waypoint-action",MT="explain-code-block-action",Iae="s",IT="c",Lae="f",Dae="q",jae="e",O6="r",Pae="Add comment",A6="Write description",zae="Explain this line",Bae="Explain the whole code block",Hae="Explain",Fae="Explain block",$ae="Collapse all",Uae="Expand all",Vae="Collapse file",qae="Expand file",Gae="Expand waypoint",Kae="Collapse waypoint",Yae="reviewed",xb=`Pick a waypoint first: press ${CT.toUpperCase()} to step to the next one.`,Wae="This waypoint has no lines on the page to comment on.",kI=(e,t,n)=>e||t===null?n:t,Xae=e=>{const{stepping:t}=e.controls,n=e.positionLabel===null?[]:[{kind:"position",label:e.positionLabel}];return[kI(e.canStepBack,e.sectionSteps.back,Un({key:yB,actionId:"previous-waypoint-action",label:t.previousLabel,isDisabled:!e.canStepBack,onRun:e.onPrevious})),...n,kI(e.canStepForward,e.sectionSteps.next,Un({key:CT,actionId:"next-waypoint-action",label:t.nextLabel,isDisabled:!e.canStepForward,onRun:e.onNext}))]},Qae=e=>{const{onCurrentReviewedChange:t,currentWaypoint:n}=e;if(t===null)return[];const r=(n==null?void 0:n.isReviewed)===!0,{currentReview:s}=e.controls;return[Un({key:Iae,actionId:"mark-reviewed-action",label:r?s.reviewedLabel:s.markLabel,isPressed:r,isPrimary:!r,isDisabled:n===null,disabledHint:xb,onRun:()=>{t(!r)}})]},Zae=(e,t)=>[Un({key:IT,actionId:"write-description-action",label:A6,isDisabled:!t,disabledHint:xb,onRun:e})],Jae=e=>{const{onCommentOnCurrent:t,onDescribeCurrent:n,currentWaypoint:r}=e;return n!==null?Zae(n,r!==null):t===null?[]:[Un({key:IT,actionId:"add-comment-action",label:Pae,isDisabled:(r==null?void 0:r.canComment)!==!0,disabledHint:r===null?xb:Wae,onRun:t})]},ece=e=>{const{onWriteUpCurrent:t,currentWaypoint:n}=e;if(t===null||(n==null?void 0:n.canWriteUp)!==!0)return[];const r=Un({key:_f,actionId:Zy,label:e.agentLabel===null?zae:`Let ${e.agentLabel} explain`,shortLabel:Hae,onRun:()=>{t("line")}}),s=Un({key:xre,actionId:MT,label:Bae,shortLabel:Fae,onRun:()=>{t("block")}});return n.canWriteUpBlock?[r,s]:[r]},tce=e=>[...Qae(e),...Jae(e),...ece(e)],nce=e=>{const{onShowReviewedChange:t}=e,n=e.controls.reviewedToggle;return t===null?[]:[{kind:"choice",id:Yae,label:n.label,detailLabel:n.countLabel,detailTone:null,marker:e.markerOf("reviewed"),isChecked:n.isShown,isDisabled:!n.isAvailable&&!n.isShown,onToggle:()=>{t(!n.isShown)}}]},rce=e=>Mae.some(t=>t===e),sce=(e,t)=>n=>({kind:"choice",id:n.key,label:n.label,detailLabel:n.detailLabel,detailTone:n.detailChange,marker:rce(n.key)?e.markerOf(n.key):null,isChecked:n.isSelected,isDisabled:!1,onToggle:()=>{t(n.toggledKeys.length===0?null:n.toggledKeys)}}),oce=e=>{const{onFilterChange:t}=e;if(t===null)return[];const{filter:n}=e.controls,r=sce(e,t),s=l=>({kind:"submenu",id:l.id,label:l.label,heading:l.heading,valueLabel:l.valueLabel,choices:l.options.map(r)}),o=n.groups.map(l=>[...l.options.map(r),...l.more===null?[]:[s(l.more)]]);return[{kind:"menu",key:Lae,actionId:"filter-action",label:n.buttonLabel,badge:n.badge,heading:n.heading,itemGroups:[...o,n.submenus.map(s),nce(e)].filter(l=>l.length>0)}]},ice=e=>{const{isFileCollapsed:t,currentWaypoint:n}=e,r=(n==null?void 0:n.isOpen)===!0,s=t===null?[]:[Un({key:jae,actionId:"collapse-file-action",label:t?qae:Vae,onRun:()=>{e.onFileCollapsedChange(!t)}})];return[Un({key:Dae,actionId:"collapse-files-action",label:e.areFilesCollapsed?Uae:$ae,onRun:()=>{e.onFilesCollapsedChange(!e.areFilesCollapsed)}}),...s,Un({key:O6,actionId:"expand-waypoint-action",label:r?Kae:Gae,isDisabled:n===null,disabledHint:xb,onRun:()=>{e.onCurrentOpenChange(!r)}})]},lce=e=>[Xae(e),tce(e),oce(e),ice(e)].filter(t=>t.length>0),ace="Arrange files",cce=()=>g.jsx("span",{"aria-hidden":"true",className:"inline-flex size-3.5 shrink-0 items-center justify-center rounded-full bg-waypoint text-line-foreground",children:g.jsx(Su,{className:"size-2.5",strokeWidth:3.5})}),uce=e=>e==="reviewed"?g.jsx(cce,{}):g.jsx(R6,{kind:e}),dce=({anchorId:e,heading:t,coverageLabel:n,emptyMessage:r,writeUpNotice:s=null,navigation:o,children:l,onArrangeFiles:c})=>{const u=Are(e);return NT(e,lce({...o,markerOf:uce,sectionSteps:u})),g.jsxs("section",{id:e,"aria-labelledby":`${e}-heading`,"data-view-section-id":"code-walkthrough-section",className:"scroll-mt-(--section-scroll-margin) border-t pt-6 pb-10",children:[g.jsxs("div",{className:"flex items-center gap-3",children:[g.jsx("h2",{id:`${e}-heading`,className:"shrink-0 text-2xl leading-9 font-semibold tracking-[-0.02em] whitespace-nowrap text-foreground",children:t}),g.jsx("p",{className:"min-w-0 truncate text-sm text-muted-foreground tabular-nums",children:n}),s===null?null:g.jsx(Df,{label:s,className:"shrink-0"}),g.jsx("span",{className:"flex-1"}),c===null?null:g.jsx(st,{variant:"link",size:"sm",onClick:c,children:ace})]}),r===null?null:g.jsx("p",{className:"pt-6 text-muted-foreground",children:r}),l]})},jf=({imageUrl:e,monogram:t,className:n})=>{const[r,s]=N.useState(!1),o=xe("size-5 shrink-0 rounded-full border border-input bg-card",n);return e===null||r?g.jsx("span",{"aria-hidden":"true",className:xe(o,"inline-flex items-center justify-center text-[0.625rem] leading-none font-bold"),children:g.jsx("span",{className:"text-box-cap",children:t})}):g.jsx("img",{src:e,alt:"",className:xe(o,"object-cover"),onError:()=>{s(!0)}})},fce={},hce="Show",pce="Hide",mce="my-1.5 mr-4 ml-28 flex max-w-[52rem] flex-col gap-3 rounded-md border border-input bg-card p-3 font-sans whitespace-normal",k6="text-xs text-muted-foreground underline decoration-1 underline-offset-[0.3em] hover:text-foreground disabled:opacity-50",gce=()=>{},LT=({label:e,submitLabel:t,postNowLabel:n=null,cancelLabel:r,hint:s=null,isSubmitting:o,shouldFocus:l=!1,className:c,renderEditor:u,onSubmit:f,onPostNow:h,onCancel:p})=>{const[y,x]=N.useState(""),[b,S]=N.useState(0),E=o||y.trim()==="",C=R=>{R(y.trim()),x(""),S(T=>T+1)};return g.jsxs("form",{className:xe("flex flex-col gap-2",c),onSubmit:R=>{R.preventDefault(),C(f)},children:[g.jsx("div",{children:u({label:e,shouldFocus:l,onChange:x})},b),g.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s===null?null:g.jsx("p",{className:"mr-auto text-xs text-muted-foreground",children:s}),r===null||p===void 0?null:g.jsx(st,{type:"button",variant:"ghost",size:"sm",onClick:p,children:r}),n===null||h===void 0?null:g.jsx(st,{type:"button",variant:"outline",size:"sm",disabled:E,onClick:()=>{C(h)},children:n}),g.jsx(st,{type:"submit",size:"sm",disabled:E,children:t})]})]})},_6=({comment:e,verdictLabel:t=null,locationLabel:n=null,isActionPending:r=!1,className:s,onDiscard:o})=>g.jsxs("article",{className:xe("grid grid-cols-[1.75rem_minmax(0,1fr)] gap-x-2 gap-y-1 text-sm",s),children:[g.jsx(jf,{imageUrl:e.author.avatarUrl,monogram:e.author.monogram,className:"mt-0.5 size-6"}),g.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[g.jsxs("p",{className:"flex flex-wrap items-baseline gap-x-2",children:[g.jsx("span",{className:"font-bold",children:e.author.name}),t===null?null:g.jsx("span",{children:t}),g.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:e.timeLabel}),e.pendingLabel===null?null:g.jsx("span",{className:"text-xs font-bold text-signal-text",children:e.pendingLabel}),e.discardLabel===null||o===void 0?null:g.jsx("button",{type:"button",disabled:r,className:k6,onClick:()=>{o(e.id)},children:e.discardLabel})]}),n===null?null:g.jsx("p",{className:"font-mono text-xs text-muted-foreground wrap-anywhere",children:n}),g.jsx(uo,{blocks:e.body,codeLinks:fce,onOpenCodeLink:gce})]})]}),yce=({comments:e,label:t,rangeLabel:n,statusLabel:r,resolution:s,canReply:o,replyPlaceholder:l,submitLabel:c,cancelLabel:u,isSubmitting:f,renderEditor:h,onReply:p,onResolve:y,onDiscard:x})=>{const[b,S]=N.useState(!1),[E,C]=N.useState(!1),R=r!==null&&!E;return g.jsxs("section",{"aria-label":t,className:mce,children:[n===null&&r===null?null:g.jsxs("p",{className:"flex flex-wrap items-baseline gap-x-3 text-xs text-muted-foreground",children:[n===null?null:g.jsx("span",{className:"tabular-nums",children:n}),r===null?null:g.jsx("span",{className:"font-bold text-foreground",children:r}),r===null?null:g.jsx("button",{type:"button","aria-expanded":!R,className:k6,onClick:()=>{C(T=>!T)},children:R?hce:pce})]}),R?null:e.map(T=>g.jsx(_6,{comment:T,isActionPending:f,onDiscard:x},T.id)),R||!b?null:g.jsx(LT,{label:`${l}, ${t}`,submitLabel:c,cancelLabel:u,isSubmitting:f,shouldFocus:!0,className:"pl-9",renderEditor:h,onSubmit:T=>{p(T),S(!1)},onCancel:()=>{S(!1)}}),R||b||!o&&s===null?null:g.jsxs("div",{className:"ml-9 flex flex-wrap items-center gap-3",children:[o?g.jsx("button",{type:"button",className:"h-8 min-w-48 flex-1 rounded-lg border border-input bg-background px-2.5 text-left text-sm text-muted-foreground hover:bg-muted",onClick:()=>{S(!0)},children:l}):null,s===null?null:g.jsx(st,{type:"button",variant:"outline",size:"sm",disabled:f,onClick:()=>{y(s.isResolving)},children:s.label})]})]})},bb=({label:e,accessibleLabel:t,isReviewed:n,isDisabled:r=!1,className:s,onChange:o})=>g.jsxs("button",{type:"button","aria-label":t,"aria-pressed":n,disabled:r,"data-user-action-id":"review-toggle-action",className:xe("group/review inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md px-2 text-[0.8rem] hover:bg-muted disabled:opacity-50",s),onClick:()=>{o(!n)},children:[g.jsx("span",{"aria-hidden":"true",className:"inline-flex size-4 items-center justify-center rounded-full border-[1.5px] border-muted-foreground text-line-foreground transition-colors duration-[180ms] ease-out group-aria-pressed/review:border-(--line) group-aria-pressed/review:bg-(--line)",children:g.jsx(Su,{className:"size-3 opacity-0 transition-opacity duration-[180ms] ease-out group-aria-pressed/review:opacity-100",strokeWidth:3})}),g.jsx("span",{className:"text-box-cap",children:e})]}),_I="not-last:after:ml-1 not-last:after:font-normal not-last:after:text-muted-foreground not-last:after:content-['•']",Jy=8,xce=[[1,1],[-1,1],[-1,-1],[1,-1]],bce=6.25,vce=8.25,Sce=2,MI=([e,t],n)=>[Jy+e*n*Math.SQRT1_2,Jy+t*n*Math.SQRT1_2].map(r=>r.toFixed(Sce)).join(" "),wce=(e,t,n)=>`M${MI(e,t)}L${MI(e,n)}`,M6=({innerRadius:e,outerRadius:t,className:n})=>g.jsx("path",{d:xce.map(r=>wce(r,e,t)).join(""),className:xe("fill-none stroke-foreground [stroke-linecap:round] [stroke-width:1.6]",n)}),Ece=({className:e})=>g.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16","data-kind":"spotlight",className:xe("size-3.5 shrink-0",e),children:[g.jsx("circle",{cx:Jy,cy:Jy,r:"4.5",className:"fill-none stroke-foreground [stroke-width:1.75]"}),g.jsx(M6,{innerRadius:bce,outerRadius:vce,className:"[stroke-width:1.5]"})]}),DT=({spotlight:e,className:t})=>g.jsxs("span",{className:xe("inline-flex min-w-0 shrink-0 items-center gap-1 text-xs font-bold text-foreground",t),children:[g.jsx(Ece,{}),g.jsxs("span",{className:"flex flex-wrap gap-x-1 text-box-cap",children:[g.jsx("span",{className:_I,children:e.label}),e.classifications.map(n=>g.jsx("span",{className:xe("font-normal text-muted-foreground",_I),children:n.label},n.key))]})]}),Cce="[data-line]",Tce="[data-diff-mark]",I6="[data-reference-scope]",Nce="[data-file-header]",Rce="[data-gutter-mark]",Oce=28,B0=8,Ace=new Map([["ArrowUp",-1],["ArrowDown",1]]),kce=150,_ce=1e3,YE="data-gutter-card-owner",WE="flight-plan:gutter-card-owner",II=()=>document.documentElement.getAttribute(YE),Mce=()=>null,LI=e=>{e===null?document.documentElement.removeAttribute(YE):document.documentElement.setAttribute(YE,e),window.dispatchEvent(new Event(WE))},Ice=e=>(window.addEventListener(WE,e),()=>{window.removeEventListener(WE,e)}),L6=e=>{const t=N.useSyncExternalStore(Ice,II,Mce),n=N.useCallback(()=>{LI(e)},[e]),r=N.useCallback(()=>{II()===e&&LI(null)},[e]);return{isOwner:t===e,claim:n,release:r}},Lce=e=>{const t=new AbortController,n=()=>{t.signal.aborted||(t.abort(),e())},r=setTimeout(n,kce),s=()=>{clearTimeout(r),setTimeout(n,_ce)};return window.addEventListener("scroll",s,{once:!0,passive:!0,capture:!0,signal:t.signal}),window.addEventListener("scrollend",n,{once:!0,capture:!0,signal:t.signal}),()=>{clearTimeout(r),t.abort()}},Dce=(e,t)=>{const n=N.useRef(t);N.useEffect(()=>{n.current=t}),N.useEffect(()=>{n.current(e)},[e])},D6=8,j6="w-[min(56rem,calc(100vw-2rem))]",P6="max-w-none gap-2 text-sm leading-6",z6={side:"flip",align:"shift",fallbackAxisSide:"none"},jce=e=>{const t=(e==null?void 0:e.closest(Cce))??null,n=(t==null?void 0:t.querySelector(Tce))??null;return t===null||n===null?e:{contextElement:t,getBoundingClientRect:()=>{const r=t.getBoundingClientRect();return new DOMRect(n.getBoundingClientRect().right,r.top,Oce,r.height)}}},Pce=1,zce=e=>{var s;const t=((s=e==null?void 0:e.closest(I6))==null?void 0:s.querySelector(Nce))??null;if(t===null)return 0;const n=Number.parseFloat(getComputedStyle(t).top)||0,r=t.getBoundingClientRect();return r.top<=n+Pce?r.bottom:n},B6=e=>({anchor:()=>jce(e),collisionPadding:{top:zce(e)+B0,right:B0,bottom:B0,left:B0}}),H6=(e,t)=>{N.useEffect(()=>{if(e)return window.addEventListener("scroll",t,{passive:!0,capture:!0}),()=>{window.removeEventListener("scroll",t,{capture:!0})}},[e,t])},F6=e=>{const t=Ace.get(e.key),n=e.currentTarget.closest(I6);if(t===void 0||n===null)return;const r=[...n.querySelectorAll(Rce)],s=r.indexOf(e.currentTarget)+t;s<0||s>=r.length||(e.preventDefault(),r[s].focus())},Bce=150,Hce="Click or press Enter to open",Fce=["pending","open","resolved"],$ce={},ew="M3 2.6h8a1.4 1.4 0 0 1 1.4 1.4v4.5a1.4 1.4 0 0 1-1.4 1.4H6.4L4.2 11.7V9.9H3a1.4 1.4 0 0 1-1.4-1.4V4A1.4 1.4 0 0 1 3 2.6z",Uce=xe("relative z-1 grid size-[1.125rem] shrink-0 place-items-center rounded-sm","transition-[background-color] duration-[180ms] ease-out hover:bg-muted aria-expanded:bg-muted","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"),Vce={open:"font-bold text-foreground",pending:"font-bold text-signal-text",resolved:"font-bold text-foreground"},qce=()=>{},Gce=e=>Fce.find(t=>e.some(n=>n.mark.kind===t))??"open",Kce=({kind:e})=>g.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 14 14","data-kind":e,className:"size-3.5 shrink-0",children:[e==="open"?g.jsx("path",{d:ew,className:"fill-muted-foreground"}):null,e==="pending"?g.jsxs(g.Fragment,{children:[g.jsx("path",{d:ew,className:"fill-none stroke-signal-text stroke-[1.5]"}),g.jsx("circle",{cx:"7",cy:"6.25",r:"1.6",className:"fill-signal"})]}):null,e==="resolved"?g.jsx("path",{d:ew,className:"fill-none stroke-muted-foreground stroke-1 [stroke-dasharray:2_1.4]"}):null]}),Yce=({thread:e})=>{const t=e.comments.at(0);return g.jsxs("section",{"aria-label":e.mark.label,className:"flex flex-col gap-1.5 px-3 py-2.5 not-first:border-t",children:[g.jsxs("p",{className:"flex flex-wrap gap-x-[0.5em] text-xs text-muted-foreground tabular-nums",children:[g.jsx("span",{className:xe(Vce[e.mark.kind],"after:ml-[0.5em] after:font-normal after:text-muted-foreground after:content-['•']"),children:e.mark.label}),g.jsx("span",{children:e.linesLabel})]}),t===void 0?null:g.jsxs("div",{className:"grid grid-cols-[1.5rem_minmax(0,1fr)] gap-x-2.5",children:[g.jsx(jf,{imageUrl:t.author.avatarUrl,monogram:t.author.monogram,className:"size-6"}),g.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[g.jsxs("p",{className:"flex items-baseline gap-2 text-sm",children:[g.jsx("span",{className:"font-semibold",children:t.author.name}),g.jsx("span",{className:"text-xs text-muted-foreground",children:t.timeLabel})]}),g.jsx("div",{className:"line-clamp-2",children:g.jsx(uo,{blocks:t.body.slice(0,1),codeLinks:$ce,onOpenCodeLink:qce,className:P6})})]})]})]})},Wce=({threads:e,isOpen:t,isTabStop:n,onToggle:r})=>{const s=N.useRef(null),[o,l]=N.useState(null),{isOwner:c,claim:u,release:f}=L6(`thread:${e.map(x=>x.id).join(" ")}`),h=c&&o!==null&&!t,p=N.useCallback(()=>{l(null),f()},[f]),y=Gce(e);return H6(h,p),g.jsxs(Dm,{open:h,onOpenChange:x=>{if(!x){p();return}l(B6(s.current)),u()},children:[g.jsx(jm,{delay:Bce,render:g.jsx("button",{ref:s,type:"button"}),"aria-label":e.map(x=>`${x.mark.label}, ${x.linesLabel}`).join("; "),"aria-expanded":t,tabIndex:n?0:-1,"data-gutter-mark":"","data-thread-mark":y,className:Uce,onKeyDown:F6,onClick:()=>{p(),r()},children:g.jsx(Kce,{kind:y})}),o===null?null:g.jsxs(yb,{side:"top",align:"start",sideOffset:D6,anchor:o.anchor,collisionPadding:o.collisionPadding,collisionAvoidance:z6,className:xe("flex flex-col font-sans",j6),children:[g.jsx(WB,{}),e.map(x=>g.jsx(Yce,{thread:x},x.id)),g.jsx("p",{className:"border-t px-3 py-2 text-xs text-muted-foreground",children:Hce})]})]})},Xce=({finding:e,codeLinks:t,onOpenCodeLink:n})=>{const[r,s]=N.useState(!1),{solution:o,trace:l}=e;return g.jsxs("article",{className:"flex flex-col gap-2 border-t pt-3 text-base leading-[1.7]",children:[g.jsxs("h4",{className:"flex items-baseline gap-2",children:[g.jsx(Oa,{kind:e.kind,label:e.kindLabel,className:"translate-y-px"}),g.jsx("span",{className:"font-semibold",children:g.jsx(cf,{inlines:e.title,codeLinks:t,onOpenCodeLink:n})})]}),g.jsx(uo,{blocks:e.reading,codeLinks:t,onOpenCodeLink:n}),l===null?null:g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsx("p",{className:"text-xs font-bold text-muted-foreground",children:e.traceLabel}),g.jsx("ol",{className:"flex max-w-[66ch] list-decimal flex-col gap-1.5 pl-5 text-base leading-[1.7]",children:Lf(l).map(({key:c,item:u})=>g.jsx("li",{children:g.jsx(cf,{inlines:u,codeLinks:t,onOpenCodeLink:n})},c))})]}),o===null?null:g.jsxs("div",{className:"flex flex-col items-start gap-2",children:[g.jsx(st,{variant:"outline",size:"sm","aria-expanded":r,onClick:()=>{s(c=>!c)},children:r?o.hideLabel:o.showLabel}),r?g.jsx(Tu,{lines:o.lines,label:o.showLabel,className:"w-full rounded-md border"}):null]})]})},Qce=["ml-18","ml-24","ml-30"],Zce="ml-36",Jce=["ml-28","ml-34","ml-40"],eue="ml-46",tue=(e,t)=>t?Jce.find((n,r)=>r===e)??eue:Qce.find((n,r)=>r===e)??Zce,nue=({waypoint:e,isOpen:t,isCurrent:n,isReviewPending:r,isGuttered:s=!1,codeLinks:o,actions:l,onOpenCodeLink:c,onToggle:u,onReviewedChange:f})=>g.jsxs("section",{id:e.anchorId,"aria-label":e.title,"data-current":n,"data-reviewed":e.isReviewed,"data-view-section-id":"waypoint-box-section",className:xe("my-1.5 mr-4 scroll-mt-(--waypoint-scroll-margin) rounded-md border border-input bg-background font-sans whitespace-normal transition-[border-color,outline-color,opacity] duration-[180ms] ease-out data-[current=true]:border-(--line) data-[current=true]:outline-1 data-[current=true]:outline-(--line) data-[reviewed=true]:opacity-60",tue(e.depth,s)),children:[g.jsxs("div",{className:"flex items-center gap-1 pr-1",children:[g.jsxs("button",{type:"button","aria-expanded":t,className:"flex min-w-0 flex-1 items-center gap-2 rounded-md px-2.5 py-2 text-left",onClick:u,children:[g.jsx(Ux,{"aria-hidden":"true",className:xe("size-4 shrink-0 text-muted-foreground transition-transform duration-[180ms] ease-out",t?"rotate-90":"")}),e.chip===null?null:g.jsx(Oa,{kind:e.chip.kind,label:e.chip.label}),e.coreChangeLabel===null?null:g.jsx(Oa,{kind:"core-change",label:e.coreChangeLabel}),e.spotlight===null?null:g.jsx(DT,{spotlight:e.spotlight}),g.jsx(cl,{isPending:e.isDraft,className:"w-56 text-[0.9375rem]",children:g.jsx("span",{className:xe("min-w-0 truncate text-[0.9375rem]",e.isDraft?"font-mono text-sm text-muted-foreground":"font-semibold"),children:e.title})}),g.jsx("span",{className:"ml-auto shrink-0 pl-2 text-xs text-muted-foreground tabular-nums",children:e.positionLabel})]}),l,f===null?null:g.jsx(bb,{label:e.reviewLabel,isReviewed:e.isReviewed,isDisabled:r,onChange:f})]}),t?g.jsxs("div",{className:"flex flex-col gap-3 border-t px-4 pt-3.5 pb-4 text-base leading-[1.7]",children:[e.reading===null?g.jsx(cl,{isPending:!0,lineCount:3,children:g.jsx("p",{className:"text-muted-foreground",children:e.unwrittenLabel})}):g.jsx(uo,{blocks:e.reading,codeLinks:o,onOpenCodeLink:c}),e.coreChange===null||e.coreChangeLabel===null?null:g.jsxs("div",{className:"flex flex-col gap-2 border-t pt-3",children:[g.jsx(Oa,{kind:"core-change",label:e.coreChangeLabel}),g.jsx(uo,{blocks:e.coreChange,codeLinks:o,onOpenCodeLink:c})]}),e.findings.map(h=>g.jsx(Xce,{finding:h,codeLinks:o,onOpenCodeLink:c},h.id))]}):null]}),rue="#D97757",sue={claude:rue,codex:"currentColor",cursor:"currentColor"},oue={claude:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",codex:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z",cursor:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"},iue=({agent:e,className:t})=>g.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24","data-agent-mark":e,className:xe("size-3.5 shrink-0",t),children:g.jsx("path",{d:oue[e],fill:sue[e]})}),vb=N.createContext(null),lue=150,aue="Expand",cue="pointer-events-none absolute left-1/2 -ml-px w-0.5 transition-[opacity,background-color] duration-[180ms] ease-out",uue={solid:"bg-waypoint",faint:"bg-waypoint opacity-50",quiet:"bg-muted-foreground opacity-35"},tw="top-0 h-[0.1875rem]",DI="top-[1.3125rem] bottom-0",due="inset-y-0",fue="top-0 h-3",hue=xe("relative z-1 grid size-[1.125rem] shrink-0 scroll-mt-[calc(var(--waypoint-scroll-margin)+14rem)] place-items-center rounded-full","transition-[background-color,opacity] duration-[180ms] ease-out hover:bg-muted aria-expanded:bg-muted data-[reviewed=true]:opacity-45","focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring"),XE=5.75,pue=7,mue=2.25,gue=8,yue=9.5,xue=11.75,bue="M5 8.25 7.1 10.25 11 5.9",vue="[stroke-dasharray:2.4_2.1]",Sue=xe("flex flex-col font-sans",j6),wue="This line of code is not explained or checked for issues yet.",Eue="This waypoint does not have any description or explanation.",Cue="Explain this line",Tue="Explain the whole code block",Nue="Ctrl+G",Rue=e=>e===null?wue:`${e.label} has not explained this line of code or checked it for issues yet.`,Oue=e=>`${(e==null?void 0:e.label)??"The agent"} is explaining this line.`,Aue=({reach:e,isJoinedAbove:t},n)=>{const r=t?[tw]:[];return e==="start"?[...r,DI]:e==="single"?r:e==="middle"?n?[tw,DI]:[due]:[n?tw:fue]},kue=({stem:e,hasMark:t,children:n})=>{const r=e===null?[]:Aue(e,t);return g.jsxs("span",{className:"relative flex flex-col items-center gap-0.5 self-stretch pt-[0.1875rem]",children:[r.map(s=>g.jsx("span",{"aria-hidden":"true",className:xe(cue,e===null?null:uue[e.tone],s)},s)),n]})},_ue=({isCurrent:e})=>e?g.jsxs(g.Fragment,{children:[g.jsx("circle",{cx:"8",cy:"8",r:XE,className:"fill-none stroke-waypoint [stroke-width:2.5]"}),g.jsx("circle",{cx:"8",cy:"8",r:mue,className:"fill-waypoint"})]}):g.jsx("circle",{cx:"8",cy:"8",r:XE,className:"fill-none stroke-muted-foreground [stroke-width:2.5]"}),Mue=()=>g.jsxs(g.Fragment,{children:[g.jsx("circle",{cx:"8",cy:"8",r:pue,className:"fill-waypoint"}),g.jsx("path",{"data-reviewed-glyph":"",d:bue,className:"fill-none stroke-code [stroke-linecap:round] [stroke-linejoin:round] [stroke-width:2]"})]}),Iue=({isBeingWritten:e})=>g.jsx("circle",{"data-being-written":e,cx:"8",cy:"8",r:XE,className:xe("origin-center fill-none stroke-muted-foreground [stroke-width:2] [transform-box:fill-box]",vue,e?"motion-safe:animate-spin":"")}),Lue=({waypoint:e,isCurrent:t})=>e.isReviewed?g.jsx(Mue,{}):e.mark.kind!=="plain"?g.jsx(N6,{kind:e.mark.kind}):e.reading===null?g.jsx(Iue,{isBeingWritten:e.isBeingWritten}):g.jsx(_ue,{isCurrent:t}),Due=e=>!e.isReviewed&&e.mark.kind==="plain"&&e.reading!==null,jue=({waypoint:e,isCurrent:t})=>g.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 16 16",className:"size-4 shrink-0 overflow-visible",children:[g.jsx(Lue,{waypoint:e,isCurrent:t}),t&&!Due(e)?g.jsx("circle",{cx:"8",cy:"8",r:gue,className:"fill-none stroke-waypoint [stroke-width:1.25]"}):null,e.spotlight===null?null:g.jsx(M6,{innerRadius:yue,outerRadius:xue})]}),Pue=({waypoint:e,isAuthored:t})=>{const n=N.use(vb);return g.jsxs("div",{className:"flex flex-col gap-2 border-t px-3 py-2",children:[e.hint===null?null:g.jsx("p",{className:"text-sm text-foreground",children:e.hint}),e.isBeingWritten?g.jsx(v6,{label:Oue(n)}):g.jsx(Df,{label:t?Eue:Rue(n)})]})},zue=e=>e===null?Cue:`Let ${e.label} explain`,Bue=({writeUp:e})=>{const t=N.use(vb);return g.jsxs(g.Fragment,{children:[g.jsx(Mp,{label:zue(t),keyLabel:_f,icon:t===null?null:g.jsx(iue,{agent:t.name}),actionId:Zy,onClick:e.onLine}),e.onBlock===null?null:g.jsx(Mp,{label:Tue,keyLabel:Nue,actionId:MT,onClick:e.onBlock})]})},Hue=({waypoint:e,isReviewPending:t,codeLinks:n,writeUp:r,onOpenCodeLink:s,onReviewedChange:o,onWriteDescription:l,onExpand:c})=>{var p;const u=((p=e.reading)==null?void 0:p.slice(0,1))??null,f=r!==null&&u===null&&!e.isBeingWritten,h=[e.rangeLabel,e.positionLabel].filter(y=>y!==null).map(y=>({text:y,kind:"plain"}));return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"flex flex-col gap-1 px-3 pt-2.5 pb-2",children:[e.chip===null&&e.coreChangeLabel===null&&e.spotlight===null?null:g.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[e.chip===null?null:g.jsx(Oa,{kind:e.chip.kind,label:e.chip.label}),e.coreChangeLabel===null?null:g.jsx(Oa,{kind:"core-change",label:e.coreChangeLabel}),e.spotlight===null?null:g.jsx(DT,{spotlight:e.spotlight})]}),g.jsx("p",{className:xe("leading-5",e.isDraft?"font-mono text-muted-foreground":"font-semibold"),children:e.title}),g.jsx(uf,{segments:h,className:"text-xs text-muted-foreground tabular-nums"})]}),u===null?g.jsx(Pue,{waypoint:e,isAuthored:l!==null}):g.jsx("div",{className:"line-clamp-3 border-t px-3 py-2",children:g.jsx(uo,{blocks:u,codeLinks:n,onOpenCodeLink:s,className:P6})}),g.jsxs("div",{className:"flex min-h-9 flex-wrap items-center gap-1.5 border-t p-1 text-xs",children:[f?g.jsx(Bue,{writeUp:r}):null,l===null||u!==null||e.isBeingWritten?null:g.jsx(Mp,{label:A6,keyLabel:IT,actionId:"write-description-action",onClick:l}),g.jsx(Mp,{label:aue,keyLabel:O6,variant:"ghost",actionId:"expand-waypoint-action",onClick:c}),o===null?null:g.jsx(bb,{label:e.reviewLabel,isReviewed:e.isReviewed,isDisabled:t,className:"ml-auto text-foreground",onChange:o})]})]})},Fue=({waypoint:e,isOpen:t,isCurrent:n,isReviewPending:r,isTabStop:s,previewRequest:o,codeLinks:l,writeUp:c,onWriteDescription:u=null,onOpenCodeLink:f,onToggle:h,onReviewedChange:p,onPreviewChange:y})=>{const x=N.useRef(null),[b,S]=N.useState(null),{isOwner:E,claim:C,release:R}=L6(`waypoint:${e.id}`),T=E&&b!==null&&!t,O=N.useCallback(()=>{S(B6(x.current)),C()},[C]),k=N.useCallback(()=>{S(null),R()},[R]),M=()=>{k(),h()};return H6(T,k),Dce(T,y),N.useEffect(()=>o===null?void 0:Lce(O),[o,O]),g.jsxs(Dm,{open:T,onOpenChange:A=>{A?O():k()},children:[g.jsx(jm,{delay:lue,render:g.jsx("button",{ref:x,type:"button"}),id:t?void 0:e.anchorId,"aria-label":e.mark.label,"aria-expanded":t,tabIndex:s?0:-1,"data-gutter-mark":"","data-waypoint-mark":e.id,"data-user-action-id":"waypoint-mark-action","data-current":n,"data-reviewed":e.isReviewed,className:hue,onKeyDown:F6,onClick:M,children:g.jsx(jue,{waypoint:e,isCurrent:n})}),b===null?null:g.jsxs(yb,{side:"top",align:"start",sideOffset:D6,anchor:b.anchor,collisionPadding:b.collisionPadding,collisionAvoidance:z6,"data-view-section-id":"waypoint-card-section",className:Sue,children:[g.jsx(WB,{}),g.jsx(Hue,{waypoint:e,isReviewPending:r,codeLinks:l,writeUp:c,onWriteDescription:u===null?null:()=>{k(),u()},onOpenCodeLink:f,onReviewedChange:p,onExpand:M})]})]})},jI={middle:3,start:2,end:1,single:0},PI={solid:2,faint:1,quiet:0},$ue=({placed:e,pending:t},n)=>{if(n.kind==="waypoint")return{placed:e,pending:n.waypoint.lines===null?t:[...t,n.waypoint]};if(n.kind==="gap")return{placed:e,pending:[]};const r=n.lines.at(0);return r===void 0||t.length===0?{placed:e,pending:t}:{placed:new Map([...e,[r,t]]),pending:[]}},Uue=e=>e.reduce($ue,{placed:new Map,pending:[]}).placed,$6=e=>e.flatMap(t=>t.kind==="lines"?[...t.lines]:t.kind==="gap"?[null]:[]),Vue=(e,t,n)=>{const r=e.slice(t),s=r.indexOf(null),o=s===-1?r:r.slice(0,s),l=o.findIndex(c=>(c==null?void 0:c.numberLabel)===String(n));return t+(l===-1?o.length-1:l)},que=(e,t,n)=>t===n?"single":e===t?"start":e===n?"end":"middle",Gue=(e,t)=>({reach:e,tone:t,isJoinedAbove:t==="solid"&&(e==="start"||e==="single")}),Kue=(e,t)=>t===void 0?!0:e.tone!==t.tone?PI[e.tone]>PI[t.tone]:jI[e.reach]>jI[t.reach],zI=(e,t,n)=>{const r=$6(e);return[...t].flatMap(([o,l])=>l.flatMap(c=>{const u=n(c.id);if(u===null||c.lines===null)return[];const f=r.indexOf(o),h=Vue(r,f,c.lines.lineEnd);return r.slice(f,h+1).flatMap((p,y)=>p===null?[]:[[p,Gue(que(f+y,f,h),u)]])})).reduce((o,[l,c])=>Kue(c,o.get(l))?new Map([...o,[l,c]]):o,new Map)},BI=10,Yue=new Set,U6=new Set,Wue=new Set,Xue="[data-waypoint-mark]",Que=new Set(["auto","scroll"]),Zue="transition-opacity duration-[180ms] ease-out data-[unfocused=true]:opacity-45",Jue=(e,t)=>{const n=e.findIndex(o=>o.kind==="waypoint"&&o.waypoint.id===t);if(n===-1)return Yue;const r=e.slice(n+1),s=r.findIndex(o=>o.kind!=="lines");return new Set((s===-1?r:r.slice(0,s)).map(o=>o.id))},ede=(e,t)=>{var n;return((n=e.find(r=>r.kind==="lines"&&Hie(r.lines,t)))==null?void 0:n.id)??null},tde=(e,t)=>e.flatMap(n=>n.kind==="waypoint"&&n.waypoint.id===t?[n.rootBlockId]:[]).at(0)??null,nde=(e,t,n)=>{const r=tde(e,t);return{onLine:()=>{n({kind:"waypoint",waypointId:t})},onBlock:r===null?null:()=>{n({kind:"root-block",rootBlockId:r})}}},rde=e=>{const t=Number.parseInt(e.startLineLabel,BI),n=Number.parseInt(e.lineLabel,BI);return Array.from({length:Math.max(n-t,0)+1},(r,s)=>l6({side:e.side,lineLabel:String(t+s)}))},HI=(e,t)=>e.side===t.side&&e.lineLabel===t.lineLabel,FI=e=>e.startLineLabel===e.lineLabel?e.lineLabel:`${e.startLineLabel} to ${e.lineLabel}`,sde=(e,t)=>e!==null&&t!==null&&e.side===t.side&&e.lineLabel===t.lineLabel,ode=(e,t)=>new Set([...[...e].filter(n=>!t.includes(n)),...t.filter(n=>!e.has(n))]),$I=(e,t)=>e.startsOpen!==t.has(e.id),jT=e=>e.isReviewed||e.isFoldedByFilter,ide=e=>new Set(e.filter(jT).map(t=>t.id)),lde=(e,t)=>jT(e)?t.has(e.id):!t.has(e.id),ade=(e,t,n)=>{const r=[...e].filter(o=>o!==t.id),s=jT(t)?n:!n;return new Set(s?[...r,t.id]:r)},cde=(e,t)=>new Set(e.filter(n=>lde(n,t)).map(n=>n.id)),ude=(e,t)=>[...[...e].filter(n=>!t.has(n)),...[...t].filter(n=>!e.has(n))],dde=e=>{const t=ide(e),[n,r]=N.useState({foldedIds:t,toggledIds:U6}),s=ude(n.foldedIds,t);return s.length>0&&r({foldedIds:t,toggledIds:new Set([...n.toggledIds].filter(o=>!s.includes(o)))}),{openRootBlockIds:cde(e,n.toggledIds),onRootBlockOpenChange:(o,l)=>{const c=e.find(u=>u.id===o);c!==void 0&&r(u=>({...u,toggledIds:ade(u.toggledIds,c,l)}))}}},fde=(e,t)=>e!==null&&!t.has(e),UI=(e,t)=>{var n;return((n=[...(e==null?void 0:e.querySelectorAll(Xue))??[]].find(r=>r.dataset.waypointMark===t))==null?void 0:n.getBoundingClientRect().top)??null},hde=e=>Que.has(getComputedStyle(e).overflowY)&&e.scrollHeight>e.clientHeight,V6=e=>{const t=(e==null?void 0:e.parentElement)??null;return t===null?window:hde(t)?t:V6(t)},pde=(e,t)=>{const n=N.useRef(null);return N.useLayoutEffect(()=>{const r=n.current;n.current=null;const s=r===null?null:UI(e.current,r.waypointId);r!==null&&s!==null&&V6(e.current).scrollBy(0,s-r.top)},[e,t]),r=>{const s=UI(e.current,r);n.current=s===null?null:{waypointId:r,top:s}}},q6=({path:e,label:t,rows:n,rootBlocks:r,threads:s,previewVisit:o=null,openWaypointIds:l,currentWaypointId:c,focusedWaypointId:u,isCollapsed:f=!1,isWrapped:h=!1,isReviewPending:p,commenting:y,codeLinks:x,codeDefinitions:b,onOpenCodeLink:S,onToggleWaypoint:E,onWaypointReviewedChange:C,onRootBlockReviewedChange:R,onWriteUp:T=null,authoring:O=null})=>{const k=N.useRef(null),[M,A]=N.useState(null),[L,I]=N.useState(U6),{openRootBlockIds:j,onRootBlockOpenChange:P}=dde(r),B=pde(k,l);if(f)return null;const H=Uue(n),D=re=>re===null?Wue:new Set(zI(n,H,he=>he===re?"faint":null).keys()),F=D(u),z=F.size===0?Jue(n,u):new Set(n.filter(re=>re.kind==="lines"&&re.lines.some(he=>F.has(he))).map(re=>re.id)),q=ede(n,b),V=z.size>0,G=(y==null?void 0:y.composingRange)??null,K=new Set([...s,...G===null?[]:[G]].flatMap(rde)),X=new Set([...H.values()].flat().map(re=>re.id)),ae=zI(n,H,re=>l.has(re)?"solid":re===c?"faint":"quiet"),$=D(M),Y=re=>s.filter(he=>HI(he,re)),J=$6(n).find(re=>{if(re===null)return!1;const he=VE(re);return H.has(re)||he!==null&&Y(he).length>0})??null,ne=J===null?null:VE(J),W=re=>g.jsx(Dle,{blocks:re,codeLinks:x,onOpenCodeLink:S}),ce=re=>{const he=H.get(re)??[];return g.jsx(kue,{stem:ae.get(re)??null,hasMark:he.length>0,children:he.map((Se,_e)=>g.jsx(Fue,{waypoint:Se,isOpen:l.has(Se.id),isCurrent:Se.id===c,isReviewPending:p,isTabStop:re===J&&_e===0,previewRequest:(o==null?void 0:o.waypointId)===Se.id?o.count:null,codeLinks:x,writeUp:T===null?null:nde(n,Se.id,T),onWriteDescription:O===null?null:()=>{O.onWriteDescription(Se.id)},onOpenCodeLink:S,onToggle:()=>{B(Se.id),E(Se.id)},onReviewedChange:C===null?null:be=>{C(Se.id,be)},onPreviewChange:be=>{A(Ae=>be?Se.id:Ae===Se.id?null:Ae)}},Se.id))})},ye=re=>{const he=y===null?[]:Y(re);return he.length===0?null:g.jsx(Wce,{threads:he,isOpen:he.some(Se=>$I(Se,L)),isTabStop:sde(re,ne)&&J!==null&&!H.has(J),onToggle:()=>{I(Se=>ode(Se,he.map(_e=>_e.id)))}})},pe=re=>{const he=r.find(_e=>_e.id===re);if(he===void 0)return null;const Se=j.has(re);return g.jsxs(g.Fragment,{children:[he.coreChangeLabel===null?null:g.jsx(Oa,{kind:"core-change",label:he.coreChangeLabel}),he.spotlight===null?null:g.jsx(DT,{spotlight:he.spotlight}),R===null?null:g.jsx(bb,{label:he.reviewLabel,accessibleLabel:he.reviewName,isReviewed:he.isReviewed,isDisabled:p,className:"h-6",onChange:_e=>{R(re,_e)}}),g.jsx(Yoe,{"aria-label":Se?he.collapseLabel:he.expandLabel,className:"flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground",children:g.jsx(su,{"aria-hidden":"true",className:xe("size-4 transition-transform duration-[180ms] ease-out",Se?"":"-rotate-90")})})]})},le=re=>y===null?null:g.jsxs(g.Fragment,{children:[Y(re).filter(he=>$I(he,L)).map(he=>g.jsx(yce,{comments:he.comments,label:`${e} ${FI(he)}`,rangeLabel:he.rangeLabel,statusLabel:he.statusLabel,resolution:he.resolution,canReply:he.canReply,replyPlaceholder:y.composer.replyPlaceholder,submitLabel:y.composer.replyLabel,cancelLabel:y.composer.cancelLabel,isSubmitting:y.isCommentPending,renderEditor:y.renderCommentEditor,onReply:Se=>{y.onReply(he.id,Se)},onResolve:Se=>{y.onResolveThread(he.id,Se)},onDiscard:y.onDiscardComment},he.id)),G!==null&&HI(G,re)?g.jsx(LT,{label:`${y.composer.placeholder}, ${e} ${FI(G)}`,submitLabel:y.composer.submitLabel,postNowLabel:y.composer.postNowLabel,cancelLabel:y.composer.cancelLabel,hint:y.composer.rangeHint,isSubmitting:y.isCommentPending,shouldFocus:!0,className:"my-1.5 mr-4 ml-28 max-w-[52rem] rounded-md border border-input bg-card p-3 font-sans whitespace-normal",renderEditor:y.renderCommentEditor,onSubmit:he=>{y.onAddComment(e,G,he)},onPostNow:he=>{y.onPostComment(e,G,he)},onCancel:()=>{y.onStartComment(e,null,!1)}}):null]});return g.jsx("div",{ref:k,children:n.map(re=>{if(re.kind==="lines"){const be=z.has(re.id);return g.jsx("div",{"data-unfocused":V&&!be,"data-waypoint-focus":be?u??void 0:void 0,className:Zue,children:g.jsx(Tu,{lines:re.lines,definitions:b,hasReferenceTabStop:re.id===q,renderDefinitionDescription:W,path:e,label:t,isWrapped:h,className:"py-0",collapses:re.collapses,openRootBlockIds:j,renderCollapseControls:pe,onRootBlockOpenChange:P,commentedLineKeys:K,markedLines:$,renderLineThreads:le,renderWaypointLane:ce,renderThreadMark:ye,...y===null?{}:{addCommentLabel:y.composer.addLabel,onAddComment:(Ae,Me)=>{y.onStartComment(e,Ae,Me)}}})},re.id)}if(fde(re.rootBlockId,j))return null;if(re.kind==="gap")return g.jsx("p",{className:"border-y bg-muted/60 py-0.5 pl-28 font-mono text-xs text-muted-foreground first-of-type:border-t-0 last:border-b-0",children:re.label},re.id);const he=X.has(re.waypoint.id),Se=l.has(re.waypoint.id),_e=(O==null?void 0:O.editedWaypointId)===re.waypoint.id;return he&&!Se&&!_e?null:g.jsxs("div",{"data-waypoint-focus":re.waypoint.id===u?u:void 0,className:"relative bg-code",children:[he?g.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute top-5 bottom-0 left-[calc(0.625rem-1px)] w-0.5 bg-(--line)"}):null,_e?O.renderEditor(re.waypoint.id):g.jsx(nue,{waypoint:re.waypoint,isOpen:Se,isCurrent:re.waypoint.id===c,isReviewPending:p,isGuttered:!0,codeLinks:x,actions:O==null?void 0:O.renderActions(re.waypoint.id),onOpenCodeLink:S,onToggle:()=>{E(re.waypoint.id)},onReviewedChange:C===null?null:be=>{C(re.waypoint.id,be)}})]},re.id)})})},mde="Collapse file",gde="Expand file",yde=({file:e,previewVisit:t=null,openWaypointIds:n,currentWaypointId:r,focusedWaypointId:s,isCollapsed:o,isReviewPending:l,composer:c,composingRange:u,isCommentPending:f,renderCommentEditor:h,codeLinks:p,codeDefinitions:y,onOpenCodeLink:x,onToggleWaypoint:b,onCollapsedChange:S,onWaypointReviewedChange:E,onFileReviewedChange:C,onRootBlockReviewedChange:R,onStartComment:T,onAddComment:O,onPostComment:k,onReply:M,onResolveThread:A,onDiscardComment:L,onWriteUp:I=null,authoring:j=null,headerActions:P=null})=>{const B=c===null?null:{composer:c,composingRange:u,isCommentPending:f,renderCommentEditor:h,onStartComment:T,onAddComment:O,onPostComment:k,onReply:M,onResolveThread:A,onDiscardComment:L};return g.jsx("article",{id:e.anchorId,"aria-label":e.title,"data-reviewed":e.isReviewed,"data-reference-scope":"",className:xe("scroll-mt-(--waypoint-scroll-margin) pt-6",o?"":"[contain-intrinsic-size:auto_32rem] [content-visibility:auto]"),children:g.jsxs("div",{className:"overflow-clip rounded-md border",children:[g.jsxs("div",{"data-file-header":"",className:xe("sticky top-(--file-header-top) z-10 flex h-11 items-center gap-3 bg-muted pr-1 pl-1.5",o?"":"border-b"),children:[g.jsx("button",{type:"button","aria-expanded":!o,"aria-label":`${o?gde:mde}: ${e.path}`,"data-user-action-id":"collapse-file-action",className:"flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-background hover:text-foreground",onClick:()=>{S(!o)},children:g.jsx(Ux,{"aria-hidden":"true",className:xe("size-4 transition-transform duration-[180ms] ease-out",o?"":"rotate-90")})}),g.jsxs("div",{className:"flex min-w-0 flex-col justify-center",children:[g.jsx("h3",{className:"truncate text-[0.9375rem] leading-5 font-semibold",children:e.title}),g.jsx("p",{className:"truncate font-mono text-xs leading-4 text-muted-foreground",title:e.path,children:e.path})]}),g.jsx("span",{className:"flex-1"}),g.jsx(uf,{segments:e.countLabels.map(H=>({text:H,kind:"plain"})),className:"hidden shrink justify-end text-xs text-muted-foreground tabular-nums md:flex"}),e.forgeLink===null?null:g.jsx(Wa,{href:e.forgeLink.href,label:e.forgeLink.label,className:"shrink-0 text-xs"}),C===null?null:g.jsx(bb,{label:e.reviewLabel,isReviewed:e.isReviewed,isDisabled:l,onChange:H=>{C(e.path,H)}}),P]}),g.jsx(q6,{path:e.path,label:e.path,rows:e.rows,rootBlocks:e.rootBlocks,threads:e.threads,previewVisit:t,openWaypointIds:n,currentWaypointId:r,focusedWaypointId:s,isCollapsed:o,isReviewPending:l,commenting:B,codeLinks:p,codeDefinitions:y,onOpenCodeLink:x,onToggleWaypoint:b,onWaypointReviewedChange:E,onRootBlockReviewedChange:R,onWriteUp:I,authoring:j})]})})},xde=140,bde=e=>e.reduce((t,n)=>{const r=document.getElementById(n);return r!==null&&r.getBoundingClientRect().top<=xde?n:t},e.find((t,n)=>n===0)??null),vde=e=>{const[t,n]=N.useState(null),r=e.join(`
|
|
352
|
-
`);return N.useEffect(()=>{const s=()=>{n(bde(r===""?[]:r.split(`
|
|
353
|
-
`)))};return s(),window.addEventListener("scroll",s,{passive:!0}),()=>{window.removeEventListener("scroll",s)}},[r]),t},Sde=({order:e,sections:t})=>g.jsx(g.Fragment,{children:e.map(n=>g.jsx(N.Fragment,{children:t[n]},n))}),G6=N.createContext(void 0);function Nu(e){const t=N.useContext(G6);if(t===void 0&&!e)throw new Error(Qt(47));return t}const wde={...Om,disabled:e=>e.disabled,instantType:e=>e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,modal:e=>e.modal,focusManagerModal:e=>e.focusManagerModal,stickIfOpen:e=>e.stickIfOpen,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class Ede extends Af{constructor(n,r,s){const o=new Nm;super(Cde(n,o,r,s),Tde(o),wde);Dt(this,"setOpen",(n,r)=>{var p,y;const s=r.reason===wn,o=r.reason===ui&&r.event.detail===0,l=!n&&(r.reason===hm||r.reason==null),c=sT(r),u=this.select("activeTriggerId");if(!n&&r.reason===u5&&r.trigger==null&&u!=null&&(r.trigger=this.context.triggerElements.getById(u)??this.select("activeTriggerElement")??void 0),(y=(p=this.context).onOpenChange)==null||y.call(p,n,r),r.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(n,r);const f=()=>{const x=ob(this.state,n,r.trigger,c());x.openChangeReason=r.reason,this.update(x)};s?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(j5,()=>{this.set("stickIfOpen",!1)}),Us.flushSync(f)):f();let h;o?h="click":l?h="dismiss":r.reason===ou&&(h="focus"),this.set("instantType",h)})}}function Cde(e,t,n,r=!1){const s={...Rm(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return s.open&&(e==null?void 0:e.mounted)===void 0&&(s.mounted=!0),s}function Tde(e){return{popupRef:N.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:N.createRef(),beforeContentFocusGuardRef:N.createRef(),stickIfOpenTimeout:new co,triggerElements:e}}const VI=Of(function({props:t}){const{children:n,open:r,defaultOpen:s=!1,onOpenChange:o,onOpenChangeComplete:l,modal:c=!1,handle:u,triggerId:f,defaultTriggerId:h=null}=t,p=Nde(u,{modal:c,open:s,openProp:r,activeTriggerId:h,triggerIdProp:f});p.useControlledProp("openProp",r),p.useControlledProp("triggerIdProp",f);const y=p.useState("open"),x=p.useState("mounted"),b=p.useState("payload");p.useContextCallback("onOpenChange",o),p.useContextCallback("onOpenChangeComplete",l),oz(p,y),Em(p);const{forceUnmount:S}=Cm(y,p,()=>{p.update({stickIfOpen:!0,openChangeReason:null})});p.useSyncedValues({modal:c}),N.useEffect(()=>{y||p.context.stickIfOpenTimeout.clear()},[p,y]),N.useImperativeHandle(t.actionsRef,()=>({unmount:S,close:()=>p.setOpen(!1,ht(pm))}),[S,p]);const E=y||x;return g.jsxs(G6.Provider,{value:p,children:[u&&g.jsx(Sm,{handle:u,store:p}),E&&g.jsx(Rde,{store:p,modal:c}),typeof n=="function"?n({payload:b}):n]})});function PT(e){return Nu(!0)?g.jsx(VI,{props:e}):g.jsx(tb,{children:g.jsx(VI,{props:e})})}function Nde(e,t){const n=sb((r,s)=>new Ede(t,r,s));return N.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function Rde({store:e,modal:t}){const n=e.useState("floatingRootContext"),r=xm(n,{outsidePressEvent:{mouse:t==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),s=r.reference,o=r.floating;return Tm(e,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:o}),null}const Ode=300,Sb=bm(function(t,n){const{render:r,className:s,style:o,disabled:l=!1,nativeButton:c=!0,handle:u,payload:f,openOnHover:h=!1,delay:p=Ode,closeDelay:y=0,id:x,...b}=t,S=Nu(!0),C=Am(u)??S;if(!C)throw new Error(Qt(74));const R=is(x),T=C.useState("isTriggerActive",R),O=C.useState("floatingRootContext"),k=C.useState("isOpenedByTrigger",R),M=C.useState("triggerPopupId",R),A=N.useRef(null),{registerTrigger:L,isMountedByThisTrigger:I}=wm(R,A,C,{payload:f,disabled:l,openOnHover:h,closeDelay:y}),j=C.useState("openChangeReason"),P=C.useState("stickIfOpen"),B=C.useState("openMethod"),H=C.useState("focusManagerModal"),D=km(O,{enabled:!l&&h&&(B!=="touch"||j!==ui),mouseOnly:!0,move:!1,handleClose:_m(),restMs:p,delay:{close:y},triggerElementRef:A,isActiveTrigger:T,isClosing:()=>C.select("transitionStatus")==="ending"}),F=nb(O,{stickIfOpen:P}),z=gT(()=>C.select("open"),ne=>{C.set("openMethod",ne)}),q=C.useState("triggerProps",I),{getButtonProps:V,buttonRef:G}=vu({disabled:l,native:c}),K={open(ne){return ne&&j===ui?pE.open(ne):um.open(ne)}},{preFocusGuardRef:X,handlePreFocusGuardFocus:ee,handleFocusTargetFocus:ae}=vz(C,A),Y=It("button",t,{state:{disabled:l,open:k},ref:[G,n,L,A],props:[F.reference,D,q,z,{[Q2]:"",id:R,"aria-haspopup":"dialog","aria-expanded":k,"aria-controls":M},b,V],stateAttributesMapping:K}),J=g.jsx(N.Fragment,{children:Y},R);return I&&!H?g.jsxs(N.Fragment,{children:[g.jsx($a,{ref:X,onFocus:ee}),J,g.jsx($a,{ref:C.context.triggerFocusTargetRef,onFocus:ae})]}):J}),K6=N.createContext(void 0);function Ade(){const e=N.useContext(K6);if(e===void 0)throw new Error(Qt(45));return e}const zT=N.forwardRef(function(t,n){const{keepMounted:r=!1,...s}=t;return Nu().useState("mounted")||r?g.jsx(K6.Provider,{value:r,children:g.jsx(Z2,{ref:n,...s})}):null}),Y6=N.createContext(void 0);function W6(){const e=N.useContext(Y6);if(!e)throw new Error(Qt(46));return e}const BT=N.forwardRef(function(t,n){const{render:r,className:s,style:o,anchor:l,positionMethod:c,side:u,align:f,sideOffset:h,alignOffset:p,collisionBoundary:y="clipping-ancestors",collisionPadding:x,arrowPadding:b,sticky:S,disableAnchorTracking:E=!1,collisionAvoidance:C=Jx,...R}=t,T=Nu(),O=Ade(),k=ym(),M=T.useState("floatingRootContext"),A=T.useState("mounted"),L=T.useState("open"),I=T.useState("openChangeReason"),j=T.useState("activeTriggerElement"),P=T.useState("modal"),B=T.useState("openMethod"),H=T.useState("positionerElement"),D=T.useState("instantType"),F=T.useState("transitionStatus"),z=T.useState("adaptiveOrigin"),q=N.useRef(null),V=mm(H),G=cb({anchor:l,floatingRootContext:M,positionMethod:c,mounted:A,side:u,sideOffset:h,align:f,alignOffset:p,arrowPadding:b,collisionBoundary:y,collisionPadding:x,sticky:S,disableAnchorTracking:E,keepMounted:O,nodeId:k,collisionAvoidance:C,adaptiveOrigin:z}),K=M.useState("domReferenceElement");Be(()=>{const Y=K,J=q.current;if(Y&&(q.current=Y),J&&Y&&Y!==J){T.set("instantType",void 0);const ne=new AbortController;return V(()=>{T.set("instantType","trigger-change")},ne.signal),()=>{ne.abort()}}},[K,V,T]);const X=P===!0&&I!==wn;pz(L&&X,B==="touch",H,j);const ee=T.useStateSetter("positionerElement"),ae={open:L,side:G.side,align:G.align,anchorHidden:G.anchorHidden,instant:D},$=ub(t,ae,{styles:G.positionerStyles,transitionStatus:F,props:R,refs:[n,ee],hidden:!A,inert:!L});return g.jsxs(Y6.Provider,{value:G,children:[A&&X&&g.jsx(hT,{inert:dT(!L),cutout:j}),g.jsx(eb,{id:k,children:$})]})}),kde=N.createContext(void 0);function _de(){const[e,t]=N.useState(0),n=Ve(()=>(t(s=>s+1),()=>{t(s=>Math.max(0,s-1))}));return{context:N.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}const HT=N.forwardRef(function(t,n){const{render:r,className:s,style:o,initialFocus:l,finalFocus:c,...u}=t,f=Nu(),h=W6(),p=az()!=null,{context:y,hasClosePart:x}=_de(),b=f.useState("open"),S=f.useState("openMethod"),E=f.useState("instantType"),C=f.useState("transitionStatus"),R=f.useState("popupProps"),T=f.useState("titleElementId"),O=f.useState("descriptionElementId"),k=f.useState("modal"),M=f.useState("mounted"),A=f.useState("openChangeReason"),L=f.useState("activeTriggerElement"),I=f.useState("floatingRootContext"),j=I.useState("floatingId"),P=f.useState("disabled"),B=f.useState("openOnHover"),H=f.useState("closeDelay");Ya({open:b,ref:f.context.popupRef,onComplete(){var G,K;b&&((K=(G=f.context).onOpenChangeComplete)==null||K.call(G,!0))}}),ib(I,{enabled:B&&!P,closeDelay:H});const D=l===void 0?nz(f.context.popupRef):l,F=k!==!1&&x;f.useSyncedValue("focusManagerModal",F);const z=f.useStateSetter("popupElement"),q={open:b,side:h.side,align:h.align,instant:E,transitionStatus:C},V=It("div",t,{state:q,ref:[n,f.context.popupRef,z],props:[R,{id:j,role:"dialog",...vm,"aria-labelledby":T,"aria-describedby":O,onKeyDown(G){p&&ab.has(G.key)&&G.stopPropagation()}},Mm(C),u],stateAttributesMapping:dm});return g.jsx(tT,{context:I,openInteractionType:S,modal:F,disabled:!M||A===wn,initialFocus:D,returnFocus:c,restoreFocus:"popup",previousFocusableElement:Yt(L)?L:void 0,nextFocusableElement:f.context.triggerFocusTargetRef,beforeContentFocusGuardRef:f.context.beforeContentFocusGuardRef,children:g.jsx(kde.Provider,{value:y,children:V})})}),Mde=N.forwardRef(function(t,n){const{render:r,className:s,style:o,...l}=t,u=Nu().useState("open"),{arrowRef:f,side:h,align:p,arrowUncentered:y,arrowStyles:x}=W6();return It("div",t,{state:{open:u,side:h,align:p,uncentered:y},ref:[n,f],props:[{style:x,"aria-hidden":!0},l],stateAttributesMapping:Rf})}),FT=N.forwardRef(function(t,n){const{render:r,className:s,style:o,...l}=t,c=Nu(),u=is(l.id);return c.useSyncedValueWithCleanup("titleElementId",u),It("h2",t,{ref:n,props:[{id:u},l]})}),df="inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-sign-foreground/35 px-2.5 text-[0.8rem] text-sign-foreground hover:bg-sign-foreground/10 aria-expanded:bg-sign-foreground/15 aria-pressed:bg-sign-foreground aria-pressed:text-sign disabled:opacity-50",Ide="border-primary bg-primary font-bold text-primary-foreground hover:bg-primary/85 aria-expanded:bg-primary/85",X6="z-50 flex w-96 origin-(--transform-origin) flex-col gap-3 rounded-lg border border-foreground bg-popover p-4 text-sm text-popover-foreground outline-none duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",Lde="max-h-[min(44rem,calc(100vh-5rem))] w-[34rem] overflow-y-auto",Dde="shrink-0 text-xs text-muted-foreground underline decoration-1 underline-offset-[0.3em] hover:text-foreground disabled:opacity-50",$T=({trigger:e,children:t,className:n,onOpen:r})=>g.jsxs(PT,{onOpenChange:s=>{s&&(r==null||r())},children:[e,g.jsx(zT,{children:g.jsx(BT,{align:"end",sideOffset:10,className:"isolate z-50",children:g.jsx(HT,{className:xe(X6,n),children:t})})})]}),jde=({label:e,isPressed:t,onClick:n})=>g.jsxs("button",{type:"button","aria-pressed":t,"data-user-action-id":"chat-action",className:df,onClick:n,children:[g.jsx(IX,{"aria-hidden":"true",className:"size-3.5"}),g.jsx("span",{className:"text-box-cap",children:e})]}),Pde=({label:e,isPending:t,onClick:n})=>g.jsxs("button",{type:"button",disabled:t,"data-user-action-id":"complete-review-action",className:df,onClick:n,children:[g.jsx(wX,{"aria-hidden":"true",className:"size-3.5"}),g.jsx("span",{className:"text-box-cap",children:e})]}),zde=({label:e,onClick:t})=>g.jsxs("button",{type:"button","data-user-action-id":"unassigned-files-action",className:xe(df,"font-bold text-signal"),onClick:t,children:[g.jsx(zX,{"aria-hidden":"true",className:"size-3.5"}),g.jsx("span",{className:"text-box-cap",children:e})]}),Bde=({draft:e,isSubmitting:t,isDiscarding:n,errorMessage:r,submissionCount:s,renderEditor:o,onSubmit:l,onDiscard:c})=>{const u=N.useId(),[f,h]=N.useState(""),[p,y]=N.useState(null),x=e.verdicts.map(S=>S.key),b=x.find(S=>S===p)??x.at(0)??null;return!e.isAvailable||b===null?g.jsx("button",{type:"button",disabled:!0,title:e.unavailableReason??void 0,className:df,children:g.jsx("span",{className:"text-box-cap",children:e.buttonLabel})}):g.jsx($T,{className:Lde,trigger:g.jsxs(Sb,{"data-user-action-id":"submit-review-action",className:xe(df,Ide),children:[g.jsx("span",{className:"text-box-cap",children:e.buttonLabel}),g.jsx(su,{"aria-hidden":"true",className:"size-3.5"})]}),children:g.jsxs("form",{className:"flex flex-col gap-3",onSubmit:S=>{S.preventDefault(),l(b,f.trim())},children:[g.jsx(FT,{className:"text-base leading-6 font-bold",children:e.heading}),g.jsx("div",{children:o({label:e.bodyPlaceholder,shouldFocus:!1,onChange:h})},s),g.jsx("fieldset",{className:"flex flex-col gap-2",children:e.verdicts.map(S=>g.jsxs("label",{className:"grid cursor-pointer grid-cols-[1.25rem_minmax(0,1fr)] gap-x-2",children:[g.jsx("input",{type:"radio",name:u,checked:b===S.key,className:"mt-1 size-3.5 accent-(--primary)",onChange:()=>{y(S.key)}}),g.jsx("span",{className:"font-bold",children:S.label}),g.jsx("span",{className:"col-start-2 text-muted-foreground",children:S.description})]},S.key))}),g.jsx("p",{className:"text-muted-foreground tabular-nums",children:e.pendingLabel}),e.pendingComments.length===0?null:g.jsx("ul",{className:"flex flex-col",children:e.pendingComments.map(S=>g.jsxs("li",{className:"flex items-start justify-between gap-3 border-t py-2 first:border-t-0 first:pt-0",children:[g.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[g.jsx("span",{className:"font-mono text-xs text-muted-foreground wrap-anywhere",children:S.locationLabel}),g.jsx("span",{className:"truncate",children:S.excerpt}),S.staleLabel===null?null:g.jsx("span",{className:"text-destructive",children:S.staleLabel})]}),g.jsx("button",{type:"button","aria-label":`${S.discardLabel}: ${S.locationLabel}`,disabled:n,className:Dde,onClick:()=>{c(S.id)},children:S.discardLabel})]},S.id))}),r===null?null:g.jsx("p",{role:"alert",className:"text-destructive",children:r}),g.jsx(st,{type:"submit",disabled:t,className:"self-end",children:e.submitLabel})]})})},qI="size-3.5 motion-safe:animate-spin",Hde=({sharing:e,publishingKey:t,onPublish:n})=>{const r=o=>o.isPending||o.key===t,s=e.options.some(r);return g.jsx($T,{trigger:g.jsxs(Sb,{"aria-busy":s,"data-user-action-id":"share-action",className:df,children:[g.jsx("span",{className:"text-box-cap",children:e.buttonLabel}),s?g.jsx(nM,{"aria-hidden":"true",className:qI}):g.jsx(su,{"aria-hidden":"true",className:"size-3.5"})]}),children:g.jsx("ul",{className:"flex flex-col",children:e.options.map(o=>g.jsxs("li",{className:"flex flex-col gap-1.5 border-t py-3 first:border-t-0 first:pt-0 last:pb-0",children:[g.jsxs("div",{className:"flex items-start justify-between gap-3",children:[g.jsx("p",{className:"font-bold",children:o.label}),g.jsxs(st,{variant:"outline",size:"sm","aria-busy":r(o),disabled:!o.isAvailable||s,onClick:()=>{n(o.key)},children:[r(o)?g.jsx(nM,{"aria-hidden":"true",className:qI}):null,r(o)?o.pendingLabel:o.actionLabel]})]}),g.jsx("p",{className:"text-muted-foreground",children:o.description}),o.statusLabel===null||o.link===null?null:g.jsxs("p",{className:"flex flex-wrap items-center gap-x-3 tabular-nums",children:[o.statusLabel,g.jsx(Wa,{href:o.link.href,label:o.link.label})]})]},o.key))})})},Fde="Okay, got it!",GI="Close this tip",$de="Keep showing tips?",Ude="Tips point out features you have not tried yet. You can stop them for good.",Vde="Keep tips",qde="Stop tips",KI="↵",Gde="Enter",Kde="Escape",Yde=12,Wde=16,Xde="button, a[href], summary, [role='button'], [role='menu'], [role='menuitem'], [role='menubar'], [role='listbox'], [role='option']",Qde="relative w-[22rem] max-w-[calc(100vw-2rem)] rounded-md bg-sign px-4 pt-[1.125rem] pb-3.5 text-sign-foreground outline-none dark:ring-1 dark:ring-sign-foreground/20 duration-[180ms] data-open:animate-in data-open:fade-in-0 motion-reduce:animate-none",Zde="absolute inset-x-0 top-0 h-1 rounded-t-md bg-(--line,var(--primary-text))",Jde="size-2.5 rotate-45 rounded-[2px] bg-sign data-[side=bottom]:-top-1 data-[side=left]:-right-1 data-[side=right]:-left-1 data-[side=top]:-bottom-1",efe="absolute top-3.5 right-2.5 grid size-6 cursor-pointer place-items-center rounded-[0.3rem] text-sign-muted transition-colors duration-[180ms] ease-out hover:bg-sign-foreground/10 hover:text-sign-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring",YI="inline-flex h-7 cursor-pointer items-center gap-1.5 rounded-[0.3rem] bg-primary px-2.5 text-[0.8rem] font-bold text-primary-foreground transition-colors duration-[180ms] ease-out hover:bg-[color-mix(in_oklab,var(--primary)_88%,var(--primary-foreground))] focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring",tfe="inline-flex h-7 cursor-pointer items-center rounded-[0.3rem] px-2.5 text-[0.8rem] text-sign-muted transition-colors duration-[180ms] ease-out hover:bg-sign-foreground/10 hover:text-sign-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring",QE=({label:e})=>g.jsx(eB,{"aria-hidden":"true",className:"mx-0.5 align-[0.05rem]",children:e}),WI=e=>typeof e=="string"?`text:${e}`:`keycap:${e.keycap}`,H0=({parts:e})=>g.jsx(g.Fragment,{children:e.map(t=>typeof t=="string"?g.jsx("span",{children:t},WI(t)):g.jsxs("span",{children:[g.jsx("span",{className:"sr-only",children:t.keycap}),g.jsx(QE,{label:t.keycap})]},WI(t)))}),nfe=e=>vB(e)&&!e.ctrlKey&&!e.shiftKey&&!(e.target instanceof Element&&e.target.closest(Xde)!==null),rfe=e=>zr.getState().shownTooltipIds.at(-1)===e,sfe=(e,t)=>{const n=[...document.querySelectorAll(e)],r=pB();if(t!==null&&n.includes(t)&&hB(PE(t),r))return t;const s=ere(n.map(PE),r);return s===null?null:n[s]},ofe=(e,t)=>{const[n,r]=N.useState(null);return mB(t,()=>{r(s=>sfe(e,s))},e),t?n:null},ife=(e,t)=>{N.useEffect(()=>{if(t)return zr.getState().showTooltip(e),()=>{zr.getState().hideTooltip(e)}},[e,t])},lfe=(e,t)=>{const n=N.useEffectEvent(t);N.useEffect(()=>{if(!e)return;const r=s=>{n(s)};return window.addEventListener("keydown",r,!0),()=>{window.removeEventListener("keydown",r,!0)}},[e])},ta=({id:e,title:t=null,content:n,anchorSelector:r,side:s="top",delay:o=uB,triggers:l})=>{const{showTooltip:c}=Zne(e,{delay:o,triggers:l}),[u,f]=N.useState("tip"),h=ofe(r,c),p=c&&h!==null,y=()=>{zr.getState().deferTooltip(e,u==="prompt"?"close-button":"got-it")},x=()=>{zr.getState().deferTooltip(e,"close-button"),zr.getState().turnTipsOff()};ife(e,p),lfe(p,S=>{!rfe(e)||!nfe(S)||(S.key===Gde&&(S.preventDefault(),y()),S.key===Kde&&(S.preventDefault(),u==="tip"?f("prompt"):y()))});const b=u==="tip"?t:$de;return g.jsx(PT,{open:p,modal:!1,children:g.jsx(zT,{children:g.jsx(BT,{anchor:h,side:s,sideOffset:Yde,collisionPadding:Wde,className:"isolate z-50 data-[anchor-hidden]:hidden",children:g.jsxs(HT,{initialFocus:!1,finalFocus:!1,"aria-live":"polite","aria-label":b??void 0,"data-guide-tooltip":e,"data-navigator-scope":"",className:Qde,children:[g.jsx("span",{"aria-hidden":"true",className:Zde}),u==="tip"?g.jsx("button",{type:"button","aria-label":GI,title:GI,"data-user-action-id":"guide-tooltip-close-action",className:efe,onClick:()=>{f("prompt")},children:g.jsx(Vx,{"aria-hidden":"true",className:"size-3.5"})}):null,b===null?null:g.jsx("p",{className:"pr-7 text-base leading-6 font-bold",children:b}),g.jsx("div",{className:xe("text-sm leading-[1.375rem] text-sign-foreground/88",b!==null&&"mt-1"),children:u==="tip"?n:Ude}),g.jsx("div",{className:"mt-3.5 flex items-center justify-end gap-2",children:u==="tip"?g.jsxs("button",{type:"button","data-user-action-id":"guide-tooltip-got-it-action",className:YI,onClick:y,children:[Fde,g.jsx(QE,{label:KI})]}):g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button","data-user-action-id":"guide-tips-stop-action",className:tfe,onClick:x,children:qde}),g.jsxs("button",{type:"button","data-user-action-id":"guide-tips-keep-action",className:YI,onClick:y,children:[Vde,g.jsx(QE,{label:KI})]})]})}),g.jsx(Mde,{className:Jde})]})})})})},afe="the agent",XI=["next-waypoint-action","previous-waypoint-action"],cfe=5,ufe="[role='toolbar']",_c=e=>`[data-user-action-id="${e}"]`,nw=e=>`${ufe} ${_c(e)}`,dfe=({reviewMode:e})=>{Jne(e);const t=N.use(hb),n=N.use(vb),r=(n==null?void 0:n.label)??afe,s=t!==null&&ET(t.groups,_f)!==null;return g.jsxs(g.Fragment,{children:[g.jsx(ta,{id:"jump-to-action-tooltip",title:"Jump to any section",content:g.jsx(H0,{parts:["Press ",{keycap:"W"}," to see every section of this review and go straight to one."]}),anchorSelector:_c("jump-to-action"),triggers:{viewVisible:["context-section"],preFeatureUse:["jump-to-action"]}}),g.jsx(ta,{id:"change-overview-card-tooltip",title:"Each card is a changed code block",content:"Hover a card to see its code. Press it to read that code in the Code Walkthrough.",anchorSelector:_c("change-overview-card-action"),triggers:{viewVisible:["change-overview-section"],preFeatureUse:{actionIds:["change-overview-card-action"],use:"click-or-hover"},dayBound:1}}),g.jsx(ta,{id:"trace-diagram-card-tooltip",title:"Open a card to read its code",content:"Press a card to see its code beside the diagram, with what it does in this change.",anchorSelector:`${_c("trace-diagram-card-action")}[data-change]`,triggers:{viewVisible:["trace-diagram-section"],preFeatureUse:["trace-diagram-card-action"]}}),g.jsx(ta,{id:"blast-diagram-card-tooltip",title:"See how a file is affected",content:"Press a file to see what the change does to it and why.",anchorSelector:`${_c("blast-diagram-card-action")}[data-mark="added"], ${_c("blast-diagram-card-action")}[data-mark="modified"]`,triggers:{viewVisible:["blast-diagram-section"],preFeatureUse:["blast-diagram-card-action"],postFeatureUse:["trace-diagram-card-action"]}}),g.jsx(ta,{id:"code-view-rail-tooltip",title:"Marks show the lines to read",content:"Hover a mark beside the code to preview its waypoint. Press the mark to open it.",anchorSelector:_c("waypoint-mark-action"),side:"right",triggers:{viewVisible:["code-walkthrough-section"],preFeatureUse:{actionIds:["waypoint-mark-action"],use:"click-or-hover"}}}),g.jsx(ta,{id:"generate-agent-writing",title:`Let ${r} explain this line`,content:g.jsx(H0,{parts:["This waypoint has no explanation yet. Press ",{keycap:"G"},` and ${r} writes one for you.`]}),anchorSelector:nw(Zy),triggers:{viewVisible:["waypoint-card-section","waypoint-box-section"],preFeatureUse:[Zy,MT],dependsOnValues:{isWaypointMissingDescription:s}}}),g.jsx(ta,{id:"next-waypoint-tooltip",title:"Step through the waypoints",content:g.jsx(H0,{parts:["Press ",{keycap:"D"}," for the next waypoint and ",{keycap:"A"}," for the one before."]}),anchorSelector:nw("next-waypoint-action"),triggers:{viewVisible:["code-walkthrough-section"],preFeatureUse:XI,postFeatureUse:{actionIds:["waypoint-mark-action"],use:"click-or-hover"}}}),g.jsx(ta,{id:"filter-waypoint-tooltip",title:"Filter the waypoints",content:g.jsx(H0,{parts:["Press ",{keycap:"F"}," to show only the waypoints with a finding, a Core change or your Spotlight."]}),anchorSelector:nw("filter-action"),triggers:{viewVisible:["code-walkthrough-section"],tooltipDependent:["next-waypoint-tooltip"],preFeatureUse:["filter-action"],postFeatureUse:{actionIds:XI,times:cfe}}})]})},ffe="data-valid",hfe="data-invalid",pfe={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},mfe={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},gfe={disabled:!1,...mfe},yfe={valid(e){return e===null?null:e?{[ffe]:""}:{[hfe]:""}}},xfe={invalid:void 0,name:void 0,validityData:{state:pfe,errors:[],error:"",value:"",initialValue:null},setValidityData:Fn,disabled:void 0,setTouched:Fn,setDirty:Fn,setFilled:Fn,setFocused:Fn,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:gfe,registerFieldControl:Fn,validation:{getValidationProps:(e,t=hn)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:Fn,getInputControl:()=>null,commit:async()=>{},change:Fn}},bfe=N.createContext(xfe);function Q6(e=!0){const t=N.useContext(bfe);if(t.setValidityData===Fn&&!e)throw new Error(Qt(28));return t}const vfe=N.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Fn,validationMode:"onSubmit",submitCountRef:{current:0}});function Sfe(){return N.useContext(vfe)}const wfe=N.createContext({controlId:void 0,registerControlId:Fn,resetControlId:Fn,labelId:void 0,setLabelId:Fn,messageIds:[],setMessageIds:Fn,getDescriptionProps:e=>e});function Z6(){return N.useContext(wfe)}function Efe(e={}){const{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:s,resetControlId:o}=Z6(),l=is(),c=Or(()=>Symbol()),u=N.useRef(!1),f=N.useRef(!1),h=Ve(()=>{!u.current||s===Fn||(u.current=!1,s(c.current,void 0))});return Be(()=>{if(!n||s===Fn){h();return}let p;if(t!==void 0)f.current=!0,p=t;else if(f.current)p=l;else{o();return}if(p===void 0){h();return}u.current=!0,s(c.current,p)},[t,n,s,o,l,c,h]),Be(()=>h,[h]),(n?r:void 0)??t??l}function Cfe(e,t,n,r,s=!0,o){const{registerFieldControl:l}=Q6(),c=Or(()=>Symbol());Be(()=>{const u=c.current;if(!s){l(u,void 0);return}l(u,{controlRef:e,getValue:r,id:t,name:o,value:n})},[e,s,r,t,o,l,c,n]),Be(()=>{const u=c.current;return()=>{l(u,void 0)}},[l,c])}const Tfe=N.forwardRef(function(t,n){const{render:r,className:s,id:o,name:l,value:c,disabled:u=!1,onValueChange:f,defaultValue:h,autoFocus:p=!1,style:y,...x}=t,{state:b,name:S,disabled:E,setTouched:C,setDirty:R,validityData:T,setFocused:O,setFilled:k,validationMode:M,validation:A}=Q6(),{clearErrors:L,elementRef:I,submitCountRef:j}=Sfe(),P=E||u,B=S??l,H={...b,disabled:P},{labelId:D}=Z6(),F=Efe({id:o}),[z]=P2({controlled:c,default:h,name:"FieldControl",state:"value"}),q=c!==void 0,V=q?z:void 0,G=V==null?void 0:String(V),K=Ve(()=>{var $;return($=A.inputRef.current)==null?void 0:$.value});Cfe(A.inputRef,F,G,K,!P,l),Be(()=>{var Y;const $=G??((Y=A.inputRef.current)==null?void 0:Y.value);$!==void 0&&k($!=="")},[G,A.inputRef,k]),gz(G,()=>{G!==void 0&&(L(B),R(G!==(T.initialValue??"")),A.change(G))});const X=N.useRef(null),ee=ns();return Be(()=>{p&&X.current===es(jt(X.current))&&O(!0)},[p,O]),It("input",t,{ref:[n,X],state:H,props:[{id:F,disabled:P,name:B,ref:A.inputRef,"aria-labelledby":D,autoFocus:p,...q?{value:V}:{defaultValue:h},onChange($){const Y=$.currentTarget.value,J=ht(fm,$.nativeEvent);f==null||f(Y,J),!q&&(R(Y!==(T.initialValue??"")),k(Y!==""),!$.nativeEvent.defaultPrevented&&!J.isCanceled&&(L(B),A.change(Y)))},onFocus(){O(!0)},onBlur($){if(C(!0),O(!1),M==="onBlur"){const Y=$.currentTarget.value;A.commit(Y),q&&queueMicrotask(()=>{var ne;const J=(ne=A.inputRef.current)==null?void 0:ne.value;J!==void 0&&J!==Y&&J!==(T.initialValue??"")&&A.commit(J)})}},onKeyDown($){if($.currentTarget.tagName==="INPUT"&&$.key==="Enter"){C(!0);const Y=$.currentTarget.value,J=$.currentTarget.form;if(J&&J===I.current&&!$.defaultPrevented){const ne=$.currentTarget,W=j.current;ee.start(0,()=>{j.current===W&&A.commit(ne.value)})}else A.commit(Y)}}},x,$=>A.getValidationProps(P,$)],stateAttributesMapping:yfe})}),Nfe=N.forwardRef(function(t,n){return g.jsx(Tfe,{ref:n,...t})});function zm({className:e,type:t,...n}){return g.jsx(Nfe,{type:t,"data-slot":"input",className:xe("h-8 w-full min-w-0 rounded-lg border border-input bg-card px-2.5 py-1 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm",e),...n})}const F0="transition-[fill,stroke,stroke-dasharray,stroke-width,opacity] duration-[180ms] ease-out",Ph="[stroke-dasharray:44_0] [stroke-width:3]",Rfe="[stroke-dasharray:4_3.33] [stroke-width:3]",Ofe="[stroke-dasharray:44_0] [stroke-width:1.5]",Afe={"no-review":xe("fill-background stroke-muted-foreground",Ph),"awaiting-review":xe("fill-background stroke-signal",Ph),"awaiting-reply":xe("fill-background stroke-signal",Ph),stale:xe("fill-background stroke-muted-foreground",Rfe),draft:xe("fill-background stroke-muted-foreground",Ofe),closed:xe("fill-muted-foreground stroke-muted-foreground",Ph),merged:xe("fill-(--line) stroke-(--line)",Ph)},UT="opacity-100",sr="opacity-0",kfe={"no-review":sr,"awaiting-review":UT,"awaiting-reply":sr,stale:sr,draft:sr,closed:sr,merged:sr},_fe={"no-review":sr,"awaiting-review":sr,"awaiting-reply":UT,stale:sr,draft:sr,closed:sr,merged:sr},Mfe={"no-review":sr,"awaiting-review":sr,"awaiting-reply":sr,stale:sr,draft:sr,closed:UT,merged:sr},Ife="stroke-signal",QI="font-bold text-signal-text",$0="text-muted-foreground",Eke={"no-review":"text-foreground","awaiting-review":QI,"awaiting-reply":QI,stale:$0,draft:$0,closed:$0,merged:$0},cp=({status:e,tone:t="status",className:n})=>g.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 20 20","data-status":e,className:xe("size-5 shrink-0",n),children:[g.jsx("circle",{cx:"10",cy:"10",r:"7",className:xe(F0,Afe[e],t==="signal"?Ife:"")}),g.jsx("path",{d:"M10 4.5a5.5 5.5 0 0 1 0 11z",className:xe("fill-signal",F0,kfe[e])}),g.jsx("circle",{cx:"10",cy:"10",r:"2.75",className:xe("fill-signal",F0,_fe[e])}),g.jsx("rect",{x:"5",y:"8.5",width:"10",height:"3",rx:"1",className:xe("fill-background",F0,Mfe[e])})]}),Lfe="flex max-w-full min-w-0 items-center gap-1.5 rounded-md px-1.5 py-0.5 hover:bg-sign-foreground/10 focus-visible:outline-2 focus-visible:outline-sign-foreground data-popup-open:bg-sign-foreground/10",Dfe="flex w-full items-start gap-2.5 rounded-md px-2 py-1.5 text-left outline-none hover:bg-muted focus-visible:bg-muted aria-[current=page]:bg-muted",jfe=({target:e,isCurrent:t,onSwitch:n})=>g.jsx("li",{children:g.jsxs("button",{type:"button","aria-current":t?"page":void 0,className:Dfe,onClick:()=>{n(e.id)},children:[g.jsx(cp,{status:e.branchStatus,className:"mt-1 size-3.5"}),g.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[g.jsx(uf,{segments:[e.title],className:"font-bold"}),g.jsxs("span",{className:"flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-0.5 text-xs text-muted-foreground",children:[e.author===null?null:g.jsxs(g.Fragment,{children:[g.jsx(jf,{imageUrl:e.author.avatarUrl,monogram:e.author.monogram,className:"size-4"}),g.jsx("span",{className:"shrink-0",children:e.author.name})]}),g.jsx(uf,{segments:e.details})]})]}),g.jsx("span",{className:"sr-only",children:e.statusLabel}),t?g.jsx(Su,{"aria-hidden":"true",className:"mt-0.5 size-4 shrink-0"}):null]})}),Pfe=({switching:e,onSwitch:t})=>{const{switcher:n}=e;return n===null?g.jsx("p",{className:"text-muted-foreground",children:e.placeholder}):g.jsxs(g.Fragment,{children:[g.jsx(FT,{className:"text-base leading-6 font-bold",children:n.heading}),g.jsx(zm,{type:"search",value:e.query,placeholder:n.searchPlaceholder,"aria-label":n.searchPlaceholder,onChange:r=>{e.onSearch(r.target.value)}}),n.emptyLabel===null?null:g.jsx("p",{className:"text-muted-foreground",children:n.emptyLabel}),g.jsx("ul",{"aria-label":n.heading,className:"-mx-2 flex max-h-80 flex-col overflow-y-auto",children:n.targets.map(r=>g.jsx(jfe,{target:r,isCurrent:r.id===n.currentTargetId,onSwitch:t},r.id))})]})},ZE=({title:e,className:t,icon:n=null,switching:r})=>{const[s,o]=N.useState(!1);if(r===null)return g.jsxs(g.Fragment,{children:[n,g.jsx("h1",{className:xe("min-w-0 truncate",t),title:e,children:e})]});const l=c=>{var u;o(!1),c!==((u=r.switcher)==null?void 0:u.currentTargetId)&&r.onSwitch(c)};return g.jsx("h1",{className:xe("-mx-1.5 flex min-w-0",t),children:g.jsxs(PT,{open:s,onOpenChange:c=>{o(c),c&&r.onOpen()},children:[g.jsxs(Sb,{className:Lfe,title:e,children:[n,g.jsx("span",{className:"min-w-0 truncate",children:e}),g.jsx(su,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-sign-muted"})]}),g.jsx(zT,{children:g.jsx(BT,{align:"start",sideOffset:10,className:"isolate z-50",children:g.jsx(HT,{className:xe(X6,"max-w-[calc(100vw-2rem)] font-sans font-normal"),children:g.jsx(Pfe,{switching:r,onSwitch:l})})})})]})})},zfe={pending:null,commented:MX,approved:Su,"changes-requested":Vx},Bfe={pending:"border-sign-muted bg-sign",commented:"border-sign bg-sign-muted text-sign",approved:"border-sign bg-sign-foreground text-sign","changes-requested":"border-sign bg-destructive text-sign-foreground"},J6="border-sign-foreground bg-sign-foreground text-sign",e8="inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-sign-foreground/35 px-2.5 text-[0.8rem] text-sign-foreground hover:bg-sign-foreground/10",JE="font-bold text-signal",Yh="text-sign-muted",Hfe={"no-review":"text-sign-foreground","awaiting-review":JE,"awaiting-reply":JE,stale:Yh,draft:Yh,closed:Yh,merged:Yh},ZI=({freshness:e})=>g.jsx("span",{className:xe("shrink-0 text-sm",e.isOutOfDate?JE:Yh),children:e.label}),Ffe="relative block rounded-full focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sign-foreground",JI=({reviewer:e})=>{const t=zfe[e.state];return g.jsxs(g.Fragment,{children:[g.jsx(jf,{imageUrl:e.avatarUrl,monogram:e.monogram,className:xe("size-6",J6)}),g.jsx("span",{"aria-hidden":"true","data-state":e.state,className:xe("absolute -right-1 -bottom-1 flex size-3.5 items-center justify-center rounded-full border",Bfe[e.state]),children:t===null?null:g.jsx(t,{className:"size-2.5",strokeWidth:3})}),g.jsx("span",{className:"sr-only",children:e.stateLabel})]})},$fe=({reviewer:e,requesting:t})=>{const{request:n}=e;return n===null||t===null?g.jsx("li",{className:"relative",title:e.stateLabel,children:g.jsx(JI,{reviewer:e})}):g.jsx("li",{title:e.stateLabel,children:g.jsxs(Cz,{children:[g.jsx(Tz,{className:Ffe,children:g.jsx(JI,{reviewer:e})}),g.jsx(Nz,{align:"end",children:g.jsx(Bd,{disabled:t.isPending,onClick:()=>{n.isRemoving?t.onRemove(n.login):t.onRequest(n.login)},children:n.label})})]})})},Ufe=({labels:e,requesting:t})=>{var n;return g.jsxs($T,{onOpen:t.onOpen,trigger:g.jsx(Sb,{"aria-label":e.buttonLabel,title:e.buttonLabel,className:xe(e8,"px-1.5"),children:g.jsx(BX,{"aria-hidden":"true",className:"size-3.5"})}),children:[g.jsx(FT,{className:"text-base leading-6 font-bold",children:e.heading}),g.jsx(zm,{type:"search",value:t.query,placeholder:e.searchPlaceholder,"aria-label":e.searchPlaceholder,onChange:r=>{t.onSearch(r.target.value)}}),((n=t.options)==null?void 0:n.length)===0?g.jsx("p",{className:"text-muted-foreground",children:e.emptyLabel}):null,g.jsx("ul",{className:"flex max-h-72 flex-col overflow-y-auto",children:(t.options??[]).map(r=>g.jsxs("li",{className:"flex items-center gap-2 border-t py-2 first:border-t-0 first:pt-0 last:pb-0",children:[g.jsx(jf,{imageUrl:r.avatarUrl,monogram:r.monogram,className:"size-6"}),g.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[g.jsx("span",{className:"truncate font-bold",children:r.name}),g.jsx("span",{className:"truncate text-xs text-muted-foreground",children:r.detail})]}),g.jsx(st,{type:"button",variant:"outline",size:"sm","aria-label":`${e.requestLabel} ${r.name}`,disabled:t.isPending,onClick:()=>{t.onRequest(r.login)},children:e.requestLabel})]},r.login))})]})},eC=({segments:e})=>e===null?null:g.jsx(uf,{segments:e,className:"shrink-0 flex-nowrap text-sm text-sign-muted tabular-nums"}),t8="font-mono text-[0.94rem] font-bold",n8="text-base font-bold",r8=g.jsx(AX,{"aria-hidden":"true",className:"size-4 shrink-0 text-sign-muted"}),Vfe="shrink-0 rounded-sm border border-sign-foreground/35 px-1.5 py-0.5 text-xs font-bold text-sign-foreground",qfe=({title:e,isBranch:t,label:n,changedFiles:r=null,switching:s=null,actions:o})=>g.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[g.jsx(ZE,{title:e,className:t?t8:n8,icon:t?r8:null,switching:s}),g.jsx("span",{className:Vfe,children:n}),g.jsx(eC,{segments:r}),g.jsx("span",{className:"flex-1"}),o]}),Gfe=({header:e,changedFiles:t,requesting:n,switching:r,actions:s})=>e.kind==="branch"?g.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[g.jsx(ZE,{title:e.branch,className:t8,icon:r8,switching:r}),e.artifactFreshness===null?null:g.jsx(ZI,{freshness:e.artifactFreshness}),g.jsx(eC,{segments:t}),g.jsx("span",{className:"flex-1"}),g.jsx("span",{className:"shrink-0 text-sm text-sign-muted",children:e.forgeMessage}),g.jsx("a",{href:e.action.href,className:e8,children:g.jsx("span",{className:"text-box-cap",children:e.action.label})}),s]}):g.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[g.jsxs("span",{className:"shrink-0",title:e.author.name,children:[g.jsx(jf,{imageUrl:e.author.avatarUrl,monogram:e.author.monogram,className:xe("size-7 text-xs",J6)}),g.jsx("span",{className:"sr-only",children:e.author.name})]}),g.jsx(ZE,{title:e.title,className:n8,switching:r}),g.jsxs("span",{className:"flex shrink-0 items-center gap-1.5",children:[g.jsx(cp,{status:e.status}),g.jsx("span",{className:xe("text-sm",Hfe[e.status]),children:e.statusLabel})]}),e.artifactFreshness===null?null:g.jsx(ZI,{freshness:e.artifactFreshness}),g.jsx(eC,{segments:t}),g.jsx("span",{className:"flex-1"}),e.reviewersEmptyLabel===null?g.jsx("ul",{"aria-label":"Reviewers",className:"flex shrink-0 gap-2.5",children:e.reviewers.map(o=>g.jsx($fe,{reviewer:o,requesting:n},o.name))}):g.jsx("span",{className:"shrink-0 text-sm text-sign-muted",children:e.reviewersEmptyLabel}),e.reviewerRequest===null||n===null?null:g.jsx(Ufe,{labels:e.reviewerRequest,requesting:n}),s]}),Kfe=({header:e,changedFiles:t=null,authorLabel:n=null,reviewerRequesting:r=null,targetSwitching:s=null,actions:o})=>n===null?g.jsx(Gfe,{header:e,changedFiles:t,requesting:r,switching:s,actions:o}):g.jsx(qfe,{title:e.kind==="branch"?e.branch:e.title,isBranch:e.kind==="branch",label:n,changedFiles:t,switching:s,actions:o}),tC="grid grid-cols-[2.5rem_1fr] items-center rounded-sm py-1.5 pr-2 text-sm hover:bg-muted",eL="transition-[fill,stroke] duration-[180ms] ease-out",Yfe="relative flex flex-col before:absolute before:top-4 before:bottom-4 before:left-[calc(1.25rem-2px)] before:w-1 before:bg-(--line)",tL=({sections:e,currentAnchorId:t})=>g.jsx("ol",{className:Yfe,children:e.map(n=>g.jsxs("li",{className:"relative flex flex-col",children:[g.jsxs("a",{href:`#${n.anchorId}`,"aria-current":n.anchorId===t?"location":void 0,"data-user-action-id":"rail-section-action",className:xe(tC,"group/stop text-muted-foreground aria-[current]:font-semibold aria-[current]:text-primary-text"),children:[g.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"size-5 justify-self-center",children:g.jsx("circle",{cx:"10",cy:"10",r:"7",className:xe(eL,"fill-background stroke-muted-foreground [stroke-width:3] group-aria-[current]/stop:fill-(--line) group-aria-[current]/stop:stroke-(--line)")})}),g.jsx("span",{className:"leading-5",children:n.label})]}),n.children.map(r=>g.jsxs("a",{href:`#${r.anchorId}`,"aria-current":r.anchorId===t?"location":void 0,"data-user-action-id":"rail-file-action",className:xe(tC,"group/stop py-1 text-[0.8125rem] text-muted-foreground aria-[current]:text-primary-text"),children:[g.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"size-5 justify-self-center",children:g.jsx("circle",{cx:"10",cy:"10",r:"3.5",className:xe(eL,"fill-background stroke-(--line) [stroke-width:2] group-aria-[current]/stop:fill-(--line)")})}),g.jsx("span",{className:"leading-4",children:r.label})]},r.anchorId))]},n.anchorId))}),Wfe="Arrange",Xfe=({label:e,groups:t,sections:n,currentAnchorId:r,onEditGroup:s=null,onArrangeGroups:o=null})=>g.jsxs("nav",{"aria-label":e,className:"flex flex-col gap-2",children:[o===null?null:g.jsxs(st,{variant:"ghost",size:"sm",className:"self-end",onClick:o,children:[g.jsx(xX,{"aria-hidden":"true"}),Wfe]}),t.map(l=>g.jsxs("div",{className:"flex flex-col",children:[l.label===null?null:g.jsxs("div",{className:"flex items-start",children:[g.jsxs("a",{href:`#${l.anchorId}`,"data-user-action-id":"rail-segment-action",className:xe(tC,"min-w-0 flex-1 items-start"),children:[g.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 20 20",className:"mt-0.5 size-5 justify-self-center",children:g.jsx("rect",{x:"3.5",y:"3.5",width:"13",height:"13",rx:"2.5",className:"fill-(--line)"})}),g.jsxs("span",{className:"flex min-w-0 flex-col",children:[g.jsx("span",{className:"leading-5 font-semibold text-foreground",children:l.label}),g.jsx("span",{className:"text-xs leading-4 text-muted-foreground tabular-nums",children:l.detailLabel})]})]}),s===null?null:g.jsx(Nr,{icon:"edit",label:`Edit ${l.label}`,className:"shrink-0 text-muted-foreground",onClick:()=>{s(l.anchorId)}})]}),g.jsx(tL,{sections:l.sections,currentAnchorId:r})]},l.anchorId)),g.jsx("div",{className:"border-t pt-2",children:g.jsx(tL,{sections:n,currentAnchorId:r})})]}),Qfe=({message:e})=>g.jsx("div",{role:"status",className:"pointer-events-none fixed bottom-4 left-1/2 z-[60] -translate-x-1/2",children:e===null?null:g.jsx("p",{className:"rounded-lg border border-foreground bg-popover px-3 py-2 text-sm text-popover-foreground duration-150 animate-in fade-in-0",children:e})});function Vn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Vn(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Zfe={value:()=>{}};function wb(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new wy(n)}function wy(e){this._=e}function Jfe(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",s=n.indexOf(".");if(s>=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}wy.prototype=wb.prototype={constructor:wy,on:function(e,t){var n=this._,r=Jfe(e+"",n),s,o=-1,l=r.length;if(arguments.length<2){for(;++o<l;)if((s=(e=r[o]).type)&&(s=ehe(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<l;)if(s=(e=r[o]).type)n[s]=nL(n[s],e.name,t);else if(t==null)for(s in n)n[s]=nL(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new wy(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),r=0,s,o;r<s;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,s=o.length;r<s;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],s=0,o=r.length;s<o;++s)r[s].value.apply(t,n)}};function ehe(e,t){for(var n=0,r=e.length,s;n<r;++n)if((s=e[n]).name===t)return s.value}function nL(e,t,n){for(var r=0,s=e.length;r<s;++r)if(e[r].name===t){e[r]=Zfe,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var nC="http://www.w3.org/1999/xhtml";const rL={svg:"http://www.w3.org/2000/svg",xhtml:nC,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Eb(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),rL.hasOwnProperty(t)?{space:rL[t],local:e}:e}function the(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===nC&&t.documentElement.namespaceURI===nC?t.createElement(e):t.createElementNS(n,e)}}function nhe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function s8(e){var t=Eb(e);return(t.local?nhe:the)(t)}function rhe(){}function VT(e){return e==null?rhe:function(){return this.querySelector(e)}}function she(e){typeof e!="function"&&(e=VT(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],l=o.length,c=r[s]=new Array(l),u,f,h=0;h<l;++h)(u=o[h])&&(f=e.call(u,u.__data__,h,o))&&("__data__"in u&&(f.__data__=u.__data__),c[h]=f);return new Vs(r,this._parents)}function ohe(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function ihe(){return[]}function o8(e){return e==null?ihe:function(){return this.querySelectorAll(e)}}function lhe(e){return function(){return ohe(e.apply(this,arguments))}}function ahe(e){typeof e=="function"?e=lhe(e):e=o8(e);for(var t=this._groups,n=t.length,r=[],s=[],o=0;o<n;++o)for(var l=t[o],c=l.length,u,f=0;f<c;++f)(u=l[f])&&(r.push(e.call(u,u.__data__,f,l)),s.push(u));return new Vs(r,s)}function i8(e){return function(){return this.matches(e)}}function l8(e){return function(t){return t.matches(e)}}var che=Array.prototype.find;function uhe(e){return function(){return che.call(this.children,e)}}function dhe(){return this.firstElementChild}function fhe(e){return this.select(e==null?dhe:uhe(typeof e=="function"?e:l8(e)))}var hhe=Array.prototype.filter;function phe(){return Array.from(this.children)}function mhe(e){return function(){return hhe.call(this.children,e)}}function ghe(e){return this.selectAll(e==null?phe:mhe(typeof e=="function"?e:l8(e)))}function yhe(e){typeof e!="function"&&(e=i8(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],l=o.length,c=r[s]=[],u,f=0;f<l;++f)(u=o[f])&&e.call(u,u.__data__,f,o)&&c.push(u);return new Vs(r,this._parents)}function a8(e){return new Array(e.length)}function xhe(){return new Vs(this._enter||this._groups.map(a8),this._parents)}function ex(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ex.prototype={constructor:ex,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function bhe(e){return function(){return e}}function vhe(e,t,n,r,s,o){for(var l=0,c,u=t.length,f=o.length;l<f;++l)(c=t[l])?(c.__data__=o[l],r[l]=c):n[l]=new ex(e,o[l]);for(;l<u;++l)(c=t[l])&&(s[l]=c)}function She(e,t,n,r,s,o,l){var c,u,f=new Map,h=t.length,p=o.length,y=new Array(h),x;for(c=0;c<h;++c)(u=t[c])&&(y[c]=x=l.call(u,u.__data__,c,t)+"",f.has(x)?s[c]=u:f.set(x,u));for(c=0;c<p;++c)x=l.call(e,o[c],c,o)+"",(u=f.get(x))?(r[c]=u,u.__data__=o[c],f.delete(x)):n[c]=new ex(e,o[c]);for(c=0;c<h;++c)(u=t[c])&&f.get(y[c])===u&&(s[c]=u)}function whe(e){return e.__data__}function Ehe(e,t){if(!arguments.length)return Array.from(this,whe);var n=t?She:vhe,r=this._parents,s=this._groups;typeof e!="function"&&(e=bhe(e));for(var o=s.length,l=new Array(o),c=new Array(o),u=new Array(o),f=0;f<o;++f){var h=r[f],p=s[f],y=p.length,x=Che(e.call(h,h&&h.__data__,f,r)),b=x.length,S=c[f]=new Array(b),E=l[f]=new Array(b),C=u[f]=new Array(y);n(h,p,S,E,C,x,t);for(var R=0,T=0,O,k;R<b;++R)if(O=S[R]){for(R>=T&&(T=R+1);!(k=E[T])&&++T<b;);O._next=k||null}}return l=new Vs(l,r),l._enter=c,l._exit=u,l}function Che(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function The(){return new Vs(this._exit||this._groups.map(a8),this._parents)}function Nhe(e,t,n){var r=this.enter(),s=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?o.remove():n(o),r&&s?r.merge(s).order():s}function Rhe(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,s=n.length,o=r.length,l=Math.min(s,o),c=new Array(s),u=0;u<l;++u)for(var f=n[u],h=r[u],p=f.length,y=c[u]=new Array(p),x,b=0;b<p;++b)(x=f[b]||h[b])&&(y[b]=x);for(;u<s;++u)c[u]=n[u];return new Vs(c,this._parents)}function Ohe(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],s=r.length-1,o=r[s],l;--s>=0;)(l=r[s])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function Ahe(e){e||(e=khe);function t(p,y){return p&&y?e(p.__data__,y.__data__):!p-!y}for(var n=this._groups,r=n.length,s=new Array(r),o=0;o<r;++o){for(var l=n[o],c=l.length,u=s[o]=new Array(c),f,h=0;h<c;++h)(f=l[h])&&(u[h]=f);u.sort(t)}return new Vs(s,this._parents).order()}function khe(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function _he(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Mhe(){return Array.from(this)}function Ihe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length;s<o;++s){var l=r[s];if(l)return l}return null}function Lhe(){let e=0;for(const t of this)++e;return e}function Dhe(){return!this.node()}function jhe(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var s=t[n],o=0,l=s.length,c;o<l;++o)(c=s[o])&&e.call(c,c.__data__,o,s);return this}function Phe(e){return function(){this.removeAttribute(e)}}function zhe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Bhe(e,t){return function(){this.setAttribute(e,t)}}function Hhe(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Fhe(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function $he(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Uhe(e,t){var n=Eb(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?zhe:Phe:typeof t=="function"?n.local?$he:Fhe:n.local?Hhe:Bhe)(n,t))}function c8(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Vhe(e){return function(){this.style.removeProperty(e)}}function qhe(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Ghe(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Khe(e,t,n){return arguments.length>1?this.each((t==null?Vhe:typeof t=="function"?Ghe:qhe)(e,t,n??"")):ff(this.node(),e)}function ff(e,t){return e.style.getPropertyValue(t)||c8(e).getComputedStyle(e,null).getPropertyValue(t)}function Yhe(e){return function(){delete this[e]}}function Whe(e,t){return function(){this[e]=t}}function Xhe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Qhe(e,t){return arguments.length>1?this.each((t==null?Yhe:typeof t=="function"?Xhe:Whe)(e,t)):this.node()[e]}function u8(e){return e.trim().split(/^|\s+/)}function qT(e){return e.classList||new d8(e)}function d8(e){this._node=e,this._names=u8(e.getAttribute("class")||"")}d8.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function f8(e,t){for(var n=qT(e),r=-1,s=t.length;++r<s;)n.add(t[r])}function h8(e,t){for(var n=qT(e),r=-1,s=t.length;++r<s;)n.remove(t[r])}function Zhe(e){return function(){f8(this,e)}}function Jhe(e){return function(){h8(this,e)}}function epe(e,t){return function(){(t.apply(this,arguments)?f8:h8)(this,e)}}function tpe(e,t){var n=u8(e+"");if(arguments.length<2){for(var r=qT(this.node()),s=-1,o=n.length;++s<o;)if(!r.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?epe:t?Zhe:Jhe)(n,t))}function npe(){this.textContent=""}function rpe(e){return function(){this.textContent=e}}function spe(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ope(e){return arguments.length?this.each(e==null?npe:(typeof e=="function"?spe:rpe)(e)):this.node().textContent}function ipe(){this.innerHTML=""}function lpe(e){return function(){this.innerHTML=e}}function ape(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function cpe(e){return arguments.length?this.each(e==null?ipe:(typeof e=="function"?ape:lpe)(e)):this.node().innerHTML}function upe(){this.nextSibling&&this.parentNode.appendChild(this)}function dpe(){return this.each(upe)}function fpe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function hpe(){return this.each(fpe)}function ppe(e){var t=typeof e=="function"?e:s8(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function mpe(){return null}function gpe(e,t){var n=typeof e=="function"?e:s8(e),r=t==null?mpe:typeof t=="function"?t:VT(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function ype(){var e=this.parentNode;e&&e.removeChild(this)}function xpe(){return this.each(ype)}function bpe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function vpe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Spe(e){return this.select(e?vpe:bpe)}function wpe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Epe(e){return function(t){e.call(this,t,this.__data__)}}function Cpe(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Tpe(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,o;n<s;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function Npe(e,t,n){return function(){var r=this.__on,s,o=Epe(t);if(r){for(var l=0,c=r.length;l<c;++l)if((s=r[l]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=o,s.options=n),s.value=t;return}}this.addEventListener(e.type,o,n),s={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(s):this.__on=[s]}}function Rpe(e,t,n){var r=Cpe(e+""),s,o=r.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var u=0,f=c.length,h;u<f;++u)for(s=0,h=c[u];s<o;++s)if((l=r[s]).type===h.type&&l.name===h.name)return h.value}return}for(c=t?Npe:Tpe,s=0;s<o;++s)this.each(c(r[s],t,n));return this}function p8(e,t,n){var r=c8(e),s=r.CustomEvent;typeof s=="function"?s=new s(t,n):(s=r.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function Ope(e,t){return function(){return p8(this,e,t)}}function Ape(e,t){return function(){return p8(this,e,t.apply(this,arguments))}}function kpe(e,t){return this.each((typeof t=="function"?Ape:Ope)(e,t))}function*_pe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],s=0,o=r.length,l;s<o;++s)(l=r[s])&&(yield l)}var m8=[null];function Vs(e,t){this._groups=e,this._parents=t}function Bm(){return new Vs([[document.documentElement]],m8)}function Mpe(){return this}Vs.prototype=Bm.prototype={constructor:Vs,select:she,selectAll:ahe,selectChild:fhe,selectChildren:ghe,filter:yhe,data:Ehe,enter:xhe,exit:The,join:Nhe,merge:Rhe,selection:Mpe,order:Ohe,sort:Ahe,call:_he,nodes:Mhe,node:Ihe,size:Lhe,empty:Dhe,each:jhe,attr:Uhe,style:Khe,property:Qhe,classed:tpe,text:ope,html:cpe,raise:dpe,lower:hpe,append:ppe,insert:gpe,remove:xpe,clone:Spe,datum:wpe,on:Rpe,dispatch:kpe,[Symbol.iterator]:_pe};function zs(e){return typeof e=="string"?new Vs([[document.querySelector(e)]],[document.documentElement]):new Vs([[e]],m8)}function Ipe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function wo(e,t){if(e=Ipe(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const Lpe={passive:!1},Ip={capture:!0,passive:!1};function rw(e){e.stopImmediatePropagation()}function Hd(e){e.preventDefault(),e.stopImmediatePropagation()}function g8(e){var t=e.document.documentElement,n=zs(e).on("dragstart.drag",Hd,Ip);"onselectstart"in t?n.on("selectstart.drag",Hd,Ip):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function y8(e,t){var n=e.document.documentElement,r=zs(e).on("dragstart.drag",null);t&&(r.on("click.drag",Hd,Ip),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const U0=e=>()=>e;function rC(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:o,x:l,y:c,dx:u,dy:f,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:u,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:h}})}rC.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Dpe(e){return!e.ctrlKey&&!e.button}function jpe(){return this.parentNode}function Ppe(e,t){return t??{x:e.x,y:e.y}}function zpe(){return navigator.maxTouchPoints||"ontouchstart"in this}function x8(){var e=Dpe,t=jpe,n=Ppe,r=zpe,s={},o=wb("start","drag","end"),l=0,c,u,f,h,p=0;function y(O){O.on("mousedown.drag",x).filter(r).on("touchstart.drag",E).on("touchmove.drag",C,Lpe).on("touchend.drag touchcancel.drag",R).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(O,k){if(!(h||!e.call(this,O,k))){var M=T(this,t.call(this,O,k),O,k,"mouse");M&&(zs(O.view).on("mousemove.drag",b,Ip).on("mouseup.drag",S,Ip),g8(O.view),rw(O),f=!1,c=O.clientX,u=O.clientY,M("start",O))}}function b(O){if(Hd(O),!f){var k=O.clientX-c,M=O.clientY-u;f=k*k+M*M>p}s.mouse("drag",O)}function S(O){zs(O.view).on("mousemove.drag mouseup.drag",null),y8(O.view,f),Hd(O),s.mouse("end",O)}function E(O,k){if(e.call(this,O,k)){var M=O.changedTouches,A=t.call(this,O,k),L=M.length,I,j;for(I=0;I<L;++I)(j=T(this,A,O,k,M[I].identifier,M[I]))&&(rw(O),j("start",O,M[I]))}}function C(O){var k=O.changedTouches,M=k.length,A,L;for(A=0;A<M;++A)(L=s[k[A].identifier])&&(Hd(O),L("drag",O,k[A]))}function R(O){var k=O.changedTouches,M=k.length,A,L;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),A=0;A<M;++A)(L=s[k[A].identifier])&&(rw(O),L("end",O,k[A]))}function T(O,k,M,A,L,I){var j=o.copy(),P=wo(I||M,k),B,H,D;if((D=n.call(O,new rC("beforestart",{sourceEvent:M,target:y,identifier:L,active:l,x:P[0],y:P[1],dx:0,dy:0,dispatch:j}),A))!=null)return B=D.x-P[0]||0,H=D.y-P[1]||0,function F(z,q,V){var G=P,K;switch(z){case"start":s[L]=F,K=l++;break;case"end":delete s[L],--l;case"drag":P=wo(V||q,k),K=l;break}j.call(z,O,new rC(z,{sourceEvent:q,subject:D,target:y,identifier:L,active:K,x:P[0]+B,y:P[1]+H,dx:P[0]-G[0],dy:P[1]-G[1],dispatch:j}),A)}}return y.filter=function(O){return arguments.length?(e=typeof O=="function"?O:U0(!!O),y):e},y.container=function(O){return arguments.length?(t=typeof O=="function"?O:U0(O),y):t},y.subject=function(O){return arguments.length?(n=typeof O=="function"?O:U0(O),y):n},y.touchable=function(O){return arguments.length?(r=typeof O=="function"?O:U0(!!O),y):r},y.on=function(){var O=o.on.apply(o,arguments);return O===o?y:O},y.clickDistance=function(O){return arguments.length?(p=(O=+O)*O,y):Math.sqrt(p)},y}function GT(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function b8(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Hm(){}var Lp=.7,tx=1/Lp,Fd="\\s*([+-]?\\d+)\\s*",Dp="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ci="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Bpe=/^#([0-9a-f]{3,8})$/,Hpe=new RegExp(`^rgb\\(${Fd},${Fd},${Fd}\\)$`),Fpe=new RegExp(`^rgb\\(${ci},${ci},${ci}\\)$`),$pe=new RegExp(`^rgba\\(${Fd},${Fd},${Fd},${Dp}\\)$`),Upe=new RegExp(`^rgba\\(${ci},${ci},${ci},${Dp}\\)$`),Vpe=new RegExp(`^hsl\\(${Dp},${ci},${ci}\\)$`),qpe=new RegExp(`^hsla\\(${Dp},${ci},${ci},${Dp}\\)$`),sL={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};GT(Hm,lu,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:oL,formatHex:oL,formatHex8:Gpe,formatHsl:Kpe,formatRgb:iL,toString:iL});function oL(){return this.rgb().formatHex()}function Gpe(){return this.rgb().formatHex8()}function Kpe(){return v8(this).formatHsl()}function iL(){return this.rgb().formatRgb()}function lu(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Bpe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?lL(t):n===3?new bs(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?V0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?V0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Hpe.exec(e))?new bs(t[1],t[2],t[3],1):(t=Fpe.exec(e))?new bs(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=$pe.exec(e))?V0(t[1],t[2],t[3],t[4]):(t=Upe.exec(e))?V0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Vpe.exec(e))?uL(t[1],t[2]/100,t[3]/100,1):(t=qpe.exec(e))?uL(t[1],t[2]/100,t[3]/100,t[4]):sL.hasOwnProperty(e)?lL(sL[e]):e==="transparent"?new bs(NaN,NaN,NaN,0):null}function lL(e){return new bs(e>>16&255,e>>8&255,e&255,1)}function V0(e,t,n,r){return r<=0&&(e=t=n=NaN),new bs(e,t,n,r)}function Ype(e){return e instanceof Hm||(e=lu(e)),e?(e=e.rgb(),new bs(e.r,e.g,e.b,e.opacity)):new bs}function sC(e,t,n,r){return arguments.length===1?Ype(e):new bs(e,t,n,r??1)}function bs(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}GT(bs,sC,b8(Hm,{brighter(e){return e=e==null?tx:Math.pow(tx,e),new bs(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lp:Math.pow(Lp,e),new bs(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new bs(Qc(this.r),Qc(this.g),Qc(this.b),nx(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:aL,formatHex:aL,formatHex8:Wpe,formatRgb:cL,toString:cL}));function aL(){return`#${Pc(this.r)}${Pc(this.g)}${Pc(this.b)}`}function Wpe(){return`#${Pc(this.r)}${Pc(this.g)}${Pc(this.b)}${Pc((isNaN(this.opacity)?1:this.opacity)*255)}`}function cL(){const e=nx(this.opacity);return`${e===1?"rgb(":"rgba("}${Qc(this.r)}, ${Qc(this.g)}, ${Qc(this.b)}${e===1?")":`, ${e})`}`}function nx(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Qc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Pc(e){return e=Qc(e),(e<16?"0":"")+e.toString(16)}function uL(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Eo(e,t,n,r)}function v8(e){if(e instanceof Eo)return new Eo(e.h,e.s,e.l,e.opacity);if(e instanceof Hm||(e=lu(e)),!e)return new Eo;if(e instanceof Eo)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),o=Math.max(t,n,r),l=NaN,c=o-s,u=(o+s)/2;return c?(t===o?l=(n-r)/c+(n<r)*6:n===o?l=(r-t)/c+2:l=(t-n)/c+4,c/=u<.5?o+s:2-o-s,l*=60):c=u>0&&u<1?0:l,new Eo(l,c,u,e.opacity)}function Xpe(e,t,n,r){return arguments.length===1?v8(e):new Eo(e,t,n,r??1)}function Eo(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}GT(Eo,Xpe,b8(Hm,{brighter(e){return e=e==null?tx:Math.pow(tx,e),new Eo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Lp:Math.pow(Lp,e),new Eo(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new bs(sw(e>=240?e-240:e+120,s,r),sw(e,s,r),sw(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Eo(dL(this.h),q0(this.s),q0(this.l),nx(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=nx(this.opacity);return`${e===1?"hsl(":"hsla("}${dL(this.h)}, ${q0(this.s)*100}%, ${q0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function dL(e){return e=(e||0)%360,e<0?e+360:e}function q0(e){return Math.max(0,Math.min(1,e||0))}function sw(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const KT=e=>()=>e;function Qpe(e,t){return function(n){return e+n*t}}function Zpe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Jpe(e){return(e=+e)==1?S8:function(t,n){return n-t?Zpe(t,n,e):KT(isNaN(t)?n:t)}}function S8(e,t){var n=t-e;return n?Qpe(e,n):KT(isNaN(e)?t:e)}const rx=(function e(t){var n=Jpe(t);function r(s,o){var l=n((s=sC(s)).r,(o=sC(o)).r),c=n(s.g,o.g),u=n(s.b,o.b),f=S8(s.opacity,o.opacity);return function(h){return s.r=l(h),s.g=c(h),s.b=u(h),s.opacity=f(h),s+""}}return r.gamma=e,r})(1);function eme(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),s;return function(o){for(s=0;s<n;++s)r[s]=e[s]*(1-o)+t[s]*o;return r}}function tme(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function nme(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,s=new Array(r),o=new Array(n),l;for(l=0;l<r;++l)s[l]=up(e[l],t[l]);for(;l<n;++l)o[l]=t[l];return function(c){for(l=0;l<r;++l)o[l]=s[l](c);return o}}function rme(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ti(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function sme(e,t){var n={},r={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=up(e[s],t[s]):r[s]=t[s];return function(o){for(s in n)r[s]=n[s](o);return r}}var oC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ow=new RegExp(oC.source,"g");function ome(e){return function(){return e}}function ime(e){return function(t){return e(t)+""}}function w8(e,t){var n=oC.lastIndex=ow.lastIndex=0,r,s,o,l=-1,c=[],u=[];for(e=e+"",t=t+"";(r=oC.exec(e))&&(s=ow.exec(t));)(o=s.index)>n&&(o=t.slice(n,o),c[l]?c[l]+=o:c[++l]=o),(r=r[0])===(s=s[0])?c[l]?c[l]+=s:c[++l]=s:(c[++l]=null,u.push({i:l,x:ti(r,s)})),n=ow.lastIndex;return n<t.length&&(o=t.slice(n),c[l]?c[l]+=o:c[++l]=o),c.length<2?u[0]?ime(u[0].x):ome(t):(t=u.length,function(f){for(var h=0,p;h<t;++h)c[(p=u[h]).i]=p.x(f);return c.join("")})}function up(e,t){var n=typeof t,r;return t==null||n==="boolean"?KT(t):(n==="number"?ti:n==="string"?(r=lu(t))?(t=r,rx):w8:t instanceof lu?rx:t instanceof Date?rme:tme(t)?eme:Array.isArray(t)?nme:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?sme:ti)(e,t)}var fL=180/Math.PI,iC={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function E8(e,t,n,r,s,o){var l,c,u;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(u=e*n+t*r)&&(n-=e*u,r-=t*u),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,u/=c),e*r<t*n&&(e=-e,t=-t,u=-u,l=-l),{translateX:s,translateY:o,rotate:Math.atan2(t,e)*fL,skewX:Math.atan(u)*fL,scaleX:l,scaleY:c}}var G0;function lme(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?iC:E8(t.a,t.b,t.c,t.d,t.e,t.f)}function ame(e){return e==null||(G0||(G0=document.createElementNS("http://www.w3.org/2000/svg","g")),G0.setAttribute("transform",e),!(e=G0.transform.baseVal.consolidate()))?iC:(e=e.matrix,E8(e.a,e.b,e.c,e.d,e.e,e.f))}function C8(e,t,n,r){function s(f){return f.length?f.pop()+" ":""}function o(f,h,p,y,x,b){if(f!==p||h!==y){var S=x.push("translate(",null,t,null,n);b.push({i:S-4,x:ti(f,p)},{i:S-2,x:ti(h,y)})}else(p||y)&&x.push("translate("+p+t+y+n)}function l(f,h,p,y){f!==h?(f-h>180?h+=360:h-f>180&&(f+=360),y.push({i:p.push(s(p)+"rotate(",null,r)-2,x:ti(f,h)})):h&&p.push(s(p)+"rotate("+h+r)}function c(f,h,p,y){f!==h?y.push({i:p.push(s(p)+"skewX(",null,r)-2,x:ti(f,h)}):h&&p.push(s(p)+"skewX("+h+r)}function u(f,h,p,y,x,b){if(f!==p||h!==y){var S=x.push(s(x)+"scale(",null,",",null,")");b.push({i:S-4,x:ti(f,p)},{i:S-2,x:ti(h,y)})}else(p!==1||y!==1)&&x.push(s(x)+"scale("+p+","+y+")")}return function(f,h){var p=[],y=[];return f=e(f),h=e(h),o(f.translateX,f.translateY,h.translateX,h.translateY,p,y),l(f.rotate,h.rotate,p,y),c(f.skewX,h.skewX,p,y),u(f.scaleX,f.scaleY,h.scaleX,h.scaleY,p,y),f=h=null,function(x){for(var b=-1,S=y.length,E;++b<S;)p[(E=y[b]).i]=E.x(x);return p.join("")}}}var cme=C8(lme,"px, ","px)","deg)"),ume=C8(ame,", ",")",")"),dme=1e-12;function hL(e){return((e=Math.exp(e))+1/e)/2}function fme(e){return((e=Math.exp(e))-1/e)/2}function hme(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ey=(function e(t,n,r){function s(o,l){var c=o[0],u=o[1],f=o[2],h=l[0],p=l[1],y=l[2],x=h-c,b=p-u,S=x*x+b*b,E,C;if(S<dme)C=Math.log(y/f)/t,E=function(A){return[c+A*x,u+A*b,f*Math.exp(t*A*C)]};else{var R=Math.sqrt(S),T=(y*y-f*f+r*S)/(2*f*n*R),O=(y*y-f*f-r*S)/(2*y*n*R),k=Math.log(Math.sqrt(T*T+1)-T),M=Math.log(Math.sqrt(O*O+1)-O);C=(M-k)/t,E=function(A){var L=A*C,I=hL(k),j=f/(n*R)*(I*hme(t*L+k)-fme(k));return[c+j*x,u+j*b,f*I/hL(t*L+k)]}}return E.duration=C*1e3*t/Math.SQRT2,E}return s.rho=function(o){var l=Math.max(.001,+o),c=l*l,u=c*c;return e(l,c,u)},s})(Math.SQRT2,2,4);var hf=0,Wh=0,zh=0,T8=1e3,sx,Xh,ox=0,au=0,Cb=0,jp=typeof performance=="object"&&performance.now?performance:Date,N8=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function YT(){return au||(N8(pme),au=jp.now()+Cb)}function pme(){au=0}function ix(){this._call=this._time=this._next=null}ix.prototype=R8.prototype={constructor:ix,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?YT():+n)+(t==null?0:+t),!this._next&&Xh!==this&&(Xh?Xh._next=this:sx=this,Xh=this),this._call=e,this._time=n,lC()},stop:function(){this._call&&(this._call=null,this._time=1/0,lC())}};function R8(e,t,n){var r=new ix;return r.restart(e,t,n),r}function mme(){YT(),++hf;for(var e=sx,t;e;)(t=au-e._time)>=0&&e._call.call(void 0,t),e=e._next;--hf}function pL(){au=(ox=jp.now())+Cb,hf=Wh=0;try{mme()}finally{hf=0,yme(),au=0}}function gme(){var e=jp.now(),t=e-ox;t>T8&&(Cb-=t,ox=e)}function yme(){for(var e,t=sx,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:sx=n);Xh=e,lC(r)}function lC(e){if(!hf){Wh&&(Wh=clearTimeout(Wh));var t=e-au;t>24?(e<1/0&&(Wh=setTimeout(pL,e-jp.now()-Cb)),zh&&(zh=clearInterval(zh))):(zh||(ox=jp.now(),zh=setInterval(gme,T8)),hf=1,N8(pL))}}function mL(e,t,n){var r=new ix;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var xme=wb("start","end","cancel","interrupt"),bme=[],O8=0,gL=1,aC=2,Cy=3,yL=4,cC=5,Ty=6;function Tb(e,t,n,r,s,o){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;vme(e,n,{name:t,index:r,group:s,on:xme,tween:bme,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:O8})}function WT(e,t){var n=Mo(e,t);if(n.state>O8)throw new Error("too late; already scheduled");return n}function hi(e,t){var n=Mo(e,t);if(n.state>Cy)throw new Error("too late; already running");return n}function Mo(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function vme(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=R8(o,0,n.time);function o(f){n.state=gL,n.timer.restart(l,n.delay,n.time),n.delay<=f&&l(f-n.delay)}function l(f){var h,p,y,x;if(n.state!==gL)return u();for(h in r)if(x=r[h],x.name===n.name){if(x.state===Cy)return mL(l);x.state===yL?(x.state=Ty,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete r[h]):+h<t&&(x.state=Ty,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete r[h])}if(mL(function(){n.state===Cy&&(n.state=yL,n.timer.restart(c,n.delay,n.time),c(f))}),n.state=aC,n.on.call("start",e,e.__data__,n.index,n.group),n.state===aC){for(n.state=Cy,s=new Array(y=n.tween.length),h=0,p=-1;h<y;++h)(x=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(s[++p]=x);s.length=p+1}}function c(f){for(var h=f<n.duration?n.ease.call(null,f/n.duration):(n.timer.restart(u),n.state=cC,1),p=-1,y=s.length;++p<y;)s[p].call(e,h);n.state===cC&&(n.on.call("end",e,e.__data__,n.index,n.group),u())}function u(){n.state=Ty,n.timer.stop(),delete r[t];for(var f in r)return;delete e.__transition}}function Ny(e,t){var n=e.__transition,r,s,o=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((r=n[l]).name!==t){o=!1;continue}s=r.state>aC&&r.state<cC,r.state=Ty,r.timer.stop(),r.on.call(s?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[l]}o&&delete e.__transition}}function Sme(e){return this.each(function(){Ny(this,e)})}function wme(e,t){var n,r;return function(){var s=hi(this,e),o=s.tween;if(o!==n){r=n=o;for(var l=0,c=r.length;l<c;++l)if(r[l].name===t){r=r.slice(),r.splice(l,1);break}}s.tween=r}}function Eme(e,t,n){var r,s;if(typeof n!="function")throw new Error;return function(){var o=hi(this,e),l=o.tween;if(l!==r){s=(r=l).slice();for(var c={name:t,value:n},u=0,f=s.length;u<f;++u)if(s[u].name===t){s[u]=c;break}u===f&&s.push(c)}o.tween=s}}function Cme(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Mo(this.node(),n).tween,s=0,o=r.length,l;s<o;++s)if((l=r[s]).name===e)return l.value;return null}return this.each((t==null?wme:Eme)(n,e,t))}function XT(e,t,n){var r=e._id;return e.each(function(){var s=hi(this,r);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Mo(s,r).value[t]}}function A8(e,t){var n;return(typeof t=="number"?ti:t instanceof lu?rx:(n=lu(t))?(t=n,rx):w8)(e,t)}function Tme(e){return function(){this.removeAttribute(e)}}function Nme(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Rme(e,t,n){var r,s=n+"",o;return function(){var l=this.getAttribute(e);return l===s?null:l===r?o:o=t(r=l,n)}}function Ome(e,t,n){var r,s=n+"",o;return function(){var l=this.getAttributeNS(e.space,e.local);return l===s?null:l===r?o:o=t(r=l,n)}}function Ame(e,t,n){var r,s,o;return function(){var l,c=n(this),u;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),u=c+"",l===u?null:l===r&&u===s?o:(s=u,o=t(r=l,c)))}}function kme(e,t,n){var r,s,o;return function(){var l,c=n(this),u;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),u=c+"",l===u?null:l===r&&u===s?o:(s=u,o=t(r=l,c)))}}function _me(e,t){var n=Eb(e),r=n==="transform"?ume:A8;return this.attrTween(e,typeof t=="function"?(n.local?kme:Ame)(n,r,XT(this,"attr."+e,t)):t==null?(n.local?Nme:Tme)(n):(n.local?Ome:Rme)(n,r,t))}function Mme(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Ime(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Lme(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&Ime(e,o)),n}return s._value=t,s}function Dme(e,t){var n,r;function s(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&Mme(e,o)),n}return s._value=t,s}function jme(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Eb(e);return this.tween(n,(r.local?Lme:Dme)(r,t))}function Pme(e,t){return function(){WT(this,e).delay=+t.apply(this,arguments)}}function zme(e,t){return t=+t,function(){WT(this,e).delay=t}}function Bme(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Pme:zme)(t,e)):Mo(this.node(),t).delay}function Hme(e,t){return function(){hi(this,e).duration=+t.apply(this,arguments)}}function Fme(e,t){return t=+t,function(){hi(this,e).duration=t}}function $me(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Hme:Fme)(t,e)):Mo(this.node(),t).duration}function Ume(e,t){if(typeof t!="function")throw new Error;return function(){hi(this,e).ease=t}}function Vme(e){var t=this._id;return arguments.length?this.each(Ume(t,e)):Mo(this.node(),t).ease}function qme(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;hi(this,e).ease=n}}function Gme(e){if(typeof e!="function")throw new Error;return this.each(qme(this._id,e))}function Kme(e){typeof e!="function"&&(e=i8(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s<n;++s)for(var o=t[s],l=o.length,c=r[s]=[],u,f=0;f<l;++f)(u=o[f])&&e.call(u,u.__data__,f,o)&&c.push(u);return new ul(r,this._parents,this._name,this._id)}function Yme(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,s=n.length,o=Math.min(r,s),l=new Array(r),c=0;c<o;++c)for(var u=t[c],f=n[c],h=u.length,p=l[c]=new Array(h),y,x=0;x<h;++x)(y=u[x]||f[x])&&(p[x]=y);for(;c<r;++c)l[c]=t[c];return new ul(l,this._parents,this._name,this._id)}function Wme(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function Xme(e,t,n){var r,s,o=Wme(t)?WT:hi;return function(){var l=o(this,e),c=l.on;c!==r&&(s=(r=c).copy()).on(t,n),l.on=s}}function Qme(e,t){var n=this._id;return arguments.length<2?Mo(this.node(),n).on.on(e):this.each(Xme(n,e,t))}function Zme(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Jme(){return this.on("end.remove",Zme(this._id))}function ege(e){var t=this._name,n=this._id;typeof e!="function"&&(e=VT(e));for(var r=this._groups,s=r.length,o=new Array(s),l=0;l<s;++l)for(var c=r[l],u=c.length,f=o[l]=new Array(u),h,p,y=0;y<u;++y)(h=c[y])&&(p=e.call(h,h.__data__,y,c))&&("__data__"in h&&(p.__data__=h.__data__),f[y]=p,Tb(f[y],t,n,y,f,Mo(h,n)));return new ul(o,this._parents,t,n)}function tge(e){var t=this._name,n=this._id;typeof e!="function"&&(e=o8(e));for(var r=this._groups,s=r.length,o=[],l=[],c=0;c<s;++c)for(var u=r[c],f=u.length,h,p=0;p<f;++p)if(h=u[p]){for(var y=e.call(h,h.__data__,p,u),x,b=Mo(h,n),S=0,E=y.length;S<E;++S)(x=y[S])&&Tb(x,t,n,S,y,b);o.push(y),l.push(h)}return new ul(o,l,t,n)}var nge=Bm.prototype.constructor;function rge(){return new nge(this._groups,this._parents)}function sge(e,t){var n,r,s;return function(){var o=ff(this,e),l=(this.style.removeProperty(e),ff(this,e));return o===l?null:o===n&&l===r?s:s=t(n=o,r=l)}}function k8(e){return function(){this.style.removeProperty(e)}}function oge(e,t,n){var r,s=n+"",o;return function(){var l=ff(this,e);return l===s?null:l===r?o:o=t(r=l,n)}}function ige(e,t,n){var r,s,o;return function(){var l=ff(this,e),c=n(this),u=c+"";return c==null&&(u=c=(this.style.removeProperty(e),ff(this,e))),l===u?null:l===r&&u===s?o:(s=u,o=t(r=l,c))}}function lge(e,t){var n,r,s,o="style."+t,l="end."+o,c;return function(){var u=hi(this,e),f=u.on,h=u.value[o]==null?c||(c=k8(t)):void 0;(f!==n||s!==h)&&(r=(n=f).copy()).on(l,s=h),u.on=r}}function age(e,t,n){var r=(e+="")=="transform"?cme:A8;return t==null?this.styleTween(e,sge(e,r)).on("end.style."+e,k8(e)):typeof t=="function"?this.styleTween(e,ige(e,r,XT(this,"style."+e,t))).each(lge(this._id,e)):this.styleTween(e,oge(e,r,t),n).on("end.style."+e,null)}function cge(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function uge(e,t,n){var r,s;function o(){var l=t.apply(this,arguments);return l!==s&&(r=(s=l)&&cge(e,l,n)),r}return o._value=t,o}function dge(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,uge(e,t,n??""))}function fge(e){return function(){this.textContent=e}}function hge(e){return function(){var t=e(this);this.textContent=t??""}}function pge(e){return this.tween("text",typeof e=="function"?hge(XT(this,"text",e)):fge(e==null?"":e+""))}function mge(e){return function(t){this.textContent=e.call(this,t)}}function gge(e){var t,n;function r(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&mge(s)),t}return r._value=e,r}function yge(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,gge(e))}function xge(){for(var e=this._name,t=this._id,n=_8(),r=this._groups,s=r.length,o=0;o<s;++o)for(var l=r[o],c=l.length,u,f=0;f<c;++f)if(u=l[f]){var h=Mo(u,t);Tb(u,e,n,f,l,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new ul(r,this._parents,e,n)}function bge(){var e,t,n=this,r=n._id,s=n.size();return new Promise(function(o,l){var c={value:l},u={value:function(){--s===0&&o()}};n.each(function(){var f=hi(this,r),h=f.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(u)),f.on=t}),s===0&&o()})}var vge=0;function ul(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function _8(){return++vge}var Di=Bm.prototype;ul.prototype={constructor:ul,select:ege,selectAll:tge,selectChild:Di.selectChild,selectChildren:Di.selectChildren,filter:Kme,merge:Yme,selection:rge,transition:xge,call:Di.call,nodes:Di.nodes,node:Di.node,size:Di.size,empty:Di.empty,each:Di.each,on:Qme,attr:_me,attrTween:jme,style:age,styleTween:dge,text:pge,textTween:yge,remove:Jme,tween:Cme,delay:Bme,duration:$me,ease:Vme,easeVarying:Gme,end:bge,[Symbol.iterator]:Di[Symbol.iterator]};function Sge(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var wge={time:null,delay:0,duration:250,ease:Sge};function Ege(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Cge(e){var t,n;e instanceof ul?(t=e._id,e=e._name):(t=_8(),(n=wge).time=YT(),e=e==null?null:e+"");for(var r=this._groups,s=r.length,o=0;o<s;++o)for(var l=r[o],c=l.length,u,f=0;f<c;++f)(u=l[f])&&Tb(u,e,t,f,l,n||Ege(u,t));return new ul(r,this._parents,e,t)}Bm.prototype.interrupt=Sme;Bm.prototype.transition=Cge;const K0=e=>()=>e;function Tge(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function Gi(e,t,n){this.k=e,this.x=t,this.y=n}Gi.prototype={constructor:Gi,scale:function(e){return e===1?this:new Gi(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Gi(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Nb=new Gi(1,0,0);M8.prototype=Gi.prototype;function M8(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Nb;return e.__zoom}function iw(e){e.stopImmediatePropagation()}function Bh(e){e.preventDefault(),e.stopImmediatePropagation()}function Nge(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Rge(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function xL(){return this.__zoom||Nb}function Oge(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Age(){return navigator.maxTouchPoints||"ontouchstart"in this}function kge(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),l>o?(o+l)/2:Math.min(0,o)||Math.max(0,l))}function I8(){var e=Nge,t=Rge,n=kge,r=Oge,s=Age,o=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,u=Ey,f=wb("start","zoom","end"),h,p,y,x=500,b=150,S=0,E=10;function C(D){D.property("__zoom",xL).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",j).filter(s).on("touchstart.zoom",P).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",H).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(D,F,z,q){var V=D.selection?D.selection():D;V.property("__zoom",xL),D!==V?k(D,F,z,q):V.interrupt().each(function(){M(this,arguments).event(q).start().zoom(null,typeof F=="function"?F.apply(this,arguments):F).end()})},C.scaleBy=function(D,F,z,q){C.scaleTo(D,function(){var V=this.__zoom.k,G=typeof F=="function"?F.apply(this,arguments):F;return V*G},z,q)},C.scaleTo=function(D,F,z,q){C.transform(D,function(){var V=t.apply(this,arguments),G=this.__zoom,K=z==null?O(V):typeof z=="function"?z.apply(this,arguments):z,X=G.invert(K),ee=typeof F=="function"?F.apply(this,arguments):F;return n(T(R(G,ee),K,X),V,l)},z,q)},C.translateBy=function(D,F,z,q){C.transform(D,function(){return n(this.__zoom.translate(typeof F=="function"?F.apply(this,arguments):F,typeof z=="function"?z.apply(this,arguments):z),t.apply(this,arguments),l)},null,q)},C.translateTo=function(D,F,z,q,V){C.transform(D,function(){var G=t.apply(this,arguments),K=this.__zoom,X=q==null?O(G):typeof q=="function"?q.apply(this,arguments):q;return n(Nb.translate(X[0],X[1]).scale(K.k).translate(typeof F=="function"?-F.apply(this,arguments):-F,typeof z=="function"?-z.apply(this,arguments):-z),G,l)},q,V)};function R(D,F){return F=Math.max(o[0],Math.min(o[1],F)),F===D.k?D:new Gi(F,D.x,D.y)}function T(D,F,z){var q=F[0]-z[0]*D.k,V=F[1]-z[1]*D.k;return q===D.x&&V===D.y?D:new Gi(D.k,q,V)}function O(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function k(D,F,z,q){D.on("start.zoom",function(){M(this,arguments).event(q).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event(q).end()}).tween("zoom",function(){var V=this,G=arguments,K=M(V,G).event(q),X=t.apply(V,G),ee=z==null?O(X):typeof z=="function"?z.apply(V,G):z,ae=Math.max(X[1][0]-X[0][0],X[1][1]-X[0][1]),$=V.__zoom,Y=typeof F=="function"?F.apply(V,G):F,J=u($.invert(ee).concat(ae/$.k),Y.invert(ee).concat(ae/Y.k));return function(ne){if(ne===1)ne=Y;else{var W=J(ne),ce=ae/W[2];ne=new Gi(ce,ee[0]-W[0]*ce,ee[1]-W[1]*ce)}K.zoom(null,ne)}})}function M(D,F,z){return!z&&D.__zooming||new A(D,F)}function A(D,F){this.that=D,this.args=F,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,F),this.taps=0}A.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,F){return this.mouse&&D!=="mouse"&&(this.mouse[1]=F.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=F.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=F.invert(this.touch1[0])),this.that.__zoom=F,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var F=zs(this.that).datum();f.call(D,this.that,new Tge(D,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:f}),F)}};function L(D,...F){if(!e.apply(this,arguments))return;var z=M(this,F).event(D),q=this.__zoom,V=Math.max(o[0],Math.min(o[1],q.k*Math.pow(2,r.apply(this,arguments)))),G=wo(D);if(z.wheel)(z.mouse[0][0]!==G[0]||z.mouse[0][1]!==G[1])&&(z.mouse[1]=q.invert(z.mouse[0]=G)),clearTimeout(z.wheel);else{if(q.k===V)return;z.mouse=[G,q.invert(G)],Ny(this),z.start()}Bh(D),z.wheel=setTimeout(K,b),z.zoom("mouse",n(T(R(q,V),z.mouse[0],z.mouse[1]),z.extent,l));function K(){z.wheel=null,z.end()}}function I(D,...F){if(y||!e.apply(this,arguments))return;var z=D.currentTarget,q=M(this,F,!0).event(D),V=zs(D.view).on("mousemove.zoom",ee,!0).on("mouseup.zoom",ae,!0),G=wo(D,z),K=D.clientX,X=D.clientY;g8(D.view),iw(D),q.mouse=[G,this.__zoom.invert(G)],Ny(this),q.start();function ee($){if(Bh($),!q.moved){var Y=$.clientX-K,J=$.clientY-X;q.moved=Y*Y+J*J>S}q.event($).zoom("mouse",n(T(q.that.__zoom,q.mouse[0]=wo($,z),q.mouse[1]),q.extent,l))}function ae($){V.on("mousemove.zoom mouseup.zoom",null),y8($.view,q.moved),Bh($),q.event($).end()}}function j(D,...F){if(e.apply(this,arguments)){var z=this.__zoom,q=wo(D.changedTouches?D.changedTouches[0]:D,this),V=z.invert(q),G=z.k*(D.shiftKey?.5:2),K=n(T(R(z,G),q,V),t.apply(this,F),l);Bh(D),c>0?zs(this).transition().duration(c).call(k,K,q,D):zs(this).call(C.transform,K,q,D)}}function P(D,...F){if(e.apply(this,arguments)){var z=D.touches,q=z.length,V=M(this,F,D.changedTouches.length===q).event(D),G,K,X,ee;for(iw(D),K=0;K<q;++K)X=z[K],ee=wo(X,this),ee=[ee,this.__zoom.invert(ee),X.identifier],V.touch0?!V.touch1&&V.touch0[2]!==ee[2]&&(V.touch1=ee,V.taps=0):(V.touch0=ee,G=!0,V.taps=1+!!h);h&&(h=clearTimeout(h)),G&&(V.taps<2&&(p=ee[0],h=setTimeout(function(){h=null},x)),Ny(this),V.start())}}function B(D,...F){if(this.__zooming){var z=M(this,F).event(D),q=D.changedTouches,V=q.length,G,K,X,ee;for(Bh(D),G=0;G<V;++G)K=q[G],X=wo(K,this),z.touch0&&z.touch0[2]===K.identifier?z.touch0[0]=X:z.touch1&&z.touch1[2]===K.identifier&&(z.touch1[0]=X);if(K=z.that.__zoom,z.touch1){var ae=z.touch0[0],$=z.touch0[1],Y=z.touch1[0],J=z.touch1[1],ne=(ne=Y[0]-ae[0])*ne+(ne=Y[1]-ae[1])*ne,W=(W=J[0]-$[0])*W+(W=J[1]-$[1])*W;K=R(K,Math.sqrt(ne/W)),X=[(ae[0]+Y[0])/2,(ae[1]+Y[1])/2],ee=[($[0]+J[0])/2,($[1]+J[1])/2]}else if(z.touch0)X=z.touch0[0],ee=z.touch0[1];else return;z.zoom("touch",n(T(K,X,ee),z.extent,l))}}function H(D,...F){if(this.__zooming){var z=M(this,F).event(D),q=D.changedTouches,V=q.length,G,K;for(iw(D),y&&clearTimeout(y),y=setTimeout(function(){y=null},x),G=0;G<V;++G)K=q[G],z.touch0&&z.touch0[2]===K.identifier?delete z.touch0:z.touch1&&z.touch1[2]===K.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(K=wo(K,this),Math.hypot(p[0]-K[0],p[1]-K[1])<E)){var X=zs(this).on("dblclick.zoom");X&&X.apply(this,arguments)}}}return C.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:K0(+D),C):r},C.filter=function(D){return arguments.length?(e=typeof D=="function"?D:K0(!!D),C):e},C.touchable=function(D){return arguments.length?(s=typeof D=="function"?D:K0(!!D),C):s},C.extent=function(D){return arguments.length?(t=typeof D=="function"?D:K0([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),C):t},C.scaleExtent=function(D){return arguments.length?(o[0]=+D[0],o[1]=+D[1],C):[o[0],o[1]]},C.translateExtent=function(D){return arguments.length?(l[0][0]=+D[0][0],l[1][0]=+D[1][0],l[0][1]=+D[0][1],l[1][1]=+D[1][1],C):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},C.constrain=function(D){return arguments.length?(n=D,C):n},C.duration=function(D){return arguments.length?(c=+D,C):c},C.interpolate=function(D){return arguments.length?(u=D,C):u},C.on=function(){var D=f.on.apply(f,arguments);return D===f?C:D},C.clickDistance=function(D){return arguments.length?(S=(D=+D)*D,C):Math.sqrt(S)},C.tapDistance=function(D){return arguments.length?(E=+D,C):E},C}const ko={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Pp=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],L8=["Enter"," ","Escape"],D8={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var pf;(function(e){e.Strict="strict",e.Loose="loose"})(pf||(pf={}));var Zc;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Zc||(Zc={}));var zp;(function(e){e.Partial="partial",e.Full="full"})(zp||(zp={}));const j8={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ua;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ua||(ua={}));var lx;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(lx||(lx={}));var Ge;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ge||(Ge={}));const bL={[Ge.Left]:Ge.Right,[Ge.Right]:Ge.Left,[Ge.Top]:Ge.Bottom,[Ge.Bottom]:Ge.Top},P8=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,_ge=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),QT=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Fm=(e,t=[0,0])=>{const{width:n,height:r}=Io(e),s=e.origin??t,o=n*s[0],l=r*s[1];return{x:e.position.x-o,y:e.position.y-l}},Mge=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1;const r=e.reduce((s,o)=>{const l=typeof o=="string";let c=!t.nodeLookup&&!l?o:void 0;return t.nodeLookup&&(c=l?t.nodeLookup.get(o):QT(o)?o:t.nodeLookup.get(o.id)),c?(n=!0,Rb(s,ax(c,t.nodeOrigin))):s},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?Ob(r):{x:0,y:0,width:0,height:0}},$m=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(s=>{(t.filter===void 0||t.filter(s))&&(n=Rb(n,ax(s)),r=!0)}),r?Ob(n):{x:0,y:0,width:0,height:0}},ZT=(e,t,[n,r,s]=[0,0,1],o=!1,l=!1)=>{const c=(t.x-n)/s,u=(t.y-r)/s,f=t.width/s,h=t.height/s,p=[];for(const y of e.values()){const{measured:x,selectable:b=!0,hidden:S=!1}=y;if(l&&!b||S)continue;const E=x.width??y.width??y.initialWidth??0,C=x.height??y.height??y.initialHeight??0,{x:R,y:T}=y.internals.positionAbsolute,O=F8(c,u,f,h,R,T,E,C),k=E*C,M=o&&O>0;(!y.internals.handleBounds||M||O>=k||y.dragging)&&p.push(y)}return p},Ige=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Lge(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{let o;if(t!=null&&t.includeHiddenNodes){const{width:l,height:c}=Io(s);o=l>0&&c>0}else o=!!(s.measured.width&&s.measured.height&&!s.hidden);o&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function Dge({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:o},l){if(e.size===0)return!0;const c=Lge(e,l),u=$m(c),f=eN(u,t,n,(l==null?void 0:l.minZoom)??s,(l==null?void 0:l.maxZoom)??o,(l==null?void 0:l.padding)??.1);return await r.setViewport(f,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),!0}function z8({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:o}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:u,y:f}=c?c.internals.positionAbsolute:{x:0,y:0},h=l.origin??r;let p=l.extent||s;if(l.extent==="parent"&&!l.expandParent)if(!c)o==null||o("005",ko.error005());else{const{width:x,height:b}=Io(c);x&&b&&(p=[[u,f],[u+x,f+b]])}else c&&uu(l.extent)&&(p=[[l.extent[0][0]+u,l.extent[0][1]+f],[l.extent[1][0]+u,l.extent[1][1]+f]]);const y=uu(p)?cu(t,p,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&(o==null||o("015",ko.error015())),{position:{x:y.x-u+(l.measured.width??0)*h[0],y:y.y-f+(l.measured.height??0)*h[1]},positionAbsolute:y}}async function jge({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const o=new Set(e.map(y=>y.id)),l=[];for(const y of n){if(y.deletable===!1)continue;const x=o.has(y.id),b=!x&&y.parentId&&l.find(S=>S.id===y.parentId);(x||b)&&l.push(y)}const c=new Set(t.map(y=>y.id)),u=r.filter(y=>y.deletable!==!1),h=Ige(l,u);for(const y of u)c.has(y.id)&&!h.find(b=>b.id===y.id)&&h.push(y);if(!s)return{edges:h,nodes:l};const p=await s({nodes:l,edges:h});return typeof p=="boolean"?p?{edges:h,nodes:l}:{edges:[],nodes:[]}:p}const mf=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),cu=(e={x:0,y:0},t,n)=>({x:mf(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:mf(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function B8(e,t,n){const{width:r,height:s}=Io(n),{x:o,y:l}=n.internals.positionAbsolute;return cu(e,[[o,l],[o+r,l+s]],t)}const vL=(e,t,n)=>e<t?mf(Math.abs(e-t),1,t)/t:e>n?-mf(Math.abs(e-n),1,t)/t:0,JT=(e,t,n=15,r=40)=>{const s=vL(e.x,r,t.width-r)*n,o=vL(e.y,r,t.height-r)*n;return[s,o]},Rb=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),uC=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Ob=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Bp=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=QT(e)?e.internals.positionAbsolute:Fm(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},ax=(e,t=[0,0])=>{var s,o;const{x:n,y:r}=QT(e)?e.internals.positionAbsolute:Fm(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},H8=(e,t)=>Ob(Rb(uC(e),uC(t))),F8=(e,t,n,r,s,o,l,c)=>{const u=Math.max(0,Math.min(e+n,s+l)-Math.max(e,s)),f=Math.max(0,Math.min(t+r,o+c)-Math.max(t,o));return Math.ceil(u*f)},cx=(e,t)=>F8(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),SL=e=>To(e.width)&&To(e.height)&&To(e.x)&&To(e.y),To=e=>!isNaN(e)&&isFinite(e),$8=(e,t)=>(n,r)=>{},Um=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Vm=({x:e,y:t},[n,r,s],o=!1,l=[1,1])=>{const c={x:(e-n)/s,y:(t-r)/s};return o?Um(c,l):c},gf=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r});function gd(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Pge(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=gd(e,n),s=gd(e,t);return{top:r,right:s,bottom:r,left:s,x:s*2,y:r*2}}if(typeof e=="object"){const r=gd(e.top??e.y??0,n),s=gd(e.bottom??e.y??0,n),o=gd(e.left??e.x??0,t),l=gd(e.right??e.x??0,t);return{top:r,right:l,bottom:s,left:o,x:o+l,y:r+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function zge(e,t,n,r,s,o){const{x:l,y:c}=gf(e,[t,n,r]),{x:u,y:f}=gf({x:e.x+e.width,y:e.y+e.height},[t,n,r]),h=s-u,p=o-f;return{left:Math.floor(l),top:Math.floor(c),right:Math.floor(h),bottom:Math.floor(p)}}const eN=(e,t,n,r,s,o)=>{const l=Pge(o,t,n),c=(t-l.x)/e.width,u=(n-l.y)/e.height,f=Math.min(c,u),h=mf(f,r,s),p=e.x+e.width/2,y=e.y+e.height/2,x=t/2-p*h,b=n/2-y*h,S=zge(e,x,b,h,t,n),E={left:Math.min(S.left-l.left,0),top:Math.min(S.top-l.top,0),right:Math.min(S.right-l.right,0),bottom:Math.min(S.bottom-l.bottom,0)};return{x:x-E.left+E.right,y:b-E.top+E.bottom,zoom:h}},Hp=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function uu(e){return e!=null&&e!=="parent"}function Io(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function U8(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function V8(e,t={width:0,height:0},n,r,s){const o={...e},l=r.get(n);if(l){const c=l.origin||s;o.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],o.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return o}function wL(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Bge(){let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}function Hge(e){return{...D8,...e||{}}}function q8(e){return e===null?null:e?"valid":"invalid"}function dp(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:o,y:l}=No(e),c=Vm({x:o-((s==null?void 0:s.left)??0),y:l-((s==null?void 0:s.top)??0)},r),{x:u,y:f}=n?Um(c,t):c;return{xSnapped:u,ySnapped:f,...c}}const tN=e=>({width:e.offsetWidth,height:e.offsetHeight}),G8=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Fge=["INPUT","SELECT","TEXTAREA"];function K8(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Fge.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Y8=e=>"clientX"in e,No=(e,t)=>{var o,l;const n=Y8(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,s=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},EL=(e,t,n,r,s)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:s,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/r,y:(c.top-n.top)/r,...tN(l)}})};function W8({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:o,targetControlX:l,targetControlY:c}){const u=e*.125+s*.375+l*.375+n*.125,f=t*.125+o*.375+c*.375+r*.125,h=Math.abs(u-e),p=Math.abs(f-t);return[u,f,h,p]}function Y0(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function CL({pos:e,x1:t,y1:n,x2:r,y2:s,c:o}){switch(e){case Ge.Left:return[t-Y0(t-r,o),n];case Ge.Right:return[t+Y0(r-t,o),n];case Ge.Top:return[t,n-Y0(n-s,o)];case Ge.Bottom:return[t,n+Y0(s-n,o)]}}function X8({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:r,targetY:s,targetPosition:o=Ge.Top,curvature:l=.25}){const[c,u]=CL({pos:n,x1:e,y1:t,x2:r,y2:s,c:l}),[f,h]=CL({pos:o,x1:r,y1:s,x2:e,y2:t,c:l}),[p,y,x,b]=W8({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:c,sourceControlY:u,targetControlX:f,targetControlY:h});return[`M${e},${t} C${c},${u} ${f},${h} ${r},${s}`,p,y,x,b]}function Q8({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,o=n<e?n+s:n-s,l=Math.abs(r-t)/2,c=r<t?r+l:r-l;return[o,c,s,l]}function $ge({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:s=!1,zIndexMode:o="basic"}){if(o==="manual")return r;const l=s&&n?r+1e3:r,c=Math.max(e.parentId||s&&e.selected?e.internals.z:0,t.parentId||s&&t.selected?t.internals.z:0);return l+c}function Uge({sourceNode:e,targetNode:t,width:n,height:r,transform:s}){const o=Rb(ax(e),ax(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const l={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:r/s[2]};return cx(l,Ob(o))>0}const Vge=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,qge=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Gge=(e,t,n={})=>{var o;if(!e.source||!e.target)return(o=n.onError)==null||o.call(n,"006",ko.error006()),t;const r=n.getEdgeId||Vge;let s;return P8(e)?s={...e}:s={...e,id:r(e)},qge(s,t)?t:(s.sourceHandle===null&&delete s.sourceHandle,s.targetHandle===null&&delete s.targetHandle,t.concat(s))};function Z8({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,o,l,c]=Q8({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,o,l,c]}const TL={[Ge.Left]:{x:-1,y:0},[Ge.Right]:{x:1,y:0},[Ge.Top]:{x:0,y:-1},[Ge.Bottom]:{x:0,y:1}},Kge=({source:e,sourcePosition:t=Ge.Bottom,target:n})=>t===Ge.Left||t===Ge.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},NL=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Yge({source:e,sourcePosition:t=Ge.Bottom,target:n,targetPosition:r=Ge.Top,center:s,offset:o,stepPosition:l}){const c=TL[t],u=TL[r],f={x:e.x+c.x*o,y:e.y+c.y*o},h={x:n.x+u.x*o,y:n.y+u.y*o},p=Kge({source:f,sourcePosition:t,target:h}),y=p.x!==0?"x":"y",x=p[y];let b=[],S,E;const C={x:0,y:0},R={x:0,y:0},[,,T,O]=Q8({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[y]*u[y]===-1){y==="x"?(S=s.x??f.x+(h.x-f.x)*l,E=s.y??(f.y+h.y)/2):(S=s.x??(f.x+h.x)/2,E=s.y??f.y+(h.y-f.y)*l);const L=[{x:S,y:f.y},{x:S,y:h.y}],I=[{x:f.x,y:E},{x:h.x,y:E}];c[y]===x?b=y==="x"?L:I:b=y==="x"?I:L}else{const L=[{x:f.x,y:h.y}],I=[{x:h.x,y:f.y}];if(y==="x"?b=c.x===x?I:L:b=c.y===x?L:I,t===r){const D=Math.abs(e[y]-n[y]);if(D<=o){const F=Math.min(o-1,o-D);c[y]===x?C[y]=(f[y]>e[y]?-1:1)*F:R[y]=(h[y]>n[y]?-1:1)*F}}if(t!==r){const D=y==="x"?"y":"x",F=c[y]===u[D],z=f[D]>h[D],q=f[D]<h[D];(c[y]===1&&(!F&&z||F&&q)||c[y]!==1&&(!F&&q||F&&z))&&(b=y==="x"?L:I)}const j={x:f.x+C.x,y:f.y+C.y},P={x:h.x+R.x,y:h.y+R.y},B=Math.max(Math.abs(j.x-b[0].x),Math.abs(P.x-b[0].x)),H=Math.max(Math.abs(j.y-b[0].y),Math.abs(P.y-b[0].y));B>=H?(S=(j.x+P.x)/2,E=b[0].y):(S=b[0].x,E=(j.y+P.y)/2)}const k={x:f.x+C.x,y:f.y+C.y},M={x:h.x+R.x,y:h.y+R.y};return[[e,...k.x!==b[0].x||k.y!==b[0].y?[k]:[],...b,...M.x!==b[b.length-1].x||M.y!==b[b.length-1].y?[M]:[],n],S,E,T,O]}function Wge(e,t,n,r){const s=Math.min(NL(e,t)/2,NL(t,n)/2,r),{x:o,y:l}=t;if(e.x===o&&o===n.x||e.y===l&&l===n.y)return`L${o} ${l}`;if(e.y===l){const f=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${o+s*f},${l}Q ${o},${l} ${o},${l+s*h}`}const c=e.x<n.x?1:-1,u=e.y<n.y?-1:1;return`L ${o},${l+s*u}Q ${o},${l} ${o+s*c},${l}`}function dC({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:r,targetY:s,targetPosition:o=Ge.Top,borderRadius:l=5,centerX:c,centerY:u,offset:f=20,stepPosition:h=.5}){const[p,y,x,b,S]=Yge({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:s},targetPosition:o,center:{x:c,y:u},offset:f,stepPosition:h});let E=`M${p[0].x} ${p[0].y}`;for(let C=1;C<p.length-1;C++)E+=Wge(p[C-1],p[C],p[C+1],l);return E+=`L${p[p.length-1].x} ${p[p.length-1].y}`,[E,y,x,b,S]}function RL(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function Xge(e){var p;const{sourceNode:t,targetNode:n}=e;if(!RL(t)||!RL(n))return null;const r=t.internals.handleBounds||OL(t.handles),s=n.internals.handleBounds||OL(n.handles),o=AL((r==null?void 0:r.source)??[],e.sourceHandle),l=AL(e.connectionMode===pf.Strict?(s==null?void 0:s.target)??[]:((s==null?void 0:s.target)??[]).concat((s==null?void 0:s.source)??[]),e.targetHandle);if(!o||!l)return(p=e.onError)==null||p.call(e,"008",ko.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=(o==null?void 0:o.position)||Ge.Bottom,u=(l==null?void 0:l.position)||Ge.Top,f=du(t,o,c),h=du(n,l,u);return{sourceX:f.x,sourceY:f.y,targetX:h.x,targetY:h.y,sourcePosition:c,targetPosition:u}}function OL(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function du(e,t,n=Ge.Left,r=!1){const s=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??Io(e);if(r)return{x:s+l/2,y:o+c/2};switch((t==null?void 0:t.position)??n){case Ge.Top:return{x:s+l/2,y:o};case Ge.Right:return{x:s+l,y:o+c/2};case Ge.Bottom:return{x:s+l/2,y:o+c};case Ge.Left:return{x:s,y:o+c/2}}}function AL(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function fC(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Qge(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const o=new Set;return e.reduce((l,c)=>([c.markerStart||r,c.markerEnd||s].forEach(u=>{if(u&&typeof u=="object"){const f=fC(u,t);o.has(f)||(l.push({id:f,color:u.color||n,...u}),o.add(f))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const J8=1e3,Zge=10,nN={nodeOrigin:[0,0],nodeExtent:Pp,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},Jge={...nN,checkEquality:!0};function rN(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function e0e(e,t,n){const r=rN(nN,n);for(const s of e.values())if(s.parentId)oN(s,e,t,r);else{const o=Fm(s,r.nodeOrigin),l=uu(s.extent)?s.extent:r.nodeExtent,c=cu(o,l,Io(s));s.internals.positionAbsolute=c}}function t0e(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const s of e.handles){const o={id:s.id,width:s.width??1,height:s.height??1,nodeId:e.id,x:s.x,y:s.y,position:s.position,type:s.type};s.type==="source"?n.push(o):s.type==="target"&&r.push(o)}return{source:n,target:r}}function sN(e){return e==="manual"}function hC(e,t,n,r={}){var h,p;const s=rN(Jge,r),o={i:0},l=new Map(t),c=s!=null&&s.elevateNodesOnSelect&&!sN(s.zIndexMode)?J8:0;let u=e.length>0,f=!1;t.clear(),n.clear();for(const y of e){let x=l.get(y.id);if(s.checkEquality&&y===(x==null?void 0:x.internals.userNode))t.set(y.id,x);else{const b=Fm(y,s.nodeOrigin),S=uu(y.extent)?y.extent:s.nodeExtent,E=cu(b,S,Io(y));x={...s.defaults,...y,measured:{width:(h=y.measured)==null?void 0:h.width,height:(p=y.measured)==null?void 0:p.height},internals:{positionAbsolute:E,handleBounds:t0e(y,x),z:eH(y,c,s.zIndexMode),userNode:y}},t.set(y.id,x)}(x.measured===void 0||x.measured.width===void 0||x.measured.height===void 0)&&!x.hidden&&(u=!1),y.parentId&&oN(x,t,n,r,o),f||(f=y.selected??!1)}return{nodesInitialized:u,hasSelectedNodes:f}}function n0e(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function oN(e,t,n,r,s){const{elevateNodesOnSelect:o,nodeOrigin:l,nodeExtent:c,zIndexMode:u}=rN(nN,r),f=e.parentId,h=t.get(f);if(!h){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}n0e(e,n),s&&!h.parentId&&h.internals.rootParentIndex===void 0&&u==="auto"&&(h.internals.rootParentIndex=++s.i,h.internals.z=h.internals.z+s.i*Zge),s&&h.internals.rootParentIndex!==void 0&&(s.i=h.internals.rootParentIndex);const p=o&&!sN(u)?J8:0,{x:y,y:x,z:b}=r0e(e,h,l,c,p,u),{positionAbsolute:S}=e.internals,E=y!==S.x||x!==S.y;(E||b!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:E?{x:y,y:x}:S,z:b}})}function eH(e,t,n){const r=To(e.zIndex)?e.zIndex:0;return sN(n)?r:r+(e.selected?t:0)}function r0e(e,t,n,r,s,o){const{x:l,y:c}=t.internals.positionAbsolute,u=Io(e),f=Fm(e,n),h=uu(e.extent)?cu(f,e.extent,u):f;let p=cu({x:l+h.x,y:c+h.y},r,u);e.extent==="parent"&&(p=B8(p,u,t));const y=eH(e,s,o),x=t.internals.z??0;return{x:p.x,y:p.y,z:x>=y?x+1:y}}function iN(e,t,n,r=[0,0]){var l;const s=[],o=new Map;for(const c of e){const u=t.get(c.parentId);if(!u)continue;const f=((l=o.get(c.parentId))==null?void 0:l.expandedRect)??Bp(u),h=H8(f,c.rect);o.set(c.parentId,{expandedRect:h,parent:u})}return o.size>0&&o.forEach(({expandedRect:c,parent:u},f)=>{var T;const h=u.internals.positionAbsolute,p=Io(u),y=u.origin??r,x=c.x<h.x?Math.round(Math.abs(h.x-c.x)):0,b=c.y<h.y?Math.round(Math.abs(h.y-c.y)):0,S=Math.max(p.width,Math.round(c.width)),E=Math.max(p.height,Math.round(c.height)),C=(S-p.width)*y[0],R=(E-p.height)*y[1];(x>0||b>0||C||R)&&(s.push({id:f,type:"position",position:{x:u.position.x-x+C,y:u.position.y-b+R}}),(T=n.get(f))==null||T.forEach(O=>{e.some(k=>k.id===O.id)||s.push({id:O.id,type:"position",position:{x:O.position.x+x,y:O.position.y+b}})})),(p.width<c.width||p.height<c.height||x||b)&&s.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:S+(x?y[0]*x-C:0),height:E+(b?y[1]*b-R:0)}})}),s}function s0e(e,t,n,r,s,o,l){const c=r==null?void 0:r.querySelector(".xyflow__viewport");let u=!1;if(!c)return{changes:[],updatedInternals:u};const f=[],h=window.getComputedStyle(c),{m22:p}=new window.DOMMatrixReadOnly(h.transform),y=[];for(const x of e.values()){const b=t.get(x.id);if(!b)continue;if(b.hidden){t.set(b.id,{...b,internals:{...b.internals,handleBounds:void 0}}),u=!0;continue}const S=tN(x.nodeElement),E=b.measured.width!==S.width||b.measured.height!==S.height;if(!!(S.width&&S.height&&(E||!b.internals.handleBounds||x.force))){const R=x.nodeElement.getBoundingClientRect(),T=uu(b.extent)?b.extent:o;let{positionAbsolute:O}=b.internals;if(b.parentId&&b.extent==="parent"){const M=t.get(b.parentId);M&&(O=B8(O,S,M))}else T&&(O=cu(O,T,S));const k={...b,measured:S,internals:{...b.internals,positionAbsolute:O,handleBounds:{source:EL("source",x.nodeElement,R,p,b.id),target:EL("target",x.nodeElement,R,p,b.id)}}};t.set(b.id,k),b.parentId&&oN(k,t,n,{nodeOrigin:s,zIndexMode:l}),u=!0,E&&(f.push({id:b.id,type:"dimensions",dimensions:S}),b.expandParent&&b.parentId&&y.push({id:b.id,parentId:b.parentId,rect:Bp(k,s)}))}}if(y.length>0){const x=iN(y,t,n,s);f.push(...x)}return{changes:f,updatedInternals:u}}async function o0e({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:o}){if(!t||!e.x&&!e.y)return!1;const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,o]],r);return!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2])}function kL(e,t,n,r,s,o){let l=s;const c=r.get(l)||new Map;r.set(l,c.set(n,t)),l=`${s}-${e}`;const u=r.get(l)||new Map;if(r.set(l,u.set(n,t)),o){l=`${s}-${e}-${o}`;const f=r.get(l)||new Map;r.set(l,f.set(n,t))}}function tH(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:o,sourceHandle:l=null,targetHandle:c=null}=r,u={edgeId:r.id,source:s,target:o,sourceHandle:l,targetHandle:c},f=`${s}-${l}--${o}-${c}`,h=`${o}-${c}--${s}-${l}`;kL("source",u,h,e,s,l),kL("target",u,f,e,o,c),t.set(r.id,r)}}function nH(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:nH(n,t):!1}function _L(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function i0e(e,t,n,r){const s=new Map;for(const[o,l]of e)if((l.selected||l.id===r)&&(!l.parentId||!nH(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(o);c&&s.set(o,{id:o,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return s}function lw({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var l,c,u;const s=[];for(const[f,h]of t){const p=(l=n.get(f))==null?void 0:l.internals.userNode;p&&s.push({...p,position:h.position,dragging:r})}if(!e)return[s[0],s];const o=(c=n.get(e))==null?void 0:c.internals.userNode;return[o?{...o,position:((u=t.get(e))==null?void 0:u.position)||o.position,dragging:r}:s[0],s]}function l0e({dragItems:e,snapGrid:t,x:n,y:r}){const s=e.values().next().value;if(!s)return null;const o={x:n-s.distance.x,y:r-s.distance.y},l=Um(o,t);return{x:l.x-o.x,y:l.y-o.y}}function a0e({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let o={x:null,y:null},l=0,c=new Map,u=!1,f={x:0,y:0},h=null,p=!1,y=null,x=!1,b=!1,S=null;function E({noDragClassName:R,handleSelector:T,domNode:O,isSelectable:k,nodeId:M,nodeClickDistance:A=0}){y=zs(O);function L({x:B,y:H}){const{nodeLookup:D,nodeExtent:F,snapGrid:z,snapToGrid:q,nodeOrigin:V,onNodeDrag:G,onSelectionDrag:K,onError:X,updateNodePositions:ee}=t();o={x:B,y:H};let ae=!1;const $=c.size>1,Y=$&&F?uC($m(c)):null,J=$&&q?l0e({dragItems:c,snapGrid:z,x:B,y:H}):null;for(const[ne,W]of c){if(!D.has(ne))continue;let ce={x:B-W.distance.x,y:H-W.distance.y};q&&(ce=J?{x:Math.round(ce.x+J.x),y:Math.round(ce.y+J.y)}:Um(ce,z));let ye=null;if($&&F&&!W.extent&&Y){const{positionAbsolute:re}=W.internals,he=re.x-Y.x+F[0][0],Se=re.x+W.measured.width-Y.x2+F[1][0],_e=re.y-Y.y+F[0][1],be=re.y+W.measured.height-Y.y2+F[1][1];ye=[[he,_e],[Se,be]]}const{position:pe,positionAbsolute:le}=z8({nodeId:ne,nextPosition:ce,nodeLookup:D,nodeExtent:ye||F,nodeOrigin:V,onError:X});ae=ae||W.position.x!==pe.x||W.position.y!==pe.y,W.position=pe,W.internals.positionAbsolute=le}if(b=b||ae,!!ae&&(ee(c,!0),S&&(r||G||!M&&K))){const[ne,W]=lw({nodeId:M,dragItems:c,nodeLookup:D});r==null||r(S,c,ne,W),G==null||G(S,ne,W),M||K==null||K(S,W)}}async function I(){if(!h)return;const{transform:B,panBy:H,autoPanSpeed:D,autoPanOnNodeDrag:F}=t();if(!F){u=!1,cancelAnimationFrame(l);return}const[z,q]=JT(f,h,D);(z!==0||q!==0)&&(o.x=(o.x??0)-z/B[2],o.y=(o.y??0)-q/B[2],await H({x:z,y:q})&&L(o)),l=requestAnimationFrame(I)}function j(B){var $;const{nodeLookup:H,multiSelectionActive:D,nodesDraggable:F,transform:z,snapGrid:q,snapToGrid:V,selectNodesOnDrag:G,onNodeDragStart:K,onSelectionDragStart:X,unselectNodesAndEdges:ee}=t();p=!0,(!G||!k)&&!D&&M&&(($=H.get(M))!=null&&$.selected||ee()),k&&G&&M&&(e==null||e(M));const ae=dp(B.sourceEvent,{transform:z,snapGrid:q,snapToGrid:V,containerBounds:h});if(o=ae,c=i0e(H,F,ae,M),c.size>0&&(n||K||!M&&X)){const[Y,J]=lw({nodeId:M,dragItems:c,nodeLookup:H});n==null||n(B.sourceEvent,c,Y,J),K==null||K(B.sourceEvent,Y,J),M||X==null||X(B.sourceEvent,J)}}const P=x8().clickDistance(A).on("start",B=>{const{domNode:H,nodeDragThreshold:D,transform:F,snapGrid:z,snapToGrid:q}=t();h=(H==null?void 0:H.getBoundingClientRect())||null,x=!1,b=!1,S=B.sourceEvent,D===0&&j(B),o=dp(B.sourceEvent,{transform:F,snapGrid:z,snapToGrid:q,containerBounds:h}),f=No(B.sourceEvent,h)}).on("drag",B=>{const{autoPanOnNodeDrag:H,transform:D,snapGrid:F,snapToGrid:z,nodeDragThreshold:q,nodeLookup:V}=t(),G=dp(B.sourceEvent,{transform:D,snapGrid:F,snapToGrid:z,containerBounds:h});if(S=B.sourceEvent,(B.sourceEvent.type==="touchmove"&&B.sourceEvent.touches.length>1||M&&!V.has(M))&&(x=!0),!x){if(!u&&H&&p&&(u=!0,I()),!p){const K=No(B.sourceEvent,h),X=K.x-f.x,ee=K.y-f.y;Math.sqrt(X*X+ee*ee)>q&&j(B)}(o.x!==G.xSnapped||o.y!==G.ySnapped)&&c&&p&&(f=No(B.sourceEvent,h),L(G))}}).on("end",B=>{if(!p||x){x&&c.size>0&&t().updateNodePositions(c,!1);return}if(u=!1,p=!1,cancelAnimationFrame(l),c.size>0){const{nodeLookup:H,updateNodePositions:D,onNodeDragStop:F,onSelectionDragStop:z}=t();if(b&&(D(c,!1),b=!1),s||F||!M&&z){const[q,V]=lw({nodeId:M,dragItems:c,nodeLookup:H,dragging:!1});s==null||s(B.sourceEvent,c,q,V),F==null||F(B.sourceEvent,q,V),M||z==null||z(B.sourceEvent,V)}}}).filter(B=>{const H=B.target;return!B.button&&(!R||!_L(H,`.${R}`,O))&&(!T||_L(H,T,O))});y.call(P)}function C(){y==null||y.on(".drag",null)}return{update:E,destroy:C}}function c0e(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())cx(s,Bp(o))>0&&r.push(o);return r}const u0e=250;function d0e(e,t,n,r){var c,u;let s=[],o=1/0;const l=c0e(e,n,t+u0e);for(const f of l){const h=[...((c=f.internals.handleBounds)==null?void 0:c.source)??[],...((u=f.internals.handleBounds)==null?void 0:u.target)??[]];for(const p of h){if(r.nodeId===p.nodeId&&r.type===p.type&&r.id===p.id)continue;const{x:y,y:x}=du(f,p,p.position,!0),b=Math.sqrt(Math.pow(y-e.x,2)+Math.pow(x-e.y,2));b>t||(b<o?(s=[{...p,x:y,y:x}],o=b):b===o&&s.push({...p,x:y,y:x}))}}if(!s.length)return null;if(s.length>1){const f=r.type==="source"?"target":"source";return s.find(h=>h.type===f)??s[0]}return s[0]}function rH(e,t,n,r,s,o=!1){var f,h,p;const l=r.get(e);if(!l)return null;const c=s==="strict"?(f=l.internals.handleBounds)==null?void 0:f[t]:[...((h=l.internals.handleBounds)==null?void 0:h.source)??[],...((p=l.internals.handleBounds)==null?void 0:p.target)??[]],u=(n?c==null?void 0:c.find(y=>y.id===n):c==null?void 0:c[0])??null;return u&&o?{...u,...du(l,u,u.position,!0)}:u}function sH(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function f0e(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const oH=()=>!0;function h0e(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:o,isTarget:l,domNode:c,nodeLookup:u,lib:f,autoPanOnConnect:h,flowId:p,panBy:y,cancelConnection:x,onConnectStart:b,onConnect:S,onConnectEnd:E,isValidConnection:C=oH,onReconnectEnd:R,updateConnection:T,getTransform:O,getFromHandle:k,autoPanSpeed:M,dragThreshold:A=1,handleDomNode:L}){const I=G8(e.target);let j=0,P;const{x:B,y:H}=No(e),D=sH(o,L),F=c==null?void 0:c.getBoundingClientRect();let z=!1;if(!F||!D)return;const q=rH(s,D,r,u,t);if(!q)return;let V=No(e,F),G=!1,K=null,X=!1,ee=null;function ae(){if(!h||!F)return;const[pe,le]=JT(V,F,M);y({x:pe,y:le}),j=requestAnimationFrame(ae)}const $={...q,nodeId:s,type:D,position:q.position},Y=u.get(s);let ne={inProgress:!0,isValid:null,from:du(Y,$,Ge.Left,!0),fromHandle:$,fromPosition:$.position,fromNode:Y,to:V,toHandle:null,toPosition:bL[$.position],toNode:null,pointer:V};function W(){z=!0,T(ne),b==null||b(e,{nodeId:s,handleId:r,handleType:D})}A===0&&W();function ce(pe){if(!z){const{x:be,y:Ae}=No(pe),Me=be-B,Le=Ae-H;if(!(Me*Me+Le*Le>A*A))return;W()}if(!k()||!$){ye(pe);return}const le=O();V=No(pe,F),P=d0e(Vm(V,le,!1,[1,1]),n,u,$),G||(ae(),G=!0);const re=iH(pe,{handle:P,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:l?"target":"source",isValidConnection:C,doc:I,lib:f,flowId:p,nodeLookup:u});ee=re.handleDomNode,K=re.connection,X=f0e(!!P,re.isValid);const he=u.get(s),Se=he?du(he,$,Ge.Left,!0):ne.from,_e={...ne,from:Se,isValid:X,to:re.toHandle&&X?gf({x:re.toHandle.x,y:re.toHandle.y},le):V,toHandle:re.toHandle,toPosition:X&&re.toHandle?re.toHandle.position:bL[$.position],toNode:re.toHandle?u.get(re.toHandle.nodeId):null,pointer:V};T(_e),ne=_e}function ye(pe){if(!("touches"in pe&&pe.touches.length>0)){if(z){(P||ee)&&K&&X&&(S==null||S(K));const{inProgress:le,...re}=ne,he={...re,toPosition:ne.toHandle?ne.toPosition:null};E==null||E(pe,he),o&&(R==null||R(pe,he))}x(),cancelAnimationFrame(j),G=!1,X=!1,K=null,ee=null,I.removeEventListener("mousemove",ce),I.removeEventListener("mouseup",ye),I.removeEventListener("touchmove",ce),I.removeEventListener("touchend",ye)}}I.addEventListener("mousemove",ce),I.addEventListener("mouseup",ye),I.addEventListener("touchmove",ce),I.addEventListener("touchend",ye)}function iH(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:o,doc:l,lib:c,flowId:u,isValidConnection:f=oH,nodeLookup:h}){const p=o==="target",y=t?l.querySelector(`.${c}-flow__handle[data-id="${u}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x,y:b}=No(e),S=l.elementFromPoint(x,b),E=S!=null&&S.classList.contains(`${c}-flow__handle`)?S:y,C={handleDomNode:E,isValid:!1,connection:null,toHandle:null};if(E){const R=sH(void 0,E),T=E.getAttribute("data-nodeid"),O=E.getAttribute("data-handleid"),k=E.classList.contains("connectable"),M=E.classList.contains("connectableend");if(!T||!R)return C;const A={source:p?T:r,sourceHandle:p?O:s,target:p?r:T,targetHandle:p?s:O};C.connection=A;const I=k&&M&&(n===pf.Strict?p&&R==="source"||!p&&R==="target":T!==r||O!==s);C.isValid=I&&f(A),C.toHandle=rH(T,R,O,h,n,!0)}return C}const pC={onPointerDown:h0e,isValid:iH};function p0e({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=zs(e);function o({translateExtent:c,width:u,height:f,zoomStep:h=1,pannable:p=!0,zoomable:y=!0,inversePan:x=!1}){const b=T=>{if(T.sourceEvent.type!=="wheel"||!t)return;const O=n(),k=T.sourceEvent.ctrlKey&&Hp()?10:1,M=-T.sourceEvent.deltaY*(T.sourceEvent.deltaMode===1?.05:T.sourceEvent.deltaMode?1:.002)*h,A=O[2]*Math.pow(2,M*k);t.scaleTo(A)};let S=[0,0];const E=T=>{(T.sourceEvent.type==="mousedown"||T.sourceEvent.type==="touchstart")&&(S=[T.sourceEvent.clientX??T.sourceEvent.touches[0].clientX,T.sourceEvent.clientY??T.sourceEvent.touches[0].clientY])},C=T=>{const O=n();if(T.sourceEvent.type!=="mousemove"&&T.sourceEvent.type!=="touchmove"||!t)return;const k=[T.sourceEvent.clientX??T.sourceEvent.touches[0].clientX,T.sourceEvent.clientY??T.sourceEvent.touches[0].clientY],M=[k[0]-S[0],k[1]-S[1]];S=k;const A=r()*Math.max(O[2],Math.log(O[2]))*(x?-1:1),L={x:O[0]-M[0]*A,y:O[1]-M[1]*A},I=[[0,0],[u,f]];t.setViewportConstrained({x:L.x,y:L.y,zoom:O[2]},I,c)},R=I8().on("start",E).on("zoom",p?C:null).on("zoom.wheel",y?b:null);s.call(R,{})}function l(){s.on("zoom",null)}return{update:o,destroy:l,pointer:wo}}const Ab=e=>({x:e.x,y:e.y,zoom:e.k}),aw=({x:e,y:t,zoom:n})=>Nb.translate(e,t).scale(n),la=(e,t)=>e.target.closest(`.${t}`),lH=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),m0e=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,cw=(e,t=0,n=m0e,r=()=>{})=>{const s=typeof t=="number"&&t>0;return s||r(),s?e.transition().duration(t).ease(n).on("end",r):e},aH=e=>{const t=e.ctrlKey&&Hp()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function g0e({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:o,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:f}){return h=>{if(la(h,t))return h.ctrlKey&&h.preventDefault(),!1;h.preventDefault(),h.stopImmediatePropagation();const p=n.property("__zoom").k||1;if(h.ctrlKey&&l){const E=wo(h),C=aH(h),R=p*Math.pow(2,C);r.scaleTo(n,R,E,h);return}const y=h.deltaMode===1?20:1;let x=s===Zc.Vertical?0:h.deltaX*y,b=s===Zc.Horizontal?0:h.deltaY*y;!Hp()&&h.shiftKey&&s!==Zc.Vertical&&(x=h.deltaY*y,b=0),r.translateBy(n,-(x/p)*o,-(b/p)*o,{internal:!0});const S=Ab(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?u==null||u(h,S):(e.isPanScrolling=!0,c==null||c(h,S)),e.panScrollTimeout=setTimeout(()=>{f==null||f(h,S),e.isPanScrolling=!1},150)}}function y0e({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){const o=r.type==="wheel",l=!t&&o&&!r.ctrlKey,c=la(r,e);if(r.ctrlKey&&o&&c&&r.preventDefault(),l||c)return null;r.preventDefault(),n.call(this,r,s)}}function x0e({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,l,c;if((o=r.sourceEvent)!=null&&o.internal)return;const s=Ab(r.transform);e.mouseButton=((l=r.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((c=r.sourceEvent)==null?void 0:c.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function b0e({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return o=>{var l,c;e.usedRightMouseButton=!!(n&&lH(t,e.mouseButton??0)),(l=o.sourceEvent)!=null&&l.sync||r([o.transform.x,o.transform.y,o.transform.k]),s&&!((c=o.sourceEvent)!=null&&c.internal)&&(s==null||s(o.sourceEvent,Ab(o.transform)))}}function v0e({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:o}){return l=>{var c;if(!((c=l.sourceEvent)!=null&&c.internal)&&(e.isZoomingOrPanning=!1,o&&lH(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&o(l.sourceEvent),e.usedRightMouseButton=!1,r(!1),s)){const u=Ab(l.transform);e.prevViewport=u,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(l.sourceEvent,u)},n?150:0)}}}function S0e({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:s,panOnScroll:o,zoomOnDoubleClick:l,userSelectionActive:c,noWheelClassName:u,noPanClassName:f,lib:h,connectionInProgress:p}){return y=>{var C;const x=t||n,b=r&&y.ctrlKey,S=y.type==="wheel";if(y.button===1&&y.type==="mousedown"&&(la(y,`${h}-flow__node`)||la(y,`${h}-flow__edge`)||la(y,`${h}-flow__selection`)||la(y,`${h}-flow__nodesselection`)))return!0;if(!s&&!x&&!o&&!l&&!r||c||p&&!S||la(y,u)&&S||la(y,f)&&(!S||o&&S&&!t)||!r&&y.ctrlKey&&S)return!1;if(!r&&y.type==="touchstart"&&((C=y.touches)==null?void 0:C.length)>1)return y.preventDefault(),!1;if(!x&&!o&&!b&&S||!s&&(y.type==="mousedown"||y.type==="touchstart")||Array.isArray(s)&&!s.includes(y.button)&&y.type==="mousedown")return!1;const E=Array.isArray(s)&&s.includes(y.button)||!y.button||y.button<=1;return(!y.ctrlKey||S||e)&&E}}function w0e({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:s,onPanZoom:o,onPanZoomStart:l,onPanZoomEnd:c,onDraggingChange:u}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect();let p=[[0,0],[h.width,h.height]];const y=typeof ResizeObserver<"u"?new ResizeObserver(H=>{const D=H[0];D&&(p=[[0,0],[D.contentRect.width,D.contentRect.height]])}):null;y==null||y.observe(e);const x=I8().extent(()=>p).scaleExtent([t,n]).translateExtent(r),b=zs(e).call(x);O({x:s.x,y:s.y,zoom:mf(s.zoom,t,n)},[[0,0],[h.width,h.height]],r);const S=b.on("wheel.zoom"),E=b.on("dblclick.zoom");x.wheelDelta(aH);async function C(H,D){return b?new Promise(F=>{x==null||x.interpolate((D==null?void 0:D.interpolate)==="linear"?up:Ey).transform(cw(b,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>F(!0)),H)}):!1}function R({noWheelClassName:H,noPanClassName:D,onPaneContextMenu:F,userSelectionActive:z,panOnScroll:q,panOnDrag:V,panOnScrollMode:G,panOnScrollSpeed:K,preventScrolling:X,zoomOnPinch:ee,zoomOnScroll:ae,zoomOnDoubleClick:$,panActivationKeyPressed:Y=!1,zoomActivationKeyPressed:J,lib:ne,onTransformChange:W,connectionInProgress:ce,paneClickDistance:ye,selectionOnDrag:pe}){z&&!f.isZoomingOrPanning&&T();const le=q&&!J&&!z;x.clickDistance(pe?1/0:!To(ye)||ye<0?0:ye);const re=le?g0e({zoomPanValues:f,noWheelClassName:H,d3Selection:b,d3Zoom:x,panOnScrollMode:G,panOnScrollSpeed:K,zoomOnPinch:ee,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:c}):y0e({noWheelClassName:H,preventScrolling:X,d3ZoomHandler:S});b.on("wheel.zoom",re,{passive:!1});const he=x0e({zoomPanValues:f,onDraggingChange:u,onPanZoomStart:l});x.on("start",he);const Se=b0e({zoomPanValues:f,panOnDrag:V,onPaneContextMenu:!!F,onPanZoom:o,onTransformChange:W});x.on("zoom",Se);const _e=v0e({zoomPanValues:f,panOnDrag:V,panOnScroll:q,onPaneContextMenu:F,onPanZoomEnd:c,onDraggingChange:u});x.on("end",_e);const be=S0e({panActivationKeyPressed:Y,zoomActivationKeyPressed:J,panOnDrag:V,zoomOnScroll:ae,panOnScroll:q,zoomOnDoubleClick:$,zoomOnPinch:ee,userSelectionActive:z,noPanClassName:D,noWheelClassName:H,lib:ne,connectionInProgress:ce});x.filter(be),$?b.on("dblclick.zoom",E):b.on("dblclick.zoom",null)}function T(){x.on("zoom",null)}async function O(H,D,F){const z=aw(H),q=x==null?void 0:x.constrain()(z,D,F);return q&&await C(q),q}async function k(H,D){const F=aw(H);return await C(F,D),F}function M(H){if(b){const D=aw(H),F=b.property("__zoom");(F.k!==H.zoom||F.x!==H.x||F.y!==H.y)&&(x==null||x.transform(b,D,null,{sync:!0}))}}function A(){const H=b?M8(b.node()):{x:0,y:0,k:1};return{x:H.x,y:H.y,zoom:H.k}}async function L(H,D){return b?new Promise(F=>{x==null||x.interpolate((D==null?void 0:D.interpolate)==="linear"?up:Ey).scaleTo(cw(b,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>F(!0)),H)}):!1}async function I(H,D){return b?new Promise(F=>{x==null||x.interpolate((D==null?void 0:D.interpolate)==="linear"?up:Ey).scaleBy(cw(b,D==null?void 0:D.duration,D==null?void 0:D.ease,()=>F(!0)),H)}):!1}function j(H){x==null||x.scaleExtent(H)}function P(H){x==null||x.translateExtent(H)}function B(H){const D=!To(H)||H<0?0:H;x==null||x.clickDistance(D)}return{update:R,destroy:T,setViewport:k,setViewportConstrained:O,getViewport:A,scaleTo:L,scaleBy:I,setScaleExtent:j,setTranslateExtent:P,syncViewport:M,setClickDistance:B}}var yf;(function(e){e.Line="line",e.Handle="handle"})(yf||(yf={}));function E0e({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:o}){const l=e-t,c=n-r,u=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&s&&(u[0]=u[0]*-1),c&&o&&(u[1]=u[1]*-1),u}function ML(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function na(e,t){return Math.max(0,t-e)}function ra(e,t){return Math.max(0,e-t)}function W0(e,t,n){return Math.max(0,t-e,e-n)}function IL(e,t){return e?!t:t}function C0e(e,t,n,r,s,o,l,c){let{affectsX:u,affectsY:f}=t;const{isHorizontal:h,isVertical:p}=t,y=h&&p,{xSnapped:x,ySnapped:b}=n,{minWidth:S,maxWidth:E,minHeight:C,maxHeight:R}=r,{x:T,y:O,width:k,height:M,aspectRatio:A}=e;let L=Math.floor(h?x-e.pointerX:0),I=Math.floor(p?b-e.pointerY:0);const j=k+(u?-L:L),P=M+(f?-I:I),B=-o[0]*k,H=-o[1]*M;let D=W0(j,S,E),F=W0(P,C,R);if(l){let V=0,G=0;u&&L<0?V=na(T+L+B,l[0][0]):!u&&L>0&&(V=ra(T+j+B,l[1][0])),f&&I<0?G=na(O+I+H,l[0][1]):!f&&I>0&&(G=ra(O+P+H,l[1][1])),D=Math.max(D,V),F=Math.max(F,G)}if(c){let V=0,G=0;u&&L>0?V=ra(T+L,c[0][0]):!u&&L<0&&(V=na(T+j,c[1][0])),f&&I>0?G=ra(O+I,c[0][1]):!f&&I<0&&(G=na(O+P,c[1][1])),D=Math.max(D,V),F=Math.max(F,G)}if(s){if(h){const V=W0(j/A,C,R)*A;if(D=Math.max(D,V),l){let G=0;!u&&!f||u&&!f&&y?G=ra(O+H+j/A,l[1][1])*A:G=na(O+H+(u?L:-L)/A,l[0][1])*A,D=Math.max(D,G)}if(c){let G=0;!u&&!f||u&&!f&&y?G=na(O+j/A,c[1][1])*A:G=ra(O+(u?L:-L)/A,c[0][1])*A,D=Math.max(D,G)}}if(p){const V=W0(P*A,S,E)/A;if(F=Math.max(F,V),l){let G=0;!u&&!f||f&&!u&&y?G=ra(T+P*A+B,l[1][0])/A:G=na(T+(f?I:-I)*A+B,l[0][0])/A,F=Math.max(F,G)}if(c){let G=0;!u&&!f||f&&!u&&y?G=na(T+P*A,c[1][0])/A:G=ra(T+(f?I:-I)*A,c[0][0])/A,F=Math.max(F,G)}}}I=I+(I<0?F:-F),L=L+(L<0?D:-D),s&&(y?j>P*A?I=(IL(u,f)?-L:L)/A:L=(IL(u,f)?-I:I)*A:h?(I=L/A,f=u):(L=I*A,u=f));const z=u?T+L:T,q=f?O+I:O;return{width:k+(u?-L:L),height:M+(f?-I:I),x:o[0]*L*(u?-1:1)+z,y:o[1]*I*(f?-1:1)+q}}const cH={width:0,height:0,x:0,y:0},T0e={...cH,pointerX:0,pointerY:0,aspectRatio:1};function N0e(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,o=e.measured.width??0,l=e.measured.height??0,c=n[0]*o,u=n[1]*l;return[[r-c,s-u],[r+o-c,s+l-u]]}function R0e({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const o=zs(e);let l={controlDirection:ML("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function c({controlPosition:f,boundaries:h,keepAspectRatio:p,resizeDirection:y,onResizeStart:x,onResize:b,onResizeEnd:S,shouldResize:E}){let C={...cH},R={...T0e};l={boundaries:h,resizeDirection:y,keepAspectRatio:p,controlDirection:ML(f)};let T,O=null,k=[],M,A,L,I=!1;const j=x8().on("start",P=>{const{nodeLookup:B,transform:H,snapGrid:D,snapToGrid:F,nodeOrigin:z,paneDomNode:q}=n();if(T=B.get(t),!T)return;O=(q==null?void 0:q.getBoundingClientRect())??null;const{xSnapped:V,ySnapped:G}=dp(P.sourceEvent,{transform:H,snapGrid:D,snapToGrid:F,containerBounds:O});C={width:T.measured.width??0,height:T.measured.height??0,x:T.position.x??0,y:T.position.y??0},R={...C,pointerX:V,pointerY:G,aspectRatio:C.width/C.height},M=void 0,A=uu(T.extent)?T.extent:void 0,T.parentId&&(T.extent==="parent"||T.expandParent)&&(M=B.get(T.parentId)),M&&T.extent==="parent"&&(A=[[0,0],[M.measured.width,M.measured.height]]),k=[],L=void 0;for(const[K,X]of B)if(X.parentId===t&&(k.push({id:K,position:{...X.position},extent:X.extent}),X.extent==="parent"||X.expandParent)){const ee=N0e(X,T,X.origin??z);L?L=[[Math.min(ee[0][0],L[0][0]),Math.min(ee[0][1],L[0][1])],[Math.max(ee[1][0],L[1][0]),Math.max(ee[1][1],L[1][1])]]:L=ee}x==null||x(P,{...C})}).on("drag",P=>{const{transform:B,snapGrid:H,snapToGrid:D,nodeOrigin:F}=n(),z=dp(P.sourceEvent,{transform:B,snapGrid:H,snapToGrid:D,containerBounds:O}),q=[];if(!T)return;const{x:V,y:G,width:K,height:X}=C,ee={},ae=T.origin??F,{width:$,height:Y,x:J,y:ne}=C0e(R,l.controlDirection,z,l.boundaries,l.keepAspectRatio,ae,A,L),W=$!==K,ce=Y!==X,ye=J!==V&&W,pe=ne!==G&&ce;if(!ye&&!pe&&!W&&!ce)return;if((ye||pe||ae[0]===1||ae[1]===1)&&(ee.x=ye?J:C.x,ee.y=pe?ne:C.y,C.x=ee.x,C.y=ee.y,k.length>0)){const Se=J-V,_e=ne-G;for(const be of k)be.position={x:be.position.x-Se+ae[0]*($-K),y:be.position.y-_e+ae[1]*(Y-X)},q.push(be)}if((W||ce)&&(ee.width=W&&(!l.resizeDirection||l.resizeDirection==="horizontal")?$:C.width,ee.height=ce&&(!l.resizeDirection||l.resizeDirection==="vertical")?Y:C.height,C.width=ee.width,C.height=ee.height),M&&T.expandParent){const Se=ae[0]*(ee.width??0);ee.x&&ee.x<Se&&(C.x=Se,R.x=R.x-(ee.x-Se));const _e=ae[1]*(ee.height??0);ee.y&&ee.y<_e&&(C.y=_e,R.y=R.y-(ee.y-_e))}const le=E0e({width:C.width,prevWidth:K,height:C.height,prevHeight:X,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),re={...C,direction:le};(E==null?void 0:E(P,re))!==!1&&(I=!0,b==null||b(P,re),r(ee,q))}).on("end",P=>{I&&(S==null||S(P,{...C}),s==null||s({...C}),I=!1)});o.call(j)}function u(){o.on(".drag",null)}return{update:c,destroy:u}}const O0e={},LL=e=>{let t;const n=new Set,r=(h,p)=>{const y=typeof h=="function"?h(t):h;if(!Object.is(y,t)){const x=t;t=p??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(b=>b(t,x))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>f,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(O0e?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,s,u);return u},A0e=e=>e?LL(e):LL,{useDebugValue:k0e}=si,{useSyncExternalStoreWithSelector:_0e}=IG,M0e=e=>e;function uH(e,t=M0e,n){const r=_0e(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return k0e(r),r}const DL=(e,t)=>{const n=A0e(e),r=(s,o=t)=>uH(n,s,o);return Object.assign(r,n),r},I0e=(e,t)=>e?DL(e,t):DL;function Cn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const kb=N.createContext(null),L0e=kb.Provider,dH=ko.error001("react");function Mt(e,t){const n=N.useContext(kb);if(n===null)throw new Error(dH);return uH(n,e,t)}function an(){const e=N.useContext(kb);if(e===null)throw new Error(dH);return N.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const jL={display:"none"},D0e={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},fH="react-flow__node-desc",hH="react-flow__edge-desc",j0e="react-flow__aria-live",P0e=e=>e.ariaLiveMessage,z0e=e=>e.ariaLabelConfig;function B0e({rfId:e}){const t=Mt(P0e);return g.jsx("div",{id:`${j0e}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:D0e,children:t})}function H0e({rfId:e,disableKeyboardA11y:t}){const n=Mt(z0e);return g.jsxs(g.Fragment,{children:[g.jsx("div",{id:`${fH}-${e}`,style:jL,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),g.jsx("div",{id:`${hH}-${e}`,style:jL,children:n["edge.a11yDescription.default"]}),!t&&g.jsx(B0e,{rfId:e})]})}const _b=N.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},o)=>{const l=`${e}`.split("-");return g.jsx("div",{className:Vn(["react-flow__panel",n,...l]),style:r,ref:o,...s,children:t})});_b.displayName="Panel";const PL="https://reactflow.dev?utm_source=attribution";function F0e({proOptions:e,position:t="bottom-right"}){return N.useEffect(()=>{},[]),e!=null&&e.hideAttribution?null:g.jsx(_b,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${PL}`,children:g.jsx("a",{href:PL,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const $0e=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},X0=e=>e.id;function U0e(e,t){return Cn(e.selectedNodes.map(X0),t.selectedNodes.map(X0))&&Cn(e.selectedEdges.map(X0),t.selectedEdges.map(X0))}function V0e({onSelectionChange:e}){const t=an(),{selectedNodes:n,selectedEdges:r}=Mt($0e,U0e);return N.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(o=>o(s))},[n,r,e]),null}const q0e=e=>!!e.onSelectionChangeHandlers;function G0e({onSelectionChange:e}){const t=Mt(q0e);return e||t?g.jsx(V0e,{onSelectionChange:e}):null}const pH=[0,0],K0e={x:0,y:0,zoom:1},Y0e=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],zL=[...Y0e,"rfId"],W0e=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),BL={translateExtent:Pp,nodeOrigin:pH,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function X0e(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:o,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:u}=Mt(W0e,Cn),f=an();N.useEffect(()=>(u(e.defaultNodes,e.defaultEdges),()=>{h.current=BL,c()}),[]);const h=N.useRef(BL);return N.useEffect(()=>{for(const p of zL){const y=e[p],x=h.current[p];y!==x&&(typeof e[p]>"u"||(p==="nodes"?t(y):p==="edges"?n(y):p==="minZoom"?r(y):p==="maxZoom"?s(y):p==="translateExtent"?o(y):p==="nodeExtent"?l(y):p==="ariaLabelConfig"?f.setState({ariaLabelConfig:Hge(y)}):p==="fitView"?f.setState({fitViewQueued:y}):p==="fitViewOptions"?f.setState({fitViewOptions:y}):f.setState({[p]:y})))}h.current=e},zL.map(p=>e[p])),null}function HL(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function Q0e(e){var r;const[t,n]=N.useState(e==="system"?null:e);return N.useEffect(()=>{if(e!=="system"){n(e);return}const s=HL(),o=()=>n(s!=null&&s.matches?"dark":"light");return o(),s==null||s.addEventListener("change",o),()=>{s==null||s.removeEventListener("change",o)}},[e]),t!==null?t:(r=HL())!=null&&r.matches?"dark":"light"}const FL=typeof document<"u"?document:null;function Fp(e=null,t={target:FL,actInsideInputWithModifier:!0}){const[n,r]=N.useState(!1),s=N.useRef(!1),o=N.useRef(new Set([])),[l,c]=N.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.replace(/\+/g,`
|
|
354
|
-
`).replace(`
|
|
355
|
-
|
|
356
|
-
`,`
|
|
357
|
-
+`).split(`
|
|
358
|
-
`)),h=f.reduce((p,y)=>p.concat(...y),[]);return[f,h]}return[[],[]]},[e]);return N.useEffect(()=>{const u=(t==null?void 0:t.target)??FL,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const h=x=>{var E,C;if(s.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!s.current||s.current&&!f)&&K8(x))return!1;const S=UL(x.code,c);if(o.current.add(x[S]),$L(l,o.current,!1)){const R=((C=(E=x.composedPath)==null?void 0:E.call(x))==null?void 0:C[0])||x.target,T=(R==null?void 0:R.nodeName)==="BUTTON"||(R==null?void 0:R.nodeName)==="A";t.preventDefault!==!1&&(s.current||!T)&&x.preventDefault(),r(!0)}},p=x=>{const b=UL(x.code,c);$L(l,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(x[b]),x.key==="Meta"&&o.current.clear(),s.current=!1},y=()=>{o.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",h),u==null||u.addEventListener("keyup",p),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{u==null||u.removeEventListener("keydown",h),u==null||u.removeEventListener("keyup",p),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[e,r]),n}function $L(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function UL(e,t){return t.includes(e)?"code":"key"}const Z0e=()=>{const e=an();return N.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,o],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??o},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:o,maxZoom:l,panZoom:c}=e.getState(),u=eN(t,r,s,o,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(u,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:s,snapToGrid:o,domNode:l}=e.getState();if(!l)return t;const{x:c,y:u}=l.getBoundingClientRect(),f={x:t.x-c,y:t.y-u},h=n.snapGrid??s,p=n.snapToGrid??o;return Vm(f,r,p,h)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:o}=r.getBoundingClientRect(),l=gf(t,n);return{x:l.x+s,y:l.y+o}}}),[])};function mH(e,t){const n=[],r=new Map,s=[];for(const o of e)if(o.type==="add"){s.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const l=r.get(o.id);l?l.push(o):r.set(o.id,[o])}for(const o of t){const l=r.get(o.id);if(!l){n.push(o);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...o};for(const u of l)J0e(u,c);n.push(c)}return s.length&&s.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function J0e(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function eye(e,t){return mH(e,t)}function tye(e,t){return mH(e,t)}function Mc(e,t){return{id:e,type:"select",selected:t}}function Od(e,t=new Set,n=!1){const r=[];for(const[s,o]of e){const l=t.has(s);!(o.selected===void 0&&!l)&&o.selected!==l&&(n&&(o.selected=l),r.push(Mc(o.id,l)))}return r}function VL({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,l]of e.entries()){const c=t.get(l.id),u=((s=c==null?void 0:c.internals)==null?void 0:s.userNode)??c;u!==void 0&&u!==l&&n.push({id:l.id,item:l,type:"replace"}),u===void 0&&n.push({item:l,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function qL(e){return{id:e.id,type:"remove"}}const nye=$8();function rye(e,t,n={}){return Gge(e,t,{...n,onError:n.onError??nye})}const GL=e=>_ge(e),sye=e=>P8(e);function gH(e){return N.forwardRef(e)}const yH=typeof window<"u"?N.useLayoutEffect:N.useEffect;function KL(e){const[t,n]=N.useState(BigInt(0)),[r]=N.useState(()=>oye(()=>n(s=>s+BigInt(1))));return yH(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function oye(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const xH=N.createContext(null);function iye({children:e}){const t=an(),n=N.useCallback(c=>{const{nodes:u=[],setNodes:f,hasDefaultNodes:h,onNodesChange:p,nodeLookup:y,fitViewQueued:x,onNodesChangeMiddlewareMap:b}=t.getState();let S=u;for(const C of c)S=typeof C=="function"?C(S):C;let E=VL({items:S,lookup:y});for(const C of b.values())E=C(E);h&&f(S),E.length>0?p==null||p(E):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:C,nodes:R,setNodes:T}=t.getState();C&&T(R)})},[]),r=KL(n),s=N.useCallback(c=>{const{edges:u=[],setEdges:f,hasDefaultEdges:h,onEdgesChange:p,edgeLookup:y}=t.getState();let x=u;for(const b of c)x=typeof b=="function"?b(x):b;h?f(x):p&&p(VL({items:x,lookup:y}))},[]),o=KL(s),l=N.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return g.jsx(xH.Provider,{value:l,children:e})}function lye(){const e=N.useContext(xH);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const aye=e=>!!e.panZoom;function Mb(){const e=Z0e(),t=an(),n=lye(),r=Mt(aye),s=N.useMemo(()=>{const o=p=>t.getState().nodeLookup.get(p),l=p=>{n.nodeQueue.push(p)},c=p=>{n.edgeQueue.push(p)},u=p=>{var C,R;const{nodeLookup:y,nodeOrigin:x}=t.getState(),b=GL(p)?p:y.get(p.id),S=b.parentId?V8(b.position,b.measured,b.parentId,y,x):b.position,E={...b,position:S,width:((C=b.measured)==null?void 0:C.width)??b.width,height:((R=b.measured)==null?void 0:R.height)??b.height};return Bp(E)},f=(p,y,x={replace:!1})=>{l(b=>b.map(S=>{if(S.id===p){const E=typeof y=="function"?y(S):y;return x.replace&&GL(E)?E:{...S,...E}}return S}))},h=(p,y,x={replace:!1})=>{c(b=>b.map(S=>{if(S.id===p){const E=typeof y=="function"?y(S):y;return x.replace&&sye(E)?E:{...S,...E}}return S}))};return{getNodes:()=>t.getState().nodes.map(p=>({...p})),getNode:p=>{var y;return(y=o(p))==null?void 0:y.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:p=[]}=t.getState();return p.map(y=>({...y}))},getEdge:p=>t.getState().edgeLookup.get(p),setNodes:l,setEdges:c,addNodes:p=>{const y=Array.isArray(p)?p:[p];n.nodeQueue.push(x=>[...x,...y])},addEdges:p=>{const y=Array.isArray(p)?p:[p];n.edgeQueue.push(x=>[...x,...y])},toObject:()=>{const{nodes:p=[],edges:y=[],transform:x}=t.getState(),[b,S,E]=x;return{nodes:p.map(C=>({...C})),edges:y.map(C=>({...C})),viewport:{x:b,y:S,zoom:E}}},deleteElements:async({nodes:p=[],edges:y=[]})=>{const{nodes:x,edges:b,onNodesDelete:S,onEdgesDelete:E,triggerNodeChanges:C,triggerEdgeChanges:R,onDelete:T,onBeforeDelete:O}=t.getState(),{nodes:k,edges:M}=await jge({nodesToRemove:p,edgesToRemove:y,nodes:x,edges:b,onBeforeDelete:O}),A=M.length>0,L=k.length>0;if(A){const I=M.map(qL);E==null||E(M),R(I)}if(L){const I=k.map(qL);S==null||S(k),C(I)}return(L||A)&&(T==null||T({nodes:k,edges:M})),{deletedNodes:k,deletedEdges:M}},getIntersectingNodes:(p,y=!0,x)=>{const b=SL(p),S=b?p:u(p),E=x!==void 0;return S?(x||t.getState().nodes).filter(C=>{const R=t.getState().nodeLookup.get(C.id);if(R&&!b&&(C.id===p.id||!R.internals.positionAbsolute))return!1;const T=Bp(E?C:R),O=cx(T,S);return y&&O>0||O>=T.width*T.height||O>=S.width*S.height}):[]},isNodeIntersecting:(p,y,x=!0)=>{const S=SL(p)?p:u(p);if(!S)return!1;const E=cx(S,y);return x&&E>0||E>=y.width*y.height||E>=S.width*S.height},updateNode:f,updateNodeData:(p,y,x={replace:!1})=>{f(p,b=>{const S=typeof y=="function"?y(b):y;return x.replace?{...b,data:S}:{...b,data:{...b.data,...S}}},x)},updateEdge:h,updateEdgeData:(p,y,x={replace:!1})=>{h(p,b=>{const S=typeof y=="function"?y(b):y;return x.replace?{...b,data:S}:{...b,data:{...b.data,...S}}},x)},getNodesBounds:p=>{const{nodeLookup:y,nodeOrigin:x}=t.getState();return Mge(p,{nodeLookup:y,nodeOrigin:x})},getHandleConnections:({type:p,id:y,nodeId:x})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${x}-${p}${y?`-${y}`:""}`))==null?void 0:b.values())??[])},getNodeConnections:({type:p,handleId:y,nodeId:x})=>{var b;return Array.from(((b=t.getState().connectionLookup.get(`${x}${p?y?`-${p}-${y}`:`-${p}`:""}`))==null?void 0:b.values())??[])},fitView:async p=>{const y=t.getState().fitViewResolver??Bge();return t.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:y}),n.nodeQueue.push(x=>[...x]),y.promise}}},[]);return N.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const YL=e=>e.selected,cye=typeof window<"u"?window:void 0;function uye({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=an(),{deleteElements:r}=Mb(),s=Fp(e,{actInsideInputWithModifier:!1}),o=Fp(t,{target:cye});N.useEffect(()=>{if(s){const{edges:l,nodes:c}=n.getState();r({nodes:c.filter(YL),edges:l.filter(YL)}),n.setState({nodesSelectionActive:!1})}},[s]),N.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function dye(e){const t=an();N.useEffect(()=>{const n=()=>{var s,o,l,c;if(!e.current||!(((o=(s=e.current).checkVisibility)==null?void 0:o.call(s))??!0))return!1;const r=tN(e.current);(r.height===0||r.width===0)&&((c=(l=t.getState()).onError)==null||c.call(l,"004",ko.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Ib={position:"absolute",width:"100%",height:"100%",top:0,left:0},fye=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function hye({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:s,panOnScrollSpeed:o=.5,panOnScrollMode:l=Zc.Free,zoomOnDoubleClick:c=!0,panOnDrag:u=!0,defaultViewport:f,translateExtent:h,minZoom:p,maxZoom:y,zoomActivationKeyCode:x,preventScrolling:b=!0,children:S,noWheelClassName:E,noPanClassName:C,onViewportChange:R,isControlledViewport:T,paneClickDistance:O,selectionOnDrag:k}){const M=an(),A=N.useRef(null),{userSelectionActive:L,lib:I,connectionInProgress:j}=Mt(fye,Cn),P=Fp(x),B=N.useRef();dye(A);const H=N.useCallback(D=>{R==null||R({x:D[0],y:D[1],zoom:D[2]}),T||M.setState({transform:D})},[R,T]);return N.useEffect(()=>{if(A.current){B.current=w0e({domNode:A.current,minZoom:p,maxZoom:y,translateExtent:h,viewport:f,onDraggingChange:q=>M.setState(V=>V.paneDragging===q?V:{paneDragging:q}),onPanZoomStart:(q,V)=>{const{onViewportChangeStart:G,onMoveStart:K}=M.getState();K==null||K(q,V),G==null||G(V)},onPanZoom:(q,V)=>{const{onViewportChange:G,onMove:K}=M.getState();K==null||K(q,V),G==null||G(V)},onPanZoomEnd:(q,V)=>{const{onViewportChangeEnd:G,onMoveEnd:K}=M.getState();K==null||K(q,V),G==null||G(V)}});const{x:D,y:F,zoom:z}=B.current.getViewport();return M.setState({panZoom:B.current,transform:[D,F,z],domNode:A.current.closest(".react-flow")}),()=>{var q;(q=B.current)==null||q.destroy()}}},[]),N.useEffect(()=>{var D;(D=B.current)==null||D.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:s,panOnScrollSpeed:o,panOnScrollMode:l,zoomOnDoubleClick:c,panOnDrag:u,zoomActivationKeyPressed:P,preventScrolling:b,noPanClassName:C,userSelectionActive:L,noWheelClassName:E,lib:I,onTransformChange:H,connectionInProgress:j,selectionOnDrag:k,paneClickDistance:O})},[e,t,n,r,s,o,l,c,u,P,b,C,L,E,I,H,j,k,O]),g.jsx("div",{className:"react-flow__renderer",ref:A,style:Ib,children:S})}const pye=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function mye(){const{userSelectionActive:e,userSelectionRect:t}=Mt(pye,Cn);return e&&t?g.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const uw=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},gye=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function yye({isSelecting:e,selectionKeyPressed:t,selectionMode:n=zp.Full,panOnDrag:r,autoPanOnSelection:s,paneClickDistance:o,selectionOnDrag:l,onSelectionStart:c,onSelectionEnd:u,onPaneClick:f,onPaneContextMenu:h,onPaneScroll:p,onPaneMouseEnter:y,onPaneMouseMove:x,onPaneMouseLeave:b,children:S}){const E=N.useRef(0),C=an(),{userSelectionActive:R,elementsSelectable:T,dragging:O,panBy:k,autoPanSpeed:M}=Mt(gye,Cn),A=T&&(e||R),L=N.useRef(null),I=N.useRef(),j=N.useRef(new Set),P=N.useRef(new Set),B=N.useRef(!1),H=N.useRef(!1),D=N.useRef({x:0,y:0}),F=N.useRef(!1),z=W=>{if(H.current||B.current||C.getState().connection.inProgress){H.current=!1,B.current=!1;return}f==null||f(W),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},q=W=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){W.preventDefault();return}h==null||h(W)},V=p?W=>p(W):void 0,G=W=>{H.current&&(W.stopPropagation(),H.current=!1)},K=W=>{var be,Ae;if(W.pointerType==="touch"&&r!==!1&&!t)return;const{domNode:ce,transform:ye}=C.getState();if(I.current=ce==null?void 0:ce.getBoundingClientRect(),!I.current)return;const pe=W.target===L.current;if(!pe&&!!W.target.closest(".nokey")||!e||!(l&&pe||t)||W.button!==0||!W.isPrimary)return;(Ae=(be=W.target)==null?void 0:be.setPointerCapture)==null||Ae.call(be,W.pointerId),H.current=!1;const{x:he,y:Se}=No(W.nativeEvent,I.current),_e=Vm({x:he,y:Se},ye);C.setState({userSelectionRect:{width:0,height:0,startX:_e.x,startY:_e.y,x:he,y:Se}}),pe||(W.stopPropagation(),W.preventDefault())};function X(W,ce){const{userSelectionRect:ye}=C.getState();if(!ye)return;const{transform:pe,nodeLookup:le,edgeLookup:re,connectionLookup:he,triggerNodeChanges:Se,triggerEdgeChanges:_e,defaultEdgeOptions:be}=C.getState(),Ae={x:ye.startX,y:ye.startY},{x:Me,y:Le}=gf(Ae,pe),ue={startX:Ae.x,startY:Ae.y,x:W<Me?W:Me,y:ce<Le?ce:Le,width:Math.abs(W-Me),height:Math.abs(ce-Le)},Re=j.current,ze=P.current;j.current=new Set(ZT(le,ue,pe,n===zp.Partial,!0).map(je=>je.id)),P.current=new Set;const ke=(be==null?void 0:be.selectable)??!0;for(const je of j.current){const Ne=he.get(je);if(Ne)for(const{edgeId:ve}of Ne.values()){const Fe=re.get(ve);Fe&&(Fe.selectable??ke)&&P.current.add(ve)}}if(!wL(Re,j.current)){const je=Od(le,j.current,!0);Se(je)}if(!wL(ze,P.current)){const je=Od(re,P.current);_e(je)}C.setState({userSelectionRect:ue,userSelectionActive:!0,nodesSelectionActive:!1})}function ee(){if(!s||!I.current)return;const[W,ce]=JT(D.current,I.current,M);k({x:W,y:ce}).then(ye=>{if(!H.current||!ye){E.current=requestAnimationFrame(ee);return}const{x:pe,y:le}=D.current;X(pe,le),E.current=requestAnimationFrame(ee)})}const ae=()=>{cancelAnimationFrame(E.current),E.current=0,F.current=!1};N.useEffect(()=>()=>ae(),[]);const $=W=>{const{userSelectionRect:ce,transform:ye,resetSelectedElements:pe}=C.getState();if(!I.current||!ce)return;const{x:le,y:re}=No(W.nativeEvent,I.current);D.current={x:le,y:re};const he=gf({x:ce.startX,y:ce.startY},ye);if(!H.current){const Se=t?0:o;if(Math.hypot(le-he.x,re-he.y)<=Se)return;pe(),c==null||c(W)}H.current=!0,F.current||(ee(),F.current=!0),X(le,re)},Y=W=>{var ce,ye;if(!A){W.target===L.current&&C.getState().connection.inProgress&&(B.current=!0);return}W.button===0&&((ye=(ce=W.target)==null?void 0:ce.releasePointerCapture)==null||ye.call(ce,W.pointerId),!R&&W.target===L.current&&C.getState().userSelectionRect&&(z==null||z(W)),C.setState({userSelectionActive:!1,userSelectionRect:null}),H.current&&(u==null||u(W),C.setState({nodesSelectionActive:j.current.size>0})),ae())},J=W=>{var ce,ye;(ye=(ce=W.target)==null?void 0:ce.releasePointerCapture)==null||ye.call(ce,W.pointerId),ae()},ne=r===!0||Array.isArray(r)&&r.includes(0);return g.jsxs("div",{className:Vn(["react-flow__pane",{draggable:ne,dragging:O,selection:e}]),onClick:A?void 0:uw(z,L),onContextMenu:uw(q,L),onWheel:uw(V,L),onPointerEnter:A?void 0:y,onPointerMove:A?$:x,onPointerUp:Y,onPointerCancel:A?J:void 0,onPointerDownCapture:A?K:void 0,onClickCapture:A?G:void 0,onPointerLeave:b,ref:L,style:Ib,children:[S,g.jsx(mye,{})]})}function mC({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:o,multiSelectionActive:l,nodeLookup:c,onError:u}=t.getState(),f=c.get(e);if(!f){u==null||u("012",ko.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&l)&&(o({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):s([e])}function bH({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:o,nodeClickDistance:l}){const c=an(),[u,f]=N.useState(!1),h=N.useRef();return N.useEffect(()=>{if(!t)return h.current=a0e({getStoreItems:()=>c.getState(),onNodeMouseDown:p=>{mC({id:p,store:c,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}}),()=>{var p;(p=h.current)==null||p.destroy(),h.current=void 0}},[t,c,e]),N.useEffect(()=>{t||!e.current||!h.current||h.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:s,nodeClickDistance:l})},[n,r,t,o,e,s,l]),u}const xye=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function vH(){const e=an();return N.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:o,nodesDraggable:l,onError:c,updateNodePositions:u,nodeLookup:f,nodeOrigin:h}=e.getState(),p=new Map,y=xye(l),x=s?o[0]:5,b=s?o[1]:5,S=n.direction.x*x*n.factor,E=n.direction.y*b*n.factor;for(const[,C]of f){if(!y(C))continue;let R={x:C.internals.positionAbsolute.x+S,y:C.internals.positionAbsolute.y+E};s&&(R=Um(R,o));const{position:T,positionAbsolute:O}=z8({nodeId:C.id,nextPosition:R,nodeLookup:f,nodeExtent:r,nodeOrigin:h,onError:c});C.position=T,C.internals.positionAbsolute=O,p.set(C.id,C)}u(p)},[])}const lN=N.createContext(null),bye=lN.Provider;lN.Consumer;const SH=()=>N.useContext(lN),vye=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),wH=N.createContext(null);function Sye({children:e}){const t=Mt(vye,Cn);return g.jsx(wH.Provider,{value:t,children:e})}function wye(){const e=N.useContext(wH);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const Eye={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},Cye=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:o,connection:l}=r,{fromHandle:c,toHandle:u,isValid:f}=l;if(!c&&!s)return Eye;const h=(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n,connectingTo:h,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:o===pf.Strict?(c==null?void 0:c.type)!==n:e!==(c==null?void 0:c.nodeId)||t!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!s,valid:h&&f}};function Tye({type:e="source",position:t=Ge.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:o=!0,id:l,onConnect:c,children:u,className:f,onMouseDown:h,onTouchStart:p,...y},x){var F,z;const b=l||null,S=e==="target",E=an(),C=SH(),{connectOnClick:R,noPanClassName:T,rfId:O}=wye(),{connectingFrom:k,connectingTo:M,clickConnecting:A,isPossibleEndHandle:L,connectionInProcess:I,clickConnectionInProcess:j,valid:P}=Mt(Cye(C,b,e),Cn);C||(z=(F=E.getState()).onError)==null||z.call(F,"010",ko.error010());const B=q=>{const{defaultEdgeOptions:V,onConnect:G,hasDefaultEdges:K}=E.getState(),X={...V,...q};if(K){const{edges:ee,setEdges:ae,onError:$}=E.getState();ae(rye(X,ee,{onError:$}))}G==null||G(X),c==null||c(X)},H=q=>{if(!C)return;const V=Y8(q.nativeEvent);if(s&&(V&&q.button===0||!V)){const G=E.getState();pC.onPointerDown(q.nativeEvent,{handleDomNode:q.currentTarget,autoPanOnConnect:G.autoPanOnConnect,connectionMode:G.connectionMode,connectionRadius:G.connectionRadius,domNode:G.domNode,nodeLookup:G.nodeLookup,lib:G.lib,isTarget:S,handleId:b,nodeId:C,flowId:G.rfId,panBy:G.panBy,cancelConnection:G.cancelConnection,onConnectStart:G.onConnectStart,onConnectEnd:(...K)=>{var X,ee;return(ee=(X=E.getState()).onConnectEnd)==null?void 0:ee.call(X,...K)},updateConnection:G.updateConnection,onConnect:B,isValidConnection:n||((...K)=>{var X,ee;return((ee=(X=E.getState()).isValidConnection)==null?void 0:ee.call(X,...K))??!0}),getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,autoPanSpeed:G.autoPanSpeed,dragThreshold:G.connectionDragThreshold})}V?h==null||h(q):p==null||p(q)},D=q=>{const{onClickConnectStart:V,onClickConnectEnd:G,connectionClickStartHandle:K,connectionMode:X,isValidConnection:ee,lib:ae,rfId:$,nodeLookup:Y,connection:J}=E.getState();if(!C||!K&&!s)return;if(!K){V==null||V(q.nativeEvent,{nodeId:C,handleId:b,handleType:e}),E.setState({connectionClickStartHandle:{nodeId:C,type:e,id:b}});return}const ne=G8(q.target),W=n||ee,{connection:ce,isValid:ye}=pC.isValid(q.nativeEvent,{handle:{nodeId:C,id:b,type:e},connectionMode:X,fromNodeId:K.nodeId,fromHandleId:K.id||null,fromType:K.type,isValidConnection:W,flowId:$,doc:ne,lib:ae,nodeLookup:Y});ye&&ce&&B(ce);const pe=structuredClone(J);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,G==null||G(q,pe),E.setState({connectionClickStartHandle:null})};return g.jsx("div",{"data-handleid":b,"data-nodeid":C,"data-handlepos":t,"data-id":`${O}-${C}-${b}-${e}`,className:Vn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",T,f,{source:!S,target:S,connectable:r,connectablestart:s,connectableend:o,clickconnecting:A,connectingfrom:k,connectingto:M,valid:P,connectionindicator:r&&(!I||L)&&(I||j?o:s)}]),onMouseDown:H,onTouchStart:H,onClick:R?D:void 0,ref:x,...y,children:u})}const fu=N.memo(gH(Tye));function Nye({data:e,isConnectable:t,sourcePosition:n=Ge.Bottom}){return g.jsxs(g.Fragment,{children:[e==null?void 0:e.label,g.jsx(fu,{type:"source",position:n,isConnectable:t})]})}function Rye({data:e,isConnectable:t,targetPosition:n=Ge.Top,sourcePosition:r=Ge.Bottom}){return g.jsxs(g.Fragment,{children:[g.jsx(fu,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,g.jsx(fu,{type:"source",position:r,isConnectable:t})]})}function Oye(){return null}function Aye({data:e,isConnectable:t,targetPosition:n=Ge.Top}){return g.jsxs(g.Fragment,{children:[g.jsx(fu,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const ux={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},WL={input:Nye,default:Rye,output:Aye,group:Oye};function kye(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const _ye=e=>{const{width:t,height:n,x:r,y:s}=$m(e.nodeLookup,{filter:o=>!!o.selected});return{width:To(t)?t:null,height:To(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function Mye({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=an(),{width:s,height:o,transformString:l,userSelectionActive:c}=Mt(_ye,Cn),u=vH(),f=N.useRef(null);N.useEffect(()=>{var x;n||(x=f.current)==null||x.focus({preventScroll:!0})},[n]);const h=!c&&s!==null&&o!==null;if(bH({nodeRef:f,disabled:!h}),!h)return null;const p=e?x=>{const b=r.getState().nodes.filter(S=>S.selected);e(x,b)}:void 0,y=x=>{Object.prototype.hasOwnProperty.call(ux,x.key)&&(x.preventDefault(),u({direction:ux[x.key],factor:x.shiftKey?4:1}))};return g.jsx("div",{className:Vn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:g.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:y,style:{width:s,height:o}})})}const XL=typeof window<"u"?window:void 0,Iye=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function EH({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:u,selectionKeyCode:f,selectionOnDrag:h,selectionMode:p,onSelectionStart:y,onSelectionEnd:x,multiSelectionKeyCode:b,panActivationKeyCode:S,zoomActivationKeyCode:E,elementsSelectable:C,zoomOnScroll:R,zoomOnPinch:T,panOnScroll:O,panOnScrollSpeed:k,panOnScrollMode:M,zoomOnDoubleClick:A,panOnDrag:L,autoPanOnSelection:I,defaultViewport:j,translateExtent:P,minZoom:B,maxZoom:H,preventScrolling:D,onSelectionContextMenu:F,noWheelClassName:z,noPanClassName:q,disableKeyboardA11y:V,onViewportChange:G,isControlledViewport:K}){const{nodesSelectionActive:X,userSelectionActive:ee}=Mt(Iye,Cn),ae=Fp(f,{target:XL}),$=Fp(S,{target:XL}),Y=$||L,J=$||O,ne=h&&Y!==!0,W=ae||ee||ne;return uye({deleteKeyCode:u,multiSelectionKeyCode:b}),g.jsx(hye,{onPaneContextMenu:o,elementsSelectable:C,zoomOnScroll:R,zoomOnPinch:T,panOnScroll:J,panActivationKeyPressed:$,panOnScrollSpeed:k,panOnScrollMode:M,zoomOnDoubleClick:A,panOnDrag:!ae&&Y,defaultViewport:j,translateExtent:P,minZoom:B,maxZoom:H,zoomActivationKeyCode:E,preventScrolling:D,noWheelClassName:z,noPanClassName:q,onViewportChange:G,isControlledViewport:K,paneClickDistance:c,selectionOnDrag:ne,children:g.jsxs(yye,{onSelectionStart:y,onSelectionEnd:x,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:o,onPaneScroll:l,panOnDrag:Y,autoPanOnSelection:I,isSelecting:!!W,selectionMode:p,selectionKeyPressed:ae,paneClickDistance:c,selectionOnDrag:ne,children:[e,X&&g.jsx(Mye,{onSelectionContextMenu:F,noPanClassName:q,disableKeyboardA11y:V})]})})}EH.displayName="FlowRenderer";const Lye=N.memo(EH),Dye=e=>t=>e?ZT(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function jye(e){return Mt(N.useCallback(Dye(e),[e]),Cn)}const Pye=e=>e.updateNodeInternals;function zye(){const e=Mt(Pye),[t]=N.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const o=s.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:s.target,force:!0})}),e(r)}));return N.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function Bye({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=an(),o=N.useRef(null),l=N.useRef(null),c=N.useRef(e.sourcePosition),u=N.useRef(e.targetPosition),f=N.useRef(t),h=n&&!!e.internals.handleBounds;return N.useEffect(()=>{o.current&&!e.hidden&&(!h||l.current!==o.current)&&(l.current&&(r==null||r.unobserve(l.current)),r==null||r.observe(o.current),l.current=o.current)},[h,e.hidden]),N.useEffect(()=>()=>{l.current&&(r==null||r.unobserve(l.current),l.current=null)},[]),N.useEffect(()=>{if(o.current){const p=f.current!==t,y=c.current!==e.sourcePosition,x=u.current!==e.targetPosition;(p||y||x)&&(f.current=t,c.current=e.sourcePosition,u.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function Hye({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:o,onDoubleClick:l,nodesDraggable:c,elementsSelectable:u,nodesConnectable:f,nodesFocusable:h,resizeObserver:p,noDragClassName:y,noPanClassName:x,disableKeyboardA11y:b,rfId:S,nodeTypes:E,nodeClickDistance:C,onError:R}){const{node:T,internals:O,isParent:k}=Mt(W=>{const ce=W.nodeLookup.get(e),ye=W.parentLookup.has(e);return{node:ce,internals:ce.internals,isParent:ye}},Cn);let M=T.type||"default",A=(E==null?void 0:E[M])||WL[M];A===void 0&&(R==null||R("003",ko.error003(M)),M="default",A=(E==null?void 0:E.default)||WL.default);const L=!!(T.draggable||c&&typeof T.draggable>"u"),I=!!(T.selectable||u&&typeof T.selectable>"u"),j=!!(T.connectable||f&&typeof T.connectable>"u"),P=!!(T.focusable||h&&typeof T.focusable>"u"),B=an(),H=U8(T),D=Bye({node:T,nodeType:M,hasDimensions:H,resizeObserver:p}),F=bH({nodeRef:D,disabled:T.hidden||!L,noDragClassName:y,handleSelector:T.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:C}),z=vH();if(T.hidden)return null;const q=Io(T),V=kye(T),G=I||L||t||n||r||s,K=n?W=>n(W,{...O.userNode}):void 0,X=r?W=>r(W,{...O.userNode}):void 0,ee=s?W=>s(W,{...O.userNode}):void 0,ae=o?W=>o(W,{...O.userNode}):void 0,$=l?W=>l(W,{...O.userNode}):void 0,Y=W=>{const{selectNodesOnDrag:ce,nodeDragThreshold:ye}=B.getState();I&&(!ce||!L||ye>0)&&mC({id:e,store:B,nodeRef:D}),t&&t(W,{...O.userNode})},J=W=>{if(!(K8(W.nativeEvent)||b)){if(L8.includes(W.key)&&I){const ce=W.key==="Escape";mC({id:e,store:B,unselect:ce,nodeRef:D})}else if(L&&T.selected&&Object.prototype.hasOwnProperty.call(ux,W.key)){W.preventDefault();const{ariaLabelConfig:ce}=B.getState();B.setState({ariaLiveMessage:ce["node.a11yDescription.ariaLiveMessage"]({direction:W.key.replace("Arrow","").toLowerCase(),x:~~O.positionAbsolute.x,y:~~O.positionAbsolute.y})}),z({direction:ux[W.key],factor:W.shiftKey?4:1})}}},ne=()=>{var he;if(b||!((he=D.current)!=null&&he.matches(":focus-visible")))return;const{transform:W,width:ce,height:ye,autoPanOnNodeFocus:pe,setCenter:le}=B.getState();if(!pe)return;ZT(new Map([[e,T]]),{x:0,y:0,width:ce,height:ye},W,!0).length>0||le(T.position.x+q.width/2,T.position.y+q.height/2,{zoom:W[2]})};return g.jsx("div",{className:Vn(["react-flow__node",`react-flow__node-${M}`,{[x]:L},T.className,{selected:T.selected,selectable:I,parent:k,draggable:L,dragging:F}]),ref:D,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:G?"all":"none",visibility:H?"visible":"hidden",...T.style,...V},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:K,onMouseMove:X,onMouseLeave:ee,onContextMenu:ae,onClick:Y,onDoubleClick:$,onKeyDown:P?J:void 0,tabIndex:P?0:void 0,onFocus:P?ne:void 0,role:T.ariaRole??(P?"group":void 0),"aria-roledescription":"node","aria-describedby":b?void 0:`${fH}-${S}`,"aria-label":T.ariaLabel,...T.domAttributes,children:g.jsx(bye,{value:e,children:g.jsx(A,{id:e,data:T.data,type:M,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:T.selected??!1,selectable:I,draggable:L,deletable:T.deletable??!0,isConnectable:j,sourcePosition:T.sourcePosition,targetPosition:T.targetPosition,dragging:F,dragHandle:T.dragHandle,zIndex:O.z,parentId:T.parentId,...q})})})}var Fye=N.memo(Hye);const $ye=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function CH(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:s}=Mt($ye,Cn),o=jye(e.onlyRenderVisibleElements),l=zye();return g.jsx("div",{className:"react-flow__nodes",style:Ib,children:o.map(c=>g.jsx(Fye,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:s},c))})}CH.displayName="NodeRenderer";const Uye=N.memo(CH);function Vye(e){return Mt(N.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const o=n.nodeLookup.get(s.source),l=n.nodeLookup.get(s.target);o&&l&&Uge({sourceNode:o,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),Cn)}const qye=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return g.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Gye=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return g.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},QL={[lx.Arrow]:qye,[lx.ArrowClosed]:Gye};function Kye(e){const t=an();return N.useMemo(()=>{var s,o;return Object.prototype.hasOwnProperty.call(QL,e)?QL[e]:((o=(s=t.getState()).onError)==null||o.call(s,"009",ko.error009(e)),null)},[e])}const Yye=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:o="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const u=Kye(t);return u?g.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:c,refX:"0",refY:"0",children:g.jsx(u,{color:n,strokeWidth:l})}):null},TH=({defaultColor:e,rfId:t})=>{const n=Mt(o=>o.edges),r=Mt(o=>o.defaultEdgeOptions),s=N.useMemo(()=>Qge(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?g.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:g.jsx("defs",{children:s.map(o=>g.jsx(Yye,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};TH.displayName="MarkerDefinitions";var Wye=N.memo(TH);function NH({x:e,y:t,label:n,labelStyle:r,labelShowBg:s=!0,labelBgStyle:o,labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:u,className:f,...h}){const[p,y]=N.useState({x:1,y:0,width:0,height:0}),x=Vn(["react-flow__edge-textwrapper",f]),b=N.useRef(null);return N.useEffect(()=>{if(b.current){const S=b.current.getBBox();y({x:S.x,y:S.y,width:S.width,height:S.height})}},[n]),n?g.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:x,visibility:p.width?"visible":"hidden",...h,children:[s&&g.jsx("rect",{width:p.width+2*l[0],x:-l[0],y:-l[1],height:p.height+2*l[1],className:"react-flow__edge-textbg",style:o,rx:c,ry:c}),g.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:b,style:r,children:n}),u]}):null}NH.displayName="EdgeText";const Xye=N.memo(NH);function Lb({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,interactionWidth:f=20,...h}){return g.jsxs(g.Fragment,{children:[g.jsx("path",{...h,d:e,fill:"none",className:Vn(["react-flow__edge-path",h.className])}),f?g.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&To(t)&&To(n)?g.jsx(Xye,{x:t,y:n,label:r,labelStyle:s,labelShowBg:o,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null]})}function ZL({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===Ge.Left||e===Ge.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function RH({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:r,targetY:s,targetPosition:o=Ge.Top}){const[l,c]=ZL({pos:n,x1:e,y1:t,x2:r,y2:s}),[u,f]=ZL({pos:o,x1:r,y1:s,x2:e,y2:t}),[h,p,y,x]=W8({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:f});return[`M${e},${t} C${l},${c} ${u},${f} ${r},${s}`,h,p,y,x]}function OH(e){return N.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:l,targetPosition:c,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:x,style:b,markerEnd:S,markerStart:E,interactionWidth:C})=>{const[R,T,O]=RH({sourceX:n,sourceY:r,sourcePosition:l,targetX:s,targetY:o,targetPosition:c}),k=e.isInternal?void 0:t;return g.jsx(Lb,{id:k,path:R,labelX:T,labelY:O,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:x,style:b,markerEnd:S,markerStart:E,interactionWidth:C})})}const Qye=OH({isInternal:!1}),AH=OH({isInternal:!0});Qye.displayName="SimpleBezierEdge";AH.displayName="SimpleBezierEdgeInternal";function kH(e){return N.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:y,sourcePosition:x=Ge.Bottom,targetPosition:b=Ge.Top,markerEnd:S,markerStart:E,pathOptions:C,interactionWidth:R})=>{const[T,O,k]=dC({sourceX:n,sourceY:r,sourcePosition:x,targetX:s,targetY:o,targetPosition:b,borderRadius:C==null?void 0:C.borderRadius,offset:C==null?void 0:C.offset,stepPosition:C==null?void 0:C.stepPosition}),M=e.isInternal?void 0:t;return g.jsx(Lb,{id:M,path:T,labelX:O,labelY:k,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:y,markerEnd:S,markerStart:E,interactionWidth:R})})}const _H=kH({isInternal:!1}),MH=kH({isInternal:!0});_H.displayName="SmoothStepEdge";MH.displayName="SmoothStepEdgeInternal";function IH(e){return N.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return g.jsx(_H,{...n,id:r,pathOptions:N.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const Zye=IH({isInternal:!1}),LH=IH({isInternal:!0});Zye.displayName="StepEdge";LH.displayName="StepEdgeInternal";function DH(e){return N.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:b,interactionWidth:S})=>{const[E,C,R]=Z8({sourceX:n,sourceY:r,targetX:s,targetY:o}),T=e.isInternal?void 0:t;return g.jsx(Lb,{id:T,path:E,labelX:C,labelY:R,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:b,interactionWidth:S})})}const Jye=DH({isInternal:!1}),jH=DH({isInternal:!0});Jye.displayName="StraightEdge";jH.displayName="StraightEdgeInternal";function PH(e){return N.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:o,sourcePosition:l=Ge.Bottom,targetPosition:c=Ge.Top,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:x,style:b,markerEnd:S,markerStart:E,pathOptions:C,interactionWidth:R})=>{const[T,O,k]=X8({sourceX:n,sourceY:r,sourcePosition:l,targetX:s,targetY:o,targetPosition:c,curvature:C==null?void 0:C.curvature}),M=e.isInternal?void 0:t;return g.jsx(Lb,{id:M,path:T,labelX:O,labelY:k,label:u,labelStyle:f,labelShowBg:h,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:x,style:b,markerEnd:S,markerStart:E,interactionWidth:R})})}const exe=PH({isInternal:!1}),zH=PH({isInternal:!0});exe.displayName="BezierEdge";zH.displayName="BezierEdgeInternal";const JL={default:zH,straight:jH,step:LH,smoothstep:MH,simplebezier:AH},eD={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},txe=(e,t,n)=>n===Ge.Left?e-t:n===Ge.Right?e+t:e,nxe=(e,t,n)=>n===Ge.Top?e-t:n===Ge.Bottom?e+t:e,tD="react-flow__edgeupdater";function nD({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:o,onMouseOut:l,type:c}){return g.jsx("circle",{onMouseDown:s,onMouseEnter:o,onMouseOut:l,className:Vn([tD,`${tD}-${c}`]),cx:txe(t,r,e),cy:nxe(n,r,e),r,stroke:"transparent",fill:"transparent"})}function rxe({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:o,targetY:l,sourcePosition:c,targetPosition:u,onReconnect:f,onReconnectStart:h,onReconnectEnd:p,setReconnecting:y,setUpdateHover:x}){const b=an(),S=(O,k)=>{if(O.button!==0)return;const{autoPanOnConnect:M,domNode:A,connectionMode:L,connectionRadius:I,lib:j,onConnectStart:P,cancelConnection:B,nodeLookup:H,rfId:D,panBy:F,updateConnection:z}=b.getState(),q=k.type==="target",V=(X,ee)=>{y(!1),p==null||p(X,n,k.type,ee)},G=X=>f==null?void 0:f(n,X),K=(X,ee)=>{y(!0),h==null||h(O,n,k.type),P==null||P(X,ee)};pC.onPointerDown(O.nativeEvent,{autoPanOnConnect:M,connectionMode:L,connectionRadius:I,domNode:A,handleId:k.id,nodeId:k.nodeId,nodeLookup:H,isTarget:q,edgeUpdaterType:k.type,lib:j,flowId:D,cancelConnection:B,panBy:F,isValidConnection:(...X)=>{var ee,ae;return((ae=(ee=b.getState()).isValidConnection)==null?void 0:ae.call(ee,...X))??!0},onConnect:G,onConnectStart:K,onConnectEnd:(...X)=>{var ee,ae;return(ae=(ee=b.getState()).onConnectEnd)==null?void 0:ae.call(ee,...X)},onReconnectEnd:V,updateConnection:z,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,dragThreshold:b.getState().connectionDragThreshold,handleDomNode:O.currentTarget})},E=O=>S(O,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),C=O=>S(O,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),R=()=>x(!0),T=()=>x(!1);return g.jsxs(g.Fragment,{children:[(e===!0||e==="source")&&g.jsx(nD,{position:c,centerX:r,centerY:s,radius:t,onMouseDown:E,onMouseEnter:R,onMouseOut:T,type:"source"}),(e===!0||e==="target")&&g.jsx(nD,{position:u,centerX:o,centerY:l,radius:t,onMouseDown:C,onMouseEnter:R,onMouseOut:T,type:"target"})]})}function sxe({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:o,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:f,reconnectRadius:h,onReconnect:p,onReconnectStart:y,onReconnectEnd:x,rfId:b,edgeTypes:S,noPanClassName:E,onError:C,disableKeyboardA11y:R}){let T=Mt(le=>le.edgeLookup.get(e));const O=Mt(le=>le.defaultEdgeOptions);T=O?{...O,...T}:T;let k=T.type||"default",M=(S==null?void 0:S[k])||JL[k];M===void 0&&(C==null||C("011",ko.error011(k)),k="default",M=(S==null?void 0:S.default)||JL.default);const A=!!(T.focusable||t&&typeof T.focusable>"u"),L=typeof p<"u"&&(T.reconnectable||n&&typeof T.reconnectable>"u"),I=!!(T.selectable||r&&typeof T.selectable>"u"),j=N.useRef(null),[P,B]=N.useState(!1),[H,D]=N.useState(!1),F=an(),{zIndex:z=T.zIndex,sourceX:q,sourceY:V,targetX:G,targetY:K,sourcePosition:X,targetPosition:ee}=Mt(N.useCallback(le=>{const re=le.nodeLookup.get(T.source),he=le.nodeLookup.get(T.target);if(!re||!he)return eD;const Se=Xge({id:e,sourceNode:re,targetNode:he,sourceHandle:T.sourceHandle||null,targetHandle:T.targetHandle||null,connectionMode:le.connectionMode,onError:C}),_e=$ge({selected:T.selected,zIndex:T.zIndex,sourceNode:re,targetNode:he,elevateOnSelect:le.elevateEdgesOnSelect,zIndexMode:le.zIndexMode});return{...Se||eD,zIndex:_e}},[T.source,T.target,T.sourceHandle,T.targetHandle,T.selected,T.zIndex,C]),Cn),ae=N.useMemo(()=>T.markerStart?`url('#${fC(T.markerStart,b)}')`:void 0,[T.markerStart,b]),$=N.useMemo(()=>T.markerEnd?`url('#${fC(T.markerEnd,b)}')`:void 0,[T.markerEnd,b]);if(T.hidden||q===null||V===null||G===null||K===null)return null;const Y=le=>{var _e;const{addSelectedEdges:re,unselectNodesAndEdges:he,multiSelectionActive:Se}=F.getState();I&&(F.setState({nodesSelectionActive:!1}),T.selected&&Se?(he({nodes:[],edges:[T]}),(_e=j.current)==null||_e.blur()):re([e])),s&&s(le,T)},J=o?le=>{o(le,{...T})}:void 0,ne=l?le=>{l(le,{...T})}:void 0,W=c?le=>{c(le,{...T})}:void 0,ce=u?le=>{u(le,{...T})}:void 0,ye=f?le=>{f(le,{...T})}:void 0,pe=le=>{var re;if(!R&&L8.includes(le.key)&&I){const{unselectNodesAndEdges:he,addSelectedEdges:Se}=F.getState();le.key==="Escape"?((re=j.current)==null||re.blur(),he({edges:[T]})):Se([e])}};return g.jsx("svg",{style:{zIndex:z},children:g.jsxs("g",{className:Vn(["react-flow__edge",`react-flow__edge-${k}`,T.className,E,{selected:T.selected,animated:T.animated,inactive:!I&&!s,updating:P,selectable:I}]),onClick:Y,onDoubleClick:J,onContextMenu:ne,onMouseEnter:W,onMouseMove:ce,onMouseLeave:ye,onKeyDown:A?pe:void 0,tabIndex:A?0:void 0,role:T.ariaRole??(A?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":T.ariaLabel===null?void 0:T.ariaLabel||`Edge from ${T.source} to ${T.target}`,"aria-describedby":A?`${hH}-${b}`:void 0,ref:j,...T.domAttributes,children:[!H&&g.jsx(M,{id:e,source:T.source,target:T.target,type:T.type,selected:T.selected,animated:T.animated,selectable:I,deletable:T.deletable??!0,label:T.label,labelStyle:T.labelStyle,labelShowBg:T.labelShowBg,labelBgStyle:T.labelBgStyle,labelBgPadding:T.labelBgPadding,labelBgBorderRadius:T.labelBgBorderRadius,sourceX:q,sourceY:V,targetX:G,targetY:K,sourcePosition:X,targetPosition:ee,data:T.data,style:T.style,sourceHandleId:T.sourceHandle,targetHandleId:T.targetHandle,markerStart:ae,markerEnd:$,pathOptions:"pathOptions"in T?T.pathOptions:void 0,interactionWidth:T.interactionWidth}),L&&g.jsx(rxe,{edge:T,isReconnectable:L,reconnectRadius:h,onReconnect:p,onReconnectStart:y,onReconnectEnd:x,sourceX:q,sourceY:V,targetX:G,targetY:K,sourcePosition:X,targetPosition:ee,setUpdateHover:B,setReconnecting:D})]})})}var oxe=N.memo(sxe);const ixe=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function BH({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:o,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:f,onEdgeClick:h,reconnectRadius:p,onEdgeDoubleClick:y,onReconnectStart:x,onReconnectEnd:b,disableKeyboardA11y:S}){const{edgesFocusable:E,edgesReconnectable:C,elementsSelectable:R,onError:T}=Mt(ixe,Cn),O=Vye(t);return g.jsxs("div",{className:"react-flow__edges",children:[g.jsx(Wye,{defaultColor:e,rfId:n}),O.map(k=>g.jsx(oxe,{id:k,edgesFocusable:E,edgesReconnectable:C,elementsSelectable:R,noPanClassName:s,onReconnect:o,onContextMenu:l,onMouseEnter:c,onMouseMove:u,onMouseLeave:f,onClick:h,reconnectRadius:p,onDoubleClick:y,onReconnectStart:x,onReconnectEnd:b,rfId:n,onError:T,edgeTypes:r,disableKeyboardA11y:S},k))]})}BH.displayName="EdgeRenderer";const lxe=N.memo(BH),rD=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function axe({children:e}){const t=an(),n=N.useRef(null),[r]=N.useState(()=>t.getState().transform);return yH(()=>{let s=null;const o=()=>{const l=t.getState().transform;s&&l[0]===s[0]&&l[1]===s[1]&&l[2]===s[2]||(s=l,n.current&&(n.current.style.transform=rD(l)))};return o(),t.subscribe(o)},[t]),g.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:rD(r)},children:e})}function cxe(e){const t=Mb(),n=N.useRef(!1);N.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const uxe=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function dxe(e){const t=Mt(uxe),n=an();return N.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function fxe(e){return e.connection.inProgress?{...e.connection,to:Vm(e.connection.to,e.transform)}:{...e.connection}}function hxe(e){return fxe}function pxe(e){const t=hxe();return Mt(t,Cn)}const mxe=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function gxe({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:o,height:l,isValid:c,inProgress:u}=Mt(mxe,Cn);return!(o&&s&&u)?null:g.jsx("svg",{style:e,width:o,height:l,className:"react-flow__connectionline react-flow__container",children:g.jsx("g",{className:Vn(["react-flow__connection",q8(c)]),children:g.jsx(HH,{style:t,type:n,CustomComponent:r,isValid:c})})})}const HH=({style:e,type:t=ua.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:o,fromNode:l,fromHandle:c,fromPosition:u,to:f,toNode:h,toHandle:p,toPosition:y,pointer:x}=pxe();if(!s)return;if(n)return g.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:o.x,fromY:o.y,toX:f.x,toY:f.y,fromPosition:u,toPosition:y,connectionStatus:q8(r),toNode:h,toHandle:p,pointer:x});let b="";const S={sourceX:o.x,sourceY:o.y,sourcePosition:u,targetX:f.x,targetY:f.y,targetPosition:y};switch(t){case ua.Bezier:[b]=X8(S);break;case ua.SimpleBezier:[b]=RH(S);break;case ua.Step:[b]=dC({...S,borderRadius:0});break;case ua.SmoothStep:[b]=dC(S);break;default:[b]=Z8(S)}return g.jsx("path",{d:b,fill:"none",className:"react-flow__connection-path",style:e})};HH.displayName="ConnectionLine";const yxe={};function sD(e=yxe){N.useRef(e),an(),N.useEffect(()=>{},[e])}function xxe(){an(),N.useRef(!1),N.useEffect(()=>{},[])}function FH({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:o,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:p,onSelectionStart:y,onSelectionEnd:x,connectionLineType:b,connectionLineStyle:S,connectionLineComponent:E,connectionLineContainerStyle:C,selectionKeyCode:R,selectionOnDrag:T,selectionMode:O,multiSelectionKeyCode:k,panActivationKeyCode:M,zoomActivationKeyCode:A,deleteKeyCode:L,onlyRenderVisibleElements:I,elementsSelectable:j,defaultViewport:P,translateExtent:B,minZoom:H,maxZoom:D,preventScrolling:F,defaultMarkerColor:z,zoomOnScroll:q,zoomOnPinch:V,panOnScroll:G,panOnScrollSpeed:K,panOnScrollMode:X,zoomOnDoubleClick:ee,panOnDrag:ae,autoPanOnSelection:$,onPaneClick:Y,onPaneMouseEnter:J,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneScroll:ce,onPaneContextMenu:ye,paneClickDistance:pe,nodeClickDistance:le,onEdgeContextMenu:re,onEdgeMouseEnter:he,onEdgeMouseMove:Se,onEdgeMouseLeave:_e,reconnectRadius:be,onReconnect:Ae,onReconnectStart:Me,onReconnectEnd:Le,noDragClassName:ue,noWheelClassName:Re,noPanClassName:ze,disableKeyboardA11y:ke,nodeExtent:je,rfId:Ne,viewport:ve,onViewportChange:Fe,nodesDraggable:Ye}){return sD(e),sD(t),xxe(),cxe(n),dxe(ve),g.jsx(Lye,{onPaneClick:Y,onPaneMouseEnter:J,onPaneMouseMove:ne,onPaneMouseLeave:W,onPaneContextMenu:ye,onPaneScroll:ce,paneClickDistance:pe,deleteKeyCode:L,selectionKeyCode:R,selectionOnDrag:T,selectionMode:O,onSelectionStart:y,onSelectionEnd:x,multiSelectionKeyCode:k,panActivationKeyCode:M,zoomActivationKeyCode:A,elementsSelectable:j,zoomOnScroll:q,zoomOnPinch:V,zoomOnDoubleClick:ee,panOnScroll:G,panOnScrollSpeed:K,panOnScrollMode:X,panOnDrag:ae,autoPanOnSelection:$,defaultViewport:P,translateExtent:B,minZoom:H,maxZoom:D,onSelectionContextMenu:p,preventScrolling:F,noDragClassName:ue,noWheelClassName:Re,noPanClassName:ze,disableKeyboardA11y:ke,onViewportChange:Fe,isControlledViewport:!!ve,children:g.jsxs(axe,{children:[g.jsx(lxe,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:l,onReconnect:Ae,onReconnectStart:Me,onReconnectEnd:Le,onlyRenderVisibleElements:I,onEdgeContextMenu:re,onEdgeMouseEnter:he,onEdgeMouseMove:Se,onEdgeMouseLeave:_e,reconnectRadius:be,defaultMarkerColor:z,noPanClassName:ze,disableKeyboardA11y:ke,rfId:Ne}),g.jsx(gxe,{style:S,type:b,component:E,containerStyle:C}),g.jsx("div",{className:"react-flow__edgelabel-renderer"}),g.jsx(Uye,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:c,onNodeMouseMove:u,onNodeMouseLeave:f,onNodeContextMenu:h,nodeClickDistance:le,onlyRenderVisibleElements:I,noPanClassName:ze,noDragClassName:ue,disableKeyboardA11y:ke,nodeExtent:je,rfId:Ne,nodesDraggable:Ye}),g.jsx("div",{className:"react-flow__viewport-portal"})]})})}FH.displayName="GraphView";const bxe=N.memo(FH),vxe=$8(),oD=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:l,fitViewOptions:c,minZoom:u=.5,maxZoom:f=2,nodeOrigin:h,nodeExtent:p,zIndexMode:y="basic"}={})=>{const x=new Map,b=new Map,S=new Map,E=new Map,C=r??t??[],R=n??e??[],T=h??[0,0],O=p??Pp;tH(S,E,C);const{nodesInitialized:k}=hC(R,x,b,{nodeOrigin:T,nodeExtent:O,zIndexMode:y});let M=[0,0,1];if(l&&s&&o){const A=$m(x,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:L,y:I,zoom:j}=eN(A,s,o,u,f,(c==null?void 0:c.padding)??.1);M=[L,I,j]}return{rfId:"1",width:s??0,height:o??0,transform:M,nodes:R,nodesInitialized:k,nodeLookup:x,parentLookup:b,edges:C,edgeLookup:E,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:u,maxZoom:f,translateExtent:Pp,nodeExtent:O,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:pf.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:T,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:c,fitViewResolver:null,connection:{...j8},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:vxe,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:D8,zIndexMode:y,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},Sxe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:f,nodeOrigin:h,nodeExtent:p,zIndexMode:y})=>I0e((x,b)=>{async function S(){const{nodeLookup:E,panZoom:C,fitViewOptions:R,fitViewResolver:T,width:O,height:k,minZoom:M,maxZoom:A}=b();C&&(await Dge({nodes:E,width:O,height:k,panZoom:C,minZoom:M,maxZoom:A},R),T==null||T.resolve(!0),x({fitViewResolver:null}))}return{...oD({nodes:e,edges:t,width:s,height:o,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:f,nodeOrigin:h,nodeExtent:p,defaultNodes:n,defaultEdges:r,zIndexMode:y}),setNodes:E=>{const{nodeLookup:C,parentLookup:R,nodeOrigin:T,nodeExtent:O,elevateNodesOnSelect:k,fitViewQueued:M,zIndexMode:A,nodesSelectionActive:L}=b(),{nodesInitialized:I,hasSelectedNodes:j}=hC(E,C,R,{nodeOrigin:T,nodeExtent:O,elevateNodesOnSelect:k,checkEquality:!0,zIndexMode:A}),P=L&&j;M&&I?(S(),x({nodes:E,nodesInitialized:I,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:P})):x({nodes:E,nodesInitialized:I,nodesSelectionActive:P})},setEdges:E=>{const{connectionLookup:C,edgeLookup:R}=b();tH(C,R,E),x({edges:E})},setDefaultNodesAndEdges:(E,C)=>{if(E){const{setNodes:R}=b();R(E),x({hasDefaultNodes:!0})}if(C){const{setEdges:R}=b();R(C),x({hasDefaultEdges:!0})}},updateNodeInternals:E=>{const{triggerNodeChanges:C,nodeLookup:R,parentLookup:T,domNode:O,nodeOrigin:k,nodeExtent:M,debug:A,fitViewQueued:L,zIndexMode:I}=b(),{changes:j,updatedInternals:P}=s0e(E,R,T,O,k,M,I);P&&(e0e(R,T,{nodeOrigin:k,nodeExtent:M,zIndexMode:I}),L?(S(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),(j==null?void 0:j.length)>0&&(A&&console.log("React Flow: trigger node changes",j),C==null||C(j)))},updateNodePositions:(E,C=!1)=>{const R=[];let T=[];const{nodeLookup:O,triggerNodeChanges:k,connection:M,updateConnection:A,onNodesChangeMiddlewareMap:L}=b();for(const[I,j]of E){const P=O.get(I),B=!!(P!=null&&P.expandParent&&(P!=null&&P.parentId)&&(j!=null&&j.position)),H={id:I,type:"position",position:B?{x:Math.max(0,j.position.x),y:Math.max(0,j.position.y)}:j.position,dragging:C};if(P&&M.inProgress&&M.fromNode.id===P.id){const D=du(P,M.fromHandle,Ge.Left,!0);A({...M,from:D})}B&&P.parentId&&R.push({id:I,parentId:P.parentId,rect:{...j.internals.positionAbsolute,width:j.measured.width??0,height:j.measured.height??0}}),T.push(H)}if(R.length>0){const{parentLookup:I,nodeOrigin:j}=b(),P=iN(R,O,I,j);T.push(...P)}for(const I of L.values())T=I(T);k(T)},triggerNodeChanges:E=>{const{onNodesChange:C,setNodes:R,nodes:T,hasDefaultNodes:O,debug:k}=b();if(E!=null&&E.length){if(O){const M=eye(E,T);R(M)}k&&console.log("React Flow: trigger node changes",E),C==null||C(E)}},triggerEdgeChanges:E=>{const{onEdgesChange:C,setEdges:R,edges:T,hasDefaultEdges:O,debug:k}=b();if(E!=null&&E.length){if(O){const M=tye(E,T);R(M)}k&&console.log("React Flow: trigger edge changes",E),C==null||C(E)}},addSelectedNodes:E=>{const{multiSelectionActive:C,edgeLookup:R,nodeLookup:T,triggerNodeChanges:O,triggerEdgeChanges:k}=b();if(C){const M=E.map(A=>Mc(A,!0));O(M);return}O(Od(T,new Set([...E]),!0)),k(Od(R))},addSelectedEdges:E=>{const{multiSelectionActive:C,edgeLookup:R,nodeLookup:T,triggerNodeChanges:O,triggerEdgeChanges:k}=b();if(C){const M=E.map(A=>Mc(A,!0));k(M);return}k(Od(R,new Set([...E]))),O(Od(T,new Set,!0))},unselectNodesAndEdges:({nodes:E,edges:C}={})=>{const{edges:R,nodes:T,nodeLookup:O,triggerNodeChanges:k,triggerEdgeChanges:M}=b(),A=E||T,L=C||R,I=[];for(const P of A){if(!P.selected)continue;const B=O.get(P.id);B&&(B.selected=!1),I.push(Mc(P.id,!1))}const j=[];for(const P of L)P.selected&&j.push(Mc(P.id,!1));k(I),M(j)},setMinZoom:E=>{const{panZoom:C,maxZoom:R}=b();C==null||C.setScaleExtent([E,R]),x({minZoom:E})},setMaxZoom:E=>{const{panZoom:C,minZoom:R}=b();C==null||C.setScaleExtent([R,E]),x({maxZoom:E})},setTranslateExtent:E=>{var C;(C=b().panZoom)==null||C.setTranslateExtent(E),x({translateExtent:E})},resetSelectedElements:()=>{const{edges:E,nodes:C,triggerNodeChanges:R,triggerEdgeChanges:T,elementsSelectable:O}=b();if(!O)return;const k=C.reduce((A,L)=>L.selected?[...A,Mc(L.id,!1)]:A,[]),M=E.reduce((A,L)=>L.selected?[...A,Mc(L.id,!1)]:A,[]);R(k),T(M)},setNodeExtent:E=>{const{nodes:C,nodeLookup:R,parentLookup:T,nodeOrigin:O,elevateNodesOnSelect:k,nodeExtent:M,zIndexMode:A}=b();E[0][0]===M[0][0]&&E[0][1]===M[0][1]&&E[1][0]===M[1][0]&&E[1][1]===M[1][1]||(hC(C,R,T,{nodeOrigin:O,nodeExtent:E,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:A}),x({nodeExtent:E}))},panBy:E=>{const{transform:C,width:R,height:T,panZoom:O,translateExtent:k}=b();return o0e({delta:E,panZoom:O,transform:C,translateExtent:k,width:R,height:T})},setCenter:async(E,C,R)=>{const{width:T,height:O,maxZoom:k,panZoom:M}=b();if(!M)return!1;const A=typeof(R==null?void 0:R.zoom)<"u"?R.zoom:k;return await M.setViewport({x:T/2-E*A,y:O/2-C*A,zoom:A},{duration:R==null?void 0:R.duration,ease:R==null?void 0:R.ease,interpolate:R==null?void 0:R.interpolate}),!0},cancelConnection:()=>{x({connection:{...j8}})},updateConnection:E=>{x({connection:E})},reset:()=>x({...oD()})}},Object.is);function $H({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:o,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:u,fitView:f,nodeOrigin:h,nodeExtent:p,zIndexMode:y,children:x}){const[b]=N.useState(()=>Sxe({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:o,fitView:f,minZoom:l,maxZoom:c,fitViewOptions:u,nodeOrigin:h,nodeExtent:p,zIndexMode:y}));return g.jsx(L0e,{value:b,children:g.jsx(iye,{children:g.jsx(Sye,{children:x})})})}function wxe({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:o,height:l,fitView:c,fitViewOptions:u,minZoom:f,maxZoom:h,nodeOrigin:p,nodeExtent:y,zIndexMode:x}){return N.useContext(kb)?g.jsx(g.Fragment,{children:e}):g.jsx($H,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:o,initialHeight:l,fitView:c,initialFitViewOptions:u,initialMinZoom:f,initialMaxZoom:h,nodeOrigin:p,nodeExtent:y,zIndexMode:x,children:e})}const Exe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function Cxe({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:o,edgeTypes:l,onNodeClick:c,onEdgeClick:u,onInit:f,onMove:h,onMoveStart:p,onMoveEnd:y,onConnect:x,onConnectStart:b,onConnectEnd:S,onClickConnectStart:E,onClickConnectEnd:C,onNodeMouseEnter:R,onNodeMouseMove:T,onNodeMouseLeave:O,onNodeContextMenu:k,onNodeDoubleClick:M,onNodeDragStart:A,onNodeDrag:L,onNodeDragStop:I,onNodesDelete:j,onEdgesDelete:P,onDelete:B,onSelectionChange:H,onSelectionDragStart:D,onSelectionDrag:F,onSelectionDragStop:z,onSelectionContextMenu:q,onSelectionStart:V,onSelectionEnd:G,onBeforeDelete:K,connectionMode:X,connectionLineType:ee=ua.Bezier,connectionLineStyle:ae,connectionLineComponent:$,connectionLineContainerStyle:Y,deleteKeyCode:J="Backspace",selectionKeyCode:ne="Shift",selectionOnDrag:W=!1,selectionMode:ce=zp.Full,panActivationKeyCode:ye="Space",multiSelectionKeyCode:pe=Hp()?"Meta":"Control",zoomActivationKeyCode:le=Hp()?"Meta":"Control",snapToGrid:re,snapGrid:he,onlyRenderVisibleElements:Se=!1,selectNodesOnDrag:_e,nodesDraggable:be,autoPanOnNodeFocus:Ae,nodesConnectable:Me,nodesFocusable:Le,nodeOrigin:ue=pH,edgesFocusable:Re,edgesReconnectable:ze,elementsSelectable:ke=!0,defaultViewport:je=K0e,minZoom:Ne=.5,maxZoom:ve=2,translateExtent:Fe=Pp,preventScrolling:Ye=!0,nodeExtent:xt,defaultMarkerColor:nn="#b1b1b7",zoomOnScroll:Ce=!0,zoomOnPinch:De=!0,panOnScroll:tt=!1,panOnScrollSpeed:Ot=.5,panOnScrollMode:gn=Zc.Free,zoomOnDoubleClick:yn=!0,panOnDrag:Fr=!0,onPaneClick:cn,onPaneMouseEnter:ar,onPaneMouseMove:$r,onPaneMouseLeave:Es,onPaneScroll:qn,onPaneContextMenu:yt,paneClickDistance:un=1,nodeClickDistance:Gn=0,children:Rn,onReconnect:On,onReconnectStart:Ht,onReconnectEnd:Zt,onEdgeContextMenu:Jt,onEdgeDoubleClick:Ur,onEdgeMouseEnter:Kn,onEdgeMouseMove:Ln,onEdgeMouseLeave:cr,reconnectRadius:ur=10,onNodesChange:dr,onEdgesChange:ls,noDragClassName:Ar="nodrag",noWheelClassName:kr="nowheel",noPanClassName:as="nopan",fitView:fo,fitViewOptions:fr,connectOnClick:Do,attributionPosition:Cs,proOptions:wl,defaultEdgeOptions:Ts,elevateNodesOnSelect:El=!0,elevateEdgesOnSelect:mi=!1,disableKeyboardA11y:ho=!1,autoPanOnConnect:cs,autoPanOnNodeDrag:us,autoPanOnSelection:gi=!0,autoPanSpeed:xn,connectionRadius:on,isValidConnection:Yn,onError:Vr,style:ec,id:yi,nodeDragThreshold:Cl,connectionDragThreshold:jo,viewport:xi,onViewportChange:Tl,width:Nl,height:Ns,colorMode:bi="light",debug:me,onScroll:Te,ariaLabelConfig:Oe,zIndexMode:Ke="basic",...lt},it){const ut=yi||"1",Ft=Q0e(bi),Pt=N.useCallback(Ze=>{Ze.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Te==null||Te(Ze)},[Te]);return g.jsx("div",{"data-testid":"rf__wrapper",...lt,onScroll:Pt,style:{...ec,...Exe},ref:it,className:Vn(["react-flow",s,Ft]),id:yi,role:"application",children:g.jsxs(wxe,{nodes:e,edges:t,width:Nl,height:Ns,fitView:fo,fitViewOptions:fr,minZoom:Ne,maxZoom:ve,nodeOrigin:ue,nodeExtent:xt,zIndexMode:Ke,children:[g.jsx(X0e,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:x,onConnectStart:b,onConnectEnd:S,onClickConnectStart:E,onClickConnectEnd:C,nodesDraggable:be,autoPanOnNodeFocus:Ae,nodesConnectable:Me,nodesFocusable:Le,edgesFocusable:Re,edgesReconnectable:ze,elementsSelectable:ke,elevateNodesOnSelect:El,elevateEdgesOnSelect:mi,minZoom:Ne,maxZoom:ve,nodeExtent:xt,onNodesChange:dr,onEdgesChange:ls,snapToGrid:re,snapGrid:he,connectionMode:X,translateExtent:Fe,connectOnClick:Do,defaultEdgeOptions:Ts,fitView:fo,fitViewOptions:fr,onNodesDelete:j,onEdgesDelete:P,onDelete:B,onNodeDragStart:A,onNodeDrag:L,onNodeDragStop:I,onSelectionDrag:F,onSelectionDragStart:D,onSelectionDragStop:z,onMove:h,onMoveStart:p,onMoveEnd:y,noPanClassName:as,nodeOrigin:ue,rfId:ut,autoPanOnConnect:cs,autoPanOnNodeDrag:us,autoPanSpeed:xn,onError:Vr,connectionRadius:on,isValidConnection:Yn,selectNodesOnDrag:_e,nodeDragThreshold:Cl,connectionDragThreshold:jo,onBeforeDelete:K,debug:me,ariaLabelConfig:Oe,zIndexMode:Ke}),g.jsx(bxe,{onInit:f,onNodeClick:c,onEdgeClick:u,onNodeMouseEnter:R,onNodeMouseMove:T,onNodeMouseLeave:O,onNodeContextMenu:k,onNodeDoubleClick:M,nodeTypes:o,edgeTypes:l,connectionLineType:ee,connectionLineStyle:ae,connectionLineComponent:$,connectionLineContainerStyle:Y,selectionKeyCode:ne,selectionOnDrag:W,selectionMode:ce,deleteKeyCode:J,multiSelectionKeyCode:pe,panActivationKeyCode:ye,zoomActivationKeyCode:le,onlyRenderVisibleElements:Se,defaultViewport:je,translateExtent:Fe,minZoom:Ne,maxZoom:ve,preventScrolling:Ye,zoomOnScroll:Ce,zoomOnPinch:De,zoomOnDoubleClick:yn,panOnScroll:tt,panOnScrollSpeed:Ot,panOnScrollMode:gn,panOnDrag:Fr,autoPanOnSelection:gi,onPaneClick:cn,onPaneMouseEnter:ar,onPaneMouseMove:$r,onPaneMouseLeave:Es,onPaneScroll:qn,onPaneContextMenu:yt,paneClickDistance:un,nodeClickDistance:Gn,onSelectionContextMenu:q,onSelectionStart:V,onSelectionEnd:G,onReconnect:On,onReconnectStart:Ht,onReconnectEnd:Zt,onEdgeContextMenu:Jt,onEdgeDoubleClick:Ur,onEdgeMouseEnter:Kn,onEdgeMouseMove:Ln,onEdgeMouseLeave:cr,reconnectRadius:ur,defaultMarkerColor:nn,noDragClassName:Ar,noWheelClassName:kr,noPanClassName:as,rfId:ut,disableKeyboardA11y:ho,nodeExtent:xt,viewport:xi,onViewportChange:Tl,nodesDraggable:be}),g.jsx(G0e,{onSelectionChange:H}),Rn,g.jsx(F0e,{proOptions:wl,position:Cs}),g.jsx(H0e,{rfId:ut,disableKeyboardA11y:ho})]})})}var Txe=gH(Cxe);function Nxe({dimensions:e,lineWidth:t,variant:n,className:r}){return g.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Vn(["react-flow__background-pattern",n,r])})}function Rxe({radius:e,className:t}){return g.jsx("circle",{cx:e,cy:e,r:e,className:Vn(["react-flow__background-pattern","dots",t])})}var Aa;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Aa||(Aa={}));const Oxe={[Aa.Dots]:1,[Aa.Lines]:1,[Aa.Cross]:6},Axe=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function UH({id:e,variant:t=Aa.Dots,gap:n=20,size:r,lineWidth:s=1,offset:o=0,color:l,bgColor:c,style:u,className:f,patternClassName:h}){const p=N.useRef(null),{transform:y,patternId:x}=Mt(Axe,Cn),b=r||Oxe[t],S=t===Aa.Dots,E=t===Aa.Cross,C=Array.isArray(n)?n:[n,n],R=[C[0]*y[2]||1,C[1]*y[2]||1],T=b*y[2],O=Array.isArray(o)?o:[o,o],k=E?[T,T]:R,M=[O[0]*y[2]+k[0]/2,O[1]*y[2]+k[1]/2],A=`${x}${e||""}`;return g.jsxs("svg",{className:Vn(["react-flow__background",f]),style:{...u,...Ib,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:p,"data-testid":"rf__background",children:[g.jsx("pattern",{id:A,x:y[0]%R[0],y:y[1]%R[1],width:R[0],height:R[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${M[0]},-${M[1]})`,children:S?g.jsx(Rxe,{radius:T/2,className:h}):g.jsx(Nxe,{dimensions:k,lineWidth:s,variant:t,className:h})}),g.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${A})`})]})}UH.displayName="Background";N.memo(UH);function kxe(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:g.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function _xe(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:g.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Mxe(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:g.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Ixe(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Lxe(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Q0({children:e,className:t,...n}){return g.jsx("button",{type:"button",className:Vn(["react-flow__controls-button",t]),...n,children:e})}const Dxe=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function VH({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:o,onZoomOut:l,onFitView:c,onInteractiveChange:u,className:f,children:h,position:p="bottom-left",orientation:y="vertical","aria-label":x}){const b=an(),{isInteractive:S,minZoomReached:E,maxZoomReached:C,ariaLabelConfig:R}=Mt(Dxe,Cn),{zoomIn:T,zoomOut:O,fitView:k}=Mb(),M=()=>{T(),o==null||o()},A=()=>{O(),l==null||l()},L=()=>{k(s),c==null||c()},I=()=>{b.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),u==null||u(!S)},j=y==="horizontal"?"horizontal":"vertical";return g.jsxs(_b,{className:Vn(["react-flow__controls",j,f]),position:p,style:e,"data-testid":"rf__controls","aria-label":x??R["controls.ariaLabel"],children:[t&&g.jsxs(g.Fragment,{children:[g.jsx(Q0,{onClick:M,className:"react-flow__controls-zoomin",title:R["controls.zoomIn.ariaLabel"],"aria-label":R["controls.zoomIn.ariaLabel"],disabled:C,children:g.jsx(kxe,{})}),g.jsx(Q0,{onClick:A,className:"react-flow__controls-zoomout",title:R["controls.zoomOut.ariaLabel"],"aria-label":R["controls.zoomOut.ariaLabel"],disabled:E,children:g.jsx(_xe,{})})]}),n&&g.jsx(Q0,{className:"react-flow__controls-fitview",onClick:L,title:R["controls.fitView.ariaLabel"],"aria-label":R["controls.fitView.ariaLabel"],children:g.jsx(Mxe,{})}),r&&g.jsx(Q0,{className:"react-flow__controls-interactive",onClick:I,title:R["controls.interactive.ariaLabel"],"aria-label":R["controls.interactive.ariaLabel"],children:S?g.jsx(Lxe,{}):g.jsx(Ixe,{})}),h]})}VH.displayName="Controls";N.memo(VH);function jxe({id:e,x:t,y:n,width:r,height:s,style:o,color:l,strokeColor:c,strokeWidth:u,className:f,borderRadius:h,shapeRendering:p,selected:y,onClick:x}){const{background:b,backgroundColor:S}=o||{},E=l||b||S;return g.jsx("rect",{className:Vn(["react-flow__minimap-node",{selected:y},f]),x:t,y:n,rx:h,ry:h,width:r,height:s,style:{fill:E,stroke:c,strokeWidth:u},shapeRendering:p,onClick:x?C=>x(C,e):void 0})}const Pxe=N.memo(jxe),zxe=e=>e.nodes.map(t=>t.id),dw=e=>e instanceof Function?e:()=>e;function Bxe({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:o=Pxe,onClick:l}){const c=Mt(zxe,Cn),u=dw(t),f=dw(e),h=dw(n),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return g.jsx(g.Fragment,{children:c.map(y=>g.jsx(Fxe,{id:y,nodeColorFunc:u,nodeStrokeColorFunc:f,nodeClassNameFunc:h,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:o,onClick:l,shapeRendering:p},y))})}function Hxe({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:o,shapeRendering:l,NodeComponent:c,onClick:u}){const{node:f,x:h,y:p,width:y,height:x}=Mt(b=>{const S=b.nodeLookup.get(e);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const E=S.internals.userNode,{x:C,y:R}=S.internals.positionAbsolute,{width:T,height:O}=Io(E);return{node:E,x:C,y:R,width:T,height:O}},Cn);return!f||f.hidden||!U8(f)?null:g.jsx(c,{x:h,y:p,width:y,height:x,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:s,strokeColor:n(f),strokeWidth:o,shapeRendering:l,onClick:u,id:f.id})}const Fxe=N.memo(Hxe);var $xe=N.memo(Bxe);const Uxe=200,Vxe=150,qxe=e=>!e.hidden,Gxe=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};let n=!1;for(const r of e.nodeLookup.values())if(!r.hidden){n=!0;break}return{viewBB:t,boundingRect:n?H8($m(e.nodeLookup,{filter:qxe}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},iD=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,Kxe=(e,t)=>iD(e.viewBB,t.viewBB)&&iD(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,Yxe="react-flow__minimap-desc";function qH({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:o=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:u,maskColor:f,maskStrokeColor:h,maskStrokeWidth:p,position:y="bottom-right",onClick:x,onNodeClick:b,pannable:S=!1,zoomable:E=!1,ariaLabel:C,inversePan:R,zoomStep:T=1,offsetScale:O=5}){const k=an(),M=N.useRef(null),{boundingRect:A,panZoom:L,viewBB:I,rfId:j,translateExtent:P,flowWidth:B,flowHeight:H,ariaLabelConfig:D}=Mt(Gxe,Kxe),F=(e==null?void 0:e.width)??Uxe,z=(e==null?void 0:e.height)??Vxe,q=A.width/F,V=A.height/z,G=Math.max(q,V),K=G*F,X=G*z,ee=O*G,ae=A.x-(K-A.width)/2-ee,$=A.y-(X-A.height)/2-ee,Y=K+ee*2,J=X+ee*2,ne=`${Yxe}-${j}`,W=N.useRef(0),ce=N.useRef();W.current=G,N.useEffect(()=>{const he=k.getState().panZoom;if(M.current&&he)return ce.current=p0e({domNode:M.current,panZoom:he,getTransform:()=>k.getState().transform,getViewScale:()=>W.current}),()=>{var Se;(Se=ce.current)==null||Se.destroy()}},[L]),N.useEffect(()=>{var he;(he=ce.current)==null||he.update({translateExtent:P,width:B,height:H,inversePan:R,pannable:S,zoomStep:T,zoomable:E})},[S,E,R,T,P,B,H]);const ye=x?he=>{var be;const[Se,_e]=((be=ce.current)==null?void 0:be.pointer(he))||[0,0];x(he,{x:Se,y:_e})}:void 0,pe=N.useCallback((he,Se)=>{const _e=k.getState().nodeLookup.get(Se).internals.userNode;b==null||b(he,_e)},[b]),le=b?pe:void 0,re=C??D["minimap.ariaLabel"];return g.jsx(_b,{position:y,style:{...e,"--xy-minimap-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*G:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:Vn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:g.jsxs("svg",{width:F,height:z,viewBox:`${ae} ${$} ${Y} ${J}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ne,ref:M,onClick:ye,children:[re&&g.jsx("title",{id:ne,children:re}),g.jsx($xe,{onClick:le,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:s,nodeStrokeWidth:l,nodeComponent:c}),g.jsx("path",{className:"react-flow__minimap-mask",d:`M${ae-ee},${$-ee}h${Y+ee*2}v${J+ee*2}h${-Y-ee*2}z
|
|
359
|
-
M${I.x},${I.y}h${I.width}v${I.height}h${-I.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}qH.displayName="MiniMap";N.memo(qH);const Wxe=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,Xxe={[yf.Line]:"right",[yf.Handle]:"bottom-right"};function Qxe({nodeId:e,position:t,variant:n=yf.Handle,className:r,style:s=void 0,children:o,color:l,minWidth:c=10,minHeight:u=10,maxWidth:f=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:y,autoScale:x=!0,shouldResize:b,onResizeStart:S,onResize:E,onResizeEnd:C}){const R=SH(),T=typeof e=="string"?e:R,O=an(),k=N.useRef(null),M=n===yf.Handle,A=Mt(N.useCallback(Wxe(M&&x),[M,x]),Cn),L=N.useRef(null),I=t??Xxe[n];N.useEffect(()=>{if(!(!k.current||!T))return L.current||(L.current=R0e({domNode:k.current,nodeId:T,getStoreItems:()=>{const{nodeLookup:P,transform:B,snapGrid:H,snapToGrid:D,nodeOrigin:F,domNode:z}=O.getState();return{nodeLookup:P,transform:B,snapGrid:H,snapToGrid:D,nodeOrigin:F,paneDomNode:z}},onChange:(P,B)=>{const{triggerNodeChanges:H,nodeLookup:D,parentLookup:F,nodeOrigin:z}=O.getState(),q=[],V={x:P.x,y:P.y},G=D.get(T);if(G&&G.expandParent&&G.parentId){const K=G.origin??z,X=P.width??G.measured.width??0,ee=P.height??G.measured.height??0,ae={id:G.id,parentId:G.parentId,rect:{width:X,height:ee,...V8({x:P.x??G.position.x,y:P.y??G.position.y},{width:X,height:ee},G.parentId,D,K)}},$=iN([ae],D,F,z);q.push(...$),V.x=P.x?Math.max(K[0]*X,P.x):void 0,V.y=P.y?Math.max(K[1]*ee,P.y):void 0}if(V.x!==void 0&&V.y!==void 0){const K={id:T,type:"position",position:{...V}};q.push(K)}if(P.width!==void 0&&P.height!==void 0){const X={id:T,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:P.width,height:P.height}};q.push(X)}for(const K of B){const X={...K,type:"position"};q.push(X)}H(q)},onEnd:({width:P,height:B})=>{const H={id:T,type:"dimensions",resizing:!1,dimensions:{width:P,height:B}};O.getState().triggerNodeChanges([H])}})),L.current.update({controlPosition:I,boundaries:{minWidth:c,minHeight:u,maxWidth:f,maxHeight:h},keepAspectRatio:p,resizeDirection:y,onResizeStart:S,onResize:E,onResizeEnd:C,shouldResize:b}),()=>{var P;(P=L.current)==null||P.destroy()}},[I,c,u,f,h,p,S,E,C,b]);const j=I.split("-");return g.jsx("div",{className:Vn(["react-flow__resize-control","nodrag",...j,n,r]),ref:k,style:{...s,scale:A,...l&&{[M?"backgroundColor":"borderColor"]:l}},children:o})}N.memo(Qxe);function pl({...e}){return g.jsx(Vz,{"data-slot":"dialog",...e})}function Cke({...e}){return g.jsx(rne,{"data-slot":"dialog-trigger",...e})}function Zxe({...e}){return g.jsx(Uz,{"data-slot":"dialog-portal",...e})}function Tke({...e}){return g.jsx(vT,{"data-slot":"dialog-close",...e})}function Jxe({className:e,...t}){return g.jsx(Vte,{"data-slot":"dialog-overlay",className:xe("fixed inset-0 isolate z-50 bg-sign/40 duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function ml({className:e,children:t,showCloseButton:n=!0,...r}){return g.jsxs(Zxe,{children:[g.jsx(Jxe,{}),g.jsxs($z,{"data-slot":"dialog-content",className:xe("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg border border-foreground bg-popover p-5 text-sm text-popover-foreground duration-150 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...r,children:[t,n&&g.jsxs(vT,{"data-slot":"dialog-close",render:g.jsx(st,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[g.jsx(Vx,{}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function gl({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-header",className:xe("flex flex-col gap-2",e),...t})}function yl({className:e,showCloseButton:t=!1,children:n,...r}){return g.jsxs("div",{"data-slot":"dialog-footer",className:xe("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&g.jsx(vT,{render:g.jsx(st,{variant:"outline"}),children:"Close"})]})}function xl({className:e,...t}){return g.jsx(nne,{"data-slot":"dialog-title",className:xe("font-heading text-lg leading-7 font-bold",e),...t})}function bl({className:e,...t}){return g.jsx(qte,{"data-slot":"dialog-description",className:xe("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}const ebe="Cancel",tbe=({title:e,description:t,confirmLabel:n,onConfirm:r,onCancel:s})=>g.jsx(pl,{open:!0,onOpenChange:o=>{o||s()},children:g.jsxs(ml,{showCloseButton:!1,children:[g.jsxs(gl,{children:[g.jsx(xl,{children:e}),g.jsx(bl,{children:t})]}),g.jsxs(yl,{children:[g.jsx(st,{type:"button",variant:"ghost",onClick:s,children:ebe}),g.jsx(st,{type:"button",variant:"destructive",onClick:r,children:n})]})]})}),nbe={trigger:"",call:"",value:"[stroke-dasharray:7_5]",data:"[stroke-dasharray:1_6] [stroke-linecap:round]"},rbe="M1 1 9 5 1 9z",sbe="fill-current stroke-current [stroke-linejoin:round] [stroke-width:1.5]",obe="fill-background stroke-current [stroke-linejoin:round] [stroke-width:1.5]",ibe=["selected","hovered"],GH={selected:"text-primary",hovered:"text-primary/60"},KH=(e,t)=>t===null?e:`${e}-${t}`,lD=({baseId:e,isAssumed:t,emphasis:n})=>g.jsx("marker",{id:KH(e,n),viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",className:n===null?void 0:GH[n],children:g.jsx("path",{d:rbe,className:t?obe:sbe})}),lbe="fill-none stroke-current [stroke-linejoin:round] [stroke-width:2]",abe=()=>{const e=N.useId();return{proven:`${e}-proven`,assumed:`${e}-assumed`}},cbe=({markers:e})=>g.jsx("defs",{children:[null,...ibe].map(t=>g.jsxs(N.Fragment,{children:[g.jsx(lD,{baseId:e.proven,isAssumed:!1,emphasis:t}),g.jsx(lD,{baseId:e.assumed,isAssumed:!0,emphasis:t})]},t??"plain"))}),ube=({path:e,kind:t,isAssumed:n,emphasis:r=null,hasArrow:s=!0,markers:o})=>g.jsx("path",{d:e,"data-kind":t,"data-assumed":n,"data-emphasis":r??void 0,markerEnd:s?`url(#${KH(n?o.assumed:o.proven,r)})`:void 0,className:xe(lbe,nbe[t],"transition-colors duration-[180ms] ease-out",r!==null&&GH[r])}),dbe=new Set,fbe=[],hbe=[],pbe=(e,t)=>new Set(e.has(t)?[...e].filter(n=>n!==t):[...e,t]),mbe='[data-focused="true"]',gbe=(e,t)=>{const n=Number.parseInt(e,10);return t.some(([r,s])=>r<=n&&n<=s)},ybe=(e,t)=>t===null?e:e.map(n=>({...n,isFocused:gbe(n.numberLabel,t)})),xbe=({id:e,rows:t},n)=>t.map(r=>r.kind==="lines"?{...r,lines:ybe(r.lines,n)}:r.kind==="waypoint"?{...r,waypoint:{...r.waypoint,anchorId:`${e}-${r.waypoint.anchorId}`}}:r),bbe=({view:e,focusedLines:t=null,isReviewPending:n,codeLinks:r,codeDefinitions:s,onOpenCodeLink:o,onWaypointReviewedChange:l})=>{const[c,u]=N.useState(dbe),f=`${e.pathLabel}, ${e.rangeLabel}`,h=N.useRef(null);return N.useEffect(()=>{var p,y;t!==null&&((y=(p=h.current)==null?void 0:p.querySelector(mbe))==null||y.scrollIntoView({block:"center"}))},[t]),g.jsxs("section",{ref:h,"aria-label":`${e.heading}, ${f}`,"data-reference-scope":"",className:"border-t",children:[g.jsxs("h4",{className:"px-4 pt-3 text-xs text-muted-foreground",children:[g.jsx("span",{className:"font-bold",children:e.heading}),e.countLabel===null?null:g.jsx("span",{className:"tabular-nums",children:` • ${e.countLabel}`})]}),g.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 px-4 py-2",children:[g.jsx("span",{className:"min-w-0 font-mono text-[0.8125rem] wrap-anywhere",children:e.pathLabel}),g.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:e.rangeLabel})]}),g.jsx("div",{className:"border-y bg-code",children:g.jsx(q6,{path:e.pathLabel,label:f,rows:xbe(e,t),rootBlocks:fbe,threads:hbe,openWaypointIds:c,currentWaypointId:null,focusedWaypointId:null,isWrapped:!0,isReviewPending:n,commenting:null,codeLinks:r,codeDefinitions:s,onOpenCodeLink:o,onToggleWaypoint:p=>{u(y=>pbe(y,p))},onWaypointReviewedChange:l,onRootBlockReviewedChange:null})}),e.note===null&&e.forgeLink===null?null:g.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-4 gap-y-1 px-4 py-2 text-xs",children:[e.note===null?null:g.jsx("span",{className:"text-muted-foreground",children:e.note}),e.forgeLink===null?null:g.jsx(Wa,{href:e.forgeLink.href,label:e.forgeLink.label})]})]})},aN=264,Qa=96,vbe=36,Sbe=48,wbe=16,Ebe=20,Cbe=4,xf=24,$p=18,Tbe=6,Nbe=6,dx=10,Rbe=8,cN=96,qm=32,oi=24,io=2,YH=aN-dx*io,uN={nodes:[],rows:[],lanes:[]},Db=e=>e.reduce((t,n)=>t+n,0),Obe={heading:wbe,row:vbe,"two-line-row":Sbe},aD=1,WH=({kind:e,lineCount:t=aD})=>e==="parameters"?t*Ebe+(t-aD)*Cbe:Obe[e],XH="card",Abe=e=>e.kind!==XH,QH=e=>{const t=new Map(e.children.map(r=>[r.id,r])),n=new Set(e.rows.filter(r=>r.kind===XH).map(r=>r.id));return[...e.rows.flatMap(r=>{if(Abe(r))return[{kind:"row",row:r}];const s=t.get(r.id);return s===void 0?[]:[{kind:"card",node:s}]}),...e.children.filter(r=>!n.has(r.id)).map(r=>({kind:"card",node:r}))]},ZH=e=>(e.kind==="row"?WH(e.row):Gm(e.node).height)+Nbe,Gm=e=>{const t=e.children.map(Gm);return{width:Math.max(aN,...t.map(n=>n.width+dx*io)),height:Qa+Db(QH(e).map(ZH))+Rbe}},JH=(e,t,n,r)=>{const{height:s}=Gm(e),o={x:t.x+dx,width:t.width-dx*io},l=(u,f)=>u.kind==="row"?{nodes:[],rows:[{id:u.row.id,kind:u.row.kind,nodeId:e.id,...o,y:f,height:WH(u.row)}],lanes:[]}:JH(u.node,{...o,y:f},n+1,r),{placed:c}=QH(e).reduce(({top:u,placed:f},h)=>({top:u+ZH(h),placed:dN([f,l(h,u)])}),{top:t.y+Qa,placed:uN});return{nodes:[{id:e.id,topId:r,depth:n,...t,height:s},...c.nodes],rows:c.rows,lanes:[]}},eF=e=>[e.id,...e.children.flatMap(eF)],dN=e=>({nodes:e.flatMap(t=>t.nodes),rows:e.flatMap(t=>t.rows),lanes:e.flatMap(t=>t.lanes)}),kbe=(e,t)=>{const n=new Map(e.flatMap(r=>eF(r).map(s=>[s,r.id])));return t.flatMap(r=>{const s=n.get(r.from),o=n.get(r.to);return s===void 0||o===void 0||s===o?[]:[{edge:r,from:s,to:o}]})},_be={visitedIds:new Set,closingLinks:[]},tF=(e,t,n,r)=>{if(r.visitedIds.has(e))return r;const s=[...t,e];return n.filter(o=>o.from===e).reduce((o,l)=>s.includes(l.to)?{...o,closingLinks:[...o.closingLinks,l]}:tF(l.to,s,n,o),{...r,visitedIds:new Set([...r.visitedIds,e])})},Mbe=(e,t)=>{const n=new Set(t.map(o=>o.to)),r=[...e.filter(o=>!n.has(o.id)),...e.filter(o=>n.has(o.id))].map(o=>o.id),{closingLinks:s}=r.reduce((o,l)=>tF(l,[],t,o),_be);return t.filter(o=>!s.includes(o))},Ibe=(e,t,n)=>new Map([...e].map(([r,s])=>{const o=t.filter(l=>l.to===r).map(l=>(e.get(l.from)??0)+1);return[r,Math.min(n,Math.max(s,...o))]})),Lbe=e=>{const t=[...new Set(e.values())].sort((n,r)=>n-r);return new Map([...e].map(([n,r])=>[n,t.indexOf(r)]))},Dbe=(e,t)=>{const n=Mbe(e,t);return Lbe(e.reduce(r=>Ibe(r,n,e.length-1),new Map(e.map(r=>[r.id,0]))))},fx=(e,t)=>e.get(t)??0,jbe=({from:e,to:t},n,r)=>fx(r,e)<n&&n<fx(r,t),gC=e=>e.y+Qa/io,yC=e=>e.y+e.height/io,Pbe=({from:e,fromRowId:t},{nodes:n,rows:r})=>{const s=t===null?void 0:r.find(l=>l.id===t);if(s!==void 0)return yC(s);const o=n.find(l=>l.id===e);return o===void 0?null:gC(o)},xC=({y:e,edgeIds:t},n)=>e+t.indexOf(n)*$p,hx=e=>(e.length-1)*$p,nF=(e,t,n)=>{const r=n.lanes.find(s=>s.toId===e.to&&s.column===t-1&&s.edgeIds.includes(e.edge.id));return r===void 0?Pbe(e.edge,n):xC(r,e.edge.id)},zbe=(e,t,n,r,s)=>n.filter(o=>o.to===e&&fx(r,o.from)<t).flatMap(o=>nF(o,t,s)??[]),Bbe=(e,t,n,r)=>{const s=t.filter(o=>o.to===e).map((o,l)=>({link:o,index:l,comingFrom:nF(o,n,r)??0})).sort((o,l)=>o.comingFrom-l.comingFrom||o.index-l.index).map(({link:o})=>o.edge.id);return{node:null,toId:e,height:hx(s),anchorHeight:hx(s),edgeIds:s}},Hbe=(e,t,n,r,s)=>{const o=n.filter(c=>jbe(c,t,r)),l=[...new Set(o.map(c=>c.to))];return[...e.filter(c=>fx(r,c.id)===t).map(c=>({node:c,toId:c.id,height:Gm(c).height,anchorHeight:Qa,edgeIds:[]})),...l.map(c=>Bbe(c,o,t,s))]},Fbe=({toId:e,anchorHeight:t},n)=>{const r=n(e);return r.length===0?oi:Db(r)/r.length-t/io},$be=({node:e,toId:t,edgeIds:n},r,s)=>e===null?{...uN,lanes:[{toId:t,column:r,x:s.x,width:s.width,y:s.y,edgeIds:n}]}:JH(e,s,0,e.id),rF=e=>e.reduce(({bottom:t,offsets:n},{item:r})=>({bottom:t+r.height+qm,offsets:[...n,t]}),{bottom:0,offsets:[]}).offsets,Ube=({members:e})=>Db(e.map(({item:t})=>t.height))+qm*(e.length-1),Vbe=e=>{const t=rF(e);return Db(e.map(({top:n},r)=>n-t[r]))/e.length},qbe=(e,t)=>e.top+Ube(e)+qm>t.top,Gbe=(e,t)=>{const n=[...e.members,...t.members];return{members:n,top:Vbe(n)}},sF=(e,t)=>{const n=e.at(-1);return n!==void 0&&qbe(n,t)?sF(e.slice(0,-1),Gbe(n,t)):[...e,t]},Kbe=e=>e.reduce((t,n)=>sF(t,{members:[n],top:n.top}),[]),Ybe=(e,t,n,r)=>{const s=e.map((l,c)=>({item:l,index:c,top:Fbe(l,r)})).sort((l,c)=>l.top-c.top||l.index-c.index),o=Math.max(aN,...e.flatMap(({node:l})=>l===null?[]:[Gm(l).width]));return dN(Kbe(s).flatMap(l=>{const c=Math.round(l.top),u=rF(l.members);return l.members.map(({item:f},h)=>$be(f,t,{x:n,y:c+u[h],width:o}))}))},Wbe=({nodes:e,lanes:t})=>Math.min(...e.map(n=>n.y),...t.map(n=>n.y)),Xbe=({nodes:e,rows:t,lanes:n},r)=>({nodes:e.map(s=>({...s,y:s.y+r})),rows:t.map(s=>({...s,y:s.y+r})),lanes:n.map(s=>({...s,y:s.y+r}))}),Qbe=e=>Xbe(e,oi-Wbe(e)),oF=({nodes:e,lanes:t})=>Math.max(oi-cN,...e.map(n=>n.x+n.width),...t.map(n=>n.x+n.width)),Zbe=(e,t,n)=>[...new Set(n.values())].sort((s,o)=>s-o).reduce((s,o)=>{const l=Hbe(e,o,t,n,s),c=Ybe(l,o,oF(s)+cN,u=>zbe(u,o,t,n,s));return dN([s,c])},uN),Jbe=({edge:e},t)=>t.filter(n=>n.edgeIds.includes(e.id)).sort((n,r)=>n.column-r.column).flatMap(n=>[{x:n.x,y:xC(n,e.id)},{x:n.x+n.width,y:xC(n,e.id)}]),eve=(e,{nodes:t,rows:n,lanes:r})=>{const s=new Map(t.map(l=>[l.id,l])),o=new Map(n.map(l=>[l.id,l]));return e.flatMap(l=>{const{edge:c}=l,u=s.get(c.from),f=s.get(c.to),h=s.get(l.from),p=s.get(l.to);if(u===void 0||f===void 0||h===void 0||p===void 0)return[];const y=c.fromRowId===null?void 0:o.get(c.fromRowId),x=c.toRowId===null?void 0:o.get(c.toRowId);return[{link:l,start:{x:h.x+h.width,y:y===void 0?gC(u):yC(y)},lanePoints:Jbe(l,r),end:{x:p.x,y:x===void 0?gC(f):yC(x)},fromRow:y,toRow:x}]})},cD=({link:e,toRow:t})=>(t==null?void 0:t.id)??e.edge.to,uD=({start:e,lanePoints:t})=>t.length===0?e.y:t[t.length-1].y,tve=(e,t)=>{const n=t.filter(l=>cD(l)===cD(e)).map((l,c)=>({other:l,index:c})).sort((l,c)=>uD(l.other)-uD(c.other)||l.index-c.index),r=(e.toRow===void 0?Qa:e.toRow.height)-Tbe*io,s=n.length<io?0:Math.min($p,r/(n.length-1)),o=n.findIndex(({other:l})=>l===e);return Math.round((o-(n.length-1)/io)*s)},iF=({start:e,end:t})=>e.x>=t.x,nve=(e,t,{nodes:n,lanes:r})=>Math.max(...n.filter(s=>s.x<t&&s.x+s.width>e).map(s=>s.y+s.height),...r.filter(s=>s.x<t&&s.x+s.width>e).map(s=>s.y+hx(s.edgeIds))),rve=(e,t,n,r)=>{const s=n.filter(iF),o=e.start.x+xf+s.indexOf(e)*$p,l=t.x-xf,c=Math.max(...s.map(u=>nve(u.end.x,u.start.x,r)))+qm/io+s.indexOf(e)*$p;return[{x:o,y:e.start.y},{x:o,y:c},{x:l,y:c},{x:l,y:t.y}]},sve=(e,t,n)=>{const{link:r,start:s,lanePoints:o,fromRow:l,toRow:c}=e,u={x:e.end.x,y:e.end.y+tve(e,t)},f=iF(e)?rve(e,u,t,n):[...o,{x:u.x-xf,y:u.y}];return{...r.edge,points:[s,...f,u],fromRowPoints:l===void 0?null:[{x:l.x+l.width,y:s.y},s],toRowPoints:c===void 0?null:[u,{x:c.x,y:u.y}]}},ove=(e,t)=>{const n=eve(e,t);return n.map(r=>sve(r,n,t))},ive=(e,t)=>{if(e.length===0)return{width:oi*io,height:oi*io,nodes:[],rows:[],edges:[]};const n=kbe(e,t),r=Dbe(e,n),s=Qbe(Zbe(e,n,r)),o=ove(n,s),l=o.flatMap(c=>c.points);return{width:Math.max(oF(s),...l.map(c=>c.x))+oi,height:Math.max(...s.nodes.map(c=>c.y+c.height),...s.lanes.map(c=>c.y+hx(c.edgeIds)),...l.map(c=>c.y))+oi,nodes:s.nodes,rows:s.rows,edges:o}},lF=2,dD={x:0,y:0},bC="left",fD=({x:e,y:t})=>e===0&&t===0,Ad=(e,t)=>({...e,x:e.x+t.x,y:e.y+t.y}),lve=(e,t,n)=>{const r=t.map(c=>{var u;return(((u=n.get(c.id))==null?void 0:u.x)??c.x)+c.width}),s=Math.max(...r)+cN,o=t.map(c=>{var u;return((u=n.get(c.id))==null?void 0:u.y)??c.y}),l=e.reduce(({bottom:c,positions:u},f)=>({bottom:c+f.height+qm,positions:[...u,[f.id,{x:s,y:c}]]}),{bottom:Math.max(oi,Math.min(...o)),positions:[]});return new Map(l.positions)},ave=(e,{x:t,y:n,width:r,height:s})=>{const o=[["left",Math.abs(e.x-t)],["top",Math.abs(e.y-n)],["bottom",Math.abs(e.y-(n+s))]],l=e.x>t+r/lF,[c]=[...o].filter(([u])=>u!=="left"||!l).sort(([,u],[,f])=>u-f);return c[0]},cve=(e,t)=>{const n=e.nodes.filter(o=>o.depth===0),r=n.filter(o=>t.has(o.id)),s=n.filter(o=>!t.has(o.id));return r.length===0||s.length===0?t:new Map([...t,...lve(s,r,t)])},uve=(e,t)=>{const n=e.x+e.width/lF;return t==="top"?[{x:n,y:e.y-xf},{x:n,y:e.y}]:[{x:n,y:e.y+e.height+xf},{x:n,y:e.y+e.height}]},dve=(e,t,n,r,s)=>{const o=Ad(e.points[0],t),l=e.fromRowPoints===null?null:e.fromRowPoints.map(u=>Ad(u,t));if(r!==bC&&s!==void 0)return{...e,points:[o,...uve(s,r)],fromRowPoints:l,toRowPoints:null};const c=Ad(e.points[e.points.length-1],n);return{...e,points:[o,{x:c.x-xf,y:c.y},c],fromRowPoints:l,toRowPoints:e.toRowPoints===null?null:e.toRowPoints.map(u=>Ad(u,n))}},fve=(e,t,n)=>{const r=e.nodes.filter(h=>h.depth===0),s=new Map(r.map(h=>{const p=t.get(h.id);return[h.id,p===void 0?dD:{x:p.x-h.x,y:p.y-h.y}]})),o=h=>s.get(h)??dD,l=e.nodes.map(h=>Ad(h,o(h.topId))),c=new Map(l.map(h=>[h.id,h])),u=h=>{var p;return o(((p=c.get(h))==null?void 0:p.topId)??h)},f=e.edges.map(h=>{const p=u(h.from),y=u(h.to),x=n.get(h.id)??bC;return fD(p)&&fD(y)&&x===bC?h:dve(h,p,y,x,c.get(h.to))});return{width:Math.max(e.width,...l.map(h=>h.x+h.width+oi)),height:Math.max(e.height,...l.map(h=>h.y+h.height+oi)),nodes:l,rows:e.rows.map(h=>Ad(h,u(h.nodeId))),edges:f}},hve={x:0,y:0},aF=e=>e.flatMap(t=>[...t.children.map(n=>[n.id,t.id]),...aF(t.children)]),px=(e,t)=>({...e,x:e.x-t.x,y:e.y-t.y}),mx=(e,t)=>`${e}:${t}`,pve=({id:e,from:t,to:n,points:r,fromRowPoints:s,toRowPoints:o})=>[{id:e,edgeId:e,source:t,target:n,points:r,hasArrow:o===null,isAboveNodes:!1},...s===null?[]:[{id:`${e}:from-row`,edgeId:e,source:t,target:t,points:s,hasArrow:!1,isAboveNodes:!0}],...o===null?[]:[{id:`${e}:to-row`,edgeId:e,source:n,target:n,points:o,hasArrow:!0,isAboveNodes:!0}]],mve=e=>{const t=e.flatMap(pve);return[...t.filter(n=>!n.isAboveNodes),...t.filter(n=>n.isAboveNodes)]},gve=(e,t)=>t.flatMap(({id:n,source:r,target:s,points:o})=>[...r===e.id?[{id:mx(n,"source"),type:"source",...px(o[0],e)}]:[],...s===e.id?[{id:mx(n,"target"),type:"target",...px(o[o.length-1],e)}]:[]]),yve=({id:e,edgeId:t,source:n,target:r,points:s,hasArrow:o,isAboveNodes:l})=>({id:e,edgeId:t,source:n,target:r,sourceHandleId:mx(e,"source"),targetHandleId:mx(e,"target"),bends:s.slice(1,-1),hasArrow:o,isAboveNodes:l}),xve=(e,t)=>{const n=new Map(aF(e)),r=new Map(t.nodes.map(o=>[o.id,o])),s=mve(t.edges);return{frames:t.nodes.map(o=>{const l=n.get(o.id)??null,c=l===null?void 0:r.get(l);return{id:o.id,parentId:c===void 0?null:c.id,depth:o.depth,position:px({x:o.x,y:o.y},c??hve),width:o.width,height:o.height,rows:t.rows.filter(u=>u.nodeId===o.id).map(u=>px(u,o)),handles:gve(o,s)}}),lines:s.map(yve)}},bve="Not explained yet.",vve="The agent is explaining this card.",cF="Explain this card",gx={"root-argument-value":Ld,call:fE,request:fE,component:yX,hook:d3,class:vX,"root-variable":Ld,config:Ld,state:wd,derived:wd,data:wd,"data-fetch":wd,cache:wd,"render-event":rM,"code-event":rM,effect:hE,"component-effect":hE,route:j1,resolver:j1,middleware:j1},fN={added:"border-diff-added",modified:"border-line-blue"},Sve={added:"text-diff-added",modified:"text-line-blue"},wve={selected:"border-primary outline outline-primary",hovered:"border-primary/60 outline outline-primary/60"},uF={selected:"bg-accent outline outline-primary",hovered:"outline outline-primary/60"},hD={collapsedNodeIds:[],focusedNodeId:null},Eve="call",nl=2,dF="trace-node",fF="trace-new-card",vC="trace-new-card",SC="new-card:line-end",pD="trace-new-card-line",Qh=32,mD="Create Card",Cve="nodrag nopan flex size-full items-center justify-center rounded-full border border-dashed border-primary bg-card text-primary transition-colors duration-[180ms] ease-out hover:bg-accent disabled:opacity-60",wC="trace-line",fw=1e3,Tve=4,hF={source:Ge.Right,target:Ge.Left},pF="right-auto bottom-auto size-0 min-h-0 min-w-0 transform-none border-0 bg-transparent",Nve="size-full bg-[radial-gradient(circle,var(--border)_1px,transparent_1px)] bg-size-[16px_16px] select-none data-[measured=false]:invisible",Rve={hideAttribution:!0},EC="text-muted-foreground",gD={pointerEvents:"all"},Ove="absolute inset-0 rounded-md transition-colors duration-[180ms] ease-out",Ave="flex w-full flex-col rounded-md text-left",kve="flex h-7 shrink-0 items-center gap-2 rounded-t-md border-b border-input bg-foreground/5 px-2.5",_ve="flex min-h-0 flex-1 flex-col justify-center gap-1 px-3",yD={argument:Ld,property:Ld,state:wd,hook:d3,effect:hE,call:fE},mF="absolute flex items-center gap-2 rounded border border-input bg-card px-2 text-left transition-colors duration-[180ms] ease-out hover:bg-accent",Mve="absolute top-1 right-1 z-10 hidden gap-0.5 rounded-md border border-input bg-card p-0.5 group-focus-within:flex group-hover:flex data-[pinned=true]:flex",Z0="flex size-6 items-center justify-center rounded text-foreground transition-colors duration-[180ms] ease-out hover:bg-accent aria-pressed:text-primary-text",Ive="Parameters",Lve=":parameters",Dve=6.7,jve=14,Pve=4,zve="absolute flex flex-wrap content-start gap-1",Bve="flex h-5 max-w-full items-center rounded-sm border bg-muted px-1.5 font-mono text-[0.6875rem] leading-4 text-muted-foreground",Hve="absolute flex items-end px-0.5 text-[0.625rem] leading-3 font-bold tracking-wide text-muted-foreground uppercase",xD="Show only the paths through this node",Fve="Hide the nodes this node leads to",$ve="Show the nodes this node leads to again",bD="Modify this card",vD="Delete this card and the cards it points to",Uve="Remove the selected line",Vve="Add card",gF="Clear diagram",yF="Remove diagram",qve="This diagram has no card yet.",Gve="c",Kve="k",Yve="l",Wve={clear:{title:"Clear this diagram?",description:"Every card, every line and the description go. The diagram stays, empty.",confirmLabel:gF},remove:{title:"Remove this diagram?",description:"The diagram goes from this segment with its cards, its lines and its description.",confirmLabel:yF}},Xve="Draw a line from this row",xF=["left","top","bottom"],Qve={left:Ge.Left,top:Ge.Top,bottom:Ge.Bottom},Zve={left:"End a line on the left of this card",top:"End a line on the top of this card",bottom:"End a line on the bottom of this card"},Up="row:",Jve="side:",SD=5,wD=10,eSe="nodrag right-auto bottom-auto z-10 size-2.5 min-h-0 min-w-0 transform-none rounded-full border border-primary bg-card opacity-60 transition-opacity duration-[180ms] ease-out hover:opacity-100",tSe="cursor-pointer fill-none stroke-transparent [stroke-width:14]",nSe=new Map,rSe=".react-flow__node",sSe=28,oSe={stroke:"var(--primary)",strokeWidth:2},iSe="Collapse all",lSe="Expand all",aSe="q",hN=e=>e.flatMap(t=>[t,...hN(t.children)]),cSe=":heading:",bF=(e,t)=>[e.id,String(t)].join(cSe),vF=e=>e.blockLists.flatMap(({kind:t,label:n,blocks:r})=>r.map(s=>({kind:t,kindLabel:n,block:s}))),uSe=e=>e.rowGroups.flatMap(({label:t},n)=>t===null?[]:[{id:bF(e,n),label:t}]),dSe=e=>Math.min(YH,e.length*Dve+jve),fSe=e=>e.reduce(({lineCount:t,lineWidth:n},r)=>{const s=dSe(r),o=n===0?s:n+Pve+s;return o<=YH?{lineCount:t,lineWidth:o}:{lineCount:t+1,lineWidth:s}},{lineCount:1,lineWidth:0}).lineCount,hSe=e=>`${e.id}${Lve}`,pSe=e=>e.parameters.length===0?[]:[{id:hSe(e),kind:"parameters",lineCount:fSe(e.parameters)}],mSe=({isDraft:e})=>e?"row":"two-line-row",gSe=e=>{const t=new Map([...e.blockLists.flatMap(({blocks:n})=>n),...e.triggerLabels].map(n=>[n.id,n]));return[...pSe(e),...e.rowGroups.flatMap(({label:n,rowIds:r,childIds:s},o)=>[...n===null?[]:[{id:bF(e,o),kind:"heading"}],...r.flatMap(l=>{const c=t.get(l);return c===void 0?[]:[{id:l,kind:mSe(c)}]}),...s.map(l=>({id:l,kind:"card"}))])]},SF=e=>({id:e.id,rows:gSe(e),children:e.children.map(SF)}),ySe=e=>new Map(e.flatMap(t=>hN([t]).map(n=>[n.id,t.id]))),xSe=(e,t)=>e.flatMap(n=>{const r=t.get(n.from),s=t.get(n.to);return r===void 0||s===void 0||r===s?[]:[{id:n.id,from:r,to:s}]}),ED=(e,t,{collapsedNodeIds:n,focusedNodeId:r})=>{const s=e.filter(u=>t.every(f=>f.to!==u.id)).map(u=>u.id),o=[...Vle(t,n,s)].filter(u=>!n.includes(u)),l=r===null?null:Ule(t,r),c=l===null?[]:e.filter(u=>!l.has(u.id)).map(u=>u.id);return new Set([...o,...c])},bSe=(e,t)=>e.includes(t)?e.filter(n=>n!==t):[...e,t],CD=(e,t,n)=>t.has(e)?"selected":n.has(e)?"hovered":null,vSe=(e,t)=>{const n=e===null?"border":"border-2";return t!==null?xe(n,wve[t]):xe(n,e===null?"border-input":fN[e])},yx=({x:e,y:t,width:n,height:r})=>({left:e,top:t,width:n,height:r}),SSe=({hint:e})=>e===null?null:g.jsx("span",{className:"line-clamp-2 text-[0.75rem] leading-4 text-muted-foreground",children:e}),wSe=(e,t)=>e===null||t===null||!e.isDraft||e.isBeingWritten?[]:[Un({key:_f,actionId:"explain-trace-card-action",label:cF,onRun:()=>{t(e.id)}})],ESe=(e,t,n)=>e===null?[]:[Un({key:Gve,actionId:"add-card-action",label:Vve,onRun:e.onAddCard}),Un({key:Kve,actionId:"clear-diagram-action",label:gF,isDisabled:e.isPending||t===0,disabledHint:t===0?qve:null,onRun:()=>{n("clear")}}),Un({key:Yve,actionId:"remove-diagram-action",label:yF,isDisabled:e.isPending,onRun:()=>{n("remove")}})],CSe=(e,t)=>t==="clear"?e.onClearDiagram:e.onRemoveDiagram,TSe=({node:e,cardActions:t,depth:n,emphasis:r,isSelected:s,isCollapsed:o,isFocusedOn:l,onSelect:c,onHoverChange:u,onFocusToggle:f,onCollapseToggle:h})=>{const p=Object.hasOwn(gx,e.type)?gx[e.type]:M2,y=o?C3:SX,x=o?$ve:Fve;return g.jsxs("div",{"data-node-id":e.id,"data-type":e.type,"data-change":e.change??void 0,"data-emphasis":r??void 0,className:xe("group",Ove,n%nl===1?"bg-muted":"bg-card",vSe(e.change,r)),children:[g.jsxs("button",{type:"button","aria-pressed":s,"data-user-action-id":"trace-diagram-card-action","data-change":e.change??void 0,className:Ave,style:{height:Qa},onMouseEnter:()=>{u(!0)},onMouseLeave:()=>{u(!1)},onFocus:()=>{u(!0)},onBlur:()=>{u(!1)},onClick:c,children:[g.jsxs("span",{"data-node-header":e.id,className:kve,children:[g.jsx(p,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),g.jsx("span",{className:"max-w-[60%] shrink-0 truncate font-mono text-[0.75rem] leading-4 font-bold",children:e.name}),g.jsx("span",{title:e.shortPath,className:"ml-auto min-w-0 truncate font-mono text-[0.6875rem] leading-4 text-muted-foreground",children:e.shortPath})]}),g.jsxs("span",{className:_ve,children:[g.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-[0.6875rem] leading-4 text-muted-foreground",children:[g.jsx("span",{className:"shrink-0",children:e.typeLabel}),e.classification.label===e.typeLabel?null:g.jsx("span",{className:"min-w-0 truncate before:mr-1 before:content-['•']",children:e.classification.label}),e.change===null||e.changedLabel===null?null:g.jsx("span",{className:xe("ml-auto font-bold",Sve[e.change]),children:e.changedLabel})]}),g.jsx(cl,{isPending:e.isDraft,lineCount:2,className:"w-full gap-1 py-0 text-[0.8125rem] [&>[aria-hidden]]:my-[0.2em]",children:e.isDraft?g.jsx(SSe,{hint:e.hint}):g.jsx("span",{className:"line-clamp-2 text-[0.8125rem] leading-4 font-bold",children:e.label})})]})]}),n>0&&t===null?null:g.jsxs("div",{role:"toolbar","aria-label":e.label,"data-pinned":l||o,className:xe("nodrag",Mve),children:[t===null?null:g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button","aria-label":`${bD}: ${e.label}`,title:bD,className:Z0,onClick:t.onEdit,children:g.jsx(G3,{"aria-hidden":"true",className:"size-3.5"})}),g.jsx("button",{type:"button",disabled:t.isPending,"aria-label":`${vD}: ${e.label}`,title:vD,className:Z0,onClick:t.onRemove,children:g.jsx(_2,{"aria-hidden":"true",className:"size-3.5"})})]}),n>0?null:g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button","aria-pressed":l,"aria-label":`${xD}: ${e.label}`,title:xD,className:Z0,onClick:f,children:g.jsx(NX,{"aria-hidden":"true",className:"size-3.5"})}),g.jsx("button",{type:"button","aria-pressed":o,"aria-label":`${x}: ${e.label}`,title:x,className:Z0,onClick:h,children:g.jsx(y,{"aria-hidden":"true",className:"size-3.5"})})]})]})]})},NSe=({trigger:e,placed:t,emphasis:n,onSelect:r,onHoverChange:s})=>{const o=Object.hasOwn(gx,e.type)?gx[e.type]:M2;return g.jsxs("button",{type:"button","data-trigger-id":e.id,"data-change":e.change??void 0,"aria-label":`${e.typeLabel}: ${e.label}`,title:e.isDraft?e.hint??void 0:void 0,className:xe(mF,e.change!==null&&fN[e.change],n!==null&&uF[n]),style:yx(t),onMouseEnter:()=>{s(!0)},onMouseLeave:()=>{s(!1)},onFocus:()=>{s(!0)},onBlur:()=>{s(!1)},onClick:r,children:[g.jsx(o,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),g.jsxs("span",{className:"flex min-w-0 flex-col",children:[g.jsx(cl,{isPending:e.isDraft,className:"h-4 w-24 py-0 text-[0.75rem]",children:g.jsx("span",{className:xe("truncate text-[0.75rem] leading-4",e.isDraft?"font-mono text-muted-foreground":"font-bold"),children:e.label})}),e.isDraft?null:g.jsx("span",{className:"truncate font-mono text-[0.6875rem] leading-4 text-muted-foreground",children:e.name})]})]})},RSe=({row:{kind:e,kindLabel:t,block:n},placed:r,emphasis:s,onSelect:o,onHoverChange:l})=>{const c=Object.hasOwn(yD,e)?yD[e]:M2;return g.jsxs("button",{type:"button","data-block-id":n.id,"data-block-kind":e,"data-change":n.change??void 0,"aria-label":`${t}: ${n.label}`,title:n.isDraft?n.hint??void 0:void 0,className:xe(mF,n.change!==null&&fN[n.change],s!==null&&uF[s]),style:yx(r),onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)},onFocus:()=>{l(!0)},onBlur:()=>{l(!1)},onClick:o,children:[g.jsx(c,{"aria-hidden":"true",className:"size-3.5 shrink-0 text-muted-foreground"}),g.jsxs("span",{className:"flex min-w-0 flex-col",children:[g.jsx(cl,{isPending:n.isDraft,className:"h-4 w-24 py-0 text-[0.75rem]",children:g.jsx("span",{className:xe("truncate text-[0.75rem] leading-4",n.isDraft?"font-mono text-muted-foreground":"font-bold"),children:n.label})}),n.isDraft?null:g.jsx("span",{className:"truncate font-mono text-[0.6875rem] leading-4 text-muted-foreground",children:n.name})]})]})},wF=e=>`${Up}${e}`,pN=e=>`${Jve}${e}`,OSe=(e,{width:t,height:n})=>e==="left"?{x:0,y:Qa/nl}:{x:t/nl,y:e==="top"?0:n},TD=({x:e,y:t})=>({x:e-SD,y:t-SD}),EF=e=>[...e.rows.filter(t=>t.kind!=="heading"&&t.kind!=="parameters").map(t=>({id:wF(t.id),type:"source",position:Ge.Right,title:Xve,...TD({x:e.width,y:t.y+t.height/nl})})),...xF.map(t=>({id:pN(t),type:"target",position:Qve[t],title:Zve[t],...TD(OSe(t,e))}))],ASe=({data:{node:e,frame:t,cardActions:n,emphasis:r,isSelected:s,isCollapsed:o,isFocusedOn:l,onSelect:c,onHoverChange:u,onFocusToggle:f,onCollapseToggle:h}})=>{const p=new Map(uSe(e).map(b=>[b.id,b])),y=new Map(vF(e).map(b=>[b.block.id,b])),x=new Map(e.triggerLabels.map(b=>[b.id,b]));return g.jsxs(g.Fragment,{children:[g.jsx(TSe,{node:e,cardActions:n,depth:t.depth,emphasis:r,isSelected:s,isCollapsed:o,isFocusedOn:l,onSelect:()=>{c(null)},onHoverChange:u,onFocusToggle:f,onCollapseToggle:h}),t.rows.flatMap(b=>{const S=p.get(b.id),E=y.get(b.id),C=x.get(b.id);if(S!==void 0)return[g.jsx("span",{"data-row-heading":e.id,className:Hve,style:yx(b),children:S.label},b.id)];if(b.kind==="parameters")return[g.jsx("ul",{"aria-label":Ive,className:zve,style:yx(b),children:e.parameters.map(T=>g.jsx("li",{title:T,className:Bve,children:g.jsx("span",{className:"truncate",children:T})},T))},b.id)];const R=()=>{c(b.id)};return E!==void 0?[g.jsx(RSe,{row:E,placed:b,emphasis:r,onSelect:R,onHoverChange:u},b.id)]:C===void 0?[]:[g.jsx(NSe,{trigger:C,placed:b,emphasis:r,onSelect:R,onHoverChange:u},b.id)]}),t.handles.map(b=>g.jsx(fu,{id:b.id,type:b.type,position:hF[b.type],isConnectable:!1,className:pF,style:{left:b.x,top:b.y}},b.id)),n===null?null:EF(t).map(b=>g.jsx(fu,{id:b.id,type:b.type,position:b.position,title:b.title,className:eSe,style:{left:b.x,top:b.y}},b.id))]})},ND=({x:e,y:t})=>({x:Math.round(e),y:Math.round(t)}),kSe=({sourceX:e,sourceY:t,targetX:n,targetY:r,data:s})=>s===void 0?null:g.jsxs(g.Fragment,{children:[g.jsx(ube,{path:qE([{x:e,y:t},...s.bends,{x:n,y:r}].map(ND)),kind:Eve,isAssumed:!1,emphasis:s.emphasis,hasArrow:s.hasArrow,markers:s.markers}),s.isSelectable?g.jsx("path",{d:qE([{x:e,y:t},...s.bends,{x:n,y:r}].map(ND)),className:tSe}):null]}),_Se=({data:{isPending:e,onCreate:t}})=>g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button",disabled:e,"aria-label":mD,title:mD,className:Cve,onClick:t,children:g.jsx(k2,{"aria-hidden":"true",className:"size-4"})}),g.jsx(fu,{id:SC,type:"target",position:Ge.Left,isConnectable:!1,className:pF,style:{left:0,top:Qh/nl}})]}),MSe={[dF]:ASe,[fF]:_Se},ISe={[wC]:kSe},LSe=e=>e.width,RD=({source:e,target:t})=>e!==t,DSe=e=>{const t="changedTouches"in e?e.changedTouches.item(0):e;return t===null?null:{x:t.clientX,y:t.clientY}},jSe=(e,{isValid:t,fromNode:n,fromHandle:r})=>{var f;const s=DSe(e);if(t===!0||s===null||n===null)return null;const o=r.id??null;if((o==null?void 0:o.startsWith(Up))!==!0)return null;const l=((f=document.elementFromPoint(s.x,s.y))==null?void 0:f.closest(rSe))??null,c=(l==null?void 0:l.dataset.id)??null;if(l===null||c===null||c===vC)return{kind:"board",line:{from:n.id,fromRowId:o.slice(Up.length)},point:s};const u=pN(ave(s,l.getBoundingClientRect()));return{kind:"card",connection:{source:n.id,sourceHandle:o,target:c,targetHandle:u}}},PSe=({label:e,authoring:t,moving:n,width:r,view:{zoom:s,offset:o,onPan:l},nodes:c,edges:u,markers:f})=>{const h=Mt(LSe),{screenToFlowPosition:p}=Mb(),y=Math.max(0,(h-r*s)/nl),x=(S,E)=>{const C=jSe(S,E);(C==null?void 0:C.kind)==="card"&&RD(C.connection)&&(t==null||t.onConnect(C.connection)),(C==null?void 0:C.kind)==="board"&&(t==null||t.onLineDropOnBoard(C.line,C.point,p))},b=S=>{S.forEach(E=>{E.type==="position"&&E.position!==void 0&&(n==null||n.onCardDrag(E.id,E.position))})};return g.jsx("div",{role:"group","aria-label":e,"data-measured":h>0,className:Nve,style:{backgroundPosition:`${String(o.x)}px ${String(o.y)}px`},children:g.jsx(Txe,{nodes:c,edges:u,nodeTypes:MSe,edgeTypes:ISe,viewport:{x:y+o.x,y:o.y,zoom:s},onViewportChange:({x:S,y:E})=>{l({x:S-y,y:E})},zIndexMode:"manual",paneClickDistance:Tve,nodesDraggable:n!==null,nodesConnectable:t!==null,isValidConnection:RD,onNodesChange:n===null?void 0:b,onNodeDragStop:n===null?void 0:(S,E)=>{n.onCardDrop(E.id,E.position)},onConnect:t===null?void 0:t.onConnect,onConnectEnd:t===null?void 0:x,connectionRadius:sSe,connectionLineStyle:oSe,onEdgeClick:t===null?void 0:(S,E)=>{E.data!==void 0&&t.onLineSelect(E.data.edgeId)},onPaneClick:t===null?void 0:t.onBoardClick,nodesFocusable:!1,edgesFocusable:!1,elementsSelectable:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomOnDoubleClick:!1,preventScrolling:!1,deleteKeyCode:null,disableKeyboardA11y:!0,proOptions:Rve,children:g.jsx("svg",{"aria-hidden":"true",className:xe("absolute size-0",EC),children:g.jsx(cbe,{markers:f})})})})},zSe=({source:e,sourceHandle:t,target:n,targetHandle:r})=>{const s=xF.find(o=>pN(o)===r);return(t==null?void 0:t.startsWith(Up))!==!0||s===void 0?null:{from:e,fromRowId:t.slice(Up.length),to:n,toSide:s}},BSe=({title:e,nodes:t,edges:n,codeLinks:r,codeDefinitions:s,isReviewPending:o,authoring:l=null,cardMoving:c=null,navigatorAnchorId:u=null,onWriteUpNode:f=null,onOpenCodeLink:h,onWaypointReviewedChange:p})=>{var xt,nn;const[y,x]=N.useState(nSe),[b,S]=N.useState(null),[E,C]=N.useState(null),[R,T]=N.useState(null),[O,k]=N.useState(null),[M,A]=N.useState(null),[L,I]=N.useState(hD),[j,P]=N.useState(!1),[B,H]=N.useState(null),D=abe(),{collapsedNodeIds:F,focusedNodeId:z}=L,q=ySe(t),V=xSe(n,q),G=ED(t,V,L),K=t.filter(Ce=>!G.has(Ce.id)),X=hN(K),ee=new Set(X.map(Ce=>Ce.id)),ae=n.filter(Ce=>ee.has(Ce.from)&&ee.has(Ce.to)),$=K.map(SF),Y=ive($,ae),J=new Map(t.flatMap(Ce=>Ce.position===null?[]:[[Ce.id,Ce.position]])),ne=new Map([...cve(Y,J),...y]),W=fve(Y,ne,new Map(ae.map(Ce=>[Ce.id,Ce.toSide]))),ce=ae.find(Ce=>Ce.id===b)??null,ye=W.nodes.filter(Ce=>Ce.depth===0).map(Ce=>({nodeId:Ce.id,x:Ce.x,y:Ce.y})),pe=c===null?null:{onCardDrag:(Ce,De)=>{x(tt=>new Map([...tt,[Ce,De]]))},onCardDrop:(Ce,De)=>{c.onMoveCards(ye.map(tt=>tt.nodeId===Ce?{nodeId:Ce,x:De.x,y:De.y}:tt))}},le=l===null?null:{onLineDropOnBoard:(Ce,De,tt)=>{C({...Ce,end:tt(De),cardCount:t.length})},onConnect:Ce=>{const De=zSe(Ce);De!==null&&l.onDrawLine(De)},onLineSelect:S,onBoardClick:()=>{S(null),C(null)}},re=l!==null&&E!==null&&E.cardCount===t.length&&ee.has(E.from)?E:null,he=xve($,W),Se=new Map(X.map(Ce=>[Ce.id,Ce])),_e=new Map(X.flatMap(Ce=>vF(Ce).map(De=>[De.block.id,De]))),be=new Map(X.flatMap(Ce=>Ce.triggerLabels.map(De=>[De.id,De]))),Ae=GE(ae,R),Me=GE(ae,M),Le=R===null?null:Se.get(R)??null,ue=(Le==null?void 0:Le.codeLinkId)==null||!Object.hasOwn(r,Le.codeLinkId)?null:r[Le.codeLinkId],Re=O===null?null:((xt=_e.get(O))==null?void 0:xt.block.lines)??((nn=be.get(O))==null?void 0:nn.lines)??null,ze=(Ce,De)=>{T(Ce),k(De),P(!0)},ke=Ce=>{I(Ce),A(null);const De=R===null?void 0:q.get(R);De!==void 0&&ED(t,V,Ce).has(De)&&T(null)},je=t.filter(Ce=>V.some(De=>De.from===Ce.id)).map(Ce=>Ce.id),Ne=he.frames.flatMap(Ce=>{const De=Se.get(Ce.id);return De===void 0?[]:[{id:Ce.id,type:dF,...Ce.parentId===null?{}:{parentId:Ce.parentId},position:Ce.position,width:Ce.width,height:Ce.height,zIndex:Ce.depth,draggable:c!==null&&Ce.depth===0,style:gD,handles:[...Ce.handles.map(({id:tt,type:Ot,x:gn,y:yn})=>({id:tt,type:Ot,position:hF[Ot],x:gn,y:yn,width:0,height:0})),...l===null?[]:EF(Ce).map(({id:tt,type:Ot,position:gn,x:yn,y:Fr})=>({id:tt,type:Ot,position:gn,x:yn,y:Fr,width:wD,height:wD}))],data:{node:De,frame:Ce,cardActions:l===null?null:{isPending:l.isPending,onEdit:()=>{l.onEditCard(Ce.id)},onRemove:()=>{l.onRemoveCard(Ce.id)}},emphasis:CD(Ce.id,Ae.nodeIds,Me.nodeIds),isSelected:Ce.id===R,isCollapsed:F.includes(Ce.id),isFocusedOn:Ce.id===z,onSelect:tt=>{ze(Ce.id,tt)},onHoverChange:tt=>{A(tt?Ce.id:null)},onFocusToggle:()=>{ke({...L,focusedNodeId:Ce.id===z?null:Ce.id})},onCollapseToggle:()=>{ke({...L,collapsedNodeIds:bSe(F,Ce.id)})}}}]}),ve=he.lines.map(Ce=>({id:Ce.id,type:wC,source:Ce.source,target:Ce.target,sourceHandle:Ce.sourceHandleId,targetHandle:Ce.targetHandleId,zIndex:Ce.isAboveNodes?fw:0,className:xe(EC,l!==null&&Ce.isAboveNodes&&"pointer-events-none"),domAttributes:{"aria-hidden":!0},data:{edgeId:Ce.edgeId,isSelectable:l!==null&&!Ce.isAboveNodes,bends:Ce.bends,emphasis:Ce.edgeId===b?"selected":CD(Ce.edgeId,Ae.edgeIds,Me.edgeIds),hasArrow:Ce.hasArrow,markers:D}})),Fe=l===null||re===null?[]:[{id:vC,type:fF,position:{x:re.end.x,y:re.end.y-Qh/nl},width:Qh,height:Qh,zIndex:fw,draggable:!1,style:gD,handles:[{id:SC,type:"target",position:Ge.Left,x:0,y:Qh/nl,width:0,height:0}],data:{isPending:l.isPending,onCreate:()=>{const{from:Ce,fromRowId:De,end:tt}=re;l.onAddCardAtLineEnd({from:Ce,fromRowId:De,position:{x:tt.x,y:tt.y-Qa/nl},places:ye})}}}],Ye=re===null?[]:[{id:pD,type:wC,source:re.from,target:vC,sourceHandle:wF(re.fromRowId),targetHandle:SC,zIndex:fw,className:xe(EC,"pointer-events-none"),domAttributes:{"aria-hidden":!0},data:{edgeId:pD,isSelectable:!1,bends:[],emphasis:null,hasArrow:!0,markers:D}}];return g.jsxs(g.Fragment,{children:[g.jsx(LB,{label:e,width:W.width,height:W.height,isFullScreen:j,onFullScreenChange:Ce=>{P(Ce),Ce||T(null)},onPanelClose:()=>{T(null)},navigation:u===null?null:{anchorId:u,groups:[[Un({key:aSe,actionId:"collapse-trace-cards-action",label:F.length===0?iSe:lSe,onRun:()=>{ke(F.length===0?{collapsedNodeIds:je,focusedNodeId:null}:hD)}}),...wSe(Le,f)],ESe(l,t.length,H)]},actions:l===null||ce===null?null:g.jsx(Nr,{icon:"delete",label:Uve,isDisabled:l.isPending,onClick:()=>{l.onRemoveLine({edgeId:ce.id,from:ce.from,to:ce.to}),S(null)}}),panel:Le===null?null:g.jsxs(u6,{title:Le.label,kindLabel:Le.typeLabel,target:Le.codeViews.length===0?ue:null,codeViews:Le.codeViews.map(Ce=>g.jsx(bbe,{view:Ce,focusedLines:Re,isReviewPending:o,codeLinks:r,codeDefinitions:s,onOpenCodeLink:h,onWaypointReviewedChange:p},Ce.id)),onClose:()=>{T(null)},children:[Le.isDraft?g.jsx(S6,{hint:Le.hint,label:Le.isBeingWritten?vve:bve,isBeingWritten:Le.isBeingWritten,buttonLabel:cF,onWriteUp:f===null?null:()=>{f(Le.id)}}):null,Le.description===null?null:g.jsx(uo,{blocks:Le.description,codeLinks:r,onOpenCodeLink:h})]}),renderCanvas:Ce=>g.jsx($H,{children:g.jsx(PSe,{label:e,authoring:le,moving:pe,width:W.width,view:Ce,nodes:[...Ne,...Fe],edges:[...ve,...Ye],markers:D})})}),l===null||B===null?null:g.jsx(tbe,{...Wve[B],onConfirm:()=>{CSe(l,B)(),H(null)},onCancel:()=>{H(null)}})]})},HSe="Add a diagram",CC="trace-diagram-section",FSe="Edit",$Se="This segment has no Trace Diagram.",USe=3,hw="max-w-[55rem] pb-4",VSe=({heading:e,diagram:t,codeLinks:n,editing:r,renderEditor:s,onOpenCodeLink:o})=>(r==null?void 0:r.isWriting)===!0&&s!==null?g.jsx("div",{className:"pb-4",children:s({label:`${e} description`,markdown:t.descriptionMarkdown,isSaving:r.isSaving,errorMessage:r.errorMessage,onSave:r.onSave,onCancel:r.onCancel})}):t.description===null?g.jsx(cl,{isPending:!0,lineCount:USe,className:xe(hw,"text-base"),children:g.jsx("p",{className:xe(hw,"text-muted-foreground"),children:t.descriptionHint??t.unwrittenLabel})}):g.jsx(uo,{blocks:t.description,codeLinks:n,className:hw,onOpenCodeLink:o}),qSe=[],GSe={authoringOf:()=>null,cardMovingOf:()=>null,writeUpOf:()=>null},CF=({anchorId:e,heading:t,diagram:n,codeLinks:r,codeDefinitions:s,isReviewPending:o,authoring:l,cardMoving:c,onWriteUpNode:u,renderDescriptionEditor:f,onOpenCodeLink:h,onWaypointReviewedChange:p})=>g.jsxs(g.Fragment,{children:[g.jsx(VSe,{heading:t,diagram:n,codeLinks:r,editing:(l==null?void 0:l.description)??null,renderEditor:f,onOpenCodeLink:h}),g.jsx(BSe,{title:n.title,nodes:n.nodes,edges:n.edges,codeLinks:r,codeDefinitions:s,isReviewPending:o,authoring:(l==null?void 0:l.board)??null,cardMoving:c,navigatorAnchorId:e,onWriteUpNode:u,onOpenCodeLink:h,onWaypointReviewedChange:p})]}),KSe=({tabs:e,tabEditing:t,...n})=>{const[r,s]=N.useState(0),o=e.at(r)??e[0],l=c=>{var f;const u=y6(c.key,r,e.length);u!==null&&(c.preventDefault(),s(u),(f=c.currentTarget.parentElement)==null||f.querySelectorAll("[role=tab]").item(u).focus())};return g.jsxs(g.Fragment,{children:[g.jsx("div",{role:"tablist","aria-label":n.heading,className:xe(m6,"mb-4"),children:e.map((c,u)=>g.jsx("button",{type:"button",role:"tab","aria-selected":u===r,"aria-controls":u===r?o.diagram.anchorId:void 0,tabIndex:u===r?0:-1,className:g6,onClick:()=>{s(u)},onKeyDown:l,children:c.label},c.id))}),g.jsx("section",{id:o.diagram.anchorId,role:"tabpanel","aria-label":o.label,"data-view-section-id":CC,className:"scroll-mt-(--section-scroll-margin)",children:g.jsx(CF,{...n,diagram:o.diagram,authoring:t.authoringOf(o.id),cardMoving:t.cardMovingOf(o.id),onWriteUpNode:t.writeUpOf(o.id)},o.id)})]})},YSe=({anchorId:e,heading:t,diagram:n,tabs:r=qSe,tabEditing:s=null,codeLinks:o,codeDefinitions:l,isReviewPending:c,writeUpNotice:u=null,onWriteUpNode:f=null,authoring:h=null,cardMoving:p=null,renderDescriptionEditor:y=null,onOpenCodeLink:x,onWaypointReviewedChange:b})=>{const S=h!==null&&n!==null&&y!==null&&!h.description.isWriting,E={anchorId:e,heading:t,codeLinks:o,codeDefinitions:l,isReviewPending:c,renderDescriptionEditor:y,onOpenCodeLink:x,onWaypointReviewedChange:b};return g.jsxs("section",{id:e,"aria-labelledby":`${e}-heading`,"data-view-section-id":CC,className:"scroll-mt-(--section-scroll-margin) border-t pt-6 pb-8",children:[g.jsxs("div",{className:"flex items-center gap-3 pb-4",children:[g.jsx("h2",{id:`${e}-heading`,className:"text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:t}),u===null?null:g.jsx(Df,{label:u}),h!==null&&n===null&&r.length===0?g.jsx(st,{variant:"link",size:"sm",disabled:h.board.isPending,onClick:h.onAddDiagram,children:HSe}):null,S?g.jsx(st,{variant:"link",size:"sm",onClick:h.description.onEdit,children:FSe}):null]}),h!==null&&n===null&&r.length===0?g.jsx("p",{className:"text-muted-foreground",children:$Se}):null,r.length===0?null:g.jsx(KSe,{...E,tabs:r,tabEditing:s??GSe}),n===null||r.length>0?null:g.jsx("section",{id:n.anchorId,"aria-label":n.title,"data-view-section-id":CC,className:"scroll-mt-(--section-scroll-margin)",children:g.jsx(CF,{...E,diagram:n,authoring:h,cardMoving:p,onWriteUpNode:f})})]})},WSe="flex w-full max-w-xl cursor-pointer items-start gap-3 rounded-lg border border-input bg-card px-3 py-2.5 text-left transition-colors duration-[180ms] ease-out outline-none hover:bg-muted focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 aria-expanded:bg-muted",OD=({option:e})=>g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"block font-bold",children:e.label}),e.summary===null?null:g.jsx("span",{className:"block text-sm",children:e.summary}),g.jsx("span",{className:"block text-sm text-muted-foreground",children:e.description})]}),TF=({label:e,dialogTitle:t,dialogDescription:n,chooseLabel:r,cancelLabel:s,options:o,selectedKey:l,onChoose:c})=>{const u=N.useId(),[f,h]=N.useState(!1),[p,y]=N.useState(l),x=o.find(E=>E.key===l),b=()=>{y(l),h(!0)},S=()=>{c(p),h(!1)};return g.jsxs(g.Fragment,{children:[g.jsxs("button",{type:"button","aria-haspopup":"dialog","aria-expanded":f,"aria-label":x===void 0?e:`${e}, ${x.label}`,className:WSe,onClick:b,children:[g.jsx("span",{className:"min-w-0 flex-1",children:x===void 0?null:g.jsx(OD,{option:x})}),g.jsx(C3,{"aria-hidden":"true",className:"mt-1 size-4 shrink-0 text-muted-foreground"})]}),g.jsx(pl,{open:f,onOpenChange:h,children:g.jsxs(ml,{className:"sm:max-w-xl",children:[g.jsxs(gl,{children:[g.jsx(xl,{children:t}),g.jsx(bl,{children:n})]}),g.jsxs("fieldset",{children:[g.jsx("legend",{className:"sr-only",children:e}),g.jsx("ul",{className:"max-h-[60dvh] overflow-y-auto border-t border-border",children:o.map(E=>g.jsx("li",{className:"border-b border-border py-3",children:g.jsxs("label",{className:"flex cursor-pointer items-start gap-3 text-base",children:[g.jsx("input",{type:"radio",name:u,checked:p===E.key,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{y(E.key)}}),g.jsxs("span",{className:"min-w-0",children:[g.jsx(OD,{option:E}),E.note===null?null:g.jsx("span",{className:"block text-sm text-muted-foreground",children:E.note})]})]})},E.key))})]}),g.jsxs(yl,{children:[g.jsx(st,{type:"button",variant:"ghost",onClick:()=>{h(!1)},children:s}),g.jsx(st,{type:"button",onClick:S,children:r})]})]})})]})},XSe="Prompt configuration",QSe="Choose a prompt configuration",ZSe="It sets the tone the agent writes in and how it words each part.",JSe="Choose",e1e="Cancel",t1e=e=>({key:e.configurationId,label:e.label,summary:e.bestFor,description:e.description,note:e.note}),n1e=({options:e,value:t,onChange:n})=>g.jsx(TF,{label:XSe,dialogTitle:QSe,dialogDescription:ZSe,chooseLabel:JSe,cancelLabel:e1e,options:e.map(t1e),selectedKey:t,onChoose:n}),r1e="Code Walkthrough order",s1e="Choose a Code Walkthrough order",o1e="It decides which changed file you read first.",i1e="Choose",l1e="Cancel",NF=[{value:"imports-bottom-up",label:"Building blocks first",description:"Start with the files the rest of the change depends on, then read the code that uses them."},{value:"imports-top-down",label:"Entry points first",description:"Start where the change is used, like pages and routes, then follow it down to the details."},{value:"important-first",label:"Most important first",description:"Start with the heart of the change and the topics you care about most, then read the rest."}],a1e=NF.map(e=>({key:e.value,label:e.label,summary:null,description:e.description,note:null})),c1e=e=>{var t;return((t=NF.find(n=>n.value===e))==null?void 0:t.value)??null},u1e=({value:e,onChange:t})=>g.jsx(TF,{label:r1e,dialogTitle:s1e,dialogDescription:o1e,chooseLabel:i1e,cancelLabel:l1e,options:a1e,selectedKey:e,onChoose:n=>{const r=c1e(n);r!==null&&t(r)}}),RF=e=>t=>{t.preventDefault(),e()},d1e="Configure",f1e="Not now",h1e="Explain",p1e="Starting…",m1e="Parts to explain",g1e="Prompt configuration",y1e="Code Walkthrough order",OF="Total",x1e="Split this review into segments",pw="pb-2 font-bold",b1e="border-b border-border py-2.5",AD="pt-2 text-destructive",v1e=e=>`Ask ${e} to explain this review?`,S1e=e=>`Flight Plan built this review from the code. ${e} can write the context, the labels, the explanations and the findings.`,AF=e=>e.sections.filter(t=>t.isChosen).map(t=>t.section),w1e=(e,t,n)=>n?[...e,t]:e.filter(r=>r!==t),TC=(e,t)=>(e==null?void 0:e.field)===t?e.message:null,E1e=({plan:e})=>g.jsxs("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-6 gap-y-1.5 border-y border-border py-3",children:[e.summary.map(t=>g.jsxs("div",{className:"contents",children:[g.jsx("dt",{className:"text-muted-foreground",children:t.label}),g.jsx("dd",{className:"font-bold",children:t.value})]},t.label)),g.jsx("dt",{className:"text-muted-foreground",children:OF}),g.jsx("dd",{className:"font-bold tabular-nums",children:e.totalLabel})]}),C1e=({plan:e})=>g.jsxs("p",{className:"flex items-baseline justify-between gap-6 pr-1",children:[g.jsx("span",{className:"text-muted-foreground",children:OF}),g.jsx("span",{className:"font-bold tabular-nums",children:e.totalLabel})]}),T1e=({plan:e,problem:t,configurationId:n,walkthroughOrder:r,isSegmented:s,onSectionsChange:o,onConfigurationChange:l,onWalkthroughOrderChange:c,onSegmentedChange:u})=>{const f=TC(t,"sections"),h=TC(t,"configuration"),p=AF(e);return g.jsxs("div",{className:"grid max-h-[60dvh] gap-5 overflow-y-auto pr-1",children:[g.jsxs("fieldset",{children:[g.jsx("legend",{className:pw,children:m1e}),g.jsx("ul",{className:"border-t border-border",children:e.sections.map(y=>g.jsx("li",{className:b1e,children:g.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[g.jsx("input",{type:"checkbox",checked:y.isChosen,className:"size-4 shrink-0 accent-(--primary)",onChange:x=>{o(w1e(p,y.section,x.target.checked))}}),g.jsx("span",{className:"flex-1 font-bold",children:y.label}),g.jsx("span",{className:"text-muted-foreground tabular-nums",children:y.countLabel})]})},y.section))}),f===null?null:g.jsx("p",{role:"alert",className:AD,children:f})]}),g.jsxs("div",{children:[g.jsx("p",{className:pw,children:g1e}),g.jsx(n1e,{options:e.configurations,value:n,onChange:l}),h===null?null:g.jsx("p",{role:"alert",className:AD,children:h})]}),g.jsxs("div",{children:[g.jsx("p",{className:pw,children:y1e}),g.jsx(u1e,{value:r,onChange:c})]}),g.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[g.jsx("input",{type:"checkbox",checked:s,className:"size-4 shrink-0 accent-(--primary)",onChange:y=>{u(y.target.checked)}}),g.jsx("span",{className:"font-bold",children:x1e})]})]})},N1e=({plan:e,problem:t,isPending:n,onSectionsChange:r,onSubmit:s,onClose:o})=>{const[l,c]=N.useState(!1),[u,f]=N.useState(e.configurationId),[h,p]=N.useState(e.walkthroughOrder),[y,x]=N.useState(e.isSegmented),b=TC(t,"agent"),S=l||t!==null&&t.field!=="agent";return g.jsx(pl,{open:!0,onOpenChange:E=>{E||o()},children:g.jsxs(ml,{className:"sm:max-w-xl",children:[g.jsxs(gl,{children:[g.jsx(xl,{children:v1e(e.agentLabel)}),g.jsx(bl,{children:S1e(e.agentLabel)})]}),g.jsxs("form",{className:"grid gap-4",onSubmit:RF(()=>{s({sections:AF(e),configurationId:u,walkthroughOrder:h,isSegmented:y})}),children:[S?g.jsxs(g.Fragment,{children:[g.jsx(T1e,{plan:e,problem:t,configurationId:u,walkthroughOrder:h,isSegmented:y,onSectionsChange:r,onConfigurationChange:f,onWalkthroughOrderChange:p,onSegmentedChange:x}),g.jsx(C1e,{plan:e})]}):g.jsx(E1e,{plan:e}),b===null?null:g.jsx("p",{role:"alert",className:"text-destructive",children:b}),g.jsxs(yl,{className:"items-center",children:[S?null:g.jsx(st,{type:"button",variant:"link",className:"mr-auto px-0",onClick:()=>{c(!0)},children:d1e}),g.jsx(st,{type:"button",variant:"ghost",onClick:o,children:f1e}),g.jsx(st,{type:"submit",disabled:n,children:n?p1e:h1e})]})]})]})})},R1e=[],O1e="Reading the code blocks…",A1e=(e,t)=>{var s,o,l;const n=ws(),r=Ga(n.review.cardBlocks.queryOptions(t===null?ao:{...e,path:t}));return{blocks:((s=r.data)==null?void 0:s.blocks)??R1e,message:((o=r.error)==null?void 0:o.message)??((l=r.data)==null?void 0:l.message)??(r.isPending&&t!==null?O1e:null)}},k1e="Loading the file…",kF=(e,t)=>{var s,o;const n=ws(),r=Ga(n.review.fileCode.queryOptions(t===null?ao:{...e,path:t}));return{lines:((s=r.data)==null?void 0:s.lines)??null,statusMessage:((o=r.error)==null?void 0:o.message)??(r.isPending&&t!==null?k1e:null)}},_1e=[],mN=(e,t)=>{var c,u,f;const n=ws(),[r,s]=N.useState(""),o=N.useDeferredValue(r),l=Ga({...n.review.searchFiles.queryOptions({...e,query:o,scope:t}),placeholderData:Mx});return{query:r,files:((c=l.data)==null?void 0:c.options)??_1e,message:((u=l.data)==null?void 0:u.message)??null,errorMessage:((f=l.error)==null?void 0:f.message)??null,onQueryChange:s}},M1e=(e,t,n)=>e!==null&&n?{anchorLine:e.anchorLine,headLine:t}:{anchorLine:t,headLine:t},I1e=({anchorLine:e,headLine:t})=>({lineStart:Math.min(e,t),lineEnd:Math.max(e,t)}),L1e=(e,t)=>e!==null&&t>=e.lineStart&&t<=e.lineEnd,D1e=e=>new Set(e===null?[]:Array.from({length:e.lineEnd-e.lineStart+1},(t,n)=>String(e.lineStart+n))),Vp=({lineStart:e,lineEnd:t})=>e===t?`Line ${String(e)}`:`Lines ${String(e)} to ${String(t)}`,j1e={"toggle-off":{isShownAtFirst:!1,canToggle:!0},"toggle-on":{isShownAtFirst:!0,canToggle:!0},"always-on":{isShownAtFirst:!0,canToggle:!1},"always-off":{isShownAtFirst:!1,canToggle:!1}},P1e="Show waypoints",z1e="Hide waypoints",B1e="Select line",H1e="Clear",F1e="[data-line]",xx=10,_F="my-1.5 mr-4 ml-18 rounded-md border border-input bg-background font-sans whitespace-normal",kD=e=>{const t=e instanceof Element?e:(e==null?void 0:e.parentElement)??null;return(t==null?void 0:t.closest(F1e))??null},_D=e=>Number.parseInt((e==null?void 0:e.dataset.line)??"",xx),$1e=e=>{const t=window.getSelection();if(e===null||t===null||t.isCollapsed)return null;const n=kD(t.anchorNode),r=kD(t.focusNode);if(n===null||r===null||!e.contains(n)||!e.contains(r))return null;const s=_D(n),o=_D(r);return Number.isNaN(s)||Number.isNaN(o)?null:{anchorLine:s,headLine:o}},U1e=(e,t)=>{var n;(n=e==null?void 0:e.querySelector(`[data-line="${String(t)}"]`))==null||n.scrollIntoView({block:"center"})},V1e=(e,t)=>t===null?e:e.map(n=>({...n,isFocused:L1e(t,Number.parseInt(n.numberLabel,xx))})),q1e=({waypoint:e})=>g.jsxs("section",{"aria-label":e.title,className:xe(_F,"flex items-center gap-2 px-2.5 py-2"),children:[e.coreChangeLabel===null?null:g.jsx(Oa,{kind:"core-change",label:e.coreChangeLabel}),g.jsx("span",{className:"min-w-0 truncate text-[0.9375rem] font-semibold",children:e.title}),g.jsx("span",{className:"ml-auto shrink-0 pl-2 text-xs text-muted-foreground tabular-nums",children:Vp(e)})]}),MF=({path:e,lines:t,statusMessage:n,waypoints:r,waypointOptions:s,highlightButtonLabel:o,focusOn:l,className:c,renderWaypoint:u,onHighlightCode:f})=>{const h=N.useRef(null),{isShownAtFirst:p,canToggle:y}=j1e[s],[x,b]=N.useState(p),[S,E]=N.useState(null),C=y?x:p,R=N.useMemo(()=>S===null?null:I1e(S),[S]),T=N.useMemo(()=>D1e(R),[R]),O=N.useMemo(()=>t===null?null:V1e(t,l),[t,l]),k=(l==null?void 0:l.lineStart)??null,M=t!==null;N.useEffect(()=>{k!==null&&M&&U1e(h.current,k)},[k,M]);const A=(P,B)=>{E(H=>M1e(H,Number.parseInt(P,xx),B))},L=()=>{const P=f===null?null:$1e(h.current);P!==null&&E(P)},I=P=>{f==null||f(P),E(null)},j=P=>{const B=Number.parseInt(P,xx);return g.jsxs(g.Fragment,{children:[(R==null?void 0:R.lineEnd)===B?g.jsxs("div",{role:"toolbar","aria-label":Vp(R),className:xe(_F,"flex items-center gap-2 px-2.5 py-1.5"),children:[g.jsx("span",{className:"text-sm text-muted-foreground tabular-nums",children:Vp(R)}),g.jsx("span",{className:"flex-1"}),g.jsx(st,{type:"button",variant:"ghost",size:"sm",onClick:()=>{E(null)},children:H1e}),g.jsx(st,{type:"button",size:"sm",onClick:()=>{I(R)},children:o})]}):null,C?r.filter(H=>H.lineEnd===B).map(H=>u===void 0?g.jsx(q1e,{waypoint:H},H.id):g.jsx("div",{children:u(H)},H.id)):null]})};return g.jsxs("div",{className:xe("flex min-h-0 flex-col overflow-hidden rounded-md border",c),children:[g.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-3 border-b bg-muted pr-1 pl-3",children:[g.jsx("p",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",title:e,children:e}),y?g.jsx(st,{type:"button",variant:"ghost",size:"sm","aria-pressed":x,onClick:()=>{b(P=>!P)},children:x?z1e:P1e}):null]}),O===null?g.jsx("p",{role:"status",className:"px-3 py-2.5 text-sm text-muted-foreground",children:n}):g.jsx("div",{ref:h,role:"presentation",className:"min-h-0 flex-1 overflow-y-auto bg-code",onMouseUp:L,children:g.jsx(Tu,{lines:O,label:e,path:e,className:"py-0",renderLineExtra:j,...f===null?{}:{selectLineLabel:B1e,selectedLineLabels:T,onSelectLine:A}})})]})},G1e="flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm select-none aria-disabled:text-muted-foreground aria-selected:bg-muted",K1e=(e,t,n)=>t===0?null:e===null?n===1?0:t-1:(e+n+t)%t,Y1e=({label:e,hint:t,placeholder:n,value:r,suggestions:s,message:o,errorMessage:l,isLiteral:c=!1,className:u,onValueChange:f,onSelect:h,onOpen:p,onEnter:y})=>{const x=N.useId(),b=N.useId(),S=N.useId(),E=N.useId(),[C,R]=N.useState(!1),[T,O]=N.useState(null),k=T===null?void 0:s[T],M=C&&(s.length>0||o!==null),A=l!==null,L=()=>{R(!1),O(null)},I=B=>{B.isDisabled||(h(B.id),L())},j=B=>{R(!0),O(H=>K1e(H,s.length,B))},P=B=>{B.key==="ArrowDown"?(B.preventDefault(),j(1)):B.key==="ArrowUp"?(B.preventDefault(),j(-1)):B.key==="Enter"?(B.preventDefault(),C&&k!==void 0?I(k):y==null||y()):B.key==="Escape"&&L()};return g.jsxs("div",{className:xe("grid gap-1.5",u),children:[g.jsx("label",{htmlFor:x,className:"text-sm font-bold",children:e}),t===null?null:g.jsx("p",{id:S,className:"text-sm text-muted-foreground",children:t}),g.jsxs("div",{className:"relative",children:[g.jsx(zm,{id:x,role:"combobox",value:r,placeholder:n,autoComplete:"off",spellCheck:!1,"aria-expanded":M,"aria-controls":b,"aria-autocomplete":"list","aria-activedescendant":k===void 0?void 0:`${b}-${k.id}`,"aria-invalid":A,"aria-describedby":xe(t===null?"":S,A?E:"")||void 0,className:c?"font-mono placeholder:font-sans":"",onChange:B=>{f(B.target.value),R(!0),O(null)},onFocus:()=>{R(!0),p==null||p()},onBlur:L,onKeyDown:P}),g.jsxs("div",{id:b,role:"listbox","aria-label":e,hidden:!M,className:"absolute inset-x-0 top-full z-30 mt-1 max-h-72 overflow-y-auto rounded-lg border border-foreground bg-popover p-1 text-popover-foreground",children:[s.map(B=>g.jsxs("div",{id:`${b}-${B.id}`,role:"option",tabIndex:-1,"aria-selected":B.id===(k==null?void 0:k.id),"aria-disabled":B.isDisabled,className:G1e,onMouseDown:H=>{H.preventDefault()},onClick:()=>{I(B)},onKeyDown:H=>{H.key==="Enter"&&I(B)},children:[B.marker,g.jsx("span",{className:xe("min-w-0 wrap-anywhere",c?"font-mono text-[0.94em]":""),children:B.label}),B.detail===null?null:g.jsx("span",{className:"min-w-0 flex-1 truncate text-muted-foreground",children:B.detail}),B.stateLabel===null?null:g.jsx("span",{className:"ml-auto shrink-0 text-muted-foreground",children:B.stateLabel})]},B.id)),s.length===0&&o!==null?g.jsx("div",{role:"presentation",className:"px-2 py-1.5 text-sm text-muted-foreground",children:o}):null]})]}),A?g.jsx("p",{id:E,role:"alert",className:"text-sm text-destructive",children:l}):null]})},W1e="/",X1e=({path:e,stateLabel:t})=>{const n=e.lastIndexOf(W1e);return{id:e,label:e.slice(n+1),detail:n<0?null:e.slice(0,n),stateLabel:t,isDisabled:!1}},gN=({label:e,hint:t,placeholder:n,query:r,files:s,message:o,errorMessage:l,className:c,onQueryChange:u,onSelect:f})=>g.jsx(Y1e,{label:e,hint:t,placeholder:n,value:r,suggestions:s.map(X1e),message:o,errorMessage:l,isLiteral:!0,className:c,onValueChange:u,onSelect:f}),Q1e="Add a card",MD="Pick a file, then the code the card stands for: one of its code blocks, or the lines you select in the code.",Z1e="File",J1e="Search the files of the repository",ID="Code blocks",ewe="Use these lines",twe="Pick a code block on the left, or select lines in the code: click a line number, then another with Shift.",nwe="Prefill the rows of the card from the code",rwe="Add card",swe="Adding…",LD="size-4 accent-(--primary)",owe="flex w-full flex-col rounded-md border border-input px-2.5 py-1.5 text-left transition-colors duration-[180ms] ease-out hover:bg-accent disabled:cursor-not-allowed disabled:opacity-60 aria-pressed:border-primary aria-pressed:bg-accent",iwe=({reviewKey:e,addition:{segmentId:t,note:n,isSaving:r,errorMessage:s,onSubmit:o,onClose:l}})=>{const c=mN(e,"repository"),[u,f]=N.useState(null),[h,p]=N.useState(null),[y,x]=N.useState(!0),[b,S]=N.useState(!1),E=kF(e,u),{blocks:C,message:R}=A1e({...e,segmentId:t},u),T=(h==null?void 0:h.kind)==="block"?C.find(A=>A.id===h.blockId)??null:null,O=(h==null?void 0:h.kind)==="lines"?h:T,k=A=>{f(A),p(null),S(!1),c.onQueryChange(A)},M=()=>{u===null||h===null||o({path:u,source:h,isPrefilled:y,hasChildComponents:b&&(T==null?void 0:T.childComponentsLabel)!=null})};return g.jsx(pl,{open:!0,onOpenChange:A=>{A||l()},children:g.jsxs(ml,{className:"h-[calc(100dvh-4rem)] grid-rows-[auto_auto_minmax(0,1fr)_auto_auto] sm:max-w-[min(90rem,calc(100vw-4rem))]",children:[g.jsxs(gl,{children:[g.jsx(xl,{children:Q1e}),g.jsx(bl,{children:n===null?MD:`${MD} ${n}`})]}),g.jsx(gN,{label:Z1e,hint:null,placeholder:J1e,query:c.query,files:c.files,message:c.message,errorMessage:c.errorMessage,onQueryChange:c.onQueryChange,onSelect:k}),u===null?g.jsx("span",{}):g.jsxs("div",{className:"grid min-h-0 grid-cols-[16rem_minmax(0,1fr)] gap-3",children:[g.jsxs("section",{"aria-label":ID,className:"flex min-h-0 flex-col gap-2",children:[g.jsx("h3",{className:"text-sm font-bold",children:ID}),R===null?null:g.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:R}),g.jsx("ul",{className:"grid min-h-0 content-start gap-1 overflow-y-auto",children:C.map(A=>g.jsx("li",{children:g.jsxs("button",{type:"button","aria-pressed":(T==null?void 0:T.id)===A.id,disabled:A.heldLabel!==null,className:owe,onClick:()=>{p({kind:"block",blockId:A.id})},children:[g.jsx("span",{className:"truncate font-mono text-[0.8125rem] font-bold",title:A.name,children:A.name}),g.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:A.heldLabel??A.detail})]})},A.id))})]}),g.jsxs("div",{className:"flex min-h-0 flex-col gap-2",children:[g.jsx(MF,{path:u,lines:E.lines,statusMessage:E.statusMessage,waypoints:[],waypointOptions:"always-off",highlightButtonLabel:ewe,focusOn:O,className:"flex-1",onHighlightCode:A=>{p({kind:"lines",...A})}}),g.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:O===null?twe:[(T==null?void 0:T.name)??null,Vp(O)].filter(A=>A!==null).join(", ")})]})]}),g.jsxs("div",{className:"grid gap-1.5",children:[g.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[g.jsx("input",{type:"checkbox",checked:y,className:LD,onChange:A=>{x(A.target.checked)}}),nwe]}),(T==null?void 0:T.childComponentsLabel)==null?null:g.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[g.jsx("input",{type:"checkbox",checked:b,className:LD,onChange:A=>{S(A.target.checked)}}),T.childComponentsLabel]}),s===null?null:g.jsx("p",{role:"alert",className:"text-sm text-destructive",children:s})]}),g.jsxs(yl,{children:[g.jsx(st,{type:"button",variant:"ghost",onClick:l,children:"Cancel"}),g.jsx(st,{type:"button",disabled:u===null||h===null||r,onClick:M,children:r?swe:rwe})]})]})})},lwe="Done",DD=({title:e,description:t,entries:n,isPending:r,onMove:s,onClose:o})=>g.jsx(pl,{open:!0,onOpenChange:l=>{l||o()},children:g.jsxs(ml,{children:[g.jsxs(gl,{children:[g.jsx(xl,{children:e}),g.jsx(bl,{children:t})]}),g.jsx("ol",{"aria-label":e,className:"grid max-h-96 gap-1 overflow-y-auto",children:n.map(l=>g.jsxs("li",{className:"flex items-center gap-2 rounded-md border px-2.5 py-1.5",children:[g.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[g.jsx("span",{className:"truncate font-semibold",title:l.heading,children:l.heading}),g.jsx("span",{className:"text-xs text-muted-foreground tabular-nums",children:l.detailLabel})]}),g.jsx(Nr,{icon:"previous",label:`Move ${l.heading} up`,isDisabled:!l.canMoveUp||r,onClick:()=>{s(l.id,"up")}}),g.jsx(Nr,{icon:"next",label:`Move ${l.heading} down`,isDisabled:!l.canMoveDown||r,onClick:()=>{s(l.id,"down")}})]},l.id))}),g.jsx(yl,{children:g.jsx(st,{type:"button",onClick:o,children:lwe})})]})});var jD=Object.defineProperty,awe=(e,t)=>{let n={};for(var r in e)jD(n,r,{get:e[r],enumerable:!0});return jD(n,Symbol.toStringTag,{value:"Module"}),n};function Sr(e){this.content=e}Sr.prototype={constructor:Sr,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,s=r.find(e),o=r.content.slice();return s==-1?o.push(n||e,t):(o[s+1]=t,n&&(o[s]=n)),new Sr(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Sr(n)},addToStart:function(e,t){return new Sr([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Sr(n)},addBefore:function(e,t,n){var r=this.remove(t),s=r.content.slice(),o=r.find(e);return s.splice(o==-1?s.length:o,0,t,n),new Sr(s)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Sr.from(e),e.size?new Sr(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Sr.from(e),e.size?new Sr(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Sr.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};Sr.from=function(e){if(e instanceof Sr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Sr(t)};function IF(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let s=e.child(r),o=t.child(r);if(s==o){n+=s.nodeSize;continue}if(!s.sameMarkup(o))return n;if(s.isText&&s.text!=o.text){let l=s.text,c=o.text,u=0;for(;l[u]==c[u];u++)n++;return u&&u<l.length&&u<c.length&&jF(l.charCodeAt(u-1))&&DF(l.charCodeAt(u))&&n--,n}if(s.content.size||o.content.size){let l=IF(s.content,o.content,n+1);if(l!=null)return l}n+=s.nodeSize}}function LF(e,t,n,r){for(let s=e.childCount,o=t.childCount;;){if(s==0||o==0)return s==o?null:{a:n,b:r};let l=e.child(--s),c=t.child(--o),u=l.nodeSize;if(l==c){n-=u,r-=u;continue}if(!l.sameMarkup(c))return{a:n,b:r};if(l.isText&&l.text!=c.text){let f=l.text,h=c.text,p=f.length,y=h.length;for(;p>0&&y>0&&f[p-1]==h[y-1];)p--,y--,n--,r--;return p&&y&&p<f.length&&jF(f.charCodeAt(p-1))&&DF(f.charCodeAt(p))&&(n++,r++),{a:n,b:r}}if(l.content.size||c.content.size){let f=LF(l.content,c.content,n-1,r-1);if(f)return f}n-=u,r-=u}}function DF(e){return e>=56320&&e<57344}function jF(e){return e>=55296&&e<56320}class Ie{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,s=0,o){for(let l=0,c=0;c<n;l++){let u=this.content[l],f=c+u.nodeSize;if(f>t&&r(u,s+c,o||null,l)!==!1&&u.content.size){let h=c+1;u.nodesBetween(Math.max(0,t-h),Math.min(u.content.size,n-h),r,s+h)}c=f}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,s){let o="",l=!0;return this.nodesBetween(t,n,(c,u)=>{let f=c.isText?c.text.slice(Math.max(t,u)-u,n-u):c.isLeaf?s?typeof s=="function"?s(c):s:c.type.spec.leafText?c.type.spec.leafText(c):"":"";c.isBlock&&(c.isLeaf&&f||c.isTextblock)&&r&&(l?l=!1:o+=r),o+=f},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,s=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(s[s.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)s.push(t.content[o]);return new Ie(s,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],s=0;if(n>t)for(let o=0,l=0;l<n;o++){let c=this.content[o],u=l+c.nodeSize;u>t&&((l<t||u>n)&&(c.isText?c=c.cut(Math.max(0,t-l),Math.min(c.text.length,n-l)):c=c.cut(Math.max(0,t-l-1),Math.min(c.content.size,n-l-1))),r.push(c),s+=c.nodeSize),l=u}return new Ie(r,s)}cutByIndex(t,n){return t==n?Ie.empty:t==0&&n==this.content.length?this:new Ie(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let s=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return s[t]=n,new Ie(s,o)}addToStart(t){return new Ie([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Ie(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let s=this.content[n];t(s,r,n),r+=s.nodeSize}}findDiffStart(t,n=0){return IF(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return LF(this,t,n,r)}findIndex(t){if(t==0)return J0(0,t);if(t==this.size)return J0(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let s=this.child(n),o=r+s.nodeSize;if(o>=t)return o==t?J0(n+1,o):J0(n,r);r=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return Ie.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return Ie.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Ie.empty;let n,r=0;for(let s=0;s<t.length;s++){let o=t[s];r+=o.nodeSize,s&&o.isText&&t[s-1].sameMarkup(o)?(n||(n=t.slice(0,s)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new Ie(n||t,r)}static from(t){if(!t)return Ie.empty;if(t instanceof Ie)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Ie([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Ie.empty=new Ie([],0);const mw={index:0,offset:0};function J0(e,t){return mw.index=e,mw.offset=t,mw}function bx(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!bx(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!bx(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let tn=class NC{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let s=0;s<t.length;s++){let o=t[s];if(this.eq(o))return t;if(this.type.excludes(o.type))n||(n=t.slice(0,s));else{if(o.type.excludes(this.type))return t;!r&&o.type.rank>this.type.rank&&(n||(n=t.slice(0,s)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&bx(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return NC.none;if(t instanceof NC)return[t];let n=t.slice();return n.sort((r,s)=>r.type.rank-s.type.rank),n}};tn.none=[];class qp extends Error{}class Ue{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=zF(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new Ue(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Ue(PF(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return Ue.empty;let r=n.openStart||0,s=n.openEnd||0;if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Ue(Ie.fromJSON(t,n.content),r,s)}static maxOpen(t,n=!0){let r=0,s=0;for(let o=t.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=t.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)s++;return new Ue(t,r,s)}}Ue.empty=new Ue(Ie.empty,0,0);function PF(e,t,n){let{index:r,offset:s}=e.findIndex(t),o=e.maybeChild(r),{index:l,offset:c}=e.findIndex(n);if(s==t||o.isText){if(c!=n&&!e.child(l).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=l)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(PF(o.content,t-s-1,n-s-1)))}function zF(e,t,n,r,s,o){let{index:l,offset:c}=e.findIndex(t),u=e.maybeChild(l);if(c==t||u.isText)return o&&r<=0&&s<=0&&!o.canReplace(l,l,n)?null:e.cut(0,t).append(n).append(e.cut(t));let f=zF(u.content,t-c-1,n,l==0?r-1:0,l==e.childCount-1?s-1:0,u);return f&&e.replaceChild(l,u.copy(f))}function cwe(e,t,n){if(n.openStart>e.depth)throw new qp("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new qp("Inconsistent open depths");return BF(e,t,n,0)}function BF(e,t,n,r){let s=e.index(r),o=e.node(r);if(s==t.index(r)&&r<e.depth-n.openStart){let l=BF(e,t,n,r+1);return o.copy(o.content.replaceChild(s,l))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let l=e.parent,c=l.content;return eu(l,c.cut(0,e.parentOffset).append(n.content).append(c.cut(t.parentOffset)))}else{let{start:l,end:c}=uwe(n,e);return eu(o,FF(e,l,c,t,r))}else return eu(o,vx(e,t,r))}function HF(e,t){if(!t.type.compatibleContent(e.type))throw new qp("Cannot join "+t.type.name+" onto "+e.type.name)}function RC(e,t,n){let r=e.node(n);return HF(r,t.node(n)),r}function Jc(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function fp(e,t,n,r){let s=(t||e).node(n),o=0,l=t?t.index(n):s.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Jc(e.nodeAfter,r),o++));for(let c=o;c<l;c++)Jc(s.child(c),r);t&&t.depth==n&&t.textOffset&&Jc(t.nodeBefore,r)}function eu(e,t){if(!e.type.validContent(t))throw new qp("Invalid content for node "+e.type.name);return e.copy(t)}function FF(e,t,n,r,s){let o=e.depth>s&&RC(e,t,s+1),l=r.depth>s&&RC(n,r,s+1),c=[];return fp(null,e,s,c),o&&l&&t.index(s)==n.index(s)?(HF(o,l),Jc(eu(o,FF(e,t,n,r,s+1)),c)):(o&&Jc(eu(o,vx(e,t,s+1)),c),fp(t,n,s,c),l&&Jc(eu(l,vx(n,r,s+1)),c)),fp(r,null,s,c),new Ie(c)}function vx(e,t,n){let r=[];if(fp(null,e,n,r),e.depth>n){let s=RC(e,t,n+1);Jc(eu(s,vx(e,t,n+1)),r)}return fp(t,null,n,r),new Ie(r)}function uwe(e,t){let n=t.depth-e.openStart,s=t.node(n).copy(e.content);for(let o=n-1;o>=0;o--)s=t.node(o).copy(Ie.from(s));return{start:s.resolveNoCache(e.openStart+n),end:s.resolveNoCache(s.content.size-e.openEnd-n)}}class Gp{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],s=t.child(n);return r?t.child(n).cut(r):s}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],s=n==0?0:this.path[n*3-1]+1;for(let o=0;o<t;o++)s+=r.child(o).nodeSize;return s}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return tn.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),s=t.maybeChild(n);if(!r){let c=r;r=s,s=c}let o=r.marks;for(var l=0;l<o.length;l++)o[l].type.spec.inclusive===!1&&(!s||!o[l].isInSet(s.marks))&&(o=o[l--].removeFromSet(o));return o}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,s=t.parent.maybeChild(t.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!s||!r[o].isInSet(s.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new Sx(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],s=0,o=n;for(let l=t;;){let{index:c,offset:u}=l.content.findIndex(o),f=o-u;if(r.push(l,c,s+u),!f||(l=l.child(c),l.isText))break;o=f-1,s+=u+1}return new Gp(n,r,o)}static resolveCached(t,n){let r=PD.get(t);if(r)for(let o=0;o<r.elts.length;o++){let l=r.elts[o];if(l.pos==n)return l}else PD.set(t,r=new dwe);let s=r.elts[r.i]=Gp.resolve(t,n);return r.i=(r.i+1)%fwe,s}}class dwe{constructor(){this.elts=[],this.i=0}}const fwe=12,PD=new WeakMap;class Sx{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const hwe=Object.create(null);let tu=class OC{constructor(t,n,r,s=tn.none){this.type=t,this.attrs=n,this.marks=s,this.content=r||Ie.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,s=0){this.content.nodesBetween(t,n,r,s,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,s){return this.content.textBetween(t,n,r,s)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&bx(this.attrs,n||t.defaultAttrs||hwe)&&tn.sameSet(this.marks,r||tn.none)}copy(t=null){return t==this.content?this:new OC(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new OC(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return Ue.empty;let s=this.resolve(t),o=this.resolve(n),l=r?0:s.sharedDepth(n),c=s.start(l),f=s.node(l).content.cut(s.pos-c,o.pos-c);return new Ue(f,s.depth-l,o.depth-l)}replace(t,n,r){return cwe(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:s}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(s==t||n.isText)return n;t-=s+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let s=this.content.child(n-1);return{node:s,index:n-1,offset:r-s.nodeSize}}resolve(t){return Gp.resolveCached(this,t)}resolveNoCache(t){return Gp.resolve(this,t)}rangeHasMark(t,n,r){let s=!1;return n>t&&this.nodesBetween(t,n,o=>(r.isInSet(o.marks)&&(s=!0),!s)),s}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),$F(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=Ie.empty,s=0,o=r.childCount){let l=this.contentMatchAt(t).matchFragment(r,s,o),c=l&&l.matchFragment(this.content,n);if(!c||!c.validEnd)return!1;for(let u=s;u<o;u++)if(!this.type.allowsMarks(r.child(u).marks))return!1;return!0}canReplaceWith(t,n,r,s){if(s&&!this.type.allowsMarks(s))return!1;let o=this.contentMatchAt(t).matchType(r),l=o&&o.matchFragment(this.content,n);return l?l.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),zD(this.type.attrs,this.attrs,"node",this.type.name);let t=tn.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];zD(r.type.attrs,r.attrs,"mark",r.type.name),t=r.addToSet(t)}if(!tn.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let s=Ie.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,s,r)}};tu.prototype.text=void 0;class wx extends tu{constructor(t,n,r,s){if(super(t,n,null,s),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):$F(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new wx(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new wx(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function $F(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}function zD(e,t,n,r){for(let s in t)if(!(s in e))throw new RangeError(`Unsupported attribute ${s} for ${n} of type ${r}`);for(let s in e)e[s].validate&&e[s].validate(t[s])}class hu{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new pwe(t,n);if(r.next==null)return hu.empty;let s=UF(r);r.next&&r.err("Unexpected trailing text");let o=Swe(vwe(s));return wwe(o,r),o}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let s=this;for(let o=n;s&&o<r;o++)s=s.matchType(t.child(o).type);return s}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let s=[this];function o(l,c){let u=l.matchFragment(t,r);if(u&&(!n||u.validEnd))return Ie.from(c.map(f=>f.createAndFill()));for(let f=0;f<l.next.length;f++){let{type:h,next:p}=l.next[f];if(!(h.isText||h.hasRequiredAttrs())&&s.indexOf(p)==-1){s.push(p);let y=o(p,c.concat(h));if(y)return y}}return null}return o(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let s=r.shift(),o=s.match;if(o.matchType(t)){let l=[];for(let c=s;c.type;c=c.via)l.push(c.type);return l.reverse()}for(let l=0;l<o.next.length;l++){let{type:c,next:u}=o.next[l];!c.isLeaf&&!c.hasRequiredAttrs()&&!(c.name in n)&&(!s.type||u.validEnd)&&(r.push({match:c.contentMatch,type:c,via:s}),n[c.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let s=0;s<r.next.length;s++)t.indexOf(r.next[s].next)==-1&&n(r.next[s].next)}return n(this),t.map((r,s)=>{let o=s+(r.validEnd?"*":" ")+" ";for(let l=0;l<r.next.length;l++)o+=(l?", ":"")+r.next[l].type.name+"->"+t.indexOf(r.next[l].next);return o}).join(`
|
|
360
|
-
`)}}hu.empty=new hu(!0);class pwe{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function UF(e){let t=[];do t.push(mwe(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function mwe(e){let t=[];do t.push(gwe(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function gwe(e){let t=bwe(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=ywe(e,t);else break;return t}function BD(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function ywe(e,t){let n=BD(e),r=n;return e.eat(",")&&(e.next!="}"?r=BD(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function xwe(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let s=[];for(let o in n){let l=n[o];l.isInGroup(t)&&s.push(l)}return s.length==0&&e.err("No node type or group '"+t+"' found"),s}function bwe(e){if(e.eat("(")){let t=UF(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=xwe(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function vwe(e){let t=[[]];return s(o(e,0),n()),t;function n(){return t.push([])-1}function r(l,c,u){let f={term:u,to:c};return t[l].push(f),f}function s(l,c){l.forEach(u=>u.to=c)}function o(l,c){if(l.type=="choice")return l.exprs.reduce((u,f)=>u.concat(o(f,c)),[]);if(l.type=="seq")for(let u=0;;u++){let f=o(l.exprs[u],c);if(u==l.exprs.length-1)return f;s(f,c=n())}else if(l.type=="star"){let u=n();return r(c,u),s(o(l.expr,u),u),[r(u)]}else if(l.type=="plus"){let u=n();return s(o(l.expr,c),u),s(o(l.expr,u),u),[r(u)]}else{if(l.type=="opt")return[r(c)].concat(o(l.expr,c));if(l.type=="range"){let u=c;for(let f=0;f<l.min;f++){let h=n();s(o(l.expr,u),h),u=h}if(l.max==-1)s(o(l.expr,u),u);else for(let f=l.min;f<l.max;f++){let h=n();r(u,h),s(o(l.expr,u),h),u=h}return[r(u)]}else{if(l.type=="name")return[r(c,void 0,l.value)];throw new Error("Unknown expr type")}}}}function VF(e,t){return t-e}function HD(e,t){let n=[];return r(t),n.sort(VF);function r(s){let o=e[s];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(s);for(let l=0;l<o.length;l++){let{term:c,to:u}=o[l];!c&&n.indexOf(u)==-1&&r(u)}}}function Swe(e){let t=Object.create(null);return n(HD(e,0));function n(r){let s=[];r.forEach(l=>{e[l].forEach(({term:c,to:u})=>{if(!c)return;let f;for(let h=0;h<s.length;h++)s[h][0]==c&&(f=s[h][1]);HD(e,u).forEach(h=>{f||s.push([c,f=[]]),f.indexOf(h)==-1&&f.push(h)})})});let o=t[r.join(",")]=new hu(r.indexOf(e.length-1)>-1);for(let l=0;l<s.length;l++){let c=s[l][1].sort(VF);o.next.push({type:s[l][0],next:t[c.join(",")]||n(c)})}return o}}function wwe(e,t){for(let n=0,r=[e];n<r.length;n++){let s=r[n],o=!s.validEnd,l=[];for(let c=0;c<s.next.length;c++){let{type:u,next:f}=s.next[c];l.push(u.name),o&&!(u.isText||u.hasRequiredAttrs())&&(o=!1),r.indexOf(f)==-1&&r.push(f)}o&&t.err("Only non-generatable nodes ("+l.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function qF(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function GF(e,t){let n=Object.create(null);for(let r in e){let s=e[r],o=t&&t[r];if(o===void 0)if(s.hasDefault)o=s.default;else throw new RangeError("No value supplied for attribute "+r);else s.validate&&s.validate(o);n[r]=o}return n}function KF(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Cwe(e,r,t[r]);return n}let FD=class YF{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=KF(t,r.attrs),this.defaultAttrs=qF(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==hu.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:GF(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new tu(this,this.computeAttrs(t),Ie.from(n),tn.setFrom(r))}createChecked(t=null,n,r){return n=Ie.from(n),this.checkContent(n),new tu(this,this.computeAttrs(t),n,tn.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=Ie.from(n),n.size){let l=this.contentMatch.fillBefore(n);if(!l)return null;n=l.append(n)}let s=this.contentMatch.matchFragment(n),o=s&&s.fillBefore(Ie.empty,!0);return o?new tu(this,t,n.append(o),tn.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:tn.none:t}static compile(t,n){let r=Object.create(null);t.forEach((o,l)=>r[o]=new YF(o,n,l));let s=n.spec.topNode||"doc";if(!r[s])throw new RangeError("Schema is missing its top node type ('"+s+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Ewe(e,t,n){let r=n.split("|");return s=>{let o=s===null?"null":typeof s;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}class Cwe{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Ewe(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class jb{constructor(t,n,r,s){this.name=t,this.rank=n,this.schema=r,this.spec=s,this.attrs=KF(t,s.attrs),this.excluded=null;let o=qF(this.attrs);this.instance=o?new tn(this,o):null}create(t=null){return!t&&this.instance?this.instance:new tn(this,GF(this.attrs,t))}static compile(t,n){let r=Object.create(null),s=0;return t.forEach((o,l)=>r[o]=new jb(o,s++,n,l)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}}class WF{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let s in t)n[s]=t[s];n.nodes=Sr.from(t.nodes),n.marks=Sr.from(t.marks||{}),this.nodes=FD.compile(this.spec.nodes,this),this.marks=jb.compile(this.spec.marks,this);let r=Object.create(null);for(let s in this.nodes){if(s in this.marks)throw new RangeError(s+" can not be both a node and a mark");let o=this.nodes[s],l=o.spec.content||"",c=o.spec.marks;if(o.contentMatch=r[l]||(r[l]=hu.parse(l,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=c=="_"?null:c?$D(this,c.split(" ")):c==""||!o.inlineContent?[]:null}for(let s in this.marks){let o=this.marks[s],l=o.spec.excludes;o.excluded=l==null?[o]:l==""?[]:$D(this,l.split(" "))}this.nodeFromJSON=s=>tu.fromJSON(this,s),this.markFromJSON=s=>tn.fromJSON(this,s),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,s){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof FD){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,s)}text(t,n){let r=this.nodes.text;return new wx(r,r.defaultAttrs,t,tn.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function $D(e,t){let n=[];for(let r=0;r<t.length;r++){let s=t[r],o=e.marks[s],l=o;if(o)n.push(o);else for(let c in e.marks){let u=e.marks[c];(s=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(s)>-1)&&n.push(l=u)}if(!l)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function Twe(e){return e.tag!=null}function Nwe(e){return e.style!=null}class rl{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(s=>{if(Twe(s))this.tags.push(s);else if(Nwe(s)){let o=/[^=]*/.exec(s.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(s)}}),this.normalizeLists=!this.tags.some(s=>{if(!/^(ul|ol)\b/.test(s.tag)||!s.node)return!1;let o=t.nodes[s.node];return o.contentMatch.matchType(o)})}parse(t,n={}){let r=new VD(this,n,!1);return r.addAll(t,tn.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new VD(this,n,!0);return r.addAll(t,tn.none,n.from,n.to),Ue.maxOpen(r.finish())}matchTag(t,n,r){for(let s=r?this.tags.indexOf(r)+1:0;s<this.tags.length;s++){let o=this.tags[s];if(Awe(t,o.tag)&&(o.namespace===void 0||t.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}matchStyle(t,n,r,s){for(let o=s?this.styles.indexOf(s)+1:0;o<this.styles.length;o++){let l=this.styles[o],c=l.style;if(!(c.indexOf(t)!=0||l.context&&!r.matchesContext(l.context)||c.length>t.length&&(c.charCodeAt(t.length)!=61||c.slice(t.length+1)!=n))){if(l.getAttrs){let u=l.getAttrs(n);if(u===!1)continue;l.attrs=u||void 0}return l}}}static schemaRules(t){let n=[];function r(s){let o=s.priority==null?50:s.priority,l=0;for(;l<n.length;l++){let c=n[l];if((c.priority==null?50:c.priority)<o)break}n.splice(l,0,s)}for(let s in t.marks){let o=t.marks[s].spec.parseDOM;o&&o.forEach(l=>{r(l=qD(l)),l.mark||l.ignore||l.clearMark||(l.mark=s)})}for(let s in t.nodes){let o=t.nodes[s].spec.parseDOM;o&&o.forEach(l=>{r(l=qD(l)),l.node||l.ignore||l.mark||(l.node=s)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new rl(t,rl.schemaRules(t)))}}const XF={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Rwe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},QF={ol:!0,ul:!0},Kp=1,AC=2,hp=4;function UD(e,t,n){return t!=null?(t?Kp:0)|(t==="full"?AC:0):e&&e.whitespace=="pre"?Kp|AC:n&~hp}class ey{constructor(t,n,r,s,o,l){this.type=t,this.attrs=n,this.marks=r,this.solid=s,this.options=l,this.content=[],this.activeMarks=tn.none,this.match=o||(l&hp?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Ie.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,s;return(s=r.findWrapping(t.type))?(this.match=r,s):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Kp)){let r=this.content[this.content.length-1],s;if(r&&r.isText&&(s=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==s[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-s[0].length))}}let n=Ie.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(Ie.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!XF.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class VD{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let s=n.topNode,o,l=UD(null,n.preserveWhitespace,0)|(r?hp:0);s?o=new ey(s.type,s.attrs,tn.none,!0,n.topMatch||s.type.contentMatch,l):r?o=new ey(null,null,tn.none,!0,null,l):o=new ey(t.schema.topNodeType,null,tn.none,!0,null,l),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,s=this.top,o=s.options&AC?"full":this.localPreserveWS||(s.options&Kp)>0,{schema:l}=this.parser;if(o==="full"||s.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(o)if(o==="full")r=r.replace(/\r\n?/g,`
|
|
361
|
-
`);else if(l.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(l.linebreakReplacement.create())){let c=r.split(/\r?\n|\r/);for(let u=0;u<c.length;u++)u&&this.insertNode(l.linebreakReplacement.create(),n,!0),c[u]&&this.insertNode(l.text(c[u]),n,!/\S/.test(c[u]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let c=s.content[s.content.length-1],u=t.previousSibling;(!c||u&&u.nodeName=="BR"||c.isText&&/[ \t\r\n\u000c]$/.test(c.text))&&(r=r.slice(1))}r&&this.insertNode(l.text(r),n,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let s=this.localPreserveWS,o=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let l=t.nodeName.toLowerCase(),c;QF.hasOwnProperty(l)&&this.parser.normalizeLists&&Owe(t);let u=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(c=this.parser.matchTag(t,this,r));e:if(u?u.ignore:Rwe.hasOwnProperty(l))this.findInside(t),this.ignoreFallback(t,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(t=u.skip);let f,h=this.needsBlock;if(XF.hasOwnProperty(l))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),f=!0,o.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let p=u&&u.skip?n:this.readStyles(t,n);p&&this.addAll(t,p),f&&this.sync(o),this.needsBlock=h}else{let f=this.readStyles(t,n);f&&this.addElementByRule(t,u,f,u.consuming===!1?c:void 0)}this.localPreserveWS=s}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
|
|
362
|
-
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let s=0;s<this.parser.matchedStyles.length;s++){let o=this.parser.matchedStyles[s],l=r.getPropertyValue(o);if(l)for(let c=void 0;;){let u=this.parser.matchStyle(o,l,this,c);if(!u)break;if(u.ignore)return null;if(u.clearMark?n=n.filter(f=>!u.clearMark(f)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)c=u;else break}}return n}addElementByRule(t,n,r,s){let o,l;if(n.node)if(l=this.parser.schema.nodes[n.node],l.isLeaf)this.insertNode(l.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let u=this.enter(l,n.attrs||null,r,n.preserveWhitespace);u&&(o=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let c=this.top;if(l&&l.isLeaf)this.findInside(t);else if(s)this.addElement(t,r,s);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(u=>this.insertNode(u,r,!1));else{let u=t;typeof n.contentElement=="string"?u=t.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(t):n.contentElement&&(u=n.contentElement),this.findAround(t,u,!0),this.addAll(u,r),this.findAround(t,u,!1)}o&&this.sync(c)&&this.open--}addAll(t,n,r,s){let o=r||0;for(let l=r?t.childNodes[r]:t.firstChild,c=s==null?null:t.childNodes[s];l!=c;l=l.nextSibling,++o)this.findAtPoint(t,o),this.addDOM(l,n);this.findAtPoint(t,o)}findPlace(t,n,r){let s,o;for(let l=this.open,c=0;l>=0;l--){let u=this.nodes[l],f=u.findWrapping(t);if(f&&(!s||s.length>f.length+c)&&(s=f,o=u,!f.length))break;if(u.solid){if(r)break;c+=2}}if(!s)return null;this.sync(o);for(let l=0;l<s.length;l++)n=this.enterInner(s[l],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let s=this.findPlace(t,n,r);if(s){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(t.type));let l=tn.none;for(let c of s.concat(t.marks))(o.type?o.type.allowsMarkType(c.type):GD(c.type,t.type))&&(l=c.addToSet(l));return o.content.push(t.mark(l)),!0}return!1}enter(t,n,r,s){let o=this.findPlace(t.create(n),r,!1);return o&&(o=this.enterInner(t,n,r,!0,s)),o}enterInner(t,n,r,s=!1,o){this.closeExtra();let l=this.top;l.match=l.match&&l.match.matchType(t);let c=UD(t,o,l.options);l.options&hp&&l.content.length==0&&(c|=hp);let u=tn.none;return r=r.filter(f=>(l.type?l.type.allowsMarkType(f.type):GD(f.type,t))?(u=f.addToSet(u),!1):!0),this.nodes.push(new ey(t,n,u,s,null,c)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Kp)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let s=r.length-1;s>=0;s--)t+=r[s].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&t.nodeType==1&&t.contains(this.find[s].node)&&n.compareDocumentPosition(this.find[s].node)&(r?2:4)&&(this.find[s].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,s=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(s?0:1),l=(c,u)=>{for(;c>=0;c--){let f=n[c];if(f==""){if(c==n.length-1||c==0)continue;for(;u>=o;u--)if(l(c-1,u))return!0;return!1}else{let h=u>0||u==0&&s?this.nodes[u].type:r&&u>=o?r.node(u-o).type:null;if(!h||h.name!=f&&!h.isInGroup(f))return!1;u--}}return!0};return l(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function Owe(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&QF.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function Awe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function qD(e){let t={};for(let n in e)t[n]=e[n];return t}function GD(e,t){let n=t.schema.nodes;for(let r in n){let s=n[r];if(!s.allowsMarkType(e))continue;let o=[],l=c=>{o.push(c);for(let u=0;u<c.edgeCount;u++){let{type:f,next:h}=c.edge(u);if(f==t||o.indexOf(h)<0&&l(h))return!0}};if(l(s.contentMatch))return!0}}class Ru{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=ty(n).createDocumentFragment());let s=r,o=[];return t.forEach(l=>{if(o.length||l.marks.length){let c=0,u=0;for(;c<o.length&&u<l.marks.length;){let f=l.marks[u];if(!this.marks[f.type.name]){u++;continue}if(!f.eq(o[c][0])||f.type.spec.spanning===!1)break;c++,u++}for(;c<o.length;)s=o.pop()[1];for(;u<l.marks.length;){let f=l.marks[u++],h=this.serializeMark(f,l.isInline,n);h&&(o.push([f,s]),s.appendChild(h.dom),s=h.contentDOM||h.dom)}}s.appendChild(this.serializeNodeInner(l,n))}),r}serializeNodeInner(t,n){if(t.isText)return ty(n).createTextNode(t.text);let{dom:r,contentDOM:s}=Ry(ty(n),this.nodes[t.type.name](t),null,t.attrs);if(s){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,s)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let s=t.marks.length-1;s>=0;s--){let o=this.serializeMark(t.marks[s],t.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,n,r={}){let s=this.marks[t.type.name];return s&&Ry(ty(r),s(t,n),null,t.attrs)}static renderSpec(t,n,r=null,s){return typeof n=="string"?{dom:t.createTextNode(n)}:Ry(t,n,r,s)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ru(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=KD(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return KD(t.marks)}}function KD(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ty(e){return e.document||window.document}const YD=new WeakMap;function kwe(e){let t=YD.get(e);return t===void 0&&YD.set(e,t=_we(e)),t}function _we(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let s=0;s<r.length;s++)n(r[s]);else for(let s in r)n(r[s])}return n(e),t}function Ry(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let s=t[0],o;if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(o=kwe(r))&&o.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let l=s.indexOf(" ");l>0&&(n=s.slice(0,l),s=s.slice(l+1));let c,u=n?e.createElementNS(n,s):e.createElement(s),f=t[1],h=1;if(f&&typeof f=="object"&&f.nodeType==null&&!Array.isArray(f)){h=2;for(let p in f)if(f[p]!=null){let y=p.indexOf(" ");y>0?u.setAttributeNS(p.slice(0,y),p.slice(y+1),f[p]):p=="style"&&u.style?u.style.cssText=f[p]:u.setAttribute(p,f[p])}}for(let p=h;p<t.length;p++){let y=t[p];if(y===0){if(p<t.length-1||p>h)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else if(typeof y=="string")u.appendChild(e.createTextNode(y));else{let{dom:x,contentDOM:b}=Ry(e,y,n,r);if(u.appendChild(x),b){if(c)throw new RangeError("Multiple content holes");c=b}}}return{dom:u,contentDOM:c}}const ZF=65535,JF=Math.pow(2,16);function Mwe(e,t){return e+t*JF}function WD(e){return e&ZF}function Iwe(e){return(e-(e&ZF))/JF}const e$=1,t$=2,Oy=4,n$=8;class kC{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&n$)>0}get deletedBefore(){return(this.delInfo&(e$|Oy))>0}get deletedAfter(){return(this.delInfo&(t$|Oy))>0}get deletedAcross(){return(this.delInfo&Oy)>0}}class Bs{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Bs.empty)return Bs.empty}recover(t){let n=0,r=WD(t);if(!this.inverted)for(let s=0;s<r;s++)n+=this.ranges[s*3+2]-this.ranges[s*3+1];return this.ranges[r*3]+n+Iwe(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let s=0,o=this.inverted?2:1,l=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let u=this.ranges[c]-(this.inverted?s:0);if(u>t)break;let f=this.ranges[c+o],h=this.ranges[c+l],p=u+f;if(t<=p){let y=f?t==u?-1:t==p?1:n:n,x=u+s+(y<0?0:h);if(r)return x;let b=t==(n<0?u:p)?null:Mwe(c/3,t-u),S=0;return f&&(S|=t==u?t$:t==p?e$:Oy,(n<0?t!=u:t!=p)&&(S|=n$)),new kC(x,S,b)}s+=h-f}return r?t+s:new kC(t+s,0,null)}touches(t,n){let r=0,s=WD(n),o=this.inverted?2:1,l=this.inverted?1:2;for(let c=0;c<this.ranges.length;c+=3){let u=this.ranges[c]-(this.inverted?r:0);if(u>t)break;let f=this.ranges[c+o],h=u+f;if(t<=h&&c==s*3)return!0;r+=this.ranges[c+l]-f}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let s=0,o=0;s<this.ranges.length;s+=3){let l=this.ranges[s],c=l-(this.inverted?o:0),u=l+(this.inverted?0:o),f=this.ranges[s+n],h=this.ranges[s+r];t(c,c+f,u,u+h),o+=h-f}}invert(){return new Bs(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Bs.empty:new Bs(t<0?[0,-t,0]:[0,0,t])}}Bs.empty=new Bs([]);class Yp{constructor(t,n,r=0,s=t?t.length:0){this.mirror=n,this.from=r,this.to=s,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new Yp(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,r=this._maps.length;n<t._maps.length;n++){let s=t.getMirror(n);this.appendMap(t._maps[n],s!=null&&s<n?r+s:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this._maps.length+t._maps.length;n>=0;n--){let s=t.getMirror(n);this.appendMap(t._maps[n].invert(),s!=null&&s>n?r-s-1:void 0)}}invert(){let t=new Yp;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let s=0;for(let o=this.from;o<this.to;o++){let l=this._maps[o],c=l.mapResult(t,n);if(c.recover!=null){let u=this.getMirror(o);if(u!=null&&u>o&&u<this.to){o=u,t=this._maps[u].recover(c.recover);continue}}s|=c.delInfo,t=c.pos}return r?t:new kC(t,s,null)}}const gw=Object.create(null);class Hr{getMap(){return Bs.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=gw[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in gw)throw new RangeError("Duplicate use of step JSON ID "+t);return gw[t]=n,n.prototype.jsonID=t,n}}class $n{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new $n(t,null)}static fail(t){return new $n(null,t)}static fromReplace(t,n,r,s){try{return $n.ok(t.replace(n,r,s))}catch(o){if(o instanceof qp)return $n.fail(o.message);throw o}}}function yN(e,t,n){let r=[];for(let s=0;s<e.childCount;s++){let o=e.child(s);o.content.size&&(o=o.copy(yN(o.content,t,o))),o.isInline&&(o=t(o,n,s)),r.push(o)}return Ie.fromArray(r)}class Ea extends Hr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),s=r.node(r.sharedDepth(this.to)),o=new Ue(yN(n.content,(l,c)=>!l.isAtom||!c.type.allowsMarkType(this.mark.type)?l:l.mark(this.mark.addToSet(l.marks)),s),n.openStart,n.openEnd);return $n.fromReplace(t,this.from,this.to,o)}invert(){return new Ro(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ea(n.pos,r.pos,this.mark)}merge(t){return t instanceof Ea&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ea(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ea(n.from,n.to,t.markFromJSON(n.mark))}}Hr.jsonID("addMark",Ea);class Ro extends Hr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new Ue(yN(n.content,s=>s.mark(this.mark.removeFromSet(s.marks)),t),n.openStart,n.openEnd);return $n.fromReplace(t,this.from,this.to,r)}invert(){return new Ea(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ro(n.pos,r.pos,this.mark)}merge(t){return t instanceof Ro&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ro(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Ro(n.from,n.to,t.markFromJSON(n.mark))}}Hr.jsonID("removeMark",Ro);class Ca extends Hr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return $n.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return $n.fromReplace(t,this.pos,this.pos+1,new Ue(Ie.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let s=0;s<n.marks.length;s++)if(!n.marks[s].isInSet(r))return new Ca(this.pos,n.marks[s]);return new Ca(this.pos,this.mark)}}return new pu(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ca(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ca(n.pos,t.markFromJSON(n.mark))}}Hr.jsonID("addNodeMark",Ca);class pu extends Hr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return $n.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return $n.fromReplace(t,this.pos,this.pos+1,new Ue(Ie.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ca(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new pu(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new pu(n.pos,t.markFromJSON(n.mark))}}Hr.jsonID("removeNodeMark",pu);class _n extends Hr{constructor(t,n,r,s=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=s}apply(t){return this.structure&&_C(t,this.from,this.to)?$n.fail("Structure replace would overwrite content"):$n.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Bs([this.from,this.to-this.from,this.slice.size])}invert(t){return new _n(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&_n.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new _n(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof _n)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?Ue.empty:new Ue(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new _n(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?Ue.empty:new Ue(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new _n(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new _n(n.from,n.to,Ue.fromJSON(t,n.slice),!!n.structure)}}_n.MAP_BIAS=1;Hr.jsonID("replace",_n);class or extends Hr{constructor(t,n,r,s,o,l,c=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=s,this.slice=o,this.insert=l,this.structure=c}apply(t){if(this.structure&&(_C(t,this.from,this.gapFrom)||_C(t,this.gapTo,this.to)))return $n.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return $n.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?$n.fromReplace(t,this.from,this.to,r):$n.fail("Content does not fit in gap")}getMap(){return new Bs([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new or(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),s=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||s<n.pos||o>r.pos?null:new or(n.pos,r.pos,s,o,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new or(n.from,n.to,n.gapFrom,n.gapTo,Ue.fromJSON(t,n.slice),n.insert,!!n.structure)}}Hr.jsonID("replaceAround",or);function _C(e,t,n){let r=e.resolve(t),s=n-t,o=r.depth;for(;s>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,s--;if(s>0){let l=r.node(o).maybeChild(r.indexAfter(o));for(;s>0;){if(!l||l.isLeaf)return!0;l=l.firstChild,s--}}return!1}function Lwe(e,t,n,r){let s=[],o=[],l,c;e.doc.nodesBetween(t,n,(u,f,h)=>{if(!u.isInline)return;let p=u.marks;if(!r.isInSet(p)&&h.type.allowsMarkType(r.type)){let y=Math.max(f,t),x=Math.min(f+u.nodeSize,n),b=r.addToSet(p);for(let S=0;S<p.length;S++)p[S].isInSet(b)||(l&&l.to==y&&l.mark.eq(p[S])?l.to=x:s.push(l=new Ro(y,x,p[S])));c&&c.to==y?c.to=x:o.push(c=new Ea(y,x,r))}}),s.forEach(u=>e.step(u)),o.forEach(u=>e.step(u))}function Dwe(e,t,n,r){let s=[],o=0;e.doc.nodesBetween(t,n,(l,c)=>{if(!l.isInline)return;o++;let u=null;if(r instanceof jb){let f=l.marks,h;for(;h=r.isInSet(f);)(u||(u=[])).push(h),f=h.removeFromSet(f)}else r?r.isInSet(l.marks)&&(u=[r]):u=l.marks;if(u&&u.length){let f=Math.min(c+l.nodeSize,n);for(let h=0;h<u.length;h++){let p=u[h],y;for(let x=0;x<s.length;x++){let b=s[x];b.step==o-1&&p.eq(s[x].style)&&(y=b)}y?(y.to=f,y.step=o):s.push({style:p,from:Math.max(c,t),to:f,step:o})}}}),s.forEach(l=>e.step(new Ro(l.from,l.to,l.style)))}function xN(e,t,n,r=n.contentMatch,s=!0){let o=e.doc.nodeAt(t),l=[],c=t+1;for(let u=0;u<o.childCount;u++){let f=o.child(u),h=c+f.nodeSize,p=r.matchType(f.type);if(!p)l.push(new _n(c,h,Ue.empty));else{r=p;for(let y=0;y<f.marks.length;y++)n.allowsMarkType(f.marks[y].type)||e.step(new Ro(c,h,f.marks[y]));if(s&&f.isText&&n.whitespace!="pre"){let y,x=/\r?\n|\r/g,b;for(;y=x.exec(f.text);)b||(b=new Ue(Ie.from(n.schema.text(" ",n.allowedMarks(f.marks))),0,0)),l.push(new _n(c+y.index,c+y.index+y[0].length,b))}}c=h}if(!r.validEnd){let u=r.fillBefore(Ie.empty,!0);e.replace(c,c,new Ue(u,0,0))}for(let u=l.length-1;u>=0;u--)e.step(l[u])}function jwe(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Pf(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,s=0,o=0;;--r){let l=e.$from.node(r),c=e.$from.index(r)+s,u=e.$to.indexAfter(r)-o;if(r<e.depth&&l.canReplace(c,u,n))return r;if(r==0||l.type.spec.isolating||!jwe(l,c,u))break;c&&(s=1),u<l.childCount&&(o=1)}return null}function Pwe(e,t,n){let{$from:r,$to:s,depth:o}=t,l=r.before(o+1),c=s.after(o+1),u=l,f=c,h=Ie.empty,p=0;for(let b=o,S=!1;b>n;b--)S||r.index(b)>0?(S=!0,h=Ie.from(r.node(b).copy(h)),p++):u--;let y=Ie.empty,x=0;for(let b=o,S=!1;b>n;b--)S||s.after(b+1)<s.end(b)?(S=!0,y=Ie.from(s.node(b).copy(y)),x++):f++;e.step(new or(u,f,l,c,new Ue(h.append(y),p,x),h.size-p,!0))}function bN(e,t,n=null,r=e){let s=zwe(e,t),o=s&&Bwe(r,t);return o?s.map(XD).concat({type:t,attrs:n}).concat(o.map(XD)):null}function XD(e){return{type:e,attrs:null}}function zwe(e,t){let{parent:n,startIndex:r,endIndex:s}=e,o=n.contentMatchAt(r).findWrapping(t);if(!o)return null;let l=o.length?o[0]:t;return n.canReplaceWith(r,s,l)?o:null}function Bwe(e,t){let{parent:n,startIndex:r,endIndex:s}=e,o=n.child(r),l=t.contentMatch.findWrapping(o.type);if(!l)return null;let u=(l.length?l[l.length-1]:t).contentMatch;for(let f=r;u&&f<s;f++)u=u.matchType(n.child(f).type);return!u||!u.validEnd?null:l}function Hwe(e,t,n){let r=Ie.empty;for(let l=n.length-1;l>=0;l--){if(r.size){let c=n[l].type.contentMatch.matchFragment(r);if(!c||!c.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Ie.from(n[l].type.create(n[l].attrs,r))}let s=t.start,o=t.end;e.step(new or(s,o,s,o,new Ue(r,0,0),n.length,!0))}function Fwe(e,t,n,r,s){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,(l,c)=>{let u=typeof s=="function"?s(l):s;if(l.isTextblock&&!l.hasMarkup(r,u)&&$we(e.doc,e.mapping.slice(o).map(c),r)){let f=null;if(r.schema.linebreakReplacement){let x=r.whitespace=="pre",b=!!r.contentMatch.matchType(r.schema.linebreakReplacement);x&&!b?f=!1:!x&&b&&(f=!0)}f===!1&&s$(e,l,c,o),xN(e,e.mapping.slice(o).map(c,1),r,void 0,f===null);let h=e.mapping.slice(o),p=h.map(c,1),y=h.map(c+l.nodeSize,1);return e.step(new or(p,y,p+1,y-1,new Ue(Ie.from(r.create(u,null,l.marks)),0,0),1,!0)),f===!0&&r$(e,l,c,o),!1}})}function r$(e,t,n,r){t.forEach((s,o)=>{if(s.isText){let l,c=/\r?\n|\r/g;for(;l=c.exec(s.text);){let u=e.mapping.slice(r).map(n+1+o+l.index);e.replaceWith(u,u+1,t.type.schema.linebreakReplacement.create())}}})}function s$(e,t,n,r){t.forEach((s,o)=>{if(s.type==s.type.schema.linebreakReplacement){let l=e.mapping.slice(r).map(n+1+o);e.replaceWith(l,l+1,t.type.schema.text(`
|
|
363
|
-
`))}})}function $we(e,t,n){let r=e.resolve(t),s=r.index();return r.parent.canReplaceWith(s,s+1,n)}function Uwe(e,t,n,r,s){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let l=n.create(r,null,s||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,l);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new or(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new Ue(Ie.from(l),0,0),1,!0))}function sl(e,t,n=1,r){let s=e.resolve(t),o=s.depth-n,l=r&&r[r.length-1]||s.parent;if(o<0||s.parent.type.spec.isolating||!s.parent.canReplace(s.index(),s.parent.childCount)||!l.type.validContent(s.parent.content.cutByIndex(s.index(),s.parent.childCount)))return!1;for(let f=s.depth-1,h=n-2;f>o;f--,h--){let p=s.node(f),y=s.index(f);if(p.type.spec.isolating)return!1;let x=p.content.cutByIndex(y,p.childCount),b=r&&r[h+1];b&&(x=x.replaceChild(0,b.type.create(b.attrs)));let S=r&&r[h]||p;if(!p.canReplace(y+1,p.childCount)||!S.type.validContent(x))return!1}let c=s.indexAfter(o),u=r&&r[0];return s.node(o).canReplaceWith(c,c,u?u.type:s.node(o+1).type)}function Vwe(e,t,n=1,r){let s=e.doc.resolve(t),o=Ie.empty,l=Ie.empty;for(let c=s.depth,u=s.depth-n,f=n-1;c>u;c--,f--){o=Ie.from(s.node(c).copy(o));let h=r&&r[f];l=Ie.from(h?h.type.create(h.attrs,l):s.node(c).copy(l))}e.step(new _n(t,t,new Ue(o.append(l),n,n),!0))}function Za(e,t){let n=e.resolve(t),r=n.index();return o$(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function qwe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let s=0;s<t.childCount;s++){let o=t.child(s),l=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(l),!n||!e.type.allowsMarks(o.marks))return!1}return n.validEnd}function o$(e,t){return!!(e&&t&&!e.isLeaf&&qwe(e,t))}function Pb(e,t,n=-1){let r=e.resolve(t);for(let s=r.depth;;s--){let o,l,c=r.index(s);if(s==r.depth?(o=r.nodeBefore,l=r.nodeAfter):n>0?(o=r.node(s+1),c++,l=r.node(s).maybeChild(c)):(o=r.node(s).maybeChild(c-1),l=r.node(s+1)),o&&!o.isTextblock&&o$(o,l)&&r.node(s).canReplace(c,c+1))return t;if(s==0)break;t=n<0?r.before(s):r.after(s)}}function Gwe(e,t,n){let r=null,{linebreakReplacement:s}=e.doc.type.schema,o=e.doc.resolve(t-n),l=o.node().type;if(s&&l.inlineContent){let h=l.whitespace=="pre",p=!!l.contentMatch.matchType(s);h&&!p?r=!1:!h&&p&&(r=!0)}let c=e.steps.length;if(r===!1){let h=e.doc.resolve(t+n);s$(e,h.node(),h.before(),c)}l.inlineContent&&xN(e,t+n-1,l,o.node().contentMatchAt(o.index()),r==null);let u=e.mapping.slice(c),f=u.map(t-n);if(e.step(new _n(f,u.map(t+n,-1),Ue.empty,!0)),r===!0){let h=e.doc.resolve(f);r$(e,h.node(),h.before(),e.steps.length)}return e}function Kwe(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let s=r.depth-1;s>=0;s--){let o=r.index(s);if(r.node(s).canReplaceWith(o,o,n))return r.before(s+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let s=r.depth-1;s>=0;s--){let o=r.indexAfter(s);if(r.node(s).canReplaceWith(o,o,n))return r.after(s+1);if(o<r.node(s).childCount)return null}return null}function Ywe(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let s=n.content;for(let o=0;o<n.openStart;o++)s=s.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let l=r.depth;l>=0;l--){let c=l==r.depth?0:r.pos<=(r.start(l+1)+r.end(l+1))/2?-1:1,u=r.index(l)+(c>0?1:0),f=r.node(l),h=!1;if(o==1)h=f.canReplace(u,u,s);else{let p=f.contentMatchAt(u).findWrapping(s.firstChild.type);h=p&&f.canReplaceWith(u,u,p[0])}if(h)return c==0?r.pos:c<0?r.before(l+1):r.after(l+1)}return null}function zb(e,t,n=t,r=Ue.empty){if(t==n&&!r.size)return null;let s=e.resolve(t),o=e.resolve(n);return i$(s,o,r)?new _n(t,n,r):new Wwe(s,o,r).fit()}function i$(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class Wwe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Ie.empty;for(let s=0;s<=t.depth;s++){let o=t.node(s);this.frontier.push({type:o.type,match:o.contentMatchAt(t.indexAfter(s))})}for(let s=t.depth;s>0;s--)this.placed=Ie.from(t.node(s).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let f=this.findFittable();f?this.placeNodes(f):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,s=this.close(t<0?this.$to:r.doc.resolve(t));if(!s)return null;let o=this.placed,l=r.depth,c=s.depth;for(;l&&c&&o.childCount==1;)o=o.firstChild.content,l--,c--;let u=new Ue(o,l,c);return t>-1?new or(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new _n(r.pos,s.pos,u):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,s=this.unplaced.openEnd;r<t;r++){let o=n.firstChild;if(n.childCount>1&&(s=0),o.type.spec.isolating&&s<=r){t=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let s,o=null;r?(o=QD(this.unplaced.content,r-1).firstChild,s=o.content):s=this.unplaced.content;let l=s.firstChild;for(let c=this.depth;c>=0;c--){let{type:u,match:f}=this.frontier[c],h,p=null;if(n==1&&(l?f.matchType(l.type)||(p=f.fillBefore(Ie.from(l),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:c,parent:o,inject:p};if(n==2&&l&&(h=f.findWrapping(l.type)))return{sliceDepth:r,frontierDepth:c,parent:o,wrap:h};if(o&&f.matchType(o.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced;return ZD(t,-1)<=n?!1:(this.unplaced.size>1&&ZD(t,1)>r&&r++,this.unplaced=new Ue(t,n+1,r),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,s=QD(t,n);if(s.childCount<=1&&n>0){let o=t.size-n<=n+s.size;this.unplaced=new Ue(Zh(t,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Ue(Zh(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:s,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let S=0;S<o.length;S++)this.openFrontierNode(o[S]);let l=this.unplaced,c=r?r.content:l.content,u=l.openStart-t,f=0,h=[],{match:p,type:y}=this.frontier[n];if(s){for(let S=0;S<s.childCount;S++)h.push(s.child(S));p=p.matchFragment(s)}let x=c.size+t-(l.content.size-l.openEnd);for(;f<c.childCount;){let S=c.child(f),E=p.matchType(S.type);if(!E)break;f++,(f>1||u==0||S.content.size)&&(p=E,h.push(l$(S.mark(y.allowedMarks(S.marks)),f==1?u:0,f==c.childCount?x:-1)))}let b=f==c.childCount;b||(x=-1),this.placed=Jh(this.placed,n,Ie.from(h)),this.frontier[n].match=p,b&&x<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let S=0,E=c;S<x;S++){let C=E.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),E=C.content}this.unplaced=b?t==0?Ue.empty:new Ue(Zh(l.content,t-1,1),t-1,x<0?l.openEnd:t-1):new Ue(Zh(l.content,t,f),l.openStart,l.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!yw(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,s=this.$to.after(r);for(;r>1&&s==this.$to.end(--r);)++s;return s}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:s}=this.frontier[n],o=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),l=yw(t,n,s,r,o);if(l){for(let c=n-1;c>=0;c--){let{match:u,type:f}=this.frontier[c],h=yw(t,c,f,u,!0);if(!h||h.childCount)continue e}return{depth:n,fit:l,move:o?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Jh(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let s=t.node(r),o=s.type.contentMatch.fillBefore(s.content,!0,t.index(r));this.openFrontierNode(s.type,s.attrs,o)}return t}openFrontierNode(t,n=null,r){let s=this.frontier[this.depth];s.match=s.match.matchType(t),this.placed=Jh(this.placed,this.depth,Ie.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Ie.empty,!0);n.childCount&&(this.placed=Jh(this.placed,this.frontier.length,n))}}function Zh(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Zh(e.firstChild.content,t-1,n)))}function Jh(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Jh(e.lastChild.content,t-1,n)))}function QD(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function l$(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,l$(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Ie.empty,!0)))),e.copy(r)}function yw(e,t,n,r,s){let o=e.node(t),l=s?e.indexAfter(t):e.index(t);if(l==o.childCount&&!n.compatibleContent(o.type))return null;let c=r.fillBefore(o.content,!0,l);return c&&!Xwe(n,o.content,l)?c:null}function Xwe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function Qwe(e){return e.spec.defining||e.spec.definingForContent}function ZD(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content}}function Zwe(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let s=e.doc.resolve(t),o=e.doc.resolve(n);if(i$(s,o,r))return e.step(new _n(t,n,r));let l=c$(s,o);l[l.length-1]==0&&l.pop();let c=-(s.depth+1);l.unshift(c);for(let y=s.depth,x=s.pos-1;y>0;y--,x--){let b=s.node(y).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;l.indexOf(y)>-1?c=y:s.before(y)==x&&l.splice(1,0,-y)}let u=l.indexOf(c),f=[],h=r.openStart;for(let y=r.content,x=0;;x++){let b=y.firstChild;if(f.push(b),x==r.openStart)break;y=b.content}for(let y=h-1;y>=0;y--){let x=f[y],b=Qwe(x.type);if(b&&!x.sameMarkup(s.node(Math.abs(c)-1)))h=y;else if(b||!x.type.isTextblock)break}for(let y=r.openStart;y>=0;y--){let x=(y+h+1)%(r.openStart+1),b=f[x];if(b)for(let S=0;S<l.length;S++){let E=l[(S+u)%l.length],C=!0;E<0&&(C=!1,E=-E);let R=s.node(E-1),T=s.index(E-1);if(R.canReplaceWith(T,T,b.type,b.marks))return e.replace(s.before(E),C?o.after(E):n,new Ue(a$(r.content,0,r.openStart,x),x,r.openEnd))}}let p=e.steps.length;for(let y=l.length-1;y>=0&&(e.replace(t,n,r),!(e.steps.length>p));y--){let x=l[y];x<0||(t=s.before(x),n=o.after(x))}}function a$(e,t,n,r,s){if(t<n){let o=e.firstChild;e=e.replaceChild(0,o.copy(a$(o.content,t+1,n,r,o)))}if(t>r){let o=s.contentMatchAt(0),l=o.fillBefore(e).append(e);e=l.append(o.matchFragment(l).fillBefore(Ie.empty,!0))}return e}function Jwe(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let s=Kwe(e.doc,t,r.type);s!=null&&(t=n=s)}e.replaceRange(t,n,new Ue(Ie.from(r),0,0))}function eEe(e,t,n){let r=e.doc.resolve(t),s=e.doc.resolve(n);if(r.parent.isTextblock&&s.parent.isTextblock&&r.start()!=s.start()&&r.parentOffset==0&&s.parentOffset==0){let l=r.sharedDepth(n),c=!1;for(let u=r.depth;u>l;u--)r.node(u).type.spec.isolating&&(c=!0);for(let u=s.depth;u>l;u--)s.node(u).type.spec.isolating&&(c=!0);if(!c){for(let u=r.depth;u>0&&t==r.start(u);u--)t=r.before(u);for(let u=s.depth;u>0&&n==s.start(u);u--)n=s.before(u);r=e.doc.resolve(t),s=e.doc.resolve(n)}}let o=c$(r,s);for(let l=0;l<o.length;l++){let c=o[l],u=l==o.length-1;if(u&&c==0||r.node(c).type.contentMatch.validEnd)return e.delete(r.start(c),s.end(c));if(c>0&&(u||r.node(c-1).canReplace(r.index(c-1),s.indexAfter(c-1))))return e.delete(r.before(c),s.after(c))}for(let l=1;l<=r.depth&&l<=s.depth;l++)if(t-r.start(l)==r.depth-l&&n>r.end(l)&&s.end(l)-n!=s.depth-l&&r.start(l-1)==s.start(l-1)&&r.node(l-1).canReplace(r.index(l-1),s.index(l-1)))return e.delete(r.before(l),n);e.delete(t,n)}function c$(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let s=r;s>=0;s--){let o=e.start(s);if(o<e.pos-(e.depth-s)||t.end(s)>t.pos+(t.depth-s)||e.node(s).type.spec.isolating||t.node(s).type.spec.isolating)break;(o==t.start(s)||s==e.depth&&s==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&s&&t.start(s-1)==o-1)&&n.push(s)}return n}class $d extends Hr{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return $n.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let s=n.type.create(r,null,n.marks);return $n.fromReplace(t,this.pos,this.pos+1,new Ue(Ie.from(s),0,n.isLeaf?0:1))}getMap(){return Bs.empty}invert(t){return new $d(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new $d(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new $d(n.pos,n.attr,n.value)}}Hr.jsonID("attr",$d);class Wp extends Hr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let s in t.attrs)n[s]=t.attrs[s];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return $n.ok(r)}getMap(){return Bs.empty}invert(t){return new Wp(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Wp(n.attr,n.value)}}Hr.jsonID("docAttr",Wp);let bf=class extends Error{};bf=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};bf.prototype=Object.create(Error.prototype);bf.prototype.constructor=bf;bf.prototype.name="TransformError";class u${constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Yp}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new bf(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let s=this.mapping.maps[r];r&&(t=s.map(t,1),n=s.map(n,-1)),s.forEach((o,l,c,u)=>{t=Math.min(t,c),n=Math.max(n,u)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=Ue.empty){let s=zb(this.doc,t,n,r);return s&&this.step(s),this}replaceWith(t,n,r){return this.replace(t,n,new Ue(Ie.from(r),0,0))}delete(t,n){return this.replace(t,n,Ue.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return Zwe(this,t,n,r),this}replaceRangeWith(t,n,r){return Jwe(this,t,n,r),this}deleteRange(t,n){return eEe(this,t,n),this}lift(t,n){return Pwe(this,t,n),this}join(t,n=1){return Gwe(this,t,n),this}wrap(t,n){return Hwe(this,t,n),this}setBlockType(t,n=t,r,s=null){return Fwe(this,t,n,r,s),this}setNodeMarkup(t,n,r=null,s){return Uwe(this,t,n,r,s),this}setNodeAttribute(t,n,r){return this.step(new $d(t,n,r)),this}setDocAttribute(t,n){return this.step(new Wp(t,n)),this}addNodeMark(t,n){return this.step(new Ca(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof tn)n.isInSet(r.marks)&&this.step(new pu(t,n));else{let s=r.marks,o,l=[];for(;o=n.isInSet(s);)l.push(new pu(t,o)),s=o.removeFromSet(s);for(let c=l.length-1;c>=0;c--)this.step(l[c])}return this}split(t,n=1,r){return Vwe(this,t,n,r),this}addMark(t,n,r){return Lwe(this,t,n,r),this}removeMark(t,n,r){return Dwe(this,t,n,r),this}clearIncompatible(t,n,r){return xN(this,t,n,r),this}}const xw=Object.create(null);class Rt{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new tEe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=Ue.empty){let r=n.content.lastChild,s=null;for(let c=0;c<n.openEnd;c++)s=r,r=r.lastChild;let o=t.steps.length,l=this.ranges;for(let c=0;c<l.length;c++){let{$from:u,$to:f}=l[c],h=t.mapping.slice(o);t.replaceRange(h.map(u.pos),h.map(f.pos),c?Ue.empty:n),c==0&&tj(t,o,(r?r.isInline:s&&s.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,s=this.ranges;for(let o=0;o<s.length;o++){let{$from:l,$to:c}=s[o],u=t.mapping.slice(r),f=u.map(l.pos),h=u.map(c.pos);o?t.deleteRange(f,h):(t.replaceRangeWith(f,h,n),tj(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let s=t.parent.inlineContent?new dt(t):Ed(t.node(0),t.parent,t.pos,t.index(),n,r);if(s)return s;for(let o=t.depth-1;o>=0;o--){let l=n<0?Ed(t.node(0),t.node(o),t.before(o+1),t.index(o),n,r):Ed(t.node(0),t.node(o),t.after(o+1),t.index(o)+1,n,r);if(l)return l}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Hs(t.node(0))}static atStart(t){return Ed(t,t,0,0,1)||new Hs(t)}static atEnd(t){return Ed(t,t,t.content.size,t.childCount,-1)||new Hs(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=xw[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in xw)throw new RangeError("Duplicate use of selection JSON ID "+t);return xw[t]=n,n.prototype.jsonID=t,n}getBookmark(){return dt.between(this.$anchor,this.$head).getBookmark()}}Rt.prototype.visible=!0;class tEe{constructor(t,n){this.$from=t,this.$to=n}}let JD=!1;function ej(e){!JD&&!e.parent.inlineContent&&(JD=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class dt extends Rt{constructor(t,n=t){ej(t),ej(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Rt.near(r);let s=t.resolve(n.map(this.anchor));return new dt(s.parent.inlineContent?s:r,r)}replace(t,n=Ue.empty){if(super.replace(t,n),n==Ue.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof dt&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Bb(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new dt(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let s=t.resolve(n);return new this(s,r==n?s:t.resolve(r))}static between(t,n,r){let s=t.pos-n.pos;if((!r||s)&&(r=s>=0?1:-1),!n.parent.inlineContent){let o=Rt.findFrom(n,r,!0)||Rt.findFrom(n,-r,!0);if(o)n=o.$head;else return Rt.near(n,r)}return t.parent.inlineContent||(s==0?t=n:(t=(Rt.findFrom(t,-r,!0)||Rt.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=s<0&&(t=n))),new dt(t,n)}}Rt.jsonID("text",dt);class Bb{constructor(t,n){this.anchor=t,this.head=n}map(t){return new Bb(t.map(this.anchor),t.map(this.head))}resolve(t){return dt.between(t.resolve(this.anchor),t.resolve(this.head))}}class nt extends Rt{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:s}=n.mapResult(this.anchor),o=t.resolve(s);return r?Rt.near(o):new nt(o)}content(){return new Ue(Ie.from(this.node),0,0)}eq(t){return t instanceof nt&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new vN(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new nt(t.resolve(n.anchor))}static create(t,n){return new nt(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}nt.prototype.visible=!1;Rt.jsonID("node",nt);class vN{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Bb(r,r):new vN(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&nt.isSelectable(r)?new nt(n):Rt.near(n)}}class Hs extends Rt{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=Ue.empty){if(n==Ue.empty){t.delete(0,t.doc.content.size);let r=Rt.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new Hs(t)}map(t){return new Hs(t)}eq(t){return t instanceof Hs}getBookmark(){return nEe}}Rt.jsonID("all",Hs);const nEe={map(){return this},resolve(e){return new Hs(e)}};function Ed(e,t,n,r,s,o=!1){if(t.inlineContent)return dt.create(e,n);for(let l=r-(s>0?0:1);s>0?l<t.childCount:l>=0;l+=s){let c=t.child(l);if(c.isAtom){if(!o&&nt.isSelectable(c))return nt.create(e,n-(s<0?c.nodeSize:0))}else{let u=Ed(e,c,n+s,s<0?c.childCount:0,s,o);if(u)return u}n+=c.nodeSize*s}return null}function tj(e,t,n){let r=e.steps.length-1;if(r<t)return;let s=e.steps[r];if(!(s instanceof _n||s instanceof or))return;let o=e.mapping.maps[r],l;o.forEach((c,u,f,h)=>{l==null&&(l=h)}),e.setSelection(Rt.near(e.doc.resolve(l),n))}const nj=1,ny=2,rj=4;class rEe extends u${constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|nj)&~ny,this.storedMarks=null,this}get selectionSet(){return(this.updated&nj)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=ny,this}ensureMarks(t){return tn.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ny)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~ny,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||tn.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let s=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(s.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let l=this.doc.resolve(n);o=r==n?l.marks():l.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,s.text(t,o)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Rt.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=rj,this}get scrolledIntoView(){return(this.updated&rj)>0}}function sj(e,t){return!t||!e?e:e.bind(t)}class ep{constructor(t,n,r){this.name=t,this.init=sj(n.init,r),this.apply=sj(n.apply,r)}}const sEe=[new ep("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new ep("selection",{init(e,t){return e.selection||Rt.atStart(t.doc)},apply(e){return e.selection}}),new ep("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new ep("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class bw{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=sEe.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new ep(r.key,r.spec.state,r))})}}class Ki{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let s=this.config.plugins[r];if(s.spec.filterTransaction&&!s.spec.filterTransaction.call(s,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),s=null;for(;;){let o=!1;for(let l=0;l<this.config.plugins.length;l++){let c=this.config.plugins[l];if(c.spec.appendTransaction){let u=s?s[l].n:0,f=s?s[l].state:this,h=u<n.length&&c.spec.appendTransaction.call(c,u?n.slice(u):n,f,r);if(h&&r.filterTransaction(h,l)){if(h.setMeta("appendedTransaction",t),!s){s=[];for(let p=0;p<this.config.plugins.length;p++)s.push(p<l?{state:r,n:n.length}:{state:this,n:0})}n.push(h),r=r.applyInner(h),o=!0}s&&(s[l]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ki(this.config),r=this.config.fields;for(let s=0;s<r.length;s++){let o=r[s];n[o.name]=o.apply(t,this[o.name],this,n)}return n}get tr(){return new rEe(this)}static create(t){let n=new bw(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Ki(n);for(let s=0;s<n.fields.length;s++)r[n.fields[s].name]=n.fields[s].init(t,r);return r}reconfigure(t){let n=new bw(this.schema,t.plugins),r=n.fields,s=new Ki(n);for(let o=0;o<r.length;o++){let l=r[o].name;s[l]=this.hasOwnProperty(l)?this[l]:r[o].init(t,s)}return s}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let s=t[r],o=s.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(s,this[s.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let s=new bw(t.schema,t.plugins),o=new Ki(s);return s.fields.forEach(l=>{if(l.name=="doc")o.doc=tu.fromJSON(t.schema,n.doc);else if(l.name=="selection")o.selection=Rt.fromJSON(o.doc,n.selection);else if(l.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let c in r){let u=r[c],f=u.spec.state;if(u.key==l.name&&f&&f.fromJSON&&Object.prototype.hasOwnProperty.call(n,c)){o[l.name]=f.fromJSON.call(u,t,n[c],o);return}}o[l.name]=l.init(t,o)}}),o}}function d$(e,t,n){for(let r in e){let s=e[r];s instanceof Function?s=s.bind(t):r=="handleDOMEvents"&&(s=d$(s,t,{})),n[r]=s}return n}class Gs{constructor(t){this.spec=t,this.props={},t.props&&d$(t.props,this,this.props),this.key=t.key?t.key.key:f$("plugin")}getState(t){return t[this.key]}}const vw=Object.create(null);function f$(e){return e in vw?e+"$"+ ++vw[e]:(vw[e]=0,e+"$")}class Lo{constructor(t="key"){this.key=f$(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const h$=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function p$(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const m$=(e,t,n)=>{let r=p$(e,n);if(!r)return!1;let s=SN(r);if(!s){let l=r.blockRange(),c=l&&Pf(l);return c==null?!1:(t&&t(e.tr.lift(l,c).scrollIntoView()),!0)}let o=s.nodeBefore;if(C$(e,s,t,-1))return!0;if(r.parent.content.size==0&&(vf(o,"end")||nt.isSelectable(o)))for(let l=r.depth;;l--){let c=zb(e.doc,r.before(l),r.after(l),Ue.empty);if(c&&c.slice.size<c.to-c.from){if(t){let u=e.tr.step(c);u.setSelection(vf(o,"end")?Rt.findFrom(u.doc.resolve(u.mapping.map(s.pos,-1)),-1):nt.create(u.doc,s.pos-o.nodeSize)),t(u.scrollIntoView())}return!0}if(l==1||r.node(l-1).childCount>1)break}return o.isAtom&&s.depth==r.depth-1?(t&&t(e.tr.delete(s.pos-o.nodeSize,s.pos).scrollIntoView()),!0):!1},oEe=(e,t,n)=>{let r=p$(e,n);if(!r)return!1;let s=SN(r);return s?g$(e,s,t):!1},iEe=(e,t,n)=>{let r=x$(e,n);if(!r)return!1;let s=wN(r);return s?g$(e,s,t):!1};function g$(e,t,n){let r=t.nodeBefore,s=r,o=t.pos-1;for(;!s.isTextblock;o--){if(s.type.spec.isolating)return!1;let h=s.lastChild;if(!h)return!1;s=h}let l=t.nodeAfter,c=l,u=t.pos+1;for(;!c.isTextblock;u++){if(c.type.spec.isolating)return!1;let h=c.firstChild;if(!h)return!1;c=h}let f=zb(e.doc,o,u,Ue.empty);if(!f||f.from!=o||f instanceof _n&&f.slice.size>=u-o)return!1;if(n){let h=e.tr.step(f);h.setSelection(dt.create(h.doc,o)),n(h.scrollIntoView())}return!0}function vf(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const y$=(e,t,n)=>{let{$head:r,empty:s}=e.selection,o=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=SN(r)}let l=o&&o.nodeBefore;return!l||!nt.isSelectable(l)?!1:(t&&t(e.tr.setSelection(nt.create(e.doc,o.pos-l.nodeSize)).scrollIntoView()),!0)};function SN(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function x$(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const b$=(e,t,n)=>{let r=x$(e,n);if(!r)return!1;let s=wN(r);if(!s)return!1;let o=s.nodeAfter;if(C$(e,s,t,1))return!0;if(r.parent.content.size==0&&(vf(o,"start")||nt.isSelectable(o))){let l=zb(e.doc,r.before(),r.after(),Ue.empty);if(l&&l.slice.size<l.to-l.from){if(t){let c=e.tr.step(l);c.setSelection(vf(o,"start")?Rt.findFrom(c.doc.resolve(c.mapping.map(s.pos)),1):nt.create(c.doc,c.mapping.map(s.pos))),t(c.scrollIntoView())}return!0}}return o.isAtom&&s.depth==r.depth-1?(t&&t(e.tr.delete(s.pos,s.pos+o.nodeSize).scrollIntoView()),!0):!1},v$=(e,t,n)=>{let{$head:r,empty:s}=e.selection,o=r;if(!s)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=wN(r)}let l=o&&o.nodeAfter;return!l||!nt.isSelectable(l)?!1:(t&&t(e.tr.setSelection(nt.create(e.doc,o.pos)).scrollIntoView()),!0)};function wN(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const lEe=(e,t)=>{let n=e.selection,r=n instanceof nt,s;if(r){if(n.node.isTextblock||!Za(e.doc,n.from))return!1;s=n.from}else if(s=Pb(e.doc,n.from,-1),s==null)return!1;if(t){let o=e.tr.join(s);r&&o.setSelection(nt.create(o.doc,s-e.doc.resolve(s).nodeBefore.nodeSize)),t(o.scrollIntoView())}return!0},aEe=(e,t)=>{let n=e.selection,r;if(n instanceof nt){if(n.node.isTextblock||!Za(e.doc,n.to))return!1;r=n.to}else if(r=Pb(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},cEe=(e,t)=>{let{$from:n,$to:r}=e.selection,s=n.blockRange(r),o=s&&Pf(s);return o==null?!1:(t&&t(e.tr.lift(s,o).scrollIntoView()),!0)},S$=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
|
|
364
|
-
`).scrollIntoView()),!0)};function EN(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const uEe=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let s=n.node(-1),o=n.indexAfter(-1),l=EN(s.contentMatchAt(o));if(!l||!s.canReplaceWith(o,o,l))return!1;if(t){let c=n.after(),u=e.tr.replaceWith(c,c,l.createAndFill());u.setSelection(Rt.near(u.doc.resolve(c),1)),t(u.scrollIntoView())}return!0},w$=(e,t)=>{let n=e.selection,{$from:r,$to:s}=n;if(n instanceof Hs||r.parent.inlineContent||s.parent.inlineContent)return!1;let o=EN(s.parent.contentMatchAt(s.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let l=(!r.parentOffset&&s.index()<s.parent.childCount?r:s).pos,c=e.tr.insert(l,o.createAndFill());c.setSelection(dt.create(c.doc,l+1)),t(c.scrollIntoView())}return!0},E$=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(sl(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),s=r&&Pf(r);return s==null?!1:(t&&t(e.tr.lift(r,s).scrollIntoView()),!0)};function dEe(e){return(t,n)=>{if(t.selection instanceof nt&&t.selection.node.isBlock){let{$from:x}=t.selection;return!x.parentOffset||!sl(t.doc,x.pos)?!1:(n&&n(t.tr.split(x.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let r=t.tr;!t.selection.empty&&(t.selection instanceof dt||t.selection instanceof Hs)&&r.deleteSelection();let{$from:s}=r.selection,o=r.steps.length,l=[],c,u,f=!1,h=!1;for(let x=s.depth;;x--)if(s.node(x).isBlock){f=s.end(x)==s.pos+(s.depth-x),h=s.start(x)==s.pos-(s.depth-x),u=EN(s.node(x-1).contentMatchAt(s.indexAfter(x-1))),l.unshift(f&&u?{type:u}:null),c=x;break}else{if(x==1)return!1;l.unshift(null)}let p=s.pos,y=sl(r.doc,p,l.length,l);if(y||(l[0]=u?{type:u}:null,y=sl(r.doc,p,l.length,l)),!y)return!1;if(r.split(p,l.length,l),!f&&h&&s.node(c).type!=u){let x=r.mapping.slice(o),b=x.map(s.before(c)),S=r.doc.resolve(b);u&&s.node(c-1).canReplaceWith(S.index(),S.index()+1,u)&&r.setNodeMarkup(x.map(s.before(c)),u)}return n&&n(r.scrollIntoView()),!0}}const fEe=dEe(),hEe=(e,t)=>{let{$from:n,to:r}=e.selection,s,o=n.sharedDepth(r);return o==0?!1:(s=n.before(o),t&&t(e.tr.setSelection(nt.create(e.doc,s))),!0)};function pEe(e,t,n){let r=t.nodeBefore,s=t.nodeAfter,o=t.index();return!r||!s||!r.type.compatibleContent(s.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(s.isTextblock||Za(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function C$(e,t,n,r){let s=t.nodeBefore,o=t.nodeAfter,l,c,u=s.type.spec.isolating||o.type.spec.isolating;if(!u&&pEe(e,t,n))return!0;let f=!u&&t.parent.canReplace(t.index(),t.index()+1);if(f&&(l=(c=s.contentMatchAt(s.childCount)).findWrapping(o.type))&&c.matchType(l[0]||o.type).validEnd){if(n){let x=t.pos+o.nodeSize,b=Ie.empty;for(let C=l.length-1;C>=0;C--)b=Ie.from(l[C].create(null,b));b=Ie.from(s.copy(b));let S=e.tr.step(new or(t.pos-1,x,t.pos,x,new Ue(b,1,0),l.length,!0)),E=S.doc.resolve(x+2*l.length);E.nodeAfter&&E.nodeAfter.type==s.type&&Za(S.doc,E.pos)&&S.join(E.pos),n(S.scrollIntoView())}return!0}let h=o.type.spec.isolating||r>0&&u?null:Rt.findFrom(t,1),p=h&&h.$from.blockRange(h.$to),y=p&&Pf(p);if(y!=null&&y>=t.depth)return n&&n(e.tr.lift(p,y).scrollIntoView()),!0;if(f&&vf(o,"start",!0)&&vf(s,"end")){let x=s,b=[];for(;b.push(x),!x.isTextblock;)x=x.lastChild;let S=o,E=1;for(;!S.isTextblock;S=S.firstChild)E++;if(x.canReplace(x.childCount,x.childCount,S.content)){if(n){let C=Ie.empty;for(let T=b.length-1;T>=0;T--)C=Ie.from(b[T].copy(C));let R=e.tr.step(new or(t.pos-b.length,t.pos+o.nodeSize,t.pos+E,t.pos+o.nodeSize-E,new Ue(C,b.length,0),0,!0));n(R.scrollIntoView())}return!0}}return!1}function T$(e){return function(t,n){let r=t.selection,s=e<0?r.$from:r.$to,o=s.depth;for(;s.node(o).isInline;){if(!o)return!1;o--}return s.node(o).isTextblock?(n&&n(t.tr.setSelection(dt.create(t.doc,e<0?s.start(o):s.end(o)))),!0):!1}}const mEe=T$(-1),gEe=T$(1);function yEe(e,t=null){return function(n,r){let{$from:s,$to:o}=n.selection,l=s.blockRange(o),c=l&&bN(l,e,t);return c?(r&&r(n.tr.wrap(l,c).scrollIntoView()),!0):!1}}function oj(e,t=null){return function(n,r){let s=!1;for(let o=0;o<n.selection.ranges.length&&!s;o++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[o];n.doc.nodesBetween(l,c,(u,f)=>{if(s)return!1;if(!(!u.isTextblock||u.hasMarkup(e,t)))if(u.type==e)s=!0;else{let h=n.doc.resolve(f),p=h.index();s=h.parent.canReplaceWith(p,p+1,e)}})}if(!s)return!1;if(r){let o=n.tr;for(let l=0;l<n.selection.ranges.length;l++){let{$from:{pos:c},$to:{pos:u}}=n.selection.ranges[l];o.setBlockType(c,u,e,t)}r(o.scrollIntoView())}return!0}}function CN(...e){return function(t,n,r){for(let s=0;s<e.length;s++)if(e[s](t,n,r))return!0;return!1}}CN(h$,m$,y$);CN(h$,b$,v$);CN(S$,w$,E$,fEe);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function xEe(e,t=null){return function(n,r){let{$from:s,$to:o}=n.selection,l=s.blockRange(o);if(!l)return!1;let c=r?n.tr:null;return bEe(c,l,e,t)?(r&&r(c.scrollIntoView()),!0):!1}}function bEe(e,t,n,r=null){let s=!1,o=t,l=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let u=l.resolve(t.start-2);o=new Sx(u,u,t.depth),t.endIndex<t.parent.childCount&&(t=new Sx(t.$from,l.resolve(t.$to.end(t.depth)),t.depth)),s=!0}let c=bN(o,n,r,t);return c?(e&&vEe(e,t,c,s,n),!0):!1}function vEe(e,t,n,r,s){let o=Ie.empty;for(let h=n.length-1;h>=0;h--)o=Ie.from(n[h].type.create(n[h].attrs,o));e.step(new or(t.start-(r?2:0),t.end,t.start,t.end,new Ue(o,0,0),n.length,!0));let l=0;for(let h=0;h<n.length;h++)n[h].type==s&&(l=h+1);let c=n.length-l,u=t.start+n.length-(r?2:0),f=t.parent;for(let h=t.startIndex,p=t.endIndex,y=!0;h<p;h++,y=!1)!y&&sl(e.doc,u,c)&&(e.split(u,c),u+=2*c),u+=f.child(h).nodeSize;return e}function SEe(e){return function(t,n){let{$from:r,$to:s}=t.selection,o=r.blockRange(s,l=>l.childCount>0&&l.firstChild.type==e);return o?n?r.node(o.depth-1).type==e?wEe(t,n,e,o):EEe(t,n,o):!0:!1}}function wEe(e,t,n,r){let s=e.tr,o=r.end,l=r.$to.end(r.depth);o<l&&(s.step(new or(o-1,l,o,l,new Ue(Ie.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Sx(s.doc.resolve(r.$from.pos),s.doc.resolve(l),r.depth));const c=Pf(r);if(c==null)return!1;s.lift(r,c);let u=s.doc.resolve(s.mapping.map(o,-1)-1);return Za(s.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&s.join(u.pos),t(s.scrollIntoView()),!0}function EEe(e,t,n){let r=e.tr,s=n.parent;for(let x=n.end,b=n.endIndex-1,S=n.startIndex;b>S;b--)x-=s.child(b).nodeSize,r.delete(x-1,x+1);let o=r.doc.resolve(n.start),l=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let c=n.startIndex==0,u=n.endIndex==s.childCount,f=o.node(-1),h=o.index(-1);if(!f.canReplace(h+(c?0:1),h+1,l.content.append(u?Ie.empty:Ie.from(s))))return!1;let p=o.pos,y=p+l.nodeSize;return r.step(new or(p-(c?1:0),y+(u?1:0),p+1,y-1,new Ue((c?Ie.empty:Ie.from(s.copy(Ie.empty))).append(u?Ie.empty:Ie.from(s.copy(Ie.empty))),c?0:1,u?0:1),c?0:1)),t(r.scrollIntoView()),!0}function CEe(e){return function(t,n){let{$from:r,$to:s}=t.selection,o=r.blockRange(s,f=>f.childCount>0&&f.firstChild.type==e);if(!o)return!1;let l=o.startIndex;if(l==0)return!1;let c=o.parent,u=c.child(l-1);if(u.type!=e)return!1;if(n){let f=u.lastChild&&u.lastChild.type==c.type,h=Ie.from(f?e.create():null),p=new Ue(Ie.from(e.create(null,Ie.from(c.type.create(null,h)))),f?3:1,0),y=o.start,x=o.end;n(t.tr.step(new or(y-(f?3:1),x,y,x,p,1,!0)).scrollIntoView())}return!0}}const wr=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Sf=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let MC=null;const Bi=function(e,t,n){let r=MC||(MC=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},TEe=function(){MC=null},mu=function(e,t,n,r){return n&&(ij(e,t,n,r,-1)||ij(e,t,n,r,1))},NEe=/^(img|br|input|textarea|hr)$/i;function ij(e,t,n,r,s){for(var o;;){if(e==n&&t==r)return!0;if(t==(s<0?0:Pr(e))){let l=e.parentNode;if(!l||!et(l)||Km(e)||NEe.test(e.nodeName)||e.contentEditable=="false")return!1;t=wr(e)+(s<0?0:1),e=l}else if(et(e)){let l=e.childNodes[t+(s<0?-1:0)];if(et(l)&&l.contentEditable=="false")if(!((o=l.pmViewDesc)===null||o===void 0)&&o.ignoreForSelection)t+=s;else return!1;else e=l,t=s<0?Pr(e):0}else return!1}}function Pr(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function et(e){return e.nodeType==1}function Jn(e){return e.nodeType==3}function gu(e,t){return t?e.contains(et(t)?t:t.parentNode):!1}function REe(e,t){for(;;){if(Jn(e)&&t)return e;if(et(e)&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=Pr(e)}else if(e.parentNode&&!Km(e))t=wr(e),e=e.parentNode;else return null}}function OEe(e,t){for(;;){if(Jn(e)&&t<e.nodeValue.length)return e;if(et(e)&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Km(e))t=wr(e)+1,e=e.parentNode;else return null}}function AEe(e,t,n){for(let r=t==0,s=t==Pr(e);r||s;){if(e==n)return!0;let o=wr(e);if(e=e.parentNode,!e)return!1;r=r&&o==0,s=s&&o==Pr(e)}}function Km(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Hb=function(e){return e.focusNode&&mu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Ic(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function kEe(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function _Ee(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Pr(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Pr(r.startContainer),r.startOffset)}}}const di=typeof navigator<"u"?navigator:null,lj=typeof document<"u"?document:null,Ja=di&&di.userAgent||"",IC=/Edge\/(\d+)/.exec(Ja),N$=/MSIE \d/.exec(Ja),LC=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ja),vs=!!(N$||LC||IC),ka=N$?document.documentMode:LC?+LC[1]:IC?+IC[1]:0,Fs=!vs&&/gecko\/(\d+)/i.test(Ja);Fs&&+(/Firefox\/(\d+)/.exec(Ja)||[0,0])[1];const DC=!vs&&/Chrome\/(\d+)/.exec(Ja),Cr=!!DC,R$=DC?+DC[1]:0,Br=!vs&&!!di&&/Apple Computer/.test(di.vendor),wf=Br&&(/Mobile\/\w+/.test(Ja)||!!di&&di.maxTouchPoints>2),ro=wf||(di?/Mac/.test(di.platform):!1),O$=di?/Win/.test(di.platform):!1,Yi=/Android \d/.test(Ja),Fb=!!lj&&"webkitFontSmoothing"in lj.documentElement.style,MEe=Fb?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function IEe(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function ji(e,t){return typeof e=="number"?e:e[t]}function LEe(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function aj(e,t,n){if(!jC(t)&&t.left==0)return;let r=e.someProp("scrollThreshold")||0,s=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let l=n||e.dom;l;){if(!et(l)){l=Sf(l);continue}let c=l==o.body,u=c?IEe(o):LEe(l),f=0,h=0;if(t.top<u.top+ji(r,"top")?h=-(u.top-t.top+ji(s,"top")):t.bottom>u.bottom-ji(r,"bottom")&&(h=t.bottom-t.top>u.bottom-u.top?t.top+ji(s,"top")-u.top:t.bottom-u.bottom+ji(s,"bottom")),t.left<u.left+ji(r,"left")?f=-(u.left-t.left+ji(s,"left")):t.right>u.right-ji(r,"right")&&(f=t.right-u.right+ji(s,"right")),f||h)if(c)o.defaultView.scrollBy(f,h);else{let y=l.scrollLeft,x=l.scrollTop;h&&(l.scrollTop+=h),f&&(l.scrollLeft+=f);let b=l.scrollLeft-y,S=l.scrollTop-x;t={left:t.left-b,top:t.top-S,right:t.right-b,bottom:t.bottom-S}}let p=c?"fixed":getComputedStyle(l).position;if(/^(fixed|sticky)$/.test(p))break;l=p=="absolute"?l.offsetParent:Sf(l)}}function DEe(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,s;for(let o=(t.left+t.right)/2,l=n+1;l<Math.min(innerHeight,t.bottom);l+=5){let c=e.root.elementFromPoint(o,l);if(!c||c==e.dom||!e.dom.contains(c))continue;let u=c.getBoundingClientRect();if(u.top>=n-20){r=c,s=u.top;break}}return{refDOM:r,refTop:s,stack:A$(e.dom)}}function A$(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Sf(r));return t}function jEe({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;k$(n,r==0?0:r-t)}function k$(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:s,left:o}=e[n];r.scrollTop!=s+t&&(r.scrollTop=s+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let yd=null;function PEe(e){if(e.setActive)return e.setActive();if(yd)return e.focus(yd);let t=A$(e);e.focus(yd==null?{get preventScroll(){return yd={preventScroll:!0},!0}}:void 0),yd||(yd=!1,k$(t,0))}function _$(e,t){let n,r=2e8,s,o=0,l=t.top,c=t.top,u,f;for(let h=e.firstChild,p=0;h;h=h.nextSibling,p++){let y;if(et(h))y=h.getClientRects();else if(Jn(h))y=Bi(h).getClientRects();else continue;for(let x=0;x<y.length;x++){let b=y[x];if(b.top<=l&&b.bottom>=c){l=Math.max(b.bottom,l),c=Math.min(b.top,c);let S=b.left>t.left?b.left-t.left:b.right<t.left?t.left-b.right:0;if(S<r){n=h,r=S,s=S&&Jn(n)?{left:b.right<t.left?b.right:b.left,top:t.top}:t,et(h)&&S&&(o=p+(t.left>=(b.left+b.right)/2?1:0));continue}}else b.top>t.top&&!u&&b.left<=t.left&&b.right>=t.left&&(u=h,f={left:Math.max(b.left,Math.min(b.right,t.left)),top:b.top});!n&&(t.left>=b.right&&t.top>=b.top||t.left>=b.left&&t.top>=b.bottom)&&(o=p+1)}}return!n&&u&&(n=u,s=f,r=0),n&&Jn(n)?zEe(n,s):!n||r?{node:e,offset:o}:_$(n,s)}function zEe(e,t){let n=e.nodeValue.length,r=document.createRange(),s;for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let l=ia(r,1);if(l.top!=l.bottom&&TN(t,l)){s={node:e,offset:o+(t.left>=(l.left+l.right)/2?1:0)};break}}return r.detach(),s||{node:e,offset:0}}function TN(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function BEe(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function HEe(e,t,n){let{node:r,offset:s}=_$(t,n),o=-1;if(et(r)&&!r.firstChild){let l=r.getBoundingClientRect();o=l.left!=l.right&&n.left>(l.left+l.right)/2?1:-1}return e.docView.posFromDOM(r,s,o)}function FEe(e,t,n,r){let s=-1;for(let o=t,l=!1;o!=e.dom;){let c=e.docView.nearestDesc(o,!0),u;if(!c)return null;if(et(c.dom)&&(c.node.isBlock&&c.parent||!c.contentDOM)&&((u=c.dom.getBoundingClientRect()).width||u.height)&&(c.node.isBlock&&c.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(c.dom.nodeName)&&(!l&&u.left>r.left||u.top>r.top?s=c.posBefore:(!l&&u.right<r.left||u.bottom<r.top)&&(s=c.posAfter),l=!0),!c.contentDOM&&s<0&&!c.node.isText))return(c.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?c.posBefore:c.posAfter;o=c.dom.parentNode}return s>-1?s:e.docView.posFromDOM(t,n,-1)}function M$(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let s=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=s;;){let l=e.childNodes[o];if(et(l)){let c=l.getClientRects();for(let u=0;u<c.length;u++){let f=c[u];if(TN(t,f))return M$(l,t,f)}}if((o=(o+1)%r)==s)break}return e}function $Ee(e,t){let n=e.dom.ownerDocument,r,s=0,o=_Ee(n,t.left,t.top);o&&({node:r,offset:s}=o);let l=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),c;if(!l||!e.dom.contains(l)){let f=e.dom.getBoundingClientRect();if(!TN(t,f)||(l=M$(e.dom,t,f),!l))return null}if(Br)for(let f=l;r&&f;f=Sf(f))f.draggable&&(r=void 0);if(l=BEe(l,t),r){if(Fs&&et(r)&&(s=Math.min(s,r.childNodes.length),s<r.childNodes.length)){let h=r.childNodes[s],p;h.nodeName=="IMG"&&(p=h.getBoundingClientRect()).right<=t.left&&p.bottom>t.top&&s++}let f;Fb&&s&&et(r)&&et(f=r.childNodes[s-1])&&f.contentEditable=="false"&&f.getBoundingClientRect().top>=t.top&&s--,r==e.dom&&s==r.childNodes.length-1&&et(r.lastChild)&&t.top>r.lastChild.getBoundingClientRect().bottom?c=e.state.doc.content.size:(s==0||!et(r)||r.childNodes[s-1].nodeName!="BR")&&(c=FEe(e,r,s,t))}c==null&&(c=HEe(e,l,t));let u=e.docView.nearestDesc(l,!0);return{pos:c,inside:u?u.posAtStart-u.border:-1}}function jC(e){return e.top<e.bottom||e.left<e.right}function ia(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(jC(r))return r}return Array.prototype.find.call(n,jC)||e.getBoundingClientRect()}const UEe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function I$(e,t,n){let{node:r,offset:s,atom:o}=e.docView.domFromPos(t,n<0?-1:1),l=Fb||Fs;if(Jn(r))if(l&&(UEe.test(r.nodeValue)||(n<0?!s:s==r.nodeValue.length))){let u=ia(Bi(r,s,s),n);if(Fs&&s&&/\s/.test(r.nodeValue[s-1])&&s<r.nodeValue.length){let f=ia(Bi(r,s-1,s-1),-1);if(f.top==u.top){let h=ia(Bi(r,s,s+1),-1);if(h.top!=u.top)return Hh(h,h.left<f.left)}}return u}else{let u=s,f=s,h=n<0?1:-1;return n<0&&!s?(f++,h=-1):n>=0&&s==r.nodeValue.length?(u--,h=1):n<0?u--:f++,Hh(ia(Bi(r,u,f),h),h<0)}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(o==null&&s&&(n<0||s==Pr(r))){let u=r.childNodes[s-1];if(et(u))return Sw(u.getBoundingClientRect(),!1)}if(o==null&&s<Pr(r)){let u=r.childNodes[s];if(et(u))return Sw(u.getBoundingClientRect(),!0)}return Sw(r.getBoundingClientRect(),n>=0)}if(o==null&&s&&(n<0||s==Pr(r))){let u=r.childNodes[s-1],f=Jn(u)?Bi(u,Pr(u)-(l?0:1)):et(u)&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(f)return Hh(ia(f,1),!1)}if(o==null&&s<Pr(r)){let u=r.childNodes[s];for(;u.pmViewDesc&&u.pmViewDesc.ignoreForCoords;)u=u.nextSibling;let f=u?Jn(u)?Bi(u,0,l?0:1):et(u)?u:null:null;if(f)return Hh(ia(f,-1),!0)}return Hh(ia(Jn(r)?Bi(r):r,-n),n>=0)}function Hh(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Sw(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function L$(e,t,n){let r=e.state,s=e.root.activeElement;r!=t&&e.updateState(t),s!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),s!=e.dom&&s&&s.focus()}}function VEe(e,t,n){let r=t.selection,s=n=="up"?r.$from:r.$to;return L$(e,t,()=>{let{node:o}=e.docView.domFromPos(s.pos,n=="up"?-1:1);for(;;){let c=e.docView.nearestDesc(o,!0);if(!c)break;if(c.node.isBlock){o=c.contentDOM||c.dom;break}o=c.dom.parentNode}let l=I$(e,s.pos,1);for(let c=o.firstChild;c;c=c.nextSibling){let u;if(et(c))u=c.getClientRects();else if(Jn(c))u=Bi(c,0,c.nodeValue.length).getClientRects();else continue;for(let f=0;f<u.length;f++){let h=u[f];if(h.bottom>h.top+1&&(n=="up"?l.top-h.top>(h.bottom-l.top)*2:h.bottom-l.bottom>(l.bottom-h.top)*2))return!1}}return!0})}const qEe=/[\u0590-\u08ac]/;function GEe(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let s=r.parentOffset,o=!s,l=s==r.parent.content.size,c=e.domSelection();return c?!qEe.test(r.parent.textContent)||!c.modify?n=="left"||n=="backward"?o:l:L$(e,t,()=>{let{focusNode:u,focusOffset:f,anchorNode:h,anchorOffset:p}=e.domSelectionRange(),y=c.caretBidiLevel;c.modify("move",n,"character");let x=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:b,focusOffset:S}=e.domSelectionRange(),E=b&&!gu(x,b)||u==b&&f==S;try{c.collapse(h,p),u&&(u!=h||f!=p)&&c.extend&&c.extend(u,f)}catch{}return y!=null&&(c.caretBidiLevel=y),E}):r.pos==r.start()||r.pos==r.end()}let cj=null,uj=null,dj=!1;function KEe(e,t,n){return cj==t&&uj==n?dj:(cj=t,uj=n,dj=n=="up"||n=="down"?VEe(e,t,n):GEe(e,t,n))}const lo=0,fj=1,zc=2,Ao=3;class Ym{constructor(t,n,r,s){this.parent=t,this.children=n,this.dom=r,this.contentDOM=s,this.dirty=lo,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(t){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let s=this.children[n];if(s==t)return r;r+=s.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&gu(this.contentDOM,t))if(r<0){let o,l;if(t==this.contentDOM)o=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&!((l=o.pmViewDesc)&&l.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(l)+l.size:this.posAtStart}else{let o,l;if(t==this.contentDOM)o=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&!((l=o.pmViewDesc)&&l.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(l):this.posAtEnd}let s;if(t==this.dom&&this.contentDOM)s=n>wr(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=!!(t.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(n==0)for(let o=t;;o=o.parentNode){if(o==this.dom){s=!1;break}if(o.previousSibling)break}if(s==null&&n==t.childNodes.length)for(let o=t;;o=o.parentNode){if(o==this.dom){s=!0;break}if(o.nextSibling)break}}return s??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,s=t;s;s=s.parentNode){let o=this.getDesc(s),l;if(o&&(!n||o.node))if(r&&(l=o.nodeDOM)&&!(et(l)?gu(l,t):l==t))r=!1;else return o}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let s=t;s;s=s.parentNode){let o=this.getDesc(s);if(o)return o.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let s=this.children[n],o=r+s.size;if(r==t&&o!=r){for(;!s.border&&s.children.length;)for(let l=0;l<s.children.length;l++){let c=s.children[l];if(c.size){s=c;break}}return s}if(t<o)return s.descAt(t-r-s.border);r=o}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,s=0;for(let o=0;r<this.children.length;r++){let l=this.children[r],c=o+l.size;if(c>t){s=t-o;break}o=c}if(s)return this.children[r].domFromPos(s-this.children[r].border,n);for(;r>0;r--){let o=this.children[r-1];if(o.size||!(o instanceof j$||o instanceof D$&&o.side>=0))break}if(n<=0){let o,l=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,l=!1);return o&&n&&l&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?wr(o.dom)+1:0}}else{let o,l=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,l=!1);return o&&l&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?wr(o.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let s=-1,o=-1;for(let l=r,c=0;;c++){let u=this.children[c],f=l+u.size;if(s==-1&&t<=f){let h=l+u.border;if(t>=h&&n<=f-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(t,n,h);t=l;for(let p=c;p>0;p--){let y=this.children[p-1];if(y.size&&y.dom.parentNode==this.contentDOM&&!y.emptyChildAt(1)){s=wr(y.dom)+1;break}t-=y.size}s==-1&&(s=0)}if(s>-1&&(f>n||c==this.children.length-1)){n=f;for(let h=c+1;h<this.children.length;h++){let p=this.children[h];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){o=wr(p.dom);break}n+=p.size}o==-1&&(o=this.contentDOM.childNodes.length);break}l=f}return{node:this.contentDOM,from:t,to:n,fromOffset:s,toOffset:o}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(!et(n)||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,s=!1){let o=Math.min(t,n),l=Math.max(t,n);for(let x=0,b=0;x<this.children.length;x++){let S=this.children[x],E=b+S.size;if(o>b&&l<E)return S.setSelection(t-b-S.border,n-b-S.border,r,s);b=E}let c=this.domFromPos(t,t?-1:1),u=n==t?c:this.domFromPos(n,n?-1:1),f=r.root.getSelection(),h=r.domSelectionRange(),p=!1;if((Fs||Br)&&t==n){let{node:x,offset:b}=c;if(Jn(x)){if(p=!!(b&&x.nodeValue[b-1]==`
|
|
365
|
-
`),p&&b==x.nodeValue.length)for(let S=x,E;S;S=S.parentNode){if(E=S.nextSibling){E.nodeName=="BR"&&(c=u={node:E.parentNode,offset:wr(E)+1});break}let C=S.pmViewDesc;if(C&&C.node&&C.node.isBlock)break}}else{let S=x.childNodes[b-1];p=S&&(S.nodeName=="BR"||S.contentEditable=="false")}}if(Fs&&h.focusNode&&h.focusNode!=u.node&&et(h.focusNode)){let x=h.focusNode.childNodes[h.focusOffset];x&&x.contentEditable=="false"&&(s=!0)}if(!(s||p&&Br)&&mu(c.node,c.offset,h.anchorNode,h.anchorOffset)&&mu(u.node,u.offset,h.focusNode,h.focusOffset))return;let y=!1;if((f.extend||t==n)&&!(p&&Fs)){f.collapse(c.node,c.offset);try{t!=n&&f.extend(u.node,u.offset),y=!0}catch{}}if(!y){if(t>n){let b=c;c=u,u=b}let x=document.createRange();x.setEnd(u.node,u.offset),x.setStart(c.node,c.offset),f.removeAllRanges(),f.addRange(x)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,s=0;s<this.children.length;s++){let o=this.children[s],l=r+o.size;if(r==l?t<=l&&n>=r:t<l&&n>r){let c=r+o.border,u=l-o.border;if(t>=c&&n<=u){this.dirty=t==r||n==l?zc:fj,t==c&&n==u&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Ao:o.markDirty(t-c,n-c);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?zc:Ao}r=l}this.dirty=zc}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?zc:fj;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class D$ extends Ym{constructor(t,n,r,s){let o,l=n.type.toDOM;if(typeof l=="function"&&(l=l(r,()=>{if(!o)return s;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){let c=et(l)?l:document.createElement("span");c!=l&&c.appendChild(l),c.hasAttribute("contenteditable")||(c.contentEditable="false"),c.classList.add("ProseMirror-widget")}super(t,[],l,null),this.widget=n,this.widget=n,o=this}matchesWidget(t){return this.dirty==lo&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class YEe extends Ym{constructor(t,n,r,s){super(t,[],n,null),this.textDOM=r,this.text=s}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class _a extends Ym{constructor(t,n,r,s,o){super(t,[],r,s),this.mark=n,this.spec=o}static create(t,n,r,s){let o=s.nodeViews[n.type.name],l=o&&o(n,s,r);return(!l||!l.dom)&&(l=Ru.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new _a(t,n,l.dom,l.contentDOM||l.dom,l)}parseRule(){return this.dirty&Ao||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Ao&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=lo){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=lo}}slice(t,n,r){let s=_a.create(this.parent,this.mark,!0,r),o=this.children,l=this.size;n<l&&(o=zC(o,n,l,r)),t>0&&(o=zC(o,0,t,r));for(let c=0;c<o.length;c++)o[c].parent=s;return s.children=o,s}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Ma extends Ym{constructor(t,n,r,s,o,l,c){super(t,[],o,l),this.node=n,this.outerDeco=r,this.innerDeco=s,this.nodeDOM=c}static create(t,n,r,s,o,l){let c=o.nodeViews[n.type.name],u,f=c&&c(n,o,()=>{if(!u)return l;if(u.parent)return u.parent.posBeforeChild(u)},r,s),h=f&&f.dom,p=f&&f.contentDOM;if(n.isText){if(!h)h=document.createTextNode(n.text);else if(!Jn(h))throw new RangeError("Text must be rendered as a DOM text node")}else h||({dom:h,contentDOM:p}=Ru.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!p&&!n.isText&&h.nodeName!="BR"&&(h.hasAttribute("contenteditable")||(h.contentEditable="false"),n.type.spec.draggable&&(h.draggable=!0));let y=h;return h=B$(h,r,n),f?u=new WEe(t,n,r,s,h,p||null,y,f):n.isText?new $b(t,n,r,s,h,y):new Ma(t,n,r,s,h,p||null,y)}parseRule(t){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let s=this.children[r];if(this.dom.contains(s.dom.parentNode)){n.contentElement=s.dom.parentNode;break}}if(!n.contentElement){let r=t&&t.find(s=>et(s)&&t.indexOf(s.parentNode)<0&&this.dom.contains(s));r?n.contentElement=r:n.getContent=()=>Ie.empty}}return n}matchesNode(t,n,r){return this.dirty==lo&&t.eq(this.node)&&Ex(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,s=n,o=t.composing?this.localCompositionInfo(t,n):null,l=o&&o.pos>-1?o:null,c=o&&o.pos<0,u=new QEe(this,l&&l.node,t),f=this.node.inlineContent,h=f&&this.node.isBlock;eCe(this.node,this.innerDeco,(p,y,x)=>{p.spec.marks?u.syncToMarks(p.spec.marks,r,t,y):p.type.side>=0&&!x&&u.syncToMarks(y==this.node.childCount?tn.none:this.node.child(y).marks,r,t,y),u.placeWidget(p,t,s)},(p,y,x,b)=>{u.syncToMarks(p.marks,r,t,b),h&&p.isAtom&&!p.isText&&u.addHackNode("IMG",u.top);let S;u.findNodeMatch(p,y,x,b)||c&&t.state.selection.from>s&&t.state.selection.to<s+p.nodeSize&&(S=u.findIndexWithChild(o.node))>-1&&u.updateNodeAt(p,y,x,S,t)||u.updateNextNode(p,y,x,t,b,s)||u.addNode(p,y,x,t,s),s+=p.nodeSize,f&&(h=p.isAtom&&!p.isText)}),u.syncToMarks([],r,t,0),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==zc)&&(l&&this.protectLocalComposition(t,l),P$(this.contentDOM,this.children,t),wf&&tCe(this.dom))}localCompositionInfo(t,n){let{from:r,to:s}=t.state.selection;if(!(t.state.selection instanceof dt)||r<n||s>n+this.node.content.size)return null;let o=t.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let l=o.nodeValue,c=nCe(this.node.content,l,r-n,s-n);return c<0?null:{node:o,pos:c,text:l}}else return{node:o,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:s}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let l=new YEe(this,o,n,s);t.input.compositionNodes.push(l),this.children=zC(this.children,r,r+s.length,t,l)}update(t,n,r,s){return this.dirty==Ao||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,s),!0)}updateInner(t,n,r,s){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(s,this.posAtStart),this.dirty=lo}updateOuterDeco(t){if(Ex(t,this.outerDeco))return;let n=!et(this.nodeDOM),r=this.dom;this.dom=z$(this.dom,this.nodeDOM,PC(this.outerDeco,this.node,n),PC(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){et(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){et(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function hj(e,t,n,r,s){B$(r,t,e);let o=new Ma(void 0,e,t,n,r,r,r);return o.contentDOM&&o.updateChildren(s,0),o}class $b extends Ma{constructor(t,n,r,s,o,l){super(t,n,r,s,o,null,l)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,s){return this.dirty==Ao||this.dirty!=lo&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=lo||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,s.trackWrites==this.nodeDOM&&(s.trackWrites=null)),this.node=t,this.dirty=lo,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let s=this.node.cut(t,n),o=document.createTextNode(s.text);return new $b(this.parent,s,this.outerDeco,this.innerDeco,o,o)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Ao)}get domAtom(){return!1}isText(t){return this.node.text==t}}class j$ extends Ym{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==lo&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class WEe extends Ma{constructor(t,n,r,s,o,l,c,u){super(t,n,r,s,o,l,c),this.spec=u}update(t,n,r,s){if(this.dirty==Ao)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let o=this.spec.update(t,n,r);return o&&this.updateInner(t,n,r,s),o}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,s)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,s){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,s)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function P$(e,t,n){let r=e.firstChild,s=!1;for(let o=0;o<t.length;o++){let l=t[o],c=l.dom;if(c.parentNode==e){for(;c!=r;)r=pj(r),s=!0;r=r.nextSibling}else s=!0,e.insertBefore(c,r);if(l instanceof _a){let u=r?r.previousSibling:e.lastChild;P$(l.contentDOM,l.children,n),r=u?u.nextSibling:e.firstChild}}for(;r;)r=pj(r),s=!0;s&&n.trackWrites==e&&(n.trackWrites=null)}const pp=function(e){e&&(this.nodeName=e)};pp.prototype=Object.create(null);const Bc=[new pp];function PC(e,t,n){if(e.length==0)return Bc;let r=n?Bc[0]:new pp,s=[r];for(let o=0;o<e.length;o++){let l=e[o].type.attrs;if(l){l.nodeName&&s.push(r=new pp(l.nodeName));for(let c in l){let u=l[c];u!=null&&(n&&s.length==1&&s.push(r=new pp(t.isInline?"span":"div")),c=="class"?r.class=(r.class?r.class+" ":"")+u:c=="style"?r.style=(r.style?r.style+";":"")+u:c!="nodeName"&&(r[c]=u))}}}return s}function z$(e,t,n,r){if(n==Bc&&r==Bc)return t;let s=t;for(let o=0;o<r.length;o++){let l=r[o],c=n[o];if(o){let u;c&&c.nodeName==l.nodeName&&s!=e&&(u=s.parentNode)&&u.nodeName.toLowerCase()==l.nodeName||(u=document.createElement(l.nodeName),u.pmIsDeco=!0,u.appendChild(s),c=Bc[0]),s=u}XEe(s,c||Bc[0],l)}return s}function XEe(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],s=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)s.indexOf(r[o])==-1&&e.classList.remove(r[o]);for(let o=0;o<s.length;o++)r.indexOf(s[o])==-1&&e.classList.add(s[o]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,s;for(;s=r.exec(t.style);)e.style.removeProperty(s[1])}n.style&&(e.style.cssText+=n.style)}}function B$(e,t,n){return z$(e,e,Bc,PC(t,n,!et(e)))}function Ex(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function pj(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class QEe{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=ZEe(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r,s){let o=0,l=this.stack.length>>1,c=Math.min(l,t.length);for(;o<c&&(o==l-1?this.top:this.stack[o+1<<1]).matchesMark(t[o])&&t[o].type.spec.spanning!==!1;)o++;for(;o<l;)this.destroyRest(),this.top.dirty=lo,this.index=this.stack.pop(),this.top=this.stack.pop(),l--;for(;l<t.length;){this.stack.push(this.top,this.index+1);let u=-1,f=this.top.children.length;s<this.preMatch.index&&(f=Math.min(this.index+3,f));for(let h=this.index;h<f;h++){let p=this.top.children[h];if(p.matchesMark(t[l])&&!this.isLocked(p.dom)){u=h;break}}if(u<0&&this.index<this.top.children.length){let h=this.top.children[this.index];h instanceof _a&&h.dirty!=Ao&&h.mark.type==t[l].type&&h.spec.update&&!this.isLocked(h.dom)&&h.spec.update(t[l])&&(h.mark=t[l],u=this.index,this.changed=!0)}if(u>-1)u>this.index&&(this.changed=!0,this.destroyBetween(this.index,u)),this.top=this.top.children[this.index];else{let h=_a.create(this.top,t[l],n,r);this.top.children.splice(this.index,0,h),this.top=h,this.changed=!0}this.index=0,l++}}findNodeMatch(t,n,r,s){let o=-1,l;if(s>=this.preMatch.index&&(l=this.preMatch.matches[s-this.preMatch.index]).parent==this.top&&l.matchesNode(t,n,r))o=this.top.children.indexOf(l,this.index);else for(let c=this.index,u=Math.min(this.top.children.length,c+5);c<u;c++){let f=this.top.children[c];if(f.matchesNode(t,n,r)&&!this.preMatch.matched.has(f)){o=c;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(t,n,r,s,o){let l=this.top.children[s];return l.dirty==Ao&&l.dom==l.contentDOM&&(l.dirty=zc),l.update(t,n,r,o)?(this.destroyBetween(this.index,s),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let s=this.index;s<this.top.children.length;s++)if(this.top.children[s]==r)return s}return-1}t=n}}updateNextNode(t,n,r,s,o,l){for(let c=this.index;c<this.top.children.length;c++){let u=this.top.children[c];if(u instanceof Ma){let f=this.preMatch.matched.get(u);if(f!=null&&f!=o)return!1;let h=u.dom,p,y=this.isLocked(h)&&!(t.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==t.text&&u.dirty!=Ao&&Ex(n,u.outerDeco));if(!y&&u.update(t,n,r,s))return this.destroyBetween(this.index,c),u.dom!=h&&(this.changed=!0),this.index++,!0;if(!y&&(p=this.recreateWrapper(u,t,n,r,s,l)))return this.destroyBetween(this.index,c),this.top.children[this.index]=p,p.contentDOM&&(p.dirty=zc,p.updateChildren(s,l+1),p.dirty=lo),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,s,o,l){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!Ex(r,t.outerDeco)||!s.eq(t.innerDeco))return null;let c=Ma.create(this.top,n,r,s,o,l);if(c.contentDOM){c.children=t.children,t.children=[];for(let u of c.children)u.parent=c}return t.destroy(),c}addNode(t,n,r,s,o){let l=Ma.create(this.top,t,n,r,s,o);l.contentDOM&&l.updateChildren(s,o+1),this.top.children.splice(this.index++,0,l),this.changed=!0}placeWidget(t,n,r){let s=this.index<this.top.children.length?this.top.children[this.index]:null;if(s&&s.matchesWidget(t)&&(t==s.widget||!s.widget.type.toDOM.parentNode))this.index++;else{let o=new D$(this.top,t,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof _a;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof $b)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Br||Cr)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let s=new j$(this.top,[],r,null);n!=this.top?n.children.push(s):n.children.splice(this.index++,0,s),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||et(t)&&t.contains(this.lock.parentNode))}}function ZEe(e,t){let n=t,r=n.children.length,s=e.childCount,o=new Map,l=[];e:for(;s>0;){let c;for(;;)if(r){let f=n.children[r-1];if(f instanceof _a)n=f,r=f.children.length;else{c=f,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=c.node;if(u){if(u!=e.child(s-1))break;--s,o.set(c,s),l.push(c)}}return{index:s,matched:o,matches:l.reverse()}}function JEe(e,t){return e.type.side-t.type.side}function eCe(e,t,n,r){let s=t.locals(e),o=0;if(s.length==0){for(let f=0;f<e.childCount;f++){let h=e.child(f);r(h,s,t.forChild(o,h),f),o+=h.nodeSize}return}let l=0,c=[],u=null;for(let f=0;;){let h,p;for(;l<s.length&&s[l].to==o;){let E=s[l++];E.widget&&(h?(p||(p=[h])).push(E):h=E)}if(h)if(p){p.sort(JEe);for(let E=0;E<p.length;E++)n(p[E],f,!!u)}else n(h,f,!!u);let y,x;if(u)x=-1,y=u,u=null;else if(f<e.childCount)x=f,y=e.child(f++);else break;for(let E=0;E<c.length;E++)c[E].to<=o&&c.splice(E--,1);for(;l<s.length&&s[l].from<=o&&s[l].to>o;)c.push(s[l++]);let b=o+y.nodeSize;if(y.isText){let E=b;l<s.length&&s[l].from<E&&(E=s[l].from);for(let C=0;C<c.length;C++)c[C].to<E&&(E=c[C].to);E<b&&(u=y.cut(E-o),y=y.cut(0,E-o),b=E,x=-1)}else for(;l<s.length&&s[l].to<b;)l++;let S=y.isInline&&!y.isLeaf?c.filter(E=>!E.inline):c.slice();r(y,S,t.forChild(o,y),x),o=b}}function tCe(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function nCe(e,t,n,r){for(let s=0,o=0;s<e.childCount&&o<=r;){let l=e.child(s++),c=o;if(o+=l.nodeSize,!l.isText)continue;let u=l.text;for(;s<e.childCount;){let f=e.child(s++);if(o+=f.nodeSize,!f.isText)break;u+=f.text}if(o>=n){if(o>=r&&u.slice(r-t.length-c,r-c)==t)return r-t.length;let f=c<r?u.lastIndexOf(t,r-c-1):-1;if(f>=0&&f+t.length+c>=n)return c+f;if(n==r&&u.length>=r+t.length-c&&u.slice(r-c,r-c+t.length)==t)return r}}return-1}function zC(e,t,n,r,s){let o=[];for(let l=0,c=0;l<e.length;l++){let u=e[l],f=c,h=c+=u.size;f>=n||h<=t?o.push(u):(f<t&&o.push(u.slice(0,t-f,r)),s&&(o.push(s),s=void 0),h>n&&o.push(u.slice(n-f,u.size,r)))}return o}function NN(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let s=e.docView.nearestDesc(n.focusNode),o=s&&s.size==0,l=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(l<0)return null;let c=r.resolve(l),u,f;if(Hb(n)){for(u=l;s&&!s.node;)s=s.parent;if(s&&s.node.isAtom&&nt.isSelectable(s.node)&&s.parent&&!(s.node.isInline&&AEe(n.focusNode,n.focusOffset,s.dom))){let p=s.posBefore;f=new nt(l==p?c:r.resolve(p))}else if(Fs&&t=="key"&&l>e.state.selection.to&&et(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&s&&s.posAtStart>e.state.selection.to)for(let p=n.focusNode;;p=p.parentNode){if(getComputedStyle(p).overflow!="visible"){f=Rt.findFrom(r.resolve(s.posAtStart),1);break}if(p==s.dom||p.nextSibling||!p.parentNode||!et(p.parentNode))break}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let p=l,y=l;for(let x=0;x<n.rangeCount;x++){let b=n.getRangeAt(x);p=Math.min(p,e.docView.posFromDOM(b.startContainer,b.startOffset,1)),y=Math.max(y,e.docView.posFromDOM(b.endContainer,b.endOffset,-1))}if(p<0)return null;[u,l]=y==e.state.selection.anchor?[y,p]:[p,y],c=r.resolve(l)}else u=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null}let h=r.resolve(u);if(!f){let p=t=="pointer"||e.state.selection.head<c.pos&&!o?1:-1;f=RN(e,h,c,p)}return f}function H$(e){return e.editable?e.hasFocus():$$(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function ol(e,t=!1){let n=e.state.selection;if(F$(e,n),!H$(e))return;let r=e.input.mouseDown;if(!t&&Cr&&r){let s=e.domSelectionRange(),o=e.domObserver.currentSelection;if(s.anchorNode&&o.anchorNode&&mu(s.anchorNode,s.anchorOffset,o.anchorNode,o.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)sCe(e);else{let{anchor:s,head:o}=n,l,c;mj&&!(n instanceof dt)&&(n.$from.parent.inlineContent||(l=gj(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(c=gj(e,n.to))),e.docView.setSelection(s,o,e,t),mj&&(l&&yj(l),c&&yj(c)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&rCe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}const mj=Br||Cr&&R$<63;function gj(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),s=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Br&&s&&s.contentEditable=="false")return ww(s);if((!s||s.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(s)return ww(s);if(o)return ww(o)}}function ww(e){return e.contentEditable="true",Br&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function yj(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function rCe(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,s=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=s)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!H$(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function sCe(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,wr(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&vs&&ka<=11&&(n.disabled=!0,n.disabled=!1)}function F$(e,t){if(t instanceof nt){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(xj(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else xj(e)}function xj(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function RN(e,t,n,r){return e.someProp("createSelectionBetween",s=>s(e,t,n))||dt.between(t,n,r)}function bj(e){return e.editable&&!e.hasFocus()?!1:$$(e)}function $$(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return gu(e.dom,t.anchorNode)&&(e.editable||gu(e.dom,t.focusNode))}catch{return!1}}function oCe(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return mu(t.node,t.offset,n.anchorNode,n.anchorOffset)}function BC(e,t){let{$anchor:n,$head:r}=e.selection,s=t>0?n.max(r):n.min(r),o=s.parent.inlineContent?s.depth?e.doc.resolve(t>0?s.after():s.before()):null:s;return o&&Rt.findFrom(o,t)}function aa(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function vj(e,t,n){let r=e.state.selection;if(r instanceof dt)if(n.indexOf("s")>-1){let{$head:s}=r,o=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let l=e.state.doc.resolve(s.pos+o.nodeSize*(t<0?-1:1));return aa(e,new dt(r.$anchor,l))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let s=BC(e.state,t);return s&&s instanceof nt?aa(e,s):!1}else if(!(ro&&n.indexOf("m")>-1)){let s=r.$head,o=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter,l;if(!o||o.isText)return!1;let c=t<0?s.pos-o.nodeSize:s.pos;return o.isAtom||(l=e.docView.descAt(c))&&!l.contentDOM?nt.isSelectable(o)?aa(e,new nt(t<0?e.state.doc.resolve(s.pos-o.nodeSize):s)):aa(e,new dt(e.state.doc.resolve(t<0?c:c+o.nodeSize))):!1}}else return!1;else{if(r instanceof nt&&r.node.isInline)return aa(e,new dt(t>0?r.$to:r.$from));{let s=BC(e.state,t);return s?aa(e,s):!1}}}function mp(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR"):et(e)&&e.contentEditable=="false"}function xd(e,t){return t<0?iCe(e):lCe(e)}function iCe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let s,o,l=!1;for(Fs&&et(n)&&r<Pr(n)&&mp(n.childNodes[r],-1)&&(l=!0);;)if(r>0){if(!et(n))break;let c=n.childNodes[r-1];if(mp(c,-1))s=n,o=--r;else if(Jn(c))n=c,r=n.nodeValue.length;else break}else{if(U$(n))break;{let c=n.previousSibling;for(;c&&mp(c,-1);)s=n.parentNode,o=wr(c),c=c.previousSibling;if(c)n=c,r=Pr(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}l?HC(e,n,r):s&&HC(e,s,o)}function lCe(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let s=Pr(n),o,l;for(;;)if(r<s){if(!et(n))break;let c=n.childNodes[r];if(mp(c,1))o=n,l=++r;else break}else{if(U$(n))break;{let c=n.nextSibling;for(;c&&mp(c,1);)o=c.parentNode,l=wr(c)+1,c=c.nextSibling;if(c)n=c,r=0,s=Pr(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}o&&HC(e,o,l)}function U$(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function aCe(e,t){for(;e&&t==e.childNodes.length&&!Km(e);)t=wr(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(Jn(n))return n;if(et(n)&&n.contentEditable=="false")break;e=n,t=0}}function cCe(e,t){for(;e&&!t&&!Km(e);)t=wr(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(Jn(n))return n;if(et(n)&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function HC(e,t,n){if(!Jn(t)){let o,l;(l=aCe(t,n))?(t=l,n=0):(o=cCe(t,n))&&(t=o,n=o.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Hb(r)){let o=document.createRange();o.setEnd(t,n),o.setStart(t,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:s}=e;setTimeout(()=>{e.state==s&&ol(e)},50)}function Sj(e,t){let n=e.state.doc.resolve(t);if(!(Cr||O$)&&n.parent.inlineContent){let s=e.coordsAtPos(t);if(t>n.start()){let o=e.coordsAtPos(t-1),l=(o.top+o.bottom)/2;if(l>s.top&&l<s.bottom&&Math.abs(o.left-s.left)>1)return o.left<s.left?"ltr":"rtl"}if(t<n.end()){let o=e.coordsAtPos(t+1),l=(o.top+o.bottom)/2;if(l>s.top&&l<s.bottom&&Math.abs(o.left-s.left)>1)return o.left>s.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function wj(e,t,n){let r=e.state.selection;if(r instanceof dt&&!r.empty||n.indexOf("s")>-1||ro&&n.indexOf("m")>-1)return!1;let{$from:s,$to:o}=r;if(!s.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let l=BC(e.state,t);if(l&&l instanceof nt)return aa(e,l)}if(!s.parent.inlineContent){let l=t<0?s:o,c=r instanceof Hs?Rt.near(l,t):Rt.findFrom(l,t);return c?aa(e,c):!1}return!1}function Ej(e,t){if(!(e.state.selection instanceof dt))return!0;let{$head:n,$anchor:r,empty:s}=e.state.selection;if(!n.sameParent(r))return!0;if(!s)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let l=e.state.tr;return t<0?l.delete(n.pos-o.nodeSize,n.pos):l.delete(n.pos,n.pos+o.nodeSize),e.dispatch(l),!0}return!1}function Cj(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function uCe(e){if(!Br||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&et(t)&&n==0&&t.firstChild&&et(t.firstChild)&&t.firstChild.contentEditable=="false"){let r=t.firstChild;Cj(e,r,"true"),setTimeout(()=>Cj(e,r,"false"),20)}return!1}function dCe(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function fCe(e,t){let n=t.keyCode,r=dCe(t);if(n==8||ro&&n==72&&r=="c")return Ej(e,-1)||xd(e,-1);if(n==46&&!t.shiftKey||ro&&n==68&&r=="c")return Ej(e,1)||xd(e,1);if(n==13||n==27)return!0;if(n==37||ro&&n==66&&r=="c"){let s=n==37?Sj(e,e.state.selection.from)=="ltr"?-1:1:-1;return vj(e,s,r)||xd(e,s)}else if(n==39||ro&&n==70&&r=="c"){let s=n==39?Sj(e,e.state.selection.from)=="ltr"?1:-1:1;return vj(e,s,r)||xd(e,s)}else{if(n==38||ro&&n==80&&r=="c")return wj(e,-1,r)||xd(e,-1);if(n==40||ro&&n==78&&r=="c")return uCe(e)||wj(e,1,r)||xd(e,1);if(r==(ro?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function ON(e,t){e.someProp("transformCopied",x=>{t=x(t,e)});let n=[],{content:r,openStart:s,openEnd:o}=t;for(;s>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){s--,o--;let x=r.firstChild;n.push(x.type.name,x.attrs!=x.type.defaultAttrs?x.attrs:null),r=x.content}let l=e.someProp("clipboardSerializer")||Ru.fromSchema(e.state.schema),c=W$(),u=c.createElement("div");u.appendChild(l.serializeFragment(r,{document:c}));let f=u.firstChild,h,p=0;for(;f&&et(f)&&(h=Y$[f.nodeName.toLowerCase()]);){for(let x=h.length-1;x>=0;x--){let b=c.createElement(h[x]);for(;u.firstChild;)b.appendChild(u.firstChild);u.appendChild(b),p++}f=u.firstChild}f&&et(f)&&f.setAttribute("data-pm-slice",`${s} ${o}${p?` -${p}`:""} ${JSON.stringify(n)}`);let y=e.someProp("clipboardTextSerializer",x=>x(t,e))||t.content.textBetween(0,t.content.size,`
|
|
366
|
-
|
|
367
|
-
`);return{dom:u,text:y,slice:t}}function V$(e,t,n,r,s){let o=s.parent.type.spec.code,l,c;if(!n&&!t)return null;let u=!!t&&(r||o||!n);if(u){if(e.someProp("transformPastedText",y=>{t=y(t,o||r,e)}),o)return c=new Ue(Ie.from(e.state.schema.text(t.replace(/\r\n?/g,`
|
|
368
|
-
`))),0,0),e.someProp("transformPasted",y=>{c=y(c,e,!0)}),c;let p=e.someProp("clipboardTextParser",y=>y(t,s,r,e));if(p)c=p;else{let y=s.marks(),{schema:x}=e.state,b=Ru.fromSchema(x);l=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(S=>{let E=l.appendChild(document.createElement("p"));S&&E.appendChild(b.serializeNode(x.text(S,y)))})}}else e.someProp("transformPastedHTML",p=>{n=p(n,e)}),l=gCe(n),Fb&&yCe(l);let f=l&&l.querySelector("[data-pm-slice]"),h=f&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(f.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let p=+h[3];p>0;p--){let y=l.firstChild;for(;y&&!et(y);)y=y.nextSibling;if(!y)break;l=y}if(c||(c=(e.someProp("clipboardParser")||e.someProp("domParser")||rl.fromSchema(e.state.schema)).parseSlice(l,{preserveWhitespace:!!(u||h),context:s,ruleFromNode(y){return y.nodeName=="BR"&&!y.nextSibling&&y.parentNode&&!hCe.test(y.parentNode.nodeName)?{ignore:!0}:null}})),h)c=xCe(Tj(c,+h[1],+h[2]),h[4]);else if(c=Ue.maxOpen(pCe(c.content,s),!0),c.openStart||c.openEnd){let p=0,y=0;for(let x=c.content.firstChild;p<c.openStart&&!x.type.spec.isolating;p++,x=x.firstChild);for(let x=c.content.lastChild;y<c.openEnd&&!x.type.spec.isolating;y++,x=x.lastChild);c=Tj(c,p,y)}return e.someProp("transformPasted",p=>{c=p(c,e,u)}),c}const hCe=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function pCe(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let s=t.node(n).contentMatchAt(t.index(n)),o,l=[];if(e.forEach(c=>{if(!l)return;let u=s.findWrapping(c.type),f;if(!u)return l=null;if(f=l.length&&o.length&&G$(u,o,c,l[l.length-1],0))l[l.length-1]=f;else{l.length&&(l[l.length-1]=K$(l[l.length-1],o.length));let h=q$(c,u);l.push(h),s=s.matchType(h.type),o=u}}),l)return Ie.from(l)}return e}function q$(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Ie.from(e));return e}function G$(e,t,n,r,s){if(s<e.length&&s<t.length&&e[s]==t[s]){let o=G$(e,t,n,r.lastChild,s+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(s==e.length-1?n.type:e[s+1]))return r.copy(r.content.append(Ie.from(q$(n,e,s+1))))}}function K$(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,K$(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Ie.empty,!0);return e.copy(n.append(r))}function FC(e,t,n,r,s,o){let l=t<0?e.firstChild:e.lastChild,c=l.content;return e.childCount>1&&(o=0),s<r-1&&(c=FC(c,t,n,r,s+1,o)),s>=n&&(c=t<0?l.contentMatchAt(0).fillBefore(c,o<=s).append(c):c.append(l.contentMatchAt(l.childCount).fillBefore(Ie.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,l.copy(c))}function Tj(e,t,n){return t<e.openStart&&(e=new Ue(FC(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Ue(FC(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Y$={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function W$(){return document.implementation.createHTMLDocument("title")}let Fh=null;function mCe(e){let t=window.trustedTypes;if(!t)return e;if(!Fh){if(Fh=t.defaultPolicy)try{return Fh.createHTML(e)}catch{}Fh=t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})}return Fh.createHTML(e)}function gCe(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=W$(),r=n.body,s=/<([a-z][^>\s]+)/i.exec(e),o;if((o=s&&Y$[s[1].toLowerCase()])&&(e=o.map(l=>"<"+l+">").join("")+e+o.map(l=>"</"+l+">").reverse().join("")),r.innerHTML=mCe(e),o)for(let l=0;l<o.length;l++)r=r.querySelector(o[l])||r;for(let l=0;l<n.styleSheets.length;l++){let c=n.styleSheets[l];for(let u=0;u<c.rules.length;u++){let f=c.rules[u];if(f instanceof CSSStyleRule){let h=r.querySelectorAll(f.selectorText);for(let p=0;p<h.length;p++)h[p].style.cssText+=f.style.cssText}}}return r}function yCe(e){let t=e.querySelectorAll(Cr?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function xCe(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:s,openStart:o,openEnd:l}=e;for(let c=r.length-2;c>=0;c-=2){let u=n.nodes[r[c]];if(!u||u.hasRequiredAttrs())break;try{s=Ie.from(u.create(r[c+1],s))}catch{break}o++,l++}return new Ue(s,o,l)}const rs={},ss={},bCe={touchstart:!0,touchmove:!0};class vCe{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function SCe(e){for(let t in rs){let n=rs[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{ECe(e,r)&&!AN(e,r)&&(e.editable||!(r.type in ss))&&n(e,r)},bCe[t]?{passive:!0}:void 0)}Br&&e.dom.addEventListener("input",()=>null),$C(e)}function Wi(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function wCe(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function $C(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>AN(e,r))})}function AN(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function ECe(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function CCe(e,t){!AN(e,t)&&rs[t.type]&&(e.editable||!(t.type in ss))&&rs[t.type](e,t)}ss.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!J$(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Yi&&Cr&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),wf&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",s=>s(e,Ic(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||fCe(e,n)?n.preventDefault():Wi(e,"key")};ss.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};ss.keypress=(e,t)=>{let n=t;if(J$(e)||!n.charCode||n.ctrlKey&&!n.altKey||ro&&n.metaKey)return;if(e.someProp("handleKeyPress",s=>s(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof dt)||!r.$from.sameParent(r.$to)){let s=String.fromCharCode(n.charCode),o=()=>e.state.tr.insertText(s).scrollIntoView();!/[\r\n]/.test(s)&&!e.someProp("handleTextInput",l=>l(e,r.$from.pos,r.$to.pos,s,o))&&e.dispatch(o()),n.preventDefault()}};function Wm(e){return{left:e.clientX,top:e.clientY}}function TCe(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function kN(e,t,n,r,s){if(r==-1)return!1;let o=e.state.doc.resolve(r);for(let l=o.depth+1;l>0;l--)if(e.someProp(t,c=>l>o.depth?c(e,n,o.nodeAfter,o.before(l),s,!0):c(e,n,o.node(l),o.before(l),s,!1)))return!0;return!1}function Xm(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function NCe(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&nt.isSelectable(r)?(Xm(e,new nt(n)),!0):!1}function RCe(e,t){if(t==-1)return!1;let n=e.state.selection,r,s;n instanceof nt&&(r=n.node);let o=e.state.doc.resolve(t);for(let l=o.depth+1;l>0;l--){let c=l>o.depth?o.nodeAfter:o.node(l);if(nt.isSelectable(c)){r&&n.$from.depth>0&&l>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?s=o.before(n.$from.depth):s=o.before(l);break}}return s!=null?(Xm(e,nt.create(e.state.doc,s)),!0):!1}function OCe(e,t,n,r,s){return kN(e,"handleClickOn",t,n,r)||e.someProp("handleClick",o=>o(e,t,r))||(s?RCe(e,n):NCe(e,n))}function ACe(e,t,n,r){return kN(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",s=>s(e,t,r))}function kCe(e,t,n,r){return kN(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",s=>s(e,t,r))||_Ce(e,n,r)}function _Ce(e,t,n){if(n.button!=0)return!1;let r=X$(e,t,!0),s=e.state.doc;return r?(Xm(e,r),r instanceof dt&&s.eq(e.state.doc)&&(e.input.mouseDown=new ICe(e,r)),!0):!1}function X$(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?dt.create(r,0,r.content.size):null;let s=r.resolve(t);for(let o=s.depth+1;o>0;o--){let l=o>s.depth?s.nodeAfter:s.node(o),c=s.before(o);if(l.inlineContent)return dt.create(r,c+1,c+1+l.content.size);if(n&&nt.isSelectable(l))return nt.create(r,c)}return null}function _N(e){return Cx(e)}const Q$=ro?"metaKey":"ctrlKey";rs.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=_N(e),s=Date.now(),o="singleClick";s-e.input.lastClick.time<500&&TCe(n,e.input.lastClick)&&!n[Q$]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?o="doubleClick":e.input.lastClick.type=="doubleClick"&&(o="tripleClick")),e.input.lastClick={time:s,x:n.clientX,y:n.clientY,type:o,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let l=e.posAtCoords(Wm(n));l&&(o=="singleClick"?e.input.mouseDown=new MCe(e,l,n,!!r):(o=="doubleClick"?ACe:kCe)(e,l.pos,l.inside,n)?n.preventDefault():Wi(e,"pointer"))};class Z${constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}}class MCe extends Z${constructor(t,n,r,s){super(t),this.pos=n,this.event=r,this.flushed=s,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!r[Q$],this.allowDefault=r.shiftKey;let o,l;if(n.inside>-1)o=t.state.doc.nodeAt(n.inside),l=n.inside;else{let h=t.state.doc.resolve(n.pos);o=h.parent,l=h.depth?h.before():0}const c=s?null:r.target,u=c?t.docView.nearestDesc(c,!0):null;this.target=u&&et(u.nodeDOM)?u.nodeDOM:null;let{selection:f}=t.state;r.button==0&&(o.type.spec.draggable&&o.type.spec.selectable!==!1||f instanceof nt&&f.from<=l&&f.to>l)&&(this.mightDrag={node:o,pos:l,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Fs&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),Wi(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||ol(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Wm(t))),this.updateAllowDefault(t),this.allowDefault||!n?Wi(this.view,"pointer"):OCe(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Br&&this.mightDrag&&!this.mightDrag.node.isAtom||Cr&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Xm(this.view,Rt.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Wi(this.view,"pointer")}move(t){this.updateAllowDefault(t),Wi(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}}class ICe extends Z${constructor(t,n){super(t),this.startSelection=n,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),Wi(this.view,"pointer");let n=this.view.posAtCoords(Wm(t)),r=n&&X$(this.view,n.inside,!1);if(!r)return;let{doc:s}=this.view.state,o=this.startSelection,[l,c]=r.from<o.from?[o.to,r.from]:[o.from,r.to];Xm(this.view,dt.create(s,l,c))}}rs.touchstart=e=>{e.input.lastTouch=Date.now(),_N(e),Wi(e,"pointer")};rs.touchmove=e=>{e.input.lastTouch=Date.now(),Wi(e,"pointer")};rs.contextmenu=e=>_N(e);function J$(e,t){return e.composing?!0:Br&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const LCe=Yi?5e3:-1;ss.compositionstart=ss.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof dt&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||Cr&&O$&&DCe(e)))e.markCursor=e.state.storedMarks||n.marks(),Cx(e,!0),e.markCursor=null;else if(Cx(e,!t.selection.empty),Fs&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let s=r.focusNode,o=r.focusOffset;s&&et(s)&&o!=0;){let l=o<0?s.lastChild:s.childNodes[o-1];if(!l)break;if(Jn(l)){let c=e.domSelection();c&&c.collapse(l,l.nodeValue.length);break}else s=l,o=-1}}e.input.composing=!0}e7(e,LCe)};function DCe(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!et(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return et(r)&&r.contentEditable=="false"}ss.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,e7(e,20))};function e7(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Cx(e),t))}function t7(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function jCe(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=REe(t.focusNode,t.focusOffset),r=OEe(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let s=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!s||!s.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let l=n.pmViewDesc;if(!(!l||!l.isText(n.nodeValue)))return r}}return n||r}function Cx(e,t=!1){if(!(Yi&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),t7(e),t||e.docView&&e.docView.dirty){let n=NN(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function PCe(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),s=document.createRange();s.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(s),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const Xp=vs&&ka<15||wf&&MEe<604;rs.copy=ss.cut=(e,t)=>{let n=t,r=e.state.selection,s=n.type=="cut";if(r.empty)return;let o=Xp?null:n.clipboardData,l=r.content(),{dom:c,text:u}=ON(e,l);o?(n.preventDefault(),o.clearData(),o.setData("text/html",c.innerHTML),o.setData("text/plain",u)):PCe(e,c),s&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function zCe(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function BCe(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let s=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Qp(e,r.value,null,s,t):Qp(e,r.textContent,r.innerHTML,s,t)},50)}function Qp(e,t,n,r,s){let o=V$(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",u=>u(e,s,o||Ue.empty)))return!0;if(!o)return!1;let l=zCe(o),c=l?e.state.tr.replaceSelectionWith(l,r):e.state.tr.replaceSelection(o);return e.dispatch(c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function n7(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}ss.paste=(e,t)=>{let n=t;if(e.composing&&!Yi)return;let r=Xp?null:n.clipboardData,s=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Qp(e,n7(r),r.getData("text/html"),s,n)?n.preventDefault():BCe(e,n)};class r7{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const HCe=ro?"altKey":"ctrlKey";function s7(e,t){let n;return e.someProp("dragCopies",r=>{n=n||r(t)}),n!=null?!n:!t[HCe]}rs.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let s=e.state.selection,o=s.empty?null:e.posAtCoords(Wm(n)),l;if(!(o&&o.pos>=s.from&&o.pos<=(s instanceof nt?s.to-1:s.to))){if(r&&r.mightDrag)l=nt.create(e.state.doc,r.mightDrag.pos);else if(n.target&&et(n.target)){let p=e.docView.nearestDesc(n.target,!0);p&&p.node.type.spec.draggable&&p!=e.docView&&(l=nt.create(e.state.doc,p.posBefore))}}let c=(l||e.state.selection).content(),{dom:u,text:f,slice:h}=ON(e,c);(!n.dataTransfer.files.length||!Cr||R$>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Xp?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Xp||n.dataTransfer.setData("text/plain",f),e.dragging=new r7(h,s7(e,n),l)};rs.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};ss.dragover=ss.dragenter=(e,t)=>t.preventDefault();ss.drop=(e,t)=>{try{FCe(e,t,e.dragging)}finally{e.dragging=null}};function FCe(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Wm(t));if(!r)return;let s=e.state.doc.resolve(r.pos),o=n&&n.slice;o?e.someProp("transformPasted",x=>{o=x(o,e,!1)}):o=V$(e,n7(t.dataTransfer),Xp?null:t.dataTransfer.getData("text/html"),!1,s);let l=!!(n&&s7(e,t));if(e.someProp("handleDrop",x=>x(e,t,o||Ue.empty,l))){t.preventDefault();return}if(!o)return;t.preventDefault();let c=o?Ywe(e.state.doc,s.pos,o):s.pos;c==null&&(c=s.pos);let u=e.state.tr;if(l){let{node:x}=n;x?x.replace(u):u.deleteSelection()}let f=u.mapping.map(c),h=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,p=u.doc;if(h?u.replaceRangeWith(f,f,o.content.firstChild):u.replaceRange(f,f,o),u.doc.eq(p))return;let y=u.doc.resolve(f);if(h&&nt.isSelectable(o.content.firstChild)&&y.nodeAfter&&y.nodeAfter.sameMarkup(o.content.firstChild))u.setSelection(new nt(y));else{let x=u.mapping.map(c);u.mapping.maps[u.mapping.maps.length-1].forEach((b,S,E,C)=>x=C),u.setSelection(RN(e,y,u.doc.resolve(x)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}rs.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&ol(e)},20))};rs.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};rs.beforeinput=(e,t)=>{if(Yi&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",o=>o(e,Ic(8,"Backspace")))))return;let{$cursor:s}=e.state.selection;s&&s.pos>0&&e.dispatch(e.state.tr.delete(s.pos-1,s.pos).scrollIntoView())},50)}};for(let e in ss)rs[e]=ss[e];function Zp(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class Tx{constructor(t,n){this.toDOM=t,this.spec=n||nu,this.side=this.spec.side||0}map(t,n,r,s){let{pos:o,deleted:l}=t.mapResult(n.from+s,this.side<0?-1:1);return l?null:new Oo(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof Tx&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Zp(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Ia{constructor(t,n){this.attrs=t,this.spec=n||nu}map(t,n,r,s){let o=t.map(n.from+s,this.spec.inclusiveStart?-1:1)-r,l=t.map(n.to+s,this.spec.inclusiveEnd?1:-1)-r;return o>=l?null:new Oo(o,l,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof Ia&&Zp(this.attrs,t.attrs)&&Zp(this.spec,t.spec)}static is(t){return t.type instanceof Ia}destroy(){}}class MN{constructor(t,n){this.attrs=t,this.spec=n||nu}map(t,n,r,s){let o=t.mapResult(n.from+s,1);if(o.deleted)return null;let l=t.mapResult(n.to+s,-1);return l.deleted||l.pos<=o.pos?null:new Oo(o.pos-r,l.pos-r,this)}valid(t,n){let{index:r,offset:s}=t.content.findIndex(n.from),o;return s==n.from&&!(o=t.child(r)).isText&&s+o.nodeSize==n.to}eq(t){return this==t||t instanceof MN&&Zp(this.attrs,t.attrs)&&Zp(this.spec,t.spec)}destroy(){}}class Oo{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new Oo(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new Oo(t,t,new Tx(n,r))}static inline(t,n,r,s){return new Oo(t,n,new Ia(r,s))}static node(t,n,r,s){return new Oo(t,n,new MN(r,s))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ia}get widget(){return this.type instanceof Tx}}const Cd=[],nu={};class En{constructor(t,n){this.local=t.length?t:Cd,this.children=n.length?n:Cd}static create(t,n){return n.length?Nx(n,t,0,nu):Dr}find(t,n,r){let s=[];return this.findInner(t??0,n??1e9,s,0,r),s}findInner(t,n,r,s,o){for(let l=0;l<this.local.length;l++){let c=this.local[l];c.from<=n&&c.to>=t&&(!o||o(c.spec))&&r.push(c.copy(c.from+s,c.to+s))}for(let l=0;l<this.children.length;l+=3)if(this.children[l]<n&&this.children[l+1]>t){let c=this.children[l]+1;this.children[l+2].findInner(t-c,n-c,r,s+c,o)}}map(t,n,r){return this==Dr||t.maps.length==0?this:this.mapInner(t,n,0,0,r||nu)}mapInner(t,n,r,s,o){let l;for(let c=0;c<this.local.length;c++){let u=this.local[c].map(t,r,s);u&&u.type.valid(n,u)?(l||(l=[])).push(u):o.onRemove&&o.onRemove(this.local[c].spec)}return this.children.length?$Ce(this.children,l||[],t,n,r,s,o):l?new En(l.sort(ru),Cd):Dr}add(t,n){return n.length?this==Dr?En.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let s,o=0;t.forEach((c,u)=>{let f=u+r,h;if(h=i7(n,c,f)){for(s||(s=this.children.slice());o<s.length&&s[o]<u;)o+=3;s[o]==u?s[o+2]=s[o+2].addInner(c,h,f+1):s.splice(o,0,u,u+c.nodeSize,Nx(h,c,f+1,nu)),o+=3}});let l=o7(o?l7(n):n,-r);for(let c=0;c<l.length;c++)l[c].type.valid(t,l[c])||l.splice(c--,1);return new En(l.length?this.local.concat(l).sort(ru):this.local,s||this.children)}remove(t){return t.length==0||this==Dr?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,s=this.local;for(let o=0;o<r.length;o+=3){let l,c=r[o]+n,u=r[o+1]+n;for(let h=0,p;h<t.length;h++)(p=t[h])&&p.from>c&&p.to<u&&(t[h]=null,(l||(l=[])).push(p));if(!l)continue;r==this.children&&(r=this.children.slice());let f=r[o+2].removeInner(l,c+1);f!=Dr?r[o+2]=f:(r.splice(o,3),o-=3)}if(s.length){for(let o=0,l;o<t.length;o++)if(l=t[o])for(let c=0;c<s.length;c++)s[c].eq(l,n)&&(s==this.local&&(s=this.local.slice()),s.splice(c--,1))}return r==this.children&&s==this.local?this:s.length||r.length?new En(s,r):Dr}forChild(t,n){if(this==Dr)return this;if(n.isLeaf)return En.empty;let r,s;for(let c=0;c<this.children.length;c+=3)if(this.children[c]>=t){this.children[c]==t&&(r=this.children[c+2]);break}let o=t+1,l=o+n.content.size;for(let c=0;c<this.local.length;c++){let u=this.local[c];if(u.from<l&&u.to>o&&u.type instanceof Ia){let f=Math.max(o,u.from)-o,h=Math.min(l,u.to)-o;f<h&&(s||(s=[])).push(u.copy(f,h))}}if(s){let c=new En(s.sort(ru),Cd);return r?new da([c,r]):c}return r||Dr}eq(t){if(this==t)return!0;if(!(t instanceof En)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return IN(this.localsInner(t))}localsInner(t){if(this==Dr)return Cd;if(t.inlineContent||!this.local.some(Ia.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Ia||n.push(this.local[r]);return n}forEachSet(t){t(this)}}En.empty=new En([],[]);En.removeOverlap=IN;const Dr=En.empty;class da{constructor(t){this.members=t}map(t,n){const r=this.members.map(s=>s.map(t,n,nu));return da.from(r)}forChild(t,n){if(n.isLeaf)return En.empty;let r=[];for(let s=0;s<this.members.length;s++){let o=this.members[s].forChild(t,n);o!=Dr&&(o instanceof da?r=r.concat(o.members):r.push(o))}return da.from(r)}eq(t){if(!(t instanceof da)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let s=0;s<this.members.length;s++){let o=this.members[s].localsInner(t);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let l=0;l<o.length;l++)n.push(o[l])}}return n?IN(r?n:n.sort(ru)):Cd}static from(t){switch(t.length){case 0:return Dr;case 1:return t[0];default:return new da(t.every(n=>n instanceof En)?t:t.reduce((n,r)=>n.concat(r instanceof En?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function $Ce(e,t,n,r,s,o,l){let c=e.slice();for(let f=0,h=o;f<n.maps.length;f++){let p=0;n.maps[f].forEach((y,x,b,S)=>{let E=S-b-(x-y);for(let C=0;C<c.length;C+=3){let R=c[C+1];if(R<0||y>R+h-p)continue;let T=c[C]+h-p;x>=T?c[C+1]=y<=T?-2:-1:y>=h&&E&&(c[C]+=E,c[C+1]+=E)}p+=E}),h=n.maps[f].map(h,-1)}let u=!1;for(let f=0;f<c.length;f+=3)if(c[f+1]<0){if(c[f+1]==-2){u=!0,c[f+1]=-1;continue}let h=n.map(e[f]+o),p=h-s;if(p<0||p>=r.content.size){u=!0;continue}let y=n.map(e[f+1]+o,-1),x=y-s,{index:b,offset:S}=r.content.findIndex(p),E=r.maybeChild(b);if(E&&S==p&&S+E.nodeSize==x){let C=c[f+2].mapInner(n,E,h+1,e[f]+o+1,l);C!=Dr?(c[f]=p,c[f+1]=x,c[f+2]=C):(c[f+1]=-2,u=!0)}else u=!0}if(u){let f=UCe(c,e,t,n,s,o,l),h=Nx(f,r,0,l);t=h.local;for(let p=0;p<c.length;p+=3)c[p+1]<0&&(c.splice(p,3),p-=3);for(let p=0,y=0;p<h.children.length;p+=3){let x=h.children[p];for(;y<c.length&&c[y]<x;)y+=3;c.splice(y,0,h.children[p],h.children[p+1],h.children[p+2])}}return new En(t.sort(ru),c)}function o7(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let s=e[r];n.push(new Oo(s.from+t,s.to+t,s.type))}return n}function UCe(e,t,n,r,s,o,l){function c(u,f){for(let h=0;h<u.local.length;h++){let p=u.local[h].map(r,s,f);p?n.push(p):l.onRemove&&l.onRemove(u.local[h].spec)}for(let h=0;h<u.children.length;h+=3)c(u.children[h+2],u.children[h]+f+1)}for(let u=0;u<e.length;u+=3)e[u+1]==-1&&c(e[u+2],t[u]+o+1);return n}function i7(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,s=null;for(let o=0,l;o<e.length;o++)(l=e[o])&&l.from>n&&l.to<r&&((s||(s=[])).push(l),e[o]=null);return s}function l7(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function Nx(e,t,n,r){let s=[],o=!1;t.forEach((c,u)=>{let f=i7(e,c,u+n);if(f){o=!0;let h=Nx(f,c,n+u+1,r);h!=Dr&&s.push(u,u+c.nodeSize,h)}});let l=o7(o?l7(e):e,-n).sort(ru);for(let c=0;c<l.length;c++)l[c].type.valid(t,l[c])||(r.onRemove&&r.onRemove(l[c].spec),l.splice(c--,1));return l.length||s.length?new En(l,s):Dr}function ru(e,t){return e.from-t.from||e.to-t.to}function IN(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let s=n+1;s<t.length;s++){let o=t[s];if(o.from==r.from){o.to!=r.to&&(t==e&&(t=e.slice()),t[s]=o.copy(o.from,r.to),Nj(t,s+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),Nj(t,s,r.copy(o.from,r.to)));break}}}return t}function Nj(e,t,n){for(;t<e.length&&ru(n,e[t])>0;)t++;e.splice(t,0,n)}function Ew(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Dr&&t.push(r)}),e.cursorWrapper&&t.push(En.create(e.state.doc,[e.cursorWrapper.deco])),da.from(t)}const VCe={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},qCe=vs&&ka<=11;class GCe{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class KCe{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new GCe,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let s=0;s<r.length;s++)this.queue.push(r[s]);vs&&ka<=11&&r.some(s=>s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length)?this.flushSoon():Br&&t.composing&&r.some(s=>s.type=="childList"&&s.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),qCe&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,VCe)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(bj(this.view)){if(this.suppressingSelectionUpdates)return ol(this.view);if(vs&&ka<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&mu(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let o=t.focusNode;o;o=Sf(o))n.add(o);for(let o=t.anchorNode;o;o=Sf(o))if(n.has(o)){r=o;break}let s=r&&this.view.docView.nearestDesc(r);if(s&&s.ignoreMutation({type:"selection",target:Jn(r)?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),s=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&bj(t)&&!this.ignoreSelectionChange(r),o=-1,l=-1,c=!1,u=[];if(t.editable)for(let h=0;h<n.length;h++){let p=this.registerMutation(n[h],u);p&&(o=o<0?p.from:Math.min(p.from,o),l=l<0?p.to:Math.max(p.to,l),p.typeOver&&(c=!0))}if(u.some(h=>h.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46||Cr&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&n.some(h=>h.type=="childList"&&h.removedNodes.length))){for(let h of u)if(h.nodeName=="BR"&&h.parentNode){let p=h.nextSibling;for(;p&&et(p);){if(p.contentEditable=="false"){h.parentNode.removeChild(h);break}p=p.firstChild}}}else if(Fs&&u.length){let h=u.filter(p=>p.nodeName=="BR");if(h.length==2){let[p,y]=h;p.parentNode&&p.parentNode.parentNode==y.parentNode?y.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let y of h){let x=y.parentNode;x&&x.nodeName=="LI"&&(!p||XCe(t,p)!=x)&&y.remove()}}}let f=null;o<0&&s&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&Hb(r)&&(f=NN(t))&&f.eq(Rt.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,ol(t),this.currentSelection.set(r),t.scrollToSelection()):(o>-1||s)&&(o>-1&&(t.docView.markDirty(o,l),YCe(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,QCe(t,u)),this.handleDOMChange(o,l,c,u),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||ol(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let h=0;h<t.addedNodes.length;h++){let p=t.addedNodes[h];n.push(p),Jn(p)&&(this.lastChangedTextNode=p)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let s=t.previousSibling,o=t.nextSibling;if(vs&&ka<=11&&t.addedNodes.length)for(let h=0;h<t.addedNodes.length;h++){let{previousSibling:p,nextSibling:y}=t.addedNodes[h];(!p||Array.prototype.indexOf.call(t.addedNodes,p)<0)&&(s=p),(!y||Array.prototype.indexOf.call(t.addedNodes,y)<0)&&(o=y)}let l=s&&s.parentNode==t.target?wr(s)+1:0,c=r.localPosFromDOM(t.target,l,-1),u=o&&o.parentNode==t.target?wr(o):t.target.childNodes.length,f=r.localPosFromDOM(t.target,u,1);return{from:c,to:f}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=t.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let Rj=new WeakMap,Oj=!1;function YCe(e){if(!Rj.has(e)&&(Rj.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Fs,Oj)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Oj=!0}}function Aj(e,t){let n=t.startContainer,r=t.startOffset,s=t.endContainer,o=t.endOffset,l=e.domAtPos(e.state.selection.anchor);return mu(l.node,l.offset,s,o)&&([n,r,s,o]=[s,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:o}}function WCe(e,t){if(t.getComposedRanges){let s=t.getComposedRanges(e.root)[0];if(s)return Aj(e,s)}let n;function r(s){s.preventDefault(),s.stopImmediatePropagation(),n=s.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?Aj(e,n):null}function XCe(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function QCe(e,t){var n;let{focusNode:r,focusOffset:s}=e.domSelectionRange();for(let o of t)if(((n=o.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let l=o.nextSibling;for(;l&&l.nodeName!="TD"&&l.nodeName!="TH";)l=l.nextSibling;if(l){let c=l;for(;;){let u=c.firstChild;if(!u||!et(u)||u.contentEditable=="false"||/^(BR|IMG)$/.test(u.nodeName))break;c=u}c.insertBefore(o,c.firstChild),r==o&&e.domSelection().collapse(o,s)}else o.parentNode.removeChild(o)}}function ZCe(e,t,n,r){let{node:s,fromOffset:o,toOffset:l,from:c,to:u}=e.docView.parseRange(t,n),f=e.domSelectionRange(),h,p=f.anchorNode;if(p&&gu(e.dom,p)&&(h=[{node:p,offset:f.anchorOffset}],Hb(f)||h.push({node:f.focusNode,offset:f.focusOffset})),Cr&&e.input.lastKeyCode===8)for(let C=l;C>o;C--){let R=s.childNodes[C-1],T=R.pmViewDesc;if(R.nodeName=="BR"&&!T){l=C;break}if(!T||T.size)break}let y=e.state.doc,x=e.someProp("domParser")||rl.fromSchema(e.state.schema),b=y.resolve(c),S=null,E=x.parse(s,{topNode:b.parent,topMatch:b.parent.contentMatchAt(b.index()),topOpen:!0,from:o,to:l,preserveWhitespace:b.parent.type.whitespace=="pre"?"full":!0,findPositions:h,ruleFromNode:JCe(r),context:b});if(h&&h[0].pos!=null){let C=h[0].pos,R=h[1]&&h[1].pos;R==null&&(R=C),S={anchor:C+c,head:R+c}}return{doc:E,sel:S,from:c,to:u}}const JCe=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName=="BR"&&t.parentNode){if(Br&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(t.parentNode.lastChild==t||Br&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null},e2e=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function t2e(e,t,n,r,s){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let A=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,L=NN(e,A);if(L&&!e.state.selection.eq(L)){if(Cr&&Yi&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",j=>j(e,Ic(13,"Enter"))))return;let I=e.state.tr.setSelection(L);A=="pointer"?I.setMeta("pointer",!0):A=="key"&&I.scrollIntoView(),o&&I.setMeta("composition",o),e.dispatch(I)}return}let l=e.state.doc.resolve(t),c=l.sharedDepth(n);t=l.before(c+1),n=e.state.doc.resolve(n).after(c+1);let u=e.state.selection,f=ZCe(e,t,n,s),h=e.state.doc,p=h.slice(f.from,f.to),y,x;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(y=e.state.selection.to,x="end"):(y=e.state.selection.from,x="start"),e.input.lastKeyCode=null;let b=o2e(p.content,f.doc.content,f.from,y,x);if(b&&e.input.domChangeCount++,(wf&&e.input.lastIOSEnter>Date.now()-225||Yi)&&s.some(A=>et(A)&&!e2e.test(A.nodeName))&&(!b||b.endA>=b.endB)&&e.someProp("handleKeyDown",A=>A(e,Ic(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!b)if(r&&u instanceof dt&&!u.empty&&u.$head.sameParent(u.$anchor)&&!e.composing&&!(f.sel&&f.sel.anchor!=f.sel.head))b={start:u.from,endA:u.to,endB:u.to};else{if(f.sel){let A=kj(e,e.state.doc,f.sel);if(A&&!A.eq(e.state.selection)){let L=e.state.tr.setSelection(A);o&&L.setMeta("composition",o),e.dispatch(L)}}return}e.state.selection.from<e.state.selection.to&&b.start==b.endB&&e.state.selection instanceof dt&&(b.start>e.state.selection.from&&b.start<=e.state.selection.from+2&&e.state.selection.from>=f.from?b.start=e.state.selection.from:b.endA<e.state.selection.to&&b.endA>=e.state.selection.to-2&&e.state.selection.to<=f.to&&(b.endB+=e.state.selection.to-b.endA,b.endA=e.state.selection.to)),vs&&ka<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>f.from&&f.doc.textBetween(b.start-f.from-1,b.start-f.from+1)==" "&&(b.start--,b.endA--,b.endB--);let S=f.doc.resolveNoCache(b.start-f.from),E=f.doc.resolveNoCache(b.endB-f.from),C=h.resolve(b.start),R=S.sameParent(E)&&S.parent.inlineContent&&C.end()>=b.endA;if((wf&&e.input.lastIOSEnter>Date.now()-225&&(!R||s.some(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!R&&s2e(f.doc,S.pos,E.pos))&&e.someProp("handleKeyDown",A=>A(e,Ic(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>b.start&&r2e(h,b.start,b.endA,S,E)&&e.someProp("handleKeyDown",A=>A(e,Ic(8,"Backspace")))){Yi&&Cr&&e.domObserver.suppressSelectionUpdates();return}Cr&&b.endB==b.start&&(e.input.lastChromeDelete=Date.now()),Yi&&!R&&S.start()!=E.start()&&E.parentOffset==0&&S.depth==E.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==b.endA&&(b.endB-=2,E=f.doc.resolveNoCache(b.endB-f.from),setTimeout(()=>{e.someProp("handleKeyDown",function(A){return A(e,Ic(13,"Enter"))})},20));let T=b.start,O=b.endA,k=A=>{let L=A||e.state.tr.replace(T,O,f.doc.slice(b.start-f.from,b.endB-f.from));if(f.sel){let I=kj(e,L.doc,f.sel);I&&!(Cr&&e.composing&&I.empty&&(b.start!=b.endB||e.input.lastChromeDelete<Date.now()-100)&&(I.head==T||I.head==L.mapping.map(O)-1)||vs&&I.empty&&I.head==T)&&L.setSelection(I)}return o&&L.setMeta("composition",o),L.scrollIntoView()},M;if(R)if(S.pos==E.pos){vs&&ka<=11&&S.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>ol(e),20));let A=k(e.state.tr.delete(T,O)),L=h.resolve(b.start).marksAcross(h.resolve(b.endA));L&&A.ensureMarks(L),e.dispatch(A)}else if(b.endA==b.endB&&(M=n2e(S.parent.content.cut(S.parentOffset,E.parentOffset),C.parent.content.cut(C.parentOffset,b.endA-C.start())))){let A=k(e.state.tr);M.type=="add"?A.addMark(T,O,M.mark):A.removeMark(T,O,M.mark),e.dispatch(A)}else if(S.parent.child(S.index()).isText&&S.index()==E.index()-(E.textOffset?0:1)){let A=S.parent.textBetween(S.parentOffset,E.parentOffset),L=()=>k(e.state.tr.insertText(A,T,O));e.someProp("handleTextInput",I=>I(e,T,O,A,L))||e.dispatch(L())}else e.dispatch(k());else e.dispatch(k())}function kj(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:RN(e,t.resolve(n.anchor),t.resolve(n.head))}function n2e(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,s=n,o=r,l,c,u;for(let h=0;h<r.length;h++)s=r[h].removeFromSet(s);for(let h=0;h<n.length;h++)o=n[h].removeFromSet(o);if(s.length==1&&o.length==0)c=s[0],l="add",u=h=>h.mark(c.addToSet(h.marks));else if(s.length==0&&o.length==1)c=o[0],l="remove",u=h=>h.mark(c.removeFromSet(h.marks));else return null;let f=[];for(let h=0;h<t.childCount;h++)f.push(u(t.child(h)));if(Ie.from(f).eq(e))return{mark:c,type:l}}function r2e(e,t,n,r,s){if(n-t<=s.pos-r.pos||Cw(r,!0,!1)<s.pos)return!1;let o=e.resolve(t);if(!r.parent.isTextblock){let c=o.nodeAfter;return c!=null&&n==t+c.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let l=e.resolve(Cw(o,!0,!0));return!l.parent.isTextblock||l.pos>n||Cw(l,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(l.parent.content)}function s2e(e,t,n){let r=0,s=0;return e.nodesBetween(t,n,(o,l)=>{o.isTextblock&&l>=t&&l<n?r++:(o.isText?/\S/.test(o.text.slice(Math.max(0,t-l),Math.min(o.nodeSize,n-l))):o.isLeaf)&&s++}),s==0&&r==1}function Cw(e,t,n){let r=e.depth,s=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,s++,t=!1;if(n){let o=e.node(r).maybeChild(e.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,s++}return s}function o2e(e,t,n,r,s){let o=e.findDiffStart(t,n),l=n+e.size,c=n+t.size;if(o==null)return null;let{a:u,b:f}=e.findDiffEnd(t,l,c);if(s=="end"){let h=Math.max(0,o-Math.min(u,f));r-=u+h-o}if(u<o&&l<c){let h=r<=o&&r>=u?o-r:0;o-=h,f=o+(f-u),u=o}else if(f<o){let h=r<=o&&r>=f?o-r:0;o-=h,u=o+(u-f),f=o}return{start:o,endA:u,endB:f}}class a7{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new vCe,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Dj),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Ij(this),Mj(this),this.nodeViews=Lj(this),this.docView=hj(this.state.doc,_j(this),Ew(this),this.dom,this),this.domObserver=new KCe(this,(r,s,o,l)=>t2e(this,r,s,o,l)),this.domObserver.start(),SCe(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&$C(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Dj),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let s=this.state,o=!1,l=!1;t.storedMarks&&this.composing&&(t7(this),l=!0),this.state=t;let c=s.plugins!=t.plugins||this._props.plugins!=n.plugins;if(c||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let x=Lj(this);l2e(x,this.nodeViews)&&(this.nodeViews=x,o=!0)}(c||n.handleDOMEvents!=this._props.handleDOMEvents)&&$C(this),this.editable=Ij(this),Mj(this);let u=Ew(this),f=_j(this),h=s.plugins!=t.plugins&&!s.doc.eq(t.doc)?"reset":t.scrollToSelection>s.scrollToSelection?"to selection":"preserve",p=o||!this.docView.matchesNode(t.doc,f,u);(p||!t.selection.eq(s.selection))&&(l=!0);let y=h=="preserve"&&l&&this.dom.style.overflowAnchor==null&&DEe(this);if(l){this.domObserver.stop();let x=p&&(vs||Cr)&&!this.composing&&!s.selection.empty&&!t.selection.empty&&i2e(s.selection,t.selection);if(p){let S=Cr?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=jCe(this)),(o||!this.docView.update(t.doc,f,u,this))&&(this.docView.updateOuterDeco(f),this.docView.destroy(),this.docView=hj(t.doc,f,u,this.dom,this)),S&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(x=!0)}let b=this.input.mouseDown;x||!(b&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&oCe(this)&&b.delaySelUpdate())?ol(this,x):(F$(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(s),!((r=this.dragging)===null||r===void 0)&&r.node&&!s.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,s),h=="reset"?this.dom.scrollTop=0:h=="to selection"?this.scrollToSelection():y&&jEe(y)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!gu(this.dom,t))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof nt){let n=this.docView.domAfterPos(this.state.selection.from);et(n)&&aj(this,n.getBoundingClientRect(),t)}else aj(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,s=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)s=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&o<this.state.doc.content.size&&this.state.doc.nodeAt(o))==r.node&&(s=o)}this.dragging=new r7(t.slice,t.move,s<0?void 0:nt.create(this.state.doc,s))}someProp(t,n){let r=this._props&&this._props[t],s;if(r!=null&&(s=n?n(r):r))return s;for(let l=0;l<this.directPlugins.length;l++){let c=this.directPlugins[l].props[t];if(c!=null&&(s=n?n(c):c))return s}let o=this.state.plugins;if(o)for(let l=0;l<o.length;l++){let c=o[l].props[t];if(c!=null&&(s=n?n(c):c))return s}}hasFocus(){if(vs){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&PEe(this.dom),ol(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return $Ee(this,t)}coordsAtPos(t,n=1){return I$(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let s=this.docView.posFromDOM(t,n,r);if(s==null)throw new RangeError("DOM position not inside the editor");return s}endOfTextblock(t,n){return KEe(this,n||this.state,t)}pasteHTML(t,n){return Qp(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Qp(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return ON(this,t)}destroy(){this.docView&&(wCe(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Ew(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,TEe())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return CCe(this,t)}domSelectionRange(){let t=this.dom.isConnected!==!1&&this.domSelection();return t?Br&&this.root.nodeType===11&&kEe(this.dom.ownerDocument)==this.dom&&WCe(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}a7.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function _j(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[Oo.node(0,e.state.doc.content.size,t)]}function Mj(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Oo.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Ij(e){return!e.someProp("editable",t=>t(e.state)===!1)}function i2e(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function Lj(e){let t=Object.create(null);function n(r){for(let s in r)Object.prototype.hasOwnProperty.call(t,s)||(t[s]=r[s])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function l2e(e,t){let n=0,r=0;for(let s in e){if(e[s]!=t[s])return!0;n++}for(let s in t)r++;return n!=r}function Dj(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var qa={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Rx={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},a2e=typeof navigator<"u"&&/Mac/.test(navigator.platform),c2e=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Er=0;Er<10;Er++)qa[48+Er]=qa[96+Er]=String(Er);for(var Er=1;Er<=24;Er++)qa[Er+111]="F"+Er;for(var Er=65;Er<=90;Er++)qa[Er]=String.fromCharCode(Er+32),Rx[Er]=String.fromCharCode(Er);for(var Tw in qa)Rx.hasOwnProperty(Tw)||(Rx[Tw]=qa[Tw]);function u2e(e){var t=a2e&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||c2e&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?Rx:qa)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const d2e=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),f2e=typeof navigator<"u"&&/Win/.test(navigator.platform);function h2e(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,s,o,l;for(let c=0;c<t.length-1;c++){let u=t[c];if(/^(cmd|meta|m)$/i.test(u))l=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))s=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))d2e?l=!0:s=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),s&&(n="Ctrl-"+n),l&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function p2e(e){let t=Object.create(null);for(let n in e)t[h2e(n)]=e[n];return t}function Nw(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function m2e(e){return new Gs({props:{handleKeyDown:g2e(e)}})}function g2e(e){let t=p2e(e);return function(n,r){let s=u2e(r),o,l=t[Nw(s,r)];if(l&&l(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(r.shiftKey){let c=t[Nw(s,r,!1)];if(c&&c(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(f2e&&r.ctrlKey&&r.altKey)&&(o=qa[r.keyCode])&&o!=s){let c=t[Nw(o,r)];if(c&&c(n.state,n.dispatch,n))return!0}}return!1}}var Ox=200,ir=function(){};ir.prototype.append=function(t){return t.length?(t=ir.from(t),!this.length&&t||t.length<Ox&&this.leafAppend(t)||this.length<Ox&&t.leafPrepend(this)||this.appendInner(t)):this};ir.prototype.prepend=function(t){return t.length?ir.from(t).append(this):this};ir.prototype.appendInner=function(t){return new y2e(this,t)};ir.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?ir.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};ir.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};ir.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};ir.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var s=[];return this.forEach(function(o,l){return s.push(t(o,l))},n,r),s};ir.from=function(t){return t instanceof ir?t:t&&t.length?new c7(t):ir.empty};var c7=(function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(s,o){return s==0&&o==this.length?this:new t(this.values.slice(s,o))},t.prototype.getInner=function(s){return this.values[s]},t.prototype.forEachInner=function(s,o,l,c){for(var u=o;u<l;u++)if(s(this.values[u],c+u)===!1)return!1},t.prototype.forEachInvertedInner=function(s,o,l,c){for(var u=o-1;u>=l;u--)if(s(this.values[u],c+u)===!1)return!1},t.prototype.leafAppend=function(s){if(this.length+s.length<=Ox)return new t(this.values.concat(s.flatten()))},t.prototype.leafPrepend=function(s){if(this.length+s.length<=Ox)return new t(s.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(ir);ir.empty=new c7([]);var y2e=(function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,s,o,l){var c=this.left.length;if(s<c&&this.left.forEachInner(r,s,Math.min(o,c),l)===!1||o>c&&this.right.forEachInner(r,Math.max(s-c,0),Math.min(this.length,o)-c,l+c)===!1)return!1},t.prototype.forEachInvertedInner=function(r,s,o,l){var c=this.left.length;if(s>c&&this.right.forEachInvertedInner(r,s-c,Math.max(o,c)-c,l+c)===!1||o<c&&this.left.forEachInvertedInner(r,Math.min(s,c),o,l)===!1)return!1},t.prototype.sliceInner=function(r,s){if(r==0&&s==this.length)return this;var o=this.left.length;return s<=o?this.left.slice(r,s):r>=o?this.right.slice(r-o,s-o):this.left.slice(r,o).append(this.right.slice(0,s-o))},t.prototype.leafAppend=function(r){var s=this.right.leafAppend(r);if(s)return new t(this.left,s)},t.prototype.leafPrepend=function(r){var s=this.left.leafPrepend(r);if(s)return new t(s,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t})(ir);const x2e=500;class Co{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let s,o;n&&(s=this.remapping(r,this.items.length),o=s.maps.length);let l=t.tr,c,u,f=[],h=[];return this.items.forEach((p,y)=>{if(!p.step){s||(s=this.remapping(r,y+1),o=s.maps.length),o--,h.push(p);return}if(s){h.push(new Wo(p.map));let x=p.step.map(s.slice(o)),b;x&&l.maybeStep(x).doc&&(b=l.mapping.maps[l.mapping.maps.length-1],f.push(new Wo(b,void 0,void 0,f.length+h.length))),o--,b&&s.appendMap(b,o)}else l.maybeStep(p.step);if(p.selection)return c=s?p.selection.map(s.slice(o)):p.selection,u=new Co(this.items.slice(0,r).append(h.reverse().concat(f)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:l,selection:c}}addTransform(t,n,r,s){let o=[],l=this.eventCount,c=this.items,u=!s&&c.length?c.get(c.length-1):null;for(let h=0;h<t.steps.length;h++){let p=t.steps[h].invert(t.docs[h]),y=new Wo(t.mapping.maps[h],p,n),x;(x=u&&u.merge(y))&&(y=x,h?o.pop():c=c.slice(0,c.length-1)),o.push(y),n&&(l++,n=void 0),s||(u=y)}let f=l-r.depth;return f>v2e&&(c=b2e(c,f),l-=f),new Co(c.append(o),l)}remapping(t,n){let r=new Yp;return this.items.forEach((s,o)=>{let l=s.mirrorOffset!=null&&o-s.mirrorOffset>=t?r.maps.length-s.mirrorOffset:void 0;r.appendMap(s.map,l)},t,n),r}addMaps(t){return this.eventCount==0?this:new Co(this.items.append(t.map(n=>new Wo(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;n=Math.min(this.items.length,n);let r=[],s=this.items.length-n,o=t.mapping,l=t.steps.length,c=this.eventCount;this.items.forEach(y=>{y.selection&&c--},s);let u=n;this.items.forEach(y=>{let x=o.getMirror(--u);if(x==null)return;l=Math.min(l,x);let b=o.maps[x];if(y.step){let S=t.steps[x].invert(t.docs[x]),E=y.selection&&y.selection.map(o.slice(u+1,x));E&&c++,r.push(new Wo(b,S,E))}else r.push(new Wo(b))},s);let f=[];for(let y=n;y<l;y++)f.push(new Wo(o.maps[y]));let h=this.items.slice(0,s).append(f).append(r),p=new Co(h,c);return p.emptyItemCount()>x2e&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,s=[],o=0;return this.items.forEach((l,c)=>{if(c>=t)s.push(l),l.selection&&o++;else if(l.step){let u=l.step.map(n.slice(r)),f=u&&u.getMap();if(r--,f&&n.appendMap(f,r),u){let h=l.selection&&l.selection.map(n.slice(r));h&&o++;let p=new Wo(f.invert(),u,h),y,x=s.length-1;(y=s.length&&s[x].merge(p))?s[x]=y:s.push(p)}}else l.map&&r--},this.items.length,0),new Co(ir.from(s.reverse()),o)}}Co.empty=new Co(ir.empty,0);function b2e(e,t){let n;return e.forEach((r,s)=>{if(r.selection&&t--==0)return n=s,!1}),e.slice(n)}class Wo{constructor(t,n,r,s){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=s}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new Wo(n.getMap().invert(),n,this.selection)}}}class ca{constructor(t,n,r,s,o){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=s,this.prevComposition=o}}const v2e=20;function S2e(e,t,n,r){let s=n.getMeta(La),o;if(s)return s.historyState;n.getMeta(u7)&&(e=new ca(e.done,e.undone,null,0,-1));let l=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(l&&l.getMeta(La))return l.getMeta(La).redo?new ca(e.done.addTransform(n,void 0,r,Ay(t)),e.undone,jj(n.mapping.maps),e.prevTime,e.prevComposition):new ca(e.done,e.undone.addTransform(n,void 0,r,Ay(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(l&&l.getMeta("addToHistory")===!1)){let c=n.getMeta("composition"),u=e.prevTime==0||!l&&e.prevComposition!=c&&(e.prevTime<(n.time||0)-r.newGroupDelay||!w2e(n,e.prevRanges)),f=l?Rw(e.prevRanges,n.mapping):jj(n.mapping.maps);return new ca(e.done.addTransform(n,u?t.selection.getBookmark():void 0,r,Ay(t)),Co.empty,f,n.time,c??e.prevComposition)}else return(o=n.getMeta("rebased"))?new ca(e.done.rebased(n,o),e.undone.rebased(n,o),Rw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new ca(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Rw(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function w2e(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,s)=>{for(let o=0;o<t.length;o+=2)r<=t[o+1]&&s>=t[o]&&(n=!0)}),n}function jj(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,s,o,l)=>t.push(o,l));return t}function Rw(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let s=t.map(e[r],1),o=t.map(e[r+1],-1);s<=o&&n.push(s,o)}return n}function E2e(e,t,n){let r=Ay(t),s=La.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let l=o.selection.resolve(o.transform.doc),c=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),s,r),u=new ca(n?c:o.remaining,n?o.remaining:c,null,0,-1);return o.transform.setSelection(l).setMeta(La,{redo:n,historyState:u})}let Ow=!1,Pj=null;function Ay(e){let t=e.plugins;if(Pj!=t){Ow=!1,Pj=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Ow=!0;break}}return Ow}function C2e(e){return e.setMeta(u7,!0)}const La=new Lo("history"),u7=new Lo("closeHistory");function Nke(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Gs({key:La,state:{init(){return new ca(Co.empty,Co.empty,null,0,-1)},apply(t,n,r){return S2e(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,s=r=="historyUndo"?T2e:r=="historyRedo"?N2e:null;return!s||!t.editable?!1:(n.preventDefault(),s(t.state,t.dispatch))}}}})}function d7(e,t){return(n,r)=>{let s=La.getState(n);if(!s||(e?s.undone:s.done).eventCount==0)return!1;if(r){let o=E2e(s,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const T2e=d7(!1,!0),N2e=d7(!0,!0);function Rke(e){return e.getMeta(La)!=null}function Ub(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:s}=n,{storedMarks:o}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return o},get selection(){return r},get doc(){return s},get tr(){return r=n.selection,s=n.doc,o=n.storedMarks,n}}}var Ud=class f7{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:n,state:r}=this,{view:s}=n,{tr:o}=r,l=this.buildProps(o);return Object.fromEntries(Object.entries(t).map(([c,u])=>[c,(...h)=>{const p=u(...h)(l);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(o),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){const{rawCommands:r,editor:s,state:o}=this,{view:l}=s,c=[],u=!!t,f=t||o.tr,h=()=>(!u&&n&&!f.getMeta("preventDispatch")&&!this.hasCustomState&&l.dispatch(f),c.every(y=>y===!0)),p={...Object.fromEntries(Object.entries(r).map(([y,x])=>[y,(...S)=>{const E=this.buildProps(f,n),C=x(...S)(E);return c.push(C),p}])),run:h};return p}static createFakeChain(){const t=new Proxy({},{get:(n,r)=>{if(r!=="then")return r==="run"?()=>!1:()=>t}});return t}createCan(t){const{rawCommands:n,state:r}=this,s=!1,o=t||r.tr,l=this.buildProps(o,s);return{...Object.fromEntries(Object.entries(n).map(([c,u])=>[c,(...f)=>u(...f)({...l,dispatch:void 0})])),chain:()=>this.createChain(o,s)}}static createFallbackCan(){const t=f7.createFakeChain();return new Proxy({chain:()=>t},{get:(n,r)=>{if(r!=="then")return r==="chain"?n.chain:()=>!1}})}buildProps(t,n=!0){const{rawCommands:r,editor:s,state:o}=this,{view:l}=s,c={tr:t,editor:s,view:l,state:Ub({state:o,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(r).map(([u,f])=>[u,(...h)=>f(...h)(c)]))}};return c}};const R2e=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),(n=window)===null||n===void 0||(n=n.getSelection())===null||n===void 0||n.removeAllRanges()}}),!0),O2e=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),A2e=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:s}=r;return n&&s.forEach(({$from:o,$to:l})=>{e.doc.nodesBetween(o.pos,l.pos,(c,u)=>{if(c.type.isText)return;const{doc:f,mapping:h}=t,p=f.resolve(h.map(u)),y=f.resolve(h.map(u+c.nodeSize)),x=p.blockRange(y);if(!x)return;const b=Pf(x);if(c.type.isTextblock){const{defaultType:S}=p.parent.contentMatchAt(p.index());t.setNodeMarkup(x.start,S)}(b||b===0)&&t.lift(x,b)})}),!0},k2e=e=>t=>e(t),_2e=()=>({state:e,dispatch:t})=>w$(e,t),M2e=(e,t)=>({editor:n,tr:r})=>{const{state:s}=n,o=s.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const l=r.mapping.map(t);return r.insert(l,o.content),r.setSelection(new dt(r.doc.resolve(Math.max(l-1,0)))),!0},I2e=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===r.type){if(t){const l=s.before(o),c=s.after(o);e.delete(l,c).scrollIntoView()}return!0}return!1};function lr(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}const L2e=e=>({tr:t,state:n,dispatch:r})=>{const s=lr(e,n.schema),o=t.selection.$anchor;for(let l=o.depth;l>0;l-=1)if(o.node(l).type===s){if(r){const c=o.before(l),u=o.after(l);t.delete(c,u).scrollIntoView()}return!0}return!1},D2e=e=>({tr:t,dispatch:n})=>{const{from:r,to:s}=e;return n&&t.delete(r,s),!0},j2e=e=>e.content?/^text(\*|\+)/.test(e.content):!1,zj=(e,t,n)=>{if(!e.parent.isInline||n==="left"&&e.pos>e.start()||n==="right"&&e.pos<e.end())return e.pos;const r=t.nodes[e.parent.type.name].spec;return j2e(r)?n==="left"?e.start()-1:e.end()+1:e.pos},P2e=(e,t,n)=>({from:zj(e,n,"left"),to:zj(t,n,"right")}),z2e=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){const n=e.tr,{ranges:r}=e.selection,s=n.steps.length;r.forEach(o=>{const l=n.mapping.slice(s),c=n.doc.resolve(l.map(o.$from.pos)),u=n.doc.resolve(l.map(o.$to.pos)),{from:f,to:h}=P2e(c,u,e.schema);n.deleteRange(f,h)}),n.selection.empty||n.setSelection(dt.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},B2e=()=>({commands:e})=>e.keyboardShortcut("Enter"),H2e=()=>({state:e,dispatch:t})=>uEe(e,t);function LN(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Ax(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(s=>n.strict?t[s]===e[s]:LN(t[s])?t[s].test(e[s]):t[s]===e[s]):!0}function h7(e,t,n={}){return e.find(r=>r.type===t&&Ax(Object.fromEntries(Object.keys(n).map(s=>[s,r.attrs[s]])),n))}function Bj(e,t,n={}){return!!h7(e,t,n)}function DN(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(u=>u.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(u=>u.type===t))return;if(!n){const u=r.node.marks.find(f=>f.type===t);u&&(n=u.attrs)}if(!h7([...r.node.marks],t,n))return;let s=r.index,o=e.start()+r.offset,l=s+1,c=o+r.node.nodeSize;for(;s>0&&Bj([...e.parent.child(s-1).marks],t,n);)s-=1,o-=e.parent.child(s).nodeSize;for(;l<e.parent.childCount&&Bj([...e.parent.child(l).marks],t,n);)c+=e.parent.child(l).nodeSize,l+=1;return{from:o,to:c}}function vl(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const F2e=(e,t)=>({tr:n,state:r,dispatch:s})=>{const o=vl(e,r.schema),{doc:l,selection:c}=n,{$from:u,from:f,to:h}=c;if(s){const p=DN(u,o,t);if(p&&p.from<=f&&p.to>=h){const y=dt.create(l,p.from,p.to);n.setSelection(y)}}return!0},$2e=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function p7(e){return e instanceof dt}function Hc(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function UC(e,t=null){if(!t)return null;const n=Rt.atStart(e),r=Rt.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const s=n.from,o=r.to;return t==="all"?dt.create(e,Hc(0,s,o),Hc(e.content.size,s,o)):dt.create(e,Hc(t,s,o),Hc(t,s,o))}function VC(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function Jp(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function U2e(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const V2e=(e=null,t={})=>({editor:n,view:r,tr:s,dispatch:o})=>{t={scrollIntoView:!0,...t};const l=()=>{(Jp()||VC())&&r.dom.focus(),U2e()&&!Jp()&&!VC()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(o&&e===null&&!p7(n.state.selection))return l(),!0;const c=UC(s.doc,e)||n.state.selection,u=n.state.selection.eq(c);return o&&(u||s.setSelection(c),u&&s.storedMarks&&s.setStoredMarks(s.storedMarks),l()),!0},q2e=(e,t)=>n=>e.every((r,s)=>t(r,{...n,index:s})),G2e=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),m7=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&m7(r)}return e};function tp(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return m7(n)}function g7(e){return typeof(e==null?void 0:e.nodesBetween)=="function"}function Ef(e,t,n){if(g7(e))return e;const r=typeof e=="object"&&e!==null;n={slice:!0,parseOptions:{},...n};const s=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return Ie.fromArray(e.map(l=>t.nodeFromJSON(l)));const o=t.nodeFromJSON(e);return n.errorOnInvalidContent&&o.check(),o}catch(o){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),Ef("",t,n)}if(s){if(n.errorOnInvalidContent){let l=!1,c="";const u=new WF({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:f=>(l=!0,c=typeof f=="string"?f:f.outerHTML,null)}]}})});if(n.slice?rl.fromSchema(u).parseSlice(tp(e),n.parseOptions):rl.fromSchema(u).parse(tp(e),n.parseOptions),n.errorOnInvalidContent&&l)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${c}`)})}const o=rl.fromSchema(t);return n.slice?o.parseSlice(tp(e),n.parseOptions).content:o.parse(tp(e),n.parseOptions)}return Ef("",t,n)}function y7(e){return!("type"in e)}function x7(e,t,n){const r=e.steps.length-1;if(r<t)return;const s=e.steps[r];if(!(s instanceof _n||s instanceof or))return;const o=e.mapping.maps[r];let l=0;o.forEach((c,u,f,h)=>{l===0&&(l=h)}),e.setSelection(Rt.near(e.doc.resolve(l),n))}const K2e=(e,t,n)=>({tr:r,dispatch:s,editor:o})=>{if(s){n={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let c;const u=E=>{o.emit("contentError",{editor:o,error:E,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}})},f={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!o.options.enableContentCheck&&o.options.emitContentError)try{Ef(t,o.schema,{parseOptions:f,errorOnInvalidContent:!0})}catch(E){u(E)}try{var l;c=Ef(t,o.schema,{parseOptions:f,errorOnInvalidContent:(l=n.errorOnInvalidContent)!==null&&l!==void 0?l:o.options.enableContentCheck})}catch(E){return u(E),!1}let{from:h,to:p}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},y=!0,x=!0;const b=y7(c)?c.content:[c];if(b.forEach(E=>{E.check(),y=y?E.isText&&E.marks.length===0:!1,x=x?E.isBlock:!1}),h===p&&x){const{parent:E}=r.doc.resolve(h);E.isTextblock&&!E.type.spec.code&&!E.childCount&&(h-=1,p+=1)}let S;if(y)Array.isArray(t)?S=t.map(E=>E.text||"").join(""):g7(t)?S=b.map(E=>{var C;return(C=E.text)!==null&&C!==void 0?C:""}).join(""):typeof t=="object"&&t&&t.text?S=t.text:S=t,r.insertText(S,h,p);else{S=Ie.from(b);const E=r.doc.resolve(h),C=E.node(),R=E.parentOffset===0,T=C.isText||C.isTextblock,O=C.content.size>0;R&&T&&O&&x&&(h=Math.max(0,h-1)),r.replaceWith(h,p,b)}n.updateSelection&&x7(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:h,text:S}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:h,text:S})}return!0};function b7(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Y2e=(e={})=>({tr:t,dispatch:n,editor:r})=>{const{pos:s,attrs:o,content:l,updateSelection:c=!0}=e;let u;typeof s=="number"?u=t.doc.resolve(s):s?u=s:u=t.selection.$from;const f=b7(u.parent.contentMatchAt(u.index()));if(!f)return!1;const h=Object.keys(f.spec.attrs||{}),p=o?Object.fromEntries(Object.entries(o).filter(([x])=>h.includes(x))):{};let y;if(l){const x=Ef(l,r.schema);y=f.createAndFill(p,x)}else y=f.createAndFill(p);return y?(n&&(t.insert(u.pos,y),c&&x7(t,t.steps.length-1,-1)),!0):!1},W2e=()=>({state:e,dispatch:t})=>lEe(e,t),X2e=()=>({state:e,dispatch:t})=>aEe(e,t),Q2e=()=>({state:e,dispatch:t})=>m$(e,t),Z2e=()=>({state:e,dispatch:t})=>b$(e,t),v7=(e,t)=>{const n=e.resolve(t),r=n.nodeBefore,s=n.nodeAfter;return!r||!s?!1:!r.type.spec.isolating&&!s.type.spec.isolating},J2e=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Pb(e.doc,e.selection.$from.pos,-1);return r==null||!v7(e.doc,r)?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},eTe=()=>({state:e,dispatch:t,tr:n})=>{try{const r=Pb(e.doc,e.selection.$from.pos,1);return r==null||!v7(e.doc,r)?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},tTe=()=>({state:e,dispatch:t})=>oEe(e,t),nTe=()=>({state:e,dispatch:t})=>iEe(e,t);function S7(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function rTe(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,s,o,l;for(let c=0;c<t.length-1;c+=1){const u=t[c];if(/^(cmd|meta|m)$/i.test(u))l=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))s=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))Jp()||S7()?l=!0:s=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),s&&(n=`Ctrl-${n}`),l&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const sTe=e=>({editor:t,view:n,tr:r,dispatch:s})=>{const o=rTe(e).split(/-(?!$)/),l=o.find(f=>!["Alt","Ctrl","Meta","Shift"].includes(f)),c=new KeyboardEvent("keydown",{key:l==="Space"?" ":l,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),u=t.captureTransaction(()=>{n.someProp("handleKeyDown",f=>f(n,c))});return u==null||u.steps.forEach(f=>{const h=f.map(r.mapping);h&&s&&r.maybeStep(h)}),!0};function em(e,t,n={}){const{from:r,to:s,empty:o}=e.selection,l=t?lr(t,e.schema):null,c=[];e.doc.nodesBetween(r,s,(h,p)=>{if(h.isText)return;const y=Math.max(r,p),x=Math.min(s,p+h.nodeSize);c.push({node:h,from:y,to:x})});const u=s-r,f=c.filter(h=>l?l.name===h.node.type.name:!0).filter(h=>Ax(h.node.attrs,n,{strict:!1}));return o?!!f.length:f.reduce((h,p)=>h+p.to-p.from,0)>=u}const oTe=(e,t={})=>({state:n,dispatch:r})=>em(n,lr(e,n.schema),t)?cEe(n,r):!1,iTe=()=>({state:e,dispatch:t})=>E$(e,t),lTe=e=>({state:t,dispatch:n})=>{const r=lr(e,t.schema);return SEe(r)(t,n)},aTe=()=>({state:e,dispatch:t})=>S$(e,t);function Vb(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function Hj(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,s)=>(n.includes(s)||(r[s]=e[s]),r),{})}const cTe=(e,t)=>({tr:n,state:r,dispatch:s})=>{let o=null,l=null;const c=Vb(typeof e=="string"?e:e.name,r.schema);if(!c)return!1;c==="node"&&(o=lr(e,r.schema)),c==="mark"&&(l=vl(e,r.schema));let u=!1;return n.selection.ranges.forEach(f=>{r.doc.nodesBetween(f.$from.pos,f.$to.pos,(h,p)=>{o&&o===h.type&&(u=!0,s&&n.setNodeMarkup(p,void 0,Hj(h.attrs,t))),l&&h.marks.length&&h.marks.forEach(y=>{l===y.type&&(u=!0,s&&n.addMark(p,p+h.nodeSize,l.create(Hj(y.attrs,t))))})})}),u},uTe=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),dTe=()=>({tr:e,dispatch:t})=>{if(t){const n=new Hs(e.doc);e.setSelection(n)}return!0},fTe=()=>({state:e,dispatch:t})=>y$(e,t),hTe=()=>({state:e,dispatch:t})=>v$(e,t),pTe=()=>({state:e,dispatch:t})=>hEe(e,t),mTe=()=>({state:e,dispatch:t})=>gEe(e,t),gTe=()=>({state:e,dispatch:t})=>mEe(e,t);function qC(e,t,n={},r={}){return Ef(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const yTe=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:s,tr:o,dispatch:l,commands:c})=>{const{doc:u}=o;if(r.preserveWhitespace!=="full"){const f=qC(e,s.schema,r,{errorOnInvalidContent:t??s.options.enableContentCheck});if(l){const h=y7(f)?f.content:[f];o.replaceWith(0,u.content.size,h).setMeta("preventUpdate",!n)}return!0}return l&&o.setMeta("preventUpdate",!n),c.insertContentAt({from:0,to:u.content.size},e,{parseOptions:r,errorOnInvalidContent:t??s.options.enableContentCheck})};function w7(e,t){const n=vl(t,e.schema),{from:r,to:s,empty:o}=e.selection,l=[];o?(e.storedMarks&&l.push(...e.storedMarks),l.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,s,u=>{l.push(...u.marks)});const c=l.find(u=>u.type.name===n.name);return c?{...c.attrs}:{}}function xTe(e,t){const n=new u$(e);return t.forEach(r=>{r.steps.forEach(s=>{n.step(s)})}),n}function Oke(e,t){const n=[];return e.descendants((r,s)=>{t(r)&&n.push({node:r,pos:s})}),n}function Ake(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(s,o)=>{n(s)&&r.push({node:s,pos:o})}),r}function bTe(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function qb(e){return t=>bTe(t.$from,e)}function We(e,t,n){return e.config[t]===void 0&&e.parent?We(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?We(e.parent,t,n):null}):e.config[t]}function jN(e){return e.map(t=>{const n=We(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return n?[t,...jN(n())]:t}).flat(10)}function PN(e,t){const n=Ru.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function GC(e){return typeof e=="function"}function Kt(e,t=void 0,...n){return GC(e)?t?e.bind(t)(...n):e(...n):e}function vTe(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Cf(e){return{baseExtensions:e.filter(t=>t.type==="extension"),nodeExtensions:e.filter(t=>t.type==="node"),markExtensions:e.filter(t=>t.type==="mark")}}function E7(e){const t=[],{nodeExtensions:n,markExtensions:r}=Cf(e),s=[...n,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},l=n.filter(f=>f.name!=="text").map(f=>f.name),c=r.map(f=>f.name),u=[...l,...c];return e.forEach(f=>{const h=We(f,"addGlobalAttributes",{name:f.name,options:f.options,storage:f.storage,extensions:s});h&&h().forEach(p=>{let y;Array.isArray(p.types)?y=p.types:p.types==="*"?y=u:p.types==="nodes"?y=l:p.types==="marks"?y=c:y=[],y.forEach(x=>{Object.entries(p.attributes).forEach(([b,S])=>{t.push({type:x,name:b,attribute:{...o,...S}})})})})}),s.forEach(f=>{const h=We(f,"addAttributes",{name:f.name,options:f.options,storage:f.storage});if(!h)return;const p=h();Object.entries(p).forEach(([y,x])=>{const b={...o,...x};typeof(b==null?void 0:b.default)=="function"&&(b.default=b.default()),b!=null&&b.isRequired&&(b==null?void 0:b.default)===void 0&&delete b.default,t.push({type:f.name,name:y,attribute:b})})}),t}function STe(e){const t=[];let n="",r=!1,s=!1,o=0;const l=e.length;for(let c=0;c<l;c+=1){const u=e[c];if(u==="'"&&!s){r=!r,n+=u;continue}if(u==='"'&&!r){s=!s,n+=u;continue}if(!r&&!s){if(u==="("){o+=1,n+=u;continue}if(u===")"&&o>0){o-=1,n+=u;continue}if(u===";"&&o===0){t.push(n),n="";continue}}n+=u}return n&&t.push(n),t}function Fj(e){const t=[],n=STe(e||""),r=n.length;for(let s=0;s<r;s+=1){const o=n[s],l=o.indexOf(":");if(l===-1)continue;const c=o.slice(0,l).trim(),u=o.slice(l+1).trim();c&&u&&t.push([c,u])}return t}function wTe(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([s,o])=>{if(s==="__proto__"){Object.defineProperty(r,s,{configurable:!0,enumerable:!0,value:o,writable:!0});return}if(!r[s]){r[s]=o;return}if(s==="class"){const l=o?String(o).split(" "):[],c=r[s]?r[s].split(" "):[],u=l.filter(f=>!c.includes(f));r[s]=[...c,...u].join(" ")}else if(s==="style"){const l=new Map([...Fj(r[s]),...Fj(o)]);r[s]=Array.from(l.entries()).map(([c,u])=>`${c}: ${u}`).join("; ")}else r[s]=o}),r},{})}function kx(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>wTe(n,r),{})}function ETe(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function $j(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const s=t.reduce((o,l)=>{const c=l.attribute.parseHTML?l.attribute.parseHTML(n):ETe(n.getAttribute(l.name));return c==null?o:{...o,[l.name]:c}},{});return{...r,...s}}}}function Uj(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&vTe(n)?!1:n!=null))}function Vj(e){var t,n;const r={};return!(!(e==null||(t=e.attribute)===null||t===void 0)&&t.isRequired)&&"default"in((e==null?void 0:e.attribute)||{})&&(r.default=e.attribute.default),(e==null||(n=e.attribute)===null||n===void 0?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function C7(e,t){var n;const r=E7(e),{nodeExtensions:s,markExtensions:o}=Cf(e),l=(n=s.find(f=>We(f,"topNode")))===null||n===void 0?void 0:n.name,c=Object.fromEntries(s.map(f=>{const h=r.filter(E=>E.type===f.name),p={name:f.name,options:f.options,storage:f.storage,editor:t},y=Uj({...e.reduce((E,C)=>{const R=We(C,"extendNodeSchema",p);return{...E,...R?R(f):{}}},{}),content:Kt(We(f,"content",p)),marks:Kt(We(f,"marks",p)),group:Kt(We(f,"group",p)),inline:Kt(We(f,"inline",p)),atom:Kt(We(f,"atom",p)),selectable:Kt(We(f,"selectable",p)),draggable:Kt(We(f,"draggable",p)),code:Kt(We(f,"code",p)),whitespace:Kt(We(f,"whitespace",p)),linebreakReplacement:Kt(We(f,"linebreakReplacement",p)),defining:Kt(We(f,"defining",p)),isolating:Kt(We(f,"isolating",p)),attrs:Object.fromEntries(h.map(Vj))}),x=Kt(We(f,"parseHTML",p));x&&(y.parseDOM=x.map(E=>$j(E,h)));const b=We(f,"renderHTML",p);b&&(y.toDOM=E=>b({node:E,HTMLAttributes:kx(E,h)}));const S=We(f,"renderText",p);return S&&(y.toText=S),[f.name,y]})),u=Object.fromEntries(o.map(f=>{const h=r.filter(S=>S.type===f.name),p={name:f.name,options:f.options,storage:f.storage,editor:t},y=Uj({...e.reduce((S,E)=>{const C=We(E,"extendMarkSchema",p);return{...S,...C?C(f):{}}},{}),inclusive:Kt(We(f,"inclusive",p)),excludes:Kt(We(f,"excludes",p)),group:Kt(We(f,"group",p)),spanning:Kt(We(f,"spanning",p)),code:Kt(We(f,"code",p)),attrs:Object.fromEntries(h.map(Vj))}),x=Kt(We(f,"parseHTML",p));x&&(y.parseDOM=x.map(S=>$j(S,h)));const b=We(f,"renderHTML",p);return b&&(y.toDOM=S=>b({mark:S,HTMLAttributes:kx(S,h)})),[f.name,y]}));return new WF({topNode:l,nodes:c,marks:u})}function CTe(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function gp(e){return e.sort((n,r)=>{const s=We(n,"priority")||100,o=We(r,"priority")||100;return s>o?-1:s<o?1:0})}function zN(e){const t=gp(jN(e)),n=CTe(t.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),t}function TTe(e,t){return C7(zN(e),t)}function kke(e,t){const n=TTe(t),r=tp(e);return rl.fromSchema(n).parse(r).toJSON()}function T7(e,t,n){const{from:r,to:s}=t,{blockSeparator:o=`
|
|
369
|
-
|
|
370
|
-
`,textSerializers:l={}}=n||{};let c="";return e.nodesBetween(r,s,(u,f,h,p)=>{u.isBlock&&f>r&&(c+=o);const y=l==null?void 0:l[u.type.name];if(y)return h&&(c+=y({node:u,pos:f,parent:h,index:p,range:t})),!1;if(u.isText){var x;c+=u==null||(x=u.text)===null||x===void 0?void 0:x.slice(Math.max(r,f)-f,s-f)}}),c}function NTe(e,t){return T7(e,{from:0,to:e.content.size},t)}function N7(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function RTe(e,t){const n=lr(t,e.schema),{from:r,to:s}=e.selection,o=[];e.doc.nodesBetween(r,s,c=>{o.push(c)});const l=o.reverse().find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function OTe(e,t){const n=Vb(typeof t=="string"?t:t.name,e.schema);return n==="node"?RTe(e,t):n==="mark"?w7(e,t):{}}function ATe(e,t=JSON.stringify){const n={};return e.filter(r=>{const s=t(r);return Object.prototype.hasOwnProperty.call(n,s)?!1:n[s]=!0})}function kTe(e){const t=ATe(e);return t.length===1?t:t.filter((n,r)=>!t.filter((s,o)=>o!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function R7(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((s,o)=>{const l=[];if(s.ranges.length)s.forEach((c,u)=>{l.push({from:c,to:u})});else{const{from:c,to:u}=n[o];if(c===void 0||u===void 0)return;l.push({from:c,to:u})}l.forEach(({from:c,to:u})=>{const f=t.slice(o).map(c,-1),h=t.slice(o).map(u),p=t.invert().map(f,-1),y=t.invert().map(h);r.push({oldRange:{from:p,to:y},newRange:{from:f,to:h}})})}),kTe(r)}function O7(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(s=>{const o=DN(n.resolve(e),s.type);o&&r.push({mark:s,...o})}):n.nodesBetween(e,t,(s,o)=>{!s||(s==null?void 0:s.nodeSize)===void 0||r.push(...s.marks.map(l=>({from:o,to:o+s.nodeSize,mark:l})))}),r}const _ke=(e,t,n,r=20)=>{const s=e.doc.resolve(n);let o=r,l=null;for(;o>0&&l===null;){const c=s.node(o);(c==null?void 0:c.type.name)===t?l=c:o-=1}return[l,o]},Mke=e=>{const t=e.depth-1;if(t<0)return null;const n=e.index(t);return n===0?null:e.node(t).child(n-1)};function bd(e,t){return t.nodes[e]||t.marks[e]||null}function ky(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const s=e.find(o=>o.type===t&&o.name===r);return s?s.attribute.keepOnSplit:!1}))}const _Te=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(s,o,l,c)=>{var u,f;const h=((u=(f=s.type.spec).toText)===null||u===void 0?void 0:u.call(f,{node:s,pos:o,parent:l,index:c}))||s.textContent||"%leaf%";n+=s.isAtom&&!s.isText?h:h.slice(0,Math.max(0,r-o))}),n};function KC(e,t,n={}){const{empty:r,ranges:s}=e.selection,o=t?vl(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(h=>o?o.name===h.type.name:!0).find(h=>Ax(h.attrs,n,{strict:!1}));let l=0;const c=[];if(s.forEach(({$from:h,$to:p})=>{const y=h.pos,x=p.pos;e.doc.nodesBetween(y,x,(b,S)=>{if(o&&b.inlineContent&&!b.type.allowsMarkType(o))return!1;if(!b.isText&&!b.marks.length)return;const E=Math.max(y,S),C=Math.min(x,S+b.nodeSize),R=C-E;l+=R,c.push(...b.marks.map(T=>({mark:T,from:E,to:C})))})}),l===0)return!1;const u=c.filter(h=>o?o.name===h.mark.type.name:!0).filter(h=>Ax(h.mark.attrs,n,{strict:!1})).reduce((h,p)=>h+p.to-p.from,0),f=c.filter(h=>o?h.mark.type!==o&&h.mark.type.excludes(o):!0).reduce((h,p)=>h+p.to-p.from,0);return(u>0?u+f:u)>=l}function MTe(e,t,n={}){if(!t)return em(e,null,n)||KC(e,null,n);const r=Vb(t,e.schema);return r==="node"?em(e,t,n):r==="mark"?KC(e,t,n):!1}const Ike=(e,t)=>{const{$from:n,$to:r,$anchor:s}=e.selection;if(t){const o=qb(c=>c.type.name===t)(e.selection);if(!o)return!1;const l=e.doc.resolve(o.pos+1);return s.pos+1===l.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Lke=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function qj(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function Aw(e,t){const{nodeExtensions:n}=Cf(t),r=n.find(o=>o.name===e);if(!r)return!1;const s=Kt(We(r,"group",{name:r.name,options:r.options,storage:r.storage}));return typeof s!="string"?!1:s.split(" ").includes("list")}function BN(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name==="hardBreak")return!0;if(e.isText){var r;return!/\S/.test((r=e.text)!==null&&r!==void 0?r:"")}}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let s=!0;return e.content.forEach(o=>{s!==!1&&(BN(o,{ignoreWhitespace:n,checkChildren:t})||(s=!1))}),s}return!1}function Dke(e){return e instanceof nt}var A7=class k7{constructor(t){this.position=t}static fromJSON(t){return new k7(t.position)}toJSON(){return{position:this.position}}};function ITe(e,t){const n=t.mapping.mapResult(e.position);return{position:new A7(n.pos),mapResult:n}}function LTe(e){return new A7(e)}function DTe(e,t,n){const{selection:r}=t;let s=null;if(p7(r)&&(s=r.$cursor),s){var o;const c=(o=e.storedMarks)!==null&&o!==void 0?o:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(c)||!c.some(u=>u.type.excludes(n)))}const{ranges:l}=r;return l.some(({$from:c,$to:u})=>{let f=c.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(c.pos,u.pos,(h,p,y)=>{if(f)return!1;if(h.isInline){const x=!y||y.type.allowsMarkType(n),b=!!n.isInSet(h.marks)||!h.marks.some(S=>S.type.excludes(n));f=x&&b}return!f}),f})}const jTe=(e,t={})=>({tr:n,state:r,dispatch:s})=>{const{selection:o}=n,{empty:l,ranges:c}=o,u=vl(e,r.schema);if(s)if(l){const f=w7(r,u);n.addStoredMark(u.create({...f,...t}))}else c.forEach(f=>{const h=f.$from.pos,p=f.$to.pos;r.doc.nodesBetween(h,p,(y,x)=>{const b=Math.max(x,h),S=Math.min(x+y.nodeSize,p);y.marks.find(E=>E.type===u)?y.marks.forEach(E=>{u===E.type&&n.addMark(b,S,u.create({...E.attrs,...t}))}):n.addMark(b,S,u.create(t))})});return DTe(r,n,u)},PTe=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),zTe=(e,t={})=>({state:n,dispatch:r,chain:s})=>{const o=lr(e,n.schema);let l;return n.selection.$anchor.sameParent(n.selection.$head)&&(l=n.selection.$anchor.parent.attrs),o.isTextblock?s().command(({commands:c})=>oj(o,{...l,...t})(n)?!0:c.clearNodes()).command(({state:c})=>oj(o,{...l,...t})(c,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},BTe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,s=Hc(e,0,r.content.size),o=nt.create(r,s);t.setSelection(o)}return!0},HTe=(e,t)=>({tr:n,state:r,dispatch:s})=>{const{selection:o}=r;let l,c;return typeof t=="number"?(l=t,c=t):t&&"from"in t&&"to"in t?(l=t.from,c=t.to):(l=o.from,c=o.to),s&&n.doc.nodesBetween(l,c,(u,f)=>{u.isText||n.setNodeMarkup(f,void 0,{...u.attrs,dir:e})}),!0},FTe=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:s,to:o}=typeof e=="number"?{from:e,to:e}:e,l=dt.atStart(r).from,c=dt.atEnd(r).to,u=Hc(s,l,c),f=Hc(o,l,c),h=dt.create(r,u,f);t.setSelection(h)}return!0},$Te=e=>({state:t,dispatch:n})=>{const r=lr(e,t.schema);return CEe(r)(t,n)};function Gj(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(s=>t==null?void 0:t.includes(s.type.name));e.tr.ensureMarks(r)}}const UTe=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:s})=>{const{selection:o,doc:l}=t,{$from:c,$to:u}=o,f=s.extensionManager.attributes,h=ky(f,c.node().type.name,c.node().attrs);if(o instanceof nt&&o.node.isBlock)return!c.parentOffset||!sl(l,c.pos)?!1:(r&&(e&&Gj(n,s.extensionManager.splittableMarks),t.split(c.pos).scrollIntoView()),!0);if(!c.parent.isBlock)return!1;const p=u.parentOffset===u.parent.content.size,y=c.depth===0?void 0:b7(c.node(-1).contentMatchAt(c.indexAfter(-1)));let x=p&&y?[{type:y,attrs:h}]:void 0;const b=o instanceof dt&&!o.empty?Ki.create({doc:t.doc,selection:o}).tr.deleteSelection():null,S=b?b.doc:t.doc,E=b?b.mapping.map(c.pos):c.pos;let C=sl(S,E,1,x);if(!x&&!C&&sl(S,E,1,y?[{type:y}]:void 0)&&(C=!0,x=y?[{type:y,attrs:h}]:void 0),r){if(C){const R=t.steps.length;if(o instanceof dt&&t.deleteSelection(),t.split(t.mapping.slice(R).map(c.pos),1,x),y&&!p&&!c.parentOffset&&c.parent.type!==y){const T=t.mapping.slice(R).map(c.before()),O=t.doc.resolve(T);c.node(-1).canReplaceWith(O.index(),O.index()+1,y)&&t.setNodeMarkup(t.mapping.slice(R).map(c.before()),y)}}e&&Gj(n,s.extensionManager.splittableMarks),t.scrollIntoView()}return C},VTe=(e,t={})=>({tr:n,state:r,dispatch:s,editor:o})=>{const l=lr(e,r.schema),{$from:c,$to:u}=r.selection,f=r.selection.node;if(f&&f.isBlock||c.depth<2||!c.sameParent(u))return!1;const h=c.node(-1);if(h.type!==l)return!1;const p=o.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(s){var y;let O=Ie.empty;const k=c.index(-1)?1:c.index(-2)?2:3;for(let P=c.depth-k;P>=c.depth-3;P-=1)O=Ie.from(c.node(P).copy(O));const M=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,A={...ky(p,c.node().type.name,c.node().attrs),...t},L=((y=l.contentMatch.defaultType)===null||y===void 0?void 0:y.createAndFill(A))||void 0;O=O.append(Ie.from(l.createAndFill(null,L)||void 0));const I=c.before(c.depth-(k-1));n.replace(I,c.after(-M),new Ue(O,4-k,0));let j=-1;n.doc.nodesBetween(I,n.doc.content.size,(P,B)=>{if(j>-1)return!1;P.isTextblock&&P.content.size===0&&(j=B+1)}),j>-1&&n.setSelection(dt.near(n.doc.resolve(j))),n.scrollIntoView()}return!0}const x=u.pos===c.end()?h.contentMatchAt(0).defaultType:null,b={...ky(p,h.type.name,h.attrs),...t},S={...ky(p,c.node().type.name,c.node().attrs),...t},E=c.parentOffset===0&&c.index(-1)===0,C=c.before(-1);n.delete(c.pos,u.pos);const R=E?h.attrs:b,T=x?[{type:l,attrs:R},{type:x,attrs:S}]:[{type:l,attrs:R}];if(!sl(n.doc,c.pos,2))return!1;if(s){const{selection:O,storedMarks:k}=r,{splittableMarks:M}=o.extensionManager,A=k||O.$to.parentOffset&&O.$from.marks();if(n.split(c.pos,2,T).scrollIntoView(),E&&n.setNodeMarkup(C,void 0,b),!A||!s)return!0;const L=A.filter(I=>M.includes(I.type.name));n.ensureMarks(L)}return!0};function Kj(e){return!e||e==="1"?null:e}function _7(e,t){return Kj(e)===Kj(t)}const kw=(e,t)=>{const n=qb(o=>o.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const s=e.doc.nodeAt(r);return!(n.node.type===(s==null?void 0:s.type)&&Za(e.doc,n.pos))||!_7(n.node.attrs.type,s==null?void 0:s.attrs.type)||e.join(n.pos),!0},_w=(e,t)=>{const n=qb(o=>o.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const s=e.doc.nodeAt(r);return!(n.node.type===(s==null?void 0:s.type)&&Za(e.doc,r))||!_7(n.node.attrs.type,s==null?void 0:s.attrs.type)||e.join(r),!0};function qTe(e){const t=e.doc,n=t.firstChild;if(!n)return null;const r=t.resolve(1),s=t.resolve(n.nodeSize-1);return dt.between(r,s)}const GTe=(e,t,n,r={})=>({editor:s,tr:o,state:l,dispatch:c,chain:u,commands:f,can:h})=>{const{extensions:p,splittableMarks:y}=s.extensionManager,x=lr(e,l.schema),b=lr(t,l.schema),{selection:S,storedMarks:E}=l,{$from:C,$to:R}=S,T=C.blockRange(R),O=E||S.$to.parentOffset&&S.$from.marks();if(!T)return!1;const k=qb(H=>Aw(H.type.name,p))(S),M=S.from===0&&S.to===l.doc.content.size,A=l.doc.content.content,L=A.length===1?A[0]:null,I=M&&L&&Aw(L.type.name,p)?{node:L,pos:0}:null,j=k??I,P=!!k&&T.depth>=1&&T.depth-k.depth<=1,B=!!I;if((P||B)&&j){if(j.node.type===x)return M&&B?u().command(({tr:H,dispatch:D})=>{const F=qTe(H);return F?(H.setSelection(F),D&&D(H),!0):!1}).liftListItem(b).run():f.liftListItem(b);if(Aw(j.node.type.name,p)&&x.validContent(j.node.content))return u().command(()=>(o.setNodeMarkup(j.pos,x),!0)).command(()=>kw(o,x)).command(()=>_w(o,x)).run()}return!n||!O||!c?u().command(()=>h().wrapInList(x,r)?!0:f.clearNodes()).wrapInList(x,r).command(()=>kw(o,x)).command(()=>_w(o,x)).run():u().command(()=>{const H=h().wrapInList(x,r),D=O.filter(F=>y.includes(F.type.name));return o.ensureMarks(D),H?!0:f.clearNodes()}).wrapInList(x,r).command(()=>kw(o,x)).command(()=>_w(o,x)).run()},KTe=(e,t={},n={})=>({state:r,commands:s})=>{const{extendEmptyMarkRange:o=!1}=n,l=vl(e,r.schema);return KC(r,l,t)?s.unsetMark(l,{extendEmptyMarkRange:o}):s.setMark(l,t)},YTe=(e,t,n={})=>({state:r,commands:s})=>{const o=lr(e,r.schema),l=lr(t,r.schema),c=em(r,o,n);let u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),c?s.setNode(l,u):s.setNode(o,{...u,...n})},WTe=(e,t={})=>({state:n,commands:r})=>{const s=lr(e,n.schema);return em(n,s,t)?r.lift(s):r.wrapIn(s,t)},XTe=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const s=n[r];let o;if(s.spec.isInputRules&&(o=s.getState(e))){if(t){const l=e.tr,c=o.transform;for(let u=c.steps.length-1;u>=0;u-=1)l.step(c.steps[u].invert(c.docs[u]));if(o.text){const u=l.doc.resolve(o.from).marks();l.replaceWith(o.from,o.to,e.schema.text(o.text,u))}else l.delete(o.from,o.to)}return!0}}return!1},QTe=(e={})=>({tr:t,dispatch:n,editor:r})=>{const{ignoreClearable:s=!1}=e,{selection:o}=t,{empty:l,ranges:c}=o;if(l)return!0;const{nonClearableMarks:u}=r.extensionManager;if(n){const f=Object.values(r.schema.marks).filter(h=>s||!u.includes(h.name));c.forEach(h=>{for(const p of f)t.removeMark(h.$from.pos,h.$to.pos,p)})}return!0},ZTe=(e,t={})=>({tr:n,state:r,dispatch:s})=>{const{extendEmptyMarkRange:o=!1}=t,{selection:l}=n,c=vl(e,r.schema),{$from:u,empty:f,ranges:h}=l;if(!s)return!0;if(f&&o){var p;let{from:y,to:x}=l;const b=DN(u,c,(p=u.marks().find(S=>S.type===c))===null||p===void 0?void 0:p.attrs);b&&(y=b.from,x=b.to),n.removeMark(y,x,c)}else h.forEach(y=>{n.removeMark(y.$from.pos,y.$to.pos,c)});return n.removeStoredMark(c),!0},JTe=e=>({tr:t,state:n,dispatch:r})=>{const{selection:s}=n;let o,l;return typeof e=="number"?(o=e,l=e):e&&"from"in e&&"to"in e?(o=e.from,l=e.to):(o=s.from,l=s.to),r&&t.doc.nodesBetween(o,l,(c,u)=>{if(c.isText)return;const f={...c.attrs};delete f.dir,t.setNodeMarkup(u,void 0,f)}),!0},eNe=(e,t={})=>({tr:n,state:r,dispatch:s})=>{let o=null,l=null;const c=Vb(typeof e=="string"?e:e.name,r.schema);if(!c)return!1;c==="node"&&(o=lr(e,r.schema)),c==="mark"&&(l=vl(e,r.schema));let u=!1;return n.selection.ranges.forEach(f=>{const h=f.$from.pos,p=f.$to.pos;let y,x,b,S;n.selection.empty?r.doc.nodesBetween(h,p,(E,C)=>{o&&o===E.type&&(u=!0,b=Math.max(C,h),S=Math.min(C+E.nodeSize,p),y=C,x=E)}):r.doc.nodesBetween(h,p,(E,C)=>{C<h&&o&&o===E.type&&(u=!0,b=Math.max(C,h),S=Math.min(C+E.nodeSize,p),y=C,x=E),C>=h&&C<=p&&(o&&o===E.type&&(u=!0,s&&n.setNodeMarkup(C,void 0,{...E.attrs,...t})),l&&E.marks.length&&E.marks.forEach(R=>{if(l===R.type&&(u=!0,s)){const T=Math.max(C,h),O=Math.min(C+E.nodeSize,p);n.addMark(T,O,l.create({...R.attrs,...t}))}}))}),x&&(y!==void 0&&s&&n.setNodeMarkup(y,void 0,{...x.attrs,...t}),l&&x.marks.length&&x.marks.forEach(E=>{l===E.type&&s&&n.addMark(b,S,l.create({...E.attrs,...t}))}))}),u},Td=new Lo("__tiptap_decorations__"),tNe=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(Td,{type:"force",name:e}),!0),nNe=(e,t={})=>({state:n,dispatch:r})=>{const s=lr(e,n.schema);return yEe(s,t)(n,r)},rNe=(e,t={})=>({state:n,dispatch:r})=>{const s=lr(e,n.schema);return xEe(s,t)(n,r)};var sNe=awe({blur:()=>R2e,clearContent:()=>O2e,clearNodes:()=>A2e,command:()=>k2e,createParagraphNear:()=>_2e,cut:()=>M2e,deleteCurrentNode:()=>I2e,deleteNode:()=>L2e,deleteRange:()=>D2e,deleteSelection:()=>z2e,enter:()=>B2e,exitCode:()=>H2e,extendMarkRange:()=>F2e,first:()=>$2e,focus:()=>V2e,forEach:()=>q2e,insertContent:()=>G2e,insertContentAt:()=>K2e,insertDefaultBlock:()=>Y2e,joinBackward:()=>Q2e,joinDown:()=>X2e,joinForward:()=>Z2e,joinItemBackward:()=>J2e,joinItemForward:()=>eTe,joinTextblockBackward:()=>tTe,joinTextblockForward:()=>nTe,joinUp:()=>W2e,keyboardShortcut:()=>sTe,lift:()=>oTe,liftEmptyBlock:()=>iTe,liftListItem:()=>lTe,newlineInCode:()=>aTe,resetAttributes:()=>cTe,scrollIntoView:()=>uTe,selectAll:()=>dTe,selectNodeBackward:()=>fTe,selectNodeForward:()=>hTe,selectParentNode:()=>pTe,selectTextblockEnd:()=>mTe,selectTextblockStart:()=>gTe,setContent:()=>yTe,setMark:()=>jTe,setMeta:()=>PTe,setNode:()=>zTe,setNodeSelection:()=>BTe,setTextDirection:()=>HTe,setTextSelection:()=>FTe,sinkListItem:()=>$Te,splitBlock:()=>UTe,splitListItem:()=>VTe,toggleList:()=>GTe,toggleMark:()=>KTe,toggleNode:()=>YTe,toggleWrap:()=>WTe,undoInputRule:()=>XTe,unsetAllMarks:()=>QTe,unsetMark:()=>ZTe,unsetTextDirection:()=>JTe,updateAttributes:()=>eNe,updateDecorations:()=>tNe,wrapIn:()=>nNe,wrapInList:()=>rNe});const $h=new WeakMap;function oNe(e,t){var n;$h.set(e,((n=$h.get(e))!==null&&n!==void 0?n:0)+1);try{return t()}finally{var r;const s=((r=$h.get(e))!==null&&r!==void 0?r:1)-1;s>0?$h.set(e,s):$h.delete(e)}}var iNe=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(r=>r.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(r=>r!==t):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}};function lNe(e){return e.kind==="widget"}function M7(e,t){const n=[],r=new Set;for(const s of e)s.kind==="widget"&&lNe(s)&&r.add(s.key),n.push(s.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function aNe(e,t,n){const{decorations:r,widgetKeys:s}=M7(t,n);return{set:En.create(e,r),widgetKeys:s}}function I7({position:e,from:t,to:n,docSize:r}){return e<t?!1:e<n?!0:e===n&&n===r}function cNe({decorations:e,from:t,to:n,docSize:r,extensionName:s,warnedExtensions:o}){return e.filter(l=>I7({position:l.anchor,from:t,to:n,docSize:r})?!0:(l.anchor===n||o.has(s)||(o.add(s),console.warn(`[tiptap warn]: Extension "${s}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function uNe(e){var t;const n=(t=e.spec)===null||t===void 0?void 0:t.key;return typeof n=="string"?n:void 0}function L7(e){return e.jsonID==="attr"}function dNe(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||L7(e))return!0;const n=e;return typeof n.from=="number"&&typeof n.to=="number"}function fNe(e,t){let n=null,r=0,s=0;for(let o=0;o<e.childCount&&!(s>t.to);o+=1){const l=s+e.child(o).nodeSize;l>=t.from&&(n===null&&(n=s),r=l),s=l}return n===null?null:{from:n,to:r}}function hNe(e,t){if(e.steps.some(o=>!dNe(o)))return{type:"full"};const n=R7(e).map(({newRange:o})=>o);e.steps.forEach((o,l)=>{if(!L7(o))return;const c=e.mapping.slice(l);n.push({from:c.map(o.pos,-1),to:c.map(o.pos+1)})});const r=[];for(const o of n){const l=fNe(t,o);l&&r.push(l)}r.sort((o,l)=>o.from-l.from);const s=[];for(const o of r){const l=s[s.length-1];l&&o.from<=l.to?l.to=Math.max(l.to,o.to):s.push({...o})}return{type:"ranges",ranges:s}}function D7(e,t,n,r){return e.map(t,n,{onRemove:s=>{const o=s==null?void 0:s.key;typeof o=="string"&&r.delete(o)}})}function pNe(e,t,n){var r,s;const o=(r=t.decorationSetsByExtension[e])!==null&&r!==void 0?r:En.empty,l=new Set((s=t.widgetKeysByExtension[e])!==null&&s!==void 0?s:[]);return{set:D7(o,n.mapping,n.doc,l),widgetKeys:l}}function Yj(e,t){const n=Object.values(t).flatMap(r=>r.find());return En.create(e,n)}function Wj(e){const t=new Set;for(const n of Object.values(e))for(const r of n)t.add(r);return t}function mNe(e,t){var n;switch((n=t.update)!==null&&n!==void 0?n:"document"){case"document":if(t.createInRange)throw new Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!t.createInRange)throw new Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(t.createInRange)throw new Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw new Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function gNe(e,t,n){return n?!0:e.update==="manual"?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}const yNe=new Set;var xNe=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:t})=>{const n=Td.getState(t);n&&this.warnDuplicateWidgetKeys(n)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:t,spec:n})=>mNe(t,n)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var e,t;return(e=(t=Td.getState(this.editor.state))===null||t===void 0?void 0:t.widgetKeys)!==null&&e!==void 0?e:yNe}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){const t=[];for(const{name:n,addDecorations:r}of e){const s=r();s&&t.push({name:n,spec:s})}return t}createPlugin(){const{editor:e,entries:t}=this;return new Gs({key:Td,state:{init:(n,r)=>{const s={},o={};for(const{name:c,spec:u}of t){const{set:f,widgetKeys:h}=this.buildFullSet(c,u,r);s[c]=f,o[c]=h}const l={decorationSetsByExtension:s,widgetKeysByExtension:o,mergedDecorationSet:this.buildMergedSet(r.doc,s),widgetKeys:Wj(o)};return this.warnDuplicateWidgetKeys(l),l},apply:(n,r,s,o)=>{const l=n.getMeta(Td),c=(l==null?void 0:l.type)==="force"&&!l.name,u=(l==null?void 0:l.type)==="force"?l.name:void 0,f={},h={},p=new Set;return oNe(e,()=>{for(const{name:y,spec:x}of t){const b=c||u===y;if(gNe(x,{editor:e,tr:n,oldState:s,newState:o},b))if(x.update==="changedRanges"&&n.docChanged&&!b){const S=this.applyChangedRangesRecompute(y,x,r,n,o);f[y]=S.set,h[y]=S.widgetKeys,p.add(y)}else{const{set:S,widgetKeys:E}=this.buildFullSet(y,x,o);f[y]=S,h[y]=E,p.add(y)}else{const S=pNe(y,r,n);f[y]=S.set,h[y]=S.widgetKeys}}}),p.size===0&&!n.docChanged?r:{decorationSetsByExtension:f,widgetKeysByExtension:h,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:f,recomputedNames:p}),widgetKeys:Wj(h)}}},props:{decorations(n){var r,s;return(r=(s=Td.getState(n))===null||s===void 0?void 0:s.mergedDecorationSet)!==null&&r!==void 0?r:En.empty}}})}applyChangedRangesRecompute(e,t,n,r,s){const o=hNe(r,s.doc);return o.type==="full"?this.buildFullSet(e,t,s):this.rebuildRanges(e,t,n,r,s,o.ranges)}rebuildRanges(e,t,n,r,s,o){var l,c;const u=(l=n.decorationSetsByExtension[e])!==null&&l!==void 0?l:En.empty,f=new Set((c=n.widgetKeysByExtension[e])!==null&&c!==void 0?c:[]);let h=D7(u,r.mapping,r.doc,f);const p=s.doc.content.size;for(const{from:y,to:x}of o){const b=h.find(y,x).filter(C=>I7({position:C.from,from:y,to:x,docSize:p}));for(const C of b){const R=uNe(C);R&&f.delete(R)}h=h.remove(b);const{decorations:S,widgetKeys:E}=M7(cNe({decorations:this.runCreate(e,"createInRange",()=>t.createInRange({editor:this.editor,state:s,view:this.mountedView,from:y,to:x})),from:y,to:x,docSize:p,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);h=h.add(s.doc,S);for(const C of E)f.add(C)}return{set:h,widgetKeys:f}}buildFullSet(e,t,n){const r=this.runCreate(e,"create",()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return aNe(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(r){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,r),[]}}warnDuplicateWidgetKeys(e){}buildMergedSet(e,t){const n=Object.keys(t);return n.length===1?t[n[0]]:Yj(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:s}){return e.length===1?r[e[0].name]:s.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):Yj(n.doc,r)}};function bNe(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(s=>Object.prototype.hasOwnProperty.call(t,s)&&Object.is(e[s],t[s]))}function jke(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof nt){const o=r.index();return r.parent.canReplaceWith(o,o+1,t)}let s=r.depth;for(;s>=0;){const o=r.index(s);if(r.node(s).contentMatchAt(o).matchType(t))return!0;s-=1}return!1}function vNe(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const s=document.createElement("style");return t&&s.setAttribute("nonce",t),s.setAttribute("data-tiptap-style",""),s.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(s),s}const SNe={lt:"<",gt:">",quot:'"',amp:"&"};function Pke(e){return e.replace(/&(?:#(\d{1,7})|#[xX]([0-9a-fA-F]{1,6})|(lt|gt|quot|amp));/g,(t,n,r,s)=>n!==void 0?Xj(Number(n)):r!==void 0?Xj(parseInt(r,16)):SNe[s])}const wNe=new Map([[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function Xj(e){var t;return e===0||e>1114111||e>=55296&&e<=57343?"�":String.fromCodePoint((t=wNe.get(e))!==null&&t!==void 0?t:e)}function zke(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function ENe(e){return typeof e=="number"}function CNe(e){return Object.prototype.toString.call(e).slice(8,-1)}function ry(e){return CNe(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function Bke(e,t,n){const r=e.split(`
|
|
371
|
-
`),s=[];let o="",l=0;const c=t.baseIndentSize||2;for(;l<r.length;){const h=r[l],p=h.match(t.itemPattern);if(!p){if(s.length>0)break;if(h.trim()===""){l+=1,o=`${o}${h}
|
|
372
|
-
`;continue}else return}const y=t.extractItemData(p),{indentLevel:x,mainContent:b}=y;o=`${o}${h}
|
|
373
|
-
`;const S=[b];for(l+=1;l<r.length;){var u;const T=r[l];if(T.trim()===""){var f;const O=r.slice(l+1).findIndex(k=>k.trim()!=="");if(O===-1)break;if((((f=r[l+1+O].match(/^(\s*)/))===null||f===void 0||(f=f[1])===null||f===void 0?void 0:f.length)||0)>x){S.push(T),o=`${o}${T}
|
|
374
|
-
`,l+=1;continue}else break}if((((u=T.match(/^(\s*)/))===null||u===void 0||(u=u[1])===null||u===void 0?void 0:u.length)||0)>x)S.push(T),o=`${o}${T}
|
|
375
|
-
`,l+=1;else break}let E;const C=S.slice(1);if(C.length>0){const T=C.map(O=>O.slice(x+c)).join(`
|
|
376
|
-
`);T.trim()&&(t.customNestedParser?E=t.customNestedParser(T):E=n.blockTokens(T))}const R=t.createToken(y,E);s.push(R)}if(s.length!==0)return{items:s,raw:o}}const Qj=4;function Zj(e){let t=0;for(const n of e)t=n===" "?t+Qj-t%Qj:t+1;return t}function Hke(e,t,n,r,s){if(!e||!Array.isArray(e.content))return"";const o=typeof n=="function"?n(r):n,[l,...c]=e.content;let u=`${o}${t.renderChildren([l])}`;return c&&c.length>0&&c.forEach((f,h)=>{var p,y;const x=(p=(y=t.renderChild)===null||y===void 0?void 0:y.call(t,f,h+1))!==null&&p!==void 0?p:t.renderChildren([f]);if(x!=null){const b=E=>{if(!(s!=null&&s.alignNestedToPrefix))return t.indent(E);const C=t.indent(""),R=Zj(o);return(Zj(C)>=R?C:" ".repeat(R))+E},S=x.split(`
|
|
377
|
-
`).map(E=>b(E||"")).join(`
|
|
378
|
-
`);u+=f.type==="paragraph"?`
|
|
379
|
-
|
|
380
|
-
${S}`:`
|
|
381
|
-
${S}`}}),u}function Jj(e){return typeof e.type=="string"?e.type:e.type.name}function Fke(e,t){if(e.length!==t.length)return!1;const n=Array.from({length:t.length},()=>!1);return e.every(r=>{const s=Jj(r),o=t.findIndex((l,c)=>!n[c]&&s===Jj(l)&&bNe(r.attrs,l.attrs));return o===-1?!1:(n[o]=!0,!0)})}function j7(e,t){const n={...e};return ry(e)&&ry(t)&&Object.keys(t).forEach(r=>{ry(t[r])&&ry(e[r])?n[r]=j7(e[r],t[r]):n[r]=t[r]}),n}function TNe(e,t,n={}){const{state:r}=t,{doc:s,tr:o}=r,l=e;s.descendants((c,u)=>{const f=o.mapping.map(u),h=o.mapping.map(u)+c.nodeSize;let p=null;if(c.marks.forEach(x=>{if(x!==l)return!1;p=x}),!p)return;let y=!1;if(Object.keys(n).forEach(x=>{n[x]!==p.attrs[x]&&(y=!0)}),y){const x=e.type.create({...e.attrs,...n});o.removeMark(f,h,e.type),o.addMark(f,h,x)}}),o.docChanged&&t.view.dispatch(o)}var Gb=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!==null&&t!==void 0?t:!0}};const NNe=(e,t)=>{if(LN(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function RNe(e){const{editor:t,from:n,to:r,text:s,insertText:o}=e;if(!o)return{inputTransaction:null,tr:t.view.state.tr};const l=t.view.state.tr.insertText(s,n,r);return{inputTransaction:l,tr:Ki.create({doc:l.doc,selection:l.selection,storedMarks:l.storedMarks}).tr}}function ONe(e){const{editor:t,from:n,to:r,text:s,rule:o,match:l,plugin:c,insertText:u}=e,{view:f}=t,{inputTransaction:h,tr:p}=RNe({editor:t,from:n,to:r,text:s,insertText:u}),y=h?n+s.length:r,x=Ub({state:f.state,transaction:p}),b={from:n-(l[0].length-s.length),to:y},{commands:S,chain:E,can:C}=new Ud({editor:t,state:x});return o.handler({state:x,range:b,match:l,commands:S,chain:E,can:C})===null||!p.steps.length?!1:(h&&(f.dispatch(h),!f.state.doc.eq(h.doc))||(C2e(p),p.setMeta("inputRule",!0),o.undoable&&p.setMeta(c,{transform:p,from:n,to:y,text:s}),f.dispatch(p)),!0)}function ANe(e,t,n){const r=t[0].length-n.length;if(r<=0)return!0;const s=e.parentOffset-r;return s>=0&&e.parent.textBetween(s,e.parentOffset)===t[0].slice(0,r)}function sy(e){var t;const{editor:n,from:r,to:s,text:o,rules:l,plugin:c,insertText:u}=e,{view:f}=n;if(f.composing)return!1;const h=f.state.doc.resolve(r);if(h.parent.type.spec.code||!((t=h.nodeBefore||h.nodeAfter)===null||t===void 0)&&t.marks.find(y=>y.type.spec.code))return!1;const p=_Te(h)+o;for(const y of l){const x=NNe(p,y.find);if(!(!x||!ANe(h,x,o))&&ONe({editor:n,from:r,to:s,text:o,rule:y,match:x,plugin:c,insertText:u}))return!0}return!1}function kNe(e){const{editor:t,rules:n}=e,r=new Gs({state:{init(){return null},apply(s,o,l){const c=s.getMeta(r);if(c)return c;const u=s.getMeta("applyInputRules");return u&&setTimeout(()=>{let{text:f}=u;typeof f=="string"?f=f:f=PN(Ie.from(f),l.schema);const{from:h}=u,p=h+f.length;sy({editor:t,from:h,to:p,text:f,rules:n,plugin:r})}),s.selectionSet||s.docChanged?null:o}},props:{handleTextInput(s,o,l,c){return sy({editor:t,from:o,to:l,text:c,rules:n,plugin:r,insertText:!0})},handleDOMEvents:{compositionend:s=>(setTimeout(()=>{const{$cursor:o}=s.state.selection;o&&sy({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(s,o){if(o.key!=="Enter")return!1;const{$cursor:l}=s.state.selection;return l?sy({editor:t,from:l.pos,to:l.pos,text:`
|
|
382
|
-
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var HN=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Kt(We(this,"addOptions",{name:this.name}))}}get storage(){return{...Kt(We(this,"addStorage",{name:this.name,options:this.options}))}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>j7(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},_Ne=class P7 extends HN{constructor(...t){super(...t),this.type="mark"}static create(t={}){const n=typeof t=="function"?t():t;return new P7(n)}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,s=t.state.selection.$from;if(s.pos===s.end()){const o=s.marks();if(!o.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=o.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",s.pos),t.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},MNe=class{constructor(e){this.find=e.find,this.handler=e.handler}};const INe=(e,t,n)=>{if(LN(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(s=>{const o=[s.text];return o.index=s.index,o.input=e,o.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(s.replaceWith)),o}):[]};function LNe(e){const{editor:t,state:n,from:r,to:s,rule:o,pasteEvent:l,dropEvent:c}=e,{commands:u,chain:f,can:h}=new Ud({editor:t,state:n}),p=[];return n.doc.nodesBetween(r,s,(y,x)=>{var b,S,E,C;if(!((b=y.type)===null||b===void 0||(b=b.spec)===null||b===void 0)&&b.code||!(y.isText||y.isTextblock||y.isInline))return;const R=(S=(E=(C=y.content)===null||C===void 0?void 0:C.size)!==null&&E!==void 0?E:y.nodeSize)!==null&&S!==void 0?S:0,T=Math.max(r,x),O=Math.min(s,x+R);if(T>=O)return;const k=y.isText?y.text||"":y.textBetween(T-x,O-x,void 0,"");INe(k,o.find,l).forEach(M=>{if(M.index===void 0)return;const A=T+M.index+1,L=A+M[0].length,I={from:n.tr.mapping.map(A),to:n.tr.mapping.map(L)},j=o.handler({state:n,range:I,match:M,commands:u,chain:f,can:h,pasteEvent:l,dropEvent:c});p.push(j)})}),p.every(y=>y!==null)}let vd=null;const DNe=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function jNe(e){const{editor:t,rules:n}=e;let r=null,s=!1,o=!1,l=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,c;try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}const u=({state:f,from:h,to:p,rule:y,pasteEvt:x})=>{const b=f.tr,S=Ub({state:f,transaction:b});if(!(!LNe({editor:t,state:S,from:Math.max(h-1,0),to:p.b-1,rule:y,pasteEvent:x,dropEvent:c})||!b.steps.length)){try{c=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{c=null}return l=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,b}};return t.on("destroy",()=>{vd===t&&(vd=null)}),n.map(f=>new Gs({view(h){const p=x=>{var b;r=!((b=h.dom.parentElement)===null||b===void 0)&&b.contains(x.target)?h.dom.parentElement:null,r&&(vd=t)},y=()=>{vd&&(vd=null)};return window.addEventListener("dragstart",p),window.addEventListener("dragend",y),{destroy(){window.removeEventListener("dragstart",p),window.removeEventListener("dragend",y)}}},props:{handleDOMEvents:{drop:(h,p)=>{if(o=r===h.dom.parentElement,c=p,!o){const y=vd;y!=null&&y.isEditable&&setTimeout(()=>{if(y.isDestroyed)return;const x=y.state.selection;x&&y.commands.deleteRange({from:x.from,to:x.to})},10)}return!1},paste:(h,p)=>{var y;const x=(y=p.clipboardData)===null||y===void 0?void 0:y.getData("text/html");return l=p,s=!!(x!=null&&x.includes("data-pm-slice")),!1}}},appendTransaction:(h,p,y)=>{const x=h[0],b=x.getMeta("uiEvent")==="paste"&&!s,S=x.getMeta("uiEvent")==="drop"&&!o,E=x.getMeta("applyPasteRules"),C=!!E;if(!b&&!S&&!C)return;if(C){let{text:O}=E;typeof O=="string"?O=O:O=PN(Ie.from(O),y.schema);const{from:k}=E,M=k+O.length,A=DNe(O);return u({rule:f,state:y,from:k,to:{b:M},pasteEvt:A})}const R=p.doc.content.findDiffStart(y.doc.content),T=p.doc.content.findDiffEnd(y.doc.content);if(!(!ENe(R)||!T||R===T.b))return u({rule:f,state:y,from:R,to:T,pasteEvt:l})}}))}var Kb=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=zN(e),this.schema=C7(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n=We(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:bd(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){const{editor:e}=this,t=gp([...this.extensions].reverse()).flatMap(r=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:bd(r.name,this.schema)},o=[],l=We(r,"addKeyboardShortcuts",s);let c={};if(r.type==="mark"&&We(r,"exitable",s)&&(c.ArrowRight=()=>_Ne.handleExit({editor:e,mark:r})),l){const y=Object.fromEntries(Object.entries(l()).map(([x,b])=>[x,()=>b({editor:e})]));c={...c,...y}}const u=m2e(c);o.push(u);const f=We(r,"addInputRules",s);if(qj(r,e.options.enableInputRules)&&f){const y=f();if(y&&y.length){const x=kNe({editor:e,rules:y}),b=Array.isArray(x)?x:[x];o.push(...b)}}const h=We(r,"addPasteRules",s);if(qj(r,e.options.enablePasteRules)&&h){const y=h();if(y&&y.length){const x=jNe({editor:e,rules:y});o.push(...x)}}const p=We(r,"addProseMirrorPlugins",s);if(p){const y=p();o.push(...y)}return o}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;const{editor:t}=this;(e=this.decorationManager)===null||e===void 0||e.destroy();const n=[];return this.extensions.forEach(r=>{const s=We(r,"addDecorations",{name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:bd(r.name,this.schema)});s&&n.push({name:r.name,addDecorations:s})}),this.decorationManager=new xNe({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){return E7(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Cf(this.extensions);return Object.fromEntries(t.filter(n=>!!We(n,"addNodeView")).map(n=>{const r=this.attributes.filter(c=>c.type===n.name),s=We(n,"addNodeView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:lr(n.name,this.schema)});if(!s)return[];const o=s();if(!o)return[];const l=(c,u,f,h,p)=>{const y=kx(c,r);return o({node:c,view:u,getPos:f,decorations:h,innerDecorations:p,editor:e,extension:n,HTMLAttributes:y})};return[n.name,l]}))}dispatchTransaction(e){const{editor:t}=this;return gp([...this.extensions].reverse()).reduceRight((n,r)=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:bd(r.name,this.schema)},o=We(r,"dispatchTransaction",s);return o?l=>{o.call(s,{transaction:l,next:n})}:n},e)}transformPastedHTML(e){const{editor:t}=this;return gp([...this.extensions]).reduce((n,r)=>{const s={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:bd(r.name,this.schema)},o=We(r,"transformPastedHTML",s);return o?(l,c)=>{const u=n(l,c);return o.call(s,u)}:n},e||(n=>n))}get markViews(){const{editor:e}=this,{markExtensions:t}=Cf(this.extensions);return Object.fromEntries(t.filter(n=>!!We(n,"addMarkView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),s=We(n,"addMarkView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:vl(n.name,this.schema)});if(!s)return[];const o=(l,c,u)=>{const f=kx(l,r);return s()({mark:l,view:c,inline:u,editor:e,extension:n,HTMLAttributes:f,updateAttributes:h=>{TNe(l,e,h)}})};return[n.name,o]}))}destroy(){var e;(e=this.decorationManager)===null||e===void 0||e.destroy(),this.extensions.forEach(t=>{let n=t;for(;n.parent;){const r=n.parent;r.child===n&&(r.child=null),n=r}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:bd(t.name,this.schema)};if(t.type==="mark"){var r,s;(!((r=Kt(We(t,"keepOnSplit",n)))!==null&&r!==void 0)||r)&&this.splittableMarks.push(t.name),!((s=Kt(We(t,"clearable",n)))!==null&&s!==void 0)||s||this.nonClearableMarks.push(t.name)}const o=We(t,"onBeforeCreate",n),l=We(t,"onCreate",n),c=We(t,"onUpdate",n),u=We(t,"onSelectionUpdate",n),f=We(t,"onTransaction",n),h=We(t,"onFocus",n),p=We(t,"onBlur",n),y=We(t,"onDestroy",n);o&&this.editor.on("beforeCreate",o),l&&this.editor.on("create",l),c&&this.editor.on("update",c),u&&this.editor.on("selectionUpdate",u),f&&this.editor.on("transaction",f),h&&this.editor.on("focus",h),p&&this.editor.on("blur",p),y&&this.editor.on("destroy",y)})}};Kb.resolve=zN;Kb.sort=gp;Kb.flatten=jN;var pi=class z7 extends HN{constructor(...t){super(...t),this.type="extension"}static create(t={}){const n=typeof t=="function"?t():t;return new z7(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};const PNe=pi.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Gs({key:new Lo("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:s}=t,o=N7(n),{blockSeparator:l}=this.options,c={...l!==void 0?{blockSeparator:l}:{},textSerializers:o};return[...s.ranges].sort((u,f)=>u.$from.pos-f.$from.pos).map(({$from:u,$to:f})=>T7(r,{from:u.pos,to:f.pos},c)).join(l??`
|
|
383
|
-
|
|
384
|
-
`)}}})]}}),zNe=pi.create({name:"commands",addCommands(){return{...sNe}}}),BNe=pi.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r;const s=()=>{var o,l,c;if((o=(l=this.editor.options.coreExtensionOptions)===null||l===void 0||(l=l.delete)===null||l===void 0||(c=l.filterTransaction)===null||c===void 0?void 0:c.call(l,e))!==null&&o!==void 0?o:e.getMeta("y-sync$"))return;const u=xTe(e.before,[e,...t]);R7(u).forEach(h=>{u.mapping.mapResult(h.oldRange.from).deletedAfter&&u.mapping.mapResult(h.oldRange.to).deletedBefore&&u.before.nodesBetween(h.oldRange.from,h.oldRange.to,(p,y)=>{const x=y+p.nodeSize-2,b=h.oldRange.from<=y&&x<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:y,to:x,newFrom:u.mapping.map(y),newTo:u.mapping.map(x),deletedRange:h.oldRange,newRange:h.newRange,partial:!b,editor:this.editor,transaction:e,combinedTransform:u})})});const f=u.mapping;u.steps.forEach((h,p)=>{if(h instanceof Ro){var y,x;const b=f.slice(p).map(h.from,-1),S=f.slice(p).map(h.to),E=f.invert().map(b,-1),C=f.invert().map(S),R=b>0?(y=u.doc.nodeAt(b-1))===null||y===void 0?void 0:y.marks.some(O=>O.eq(h.mark)):!1,T=(x=u.doc.nodeAt(S))===null||x===void 0?void 0:x.marks.some(O=>O.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:E,to:C},newRange:{from:b,to:S},partial:!!(T||R),editor:this.editor,transaction:e,combinedTransform:u})}})};!((n=(r=this.editor.options.coreExtensionOptions)===null||r===void 0||(r=r.delete)===null||r===void 0?void 0:r.async)!==null&&n!==void 0)||n?setTimeout(s,0):s()}}),HNe=pi.create({name:"drop",addProseMirrorPlugins(){return[new Gs({key:new Lo("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),FNe=pi.create({name:"editable",addProseMirrorPlugins(){return[new Gs({key:new Lo("editable"),props:{editable:()=>this.editor.options.editable}})]}}),$Ne=new Lo("focusEvents"),UNe=pi.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Gs({key:$Ne,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),VNe=pi.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:l})=>[()=>l.undoInputRule(),()=>l.command(({tr:c})=>{const{selection:u,doc:f}=c,{empty:h,$anchor:p}=u,{pos:y,parent:x}=p,b=p.parent.isTextblock&&y>0?c.doc.resolve(y-1):p,S=b.parent.type.spec.isolating,E=p.pos-p.parentOffset,C=S&&b.parent.childCount===1?E===p.pos:Rt.atStart(f).from===y;return!h||!x.type.isTextblock||x.textContent.length||!C||C&&p.parent.type.name==="paragraph"?!1:l.clearNodes()}),()=>l.deleteSelection(),()=>l.joinBackward(),()=>l.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:l})=>[()=>l.deleteSelection(),()=>l.deleteCurrentNode(),()=>l.joinForward(),()=>l.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:l})=>[()=>l.newlineInCode(),()=>l.createParagraphNear(),()=>l.liftEmptyBlock(),()=>l.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},s={...r},o={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Jp()||S7()?o:s},addProseMirrorPlugins(){return[new Gs({key:new Lo("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(x=>x.getMeta("composition")))return;const r=e.some(x=>x.docChanged)&&!t.doc.eq(n.doc),s=e.some(x=>x.getMeta("preventClearDocument"));if(!r||s)return;const{empty:o,from:l,to:c}=t.selection,u=Rt.atStart(t.doc).from,f=Rt.atEnd(t.doc).to;if(o||!(l===u&&c===f)||!BN(n.doc))return;const h=n.tr,p=Ub({state:n,transaction:h}),{commands:y}=new Ud({editor:this.editor,state:p});if(y.clearNodes(),!!h.steps.length)return h}})]}}),qNe=pi.create({name:"paste",addProseMirrorPlugins(){return[new Gs({key:new Lo("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),GNe=pi.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new Gs({key:new Lo("tabindex"),props:{attributes:()=>{var e;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(e=this.options.value)!==null&&e!==void 0?e:"0"}}}})]}}),KNe=pi.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=Cf(this.extensions);return[{types:e.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const n=t.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new Gs({key:new Lo("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}});let eP=!1;function YNe(e){if(eP)return;eP=!0;let t;try{t=_n.fromJSON(e,{from:0,to:0}).slice.content}catch{return}t instanceof Ie||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}var WNe=class np{get name(){return this.node.type.name}constructor(t,n,r=!1,s=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=s}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!==null&&t!==void 0?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new np(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new np(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new np(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const s=n.isBlock&&!n.isTextblock,o=n.isAtom&&!n.isText,l=n.isInline,c=this.pos+r+(o?0:1);if(c<0||c>this.resolvedPos.doc.nodeSize-2)return;const u=this.resolvedPos.doc.resolve(c);if(!s&&!l&&u.depth<=this.depth)return;const f=new np(u,this.editor,s,s||l?n:null);s&&(f.actualDepth=this.depth+1),t.push(f)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,s=this.parent;for(;s&&!r;){if(s.node.type.name===t)if(Object.keys(n).length>0){const o=s.node.attrs,l=Object.keys(n);for(let c=0;c<l.length;c+=1){const u=l[c];if(o[u]!==n[u])break}}else r=s;s=s.parent}return r}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},r=!1){let s=[];if(!this.children||this.children.length===0)return s;const o=Object.keys(n);return this.children.forEach(l=>{r&&s.length>0||(l.node.type.name===t&&o.every(c=>n[c]===l.node.attrs[c])&&s.push(l),!(r&&s.length>0)&&(s=s.concat(l.querySelectorAll(t,n,r))))}),s}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}};const XNe=`.ProseMirror {
|
|
385
|
-
position: relative;
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
.ProseMirror {
|
|
389
|
-
word-wrap: break-word;
|
|
390
|
-
white-space: pre-wrap;
|
|
391
|
-
white-space: break-spaces;
|
|
392
|
-
-webkit-font-variant-ligatures: none;
|
|
393
|
-
font-variant-ligatures: none;
|
|
394
|
-
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
.ProseMirror [contenteditable="false"] {
|
|
398
|
-
white-space: normal;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
|
|
402
|
-
white-space: pre-wrap;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
.ProseMirror pre {
|
|
406
|
-
white-space: pre-wrap;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
img.ProseMirror-separator {
|
|
410
|
-
display: inline !important;
|
|
411
|
-
border: none !important;
|
|
412
|
-
margin: 0 !important;
|
|
413
|
-
width: 0 !important;
|
|
414
|
-
height: 0 !important;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
.ProseMirror-gapcursor {
|
|
418
|
-
display: none;
|
|
419
|
-
pointer-events: none;
|
|
420
|
-
position: absolute;
|
|
421
|
-
margin: 0;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
.ProseMirror-gapcursor:after {
|
|
425
|
-
content: "";
|
|
426
|
-
display: block;
|
|
427
|
-
position: absolute;
|
|
428
|
-
top: -2px;
|
|
429
|
-
width: 20px;
|
|
430
|
-
border-top: 1px solid black;
|
|
431
|
-
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
@keyframes ProseMirror-cursor-blink {
|
|
435
|
-
to {
|
|
436
|
-
visibility: hidden;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
.ProseMirror-hideselection *::selection {
|
|
441
|
-
background: transparent;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
.ProseMirror-hideselection *::-moz-selection {
|
|
445
|
-
background: transparent;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
.ProseMirror-hideselection * {
|
|
449
|
-
caret-color: transparent;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
453
|
-
display: block;
|
|
454
|
-
}`;var $ke=class extends iNe{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:ITe,createMappablePosition:LTe},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:r,moved:s})=>this.options.onDrop(n,r,s)),this.on("paste",({event:n,slice:r})=>this.options.onPaste(n,r)),this.on("delete",this.options.onDelete);const t=this.createDoc();if(!this.editorState){const n=UC(t,this.options.autofocus);this.editorState=Ki.create({doc:t,schema:this.schema,selection:n||void 0})}YNe(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;const e=this.editorView.dom;e!=null&&e.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():Ud.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Ud.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=vNe(XNe,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=GC(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(s=>{const o=typeof s=="string"?`${s}$`:s.key;n=n.filter(l=>!l.key.startsWith(o))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;const n=[...this.options.enableCoreExtensions?[FNe,PNe.configure({blockSeparator:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.clipboardTextSerializer)===null||e===void 0?void 0:e.blockSeparator}),zNe,UNe,VNe,GNe.configure({value:(t=this.options.coreExtensionOptions)===null||t===void 0||(t=t.tabindex)===null||t===void 0?void 0:t.value}),HNe,qNe,BNe,KNe.configure({direction:this.options.textDirection})].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new Kb(n,this)}createCommandManager(){this.commandManager=new Ud({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=qC(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;const n=qC(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=Ki.create({doc:n,schema:this.schema,selection:UC(n,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(r=>r.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return e}getEditorViewAttributes(){var e;const t=(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes;return GC(t)?n=>({role:"textbox",...t(n)}):{role:"textbox",...t}}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),s=n?this.extensionManager.dispatchTransaction(r):r,o=t.transformPastedHTML,l=this.extensionManager.transformPastedHTML(o);this.editorView=new a7(e,{...t,attributes:this.getEditorViewAttributes(),dispatchTransaction:s,transformPastedHTML:l,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const c=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(c),this.prependClass(),this.injectCSS();const u=this.view.dom;u.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(f=>{var h;return(h=this.capturedTransaction)===null||h===void 0?void 0:h.step(f)});return}const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),s=n.includes(e),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!s)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const l=n.findLast(f=>f.getMeta("focus")||f.getMeta("blur")),c=l==null?void 0:l.getMeta("focus"),u=l==null?void 0:l.getMeta("blur");c&&this.emit("focus",{editor:this,event:c.event,transaction:l}),u&&this.emit("blur",{editor:this,event:u.event,transaction:l}),!(e.getMeta("preventUpdate")||!n.some(f=>f.docChanged)||o.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return OTe(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return MTe(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return PN(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
|
|
455
|
-
|
|
456
|
-
`,textSerializers:n={}}=e||{};return NTe(this.state.doc,{blockSeparator:t,textSerializers:{...N7(this.schema),...n}})}get isEmpty(){return BN(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return(e=(t=this.editorView)===null||t===void 0?void 0:t.isDestroyed)!==null&&e!==void 0?e:!0}$node(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new WNe(t,this,!1,n)}get $doc(){return this.$pos(0)}};function Uke(e){return new Gb({find:e.find,handler:({state:t,range:n,match:r})=>{const s=Kt(e.getAttributes,void 0,r);if(s===!1||s===null)return null;const{tr:o}=t,l=r[r.length-1],c=r[0];if(l){const u=c.search(/\S/),f=n.from+c.indexOf(l),h=f+l.length;if(O7(n.from,n.to,t.doc).filter(y=>y.mark.type.excluded.find(x=>x===e.type&&x!==y.mark.type)).filter(y=>y.to>f).length)return null;h<n.to&&o.delete(h,n.to),f>n.from&&o.delete(n.from+u,f);const p=n.from+u+l.length;o.addMark(n.from+u,p,e.type.create(s||{})),o.removeStoredMark(e.type)}},undoable:e.undoable})}function Vke(e){return new Gb({find:e.find,handler:({state:t,range:n,match:r})=>{const s=Kt(e.getAttributes,void 0,r)||{},{tr:o}=t,l=n.from;let c=n.to;const u=e.type.create(s);if(r[1]){let f=l+r[0].lastIndexOf(r[1]);f>c?f=c:c=f+r[1].length;const h=r[0][r[0].length-1];o.insertText(h,l+r[0].length-1),o.replaceWith(f,c,u)}else if(r[0]){const f=e.type.isInline?l:l-1;o.insert(f,e.type.create(s)).delete(o.mapping.map(l),o.mapping.map(c))}o.scrollIntoView()},undoable:e.undoable})}function qke(e){return new Gb({find:e.find,handler:({state:t,range:n,match:r})=>{const s=t.doc.resolve(n.from),o=Kt(e.getAttributes,void 0,r)||{};if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,o)},undoable:e.undoable})}function Gke(e){return new Gb({find:e.find,handler:({state:t,range:n,match:r,chain:s})=>{const o=Kt(e.getAttributes,void 0,r)||{},l=t.tr.delete(n.from,n.to),c=l.doc.resolve(n.from).blockRange(),u=c&&bN(c,e.type,o);if(!u)return null;if(l.wrap(c,u),e.keepMarks&&e.editor){const{selection:h,storedMarks:p}=t,{splittableMarks:y}=e.editor.extensionManager,x=p||h.$to.parentOffset&&h.$from.marks();if(x){const b=x.filter(S=>y.includes(S.type.name));l.ensureMarks(b)}}if(e.keepAttributes){const h=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";s().updateAttributes(h,o).run()}const f=l.doc.resolve(n.from-1).nodeBefore;f&&f.type===e.type&&Za(l.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,f))&&l.join(n.from-1)},undoable:e.undoable})}var QNe=class B7 extends HN{constructor(...t){super(...t),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new B7(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},Kke=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=()=>{try{return t.getPos()}catch{return}},this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n;const{view:r}=this.editor,s=e.target,o=s.nodeType===3?(t=s.parentElement)===null||t===void 0?void 0:t.closest("[data-drag-handle]"):s.closest("[data-drag-handle]");if(!this.dom||!((n=this.contentDOM)===null||n===void 0)&&n.contains(s)||!o)return;let l=0,c=0;if(this.dom!==o){var u,f,h,p;const R=this.dom.getBoundingClientRect(),T=o.getBoundingClientRect(),O=(u=e.offsetX)!==null&&u!==void 0?u:(f=e.nativeEvent)===null||f===void 0?void 0:f.offsetX,k=(h=e.offsetY)!==null&&h!==void 0?h:(p=e.nativeEvent)===null||p===void 0?void 0:p.offsetY;l=T.x-R.x+O,c=T.y-R.y+k}const y=this.dom.cloneNode(!0);try{const R=this.dom.getBoundingClientRect();y.style.width=`${Math.round(R.width)}px`,y.style.height=`${Math.round(R.height)}px`,y.style.boxSizing="border-box",y.style.pointerEvents="none"}catch{}let x=null;try{var b;x=document.createElement("div"),x.style.position="absolute",x.style.top="-9999px",x.style.left="-9999px",x.style.pointerEvents="none",x.appendChild(y),document.body.appendChild(x),(b=e.dataTransfer)===null||b===void 0||b.setDragImage(y,l,c)}finally{x&&setTimeout(()=>{try{x==null||x.remove()}catch{}},0)}const S=this.getPos();if(typeof S!="number")return;const E=nt.create(r.state.doc,S),C=r.state.tr.setSelection(E);r.dispatch(C)}stopEvent(e){var t;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(!((t=this.contentDOM)===null||t===void 0)&&t.contains(n))))return!1;const r=e.type.startsWith("drag"),s=e.type==="dragover"||e.type==="dragenter",o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!r)return!0;const{isEditable:l}=this.editor,{isDragging:c}=this,u=!!this.node.type.spec.draggable,f=nt.isSelectable(this.node),h=e.type==="copy",p=e.type==="paste",y=e.type==="cut",x=e.type==="mousedown";if(!u&&f&&r&&e.target===this.dom&&e.preventDefault(),u&&r&&!c&&e.target===this.dom)return e.preventDefault(),!1;if(u&&l&&!c&&x){const b=n.closest("[data-drag-handle]");b&&(this.dom===b||this.dom.contains(b))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||s||o||h||p||y||x&&f)}ignoreMutation(e){return this.dom?this.contentDOM?typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.contentDOM.contains(e.target)&&e.type==="childList"&&(Jp()||VC())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(t=>t.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target):e.type!=="selection":!0}updateAttributes(e){this.editor.commands.command(({tr:t})=>{const n=this.getPos();return typeof n!="number"?!1:(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function Yke(e){return new MNe({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:s})=>{const o=Kt(e.getAttributes,void 0,r,s);if(o===!1||o===null)return null;const{tr:l}=t,c=r[r.length-1],u=r[0];let f=n.to;if(c){const h=u.search(/\S/),p=n.from+u.indexOf(c),y=p+c.length;if(O7(n.from,n.to,t.doc).filter(x=>x.mark.type.excluded.find(b=>b===e.type&&b!==x.mark.type)).filter(x=>x.to>p).length)return null;y<n.to&&l.delete(y,n.to),p>n.from&&l.delete(n.from+h,p),f=n.from+h+c.length,l.addMark(n.from+h,f,e.type.create(o||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||l.removeStoredMark(e.type)}}})}const oy="codeLink",Mw="data-code-link",tP="data-code",ZNe=/^\[(`?)([^\]`\n]+)\1\]\(code:([^)\s]+)\)/,JNe=/\[[^\]\n]*\]\(code:/,eRe="rounded-sm border border-border bg-muted px-1.5 py-0.5 text-[0.875em] data-code:font-mono",tRe=/^[^\]`\n]+$/,nRe=/^[^)\s]+$/,rRe="#",sRe=({lineStart:e,lineEnd:t})=>e===t?`L${String(e)}`:`L${String(e)}-${String(t)}`,oRe=({path:e,range:t,label:n,isCode:r})=>{const s=n.trim();return tRe.test(s)&&nRe.test(e)?{linkId:`${e}${rRe}${sRe(t)}`,label:s,isCode:r}:null},nP=e=>typeof e=="string"?e:"",Iw=e=>({linkId:nP(e==null?void 0:e.linkId),label:nP(e==null?void 0:e.label),isCode:(e==null?void 0:e.isCode)===!0}),iRe=({linkId:e,label:t,isCode:n})=>`[${n?`\`${t}\``:t}](code:${e})`,lRe=e=>{const t=ZNe.exec(e);return t===null?null:{raw:t[0],isCode:t[1]!=="",label:t[2],linkId:t[3]}},Wke=QNe.create({name:oy,group:"inline",inline:!0,atom:!0,selectable:!0,addAttributes:()=>({linkId:{default:""},label:{default:""},isCode:{default:!1}}),parseHTML:()=>[{tag:`span[${Mw}]`,getAttrs:e=>({linkId:e.getAttribute(Mw)??"",label:e.textContent,isCode:e.hasAttribute(tP)})}],renderHTML:({node:e})=>{const{linkId:t,label:n,isCode:r}=Iw(e.attrs);return["span",{[Mw]:t,...r?{[tP]:""}:{},class:eRe,title:t},n]},markdownTokenizer:{name:oy,level:"inline",start:e=>e.search(JNe),tokenize:e=>{const t=lRe(e);return t===null?void 0:{type:oy,...t}}},parseMarkdown:e=>({type:oy,attrs:Iw(e)}),renderMarkdown:e=>iRe(Iw(e.attrs))}),aRe="Link to code",cRe="Pick a file of the Flight Plan, select the lines the link points at, and name the link.",uRe="File",dRe="Search the files of the Flight Plan",fRe="Link these lines",hRe="Select the lines in the code: click a line number, then another with Shift.",pRe="Label",mRe="Show the label as code",gRe="Write a label without a backtick or a closing square bracket.",Uh=({reviewKey:e,selectedText:t,onInsert:n,onClose:r})=>{const s=N.useId(),o=mN(e,"flight-plan"),[l,c]=N.useState(null),[u,f]=N.useState(null),[h,p]=N.useState(t),[y,x]=N.useState(!1),b=kF(e,l),S=l===null||u===null?null:oRe({path:l,range:u,label:h,isCode:y}),E=l!==null&&u!==null&&h.trim()!==""&&S===null,C=R=>{c(R),f(null),o.onQueryChange(R)};return g.jsx(pl,{open:!0,onOpenChange:R=>{R||r()},children:g.jsxs(ml,{className:"h-[calc(100dvh-4rem)] grid-rows-[auto_auto_minmax(0,1fr)_auto_auto] sm:max-w-[min(90rem,calc(100vw-4rem))]",children:[g.jsxs(gl,{children:[g.jsx(xl,{children:aRe}),g.jsx(bl,{children:cRe})]}),g.jsx(gN,{label:uRe,hint:null,placeholder:dRe,query:o.query,files:o.files,message:o.message,errorMessage:o.errorMessage,onQueryChange:o.onQueryChange,onSelect:C}),l===null?g.jsx("span",{}):g.jsxs("div",{className:"flex min-h-0 flex-col gap-2",children:[g.jsx(MF,{path:l,lines:b.lines,statusMessage:b.statusMessage,waypoints:[],waypointOptions:"always-off",highlightButtonLabel:fRe,focusOn:u,className:"flex-1",onHighlightCode:f}),g.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:u===null?hRe:Vp(u)})]}),g.jsxs("div",{className:"grid gap-1.5",children:[g.jsx("label",{htmlFor:s,className:"text-sm font-bold",children:pRe}),g.jsx(zm,{id:s,value:h,"aria-invalid":E,onChange:R=>{p(R.target.value)}}),E?g.jsx("p",{role:"alert",className:"text-sm text-destructive",children:gRe}):null,g.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[g.jsx("input",{type:"checkbox",checked:y,className:"size-4 accent-(--primary)",onChange:R=>{x(R.target.checked)}}),mRe]})]}),g.jsxs(yl,{children:[g.jsx(st,{type:"button",variant:"ghost",onClick:r,children:"Cancel"}),g.jsx(st,{type:"button",disabled:S===null,onClick:()=>{S!==null&&n(S)},children:"Insert"})]})]})})},yRe=({choice:e,isPending:t,onComplete:n,onClose:r})=>{const s=N.useId(),[o,l]=N.useState(e.selectedId);return g.jsx(pl,{open:!0,onOpenChange:c=>{c||r()},children:g.jsxs(ml,{className:"sm:max-w-xl",children:[g.jsxs(gl,{children:[g.jsx(xl,{children:e.title}),g.jsx(bl,{children:e.description})]}),e.emptyMessage===null?g.jsxs("fieldset",{children:[g.jsx("legend",{className:"sr-only",children:e.title}),g.jsx("ul",{className:"max-h-[60dvh] overflow-y-auto border-t border-border",children:e.options.map(c=>g.jsxs("li",{className:"border-b border-border py-3",children:[g.jsxs("label",{className:"flex cursor-pointer items-start gap-3 text-base",children:[g.jsx("input",{type:"radio",name:s,checked:o===c.id,className:"mt-1 size-4 shrink-0 accent-(--primary)",onChange:()=>{l(c.id)}}),g.jsx("span",{className:"min-w-0 font-bold",children:c.label})]}),g.jsx("span",{className:"block pl-7 text-sm text-muted-foreground",children:c.detail})]},c.id))})]}):g.jsx("p",{className:"text-muted-foreground",children:e.emptyMessage}),g.jsxs(yl,{children:[g.jsx(st,{type:"button",variant:"ghost",onClick:r,children:e.cancelLabel}),g.jsx(st,{type:"button",variant:"outline",disabled:t,onClick:()=>{n(null)},children:e.skipLabel}),e.emptyMessage===null?g.jsx(st,{type:"button",disabled:t||o===null,onClick:()=>{n(o)},children:e.confirmLabel}):null]})]})})},xRe=4,Lw="change-overview-card-action",bRe={added:"[--change:var(--diff-added)]",modified:"[--change:var(--line-blue)]",deleted:"[--change:var(--diff-removed)]"},vRe="relative grid h-full w-full min-w-0 gap-0.5 rounded-[0.3rem] border border-[color-mix(in_oklab,var(--change)_55%,transparent)] bg-(--plate-fill) px-3 pt-3.5 pb-2.5 text-left [--plate-fill:color-mix(in_oklab,var(--change)_8%,var(--card))]",SRe="cursor-pointer transition-[border-color,box-shadow] duration-[180ms] ease-out hover:border-(--change) hover:ring-1 hover:ring-(--change) focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none",wRe="absolute -top-2 right-2.5 flex items-center gap-1 bg-[linear-gradient(to_bottom,var(--background)_50%,var(--plate-fill)_50%)] px-1.5 text-xs leading-4 font-bold text-(--change)",ERe=({card:e})=>g.jsxs(g.Fragment,{children:[g.jsxs("span",{className:wRe,children:[g.jsx(bT,{mark:e.change,radius:xRe}),e.changeLabel]}),g.jsx("span",{className:"truncate font-mono text-sm font-bold text-foreground",children:e.label}),g.jsxs("span",{className:"flex min-w-0 items-baseline gap-1.5 text-xs leading-4 text-muted-foreground",children:[g.jsx("span",{className:"shrink-0",children:e.typeLabel}),g.jsx("span",{"aria-hidden":"true",children:"•"}),g.jsx("span",{title:e.path,className:"min-w-0 truncate font-mono [direction:rtl]",children:g.jsx("bdi",{children:e.path})})]})]}),CRe=({card:e,onOpenWaypoint:t})=>{const{waypointAnchorId:n,change:r,preview:s}=e,o=n!==null,l=xe(vRe,bRe[r],o?SRe:""),c=o?()=>{t(n)}:void 0,u=g.jsx(ERe,{card:e});return s===null?o?g.jsx("button",{type:"button","data-user-action-id":Lw,className:l,onClick:c,children:u}):g.jsx("div",{"data-user-action-id":Lw,className:l,children:u}):g.jsxs(Dm,{children:[g.jsx(jm,{delay:d6,render:o?g.jsx("button",{type:"button"}):g.jsx("div",{}),"data-user-action-id":Lw,className:l,onClick:c,children:u}),g.jsx(f6,{target:s})]})},TRe=({heading:e,emptyMessage:t,rows:n,onOpenWaypoint:r})=>{const s=N.useId();return g.jsxs("section",{"aria-labelledby":s,"data-view-section-id":"change-overview-section",className:"pt-6",children:[g.jsx("h3",{id:s,className:"pb-3 text-base leading-6 font-bold text-foreground",children:e}),t===null?null:g.jsx("p",{className:"text-muted-foreground",children:t}),n.length===0?null:g.jsx("ul",{className:"grid gap-5",children:n.map(o=>g.jsxs("li",{"aria-label":o.classification.label,children:[g.jsx("span",{className:"text-sm leading-5 font-bold text-foreground",children:o.classification.label}),g.jsx("ul",{className:"grid grid-cols-[repeat(auto-fill,minmax(15rem,1fr))] gap-x-3 gap-y-5 pt-4",children:o.cards.map(l=>g.jsx("li",{className:"min-w-0",children:g.jsx(CRe,{card:l,onOpenWaypoint:r})},l.id))})]},o.classification.key))})]})},NRe="max-w-[85ch]",RRe=({anchorId:e,heading:t,writeUpNotice:n=null,action:r=null,children:s})=>g.jsxs("section",{id:e,"aria-labelledby":`${e}-heading`,"data-view-section-id":"context-section",className:"scroll-mt-(--section-scroll-margin) pt-6 pb-8",children:[g.jsxs("div",{className:"flex items-center gap-3 pb-4",children:[g.jsx("h2",{id:`${e}-heading`,className:"text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:t}),n===null?null:g.jsx(Df,{label:n}),r]}),s]}),ORe=N.lazy(async()=>await Ut(()=>import("./index-Qxg2C8CP.js"),__vite__mapDeps([24,25]))),ARe="Loading the editor…",kRe=({anchorId:e,heading:t,context:n,markdown:r,isDraft:s,unwrittenLabel:o,writeUpNotice:l,changeOverview:c,codeLinks:u,editing:f,renderCodeLinkDialog:h,onOpenCodeLink:p})=>{const y=(f==null?void 0:f.isWriting)===!0,x=gle(e,n);return g.jsxs(RRe,{anchorId:e,heading:t,writeUpNotice:l,action:f===null||y?null:g.jsx(st,{variant:"link",size:"sm",onClick:f.onEdit,children:"Edit"}),children:[f!==null&&y?g.jsx(N.Suspense,{fallback:g.jsx("p",{className:"text-sm text-muted-foreground",children:ARe}),children:g.jsx(ORe,{label:t,markdown:r,isSaving:f.isSaving,errorMessage:f.errorMessage,renderCodeLinkDialog:h,onSave:f.onSave,onCancel:f.onCancel})}):null,!y&&s?g.jsx(cl,{isPending:!0,lineCount:4,className:"max-w-[55rem] text-base",children:g.jsx("p",{className:"text-muted-foreground",children:o})}):null,!y&&!s?g.jsx(h6,{value:x,children:g.jsx(uo,{blocks:n,codeLinks:u,className:NRe,onOpenCodeLink:p})}):null,g.jsx(TRe,{...c,onOpenWaypoint:p})]})},_Re=({anchorId:e,heading:t,emptyMessage:n,entries:r,placeholder:s,submitLabel:o,isSubmitting:l,renderEditor:c,onComment:u})=>g.jsxs("section",{id:e,"aria-labelledby":`${e}-heading`,"data-view-section-id":"conversation-section",className:"scroll-mt-(--section-scroll-margin) border-t pt-6 pb-8",children:[g.jsx("h2",{id:`${e}-heading`,className:"pb-4 text-2xl leading-9 font-semibold tracking-[-0.02em] text-foreground",children:t}),g.jsxs("div",{className:"flex max-w-[52rem] flex-col",children:[n===null?null:g.jsx("p",{className:"pb-4 text-muted-foreground",children:n}),r.map(f=>g.jsx(_6,{comment:f,verdictLabel:f.verdictLabel,locationLabel:f.locationLabel,className:"border-t py-3 first:border-t-0 first:pt-0"},f.id)),g.jsx(LT,{label:s,submitLabel:o,cancelLabel:null,isSubmitting:l,className:"border-t pt-4",renderEditor:c,onSubmit:u})]})]}),MRe="max-h-48 overflow-auto rounded-sm bg-muted px-2 py-1.5 font-mono text-xs leading-5 whitespace-pre-wrap wrap-anywhere",IRe="min-h-16 w-full resize-none rounded-lg border border-input bg-card px-2.5 py-1.5 text-sm outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40",LRe=e=>e.trim()===""?null:e.trim(),DRe=({request:e,isAnswering:t,problem:n,onAnswer:r})=>{const s=N.useId(),[o,l]=N.useState("");return g.jsx(pl,{open:!0,children:g.jsxs(ml,{showCloseButton:!1,className:"sm:max-w-lg",children:[g.jsxs(gl,{children:[g.jsx(xl,{children:e.title}),g.jsx(bl,{children:e.description})]}),e.detail===null?null:g.jsx("pre",{className:MRe,children:e.detail}),g.jsxs("div",{className:"flex flex-col gap-1",children:[g.jsx("label",{htmlFor:s,className:"text-xs text-muted-foreground",children:e.reasonLabel}),g.jsx("textarea",{id:s,value:o,className:IRe,onChange:c=>{l(c.target.value)}})]}),n===null?null:g.jsx("p",{role:"alert",className:"text-sm text-destructive",children:n}),g.jsxs(yl,{children:[g.jsx(st,{type:"button",variant:"destructive",disabled:t,onClick:()=>{r(e.denyLabel,LRe(o))},children:e.denyLabel}),g.jsx(st,{type:"button",disabled:t,onClick:()=>{r(e.allowLabel,null)},children:e.allowLabel})]})]})})},jRe={},PRe=()=>{},rP="flex flex-wrap items-center gap-x-3 gap-y-1 border-b py-2.5 text-sm",zRe="sticky top-(--band-height) z-20 flex h-(--strip-height) items-center gap-3 border-b bg-background text-sm whitespace-nowrap",BRe=({staleNotice:e,unassignedFiles:t,progress:n,onShowUnassignedFiles:r,onCopyPrompt:s})=>g.jsxs(g.Fragment,{children:[e===null?null:g.jsxs("div",{role:"status",className:rP,children:[g.jsx(cp,{status:"stale",tone:"signal"}),g.jsx("p",{className:"font-bold text-signal-text [&_code]:bg-transparent [&_code]:px-0",children:g.jsx(cf,{inlines:e.message,codeLinks:jRe,onOpenCodeLink:PRe})}),g.jsx(st,{variant:"outline",size:"sm",onClick:()=>{s(e.prompt,e.copiedMessage)},children:e.promptLabel})]}),t===null?null:g.jsxs("div",{role:"status",className:rP,children:[g.jsx(cp,{status:"stale",tone:"signal"}),g.jsx("p",{className:"font-bold text-signal-text",children:t.message}),g.jsx(st,{variant:"outline",size:"sm",onClick:r,children:t.actionLabel})]}),n===null?null:g.jsxs("div",{role:"status",...Bre,className:zRe,children:[g.jsx(cp,{status:n.isWriting?"awaiting-review":"stale",tone:n.isWriting?"status":"signal",className:n.isWriting?"motion-safe:animate-pulse":""}),g.jsx("p",{className:"font-bold text-signal-text",children:n.label}),g.jsx("progress",{"aria-label":n.countLabel,value:n.writtenCount,max:n.totalCount,className:"h-1.5 w-40 shrink-0 appearance-none overflow-hidden rounded-[0.225rem] bg-muted [&::-moz-progress-bar]:bg-signal [&::-webkit-progress-bar]:bg-muted [&::-webkit-progress-value]:bg-signal [&::-webkit-progress-value]:transition-[width] [&::-webkit-progress-value]:duration-300"}),g.jsx("p",{className:"text-foreground tabular-nums",children:n.countLabel}),g.jsx("p",{className:"min-w-0 truncate text-muted-foreground",children:n.message}),n.prompt===null?null:g.jsx(st,{variant:"outline",size:"sm",onClick:()=>{n.prompt!==null&&s(n.prompt.text,n.prompt.copiedMessage)},children:n.prompt.label})]})]}),HRe="Label",FRe="Files",$Re="No files yet.",URe="Add a file",VRe="Search the changed files",qRe="Close",GRe="Delete",H7=({reviewKey:e,legend:t,label:n,paths:r,isSaving:s,isDeleting:o,errorMessage:l,onSave:c,onDelete:u,onClose:f})=>{const h=N.useId(),p=N.useId(),y=mN(e,"changed"),[x,b]=N.useState(n),[S,E]=N.useState(r),C=R=>{E(T=>T.includes(R)?T:[...T,R]),y.onQueryChange("")};return g.jsxs("form",{"aria-label":t,onSubmit:RF(()=>{c({title:x,paths:S})}),className:"relative mt-6 grid max-w-[44rem] gap-4 rounded-lg border border-foreground p-4",children:[g.jsx(Nr,{icon:"close",label:qRe,className:"absolute top-2 right-2",onClick:f}),g.jsxs("div",{className:"grid gap-1.5 pr-8",children:[g.jsx("label",{htmlFor:h,className:"text-sm font-bold",children:HRe}),g.jsx(zm,{id:h,value:x,onChange:R=>{b(R.target.value)}})]}),g.jsxs("div",{className:"grid gap-1.5",children:[g.jsx("p",{id:p,className:"text-sm font-bold",children:FRe}),S.length===0?g.jsx("p",{className:"text-sm text-muted-foreground",children:$Re}):g.jsx("ul",{"aria-labelledby":p,className:"grid gap-0.5",children:S.map(R=>g.jsxs("li",{className:"flex items-center justify-between gap-2",children:[g.jsx("span",{className:"min-w-0 truncate font-mono text-[0.8rem]",title:R,children:R}),g.jsx(Nr,{icon:"close",label:`Remove ${R}`,onClick:()=>{E(T=>T.filter(O=>O!==R))}})]},R))})]}),g.jsx(gN,{label:URe,hint:null,placeholder:VRe,query:y.query,files:y.files,message:y.message,errorMessage:y.errorMessage,onQueryChange:y.onQueryChange,onSelect:C}),l===null?null:g.jsx("p",{role:"alert",className:"text-sm text-destructive",children:l}),g.jsxs("div",{className:"flex justify-end gap-2",children:[u===null?null:g.jsx(st,{type:"button",variant:"destructive",disabled:o,onClick:u,children:GRe}),g.jsx(st,{type:"submit",disabled:s,children:s?"Saving…":"Save"})]})]})},KRe=({heading:e,detailLabel:t,children:n=null})=>g.jsxs("div",{className:"flex items-baseline gap-3 pt-6",children:[g.jsx("h2",{className:"text-[1.75rem] leading-9 font-semibold tracking-[-0.02em] text-foreground",children:e}),n,t===null?null:g.jsx("p",{className:"text-sm text-muted-foreground tabular-nums",children:t})]}),YRe="text-[1.75rem] leading-9 font-semibold tracking-[-0.02em] text-foreground",WRe="text-sm text-muted-foreground tabular-nums",XRe="Edit segment",QRe=({reviewKey:e,heading:t,isTitleDraft:n,detailLabel:r,outline:s,authoring:o})=>o===null?t===null?null:g.jsx(KRe,{heading:t,detailLabel:r,children:g.jsx(cl,{isPending:n,className:"w-64 self-center text-[1.75rem]",children:null})}):o.writing.isWriting?g.jsx(H7,{reviewKey:e,legend:s.heading,label:s.label,paths:s.paths,isSaving:o.writing.isSaving,isDeleting:o.isPending,errorMessage:o.writing.errorMessage,onSave:o.writing.onSave,onDelete:o.onRemove,onClose:o.writing.onCancel}):g.jsxs("div",{className:"flex items-center gap-3 pt-6",children:[g.jsx("h2",{className:YRe,children:s.heading}),g.jsx("p",{className:WRe,children:s.detailLabel}),g.jsx(st,{variant:"link",size:"sm",onClick:o.writing.onEdit,children:XRe})]}),ZRe=({selection:e,onComment:t,onAsk:n})=>e===null||e.commentRange===null&&n===null?null:g.jsxs("div",{role:"toolbar","aria-label":"Selected code",className:"fixed z-50 flex -translate-y-full gap-0.5 rounded-lg border border-foreground bg-popover p-1 duration-150 animate-in fade-in-0",style:{left:e.left,top:e.top},onMouseDown:r=>{r.preventDefault()},children:[e.commentRange===null?null:g.jsx(st,{variant:"ghost",size:"sm",onClick:()=>{e.commentRange!==null&&t(e.path,e.commentRange)},children:"Add comment"}),n===null?null:g.jsx(st,{variant:"ghost",size:"sm",onClick:()=>{n(e)},children:"Ask the agent"})]}),JRe=({heading:e,message:t,children:n})=>g.jsxs("div",{className:"grid grid-cols-[2.5rem_minmax(0,1fr)] pt-10",children:[g.jsxs("span",{"aria-hidden":"true",className:"flex flex-col items-center",children:[g.jsx("span",{className:"h-9 w-1 bg-(--line)"}),g.jsx("span",{className:"h-1 w-4 bg-(--line)"})]}),g.jsxs("div",{className:"pt-5",children:[g.jsx("h2",{className:"text-xl leading-7 font-semibold tracking-[-0.01em] text-foreground",children:e}),g.jsx("p",{className:"max-w-[62ch] text-muted-foreground",children:t}),n]})]}),eOe="Close",tOe="Cancel",nOe=({title:e,description:t,paths:n,confirmation:r,onClose:s})=>g.jsx(pl,{open:!0,onOpenChange:o=>{o||s()},children:g.jsxs(ml,{children:[g.jsxs(gl,{children:[g.jsx(xl,{children:e}),g.jsx(bl,{children:(r==null?void 0:r.warning)??t})]}),g.jsx("ul",{"aria-label":e,className:"grid max-h-80 gap-1 overflow-y-auto",children:n.map(o=>g.jsx("li",{className:"font-mono text-[0.8rem] break-all",children:o},o))}),g.jsxs(yl,{children:[g.jsx(st,{type:"button",variant:"ghost",onClick:s,children:r===null?eOe:tOe}),r===null?null:g.jsx(st,{type:"button",onClick:r.onConfirm,children:r.confirmLabel})]})]})}),rOe=(e,t)=>{var S,E;const n=ws(),r=_o(),[s,o]=N.useState(!1),[l,c]=N.useState(null),u=ZW(n.conversation.watch.subscriptionOptions(e,{enabled:s})),f=Ga({...n.conversation.modelChoice.queryOptions(e),enabled:s}),h=C=>{t(C.message)},p=kn(n.conversation.sendMessage.mutationOptions({onSuccess:C=>{C.kind==="sent"&&c(null)},onError:h})),y=kn(n.conversation.answerQuestions.mutationOptions({onSuccess:async()=>{await r.invalidateQueries(n.review.get.pathFilter())},onError:h})),x=kn(n.conversation.chooseModel.mutationOptions({onSuccess:async C=>{C.kind==="rejected"&&t(C.message),await r.invalidateQueries(n.conversation.modelChoice.pathFilter())},onError:h})),b=((S=y.data)==null?void 0:S.kind)==="rejected"&&y.variables!==void 0?{batchId:y.variables.batchId,message:y.data.message}:null;return{isOpen:s,reference:l,conversation:u.data,modelChoice:f.data??null,isSending:p.isPending,sendProblem:((E=p.data)==null?void 0:E.kind)==="rejected"?p.data.message:null,answering:{pendingBatchId:y.isPending?y.variables.batchId:null,rejection:b},onToggle:()=>{o(C=>!C)},onClose:()=>{o(!1)},onAsk:C=>{c(C),o(!0)},onClearReference:()=>{c(null)},onSend:C=>{p.mutate({...e,body:C,reference:l})},onAnswer:(C,R)=>{y.mutate({...e,batchId:C,answers:R.map(T=>({...T,pickedLabels:[...T.pickedLabels]}))})},onChooseModel:C=>{x.mutate({...e,model:C})}}},sOe="[data-line]",oOe="[data-path]",iOe=6,YC=10,sP=e=>{const t=e instanceof Element?e:(e==null?void 0:e.parentElement)??null;return(t==null?void 0:t.closest(sOe))??null},oP=e=>Number.parseInt(e.dataset.line??"",YC),iP=e=>{const{commentSide:t,commentLine:n}=e.dataset;return(t==="old"||t==="new")&&n!==void 0?{side:t,lineLabel:n}:null},lOe=(e,t)=>{if(t===null)return null;const n=Number.parseInt(t.lineLabel,YC),r=(e==null?void 0:e.side)===t.side?Number.parseInt(e.lineLabel,YC):n;return{side:t.side,startLineLabel:String(Math.min(r,n)),lineLabel:String(Math.max(r,n))}},lP=()=>{const e=window.getSelection();if(e===null||e.isCollapsed||e.rangeCount===0)return null;const t=sP(e.anchorNode),n=sP(e.focusNode),r=(t==null?void 0:t.closest(oOe))??null,s=r==null?void 0:r.dataset.path;if(t===null||n===null||r===null||s===void 0||!r.contains(n))return null;const o=oP(t),l=oP(n);if(Number.isNaN(o)||Number.isNaN(l))return null;const c=e.getRangeAt(0).getBoundingClientRect();return{path:s,lineStart:o,lineEnd:l,commentRange:lOe(iP(t),iP(n)),left:c.left,top:c.top-iOe}},aOe=()=>{const[e,t]=N.useState(null);return N.useEffect(()=>{const n=()=>{t(lP())},r=()=>{t(null)},s=()=>{lP()===null&&t(null)};return document.addEventListener("selectionchange",s),document.addEventListener("mouseup",n),document.addEventListener("keyup",n),window.addEventListener("scroll",r,{passive:!0}),()=>{document.removeEventListener("selectionchange",s),document.removeEventListener("mouseup",n),document.removeEventListener("keyup",n),window.removeEventListener("scroll",r)}},[]),e},F7=()=>"Notification"in window,cOe=()=>{F7()&&Notification.permission==="default"&&Notification.requestPermission()},uOe=(e,{title:t,body:n})=>{if(!F7()||Notification.permission!=="granted")return;const r=new Notification(t,{body:n,tag:e});r.addEventListener("click",()=>{window.focus(),r.close()})},dOe=(e,t,n,r)=>{const s=N.useRef(null);N.useEffect(()=>{if(t){s.current=e;return}n===null||s.current!==e||(s.current=null,r(n.title),uOe(e,n))},[e,t,n,r])},fOe=e=>{var f,h;const t=ws(),n=_o(),[r,s]=N.useState([]),o=p=>{s(y=>y.filter(x=>x!==p))},l=kn(t.review.editContext.mutationOptions({onSuccess:async(p,{segmentId:y})=>{p.kind==="saved"&&(await n.invalidateQueries(t.review.get.pathFilter()),o(y))}})),u=(((f=l.data)==null?void 0:f.kind)==="rejected"?l.data.message:null)??((h=l.error)==null?void 0:h.message)??null;return p=>{var x;const y=((x=l.variables)==null?void 0:x.segmentId)===p;return{isWriting:r.includes(p),isSaving:y&&l.isPending,errorMessage:y?u:null,onEdit:()=>{y&&l.reset(),s(b=>[...b,p])},onSave:b=>{l.mutate({...e,segmentId:p,context:b})},onCancel:()=>{y&&l.reset(),o(p)}}}},hOe=10,pOe="Review submitted",_x=e=>Number.parseInt(e,hOe),aP=(e,t)=>({path:e,side:t.side,startLine:_x(t.startLineLabel),endLine:_x(t.lineLabel)}),mOe=(e,t,n,r)=>{if(n===null)return null;const s={path:t,anchorLineLabel:n.lineLabel,range:{side:n.side,startLineLabel:n.lineLabel,lineLabel:n.lineLabel}};if(!r||(e==null?void 0:e.path)!==t||e.range.side!==n.side)return s;const o=_x(e.anchorLineLabel),l=_x(n.lineLabel);return{...e,range:{side:n.side,startLineLabel:String(Math.min(o,l)),lineLabel:String(Math.max(o,l))}}},gOe=(e,t)=>{var I;const n=ws(),r=_o(),[s,o]=N.useState(null),[l,c]=N.useState(0),[u,f]=N.useState(""),[h,p]=N.useState(!1),y=N.useDeferredValue(u),x=async()=>{await r.invalidateQueries(n.review.get.pathFilter())},b=async()=>{await Promise.all([x(),r.invalidateQueries(n.review.searchReviewers.pathFilter())])},S=j=>{t(j.message)},E={onSuccess:x,onError:S},C=kn(n.review.addComment.mutationOptions({onSuccess:async()=>{o(null),await x()},onError:S})),R=kn(n.review.discardComment.mutationOptions(E)),T=kn(n.review.replyToThread.mutationOptions(E)),O=kn(n.review.resolveThread.mutationOptions(E)),k=kn(n.review.submit.mutationOptions({onSuccess:async()=>{c(j=>j+1),t(pOe),await Promise.all([x(),r.invalidateQueries(n.repository.list.pathFilter())])}})),M=kn(n.review.requestReviewer.mutationOptions({onSuccess:b,onError:S})),A=kn(n.review.removeReviewRequest.mutationOptions({onSuccess:b,onError:S})),L=Ga({...n.review.searchReviewers.queryOptions({...e,query:y}),enabled:h,placeholderData:Mx});return{composingRangeOf:j=>(s==null?void 0:s.path)===j?s.range:null,isCommentPending:C.isPending||T.isPending||O.isPending||R.isPending,isSubmitting:k.isPending,isDiscarding:R.isPending,submissionCount:l,submissionError:((I=k.error)==null?void 0:I.message)??null,reviewerRequesting:{query:u,options:L.data??null,isPending:M.isPending||A.isPending,onOpen:()=>{p(!0)},onSearch:f,onRequest:j=>{M.mutate({...e,login:j})},onRemove:j=>{A.mutate({...e,login:j})}},onStartComment:(j,P,B)=>{o(H=>mOe(H,j,P,B))},onStartRangeComment:(j,P)=>{o({path:j,anchorLineLabel:P.startLineLabel,range:P})},onAddComment:(j,P,B)=>{C.mutate({...e,position:aP(j,P),body:B,shouldPostNow:!1})},onPostComment:(j,P,B)=>{C.mutate({...e,position:aP(j,P),body:B,shouldPostNow:!0})},onComment:j=>{C.mutate({...e,position:null,body:j,shouldPostNow:!0})},onReply:(j,P)=>{T.mutate({...e,threadId:j,body:P})},onResolveThread:(j,P)=>{O.mutate({...e,threadId:j,isResolved:P})},onDiscardComment:j=>{R.mutate({...e,commentId:j})},onSubmit:(j,P)=>{k.mutate({...e,verdict:j,body:P})}}},cP=e=>e.kind==="add"||e.kind==="change",yOe=(e,t)=>{var S,E,C;const n=ws(),r=_o(),[s,o]=N.useState([]),[l,c]=N.useState(!1),u=R=>{o(T=>T.filter(O=>O!==R))},f=kn(n.review.editSegments.mutationOptions({onSuccess:async(R,{edit:T})=>{if(R.kind==="rejected"){cP(T)||t(R.message);return}await r.invalidateQueries(n.review.get.pathFilter()),T.kind==="add"&&c(!1),(T.kind==="change"||T.kind==="remove")&&u(T.segmentId)},onError:(R,{edit:T})=>{cP(T)||t(R.message)}})),h=R=>{f.mutate({...e,edit:"paths"in R?{...R,paths:[...R.paths]}:R})},p=((S=f.variables)==null?void 0:S.edit)??null,x=(((E=f.data)==null?void 0:E.kind)==="rejected"?f.data.message:null)??((C=f.error)==null?void 0:C.message)??null,b=(p==null?void 0:p.kind)==="add";return{isPending:f.isPending,onMove:(R,T)=>{h({kind:"move",segmentId:R,direction:T})},addition:{isWriting:l,isSaving:b&&f.isPending,errorMessage:b?x:null,onEdit:()=>{b&&f.reset(),c(!0)},onSave:R=>{h({kind:"add",...R})},onCancel:()=>{b&&f.reset(),c(!1)}},authoringOf:R=>{const T=(p==null?void 0:p.kind)==="change"&&p.segmentId===R;return{writing:{isWriting:s.includes(R),isSaving:T&&f.isPending,errorMessage:T?x:null,onEdit:()=>{T&&f.reset(),o(O=>O.includes(R)?O:[...O,R])},onSave:O=>{h({kind:"change",segmentId:R,...O})},onCancel:()=>{T&&f.reset(),u(R)}},isPending:f.isPending,onRemove:()=>{h({kind:"remove",segmentId:R})}}}}},xOe="Loading the branches…",bOe=e=>{var f;const t=ws(),n=lm(),[r,s]=N.useState(!1),[o,l]=N.useState(""),c=N.useDeferredValue(o),u=Ga({...t.review.targetSwitcher.queryOptions({...e,query:c}),enabled:r,placeholderData:Mx});return{switcher:u.data??null,placeholder:((f=u.error)==null?void 0:f.message)??xOe,query:o,onOpen:()=>{s(!0),u.refetch()},onSearch:l,onSwitch:h=>{l(""),n({to:"/pr-reviews/$repoName/$branchId",params:{repoName:e.repositoryName,branchId:h}})}}},vOe=2500,SOe=()=>{const[e,t]=N.useState(null);N.useEffect(()=>{if(e===null)return;const r=window.setTimeout(()=>{t(null)},vOe);return()=>{window.clearTimeout(r)}},[e]);const n=N.useCallback(r=>{t({message:r})},[]);return[(e==null?void 0:e.message)??null,n]},wOe="The line you drew ends at this card.",EOe=["add-card","change-card","describe"],uP=e=>EOe.includes(e.kind),COe=(e,t)=>{var O,k,M;const n=ws(),r=_o(),[s,o]=N.useState(null),[l,c]=N.useState(null),[u,f]=N.useState([]),h=A=>{f(L=>L.filter(I=>I!==A))},p=kn(n.review.editTrace.mutationOptions({onSuccess:async(A,{segmentId:L,edit:I})=>{if(A.kind==="rejected"){uP(I)||t(A.message);return}await Promise.all([r.invalidateQueries(n.review.get.pathFilter()),r.invalidateQueries(n.review.cardForm.pathFilter()),r.invalidateQueries(n.review.cardBlocks.pathFilter())]),I.kind==="add-card"&&(o(null),c(A.nodeId===null?null:{segmentId:L,nodeId:A.nodeId})),I.kind==="change-card"&&c(null),I.kind==="describe"&&h(L)},onError:(A,{edit:L})=>{uP(L)||t(A.message)}})),y=(A,L)=>{p.mutate({...e,segmentId:A,edit:L})},x=((O=p.variables)==null?void 0:O.edit)??null,S=(((k=p.data)==null?void 0:k.kind)==="rejected"?p.data.message:null)??((M=p.error)==null?void 0:M.message)??null,E=(x==null?void 0:x.kind)==="add-card",C=A=>{E&&p.reset(),o(A)},R=(x==null?void 0:x.kind)==="change-card",T=A=>{var L;return(x==null?void 0:x.kind)==="describe"&&((L=p.variables)==null?void 0:L.segmentId)===A};return{cardMovingOf:A=>({onMoveCards:L=>{y(A,{kind:"move-cards",places:[...L]})}}),authoringOf:A=>({board:{isPending:p.isPending,onAddCard:()=>{C({segmentId:A,lineEnd:null})},onClearDiagram:()=>{y(A,{kind:"clear-diagram"})},onRemoveDiagram:()=>{y(A,{kind:"remove-diagram"})},onAddCardAtLineEnd:L=>{C({segmentId:A,lineEnd:{...L,places:[...L.places]}})},onDrawLine:L=>{y(A,{kind:"add-line",...L})},onRemoveLine:L=>{y(A,{kind:"remove-line",...L})},onEditCard:L=>{R&&p.reset(),c({segmentId:A,nodeId:L})},onRemoveCard:L=>{y(A,{kind:"remove-card",nodeId:L})}},description:{isWriting:u.includes(A),isSaving:T(A)&&p.isPending,errorMessage:T(A)?S:null,onEdit:()=>{T(A)&&p.reset(),f(L=>[...L,A])},onSave:L=>{y(A,{kind:"describe",description:L})},onCancel:()=>{T(A)&&p.reset(),h(A)}},onAddDiagram:()=>{y(A,{kind:"add-diagram"})}}),cardAddition:s===null?null:{segmentId:s.segmentId,note:s.lineEnd===null?null:wOe,isSaving:E&&p.isPending,errorMessage:E?S:null,onSubmit:A=>{y(s.segmentId,{kind:"add-card",...A,...s.lineEnd===null?{}:{lineEnd:s.lineEnd}})},onClose:()=>{o(null)}},cardChange:l===null?null:{...l,isSaving:R&&p.isPending,errorMessage:R?S:null,onSave:A=>{y(l.segmentId,{kind:"change-card",nodeId:l.nodeId,...A})},onClose:()=>{c(null)}}}},TOe=(e,t)=>{const n=ws(),r=_o(),s=kn(n.review.editWalkthrough.mutationOptions({onSuccess:async o=>{o.kind==="rejected"?t(o.message):await r.invalidateQueries(n.review.get.pathFilter())},onError:o=>{t(o.message)}}));return{isPending:s.isPending,onMoveFile:(o,l,c,u)=>{s.mutate({...e,segmentId:o,edit:{kind:"move-file",path:l,direction:c,shownPaths:[...u]}})},onRemoveFile:(o,l)=>{s.mutate({...e,segmentId:o,edit:{kind:"remove-file",path:l}})},onRemoveWaypoint:(o,l)=>{s.mutate({...e,segmentId:o,edit:{kind:"remove-waypoint",waypointId:l}})}}},NOe=e=>[...e.groups.flatMap(t=>{var n;return[...t.options,...((n=t.more)==null?void 0:n.options)??[]]}),...e.submenus.flatMap(t=>t.options)],ROe=e=>NOe(e).filter(t=>t.isSelected).map(t=>t.key),OOe=(e,t)=>e.length===t.length&&e.every(n=>t.includes(n)),AOe=(e,t)=>e.every(n=>OOe(ROe(n.walkthrough.controls.filter),t)),kOe=e=>e.flatMap(t=>t.walkthrough.files).flatMap(t=>t.rows).flatMap(t=>t.kind==="waypoint"&&!t.waypoint.isReviewed?[t.waypoint.id]:[]).at(0)??null,_Oe=new Set,MOe=[],WC=e=>{var n;const t=(n=document.getElementById(e))==null?void 0:n.getBoundingClientRect();return t!==void 0&&t.height>0&&t.top<RT()},XC=e=>{var t;(t=document.getElementById(e))==null||t.scrollIntoView({block:"start",behavior:"instant"})},IOe=e=>{const[t,n]=N.useState(null),r=N.useRef(null);return N.useLayoutEffect(()=>{t!==null&&XC(t.anchorId)},[t]),N.useLayoutEffect(()=>{const s=r.current;s!==null&&(r.current=null,XC(s))},[e]),{holdPlace:s=>{s!==null&&WC(s)&&n(o=>({anchorId:s,count:((o==null?void 0:o.count)??0)+1}))},holdPlaceThroughRefresh:s=>{r.current=WC(s)?s:null}}},LOe=(e,t)=>{const n=N.useRef(null);return N.useLayoutEffect(()=>{const r=n.current;if(r===null||!AOe(e,r.keys))return;n.current=null;const s=kOe(e);s!==null?t(s):r.heldAnchorId!==null&&XC(r.heldAnchorId)},[e,t]),(r,s)=>{n.current={keys:r,heldAnchorId:WC(s)?s:null}}},DOe=(e,t)=>e.rows.some(n=>n.kind==="waypoint"&&n.waypoint.id===t),jOe=(e,t)=>{var n;return((n=e.flatMap(r=>r.walkthrough.files).find(r=>DOe(r,t)))==null?void 0:n.anchorId)??null},POe=(e,t)=>e.flatMap(n=>n.walkthrough.files).flatMap(n=>n.rows.flatMap(r=>r.kind==="waypoint"&&r.waypoint.id===t?[{path:n.path,waypoint:r.waypoint,rootBlockId:r.rootBlockId}]:[])).at(0)??null,zOe=e=>({side:"new",startLineLabel:String(e.lineStart),lineLabel:String(e.lineEnd)}),BOe=e=>e.reading===null&&!e.isBeingWritten,HOe=(e,t)=>t==="line"?{kind:"waypoint",waypointId:e.waypoint.id}:e.rootBlockId===null?null:{kind:"root-block",rootBlockId:e.rootBlockId},dP=(e,t,n)=>new Set(n?[...e,...t]:[...e].filter(r=>!t.includes(r))),FOe=(e,t)=>{var n,r;return((n=e.find(s=>s.anchorId===t))==null?void 0:n.anchorId)??((r=e.at(0))==null?void 0:r.anchorId)??null},$Oe=(e,t,n,r)=>{const s=jOe(e,t.currentWaypointId),[o,l]=N.useState({collapsedAnchorIds:_Oe,holdingAnchorId:s});o.holdingAnchorId!==s&&l({collapsedAnchorIds:s===null?o.collapsedAnchorIds:dP(o.collapsedAnchorIds,[s],!1),holdingAnchorId:s});const{collapsedAnchorIds:c}=o,{holdPlace:u,holdPlaceThroughRefresh:f}=IOe(e),h=LOe(e,t.onVisitWaypoint),p=(k,M,A)=>{u(A),l(L=>({...L,collapsedAnchorIds:dP(L.collapsedAnchorIds,k,M)}))},y=POe(e,t.currentWaypointId),x=(y==null?void 0:y.waypoint)??null,{onReviewedChange:b,onFilterChange:S,onShowReviewedChange:E,onCommentOnWaypoint:C,onWriteDescription:R,onWriteUp:T,agentLabel:O}=r;return{isFileCollapsed:k=>c.has(k),onFileCollapsedChange:(k,M)=>{p([k],M,k)},navigationOf:k=>{const{controls:M}=k.walkthrough,A=k.walkthrough.files.map(j=>j.anchorId),L=FOe(k.walkthrough.files,n),I=t.steppingOf(k);return{controls:M,positionLabel:I.positionLabel,canStepBack:I.canStepBack,canStepForward:I.canStepForward,currentWaypoint:x===null?null:{isReviewed:x.isReviewed,isOpen:t.openWaypointIds.has(x.id),canComment:x.lines!==null,canWriteUp:BOe(x),canWriteUpBlock:(y==null?void 0:y.rootBlockId)!=null},areFilesCollapsed:A.length>0&&A.every(j=>c.has(j)),isFileCollapsed:L===null?null:c.has(L),onPrevious:I.onPrevious,onNext:I.onNext,onCurrentReviewedChange:b===null?null:j=>{x!==null&&(j&&!M.reviewedToggle.isShown&&I.onNext(),b(x.id,j))},onCommentOnCurrent:C===null?null:()=>{(y==null?void 0:y.waypoint.lines)!=null&&C(y.path,zOe(y.waypoint.lines))},onDescribeCurrent:R===null?null:()=>{x!==null&&R(x.id)},agentLabel:O,onWriteUpCurrent:T===null?null:j=>{const P=y===null?null:HOe(y,j);P!==null&&T(P)},onFilterChange:S===null?null:j=>{h(j??MOe,k.walkthrough.anchorId),S(j)},onShowReviewedChange:E===null?null:j=>{f(k.walkthrough.anchorId),E(j)},onFilesCollapsedChange:j=>{p(A,j,k.walkthrough.anchorId)},onFileCollapsedChange:j=>{L!==null&&p([L],j,L)},onCurrentOpenChange:t.onCurrentOpenChange}}}},UOe=N.lazy(async()=>await Ut(()=>import("./index-Dq71dq4Z.js"),__vite__mapDeps([26,25]))),VOe="Loading the editor…",qOe="Remove the file from the walkthrough",fP="Edit the waypoint",GOe="Remove the waypoint",KOe="my-1.5 mr-4 ml-28 rounded-md border border-foreground bg-background p-4 font-sans whitespace-normal",hP=(e,t)=>e.rows.flatMap(n=>n.kind==="waypoint"&&n.waypoint.id===t?[n.waypoint]:[]).at(0)??null,YOe=(e,t)=>{const[n,r]=N.useState(null),s=()=>{r(null)},o=(c,u)=>g.jsx("div",{id:u.anchorId,className:KOe,children:g.jsx(N.Suspense,{fallback:g.jsx("p",{className:"text-muted-foreground",children:VOe}),children:g.jsx(UOe,{reviewKey:e,segmentId:c,waypointId:u.id,legend:`${fP}: ${u.title}`,text:u.text,renderCodeLinkDialog:t.renderCodeLinkDialog,onClose:s})})}),l=(c,u)=>g.jsxs(g.Fragment,{children:[g.jsx(Nr,{icon:"edit",label:`${fP}: ${u.title}`,onClick:()=>{r(u.id)}}),g.jsx(Nr,{icon:"delete",label:`${GOe}: ${u.title}`,isDisabled:t.isPending,onClick:()=>{t.onRemoveWaypoint(c,u.id)}})]});return{onWriteDescription:r,authoringOf:(c,u)=>({editedWaypointId:n,renderEditor:f=>{const h=hP(u,f);return h===null?null:o(c,h)},renderActions:f=>{const h=hP(u,f);return h===null?null:l(c,h)},onWriteDescription:r}),headerActionsOf:(c,u)=>g.jsx(Nr,{icon:"remove",label:`${qOe}: ${u.path}`,isDisabled:t.isPending,onClick:()=>{t.onRemoveFile(c,u.path)}})}},WOe=160,XOe=.33,QOe=900,ZOe=120,iy=0,ly=`
|
|
457
|
-
`,pP="data-waypoint-focus",QC=e=>{var t;(t=document.getElementById(e))==null||t.scrollIntoView({block:"start"})},JOe=e=>[...document.querySelectorAll(`[${pP}]`)].filter(t=>t.getAttribute(pP)===e),eAe=e=>{const t=JOe(e).map(o=>o.getBoundingClientRect());if(t.length===0)return 0;const n=Math.min(...t.map(o=>o.top)),r=Math.max(...t.map(o=>o.bottom));return Math.max(0,Math.min(r,window.innerHeight)-Math.max(n,RT()))/Math.max(1,r-n)},tAe=e=>{var n;const t=(n=document.getElementById(e))==null?void 0:n.getBoundingClientRect();return t!==void 0&&t.height>0&&t.top<ZOe},nAe=e=>{const[t,n]=N.useState(""),r=N.useRef(iy),s=e.join(ly);return N.useEffect(()=>{const o=s===""?[]:s.split(ly),l=()=>{r.current=iy,n(o.filter(tAe).join(ly))},c=()=>{r.current===iy&&(r.current=requestAnimationFrame(l))};return c(),window.addEventListener("scroll",c,{passive:!0}),window.addEventListener("resize",c),()=>{cancelAnimationFrame(r.current),r.current=iy,window.removeEventListener("scroll",c),window.removeEventListener("resize",c)}},[s]),N.useMemo(()=>new Set(t===""?[]:t.split(ly)),[t])},Dw=e=>e.walkthrough.files.flatMap(t=>t.rows.flatMap(n=>n.kind==="waypoint"?[n.waypoint]:[])),rAe=(e,t,n)=>{var r,s;return t===null?{previousId:((r=e.filter(o=>n.has(o.anchorId)).at(-1))==null?void 0:r.id)??null,nextId:((s=e.find(o=>!n.has(o.anchorId)))==null?void 0:s.id)??null}:{previousId:t.previousId,nextId:t.nextId}},sAe=(e,t,n)=>{const r=N.useRef(null);N.useEffect(()=>{if(r.current=null,e===null)return;const s=()=>{r.current??(r.current=window.scrollY)},o=()=>{const c=r.current;if(c===null)return;(Math.abs(window.scrollY-c)>WOe||eAe(e)<XOe)&&n()},l=setTimeout(s,QOe);return window.addEventListener("scrollend",s),window.addEventListener("scroll",o,{passive:!0}),()=>{clearTimeout(l),window.removeEventListener("scrollend",s),window.removeEventListener("scroll",o)}},[e,t,n])},oAe=e=>()=>{e(null)},iAe=e=>e===null||e.isOpening?null:{waypointId:e.waypointId,count:e.count},lAe=e=>{const[t,n]=N.useState(()=>new Set),[r,s]=N.useState(null),[o,l]=N.useState(null),[c,u]=N.useState(null),[f]=N.useState(()=>oAe(l)),h=e.flatMap(Dw),p=nAe(h.map(x=>x.anchorId));N.useEffect(()=>{c!==null&&QC(c.anchorId)},[c]),sAe(o,c,f);const y=(x,b)=>{const S=h.find(E=>E.id===x);S!==void 0&&(s(S.id),l(S.id),b&&n(E=>new Set([...E,S.id])),u(E=>({anchorId:S.anchorId,waypointId:S.id,isOpening:b,count:((E==null?void 0:E.count)??0)+1})))};return{openWaypointIds:t,previewVisit:iAe(c),currentWaypointId:r,focusedWaypointId:o,steppingOf:x=>{const b=Dw(x),S=b.find(C=>C.id===r)??null,E=rAe(b,S,p);return{positionLabel:(S==null?void 0:S.positionLabel)??null,canStepBack:E.previousId!==null,canStepForward:E.nextId!==null,onPrevious:()=>{y(E.previousId,!1)},onNext:()=>{y(E.nextId,!1)}}},onSectionEntered:x=>{const b=e.find(E=>E.walkthrough.anchorId===x),S=b===void 0?void 0:Dw(b).at(0);S!==void 0&&(s(S.id),l(null))},onVisitWaypoint:x=>{y(x,!1)},onToggleWaypoint:x=>{s(x),n(b=>new Set(b.has(x)?[...b].filter(S=>S!==x):[...b,x]))},onCurrentOpenChange:x=>{x||n(b=>new Set([...b].filter(S=>S!==r))),y(r,x)},onOpenCodeLink:x=>{const b=h.find(S=>S.anchorId===x);b===void 0?QC(x):y(b.id,!0)}}},aAe=(e,t)=>e==="open"||e==="unasked"&&!t,cAe=(e,t,n)=>{var S,E;const r=ws(),s=_o(),[o,l]=N.useState("unasked"),[c,u]=N.useState(null),f=Ga({...r.review.writeUpPlan.queryOptions({...e,sections:c}),enabled:t,placeholderData:Mx}),h=((S=f.data)==null?void 0:S.kind)==="plan"?f.data:null,p=async()=>{await Promise.all([s.invalidateQueries(r.review.get.pathFilter()),s.invalidateQueries(r.review.writeUpPlan.pathFilter())])},y=()=>{l("closed"),u(null)},x=kn(r.review.declineWriteUp.mutationOptions({onSuccess:p})),b=kn(r.review.writeUp.mutationOptions({onSuccess:async C=>{C.kind!=="rejected"&&(y(),C.kind==="started"&&C.prompt!==null?n.onCopy(C.prompt,C.message):n.onMessage(C.message),await p())},onError:C=>{n.onMessage(C.message)}}));return{plan:h!==null&&aAe(o,h.isOffered)?h:null,canWriteUp:h!==null,agent:h===null?null:{name:h.agent,label:h.agentLabel},problem:((E=b.data)==null?void 0:E.kind)==="rejected"?b.data:null,isPending:b.isPending,onOpen:()=>{b.reset(),l("open")},onSectionsChange:u,onSubmit:C=>{cOe(),b.mutate({...e,...C})},onClose:()=>{h!==null&&!h.isOffered&&x.mutate(e),y()}}},uAe=(e,t)=>{const n=ws(),r=_o(),s=kn(n.review.requestWriteUp.mutationOptions({onSuccess:async o=>{o.kind==="started"&&o.prompt!==null?t.onCopy(o.prompt,o.message):t.onMessage(o.message),await r.invalidateQueries(n.review.get.pathFilter())},onError:o=>{t.onMessage(o.message)}}));return o=>{s.mutate({...e,target:o})}},dAe=N.lazy(async()=>await Ut(()=>import("./index-EItMs0kz.js"),__vite__mapDeps([27,25]))),fAe=N.lazy(async()=>await Ut(()=>import("./index-CRQLJ5uq.js"),__vite__mapDeps([28,25]))),hAe=N.lazy(async()=>await Ut(()=>import("./index-Qxg2C8CP.js"),__vite__mapDeps([24,25]))),pAe=N.lazy(async()=>await Ut(()=>import("./index-CBObEG9P.js"),__vite__mapDeps([29,25]))),mAe=5e3,gAe="The backend did not say what went wrong.",yAe="Could not copy to the clipboard",ZC="Loading the editor…",xAe="Add a segment",bAe="New segment",vAe="This Flight Plan has no segments yet.",SAe="Publish anyway",wAe="Arrange segments",EAe="Move a segment up or down. The order is saved as you go.",CAe="Arrange files",TAe="Move a file up or down in the Code Walkthrough. The order is saved as you go.",NAe=[],mP=[],RAe="[--line:var(--primary-text)]",OAe="[--band-height:3.5rem] [--pinned-height:calc(var(--band-height)+var(--strip-height,0px))] [--section-scroll-margin:calc(var(--pinned-height)+1rem)] [--file-header-top:var(--pinned-height)] [--waypoint-scroll-margin:calc(var(--pinned-height)+3.5rem)] [--chat-width:26rem] [--navigator-inset-left:calc(1.5rem+13rem+2rem)]",AAe="[--strip-height:2.75rem]",kAe="[--navigator-inset-right:1.5rem]",_Ae="[--navigator-inset-right:calc(var(--chat-width)+1.5rem)] [--navigator-band-right:var(--chat-width)]",MAe=({writingLabel:e,agent:t,children:n})=>g.jsx(x6,{value:e,children:g.jsx(vb,{value:t,children:n})}),jw=e=>g.jsx(N.Suspense,{fallback:g.jsx("p",{className:"text-sm text-muted-foreground",children:ZC}),children:g.jsx(pAe,{...e})}),$7=(e,t)=>({repositoryName:e.repoName,targetId:e.branchId,filterKeys:[...t.filter??[]],isShowingReviewed:t.reviewed===!0}),Xke=({params:e,search:t,onSearchChange:n})=>{var be,Ae,Me,Le;const r=ws(),s=_o(),o=lm(),l=N.use(N4),c={repositoryName:e.repoName,targetId:e.branchId},{data:u}=cq({...r.review.get.queryOptions($7(e,t)),refetchInterval:mAe,refetchIntervalInBackground:!0}),[f,h]=N.useState(null),[p,y]=N.useState(!1),[x,b]=N.useState(!1),[S,E]=N.useState(null),[C,R]=SOe(),{isOwn:T}=u,O=u.kind==="artifact"?u.progress:null,k=(O==null?void 0:O.permission)??null;dOe(`${e.repoName}/${e.branchId}`,O!==null,u.kind==="artifact"?u.completion:null,R);const M=aOe(),A=fOe(c),L=yOe(c,R),I=COe(c,R),j=TOe(c,R),P=YOe(c,{isPending:j.isPending,renderCodeLinkDialog:ue=>g.jsx(Uh,{reviewKey:c,...ue}),onRemoveFile:j.onRemoveFile,onRemoveWaypoint:j.onRemoveWaypoint}),B=gOe(c,R),H=rOe(c,R),D=bOe(c),F=async()=>{await s.invalidateQueries(r.review.get.pathFilter())},z=ue=>{R(ue.message)},q=(ue,Re)=>{navigator.clipboard.writeText(ue).then(()=>{R(Re)},()=>{R(yAe)})},V=cAe(c,u.kind==="artifact",{onMessage:R,onCopy:q}),G=uAe(c,{onMessage:R,onCopy:q}),K=V.canWriteUp?G:null,X=kn(r.review.setReviewed.mutationOptions({onSuccess:F,onError:z})),ee=kn(r.review.publish.mutationOptions({onSuccess:async({message:ue})=>{R(ue),await F()},onError:z})),ae=kn(r.review.markComplete.mutationOptions({onSuccess:async({message:ue,targetId:Re})=>{R(ue),b(!1),await F(),Re!==e.branchId&&o({to:"/pr-reviews/$repoName/$branchId",params:{repoName:e.repoName,branchId:Re}})},onError:z})),$=kn(r.review.delete.mutationOptions({onSuccess:async()=>{s.removeQueries(r.review.get.pathFilter()),await o({to:"/"})},onError:z})),Y=u.kind==="artifact"?u:null,J=(Y==null?void 0:Y.segments.find(ue=>ue.id===S))??null,ne=lAe((Y==null?void 0:Y.segments)??mP),{openWaypointIds:W,currentWaypointId:ce}=ne,ye=ne.onOpenCodeLink,pe=ne.onToggleWaypoint,le=[...(Y==null?void 0:Y.rail.groups.flatMap(ue=>ue.sections))??[],...(Y==null?void 0:Y.rail.sections)??[]],re=vde(le.flatMap(ue=>[ue.anchorId,...ue.children.map(Re=>Re.anchorId)])),he=$Oe((Y==null?void 0:Y.segments)??mP,ne,re,{onReviewedChange:T?null:(ue,Re)=>{X.mutate({...c,subject:{kind:"waypoint",id:ue},isReviewed:Re})},onFilterChange:ue=>{n({filter:ue===null?void 0:[...ue]})},onShowReviewedChange:T?null:ue=>{n({reviewed:ue?!0:void 0})},onCommentOnWaypoint:T||(Y==null?void 0:Y.composer)==null?null:B.onStartRangeComment,onWriteDescription:T?P.onWriteDescription:null,onWriteUp:K,agentLabel:((be=V.agent)==null?void 0:be.label)??null}),Se=ue=>{const Re=Y==null?void 0:Y.segments.find(ze=>ze.anchorId===ue);Re!==void 0&&(L.authoringOf(Re.id).writing.onEdit(),QC(ue))},_e=(ue,Re)=>{s.query({...r.review.codeReference.queryOptions({...c,path:ue.path,lineStart:ue.lineStart,lineEnd:ue.lineEnd}),staleTime:"static"}).then(Re,ze=>{R(ze instanceof Error?ze.message:gAe)})};return g.jsxs("div",{className:xe("px-6 pb-24 transition-[margin] duration-200 ease-out",H.isOpen?["mr-(--chat-width)",_Ae]:kAe,RAe,OAe,O===null?null:AAe),children:[g.jsx("title",{children:u.shell.documentTitle}),l===null?null:Us.createPortal(g.jsxs(g.Fragment,{children:[g.jsx(Dte,{lineColor:"primary"}),g.jsx(Kfe,{header:u.shell.header,changedFiles:u.kind==="missing"?u.changedFiles:null,authorLabel:u.shell.authorLabel,reviewerRequesting:B.reviewerRequesting,targetSwitching:D,actions:u.kind==="missing"?g.jsx(ME,{links:uE,useThemeToggle:sE}):g.jsxs(g.Fragment,{children:[g.jsx(jde,{label:u.chatLabel,isPressed:H.isOpen,onClick:H.onToggle}),!T||u.unassignedFiles===null?null:g.jsx(zde,{label:u.unassignedFiles.label,onClick:()=>{h({kind:"list"})}}),u.completeAction===null?null:g.jsx(Pde,{label:u.completeAction.label,isPending:ae.isPending,onClick:()=>{var ue;((ue=u.completeAction)==null?void 0:ue.pullRequestChoice)==null?ae.mutate({...c,pullRequestTargetId:null}):b(!0)}}),u.sharing===null?null:g.jsx(Hde,{sharing:u.sharing,publishingKey:ee.isPending?ee.variables.destination:null,onPublish:ue=>{u.unassignedFiles===null?ee.mutate({...c,destination:ue}):h({kind:"publish",destination:ue})}}),u.reviewDraft===null?null:g.jsx(Bde,{draft:u.reviewDraft,isSubmitting:B.isSubmitting,isDiscarding:B.isDiscarding,errorMessage:B.submissionError,submissionCount:B.submissionCount,renderEditor:jw,onSubmit:B.onSubmit,onDiscard:B.onDiscardComment}),g.jsx(ME,{links:uE,useThemeToggle:sE,reviewActions:{forgeLink:u.shell.header.kind==="pull-request"?u.shell.header.forgeLink:null,onWriteUp:V.canWriteUp?V.onOpen:null,onDelete:()=>{$.mutate(c)}}})]})})]}),l),u.kind==="missing"?g.jsx("div",{className:"max-w-208",children:g.jsx(JRe,{heading:u.heading,message:u.message})}):null,u.kind==="missing"?null:g.jsx(nse,{rail:u.rail,onSectionJump:ne.onSectionEntered,children:g.jsxs(MAe,{writingLabel:((Ae=u.progress)==null?void 0:Ae.isWriting)===!0?u.progress.label:null,agent:V.agent,children:[g.jsx(BRe,{staleNotice:u.staleNotice,unassignedFiles:T?null:u.unassignedFiles,progress:u.progress,onShowUnassignedFiles:()=>{h({kind:"list"})},onCopyPrompt:q}),g.jsxs("div",{className:"grid grid-cols-[13rem_minmax(0,1fr)] gap-x-8",children:[g.jsx("aside",{className:"sticky top-[calc(var(--pinned-height)+0.5rem)] max-h-[calc(100dvh-var(--pinned-height)-1rem)] self-start overflow-y-auto pt-5 pb-4",children:g.jsx(Xfe,{label:"Review sections",groups:u.rail.groups,sections:u.rail.sections,currentAnchorId:re,onEditGroup:T?Se:null,onArrangeGroups:T&&u.segments.some(ue=>ue.outline.canMoveUp)?()=>{y(!0)}:null})}),g.jsxs("div",{className:"min-w-0",children:[u.segments.map(ue=>g.jsxs("section",{id:ue.anchorId,"aria-label":(T?ue.outline.heading:ue.heading)??void 0,className:"scroll-mt-(--section-scroll-margin) not-first:border-t-4 not-first:border-foreground",children:[g.jsx(QRe,{reviewKey:c,heading:ue.heading,isTitleDraft:ue.isTitleDraft,detailLabel:ue.detailLabel,outline:ue.outline,authoring:T&&ue.heading!==null?L.authoringOf(ue.id):null}),g.jsx(Sde,{order:ue.sectionOrder,sections:{context:g.jsx(kRe,{...ue.context,writeUpNotice:ue.writeUpNotices.context,codeLinks:u.codeLinks,editing:T?A(ue.id):null,renderCodeLinkDialog:Re=>g.jsx(Uh,{reviewKey:c,...Re}),onOpenCodeLink:ye}),traceDiagram:g.jsx(YSe,{...ue.traceDiagram,writeUpNotice:ue.writeUpNotices.traceDiagram,codeLinks:u.codeLinks,codeDefinitions:u.codeDefinitions,isReviewPending:X.isPending,authoring:T?I.authoringOf(ue.id):null,cardMoving:u.canMoveCards?I.cardMovingOf(ue.id):null,onWriteUpNode:K===null?null:Re=>{K({kind:"trace-node",segmentId:ue.id,nodeId:Re})},tabEditing:{authoringOf:Re=>T?I.authoringOf(Re):null,cardMovingOf:Re=>u.canMoveCards?I.cardMovingOf(Re):null,writeUpOf:Re=>K===null?null:ze=>{K({kind:"trace-node",segmentId:Re,nodeId:ze})}},renderDescriptionEditor:T?Re=>g.jsx(N.Suspense,{fallback:g.jsx("p",{className:"text-sm text-muted-foreground",children:ZC}),children:g.jsx(hAe,{...Re,renderCodeLinkDialog:ze=>g.jsx(Uh,{reviewKey:c,...ze})})}):null,onOpenCodeLink:ye,onWaypointReviewedChange:T?null:(Re,ze)=>{X.mutate({...c,subject:{kind:"waypoint",id:Re},isReviewed:ze})}}),blastDiagram:g.jsx(g.Fragment,{children:ue.blastDiagram===null?null:g.jsx(lae,{...ue.blastDiagram,writeUpNotice:ue.writeUpNotices.blastDiagram,onWriteUpFile:K===null?null:Re=>{K({kind:"blast-file",segmentId:ue.id,path:Re})},codeLinks:u.codeLinks,renderImpactEditor:T?Re=>g.jsx(N.Suspense,{fallback:g.jsx("p",{className:"text-muted-foreground",children:ZC}),children:g.jsx(fAe,{...Re,reviewKey:c,renderCodeLinkDialog:ze=>g.jsx(Uh,{reviewKey:c,...ze})},Re.path)}):null,onOpenCodeLink:ye,onOpenFile:ye})}),walkthrough:g.jsx(dce,{anchorId:ue.walkthrough.anchorId,heading:ue.walkthrough.heading,coverageLabel:ue.walkthrough.coverageLabel,emptyMessage:ue.walkthrough.emptyMessage,writeUpNotice:ue.writeUpNotices.walkthrough,navigation:he.navigationOf(ue),onArrangeFiles:T&&ue.walkthrough.fileOrder.length>1?()=>{E(ue.id)}:null,children:ue.walkthrough.files.map(Re=>g.jsx(yde,{file:Re,openWaypointIds:W,currentWaypointId:ce,focusedWaypointId:ne.focusedWaypointId,previewVisit:ne.previewVisit,isCollapsed:he.isFileCollapsed(Re.anchorId),isReviewPending:X.isPending,composer:T?null:u.composer,composingRange:B.composingRangeOf(Re.path),isCommentPending:B.isCommentPending,renderCommentEditor:jw,codeLinks:u.codeLinks,codeDefinitions:u.codeDefinitions,onOpenCodeLink:ye,onToggleWaypoint:pe,onCollapsedChange:ze=>{he.onFileCollapsedChange(Re.anchorId,ze)},onWaypointReviewedChange:T?null:(ze,ke)=>{X.mutate({...c,subject:{kind:"waypoint",id:ze},isReviewed:ke})},onFileReviewedChange:T?null:(ze,ke)=>{X.mutate({...c,subject:{kind:"file",path:ze},isReviewed:ke})},onRootBlockReviewedChange:T?null:(ze,ke)=>{X.mutate({...c,subject:{kind:"root-block",id:ze},isReviewed:ke})},onStartComment:B.onStartComment,onAddComment:B.onAddComment,onPostComment:B.onPostComment,onReply:B.onReply,onResolveThread:B.onResolveThread,onDiscardComment:B.onDiscardComment,onWriteUp:K,authoring:T?P.authoringOf(ue.id,Re):null,headerActions:T?P.headerActionsOf(ue.id,Re):null},Re.anchorId))})}})]},ue.id)),T&&u.segments.length===0&&!L.addition.isWriting?g.jsx("p",{className:"pt-6 text-muted-foreground",children:vAe}):null,T&&L.addition.isWriting?g.jsx(H7,{reviewKey:c,legend:bAe,label:"",paths:NAe,isSaving:L.addition.isSaving,isDeleting:!1,errorMessage:L.addition.errorMessage,onSave:L.addition.onSave,onDelete:null,onClose:L.addition.onCancel}):null,T&&!L.addition.isWriting&&u.segments.every(ue=>ue.heading!==null)?g.jsx(st,{variant:"outline",className:"mt-6",onClick:L.addition.onEdit,children:xAe}):null,u.conversation===null||u.composer===null?null:g.jsx(_Re,{anchorId:u.conversation.anchorId,heading:u.conversation.heading,emptyMessage:u.conversation.emptyMessage,entries:u.conversation.entries,placeholder:u.composer.placeholder,submitLabel:u.composer.commentLabel,isSubmitting:B.isCommentPending,renderEditor:jw,onComment:B.onComment})]})]}),p&&T?g.jsx(DD,{title:wAe,description:EAe,entries:u.segments.map(ue=>({id:ue.id,...ue.outline})),isPending:L.isPending,onMove:L.onMove,onClose:()=>{y(!1)}}):null,!T||J===null?null:g.jsx(DD,{title:CAe,description:TAe,entries:J.walkthrough.fileOrder.map(ue=>({id:ue.path,...ue})),isPending:j.isPending,onMove:(ue,Re)=>{j.onMoveFile(J.id,ue,Re,J.walkthrough.fileOrder.map(ze=>ze.path))},onClose:()=>{E(null)}}),!T||I.cardAddition===null?null:g.jsx(iwe,{reviewKey:c,addition:I.cardAddition}),!T||I.cardChange===null?null:g.jsx(N.Suspense,{fallback:null,children:g.jsx(dAe,{reviewKey:c,change:I.cardChange,renderCodeLinkDialog:ue=>g.jsx(Uh,{reviewKey:c,...ue})})}),V.plan===null?null:g.jsx(N1e,{plan:V.plan,problem:V.problem,isPending:V.isPending,onSectionsChange:V.onSectionsChange,onSubmit:V.onSubmit,onClose:V.onClose}),x&&((Me=u.completeAction)==null?void 0:Me.pullRequestChoice)!=null?g.jsx(yRe,{choice:u.completeAction.pullRequestChoice,isPending:ae.isPending,onComplete:ue=>{ae.mutate({...c,pullRequestTargetId:ue})},onClose:()=>{b(!1)}}):null,f===null||u.unassignedFiles===null?null:g.jsx(nOe,{title:u.unassignedFiles.title,description:u.unassignedFiles.description,paths:u.unassignedFiles.paths,confirmation:f.kind==="list"?null:{warning:u.unassignedFiles.publishWarning,confirmLabel:SAe,onConfirm:()=>{ee.mutate({...c,destination:f.destination}),h(null)}},onClose:()=>{h(null)}}),g.jsx(ZRe,{selection:M,onComment:(ue,Re)=>{var ze;B.onStartRangeComment(ue,Re),(ze=window.getSelection())==null||ze.removeAllRanges()},onAsk:ue=>{_e(ue,({reference:Re})=>{H.onAsk(Re)})}}),H.isOpen&&H.conversation!==void 0?g.jsx(Cae,{conversation:H.conversation,modelChoice:H.modelChoice,codeLinks:u.codeLinks,reference:H.reference,isSending:H.isSending,sendProblem:H.sendProblem,answering:H.answering,onSend:H.onSend,onAnswer:H.onAnswer,onChooseModel:H.onChooseModel,onClearReference:H.onClearReference,onOpenCodeLink:ye,onClose:H.onClose}):null,g.jsx(TB,{}),g.jsx(dfe,{reviewMode:T?"user":"teammate"})]})}),k===null?null:g.jsx(DRe,{request:k,isAnswering:H.answering.pendingBatchId===k.batchId,problem:((Le=H.answering.rejection)==null?void 0:Le.batchId)===k.batchId?H.answering.rejection.message:null,onAnswer:(ue,Re)=>{H.onAnswer(k.batchId,[{questionId:k.questionId,pickedLabels:[ue],text:Re}])}},k.batchId),g.jsx(Qfe,{message:C})]})},Qke=({error:e})=>g.jsx(q4,{heading:"MAYDAY! MAYDAY! We couldn't open this review",error:e,className:"px-6 pt-8",children:g.jsx(ri,{to:"/",className:"underline",children:"Go to your repositories"})}),IAe=e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):void 0,LAe=e=>({filter:IAe(e.filter),reviewed:e.reviewed===!0?!0:void 0}),DAe=()=>Ut(()=>import("./_branchId-PhBseeXo.js"),[]),jAe=()=>Ut(()=>import("./_branchId-438YLxpk.js"),[]),PAe=Ss()({staticData:{isFullWidth:!0,hasPageSettingsMenu:!0},validateSearch:LAe,loaderDeps:({search:e})=>e,loader:async({context:{queryClient:e,trpc:t},params:n,deps:r})=>{await e.query({...t.review.get.queryOptions($7(n,r)),staleTime:"static"})},component:mn(jAe,"component"),pendingComponent:Mte,errorComponent:mn(DAe,"errorComponent")}),zAe=()=>Ut(()=>import("./create-t6MxPYs8.js"),[]),BAe=()=>Ut(()=>import("./create-Byti8N1q.js"),[]),HAe=Ss()({loader:async({context:{queryClient:e,trpc:t},params:n})=>{await e.query({...t.review.creationForm.queryOptions({repositoryName:n.repoName}),staleTime:"static"})},component:mn(BAe,"component"),errorComponent:mn(zAe,"errorComponent")}),FAe=()=>Ut(()=>import("./index-CSy69oc4.js"),__vite__mapDeps([30,6])),$Ae=()=>Ut(()=>import("./index-Cjx98rmL.js"),__vite__mapDeps([31,11])),UAe=Ss()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.configuration.list.queryOptions(),staleTime:"static"})},component:mn($Ae,"component"),pendingComponent:Cu,errorComponent:mn(FAe,"errorComponent")}),VAe=()=>Ut(()=>import("./_id-z15a_Wqg.js"),__vite__mapDeps([32,6])),qAe=()=>Ut(()=>import("./_id-yAHjl11v.js"),__vite__mapDeps([33,25])),GAe=Ss()({validateSearch:e=>typeof e.field=="string"?{field:e.field}:{},loaderDeps:({search:e})=>({field:e.field??null}),loader:async({context:{queryClient:e,trpc:t},params:n,deps:r})=>{await e.query({...t.configuration.get.queryOptions({id:n.id,field:r.field}),staleTime:"static"})},component:mn(qAe,"component"),pendingComponent:Cu,errorComponent:mn(VAe,"errorComponent")}),KAe=()=>Ut(()=>import("./create-DiPNM_Jx.js"),__vite__mapDeps([34,6])),YAe=()=>Ut(()=>import("./create-DHjp2cB6.js"),__vite__mapDeps([35,11])),WAe=Ss()({loader:async({context:{queryClient:e,trpc:t}})=>{await e.query({...t.configuration.creationForm.queryOptions(),staleTime:"static"})},component:mn(YAe,"component"),pendingComponent:Cu,errorComponent:mn(KAe,"errorComponent")}),XAe=nte.update({id:"/",path:"/",getParentRoute:()=>Eu}),Sl=ste.update({id:"/settings",path:"/settings",getParentRoute:()=>Eu}),QAe=ote.update({id:"/",path:"/",getParentRoute:()=>Sl}),ZAe=ute.update({id:"/agents",path:"/agents",getParentRoute:()=>Sl}),JAe=pte.update({id:"/forges",path:"/forges",getParentRoute:()=>Sl}),eke=xte.update({id:"/repositories",path:"/repositories",getParentRoute:()=>Sl}),tke=wte.update({id:"/review",path:"/review",getParentRoute:()=>Sl}),nke=Ote.update({id:"/setup/",path:"/setup/",getParentRoute:()=>Eu}),rke=_te.update({id:"/artifact/claude/download",path:"/artifact/claude/download",getParentRoute:()=>Eu}),ske=PAe.update({id:"/pr-reviews/$repoName/$branchId",path:"/pr-reviews/$repoName/$branchId",getParentRoute:()=>Eu}),oke=HAe.update({id:"/pr-reviews/$repoName/create",path:"/pr-reviews/$repoName/create",getParentRoute:()=>Eu}),ike=UAe.update({id:"/profiles/",path:"/profiles/",getParentRoute:()=>Sl}),lke=GAe.update({id:"/profiles/$id",path:"/profiles/$id",getParentRoute:()=>Sl}),ake=WAe.update({id:"/profiles/create",path:"/profiles/create",getParentRoute:()=>Sl}),cke={SettingsAgentsRoute:ZAe,SettingsForgesRoute:JAe,SettingsRepositoriesRoute:eke,SettingsReviewRoute:tke,SettingsIndexRoute:QAe,SettingsProfilesIdRoute:lke,SettingsProfilesCreateRoute:ake,SettingsProfilesIndexRoute:ike},uke=Sl._addFileChildren(cke),dke={IndexRoute:XAe,SettingsRouteRoute:uke,SetupIndexRoute:nke,ArtifactClaudeDownloadRoute:rke,PrReviewsRepoNameBranchIdRoute:ske,PrReviewsRepoNameCreateRoute:oke},fke=Eu._addFileChildren(dke)._addFileTypes(),hke=(e,t)=>oK({routeTree:fke,context:e,defaultPreload:"intent",defaultPreloadStaleTime:0,...t===void 0?{}:{history:t}}),pke=({queryClient:e,trpcClient:t,history:n})=>{const r=hke({queryClient:e,trpc:rX(t,e)},n);return g.jsx(NV,{client:e,children:g.jsx(eX,{trpcClient:t,queryClient:e,children:g.jsx(aK,{router:r})})})},U7=document.getElementById("root");if(!U7)throw new Error("Missing #root element in index.html");const mke=pke({queryClient:new QV,trpcClient:nX(tX())});mq.createRoot(U7).render(g.jsx(N.StrictMode,{children:mke}));export{Tke as $,jf as A,st as B,su as C,pl as D,Ite as E,cq as F,N4 as G,bu as H,Nr as I,Us as J,Dte as K,uf as L,ite as M,dte as N,C4 as O,mte as P,bte as Q,nte as R,Y1e as S,Lf as T,Ote as U,Koe as V,Yoe as W,Woe as X,zm as Y,bae as Z,Cke as _,ml as a,Gb as a$,n1e as a0,u1e as a1,ct as a2,qK as a3,nM as a4,_te as a5,Ate as a6,xke as a7,Qke as a8,PAe as a9,Gs as aA,p7 as aB,vke as aC,Jp as aD,VC as aE,QNe as aF,Gke as aG,wTe as aH,Ue as aI,dt as aJ,_Ne as aK,Yke as aL,Uke as aM,qke as aN,Rt as aO,Vke as aP,jke as aQ,Dke as aR,nt as aS,xTe as aT,Rke as aU,_n as aV,R7 as aW,Ake as aX,O7 as aY,OTe as aZ,MNe as a_,Xke as aa,lm as ab,HAe as ac,GAe as ad,kF as ae,Vp as af,MF as ag,pi as ah,sNe as ai,gp as aj,jN as ak,Kt as al,We as am,Pke as an,Fke as ao,kke as ap,TTe as aq,zke as ar,bNe as as,rT as at,si as au,$ke as av,y2 as aw,Lo as ax,Kke as ay,kx as az,gl as b,Hke as b0,em as b1,Mke as b2,Ie as b3,Lke as b4,Ike as b5,_ke as b6,lr as b7,Bke as b8,Ywe as b9,g2e as ba,En as bb,Oo as bc,Nke as bd,N2e as be,T2e as bf,BN as bg,k2 as bh,m6 as bi,g6 as bj,Vx as bk,y6 as bl,Oke as bm,Wke as bn,oy as bo,xl as c,bl as d,yl as e,wke as f,ws as g,_o as h,Ga as i,g as j,kn as k,Mx as l,Cz as m,Tz as n,Nz as o,Ske as p,Rz as q,N as r,RF as s,Bd as t,qs as u,SY as v,cp as w,ri as x,Eke as y,xe as z};
|