@kitschpatrol/tldraw-cli 5.0.6 → 5.0.7

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.
@@ -1,12 +1,12 @@
1
- function bZ(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ja(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var sC={exports:{}},Qp={};var fR;function vZ(){if(fR)return Qp;fR=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var a in i)a!=="key"&&(s[a]=i[a])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:o,ref:i!==void 0?i:null,props:s}}return Qp.Fragment=e,Qp.jsx=n,Qp.jsxs=n,Qp}var pR;function xZ(){return pR||(pR=1,sC.exports=vZ()),sC.exports}var y=xZ(),oC={exports:{}},ut={};var gR;function wZ(){if(gR)return ut;gR=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),g=Symbol.iterator;function m(U){return U===null||typeof U!="object"?null:(U=g&&U[g]||U["@@iterator"],typeof U=="function"?U:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,x={};function v(U,ne,le){this.props=U,this.context=ne,this.refs=x,this.updater=le||b}v.prototype.isReactComponent={},v.prototype.setState=function(U,ne){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,ne,"setState")},v.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function C(){}C.prototype=v.prototype;function P(U,ne,le){this.props=U,this.context=ne,this.refs=x,this.updater=le||b}var k=P.prototype=new C;k.constructor=P,w(k,v.prototype),k.isPureReactComponent=!0;var M=Array.isArray;function A(){}var O={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function F(U,ne,le){var fe=le.ref;return{$$typeof:t,type:U,key:ne,ref:fe!==void 0?fe:null,props:le}}function N(U,ne){return F(U.type,ne,U.props)}function j(U){return typeof U=="object"&&U!==null&&U.$$typeof===t}function H(U){var ne={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(le){return ne[le]})}var V=/\/+/g;function z(U,ne){return typeof U=="object"&&U!==null&&U.key!=null?H(""+U.key):ne.toString(36)}function K(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(A,A):(U.status="pending",U.then(function(ne){U.status==="pending"&&(U.status="fulfilled",U.value=ne)},function(ne){U.status==="pending"&&(U.status="rejected",U.reason=ne)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function B(U,ne,le,fe,me){var _e=typeof U;(_e==="undefined"||_e==="boolean")&&(U=null);var xe=!1;if(U===null)xe=!0;else switch(_e){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(U.$$typeof){case t:case e:xe=!0;break;case f:return xe=U._init,B(xe(U._payload),ne,le,fe,me)}}if(xe)return me=me(U),xe=fe===""?"."+z(U,0):fe,M(me)?(le="",xe!=null&&(le=xe.replace(V,"$&/")+"/"),B(me,ne,le,"",function(He){return He})):me!=null&&(j(me)&&(me=N(me,le+(me.key==null||U&&U.key===me.key?"":(""+me.key).replace(V,"$&/")+"/")+xe)),ne.push(me)),1;xe=0;var Pe=fe===""?".":fe+":";if(M(U))for(var Oe=0;Oe<U.length;Oe++)fe=U[Oe],_e=Pe+z(fe,Oe),xe+=B(fe,ne,le,_e,me);else if(Oe=m(U),typeof Oe=="function")for(U=Oe.call(U),Oe=0;!(fe=U.next()).done;)fe=fe.value,_e=Pe+z(fe,Oe++),xe+=B(fe,ne,le,_e,me);else if(_e==="object"){if(typeof U.then=="function")return B(K(U),ne,le,fe,me);throw ne=String(U),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return xe}function G(U,ne,le){if(U==null)return U;var fe=[],me=0;return B(U,fe,"","",function(_e){return ne.call(le,_e,me++)}),fe}function W(U){if(U._status===-1){var ne=U._result;ne=ne(),ne.then(function(le){(U._status===0||U._status===-1)&&(U._status=1,U._result=le)},function(le){(U._status===0||U._status===-1)&&(U._status=2,U._result=le)}),U._status===-1&&(U._status=0,U._result=ne)}if(U._status===1)return U._result.default;throw U._result}var Z=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},de={map:G,forEach:function(U,ne,le){G(U,function(){ne.apply(this,arguments)},le)},count:function(U){var ne=0;return G(U,function(){ne++}),ne},toArray:function(U){return G(U,function(ne){return ne})||[]},only:function(U){if(!j(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return ut.Activity=h,ut.Children=de,ut.Component=v,ut.Fragment=n,ut.Profiler=i,ut.PureComponent=P,ut.StrictMode=r,ut.Suspense=l,ut.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,ut.__COMPILER_RUNTIME={__proto__:null,c:function(U){return O.H.useMemoCache(U)}},ut.cache=function(U){return function(){return U.apply(null,arguments)}},ut.cacheSignal=function(){return null},ut.cloneElement=function(U,ne,le){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var fe=w({},U.props),me=U.key;if(ne!=null)for(_e in ne.key!==void 0&&(me=""+ne.key),ne)!R.call(ne,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&ne.ref===void 0||(fe[_e]=ne[_e]);var _e=arguments.length-2;if(_e===1)fe.children=le;else if(1<_e){for(var xe=Array(_e),Pe=0;Pe<_e;Pe++)xe[Pe]=arguments[Pe+2];fe.children=xe}return F(U.type,me,fe)},ut.createContext=function(U){return U={$$typeof:o,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:s,_context:U},U},ut.createElement=function(U,ne,le){var fe,me={},_e=null;if(ne!=null)for(fe in ne.key!==void 0&&(_e=""+ne.key),ne)R.call(ne,fe)&&fe!=="key"&&fe!=="__self"&&fe!=="__source"&&(me[fe]=ne[fe]);var xe=arguments.length-2;if(xe===1)me.children=le;else if(1<xe){for(var Pe=Array(xe),Oe=0;Oe<xe;Oe++)Pe[Oe]=arguments[Oe+2];me.children=Pe}if(U&&U.defaultProps)for(fe in xe=U.defaultProps,xe)me[fe]===void 0&&(me[fe]=xe[fe]);return F(U,_e,me)},ut.createRef=function(){return{current:null}},ut.forwardRef=function(U){return{$$typeof:a,render:U}},ut.isValidElement=j,ut.lazy=function(U){return{$$typeof:f,_payload:{_status:-1,_result:U},_init:W}},ut.memo=function(U,ne){return{$$typeof:u,type:U,compare:ne===void 0?null:ne}},ut.startTransition=function(U){var ne=O.T,le={};O.T=le;try{var fe=U(),me=O.S;me!==null&&me(le,fe),typeof fe=="object"&&fe!==null&&typeof fe.then=="function"&&fe.then(A,Z)}catch(_e){Z(_e)}finally{ne!==null&&le.types!==null&&(ne.types=le.types),O.T=ne}},ut.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},ut.use=function(U){return O.H.use(U)},ut.useActionState=function(U,ne,le){return O.H.useActionState(U,ne,le)},ut.useCallback=function(U,ne){return O.H.useCallback(U,ne)},ut.useContext=function(U){return O.H.useContext(U)},ut.useDebugValue=function(){},ut.useDeferredValue=function(U,ne){return O.H.useDeferredValue(U,ne)},ut.useEffect=function(U,ne){return O.H.useEffect(U,ne)},ut.useEffectEvent=function(U){return O.H.useEffectEvent(U)},ut.useId=function(){return O.H.useId()},ut.useImperativeHandle=function(U,ne,le){return O.H.useImperativeHandle(U,ne,le)},ut.useInsertionEffect=function(U,ne){return O.H.useInsertionEffect(U,ne)},ut.useLayoutEffect=function(U,ne){return O.H.useLayoutEffect(U,ne)},ut.useMemo=function(U,ne){return O.H.useMemo(U,ne)},ut.useOptimistic=function(U,ne){return O.H.useOptimistic(U,ne)},ut.useReducer=function(U,ne,le){return O.H.useReducer(U,ne,le)},ut.useRef=function(U){return O.H.useRef(U)},ut.useState=function(U){return O.H.useState(U)},ut.useSyncExternalStore=function(U,ne,le){return O.H.useSyncExternalStore(U,ne,le)},ut.useTransition=function(){return O.H.useTransition()},ut.version="19.2.1",ut}var mR;function wI(){return mR||(mR=1,oC.exports=wZ()),oC.exports}var E=wI();const qe=Ja(E),AB=bZ({__proto__:null,default:qe},[E]);var aC={exports:{}},eg={},lC={exports:{}},cC={};var yR;function CZ(){return yR||(yR=1,(function(t){function e(B,G){var W=B.length;B.push(G);e:for(;0<W;){var Z=W-1>>>1,de=B[Z];if(0<i(de,G))B[Z]=G,B[W]=de,W=Z;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var G=B[0],W=B.pop();if(W!==G){B[0]=W;e:for(var Z=0,de=B.length,U=de>>>1;Z<U;){var ne=2*(Z+1)-1,le=B[ne],fe=ne+1,me=B[fe];if(0>i(le,W))fe<de&&0>i(me,le)?(B[Z]=me,B[fe]=W,Z=fe):(B[Z]=le,B[ne]=W,Z=ne);else if(fe<de&&0>i(me,W))B[Z]=me,B[fe]=W,Z=fe;else break e}}return G}function i(B,G){var W=B.sortIndex-G.sortIndex;return W!==0?W:B.id-G.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],f=1,h=null,g=3,m=!1,b=!1,w=!1,x=!1,v=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function k(B){for(var G=n(u);G!==null;){if(G.callback===null)r(u);else if(G.startTime<=B)r(u),G.sortIndex=G.expirationTime,e(l,G);else break;G=n(u)}}function M(B){if(w=!1,k(B),!b)if(n(l)!==null)b=!0,A||(A=!0,H());else{var G=n(u);G!==null&&K(M,G.startTime-B)}}var A=!1,O=-1,R=5,F=-1;function N(){return x?!0:!(t.unstable_now()-F<R)}function j(){if(x=!1,A){var B=t.unstable_now();F=B;var G=!0;try{e:{b=!1,w&&(w=!1,C(O),O=-1),m=!0;var W=g;try{t:{for(k(B),h=n(l);h!==null&&!(h.expirationTime>B&&N());){var Z=h.callback;if(typeof Z=="function"){h.callback=null,g=h.priorityLevel;var de=Z(h.expirationTime<=B);if(B=t.unstable_now(),typeof de=="function"){h.callback=de,k(B),G=!0;break t}h===n(l)&&r(l),k(B)}else r(l);h=n(l)}if(h!==null)G=!0;else{var U=n(u);U!==null&&K(M,U.startTime-B),G=!1}}break e}finally{h=null,g=W,m=!1}G=void 0}}finally{G?H():A=!1}}}var H;if(typeof P=="function")H=function(){P(j)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,z=V.port2;V.port1.onmessage=j,H=function(){z.postMessage(null)}}else H=function(){v(j,0)};function K(B,G){O=v(function(){B(t.unstable_now())},G)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(B){switch(g){case 1:case 2:case 3:var G=3;break;default:G=g}var W=g;g=G;try{return B()}finally{g=W}},t.unstable_requestPaint=function(){x=!0},t.unstable_runWithPriority=function(B,G){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var W=g;g=B;try{return G()}finally{g=W}},t.unstable_scheduleCallback=function(B,G,W){var Z=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?Z+W:Z):W=Z,B){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=W+de,B={id:f++,callback:G,priorityLevel:B,startTime:W,expirationTime:de,sortIndex:-1},W>Z?(B.sortIndex=W,e(u,B),n(l)===null&&B===n(u)&&(w?(C(O),O=-1):w=!0,K(M,W-Z))):(B.sortIndex=de,e(l,B),b||m||(b=!0,A||(A=!0,H()))),B},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(B){var G=g;return function(){var W=g;g=G;try{return B.apply(this,arguments)}finally{g=W}}}})(cC)),cC}var SR;function TZ(){return SR||(SR=1,lC.exports=CZ()),lC.exports}var uC={exports:{}},vi={};var bR;function EZ(){if(bR)return vi;bR=1;var t=wI();function e(l){var u="https://react.dev/errors/"+l;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)u+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+l+"; visit "+u+" 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(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(l,u,f){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:h==null?null:""+h,children:l,containerInfo:u,implementation:f}}var o=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(l,u){if(l==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return vi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,vi.createPortal=function(l,u){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(e(299));return s(l,u,null,f)},vi.flushSync=function(l){var u=o.T,f=r.p;try{if(o.T=null,r.p=2,l)return l()}finally{o.T=u,r.p=f,r.d.f()}},vi.preconnect=function(l,u){typeof l=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(l,u))},vi.prefetchDNS=function(l){typeof l=="string"&&r.d.D(l)},vi.preinit=function(l,u){if(typeof l=="string"&&u&&typeof u.as=="string"){var f=u.as,h=a(f,u.crossOrigin),g=typeof u.integrity=="string"?u.integrity:void 0,m=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;f==="style"?r.d.S(l,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:h,integrity:g,fetchPriority:m}):f==="script"&&r.d.X(l,{crossOrigin:h,integrity:g,fetchPriority:m,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},vi.preinitModule=function(l,u){if(typeof l=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var f=a(u.as,u.crossOrigin);r.d.M(l,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&r.d.M(l)},vi.preload=function(l,u){if(typeof l=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var f=u.as,h=a(f,u.crossOrigin);r.d.L(l,f,{crossOrigin:h,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},vi.preloadModule=function(l,u){if(typeof l=="string")if(u){var f=a(u.as,u.crossOrigin);r.d.m(l,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else r.d.m(l)},vi.requestFormReset=function(l){r.d.r(l)},vi.unstable_batchedUpdates=function(l,u){return l(u)},vi.useFormState=function(l,u,f){return o.H.useFormState(l,u,f)},vi.useFormStatus=function(){return o.H.useHostTransitionStatus()},vi.version="19.2.1",vi}var vR;function OB(){if(vR)return uC.exports;vR=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),uC.exports=EZ(),uC.exports}var xR;function _Z(){if(xR)return eg;xR=1;var t=TZ(),e=wI(),n=OB();function r(c){var d="https://react.dev/errors/"+c;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function s(c){var d=c,p=c;if(c.alternate)for(;d.return;)d=d.return;else{c=d;do d=c,(d.flags&4098)!==0&&(p=d.return),c=d.return;while(c)}return d.tag===3?p:null}function o(c){if(c.tag===13){var d=c.memoizedState;if(d===null&&(c=c.alternate,c!==null&&(d=c.memoizedState)),d!==null)return d.dehydrated}return null}function a(c){if(c.tag===31){var d=c.memoizedState;if(d===null&&(c=c.alternate,c!==null&&(d=c.memoizedState)),d!==null)return d.dehydrated}return null}function l(c){if(s(c)!==c)throw Error(r(188))}function u(c){var d=c.alternate;if(!d){if(d=s(c),d===null)throw Error(r(188));return d!==c?null:c}for(var p=c,S=d;;){var T=p.return;if(T===null)break;var _=T.alternate;if(_===null){if(S=T.return,S!==null){p=S;continue}break}if(T.child===_.child){for(_=T.child;_;){if(_===p)return l(T),c;if(_===S)return l(T),d;_=_.sibling}throw Error(r(188))}if(p.return!==S.return)p=T,S=_;else{for(var D=!1,L=T.child;L;){if(L===p){D=!0,p=T,S=_;break}if(L===S){D=!0,S=T,p=_;break}L=L.sibling}if(!D){for(L=_.child;L;){if(L===p){D=!0,p=_,S=T;break}if(L===S){D=!0,S=_,p=T;break}L=L.sibling}if(!D)throw Error(r(189))}}if(p.alternate!==S)throw Error(r(190))}if(p.tag!==3)throw Error(r(188));return p.stateNode.current===p?c:d}function f(c){var d=c.tag;if(d===5||d===26||d===27||d===6)return c;for(c=c.child;c!==null;){if(d=f(c),d!==null)return d;c=c.sibling}return null}var h=Object.assign,g=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),P=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),N=Symbol.for("react.memo_cache_sentinel"),j=Symbol.iterator;function H(c){return c===null||typeof c!="object"?null:(c=j&&c[j]||c["@@iterator"],typeof c=="function"?c:null)}var V=Symbol.for("react.client.reference");function z(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===V?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case w:return"Fragment";case v:return"Profiler";case x:return"StrictMode";case M:return"Suspense";case A:return"SuspenseList";case F:return"Activity"}if(typeof c=="object")switch(c.$$typeof){case b:return"Portal";case P:return c.displayName||"Context";case C:return(c._context.displayName||"Context")+".Consumer";case k:var d=c.render;return c=c.displayName,c||(c=d.displayName||d.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case O:return d=c.displayName||null,d!==null?d:z(c.type)||"Memo";case R:d=c._payload,c=c._init;try{return z(c(d))}catch{}}return null}var K=Array.isArray,B=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},Z=[],de=-1;function U(c){return{current:c}}function ne(c){0>de||(c.current=Z[de],Z[de]=null,de--)}function le(c,d){de++,Z[de]=c.current,c.current=d}var fe=U(null),me=U(null),_e=U(null),xe=U(null);function Pe(c,d){switch(le(_e,d),le(me,c),le(fe,null),d.nodeType){case 9:case 11:c=(c=d.documentElement)&&(c=c.namespaceURI)?LD(c):0;break;default:if(c=d.tagName,d=d.namespaceURI)d=LD(d),c=ND(d,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}ne(fe),le(fe,c)}function Oe(){ne(fe),ne(me),ne(_e)}function He(c){c.memoizedState!==null&&le(xe,c);var d=fe.current,p=ND(d,c.type);d!==p&&(le(me,c),le(fe,p))}function zt(c){me.current===c&&(ne(fe),ne(me)),xe.current===c&&(ne(xe),Wp._currentValue=W)}var Kt,Mt;function _t(c){if(Kt===void 0)try{throw Error()}catch(p){var d=p.stack.trim().match(/\n( *(at )?)/);Kt=d&&d[1]||"",Mt=-1<p.stack.indexOf(`
1
+ function bZ(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var zr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ja(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var sC={exports:{}},Qp={};var fR;function vZ(){if(fR)return Qp;fR=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var a in i)a!=="key"&&(s[a]=i[a])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:o,ref:i!==void 0?i:null,props:s}}return Qp.Fragment=e,Qp.jsx=n,Qp.jsxs=n,Qp}var pR;function xZ(){return pR||(pR=1,sC.exports=vZ()),sC.exports}var y=xZ(),oC={exports:{}},ut={};var gR;function wZ(){if(gR)return ut;gR=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),g=Symbol.iterator;function m(U){return U===null||typeof U!="object"?null:(U=g&&U[g]||U["@@iterator"],typeof U=="function"?U:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,x={};function v(U,ne,le){this.props=U,this.context=ne,this.refs=x,this.updater=le||b}v.prototype.isReactComponent={},v.prototype.setState=function(U,ne){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,ne,"setState")},v.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function C(){}C.prototype=v.prototype;function P(U,ne,le){this.props=U,this.context=ne,this.refs=x,this.updater=le||b}var k=P.prototype=new C;k.constructor=P,w(k,v.prototype),k.isPureReactComponent=!0;var M=Array.isArray;function A(){}var O={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function F(U,ne,le){var fe=le.ref;return{$$typeof:t,type:U,key:ne,ref:fe!==void 0?fe:null,props:le}}function N(U,ne){return F(U.type,ne,U.props)}function j(U){return typeof U=="object"&&U!==null&&U.$$typeof===t}function H(U){var ne={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(le){return ne[le]})}var V=/\/+/g;function z(U,ne){return typeof U=="object"&&U!==null&&U.key!=null?H(""+U.key):ne.toString(36)}function K(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(A,A):(U.status="pending",U.then(function(ne){U.status==="pending"&&(U.status="fulfilled",U.value=ne)},function(ne){U.status==="pending"&&(U.status="rejected",U.reason=ne)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function B(U,ne,le,fe,me){var _e=typeof U;(_e==="undefined"||_e==="boolean")&&(U=null);var xe=!1;if(U===null)xe=!0;else switch(_e){case"bigint":case"string":case"number":xe=!0;break;case"object":switch(U.$$typeof){case t:case e:xe=!0;break;case f:return xe=U._init,B(xe(U._payload),ne,le,fe,me)}}if(xe)return me=me(U),xe=fe===""?"."+z(U,0):fe,M(me)?(le="",xe!=null&&(le=xe.replace(V,"$&/")+"/"),B(me,ne,le,"",function(He){return He})):me!=null&&(j(me)&&(me=N(me,le+(me.key==null||U&&U.key===me.key?"":(""+me.key).replace(V,"$&/")+"/")+xe)),ne.push(me)),1;xe=0;var Pe=fe===""?".":fe+":";if(M(U))for(var Oe=0;Oe<U.length;Oe++)fe=U[Oe],_e=Pe+z(fe,Oe),xe+=B(fe,ne,le,_e,me);else if(Oe=m(U),typeof Oe=="function")for(U=Oe.call(U),Oe=0;!(fe=U.next()).done;)fe=fe.value,_e=Pe+z(fe,Oe++),xe+=B(fe,ne,le,_e,me);else if(_e==="object"){if(typeof U.then=="function")return B(K(U),ne,le,fe,me);throw ne=String(U),Error("Objects are not valid as a React child (found: "+(ne==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":ne)+"). If you meant to render a collection of children, use an array instead.")}return xe}function G(U,ne,le){if(U==null)return U;var fe=[],me=0;return B(U,fe,"","",function(_e){return ne.call(le,_e,me++)}),fe}function W(U){if(U._status===-1){var ne=U._result;ne=ne(),ne.then(function(le){(U._status===0||U._status===-1)&&(U._status=1,U._result=le)},function(le){(U._status===0||U._status===-1)&&(U._status=2,U._result=le)}),U._status===-1&&(U._status=0,U._result=ne)}if(U._status===1)return U._result.default;throw U._result}var Z=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ne=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(ne))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},de={map:G,forEach:function(U,ne,le){G(U,function(){ne.apply(this,arguments)},le)},count:function(U){var ne=0;return G(U,function(){ne++}),ne},toArray:function(U){return G(U,function(ne){return ne})||[]},only:function(U){if(!j(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return ut.Activity=h,ut.Children=de,ut.Component=v,ut.Fragment=n,ut.Profiler=i,ut.PureComponent=P,ut.StrictMode=r,ut.Suspense=l,ut.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,ut.__COMPILER_RUNTIME={__proto__:null,c:function(U){return O.H.useMemoCache(U)}},ut.cache=function(U){return function(){return U.apply(null,arguments)}},ut.cacheSignal=function(){return null},ut.cloneElement=function(U,ne,le){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var fe=w({},U.props),me=U.key;if(ne!=null)for(_e in ne.key!==void 0&&(me=""+ne.key),ne)!R.call(ne,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&ne.ref===void 0||(fe[_e]=ne[_e]);var _e=arguments.length-2;if(_e===1)fe.children=le;else if(1<_e){for(var xe=Array(_e),Pe=0;Pe<_e;Pe++)xe[Pe]=arguments[Pe+2];fe.children=xe}return F(U.type,me,fe)},ut.createContext=function(U){return U={$$typeof:o,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:s,_context:U},U},ut.createElement=function(U,ne,le){var fe,me={},_e=null;if(ne!=null)for(fe in ne.key!==void 0&&(_e=""+ne.key),ne)R.call(ne,fe)&&fe!=="key"&&fe!=="__self"&&fe!=="__source"&&(me[fe]=ne[fe]);var xe=arguments.length-2;if(xe===1)me.children=le;else if(1<xe){for(var Pe=Array(xe),Oe=0;Oe<xe;Oe++)Pe[Oe]=arguments[Oe+2];me.children=Pe}if(U&&U.defaultProps)for(fe in xe=U.defaultProps,xe)me[fe]===void 0&&(me[fe]=xe[fe]);return F(U,_e,me)},ut.createRef=function(){return{current:null}},ut.forwardRef=function(U){return{$$typeof:a,render:U}},ut.isValidElement=j,ut.lazy=function(U){return{$$typeof:f,_payload:{_status:-1,_result:U},_init:W}},ut.memo=function(U,ne){return{$$typeof:u,type:U,compare:ne===void 0?null:ne}},ut.startTransition=function(U){var ne=O.T,le={};O.T=le;try{var fe=U(),me=O.S;me!==null&&me(le,fe),typeof fe=="object"&&fe!==null&&typeof fe.then=="function"&&fe.then(A,Z)}catch(_e){Z(_e)}finally{ne!==null&&le.types!==null&&(ne.types=le.types),O.T=ne}},ut.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},ut.use=function(U){return O.H.use(U)},ut.useActionState=function(U,ne,le){return O.H.useActionState(U,ne,le)},ut.useCallback=function(U,ne){return O.H.useCallback(U,ne)},ut.useContext=function(U){return O.H.useContext(U)},ut.useDebugValue=function(){},ut.useDeferredValue=function(U,ne){return O.H.useDeferredValue(U,ne)},ut.useEffect=function(U,ne){return O.H.useEffect(U,ne)},ut.useEffectEvent=function(U){return O.H.useEffectEvent(U)},ut.useId=function(){return O.H.useId()},ut.useImperativeHandle=function(U,ne,le){return O.H.useImperativeHandle(U,ne,le)},ut.useInsertionEffect=function(U,ne){return O.H.useInsertionEffect(U,ne)},ut.useLayoutEffect=function(U,ne){return O.H.useLayoutEffect(U,ne)},ut.useMemo=function(U,ne){return O.H.useMemo(U,ne)},ut.useOptimistic=function(U,ne){return O.H.useOptimistic(U,ne)},ut.useReducer=function(U,ne,le){return O.H.useReducer(U,ne,le)},ut.useRef=function(U){return O.H.useRef(U)},ut.useState=function(U){return O.H.useState(U)},ut.useSyncExternalStore=function(U,ne,le){return O.H.useSyncExternalStore(U,ne,le)},ut.useTransition=function(){return O.H.useTransition()},ut.version="19.2.3",ut}var mR;function wI(){return mR||(mR=1,oC.exports=wZ()),oC.exports}var E=wI();const qe=Ja(E),AB=bZ({__proto__:null,default:qe},[E]);var aC={exports:{}},eg={},lC={exports:{}},cC={};var yR;function CZ(){return yR||(yR=1,(function(t){function e(B,G){var W=B.length;B.push(G);e:for(;0<W;){var Z=W-1>>>1,de=B[Z];if(0<i(de,G))B[Z]=G,B[W]=de,W=Z;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var G=B[0],W=B.pop();if(W!==G){B[0]=W;e:for(var Z=0,de=B.length,U=de>>>1;Z<U;){var ne=2*(Z+1)-1,le=B[ne],fe=ne+1,me=B[fe];if(0>i(le,W))fe<de&&0>i(me,le)?(B[Z]=me,B[fe]=W,Z=fe):(B[Z]=le,B[ne]=W,Z=ne);else if(fe<de&&0>i(me,W))B[Z]=me,B[fe]=W,Z=fe;else break e}}return G}function i(B,G){var W=B.sortIndex-G.sortIndex;return W!==0?W:B.id-G.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],f=1,h=null,g=3,m=!1,b=!1,w=!1,x=!1,v=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function k(B){for(var G=n(u);G!==null;){if(G.callback===null)r(u);else if(G.startTime<=B)r(u),G.sortIndex=G.expirationTime,e(l,G);else break;G=n(u)}}function M(B){if(w=!1,k(B),!b)if(n(l)!==null)b=!0,A||(A=!0,H());else{var G=n(u);G!==null&&K(M,G.startTime-B)}}var A=!1,O=-1,R=5,F=-1;function N(){return x?!0:!(t.unstable_now()-F<R)}function j(){if(x=!1,A){var B=t.unstable_now();F=B;var G=!0;try{e:{b=!1,w&&(w=!1,C(O),O=-1),m=!0;var W=g;try{t:{for(k(B),h=n(l);h!==null&&!(h.expirationTime>B&&N());){var Z=h.callback;if(typeof Z=="function"){h.callback=null,g=h.priorityLevel;var de=Z(h.expirationTime<=B);if(B=t.unstable_now(),typeof de=="function"){h.callback=de,k(B),G=!0;break t}h===n(l)&&r(l),k(B)}else r(l);h=n(l)}if(h!==null)G=!0;else{var U=n(u);U!==null&&K(M,U.startTime-B),G=!1}}break e}finally{h=null,g=W,m=!1}G=void 0}}finally{G?H():A=!1}}}var H;if(typeof P=="function")H=function(){P(j)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,z=V.port2;V.port1.onmessage=j,H=function(){z.postMessage(null)}}else H=function(){v(j,0)};function K(B,G){O=v(function(){B(t.unstable_now())},G)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(B){switch(g){case 1:case 2:case 3:var G=3;break;default:G=g}var W=g;g=G;try{return B()}finally{g=W}},t.unstable_requestPaint=function(){x=!0},t.unstable_runWithPriority=function(B,G){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var W=g;g=B;try{return G()}finally{g=W}},t.unstable_scheduleCallback=function(B,G,W){var Z=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?Z+W:Z):W=Z,B){case 1:var de=-1;break;case 2:de=250;break;case 5:de=1073741823;break;case 4:de=1e4;break;default:de=5e3}return de=W+de,B={id:f++,callback:G,priorityLevel:B,startTime:W,expirationTime:de,sortIndex:-1},W>Z?(B.sortIndex=W,e(u,B),n(l)===null&&B===n(u)&&(w?(C(O),O=-1):w=!0,K(M,W-Z))):(B.sortIndex=de,e(l,B),b||m||(b=!0,A||(A=!0,H()))),B},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(B){var G=g;return function(){var W=g;g=G;try{return B.apply(this,arguments)}finally{g=W}}}})(cC)),cC}var SR;function TZ(){return SR||(SR=1,lC.exports=CZ()),lC.exports}var uC={exports:{}},vi={};var bR;function EZ(){if(bR)return vi;bR=1;var t=wI();function e(l){var u="https://react.dev/errors/"+l;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)u+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+l+"; visit "+u+" 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(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(l,u,f){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:h==null?null:""+h,children:l,containerInfo:u,implementation:f}}var o=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(l,u){if(l==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return vi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,vi.createPortal=function(l,u){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(e(299));return s(l,u,null,f)},vi.flushSync=function(l){var u=o.T,f=r.p;try{if(o.T=null,r.p=2,l)return l()}finally{o.T=u,r.p=f,r.d.f()}},vi.preconnect=function(l,u){typeof l=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,r.d.C(l,u))},vi.prefetchDNS=function(l){typeof l=="string"&&r.d.D(l)},vi.preinit=function(l,u){if(typeof l=="string"&&u&&typeof u.as=="string"){var f=u.as,h=a(f,u.crossOrigin),g=typeof u.integrity=="string"?u.integrity:void 0,m=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;f==="style"?r.d.S(l,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:h,integrity:g,fetchPriority:m}):f==="script"&&r.d.X(l,{crossOrigin:h,integrity:g,fetchPriority:m,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},vi.preinitModule=function(l,u){if(typeof l=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var f=a(u.as,u.crossOrigin);r.d.M(l,{crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&r.d.M(l)},vi.preload=function(l,u){if(typeof l=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var f=u.as,h=a(f,u.crossOrigin);r.d.L(l,f,{crossOrigin:h,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},vi.preloadModule=function(l,u){if(typeof l=="string")if(u){var f=a(u.as,u.crossOrigin);r.d.m(l,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:f,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else r.d.m(l)},vi.requestFormReset=function(l){r.d.r(l)},vi.unstable_batchedUpdates=function(l,u){return l(u)},vi.useFormState=function(l,u,f){return o.H.useFormState(l,u,f)},vi.useFormStatus=function(){return o.H.useHostTransitionStatus()},vi.version="19.2.3",vi}var vR;function OB(){if(vR)return uC.exports;vR=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),uC.exports=EZ(),uC.exports}var xR;function _Z(){if(xR)return eg;xR=1;var t=TZ(),e=wI(),n=OB();function r(c){var d="https://react.dev/errors/"+c;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)d+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function s(c){var d=c,p=c;if(c.alternate)for(;d.return;)d=d.return;else{c=d;do d=c,(d.flags&4098)!==0&&(p=d.return),c=d.return;while(c)}return d.tag===3?p:null}function o(c){if(c.tag===13){var d=c.memoizedState;if(d===null&&(c=c.alternate,c!==null&&(d=c.memoizedState)),d!==null)return d.dehydrated}return null}function a(c){if(c.tag===31){var d=c.memoizedState;if(d===null&&(c=c.alternate,c!==null&&(d=c.memoizedState)),d!==null)return d.dehydrated}return null}function l(c){if(s(c)!==c)throw Error(r(188))}function u(c){var d=c.alternate;if(!d){if(d=s(c),d===null)throw Error(r(188));return d!==c?null:c}for(var p=c,S=d;;){var T=p.return;if(T===null)break;var _=T.alternate;if(_===null){if(S=T.return,S!==null){p=S;continue}break}if(T.child===_.child){for(_=T.child;_;){if(_===p)return l(T),c;if(_===S)return l(T),d;_=_.sibling}throw Error(r(188))}if(p.return!==S.return)p=T,S=_;else{for(var D=!1,L=T.child;L;){if(L===p){D=!0,p=T,S=_;break}if(L===S){D=!0,S=T,p=_;break}L=L.sibling}if(!D){for(L=_.child;L;){if(L===p){D=!0,p=_,S=T;break}if(L===S){D=!0,S=_,p=T;break}L=L.sibling}if(!D)throw Error(r(189))}}if(p.alternate!==S)throw Error(r(190))}if(p.tag!==3)throw Error(r(188));return p.stateNode.current===p?c:d}function f(c){var d=c.tag;if(d===5||d===26||d===27||d===6)return c;for(c=c.child;c!==null;){if(d=f(c),d!==null)return d;c=c.sibling}return null}var h=Object.assign,g=Symbol.for("react.element"),m=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),P=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),N=Symbol.for("react.memo_cache_sentinel"),j=Symbol.iterator;function H(c){return c===null||typeof c!="object"?null:(c=j&&c[j]||c["@@iterator"],typeof c=="function"?c:null)}var V=Symbol.for("react.client.reference");function z(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===V?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case w:return"Fragment";case v:return"Profiler";case x:return"StrictMode";case M:return"Suspense";case A:return"SuspenseList";case F:return"Activity"}if(typeof c=="object")switch(c.$$typeof){case b:return"Portal";case P:return c.displayName||"Context";case C:return(c._context.displayName||"Context")+".Consumer";case k:var d=c.render;return c=c.displayName,c||(c=d.displayName||d.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case O:return d=c.displayName||null,d!==null?d:z(c.type)||"Memo";case R:d=c._payload,c=c._init;try{return z(c(d))}catch{}}return null}var K=Array.isArray,B=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},Z=[],de=-1;function U(c){return{current:c}}function ne(c){0>de||(c.current=Z[de],Z[de]=null,de--)}function le(c,d){de++,Z[de]=c.current,c.current=d}var fe=U(null),me=U(null),_e=U(null),xe=U(null);function Pe(c,d){switch(le(_e,d),le(me,c),le(fe,null),d.nodeType){case 9:case 11:c=(c=d.documentElement)&&(c=c.namespaceURI)?LD(c):0;break;default:if(c=d.tagName,d=d.namespaceURI)d=LD(d),c=ND(d,c);else switch(c){case"svg":c=1;break;case"math":c=2;break;default:c=0}}ne(fe),le(fe,c)}function Oe(){ne(fe),ne(me),ne(_e)}function He(c){c.memoizedState!==null&&le(xe,c);var d=fe.current,p=ND(d,c.type);d!==p&&(le(me,c),le(fe,p))}function zt(c){me.current===c&&(ne(fe),ne(me)),xe.current===c&&(ne(xe),Wp._currentValue=W)}var Kt,Mt;function _t(c){if(Kt===void 0)try{throw Error()}catch(p){var d=p.stack.trim().match(/\n( *(at )?)/);Kt=d&&d[1]||"",Mt=-1<p.stack.indexOf(`
2
2
  at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
3
3
  `+Kt+c+Mt}var Ht=!1;function Xn(c,d){if(!c||Ht)return"";Ht=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var S={DetermineComponentFrameRoot:function(){try{if(d){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(ue){var ae=ue}Reflect.construct(c,[],Se)}else{try{Se.call()}catch(ue){ae=ue}c.call(Se.prototype)}}else{try{throw Error()}catch(ue){ae=ue}(Se=c())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(ue){if(ue&&ae&&typeof ue.stack=="string")return[ue.stack,ae.stack]}return[null,null]}};S.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var T=Object.getOwnPropertyDescriptor(S.DetermineComponentFrameRoot,"name");T&&T.configurable&&Object.defineProperty(S.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=S.DetermineComponentFrameRoot(),D=_[0],L=_[1];if(D&&L){var Y=D.split(`
4
4
  `),oe=L.split(`
5
5
  `);for(T=S=0;S<Y.length&&!Y[S].includes("DetermineComponentFrameRoot");)S++;for(;T<oe.length&&!oe[T].includes("DetermineComponentFrameRoot");)T++;if(S===Y.length||T===oe.length)for(S=Y.length-1,T=oe.length-1;1<=S&&0<=T&&Y[S]!==oe[T];)T--;for(;1<=S&&0<=T;S--,T--)if(Y[S]!==oe[T]){if(S!==1||T!==1)do if(S--,T--,0>T||Y[S]!==oe[T]){var he=`
6
6
  `+Y[S].replace(" at new "," at ");return c.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",c.displayName)),he}while(1<=S&&0<=T);break}}}finally{Ht=!1,Error.prepareStackTrace=p}return(p=c?c.displayName||c.name:"")?_t(p):""}function wr(c,d){switch(c.tag){case 26:case 27:case 5:return _t(c.type);case 16:return _t("Lazy");case 13:return c.child!==d&&d!==null?_t("Suspense Fallback"):_t("Suspense");case 19:return _t("SuspenseList");case 0:case 15:return Xn(c.type,!1);case 11:return Xn(c.type.render,!1);case 1:return Xn(c.type,!0);case 31:return _t("Activity");default:return""}}function kr(c){try{var d="",p=null;do d+=wr(c,p),p=c,c=c.return;while(c);return d}catch(S){return`
7
7
  Error generating stack: `+S.message+`
8
- `+S.stack}}var Gr=Object.prototype.hasOwnProperty,hi=t.unstable_scheduleCallback,fi=t.unstable_cancelCallback,ol=t.unstable_shouldYield,sc=t.unstable_requestPaint,dr=t.unstable_now,Fi=t.unstable_getCurrentPriorityLevel,So=t.unstable_ImmediatePriority,Xo=t.unstable_UserBlockingPriority,us=t.unstable_NormalPriority,al=t.unstable_LowPriority,ce=t.unstable_IdlePriority,ke=t.log,Xe=t.unstable_setDisableYieldValue,At=null,qt=null;function pn(c){if(typeof ke=="function"&&Xe(c),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(At,c)}catch{}}var An=Math.clz32?Math.clz32:ds,Ui=Math.log,Yr=Math.LN2;function ds(c){return c>>>=0,c===0?32:31-(Ui(c)/Yr|0)|0}var pi=256,hs=262144,Zo=4194304;function Ns(c){var d=c&42;if(d!==0)return d;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function zs(c,d,p){var S=c.pendingLanes;if(S===0)return 0;var T=0,_=c.suspendedLanes,D=c.pingedLanes;c=c.warmLanes;var L=S&134217727;return L!==0?(S=L&~_,S!==0?T=Ns(S):(D&=L,D!==0?T=Ns(D):p||(p=L&~c,p!==0&&(T=Ns(p))))):(L=S&~_,L!==0?T=Ns(L):D!==0?T=Ns(D):p||(p=S&~c,p!==0&&(T=Ns(p)))),T===0?0:d!==0&&d!==T&&(d&_)===0&&(_=T&-T,p=d&-d,_>=p||_===32&&(p&4194048)!==0)?d:T}function Bs(c,d){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&d)===0}function Fs(c,d){switch(c){case 1:case 2:case 4:case 8:case 64:return d+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 d+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 oc(){var c=Zo;return Zo<<=1,(Zo&62914560)===0&&(Zo=4194304),c}function Jo(c){for(var d=[],p=0;31>p;p++)d.push(c);return d}function ll(c,d){c.pendingLanes|=d,d!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function hp(c,d,p,S,T,_){var D=c.pendingLanes;c.pendingLanes=p,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=p,c.entangledLanes&=p,c.errorRecoveryDisabledLanes&=p,c.shellSuspendCounter=0;var L=c.entanglements,Y=c.expirationTimes,oe=c.hiddenUpdates;for(p=D&~p;0<p;){var he=31-An(p),Se=1<<he;L[he]=0,Y[he]=-1;var ae=oe[he];if(ae!==null)for(oe[he]=null,he=0;he<ae.length;he++){var ue=ae[he];ue!==null&&(ue.lane&=-536870913)}p&=~Se}S!==0&&Zd(c,S,0),_!==0&&T===0&&c.tag!==0&&(c.suspendedLanes|=_&~(D&~d))}function Zd(c,d,p){c.pendingLanes|=d,c.suspendedLanes&=~d;var S=31-An(d);c.entangledLanes|=d,c.entanglements[S]=c.entanglements[S]|1073741824|p&261930}function fs(c,d){var p=c.entangledLanes|=d;for(c=c.entanglements;p;){var S=31-An(p),T=1<<S;T&d|c[S]&d&&(c[S]|=d),p&=~T}}function Jd(c,d){var p=d&-d;return p=(p&42)!==0?1:ac(p),(p&(c.suspendedLanes|d))!==0?0:p}function ac(c){switch(c){case 2:c=1;break;case 8:c=4;break;case 32:c=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:c=128;break;case 268435456:c=134217728;break;default:c=0}return c}function cl(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function bo(){var c=G.p;return c!==0?c:(c=window.event,c===void 0?32:oR(c.type))}function Qd(c,d){var p=G.p;try{return G.p=c,d()}finally{G.p=p}}var Mr=Math.random().toString(36).slice(2),Zn="__reactFiber$"+Mr,Ar="__reactProps$"+Mr,wa="__reactContainer$"+Mr,Hi="__reactEvents$"+Mr,fp="__reactListeners$"+Mr,lc="__reactHandles$"+Mr,eh="__reactResources$"+Mr,ul="__reactMarker$"+Mr;function ps(c){delete c[Zn],delete c[Ar],delete c[Hi],delete c[fp],delete c[lc]}function gi(c){var d=c[Zn];if(d)return d;for(var p=c.parentNode;p;){if(d=p[wa]||p[Zn]){if(p=d.alternate,d.child!==null||p!==null&&p.child!==null)for(c=KD(c);c!==null;){if(p=c[Zn])return p;c=KD(c)}return d}c=p,p=c.parentNode}return null}function Ca(c){if(c=c[Zn]||c[wa]){var d=c.tag;if(d===5||d===6||d===13||d===31||d===26||d===27||d===3)return c}return null}function dl(c){var d=c.tag;if(d===5||d===26||d===27||d===6)return c.stateNode;throw Error(r(33))}function Ta(c){var d=c[eh];return d||(d=c[eh]={hoistableStyles:new Map,hoistableScripts:new Map}),d}function Ln(c){c[ul]=!0}var th=new Set,vo={};function Qo(c,d){ea(c,d),ea(c+"Capture",d)}function ea(c,d){for(vo[c]=d,c=0;c<d.length;c++)th.add(d[c])}var xo=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]*$"),nh={},rh={};function pp(c){return Gr.call(rh,c)?!0:Gr.call(nh,c)?!1:xo.test(c)?rh[c]=!0:(nh[c]=!0,!1)}function hl(c,d,p){if(pp(d))if(p===null)c.removeAttribute(d);else{switch(typeof p){case"undefined":case"function":case"symbol":c.removeAttribute(d);return;case"boolean":var S=d.toLowerCase().slice(0,5);if(S!=="data-"&&S!=="aria-"){c.removeAttribute(d);return}}c.setAttribute(d,""+p)}}function cc(c,d,p){if(p===null)c.removeAttribute(d);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(d);return}c.setAttribute(d,""+p)}}function Us(c,d,p,S){if(S===null)c.removeAttribute(p);else{switch(typeof S){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(p);return}c.setAttributeNS(d,p,""+S)}}function Nn(c){switch(typeof c){case"bigint":case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function ta(c){var d=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function mi(c,d,p){var S=Object.getOwnPropertyDescriptor(c.constructor.prototype,d);if(!c.hasOwnProperty(d)&&typeof S<"u"&&typeof S.get=="function"&&typeof S.set=="function"){var T=S.get,_=S.set;return Object.defineProperty(c,d,{configurable:!0,get:function(){return T.call(this)},set:function(D){p=""+D,_.call(this,D)}}),Object.defineProperty(c,d,{enumerable:S.enumerable}),{getValue:function(){return p},setValue:function(D){p=""+D},stopTracking:function(){c._valueTracker=null,delete c[d]}}}}function uc(c){if(!c._valueTracker){var d=ta(c)?"checked":"value";c._valueTracker=mi(c,d,""+c[d])}}function zu(c){if(!c)return!1;var d=c._valueTracker;if(!d)return!0;var p=d.getValue(),S="";return c&&(S=ta(c)?c.checked?"true":"false":c.value),c=S,c!==p?(d.setValue(c),!0):!1}function dc(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var gp=/[\n"\\]/g;function zn(c){return c.replace(gp,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function hc(c,d,p,S,T,_,D,L){c.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?c.type=D:c.removeAttribute("type"),d!=null?D==="number"?(d===0&&c.value===""||c.value!=d)&&(c.value=""+Nn(d)):c.value!==""+Nn(d)&&(c.value=""+Nn(d)):D!=="submit"&&D!=="reset"||c.removeAttribute("value"),d!=null?fl(c,D,Nn(d)):p!=null?fl(c,D,Nn(p)):S!=null&&c.removeAttribute("value"),T==null&&_!=null&&(c.defaultChecked=!!_),T!=null&&(c.checked=T&&typeof T!="function"&&typeof T!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?c.name=""+Nn(L):c.removeAttribute("name")}function Bu(c,d,p,S,T,_,D,L){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(c.type=_),d!=null||p!=null){if(!(_!=="submit"&&_!=="reset"||d!=null)){uc(c);return}p=p!=null?""+Nn(p):"",d=d!=null?""+Nn(d):p,L||d===c.value||(c.value=d),c.defaultValue=d}S=S??T,S=typeof S!="function"&&typeof S!="symbol"&&!!S,c.checked=L?c.checked:!!S,c.defaultChecked=!!S,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(c.name=D),uc(c)}function fl(c,d,p){d==="number"&&dc(c.ownerDocument)===c||c.defaultValue===""+p||(c.defaultValue=""+p)}function na(c,d,p,S){if(c=c.options,d){d={};for(var T=0;T<p.length;T++)d["$"+p[T]]=!0;for(p=0;p<c.length;p++)T=d.hasOwnProperty("$"+c[p].value),c[p].selected!==T&&(c[p].selected=T),T&&S&&(c[p].defaultSelected=!0)}else{for(p=""+Nn(p),d=null,T=0;T<c.length;T++){if(c[T].value===p){c[T].selected=!0,S&&(c[T].defaultSelected=!0);return}d!==null||c[T].disabled||(d=c[T])}d!==null&&(d.selected=!0)}}function Fu(c,d,p){if(d!=null&&(d=""+Nn(d),d!==c.value&&(c.value=d),p==null)){c.defaultValue!==d&&(c.defaultValue=d);return}c.defaultValue=p!=null?""+Nn(p):""}function pl(c,d,p,S){if(d==null){if(S!=null){if(p!=null)throw Error(r(92));if(K(S)){if(1<S.length)throw Error(r(93));S=S[0]}p=S}p==null&&(p=""),d=p}p=Nn(d),c.defaultValue=p,S=c.textContent,S===p&&S!==""&&S!==null&&(c.value=S),uc(c)}function yi(c,d){if(d){var p=c.firstChild;if(p&&p===c.lastChild&&p.nodeType===3){p.nodeValue=d;return}}c.textContent=d}var ih=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 fc(c,d,p){var S=d.indexOf("--")===0;p==null||typeof p=="boolean"||p===""?S?c.setProperty(d,""):d==="float"?c.cssFloat="":c[d]="":S?c.setProperty(d,p):typeof p!="number"||p===0||ih.has(d)?d==="float"?c.cssFloat=p:c[d]=(""+p).trim():c[d]=p+"px"}function $i(c,d,p){if(d!=null&&typeof d!="object")throw Error(r(62));if(c=c.style,p!=null){for(var S in p)!p.hasOwnProperty(S)||d!=null&&d.hasOwnProperty(S)||(S.indexOf("--")===0?c.setProperty(S,""):S==="float"?c.cssFloat="":c[S]="");for(var T in d)S=d[T],d.hasOwnProperty(T)&&p[T]!==S&&fc(c,T,S)}else for(var _ in d)d.hasOwnProperty(_)&&fc(c,_,d[_])}function Uu(c){if(c.indexOf("-")===-1)return!1;switch(c){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 sh=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),q=/^[\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 ie(c){return q.test(""+c)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":c}function Ce(){}var ze=null;function Jt(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var rt=null,an=null;function Cr(c){var d=Ca(c);if(d&&(c=d.stateNode)){var p=c[Ar]||null;e:switch(c=d.stateNode,d.type){case"input":if(hc(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name),d=p.name,p.type==="radio"&&d!=null){for(p=c;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll('input[name="'+zn(""+d)+'"][type="radio"]'),d=0;d<p.length;d++){var S=p[d];if(S!==c&&S.form===c.form){var T=S[Ar]||null;if(!T)throw Error(r(90));hc(S,T.value,T.defaultValue,T.defaultValue,T.checked,T.defaultChecked,T.type,T.name)}}for(d=0;d<p.length;d++)S=p[d],S.form===c.form&&zu(S)}break e;case"textarea":Fu(c,p.value,p.defaultValue);break e;case"select":d=p.value,d!=null&&na(c,!!p.multiple,d,!1)}}}var xn=!1;function Tr(c,d,p){if(xn)return c(d,p);xn=!0;try{var S=c(d);return S}finally{if(xn=!1,(rt!==null||an!==null)&&(dS(),rt&&(d=rt,c=an,an=rt=null,Cr(d),c)))for(d=0;d<c.length;d++)Cr(c[d])}}function Jn(c,d){var p=c.stateNode;if(p===null)return null;var S=p[Ar]||null;if(S===null)return null;p=S[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(S=!S.disabled)||(c=c.type,S=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!S;break e;default:c=!1}if(c)return null;if(p&&typeof p!="function")throw Error(r(231,d,typeof p));return p}var wn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bn=!1;if(wn)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){Bn=!0}}),window.addEventListener("test",Cn,Cn),window.removeEventListener("test",Cn,Cn)}catch{Bn=!1}var Tn=null,gs=null,Si=null;function wo(){if(Si)return Si;var c,d=gs,p=d.length,S,T="value"in Tn?Tn.value:Tn.textContent,_=T.length;for(c=0;c<p&&d[c]===T[c];c++);var D=p-c;for(S=1;S<=D&&d[p-S]===T[_-S];S++);return Si=T.slice(c,1<S?1-S:void 0)}function $(c){var d=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&d===13&&(c=13)):c=d,c===10&&(c=13),32<=c||c===13?c:0}function Q(){return!0}function be(){return!1}function Me(c){function d(p,S,T,_,D){this._reactName=p,this._targetInst=T,this.type=S,this.nativeEvent=_,this.target=D,this.currentTarget=null;for(var L in c)c.hasOwnProperty(L)&&(p=c[L],this[L]=p?p(_):_[L]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Q:be,this.isPropagationStopped=be,this}return h(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Q)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Q)},persist:function(){},isPersistent:Q}),d}var Rt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},st=Me(Rt),Qt=h({},Rt,{view:0,detail:0}),hr=Me(Qt),Qn,ln,Er,bi=h({},Qt,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uw,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==Er&&(Er&&c.type==="mousemove"?(Qn=c.screenX-Er.screenX,ln=c.screenY-Er.screenY):ln=Qn=0,Er=c),Qn)},movementY:function(c){return"movementY"in c?c.movementY:ln}}),_r=Me(bi),ms=h({},bi,{dataTransfer:0}),ys=Me(ms),Ea=h({},Qt,{relatedTarget:0}),Hs=Me(Ea),gl=h({},Rt,{animationName:0,elapsedTime:0,pseudoElement:0}),ky=Me(gl),oh=h({},Rt,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),ah=Me(oh),EW=h({},Rt,{data:0}),F2=Me(EW),_W={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PW={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"},IW={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kW(c){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(c):(c=IW[c])?!!d[c]:!1}function uw(){return kW}var MW=h({},Qt,{key:function(c){if(c.key){var d=_W[c.key]||c.key;if(d!=="Unidentified")return d}return c.type==="keypress"?(c=$(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?PW[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uw,charCode:function(c){return c.type==="keypress"?$(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?$(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),AW=Me(MW),OW=h({},bi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),U2=Me(OW),DW=h({},Qt,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uw}),RW=Me(DW),jW=h({},Rt,{propertyName:0,elapsedTime:0,pseudoElement:0}),LW=Me(jW),NW=h({},bi,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),zW=Me(NW),BW=h({},Rt,{newState:0,oldState:0}),FW=Me(BW),UW=[9,13,27,32],dw=wn&&"CompositionEvent"in window,mp=null;wn&&"documentMode"in document&&(mp=document.documentMode);var HW=wn&&"TextEvent"in window&&!mp,H2=wn&&(!dw||mp&&8<mp&&11>=mp),$2=" ",K2=!1;function V2(c,d){switch(c){case"keyup":return UW.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function q2(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var lh=!1;function $W(c,d){switch(c){case"compositionend":return q2(d);case"keypress":return d.which!==32?null:(K2=!0,$2);case"textInput":return c=d.data,c===$2&&K2?null:c;default:return null}}function KW(c,d){if(lh)return c==="compositionend"||!dw&&V2(c,d)?(c=wo(),Si=gs=Tn=null,lh=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return H2&&d.locale!=="ko"?null:d.data;default:return null}}var VW={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 G2(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d==="input"?!!VW[c.type]:d==="textarea"}function Y2(c,d,p,S){rt?an?an.push(S):an=[S]:rt=S,d=SS(d,"onChange"),0<d.length&&(p=new st("onChange","change",null,p,S),c.push({event:p,listeners:d}))}var yp=null,Sp=null;function qW(c){MD(c,0)}function My(c){var d=dl(c);if(zu(d))return c}function W2(c,d){if(c==="change")return d}var X2=!1;if(wn){var hw;if(wn){var fw="oninput"in document;if(!fw){var Z2=document.createElement("div");Z2.setAttribute("oninput","return;"),fw=typeof Z2.oninput=="function"}hw=fw}else hw=!1;X2=hw&&(!document.documentMode||9<document.documentMode)}function J2(){yp&&(yp.detachEvent("onpropertychange",Q2),Sp=yp=null)}function Q2(c){if(c.propertyName==="value"&&My(Sp)){var d=[];Y2(d,Sp,c,Jt(c)),Tr(qW,d)}}function GW(c,d,p){c==="focusin"?(J2(),yp=d,Sp=p,yp.attachEvent("onpropertychange",Q2)):c==="focusout"&&J2()}function YW(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return My(Sp)}function WW(c,d){if(c==="click")return My(d)}function XW(c,d){if(c==="input"||c==="change")return My(d)}function ZW(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var $s=typeof Object.is=="function"?Object.is:ZW;function bp(c,d){if($s(c,d))return!0;if(typeof c!="object"||c===null||typeof d!="object"||d===null)return!1;var p=Object.keys(c),S=Object.keys(d);if(p.length!==S.length)return!1;for(S=0;S<p.length;S++){var T=p[S];if(!Gr.call(d,T)||!$s(c[T],d[T]))return!1}return!0}function eA(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function tA(c,d){var p=eA(c);c=0;for(var S;p;){if(p.nodeType===3){if(S=c+p.textContent.length,c<=d&&S>=d)return{node:p,offset:d-c};c=S}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=eA(p)}}function nA(c,d){return c&&d?c===d?!0:c&&c.nodeType===3?!1:d&&d.nodeType===3?nA(c,d.parentNode):"contains"in c?c.contains(d):c.compareDocumentPosition?!!(c.compareDocumentPosition(d)&16):!1:!1}function rA(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var d=dc(c.document);d instanceof c.HTMLIFrameElement;){try{var p=typeof d.contentWindow.location.href=="string"}catch{p=!1}if(p)c=d.contentWindow;else break;d=dc(c.document)}return d}function pw(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d&&(d==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||d==="textarea"||c.contentEditable==="true")}var JW=wn&&"documentMode"in document&&11>=document.documentMode,ch=null,gw=null,vp=null,mw=!1;function iA(c,d,p){var S=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;mw||ch==null||ch!==dc(S)||(S=ch,"selectionStart"in S&&pw(S)?S={start:S.selectionStart,end:S.selectionEnd}:(S=(S.ownerDocument&&S.ownerDocument.defaultView||window).getSelection(),S={anchorNode:S.anchorNode,anchorOffset:S.anchorOffset,focusNode:S.focusNode,focusOffset:S.focusOffset}),vp&&bp(vp,S)||(vp=S,S=SS(gw,"onSelect"),0<S.length&&(d=new st("onSelect","select",null,d,p),c.push({event:d,listeners:S}),d.target=ch)))}function Hu(c,d){var p={};return p[c.toLowerCase()]=d.toLowerCase(),p["Webkit"+c]="webkit"+d,p["Moz"+c]="moz"+d,p}var uh={animationend:Hu("Animation","AnimationEnd"),animationiteration:Hu("Animation","AnimationIteration"),animationstart:Hu("Animation","AnimationStart"),transitionrun:Hu("Transition","TransitionRun"),transitionstart:Hu("Transition","TransitionStart"),transitioncancel:Hu("Transition","TransitionCancel"),transitionend:Hu("Transition","TransitionEnd")},yw={},sA={};wn&&(sA=document.createElement("div").style,"AnimationEvent"in window||(delete uh.animationend.animation,delete uh.animationiteration.animation,delete uh.animationstart.animation),"TransitionEvent"in window||delete uh.transitionend.transition);function $u(c){if(yw[c])return yw[c];if(!uh[c])return c;var d=uh[c],p;for(p in d)if(d.hasOwnProperty(p)&&p in sA)return yw[c]=d[p];return c}var oA=$u("animationend"),aA=$u("animationiteration"),lA=$u("animationstart"),QW=$u("transitionrun"),eX=$u("transitionstart"),tX=$u("transitioncancel"),cA=$u("transitionend"),uA=new Map,Sw="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Sw.push("scrollEnd");function ra(c,d){uA.set(c,d),Qo(d,[c])}var Ay=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var d=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(d))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",c);return}console.error(c)},Co=[],dh=0,bw=0;function Oy(){for(var c=dh,d=bw=dh=0;d<c;){var p=Co[d];Co[d++]=null;var S=Co[d];Co[d++]=null;var T=Co[d];Co[d++]=null;var _=Co[d];if(Co[d++]=null,S!==null&&T!==null){var D=S.pending;D===null?T.next=T:(T.next=D.next,D.next=T),S.pending=T}_!==0&&dA(p,T,_)}}function Dy(c,d,p,S){Co[dh++]=c,Co[dh++]=d,Co[dh++]=p,Co[dh++]=S,bw|=S,c.lanes|=S,c=c.alternate,c!==null&&(c.lanes|=S)}function vw(c,d,p,S){return Dy(c,d,p,S),Ry(c)}function Ku(c,d){return Dy(c,null,null,d),Ry(c)}function dA(c,d,p){c.lanes|=p;var S=c.alternate;S!==null&&(S.lanes|=p);for(var T=!1,_=c.return;_!==null;)_.childLanes|=p,S=_.alternate,S!==null&&(S.childLanes|=p),_.tag===22&&(c=_.stateNode,c===null||c._visibility&1||(T=!0)),c=_,_=_.return;return c.tag===3?(_=c.stateNode,T&&d!==null&&(T=31-An(p),c=_.hiddenUpdates,S=c[T],S===null?c[T]=[d]:S.push(d),d.lane=p|536870912),_):null}function Ry(c){if(50<Hp)throw Hp=0,k1=null,Error(r(185));for(var d=c.return;d!==null;)c=d,d=c.return;return c.tag===3?c.stateNode:null}var hh={};function nX(c,d,p,S){this.tag=c,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ks(c,d,p,S){return new nX(c,d,p,S)}function xw(c){return c=c.prototype,!(!c||!c.isReactComponent)}function ml(c,d){var p=c.alternate;return p===null?(p=Ks(c.tag,d,c.key,c.mode),p.elementType=c.elementType,p.type=c.type,p.stateNode=c.stateNode,p.alternate=c,c.alternate=p):(p.pendingProps=d,p.type=c.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=c.flags&65011712,p.childLanes=c.childLanes,p.lanes=c.lanes,p.child=c.child,p.memoizedProps=c.memoizedProps,p.memoizedState=c.memoizedState,p.updateQueue=c.updateQueue,d=c.dependencies,p.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},p.sibling=c.sibling,p.index=c.index,p.ref=c.ref,p.refCleanup=c.refCleanup,p}function hA(c,d){c.flags&=65011714;var p=c.alternate;return p===null?(c.childLanes=0,c.lanes=d,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=p.childLanes,c.lanes=p.lanes,c.child=p.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=p.memoizedProps,c.memoizedState=p.memoizedState,c.updateQueue=p.updateQueue,c.type=p.type,d=p.dependencies,c.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),c}function jy(c,d,p,S,T,_){var D=0;if(S=c,typeof c=="function")xw(c)&&(D=1);else if(typeof c=="string")D=aZ(c,p,fe.current)?26:c==="html"||c==="head"||c==="body"?27:5;else e:switch(c){case F:return c=Ks(31,p,d,T),c.elementType=F,c.lanes=_,c;case w:return Vu(p.children,T,_,d);case x:D=8,T|=24;break;case v:return c=Ks(12,p,d,T|2),c.elementType=v,c.lanes=_,c;case M:return c=Ks(13,p,d,T),c.elementType=M,c.lanes=_,c;case A:return c=Ks(19,p,d,T),c.elementType=A,c.lanes=_,c;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case P:D=10;break e;case C:D=9;break e;case k:D=11;break e;case O:D=14;break e;case R:D=16,S=null;break e}D=29,p=Error(r(130,c===null?"null":typeof c,"")),S=null}return d=Ks(D,p,d,T),d.elementType=c,d.type=S,d.lanes=_,d}function Vu(c,d,p,S){return c=Ks(7,c,S,d),c.lanes=p,c}function ww(c,d,p){return c=Ks(6,c,null,d),c.lanes=p,c}function fA(c){var d=Ks(18,null,null,0);return d.stateNode=c,d}function Cw(c,d,p){return d=Ks(4,c.children!==null?c.children:[],c.key,d),d.lanes=p,d.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},d}var pA=new WeakMap;function To(c,d){if(typeof c=="object"&&c!==null){var p=pA.get(c);return p!==void 0?p:(d={value:c,source:d,stack:kr(d)},pA.set(c,d),d)}return{value:c,source:d,stack:kr(d)}}var fh=[],ph=0,Ly=null,xp=0,Eo=[],_o=0,pc=null,_a=1,Pa="";function yl(c,d){fh[ph++]=xp,fh[ph++]=Ly,Ly=c,xp=d}function gA(c,d,p){Eo[_o++]=_a,Eo[_o++]=Pa,Eo[_o++]=pc,pc=c;var S=_a;c=Pa;var T=32-An(S)-1;S&=~(1<<T),p+=1;var _=32-An(d)+T;if(30<_){var D=T-T%5;_=(S&(1<<D)-1).toString(32),S>>=D,T-=D,_a=1<<32-An(d)+T|p<<T|S,Pa=_+c}else _a=1<<_|p<<T|S,Pa=c}function Tw(c){c.return!==null&&(yl(c,1),gA(c,1,0))}function Ew(c){for(;c===Ly;)Ly=fh[--ph],fh[ph]=null,xp=fh[--ph],fh[ph]=null;for(;c===pc;)pc=Eo[--_o],Eo[_o]=null,Pa=Eo[--_o],Eo[_o]=null,_a=Eo[--_o],Eo[_o]=null}function mA(c,d){Eo[_o++]=_a,Eo[_o++]=Pa,Eo[_o++]=pc,_a=d.id,Pa=d.overflow,pc=c}var Wr=null,gn=null,Ot=!1,gc=null,Po=!1,_w=Error(r(519));function mc(c){var d=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wp(To(d,c)),_w}function yA(c){var d=c.stateNode,p=c.type,S=c.memoizedProps;switch(d[Zn]=c,d[Ar]=S,p){case"dialog":Tt("cancel",d),Tt("close",d);break;case"iframe":case"object":case"embed":Tt("load",d);break;case"video":case"audio":for(p=0;p<Kp.length;p++)Tt(Kp[p],d);break;case"source":Tt("error",d);break;case"img":case"image":case"link":Tt("error",d),Tt("load",d);break;case"details":Tt("toggle",d);break;case"input":Tt("invalid",d),Bu(d,S.value,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name,!0);break;case"select":Tt("invalid",d);break;case"textarea":Tt("invalid",d),pl(d,S.value,S.defaultValue,S.children)}p=S.children,typeof p!="string"&&typeof p!="number"&&typeof p!="bigint"||d.textContent===""+p||S.suppressHydrationWarning===!0||RD(d.textContent,p)?(S.popover!=null&&(Tt("beforetoggle",d),Tt("toggle",d)),S.onScroll!=null&&Tt("scroll",d),S.onScrollEnd!=null&&Tt("scrollend",d),S.onClick!=null&&(d.onclick=Ce),d=!0):d=!1,d||mc(c,!0)}function SA(c){for(Wr=c.return;Wr;)switch(Wr.tag){case 5:case 31:case 13:Po=!1;return;case 27:case 3:Po=!0;return;default:Wr=Wr.return}}function gh(c){if(c!==Wr)return!1;if(!Ot)return SA(c),Ot=!0,!1;var d=c.tag,p;if((p=d!==3&&d!==27)&&((p=d===5)&&(p=c.type,p=!(p!=="form"&&p!=="button")||K1(c.type,c.memoizedProps)),p=!p),p&&gn&&mc(c),SA(c),d===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));gn=$D(c)}else if(d===31){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));gn=$D(c)}else d===27?(d=gn,Mc(c.type)?(c=W1,W1=null,gn=c):gn=d):gn=Wr?ko(c.stateNode.nextSibling):null;return!0}function qu(){gn=Wr=null,Ot=!1}function Pw(){var c=gc;return c!==null&&(xs===null?xs=c:xs.push.apply(xs,c),gc=null),c}function wp(c){gc===null?gc=[c]:gc.push(c)}var Iw=U(null),Gu=null,Sl=null;function yc(c,d,p){le(Iw,d._currentValue),d._currentValue=p}function bl(c){c._currentValue=Iw.current,ne(Iw)}function kw(c,d,p){for(;c!==null;){var S=c.alternate;if((c.childLanes&d)!==d?(c.childLanes|=d,S!==null&&(S.childLanes|=d)):S!==null&&(S.childLanes&d)!==d&&(S.childLanes|=d),c===p)break;c=c.return}}function Mw(c,d,p,S){var T=c.child;for(T!==null&&(T.return=c);T!==null;){var _=T.dependencies;if(_!==null){var D=T.child;_=_.firstContext;e:for(;_!==null;){var L=_;_=T;for(var Y=0;Y<d.length;Y++)if(L.context===d[Y]){_.lanes|=p,L=_.alternate,L!==null&&(L.lanes|=p),kw(_.return,p,c),S||(D=null);break e}_=L.next}}else if(T.tag===18){if(D=T.return,D===null)throw Error(r(341));D.lanes|=p,_=D.alternate,_!==null&&(_.lanes|=p),kw(D,p,c),D=null}else D=T.child;if(D!==null)D.return=T;else for(D=T;D!==null;){if(D===c){D=null;break}if(T=D.sibling,T!==null){T.return=D.return,D=T;break}D=D.return}T=D}}function mh(c,d,p,S){c=null;for(var T=d,_=!1;T!==null;){if(!_){if((T.flags&524288)!==0)_=!0;else if((T.flags&262144)!==0)break}if(T.tag===10){var D=T.alternate;if(D===null)throw Error(r(387));if(D=D.memoizedProps,D!==null){var L=T.type;$s(T.pendingProps.value,D.value)||(c!==null?c.push(L):c=[L])}}else if(T===xe.current){if(D=T.alternate,D===null)throw Error(r(387));D.memoizedState.memoizedState!==T.memoizedState.memoizedState&&(c!==null?c.push(Wp):c=[Wp])}T=T.return}c!==null&&Mw(d,c,p,S),d.flags|=262144}function Ny(c){for(c=c.firstContext;c!==null;){if(!$s(c.context._currentValue,c.memoizedValue))return!0;c=c.next}return!1}function Yu(c){Gu=c,Sl=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function Xr(c){return bA(Gu,c)}function zy(c,d){return Gu===null&&Yu(c),bA(c,d)}function bA(c,d){var p=d._currentValue;if(d={context:d,memoizedValue:p,next:null},Sl===null){if(c===null)throw Error(r(308));Sl=d,c.dependencies={lanes:0,firstContext:d},c.flags|=524288}else Sl=Sl.next=d;return p}var rX=typeof AbortController<"u"?AbortController:function(){var c=[],d=this.signal={aborted:!1,addEventListener:function(p,S){c.push(S)}};this.abort=function(){d.aborted=!0,c.forEach(function(p){return p()})}},iX=t.unstable_scheduleCallback,sX=t.unstable_NormalPriority,fr={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Aw(){return{controller:new rX,data:new Map,refCount:0}}function Cp(c){c.refCount--,c.refCount===0&&iX(sX,function(){c.controller.abort()})}var Tp=null,Ow=0,yh=0,Sh=null;function oX(c,d){if(Tp===null){var p=Tp=[];Ow=0,yh=j1(),Sh={status:"pending",value:void 0,then:function(S){p.push(S)}}}return Ow++,d.then(vA,vA),d}function vA(){if(--Ow===0&&Tp!==null){Sh!==null&&(Sh.status="fulfilled");var c=Tp;Tp=null,yh=0,Sh=null;for(var d=0;d<c.length;d++)(0,c[d])()}}function aX(c,d){var p=[],S={status:"pending",value:null,reason:null,then:function(T){p.push(T)}};return c.then(function(){S.status="fulfilled",S.value=d;for(var T=0;T<p.length;T++)(0,p[T])(d)},function(T){for(S.status="rejected",S.reason=T,T=0;T<p.length;T++)(0,p[T])(void 0)}),S}var xA=B.S;B.S=function(c,d){iD=dr(),typeof d=="object"&&d!==null&&typeof d.then=="function"&&oX(c,d),xA!==null&&xA(c,d)};var Wu=U(null);function Dw(){var c=Wu.current;return c!==null?c:cn.pooledCache}function By(c,d){d===null?le(Wu,Wu.current):le(Wu,d.pool)}function wA(){var c=Dw();return c===null?null:{parent:fr._currentValue,pool:c}}var bh=Error(r(460)),Rw=Error(r(474)),Fy=Error(r(542)),Uy={then:function(){}};function CA(c){return c=c.status,c==="fulfilled"||c==="rejected"}function TA(c,d,p){switch(p=c[p],p===void 0?c.push(d):p!==d&&(d.then(Ce,Ce),d=p),d.status){case"fulfilled":return d.value;case"rejected":throw c=d.reason,_A(c),c;default:if(typeof d.status=="string")d.then(Ce,Ce);else{if(c=cn,c!==null&&100<c.shellSuspendCounter)throw Error(r(482));c=d,c.status="pending",c.then(function(S){if(d.status==="pending"){var T=d;T.status="fulfilled",T.value=S}},function(S){if(d.status==="pending"){var T=d;T.status="rejected",T.reason=S}})}switch(d.status){case"fulfilled":return d.value;case"rejected":throw c=d.reason,_A(c),c}throw Zu=d,bh}}function Xu(c){try{var d=c._init;return d(c._payload)}catch(p){throw p!==null&&typeof p=="object"&&typeof p.then=="function"?(Zu=p,bh):p}}var Zu=null;function EA(){if(Zu===null)throw Error(r(459));var c=Zu;return Zu=null,c}function _A(c){if(c===bh||c===Fy)throw Error(r(483))}var vh=null,Ep=0;function Hy(c){var d=Ep;return Ep+=1,vh===null&&(vh=[]),TA(vh,c,d)}function _p(c,d){d=d.props.ref,c.ref=d!==void 0?d:null}function $y(c,d){throw d.$$typeof===g?Error(r(525)):(c=Object.prototype.toString.call(d),Error(r(31,c==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":c)))}function PA(c){function d(re,X){if(c){var se=re.deletions;se===null?(re.deletions=[X],re.flags|=16):se.push(X)}}function p(re,X){if(!c)return null;for(;X!==null;)d(re,X),X=X.sibling;return null}function S(re){for(var X=new Map;re!==null;)re.key!==null?X.set(re.key,re):X.set(re.index,re),re=re.sibling;return X}function T(re,X){return re=ml(re,X),re.index=0,re.sibling=null,re}function _(re,X,se){return re.index=se,c?(se=re.alternate,se!==null?(se=se.index,se<X?(re.flags|=67108866,X):se):(re.flags|=67108866,X)):(re.flags|=1048576,X)}function D(re){return c&&re.alternate===null&&(re.flags|=67108866),re}function L(re,X,se,ye){return X===null||X.tag!==6?(X=ww(se,re.mode,ye),X.return=re,X):(X=T(X,se),X.return=re,X)}function Y(re,X,se,ye){var Ge=se.type;return Ge===w?he(re,X,se.props.children,ye,se.key):X!==null&&(X.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===R&&Xu(Ge)===X.type)?(X=T(X,se.props),_p(X,se),X.return=re,X):(X=jy(se.type,se.key,se.props,null,re.mode,ye),_p(X,se),X.return=re,X)}function oe(re,X,se,ye){return X===null||X.tag!==4||X.stateNode.containerInfo!==se.containerInfo||X.stateNode.implementation!==se.implementation?(X=Cw(se,re.mode,ye),X.return=re,X):(X=T(X,se.children||[]),X.return=re,X)}function he(re,X,se,ye,Ge){return X===null||X.tag!==7?(X=Vu(se,re.mode,ye,Ge),X.return=re,X):(X=T(X,se),X.return=re,X)}function Se(re,X,se){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=ww(""+X,re.mode,se),X.return=re,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case m:return se=jy(X.type,X.key,X.props,null,re.mode,se),_p(se,X),se.return=re,se;case b:return X=Cw(X,re.mode,se),X.return=re,X;case R:return X=Xu(X),Se(re,X,se)}if(K(X)||H(X))return X=Vu(X,re.mode,se,null),X.return=re,X;if(typeof X.then=="function")return Se(re,Hy(X),se);if(X.$$typeof===P)return Se(re,zy(re,X),se);$y(re,X)}return null}function ae(re,X,se,ye){var Ge=X!==null?X.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Ge!==null?null:L(re,X,""+se,ye);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case m:return se.key===Ge?Y(re,X,se,ye):null;case b:return se.key===Ge?oe(re,X,se,ye):null;case R:return se=Xu(se),ae(re,X,se,ye)}if(K(se)||H(se))return Ge!==null?null:he(re,X,se,ye,null);if(typeof se.then=="function")return ae(re,X,Hy(se),ye);if(se.$$typeof===P)return ae(re,X,zy(re,se),ye);$y(re,se)}return null}function ue(re,X,se,ye,Ge){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return re=re.get(se)||null,L(X,re,""+ye,Ge);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case m:return re=re.get(ye.key===null?se:ye.key)||null,Y(X,re,ye,Ge);case b:return re=re.get(ye.key===null?se:ye.key)||null,oe(X,re,ye,Ge);case R:return ye=Xu(ye),ue(re,X,se,ye,Ge)}if(K(ye)||H(ye))return re=re.get(se)||null,he(X,re,ye,Ge,null);if(typeof ye.then=="function")return ue(re,X,se,Hy(ye),Ge);if(ye.$$typeof===P)return ue(re,X,se,zy(X,ye),Ge);$y(X,ye)}return null}function Ue(re,X,se,ye){for(var Ge=null,Bt=null,$e=X,mt=X=0,It=null;$e!==null&&mt<se.length;mt++){$e.index>mt?(It=$e,$e=null):It=$e.sibling;var Ft=ae(re,$e,se[mt],ye);if(Ft===null){$e===null&&($e=It);break}c&&$e&&Ft.alternate===null&&d(re,$e),X=_(Ft,X,mt),Bt===null?Ge=Ft:Bt.sibling=Ft,Bt=Ft,$e=It}if(mt===se.length)return p(re,$e),Ot&&yl(re,mt),Ge;if($e===null){for(;mt<se.length;mt++)$e=Se(re,se[mt],ye),$e!==null&&(X=_($e,X,mt),Bt===null?Ge=$e:Bt.sibling=$e,Bt=$e);return Ot&&yl(re,mt),Ge}for($e=S($e);mt<se.length;mt++)It=ue($e,re,mt,se[mt],ye),It!==null&&(c&&It.alternate!==null&&$e.delete(It.key===null?mt:It.key),X=_(It,X,mt),Bt===null?Ge=It:Bt.sibling=It,Bt=It);return c&&$e.forEach(function(jc){return d(re,jc)}),Ot&&yl(re,mt),Ge}function et(re,X,se,ye){if(se==null)throw Error(r(151));for(var Ge=null,Bt=null,$e=X,mt=X=0,It=null,Ft=se.next();$e!==null&&!Ft.done;mt++,Ft=se.next()){$e.index>mt?(It=$e,$e=null):It=$e.sibling;var jc=ae(re,$e,Ft.value,ye);if(jc===null){$e===null&&($e=It);break}c&&$e&&jc.alternate===null&&d(re,$e),X=_(jc,X,mt),Bt===null?Ge=jc:Bt.sibling=jc,Bt=jc,$e=It}if(Ft.done)return p(re,$e),Ot&&yl(re,mt),Ge;if($e===null){for(;!Ft.done;mt++,Ft=se.next())Ft=Se(re,Ft.value,ye),Ft!==null&&(X=_(Ft,X,mt),Bt===null?Ge=Ft:Bt.sibling=Ft,Bt=Ft);return Ot&&yl(re,mt),Ge}for($e=S($e);!Ft.done;mt++,Ft=se.next())Ft=ue($e,re,mt,Ft.value,ye),Ft!==null&&(c&&Ft.alternate!==null&&$e.delete(Ft.key===null?mt:Ft.key),X=_(Ft,X,mt),Bt===null?Ge=Ft:Bt.sibling=Ft,Bt=Ft);return c&&$e.forEach(function(SZ){return d(re,SZ)}),Ot&&yl(re,mt),Ge}function nn(re,X,se,ye){if(typeof se=="object"&&se!==null&&se.type===w&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case m:e:{for(var Ge=se.key;X!==null;){if(X.key===Ge){if(Ge=se.type,Ge===w){if(X.tag===7){p(re,X.sibling),ye=T(X,se.props.children),ye.return=re,re=ye;break e}}else if(X.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===R&&Xu(Ge)===X.type){p(re,X.sibling),ye=T(X,se.props),_p(ye,se),ye.return=re,re=ye;break e}p(re,X);break}else d(re,X);X=X.sibling}se.type===w?(ye=Vu(se.props.children,re.mode,ye,se.key),ye.return=re,re=ye):(ye=jy(se.type,se.key,se.props,null,re.mode,ye),_p(ye,se),ye.return=re,re=ye)}return D(re);case b:e:{for(Ge=se.key;X!==null;){if(X.key===Ge)if(X.tag===4&&X.stateNode.containerInfo===se.containerInfo&&X.stateNode.implementation===se.implementation){p(re,X.sibling),ye=T(X,se.children||[]),ye.return=re,re=ye;break e}else{p(re,X);break}else d(re,X);X=X.sibling}ye=Cw(se,re.mode,ye),ye.return=re,re=ye}return D(re);case R:return se=Xu(se),nn(re,X,se,ye)}if(K(se))return Ue(re,X,se,ye);if(H(se)){if(Ge=H(se),typeof Ge!="function")throw Error(r(150));return se=Ge.call(se),et(re,X,se,ye)}if(typeof se.then=="function")return nn(re,X,Hy(se),ye);if(se.$$typeof===P)return nn(re,X,zy(re,se),ye);$y(re,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,X!==null&&X.tag===6?(p(re,X.sibling),ye=T(X,se),ye.return=re,re=ye):(p(re,X),ye=ww(se,re.mode,ye),ye.return=re,re=ye),D(re)):p(re,X)}return function(re,X,se,ye){try{Ep=0;var Ge=nn(re,X,se,ye);return vh=null,Ge}catch($e){if($e===bh||$e===Fy)throw $e;var Bt=Ks(29,$e,null,re.mode);return Bt.lanes=ye,Bt.return=re,Bt}finally{}}}var Ju=PA(!0),IA=PA(!1),Sc=!1;function jw(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lw(c,d){c=c.updateQueue,d.updateQueue===c&&(d.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function bc(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function vc(c,d,p){var S=c.updateQueue;if(S===null)return null;if(S=S.shared,($t&2)!==0){var T=S.pending;return T===null?d.next=d:(d.next=T.next,T.next=d),S.pending=d,d=Ry(c),dA(c,null,p),d}return Dy(c,S,d,p),Ry(c)}function Pp(c,d,p){if(d=d.updateQueue,d!==null&&(d=d.shared,(p&4194048)!==0)){var S=d.lanes;S&=c.pendingLanes,p|=S,d.lanes=p,fs(c,p)}}function Nw(c,d){var p=c.updateQueue,S=c.alternate;if(S!==null&&(S=S.updateQueue,p===S)){var T=null,_=null;if(p=p.firstBaseUpdate,p!==null){do{var D={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};_===null?T=_=D:_=_.next=D,p=p.next}while(p!==null);_===null?T=_=d:_=_.next=d}else T=_=d;p={baseState:S.baseState,firstBaseUpdate:T,lastBaseUpdate:_,shared:S.shared,callbacks:S.callbacks},c.updateQueue=p;return}c=p.lastBaseUpdate,c===null?p.firstBaseUpdate=d:c.next=d,p.lastBaseUpdate=d}var zw=!1;function Ip(){if(zw){var c=Sh;if(c!==null)throw c}}function kp(c,d,p,S){zw=!1;var T=c.updateQueue;Sc=!1;var _=T.firstBaseUpdate,D=T.lastBaseUpdate,L=T.shared.pending;if(L!==null){T.shared.pending=null;var Y=L,oe=Y.next;Y.next=null,D===null?_=oe:D.next=oe,D=Y;var he=c.alternate;he!==null&&(he=he.updateQueue,L=he.lastBaseUpdate,L!==D&&(L===null?he.firstBaseUpdate=oe:L.next=oe,he.lastBaseUpdate=Y))}if(_!==null){var Se=T.baseState;D=0,he=oe=Y=null,L=_;do{var ae=L.lane&-536870913,ue=ae!==L.lane;if(ue?(Pt&ae)===ae:(S&ae)===ae){ae!==0&&ae===yh&&(zw=!0),he!==null&&(he=he.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Ue=c,et=L;ae=d;var nn=p;switch(et.tag){case 1:if(Ue=et.payload,typeof Ue=="function"){Se=Ue.call(nn,Se,ae);break e}Se=Ue;break e;case 3:Ue.flags=Ue.flags&-65537|128;case 0:if(Ue=et.payload,ae=typeof Ue=="function"?Ue.call(nn,Se,ae):Ue,ae==null)break e;Se=h({},Se,ae);break e;case 2:Sc=!0}}ae=L.callback,ae!==null&&(c.flags|=64,ue&&(c.flags|=8192),ue=T.callbacks,ue===null?T.callbacks=[ae]:ue.push(ae))}else ue={lane:ae,tag:L.tag,payload:L.payload,callback:L.callback,next:null},he===null?(oe=he=ue,Y=Se):he=he.next=ue,D|=ae;if(L=L.next,L===null){if(L=T.shared.pending,L===null)break;ue=L,L=ue.next,ue.next=null,T.lastBaseUpdate=ue,T.shared.pending=null}}while(!0);he===null&&(Y=Se),T.baseState=Y,T.firstBaseUpdate=oe,T.lastBaseUpdate=he,_===null&&(T.shared.lanes=0),Ec|=D,c.lanes=D,c.memoizedState=Se}}function kA(c,d){if(typeof c!="function")throw Error(r(191,c));c.call(d)}function MA(c,d){var p=c.callbacks;if(p!==null)for(c.callbacks=null,c=0;c<p.length;c++)kA(p[c],d)}var xh=U(null),Ky=U(0);function AA(c,d){c=Il,le(Ky,c),le(xh,d),Il=c|d.baseLanes}function Bw(){le(Ky,Il),le(xh,xh.current)}function Fw(){Il=Ky.current,ne(xh),ne(Ky)}var Vs=U(null),Io=null;function xc(c){var d=c.alternate;le(er,er.current&1),le(Vs,c),Io===null&&(d===null||xh.current!==null||d.memoizedState!==null)&&(Io=c)}function Uw(c){le(er,er.current),le(Vs,c),Io===null&&(Io=c)}function OA(c){c.tag===22?(le(er,er.current),le(Vs,c),Io===null&&(Io=c)):wc()}function wc(){le(er,er.current),le(Vs,Vs.current)}function qs(c){ne(Vs),Io===c&&(Io=null),ne(er)}var er=U(0);function Vy(c){for(var d=c;d!==null;){if(d.tag===13){var p=d.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||G1(p)||Y1(p)))return d}else if(d.tag===19&&(d.memoizedProps.revealOrder==="forwards"||d.memoizedProps.revealOrder==="backwards"||d.memoizedProps.revealOrder==="unstable_legacy-backwards"||d.memoizedProps.revealOrder==="together")){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var vl=0,ft=null,en=null,pr=null,qy=!1,wh=!1,Qu=!1,Gy=0,Mp=0,Ch=null,lX=0;function Fn(){throw Error(r(321))}function Hw(c,d){if(d===null)return!1;for(var p=0;p<d.length&&p<c.length;p++)if(!$s(c[p],d[p]))return!1;return!0}function $w(c,d,p,S,T,_){return vl=_,ft=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,B.H=c===null||c.memoizedState===null?gO:i1,Qu=!1,_=p(S,T),Qu=!1,wh&&(_=RA(d,p,S,T)),DA(c),_}function DA(c){B.H=Dp;var d=en!==null&&en.next!==null;if(vl=0,pr=en=ft=null,qy=!1,Mp=0,Ch=null,d)throw Error(r(300));c===null||gr||(c=c.dependencies,c!==null&&Ny(c)&&(gr=!0))}function RA(c,d,p,S){ft=c;var T=0;do{if(wh&&(Ch=null),Mp=0,wh=!1,25<=T)throw Error(r(301));if(T+=1,pr=en=null,c.updateQueue!=null){var _=c.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}B.H=mO,_=d(p,S)}while(wh);return _}function cX(){var c=B.H,d=c.useState()[0];return d=typeof d.then=="function"?Ap(d):d,c=c.useState()[0],(en!==null?en.memoizedState:null)!==c&&(ft.flags|=1024),d}function Kw(){var c=Gy!==0;return Gy=0,c}function Vw(c,d,p){d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~p}function qw(c){if(qy){for(c=c.memoizedState;c!==null;){var d=c.queue;d!==null&&(d.pending=null),c=c.next}qy=!1}vl=0,pr=en=ft=null,wh=!1,Mp=Gy=0,Ch=null}function Ki(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pr===null?ft.memoizedState=pr=c:pr=pr.next=c,pr}function tr(){if(en===null){var c=ft.alternate;c=c!==null?c.memoizedState:null}else c=en.next;var d=pr===null?ft.memoizedState:pr.next;if(d!==null)pr=d,en=c;else{if(c===null)throw ft.alternate===null?Error(r(467)):Error(r(310));en=c,c={memoizedState:en.memoizedState,baseState:en.baseState,baseQueue:en.baseQueue,queue:en.queue,next:null},pr===null?ft.memoizedState=pr=c:pr=pr.next=c}return pr}function Yy(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ap(c){var d=Mp;return Mp+=1,Ch===null&&(Ch=[]),c=TA(Ch,c,d),d=ft,(pr===null?d.memoizedState:pr.next)===null&&(d=d.alternate,B.H=d===null||d.memoizedState===null?gO:i1),c}function Wy(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return Ap(c);if(c.$$typeof===P)return Xr(c)}throw Error(r(438,String(c)))}function Gw(c){var d=null,p=ft.updateQueue;if(p!==null&&(d=p.memoCache),d==null){var S=ft.alternate;S!==null&&(S=S.updateQueue,S!==null&&(S=S.memoCache,S!=null&&(d={data:S.data.map(function(T){return T.slice()}),index:0})))}if(d==null&&(d={data:[],index:0}),p===null&&(p=Yy(),ft.updateQueue=p),p.memoCache=d,p=d.data[d.index],p===void 0)for(p=d.data[d.index]=Array(c),S=0;S<c;S++)p[S]=N;return d.index++,p}function xl(c,d){return typeof d=="function"?d(c):d}function Xy(c){var d=tr();return Yw(d,en,c)}function Yw(c,d,p){var S=c.queue;if(S===null)throw Error(r(311));S.lastRenderedReducer=p;var T=c.baseQueue,_=S.pending;if(_!==null){if(T!==null){var D=T.next;T.next=_.next,_.next=D}d.baseQueue=T=_,S.pending=null}if(_=c.baseState,T===null)c.memoizedState=_;else{d=T.next;var L=D=null,Y=null,oe=d,he=!1;do{var Se=oe.lane&-536870913;if(Se!==oe.lane?(Pt&Se)===Se:(vl&Se)===Se){var ae=oe.revertLane;if(ae===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),Se===yh&&(he=!0);else if((vl&ae)===ae){oe=oe.next,ae===yh&&(he=!0);continue}else Se={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Y===null?(L=Y=Se,D=_):Y=Y.next=Se,ft.lanes|=ae,Ec|=ae;Se=oe.action,Qu&&p(_,Se),_=oe.hasEagerState?oe.eagerState:p(_,Se)}else ae={lane:Se,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Y===null?(L=Y=ae,D=_):Y=Y.next=ae,ft.lanes|=Se,Ec|=Se;oe=oe.next}while(oe!==null&&oe!==d);if(Y===null?D=_:Y.next=L,!$s(_,c.memoizedState)&&(gr=!0,he&&(p=Sh,p!==null)))throw p;c.memoizedState=_,c.baseState=D,c.baseQueue=Y,S.lastRenderedState=_}return T===null&&(S.lanes=0),[c.memoizedState,S.dispatch]}function Ww(c){var d=tr(),p=d.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=c;var S=p.dispatch,T=p.pending,_=d.memoizedState;if(T!==null){p.pending=null;var D=T=T.next;do _=c(_,D.action),D=D.next;while(D!==T);$s(_,d.memoizedState)||(gr=!0),d.memoizedState=_,d.baseQueue===null&&(d.baseState=_),p.lastRenderedState=_}return[_,S]}function jA(c,d,p){var S=ft,T=tr(),_=Ot;if(_){if(p===void 0)throw Error(r(407));p=p()}else p=d();var D=!$s((en||T).memoizedState,p);if(D&&(T.memoizedState=p,gr=!0),T=T.queue,Jw(zA.bind(null,S,T,c),[c]),T.getSnapshot!==d||D||pr!==null&&pr.memoizedState.tag&1){if(S.flags|=2048,Th(9,{destroy:void 0},NA.bind(null,S,T,p,d),null),cn===null)throw Error(r(349));_||(vl&127)!==0||LA(S,d,p)}return p}function LA(c,d,p){c.flags|=16384,c={getSnapshot:d,value:p},d=ft.updateQueue,d===null?(d=Yy(),ft.updateQueue=d,d.stores=[c]):(p=d.stores,p===null?d.stores=[c]:p.push(c))}function NA(c,d,p,S){d.value=p,d.getSnapshot=S,BA(d)&&FA(c)}function zA(c,d,p){return p(function(){BA(d)&&FA(c)})}function BA(c){var d=c.getSnapshot;c=c.value;try{var p=d();return!$s(c,p)}catch{return!0}}function FA(c){var d=Ku(c,2);d!==null&&ws(d,c,2)}function Xw(c){var d=Ki();if(typeof c=="function"){var p=c;if(c=p(),Qu){pn(!0);try{p()}finally{pn(!1)}}}return d.memoizedState=d.baseState=c,d.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:c},d}function UA(c,d,p,S){return c.baseState=p,Yw(c,en,typeof S=="function"?S:xl)}function uX(c,d,p,S,T){if(Qy(c))throw Error(r(485));if(c=d.action,c!==null){var _={payload:T,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){_.listeners.push(D)}};B.T!==null?p(!0):_.isTransition=!1,S(_),p=d.pending,p===null?(_.next=d.pending=_,HA(d,_)):(_.next=p.next,d.pending=p.next=_)}}function HA(c,d){var p=d.action,S=d.payload,T=c.state;if(d.isTransition){var _=B.T,D={};B.T=D;try{var L=p(T,S),Y=B.S;Y!==null&&Y(D,L),$A(c,d,L)}catch(oe){Zw(c,d,oe)}finally{_!==null&&D.types!==null&&(_.types=D.types),B.T=_}}else try{_=p(T,S),$A(c,d,_)}catch(oe){Zw(c,d,oe)}}function $A(c,d,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(S){KA(c,d,S)},function(S){return Zw(c,d,S)}):KA(c,d,p)}function KA(c,d,p){d.status="fulfilled",d.value=p,VA(d),c.state=p,d=c.pending,d!==null&&(p=d.next,p===d?c.pending=null:(p=p.next,d.next=p,HA(c,p)))}function Zw(c,d,p){var S=c.pending;if(c.pending=null,S!==null){S=S.next;do d.status="rejected",d.reason=p,VA(d),d=d.next;while(d!==S)}c.action=null}function VA(c){c=c.listeners;for(var d=0;d<c.length;d++)(0,c[d])()}function qA(c,d){return d}function GA(c,d){if(Ot){var p=cn.formState;if(p!==null){e:{var S=ft;if(Ot){if(gn){t:{for(var T=gn,_=Po;T.nodeType!==8;){if(!_){T=null;break t}if(T=ko(T.nextSibling),T===null){T=null;break t}}_=T.data,T=_==="F!"||_==="F"?T:null}if(T){gn=ko(T.nextSibling),S=T.data==="F!";break e}}mc(S)}S=!1}S&&(d=p[0])}}return p=Ki(),p.memoizedState=p.baseState=d,S={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qA,lastRenderedState:d},p.queue=S,p=hO.bind(null,ft,S),S.dispatch=p,S=Xw(!1),_=r1.bind(null,ft,!1,S.queue),S=Ki(),T={state:d,dispatch:null,action:c,pending:null},S.queue=T,p=uX.bind(null,ft,T,_,p),T.dispatch=p,S.memoizedState=c,[d,p,!1]}function YA(c){var d=tr();return WA(d,en,c)}function WA(c,d,p){if(d=Yw(c,d,qA)[0],c=Xy(xl)[0],typeof d=="object"&&d!==null&&typeof d.then=="function")try{var S=Ap(d)}catch(D){throw D===bh?Fy:D}else S=d;d=tr();var T=d.queue,_=T.dispatch;return p!==d.memoizedState&&(ft.flags|=2048,Th(9,{destroy:void 0},dX.bind(null,T,p),null)),[S,_,c]}function dX(c,d){c.action=d}function XA(c){var d=tr(),p=en;if(p!==null)return WA(d,p,c);tr(),d=d.memoizedState,p=tr();var S=p.queue.dispatch;return p.memoizedState=c,[d,S,!1]}function Th(c,d,p,S){return c={tag:c,create:p,deps:S,inst:d,next:null},d=ft.updateQueue,d===null&&(d=Yy(),ft.updateQueue=d),p=d.lastEffect,p===null?d.lastEffect=c.next=c:(S=p.next,p.next=c,c.next=S,d.lastEffect=c),c}function ZA(){return tr().memoizedState}function Zy(c,d,p,S){var T=Ki();ft.flags|=c,T.memoizedState=Th(1|d,{destroy:void 0},p,S===void 0?null:S)}function Jy(c,d,p,S){var T=tr();S=S===void 0?null:S;var _=T.memoizedState.inst;en!==null&&S!==null&&Hw(S,en.memoizedState.deps)?T.memoizedState=Th(d,_,p,S):(ft.flags|=c,T.memoizedState=Th(1|d,_,p,S))}function JA(c,d){Zy(8390656,8,c,d)}function Jw(c,d){Jy(2048,8,c,d)}function hX(c){ft.flags|=4;var d=ft.updateQueue;if(d===null)d=Yy(),ft.updateQueue=d,d.events=[c];else{var p=d.events;p===null?d.events=[c]:p.push(c)}}function QA(c){var d=tr().memoizedState;return hX({ref:d,nextImpl:c}),function(){if(($t&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}function eO(c,d){return Jy(4,2,c,d)}function tO(c,d){return Jy(4,4,c,d)}function nO(c,d){if(typeof d=="function"){c=c();var p=d(c);return function(){typeof p=="function"?p():d(null)}}if(d!=null)return c=c(),d.current=c,function(){d.current=null}}function rO(c,d,p){p=p!=null?p.concat([c]):null,Jy(4,4,nO.bind(null,d,c),p)}function Qw(){}function iO(c,d){var p=tr();d=d===void 0?null:d;var S=p.memoizedState;return d!==null&&Hw(d,S[1])?S[0]:(p.memoizedState=[c,d],c)}function sO(c,d){var p=tr();d=d===void 0?null:d;var S=p.memoizedState;if(d!==null&&Hw(d,S[1]))return S[0];if(S=c(),Qu){pn(!0);try{c()}finally{pn(!1)}}return p.memoizedState=[S,d],S}function e1(c,d,p){return p===void 0||(vl&1073741824)!==0&&(Pt&261930)===0?c.memoizedState=d:(c.memoizedState=p,c=oD(),ft.lanes|=c,Ec|=c,p)}function oO(c,d,p,S){return $s(p,d)?p:xh.current!==null?(c=e1(c,p,S),$s(c,d)||(gr=!0),c):(vl&42)===0||(vl&1073741824)!==0&&(Pt&261930)===0?(gr=!0,c.memoizedState=p):(c=oD(),ft.lanes|=c,Ec|=c,d)}function aO(c,d,p,S,T){var _=G.p;G.p=_!==0&&8>_?_:8;var D=B.T,L={};B.T=L,r1(c,!1,d,p);try{var Y=T(),oe=B.S;if(oe!==null&&oe(L,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var he=aX(Y,S);Op(c,d,he,Ws(c))}else Op(c,d,S,Ws(c))}catch(Se){Op(c,d,{then:function(){},status:"rejected",reason:Se},Ws())}finally{G.p=_,D!==null&&L.types!==null&&(D.types=L.types),B.T=D}}function fX(){}function t1(c,d,p,S){if(c.tag!==5)throw Error(r(476));var T=lO(c).queue;aO(c,T,d,W,p===null?fX:function(){return cO(c),p(S)})}function lO(c){var d=c.memoizedState;if(d!==null)return d;d={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:W},next:null};var p={};return d.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:p},next:null},c.memoizedState=d,c=c.alternate,c!==null&&(c.memoizedState=d),d}function cO(c){var d=lO(c);d.next===null&&(d=c.alternate.memoizedState),Op(c,d.next.queue,{},Ws())}function n1(){return Xr(Wp)}function uO(){return tr().memoizedState}function dO(){return tr().memoizedState}function pX(c){for(var d=c.return;d!==null;){switch(d.tag){case 24:case 3:var p=Ws();c=bc(p);var S=vc(d,c,p);S!==null&&(ws(S,d,p),Pp(S,d,p)),d={cache:Aw()},c.payload=d;return}d=d.return}}function gX(c,d,p){var S=Ws();p={lane:S,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Qy(c)?fO(d,p):(p=vw(c,d,p,S),p!==null&&(ws(p,c,S),pO(p,d,S)))}function hO(c,d,p){var S=Ws();Op(c,d,p,S)}function Op(c,d,p,S){var T={lane:S,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(Qy(c))fO(d,T);else{var _=c.alternate;if(c.lanes===0&&(_===null||_.lanes===0)&&(_=d.lastRenderedReducer,_!==null))try{var D=d.lastRenderedState,L=_(D,p);if(T.hasEagerState=!0,T.eagerState=L,$s(L,D))return Dy(c,d,T,0),cn===null&&Oy(),!1}catch{}finally{}if(p=vw(c,d,T,S),p!==null)return ws(p,c,S),pO(p,d,S),!0}return!1}function r1(c,d,p,S){if(S={lane:2,revertLane:j1(),gesture:null,action:S,hasEagerState:!1,eagerState:null,next:null},Qy(c)){if(d)throw Error(r(479))}else d=vw(c,p,S,2),d!==null&&ws(d,c,2)}function Qy(c){var d=c.alternate;return c===ft||d!==null&&d===ft}function fO(c,d){wh=qy=!0;var p=c.pending;p===null?d.next=d:(d.next=p.next,p.next=d),c.pending=d}function pO(c,d,p){if((p&4194048)!==0){var S=d.lanes;S&=c.pendingLanes,p|=S,d.lanes=p,fs(c,p)}}var Dp={readContext:Xr,use:Wy,useCallback:Fn,useContext:Fn,useEffect:Fn,useImperativeHandle:Fn,useLayoutEffect:Fn,useInsertionEffect:Fn,useMemo:Fn,useReducer:Fn,useRef:Fn,useState:Fn,useDebugValue:Fn,useDeferredValue:Fn,useTransition:Fn,useSyncExternalStore:Fn,useId:Fn,useHostTransitionStatus:Fn,useFormState:Fn,useActionState:Fn,useOptimistic:Fn,useMemoCache:Fn,useCacheRefresh:Fn};Dp.useEffectEvent=Fn;var gO={readContext:Xr,use:Wy,useCallback:function(c,d){return Ki().memoizedState=[c,d===void 0?null:d],c},useContext:Xr,useEffect:JA,useImperativeHandle:function(c,d,p){p=p!=null?p.concat([c]):null,Zy(4194308,4,nO.bind(null,d,c),p)},useLayoutEffect:function(c,d){return Zy(4194308,4,c,d)},useInsertionEffect:function(c,d){Zy(4,2,c,d)},useMemo:function(c,d){var p=Ki();d=d===void 0?null:d;var S=c();if(Qu){pn(!0);try{c()}finally{pn(!1)}}return p.memoizedState=[S,d],S},useReducer:function(c,d,p){var S=Ki();if(p!==void 0){var T=p(d);if(Qu){pn(!0);try{p(d)}finally{pn(!1)}}}else T=d;return S.memoizedState=S.baseState=T,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:T},S.queue=c,c=c.dispatch=gX.bind(null,ft,c),[S.memoizedState,c]},useRef:function(c){var d=Ki();return c={current:c},d.memoizedState=c},useState:function(c){c=Xw(c);var d=c.queue,p=hO.bind(null,ft,d);return d.dispatch=p,[c.memoizedState,p]},useDebugValue:Qw,useDeferredValue:function(c,d){var p=Ki();return e1(p,c,d)},useTransition:function(){var c=Xw(!1);return c=aO.bind(null,ft,c.queue,!0,!1),Ki().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,d,p){var S=ft,T=Ki();if(Ot){if(p===void 0)throw Error(r(407));p=p()}else{if(p=d(),cn===null)throw Error(r(349));(Pt&127)!==0||LA(S,d,p)}T.memoizedState=p;var _={value:p,getSnapshot:d};return T.queue=_,JA(zA.bind(null,S,_,c),[c]),S.flags|=2048,Th(9,{destroy:void 0},NA.bind(null,S,_,p,d),null),p},useId:function(){var c=Ki(),d=cn.identifierPrefix;if(Ot){var p=Pa,S=_a;p=(S&~(1<<32-An(S)-1)).toString(32)+p,d="_"+d+"R_"+p,p=Gy++,0<p&&(d+="H"+p.toString(32)),d+="_"}else p=lX++,d="_"+d+"r_"+p.toString(32)+"_";return c.memoizedState=d},useHostTransitionStatus:n1,useFormState:GA,useActionState:GA,useOptimistic:function(c){var d=Ki();d.memoizedState=d.baseState=c;var p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return d.queue=p,d=r1.bind(null,ft,!0,p),p.dispatch=d,[c,d]},useMemoCache:Gw,useCacheRefresh:function(){return Ki().memoizedState=pX.bind(null,ft)},useEffectEvent:function(c){var d=Ki(),p={impl:c};return d.memoizedState=p,function(){if(($t&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}},i1={readContext:Xr,use:Wy,useCallback:iO,useContext:Xr,useEffect:Jw,useImperativeHandle:rO,useInsertionEffect:eO,useLayoutEffect:tO,useMemo:sO,useReducer:Xy,useRef:ZA,useState:function(){return Xy(xl)},useDebugValue:Qw,useDeferredValue:function(c,d){var p=tr();return oO(p,en.memoizedState,c,d)},useTransition:function(){var c=Xy(xl)[0],d=tr().memoizedState;return[typeof c=="boolean"?c:Ap(c),d]},useSyncExternalStore:jA,useId:uO,useHostTransitionStatus:n1,useFormState:YA,useActionState:YA,useOptimistic:function(c,d){var p=tr();return UA(p,en,c,d)},useMemoCache:Gw,useCacheRefresh:dO};i1.useEffectEvent=QA;var mO={readContext:Xr,use:Wy,useCallback:iO,useContext:Xr,useEffect:Jw,useImperativeHandle:rO,useInsertionEffect:eO,useLayoutEffect:tO,useMemo:sO,useReducer:Ww,useRef:ZA,useState:function(){return Ww(xl)},useDebugValue:Qw,useDeferredValue:function(c,d){var p=tr();return en===null?e1(p,c,d):oO(p,en.memoizedState,c,d)},useTransition:function(){var c=Ww(xl)[0],d=tr().memoizedState;return[typeof c=="boolean"?c:Ap(c),d]},useSyncExternalStore:jA,useId:uO,useHostTransitionStatus:n1,useFormState:XA,useActionState:XA,useOptimistic:function(c,d){var p=tr();return en!==null?UA(p,en,c,d):(p.baseState=c,[c,p.queue.dispatch])},useMemoCache:Gw,useCacheRefresh:dO};mO.useEffectEvent=QA;function s1(c,d,p,S){d=c.memoizedState,p=p(S,d),p=p==null?d:h({},d,p),c.memoizedState=p,c.lanes===0&&(c.updateQueue.baseState=p)}var o1={enqueueSetState:function(c,d,p){c=c._reactInternals;var S=Ws(),T=bc(S);T.payload=d,p!=null&&(T.callback=p),d=vc(c,T,S),d!==null&&(ws(d,c,S),Pp(d,c,S))},enqueueReplaceState:function(c,d,p){c=c._reactInternals;var S=Ws(),T=bc(S);T.tag=1,T.payload=d,p!=null&&(T.callback=p),d=vc(c,T,S),d!==null&&(ws(d,c,S),Pp(d,c,S))},enqueueForceUpdate:function(c,d){c=c._reactInternals;var p=Ws(),S=bc(p);S.tag=2,d!=null&&(S.callback=d),d=vc(c,S,p),d!==null&&(ws(d,c,p),Pp(d,c,p))}};function yO(c,d,p,S,T,_,D){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(S,_,D):d.prototype&&d.prototype.isPureReactComponent?!bp(p,S)||!bp(T,_):!0}function SO(c,d,p,S){c=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(p,S),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(p,S),d.state!==c&&o1.enqueueReplaceState(d,d.state,null)}function ed(c,d){var p=d;if("ref"in d){p={};for(var S in d)S!=="ref"&&(p[S]=d[S])}if(c=c.defaultProps){p===d&&(p=h({},p));for(var T in c)p[T]===void 0&&(p[T]=c[T])}return p}function bO(c){Ay(c)}function vO(c){console.error(c)}function xO(c){Ay(c)}function eS(c,d){try{var p=c.onUncaughtError;p(d.value,{componentStack:d.stack})}catch(S){setTimeout(function(){throw S})}}function wO(c,d,p){try{var S=c.onCaughtError;S(p.value,{componentStack:p.stack,errorBoundary:d.tag===1?d.stateNode:null})}catch(T){setTimeout(function(){throw T})}}function a1(c,d,p){return p=bc(p),p.tag=3,p.payload={element:null},p.callback=function(){eS(c,d)},p}function CO(c){return c=bc(c),c.tag=3,c}function TO(c,d,p,S){var T=p.type.getDerivedStateFromError;if(typeof T=="function"){var _=S.value;c.payload=function(){return T(_)},c.callback=function(){wO(d,p,S)}}var D=p.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(c.callback=function(){wO(d,p,S),typeof T!="function"&&(_c===null?_c=new Set([this]):_c.add(this));var L=S.stack;this.componentDidCatch(S.value,{componentStack:L!==null?L:""})})}function mX(c,d,p,S,T){if(p.flags|=32768,S!==null&&typeof S=="object"&&typeof S.then=="function"){if(d=p.alternate,d!==null&&mh(d,p,T,!0),p=Vs.current,p!==null){switch(p.tag){case 31:case 13:return Io===null?hS():p.alternate===null&&Un===0&&(Un=3),p.flags&=-257,p.flags|=65536,p.lanes=T,S===Uy?p.flags|=16384:(d=p.updateQueue,d===null?p.updateQueue=new Set([S]):d.add(S),O1(c,S,T)),!1;case 22:return p.flags|=65536,S===Uy?p.flags|=16384:(d=p.updateQueue,d===null?(d={transitions:null,markerInstances:null,retryQueue:new Set([S])},p.updateQueue=d):(p=d.retryQueue,p===null?d.retryQueue=new Set([S]):p.add(S)),O1(c,S,T)),!1}throw Error(r(435,p.tag))}return O1(c,S,T),hS(),!1}if(Ot)return d=Vs.current,d!==null?((d.flags&65536)===0&&(d.flags|=256),d.flags|=65536,d.lanes=T,S!==_w&&(c=Error(r(422),{cause:S}),wp(To(c,p)))):(S!==_w&&(d=Error(r(423),{cause:S}),wp(To(d,p))),c=c.current.alternate,c.flags|=65536,T&=-T,c.lanes|=T,S=To(S,p),T=a1(c.stateNode,S,T),Nw(c,T),Un!==4&&(Un=2)),!1;var _=Error(r(520),{cause:S});if(_=To(_,p),Up===null?Up=[_]:Up.push(_),Un!==4&&(Un=2),d===null)return!0;S=To(S,p),p=d;do{switch(p.tag){case 3:return p.flags|=65536,c=T&-T,p.lanes|=c,c=a1(p.stateNode,S,c),Nw(p,c),!1;case 1:if(d=p.type,_=p.stateNode,(p.flags&128)===0&&(typeof d.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(_c===null||!_c.has(_))))return p.flags|=65536,T&=-T,p.lanes|=T,T=CO(T),TO(T,c,p,S),Nw(p,T),!1}p=p.return}while(p!==null);return!1}var l1=Error(r(461)),gr=!1;function Zr(c,d,p,S){d.child=c===null?IA(d,null,p,S):Ju(d,c.child,p,S)}function EO(c,d,p,S,T){p=p.render;var _=d.ref;if("ref"in S){var D={};for(var L in S)L!=="ref"&&(D[L]=S[L])}else D=S;return Yu(d),S=$w(c,d,p,D,_,T),L=Kw(),c!==null&&!gr?(Vw(c,d,T),wl(c,d,T)):(Ot&&L&&Tw(d),d.flags|=1,Zr(c,d,S,T),d.child)}function _O(c,d,p,S,T){if(c===null){var _=p.type;return typeof _=="function"&&!xw(_)&&_.defaultProps===void 0&&p.compare===null?(d.tag=15,d.type=_,PO(c,d,_,S,T)):(c=jy(p.type,null,S,d,d.mode,T),c.ref=d.ref,c.return=d,d.child=c)}if(_=c.child,!m1(c,T)){var D=_.memoizedProps;if(p=p.compare,p=p!==null?p:bp,p(D,S)&&c.ref===d.ref)return wl(c,d,T)}return d.flags|=1,c=ml(_,S),c.ref=d.ref,c.return=d,d.child=c}function PO(c,d,p,S,T){if(c!==null){var _=c.memoizedProps;if(bp(_,S)&&c.ref===d.ref)if(gr=!1,d.pendingProps=S=_,m1(c,T))(c.flags&131072)!==0&&(gr=!0);else return d.lanes=c.lanes,wl(c,d,T)}return c1(c,d,p,S,T)}function IO(c,d,p,S){var T=S.children,_=c!==null?c.memoizedState:null;if(c===null&&d.stateNode===null&&(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),S.mode==="hidden"){if((d.flags&128)!==0){if(_=_!==null?_.baseLanes|p:p,c!==null){for(S=d.child=c.child,T=0;S!==null;)T=T|S.lanes|S.childLanes,S=S.sibling;S=T&~_}else S=0,d.child=null;return kO(c,d,_,p,S)}if((p&536870912)!==0)d.memoizedState={baseLanes:0,cachePool:null},c!==null&&By(d,_!==null?_.cachePool:null),_!==null?AA(d,_):Bw(),OA(d);else return S=d.lanes=536870912,kO(c,d,_!==null?_.baseLanes|p:p,p,S)}else _!==null?(By(d,_.cachePool),AA(d,_),wc(),d.memoizedState=null):(c!==null&&By(d,null),Bw(),wc());return Zr(c,d,T,p),d.child}function Rp(c,d){return c!==null&&c.tag===22||d.stateNode!==null||(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.sibling}function kO(c,d,p,S,T){var _=Dw();return _=_===null?null:{parent:fr._currentValue,pool:_},d.memoizedState={baseLanes:p,cachePool:_},c!==null&&By(d,null),Bw(),OA(d),c!==null&&mh(c,d,S,!0),d.childLanes=T,null}function tS(c,d){return d=rS({mode:d.mode,children:d.children},c.mode),d.ref=c.ref,c.child=d,d.return=c,d}function MO(c,d,p){return Ju(d,c.child,null,p),c=tS(d,d.pendingProps),c.flags|=2,qs(d),d.memoizedState=null,c}function yX(c,d,p){var S=d.pendingProps,T=(d.flags&128)!==0;if(d.flags&=-129,c===null){if(Ot){if(S.mode==="hidden")return c=tS(d,S),d.lanes=536870912,Rp(null,c);if(Uw(d),(c=gn)?(c=HD(c,Po),c=c!==null&&c.data==="&"?c:null,c!==null&&(d.memoizedState={dehydrated:c,treeContext:pc!==null?{id:_a,overflow:Pa}:null,retryLane:536870912,hydrationErrors:null},p=fA(c),p.return=d,d.child=p,Wr=d,gn=null)):c=null,c===null)throw mc(d);return d.lanes=536870912,null}return tS(d,S)}var _=c.memoizedState;if(_!==null){var D=_.dehydrated;if(Uw(d),T)if(d.flags&256)d.flags&=-257,d=MO(c,d,p);else if(d.memoizedState!==null)d.child=c.child,d.flags|=128,d=null;else throw Error(r(558));else if(gr||mh(c,d,p,!1),T=(p&c.childLanes)!==0,gr||T){if(S=cn,S!==null&&(D=Jd(S,p),D!==0&&D!==_.retryLane))throw _.retryLane=D,Ku(c,D),ws(S,c,D),l1;hS(),d=MO(c,d,p)}else c=_.treeContext,gn=ko(D.nextSibling),Wr=d,Ot=!0,gc=null,Po=!1,c!==null&&mA(d,c),d=tS(d,S),d.flags|=4096;return d}return c=ml(c.child,{mode:S.mode,children:S.children}),c.ref=d.ref,d.child=c,c.return=d,c}function nS(c,d){var p=d.ref;if(p===null)c!==null&&c.ref!==null&&(d.flags|=4194816);else{if(typeof p!="function"&&typeof p!="object")throw Error(r(284));(c===null||c.ref!==p)&&(d.flags|=4194816)}}function c1(c,d,p,S,T){return Yu(d),p=$w(c,d,p,S,void 0,T),S=Kw(),c!==null&&!gr?(Vw(c,d,T),wl(c,d,T)):(Ot&&S&&Tw(d),d.flags|=1,Zr(c,d,p,T),d.child)}function AO(c,d,p,S,T,_){return Yu(d),d.updateQueue=null,p=RA(d,S,p,T),DA(c),S=Kw(),c!==null&&!gr?(Vw(c,d,_),wl(c,d,_)):(Ot&&S&&Tw(d),d.flags|=1,Zr(c,d,p,_),d.child)}function OO(c,d,p,S,T){if(Yu(d),d.stateNode===null){var _=hh,D=p.contextType;typeof D=="object"&&D!==null&&(_=Xr(D)),_=new p(S,_),d.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=o1,d.stateNode=_,_._reactInternals=d,_=d.stateNode,_.props=S,_.state=d.memoizedState,_.refs={},jw(d),D=p.contextType,_.context=typeof D=="object"&&D!==null?Xr(D):hh,_.state=d.memoizedState,D=p.getDerivedStateFromProps,typeof D=="function"&&(s1(d,p,D,S),_.state=d.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(D=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),D!==_.state&&o1.enqueueReplaceState(_,_.state,null),kp(d,S,_,T),Ip(),_.state=d.memoizedState),typeof _.componentDidMount=="function"&&(d.flags|=4194308),S=!0}else if(c===null){_=d.stateNode;var L=d.memoizedProps,Y=ed(p,L);_.props=Y;var oe=_.context,he=p.contextType;D=hh,typeof he=="object"&&he!==null&&(D=Xr(he));var Se=p.getDerivedStateFromProps;he=typeof Se=="function"||typeof _.getSnapshotBeforeUpdate=="function",L=d.pendingProps!==L,he||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(L||oe!==D)&&SO(d,_,S,D),Sc=!1;var ae=d.memoizedState;_.state=ae,kp(d,S,_,T),Ip(),oe=d.memoizedState,L||ae!==oe||Sc?(typeof Se=="function"&&(s1(d,p,Se,S),oe=d.memoizedState),(Y=Sc||yO(d,p,Y,S,ae,oe,D))?(he||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(d.flags|=4194308)):(typeof _.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=S,d.memoizedState=oe),_.props=S,_.state=oe,_.context=D,S=Y):(typeof _.componentDidMount=="function"&&(d.flags|=4194308),S=!1)}else{_=d.stateNode,Lw(c,d),D=d.memoizedProps,he=ed(p,D),_.props=he,Se=d.pendingProps,ae=_.context,oe=p.contextType,Y=hh,typeof oe=="object"&&oe!==null&&(Y=Xr(oe)),L=p.getDerivedStateFromProps,(oe=typeof L=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(D!==Se||ae!==Y)&&SO(d,_,S,Y),Sc=!1,ae=d.memoizedState,_.state=ae,kp(d,S,_,T),Ip();var ue=d.memoizedState;D!==Se||ae!==ue||Sc||c!==null&&c.dependencies!==null&&Ny(c.dependencies)?(typeof L=="function"&&(s1(d,p,L,S),ue=d.memoizedState),(he=Sc||yO(d,p,he,S,ae,ue,Y)||c!==null&&c.dependencies!==null&&Ny(c.dependencies))?(oe||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(S,ue,Y),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(S,ue,Y)),typeof _.componentDidUpdate=="function"&&(d.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof _.componentDidUpdate!="function"||D===c.memoizedProps&&ae===c.memoizedState||(d.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===c.memoizedProps&&ae===c.memoizedState||(d.flags|=1024),d.memoizedProps=S,d.memoizedState=ue),_.props=S,_.state=ue,_.context=Y,S=he):(typeof _.componentDidUpdate!="function"||D===c.memoizedProps&&ae===c.memoizedState||(d.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===c.memoizedProps&&ae===c.memoizedState||(d.flags|=1024),S=!1)}return _=S,nS(c,d),S=(d.flags&128)!==0,_||S?(_=d.stateNode,p=S&&typeof p.getDerivedStateFromError!="function"?null:_.render(),d.flags|=1,c!==null&&S?(d.child=Ju(d,c.child,null,T),d.child=Ju(d,null,p,T)):Zr(c,d,p,T),d.memoizedState=_.state,c=d.child):c=wl(c,d,T),c}function DO(c,d,p,S){return qu(),d.flags|=256,Zr(c,d,p,S),d.child}var u1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function d1(c){return{baseLanes:c,cachePool:wA()}}function h1(c,d,p){return c=c!==null?c.childLanes&~p:0,d&&(c|=Ys),c}function RO(c,d,p){var S=d.pendingProps,T=!1,_=(d.flags&128)!==0,D;if((D=_)||(D=c!==null&&c.memoizedState===null?!1:(er.current&2)!==0),D&&(T=!0,d.flags&=-129),D=(d.flags&32)!==0,d.flags&=-33,c===null){if(Ot){if(T?xc(d):wc(),(c=gn)?(c=HD(c,Po),c=c!==null&&c.data!=="&"?c:null,c!==null&&(d.memoizedState={dehydrated:c,treeContext:pc!==null?{id:_a,overflow:Pa}:null,retryLane:536870912,hydrationErrors:null},p=fA(c),p.return=d,d.child=p,Wr=d,gn=null)):c=null,c===null)throw mc(d);return Y1(c)?d.lanes=32:d.lanes=536870912,null}var L=S.children;return S=S.fallback,T?(wc(),T=d.mode,L=rS({mode:"hidden",children:L},T),S=Vu(S,T,p,null),L.return=d,S.return=d,L.sibling=S,d.child=L,S=d.child,S.memoizedState=d1(p),S.childLanes=h1(c,D,p),d.memoizedState=u1,Rp(null,S)):(xc(d),f1(d,L))}var Y=c.memoizedState;if(Y!==null&&(L=Y.dehydrated,L!==null)){if(_)d.flags&256?(xc(d),d.flags&=-257,d=p1(c,d,p)):d.memoizedState!==null?(wc(),d.child=c.child,d.flags|=128,d=null):(wc(),L=S.fallback,T=d.mode,S=rS({mode:"visible",children:S.children},T),L=Vu(L,T,p,null),L.flags|=2,S.return=d,L.return=d,S.sibling=L,d.child=S,Ju(d,c.child,null,p),S=d.child,S.memoizedState=d1(p),S.childLanes=h1(c,D,p),d.memoizedState=u1,d=Rp(null,S));else if(xc(d),Y1(L)){if(D=L.nextSibling&&L.nextSibling.dataset,D)var oe=D.dgst;D=oe,S=Error(r(419)),S.stack="",S.digest=D,wp({value:S,source:null,stack:null}),d=p1(c,d,p)}else if(gr||mh(c,d,p,!1),D=(p&c.childLanes)!==0,gr||D){if(D=cn,D!==null&&(S=Jd(D,p),S!==0&&S!==Y.retryLane))throw Y.retryLane=S,Ku(c,S),ws(D,c,S),l1;G1(L)||hS(),d=p1(c,d,p)}else G1(L)?(d.flags|=192,d.child=c.child,d=null):(c=Y.treeContext,gn=ko(L.nextSibling),Wr=d,Ot=!0,gc=null,Po=!1,c!==null&&mA(d,c),d=f1(d,S.children),d.flags|=4096);return d}return T?(wc(),L=S.fallback,T=d.mode,Y=c.child,oe=Y.sibling,S=ml(Y,{mode:"hidden",children:S.children}),S.subtreeFlags=Y.subtreeFlags&65011712,oe!==null?L=ml(oe,L):(L=Vu(L,T,p,null),L.flags|=2),L.return=d,S.return=d,S.sibling=L,d.child=S,Rp(null,S),S=d.child,L=c.child.memoizedState,L===null?L=d1(p):(T=L.cachePool,T!==null?(Y=fr._currentValue,T=T.parent!==Y?{parent:Y,pool:Y}:T):T=wA(),L={baseLanes:L.baseLanes|p,cachePool:T}),S.memoizedState=L,S.childLanes=h1(c,D,p),d.memoizedState=u1,Rp(c.child,S)):(xc(d),p=c.child,c=p.sibling,p=ml(p,{mode:"visible",children:S.children}),p.return=d,p.sibling=null,c!==null&&(D=d.deletions,D===null?(d.deletions=[c],d.flags|=16):D.push(c)),d.child=p,d.memoizedState=null,p)}function f1(c,d){return d=rS({mode:"visible",children:d},c.mode),d.return=c,c.child=d}function rS(c,d){return c=Ks(22,c,null,d),c.lanes=0,c}function p1(c,d,p){return Ju(d,c.child,null,p),c=f1(d,d.pendingProps.children),c.flags|=2,d.memoizedState=null,c}function jO(c,d,p){c.lanes|=d;var S=c.alternate;S!==null&&(S.lanes|=d),kw(c.return,d,p)}function g1(c,d,p,S,T,_){var D=c.memoizedState;D===null?c.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:S,tail:p,tailMode:T,treeForkCount:_}:(D.isBackwards=d,D.rendering=null,D.renderingStartTime=0,D.last=S,D.tail=p,D.tailMode=T,D.treeForkCount=_)}function LO(c,d,p){var S=d.pendingProps,T=S.revealOrder,_=S.tail;S=S.children;var D=er.current,L=(D&2)!==0;if(L?(D=D&1|2,d.flags|=128):D&=1,le(er,D),Zr(c,d,S,p),S=Ot?xp:0,!L&&c!==null&&(c.flags&128)!==0)e:for(c=d.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&jO(c,p,d);else if(c.tag===19)jO(c,p,d);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===d)break e;for(;c.sibling===null;){if(c.return===null||c.return===d)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}switch(T){case"forwards":for(p=d.child,T=null;p!==null;)c=p.alternate,c!==null&&Vy(c)===null&&(T=p),p=p.sibling;p=T,p===null?(T=d.child,d.child=null):(T=p.sibling,p.sibling=null),g1(d,!1,T,p,_,S);break;case"backwards":case"unstable_legacy-backwards":for(p=null,T=d.child,d.child=null;T!==null;){if(c=T.alternate,c!==null&&Vy(c)===null){d.child=T;break}c=T.sibling,T.sibling=p,p=T,T=c}g1(d,!0,p,null,_,S);break;case"together":g1(d,!1,null,null,void 0,S);break;default:d.memoizedState=null}return d.child}function wl(c,d,p){if(c!==null&&(d.dependencies=c.dependencies),Ec|=d.lanes,(p&d.childLanes)===0)if(c!==null){if(mh(c,d,p,!1),(p&d.childLanes)===0)return null}else return null;if(c!==null&&d.child!==c.child)throw Error(r(153));if(d.child!==null){for(c=d.child,p=ml(c,c.pendingProps),d.child=p,p.return=d;c.sibling!==null;)c=c.sibling,p=p.sibling=ml(c,c.pendingProps),p.return=d;p.sibling=null}return d.child}function m1(c,d){return(c.lanes&d)!==0?!0:(c=c.dependencies,!!(c!==null&&Ny(c)))}function SX(c,d,p){switch(d.tag){case 3:Pe(d,d.stateNode.containerInfo),yc(d,fr,c.memoizedState.cache),qu();break;case 27:case 5:He(d);break;case 4:Pe(d,d.stateNode.containerInfo);break;case 10:yc(d,d.type,d.memoizedProps.value);break;case 31:if(d.memoizedState!==null)return d.flags|=128,Uw(d),null;break;case 13:var S=d.memoizedState;if(S!==null)return S.dehydrated!==null?(xc(d),d.flags|=128,null):(p&d.child.childLanes)!==0?RO(c,d,p):(xc(d),c=wl(c,d,p),c!==null?c.sibling:null);xc(d);break;case 19:var T=(c.flags&128)!==0;if(S=(p&d.childLanes)!==0,S||(mh(c,d,p,!1),S=(p&d.childLanes)!==0),T){if(S)return LO(c,d,p);d.flags|=128}if(T=d.memoizedState,T!==null&&(T.rendering=null,T.tail=null,T.lastEffect=null),le(er,er.current),S)break;return null;case 22:return d.lanes=0,IO(c,d,p,d.pendingProps);case 24:yc(d,fr,c.memoizedState.cache)}return wl(c,d,p)}function NO(c,d,p){if(c!==null)if(c.memoizedProps!==d.pendingProps)gr=!0;else{if(!m1(c,p)&&(d.flags&128)===0)return gr=!1,SX(c,d,p);gr=(c.flags&131072)!==0}else gr=!1,Ot&&(d.flags&1048576)!==0&&gA(d,xp,d.index);switch(d.lanes=0,d.tag){case 16:e:{var S=d.pendingProps;if(c=Xu(d.elementType),d.type=c,typeof c=="function")xw(c)?(S=ed(c,S),d.tag=1,d=OO(null,d,c,S,p)):(d.tag=0,d=c1(null,d,c,S,p));else{if(c!=null){var T=c.$$typeof;if(T===k){d.tag=11,d=EO(null,d,c,S,p);break e}else if(T===O){d.tag=14,d=_O(null,d,c,S,p);break e}}throw d=z(c)||c,Error(r(306,d,""))}}return d;case 0:return c1(c,d,d.type,d.pendingProps,p);case 1:return S=d.type,T=ed(S,d.pendingProps),OO(c,d,S,T,p);case 3:e:{if(Pe(d,d.stateNode.containerInfo),c===null)throw Error(r(387));S=d.pendingProps;var _=d.memoizedState;T=_.element,Lw(c,d),kp(d,S,null,p);var D=d.memoizedState;if(S=D.cache,yc(d,fr,S),S!==_.cache&&Mw(d,[fr],p,!0),Ip(),S=D.element,_.isDehydrated)if(_={element:S,isDehydrated:!1,cache:D.cache},d.updateQueue.baseState=_,d.memoizedState=_,d.flags&256){d=DO(c,d,S,p);break e}else if(S!==T){T=To(Error(r(424)),d),wp(T),d=DO(c,d,S,p);break e}else{switch(c=d.stateNode.containerInfo,c.nodeType){case 9:c=c.body;break;default:c=c.nodeName==="HTML"?c.ownerDocument.body:c}for(gn=ko(c.firstChild),Wr=d,Ot=!0,gc=null,Po=!0,p=IA(d,null,S,p),d.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling}else{if(qu(),S===T){d=wl(c,d,p);break e}Zr(c,d,S,p)}d=d.child}return d;case 26:return nS(c,d),c===null?(p=YD(d.type,null,d.pendingProps,null))?d.memoizedState=p:Ot||(p=d.type,c=d.pendingProps,S=bS(_e.current).createElement(p),S[Zn]=d,S[Ar]=c,Jr(S,p,c),Ln(S),d.stateNode=S):d.memoizedState=YD(d.type,c.memoizedProps,d.pendingProps,c.memoizedState),null;case 27:return He(d),c===null&&Ot&&(S=d.stateNode=VD(d.type,d.pendingProps,_e.current),Wr=d,Po=!0,T=gn,Mc(d.type)?(W1=T,gn=ko(S.firstChild)):gn=T),Zr(c,d,d.pendingProps.children,p),nS(c,d),c===null&&(d.flags|=4194304),d.child;case 5:return c===null&&Ot&&((T=S=gn)&&(S=YX(S,d.type,d.pendingProps,Po),S!==null?(d.stateNode=S,Wr=d,gn=ko(S.firstChild),Po=!1,T=!0):T=!1),T||mc(d)),He(d),T=d.type,_=d.pendingProps,D=c!==null?c.memoizedProps:null,S=_.children,K1(T,_)?S=null:D!==null&&K1(T,D)&&(d.flags|=32),d.memoizedState!==null&&(T=$w(c,d,cX,null,null,p),Wp._currentValue=T),nS(c,d),Zr(c,d,S,p),d.child;case 6:return c===null&&Ot&&((c=p=gn)&&(p=WX(p,d.pendingProps,Po),p!==null?(d.stateNode=p,Wr=d,gn=null,c=!0):c=!1),c||mc(d)),null;case 13:return RO(c,d,p);case 4:return Pe(d,d.stateNode.containerInfo),S=d.pendingProps,c===null?d.child=Ju(d,null,S,p):Zr(c,d,S,p),d.child;case 11:return EO(c,d,d.type,d.pendingProps,p);case 7:return Zr(c,d,d.pendingProps,p),d.child;case 8:return Zr(c,d,d.pendingProps.children,p),d.child;case 12:return Zr(c,d,d.pendingProps.children,p),d.child;case 10:return S=d.pendingProps,yc(d,d.type,S.value),Zr(c,d,S.children,p),d.child;case 9:return T=d.type._context,S=d.pendingProps.children,Yu(d),T=Xr(T),S=S(T),d.flags|=1,Zr(c,d,S,p),d.child;case 14:return _O(c,d,d.type,d.pendingProps,p);case 15:return PO(c,d,d.type,d.pendingProps,p);case 19:return LO(c,d,p);case 31:return yX(c,d,p);case 22:return IO(c,d,p,d.pendingProps);case 24:return Yu(d),S=Xr(fr),c===null?(T=Dw(),T===null&&(T=cn,_=Aw(),T.pooledCache=_,_.refCount++,_!==null&&(T.pooledCacheLanes|=p),T=_),d.memoizedState={parent:S,cache:T},jw(d),yc(d,fr,T)):((c.lanes&p)!==0&&(Lw(c,d),kp(d,null,null,p),Ip()),T=c.memoizedState,_=d.memoizedState,T.parent!==S?(T={parent:S,cache:S},d.memoizedState=T,d.lanes===0&&(d.memoizedState=d.updateQueue.baseState=T),yc(d,fr,S)):(S=_.cache,yc(d,fr,S),S!==T.cache&&Mw(d,[fr],p,!0))),Zr(c,d,d.pendingProps.children,p),d.child;case 29:throw d.pendingProps}throw Error(r(156,d.tag))}function Cl(c){c.flags|=4}function y1(c,d,p,S,T){if((d=(c.mode&32)!==0)&&(d=!1),d){if(c.flags|=16777216,(T&335544128)===T)if(c.stateNode.complete)c.flags|=8192;else if(uD())c.flags|=8192;else throw Zu=Uy,Rw}else c.flags&=-16777217}function zO(c,d){if(d.type!=="stylesheet"||(d.state.loading&4)!==0)c.flags&=-16777217;else if(c.flags|=16777216,!QD(d))if(uD())c.flags|=8192;else throw Zu=Uy,Rw}function iS(c,d){d!==null&&(c.flags|=4),c.flags&16384&&(d=c.tag!==22?oc():536870912,c.lanes|=d,Ih|=d)}function jp(c,d){if(!Ot)switch(c.tailMode){case"hidden":d=c.tail;for(var p=null;d!==null;)d.alternate!==null&&(p=d),d=d.sibling;p===null?c.tail=null:p.sibling=null;break;case"collapsed":p=c.tail;for(var S=null;p!==null;)p.alternate!==null&&(S=p),p=p.sibling;S===null?d||c.tail===null?c.tail=null:c.tail.sibling=null:S.sibling=null}}function mn(c){var d=c.alternate!==null&&c.alternate.child===c.child,p=0,S=0;if(d)for(var T=c.child;T!==null;)p|=T.lanes|T.childLanes,S|=T.subtreeFlags&65011712,S|=T.flags&65011712,T.return=c,T=T.sibling;else for(T=c.child;T!==null;)p|=T.lanes|T.childLanes,S|=T.subtreeFlags,S|=T.flags,T.return=c,T=T.sibling;return c.subtreeFlags|=S,c.childLanes=p,d}function bX(c,d,p){var S=d.pendingProps;switch(Ew(d),d.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mn(d),null;case 1:return mn(d),null;case 3:return p=d.stateNode,S=null,c!==null&&(S=c.memoizedState.cache),d.memoizedState.cache!==S&&(d.flags|=2048),bl(fr),Oe(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(c===null||c.child===null)&&(gh(d)?Cl(d):c===null||c.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,Pw())),mn(d),null;case 26:var T=d.type,_=d.memoizedState;return c===null?(Cl(d),_!==null?(mn(d),zO(d,_)):(mn(d),y1(d,T,null,S,p))):_?_!==c.memoizedState?(Cl(d),mn(d),zO(d,_)):(mn(d),d.flags&=-16777217):(c=c.memoizedProps,c!==S&&Cl(d),mn(d),y1(d,T,c,S,p)),null;case 27:if(zt(d),p=_e.current,T=d.type,c!==null&&d.stateNode!=null)c.memoizedProps!==S&&Cl(d);else{if(!S){if(d.stateNode===null)throw Error(r(166));return mn(d),null}c=fe.current,gh(d)?yA(d):(c=VD(T,S,p),d.stateNode=c,Cl(d))}return mn(d),null;case 5:if(zt(d),T=d.type,c!==null&&d.stateNode!=null)c.memoizedProps!==S&&Cl(d);else{if(!S){if(d.stateNode===null)throw Error(r(166));return mn(d),null}if(_=fe.current,gh(d))yA(d);else{var D=bS(_e.current);switch(_){case 1:_=D.createElementNS("http://www.w3.org/2000/svg",T);break;case 2:_=D.createElementNS("http://www.w3.org/1998/Math/MathML",T);break;default:switch(T){case"svg":_=D.createElementNS("http://www.w3.org/2000/svg",T);break;case"math":_=D.createElementNS("http://www.w3.org/1998/Math/MathML",T);break;case"script":_=D.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof S.is=="string"?D.createElement("select",{is:S.is}):D.createElement("select"),S.multiple?_.multiple=!0:S.size&&(_.size=S.size);break;default:_=typeof S.is=="string"?D.createElement(T,{is:S.is}):D.createElement(T)}}_[Zn]=d,_[Ar]=S;e:for(D=d.child;D!==null;){if(D.tag===5||D.tag===6)_.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===d)break e;for(;D.sibling===null;){if(D.return===null||D.return===d)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}d.stateNode=_;e:switch(Jr(_,T,S),T){case"button":case"input":case"select":case"textarea":S=!!S.autoFocus;break e;case"img":S=!0;break e;default:S=!1}S&&Cl(d)}}return mn(d),y1(d,d.type,c===null?null:c.memoizedProps,d.pendingProps,p),null;case 6:if(c&&d.stateNode!=null)c.memoizedProps!==S&&Cl(d);else{if(typeof S!="string"&&d.stateNode===null)throw Error(r(166));if(c=_e.current,gh(d)){if(c=d.stateNode,p=d.memoizedProps,S=null,T=Wr,T!==null)switch(T.tag){case 27:case 5:S=T.memoizedProps}c[Zn]=d,c=!!(c.nodeValue===p||S!==null&&S.suppressHydrationWarning===!0||RD(c.nodeValue,p)),c||mc(d,!0)}else c=bS(c).createTextNode(S),c[Zn]=d,d.stateNode=c}return mn(d),null;case 31:if(p=d.memoizedState,c===null||c.memoizedState!==null){if(S=gh(d),p!==null){if(c===null){if(!S)throw Error(r(318));if(c=d.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[Zn]=d}else qu(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;mn(d),c=!1}else p=Pw(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=p),c=!0;if(!c)return d.flags&256?(qs(d),d):(qs(d),null);if((d.flags&128)!==0)throw Error(r(558))}return mn(d),null;case 13:if(S=d.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(T=gh(d),S!==null&&S.dehydrated!==null){if(c===null){if(!T)throw Error(r(318));if(T=d.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(r(317));T[Zn]=d}else qu(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;mn(d),T=!1}else T=Pw(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=T),T=!0;if(!T)return d.flags&256?(qs(d),d):(qs(d),null)}return qs(d),(d.flags&128)!==0?(d.lanes=p,d):(p=S!==null,c=c!==null&&c.memoizedState!==null,p&&(S=d.child,T=null,S.alternate!==null&&S.alternate.memoizedState!==null&&S.alternate.memoizedState.cachePool!==null&&(T=S.alternate.memoizedState.cachePool.pool),_=null,S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(_=S.memoizedState.cachePool.pool),_!==T&&(S.flags|=2048)),p!==c&&p&&(d.child.flags|=8192),iS(d,d.updateQueue),mn(d),null);case 4:return Oe(),c===null&&B1(d.stateNode.containerInfo),mn(d),null;case 10:return bl(d.type),mn(d),null;case 19:if(ne(er),S=d.memoizedState,S===null)return mn(d),null;if(T=(d.flags&128)!==0,_=S.rendering,_===null)if(T)jp(S,!1);else{if(Un!==0||c!==null&&(c.flags&128)!==0)for(c=d.child;c!==null;){if(_=Vy(c),_!==null){for(d.flags|=128,jp(S,!1),c=_.updateQueue,d.updateQueue=c,iS(d,c),d.subtreeFlags=0,c=p,p=d.child;p!==null;)hA(p,c),p=p.sibling;return le(er,er.current&1|2),Ot&&yl(d,S.treeForkCount),d.child}c=c.sibling}S.tail!==null&&dr()>cS&&(d.flags|=128,T=!0,jp(S,!1),d.lanes=4194304)}else{if(!T)if(c=Vy(_),c!==null){if(d.flags|=128,T=!0,c=c.updateQueue,d.updateQueue=c,iS(d,c),jp(S,!0),S.tail===null&&S.tailMode==="hidden"&&!_.alternate&&!Ot)return mn(d),null}else 2*dr()-S.renderingStartTime>cS&&p!==536870912&&(d.flags|=128,T=!0,jp(S,!1),d.lanes=4194304);S.isBackwards?(_.sibling=d.child,d.child=_):(c=S.last,c!==null?c.sibling=_:d.child=_,S.last=_)}return S.tail!==null?(c=S.tail,S.rendering=c,S.tail=c.sibling,S.renderingStartTime=dr(),c.sibling=null,p=er.current,le(er,T?p&1|2:p&1),Ot&&yl(d,S.treeForkCount),c):(mn(d),null);case 22:case 23:return qs(d),Fw(),S=d.memoizedState!==null,c!==null?c.memoizedState!==null!==S&&(d.flags|=8192):S&&(d.flags|=8192),S?(p&536870912)!==0&&(d.flags&128)===0&&(mn(d),d.subtreeFlags&6&&(d.flags|=8192)):mn(d),p=d.updateQueue,p!==null&&iS(d,p.retryQueue),p=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(p=c.memoizedState.cachePool.pool),S=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(S=d.memoizedState.cachePool.pool),S!==p&&(d.flags|=2048),c!==null&&ne(Wu),null;case 24:return p=null,c!==null&&(p=c.memoizedState.cache),d.memoizedState.cache!==p&&(d.flags|=2048),bl(fr),mn(d),null;case 25:return null;case 30:return null}throw Error(r(156,d.tag))}function vX(c,d){switch(Ew(d),d.tag){case 1:return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 3:return bl(fr),Oe(),c=d.flags,(c&65536)!==0&&(c&128)===0?(d.flags=c&-65537|128,d):null;case 26:case 27:case 5:return zt(d),null;case 31:if(d.memoizedState!==null){if(qs(d),d.alternate===null)throw Error(r(340));qu()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 13:if(qs(d),c=d.memoizedState,c!==null&&c.dehydrated!==null){if(d.alternate===null)throw Error(r(340));qu()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 19:return ne(er),null;case 4:return Oe(),null;case 10:return bl(d.type),null;case 22:case 23:return qs(d),Fw(),c!==null&&ne(Wu),c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 24:return bl(fr),null;case 25:return null;default:return null}}function BO(c,d){switch(Ew(d),d.tag){case 3:bl(fr),Oe();break;case 26:case 27:case 5:zt(d);break;case 4:Oe();break;case 31:d.memoizedState!==null&&qs(d);break;case 13:qs(d);break;case 19:ne(er);break;case 10:bl(d.type);break;case 22:case 23:qs(d),Fw(),c!==null&&ne(Wu);break;case 24:bl(fr)}}function Lp(c,d){try{var p=d.updateQueue,S=p!==null?p.lastEffect:null;if(S!==null){var T=S.next;p=T;do{if((p.tag&c)===c){S=void 0;var _=p.create,D=p.inst;S=_(),D.destroy=S}p=p.next}while(p!==T)}}catch(L){Yt(d,d.return,L)}}function Cc(c,d,p){try{var S=d.updateQueue,T=S!==null?S.lastEffect:null;if(T!==null){var _=T.next;S=_;do{if((S.tag&c)===c){var D=S.inst,L=D.destroy;if(L!==void 0){D.destroy=void 0,T=d;var Y=p,oe=L;try{oe()}catch(he){Yt(T,Y,he)}}}S=S.next}while(S!==_)}}catch(he){Yt(d,d.return,he)}}function FO(c){var d=c.updateQueue;if(d!==null){var p=c.stateNode;try{MA(d,p)}catch(S){Yt(c,c.return,S)}}}function UO(c,d,p){p.props=ed(c.type,c.memoizedProps),p.state=c.memoizedState;try{p.componentWillUnmount()}catch(S){Yt(c,d,S)}}function Np(c,d){try{var p=c.ref;if(p!==null){switch(c.tag){case 26:case 27:case 5:var S=c.stateNode;break;case 30:S=c.stateNode;break;default:S=c.stateNode}typeof p=="function"?c.refCleanup=p(S):p.current=S}}catch(T){Yt(c,d,T)}}function Ia(c,d){var p=c.ref,S=c.refCleanup;if(p!==null)if(typeof S=="function")try{S()}catch(T){Yt(c,d,T)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(T){Yt(c,d,T)}else p.current=null}function HO(c){var d=c.type,p=c.memoizedProps,S=c.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":p.autoFocus&&S.focus();break e;case"img":p.src?S.src=p.src:p.srcSet&&(S.srcset=p.srcSet)}}catch(T){Yt(c,c.return,T)}}function S1(c,d,p){try{var S=c.stateNode;HX(S,c.type,p,d),S[Ar]=d}catch(T){Yt(c,c.return,T)}}function $O(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&Mc(c.type)||c.tag===4}function b1(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||$O(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&Mc(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function v1(c,d,p){var S=c.tag;if(S===5||S===6)c=c.stateNode,d?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(c,d):(d=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,d.appendChild(c),p=p._reactRootContainer,p!=null||d.onclick!==null||(d.onclick=Ce));else if(S!==4&&(S===27&&Mc(c.type)&&(p=c.stateNode,d=null),c=c.child,c!==null))for(v1(c,d,p),c=c.sibling;c!==null;)v1(c,d,p),c=c.sibling}function sS(c,d,p){var S=c.tag;if(S===5||S===6)c=c.stateNode,d?p.insertBefore(c,d):p.appendChild(c);else if(S!==4&&(S===27&&Mc(c.type)&&(p=c.stateNode),c=c.child,c!==null))for(sS(c,d,p),c=c.sibling;c!==null;)sS(c,d,p),c=c.sibling}function KO(c){var d=c.stateNode,p=c.memoizedProps;try{for(var S=c.type,T=d.attributes;T.length;)d.removeAttributeNode(T[0]);Jr(d,S,p),d[Zn]=c,d[Ar]=p}catch(_){Yt(c,c.return,_)}}var Tl=!1,mr=!1,x1=!1,VO=typeof WeakSet=="function"?WeakSet:Set,Or=null;function xX(c,d){if(c=c.containerInfo,H1=_S,c=rA(c),pw(c)){if("selectionStart"in c)var p={start:c.selectionStart,end:c.selectionEnd};else e:{p=(p=c.ownerDocument)&&p.defaultView||window;var S=p.getSelection&&p.getSelection();if(S&&S.rangeCount!==0){p=S.anchorNode;var T=S.anchorOffset,_=S.focusNode;S=S.focusOffset;try{p.nodeType,_.nodeType}catch{p=null;break e}var D=0,L=-1,Y=-1,oe=0,he=0,Se=c,ae=null;t:for(;;){for(var ue;Se!==p||T!==0&&Se.nodeType!==3||(L=D+T),Se!==_||S!==0&&Se.nodeType!==3||(Y=D+S),Se.nodeType===3&&(D+=Se.nodeValue.length),(ue=Se.firstChild)!==null;)ae=Se,Se=ue;for(;;){if(Se===c)break t;if(ae===p&&++oe===T&&(L=D),ae===_&&++he===S&&(Y=D),(ue=Se.nextSibling)!==null)break;Se=ae,ae=Se.parentNode}Se=ue}p=L===-1||Y===-1?null:{start:L,end:Y}}else p=null}p=p||{start:0,end:0}}else p=null;for($1={focusedElem:c,selectionRange:p},_S=!1,Or=d;Or!==null;)if(d=Or,c=d.child,(d.subtreeFlags&1028)!==0&&c!==null)c.return=d,Or=c;else for(;Or!==null;){switch(d=Or,_=d.alternate,c=d.flags,d.tag){case 0:if((c&4)!==0&&(c=d.updateQueue,c=c!==null?c.events:null,c!==null))for(p=0;p<c.length;p++)T=c[p],T.ref.impl=T.nextImpl;break;case 11:case 15:break;case 1:if((c&1024)!==0&&_!==null){c=void 0,p=d,T=_.memoizedProps,_=_.memoizedState,S=p.stateNode;try{var Ue=ed(p.type,T);c=S.getSnapshotBeforeUpdate(Ue,_),S.__reactInternalSnapshotBeforeUpdate=c}catch(et){Yt(p,p.return,et)}}break;case 3:if((c&1024)!==0){if(c=d.stateNode.containerInfo,p=c.nodeType,p===9)q1(c);else if(p===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":q1(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((c&1024)!==0)throw Error(r(163))}if(c=d.sibling,c!==null){c.return=d.return,Or=c;break}Or=d.return}}function qO(c,d,p){var S=p.flags;switch(p.tag){case 0:case 11:case 15:_l(c,p),S&4&&Lp(5,p);break;case 1:if(_l(c,p),S&4)if(c=p.stateNode,d===null)try{c.componentDidMount()}catch(D){Yt(p,p.return,D)}else{var T=ed(p.type,d.memoizedProps);d=d.memoizedState;try{c.componentDidUpdate(T,d,c.__reactInternalSnapshotBeforeUpdate)}catch(D){Yt(p,p.return,D)}}S&64&&FO(p),S&512&&Np(p,p.return);break;case 3:if(_l(c,p),S&64&&(c=p.updateQueue,c!==null)){if(d=null,p.child!==null)switch(p.child.tag){case 27:case 5:d=p.child.stateNode;break;case 1:d=p.child.stateNode}try{MA(c,d)}catch(D){Yt(p,p.return,D)}}break;case 27:d===null&&S&4&&KO(p);case 26:case 5:_l(c,p),d===null&&S&4&&HO(p),S&512&&Np(p,p.return);break;case 12:_l(c,p);break;case 31:_l(c,p),S&4&&WO(c,p);break;case 13:_l(c,p),S&4&&XO(c,p),S&64&&(c=p.memoizedState,c!==null&&(c=c.dehydrated,c!==null&&(p=MX.bind(null,p),XX(c,p))));break;case 22:if(S=p.memoizedState!==null||Tl,!S){d=d!==null&&d.memoizedState!==null||mr,T=Tl;var _=mr;Tl=S,(mr=d)&&!_?Pl(c,p,(p.subtreeFlags&8772)!==0):_l(c,p),Tl=T,mr=_}break;case 30:break;default:_l(c,p)}}function GO(c){var d=c.alternate;d!==null&&(c.alternate=null,GO(d)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(d=c.stateNode,d!==null&&ps(d)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}var En=null,Ss=!1;function El(c,d,p){for(p=p.child;p!==null;)YO(c,d,p),p=p.sibling}function YO(c,d,p){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(At,p)}catch{}switch(p.tag){case 26:mr||Ia(p,d),El(c,d,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:mr||Ia(p,d);var S=En,T=Ss;Mc(p.type)&&(En=p.stateNode,Ss=!1),El(c,d,p),qp(p.stateNode),En=S,Ss=T;break;case 5:mr||Ia(p,d);case 6:if(S=En,T=Ss,En=null,El(c,d,p),En=S,Ss=T,En!==null)if(Ss)try{(En.nodeType===9?En.body:En.nodeName==="HTML"?En.ownerDocument.body:En).removeChild(p.stateNode)}catch(_){Yt(p,d,_)}else try{En.removeChild(p.stateNode)}catch(_){Yt(p,d,_)}break;case 18:En!==null&&(Ss?(c=En,FD(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,p.stateNode),Lh(c)):FD(En,p.stateNode));break;case 4:S=En,T=Ss,En=p.stateNode.containerInfo,Ss=!0,El(c,d,p),En=S,Ss=T;break;case 0:case 11:case 14:case 15:Cc(2,p,d),mr||Cc(4,p,d),El(c,d,p);break;case 1:mr||(Ia(p,d),S=p.stateNode,typeof S.componentWillUnmount=="function"&&UO(p,d,S)),El(c,d,p);break;case 21:El(c,d,p);break;case 22:mr=(S=mr)||p.memoizedState!==null,El(c,d,p),mr=S;break;default:El(c,d,p)}}function WO(c,d){if(d.memoizedState===null&&(c=d.alternate,c!==null&&(c=c.memoizedState,c!==null))){c=c.dehydrated;try{Lh(c)}catch(p){Yt(d,d.return,p)}}}function XO(c,d){if(d.memoizedState===null&&(c=d.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{Lh(c)}catch(p){Yt(d,d.return,p)}}function wX(c){switch(c.tag){case 31:case 13:case 19:var d=c.stateNode;return d===null&&(d=c.stateNode=new VO),d;case 22:return c=c.stateNode,d=c._retryCache,d===null&&(d=c._retryCache=new VO),d;default:throw Error(r(435,c.tag))}}function oS(c,d){var p=wX(c);d.forEach(function(S){if(!p.has(S)){p.add(S);var T=AX.bind(null,c,S);S.then(T,T)}})}function bs(c,d){var p=d.deletions;if(p!==null)for(var S=0;S<p.length;S++){var T=p[S],_=c,D=d,L=D;e:for(;L!==null;){switch(L.tag){case 27:if(Mc(L.type)){En=L.stateNode,Ss=!1;break e}break;case 5:En=L.stateNode,Ss=!1;break e;case 3:case 4:En=L.stateNode.containerInfo,Ss=!0;break e}L=L.return}if(En===null)throw Error(r(160));YO(_,D,T),En=null,Ss=!1,_=T.alternate,_!==null&&(_.return=null),T.return=null}if(d.subtreeFlags&13886)for(d=d.child;d!==null;)ZO(d,c),d=d.sibling}var ia=null;function ZO(c,d){var p=c.alternate,S=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:bs(d,c),vs(c),S&4&&(Cc(3,c,c.return),Lp(3,c),Cc(5,c,c.return));break;case 1:bs(d,c),vs(c),S&512&&(mr||p===null||Ia(p,p.return)),S&64&&Tl&&(c=c.updateQueue,c!==null&&(S=c.callbacks,S!==null&&(p=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=p===null?S:p.concat(S))));break;case 26:var T=ia;if(bs(d,c),vs(c),S&512&&(mr||p===null||Ia(p,p.return)),S&4){var _=p!==null?p.memoizedState:null;if(S=c.memoizedState,p===null)if(S===null)if(c.stateNode===null){e:{S=c.type,p=c.memoizedProps,T=T.ownerDocument||T;t:switch(S){case"title":_=T.getElementsByTagName("title")[0],(!_||_[ul]||_[Zn]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=T.createElement(S),T.head.insertBefore(_,T.querySelector("head > title"))),Jr(_,S,p),_[Zn]=c,Ln(_),S=_;break e;case"link":var D=ZD("link","href",T).get(S+(p.href||""));if(D){for(var L=0;L<D.length;L++)if(_=D[L],_.getAttribute("href")===(p.href==null||p.href===""?null:p.href)&&_.getAttribute("rel")===(p.rel==null?null:p.rel)&&_.getAttribute("title")===(p.title==null?null:p.title)&&_.getAttribute("crossorigin")===(p.crossOrigin==null?null:p.crossOrigin)){D.splice(L,1);break t}}_=T.createElement(S),Jr(_,S,p),T.head.appendChild(_);break;case"meta":if(D=ZD("meta","content",T).get(S+(p.content||""))){for(L=0;L<D.length;L++)if(_=D[L],_.getAttribute("content")===(p.content==null?null:""+p.content)&&_.getAttribute("name")===(p.name==null?null:p.name)&&_.getAttribute("property")===(p.property==null?null:p.property)&&_.getAttribute("http-equiv")===(p.httpEquiv==null?null:p.httpEquiv)&&_.getAttribute("charset")===(p.charSet==null?null:p.charSet)){D.splice(L,1);break t}}_=T.createElement(S),Jr(_,S,p),T.head.appendChild(_);break;default:throw Error(r(468,S))}_[Zn]=c,Ln(_),S=_}c.stateNode=S}else JD(T,c.type,c.stateNode);else c.stateNode=XD(T,S,c.memoizedProps);else _!==S?(_===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):_.count--,S===null?JD(T,c.type,c.stateNode):XD(T,S,c.memoizedProps)):S===null&&c.stateNode!==null&&S1(c,c.memoizedProps,p.memoizedProps)}break;case 27:bs(d,c),vs(c),S&512&&(mr||p===null||Ia(p,p.return)),p!==null&&S&4&&S1(c,c.memoizedProps,p.memoizedProps);break;case 5:if(bs(d,c),vs(c),S&512&&(mr||p===null||Ia(p,p.return)),c.flags&32){T=c.stateNode;try{yi(T,"")}catch(Ue){Yt(c,c.return,Ue)}}S&4&&c.stateNode!=null&&(T=c.memoizedProps,S1(c,T,p!==null?p.memoizedProps:T)),S&1024&&(x1=!0);break;case 6:if(bs(d,c),vs(c),S&4){if(c.stateNode===null)throw Error(r(162));S=c.memoizedProps,p=c.stateNode;try{p.nodeValue=S}catch(Ue){Yt(c,c.return,Ue)}}break;case 3:if(wS=null,T=ia,ia=vS(d.containerInfo),bs(d,c),ia=T,vs(c),S&4&&p!==null&&p.memoizedState.isDehydrated)try{Lh(d.containerInfo)}catch(Ue){Yt(c,c.return,Ue)}x1&&(x1=!1,JO(c));break;case 4:S=ia,ia=vS(c.stateNode.containerInfo),bs(d,c),vs(c),ia=S;break;case 12:bs(d,c),vs(c);break;case 31:bs(d,c),vs(c),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,oS(c,S)));break;case 13:bs(d,c),vs(c),c.child.flags&8192&&c.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(lS=dr()),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,oS(c,S)));break;case 22:T=c.memoizedState!==null;var Y=p!==null&&p.memoizedState!==null,oe=Tl,he=mr;if(Tl=oe||T,mr=he||Y,bs(d,c),mr=he,Tl=oe,vs(c),S&8192)e:for(d=c.stateNode,d._visibility=T?d._visibility&-2:d._visibility|1,T&&(p===null||Y||Tl||mr||td(c)),p=null,d=c;;){if(d.tag===5||d.tag===26){if(p===null){Y=p=d;try{if(_=Y.stateNode,T)D=_.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{L=Y.stateNode;var Se=Y.memoizedProps.style,ae=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;L.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(Ue){Yt(Y,Y.return,Ue)}}}else if(d.tag===6){if(p===null){Y=d;try{Y.stateNode.nodeValue=T?"":Y.memoizedProps}catch(Ue){Yt(Y,Y.return,Ue)}}}else if(d.tag===18){if(p===null){Y=d;try{var ue=Y.stateNode;T?UD(ue,!0):UD(Y.stateNode,!1)}catch(Ue){Yt(Y,Y.return,Ue)}}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===c)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break e;for(;d.sibling===null;){if(d.return===null||d.return===c)break e;p===d&&(p=null),d=d.return}p===d&&(p=null),d.sibling.return=d.return,d=d.sibling}S&4&&(S=c.updateQueue,S!==null&&(p=S.retryQueue,p!==null&&(S.retryQueue=null,oS(c,p))));break;case 19:bs(d,c),vs(c),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,oS(c,S)));break;case 30:break;case 21:break;default:bs(d,c),vs(c)}}function vs(c){var d=c.flags;if(d&2){try{for(var p,S=c.return;S!==null;){if($O(S)){p=S;break}S=S.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var T=p.stateNode,_=b1(c);sS(c,_,T);break;case 5:var D=p.stateNode;p.flags&32&&(yi(D,""),p.flags&=-33);var L=b1(c);sS(c,L,D);break;case 3:case 4:var Y=p.stateNode.containerInfo,oe=b1(c);v1(c,oe,Y);break;default:throw Error(r(161))}}catch(he){Yt(c,c.return,he)}c.flags&=-3}d&4096&&(c.flags&=-4097)}function JO(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var d=c;JO(d),d.tag===5&&d.flags&1024&&d.stateNode.reset(),c=c.sibling}}function _l(c,d){if(d.subtreeFlags&8772)for(d=d.child;d!==null;)qO(c,d.alternate,d),d=d.sibling}function td(c){for(c=c.child;c!==null;){var d=c;switch(d.tag){case 0:case 11:case 14:case 15:Cc(4,d,d.return),td(d);break;case 1:Ia(d,d.return);var p=d.stateNode;typeof p.componentWillUnmount=="function"&&UO(d,d.return,p),td(d);break;case 27:qp(d.stateNode);case 26:case 5:Ia(d,d.return),td(d);break;case 22:d.memoizedState===null&&td(d);break;case 30:td(d);break;default:td(d)}c=c.sibling}}function Pl(c,d,p){for(p=p&&(d.subtreeFlags&8772)!==0,d=d.child;d!==null;){var S=d.alternate,T=c,_=d,D=_.flags;switch(_.tag){case 0:case 11:case 15:Pl(T,_,p),Lp(4,_);break;case 1:if(Pl(T,_,p),S=_,T=S.stateNode,typeof T.componentDidMount=="function")try{T.componentDidMount()}catch(oe){Yt(S,S.return,oe)}if(S=_,T=S.updateQueue,T!==null){var L=S.stateNode;try{var Y=T.shared.hiddenCallbacks;if(Y!==null)for(T.shared.hiddenCallbacks=null,T=0;T<Y.length;T++)kA(Y[T],L)}catch(oe){Yt(S,S.return,oe)}}p&&D&64&&FO(_),Np(_,_.return);break;case 27:KO(_);case 26:case 5:Pl(T,_,p),p&&S===null&&D&4&&HO(_),Np(_,_.return);break;case 12:Pl(T,_,p);break;case 31:Pl(T,_,p),p&&D&4&&WO(T,_);break;case 13:Pl(T,_,p),p&&D&4&&XO(T,_);break;case 22:_.memoizedState===null&&Pl(T,_,p),Np(_,_.return);break;case 30:break;default:Pl(T,_,p)}d=d.sibling}}function w1(c,d){var p=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(p=c.memoizedState.cachePool.pool),c=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(c=d.memoizedState.cachePool.pool),c!==p&&(c!=null&&c.refCount++,p!=null&&Cp(p))}function C1(c,d){c=null,d.alternate!==null&&(c=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==c&&(d.refCount++,c!=null&&Cp(c))}function sa(c,d,p,S){if(d.subtreeFlags&10256)for(d=d.child;d!==null;)QO(c,d,p,S),d=d.sibling}function QO(c,d,p,S){var T=d.flags;switch(d.tag){case 0:case 11:case 15:sa(c,d,p,S),T&2048&&Lp(9,d);break;case 1:sa(c,d,p,S);break;case 3:sa(c,d,p,S),T&2048&&(c=null,d.alternate!==null&&(c=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==c&&(d.refCount++,c!=null&&Cp(c)));break;case 12:if(T&2048){sa(c,d,p,S),c=d.stateNode;try{var _=d.memoizedProps,D=_.id,L=_.onPostCommit;typeof L=="function"&&L(D,d.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(Y){Yt(d,d.return,Y)}}else sa(c,d,p,S);break;case 31:sa(c,d,p,S);break;case 13:sa(c,d,p,S);break;case 23:break;case 22:_=d.stateNode,D=d.alternate,d.memoizedState!==null?_._visibility&2?sa(c,d,p,S):zp(c,d):_._visibility&2?sa(c,d,p,S):(_._visibility|=2,Eh(c,d,p,S,(d.subtreeFlags&10256)!==0||!1)),T&2048&&w1(D,d);break;case 24:sa(c,d,p,S),T&2048&&C1(d.alternate,d);break;default:sa(c,d,p,S)}}function Eh(c,d,p,S,T){for(T=T&&((d.subtreeFlags&10256)!==0||!1),d=d.child;d!==null;){var _=c,D=d,L=p,Y=S,oe=D.flags;switch(D.tag){case 0:case 11:case 15:Eh(_,D,L,Y,T),Lp(8,D);break;case 23:break;case 22:var he=D.stateNode;D.memoizedState!==null?he._visibility&2?Eh(_,D,L,Y,T):zp(_,D):(he._visibility|=2,Eh(_,D,L,Y,T)),T&&oe&2048&&w1(D.alternate,D);break;case 24:Eh(_,D,L,Y,T),T&&oe&2048&&C1(D.alternate,D);break;default:Eh(_,D,L,Y,T)}d=d.sibling}}function zp(c,d){if(d.subtreeFlags&10256)for(d=d.child;d!==null;){var p=c,S=d,T=S.flags;switch(S.tag){case 22:zp(p,S),T&2048&&w1(S.alternate,S);break;case 24:zp(p,S),T&2048&&C1(S.alternate,S);break;default:zp(p,S)}d=d.sibling}}var Bp=8192;function _h(c,d,p){if(c.subtreeFlags&Bp)for(c=c.child;c!==null;)eD(c,d,p),c=c.sibling}function eD(c,d,p){switch(c.tag){case 26:_h(c,d,p),c.flags&Bp&&c.memoizedState!==null&&lZ(p,ia,c.memoizedState,c.memoizedProps);break;case 5:_h(c,d,p);break;case 3:case 4:var S=ia;ia=vS(c.stateNode.containerInfo),_h(c,d,p),ia=S;break;case 22:c.memoizedState===null&&(S=c.alternate,S!==null&&S.memoizedState!==null?(S=Bp,Bp=16777216,_h(c,d,p),Bp=S):_h(c,d,p));break;default:_h(c,d,p)}}function tD(c){var d=c.alternate;if(d!==null&&(c=d.child,c!==null)){d.child=null;do d=c.sibling,c.sibling=null,c=d;while(c!==null)}}function Fp(c){var d=c.deletions;if((c.flags&16)!==0){if(d!==null)for(var p=0;p<d.length;p++){var S=d[p];Or=S,rD(S,c)}tD(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)nD(c),c=c.sibling}function nD(c){switch(c.tag){case 0:case 11:case 15:Fp(c),c.flags&2048&&Cc(9,c,c.return);break;case 3:Fp(c);break;case 12:Fp(c);break;case 22:var d=c.stateNode;c.memoizedState!==null&&d._visibility&2&&(c.return===null||c.return.tag!==13)?(d._visibility&=-3,aS(c)):Fp(c);break;default:Fp(c)}}function aS(c){var d=c.deletions;if((c.flags&16)!==0){if(d!==null)for(var p=0;p<d.length;p++){var S=d[p];Or=S,rD(S,c)}tD(c)}for(c=c.child;c!==null;){switch(d=c,d.tag){case 0:case 11:case 15:Cc(8,d,d.return),aS(d);break;case 22:p=d.stateNode,p._visibility&2&&(p._visibility&=-3,aS(d));break;default:aS(d)}c=c.sibling}}function rD(c,d){for(;Or!==null;){var p=Or;switch(p.tag){case 0:case 11:case 15:Cc(8,p,d);break;case 23:case 22:if(p.memoizedState!==null&&p.memoizedState.cachePool!==null){var S=p.memoizedState.cachePool.pool;S!=null&&S.refCount++}break;case 24:Cp(p.memoizedState.cache)}if(S=p.child,S!==null)S.return=p,Or=S;else e:for(p=c;Or!==null;){S=Or;var T=S.sibling,_=S.return;if(GO(S),S===p){Or=null;break e}if(T!==null){T.return=_,Or=T;break e}Or=_}}}var CX={getCacheForType:function(c){var d=Xr(fr),p=d.data.get(c);return p===void 0&&(p=c(),d.data.set(c,p)),p},cacheSignal:function(){return Xr(fr).controller.signal}},TX=typeof WeakMap=="function"?WeakMap:Map,$t=0,cn=null,Ct=null,Pt=0,Gt=0,Gs=null,Tc=!1,Ph=!1,T1=!1,Il=0,Un=0,Ec=0,nd=0,E1=0,Ys=0,Ih=0,Up=null,xs=null,_1=!1,lS=0,iD=0,cS=1/0,uS=null,_c=null,Pr=0,Pc=null,kh=null,kl=0,P1=0,I1=null,sD=null,Hp=0,k1=null;function Ws(){return($t&2)!==0&&Pt!==0?Pt&-Pt:B.T!==null?j1():bo()}function oD(){if(Ys===0)if((Pt&536870912)===0||Ot){var c=hs;hs<<=1,(hs&3932160)===0&&(hs=262144),Ys=c}else Ys=536870912;return c=Vs.current,c!==null&&(c.flags|=32),Ys}function ws(c,d,p){(c===cn&&(Gt===2||Gt===9)||c.cancelPendingCommit!==null)&&(Mh(c,0),Ic(c,Pt,Ys,!1)),ll(c,p),(($t&2)===0||c!==cn)&&(c===cn&&(($t&2)===0&&(nd|=p),Un===4&&Ic(c,Pt,Ys,!1)),ka(c))}function aD(c,d,p){if(($t&6)!==0)throw Error(r(327));var S=!p&&(d&127)===0&&(d&c.expiredLanes)===0||Bs(c,d),T=S?PX(c,d):A1(c,d,!0),_=S;do{if(T===0){Ph&&!S&&Ic(c,d,0,!1);break}else{if(p=c.current.alternate,_&&!EX(p)){T=A1(c,d,!1),_=!1;continue}if(T===2){if(_=d,c.errorRecoveryDisabledLanes&_)var D=0;else D=c.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){d=D;e:{var L=c;T=Up;var Y=L.current.memoizedState.isDehydrated;if(Y&&(Mh(L,D).flags|=256),D=A1(L,D,!1),D!==2){if(T1&&!Y){L.errorRecoveryDisabledLanes|=_,nd|=_,T=4;break e}_=xs,xs=T,_!==null&&(xs===null?xs=_:xs.push.apply(xs,_))}T=D}if(_=!1,T!==2)continue}}if(T===1){Mh(c,0),Ic(c,d,0,!0);break}e:{switch(S=c,_=T,_){case 0:case 1:throw Error(r(345));case 4:if((d&4194048)!==d)break;case 6:Ic(S,d,Ys,!Tc);break e;case 2:xs=null;break;case 3:case 5:break;default:throw Error(r(329))}if((d&62914560)===d&&(T=lS+300-dr(),10<T)){if(Ic(S,d,Ys,!Tc),zs(S,0,!0)!==0)break e;kl=d,S.timeoutHandle=zD(lD.bind(null,S,p,xs,uS,_1,d,Ys,nd,Ih,Tc,_,"Throttled",-0,0),T);break e}lD(S,p,xs,uS,_1,d,Ys,nd,Ih,Tc,_,null,-0,0)}}break}while(!0);ka(c)}function lD(c,d,p,S,T,_,D,L,Y,oe,he,Se,ae,ue){if(c.timeoutHandle=-1,Se=d.subtreeFlags,Se&8192||(Se&16785408)===16785408){Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ce},eD(d,_,Se);var Ue=(_&62914560)===_?lS-dr():(_&4194048)===_?iD-dr():0;if(Ue=cZ(Se,Ue),Ue!==null){kl=_,c.cancelPendingCommit=Ue(mD.bind(null,c,d,_,p,S,T,D,L,Y,he,Se,null,ae,ue)),Ic(c,_,D,!oe);return}}mD(c,d,_,p,S,T,D,L,Y)}function EX(c){for(var d=c;;){var p=d.tag;if((p===0||p===11||p===15)&&d.flags&16384&&(p=d.updateQueue,p!==null&&(p=p.stores,p!==null)))for(var S=0;S<p.length;S++){var T=p[S],_=T.getSnapshot;T=T.value;try{if(!$s(_(),T))return!1}catch{return!1}}if(p=d.child,d.subtreeFlags&16384&&p!==null)p.return=d,d=p;else{if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Ic(c,d,p,S){d&=~E1,d&=~nd,c.suspendedLanes|=d,c.pingedLanes&=~d,S&&(c.warmLanes|=d),S=c.expirationTimes;for(var T=d;0<T;){var _=31-An(T),D=1<<_;S[_]=-1,T&=~D}p!==0&&Zd(c,p,d)}function dS(){return($t&6)===0?($p(0),!1):!0}function M1(){if(Ct!==null){if(Gt===0)var c=Ct.return;else c=Ct,Sl=Gu=null,qw(c),vh=null,Ep=0,c=Ct;for(;c!==null;)BO(c.alternate,c),c=c.return;Ct=null}}function Mh(c,d){var p=c.timeoutHandle;p!==-1&&(c.timeoutHandle=-1,VX(p)),p=c.cancelPendingCommit,p!==null&&(c.cancelPendingCommit=null,p()),kl=0,M1(),cn=c,Ct=p=ml(c.current,null),Pt=d,Gt=0,Gs=null,Tc=!1,Ph=Bs(c,d),T1=!1,Ih=Ys=E1=nd=Ec=Un=0,xs=Up=null,_1=!1,(d&8)!==0&&(d|=d&32);var S=c.entangledLanes;if(S!==0)for(c=c.entanglements,S&=d;0<S;){var T=31-An(S),_=1<<T;d|=c[T],S&=~_}return Il=d,Oy(),p}function cD(c,d){ft=null,B.H=Dp,d===bh||d===Fy?(d=EA(),Gt=3):d===Rw?(d=EA(),Gt=4):Gt=d===l1?8:d!==null&&typeof d=="object"&&typeof d.then=="function"?6:1,Gs=d,Ct===null&&(Un=1,eS(c,To(d,c.current)))}function uD(){var c=Vs.current;return c===null?!0:(Pt&4194048)===Pt?Io===null:(Pt&62914560)===Pt||(Pt&536870912)!==0?c===Io:!1}function dD(){var c=B.H;return B.H=Dp,c===null?Dp:c}function hD(){var c=B.A;return B.A=CX,c}function hS(){Un=4,Tc||(Pt&4194048)!==Pt&&Vs.current!==null||(Ph=!0),(Ec&134217727)===0&&(nd&134217727)===0||cn===null||Ic(cn,Pt,Ys,!1)}function A1(c,d,p){var S=$t;$t|=2;var T=dD(),_=hD();(cn!==c||Pt!==d)&&(uS=null,Mh(c,d)),d=!1;var D=Un;e:do try{if(Gt!==0&&Ct!==null){var L=Ct,Y=Gs;switch(Gt){case 8:M1(),D=6;break e;case 3:case 2:case 9:case 6:Vs.current===null&&(d=!0);var oe=Gt;if(Gt=0,Gs=null,Ah(c,L,Y,oe),p&&Ph){D=0;break e}break;default:oe=Gt,Gt=0,Gs=null,Ah(c,L,Y,oe)}}_X(),D=Un;break}catch(he){cD(c,he)}while(!0);return d&&c.shellSuspendCounter++,Sl=Gu=null,$t=S,B.H=T,B.A=_,Ct===null&&(cn=null,Pt=0,Oy()),D}function _X(){for(;Ct!==null;)fD(Ct)}function PX(c,d){var p=$t;$t|=2;var S=dD(),T=hD();cn!==c||Pt!==d?(uS=null,cS=dr()+500,Mh(c,d)):Ph=Bs(c,d);e:do try{if(Gt!==0&&Ct!==null){d=Ct;var _=Gs;t:switch(Gt){case 1:Gt=0,Gs=null,Ah(c,d,_,1);break;case 2:case 9:if(CA(_)){Gt=0,Gs=null,pD(d);break}d=function(){Gt!==2&&Gt!==9||cn!==c||(Gt=7),ka(c)},_.then(d,d);break e;case 3:Gt=7;break e;case 4:Gt=5;break e;case 7:CA(_)?(Gt=0,Gs=null,pD(d)):(Gt=0,Gs=null,Ah(c,d,_,7));break;case 5:var D=null;switch(Ct.tag){case 26:D=Ct.memoizedState;case 5:case 27:var L=Ct;if(D?QD(D):L.stateNode.complete){Gt=0,Gs=null;var Y=L.sibling;if(Y!==null)Ct=Y;else{var oe=L.return;oe!==null?(Ct=oe,fS(oe)):Ct=null}break t}}Gt=0,Gs=null,Ah(c,d,_,5);break;case 6:Gt=0,Gs=null,Ah(c,d,_,6);break;case 8:M1(),Un=6;break e;default:throw Error(r(462))}}IX();break}catch(he){cD(c,he)}while(!0);return Sl=Gu=null,B.H=S,B.A=T,$t=p,Ct!==null?0:(cn=null,Pt=0,Oy(),Un)}function IX(){for(;Ct!==null&&!ol();)fD(Ct)}function fD(c){var d=NO(c.alternate,c,Il);c.memoizedProps=c.pendingProps,d===null?fS(c):Ct=d}function pD(c){var d=c,p=d.alternate;switch(d.tag){case 15:case 0:d=AO(p,d,d.pendingProps,d.type,void 0,Pt);break;case 11:d=AO(p,d,d.pendingProps,d.type.render,d.ref,Pt);break;case 5:qw(d);default:BO(p,d),d=Ct=hA(d,Il),d=NO(p,d,Il)}c.memoizedProps=c.pendingProps,d===null?fS(c):Ct=d}function Ah(c,d,p,S){Sl=Gu=null,qw(d),vh=null,Ep=0;var T=d.return;try{if(mX(c,T,d,p,Pt)){Un=1,eS(c,To(p,c.current)),Ct=null;return}}catch(_){if(T!==null)throw Ct=T,_;Un=1,eS(c,To(p,c.current)),Ct=null;return}d.flags&32768?(Ot||S===1?c=!0:Ph||(Pt&536870912)!==0?c=!1:(Tc=c=!0,(S===2||S===9||S===3||S===6)&&(S=Vs.current,S!==null&&S.tag===13&&(S.flags|=16384))),gD(d,c)):fS(d)}function fS(c){var d=c;do{if((d.flags&32768)!==0){gD(d,Tc);return}c=d.return;var p=bX(d.alternate,d,Il);if(p!==null){Ct=p;return}if(d=d.sibling,d!==null){Ct=d;return}Ct=d=c}while(d!==null);Un===0&&(Un=5)}function gD(c,d){do{var p=vX(c.alternate,c);if(p!==null){p.flags&=32767,Ct=p;return}if(p=c.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!d&&(c=c.sibling,c!==null)){Ct=c;return}Ct=c=p}while(c!==null);Un=6,Ct=null}function mD(c,d,p,S,T,_,D,L,Y){c.cancelPendingCommit=null;do pS();while(Pr!==0);if(($t&6)!==0)throw Error(r(327));if(d!==null){if(d===c.current)throw Error(r(177));if(_=d.lanes|d.childLanes,_|=bw,hp(c,p,_,D,L,Y),c===cn&&(Ct=cn=null,Pt=0),kh=d,Pc=c,kl=p,P1=_,I1=T,sD=S,(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?(c.callbackNode=null,c.callbackPriority=0,OX(us,function(){return xD(),null})):(c.callbackNode=null,c.callbackPriority=0),S=(d.flags&13878)!==0,(d.subtreeFlags&13878)!==0||S){S=B.T,B.T=null,T=G.p,G.p=2,D=$t,$t|=4;try{xX(c,d,p)}finally{$t=D,G.p=T,B.T=S}}Pr=1,yD(),SD(),bD()}}function yD(){if(Pr===1){Pr=0;var c=Pc,d=kh,p=(d.flags&13878)!==0;if((d.subtreeFlags&13878)!==0||p){p=B.T,B.T=null;var S=G.p;G.p=2;var T=$t;$t|=4;try{ZO(d,c);var _=$1,D=rA(c.containerInfo),L=_.focusedElem,Y=_.selectionRange;if(D!==L&&L&&L.ownerDocument&&nA(L.ownerDocument.documentElement,L)){if(Y!==null&&pw(L)){var oe=Y.start,he=Y.end;if(he===void 0&&(he=oe),"selectionStart"in L)L.selectionStart=oe,L.selectionEnd=Math.min(he,L.value.length);else{var Se=L.ownerDocument||document,ae=Se&&Se.defaultView||window;if(ae.getSelection){var ue=ae.getSelection(),Ue=L.textContent.length,et=Math.min(Y.start,Ue),nn=Y.end===void 0?et:Math.min(Y.end,Ue);!ue.extend&&et>nn&&(D=nn,nn=et,et=D);var re=tA(L,et),X=tA(L,nn);if(re&&X&&(ue.rangeCount!==1||ue.anchorNode!==re.node||ue.anchorOffset!==re.offset||ue.focusNode!==X.node||ue.focusOffset!==X.offset)){var se=Se.createRange();se.setStart(re.node,re.offset),ue.removeAllRanges(),et>nn?(ue.addRange(se),ue.extend(X.node,X.offset)):(se.setEnd(X.node,X.offset),ue.addRange(se))}}}}for(Se=[],ue=L;ue=ue.parentNode;)ue.nodeType===1&&Se.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<Se.length;L++){var ye=Se[L];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}_S=!!H1,$1=H1=null}finally{$t=T,G.p=S,B.T=p}}c.current=d,Pr=2}}function SD(){if(Pr===2){Pr=0;var c=Pc,d=kh,p=(d.flags&8772)!==0;if((d.subtreeFlags&8772)!==0||p){p=B.T,B.T=null;var S=G.p;G.p=2;var T=$t;$t|=4;try{qO(c,d.alternate,d)}finally{$t=T,G.p=S,B.T=p}}Pr=3}}function bD(){if(Pr===4||Pr===3){Pr=0,sc();var c=Pc,d=kh,p=kl,S=sD;(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?Pr=5:(Pr=0,kh=Pc=null,vD(c,c.pendingLanes));var T=c.pendingLanes;if(T===0&&(_c=null),cl(p),d=d.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(At,d,void 0,(d.current.flags&128)===128)}catch{}if(S!==null){d=B.T,T=G.p,G.p=2,B.T=null;try{for(var _=c.onRecoverableError,D=0;D<S.length;D++){var L=S[D];_(L.value,{componentStack:L.stack})}}finally{B.T=d,G.p=T}}(kl&3)!==0&&pS(),ka(c),T=c.pendingLanes,(p&261930)!==0&&(T&42)!==0?c===k1?Hp++:(Hp=0,k1=c):Hp=0,$p(0)}}function vD(c,d){(c.pooledCacheLanes&=d)===0&&(d=c.pooledCache,d!=null&&(c.pooledCache=null,Cp(d)))}function pS(){return yD(),SD(),bD(),xD()}function xD(){if(Pr!==5)return!1;var c=Pc,d=P1;P1=0;var p=cl(kl),S=B.T,T=G.p;try{G.p=32>p?32:p,B.T=null,p=I1,I1=null;var _=Pc,D=kl;if(Pr=0,kh=Pc=null,kl=0,($t&6)!==0)throw Error(r(331));var L=$t;if($t|=4,nD(_.current),QO(_,_.current,D,p),$t=L,$p(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(At,_)}catch{}return!0}finally{G.p=T,B.T=S,vD(c,d)}}function wD(c,d,p){d=To(p,d),d=a1(c.stateNode,d,2),c=vc(c,d,2),c!==null&&(ll(c,2),ka(c))}function Yt(c,d,p){if(c.tag===3)wD(c,c,p);else for(;d!==null;){if(d.tag===3){wD(d,c,p);break}else if(d.tag===1){var S=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(_c===null||!_c.has(S))){c=To(p,c),p=CO(2),S=vc(d,p,2),S!==null&&(TO(p,S,d,c),ll(S,2),ka(S));break}}d=d.return}}function O1(c,d,p){var S=c.pingCache;if(S===null){S=c.pingCache=new TX;var T=new Set;S.set(d,T)}else T=S.get(d),T===void 0&&(T=new Set,S.set(d,T));T.has(p)||(T1=!0,T.add(p),c=kX.bind(null,c,d,p),d.then(c,c))}function kX(c,d,p){var S=c.pingCache;S!==null&&S.delete(d),c.pingedLanes|=c.suspendedLanes&p,c.warmLanes&=~p,cn===c&&(Pt&p)===p&&(Un===4||Un===3&&(Pt&62914560)===Pt&&300>dr()-lS?($t&2)===0&&Mh(c,0):E1|=p,Ih===Pt&&(Ih=0)),ka(c)}function CD(c,d){d===0&&(d=oc()),c=Ku(c,d),c!==null&&(ll(c,d),ka(c))}function MX(c){var d=c.memoizedState,p=0;d!==null&&(p=d.retryLane),CD(c,p)}function AX(c,d){var p=0;switch(c.tag){case 31:case 13:var S=c.stateNode,T=c.memoizedState;T!==null&&(p=T.retryLane);break;case 19:S=c.stateNode;break;case 22:S=c.stateNode._retryCache;break;default:throw Error(r(314))}S!==null&&S.delete(d),CD(c,p)}function OX(c,d){return hi(c,d)}var gS=null,Oh=null,D1=!1,mS=!1,R1=!1,kc=0;function ka(c){c!==Oh&&c.next===null&&(Oh===null?gS=Oh=c:Oh=Oh.next=c),mS=!0,D1||(D1=!0,RX())}function $p(c,d){if(!R1&&mS){R1=!0;do for(var p=!1,S=gS;S!==null;){if(c!==0){var T=S.pendingLanes;if(T===0)var _=0;else{var D=S.suspendedLanes,L=S.pingedLanes;_=(1<<31-An(42|c)+1)-1,_&=T&~(D&~L),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(p=!0,PD(S,_))}else _=Pt,_=zs(S,S===cn?_:0,S.cancelPendingCommit!==null||S.timeoutHandle!==-1),(_&3)===0||Bs(S,_)||(p=!0,PD(S,_));S=S.next}while(p);R1=!1}}function DX(){TD()}function TD(){mS=D1=!1;var c=0;kc!==0&&KX()&&(c=kc);for(var d=dr(),p=null,S=gS;S!==null;){var T=S.next,_=ED(S,d);_===0?(S.next=null,p===null?gS=T:p.next=T,T===null&&(Oh=p)):(p=S,(c!==0||(_&3)!==0)&&(mS=!0)),S=T}Pr!==0&&Pr!==5||$p(c),kc!==0&&(kc=0)}function ED(c,d){for(var p=c.suspendedLanes,S=c.pingedLanes,T=c.expirationTimes,_=c.pendingLanes&-62914561;0<_;){var D=31-An(_),L=1<<D,Y=T[D];Y===-1?((L&p)===0||(L&S)!==0)&&(T[D]=Fs(L,d)):Y<=d&&(c.expiredLanes|=L),_&=~L}if(d=cn,p=Pt,p=zs(c,c===d?p:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),S=c.callbackNode,p===0||c===d&&(Gt===2||Gt===9)||c.cancelPendingCommit!==null)return S!==null&&S!==null&&fi(S),c.callbackNode=null,c.callbackPriority=0;if((p&3)===0||Bs(c,p)){if(d=p&-p,d===c.callbackPriority)return d;switch(S!==null&&fi(S),cl(p)){case 2:case 8:p=Xo;break;case 32:p=us;break;case 268435456:p=ce;break;default:p=us}return S=_D.bind(null,c),p=hi(p,S),c.callbackPriority=d,c.callbackNode=p,d}return S!==null&&S!==null&&fi(S),c.callbackPriority=2,c.callbackNode=null,2}function _D(c,d){if(Pr!==0&&Pr!==5)return c.callbackNode=null,c.callbackPriority=0,null;var p=c.callbackNode;if(pS()&&c.callbackNode!==p)return null;var S=Pt;return S=zs(c,c===cn?S:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),S===0?null:(aD(c,S,d),ED(c,dr()),c.callbackNode!=null&&c.callbackNode===p?_D.bind(null,c):null)}function PD(c,d){if(pS())return null;aD(c,d,!0)}function RX(){qX(function(){($t&6)!==0?hi(So,DX):TD()})}function j1(){if(kc===0){var c=yh;c===0&&(c=pi,pi<<=1,(pi&261888)===0&&(pi=256)),kc=c}return kc}function ID(c){return c==null||typeof c=="symbol"||typeof c=="boolean"?null:typeof c=="function"?c:ie(""+c)}function kD(c,d){var p=d.ownerDocument.createElement("input");return p.name=d.name,p.value=d.value,c.id&&p.setAttribute("form",c.id),d.parentNode.insertBefore(p,d),c=new FormData(c),p.parentNode.removeChild(p),c}function jX(c,d,p,S,T){if(d==="submit"&&p&&p.stateNode===T){var _=ID((T[Ar]||null).action),D=S.submitter;D&&(d=(d=D[Ar]||null)?ID(d.formAction):D.getAttribute("formAction"),d!==null&&(_=d,D=null));var L=new st("action","action",null,S,T);c.push({event:L,listeners:[{instance:null,listener:function(){if(S.defaultPrevented){if(kc!==0){var Y=D?kD(T,D):new FormData(T);t1(p,{pending:!0,data:Y,method:T.method,action:_},null,Y)}}else typeof _=="function"&&(L.preventDefault(),Y=D?kD(T,D):new FormData(T),t1(p,{pending:!0,data:Y,method:T.method,action:_},_,Y))},currentTarget:T}]})}}for(var L1=0;L1<Sw.length;L1++){var N1=Sw[L1],LX=N1.toLowerCase(),NX=N1[0].toUpperCase()+N1.slice(1);ra(LX,"on"+NX)}ra(oA,"onAnimationEnd"),ra(aA,"onAnimationIteration"),ra(lA,"onAnimationStart"),ra("dblclick","onDoubleClick"),ra("focusin","onFocus"),ra("focusout","onBlur"),ra(QW,"onTransitionRun"),ra(eX,"onTransitionStart"),ra(tX,"onTransitionCancel"),ra(cA,"onTransitionEnd"),ea("onMouseEnter",["mouseout","mouseover"]),ea("onMouseLeave",["mouseout","mouseover"]),ea("onPointerEnter",["pointerout","pointerover"]),ea("onPointerLeave",["pointerout","pointerover"]),Qo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Kp="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(" "),zX=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Kp));function MD(c,d){d=(d&4)!==0;for(var p=0;p<c.length;p++){var S=c[p],T=S.event;S=S.listeners;e:{var _=void 0;if(d)for(var D=S.length-1;0<=D;D--){var L=S[D],Y=L.instance,oe=L.currentTarget;if(L=L.listener,Y!==_&&T.isPropagationStopped())break e;_=L,T.currentTarget=oe;try{_(T)}catch(he){Ay(he)}T.currentTarget=null,_=Y}else for(D=0;D<S.length;D++){if(L=S[D],Y=L.instance,oe=L.currentTarget,L=L.listener,Y!==_&&T.isPropagationStopped())break e;_=L,T.currentTarget=oe;try{_(T)}catch(he){Ay(he)}T.currentTarget=null,_=Y}}}}function Tt(c,d){var p=d[Hi];p===void 0&&(p=d[Hi]=new Set);var S=c+"__bubble";p.has(S)||(AD(d,c,2,!1),p.add(S))}function z1(c,d,p){var S=0;d&&(S|=4),AD(p,c,S,d)}var yS="_reactListening"+Math.random().toString(36).slice(2);function B1(c){if(!c[yS]){c[yS]=!0,th.forEach(function(p){p!=="selectionchange"&&(zX.has(p)||z1(p,!1,c),z1(p,!0,c))});var d=c.nodeType===9?c:c.ownerDocument;d===null||d[yS]||(d[yS]=!0,z1("selectionchange",!1,d))}}function AD(c,d,p,S){switch(oR(d)){case 2:var T=hZ;break;case 8:T=fZ;break;default:T=eC}p=T.bind(null,d,p,c),T=void 0,!Bn||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(T=!0),S?T!==void 0?c.addEventListener(d,p,{capture:!0,passive:T}):c.addEventListener(d,p,!0):T!==void 0?c.addEventListener(d,p,{passive:T}):c.addEventListener(d,p,!1)}function F1(c,d,p,S,T){var _=S;if((d&1)===0&&(d&2)===0&&S!==null)e:for(;;){if(S===null)return;var D=S.tag;if(D===3||D===4){var L=S.stateNode.containerInfo;if(L===T)break;if(D===4)for(D=S.return;D!==null;){var Y=D.tag;if((Y===3||Y===4)&&D.stateNode.containerInfo===T)return;D=D.return}for(;L!==null;){if(D=gi(L),D===null)return;if(Y=D.tag,Y===5||Y===6||Y===26||Y===27){S=_=D;continue e}L=L.parentNode}}S=S.return}Tr(function(){var oe=_,he=Jt(p),Se=[];e:{var ae=uA.get(c);if(ae!==void 0){var ue=st,Ue=c;switch(c){case"keypress":if($(p)===0)break e;case"keydown":case"keyup":ue=AW;break;case"focusin":Ue="focus",ue=Hs;break;case"focusout":Ue="blur",ue=Hs;break;case"beforeblur":case"afterblur":ue=Hs;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=_r;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=ys;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=RW;break;case oA:case aA:case lA:ue=ky;break;case cA:ue=LW;break;case"scroll":case"scrollend":ue=hr;break;case"wheel":ue=zW;break;case"copy":case"cut":case"paste":ue=ah;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=U2;break;case"toggle":case"beforetoggle":ue=FW}var et=(d&4)!==0,nn=!et&&(c==="scroll"||c==="scrollend"),re=et?ae!==null?ae+"Capture":null:ae;et=[];for(var X=oe,se;X!==null;){var ye=X;if(se=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||se===null||re===null||(ye=Jn(X,re),ye!=null&&et.push(Vp(X,ye,se))),nn)break;X=X.return}0<et.length&&(ae=new ue(ae,Ue,null,p,he),Se.push({event:ae,listeners:et}))}}if((d&7)===0){e:{if(ae=c==="mouseover"||c==="pointerover",ue=c==="mouseout"||c==="pointerout",ae&&p!==ze&&(Ue=p.relatedTarget||p.fromElement)&&(gi(Ue)||Ue[wa]))break e;if((ue||ae)&&(ae=he.window===he?he:(ae=he.ownerDocument)?ae.defaultView||ae.parentWindow:window,ue?(Ue=p.relatedTarget||p.toElement,ue=oe,Ue=Ue?gi(Ue):null,Ue!==null&&(nn=s(Ue),et=Ue.tag,Ue!==nn||et!==5&&et!==27&&et!==6)&&(Ue=null)):(ue=null,Ue=oe),ue!==Ue)){if(et=_r,ye="onMouseLeave",re="onMouseEnter",X="mouse",(c==="pointerout"||c==="pointerover")&&(et=U2,ye="onPointerLeave",re="onPointerEnter",X="pointer"),nn=ue==null?ae:dl(ue),se=Ue==null?ae:dl(Ue),ae=new et(ye,X+"leave",ue,p,he),ae.target=nn,ae.relatedTarget=se,ye=null,gi(he)===oe&&(et=new et(re,X+"enter",Ue,p,he),et.target=se,et.relatedTarget=nn,ye=et),nn=ye,ue&&Ue)t:{for(et=BX,re=ue,X=Ue,se=0,ye=re;ye;ye=et(ye))se++;ye=0;for(var Ge=X;Ge;Ge=et(Ge))ye++;for(;0<se-ye;)re=et(re),se--;for(;0<ye-se;)X=et(X),ye--;for(;se--;){if(re===X||X!==null&&re===X.alternate){et=re;break t}re=et(re),X=et(X)}et=null}else et=null;ue!==null&&OD(Se,ae,ue,et,!1),Ue!==null&&nn!==null&&OD(Se,nn,Ue,et,!0)}}e:{if(ae=oe?dl(oe):window,ue=ae.nodeName&&ae.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ae.type==="file")var Bt=W2;else if(G2(ae))if(X2)Bt=XW;else{Bt=YW;var $e=GW}else ue=ae.nodeName,!ue||ue.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?oe&&Uu(oe.elementType)&&(Bt=W2):Bt=WW;if(Bt&&(Bt=Bt(c,oe))){Y2(Se,Bt,p,he);break e}$e&&$e(c,ae,oe),c==="focusout"&&oe&&ae.type==="number"&&oe.memoizedProps.value!=null&&fl(ae,"number",ae.value)}switch($e=oe?dl(oe):window,c){case"focusin":(G2($e)||$e.contentEditable==="true")&&(ch=$e,gw=oe,vp=null);break;case"focusout":vp=gw=ch=null;break;case"mousedown":mw=!0;break;case"contextmenu":case"mouseup":case"dragend":mw=!1,iA(Se,p,he);break;case"selectionchange":if(JW)break;case"keydown":case"keyup":iA(Se,p,he)}var mt;if(dw)e:{switch(c){case"compositionstart":var It="onCompositionStart";break e;case"compositionend":It="onCompositionEnd";break e;case"compositionupdate":It="onCompositionUpdate";break e}It=void 0}else lh?V2(c,p)&&(It="onCompositionEnd"):c==="keydown"&&p.keyCode===229&&(It="onCompositionStart");It&&(H2&&p.locale!=="ko"&&(lh||It!=="onCompositionStart"?It==="onCompositionEnd"&&lh&&(mt=wo()):(Tn=he,gs="value"in Tn?Tn.value:Tn.textContent,lh=!0)),$e=SS(oe,It),0<$e.length&&(It=new F2(It,c,null,p,he),Se.push({event:It,listeners:$e}),mt?It.data=mt:(mt=q2(p),mt!==null&&(It.data=mt)))),(mt=HW?$W(c,p):KW(c,p))&&(It=SS(oe,"onBeforeInput"),0<It.length&&($e=new F2("onBeforeInput","beforeinput",null,p,he),Se.push({event:$e,listeners:It}),$e.data=mt)),jX(Se,c,oe,p,he)}MD(Se,d)})}function Vp(c,d,p){return{instance:c,listener:d,currentTarget:p}}function SS(c,d){for(var p=d+"Capture",S=[];c!==null;){var T=c,_=T.stateNode;if(T=T.tag,T!==5&&T!==26&&T!==27||_===null||(T=Jn(c,p),T!=null&&S.unshift(Vp(c,T,_)),T=Jn(c,d),T!=null&&S.push(Vp(c,T,_))),c.tag===3)return S;c=c.return}return[]}function BX(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5&&c.tag!==27);return c||null}function OD(c,d,p,S,T){for(var _=d._reactName,D=[];p!==null&&p!==S;){var L=p,Y=L.alternate,oe=L.stateNode;if(L=L.tag,Y!==null&&Y===S)break;L!==5&&L!==26&&L!==27||oe===null||(Y=oe,T?(oe=Jn(p,_),oe!=null&&D.unshift(Vp(p,oe,Y))):T||(oe=Jn(p,_),oe!=null&&D.push(Vp(p,oe,Y)))),p=p.return}D.length!==0&&c.push({event:d,listeners:D})}var FX=/\r\n?/g,UX=/\u0000|\uFFFD/g;function DD(c){return(typeof c=="string"?c:""+c).replace(FX,`
9
- `).replace(UX,"")}function RD(c,d){return d=DD(d),DD(c)===d}function tn(c,d,p,S,T,_){switch(p){case"children":typeof S=="string"?d==="body"||d==="textarea"&&S===""||yi(c,S):(typeof S=="number"||typeof S=="bigint")&&d!=="body"&&yi(c,""+S);break;case"className":cc(c,"class",S);break;case"tabIndex":cc(c,"tabindex",S);break;case"dir":case"role":case"viewBox":case"width":case"height":cc(c,p,S);break;case"style":$i(c,S,_);break;case"data":if(d!=="object"){cc(c,"data",S);break}case"src":case"href":if(S===""&&(d!=="a"||p!=="href")){c.removeAttribute(p);break}if(S==null||typeof S=="function"||typeof S=="symbol"||typeof S=="boolean"){c.removeAttribute(p);break}S=ie(""+S),c.setAttribute(p,S);break;case"action":case"formAction":if(typeof S=="function"){c.setAttribute(p,"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 _=="function"&&(p==="formAction"?(d!=="input"&&tn(c,d,"name",T.name,T,null),tn(c,d,"formEncType",T.formEncType,T,null),tn(c,d,"formMethod",T.formMethod,T,null),tn(c,d,"formTarget",T.formTarget,T,null)):(tn(c,d,"encType",T.encType,T,null),tn(c,d,"method",T.method,T,null),tn(c,d,"target",T.target,T,null)));if(S==null||typeof S=="symbol"||typeof S=="boolean"){c.removeAttribute(p);break}S=ie(""+S),c.setAttribute(p,S);break;case"onClick":S!=null&&(c.onclick=Ce);break;case"onScroll":S!=null&&Tt("scroll",c);break;case"onScrollEnd":S!=null&&Tt("scrollend",c);break;case"dangerouslySetInnerHTML":if(S!=null){if(typeof S!="object"||!("__html"in S))throw Error(r(61));if(p=S.__html,p!=null){if(T.children!=null)throw Error(r(60));c.innerHTML=p}}break;case"multiple":c.multiple=S&&typeof S!="function"&&typeof S!="symbol";break;case"muted":c.muted=S&&typeof S!="function"&&typeof S!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(S==null||typeof S=="function"||typeof S=="boolean"||typeof S=="symbol"){c.removeAttribute("xlink:href");break}p=ie(""+S),c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",p);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":S!=null&&typeof S!="function"&&typeof S!="symbol"?c.setAttribute(p,""+S):c.removeAttribute(p);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":S&&typeof S!="function"&&typeof S!="symbol"?c.setAttribute(p,""):c.removeAttribute(p);break;case"capture":case"download":S===!0?c.setAttribute(p,""):S!==!1&&S!=null&&typeof S!="function"&&typeof S!="symbol"?c.setAttribute(p,S):c.removeAttribute(p);break;case"cols":case"rows":case"size":case"span":S!=null&&typeof S!="function"&&typeof S!="symbol"&&!isNaN(S)&&1<=S?c.setAttribute(p,S):c.removeAttribute(p);break;case"rowSpan":case"start":S==null||typeof S=="function"||typeof S=="symbol"||isNaN(S)?c.removeAttribute(p):c.setAttribute(p,S);break;case"popover":Tt("beforetoggle",c),Tt("toggle",c),hl(c,"popover",S);break;case"xlinkActuate":Us(c,"http://www.w3.org/1999/xlink","xlink:actuate",S);break;case"xlinkArcrole":Us(c,"http://www.w3.org/1999/xlink","xlink:arcrole",S);break;case"xlinkRole":Us(c,"http://www.w3.org/1999/xlink","xlink:role",S);break;case"xlinkShow":Us(c,"http://www.w3.org/1999/xlink","xlink:show",S);break;case"xlinkTitle":Us(c,"http://www.w3.org/1999/xlink","xlink:title",S);break;case"xlinkType":Us(c,"http://www.w3.org/1999/xlink","xlink:type",S);break;case"xmlBase":Us(c,"http://www.w3.org/XML/1998/namespace","xml:base",S);break;case"xmlLang":Us(c,"http://www.w3.org/XML/1998/namespace","xml:lang",S);break;case"xmlSpace":Us(c,"http://www.w3.org/XML/1998/namespace","xml:space",S);break;case"is":hl(c,"is",S);break;case"innerText":case"textContent":break;default:(!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(p=sh.get(p)||p,hl(c,p,S))}}function U1(c,d,p,S,T,_){switch(p){case"style":$i(c,S,_);break;case"dangerouslySetInnerHTML":if(S!=null){if(typeof S!="object"||!("__html"in S))throw Error(r(61));if(p=S.__html,p!=null){if(T.children!=null)throw Error(r(60));c.innerHTML=p}}break;case"children":typeof S=="string"?yi(c,S):(typeof S=="number"||typeof S=="bigint")&&yi(c,""+S);break;case"onScroll":S!=null&&Tt("scroll",c);break;case"onScrollEnd":S!=null&&Tt("scrollend",c);break;case"onClick":S!=null&&(c.onclick=Ce);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vo.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(T=p.endsWith("Capture"),d=p.slice(2,T?p.length-7:void 0),_=c[Ar]||null,_=_!=null?_[p]:null,typeof _=="function"&&c.removeEventListener(d,_,T),typeof S=="function")){typeof _!="function"&&_!==null&&(p in c?c[p]=null:c.hasAttribute(p)&&c.removeAttribute(p)),c.addEventListener(d,S,T);break e}p in c?c[p]=S:S===!0?c.setAttribute(p,""):hl(c,p,S)}}}function Jr(c,d,p){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Tt("error",c),Tt("load",c);var S=!1,T=!1,_;for(_ in p)if(p.hasOwnProperty(_)){var D=p[_];if(D!=null)switch(_){case"src":S=!0;break;case"srcSet":T=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,d));default:tn(c,d,_,D,p,null)}}T&&tn(c,d,"srcSet",p.srcSet,p,null),S&&tn(c,d,"src",p.src,p,null);return;case"input":Tt("invalid",c);var L=_=D=T=null,Y=null,oe=null;for(S in p)if(p.hasOwnProperty(S)){var he=p[S];if(he!=null)switch(S){case"name":T=he;break;case"type":D=he;break;case"checked":Y=he;break;case"defaultChecked":oe=he;break;case"value":_=he;break;case"defaultValue":L=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,d));break;default:tn(c,d,S,he,p,null)}}Bu(c,_,L,Y,oe,D,T,!1);return;case"select":Tt("invalid",c),S=D=_=null;for(T in p)if(p.hasOwnProperty(T)&&(L=p[T],L!=null))switch(T){case"value":_=L;break;case"defaultValue":D=L;break;case"multiple":S=L;default:tn(c,d,T,L,p,null)}d=_,p=D,c.multiple=!!S,d!=null?na(c,!!S,d,!1):p!=null&&na(c,!!S,p,!0);return;case"textarea":Tt("invalid",c),_=T=S=null;for(D in p)if(p.hasOwnProperty(D)&&(L=p[D],L!=null))switch(D){case"value":S=L;break;case"defaultValue":T=L;break;case"children":_=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:tn(c,d,D,L,p,null)}pl(c,S,T,_);return;case"option":for(Y in p)if(p.hasOwnProperty(Y)&&(S=p[Y],S!=null))switch(Y){case"selected":c.selected=S&&typeof S!="function"&&typeof S!="symbol";break;default:tn(c,d,Y,S,p,null)}return;case"dialog":Tt("beforetoggle",c),Tt("toggle",c),Tt("cancel",c),Tt("close",c);break;case"iframe":case"object":Tt("load",c);break;case"video":case"audio":for(S=0;S<Kp.length;S++)Tt(Kp[S],c);break;case"image":Tt("error",c),Tt("load",c);break;case"details":Tt("toggle",c);break;case"embed":case"source":case"link":Tt("error",c),Tt("load",c);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(oe in p)if(p.hasOwnProperty(oe)&&(S=p[oe],S!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,d));default:tn(c,d,oe,S,p,null)}return;default:if(Uu(d)){for(he in p)p.hasOwnProperty(he)&&(S=p[he],S!==void 0&&U1(c,d,he,S,p,void 0));return}}for(L in p)p.hasOwnProperty(L)&&(S=p[L],S!=null&&tn(c,d,L,S,p,null))}function HX(c,d,p,S){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var T=null,_=null,D=null,L=null,Y=null,oe=null,he=null;for(ue in p){var Se=p[ue];if(p.hasOwnProperty(ue)&&Se!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":Y=Se;default:S.hasOwnProperty(ue)||tn(c,d,ue,null,S,Se)}}for(var ae in S){var ue=S[ae];if(Se=p[ae],S.hasOwnProperty(ae)&&(ue!=null||Se!=null))switch(ae){case"type":_=ue;break;case"name":T=ue;break;case"checked":oe=ue;break;case"defaultChecked":he=ue;break;case"value":D=ue;break;case"defaultValue":L=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,d));break;default:ue!==Se&&tn(c,d,ae,ue,S,Se)}}hc(c,D,L,Y,oe,he,_,T);return;case"select":ue=D=L=ae=null;for(_ in p)if(Y=p[_],p.hasOwnProperty(_)&&Y!=null)switch(_){case"value":break;case"multiple":ue=Y;default:S.hasOwnProperty(_)||tn(c,d,_,null,S,Y)}for(T in S)if(_=S[T],Y=p[T],S.hasOwnProperty(T)&&(_!=null||Y!=null))switch(T){case"value":ae=_;break;case"defaultValue":L=_;break;case"multiple":D=_;default:_!==Y&&tn(c,d,T,_,S,Y)}d=L,p=D,S=ue,ae!=null?na(c,!!p,ae,!1):!!S!=!!p&&(d!=null?na(c,!!p,d,!0):na(c,!!p,p?[]:"",!1));return;case"textarea":ue=ae=null;for(L in p)if(T=p[L],p.hasOwnProperty(L)&&T!=null&&!S.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:tn(c,d,L,null,S,T)}for(D in S)if(T=S[D],_=p[D],S.hasOwnProperty(D)&&(T!=null||_!=null))switch(D){case"value":ae=T;break;case"defaultValue":ue=T;break;case"children":break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:T!==_&&tn(c,d,D,T,S,_)}Fu(c,ae,ue);return;case"option":for(var Ue in p)if(ae=p[Ue],p.hasOwnProperty(Ue)&&ae!=null&&!S.hasOwnProperty(Ue))switch(Ue){case"selected":c.selected=!1;break;default:tn(c,d,Ue,null,S,ae)}for(Y in S)if(ae=S[Y],ue=p[Y],S.hasOwnProperty(Y)&&ae!==ue&&(ae!=null||ue!=null))switch(Y){case"selected":c.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:tn(c,d,Y,ae,S,ue)}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 et in p)ae=p[et],p.hasOwnProperty(et)&&ae!=null&&!S.hasOwnProperty(et)&&tn(c,d,et,null,S,ae);for(oe in S)if(ae=S[oe],ue=p[oe],S.hasOwnProperty(oe)&&ae!==ue&&(ae!=null||ue!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,d));break;default:tn(c,d,oe,ae,S,ue)}return;default:if(Uu(d)){for(var nn in p)ae=p[nn],p.hasOwnProperty(nn)&&ae!==void 0&&!S.hasOwnProperty(nn)&&U1(c,d,nn,void 0,S,ae);for(he in S)ae=S[he],ue=p[he],!S.hasOwnProperty(he)||ae===ue||ae===void 0&&ue===void 0||U1(c,d,he,ae,S,ue);return}}for(var re in p)ae=p[re],p.hasOwnProperty(re)&&ae!=null&&!S.hasOwnProperty(re)&&tn(c,d,re,null,S,ae);for(Se in S)ae=S[Se],ue=p[Se],!S.hasOwnProperty(Se)||ae===ue||ae==null&&ue==null||tn(c,d,Se,ae,S,ue)}function jD(c){switch(c){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $X(){if(typeof performance.getEntriesByType=="function"){for(var c=0,d=0,p=performance.getEntriesByType("resource"),S=0;S<p.length;S++){var T=p[S],_=T.transferSize,D=T.initiatorType,L=T.duration;if(_&&L&&jD(D)){for(D=0,L=T.responseEnd,S+=1;S<p.length;S++){var Y=p[S],oe=Y.startTime;if(oe>L)break;var he=Y.transferSize,Se=Y.initiatorType;he&&jD(Se)&&(Y=Y.responseEnd,D+=he*(Y<L?1:(L-oe)/(Y-oe)))}if(--S,d+=8*(_+D)/(T.duration/1e3),c++,10<c)break}}if(0<c)return d/c/1e6}return navigator.connection&&(c=navigator.connection.downlink,typeof c=="number")?c:5}var H1=null,$1=null;function bS(c){return c.nodeType===9?c:c.ownerDocument}function LD(c){switch(c){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ND(c,d){if(c===0)switch(d){case"svg":return 1;case"math":return 2;default:return 0}return c===1&&d==="foreignObject"?0:c}function K1(c,d){return c==="textarea"||c==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.children=="bigint"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var V1=null;function KX(){var c=window.event;return c&&c.type==="popstate"?c===V1?!1:(V1=c,!0):(V1=null,!1)}var zD=typeof setTimeout=="function"?setTimeout:void 0,VX=typeof clearTimeout=="function"?clearTimeout:void 0,BD=typeof Promise=="function"?Promise:void 0,qX=typeof queueMicrotask=="function"?queueMicrotask:typeof BD<"u"?function(c){return BD.resolve(null).then(c).catch(GX)}:zD;function GX(c){setTimeout(function(){throw c})}function Mc(c){return c==="head"}function FD(c,d){var p=d,S=0;do{var T=p.nextSibling;if(c.removeChild(p),T&&T.nodeType===8)if(p=T.data,p==="/$"||p==="/&"){if(S===0){c.removeChild(T),Lh(d);return}S--}else if(p==="$"||p==="$?"||p==="$~"||p==="$!"||p==="&")S++;else if(p==="html")qp(c.ownerDocument.documentElement);else if(p==="head"){p=c.ownerDocument.head,qp(p);for(var _=p.firstChild;_;){var D=_.nextSibling,L=_.nodeName;_[ul]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&_.rel.toLowerCase()==="stylesheet"||p.removeChild(_),_=D}}else p==="body"&&qp(c.ownerDocument.body);p=T}while(p);Lh(d)}function UD(c,d){var p=c;c=0;do{var S=p.nextSibling;if(p.nodeType===1?d?(p._stashedDisplay=p.style.display,p.style.display="none"):(p.style.display=p._stashedDisplay||"",p.getAttribute("style")===""&&p.removeAttribute("style")):p.nodeType===3&&(d?(p._stashedText=p.nodeValue,p.nodeValue=""):p.nodeValue=p._stashedText||""),S&&S.nodeType===8)if(p=S.data,p==="/$"){if(c===0)break;c--}else p!=="$"&&p!=="$?"&&p!=="$~"&&p!=="$!"||c++;p=S}while(p)}function q1(c){var d=c.firstChild;for(d&&d.nodeType===10&&(d=d.nextSibling);d;){var p=d;switch(d=d.nextSibling,p.nodeName){case"HTML":case"HEAD":case"BODY":q1(p),ps(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}c.removeChild(p)}}function YX(c,d,p,S){for(;c.nodeType===1;){var T=p;if(c.nodeName.toLowerCase()!==d.toLowerCase()){if(!S&&(c.nodeName!=="INPUT"||c.type!=="hidden"))break}else if(S){if(!c[ul])switch(d){case"meta":if(!c.hasAttribute("itemprop"))break;return c;case"link":if(_=c.getAttribute("rel"),_==="stylesheet"&&c.hasAttribute("data-precedence"))break;if(_!==T.rel||c.getAttribute("href")!==(T.href==null||T.href===""?null:T.href)||c.getAttribute("crossorigin")!==(T.crossOrigin==null?null:T.crossOrigin)||c.getAttribute("title")!==(T.title==null?null:T.title))break;return c;case"style":if(c.hasAttribute("data-precedence"))break;return c;case"script":if(_=c.getAttribute("src"),(_!==(T.src==null?null:T.src)||c.getAttribute("type")!==(T.type==null?null:T.type)||c.getAttribute("crossorigin")!==(T.crossOrigin==null?null:T.crossOrigin))&&_&&c.hasAttribute("async")&&!c.hasAttribute("itemprop"))break;return c;default:return c}}else if(d==="input"&&c.type==="hidden"){var _=T.name==null?null:""+T.name;if(T.type==="hidden"&&c.getAttribute("name")===_)return c}else return c;if(c=ko(c.nextSibling),c===null)break}return null}function WX(c,d,p){if(d==="")return null;for(;c.nodeType!==3;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!p||(c=ko(c.nextSibling),c===null))return null;return c}function HD(c,d){for(;c.nodeType!==8;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!d||(c=ko(c.nextSibling),c===null))return null;return c}function G1(c){return c.data==="$?"||c.data==="$~"}function Y1(c){return c.data==="$!"||c.data==="$?"&&c.ownerDocument.readyState!=="loading"}function XX(c,d){var p=c.ownerDocument;if(c.data==="$~")c._reactRetry=d;else if(c.data!=="$?"||p.readyState!=="loading")d();else{var S=function(){d(),p.removeEventListener("DOMContentLoaded",S)};p.addEventListener("DOMContentLoaded",S),c._reactRetry=S}}function ko(c){for(;c!=null;c=c.nextSibling){var d=c.nodeType;if(d===1||d===3)break;if(d===8){if(d=c.data,d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"||d==="F!"||d==="F")break;if(d==="/$"||d==="/&")return null}}return c}var W1=null;function $D(c){c=c.nextSibling;for(var d=0;c;){if(c.nodeType===8){var p=c.data;if(p==="/$"||p==="/&"){if(d===0)return ko(c.nextSibling);d--}else p!=="$"&&p!=="$!"&&p!=="$?"&&p!=="$~"&&p!=="&"||d++}c=c.nextSibling}return null}function KD(c){c=c.previousSibling;for(var d=0;c;){if(c.nodeType===8){var p=c.data;if(p==="$"||p==="$!"||p==="$?"||p==="$~"||p==="&"){if(d===0)return c;d--}else p!=="/$"&&p!=="/&"||d++}c=c.previousSibling}return null}function VD(c,d,p){switch(d=bS(p),c){case"html":if(c=d.documentElement,!c)throw Error(r(452));return c;case"head":if(c=d.head,!c)throw Error(r(453));return c;case"body":if(c=d.body,!c)throw Error(r(454));return c;default:throw Error(r(451))}}function qp(c){for(var d=c.attributes;d.length;)c.removeAttributeNode(d[0]);ps(c)}var Mo=new Map,qD=new Set;function vS(c){return typeof c.getRootNode=="function"?c.getRootNode():c.nodeType===9?c:c.ownerDocument}var Ml=G.d;G.d={f:ZX,r:JX,D:QX,C:eZ,L:tZ,m:nZ,X:iZ,S:rZ,M:sZ};function ZX(){var c=Ml.f(),d=dS();return c||d}function JX(c){var d=Ca(c);d!==null&&d.tag===5&&d.type==="form"?cO(d):Ml.r(c)}var Dh=typeof document>"u"?null:document;function GD(c,d,p){var S=Dh;if(S&&typeof d=="string"&&d){var T=zn(d);T='link[rel="'+c+'"][href="'+T+'"]',typeof p=="string"&&(T+='[crossorigin="'+p+'"]'),qD.has(T)||(qD.add(T),c={rel:c,crossOrigin:p,href:d},S.querySelector(T)===null&&(d=S.createElement("link"),Jr(d,"link",c),Ln(d),S.head.appendChild(d)))}}function QX(c){Ml.D(c),GD("dns-prefetch",c,null)}function eZ(c,d){Ml.C(c,d),GD("preconnect",c,d)}function tZ(c,d,p){Ml.L(c,d,p);var S=Dh;if(S&&c&&d){var T='link[rel="preload"][as="'+zn(d)+'"]';d==="image"&&p&&p.imageSrcSet?(T+='[imagesrcset="'+zn(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(T+='[imagesizes="'+zn(p.imageSizes)+'"]')):T+='[href="'+zn(c)+'"]';var _=T;switch(d){case"style":_=Rh(c);break;case"script":_=jh(c)}Mo.has(_)||(c=h({rel:"preload",href:d==="image"&&p&&p.imageSrcSet?void 0:c,as:d},p),Mo.set(_,c),S.querySelector(T)!==null||d==="style"&&S.querySelector(Gp(_))||d==="script"&&S.querySelector(Yp(_))||(d=S.createElement("link"),Jr(d,"link",c),Ln(d),S.head.appendChild(d)))}}function nZ(c,d){Ml.m(c,d);var p=Dh;if(p&&c){var S=d&&typeof d.as=="string"?d.as:"script",T='link[rel="modulepreload"][as="'+zn(S)+'"][href="'+zn(c)+'"]',_=T;switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=jh(c)}if(!Mo.has(_)&&(c=h({rel:"modulepreload",href:c},d),Mo.set(_,c),p.querySelector(T)===null)){switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Yp(_)))return}S=p.createElement("link"),Jr(S,"link",c),Ln(S),p.head.appendChild(S)}}}function rZ(c,d,p){Ml.S(c,d,p);var S=Dh;if(S&&c){var T=Ta(S).hoistableStyles,_=Rh(c);d=d||"default";var D=T.get(_);if(!D){var L={loading:0,preload:null};if(D=S.querySelector(Gp(_)))L.loading=5;else{c=h({rel:"stylesheet",href:c,"data-precedence":d},p),(p=Mo.get(_))&&X1(c,p);var Y=D=S.createElement("link");Ln(Y),Jr(Y,"link",c),Y._p=new Promise(function(oe,he){Y.onload=oe,Y.onerror=he}),Y.addEventListener("load",function(){L.loading|=1}),Y.addEventListener("error",function(){L.loading|=2}),L.loading|=4,xS(D,d,S)}D={type:"stylesheet",instance:D,count:1,state:L},T.set(_,D)}}}function iZ(c,d){Ml.X(c,d);var p=Dh;if(p&&c){var S=Ta(p).hoistableScripts,T=jh(c),_=S.get(T);_||(_=p.querySelector(Yp(T)),_||(c=h({src:c,async:!0},d),(d=Mo.get(T))&&Z1(c,d),_=p.createElement("script"),Ln(_),Jr(_,"link",c),p.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},S.set(T,_))}}function sZ(c,d){Ml.M(c,d);var p=Dh;if(p&&c){var S=Ta(p).hoistableScripts,T=jh(c),_=S.get(T);_||(_=p.querySelector(Yp(T)),_||(c=h({src:c,async:!0,type:"module"},d),(d=Mo.get(T))&&Z1(c,d),_=p.createElement("script"),Ln(_),Jr(_,"link",c),p.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},S.set(T,_))}}function YD(c,d,p,S){var T=(T=_e.current)?vS(T):null;if(!T)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(d=Rh(p.href),p=Ta(T).hoistableStyles,S=p.get(d),S||(S={type:"style",instance:null,count:0,state:null},p.set(d,S)),S):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){c=Rh(p.href);var _=Ta(T).hoistableStyles,D=_.get(c);if(D||(T=T.ownerDocument||T,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(c,D),(_=T.querySelector(Gp(c)))&&!_._p&&(D.instance=_,D.state.loading=5),Mo.has(c)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},Mo.set(c,p),_||oZ(T,c,p,D.state))),d&&S===null)throw Error(r(528,""));return D}if(d&&S!==null)throw Error(r(529,""));return null;case"script":return d=p.async,p=p.src,typeof p=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=jh(p),p=Ta(T).hoistableScripts,S=p.get(d),S||(S={type:"script",instance:null,count:0,state:null},p.set(d,S)),S):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function Rh(c){return'href="'+zn(c)+'"'}function Gp(c){return'link[rel="stylesheet"]['+c+"]"}function WD(c){return h({},c,{"data-precedence":c.precedence,precedence:null})}function oZ(c,d,p,S){c.querySelector('link[rel="preload"][as="style"]['+d+"]")?S.loading=1:(d=c.createElement("link"),S.preload=d,d.addEventListener("load",function(){return S.loading|=1}),d.addEventListener("error",function(){return S.loading|=2}),Jr(d,"link",p),Ln(d),c.head.appendChild(d))}function jh(c){return'[src="'+zn(c)+'"]'}function Yp(c){return"script[async]"+c}function XD(c,d,p){if(d.count++,d.instance===null)switch(d.type){case"style":var S=c.querySelector('style[data-href~="'+zn(p.href)+'"]');if(S)return d.instance=S,Ln(S),S;var T=h({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return S=(c.ownerDocument||c).createElement("style"),Ln(S),Jr(S,"style",T),xS(S,p.precedence,c),d.instance=S;case"stylesheet":T=Rh(p.href);var _=c.querySelector(Gp(T));if(_)return d.state.loading|=4,d.instance=_,Ln(_),_;S=WD(p),(T=Mo.get(T))&&X1(S,T),_=(c.ownerDocument||c).createElement("link"),Ln(_);var D=_;return D._p=new Promise(function(L,Y){D.onload=L,D.onerror=Y}),Jr(_,"link",S),d.state.loading|=4,xS(_,p.precedence,c),d.instance=_;case"script":return _=jh(p.src),(T=c.querySelector(Yp(_)))?(d.instance=T,Ln(T),T):(S=p,(T=Mo.get(_))&&(S=h({},p),Z1(S,T)),c=c.ownerDocument||c,T=c.createElement("script"),Ln(T),Jr(T,"link",S),c.head.appendChild(T),d.instance=T);case"void":return null;default:throw Error(r(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(S=d.instance,d.state.loading|=4,xS(S,p.precedence,c));return d.instance}function xS(c,d,p){for(var S=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),T=S.length?S[S.length-1]:null,_=T,D=0;D<S.length;D++){var L=S[D];if(L.dataset.precedence===d)_=L;else if(_!==T)break}_?_.parentNode.insertBefore(c,_.nextSibling):(d=p.nodeType===9?p.head:p,d.insertBefore(c,d.firstChild))}function X1(c,d){c.crossOrigin==null&&(c.crossOrigin=d.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=d.referrerPolicy),c.title==null&&(c.title=d.title)}function Z1(c,d){c.crossOrigin==null&&(c.crossOrigin=d.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=d.referrerPolicy),c.integrity==null&&(c.integrity=d.integrity)}var wS=null;function ZD(c,d,p){if(wS===null){var S=new Map,T=wS=new Map;T.set(p,S)}else T=wS,S=T.get(p),S||(S=new Map,T.set(p,S));if(S.has(c))return S;for(S.set(c,null),p=p.getElementsByTagName(c),T=0;T<p.length;T++){var _=p[T];if(!(_[ul]||_[Zn]||c==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var D=_.getAttribute(d)||"";D=c+D;var L=S.get(D);L?L.push(_):S.set(D,[_])}}return S}function JD(c,d,p){c=c.ownerDocument||c,c.head.insertBefore(p,d==="title"?c.querySelector("head > title"):null)}function aZ(c,d,p){if(p===1||d.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;switch(d.rel){case"stylesheet":return c=d.disabled,typeof d.precedence=="string"&&c==null;default:return!0}case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function QD(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function lZ(c,d,p,S){if(p.type==="stylesheet"&&(typeof S.media!="string"||matchMedia(S.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var T=Rh(S.href),_=d.querySelector(Gp(T));if(_){d=_._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(c.count++,c=CS.bind(c),d.then(c,c)),p.state.loading|=4,p.instance=_,Ln(_);return}_=d.ownerDocument||d,S=WD(S),(T=Mo.get(T))&&X1(S,T),_=_.createElement("link"),Ln(_);var D=_;D._p=new Promise(function(L,Y){D.onload=L,D.onerror=Y}),Jr(_,"link",S),p.instance=_}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(p,d),(d=p.state.preload)&&(p.state.loading&3)===0&&(c.count++,p=CS.bind(c),d.addEventListener("load",p),d.addEventListener("error",p))}}var J1=0;function cZ(c,d){return c.stylesheets&&c.count===0&&ES(c,c.stylesheets),0<c.count||0<c.imgCount?function(p){var S=setTimeout(function(){if(c.stylesheets&&ES(c,c.stylesheets),c.unsuspend){var _=c.unsuspend;c.unsuspend=null,_()}},6e4+d);0<c.imgBytes&&J1===0&&(J1=62500*$X());var T=setTimeout(function(){if(c.waitingForImages=!1,c.count===0&&(c.stylesheets&&ES(c,c.stylesheets),c.unsuspend)){var _=c.unsuspend;c.unsuspend=null,_()}},(c.imgBytes>J1?50:800)+d);return c.unsuspend=p,function(){c.unsuspend=null,clearTimeout(S),clearTimeout(T)}}:null}function CS(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ES(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var TS=null;function ES(c,d){c.stylesheets=null,c.unsuspend!==null&&(c.count++,TS=new Map,d.forEach(uZ,c),TS=null,CS.call(c))}function uZ(c,d){if(!(d.state.loading&4)){var p=TS.get(c);if(p)var S=p.get(null);else{p=new Map,TS.set(c,p);for(var T=c.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<T.length;_++){var D=T[_];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(p.set(D.dataset.precedence,D),S=D)}S&&p.set(null,S)}T=d.instance,D=T.getAttribute("data-precedence"),_=p.get(D)||S,_===S&&p.set(null,T),p.set(D,T),this.count++,S=CS.bind(this),T.addEventListener("load",S),T.addEventListener("error",S),_?_.parentNode.insertBefore(T,_.nextSibling):(c=c.nodeType===9?c.head:c,c.insertBefore(T,c.firstChild)),d.state.loading|=4}}var Wp={$$typeof:P,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function dZ(c,d,p,S,T,_,D,L,Y){this.tag=1,this.containerInfo=c,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=Jo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jo(0),this.hiddenUpdates=Jo(null),this.identifierPrefix=S,this.onUncaughtError=T,this.onCaughtError=_,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function eR(c,d,p,S,T,_,D,L,Y,oe,he,Se){return c=new dZ(c,d,p,D,Y,oe,he,Se,L),d=1,_===!0&&(d|=24),_=Ks(3,null,null,d),c.current=_,_.stateNode=c,d=Aw(),d.refCount++,c.pooledCache=d,d.refCount++,_.memoizedState={element:S,isDehydrated:p,cache:d},jw(_),c}function tR(c){return c?(c=hh,c):hh}function nR(c,d,p,S,T,_){T=tR(T),S.context===null?S.context=T:S.pendingContext=T,S=bc(d),S.payload={element:p},_=_===void 0?null:_,_!==null&&(S.callback=_),p=vc(c,S,d),p!==null&&(ws(p,c,d),Pp(p,c,d))}function rR(c,d){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var p=c.retryLane;c.retryLane=p!==0&&p<d?p:d}}function Q1(c,d){rR(c,d),(c=c.alternate)&&rR(c,d)}function iR(c){if(c.tag===13||c.tag===31){var d=Ku(c,67108864);d!==null&&ws(d,c,67108864),Q1(c,67108864)}}function sR(c){if(c.tag===13||c.tag===31){var d=Ws();d=ac(d);var p=Ku(c,d);p!==null&&ws(p,c,d),Q1(c,d)}}var _S=!0;function hZ(c,d,p,S){var T=B.T;B.T=null;var _=G.p;try{G.p=2,eC(c,d,p,S)}finally{G.p=_,B.T=T}}function fZ(c,d,p,S){var T=B.T;B.T=null;var _=G.p;try{G.p=8,eC(c,d,p,S)}finally{G.p=_,B.T=T}}function eC(c,d,p,S){if(_S){var T=tC(S);if(T===null)F1(c,d,S,PS,p),aR(c,S);else if(gZ(T,c,d,p,S))S.stopPropagation();else if(aR(c,S),d&4&&-1<pZ.indexOf(c)){for(;T!==null;){var _=Ca(T);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var D=Ns(_.pendingLanes);if(D!==0){var L=_;for(L.pendingLanes|=2,L.entangledLanes|=2;D;){var Y=1<<31-An(D);L.entanglements[1]|=Y,D&=~Y}ka(_),($t&6)===0&&(cS=dr()+500,$p(0))}}break;case 31:case 13:L=Ku(_,2),L!==null&&ws(L,_,2),dS(),Q1(_,2)}if(_=tC(S),_===null&&F1(c,d,S,PS,p),_===T)break;T=_}T!==null&&S.stopPropagation()}else F1(c,d,S,null,p)}}function tC(c){return c=Jt(c),nC(c)}var PS=null;function nC(c){if(PS=null,c=gi(c),c!==null){var d=s(c);if(d===null)c=null;else{var p=d.tag;if(p===13){if(c=o(d),c!==null)return c;c=null}else if(p===31){if(c=a(d),c!==null)return c;c=null}else if(p===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;c=null}else d!==c&&(c=null)}}return PS=c,null}function oR(c){switch(c){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Fi()){case So:return 2;case Xo:return 8;case us:case al:return 32;case ce:return 268435456;default:return 32}default:return 32}}var rC=!1,Ac=null,Oc=null,Dc=null,Xp=new Map,Zp=new Map,Rc=[],pZ="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 aR(c,d){switch(c){case"focusin":case"focusout":Ac=null;break;case"dragenter":case"dragleave":Oc=null;break;case"mouseover":case"mouseout":Dc=null;break;case"pointerover":case"pointerout":Xp.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zp.delete(d.pointerId)}}function Jp(c,d,p,S,T,_){return c===null||c.nativeEvent!==_?(c={blockedOn:d,domEventName:p,eventSystemFlags:S,nativeEvent:_,targetContainers:[T]},d!==null&&(d=Ca(d),d!==null&&iR(d)),c):(c.eventSystemFlags|=S,d=c.targetContainers,T!==null&&d.indexOf(T)===-1&&d.push(T),c)}function gZ(c,d,p,S,T){switch(d){case"focusin":return Ac=Jp(Ac,c,d,p,S,T),!0;case"dragenter":return Oc=Jp(Oc,c,d,p,S,T),!0;case"mouseover":return Dc=Jp(Dc,c,d,p,S,T),!0;case"pointerover":var _=T.pointerId;return Xp.set(_,Jp(Xp.get(_)||null,c,d,p,S,T)),!0;case"gotpointercapture":return _=T.pointerId,Zp.set(_,Jp(Zp.get(_)||null,c,d,p,S,T)),!0}return!1}function lR(c){var d=gi(c.target);if(d!==null){var p=s(d);if(p!==null){if(d=p.tag,d===13){if(d=o(p),d!==null){c.blockedOn=d,Qd(c.priority,function(){sR(p)});return}}else if(d===31){if(d=a(p),d!==null){c.blockedOn=d,Qd(c.priority,function(){sR(p)});return}}else if(d===3&&p.stateNode.current.memoizedState.isDehydrated){c.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}c.blockedOn=null}function IS(c){if(c.blockedOn!==null)return!1;for(var d=c.targetContainers;0<d.length;){var p=tC(c.nativeEvent);if(p===null){p=c.nativeEvent;var S=new p.constructor(p.type,p);ze=S,p.target.dispatchEvent(S),ze=null}else return d=Ca(p),d!==null&&iR(d),c.blockedOn=p,!1;d.shift()}return!0}function cR(c,d,p){IS(c)&&p.delete(d)}function mZ(){rC=!1,Ac!==null&&IS(Ac)&&(Ac=null),Oc!==null&&IS(Oc)&&(Oc=null),Dc!==null&&IS(Dc)&&(Dc=null),Xp.forEach(cR),Zp.forEach(cR)}function kS(c,d){c.blockedOn===d&&(c.blockedOn=null,rC||(rC=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,mZ)))}var MS=null;function uR(c){MS!==c&&(MS=c,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){MS===c&&(MS=null);for(var d=0;d<c.length;d+=3){var p=c[d],S=c[d+1],T=c[d+2];if(typeof S!="function"){if(nC(S||p)===null)continue;break}var _=Ca(p);_!==null&&(c.splice(d,3),d-=3,t1(_,{pending:!0,data:T,method:p.method,action:S},S,T))}}))}function Lh(c){function d(Y){return kS(Y,c)}Ac!==null&&kS(Ac,c),Oc!==null&&kS(Oc,c),Dc!==null&&kS(Dc,c),Xp.forEach(d),Zp.forEach(d);for(var p=0;p<Rc.length;p++){var S=Rc[p];S.blockedOn===c&&(S.blockedOn=null)}for(;0<Rc.length&&(p=Rc[0],p.blockedOn===null);)lR(p),p.blockedOn===null&&Rc.shift();if(p=(c.ownerDocument||c).$$reactFormReplay,p!=null)for(S=0;S<p.length;S+=3){var T=p[S],_=p[S+1],D=T[Ar]||null;if(typeof _=="function")D||uR(p);else if(D){var L=null;if(_&&_.hasAttribute("formAction")){if(T=_,D=_[Ar]||null)L=D.formAction;else if(nC(T)!==null)continue}else L=D.action;typeof L=="function"?p[S+1]=L:(p.splice(S,3),S-=3),uR(p)}}}function dR(){function c(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(D){return T=D})},focusReset:"manual",scroll:"manual"})}function d(){T!==null&&(T(),T=null),S||setTimeout(p,20)}function p(){if(!S&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var S=!1,T=null;return navigation.addEventListener("navigate",c),navigation.addEventListener("navigatesuccess",d),navigation.addEventListener("navigateerror",d),setTimeout(p,100),function(){S=!0,navigation.removeEventListener("navigate",c),navigation.removeEventListener("navigatesuccess",d),navigation.removeEventListener("navigateerror",d),T!==null&&(T(),T=null)}}}function iC(c){this._internalRoot=c}AS.prototype.render=iC.prototype.render=function(c){var d=this._internalRoot;if(d===null)throw Error(r(409));var p=d.current,S=Ws();nR(p,S,c,d,null,null)},AS.prototype.unmount=iC.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var d=c.containerInfo;nR(c.current,2,null,c,null,null),dS(),d[wa]=null}};function AS(c){this._internalRoot=c}AS.prototype.unstable_scheduleHydration=function(c){if(c){var d=bo();c={blockedOn:null,target:c,priority:d};for(var p=0;p<Rc.length&&d!==0&&d<Rc[p].priority;p++);Rc.splice(p,0,c),p===0&&lR(c)}};var hR=e.version;if(hR!=="19.2.1")throw Error(r(527,hR,"19.2.1"));G.findDOMNode=function(c){var d=c._reactInternals;if(d===void 0)throw typeof c.render=="function"?Error(r(188)):(c=Object.keys(c).join(","),Error(r(268,c)));return c=u(d),c=c!==null?f(c):null,c=c===null?null:c.stateNode,c};var yZ={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var OS=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!OS.isDisabled&&OS.supportsFiber)try{At=OS.inject(yZ),qt=OS}catch{}}return eg.createRoot=function(c,d){if(!i(c))throw Error(r(299));var p=!1,S="",T=bO,_=vO,D=xO;return d!=null&&(d.unstable_strictMode===!0&&(p=!0),d.identifierPrefix!==void 0&&(S=d.identifierPrefix),d.onUncaughtError!==void 0&&(T=d.onUncaughtError),d.onCaughtError!==void 0&&(_=d.onCaughtError),d.onRecoverableError!==void 0&&(D=d.onRecoverableError)),d=eR(c,1,!1,null,null,p,S,null,T,_,D,dR),c[wa]=d.current,B1(c),new iC(d)},eg.hydrateRoot=function(c,d,p){if(!i(c))throw Error(r(299));var S=!1,T="",_=bO,D=vO,L=xO,Y=null;return p!=null&&(p.unstable_strictMode===!0&&(S=!0),p.identifierPrefix!==void 0&&(T=p.identifierPrefix),p.onUncaughtError!==void 0&&(_=p.onUncaughtError),p.onCaughtError!==void 0&&(D=p.onCaughtError),p.onRecoverableError!==void 0&&(L=p.onRecoverableError),p.formState!==void 0&&(Y=p.formState)),d=eR(c,1,!0,d,p??null,S,T,Y,_,D,L,dR),d.context=tR(null),p=d.current,S=Ws(),S=ac(S),T=bc(S),T.callback=null,vc(p,T,S),p=S,d.current.lanes=p,ll(d,p),ka(d),c[wa]=d.current,B1(c),new AS(d)},eg.version="19.2.1",eg}var wR;function PZ(){if(wR)return aC.exports;wR=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),aC.exports=_Z(),aC.exports}var DB=PZ();const IZ=Ja(DB);function Ie(t,e={}){const n=typeof t=="string"?t:t.src;if(typeof e=="function")return e(n);const{baseUrl:r=""}=e;return n.startsWith("data:")||n.match(/^https?:\/\//)?n:`${r.replace(/\/$/,"")}/${n.replace(/^\.?\//,"")}`}function kZ(t){const e=Ie("./icons/icon/0_merged.svg",t);return{fonts:{tldraw_mono_bold:Ie("./fonts/IBMPlexMono-Bold.woff2",t),tldraw_mono_italic_bold:Ie("./fonts/IBMPlexMono-BoldItalic.woff2",t),tldraw_mono:Ie("./fonts/IBMPlexMono-Medium.woff2",t),tldraw_mono_italic:Ie("./fonts/IBMPlexMono-MediumItalic.woff2",t),tldraw_sans_bold:Ie("./fonts/IBMPlexSans-Bold.woff2",t),tldraw_sans_italic_bold:Ie("./fonts/IBMPlexSans-BoldItalic.woff2",t),tldraw_sans:Ie("./fonts/IBMPlexSans-Medium.woff2",t),tldraw_sans_italic:Ie("./fonts/IBMPlexSans-MediumItalic.woff2",t),tldraw_serif_bold:Ie("./fonts/IBMPlexSerif-Bold.woff2",t),tldraw_serif_italic_bold:Ie("./fonts/IBMPlexSerif-BoldItalic.woff2",t),tldraw_serif:Ie("./fonts/IBMPlexSerif-Medium.woff2",t),tldraw_serif_italic:Ie("./fonts/IBMPlexSerif-MediumItalic.woff2",t),tldraw_draw_bold:Ie("./fonts/Shantell_Sans-Informal_Bold.woff2",t),tldraw_draw_italic_bold:Ie("./fonts/Shantell_Sans-Informal_Bold_Italic.woff2",t),tldraw_draw:Ie("./fonts/Shantell_Sans-Informal_Regular.woff2",t),tldraw_draw_italic:Ie("./fonts/Shantell_Sans-Informal_Regular_Italic.woff2",t)},icons:{"align-bottom":e+"#align-bottom","align-center-horizontal":e+"#align-center-horizontal","align-center-vertical":e+"#align-center-vertical","align-left":e+"#align-left","align-right":e+"#align-right","align-top":e+"#align-top",alt:e+"#alt","arrow-arc":e+"#arrow-arc","arrow-cycle":e+"#arrow-cycle","arrow-elbow":e+"#arrow-elbow","arrow-left":e+"#arrow-left","arrowhead-arrow":e+"#arrowhead-arrow","arrowhead-bar":e+"#arrowhead-bar","arrowhead-diamond":e+"#arrowhead-diamond","arrowhead-dot":e+"#arrowhead-dot","arrowhead-none":e+"#arrowhead-none","arrowhead-square":e+"#arrowhead-square","arrowhead-triangle-inverted":e+"#arrowhead-triangle-inverted","arrowhead-triangle":e+"#arrowhead-triangle",blob:e+"#blob",bold:e+"#bold",bookmark:e+"#bookmark","bring-forward":e+"#bring-forward","bring-to-front":e+"#bring-to-front",broken:e+"#broken",bulletList:e+"#bulletList","check-circle":e+"#check-circle",check:e+"#check","chevron-down":e+"#chevron-down","chevron-left":e+"#chevron-left","chevron-right":e+"#chevron-right","chevron-up":e+"#chevron-up","chevrons-ne":e+"#chevrons-ne","chevrons-sw":e+"#chevrons-sw","clipboard-copied":e+"#clipboard-copied","clipboard-copy":e+"#clipboard-copy",code:e+"#code",color:e+"#color",comment:e+"#comment",corners:e+"#corners",crop:e+"#crop","cross-2":e+"#cross-2","cross-circle":e+"#cross-circle","dash-dashed":e+"#dash-dashed","dash-dotted":e+"#dash-dotted","dash-draw":e+"#dash-draw","dash-solid":e+"#dash-solid",disconnected:e+"#disconnected",discord:e+"#discord","distribute-horizontal":e+"#distribute-horizontal","distribute-vertical":e+"#distribute-vertical",dot:e+"#dot","dots-horizontal":e+"#dots-horizontal","dots-vertical":e+"#dots-vertical",download:e+"#download","drag-handle-dots":e+"#drag-handle-dots",duplicate:e+"#duplicate",edit:e+"#edit","external-link":e+"#external-link","fill-fill":e+"#fill-fill","fill-none":e+"#fill-none","fill-pattern":e+"#fill-pattern","fill-semi":e+"#fill-semi","fill-solid":e+"#fill-solid",follow:e+"#follow",following:e+"#following","font-draw":e+"#font-draw","font-mono":e+"#font-mono","font-sans":e+"#font-sans","font-serif":e+"#font-serif","geo-arrow-down":e+"#geo-arrow-down","geo-arrow-left":e+"#geo-arrow-left","geo-arrow-right":e+"#geo-arrow-right","geo-arrow-up":e+"#geo-arrow-up","geo-check-box":e+"#geo-check-box","geo-cloud":e+"#geo-cloud","geo-diamond":e+"#geo-diamond","geo-ellipse":e+"#geo-ellipse","geo-heart":e+"#geo-heart","geo-hexagon":e+"#geo-hexagon","geo-octagon":e+"#geo-octagon","geo-oval":e+"#geo-oval","geo-pentagon":e+"#geo-pentagon","geo-rectangle":e+"#geo-rectangle","geo-rhombus-2":e+"#geo-rhombus-2","geo-rhombus":e+"#geo-rhombus","geo-star":e+"#geo-star","geo-trapezoid":e+"#geo-trapezoid","geo-triangle":e+"#geo-triangle","geo-x-box":e+"#geo-x-box",github:e+"#github",group:e+"#group",heading:e+"#heading","help-circle":e+"#help-circle",highlight:e+"#highlight","horizontal-align-end":e+"#horizontal-align-end","horizontal-align-middle":e+"#horizontal-align-middle","horizontal-align-start":e+"#horizontal-align-start","info-circle":e+"#info-circle",italic:e+"#italic",leading:e+"#leading",link:e+"#link",list:e+"#list",lock:e+"#lock",manual:e+"#manual",menu:e+"#menu",minus:e+"#minus",mixed:e+"#mixed",pack:e+"#pack",plus:e+"#plus","question-mark-circle":e+"#question-mark-circle","question-mark":e+"#question-mark",redo:e+"#redo","reset-zoom":e+"#reset-zoom","rotate-ccw":e+"#rotate-ccw","rotate-cw":e+"#rotate-cw","send-backward":e+"#send-backward","send-to-back":e+"#send-to-back","share-1":e+"#share-1","size-extra-large":e+"#size-extra-large","size-large":e+"#size-large","size-medium":e+"#size-medium","size-small":e+"#size-small","spline-cubic":e+"#spline-cubic","spline-line":e+"#spline-line","stack-horizontal":e+"#stack-horizontal","stack-vertical":e+"#stack-vertical","status-offline":e+"#status-offline","stretch-horizontal":e+"#stretch-horizontal","stretch-vertical":e+"#stretch-vertical",strike:e+"#strike","text-align-center":e+"#text-align-center","text-align-left":e+"#text-align-left","text-align-right":e+"#text-align-right","toggle-off":e+"#toggle-off","toggle-on":e+"#toggle-on","tool-arrow":e+"#tool-arrow","tool-eraser":e+"#tool-eraser","tool-frame":e+"#tool-frame","tool-hand":e+"#tool-hand","tool-highlight":e+"#tool-highlight","tool-laser":e+"#tool-laser","tool-line":e+"#tool-line","tool-media":e+"#tool-media","tool-note":e+"#tool-note","tool-pencil":e+"#tool-pencil","tool-pointer":e+"#tool-pointer","tool-screenshot":e+"#tool-screenshot","tool-text":e+"#tool-text",trash:e+"#trash",twitter:e+"#twitter",underline:e+"#underline",undo:e+"#undo",ungroup:e+"#ungroup",unlock:e+"#unlock","vertical-align-end":e+"#vertical-align-end","vertical-align-middle":e+"#vertical-align-middle","vertical-align-start":e+"#vertical-align-start","warning-triangle":e+"#warning-triangle","zoom-in":e+"#zoom-in","zoom-out":e+"#zoom-out"},translations:{ar:Ie("./translations/ar.json",t),bn:Ie("./translations/bn.json",t),ca:Ie("./translations/ca.json",t),cs:Ie("./translations/cs.json",t),da:Ie("./translations/da.json",t),de:Ie("./translations/de.json",t),el:Ie("./translations/el.json",t),en:Ie("./translations/en.json",t),es:Ie("./translations/es.json",t),fa:Ie("./translations/fa.json",t),fi:Ie("./translations/fi.json",t),fr:Ie("./translations/fr.json",t),gl:Ie("./translations/gl.json",t),"gu-in":Ie("./translations/gu-in.json",t),he:Ie("./translations/he.json",t),"hi-in":Ie("./translations/hi-in.json",t),hr:Ie("./translations/hr.json",t),hu:Ie("./translations/hu.json",t),id:Ie("./translations/id.json",t),it:Ie("./translations/it.json",t),ja:Ie("./translations/ja.json",t),"km-kh":Ie("./translations/km-kh.json",t),kn:Ie("./translations/kn.json",t),"ko-kr":Ie("./translations/ko-kr.json",t),ku:Ie("./translations/ku.json",t),languages:Ie("./translations/languages.json",t),main:Ie("./translations/main.json",t),ml:Ie("./translations/ml.json",t),mr:Ie("./translations/mr.json",t),ms:Ie("./translations/ms.json",t),my:Ie("./translations/my.json",t),ne:Ie("./translations/ne.json",t),nl:Ie("./translations/nl.json",t),no:Ie("./translations/no.json",t),pa:Ie("./translations/pa.json",t),pl:Ie("./translations/pl.json",t),"pt-br":Ie("./translations/pt-br.json",t),"pt-pt":Ie("./translations/pt-pt.json",t),ro:Ie("./translations/ro.json",t),ru:Ie("./translations/ru.json",t),sl:Ie("./translations/sl.json",t),so:Ie("./translations/so.json",t),sv:Ie("./translations/sv.json",t),ta:Ie("./translations/ta.json",t),te:Ie("./translations/te.json",t),th:Ie("./translations/th.json",t),tl:Ie("./translations/tl.json",t),tr:Ie("./translations/tr.json",t),uk:Ie("./translations/uk.json",t),ur:Ie("./translations/ur.json",t),vi:Ie("./translations/vi.json",t),"zh-cn":Ie("./translations/zh-cn.json",t),"zh-tw":Ie("./translations/zh-tw.json",t)},embedIcons:{codepen:Ie("./embed-icons/codepen.png",t),codesandbox:Ie("./embed-icons/codesandbox.png",t),desmos:Ie("./embed-icons/desmos.png",t),excalidraw:Ie("./embed-icons/excalidraw.png",t),felt:Ie("./embed-icons/felt.png",t),figma:Ie("./embed-icons/figma.png",t),github_gist:Ie("./embed-icons/github_gist.png",t),google_calendar:Ie("./embed-icons/google_calendar.png",t),google_maps:Ie("./embed-icons/google_maps.png",t),google_slides:Ie("./embed-icons/google_slides.png",t),observable:Ie("./embed-icons/observable.png",t),replit:Ie("./embed-icons/replit.png",t),scratch:Ie("./embed-icons/scratch.png",t),spotify:Ie("./embed-icons/spotify.png",t),tldraw:Ie("./embed-icons/tldraw.png",t),val_town:Ie("./embed-icons/val_town.png",t),vimeo:Ie("./embed-icons/vimeo.png",t),youtube:Ie("./embed-icons/youtube.png",t)}}}const dC="__TLDRAW_LIBRARY_VERSIONS__";function MZ(){if(globalThis[dC])return globalThis[dC];const t={versions:[],didWarn:!1,scheduledNotice:null};return Object.defineProperty(globalThis,dC,{value:t,writable:!1,configurable:!1,enumerable:!1}),t}function Cu(t,e,n){if(!t||!e||!n)throw new Error("Missing name/version/module system in built version of tldraw library");const r=MZ();if(r.versions.push({name:t,version:e,modules:n}),!r.scheduledNotice)try{r.scheduledNotice=setTimeout(()=>{r.scheduledNotice=null,CR(r)},100)}catch{CR(r)}}function CR(t){if(!t.versions.length||t.didWarn)return;const e=t.versions.sort((a,l)=>TR(a.version,l.version)),n=e[e.length-1].version,r=new Set,i=new Map;for(const a of e){if(i.has(a.name)){r.delete(a.name),hC(i,a.name,new Set).add(a.version);continue}a.version===n?r.add(a.name):(r.delete(a.name),hC(i,a.name,new Set).add(a.version))}if(i.size>0){const a=[`${Al("[tldraw]",["bold","bgRed","textWhite"])} ${Al("You have multiple versions of tldraw libraries installed. This can lead to bugs and unexpected behavior.",["textRed","bold"])}`,"",`The latest version you have installed is ${Al(`v${n}`,["bold","textBlue"])}. The following libraries are on the latest version:`,...Array.from(r,l=>` • ✅ ${Al(l,["bold"])}`),"","The following libraries are not on the latest version, or have multiple versions installed:",...Array.from(i,([l,u])=>{const f=Array.from(u).sort(TR).map(h=>Al(`v${h}`,h===n?["textGreen"]:["textRed"]));return` • ❌ ${Al(l,["bold"])} (${f.join(", ")})`})];console.log(a.join(`
8
+ `+S.stack}}var Gr=Object.prototype.hasOwnProperty,hi=t.unstable_scheduleCallback,fi=t.unstable_cancelCallback,ol=t.unstable_shouldYield,sc=t.unstable_requestPaint,dr=t.unstable_now,Fi=t.unstable_getCurrentPriorityLevel,So=t.unstable_ImmediatePriority,Xo=t.unstable_UserBlockingPriority,us=t.unstable_NormalPriority,al=t.unstable_LowPriority,ce=t.unstable_IdlePriority,ke=t.log,Xe=t.unstable_setDisableYieldValue,At=null,qt=null;function pn(c){if(typeof ke=="function"&&Xe(c),qt&&typeof qt.setStrictMode=="function")try{qt.setStrictMode(At,c)}catch{}}var An=Math.clz32?Math.clz32:ds,Ui=Math.log,Yr=Math.LN2;function ds(c){return c>>>=0,c===0?32:31-(Ui(c)/Yr|0)|0}var pi=256,hs=262144,Zo=4194304;function Ns(c){var d=c&42;if(d!==0)return d;switch(c&-c){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 c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function zs(c,d,p){var S=c.pendingLanes;if(S===0)return 0;var T=0,_=c.suspendedLanes,D=c.pingedLanes;c=c.warmLanes;var L=S&134217727;return L!==0?(S=L&~_,S!==0?T=Ns(S):(D&=L,D!==0?T=Ns(D):p||(p=L&~c,p!==0&&(T=Ns(p))))):(L=S&~_,L!==0?T=Ns(L):D!==0?T=Ns(D):p||(p=S&~c,p!==0&&(T=Ns(p)))),T===0?0:d!==0&&d!==T&&(d&_)===0&&(_=T&-T,p=d&-d,_>=p||_===32&&(p&4194048)!==0)?d:T}function Bs(c,d){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&d)===0}function Fs(c,d){switch(c){case 1:case 2:case 4:case 8:case 64:return d+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 d+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 oc(){var c=Zo;return Zo<<=1,(Zo&62914560)===0&&(Zo=4194304),c}function Jo(c){for(var d=[],p=0;31>p;p++)d.push(c);return d}function ll(c,d){c.pendingLanes|=d,d!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function hp(c,d,p,S,T,_){var D=c.pendingLanes;c.pendingLanes=p,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=p,c.entangledLanes&=p,c.errorRecoveryDisabledLanes&=p,c.shellSuspendCounter=0;var L=c.entanglements,Y=c.expirationTimes,oe=c.hiddenUpdates;for(p=D&~p;0<p;){var he=31-An(p),Se=1<<he;L[he]=0,Y[he]=-1;var ae=oe[he];if(ae!==null)for(oe[he]=null,he=0;he<ae.length;he++){var ue=ae[he];ue!==null&&(ue.lane&=-536870913)}p&=~Se}S!==0&&Zd(c,S,0),_!==0&&T===0&&c.tag!==0&&(c.suspendedLanes|=_&~(D&~d))}function Zd(c,d,p){c.pendingLanes|=d,c.suspendedLanes&=~d;var S=31-An(d);c.entangledLanes|=d,c.entanglements[S]=c.entanglements[S]|1073741824|p&261930}function fs(c,d){var p=c.entangledLanes|=d;for(c=c.entanglements;p;){var S=31-An(p),T=1<<S;T&d|c[S]&d&&(c[S]|=d),p&=~T}}function Jd(c,d){var p=d&-d;return p=(p&42)!==0?1:ac(p),(p&(c.suspendedLanes|d))!==0?0:p}function ac(c){switch(c){case 2:c=1;break;case 8:c=4;break;case 32:c=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:c=128;break;case 268435456:c=134217728;break;default:c=0}return c}function cl(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function bo(){var c=G.p;return c!==0?c:(c=window.event,c===void 0?32:oR(c.type))}function Qd(c,d){var p=G.p;try{return G.p=c,d()}finally{G.p=p}}var Mr=Math.random().toString(36).slice(2),Zn="__reactFiber$"+Mr,Ar="__reactProps$"+Mr,wa="__reactContainer$"+Mr,Hi="__reactEvents$"+Mr,fp="__reactListeners$"+Mr,lc="__reactHandles$"+Mr,eh="__reactResources$"+Mr,ul="__reactMarker$"+Mr;function ps(c){delete c[Zn],delete c[Ar],delete c[Hi],delete c[fp],delete c[lc]}function gi(c){var d=c[Zn];if(d)return d;for(var p=c.parentNode;p;){if(d=p[wa]||p[Zn]){if(p=d.alternate,d.child!==null||p!==null&&p.child!==null)for(c=KD(c);c!==null;){if(p=c[Zn])return p;c=KD(c)}return d}c=p,p=c.parentNode}return null}function Ca(c){if(c=c[Zn]||c[wa]){var d=c.tag;if(d===5||d===6||d===13||d===31||d===26||d===27||d===3)return c}return null}function dl(c){var d=c.tag;if(d===5||d===26||d===27||d===6)return c.stateNode;throw Error(r(33))}function Ta(c){var d=c[eh];return d||(d=c[eh]={hoistableStyles:new Map,hoistableScripts:new Map}),d}function Ln(c){c[ul]=!0}var th=new Set,vo={};function Qo(c,d){ea(c,d),ea(c+"Capture",d)}function ea(c,d){for(vo[c]=d,c=0;c<d.length;c++)th.add(d[c])}var xo=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]*$"),nh={},rh={};function pp(c){return Gr.call(rh,c)?!0:Gr.call(nh,c)?!1:xo.test(c)?rh[c]=!0:(nh[c]=!0,!1)}function hl(c,d,p){if(pp(d))if(p===null)c.removeAttribute(d);else{switch(typeof p){case"undefined":case"function":case"symbol":c.removeAttribute(d);return;case"boolean":var S=d.toLowerCase().slice(0,5);if(S!=="data-"&&S!=="aria-"){c.removeAttribute(d);return}}c.setAttribute(d,""+p)}}function cc(c,d,p){if(p===null)c.removeAttribute(d);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(d);return}c.setAttribute(d,""+p)}}function Us(c,d,p,S){if(S===null)c.removeAttribute(p);else{switch(typeof S){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(p);return}c.setAttributeNS(d,p,""+S)}}function Nn(c){switch(typeof c){case"bigint":case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function ta(c){var d=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(d==="checkbox"||d==="radio")}function mi(c,d,p){var S=Object.getOwnPropertyDescriptor(c.constructor.prototype,d);if(!c.hasOwnProperty(d)&&typeof S<"u"&&typeof S.get=="function"&&typeof S.set=="function"){var T=S.get,_=S.set;return Object.defineProperty(c,d,{configurable:!0,get:function(){return T.call(this)},set:function(D){p=""+D,_.call(this,D)}}),Object.defineProperty(c,d,{enumerable:S.enumerable}),{getValue:function(){return p},setValue:function(D){p=""+D},stopTracking:function(){c._valueTracker=null,delete c[d]}}}}function uc(c){if(!c._valueTracker){var d=ta(c)?"checked":"value";c._valueTracker=mi(c,d,""+c[d])}}function zu(c){if(!c)return!1;var d=c._valueTracker;if(!d)return!0;var p=d.getValue(),S="";return c&&(S=ta(c)?c.checked?"true":"false":c.value),c=S,c!==p?(d.setValue(c),!0):!1}function dc(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var gp=/[\n"\\]/g;function zn(c){return c.replace(gp,function(d){return"\\"+d.charCodeAt(0).toString(16)+" "})}function hc(c,d,p,S,T,_,D,L){c.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?c.type=D:c.removeAttribute("type"),d!=null?D==="number"?(d===0&&c.value===""||c.value!=d)&&(c.value=""+Nn(d)):c.value!==""+Nn(d)&&(c.value=""+Nn(d)):D!=="submit"&&D!=="reset"||c.removeAttribute("value"),d!=null?fl(c,D,Nn(d)):p!=null?fl(c,D,Nn(p)):S!=null&&c.removeAttribute("value"),T==null&&_!=null&&(c.defaultChecked=!!_),T!=null&&(c.checked=T&&typeof T!="function"&&typeof T!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?c.name=""+Nn(L):c.removeAttribute("name")}function Bu(c,d,p,S,T,_,D,L){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(c.type=_),d!=null||p!=null){if(!(_!=="submit"&&_!=="reset"||d!=null)){uc(c);return}p=p!=null?""+Nn(p):"",d=d!=null?""+Nn(d):p,L||d===c.value||(c.value=d),c.defaultValue=d}S=S??T,S=typeof S!="function"&&typeof S!="symbol"&&!!S,c.checked=L?c.checked:!!S,c.defaultChecked=!!S,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(c.name=D),uc(c)}function fl(c,d,p){d==="number"&&dc(c.ownerDocument)===c||c.defaultValue===""+p||(c.defaultValue=""+p)}function na(c,d,p,S){if(c=c.options,d){d={};for(var T=0;T<p.length;T++)d["$"+p[T]]=!0;for(p=0;p<c.length;p++)T=d.hasOwnProperty("$"+c[p].value),c[p].selected!==T&&(c[p].selected=T),T&&S&&(c[p].defaultSelected=!0)}else{for(p=""+Nn(p),d=null,T=0;T<c.length;T++){if(c[T].value===p){c[T].selected=!0,S&&(c[T].defaultSelected=!0);return}d!==null||c[T].disabled||(d=c[T])}d!==null&&(d.selected=!0)}}function Fu(c,d,p){if(d!=null&&(d=""+Nn(d),d!==c.value&&(c.value=d),p==null)){c.defaultValue!==d&&(c.defaultValue=d);return}c.defaultValue=p!=null?""+Nn(p):""}function pl(c,d,p,S){if(d==null){if(S!=null){if(p!=null)throw Error(r(92));if(K(S)){if(1<S.length)throw Error(r(93));S=S[0]}p=S}p==null&&(p=""),d=p}p=Nn(d),c.defaultValue=p,S=c.textContent,S===p&&S!==""&&S!==null&&(c.value=S),uc(c)}function yi(c,d){if(d){var p=c.firstChild;if(p&&p===c.lastChild&&p.nodeType===3){p.nodeValue=d;return}}c.textContent=d}var ih=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 fc(c,d,p){var S=d.indexOf("--")===0;p==null||typeof p=="boolean"||p===""?S?c.setProperty(d,""):d==="float"?c.cssFloat="":c[d]="":S?c.setProperty(d,p):typeof p!="number"||p===0||ih.has(d)?d==="float"?c.cssFloat=p:c[d]=(""+p).trim():c[d]=p+"px"}function $i(c,d,p){if(d!=null&&typeof d!="object")throw Error(r(62));if(c=c.style,p!=null){for(var S in p)!p.hasOwnProperty(S)||d!=null&&d.hasOwnProperty(S)||(S.indexOf("--")===0?c.setProperty(S,""):S==="float"?c.cssFloat="":c[S]="");for(var T in d)S=d[T],d.hasOwnProperty(T)&&p[T]!==S&&fc(c,T,S)}else for(var _ in d)d.hasOwnProperty(_)&&fc(c,_,d[_])}function Uu(c){if(c.indexOf("-")===-1)return!1;switch(c){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 sh=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),q=/^[\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 ie(c){return q.test(""+c)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":c}function Ce(){}var ze=null;function Jt(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var rt=null,an=null;function Cr(c){var d=Ca(c);if(d&&(c=d.stateNode)){var p=c[Ar]||null;e:switch(c=d.stateNode,d.type){case"input":if(hc(c,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name),d=p.name,p.type==="radio"&&d!=null){for(p=c;p.parentNode;)p=p.parentNode;for(p=p.querySelectorAll('input[name="'+zn(""+d)+'"][type="radio"]'),d=0;d<p.length;d++){var S=p[d];if(S!==c&&S.form===c.form){var T=S[Ar]||null;if(!T)throw Error(r(90));hc(S,T.value,T.defaultValue,T.defaultValue,T.checked,T.defaultChecked,T.type,T.name)}}for(d=0;d<p.length;d++)S=p[d],S.form===c.form&&zu(S)}break e;case"textarea":Fu(c,p.value,p.defaultValue);break e;case"select":d=p.value,d!=null&&na(c,!!p.multiple,d,!1)}}}var xn=!1;function Tr(c,d,p){if(xn)return c(d,p);xn=!0;try{var S=c(d);return S}finally{if(xn=!1,(rt!==null||an!==null)&&(dS(),rt&&(d=rt,c=an,an=rt=null,Cr(d),c)))for(d=0;d<c.length;d++)Cr(c[d])}}function Jn(c,d){var p=c.stateNode;if(p===null)return null;var S=p[Ar]||null;if(S===null)return null;p=S[d];e:switch(d){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(S=!S.disabled)||(c=c.type,S=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!S;break e;default:c=!1}if(c)return null;if(p&&typeof p!="function")throw Error(r(231,d,typeof p));return p}var wn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bn=!1;if(wn)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){Bn=!0}}),window.addEventListener("test",Cn,Cn),window.removeEventListener("test",Cn,Cn)}catch{Bn=!1}var Tn=null,gs=null,Si=null;function wo(){if(Si)return Si;var c,d=gs,p=d.length,S,T="value"in Tn?Tn.value:Tn.textContent,_=T.length;for(c=0;c<p&&d[c]===T[c];c++);var D=p-c;for(S=1;S<=D&&d[p-S]===T[_-S];S++);return Si=T.slice(c,1<S?1-S:void 0)}function $(c){var d=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&d===13&&(c=13)):c=d,c===10&&(c=13),32<=c||c===13?c:0}function Q(){return!0}function be(){return!1}function Me(c){function d(p,S,T,_,D){this._reactName=p,this._targetInst=T,this.type=S,this.nativeEvent=_,this.target=D,this.currentTarget=null;for(var L in c)c.hasOwnProperty(L)&&(p=c[L],this[L]=p?p(_):_[L]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Q:be,this.isPropagationStopped=be,this}return h(d.prototype,{preventDefault:function(){this.defaultPrevented=!0;var p=this.nativeEvent;p&&(p.preventDefault?p.preventDefault():typeof p.returnValue!="unknown"&&(p.returnValue=!1),this.isDefaultPrevented=Q)},stopPropagation:function(){var p=this.nativeEvent;p&&(p.stopPropagation?p.stopPropagation():typeof p.cancelBubble!="unknown"&&(p.cancelBubble=!0),this.isPropagationStopped=Q)},persist:function(){},isPersistent:Q}),d}var Rt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},st=Me(Rt),Qt=h({},Rt,{view:0,detail:0}),hr=Me(Qt),Qn,ln,Er,bi=h({},Qt,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uw,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==Er&&(Er&&c.type==="mousemove"?(Qn=c.screenX-Er.screenX,ln=c.screenY-Er.screenY):ln=Qn=0,Er=c),Qn)},movementY:function(c){return"movementY"in c?c.movementY:ln}}),_r=Me(bi),ms=h({},bi,{dataTransfer:0}),ys=Me(ms),Ea=h({},Qt,{relatedTarget:0}),Hs=Me(Ea),gl=h({},Rt,{animationName:0,elapsedTime:0,pseudoElement:0}),ky=Me(gl),oh=h({},Rt,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),ah=Me(oh),EW=h({},Rt,{data:0}),F2=Me(EW),_W={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PW={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"},IW={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kW(c){var d=this.nativeEvent;return d.getModifierState?d.getModifierState(c):(c=IW[c])?!!d[c]:!1}function uw(){return kW}var MW=h({},Qt,{key:function(c){if(c.key){var d=_W[c.key]||c.key;if(d!=="Unidentified")return d}return c.type==="keypress"?(c=$(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?PW[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uw,charCode:function(c){return c.type==="keypress"?$(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?$(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),AW=Me(MW),OW=h({},bi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),U2=Me(OW),DW=h({},Qt,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uw}),RW=Me(DW),jW=h({},Rt,{propertyName:0,elapsedTime:0,pseudoElement:0}),LW=Me(jW),NW=h({},bi,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),zW=Me(NW),BW=h({},Rt,{newState:0,oldState:0}),FW=Me(BW),UW=[9,13,27,32],dw=wn&&"CompositionEvent"in window,mp=null;wn&&"documentMode"in document&&(mp=document.documentMode);var HW=wn&&"TextEvent"in window&&!mp,H2=wn&&(!dw||mp&&8<mp&&11>=mp),$2=" ",K2=!1;function V2(c,d){switch(c){case"keyup":return UW.indexOf(d.keyCode)!==-1;case"keydown":return d.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function q2(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var lh=!1;function $W(c,d){switch(c){case"compositionend":return q2(d);case"keypress":return d.which!==32?null:(K2=!0,$2);case"textInput":return c=d.data,c===$2&&K2?null:c;default:return null}}function KW(c,d){if(lh)return c==="compositionend"||!dw&&V2(c,d)?(c=wo(),Si=gs=Tn=null,lh=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(d.ctrlKey||d.altKey||d.metaKey)||d.ctrlKey&&d.altKey){if(d.char&&1<d.char.length)return d.char;if(d.which)return String.fromCharCode(d.which)}return null;case"compositionend":return H2&&d.locale!=="ko"?null:d.data;default:return null}}var VW={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 G2(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d==="input"?!!VW[c.type]:d==="textarea"}function Y2(c,d,p,S){rt?an?an.push(S):an=[S]:rt=S,d=SS(d,"onChange"),0<d.length&&(p=new st("onChange","change",null,p,S),c.push({event:p,listeners:d}))}var yp=null,Sp=null;function qW(c){MD(c,0)}function My(c){var d=dl(c);if(zu(d))return c}function W2(c,d){if(c==="change")return d}var X2=!1;if(wn){var hw;if(wn){var fw="oninput"in document;if(!fw){var Z2=document.createElement("div");Z2.setAttribute("oninput","return;"),fw=typeof Z2.oninput=="function"}hw=fw}else hw=!1;X2=hw&&(!document.documentMode||9<document.documentMode)}function J2(){yp&&(yp.detachEvent("onpropertychange",Q2),Sp=yp=null)}function Q2(c){if(c.propertyName==="value"&&My(Sp)){var d=[];Y2(d,Sp,c,Jt(c)),Tr(qW,d)}}function GW(c,d,p){c==="focusin"?(J2(),yp=d,Sp=p,yp.attachEvent("onpropertychange",Q2)):c==="focusout"&&J2()}function YW(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return My(Sp)}function WW(c,d){if(c==="click")return My(d)}function XW(c,d){if(c==="input"||c==="change")return My(d)}function ZW(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var $s=typeof Object.is=="function"?Object.is:ZW;function bp(c,d){if($s(c,d))return!0;if(typeof c!="object"||c===null||typeof d!="object"||d===null)return!1;var p=Object.keys(c),S=Object.keys(d);if(p.length!==S.length)return!1;for(S=0;S<p.length;S++){var T=p[S];if(!Gr.call(d,T)||!$s(c[T],d[T]))return!1}return!0}function eA(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function tA(c,d){var p=eA(c);c=0;for(var S;p;){if(p.nodeType===3){if(S=c+p.textContent.length,c<=d&&S>=d)return{node:p,offset:d-c};c=S}e:{for(;p;){if(p.nextSibling){p=p.nextSibling;break e}p=p.parentNode}p=void 0}p=eA(p)}}function nA(c,d){return c&&d?c===d?!0:c&&c.nodeType===3?!1:d&&d.nodeType===3?nA(c,d.parentNode):"contains"in c?c.contains(d):c.compareDocumentPosition?!!(c.compareDocumentPosition(d)&16):!1:!1}function rA(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var d=dc(c.document);d instanceof c.HTMLIFrameElement;){try{var p=typeof d.contentWindow.location.href=="string"}catch{p=!1}if(p)c=d.contentWindow;else break;d=dc(c.document)}return d}function pw(c){var d=c&&c.nodeName&&c.nodeName.toLowerCase();return d&&(d==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||d==="textarea"||c.contentEditable==="true")}var JW=wn&&"documentMode"in document&&11>=document.documentMode,ch=null,gw=null,vp=null,mw=!1;function iA(c,d,p){var S=p.window===p?p.document:p.nodeType===9?p:p.ownerDocument;mw||ch==null||ch!==dc(S)||(S=ch,"selectionStart"in S&&pw(S)?S={start:S.selectionStart,end:S.selectionEnd}:(S=(S.ownerDocument&&S.ownerDocument.defaultView||window).getSelection(),S={anchorNode:S.anchorNode,anchorOffset:S.anchorOffset,focusNode:S.focusNode,focusOffset:S.focusOffset}),vp&&bp(vp,S)||(vp=S,S=SS(gw,"onSelect"),0<S.length&&(d=new st("onSelect","select",null,d,p),c.push({event:d,listeners:S}),d.target=ch)))}function Hu(c,d){var p={};return p[c.toLowerCase()]=d.toLowerCase(),p["Webkit"+c]="webkit"+d,p["Moz"+c]="moz"+d,p}var uh={animationend:Hu("Animation","AnimationEnd"),animationiteration:Hu("Animation","AnimationIteration"),animationstart:Hu("Animation","AnimationStart"),transitionrun:Hu("Transition","TransitionRun"),transitionstart:Hu("Transition","TransitionStart"),transitioncancel:Hu("Transition","TransitionCancel"),transitionend:Hu("Transition","TransitionEnd")},yw={},sA={};wn&&(sA=document.createElement("div").style,"AnimationEvent"in window||(delete uh.animationend.animation,delete uh.animationiteration.animation,delete uh.animationstart.animation),"TransitionEvent"in window||delete uh.transitionend.transition);function $u(c){if(yw[c])return yw[c];if(!uh[c])return c;var d=uh[c],p;for(p in d)if(d.hasOwnProperty(p)&&p in sA)return yw[c]=d[p];return c}var oA=$u("animationend"),aA=$u("animationiteration"),lA=$u("animationstart"),QW=$u("transitionrun"),eX=$u("transitionstart"),tX=$u("transitioncancel"),cA=$u("transitionend"),uA=new Map,Sw="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Sw.push("scrollEnd");function ra(c,d){uA.set(c,d),Qo(d,[c])}var Ay=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var d=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(d))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",c);return}console.error(c)},Co=[],dh=0,bw=0;function Oy(){for(var c=dh,d=bw=dh=0;d<c;){var p=Co[d];Co[d++]=null;var S=Co[d];Co[d++]=null;var T=Co[d];Co[d++]=null;var _=Co[d];if(Co[d++]=null,S!==null&&T!==null){var D=S.pending;D===null?T.next=T:(T.next=D.next,D.next=T),S.pending=T}_!==0&&dA(p,T,_)}}function Dy(c,d,p,S){Co[dh++]=c,Co[dh++]=d,Co[dh++]=p,Co[dh++]=S,bw|=S,c.lanes|=S,c=c.alternate,c!==null&&(c.lanes|=S)}function vw(c,d,p,S){return Dy(c,d,p,S),Ry(c)}function Ku(c,d){return Dy(c,null,null,d),Ry(c)}function dA(c,d,p){c.lanes|=p;var S=c.alternate;S!==null&&(S.lanes|=p);for(var T=!1,_=c.return;_!==null;)_.childLanes|=p,S=_.alternate,S!==null&&(S.childLanes|=p),_.tag===22&&(c=_.stateNode,c===null||c._visibility&1||(T=!0)),c=_,_=_.return;return c.tag===3?(_=c.stateNode,T&&d!==null&&(T=31-An(p),c=_.hiddenUpdates,S=c[T],S===null?c[T]=[d]:S.push(d),d.lane=p|536870912),_):null}function Ry(c){if(50<Hp)throw Hp=0,k1=null,Error(r(185));for(var d=c.return;d!==null;)c=d,d=c.return;return c.tag===3?c.stateNode:null}var hh={};function nX(c,d,p,S){this.tag=c,this.key=p,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ks(c,d,p,S){return new nX(c,d,p,S)}function xw(c){return c=c.prototype,!(!c||!c.isReactComponent)}function ml(c,d){var p=c.alternate;return p===null?(p=Ks(c.tag,d,c.key,c.mode),p.elementType=c.elementType,p.type=c.type,p.stateNode=c.stateNode,p.alternate=c,c.alternate=p):(p.pendingProps=d,p.type=c.type,p.flags=0,p.subtreeFlags=0,p.deletions=null),p.flags=c.flags&65011712,p.childLanes=c.childLanes,p.lanes=c.lanes,p.child=c.child,p.memoizedProps=c.memoizedProps,p.memoizedState=c.memoizedState,p.updateQueue=c.updateQueue,d=c.dependencies,p.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},p.sibling=c.sibling,p.index=c.index,p.ref=c.ref,p.refCleanup=c.refCleanup,p}function hA(c,d){c.flags&=65011714;var p=c.alternate;return p===null?(c.childLanes=0,c.lanes=d,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=p.childLanes,c.lanes=p.lanes,c.child=p.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=p.memoizedProps,c.memoizedState=p.memoizedState,c.updateQueue=p.updateQueue,c.type=p.type,d=p.dependencies,c.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext}),c}function jy(c,d,p,S,T,_){var D=0;if(S=c,typeof c=="function")xw(c)&&(D=1);else if(typeof c=="string")D=aZ(c,p,fe.current)?26:c==="html"||c==="head"||c==="body"?27:5;else e:switch(c){case F:return c=Ks(31,p,d,T),c.elementType=F,c.lanes=_,c;case w:return Vu(p.children,T,_,d);case x:D=8,T|=24;break;case v:return c=Ks(12,p,d,T|2),c.elementType=v,c.lanes=_,c;case M:return c=Ks(13,p,d,T),c.elementType=M,c.lanes=_,c;case A:return c=Ks(19,p,d,T),c.elementType=A,c.lanes=_,c;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case P:D=10;break e;case C:D=9;break e;case k:D=11;break e;case O:D=14;break e;case R:D=16,S=null;break e}D=29,p=Error(r(130,c===null?"null":typeof c,"")),S=null}return d=Ks(D,p,d,T),d.elementType=c,d.type=S,d.lanes=_,d}function Vu(c,d,p,S){return c=Ks(7,c,S,d),c.lanes=p,c}function ww(c,d,p){return c=Ks(6,c,null,d),c.lanes=p,c}function fA(c){var d=Ks(18,null,null,0);return d.stateNode=c,d}function Cw(c,d,p){return d=Ks(4,c.children!==null?c.children:[],c.key,d),d.lanes=p,d.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},d}var pA=new WeakMap;function To(c,d){if(typeof c=="object"&&c!==null){var p=pA.get(c);return p!==void 0?p:(d={value:c,source:d,stack:kr(d)},pA.set(c,d),d)}return{value:c,source:d,stack:kr(d)}}var fh=[],ph=0,Ly=null,xp=0,Eo=[],_o=0,pc=null,_a=1,Pa="";function yl(c,d){fh[ph++]=xp,fh[ph++]=Ly,Ly=c,xp=d}function gA(c,d,p){Eo[_o++]=_a,Eo[_o++]=Pa,Eo[_o++]=pc,pc=c;var S=_a;c=Pa;var T=32-An(S)-1;S&=~(1<<T),p+=1;var _=32-An(d)+T;if(30<_){var D=T-T%5;_=(S&(1<<D)-1).toString(32),S>>=D,T-=D,_a=1<<32-An(d)+T|p<<T|S,Pa=_+c}else _a=1<<_|p<<T|S,Pa=c}function Tw(c){c.return!==null&&(yl(c,1),gA(c,1,0))}function Ew(c){for(;c===Ly;)Ly=fh[--ph],fh[ph]=null,xp=fh[--ph],fh[ph]=null;for(;c===pc;)pc=Eo[--_o],Eo[_o]=null,Pa=Eo[--_o],Eo[_o]=null,_a=Eo[--_o],Eo[_o]=null}function mA(c,d){Eo[_o++]=_a,Eo[_o++]=Pa,Eo[_o++]=pc,_a=d.id,Pa=d.overflow,pc=c}var Wr=null,gn=null,Ot=!1,gc=null,Po=!1,_w=Error(r(519));function mc(c){var d=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wp(To(d,c)),_w}function yA(c){var d=c.stateNode,p=c.type,S=c.memoizedProps;switch(d[Zn]=c,d[Ar]=S,p){case"dialog":Tt("cancel",d),Tt("close",d);break;case"iframe":case"object":case"embed":Tt("load",d);break;case"video":case"audio":for(p=0;p<Kp.length;p++)Tt(Kp[p],d);break;case"source":Tt("error",d);break;case"img":case"image":case"link":Tt("error",d),Tt("load",d);break;case"details":Tt("toggle",d);break;case"input":Tt("invalid",d),Bu(d,S.value,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name,!0);break;case"select":Tt("invalid",d);break;case"textarea":Tt("invalid",d),pl(d,S.value,S.defaultValue,S.children)}p=S.children,typeof p!="string"&&typeof p!="number"&&typeof p!="bigint"||d.textContent===""+p||S.suppressHydrationWarning===!0||RD(d.textContent,p)?(S.popover!=null&&(Tt("beforetoggle",d),Tt("toggle",d)),S.onScroll!=null&&Tt("scroll",d),S.onScrollEnd!=null&&Tt("scrollend",d),S.onClick!=null&&(d.onclick=Ce),d=!0):d=!1,d||mc(c,!0)}function SA(c){for(Wr=c.return;Wr;)switch(Wr.tag){case 5:case 31:case 13:Po=!1;return;case 27:case 3:Po=!0;return;default:Wr=Wr.return}}function gh(c){if(c!==Wr)return!1;if(!Ot)return SA(c),Ot=!0,!1;var d=c.tag,p;if((p=d!==3&&d!==27)&&((p=d===5)&&(p=c.type,p=!(p!=="form"&&p!=="button")||K1(c.type,c.memoizedProps)),p=!p),p&&gn&&mc(c),SA(c),d===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));gn=$D(c)}else if(d===31){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));gn=$D(c)}else d===27?(d=gn,Mc(c.type)?(c=W1,W1=null,gn=c):gn=d):gn=Wr?ko(c.stateNode.nextSibling):null;return!0}function qu(){gn=Wr=null,Ot=!1}function Pw(){var c=gc;return c!==null&&(xs===null?xs=c:xs.push.apply(xs,c),gc=null),c}function wp(c){gc===null?gc=[c]:gc.push(c)}var Iw=U(null),Gu=null,Sl=null;function yc(c,d,p){le(Iw,d._currentValue),d._currentValue=p}function bl(c){c._currentValue=Iw.current,ne(Iw)}function kw(c,d,p){for(;c!==null;){var S=c.alternate;if((c.childLanes&d)!==d?(c.childLanes|=d,S!==null&&(S.childLanes|=d)):S!==null&&(S.childLanes&d)!==d&&(S.childLanes|=d),c===p)break;c=c.return}}function Mw(c,d,p,S){var T=c.child;for(T!==null&&(T.return=c);T!==null;){var _=T.dependencies;if(_!==null){var D=T.child;_=_.firstContext;e:for(;_!==null;){var L=_;_=T;for(var Y=0;Y<d.length;Y++)if(L.context===d[Y]){_.lanes|=p,L=_.alternate,L!==null&&(L.lanes|=p),kw(_.return,p,c),S||(D=null);break e}_=L.next}}else if(T.tag===18){if(D=T.return,D===null)throw Error(r(341));D.lanes|=p,_=D.alternate,_!==null&&(_.lanes|=p),kw(D,p,c),D=null}else D=T.child;if(D!==null)D.return=T;else for(D=T;D!==null;){if(D===c){D=null;break}if(T=D.sibling,T!==null){T.return=D.return,D=T;break}D=D.return}T=D}}function mh(c,d,p,S){c=null;for(var T=d,_=!1;T!==null;){if(!_){if((T.flags&524288)!==0)_=!0;else if((T.flags&262144)!==0)break}if(T.tag===10){var D=T.alternate;if(D===null)throw Error(r(387));if(D=D.memoizedProps,D!==null){var L=T.type;$s(T.pendingProps.value,D.value)||(c!==null?c.push(L):c=[L])}}else if(T===xe.current){if(D=T.alternate,D===null)throw Error(r(387));D.memoizedState.memoizedState!==T.memoizedState.memoizedState&&(c!==null?c.push(Wp):c=[Wp])}T=T.return}c!==null&&Mw(d,c,p,S),d.flags|=262144}function Ny(c){for(c=c.firstContext;c!==null;){if(!$s(c.context._currentValue,c.memoizedValue))return!0;c=c.next}return!1}function Yu(c){Gu=c,Sl=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function Xr(c){return bA(Gu,c)}function zy(c,d){return Gu===null&&Yu(c),bA(c,d)}function bA(c,d){var p=d._currentValue;if(d={context:d,memoizedValue:p,next:null},Sl===null){if(c===null)throw Error(r(308));Sl=d,c.dependencies={lanes:0,firstContext:d},c.flags|=524288}else Sl=Sl.next=d;return p}var rX=typeof AbortController<"u"?AbortController:function(){var c=[],d=this.signal={aborted:!1,addEventListener:function(p,S){c.push(S)}};this.abort=function(){d.aborted=!0,c.forEach(function(p){return p()})}},iX=t.unstable_scheduleCallback,sX=t.unstable_NormalPriority,fr={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Aw(){return{controller:new rX,data:new Map,refCount:0}}function Cp(c){c.refCount--,c.refCount===0&&iX(sX,function(){c.controller.abort()})}var Tp=null,Ow=0,yh=0,Sh=null;function oX(c,d){if(Tp===null){var p=Tp=[];Ow=0,yh=j1(),Sh={status:"pending",value:void 0,then:function(S){p.push(S)}}}return Ow++,d.then(vA,vA),d}function vA(){if(--Ow===0&&Tp!==null){Sh!==null&&(Sh.status="fulfilled");var c=Tp;Tp=null,yh=0,Sh=null;for(var d=0;d<c.length;d++)(0,c[d])()}}function aX(c,d){var p=[],S={status:"pending",value:null,reason:null,then:function(T){p.push(T)}};return c.then(function(){S.status="fulfilled",S.value=d;for(var T=0;T<p.length;T++)(0,p[T])(d)},function(T){for(S.status="rejected",S.reason=T,T=0;T<p.length;T++)(0,p[T])(void 0)}),S}var xA=B.S;B.S=function(c,d){iD=dr(),typeof d=="object"&&d!==null&&typeof d.then=="function"&&oX(c,d),xA!==null&&xA(c,d)};var Wu=U(null);function Dw(){var c=Wu.current;return c!==null?c:cn.pooledCache}function By(c,d){d===null?le(Wu,Wu.current):le(Wu,d.pool)}function wA(){var c=Dw();return c===null?null:{parent:fr._currentValue,pool:c}}var bh=Error(r(460)),Rw=Error(r(474)),Fy=Error(r(542)),Uy={then:function(){}};function CA(c){return c=c.status,c==="fulfilled"||c==="rejected"}function TA(c,d,p){switch(p=c[p],p===void 0?c.push(d):p!==d&&(d.then(Ce,Ce),d=p),d.status){case"fulfilled":return d.value;case"rejected":throw c=d.reason,_A(c),c;default:if(typeof d.status=="string")d.then(Ce,Ce);else{if(c=cn,c!==null&&100<c.shellSuspendCounter)throw Error(r(482));c=d,c.status="pending",c.then(function(S){if(d.status==="pending"){var T=d;T.status="fulfilled",T.value=S}},function(S){if(d.status==="pending"){var T=d;T.status="rejected",T.reason=S}})}switch(d.status){case"fulfilled":return d.value;case"rejected":throw c=d.reason,_A(c),c}throw Zu=d,bh}}function Xu(c){try{var d=c._init;return d(c._payload)}catch(p){throw p!==null&&typeof p=="object"&&typeof p.then=="function"?(Zu=p,bh):p}}var Zu=null;function EA(){if(Zu===null)throw Error(r(459));var c=Zu;return Zu=null,c}function _A(c){if(c===bh||c===Fy)throw Error(r(483))}var vh=null,Ep=0;function Hy(c){var d=Ep;return Ep+=1,vh===null&&(vh=[]),TA(vh,c,d)}function _p(c,d){d=d.props.ref,c.ref=d!==void 0?d:null}function $y(c,d){throw d.$$typeof===g?Error(r(525)):(c=Object.prototype.toString.call(d),Error(r(31,c==="[object Object]"?"object with keys {"+Object.keys(d).join(", ")+"}":c)))}function PA(c){function d(re,X){if(c){var se=re.deletions;se===null?(re.deletions=[X],re.flags|=16):se.push(X)}}function p(re,X){if(!c)return null;for(;X!==null;)d(re,X),X=X.sibling;return null}function S(re){for(var X=new Map;re!==null;)re.key!==null?X.set(re.key,re):X.set(re.index,re),re=re.sibling;return X}function T(re,X){return re=ml(re,X),re.index=0,re.sibling=null,re}function _(re,X,se){return re.index=se,c?(se=re.alternate,se!==null?(se=se.index,se<X?(re.flags|=67108866,X):se):(re.flags|=67108866,X)):(re.flags|=1048576,X)}function D(re){return c&&re.alternate===null&&(re.flags|=67108866),re}function L(re,X,se,ye){return X===null||X.tag!==6?(X=ww(se,re.mode,ye),X.return=re,X):(X=T(X,se),X.return=re,X)}function Y(re,X,se,ye){var Ge=se.type;return Ge===w?he(re,X,se.props.children,ye,se.key):X!==null&&(X.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===R&&Xu(Ge)===X.type)?(X=T(X,se.props),_p(X,se),X.return=re,X):(X=jy(se.type,se.key,se.props,null,re.mode,ye),_p(X,se),X.return=re,X)}function oe(re,X,se,ye){return X===null||X.tag!==4||X.stateNode.containerInfo!==se.containerInfo||X.stateNode.implementation!==se.implementation?(X=Cw(se,re.mode,ye),X.return=re,X):(X=T(X,se.children||[]),X.return=re,X)}function he(re,X,se,ye,Ge){return X===null||X.tag!==7?(X=Vu(se,re.mode,ye,Ge),X.return=re,X):(X=T(X,se),X.return=re,X)}function Se(re,X,se){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=ww(""+X,re.mode,se),X.return=re,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case m:return se=jy(X.type,X.key,X.props,null,re.mode,se),_p(se,X),se.return=re,se;case b:return X=Cw(X,re.mode,se),X.return=re,X;case R:return X=Xu(X),Se(re,X,se)}if(K(X)||H(X))return X=Vu(X,re.mode,se,null),X.return=re,X;if(typeof X.then=="function")return Se(re,Hy(X),se);if(X.$$typeof===P)return Se(re,zy(re,X),se);$y(re,X)}return null}function ae(re,X,se,ye){var Ge=X!==null?X.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Ge!==null?null:L(re,X,""+se,ye);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case m:return se.key===Ge?Y(re,X,se,ye):null;case b:return se.key===Ge?oe(re,X,se,ye):null;case R:return se=Xu(se),ae(re,X,se,ye)}if(K(se)||H(se))return Ge!==null?null:he(re,X,se,ye,null);if(typeof se.then=="function")return ae(re,X,Hy(se),ye);if(se.$$typeof===P)return ae(re,X,zy(re,se),ye);$y(re,se)}return null}function ue(re,X,se,ye,Ge){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return re=re.get(se)||null,L(X,re,""+ye,Ge);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case m:return re=re.get(ye.key===null?se:ye.key)||null,Y(X,re,ye,Ge);case b:return re=re.get(ye.key===null?se:ye.key)||null,oe(X,re,ye,Ge);case R:return ye=Xu(ye),ue(re,X,se,ye,Ge)}if(K(ye)||H(ye))return re=re.get(se)||null,he(X,re,ye,Ge,null);if(typeof ye.then=="function")return ue(re,X,se,Hy(ye),Ge);if(ye.$$typeof===P)return ue(re,X,se,zy(X,ye),Ge);$y(X,ye)}return null}function Ue(re,X,se,ye){for(var Ge=null,Bt=null,$e=X,mt=X=0,It=null;$e!==null&&mt<se.length;mt++){$e.index>mt?(It=$e,$e=null):It=$e.sibling;var Ft=ae(re,$e,se[mt],ye);if(Ft===null){$e===null&&($e=It);break}c&&$e&&Ft.alternate===null&&d(re,$e),X=_(Ft,X,mt),Bt===null?Ge=Ft:Bt.sibling=Ft,Bt=Ft,$e=It}if(mt===se.length)return p(re,$e),Ot&&yl(re,mt),Ge;if($e===null){for(;mt<se.length;mt++)$e=Se(re,se[mt],ye),$e!==null&&(X=_($e,X,mt),Bt===null?Ge=$e:Bt.sibling=$e,Bt=$e);return Ot&&yl(re,mt),Ge}for($e=S($e);mt<se.length;mt++)It=ue($e,re,mt,se[mt],ye),It!==null&&(c&&It.alternate!==null&&$e.delete(It.key===null?mt:It.key),X=_(It,X,mt),Bt===null?Ge=It:Bt.sibling=It,Bt=It);return c&&$e.forEach(function(jc){return d(re,jc)}),Ot&&yl(re,mt),Ge}function et(re,X,se,ye){if(se==null)throw Error(r(151));for(var Ge=null,Bt=null,$e=X,mt=X=0,It=null,Ft=se.next();$e!==null&&!Ft.done;mt++,Ft=se.next()){$e.index>mt?(It=$e,$e=null):It=$e.sibling;var jc=ae(re,$e,Ft.value,ye);if(jc===null){$e===null&&($e=It);break}c&&$e&&jc.alternate===null&&d(re,$e),X=_(jc,X,mt),Bt===null?Ge=jc:Bt.sibling=jc,Bt=jc,$e=It}if(Ft.done)return p(re,$e),Ot&&yl(re,mt),Ge;if($e===null){for(;!Ft.done;mt++,Ft=se.next())Ft=Se(re,Ft.value,ye),Ft!==null&&(X=_(Ft,X,mt),Bt===null?Ge=Ft:Bt.sibling=Ft,Bt=Ft);return Ot&&yl(re,mt),Ge}for($e=S($e);!Ft.done;mt++,Ft=se.next())Ft=ue($e,re,mt,Ft.value,ye),Ft!==null&&(c&&Ft.alternate!==null&&$e.delete(Ft.key===null?mt:Ft.key),X=_(Ft,X,mt),Bt===null?Ge=Ft:Bt.sibling=Ft,Bt=Ft);return c&&$e.forEach(function(SZ){return d(re,SZ)}),Ot&&yl(re,mt),Ge}function nn(re,X,se,ye){if(typeof se=="object"&&se!==null&&se.type===w&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case m:e:{for(var Ge=se.key;X!==null;){if(X.key===Ge){if(Ge=se.type,Ge===w){if(X.tag===7){p(re,X.sibling),ye=T(X,se.props.children),ye.return=re,re=ye;break e}}else if(X.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===R&&Xu(Ge)===X.type){p(re,X.sibling),ye=T(X,se.props),_p(ye,se),ye.return=re,re=ye;break e}p(re,X);break}else d(re,X);X=X.sibling}se.type===w?(ye=Vu(se.props.children,re.mode,ye,se.key),ye.return=re,re=ye):(ye=jy(se.type,se.key,se.props,null,re.mode,ye),_p(ye,se),ye.return=re,re=ye)}return D(re);case b:e:{for(Ge=se.key;X!==null;){if(X.key===Ge)if(X.tag===4&&X.stateNode.containerInfo===se.containerInfo&&X.stateNode.implementation===se.implementation){p(re,X.sibling),ye=T(X,se.children||[]),ye.return=re,re=ye;break e}else{p(re,X);break}else d(re,X);X=X.sibling}ye=Cw(se,re.mode,ye),ye.return=re,re=ye}return D(re);case R:return se=Xu(se),nn(re,X,se,ye)}if(K(se))return Ue(re,X,se,ye);if(H(se)){if(Ge=H(se),typeof Ge!="function")throw Error(r(150));return se=Ge.call(se),et(re,X,se,ye)}if(typeof se.then=="function")return nn(re,X,Hy(se),ye);if(se.$$typeof===P)return nn(re,X,zy(re,se),ye);$y(re,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,X!==null&&X.tag===6?(p(re,X.sibling),ye=T(X,se),ye.return=re,re=ye):(p(re,X),ye=ww(se,re.mode,ye),ye.return=re,re=ye),D(re)):p(re,X)}return function(re,X,se,ye){try{Ep=0;var Ge=nn(re,X,se,ye);return vh=null,Ge}catch($e){if($e===bh||$e===Fy)throw $e;var Bt=Ks(29,$e,null,re.mode);return Bt.lanes=ye,Bt.return=re,Bt}}}var Ju=PA(!0),IA=PA(!1),Sc=!1;function jw(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lw(c,d){c=c.updateQueue,d.updateQueue===c&&(d.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function bc(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function vc(c,d,p){var S=c.updateQueue;if(S===null)return null;if(S=S.shared,($t&2)!==0){var T=S.pending;return T===null?d.next=d:(d.next=T.next,T.next=d),S.pending=d,d=Ry(c),dA(c,null,p),d}return Dy(c,S,d,p),Ry(c)}function Pp(c,d,p){if(d=d.updateQueue,d!==null&&(d=d.shared,(p&4194048)!==0)){var S=d.lanes;S&=c.pendingLanes,p|=S,d.lanes=p,fs(c,p)}}function Nw(c,d){var p=c.updateQueue,S=c.alternate;if(S!==null&&(S=S.updateQueue,p===S)){var T=null,_=null;if(p=p.firstBaseUpdate,p!==null){do{var D={lane:p.lane,tag:p.tag,payload:p.payload,callback:null,next:null};_===null?T=_=D:_=_.next=D,p=p.next}while(p!==null);_===null?T=_=d:_=_.next=d}else T=_=d;p={baseState:S.baseState,firstBaseUpdate:T,lastBaseUpdate:_,shared:S.shared,callbacks:S.callbacks},c.updateQueue=p;return}c=p.lastBaseUpdate,c===null?p.firstBaseUpdate=d:c.next=d,p.lastBaseUpdate=d}var zw=!1;function Ip(){if(zw){var c=Sh;if(c!==null)throw c}}function kp(c,d,p,S){zw=!1;var T=c.updateQueue;Sc=!1;var _=T.firstBaseUpdate,D=T.lastBaseUpdate,L=T.shared.pending;if(L!==null){T.shared.pending=null;var Y=L,oe=Y.next;Y.next=null,D===null?_=oe:D.next=oe,D=Y;var he=c.alternate;he!==null&&(he=he.updateQueue,L=he.lastBaseUpdate,L!==D&&(L===null?he.firstBaseUpdate=oe:L.next=oe,he.lastBaseUpdate=Y))}if(_!==null){var Se=T.baseState;D=0,he=oe=Y=null,L=_;do{var ae=L.lane&-536870913,ue=ae!==L.lane;if(ue?(Pt&ae)===ae:(S&ae)===ae){ae!==0&&ae===yh&&(zw=!0),he!==null&&(he=he.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Ue=c,et=L;ae=d;var nn=p;switch(et.tag){case 1:if(Ue=et.payload,typeof Ue=="function"){Se=Ue.call(nn,Se,ae);break e}Se=Ue;break e;case 3:Ue.flags=Ue.flags&-65537|128;case 0:if(Ue=et.payload,ae=typeof Ue=="function"?Ue.call(nn,Se,ae):Ue,ae==null)break e;Se=h({},Se,ae);break e;case 2:Sc=!0}}ae=L.callback,ae!==null&&(c.flags|=64,ue&&(c.flags|=8192),ue=T.callbacks,ue===null?T.callbacks=[ae]:ue.push(ae))}else ue={lane:ae,tag:L.tag,payload:L.payload,callback:L.callback,next:null},he===null?(oe=he=ue,Y=Se):he=he.next=ue,D|=ae;if(L=L.next,L===null){if(L=T.shared.pending,L===null)break;ue=L,L=ue.next,ue.next=null,T.lastBaseUpdate=ue,T.shared.pending=null}}while(!0);he===null&&(Y=Se),T.baseState=Y,T.firstBaseUpdate=oe,T.lastBaseUpdate=he,_===null&&(T.shared.lanes=0),Ec|=D,c.lanes=D,c.memoizedState=Se}}function kA(c,d){if(typeof c!="function")throw Error(r(191,c));c.call(d)}function MA(c,d){var p=c.callbacks;if(p!==null)for(c.callbacks=null,c=0;c<p.length;c++)kA(p[c],d)}var xh=U(null),Ky=U(0);function AA(c,d){c=Il,le(Ky,c),le(xh,d),Il=c|d.baseLanes}function Bw(){le(Ky,Il),le(xh,xh.current)}function Fw(){Il=Ky.current,ne(xh),ne(Ky)}var Vs=U(null),Io=null;function xc(c){var d=c.alternate;le(er,er.current&1),le(Vs,c),Io===null&&(d===null||xh.current!==null||d.memoizedState!==null)&&(Io=c)}function Uw(c){le(er,er.current),le(Vs,c),Io===null&&(Io=c)}function OA(c){c.tag===22?(le(er,er.current),le(Vs,c),Io===null&&(Io=c)):wc()}function wc(){le(er,er.current),le(Vs,Vs.current)}function qs(c){ne(Vs),Io===c&&(Io=null),ne(er)}var er=U(0);function Vy(c){for(var d=c;d!==null;){if(d.tag===13){var p=d.memoizedState;if(p!==null&&(p=p.dehydrated,p===null||G1(p)||Y1(p)))return d}else if(d.tag===19&&(d.memoizedProps.revealOrder==="forwards"||d.memoizedProps.revealOrder==="backwards"||d.memoizedProps.revealOrder==="unstable_legacy-backwards"||d.memoizedProps.revealOrder==="together")){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var vl=0,ft=null,en=null,pr=null,qy=!1,wh=!1,Qu=!1,Gy=0,Mp=0,Ch=null,lX=0;function Fn(){throw Error(r(321))}function Hw(c,d){if(d===null)return!1;for(var p=0;p<d.length&&p<c.length;p++)if(!$s(c[p],d[p]))return!1;return!0}function $w(c,d,p,S,T,_){return vl=_,ft=d,d.memoizedState=null,d.updateQueue=null,d.lanes=0,B.H=c===null||c.memoizedState===null?gO:i1,Qu=!1,_=p(S,T),Qu=!1,wh&&(_=RA(d,p,S,T)),DA(c),_}function DA(c){B.H=Dp;var d=en!==null&&en.next!==null;if(vl=0,pr=en=ft=null,qy=!1,Mp=0,Ch=null,d)throw Error(r(300));c===null||gr||(c=c.dependencies,c!==null&&Ny(c)&&(gr=!0))}function RA(c,d,p,S){ft=c;var T=0;do{if(wh&&(Ch=null),Mp=0,wh=!1,25<=T)throw Error(r(301));if(T+=1,pr=en=null,c.updateQueue!=null){var _=c.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}B.H=mO,_=d(p,S)}while(wh);return _}function cX(){var c=B.H,d=c.useState()[0];return d=typeof d.then=="function"?Ap(d):d,c=c.useState()[0],(en!==null?en.memoizedState:null)!==c&&(ft.flags|=1024),d}function Kw(){var c=Gy!==0;return Gy=0,c}function Vw(c,d,p){d.updateQueue=c.updateQueue,d.flags&=-2053,c.lanes&=~p}function qw(c){if(qy){for(c=c.memoizedState;c!==null;){var d=c.queue;d!==null&&(d.pending=null),c=c.next}qy=!1}vl=0,pr=en=ft=null,wh=!1,Mp=Gy=0,Ch=null}function Ki(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pr===null?ft.memoizedState=pr=c:pr=pr.next=c,pr}function tr(){if(en===null){var c=ft.alternate;c=c!==null?c.memoizedState:null}else c=en.next;var d=pr===null?ft.memoizedState:pr.next;if(d!==null)pr=d,en=c;else{if(c===null)throw ft.alternate===null?Error(r(467)):Error(r(310));en=c,c={memoizedState:en.memoizedState,baseState:en.baseState,baseQueue:en.baseQueue,queue:en.queue,next:null},pr===null?ft.memoizedState=pr=c:pr=pr.next=c}return pr}function Yy(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ap(c){var d=Mp;return Mp+=1,Ch===null&&(Ch=[]),c=TA(Ch,c,d),d=ft,(pr===null?d.memoizedState:pr.next)===null&&(d=d.alternate,B.H=d===null||d.memoizedState===null?gO:i1),c}function Wy(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return Ap(c);if(c.$$typeof===P)return Xr(c)}throw Error(r(438,String(c)))}function Gw(c){var d=null,p=ft.updateQueue;if(p!==null&&(d=p.memoCache),d==null){var S=ft.alternate;S!==null&&(S=S.updateQueue,S!==null&&(S=S.memoCache,S!=null&&(d={data:S.data.map(function(T){return T.slice()}),index:0})))}if(d==null&&(d={data:[],index:0}),p===null&&(p=Yy(),ft.updateQueue=p),p.memoCache=d,p=d.data[d.index],p===void 0)for(p=d.data[d.index]=Array(c),S=0;S<c;S++)p[S]=N;return d.index++,p}function xl(c,d){return typeof d=="function"?d(c):d}function Xy(c){var d=tr();return Yw(d,en,c)}function Yw(c,d,p){var S=c.queue;if(S===null)throw Error(r(311));S.lastRenderedReducer=p;var T=c.baseQueue,_=S.pending;if(_!==null){if(T!==null){var D=T.next;T.next=_.next,_.next=D}d.baseQueue=T=_,S.pending=null}if(_=c.baseState,T===null)c.memoizedState=_;else{d=T.next;var L=D=null,Y=null,oe=d,he=!1;do{var Se=oe.lane&-536870913;if(Se!==oe.lane?(Pt&Se)===Se:(vl&Se)===Se){var ae=oe.revertLane;if(ae===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),Se===yh&&(he=!0);else if((vl&ae)===ae){oe=oe.next,ae===yh&&(he=!0);continue}else Se={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Y===null?(L=Y=Se,D=_):Y=Y.next=Se,ft.lanes|=ae,Ec|=ae;Se=oe.action,Qu&&p(_,Se),_=oe.hasEagerState?oe.eagerState:p(_,Se)}else ae={lane:Se,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},Y===null?(L=Y=ae,D=_):Y=Y.next=ae,ft.lanes|=Se,Ec|=Se;oe=oe.next}while(oe!==null&&oe!==d);if(Y===null?D=_:Y.next=L,!$s(_,c.memoizedState)&&(gr=!0,he&&(p=Sh,p!==null)))throw p;c.memoizedState=_,c.baseState=D,c.baseQueue=Y,S.lastRenderedState=_}return T===null&&(S.lanes=0),[c.memoizedState,S.dispatch]}function Ww(c){var d=tr(),p=d.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=c;var S=p.dispatch,T=p.pending,_=d.memoizedState;if(T!==null){p.pending=null;var D=T=T.next;do _=c(_,D.action),D=D.next;while(D!==T);$s(_,d.memoizedState)||(gr=!0),d.memoizedState=_,d.baseQueue===null&&(d.baseState=_),p.lastRenderedState=_}return[_,S]}function jA(c,d,p){var S=ft,T=tr(),_=Ot;if(_){if(p===void 0)throw Error(r(407));p=p()}else p=d();var D=!$s((en||T).memoizedState,p);if(D&&(T.memoizedState=p,gr=!0),T=T.queue,Jw(zA.bind(null,S,T,c),[c]),T.getSnapshot!==d||D||pr!==null&&pr.memoizedState.tag&1){if(S.flags|=2048,Th(9,{destroy:void 0},NA.bind(null,S,T,p,d),null),cn===null)throw Error(r(349));_||(vl&127)!==0||LA(S,d,p)}return p}function LA(c,d,p){c.flags|=16384,c={getSnapshot:d,value:p},d=ft.updateQueue,d===null?(d=Yy(),ft.updateQueue=d,d.stores=[c]):(p=d.stores,p===null?d.stores=[c]:p.push(c))}function NA(c,d,p,S){d.value=p,d.getSnapshot=S,BA(d)&&FA(c)}function zA(c,d,p){return p(function(){BA(d)&&FA(c)})}function BA(c){var d=c.getSnapshot;c=c.value;try{var p=d();return!$s(c,p)}catch{return!0}}function FA(c){var d=Ku(c,2);d!==null&&ws(d,c,2)}function Xw(c){var d=Ki();if(typeof c=="function"){var p=c;if(c=p(),Qu){pn(!0);try{p()}finally{pn(!1)}}}return d.memoizedState=d.baseState=c,d.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:c},d}function UA(c,d,p,S){return c.baseState=p,Yw(c,en,typeof S=="function"?S:xl)}function uX(c,d,p,S,T){if(Qy(c))throw Error(r(485));if(c=d.action,c!==null){var _={payload:T,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){_.listeners.push(D)}};B.T!==null?p(!0):_.isTransition=!1,S(_),p=d.pending,p===null?(_.next=d.pending=_,HA(d,_)):(_.next=p.next,d.pending=p.next=_)}}function HA(c,d){var p=d.action,S=d.payload,T=c.state;if(d.isTransition){var _=B.T,D={};B.T=D;try{var L=p(T,S),Y=B.S;Y!==null&&Y(D,L),$A(c,d,L)}catch(oe){Zw(c,d,oe)}finally{_!==null&&D.types!==null&&(_.types=D.types),B.T=_}}else try{_=p(T,S),$A(c,d,_)}catch(oe){Zw(c,d,oe)}}function $A(c,d,p){p!==null&&typeof p=="object"&&typeof p.then=="function"?p.then(function(S){KA(c,d,S)},function(S){return Zw(c,d,S)}):KA(c,d,p)}function KA(c,d,p){d.status="fulfilled",d.value=p,VA(d),c.state=p,d=c.pending,d!==null&&(p=d.next,p===d?c.pending=null:(p=p.next,d.next=p,HA(c,p)))}function Zw(c,d,p){var S=c.pending;if(c.pending=null,S!==null){S=S.next;do d.status="rejected",d.reason=p,VA(d),d=d.next;while(d!==S)}c.action=null}function VA(c){c=c.listeners;for(var d=0;d<c.length;d++)(0,c[d])()}function qA(c,d){return d}function GA(c,d){if(Ot){var p=cn.formState;if(p!==null){e:{var S=ft;if(Ot){if(gn){t:{for(var T=gn,_=Po;T.nodeType!==8;){if(!_){T=null;break t}if(T=ko(T.nextSibling),T===null){T=null;break t}}_=T.data,T=_==="F!"||_==="F"?T:null}if(T){gn=ko(T.nextSibling),S=T.data==="F!";break e}}mc(S)}S=!1}S&&(d=p[0])}}return p=Ki(),p.memoizedState=p.baseState=d,S={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qA,lastRenderedState:d},p.queue=S,p=hO.bind(null,ft,S),S.dispatch=p,S=Xw(!1),_=r1.bind(null,ft,!1,S.queue),S=Ki(),T={state:d,dispatch:null,action:c,pending:null},S.queue=T,p=uX.bind(null,ft,T,_,p),T.dispatch=p,S.memoizedState=c,[d,p,!1]}function YA(c){var d=tr();return WA(d,en,c)}function WA(c,d,p){if(d=Yw(c,d,qA)[0],c=Xy(xl)[0],typeof d=="object"&&d!==null&&typeof d.then=="function")try{var S=Ap(d)}catch(D){throw D===bh?Fy:D}else S=d;d=tr();var T=d.queue,_=T.dispatch;return p!==d.memoizedState&&(ft.flags|=2048,Th(9,{destroy:void 0},dX.bind(null,T,p),null)),[S,_,c]}function dX(c,d){c.action=d}function XA(c){var d=tr(),p=en;if(p!==null)return WA(d,p,c);tr(),d=d.memoizedState,p=tr();var S=p.queue.dispatch;return p.memoizedState=c,[d,S,!1]}function Th(c,d,p,S){return c={tag:c,create:p,deps:S,inst:d,next:null},d=ft.updateQueue,d===null&&(d=Yy(),ft.updateQueue=d),p=d.lastEffect,p===null?d.lastEffect=c.next=c:(S=p.next,p.next=c,c.next=S,d.lastEffect=c),c}function ZA(){return tr().memoizedState}function Zy(c,d,p,S){var T=Ki();ft.flags|=c,T.memoizedState=Th(1|d,{destroy:void 0},p,S===void 0?null:S)}function Jy(c,d,p,S){var T=tr();S=S===void 0?null:S;var _=T.memoizedState.inst;en!==null&&S!==null&&Hw(S,en.memoizedState.deps)?T.memoizedState=Th(d,_,p,S):(ft.flags|=c,T.memoizedState=Th(1|d,_,p,S))}function JA(c,d){Zy(8390656,8,c,d)}function Jw(c,d){Jy(2048,8,c,d)}function hX(c){ft.flags|=4;var d=ft.updateQueue;if(d===null)d=Yy(),ft.updateQueue=d,d.events=[c];else{var p=d.events;p===null?d.events=[c]:p.push(c)}}function QA(c){var d=tr().memoizedState;return hX({ref:d,nextImpl:c}),function(){if(($t&2)!==0)throw Error(r(440));return d.impl.apply(void 0,arguments)}}function eO(c,d){return Jy(4,2,c,d)}function tO(c,d){return Jy(4,4,c,d)}function nO(c,d){if(typeof d=="function"){c=c();var p=d(c);return function(){typeof p=="function"?p():d(null)}}if(d!=null)return c=c(),d.current=c,function(){d.current=null}}function rO(c,d,p){p=p!=null?p.concat([c]):null,Jy(4,4,nO.bind(null,d,c),p)}function Qw(){}function iO(c,d){var p=tr();d=d===void 0?null:d;var S=p.memoizedState;return d!==null&&Hw(d,S[1])?S[0]:(p.memoizedState=[c,d],c)}function sO(c,d){var p=tr();d=d===void 0?null:d;var S=p.memoizedState;if(d!==null&&Hw(d,S[1]))return S[0];if(S=c(),Qu){pn(!0);try{c()}finally{pn(!1)}}return p.memoizedState=[S,d],S}function e1(c,d,p){return p===void 0||(vl&1073741824)!==0&&(Pt&261930)===0?c.memoizedState=d:(c.memoizedState=p,c=oD(),ft.lanes|=c,Ec|=c,p)}function oO(c,d,p,S){return $s(p,d)?p:xh.current!==null?(c=e1(c,p,S),$s(c,d)||(gr=!0),c):(vl&42)===0||(vl&1073741824)!==0&&(Pt&261930)===0?(gr=!0,c.memoizedState=p):(c=oD(),ft.lanes|=c,Ec|=c,d)}function aO(c,d,p,S,T){var _=G.p;G.p=_!==0&&8>_?_:8;var D=B.T,L={};B.T=L,r1(c,!1,d,p);try{var Y=T(),oe=B.S;if(oe!==null&&oe(L,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var he=aX(Y,S);Op(c,d,he,Ws(c))}else Op(c,d,S,Ws(c))}catch(Se){Op(c,d,{then:function(){},status:"rejected",reason:Se},Ws())}finally{G.p=_,D!==null&&L.types!==null&&(D.types=L.types),B.T=D}}function fX(){}function t1(c,d,p,S){if(c.tag!==5)throw Error(r(476));var T=lO(c).queue;aO(c,T,d,W,p===null?fX:function(){return cO(c),p(S)})}function lO(c){var d=c.memoizedState;if(d!==null)return d;d={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:W},next:null};var p={};return d.next={memoizedState:p,baseState:p,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xl,lastRenderedState:p},next:null},c.memoizedState=d,c=c.alternate,c!==null&&(c.memoizedState=d),d}function cO(c){var d=lO(c);d.next===null&&(d=c.alternate.memoizedState),Op(c,d.next.queue,{},Ws())}function n1(){return Xr(Wp)}function uO(){return tr().memoizedState}function dO(){return tr().memoizedState}function pX(c){for(var d=c.return;d!==null;){switch(d.tag){case 24:case 3:var p=Ws();c=bc(p);var S=vc(d,c,p);S!==null&&(ws(S,d,p),Pp(S,d,p)),d={cache:Aw()},c.payload=d;return}d=d.return}}function gX(c,d,p){var S=Ws();p={lane:S,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Qy(c)?fO(d,p):(p=vw(c,d,p,S),p!==null&&(ws(p,c,S),pO(p,d,S)))}function hO(c,d,p){var S=Ws();Op(c,d,p,S)}function Op(c,d,p,S){var T={lane:S,revertLane:0,gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null};if(Qy(c))fO(d,T);else{var _=c.alternate;if(c.lanes===0&&(_===null||_.lanes===0)&&(_=d.lastRenderedReducer,_!==null))try{var D=d.lastRenderedState,L=_(D,p);if(T.hasEagerState=!0,T.eagerState=L,$s(L,D))return Dy(c,d,T,0),cn===null&&Oy(),!1}catch{}if(p=vw(c,d,T,S),p!==null)return ws(p,c,S),pO(p,d,S),!0}return!1}function r1(c,d,p,S){if(S={lane:2,revertLane:j1(),gesture:null,action:S,hasEagerState:!1,eagerState:null,next:null},Qy(c)){if(d)throw Error(r(479))}else d=vw(c,p,S,2),d!==null&&ws(d,c,2)}function Qy(c){var d=c.alternate;return c===ft||d!==null&&d===ft}function fO(c,d){wh=qy=!0;var p=c.pending;p===null?d.next=d:(d.next=p.next,p.next=d),c.pending=d}function pO(c,d,p){if((p&4194048)!==0){var S=d.lanes;S&=c.pendingLanes,p|=S,d.lanes=p,fs(c,p)}}var Dp={readContext:Xr,use:Wy,useCallback:Fn,useContext:Fn,useEffect:Fn,useImperativeHandle:Fn,useLayoutEffect:Fn,useInsertionEffect:Fn,useMemo:Fn,useReducer:Fn,useRef:Fn,useState:Fn,useDebugValue:Fn,useDeferredValue:Fn,useTransition:Fn,useSyncExternalStore:Fn,useId:Fn,useHostTransitionStatus:Fn,useFormState:Fn,useActionState:Fn,useOptimistic:Fn,useMemoCache:Fn,useCacheRefresh:Fn};Dp.useEffectEvent=Fn;var gO={readContext:Xr,use:Wy,useCallback:function(c,d){return Ki().memoizedState=[c,d===void 0?null:d],c},useContext:Xr,useEffect:JA,useImperativeHandle:function(c,d,p){p=p!=null?p.concat([c]):null,Zy(4194308,4,nO.bind(null,d,c),p)},useLayoutEffect:function(c,d){return Zy(4194308,4,c,d)},useInsertionEffect:function(c,d){Zy(4,2,c,d)},useMemo:function(c,d){var p=Ki();d=d===void 0?null:d;var S=c();if(Qu){pn(!0);try{c()}finally{pn(!1)}}return p.memoizedState=[S,d],S},useReducer:function(c,d,p){var S=Ki();if(p!==void 0){var T=p(d);if(Qu){pn(!0);try{p(d)}finally{pn(!1)}}}else T=d;return S.memoizedState=S.baseState=T,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:T},S.queue=c,c=c.dispatch=gX.bind(null,ft,c),[S.memoizedState,c]},useRef:function(c){var d=Ki();return c={current:c},d.memoizedState=c},useState:function(c){c=Xw(c);var d=c.queue,p=hO.bind(null,ft,d);return d.dispatch=p,[c.memoizedState,p]},useDebugValue:Qw,useDeferredValue:function(c,d){var p=Ki();return e1(p,c,d)},useTransition:function(){var c=Xw(!1);return c=aO.bind(null,ft,c.queue,!0,!1),Ki().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,d,p){var S=ft,T=Ki();if(Ot){if(p===void 0)throw Error(r(407));p=p()}else{if(p=d(),cn===null)throw Error(r(349));(Pt&127)!==0||LA(S,d,p)}T.memoizedState=p;var _={value:p,getSnapshot:d};return T.queue=_,JA(zA.bind(null,S,_,c),[c]),S.flags|=2048,Th(9,{destroy:void 0},NA.bind(null,S,_,p,d),null),p},useId:function(){var c=Ki(),d=cn.identifierPrefix;if(Ot){var p=Pa,S=_a;p=(S&~(1<<32-An(S)-1)).toString(32)+p,d="_"+d+"R_"+p,p=Gy++,0<p&&(d+="H"+p.toString(32)),d+="_"}else p=lX++,d="_"+d+"r_"+p.toString(32)+"_";return c.memoizedState=d},useHostTransitionStatus:n1,useFormState:GA,useActionState:GA,useOptimistic:function(c){var d=Ki();d.memoizedState=d.baseState=c;var p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return d.queue=p,d=r1.bind(null,ft,!0,p),p.dispatch=d,[c,d]},useMemoCache:Gw,useCacheRefresh:function(){return Ki().memoizedState=pX.bind(null,ft)},useEffectEvent:function(c){var d=Ki(),p={impl:c};return d.memoizedState=p,function(){if(($t&2)!==0)throw Error(r(440));return p.impl.apply(void 0,arguments)}}},i1={readContext:Xr,use:Wy,useCallback:iO,useContext:Xr,useEffect:Jw,useImperativeHandle:rO,useInsertionEffect:eO,useLayoutEffect:tO,useMemo:sO,useReducer:Xy,useRef:ZA,useState:function(){return Xy(xl)},useDebugValue:Qw,useDeferredValue:function(c,d){var p=tr();return oO(p,en.memoizedState,c,d)},useTransition:function(){var c=Xy(xl)[0],d=tr().memoizedState;return[typeof c=="boolean"?c:Ap(c),d]},useSyncExternalStore:jA,useId:uO,useHostTransitionStatus:n1,useFormState:YA,useActionState:YA,useOptimistic:function(c,d){var p=tr();return UA(p,en,c,d)},useMemoCache:Gw,useCacheRefresh:dO};i1.useEffectEvent=QA;var mO={readContext:Xr,use:Wy,useCallback:iO,useContext:Xr,useEffect:Jw,useImperativeHandle:rO,useInsertionEffect:eO,useLayoutEffect:tO,useMemo:sO,useReducer:Ww,useRef:ZA,useState:function(){return Ww(xl)},useDebugValue:Qw,useDeferredValue:function(c,d){var p=tr();return en===null?e1(p,c,d):oO(p,en.memoizedState,c,d)},useTransition:function(){var c=Ww(xl)[0],d=tr().memoizedState;return[typeof c=="boolean"?c:Ap(c),d]},useSyncExternalStore:jA,useId:uO,useHostTransitionStatus:n1,useFormState:XA,useActionState:XA,useOptimistic:function(c,d){var p=tr();return en!==null?UA(p,en,c,d):(p.baseState=c,[c,p.queue.dispatch])},useMemoCache:Gw,useCacheRefresh:dO};mO.useEffectEvent=QA;function s1(c,d,p,S){d=c.memoizedState,p=p(S,d),p=p==null?d:h({},d,p),c.memoizedState=p,c.lanes===0&&(c.updateQueue.baseState=p)}var o1={enqueueSetState:function(c,d,p){c=c._reactInternals;var S=Ws(),T=bc(S);T.payload=d,p!=null&&(T.callback=p),d=vc(c,T,S),d!==null&&(ws(d,c,S),Pp(d,c,S))},enqueueReplaceState:function(c,d,p){c=c._reactInternals;var S=Ws(),T=bc(S);T.tag=1,T.payload=d,p!=null&&(T.callback=p),d=vc(c,T,S),d!==null&&(ws(d,c,S),Pp(d,c,S))},enqueueForceUpdate:function(c,d){c=c._reactInternals;var p=Ws(),S=bc(p);S.tag=2,d!=null&&(S.callback=d),d=vc(c,S,p),d!==null&&(ws(d,c,p),Pp(d,c,p))}};function yO(c,d,p,S,T,_,D){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(S,_,D):d.prototype&&d.prototype.isPureReactComponent?!bp(p,S)||!bp(T,_):!0}function SO(c,d,p,S){c=d.state,typeof d.componentWillReceiveProps=="function"&&d.componentWillReceiveProps(p,S),typeof d.UNSAFE_componentWillReceiveProps=="function"&&d.UNSAFE_componentWillReceiveProps(p,S),d.state!==c&&o1.enqueueReplaceState(d,d.state,null)}function ed(c,d){var p=d;if("ref"in d){p={};for(var S in d)S!=="ref"&&(p[S]=d[S])}if(c=c.defaultProps){p===d&&(p=h({},p));for(var T in c)p[T]===void 0&&(p[T]=c[T])}return p}function bO(c){Ay(c)}function vO(c){console.error(c)}function xO(c){Ay(c)}function eS(c,d){try{var p=c.onUncaughtError;p(d.value,{componentStack:d.stack})}catch(S){setTimeout(function(){throw S})}}function wO(c,d,p){try{var S=c.onCaughtError;S(p.value,{componentStack:p.stack,errorBoundary:d.tag===1?d.stateNode:null})}catch(T){setTimeout(function(){throw T})}}function a1(c,d,p){return p=bc(p),p.tag=3,p.payload={element:null},p.callback=function(){eS(c,d)},p}function CO(c){return c=bc(c),c.tag=3,c}function TO(c,d,p,S){var T=p.type.getDerivedStateFromError;if(typeof T=="function"){var _=S.value;c.payload=function(){return T(_)},c.callback=function(){wO(d,p,S)}}var D=p.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(c.callback=function(){wO(d,p,S),typeof T!="function"&&(_c===null?_c=new Set([this]):_c.add(this));var L=S.stack;this.componentDidCatch(S.value,{componentStack:L!==null?L:""})})}function mX(c,d,p,S,T){if(p.flags|=32768,S!==null&&typeof S=="object"&&typeof S.then=="function"){if(d=p.alternate,d!==null&&mh(d,p,T,!0),p=Vs.current,p!==null){switch(p.tag){case 31:case 13:return Io===null?hS():p.alternate===null&&Un===0&&(Un=3),p.flags&=-257,p.flags|=65536,p.lanes=T,S===Uy?p.flags|=16384:(d=p.updateQueue,d===null?p.updateQueue=new Set([S]):d.add(S),O1(c,S,T)),!1;case 22:return p.flags|=65536,S===Uy?p.flags|=16384:(d=p.updateQueue,d===null?(d={transitions:null,markerInstances:null,retryQueue:new Set([S])},p.updateQueue=d):(p=d.retryQueue,p===null?d.retryQueue=new Set([S]):p.add(S)),O1(c,S,T)),!1}throw Error(r(435,p.tag))}return O1(c,S,T),hS(),!1}if(Ot)return d=Vs.current,d!==null?((d.flags&65536)===0&&(d.flags|=256),d.flags|=65536,d.lanes=T,S!==_w&&(c=Error(r(422),{cause:S}),wp(To(c,p)))):(S!==_w&&(d=Error(r(423),{cause:S}),wp(To(d,p))),c=c.current.alternate,c.flags|=65536,T&=-T,c.lanes|=T,S=To(S,p),T=a1(c.stateNode,S,T),Nw(c,T),Un!==4&&(Un=2)),!1;var _=Error(r(520),{cause:S});if(_=To(_,p),Up===null?Up=[_]:Up.push(_),Un!==4&&(Un=2),d===null)return!0;S=To(S,p),p=d;do{switch(p.tag){case 3:return p.flags|=65536,c=T&-T,p.lanes|=c,c=a1(p.stateNode,S,c),Nw(p,c),!1;case 1:if(d=p.type,_=p.stateNode,(p.flags&128)===0&&(typeof d.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(_c===null||!_c.has(_))))return p.flags|=65536,T&=-T,p.lanes|=T,T=CO(T),TO(T,c,p,S),Nw(p,T),!1}p=p.return}while(p!==null);return!1}var l1=Error(r(461)),gr=!1;function Zr(c,d,p,S){d.child=c===null?IA(d,null,p,S):Ju(d,c.child,p,S)}function EO(c,d,p,S,T){p=p.render;var _=d.ref;if("ref"in S){var D={};for(var L in S)L!=="ref"&&(D[L]=S[L])}else D=S;return Yu(d),S=$w(c,d,p,D,_,T),L=Kw(),c!==null&&!gr?(Vw(c,d,T),wl(c,d,T)):(Ot&&L&&Tw(d),d.flags|=1,Zr(c,d,S,T),d.child)}function _O(c,d,p,S,T){if(c===null){var _=p.type;return typeof _=="function"&&!xw(_)&&_.defaultProps===void 0&&p.compare===null?(d.tag=15,d.type=_,PO(c,d,_,S,T)):(c=jy(p.type,null,S,d,d.mode,T),c.ref=d.ref,c.return=d,d.child=c)}if(_=c.child,!m1(c,T)){var D=_.memoizedProps;if(p=p.compare,p=p!==null?p:bp,p(D,S)&&c.ref===d.ref)return wl(c,d,T)}return d.flags|=1,c=ml(_,S),c.ref=d.ref,c.return=d,d.child=c}function PO(c,d,p,S,T){if(c!==null){var _=c.memoizedProps;if(bp(_,S)&&c.ref===d.ref)if(gr=!1,d.pendingProps=S=_,m1(c,T))(c.flags&131072)!==0&&(gr=!0);else return d.lanes=c.lanes,wl(c,d,T)}return c1(c,d,p,S,T)}function IO(c,d,p,S){var T=S.children,_=c!==null?c.memoizedState:null;if(c===null&&d.stateNode===null&&(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),S.mode==="hidden"){if((d.flags&128)!==0){if(_=_!==null?_.baseLanes|p:p,c!==null){for(S=d.child=c.child,T=0;S!==null;)T=T|S.lanes|S.childLanes,S=S.sibling;S=T&~_}else S=0,d.child=null;return kO(c,d,_,p,S)}if((p&536870912)!==0)d.memoizedState={baseLanes:0,cachePool:null},c!==null&&By(d,_!==null?_.cachePool:null),_!==null?AA(d,_):Bw(),OA(d);else return S=d.lanes=536870912,kO(c,d,_!==null?_.baseLanes|p:p,p,S)}else _!==null?(By(d,_.cachePool),AA(d,_),wc(),d.memoizedState=null):(c!==null&&By(d,null),Bw(),wc());return Zr(c,d,T,p),d.child}function Rp(c,d){return c!==null&&c.tag===22||d.stateNode!==null||(d.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.sibling}function kO(c,d,p,S,T){var _=Dw();return _=_===null?null:{parent:fr._currentValue,pool:_},d.memoizedState={baseLanes:p,cachePool:_},c!==null&&By(d,null),Bw(),OA(d),c!==null&&mh(c,d,S,!0),d.childLanes=T,null}function tS(c,d){return d=rS({mode:d.mode,children:d.children},c.mode),d.ref=c.ref,c.child=d,d.return=c,d}function MO(c,d,p){return Ju(d,c.child,null,p),c=tS(d,d.pendingProps),c.flags|=2,qs(d),d.memoizedState=null,c}function yX(c,d,p){var S=d.pendingProps,T=(d.flags&128)!==0;if(d.flags&=-129,c===null){if(Ot){if(S.mode==="hidden")return c=tS(d,S),d.lanes=536870912,Rp(null,c);if(Uw(d),(c=gn)?(c=HD(c,Po),c=c!==null&&c.data==="&"?c:null,c!==null&&(d.memoizedState={dehydrated:c,treeContext:pc!==null?{id:_a,overflow:Pa}:null,retryLane:536870912,hydrationErrors:null},p=fA(c),p.return=d,d.child=p,Wr=d,gn=null)):c=null,c===null)throw mc(d);return d.lanes=536870912,null}return tS(d,S)}var _=c.memoizedState;if(_!==null){var D=_.dehydrated;if(Uw(d),T)if(d.flags&256)d.flags&=-257,d=MO(c,d,p);else if(d.memoizedState!==null)d.child=c.child,d.flags|=128,d=null;else throw Error(r(558));else if(gr||mh(c,d,p,!1),T=(p&c.childLanes)!==0,gr||T){if(S=cn,S!==null&&(D=Jd(S,p),D!==0&&D!==_.retryLane))throw _.retryLane=D,Ku(c,D),ws(S,c,D),l1;hS(),d=MO(c,d,p)}else c=_.treeContext,gn=ko(D.nextSibling),Wr=d,Ot=!0,gc=null,Po=!1,c!==null&&mA(d,c),d=tS(d,S),d.flags|=4096;return d}return c=ml(c.child,{mode:S.mode,children:S.children}),c.ref=d.ref,d.child=c,c.return=d,c}function nS(c,d){var p=d.ref;if(p===null)c!==null&&c.ref!==null&&(d.flags|=4194816);else{if(typeof p!="function"&&typeof p!="object")throw Error(r(284));(c===null||c.ref!==p)&&(d.flags|=4194816)}}function c1(c,d,p,S,T){return Yu(d),p=$w(c,d,p,S,void 0,T),S=Kw(),c!==null&&!gr?(Vw(c,d,T),wl(c,d,T)):(Ot&&S&&Tw(d),d.flags|=1,Zr(c,d,p,T),d.child)}function AO(c,d,p,S,T,_){return Yu(d),d.updateQueue=null,p=RA(d,S,p,T),DA(c),S=Kw(),c!==null&&!gr?(Vw(c,d,_),wl(c,d,_)):(Ot&&S&&Tw(d),d.flags|=1,Zr(c,d,p,_),d.child)}function OO(c,d,p,S,T){if(Yu(d),d.stateNode===null){var _=hh,D=p.contextType;typeof D=="object"&&D!==null&&(_=Xr(D)),_=new p(S,_),d.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=o1,d.stateNode=_,_._reactInternals=d,_=d.stateNode,_.props=S,_.state=d.memoizedState,_.refs={},jw(d),D=p.contextType,_.context=typeof D=="object"&&D!==null?Xr(D):hh,_.state=d.memoizedState,D=p.getDerivedStateFromProps,typeof D=="function"&&(s1(d,p,D,S),_.state=d.memoizedState),typeof p.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(D=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),D!==_.state&&o1.enqueueReplaceState(_,_.state,null),kp(d,S,_,T),Ip(),_.state=d.memoizedState),typeof _.componentDidMount=="function"&&(d.flags|=4194308),S=!0}else if(c===null){_=d.stateNode;var L=d.memoizedProps,Y=ed(p,L);_.props=Y;var oe=_.context,he=p.contextType;D=hh,typeof he=="object"&&he!==null&&(D=Xr(he));var Se=p.getDerivedStateFromProps;he=typeof Se=="function"||typeof _.getSnapshotBeforeUpdate=="function",L=d.pendingProps!==L,he||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(L||oe!==D)&&SO(d,_,S,D),Sc=!1;var ae=d.memoizedState;_.state=ae,kp(d,S,_,T),Ip(),oe=d.memoizedState,L||ae!==oe||Sc?(typeof Se=="function"&&(s1(d,p,Se,S),oe=d.memoizedState),(Y=Sc||yO(d,p,Y,S,ae,oe,D))?(he||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(d.flags|=4194308)):(typeof _.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=S,d.memoizedState=oe),_.props=S,_.state=oe,_.context=D,S=Y):(typeof _.componentDidMount=="function"&&(d.flags|=4194308),S=!1)}else{_=d.stateNode,Lw(c,d),D=d.memoizedProps,he=ed(p,D),_.props=he,Se=d.pendingProps,ae=_.context,oe=p.contextType,Y=hh,typeof oe=="object"&&oe!==null&&(Y=Xr(oe)),L=p.getDerivedStateFromProps,(oe=typeof L=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(D!==Se||ae!==Y)&&SO(d,_,S,Y),Sc=!1,ae=d.memoizedState,_.state=ae,kp(d,S,_,T),Ip();var ue=d.memoizedState;D!==Se||ae!==ue||Sc||c!==null&&c.dependencies!==null&&Ny(c.dependencies)?(typeof L=="function"&&(s1(d,p,L,S),ue=d.memoizedState),(he=Sc||yO(d,p,he,S,ae,ue,Y)||c!==null&&c.dependencies!==null&&Ny(c.dependencies))?(oe||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(S,ue,Y),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(S,ue,Y)),typeof _.componentDidUpdate=="function"&&(d.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof _.componentDidUpdate!="function"||D===c.memoizedProps&&ae===c.memoizedState||(d.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===c.memoizedProps&&ae===c.memoizedState||(d.flags|=1024),d.memoizedProps=S,d.memoizedState=ue),_.props=S,_.state=ue,_.context=Y,S=he):(typeof _.componentDidUpdate!="function"||D===c.memoizedProps&&ae===c.memoizedState||(d.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||D===c.memoizedProps&&ae===c.memoizedState||(d.flags|=1024),S=!1)}return _=S,nS(c,d),S=(d.flags&128)!==0,_||S?(_=d.stateNode,p=S&&typeof p.getDerivedStateFromError!="function"?null:_.render(),d.flags|=1,c!==null&&S?(d.child=Ju(d,c.child,null,T),d.child=Ju(d,null,p,T)):Zr(c,d,p,T),d.memoizedState=_.state,c=d.child):c=wl(c,d,T),c}function DO(c,d,p,S){return qu(),d.flags|=256,Zr(c,d,p,S),d.child}var u1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function d1(c){return{baseLanes:c,cachePool:wA()}}function h1(c,d,p){return c=c!==null?c.childLanes&~p:0,d&&(c|=Ys),c}function RO(c,d,p){var S=d.pendingProps,T=!1,_=(d.flags&128)!==0,D;if((D=_)||(D=c!==null&&c.memoizedState===null?!1:(er.current&2)!==0),D&&(T=!0,d.flags&=-129),D=(d.flags&32)!==0,d.flags&=-33,c===null){if(Ot){if(T?xc(d):wc(),(c=gn)?(c=HD(c,Po),c=c!==null&&c.data!=="&"?c:null,c!==null&&(d.memoizedState={dehydrated:c,treeContext:pc!==null?{id:_a,overflow:Pa}:null,retryLane:536870912,hydrationErrors:null},p=fA(c),p.return=d,d.child=p,Wr=d,gn=null)):c=null,c===null)throw mc(d);return Y1(c)?d.lanes=32:d.lanes=536870912,null}var L=S.children;return S=S.fallback,T?(wc(),T=d.mode,L=rS({mode:"hidden",children:L},T),S=Vu(S,T,p,null),L.return=d,S.return=d,L.sibling=S,d.child=L,S=d.child,S.memoizedState=d1(p),S.childLanes=h1(c,D,p),d.memoizedState=u1,Rp(null,S)):(xc(d),f1(d,L))}var Y=c.memoizedState;if(Y!==null&&(L=Y.dehydrated,L!==null)){if(_)d.flags&256?(xc(d),d.flags&=-257,d=p1(c,d,p)):d.memoizedState!==null?(wc(),d.child=c.child,d.flags|=128,d=null):(wc(),L=S.fallback,T=d.mode,S=rS({mode:"visible",children:S.children},T),L=Vu(L,T,p,null),L.flags|=2,S.return=d,L.return=d,S.sibling=L,d.child=S,Ju(d,c.child,null,p),S=d.child,S.memoizedState=d1(p),S.childLanes=h1(c,D,p),d.memoizedState=u1,d=Rp(null,S));else if(xc(d),Y1(L)){if(D=L.nextSibling&&L.nextSibling.dataset,D)var oe=D.dgst;D=oe,S=Error(r(419)),S.stack="",S.digest=D,wp({value:S,source:null,stack:null}),d=p1(c,d,p)}else if(gr||mh(c,d,p,!1),D=(p&c.childLanes)!==0,gr||D){if(D=cn,D!==null&&(S=Jd(D,p),S!==0&&S!==Y.retryLane))throw Y.retryLane=S,Ku(c,S),ws(D,c,S),l1;G1(L)||hS(),d=p1(c,d,p)}else G1(L)?(d.flags|=192,d.child=c.child,d=null):(c=Y.treeContext,gn=ko(L.nextSibling),Wr=d,Ot=!0,gc=null,Po=!1,c!==null&&mA(d,c),d=f1(d,S.children),d.flags|=4096);return d}return T?(wc(),L=S.fallback,T=d.mode,Y=c.child,oe=Y.sibling,S=ml(Y,{mode:"hidden",children:S.children}),S.subtreeFlags=Y.subtreeFlags&65011712,oe!==null?L=ml(oe,L):(L=Vu(L,T,p,null),L.flags|=2),L.return=d,S.return=d,S.sibling=L,d.child=S,Rp(null,S),S=d.child,L=c.child.memoizedState,L===null?L=d1(p):(T=L.cachePool,T!==null?(Y=fr._currentValue,T=T.parent!==Y?{parent:Y,pool:Y}:T):T=wA(),L={baseLanes:L.baseLanes|p,cachePool:T}),S.memoizedState=L,S.childLanes=h1(c,D,p),d.memoizedState=u1,Rp(c.child,S)):(xc(d),p=c.child,c=p.sibling,p=ml(p,{mode:"visible",children:S.children}),p.return=d,p.sibling=null,c!==null&&(D=d.deletions,D===null?(d.deletions=[c],d.flags|=16):D.push(c)),d.child=p,d.memoizedState=null,p)}function f1(c,d){return d=rS({mode:"visible",children:d},c.mode),d.return=c,c.child=d}function rS(c,d){return c=Ks(22,c,null,d),c.lanes=0,c}function p1(c,d,p){return Ju(d,c.child,null,p),c=f1(d,d.pendingProps.children),c.flags|=2,d.memoizedState=null,c}function jO(c,d,p){c.lanes|=d;var S=c.alternate;S!==null&&(S.lanes|=d),kw(c.return,d,p)}function g1(c,d,p,S,T,_){var D=c.memoizedState;D===null?c.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:S,tail:p,tailMode:T,treeForkCount:_}:(D.isBackwards=d,D.rendering=null,D.renderingStartTime=0,D.last=S,D.tail=p,D.tailMode=T,D.treeForkCount=_)}function LO(c,d,p){var S=d.pendingProps,T=S.revealOrder,_=S.tail;S=S.children;var D=er.current,L=(D&2)!==0;if(L?(D=D&1|2,d.flags|=128):D&=1,le(er,D),Zr(c,d,S,p),S=Ot?xp:0,!L&&c!==null&&(c.flags&128)!==0)e:for(c=d.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&jO(c,p,d);else if(c.tag===19)jO(c,p,d);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===d)break e;for(;c.sibling===null;){if(c.return===null||c.return===d)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}switch(T){case"forwards":for(p=d.child,T=null;p!==null;)c=p.alternate,c!==null&&Vy(c)===null&&(T=p),p=p.sibling;p=T,p===null?(T=d.child,d.child=null):(T=p.sibling,p.sibling=null),g1(d,!1,T,p,_,S);break;case"backwards":case"unstable_legacy-backwards":for(p=null,T=d.child,d.child=null;T!==null;){if(c=T.alternate,c!==null&&Vy(c)===null){d.child=T;break}c=T.sibling,T.sibling=p,p=T,T=c}g1(d,!0,p,null,_,S);break;case"together":g1(d,!1,null,null,void 0,S);break;default:d.memoizedState=null}return d.child}function wl(c,d,p){if(c!==null&&(d.dependencies=c.dependencies),Ec|=d.lanes,(p&d.childLanes)===0)if(c!==null){if(mh(c,d,p,!1),(p&d.childLanes)===0)return null}else return null;if(c!==null&&d.child!==c.child)throw Error(r(153));if(d.child!==null){for(c=d.child,p=ml(c,c.pendingProps),d.child=p,p.return=d;c.sibling!==null;)c=c.sibling,p=p.sibling=ml(c,c.pendingProps),p.return=d;p.sibling=null}return d.child}function m1(c,d){return(c.lanes&d)!==0?!0:(c=c.dependencies,!!(c!==null&&Ny(c)))}function SX(c,d,p){switch(d.tag){case 3:Pe(d,d.stateNode.containerInfo),yc(d,fr,c.memoizedState.cache),qu();break;case 27:case 5:He(d);break;case 4:Pe(d,d.stateNode.containerInfo);break;case 10:yc(d,d.type,d.memoizedProps.value);break;case 31:if(d.memoizedState!==null)return d.flags|=128,Uw(d),null;break;case 13:var S=d.memoizedState;if(S!==null)return S.dehydrated!==null?(xc(d),d.flags|=128,null):(p&d.child.childLanes)!==0?RO(c,d,p):(xc(d),c=wl(c,d,p),c!==null?c.sibling:null);xc(d);break;case 19:var T=(c.flags&128)!==0;if(S=(p&d.childLanes)!==0,S||(mh(c,d,p,!1),S=(p&d.childLanes)!==0),T){if(S)return LO(c,d,p);d.flags|=128}if(T=d.memoizedState,T!==null&&(T.rendering=null,T.tail=null,T.lastEffect=null),le(er,er.current),S)break;return null;case 22:return d.lanes=0,IO(c,d,p,d.pendingProps);case 24:yc(d,fr,c.memoizedState.cache)}return wl(c,d,p)}function NO(c,d,p){if(c!==null)if(c.memoizedProps!==d.pendingProps)gr=!0;else{if(!m1(c,p)&&(d.flags&128)===0)return gr=!1,SX(c,d,p);gr=(c.flags&131072)!==0}else gr=!1,Ot&&(d.flags&1048576)!==0&&gA(d,xp,d.index);switch(d.lanes=0,d.tag){case 16:e:{var S=d.pendingProps;if(c=Xu(d.elementType),d.type=c,typeof c=="function")xw(c)?(S=ed(c,S),d.tag=1,d=OO(null,d,c,S,p)):(d.tag=0,d=c1(null,d,c,S,p));else{if(c!=null){var T=c.$$typeof;if(T===k){d.tag=11,d=EO(null,d,c,S,p);break e}else if(T===O){d.tag=14,d=_O(null,d,c,S,p);break e}}throw d=z(c)||c,Error(r(306,d,""))}}return d;case 0:return c1(c,d,d.type,d.pendingProps,p);case 1:return S=d.type,T=ed(S,d.pendingProps),OO(c,d,S,T,p);case 3:e:{if(Pe(d,d.stateNode.containerInfo),c===null)throw Error(r(387));S=d.pendingProps;var _=d.memoizedState;T=_.element,Lw(c,d),kp(d,S,null,p);var D=d.memoizedState;if(S=D.cache,yc(d,fr,S),S!==_.cache&&Mw(d,[fr],p,!0),Ip(),S=D.element,_.isDehydrated)if(_={element:S,isDehydrated:!1,cache:D.cache},d.updateQueue.baseState=_,d.memoizedState=_,d.flags&256){d=DO(c,d,S,p);break e}else if(S!==T){T=To(Error(r(424)),d),wp(T),d=DO(c,d,S,p);break e}else{switch(c=d.stateNode.containerInfo,c.nodeType){case 9:c=c.body;break;default:c=c.nodeName==="HTML"?c.ownerDocument.body:c}for(gn=ko(c.firstChild),Wr=d,Ot=!0,gc=null,Po=!0,p=IA(d,null,S,p),d.child=p;p;)p.flags=p.flags&-3|4096,p=p.sibling}else{if(qu(),S===T){d=wl(c,d,p);break e}Zr(c,d,S,p)}d=d.child}return d;case 26:return nS(c,d),c===null?(p=YD(d.type,null,d.pendingProps,null))?d.memoizedState=p:Ot||(p=d.type,c=d.pendingProps,S=bS(_e.current).createElement(p),S[Zn]=d,S[Ar]=c,Jr(S,p,c),Ln(S),d.stateNode=S):d.memoizedState=YD(d.type,c.memoizedProps,d.pendingProps,c.memoizedState),null;case 27:return He(d),c===null&&Ot&&(S=d.stateNode=VD(d.type,d.pendingProps,_e.current),Wr=d,Po=!0,T=gn,Mc(d.type)?(W1=T,gn=ko(S.firstChild)):gn=T),Zr(c,d,d.pendingProps.children,p),nS(c,d),c===null&&(d.flags|=4194304),d.child;case 5:return c===null&&Ot&&((T=S=gn)&&(S=YX(S,d.type,d.pendingProps,Po),S!==null?(d.stateNode=S,Wr=d,gn=ko(S.firstChild),Po=!1,T=!0):T=!1),T||mc(d)),He(d),T=d.type,_=d.pendingProps,D=c!==null?c.memoizedProps:null,S=_.children,K1(T,_)?S=null:D!==null&&K1(T,D)&&(d.flags|=32),d.memoizedState!==null&&(T=$w(c,d,cX,null,null,p),Wp._currentValue=T),nS(c,d),Zr(c,d,S,p),d.child;case 6:return c===null&&Ot&&((c=p=gn)&&(p=WX(p,d.pendingProps,Po),p!==null?(d.stateNode=p,Wr=d,gn=null,c=!0):c=!1),c||mc(d)),null;case 13:return RO(c,d,p);case 4:return Pe(d,d.stateNode.containerInfo),S=d.pendingProps,c===null?d.child=Ju(d,null,S,p):Zr(c,d,S,p),d.child;case 11:return EO(c,d,d.type,d.pendingProps,p);case 7:return Zr(c,d,d.pendingProps,p),d.child;case 8:return Zr(c,d,d.pendingProps.children,p),d.child;case 12:return Zr(c,d,d.pendingProps.children,p),d.child;case 10:return S=d.pendingProps,yc(d,d.type,S.value),Zr(c,d,S.children,p),d.child;case 9:return T=d.type._context,S=d.pendingProps.children,Yu(d),T=Xr(T),S=S(T),d.flags|=1,Zr(c,d,S,p),d.child;case 14:return _O(c,d,d.type,d.pendingProps,p);case 15:return PO(c,d,d.type,d.pendingProps,p);case 19:return LO(c,d,p);case 31:return yX(c,d,p);case 22:return IO(c,d,p,d.pendingProps);case 24:return Yu(d),S=Xr(fr),c===null?(T=Dw(),T===null&&(T=cn,_=Aw(),T.pooledCache=_,_.refCount++,_!==null&&(T.pooledCacheLanes|=p),T=_),d.memoizedState={parent:S,cache:T},jw(d),yc(d,fr,T)):((c.lanes&p)!==0&&(Lw(c,d),kp(d,null,null,p),Ip()),T=c.memoizedState,_=d.memoizedState,T.parent!==S?(T={parent:S,cache:S},d.memoizedState=T,d.lanes===0&&(d.memoizedState=d.updateQueue.baseState=T),yc(d,fr,S)):(S=_.cache,yc(d,fr,S),S!==T.cache&&Mw(d,[fr],p,!0))),Zr(c,d,d.pendingProps.children,p),d.child;case 29:throw d.pendingProps}throw Error(r(156,d.tag))}function Cl(c){c.flags|=4}function y1(c,d,p,S,T){if((d=(c.mode&32)!==0)&&(d=!1),d){if(c.flags|=16777216,(T&335544128)===T)if(c.stateNode.complete)c.flags|=8192;else if(uD())c.flags|=8192;else throw Zu=Uy,Rw}else c.flags&=-16777217}function zO(c,d){if(d.type!=="stylesheet"||(d.state.loading&4)!==0)c.flags&=-16777217;else if(c.flags|=16777216,!QD(d))if(uD())c.flags|=8192;else throw Zu=Uy,Rw}function iS(c,d){d!==null&&(c.flags|=4),c.flags&16384&&(d=c.tag!==22?oc():536870912,c.lanes|=d,Ih|=d)}function jp(c,d){if(!Ot)switch(c.tailMode){case"hidden":d=c.tail;for(var p=null;d!==null;)d.alternate!==null&&(p=d),d=d.sibling;p===null?c.tail=null:p.sibling=null;break;case"collapsed":p=c.tail;for(var S=null;p!==null;)p.alternate!==null&&(S=p),p=p.sibling;S===null?d||c.tail===null?c.tail=null:c.tail.sibling=null:S.sibling=null}}function mn(c){var d=c.alternate!==null&&c.alternate.child===c.child,p=0,S=0;if(d)for(var T=c.child;T!==null;)p|=T.lanes|T.childLanes,S|=T.subtreeFlags&65011712,S|=T.flags&65011712,T.return=c,T=T.sibling;else for(T=c.child;T!==null;)p|=T.lanes|T.childLanes,S|=T.subtreeFlags,S|=T.flags,T.return=c,T=T.sibling;return c.subtreeFlags|=S,c.childLanes=p,d}function bX(c,d,p){var S=d.pendingProps;switch(Ew(d),d.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mn(d),null;case 1:return mn(d),null;case 3:return p=d.stateNode,S=null,c!==null&&(S=c.memoizedState.cache),d.memoizedState.cache!==S&&(d.flags|=2048),bl(fr),Oe(),p.pendingContext&&(p.context=p.pendingContext,p.pendingContext=null),(c===null||c.child===null)&&(gh(d)?Cl(d):c===null||c.memoizedState.isDehydrated&&(d.flags&256)===0||(d.flags|=1024,Pw())),mn(d),null;case 26:var T=d.type,_=d.memoizedState;return c===null?(Cl(d),_!==null?(mn(d),zO(d,_)):(mn(d),y1(d,T,null,S,p))):_?_!==c.memoizedState?(Cl(d),mn(d),zO(d,_)):(mn(d),d.flags&=-16777217):(c=c.memoizedProps,c!==S&&Cl(d),mn(d),y1(d,T,c,S,p)),null;case 27:if(zt(d),p=_e.current,T=d.type,c!==null&&d.stateNode!=null)c.memoizedProps!==S&&Cl(d);else{if(!S){if(d.stateNode===null)throw Error(r(166));return mn(d),null}c=fe.current,gh(d)?yA(d):(c=VD(T,S,p),d.stateNode=c,Cl(d))}return mn(d),null;case 5:if(zt(d),T=d.type,c!==null&&d.stateNode!=null)c.memoizedProps!==S&&Cl(d);else{if(!S){if(d.stateNode===null)throw Error(r(166));return mn(d),null}if(_=fe.current,gh(d))yA(d);else{var D=bS(_e.current);switch(_){case 1:_=D.createElementNS("http://www.w3.org/2000/svg",T);break;case 2:_=D.createElementNS("http://www.w3.org/1998/Math/MathML",T);break;default:switch(T){case"svg":_=D.createElementNS("http://www.w3.org/2000/svg",T);break;case"math":_=D.createElementNS("http://www.w3.org/1998/Math/MathML",T);break;case"script":_=D.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof S.is=="string"?D.createElement("select",{is:S.is}):D.createElement("select"),S.multiple?_.multiple=!0:S.size&&(_.size=S.size);break;default:_=typeof S.is=="string"?D.createElement(T,{is:S.is}):D.createElement(T)}}_[Zn]=d,_[Ar]=S;e:for(D=d.child;D!==null;){if(D.tag===5||D.tag===6)_.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===d)break e;for(;D.sibling===null;){if(D.return===null||D.return===d)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}d.stateNode=_;e:switch(Jr(_,T,S),T){case"button":case"input":case"select":case"textarea":S=!!S.autoFocus;break e;case"img":S=!0;break e;default:S=!1}S&&Cl(d)}}return mn(d),y1(d,d.type,c===null?null:c.memoizedProps,d.pendingProps,p),null;case 6:if(c&&d.stateNode!=null)c.memoizedProps!==S&&Cl(d);else{if(typeof S!="string"&&d.stateNode===null)throw Error(r(166));if(c=_e.current,gh(d)){if(c=d.stateNode,p=d.memoizedProps,S=null,T=Wr,T!==null)switch(T.tag){case 27:case 5:S=T.memoizedProps}c[Zn]=d,c=!!(c.nodeValue===p||S!==null&&S.suppressHydrationWarning===!0||RD(c.nodeValue,p)),c||mc(d,!0)}else c=bS(c).createTextNode(S),c[Zn]=d,d.stateNode=c}return mn(d),null;case 31:if(p=d.memoizedState,c===null||c.memoizedState!==null){if(S=gh(d),p!==null){if(c===null){if(!S)throw Error(r(318));if(c=d.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(557));c[Zn]=d}else qu(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;mn(d),c=!1}else p=Pw(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=p),c=!0;if(!c)return d.flags&256?(qs(d),d):(qs(d),null);if((d.flags&128)!==0)throw Error(r(558))}return mn(d),null;case 13:if(S=d.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(T=gh(d),S!==null&&S.dehydrated!==null){if(c===null){if(!T)throw Error(r(318));if(T=d.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(r(317));T[Zn]=d}else qu(),(d.flags&128)===0&&(d.memoizedState=null),d.flags|=4;mn(d),T=!1}else T=Pw(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=T),T=!0;if(!T)return d.flags&256?(qs(d),d):(qs(d),null)}return qs(d),(d.flags&128)!==0?(d.lanes=p,d):(p=S!==null,c=c!==null&&c.memoizedState!==null,p&&(S=d.child,T=null,S.alternate!==null&&S.alternate.memoizedState!==null&&S.alternate.memoizedState.cachePool!==null&&(T=S.alternate.memoizedState.cachePool.pool),_=null,S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(_=S.memoizedState.cachePool.pool),_!==T&&(S.flags|=2048)),p!==c&&p&&(d.child.flags|=8192),iS(d,d.updateQueue),mn(d),null);case 4:return Oe(),c===null&&B1(d.stateNode.containerInfo),mn(d),null;case 10:return bl(d.type),mn(d),null;case 19:if(ne(er),S=d.memoizedState,S===null)return mn(d),null;if(T=(d.flags&128)!==0,_=S.rendering,_===null)if(T)jp(S,!1);else{if(Un!==0||c!==null&&(c.flags&128)!==0)for(c=d.child;c!==null;){if(_=Vy(c),_!==null){for(d.flags|=128,jp(S,!1),c=_.updateQueue,d.updateQueue=c,iS(d,c),d.subtreeFlags=0,c=p,p=d.child;p!==null;)hA(p,c),p=p.sibling;return le(er,er.current&1|2),Ot&&yl(d,S.treeForkCount),d.child}c=c.sibling}S.tail!==null&&dr()>cS&&(d.flags|=128,T=!0,jp(S,!1),d.lanes=4194304)}else{if(!T)if(c=Vy(_),c!==null){if(d.flags|=128,T=!0,c=c.updateQueue,d.updateQueue=c,iS(d,c),jp(S,!0),S.tail===null&&S.tailMode==="hidden"&&!_.alternate&&!Ot)return mn(d),null}else 2*dr()-S.renderingStartTime>cS&&p!==536870912&&(d.flags|=128,T=!0,jp(S,!1),d.lanes=4194304);S.isBackwards?(_.sibling=d.child,d.child=_):(c=S.last,c!==null?c.sibling=_:d.child=_,S.last=_)}return S.tail!==null?(c=S.tail,S.rendering=c,S.tail=c.sibling,S.renderingStartTime=dr(),c.sibling=null,p=er.current,le(er,T?p&1|2:p&1),Ot&&yl(d,S.treeForkCount),c):(mn(d),null);case 22:case 23:return qs(d),Fw(),S=d.memoizedState!==null,c!==null?c.memoizedState!==null!==S&&(d.flags|=8192):S&&(d.flags|=8192),S?(p&536870912)!==0&&(d.flags&128)===0&&(mn(d),d.subtreeFlags&6&&(d.flags|=8192)):mn(d),p=d.updateQueue,p!==null&&iS(d,p.retryQueue),p=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(p=c.memoizedState.cachePool.pool),S=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(S=d.memoizedState.cachePool.pool),S!==p&&(d.flags|=2048),c!==null&&ne(Wu),null;case 24:return p=null,c!==null&&(p=c.memoizedState.cache),d.memoizedState.cache!==p&&(d.flags|=2048),bl(fr),mn(d),null;case 25:return null;case 30:return null}throw Error(r(156,d.tag))}function vX(c,d){switch(Ew(d),d.tag){case 1:return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 3:return bl(fr),Oe(),c=d.flags,(c&65536)!==0&&(c&128)===0?(d.flags=c&-65537|128,d):null;case 26:case 27:case 5:return zt(d),null;case 31:if(d.memoizedState!==null){if(qs(d),d.alternate===null)throw Error(r(340));qu()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 13:if(qs(d),c=d.memoizedState,c!==null&&c.dehydrated!==null){if(d.alternate===null)throw Error(r(340));qu()}return c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 19:return ne(er),null;case 4:return Oe(),null;case 10:return bl(d.type),null;case 22:case 23:return qs(d),Fw(),c!==null&&ne(Wu),c=d.flags,c&65536?(d.flags=c&-65537|128,d):null;case 24:return bl(fr),null;case 25:return null;default:return null}}function BO(c,d){switch(Ew(d),d.tag){case 3:bl(fr),Oe();break;case 26:case 27:case 5:zt(d);break;case 4:Oe();break;case 31:d.memoizedState!==null&&qs(d);break;case 13:qs(d);break;case 19:ne(er);break;case 10:bl(d.type);break;case 22:case 23:qs(d),Fw(),c!==null&&ne(Wu);break;case 24:bl(fr)}}function Lp(c,d){try{var p=d.updateQueue,S=p!==null?p.lastEffect:null;if(S!==null){var T=S.next;p=T;do{if((p.tag&c)===c){S=void 0;var _=p.create,D=p.inst;S=_(),D.destroy=S}p=p.next}while(p!==T)}}catch(L){Yt(d,d.return,L)}}function Cc(c,d,p){try{var S=d.updateQueue,T=S!==null?S.lastEffect:null;if(T!==null){var _=T.next;S=_;do{if((S.tag&c)===c){var D=S.inst,L=D.destroy;if(L!==void 0){D.destroy=void 0,T=d;var Y=p,oe=L;try{oe()}catch(he){Yt(T,Y,he)}}}S=S.next}while(S!==_)}}catch(he){Yt(d,d.return,he)}}function FO(c){var d=c.updateQueue;if(d!==null){var p=c.stateNode;try{MA(d,p)}catch(S){Yt(c,c.return,S)}}}function UO(c,d,p){p.props=ed(c.type,c.memoizedProps),p.state=c.memoizedState;try{p.componentWillUnmount()}catch(S){Yt(c,d,S)}}function Np(c,d){try{var p=c.ref;if(p!==null){switch(c.tag){case 26:case 27:case 5:var S=c.stateNode;break;case 30:S=c.stateNode;break;default:S=c.stateNode}typeof p=="function"?c.refCleanup=p(S):p.current=S}}catch(T){Yt(c,d,T)}}function Ia(c,d){var p=c.ref,S=c.refCleanup;if(p!==null)if(typeof S=="function")try{S()}catch(T){Yt(c,d,T)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof p=="function")try{p(null)}catch(T){Yt(c,d,T)}else p.current=null}function HO(c){var d=c.type,p=c.memoizedProps,S=c.stateNode;try{e:switch(d){case"button":case"input":case"select":case"textarea":p.autoFocus&&S.focus();break e;case"img":p.src?S.src=p.src:p.srcSet&&(S.srcset=p.srcSet)}}catch(T){Yt(c,c.return,T)}}function S1(c,d,p){try{var S=c.stateNode;HX(S,c.type,p,d),S[Ar]=d}catch(T){Yt(c,c.return,T)}}function $O(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&Mc(c.type)||c.tag===4}function b1(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||$O(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&Mc(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function v1(c,d,p){var S=c.tag;if(S===5||S===6)c=c.stateNode,d?(p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p).insertBefore(c,d):(d=p.nodeType===9?p.body:p.nodeName==="HTML"?p.ownerDocument.body:p,d.appendChild(c),p=p._reactRootContainer,p!=null||d.onclick!==null||(d.onclick=Ce));else if(S!==4&&(S===27&&Mc(c.type)&&(p=c.stateNode,d=null),c=c.child,c!==null))for(v1(c,d,p),c=c.sibling;c!==null;)v1(c,d,p),c=c.sibling}function sS(c,d,p){var S=c.tag;if(S===5||S===6)c=c.stateNode,d?p.insertBefore(c,d):p.appendChild(c);else if(S!==4&&(S===27&&Mc(c.type)&&(p=c.stateNode),c=c.child,c!==null))for(sS(c,d,p),c=c.sibling;c!==null;)sS(c,d,p),c=c.sibling}function KO(c){var d=c.stateNode,p=c.memoizedProps;try{for(var S=c.type,T=d.attributes;T.length;)d.removeAttributeNode(T[0]);Jr(d,S,p),d[Zn]=c,d[Ar]=p}catch(_){Yt(c,c.return,_)}}var Tl=!1,mr=!1,x1=!1,VO=typeof WeakSet=="function"?WeakSet:Set,Or=null;function xX(c,d){if(c=c.containerInfo,H1=_S,c=rA(c),pw(c)){if("selectionStart"in c)var p={start:c.selectionStart,end:c.selectionEnd};else e:{p=(p=c.ownerDocument)&&p.defaultView||window;var S=p.getSelection&&p.getSelection();if(S&&S.rangeCount!==0){p=S.anchorNode;var T=S.anchorOffset,_=S.focusNode;S=S.focusOffset;try{p.nodeType,_.nodeType}catch{p=null;break e}var D=0,L=-1,Y=-1,oe=0,he=0,Se=c,ae=null;t:for(;;){for(var ue;Se!==p||T!==0&&Se.nodeType!==3||(L=D+T),Se!==_||S!==0&&Se.nodeType!==3||(Y=D+S),Se.nodeType===3&&(D+=Se.nodeValue.length),(ue=Se.firstChild)!==null;)ae=Se,Se=ue;for(;;){if(Se===c)break t;if(ae===p&&++oe===T&&(L=D),ae===_&&++he===S&&(Y=D),(ue=Se.nextSibling)!==null)break;Se=ae,ae=Se.parentNode}Se=ue}p=L===-1||Y===-1?null:{start:L,end:Y}}else p=null}p=p||{start:0,end:0}}else p=null;for($1={focusedElem:c,selectionRange:p},_S=!1,Or=d;Or!==null;)if(d=Or,c=d.child,(d.subtreeFlags&1028)!==0&&c!==null)c.return=d,Or=c;else for(;Or!==null;){switch(d=Or,_=d.alternate,c=d.flags,d.tag){case 0:if((c&4)!==0&&(c=d.updateQueue,c=c!==null?c.events:null,c!==null))for(p=0;p<c.length;p++)T=c[p],T.ref.impl=T.nextImpl;break;case 11:case 15:break;case 1:if((c&1024)!==0&&_!==null){c=void 0,p=d,T=_.memoizedProps,_=_.memoizedState,S=p.stateNode;try{var Ue=ed(p.type,T);c=S.getSnapshotBeforeUpdate(Ue,_),S.__reactInternalSnapshotBeforeUpdate=c}catch(et){Yt(p,p.return,et)}}break;case 3:if((c&1024)!==0){if(c=d.stateNode.containerInfo,p=c.nodeType,p===9)q1(c);else if(p===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":q1(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((c&1024)!==0)throw Error(r(163))}if(c=d.sibling,c!==null){c.return=d.return,Or=c;break}Or=d.return}}function qO(c,d,p){var S=p.flags;switch(p.tag){case 0:case 11:case 15:_l(c,p),S&4&&Lp(5,p);break;case 1:if(_l(c,p),S&4)if(c=p.stateNode,d===null)try{c.componentDidMount()}catch(D){Yt(p,p.return,D)}else{var T=ed(p.type,d.memoizedProps);d=d.memoizedState;try{c.componentDidUpdate(T,d,c.__reactInternalSnapshotBeforeUpdate)}catch(D){Yt(p,p.return,D)}}S&64&&FO(p),S&512&&Np(p,p.return);break;case 3:if(_l(c,p),S&64&&(c=p.updateQueue,c!==null)){if(d=null,p.child!==null)switch(p.child.tag){case 27:case 5:d=p.child.stateNode;break;case 1:d=p.child.stateNode}try{MA(c,d)}catch(D){Yt(p,p.return,D)}}break;case 27:d===null&&S&4&&KO(p);case 26:case 5:_l(c,p),d===null&&S&4&&HO(p),S&512&&Np(p,p.return);break;case 12:_l(c,p);break;case 31:_l(c,p),S&4&&WO(c,p);break;case 13:_l(c,p),S&4&&XO(c,p),S&64&&(c=p.memoizedState,c!==null&&(c=c.dehydrated,c!==null&&(p=MX.bind(null,p),XX(c,p))));break;case 22:if(S=p.memoizedState!==null||Tl,!S){d=d!==null&&d.memoizedState!==null||mr,T=Tl;var _=mr;Tl=S,(mr=d)&&!_?Pl(c,p,(p.subtreeFlags&8772)!==0):_l(c,p),Tl=T,mr=_}break;case 30:break;default:_l(c,p)}}function GO(c){var d=c.alternate;d!==null&&(c.alternate=null,GO(d)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(d=c.stateNode,d!==null&&ps(d)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}var En=null,Ss=!1;function El(c,d,p){for(p=p.child;p!==null;)YO(c,d,p),p=p.sibling}function YO(c,d,p){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(At,p)}catch{}switch(p.tag){case 26:mr||Ia(p,d),El(c,d,p),p.memoizedState?p.memoizedState.count--:p.stateNode&&(p=p.stateNode,p.parentNode.removeChild(p));break;case 27:mr||Ia(p,d);var S=En,T=Ss;Mc(p.type)&&(En=p.stateNode,Ss=!1),El(c,d,p),qp(p.stateNode),En=S,Ss=T;break;case 5:mr||Ia(p,d);case 6:if(S=En,T=Ss,En=null,El(c,d,p),En=S,Ss=T,En!==null)if(Ss)try{(En.nodeType===9?En.body:En.nodeName==="HTML"?En.ownerDocument.body:En).removeChild(p.stateNode)}catch(_){Yt(p,d,_)}else try{En.removeChild(p.stateNode)}catch(_){Yt(p,d,_)}break;case 18:En!==null&&(Ss?(c=En,FD(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,p.stateNode),Lh(c)):FD(En,p.stateNode));break;case 4:S=En,T=Ss,En=p.stateNode.containerInfo,Ss=!0,El(c,d,p),En=S,Ss=T;break;case 0:case 11:case 14:case 15:Cc(2,p,d),mr||Cc(4,p,d),El(c,d,p);break;case 1:mr||(Ia(p,d),S=p.stateNode,typeof S.componentWillUnmount=="function"&&UO(p,d,S)),El(c,d,p);break;case 21:El(c,d,p);break;case 22:mr=(S=mr)||p.memoizedState!==null,El(c,d,p),mr=S;break;default:El(c,d,p)}}function WO(c,d){if(d.memoizedState===null&&(c=d.alternate,c!==null&&(c=c.memoizedState,c!==null))){c=c.dehydrated;try{Lh(c)}catch(p){Yt(d,d.return,p)}}}function XO(c,d){if(d.memoizedState===null&&(c=d.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{Lh(c)}catch(p){Yt(d,d.return,p)}}function wX(c){switch(c.tag){case 31:case 13:case 19:var d=c.stateNode;return d===null&&(d=c.stateNode=new VO),d;case 22:return c=c.stateNode,d=c._retryCache,d===null&&(d=c._retryCache=new VO),d;default:throw Error(r(435,c.tag))}}function oS(c,d){var p=wX(c);d.forEach(function(S){if(!p.has(S)){p.add(S);var T=AX.bind(null,c,S);S.then(T,T)}})}function bs(c,d){var p=d.deletions;if(p!==null)for(var S=0;S<p.length;S++){var T=p[S],_=c,D=d,L=D;e:for(;L!==null;){switch(L.tag){case 27:if(Mc(L.type)){En=L.stateNode,Ss=!1;break e}break;case 5:En=L.stateNode,Ss=!1;break e;case 3:case 4:En=L.stateNode.containerInfo,Ss=!0;break e}L=L.return}if(En===null)throw Error(r(160));YO(_,D,T),En=null,Ss=!1,_=T.alternate,_!==null&&(_.return=null),T.return=null}if(d.subtreeFlags&13886)for(d=d.child;d!==null;)ZO(d,c),d=d.sibling}var ia=null;function ZO(c,d){var p=c.alternate,S=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:bs(d,c),vs(c),S&4&&(Cc(3,c,c.return),Lp(3,c),Cc(5,c,c.return));break;case 1:bs(d,c),vs(c),S&512&&(mr||p===null||Ia(p,p.return)),S&64&&Tl&&(c=c.updateQueue,c!==null&&(S=c.callbacks,S!==null&&(p=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=p===null?S:p.concat(S))));break;case 26:var T=ia;if(bs(d,c),vs(c),S&512&&(mr||p===null||Ia(p,p.return)),S&4){var _=p!==null?p.memoizedState:null;if(S=c.memoizedState,p===null)if(S===null)if(c.stateNode===null){e:{S=c.type,p=c.memoizedProps,T=T.ownerDocument||T;t:switch(S){case"title":_=T.getElementsByTagName("title")[0],(!_||_[ul]||_[Zn]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=T.createElement(S),T.head.insertBefore(_,T.querySelector("head > title"))),Jr(_,S,p),_[Zn]=c,Ln(_),S=_;break e;case"link":var D=ZD("link","href",T).get(S+(p.href||""));if(D){for(var L=0;L<D.length;L++)if(_=D[L],_.getAttribute("href")===(p.href==null||p.href===""?null:p.href)&&_.getAttribute("rel")===(p.rel==null?null:p.rel)&&_.getAttribute("title")===(p.title==null?null:p.title)&&_.getAttribute("crossorigin")===(p.crossOrigin==null?null:p.crossOrigin)){D.splice(L,1);break t}}_=T.createElement(S),Jr(_,S,p),T.head.appendChild(_);break;case"meta":if(D=ZD("meta","content",T).get(S+(p.content||""))){for(L=0;L<D.length;L++)if(_=D[L],_.getAttribute("content")===(p.content==null?null:""+p.content)&&_.getAttribute("name")===(p.name==null?null:p.name)&&_.getAttribute("property")===(p.property==null?null:p.property)&&_.getAttribute("http-equiv")===(p.httpEquiv==null?null:p.httpEquiv)&&_.getAttribute("charset")===(p.charSet==null?null:p.charSet)){D.splice(L,1);break t}}_=T.createElement(S),Jr(_,S,p),T.head.appendChild(_);break;default:throw Error(r(468,S))}_[Zn]=c,Ln(_),S=_}c.stateNode=S}else JD(T,c.type,c.stateNode);else c.stateNode=XD(T,S,c.memoizedProps);else _!==S?(_===null?p.stateNode!==null&&(p=p.stateNode,p.parentNode.removeChild(p)):_.count--,S===null?JD(T,c.type,c.stateNode):XD(T,S,c.memoizedProps)):S===null&&c.stateNode!==null&&S1(c,c.memoizedProps,p.memoizedProps)}break;case 27:bs(d,c),vs(c),S&512&&(mr||p===null||Ia(p,p.return)),p!==null&&S&4&&S1(c,c.memoizedProps,p.memoizedProps);break;case 5:if(bs(d,c),vs(c),S&512&&(mr||p===null||Ia(p,p.return)),c.flags&32){T=c.stateNode;try{yi(T,"")}catch(Ue){Yt(c,c.return,Ue)}}S&4&&c.stateNode!=null&&(T=c.memoizedProps,S1(c,T,p!==null?p.memoizedProps:T)),S&1024&&(x1=!0);break;case 6:if(bs(d,c),vs(c),S&4){if(c.stateNode===null)throw Error(r(162));S=c.memoizedProps,p=c.stateNode;try{p.nodeValue=S}catch(Ue){Yt(c,c.return,Ue)}}break;case 3:if(wS=null,T=ia,ia=vS(d.containerInfo),bs(d,c),ia=T,vs(c),S&4&&p!==null&&p.memoizedState.isDehydrated)try{Lh(d.containerInfo)}catch(Ue){Yt(c,c.return,Ue)}x1&&(x1=!1,JO(c));break;case 4:S=ia,ia=vS(c.stateNode.containerInfo),bs(d,c),vs(c),ia=S;break;case 12:bs(d,c),vs(c);break;case 31:bs(d,c),vs(c),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,oS(c,S)));break;case 13:bs(d,c),vs(c),c.child.flags&8192&&c.memoizedState!==null!=(p!==null&&p.memoizedState!==null)&&(lS=dr()),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,oS(c,S)));break;case 22:T=c.memoizedState!==null;var Y=p!==null&&p.memoizedState!==null,oe=Tl,he=mr;if(Tl=oe||T,mr=he||Y,bs(d,c),mr=he,Tl=oe,vs(c),S&8192)e:for(d=c.stateNode,d._visibility=T?d._visibility&-2:d._visibility|1,T&&(p===null||Y||Tl||mr||td(c)),p=null,d=c;;){if(d.tag===5||d.tag===26){if(p===null){Y=p=d;try{if(_=Y.stateNode,T)D=_.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{L=Y.stateNode;var Se=Y.memoizedProps.style,ae=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;L.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(Ue){Yt(Y,Y.return,Ue)}}}else if(d.tag===6){if(p===null){Y=d;try{Y.stateNode.nodeValue=T?"":Y.memoizedProps}catch(Ue){Yt(Y,Y.return,Ue)}}}else if(d.tag===18){if(p===null){Y=d;try{var ue=Y.stateNode;T?UD(ue,!0):UD(Y.stateNode,!1)}catch(Ue){Yt(Y,Y.return,Ue)}}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===c)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===c)break e;for(;d.sibling===null;){if(d.return===null||d.return===c)break e;p===d&&(p=null),d=d.return}p===d&&(p=null),d.sibling.return=d.return,d=d.sibling}S&4&&(S=c.updateQueue,S!==null&&(p=S.retryQueue,p!==null&&(S.retryQueue=null,oS(c,p))));break;case 19:bs(d,c),vs(c),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,oS(c,S)));break;case 30:break;case 21:break;default:bs(d,c),vs(c)}}function vs(c){var d=c.flags;if(d&2){try{for(var p,S=c.return;S!==null;){if($O(S)){p=S;break}S=S.return}if(p==null)throw Error(r(160));switch(p.tag){case 27:var T=p.stateNode,_=b1(c);sS(c,_,T);break;case 5:var D=p.stateNode;p.flags&32&&(yi(D,""),p.flags&=-33);var L=b1(c);sS(c,L,D);break;case 3:case 4:var Y=p.stateNode.containerInfo,oe=b1(c);v1(c,oe,Y);break;default:throw Error(r(161))}}catch(he){Yt(c,c.return,he)}c.flags&=-3}d&4096&&(c.flags&=-4097)}function JO(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var d=c;JO(d),d.tag===5&&d.flags&1024&&d.stateNode.reset(),c=c.sibling}}function _l(c,d){if(d.subtreeFlags&8772)for(d=d.child;d!==null;)qO(c,d.alternate,d),d=d.sibling}function td(c){for(c=c.child;c!==null;){var d=c;switch(d.tag){case 0:case 11:case 14:case 15:Cc(4,d,d.return),td(d);break;case 1:Ia(d,d.return);var p=d.stateNode;typeof p.componentWillUnmount=="function"&&UO(d,d.return,p),td(d);break;case 27:qp(d.stateNode);case 26:case 5:Ia(d,d.return),td(d);break;case 22:d.memoizedState===null&&td(d);break;case 30:td(d);break;default:td(d)}c=c.sibling}}function Pl(c,d,p){for(p=p&&(d.subtreeFlags&8772)!==0,d=d.child;d!==null;){var S=d.alternate,T=c,_=d,D=_.flags;switch(_.tag){case 0:case 11:case 15:Pl(T,_,p),Lp(4,_);break;case 1:if(Pl(T,_,p),S=_,T=S.stateNode,typeof T.componentDidMount=="function")try{T.componentDidMount()}catch(oe){Yt(S,S.return,oe)}if(S=_,T=S.updateQueue,T!==null){var L=S.stateNode;try{var Y=T.shared.hiddenCallbacks;if(Y!==null)for(T.shared.hiddenCallbacks=null,T=0;T<Y.length;T++)kA(Y[T],L)}catch(oe){Yt(S,S.return,oe)}}p&&D&64&&FO(_),Np(_,_.return);break;case 27:KO(_);case 26:case 5:Pl(T,_,p),p&&S===null&&D&4&&HO(_),Np(_,_.return);break;case 12:Pl(T,_,p);break;case 31:Pl(T,_,p),p&&D&4&&WO(T,_);break;case 13:Pl(T,_,p),p&&D&4&&XO(T,_);break;case 22:_.memoizedState===null&&Pl(T,_,p),Np(_,_.return);break;case 30:break;default:Pl(T,_,p)}d=d.sibling}}function w1(c,d){var p=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(p=c.memoizedState.cachePool.pool),c=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(c=d.memoizedState.cachePool.pool),c!==p&&(c!=null&&c.refCount++,p!=null&&Cp(p))}function C1(c,d){c=null,d.alternate!==null&&(c=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==c&&(d.refCount++,c!=null&&Cp(c))}function sa(c,d,p,S){if(d.subtreeFlags&10256)for(d=d.child;d!==null;)QO(c,d,p,S),d=d.sibling}function QO(c,d,p,S){var T=d.flags;switch(d.tag){case 0:case 11:case 15:sa(c,d,p,S),T&2048&&Lp(9,d);break;case 1:sa(c,d,p,S);break;case 3:sa(c,d,p,S),T&2048&&(c=null,d.alternate!==null&&(c=d.alternate.memoizedState.cache),d=d.memoizedState.cache,d!==c&&(d.refCount++,c!=null&&Cp(c)));break;case 12:if(T&2048){sa(c,d,p,S),c=d.stateNode;try{var _=d.memoizedProps,D=_.id,L=_.onPostCommit;typeof L=="function"&&L(D,d.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(Y){Yt(d,d.return,Y)}}else sa(c,d,p,S);break;case 31:sa(c,d,p,S);break;case 13:sa(c,d,p,S);break;case 23:break;case 22:_=d.stateNode,D=d.alternate,d.memoizedState!==null?_._visibility&2?sa(c,d,p,S):zp(c,d):_._visibility&2?sa(c,d,p,S):(_._visibility|=2,Eh(c,d,p,S,(d.subtreeFlags&10256)!==0||!1)),T&2048&&w1(D,d);break;case 24:sa(c,d,p,S),T&2048&&C1(d.alternate,d);break;default:sa(c,d,p,S)}}function Eh(c,d,p,S,T){for(T=T&&((d.subtreeFlags&10256)!==0||!1),d=d.child;d!==null;){var _=c,D=d,L=p,Y=S,oe=D.flags;switch(D.tag){case 0:case 11:case 15:Eh(_,D,L,Y,T),Lp(8,D);break;case 23:break;case 22:var he=D.stateNode;D.memoizedState!==null?he._visibility&2?Eh(_,D,L,Y,T):zp(_,D):(he._visibility|=2,Eh(_,D,L,Y,T)),T&&oe&2048&&w1(D.alternate,D);break;case 24:Eh(_,D,L,Y,T),T&&oe&2048&&C1(D.alternate,D);break;default:Eh(_,D,L,Y,T)}d=d.sibling}}function zp(c,d){if(d.subtreeFlags&10256)for(d=d.child;d!==null;){var p=c,S=d,T=S.flags;switch(S.tag){case 22:zp(p,S),T&2048&&w1(S.alternate,S);break;case 24:zp(p,S),T&2048&&C1(S.alternate,S);break;default:zp(p,S)}d=d.sibling}}var Bp=8192;function _h(c,d,p){if(c.subtreeFlags&Bp)for(c=c.child;c!==null;)eD(c,d,p),c=c.sibling}function eD(c,d,p){switch(c.tag){case 26:_h(c,d,p),c.flags&Bp&&c.memoizedState!==null&&lZ(p,ia,c.memoizedState,c.memoizedProps);break;case 5:_h(c,d,p);break;case 3:case 4:var S=ia;ia=vS(c.stateNode.containerInfo),_h(c,d,p),ia=S;break;case 22:c.memoizedState===null&&(S=c.alternate,S!==null&&S.memoizedState!==null?(S=Bp,Bp=16777216,_h(c,d,p),Bp=S):_h(c,d,p));break;default:_h(c,d,p)}}function tD(c){var d=c.alternate;if(d!==null&&(c=d.child,c!==null)){d.child=null;do d=c.sibling,c.sibling=null,c=d;while(c!==null)}}function Fp(c){var d=c.deletions;if((c.flags&16)!==0){if(d!==null)for(var p=0;p<d.length;p++){var S=d[p];Or=S,rD(S,c)}tD(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)nD(c),c=c.sibling}function nD(c){switch(c.tag){case 0:case 11:case 15:Fp(c),c.flags&2048&&Cc(9,c,c.return);break;case 3:Fp(c);break;case 12:Fp(c);break;case 22:var d=c.stateNode;c.memoizedState!==null&&d._visibility&2&&(c.return===null||c.return.tag!==13)?(d._visibility&=-3,aS(c)):Fp(c);break;default:Fp(c)}}function aS(c){var d=c.deletions;if((c.flags&16)!==0){if(d!==null)for(var p=0;p<d.length;p++){var S=d[p];Or=S,rD(S,c)}tD(c)}for(c=c.child;c!==null;){switch(d=c,d.tag){case 0:case 11:case 15:Cc(8,d,d.return),aS(d);break;case 22:p=d.stateNode,p._visibility&2&&(p._visibility&=-3,aS(d));break;default:aS(d)}c=c.sibling}}function rD(c,d){for(;Or!==null;){var p=Or;switch(p.tag){case 0:case 11:case 15:Cc(8,p,d);break;case 23:case 22:if(p.memoizedState!==null&&p.memoizedState.cachePool!==null){var S=p.memoizedState.cachePool.pool;S!=null&&S.refCount++}break;case 24:Cp(p.memoizedState.cache)}if(S=p.child,S!==null)S.return=p,Or=S;else e:for(p=c;Or!==null;){S=Or;var T=S.sibling,_=S.return;if(GO(S),S===p){Or=null;break e}if(T!==null){T.return=_,Or=T;break e}Or=_}}}var CX={getCacheForType:function(c){var d=Xr(fr),p=d.data.get(c);return p===void 0&&(p=c(),d.data.set(c,p)),p},cacheSignal:function(){return Xr(fr).controller.signal}},TX=typeof WeakMap=="function"?WeakMap:Map,$t=0,cn=null,Ct=null,Pt=0,Gt=0,Gs=null,Tc=!1,Ph=!1,T1=!1,Il=0,Un=0,Ec=0,nd=0,E1=0,Ys=0,Ih=0,Up=null,xs=null,_1=!1,lS=0,iD=0,cS=1/0,uS=null,_c=null,Pr=0,Pc=null,kh=null,kl=0,P1=0,I1=null,sD=null,Hp=0,k1=null;function Ws(){return($t&2)!==0&&Pt!==0?Pt&-Pt:B.T!==null?j1():bo()}function oD(){if(Ys===0)if((Pt&536870912)===0||Ot){var c=hs;hs<<=1,(hs&3932160)===0&&(hs=262144),Ys=c}else Ys=536870912;return c=Vs.current,c!==null&&(c.flags|=32),Ys}function ws(c,d,p){(c===cn&&(Gt===2||Gt===9)||c.cancelPendingCommit!==null)&&(Mh(c,0),Ic(c,Pt,Ys,!1)),ll(c,p),(($t&2)===0||c!==cn)&&(c===cn&&(($t&2)===0&&(nd|=p),Un===4&&Ic(c,Pt,Ys,!1)),ka(c))}function aD(c,d,p){if(($t&6)!==0)throw Error(r(327));var S=!p&&(d&127)===0&&(d&c.expiredLanes)===0||Bs(c,d),T=S?PX(c,d):A1(c,d,!0),_=S;do{if(T===0){Ph&&!S&&Ic(c,d,0,!1);break}else{if(p=c.current.alternate,_&&!EX(p)){T=A1(c,d,!1),_=!1;continue}if(T===2){if(_=d,c.errorRecoveryDisabledLanes&_)var D=0;else D=c.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){d=D;e:{var L=c;T=Up;var Y=L.current.memoizedState.isDehydrated;if(Y&&(Mh(L,D).flags|=256),D=A1(L,D,!1),D!==2){if(T1&&!Y){L.errorRecoveryDisabledLanes|=_,nd|=_,T=4;break e}_=xs,xs=T,_!==null&&(xs===null?xs=_:xs.push.apply(xs,_))}T=D}if(_=!1,T!==2)continue}}if(T===1){Mh(c,0),Ic(c,d,0,!0);break}e:{switch(S=c,_=T,_){case 0:case 1:throw Error(r(345));case 4:if((d&4194048)!==d)break;case 6:Ic(S,d,Ys,!Tc);break e;case 2:xs=null;break;case 3:case 5:break;default:throw Error(r(329))}if((d&62914560)===d&&(T=lS+300-dr(),10<T)){if(Ic(S,d,Ys,!Tc),zs(S,0,!0)!==0)break e;kl=d,S.timeoutHandle=zD(lD.bind(null,S,p,xs,uS,_1,d,Ys,nd,Ih,Tc,_,"Throttled",-0,0),T);break e}lD(S,p,xs,uS,_1,d,Ys,nd,Ih,Tc,_,null,-0,0)}}break}while(!0);ka(c)}function lD(c,d,p,S,T,_,D,L,Y,oe,he,Se,ae,ue){if(c.timeoutHandle=-1,Se=d.subtreeFlags,Se&8192||(Se&16785408)===16785408){Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ce},eD(d,_,Se);var Ue=(_&62914560)===_?lS-dr():(_&4194048)===_?iD-dr():0;if(Ue=cZ(Se,Ue),Ue!==null){kl=_,c.cancelPendingCommit=Ue(mD.bind(null,c,d,_,p,S,T,D,L,Y,he,Se,null,ae,ue)),Ic(c,_,D,!oe);return}}mD(c,d,_,p,S,T,D,L,Y)}function EX(c){for(var d=c;;){var p=d.tag;if((p===0||p===11||p===15)&&d.flags&16384&&(p=d.updateQueue,p!==null&&(p=p.stores,p!==null)))for(var S=0;S<p.length;S++){var T=p[S],_=T.getSnapshot;T=T.value;try{if(!$s(_(),T))return!1}catch{return!1}}if(p=d.child,d.subtreeFlags&16384&&p!==null)p.return=d,d=p;else{if(d===c)break;for(;d.sibling===null;){if(d.return===null||d.return===c)return!0;d=d.return}d.sibling.return=d.return,d=d.sibling}}return!0}function Ic(c,d,p,S){d&=~E1,d&=~nd,c.suspendedLanes|=d,c.pingedLanes&=~d,S&&(c.warmLanes|=d),S=c.expirationTimes;for(var T=d;0<T;){var _=31-An(T),D=1<<_;S[_]=-1,T&=~D}p!==0&&Zd(c,p,d)}function dS(){return($t&6)===0?($p(0),!1):!0}function M1(){if(Ct!==null){if(Gt===0)var c=Ct.return;else c=Ct,Sl=Gu=null,qw(c),vh=null,Ep=0,c=Ct;for(;c!==null;)BO(c.alternate,c),c=c.return;Ct=null}}function Mh(c,d){var p=c.timeoutHandle;p!==-1&&(c.timeoutHandle=-1,VX(p)),p=c.cancelPendingCommit,p!==null&&(c.cancelPendingCommit=null,p()),kl=0,M1(),cn=c,Ct=p=ml(c.current,null),Pt=d,Gt=0,Gs=null,Tc=!1,Ph=Bs(c,d),T1=!1,Ih=Ys=E1=nd=Ec=Un=0,xs=Up=null,_1=!1,(d&8)!==0&&(d|=d&32);var S=c.entangledLanes;if(S!==0)for(c=c.entanglements,S&=d;0<S;){var T=31-An(S),_=1<<T;d|=c[T],S&=~_}return Il=d,Oy(),p}function cD(c,d){ft=null,B.H=Dp,d===bh||d===Fy?(d=EA(),Gt=3):d===Rw?(d=EA(),Gt=4):Gt=d===l1?8:d!==null&&typeof d=="object"&&typeof d.then=="function"?6:1,Gs=d,Ct===null&&(Un=1,eS(c,To(d,c.current)))}function uD(){var c=Vs.current;return c===null?!0:(Pt&4194048)===Pt?Io===null:(Pt&62914560)===Pt||(Pt&536870912)!==0?c===Io:!1}function dD(){var c=B.H;return B.H=Dp,c===null?Dp:c}function hD(){var c=B.A;return B.A=CX,c}function hS(){Un=4,Tc||(Pt&4194048)!==Pt&&Vs.current!==null||(Ph=!0),(Ec&134217727)===0&&(nd&134217727)===0||cn===null||Ic(cn,Pt,Ys,!1)}function A1(c,d,p){var S=$t;$t|=2;var T=dD(),_=hD();(cn!==c||Pt!==d)&&(uS=null,Mh(c,d)),d=!1;var D=Un;e:do try{if(Gt!==0&&Ct!==null){var L=Ct,Y=Gs;switch(Gt){case 8:M1(),D=6;break e;case 3:case 2:case 9:case 6:Vs.current===null&&(d=!0);var oe=Gt;if(Gt=0,Gs=null,Ah(c,L,Y,oe),p&&Ph){D=0;break e}break;default:oe=Gt,Gt=0,Gs=null,Ah(c,L,Y,oe)}}_X(),D=Un;break}catch(he){cD(c,he)}while(!0);return d&&c.shellSuspendCounter++,Sl=Gu=null,$t=S,B.H=T,B.A=_,Ct===null&&(cn=null,Pt=0,Oy()),D}function _X(){for(;Ct!==null;)fD(Ct)}function PX(c,d){var p=$t;$t|=2;var S=dD(),T=hD();cn!==c||Pt!==d?(uS=null,cS=dr()+500,Mh(c,d)):Ph=Bs(c,d);e:do try{if(Gt!==0&&Ct!==null){d=Ct;var _=Gs;t:switch(Gt){case 1:Gt=0,Gs=null,Ah(c,d,_,1);break;case 2:case 9:if(CA(_)){Gt=0,Gs=null,pD(d);break}d=function(){Gt!==2&&Gt!==9||cn!==c||(Gt=7),ka(c)},_.then(d,d);break e;case 3:Gt=7;break e;case 4:Gt=5;break e;case 7:CA(_)?(Gt=0,Gs=null,pD(d)):(Gt=0,Gs=null,Ah(c,d,_,7));break;case 5:var D=null;switch(Ct.tag){case 26:D=Ct.memoizedState;case 5:case 27:var L=Ct;if(D?QD(D):L.stateNode.complete){Gt=0,Gs=null;var Y=L.sibling;if(Y!==null)Ct=Y;else{var oe=L.return;oe!==null?(Ct=oe,fS(oe)):Ct=null}break t}}Gt=0,Gs=null,Ah(c,d,_,5);break;case 6:Gt=0,Gs=null,Ah(c,d,_,6);break;case 8:M1(),Un=6;break e;default:throw Error(r(462))}}IX();break}catch(he){cD(c,he)}while(!0);return Sl=Gu=null,B.H=S,B.A=T,$t=p,Ct!==null?0:(cn=null,Pt=0,Oy(),Un)}function IX(){for(;Ct!==null&&!ol();)fD(Ct)}function fD(c){var d=NO(c.alternate,c,Il);c.memoizedProps=c.pendingProps,d===null?fS(c):Ct=d}function pD(c){var d=c,p=d.alternate;switch(d.tag){case 15:case 0:d=AO(p,d,d.pendingProps,d.type,void 0,Pt);break;case 11:d=AO(p,d,d.pendingProps,d.type.render,d.ref,Pt);break;case 5:qw(d);default:BO(p,d),d=Ct=hA(d,Il),d=NO(p,d,Il)}c.memoizedProps=c.pendingProps,d===null?fS(c):Ct=d}function Ah(c,d,p,S){Sl=Gu=null,qw(d),vh=null,Ep=0;var T=d.return;try{if(mX(c,T,d,p,Pt)){Un=1,eS(c,To(p,c.current)),Ct=null;return}}catch(_){if(T!==null)throw Ct=T,_;Un=1,eS(c,To(p,c.current)),Ct=null;return}d.flags&32768?(Ot||S===1?c=!0:Ph||(Pt&536870912)!==0?c=!1:(Tc=c=!0,(S===2||S===9||S===3||S===6)&&(S=Vs.current,S!==null&&S.tag===13&&(S.flags|=16384))),gD(d,c)):fS(d)}function fS(c){var d=c;do{if((d.flags&32768)!==0){gD(d,Tc);return}c=d.return;var p=bX(d.alternate,d,Il);if(p!==null){Ct=p;return}if(d=d.sibling,d!==null){Ct=d;return}Ct=d=c}while(d!==null);Un===0&&(Un=5)}function gD(c,d){do{var p=vX(c.alternate,c);if(p!==null){p.flags&=32767,Ct=p;return}if(p=c.return,p!==null&&(p.flags|=32768,p.subtreeFlags=0,p.deletions=null),!d&&(c=c.sibling,c!==null)){Ct=c;return}Ct=c=p}while(c!==null);Un=6,Ct=null}function mD(c,d,p,S,T,_,D,L,Y){c.cancelPendingCommit=null;do pS();while(Pr!==0);if(($t&6)!==0)throw Error(r(327));if(d!==null){if(d===c.current)throw Error(r(177));if(_=d.lanes|d.childLanes,_|=bw,hp(c,p,_,D,L,Y),c===cn&&(Ct=cn=null,Pt=0),kh=d,Pc=c,kl=p,P1=_,I1=T,sD=S,(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?(c.callbackNode=null,c.callbackPriority=0,OX(us,function(){return xD(),null})):(c.callbackNode=null,c.callbackPriority=0),S=(d.flags&13878)!==0,(d.subtreeFlags&13878)!==0||S){S=B.T,B.T=null,T=G.p,G.p=2,D=$t,$t|=4;try{xX(c,d,p)}finally{$t=D,G.p=T,B.T=S}}Pr=1,yD(),SD(),bD()}}function yD(){if(Pr===1){Pr=0;var c=Pc,d=kh,p=(d.flags&13878)!==0;if((d.subtreeFlags&13878)!==0||p){p=B.T,B.T=null;var S=G.p;G.p=2;var T=$t;$t|=4;try{ZO(d,c);var _=$1,D=rA(c.containerInfo),L=_.focusedElem,Y=_.selectionRange;if(D!==L&&L&&L.ownerDocument&&nA(L.ownerDocument.documentElement,L)){if(Y!==null&&pw(L)){var oe=Y.start,he=Y.end;if(he===void 0&&(he=oe),"selectionStart"in L)L.selectionStart=oe,L.selectionEnd=Math.min(he,L.value.length);else{var Se=L.ownerDocument||document,ae=Se&&Se.defaultView||window;if(ae.getSelection){var ue=ae.getSelection(),Ue=L.textContent.length,et=Math.min(Y.start,Ue),nn=Y.end===void 0?et:Math.min(Y.end,Ue);!ue.extend&&et>nn&&(D=nn,nn=et,et=D);var re=tA(L,et),X=tA(L,nn);if(re&&X&&(ue.rangeCount!==1||ue.anchorNode!==re.node||ue.anchorOffset!==re.offset||ue.focusNode!==X.node||ue.focusOffset!==X.offset)){var se=Se.createRange();se.setStart(re.node,re.offset),ue.removeAllRanges(),et>nn?(ue.addRange(se),ue.extend(X.node,X.offset)):(se.setEnd(X.node,X.offset),ue.addRange(se))}}}}for(Se=[],ue=L;ue=ue.parentNode;)ue.nodeType===1&&Se.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<Se.length;L++){var ye=Se[L];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}_S=!!H1,$1=H1=null}finally{$t=T,G.p=S,B.T=p}}c.current=d,Pr=2}}function SD(){if(Pr===2){Pr=0;var c=Pc,d=kh,p=(d.flags&8772)!==0;if((d.subtreeFlags&8772)!==0||p){p=B.T,B.T=null;var S=G.p;G.p=2;var T=$t;$t|=4;try{qO(c,d.alternate,d)}finally{$t=T,G.p=S,B.T=p}}Pr=3}}function bD(){if(Pr===4||Pr===3){Pr=0,sc();var c=Pc,d=kh,p=kl,S=sD;(d.subtreeFlags&10256)!==0||(d.flags&10256)!==0?Pr=5:(Pr=0,kh=Pc=null,vD(c,c.pendingLanes));var T=c.pendingLanes;if(T===0&&(_c=null),cl(p),d=d.stateNode,qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(At,d,void 0,(d.current.flags&128)===128)}catch{}if(S!==null){d=B.T,T=G.p,G.p=2,B.T=null;try{for(var _=c.onRecoverableError,D=0;D<S.length;D++){var L=S[D];_(L.value,{componentStack:L.stack})}}finally{B.T=d,G.p=T}}(kl&3)!==0&&pS(),ka(c),T=c.pendingLanes,(p&261930)!==0&&(T&42)!==0?c===k1?Hp++:(Hp=0,k1=c):Hp=0,$p(0)}}function vD(c,d){(c.pooledCacheLanes&=d)===0&&(d=c.pooledCache,d!=null&&(c.pooledCache=null,Cp(d)))}function pS(){return yD(),SD(),bD(),xD()}function xD(){if(Pr!==5)return!1;var c=Pc,d=P1;P1=0;var p=cl(kl),S=B.T,T=G.p;try{G.p=32>p?32:p,B.T=null,p=I1,I1=null;var _=Pc,D=kl;if(Pr=0,kh=Pc=null,kl=0,($t&6)!==0)throw Error(r(331));var L=$t;if($t|=4,nD(_.current),QO(_,_.current,D,p),$t=L,$p(0,!1),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(At,_)}catch{}return!0}finally{G.p=T,B.T=S,vD(c,d)}}function wD(c,d,p){d=To(p,d),d=a1(c.stateNode,d,2),c=vc(c,d,2),c!==null&&(ll(c,2),ka(c))}function Yt(c,d,p){if(c.tag===3)wD(c,c,p);else for(;d!==null;){if(d.tag===3){wD(d,c,p);break}else if(d.tag===1){var S=d.stateNode;if(typeof d.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(_c===null||!_c.has(S))){c=To(p,c),p=CO(2),S=vc(d,p,2),S!==null&&(TO(p,S,d,c),ll(S,2),ka(S));break}}d=d.return}}function O1(c,d,p){var S=c.pingCache;if(S===null){S=c.pingCache=new TX;var T=new Set;S.set(d,T)}else T=S.get(d),T===void 0&&(T=new Set,S.set(d,T));T.has(p)||(T1=!0,T.add(p),c=kX.bind(null,c,d,p),d.then(c,c))}function kX(c,d,p){var S=c.pingCache;S!==null&&S.delete(d),c.pingedLanes|=c.suspendedLanes&p,c.warmLanes&=~p,cn===c&&(Pt&p)===p&&(Un===4||Un===3&&(Pt&62914560)===Pt&&300>dr()-lS?($t&2)===0&&Mh(c,0):E1|=p,Ih===Pt&&(Ih=0)),ka(c)}function CD(c,d){d===0&&(d=oc()),c=Ku(c,d),c!==null&&(ll(c,d),ka(c))}function MX(c){var d=c.memoizedState,p=0;d!==null&&(p=d.retryLane),CD(c,p)}function AX(c,d){var p=0;switch(c.tag){case 31:case 13:var S=c.stateNode,T=c.memoizedState;T!==null&&(p=T.retryLane);break;case 19:S=c.stateNode;break;case 22:S=c.stateNode._retryCache;break;default:throw Error(r(314))}S!==null&&S.delete(d),CD(c,p)}function OX(c,d){return hi(c,d)}var gS=null,Oh=null,D1=!1,mS=!1,R1=!1,kc=0;function ka(c){c!==Oh&&c.next===null&&(Oh===null?gS=Oh=c:Oh=Oh.next=c),mS=!0,D1||(D1=!0,RX())}function $p(c,d){if(!R1&&mS){R1=!0;do for(var p=!1,S=gS;S!==null;){if(c!==0){var T=S.pendingLanes;if(T===0)var _=0;else{var D=S.suspendedLanes,L=S.pingedLanes;_=(1<<31-An(42|c)+1)-1,_&=T&~(D&~L),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(p=!0,PD(S,_))}else _=Pt,_=zs(S,S===cn?_:0,S.cancelPendingCommit!==null||S.timeoutHandle!==-1),(_&3)===0||Bs(S,_)||(p=!0,PD(S,_));S=S.next}while(p);R1=!1}}function DX(){TD()}function TD(){mS=D1=!1;var c=0;kc!==0&&KX()&&(c=kc);for(var d=dr(),p=null,S=gS;S!==null;){var T=S.next,_=ED(S,d);_===0?(S.next=null,p===null?gS=T:p.next=T,T===null&&(Oh=p)):(p=S,(c!==0||(_&3)!==0)&&(mS=!0)),S=T}Pr!==0&&Pr!==5||$p(c),kc!==0&&(kc=0)}function ED(c,d){for(var p=c.suspendedLanes,S=c.pingedLanes,T=c.expirationTimes,_=c.pendingLanes&-62914561;0<_;){var D=31-An(_),L=1<<D,Y=T[D];Y===-1?((L&p)===0||(L&S)!==0)&&(T[D]=Fs(L,d)):Y<=d&&(c.expiredLanes|=L),_&=~L}if(d=cn,p=Pt,p=zs(c,c===d?p:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),S=c.callbackNode,p===0||c===d&&(Gt===2||Gt===9)||c.cancelPendingCommit!==null)return S!==null&&S!==null&&fi(S),c.callbackNode=null,c.callbackPriority=0;if((p&3)===0||Bs(c,p)){if(d=p&-p,d===c.callbackPriority)return d;switch(S!==null&&fi(S),cl(p)){case 2:case 8:p=Xo;break;case 32:p=us;break;case 268435456:p=ce;break;default:p=us}return S=_D.bind(null,c),p=hi(p,S),c.callbackPriority=d,c.callbackNode=p,d}return S!==null&&S!==null&&fi(S),c.callbackPriority=2,c.callbackNode=null,2}function _D(c,d){if(Pr!==0&&Pr!==5)return c.callbackNode=null,c.callbackPriority=0,null;var p=c.callbackNode;if(pS()&&c.callbackNode!==p)return null;var S=Pt;return S=zs(c,c===cn?S:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),S===0?null:(aD(c,S,d),ED(c,dr()),c.callbackNode!=null&&c.callbackNode===p?_D.bind(null,c):null)}function PD(c,d){if(pS())return null;aD(c,d,!0)}function RX(){qX(function(){($t&6)!==0?hi(So,DX):TD()})}function j1(){if(kc===0){var c=yh;c===0&&(c=pi,pi<<=1,(pi&261888)===0&&(pi=256)),kc=c}return kc}function ID(c){return c==null||typeof c=="symbol"||typeof c=="boolean"?null:typeof c=="function"?c:ie(""+c)}function kD(c,d){var p=d.ownerDocument.createElement("input");return p.name=d.name,p.value=d.value,c.id&&p.setAttribute("form",c.id),d.parentNode.insertBefore(p,d),c=new FormData(c),p.parentNode.removeChild(p),c}function jX(c,d,p,S,T){if(d==="submit"&&p&&p.stateNode===T){var _=ID((T[Ar]||null).action),D=S.submitter;D&&(d=(d=D[Ar]||null)?ID(d.formAction):D.getAttribute("formAction"),d!==null&&(_=d,D=null));var L=new st("action","action",null,S,T);c.push({event:L,listeners:[{instance:null,listener:function(){if(S.defaultPrevented){if(kc!==0){var Y=D?kD(T,D):new FormData(T);t1(p,{pending:!0,data:Y,method:T.method,action:_},null,Y)}}else typeof _=="function"&&(L.preventDefault(),Y=D?kD(T,D):new FormData(T),t1(p,{pending:!0,data:Y,method:T.method,action:_},_,Y))},currentTarget:T}]})}}for(var L1=0;L1<Sw.length;L1++){var N1=Sw[L1],LX=N1.toLowerCase(),NX=N1[0].toUpperCase()+N1.slice(1);ra(LX,"on"+NX)}ra(oA,"onAnimationEnd"),ra(aA,"onAnimationIteration"),ra(lA,"onAnimationStart"),ra("dblclick","onDoubleClick"),ra("focusin","onFocus"),ra("focusout","onBlur"),ra(QW,"onTransitionRun"),ra(eX,"onTransitionStart"),ra(tX,"onTransitionCancel"),ra(cA,"onTransitionEnd"),ea("onMouseEnter",["mouseout","mouseover"]),ea("onMouseLeave",["mouseout","mouseover"]),ea("onPointerEnter",["pointerout","pointerover"]),ea("onPointerLeave",["pointerout","pointerover"]),Qo("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Qo("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Qo("onBeforeInput",["compositionend","keypress","textInput","paste"]),Qo("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Qo("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Qo("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Kp="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(" "),zX=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Kp));function MD(c,d){d=(d&4)!==0;for(var p=0;p<c.length;p++){var S=c[p],T=S.event;S=S.listeners;e:{var _=void 0;if(d)for(var D=S.length-1;0<=D;D--){var L=S[D],Y=L.instance,oe=L.currentTarget;if(L=L.listener,Y!==_&&T.isPropagationStopped())break e;_=L,T.currentTarget=oe;try{_(T)}catch(he){Ay(he)}T.currentTarget=null,_=Y}else for(D=0;D<S.length;D++){if(L=S[D],Y=L.instance,oe=L.currentTarget,L=L.listener,Y!==_&&T.isPropagationStopped())break e;_=L,T.currentTarget=oe;try{_(T)}catch(he){Ay(he)}T.currentTarget=null,_=Y}}}}function Tt(c,d){var p=d[Hi];p===void 0&&(p=d[Hi]=new Set);var S=c+"__bubble";p.has(S)||(AD(d,c,2,!1),p.add(S))}function z1(c,d,p){var S=0;d&&(S|=4),AD(p,c,S,d)}var yS="_reactListening"+Math.random().toString(36).slice(2);function B1(c){if(!c[yS]){c[yS]=!0,th.forEach(function(p){p!=="selectionchange"&&(zX.has(p)||z1(p,!1,c),z1(p,!0,c))});var d=c.nodeType===9?c:c.ownerDocument;d===null||d[yS]||(d[yS]=!0,z1("selectionchange",!1,d))}}function AD(c,d,p,S){switch(oR(d)){case 2:var T=hZ;break;case 8:T=fZ;break;default:T=eC}p=T.bind(null,d,p,c),T=void 0,!Bn||d!=="touchstart"&&d!=="touchmove"&&d!=="wheel"||(T=!0),S?T!==void 0?c.addEventListener(d,p,{capture:!0,passive:T}):c.addEventListener(d,p,!0):T!==void 0?c.addEventListener(d,p,{passive:T}):c.addEventListener(d,p,!1)}function F1(c,d,p,S,T){var _=S;if((d&1)===0&&(d&2)===0&&S!==null)e:for(;;){if(S===null)return;var D=S.tag;if(D===3||D===4){var L=S.stateNode.containerInfo;if(L===T)break;if(D===4)for(D=S.return;D!==null;){var Y=D.tag;if((Y===3||Y===4)&&D.stateNode.containerInfo===T)return;D=D.return}for(;L!==null;){if(D=gi(L),D===null)return;if(Y=D.tag,Y===5||Y===6||Y===26||Y===27){S=_=D;continue e}L=L.parentNode}}S=S.return}Tr(function(){var oe=_,he=Jt(p),Se=[];e:{var ae=uA.get(c);if(ae!==void 0){var ue=st,Ue=c;switch(c){case"keypress":if($(p)===0)break e;case"keydown":case"keyup":ue=AW;break;case"focusin":Ue="focus",ue=Hs;break;case"focusout":Ue="blur",ue=Hs;break;case"beforeblur":case"afterblur":ue=Hs;break;case"click":if(p.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=_r;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=ys;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=RW;break;case oA:case aA:case lA:ue=ky;break;case cA:ue=LW;break;case"scroll":case"scrollend":ue=hr;break;case"wheel":ue=zW;break;case"copy":case"cut":case"paste":ue=ah;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=U2;break;case"toggle":case"beforetoggle":ue=FW}var et=(d&4)!==0,nn=!et&&(c==="scroll"||c==="scrollend"),re=et?ae!==null?ae+"Capture":null:ae;et=[];for(var X=oe,se;X!==null;){var ye=X;if(se=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||se===null||re===null||(ye=Jn(X,re),ye!=null&&et.push(Vp(X,ye,se))),nn)break;X=X.return}0<et.length&&(ae=new ue(ae,Ue,null,p,he),Se.push({event:ae,listeners:et}))}}if((d&7)===0){e:{if(ae=c==="mouseover"||c==="pointerover",ue=c==="mouseout"||c==="pointerout",ae&&p!==ze&&(Ue=p.relatedTarget||p.fromElement)&&(gi(Ue)||Ue[wa]))break e;if((ue||ae)&&(ae=he.window===he?he:(ae=he.ownerDocument)?ae.defaultView||ae.parentWindow:window,ue?(Ue=p.relatedTarget||p.toElement,ue=oe,Ue=Ue?gi(Ue):null,Ue!==null&&(nn=s(Ue),et=Ue.tag,Ue!==nn||et!==5&&et!==27&&et!==6)&&(Ue=null)):(ue=null,Ue=oe),ue!==Ue)){if(et=_r,ye="onMouseLeave",re="onMouseEnter",X="mouse",(c==="pointerout"||c==="pointerover")&&(et=U2,ye="onPointerLeave",re="onPointerEnter",X="pointer"),nn=ue==null?ae:dl(ue),se=Ue==null?ae:dl(Ue),ae=new et(ye,X+"leave",ue,p,he),ae.target=nn,ae.relatedTarget=se,ye=null,gi(he)===oe&&(et=new et(re,X+"enter",Ue,p,he),et.target=se,et.relatedTarget=nn,ye=et),nn=ye,ue&&Ue)t:{for(et=BX,re=ue,X=Ue,se=0,ye=re;ye;ye=et(ye))se++;ye=0;for(var Ge=X;Ge;Ge=et(Ge))ye++;for(;0<se-ye;)re=et(re),se--;for(;0<ye-se;)X=et(X),ye--;for(;se--;){if(re===X||X!==null&&re===X.alternate){et=re;break t}re=et(re),X=et(X)}et=null}else et=null;ue!==null&&OD(Se,ae,ue,et,!1),Ue!==null&&nn!==null&&OD(Se,nn,Ue,et,!0)}}e:{if(ae=oe?dl(oe):window,ue=ae.nodeName&&ae.nodeName.toLowerCase(),ue==="select"||ue==="input"&&ae.type==="file")var Bt=W2;else if(G2(ae))if(X2)Bt=XW;else{Bt=YW;var $e=GW}else ue=ae.nodeName,!ue||ue.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?oe&&Uu(oe.elementType)&&(Bt=W2):Bt=WW;if(Bt&&(Bt=Bt(c,oe))){Y2(Se,Bt,p,he);break e}$e&&$e(c,ae,oe),c==="focusout"&&oe&&ae.type==="number"&&oe.memoizedProps.value!=null&&fl(ae,"number",ae.value)}switch($e=oe?dl(oe):window,c){case"focusin":(G2($e)||$e.contentEditable==="true")&&(ch=$e,gw=oe,vp=null);break;case"focusout":vp=gw=ch=null;break;case"mousedown":mw=!0;break;case"contextmenu":case"mouseup":case"dragend":mw=!1,iA(Se,p,he);break;case"selectionchange":if(JW)break;case"keydown":case"keyup":iA(Se,p,he)}var mt;if(dw)e:{switch(c){case"compositionstart":var It="onCompositionStart";break e;case"compositionend":It="onCompositionEnd";break e;case"compositionupdate":It="onCompositionUpdate";break e}It=void 0}else lh?V2(c,p)&&(It="onCompositionEnd"):c==="keydown"&&p.keyCode===229&&(It="onCompositionStart");It&&(H2&&p.locale!=="ko"&&(lh||It!=="onCompositionStart"?It==="onCompositionEnd"&&lh&&(mt=wo()):(Tn=he,gs="value"in Tn?Tn.value:Tn.textContent,lh=!0)),$e=SS(oe,It),0<$e.length&&(It=new F2(It,c,null,p,he),Se.push({event:It,listeners:$e}),mt?It.data=mt:(mt=q2(p),mt!==null&&(It.data=mt)))),(mt=HW?$W(c,p):KW(c,p))&&(It=SS(oe,"onBeforeInput"),0<It.length&&($e=new F2("onBeforeInput","beforeinput",null,p,he),Se.push({event:$e,listeners:It}),$e.data=mt)),jX(Se,c,oe,p,he)}MD(Se,d)})}function Vp(c,d,p){return{instance:c,listener:d,currentTarget:p}}function SS(c,d){for(var p=d+"Capture",S=[];c!==null;){var T=c,_=T.stateNode;if(T=T.tag,T!==5&&T!==26&&T!==27||_===null||(T=Jn(c,p),T!=null&&S.unshift(Vp(c,T,_)),T=Jn(c,d),T!=null&&S.push(Vp(c,T,_))),c.tag===3)return S;c=c.return}return[]}function BX(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5&&c.tag!==27);return c||null}function OD(c,d,p,S,T){for(var _=d._reactName,D=[];p!==null&&p!==S;){var L=p,Y=L.alternate,oe=L.stateNode;if(L=L.tag,Y!==null&&Y===S)break;L!==5&&L!==26&&L!==27||oe===null||(Y=oe,T?(oe=Jn(p,_),oe!=null&&D.unshift(Vp(p,oe,Y))):T||(oe=Jn(p,_),oe!=null&&D.push(Vp(p,oe,Y)))),p=p.return}D.length!==0&&c.push({event:d,listeners:D})}var FX=/\r\n?/g,UX=/\u0000|\uFFFD/g;function DD(c){return(typeof c=="string"?c:""+c).replace(FX,`
9
+ `).replace(UX,"")}function RD(c,d){return d=DD(d),DD(c)===d}function tn(c,d,p,S,T,_){switch(p){case"children":typeof S=="string"?d==="body"||d==="textarea"&&S===""||yi(c,S):(typeof S=="number"||typeof S=="bigint")&&d!=="body"&&yi(c,""+S);break;case"className":cc(c,"class",S);break;case"tabIndex":cc(c,"tabindex",S);break;case"dir":case"role":case"viewBox":case"width":case"height":cc(c,p,S);break;case"style":$i(c,S,_);break;case"data":if(d!=="object"){cc(c,"data",S);break}case"src":case"href":if(S===""&&(d!=="a"||p!=="href")){c.removeAttribute(p);break}if(S==null||typeof S=="function"||typeof S=="symbol"||typeof S=="boolean"){c.removeAttribute(p);break}S=ie(""+S),c.setAttribute(p,S);break;case"action":case"formAction":if(typeof S=="function"){c.setAttribute(p,"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 _=="function"&&(p==="formAction"?(d!=="input"&&tn(c,d,"name",T.name,T,null),tn(c,d,"formEncType",T.formEncType,T,null),tn(c,d,"formMethod",T.formMethod,T,null),tn(c,d,"formTarget",T.formTarget,T,null)):(tn(c,d,"encType",T.encType,T,null),tn(c,d,"method",T.method,T,null),tn(c,d,"target",T.target,T,null)));if(S==null||typeof S=="symbol"||typeof S=="boolean"){c.removeAttribute(p);break}S=ie(""+S),c.setAttribute(p,S);break;case"onClick":S!=null&&(c.onclick=Ce);break;case"onScroll":S!=null&&Tt("scroll",c);break;case"onScrollEnd":S!=null&&Tt("scrollend",c);break;case"dangerouslySetInnerHTML":if(S!=null){if(typeof S!="object"||!("__html"in S))throw Error(r(61));if(p=S.__html,p!=null){if(T.children!=null)throw Error(r(60));c.innerHTML=p}}break;case"multiple":c.multiple=S&&typeof S!="function"&&typeof S!="symbol";break;case"muted":c.muted=S&&typeof S!="function"&&typeof S!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(S==null||typeof S=="function"||typeof S=="boolean"||typeof S=="symbol"){c.removeAttribute("xlink:href");break}p=ie(""+S),c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",p);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":S!=null&&typeof S!="function"&&typeof S!="symbol"?c.setAttribute(p,""+S):c.removeAttribute(p);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":S&&typeof S!="function"&&typeof S!="symbol"?c.setAttribute(p,""):c.removeAttribute(p);break;case"capture":case"download":S===!0?c.setAttribute(p,""):S!==!1&&S!=null&&typeof S!="function"&&typeof S!="symbol"?c.setAttribute(p,S):c.removeAttribute(p);break;case"cols":case"rows":case"size":case"span":S!=null&&typeof S!="function"&&typeof S!="symbol"&&!isNaN(S)&&1<=S?c.setAttribute(p,S):c.removeAttribute(p);break;case"rowSpan":case"start":S==null||typeof S=="function"||typeof S=="symbol"||isNaN(S)?c.removeAttribute(p):c.setAttribute(p,S);break;case"popover":Tt("beforetoggle",c),Tt("toggle",c),hl(c,"popover",S);break;case"xlinkActuate":Us(c,"http://www.w3.org/1999/xlink","xlink:actuate",S);break;case"xlinkArcrole":Us(c,"http://www.w3.org/1999/xlink","xlink:arcrole",S);break;case"xlinkRole":Us(c,"http://www.w3.org/1999/xlink","xlink:role",S);break;case"xlinkShow":Us(c,"http://www.w3.org/1999/xlink","xlink:show",S);break;case"xlinkTitle":Us(c,"http://www.w3.org/1999/xlink","xlink:title",S);break;case"xlinkType":Us(c,"http://www.w3.org/1999/xlink","xlink:type",S);break;case"xmlBase":Us(c,"http://www.w3.org/XML/1998/namespace","xml:base",S);break;case"xmlLang":Us(c,"http://www.w3.org/XML/1998/namespace","xml:lang",S);break;case"xmlSpace":Us(c,"http://www.w3.org/XML/1998/namespace","xml:space",S);break;case"is":hl(c,"is",S);break;case"innerText":case"textContent":break;default:(!(2<p.length)||p[0]!=="o"&&p[0]!=="O"||p[1]!=="n"&&p[1]!=="N")&&(p=sh.get(p)||p,hl(c,p,S))}}function U1(c,d,p,S,T,_){switch(p){case"style":$i(c,S,_);break;case"dangerouslySetInnerHTML":if(S!=null){if(typeof S!="object"||!("__html"in S))throw Error(r(61));if(p=S.__html,p!=null){if(T.children!=null)throw Error(r(60));c.innerHTML=p}}break;case"children":typeof S=="string"?yi(c,S):(typeof S=="number"||typeof S=="bigint")&&yi(c,""+S);break;case"onScroll":S!=null&&Tt("scroll",c);break;case"onScrollEnd":S!=null&&Tt("scrollend",c);break;case"onClick":S!=null&&(c.onclick=Ce);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vo.hasOwnProperty(p))e:{if(p[0]==="o"&&p[1]==="n"&&(T=p.endsWith("Capture"),d=p.slice(2,T?p.length-7:void 0),_=c[Ar]||null,_=_!=null?_[p]:null,typeof _=="function"&&c.removeEventListener(d,_,T),typeof S=="function")){typeof _!="function"&&_!==null&&(p in c?c[p]=null:c.hasAttribute(p)&&c.removeAttribute(p)),c.addEventListener(d,S,T);break e}p in c?c[p]=S:S===!0?c.setAttribute(p,""):hl(c,p,S)}}}function Jr(c,d,p){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Tt("error",c),Tt("load",c);var S=!1,T=!1,_;for(_ in p)if(p.hasOwnProperty(_)){var D=p[_];if(D!=null)switch(_){case"src":S=!0;break;case"srcSet":T=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,d));default:tn(c,d,_,D,p,null)}}T&&tn(c,d,"srcSet",p.srcSet,p,null),S&&tn(c,d,"src",p.src,p,null);return;case"input":Tt("invalid",c);var L=_=D=T=null,Y=null,oe=null;for(S in p)if(p.hasOwnProperty(S)){var he=p[S];if(he!=null)switch(S){case"name":T=he;break;case"type":D=he;break;case"checked":Y=he;break;case"defaultChecked":oe=he;break;case"value":_=he;break;case"defaultValue":L=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,d));break;default:tn(c,d,S,he,p,null)}}Bu(c,_,L,Y,oe,D,T,!1);return;case"select":Tt("invalid",c),S=D=_=null;for(T in p)if(p.hasOwnProperty(T)&&(L=p[T],L!=null))switch(T){case"value":_=L;break;case"defaultValue":D=L;break;case"multiple":S=L;default:tn(c,d,T,L,p,null)}d=_,p=D,c.multiple=!!S,d!=null?na(c,!!S,d,!1):p!=null&&na(c,!!S,p,!0);return;case"textarea":Tt("invalid",c),_=T=S=null;for(D in p)if(p.hasOwnProperty(D)&&(L=p[D],L!=null))switch(D){case"value":S=L;break;case"defaultValue":T=L;break;case"children":_=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(91));break;default:tn(c,d,D,L,p,null)}pl(c,S,T,_);return;case"option":for(Y in p)if(p.hasOwnProperty(Y)&&(S=p[Y],S!=null))switch(Y){case"selected":c.selected=S&&typeof S!="function"&&typeof S!="symbol";break;default:tn(c,d,Y,S,p,null)}return;case"dialog":Tt("beforetoggle",c),Tt("toggle",c),Tt("cancel",c),Tt("close",c);break;case"iframe":case"object":Tt("load",c);break;case"video":case"audio":for(S=0;S<Kp.length;S++)Tt(Kp[S],c);break;case"image":Tt("error",c),Tt("load",c);break;case"details":Tt("toggle",c);break;case"embed":case"source":case"link":Tt("error",c),Tt("load",c);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(oe in p)if(p.hasOwnProperty(oe)&&(S=p[oe],S!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,d));default:tn(c,d,oe,S,p,null)}return;default:if(Uu(d)){for(he in p)p.hasOwnProperty(he)&&(S=p[he],S!==void 0&&U1(c,d,he,S,p,void 0));return}}for(L in p)p.hasOwnProperty(L)&&(S=p[L],S!=null&&tn(c,d,L,S,p,null))}function HX(c,d,p,S){switch(d){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var T=null,_=null,D=null,L=null,Y=null,oe=null,he=null;for(ue in p){var Se=p[ue];if(p.hasOwnProperty(ue)&&Se!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":Y=Se;default:S.hasOwnProperty(ue)||tn(c,d,ue,null,S,Se)}}for(var ae in S){var ue=S[ae];if(Se=p[ae],S.hasOwnProperty(ae)&&(ue!=null||Se!=null))switch(ae){case"type":_=ue;break;case"name":T=ue;break;case"checked":oe=ue;break;case"defaultChecked":he=ue;break;case"value":D=ue;break;case"defaultValue":L=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,d));break;default:ue!==Se&&tn(c,d,ae,ue,S,Se)}}hc(c,D,L,Y,oe,he,_,T);return;case"select":ue=D=L=ae=null;for(_ in p)if(Y=p[_],p.hasOwnProperty(_)&&Y!=null)switch(_){case"value":break;case"multiple":ue=Y;default:S.hasOwnProperty(_)||tn(c,d,_,null,S,Y)}for(T in S)if(_=S[T],Y=p[T],S.hasOwnProperty(T)&&(_!=null||Y!=null))switch(T){case"value":ae=_;break;case"defaultValue":L=_;break;case"multiple":D=_;default:_!==Y&&tn(c,d,T,_,S,Y)}d=L,p=D,S=ue,ae!=null?na(c,!!p,ae,!1):!!S!=!!p&&(d!=null?na(c,!!p,d,!0):na(c,!!p,p?[]:"",!1));return;case"textarea":ue=ae=null;for(L in p)if(T=p[L],p.hasOwnProperty(L)&&T!=null&&!S.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:tn(c,d,L,null,S,T)}for(D in S)if(T=S[D],_=p[D],S.hasOwnProperty(D)&&(T!=null||_!=null))switch(D){case"value":ae=T;break;case"defaultValue":ue=T;break;case"children":break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(r(91));break;default:T!==_&&tn(c,d,D,T,S,_)}Fu(c,ae,ue);return;case"option":for(var Ue in p)if(ae=p[Ue],p.hasOwnProperty(Ue)&&ae!=null&&!S.hasOwnProperty(Ue))switch(Ue){case"selected":c.selected=!1;break;default:tn(c,d,Ue,null,S,ae)}for(Y in S)if(ae=S[Y],ue=p[Y],S.hasOwnProperty(Y)&&ae!==ue&&(ae!=null||ue!=null))switch(Y){case"selected":c.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:tn(c,d,Y,ae,S,ue)}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 et in p)ae=p[et],p.hasOwnProperty(et)&&ae!=null&&!S.hasOwnProperty(et)&&tn(c,d,et,null,S,ae);for(oe in S)if(ae=S[oe],ue=p[oe],S.hasOwnProperty(oe)&&ae!==ue&&(ae!=null||ue!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,d));break;default:tn(c,d,oe,ae,S,ue)}return;default:if(Uu(d)){for(var nn in p)ae=p[nn],p.hasOwnProperty(nn)&&ae!==void 0&&!S.hasOwnProperty(nn)&&U1(c,d,nn,void 0,S,ae);for(he in S)ae=S[he],ue=p[he],!S.hasOwnProperty(he)||ae===ue||ae===void 0&&ue===void 0||U1(c,d,he,ae,S,ue);return}}for(var re in p)ae=p[re],p.hasOwnProperty(re)&&ae!=null&&!S.hasOwnProperty(re)&&tn(c,d,re,null,S,ae);for(Se in S)ae=S[Se],ue=p[Se],!S.hasOwnProperty(Se)||ae===ue||ae==null&&ue==null||tn(c,d,Se,ae,S,ue)}function jD(c){switch(c){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function $X(){if(typeof performance.getEntriesByType=="function"){for(var c=0,d=0,p=performance.getEntriesByType("resource"),S=0;S<p.length;S++){var T=p[S],_=T.transferSize,D=T.initiatorType,L=T.duration;if(_&&L&&jD(D)){for(D=0,L=T.responseEnd,S+=1;S<p.length;S++){var Y=p[S],oe=Y.startTime;if(oe>L)break;var he=Y.transferSize,Se=Y.initiatorType;he&&jD(Se)&&(Y=Y.responseEnd,D+=he*(Y<L?1:(L-oe)/(Y-oe)))}if(--S,d+=8*(_+D)/(T.duration/1e3),c++,10<c)break}}if(0<c)return d/c/1e6}return navigator.connection&&(c=navigator.connection.downlink,typeof c=="number")?c:5}var H1=null,$1=null;function bS(c){return c.nodeType===9?c:c.ownerDocument}function LD(c){switch(c){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ND(c,d){if(c===0)switch(d){case"svg":return 1;case"math":return 2;default:return 0}return c===1&&d==="foreignObject"?0:c}function K1(c,d){return c==="textarea"||c==="noscript"||typeof d.children=="string"||typeof d.children=="number"||typeof d.children=="bigint"||typeof d.dangerouslySetInnerHTML=="object"&&d.dangerouslySetInnerHTML!==null&&d.dangerouslySetInnerHTML.__html!=null}var V1=null;function KX(){var c=window.event;return c&&c.type==="popstate"?c===V1?!1:(V1=c,!0):(V1=null,!1)}var zD=typeof setTimeout=="function"?setTimeout:void 0,VX=typeof clearTimeout=="function"?clearTimeout:void 0,BD=typeof Promise=="function"?Promise:void 0,qX=typeof queueMicrotask=="function"?queueMicrotask:typeof BD<"u"?function(c){return BD.resolve(null).then(c).catch(GX)}:zD;function GX(c){setTimeout(function(){throw c})}function Mc(c){return c==="head"}function FD(c,d){var p=d,S=0;do{var T=p.nextSibling;if(c.removeChild(p),T&&T.nodeType===8)if(p=T.data,p==="/$"||p==="/&"){if(S===0){c.removeChild(T),Lh(d);return}S--}else if(p==="$"||p==="$?"||p==="$~"||p==="$!"||p==="&")S++;else if(p==="html")qp(c.ownerDocument.documentElement);else if(p==="head"){p=c.ownerDocument.head,qp(p);for(var _=p.firstChild;_;){var D=_.nextSibling,L=_.nodeName;_[ul]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&_.rel.toLowerCase()==="stylesheet"||p.removeChild(_),_=D}}else p==="body"&&qp(c.ownerDocument.body);p=T}while(p);Lh(d)}function UD(c,d){var p=c;c=0;do{var S=p.nextSibling;if(p.nodeType===1?d?(p._stashedDisplay=p.style.display,p.style.display="none"):(p.style.display=p._stashedDisplay||"",p.getAttribute("style")===""&&p.removeAttribute("style")):p.nodeType===3&&(d?(p._stashedText=p.nodeValue,p.nodeValue=""):p.nodeValue=p._stashedText||""),S&&S.nodeType===8)if(p=S.data,p==="/$"){if(c===0)break;c--}else p!=="$"&&p!=="$?"&&p!=="$~"&&p!=="$!"||c++;p=S}while(p)}function q1(c){var d=c.firstChild;for(d&&d.nodeType===10&&(d=d.nextSibling);d;){var p=d;switch(d=d.nextSibling,p.nodeName){case"HTML":case"HEAD":case"BODY":q1(p),ps(p);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(p.rel.toLowerCase()==="stylesheet")continue}c.removeChild(p)}}function YX(c,d,p,S){for(;c.nodeType===1;){var T=p;if(c.nodeName.toLowerCase()!==d.toLowerCase()){if(!S&&(c.nodeName!=="INPUT"||c.type!=="hidden"))break}else if(S){if(!c[ul])switch(d){case"meta":if(!c.hasAttribute("itemprop"))break;return c;case"link":if(_=c.getAttribute("rel"),_==="stylesheet"&&c.hasAttribute("data-precedence"))break;if(_!==T.rel||c.getAttribute("href")!==(T.href==null||T.href===""?null:T.href)||c.getAttribute("crossorigin")!==(T.crossOrigin==null?null:T.crossOrigin)||c.getAttribute("title")!==(T.title==null?null:T.title))break;return c;case"style":if(c.hasAttribute("data-precedence"))break;return c;case"script":if(_=c.getAttribute("src"),(_!==(T.src==null?null:T.src)||c.getAttribute("type")!==(T.type==null?null:T.type)||c.getAttribute("crossorigin")!==(T.crossOrigin==null?null:T.crossOrigin))&&_&&c.hasAttribute("async")&&!c.hasAttribute("itemprop"))break;return c;default:return c}}else if(d==="input"&&c.type==="hidden"){var _=T.name==null?null:""+T.name;if(T.type==="hidden"&&c.getAttribute("name")===_)return c}else return c;if(c=ko(c.nextSibling),c===null)break}return null}function WX(c,d,p){if(d==="")return null;for(;c.nodeType!==3;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!p||(c=ko(c.nextSibling),c===null))return null;return c}function HD(c,d){for(;c.nodeType!==8;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!d||(c=ko(c.nextSibling),c===null))return null;return c}function G1(c){return c.data==="$?"||c.data==="$~"}function Y1(c){return c.data==="$!"||c.data==="$?"&&c.ownerDocument.readyState!=="loading"}function XX(c,d){var p=c.ownerDocument;if(c.data==="$~")c._reactRetry=d;else if(c.data!=="$?"||p.readyState!=="loading")d();else{var S=function(){d(),p.removeEventListener("DOMContentLoaded",S)};p.addEventListener("DOMContentLoaded",S),c._reactRetry=S}}function ko(c){for(;c!=null;c=c.nextSibling){var d=c.nodeType;if(d===1||d===3)break;if(d===8){if(d=c.data,d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"||d==="F!"||d==="F")break;if(d==="/$"||d==="/&")return null}}return c}var W1=null;function $D(c){c=c.nextSibling;for(var d=0;c;){if(c.nodeType===8){var p=c.data;if(p==="/$"||p==="/&"){if(d===0)return ko(c.nextSibling);d--}else p!=="$"&&p!=="$!"&&p!=="$?"&&p!=="$~"&&p!=="&"||d++}c=c.nextSibling}return null}function KD(c){c=c.previousSibling;for(var d=0;c;){if(c.nodeType===8){var p=c.data;if(p==="$"||p==="$!"||p==="$?"||p==="$~"||p==="&"){if(d===0)return c;d--}else p!=="/$"&&p!=="/&"||d++}c=c.previousSibling}return null}function VD(c,d,p){switch(d=bS(p),c){case"html":if(c=d.documentElement,!c)throw Error(r(452));return c;case"head":if(c=d.head,!c)throw Error(r(453));return c;case"body":if(c=d.body,!c)throw Error(r(454));return c;default:throw Error(r(451))}}function qp(c){for(var d=c.attributes;d.length;)c.removeAttributeNode(d[0]);ps(c)}var Mo=new Map,qD=new Set;function vS(c){return typeof c.getRootNode=="function"?c.getRootNode():c.nodeType===9?c:c.ownerDocument}var Ml=G.d;G.d={f:ZX,r:JX,D:QX,C:eZ,L:tZ,m:nZ,X:iZ,S:rZ,M:sZ};function ZX(){var c=Ml.f(),d=dS();return c||d}function JX(c){var d=Ca(c);d!==null&&d.tag===5&&d.type==="form"?cO(d):Ml.r(c)}var Dh=typeof document>"u"?null:document;function GD(c,d,p){var S=Dh;if(S&&typeof d=="string"&&d){var T=zn(d);T='link[rel="'+c+'"][href="'+T+'"]',typeof p=="string"&&(T+='[crossorigin="'+p+'"]'),qD.has(T)||(qD.add(T),c={rel:c,crossOrigin:p,href:d},S.querySelector(T)===null&&(d=S.createElement("link"),Jr(d,"link",c),Ln(d),S.head.appendChild(d)))}}function QX(c){Ml.D(c),GD("dns-prefetch",c,null)}function eZ(c,d){Ml.C(c,d),GD("preconnect",c,d)}function tZ(c,d,p){Ml.L(c,d,p);var S=Dh;if(S&&c&&d){var T='link[rel="preload"][as="'+zn(d)+'"]';d==="image"&&p&&p.imageSrcSet?(T+='[imagesrcset="'+zn(p.imageSrcSet)+'"]',typeof p.imageSizes=="string"&&(T+='[imagesizes="'+zn(p.imageSizes)+'"]')):T+='[href="'+zn(c)+'"]';var _=T;switch(d){case"style":_=Rh(c);break;case"script":_=jh(c)}Mo.has(_)||(c=h({rel:"preload",href:d==="image"&&p&&p.imageSrcSet?void 0:c,as:d},p),Mo.set(_,c),S.querySelector(T)!==null||d==="style"&&S.querySelector(Gp(_))||d==="script"&&S.querySelector(Yp(_))||(d=S.createElement("link"),Jr(d,"link",c),Ln(d),S.head.appendChild(d)))}}function nZ(c,d){Ml.m(c,d);var p=Dh;if(p&&c){var S=d&&typeof d.as=="string"?d.as:"script",T='link[rel="modulepreload"][as="'+zn(S)+'"][href="'+zn(c)+'"]',_=T;switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=jh(c)}if(!Mo.has(_)&&(c=h({rel:"modulepreload",href:c},d),Mo.set(_,c),p.querySelector(T)===null)){switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(p.querySelector(Yp(_)))return}S=p.createElement("link"),Jr(S,"link",c),Ln(S),p.head.appendChild(S)}}}function rZ(c,d,p){Ml.S(c,d,p);var S=Dh;if(S&&c){var T=Ta(S).hoistableStyles,_=Rh(c);d=d||"default";var D=T.get(_);if(!D){var L={loading:0,preload:null};if(D=S.querySelector(Gp(_)))L.loading=5;else{c=h({rel:"stylesheet",href:c,"data-precedence":d},p),(p=Mo.get(_))&&X1(c,p);var Y=D=S.createElement("link");Ln(Y),Jr(Y,"link",c),Y._p=new Promise(function(oe,he){Y.onload=oe,Y.onerror=he}),Y.addEventListener("load",function(){L.loading|=1}),Y.addEventListener("error",function(){L.loading|=2}),L.loading|=4,xS(D,d,S)}D={type:"stylesheet",instance:D,count:1,state:L},T.set(_,D)}}}function iZ(c,d){Ml.X(c,d);var p=Dh;if(p&&c){var S=Ta(p).hoistableScripts,T=jh(c),_=S.get(T);_||(_=p.querySelector(Yp(T)),_||(c=h({src:c,async:!0},d),(d=Mo.get(T))&&Z1(c,d),_=p.createElement("script"),Ln(_),Jr(_,"link",c),p.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},S.set(T,_))}}function sZ(c,d){Ml.M(c,d);var p=Dh;if(p&&c){var S=Ta(p).hoistableScripts,T=jh(c),_=S.get(T);_||(_=p.querySelector(Yp(T)),_||(c=h({src:c,async:!0,type:"module"},d),(d=Mo.get(T))&&Z1(c,d),_=p.createElement("script"),Ln(_),Jr(_,"link",c),p.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},S.set(T,_))}}function YD(c,d,p,S){var T=(T=_e.current)?vS(T):null;if(!T)throw Error(r(446));switch(c){case"meta":case"title":return null;case"style":return typeof p.precedence=="string"&&typeof p.href=="string"?(d=Rh(p.href),p=Ta(T).hoistableStyles,S=p.get(d),S||(S={type:"style",instance:null,count:0,state:null},p.set(d,S)),S):{type:"void",instance:null,count:0,state:null};case"link":if(p.rel==="stylesheet"&&typeof p.href=="string"&&typeof p.precedence=="string"){c=Rh(p.href);var _=Ta(T).hoistableStyles,D=_.get(c);if(D||(T=T.ownerDocument||T,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(c,D),(_=T.querySelector(Gp(c)))&&!_._p&&(D.instance=_,D.state.loading=5),Mo.has(c)||(p={rel:"preload",as:"style",href:p.href,crossOrigin:p.crossOrigin,integrity:p.integrity,media:p.media,hrefLang:p.hrefLang,referrerPolicy:p.referrerPolicy},Mo.set(c,p),_||oZ(T,c,p,D.state))),d&&S===null)throw Error(r(528,""));return D}if(d&&S!==null)throw Error(r(529,""));return null;case"script":return d=p.async,p=p.src,typeof p=="string"&&d&&typeof d!="function"&&typeof d!="symbol"?(d=jh(p),p=Ta(T).hoistableScripts,S=p.get(d),S||(S={type:"script",instance:null,count:0,state:null},p.set(d,S)),S):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,c))}}function Rh(c){return'href="'+zn(c)+'"'}function Gp(c){return'link[rel="stylesheet"]['+c+"]"}function WD(c){return h({},c,{"data-precedence":c.precedence,precedence:null})}function oZ(c,d,p,S){c.querySelector('link[rel="preload"][as="style"]['+d+"]")?S.loading=1:(d=c.createElement("link"),S.preload=d,d.addEventListener("load",function(){return S.loading|=1}),d.addEventListener("error",function(){return S.loading|=2}),Jr(d,"link",p),Ln(d),c.head.appendChild(d))}function jh(c){return'[src="'+zn(c)+'"]'}function Yp(c){return"script[async]"+c}function XD(c,d,p){if(d.count++,d.instance===null)switch(d.type){case"style":var S=c.querySelector('style[data-href~="'+zn(p.href)+'"]');if(S)return d.instance=S,Ln(S),S;var T=h({},p,{"data-href":p.href,"data-precedence":p.precedence,href:null,precedence:null});return S=(c.ownerDocument||c).createElement("style"),Ln(S),Jr(S,"style",T),xS(S,p.precedence,c),d.instance=S;case"stylesheet":T=Rh(p.href);var _=c.querySelector(Gp(T));if(_)return d.state.loading|=4,d.instance=_,Ln(_),_;S=WD(p),(T=Mo.get(T))&&X1(S,T),_=(c.ownerDocument||c).createElement("link"),Ln(_);var D=_;return D._p=new Promise(function(L,Y){D.onload=L,D.onerror=Y}),Jr(_,"link",S),d.state.loading|=4,xS(_,p.precedence,c),d.instance=_;case"script":return _=jh(p.src),(T=c.querySelector(Yp(_)))?(d.instance=T,Ln(T),T):(S=p,(T=Mo.get(_))&&(S=h({},p),Z1(S,T)),c=c.ownerDocument||c,T=c.createElement("script"),Ln(T),Jr(T,"link",S),c.head.appendChild(T),d.instance=T);case"void":return null;default:throw Error(r(443,d.type))}else d.type==="stylesheet"&&(d.state.loading&4)===0&&(S=d.instance,d.state.loading|=4,xS(S,p.precedence,c));return d.instance}function xS(c,d,p){for(var S=p.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),T=S.length?S[S.length-1]:null,_=T,D=0;D<S.length;D++){var L=S[D];if(L.dataset.precedence===d)_=L;else if(_!==T)break}_?_.parentNode.insertBefore(c,_.nextSibling):(d=p.nodeType===9?p.head:p,d.insertBefore(c,d.firstChild))}function X1(c,d){c.crossOrigin==null&&(c.crossOrigin=d.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=d.referrerPolicy),c.title==null&&(c.title=d.title)}function Z1(c,d){c.crossOrigin==null&&(c.crossOrigin=d.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=d.referrerPolicy),c.integrity==null&&(c.integrity=d.integrity)}var wS=null;function ZD(c,d,p){if(wS===null){var S=new Map,T=wS=new Map;T.set(p,S)}else T=wS,S=T.get(p),S||(S=new Map,T.set(p,S));if(S.has(c))return S;for(S.set(c,null),p=p.getElementsByTagName(c),T=0;T<p.length;T++){var _=p[T];if(!(_[ul]||_[Zn]||c==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var D=_.getAttribute(d)||"";D=c+D;var L=S.get(D);L?L.push(_):S.set(D,[_])}}return S}function JD(c,d,p){c=c.ownerDocument||c,c.head.insertBefore(p,d==="title"?c.querySelector("head > title"):null)}function aZ(c,d,p){if(p===1||d.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof d.precedence!="string"||typeof d.href!="string"||d.href==="")break;return!0;case"link":if(typeof d.rel!="string"||typeof d.href!="string"||d.href===""||d.onLoad||d.onError)break;switch(d.rel){case"stylesheet":return c=d.disabled,typeof d.precedence=="string"&&c==null;default:return!0}case"script":if(d.async&&typeof d.async!="function"&&typeof d.async!="symbol"&&!d.onLoad&&!d.onError&&d.src&&typeof d.src=="string")return!0}return!1}function QD(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function lZ(c,d,p,S){if(p.type==="stylesheet"&&(typeof S.media!="string"||matchMedia(S.media).matches!==!1)&&(p.state.loading&4)===0){if(p.instance===null){var T=Rh(S.href),_=d.querySelector(Gp(T));if(_){d=_._p,d!==null&&typeof d=="object"&&typeof d.then=="function"&&(c.count++,c=CS.bind(c),d.then(c,c)),p.state.loading|=4,p.instance=_,Ln(_);return}_=d.ownerDocument||d,S=WD(S),(T=Mo.get(T))&&X1(S,T),_=_.createElement("link"),Ln(_);var D=_;D._p=new Promise(function(L,Y){D.onload=L,D.onerror=Y}),Jr(_,"link",S),p.instance=_}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(p,d),(d=p.state.preload)&&(p.state.loading&3)===0&&(c.count++,p=CS.bind(c),d.addEventListener("load",p),d.addEventListener("error",p))}}var J1=0;function cZ(c,d){return c.stylesheets&&c.count===0&&ES(c,c.stylesheets),0<c.count||0<c.imgCount?function(p){var S=setTimeout(function(){if(c.stylesheets&&ES(c,c.stylesheets),c.unsuspend){var _=c.unsuspend;c.unsuspend=null,_()}},6e4+d);0<c.imgBytes&&J1===0&&(J1=62500*$X());var T=setTimeout(function(){if(c.waitingForImages=!1,c.count===0&&(c.stylesheets&&ES(c,c.stylesheets),c.unsuspend)){var _=c.unsuspend;c.unsuspend=null,_()}},(c.imgBytes>J1?50:800)+d);return c.unsuspend=p,function(){c.unsuspend=null,clearTimeout(S),clearTimeout(T)}}:null}function CS(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ES(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var TS=null;function ES(c,d){c.stylesheets=null,c.unsuspend!==null&&(c.count++,TS=new Map,d.forEach(uZ,c),TS=null,CS.call(c))}function uZ(c,d){if(!(d.state.loading&4)){var p=TS.get(c);if(p)var S=p.get(null);else{p=new Map,TS.set(c,p);for(var T=c.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<T.length;_++){var D=T[_];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(p.set(D.dataset.precedence,D),S=D)}S&&p.set(null,S)}T=d.instance,D=T.getAttribute("data-precedence"),_=p.get(D)||S,_===S&&p.set(null,T),p.set(D,T),this.count++,S=CS.bind(this),T.addEventListener("load",S),T.addEventListener("error",S),_?_.parentNode.insertBefore(T,_.nextSibling):(c=c.nodeType===9?c.head:c,c.insertBefore(T,c.firstChild)),d.state.loading|=4}}var Wp={$$typeof:P,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function dZ(c,d,p,S,T,_,D,L,Y){this.tag=1,this.containerInfo=c,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=Jo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jo(0),this.hiddenUpdates=Jo(null),this.identifierPrefix=S,this.onUncaughtError=T,this.onCaughtError=_,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function eR(c,d,p,S,T,_,D,L,Y,oe,he,Se){return c=new dZ(c,d,p,D,Y,oe,he,Se,L),d=1,_===!0&&(d|=24),_=Ks(3,null,null,d),c.current=_,_.stateNode=c,d=Aw(),d.refCount++,c.pooledCache=d,d.refCount++,_.memoizedState={element:S,isDehydrated:p,cache:d},jw(_),c}function tR(c){return c?(c=hh,c):hh}function nR(c,d,p,S,T,_){T=tR(T),S.context===null?S.context=T:S.pendingContext=T,S=bc(d),S.payload={element:p},_=_===void 0?null:_,_!==null&&(S.callback=_),p=vc(c,S,d),p!==null&&(ws(p,c,d),Pp(p,c,d))}function rR(c,d){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var p=c.retryLane;c.retryLane=p!==0&&p<d?p:d}}function Q1(c,d){rR(c,d),(c=c.alternate)&&rR(c,d)}function iR(c){if(c.tag===13||c.tag===31){var d=Ku(c,67108864);d!==null&&ws(d,c,67108864),Q1(c,67108864)}}function sR(c){if(c.tag===13||c.tag===31){var d=Ws();d=ac(d);var p=Ku(c,d);p!==null&&ws(p,c,d),Q1(c,d)}}var _S=!0;function hZ(c,d,p,S){var T=B.T;B.T=null;var _=G.p;try{G.p=2,eC(c,d,p,S)}finally{G.p=_,B.T=T}}function fZ(c,d,p,S){var T=B.T;B.T=null;var _=G.p;try{G.p=8,eC(c,d,p,S)}finally{G.p=_,B.T=T}}function eC(c,d,p,S){if(_S){var T=tC(S);if(T===null)F1(c,d,S,PS,p),aR(c,S);else if(gZ(T,c,d,p,S))S.stopPropagation();else if(aR(c,S),d&4&&-1<pZ.indexOf(c)){for(;T!==null;){var _=Ca(T);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var D=Ns(_.pendingLanes);if(D!==0){var L=_;for(L.pendingLanes|=2,L.entangledLanes|=2;D;){var Y=1<<31-An(D);L.entanglements[1]|=Y,D&=~Y}ka(_),($t&6)===0&&(cS=dr()+500,$p(0))}}break;case 31:case 13:L=Ku(_,2),L!==null&&ws(L,_,2),dS(),Q1(_,2)}if(_=tC(S),_===null&&F1(c,d,S,PS,p),_===T)break;T=_}T!==null&&S.stopPropagation()}else F1(c,d,S,null,p)}}function tC(c){return c=Jt(c),nC(c)}var PS=null;function nC(c){if(PS=null,c=gi(c),c!==null){var d=s(c);if(d===null)c=null;else{var p=d.tag;if(p===13){if(c=o(d),c!==null)return c;c=null}else if(p===31){if(c=a(d),c!==null)return c;c=null}else if(p===3){if(d.stateNode.current.memoizedState.isDehydrated)return d.tag===3?d.stateNode.containerInfo:null;c=null}else d!==c&&(c=null)}}return PS=c,null}function oR(c){switch(c){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Fi()){case So:return 2;case Xo:return 8;case us:case al:return 32;case ce:return 268435456;default:return 32}default:return 32}}var rC=!1,Ac=null,Oc=null,Dc=null,Xp=new Map,Zp=new Map,Rc=[],pZ="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 aR(c,d){switch(c){case"focusin":case"focusout":Ac=null;break;case"dragenter":case"dragleave":Oc=null;break;case"mouseover":case"mouseout":Dc=null;break;case"pointerover":case"pointerout":Xp.delete(d.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zp.delete(d.pointerId)}}function Jp(c,d,p,S,T,_){return c===null||c.nativeEvent!==_?(c={blockedOn:d,domEventName:p,eventSystemFlags:S,nativeEvent:_,targetContainers:[T]},d!==null&&(d=Ca(d),d!==null&&iR(d)),c):(c.eventSystemFlags|=S,d=c.targetContainers,T!==null&&d.indexOf(T)===-1&&d.push(T),c)}function gZ(c,d,p,S,T){switch(d){case"focusin":return Ac=Jp(Ac,c,d,p,S,T),!0;case"dragenter":return Oc=Jp(Oc,c,d,p,S,T),!0;case"mouseover":return Dc=Jp(Dc,c,d,p,S,T),!0;case"pointerover":var _=T.pointerId;return Xp.set(_,Jp(Xp.get(_)||null,c,d,p,S,T)),!0;case"gotpointercapture":return _=T.pointerId,Zp.set(_,Jp(Zp.get(_)||null,c,d,p,S,T)),!0}return!1}function lR(c){var d=gi(c.target);if(d!==null){var p=s(d);if(p!==null){if(d=p.tag,d===13){if(d=o(p),d!==null){c.blockedOn=d,Qd(c.priority,function(){sR(p)});return}}else if(d===31){if(d=a(p),d!==null){c.blockedOn=d,Qd(c.priority,function(){sR(p)});return}}else if(d===3&&p.stateNode.current.memoizedState.isDehydrated){c.blockedOn=p.tag===3?p.stateNode.containerInfo:null;return}}}c.blockedOn=null}function IS(c){if(c.blockedOn!==null)return!1;for(var d=c.targetContainers;0<d.length;){var p=tC(c.nativeEvent);if(p===null){p=c.nativeEvent;var S=new p.constructor(p.type,p);ze=S,p.target.dispatchEvent(S),ze=null}else return d=Ca(p),d!==null&&iR(d),c.blockedOn=p,!1;d.shift()}return!0}function cR(c,d,p){IS(c)&&p.delete(d)}function mZ(){rC=!1,Ac!==null&&IS(Ac)&&(Ac=null),Oc!==null&&IS(Oc)&&(Oc=null),Dc!==null&&IS(Dc)&&(Dc=null),Xp.forEach(cR),Zp.forEach(cR)}function kS(c,d){c.blockedOn===d&&(c.blockedOn=null,rC||(rC=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,mZ)))}var MS=null;function uR(c){MS!==c&&(MS=c,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){MS===c&&(MS=null);for(var d=0;d<c.length;d+=3){var p=c[d],S=c[d+1],T=c[d+2];if(typeof S!="function"){if(nC(S||p)===null)continue;break}var _=Ca(p);_!==null&&(c.splice(d,3),d-=3,t1(_,{pending:!0,data:T,method:p.method,action:S},S,T))}}))}function Lh(c){function d(Y){return kS(Y,c)}Ac!==null&&kS(Ac,c),Oc!==null&&kS(Oc,c),Dc!==null&&kS(Dc,c),Xp.forEach(d),Zp.forEach(d);for(var p=0;p<Rc.length;p++){var S=Rc[p];S.blockedOn===c&&(S.blockedOn=null)}for(;0<Rc.length&&(p=Rc[0],p.blockedOn===null);)lR(p),p.blockedOn===null&&Rc.shift();if(p=(c.ownerDocument||c).$$reactFormReplay,p!=null)for(S=0;S<p.length;S+=3){var T=p[S],_=p[S+1],D=T[Ar]||null;if(typeof _=="function")D||uR(p);else if(D){var L=null;if(_&&_.hasAttribute("formAction")){if(T=_,D=_[Ar]||null)L=D.formAction;else if(nC(T)!==null)continue}else L=D.action;typeof L=="function"?p[S+1]=L:(p.splice(S,3),S-=3),uR(p)}}}function dR(){function c(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(D){return T=D})},focusReset:"manual",scroll:"manual"})}function d(){T!==null&&(T(),T=null),S||setTimeout(p,20)}function p(){if(!S&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var S=!1,T=null;return navigation.addEventListener("navigate",c),navigation.addEventListener("navigatesuccess",d),navigation.addEventListener("navigateerror",d),setTimeout(p,100),function(){S=!0,navigation.removeEventListener("navigate",c),navigation.removeEventListener("navigatesuccess",d),navigation.removeEventListener("navigateerror",d),T!==null&&(T(),T=null)}}}function iC(c){this._internalRoot=c}AS.prototype.render=iC.prototype.render=function(c){var d=this._internalRoot;if(d===null)throw Error(r(409));var p=d.current,S=Ws();nR(p,S,c,d,null,null)},AS.prototype.unmount=iC.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var d=c.containerInfo;nR(c.current,2,null,c,null,null),dS(),d[wa]=null}};function AS(c){this._internalRoot=c}AS.prototype.unstable_scheduleHydration=function(c){if(c){var d=bo();c={blockedOn:null,target:c,priority:d};for(var p=0;p<Rc.length&&d!==0&&d<Rc[p].priority;p++);Rc.splice(p,0,c),p===0&&lR(c)}};var hR=e.version;if(hR!=="19.2.3")throw Error(r(527,hR,"19.2.3"));G.findDOMNode=function(c){var d=c._reactInternals;if(d===void 0)throw typeof c.render=="function"?Error(r(188)):(c=Object.keys(c).join(","),Error(r(268,c)));return c=u(d),c=c!==null?f(c):null,c=c===null?null:c.stateNode,c};var yZ={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var OS=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!OS.isDisabled&&OS.supportsFiber)try{At=OS.inject(yZ),qt=OS}catch{}}return eg.createRoot=function(c,d){if(!i(c))throw Error(r(299));var p=!1,S="",T=bO,_=vO,D=xO;return d!=null&&(d.unstable_strictMode===!0&&(p=!0),d.identifierPrefix!==void 0&&(S=d.identifierPrefix),d.onUncaughtError!==void 0&&(T=d.onUncaughtError),d.onCaughtError!==void 0&&(_=d.onCaughtError),d.onRecoverableError!==void 0&&(D=d.onRecoverableError)),d=eR(c,1,!1,null,null,p,S,null,T,_,D,dR),c[wa]=d.current,B1(c),new iC(d)},eg.hydrateRoot=function(c,d,p){if(!i(c))throw Error(r(299));var S=!1,T="",_=bO,D=vO,L=xO,Y=null;return p!=null&&(p.unstable_strictMode===!0&&(S=!0),p.identifierPrefix!==void 0&&(T=p.identifierPrefix),p.onUncaughtError!==void 0&&(_=p.onUncaughtError),p.onCaughtError!==void 0&&(D=p.onCaughtError),p.onRecoverableError!==void 0&&(L=p.onRecoverableError),p.formState!==void 0&&(Y=p.formState)),d=eR(c,1,!0,d,p??null,S,T,Y,_,D,L,dR),d.context=tR(null),p=d.current,S=Ws(),S=ac(S),T=bc(S),T.callback=null,vc(p,T,S),p=S,d.current.lanes=p,ll(d,p),ka(d),c[wa]=d.current,B1(c),new AS(d)},eg.version="19.2.3",eg}var wR;function PZ(){if(wR)return aC.exports;wR=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),aC.exports=_Z(),aC.exports}var DB=PZ();const IZ=Ja(DB);function Ie(t,e={}){const n=typeof t=="string"?t:t.src;if(typeof e=="function")return e(n);const{baseUrl:r=""}=e;return n.startsWith("data:")||n.match(/^https?:\/\//)?n:`${r.replace(/\/$/,"")}/${n.replace(/^\.?\//,"")}`}function kZ(t){const e=Ie("./icons/icon/0_merged.svg",t);return{fonts:{tldraw_mono_bold:Ie("./fonts/IBMPlexMono-Bold.woff2",t),tldraw_mono_italic_bold:Ie("./fonts/IBMPlexMono-BoldItalic.woff2",t),tldraw_mono:Ie("./fonts/IBMPlexMono-Medium.woff2",t),tldraw_mono_italic:Ie("./fonts/IBMPlexMono-MediumItalic.woff2",t),tldraw_sans_bold:Ie("./fonts/IBMPlexSans-Bold.woff2",t),tldraw_sans_italic_bold:Ie("./fonts/IBMPlexSans-BoldItalic.woff2",t),tldraw_sans:Ie("./fonts/IBMPlexSans-Medium.woff2",t),tldraw_sans_italic:Ie("./fonts/IBMPlexSans-MediumItalic.woff2",t),tldraw_serif_bold:Ie("./fonts/IBMPlexSerif-Bold.woff2",t),tldraw_serif_italic_bold:Ie("./fonts/IBMPlexSerif-BoldItalic.woff2",t),tldraw_serif:Ie("./fonts/IBMPlexSerif-Medium.woff2",t),tldraw_serif_italic:Ie("./fonts/IBMPlexSerif-MediumItalic.woff2",t),tldraw_draw_bold:Ie("./fonts/Shantell_Sans-Informal_Bold.woff2",t),tldraw_draw_italic_bold:Ie("./fonts/Shantell_Sans-Informal_Bold_Italic.woff2",t),tldraw_draw:Ie("./fonts/Shantell_Sans-Informal_Regular.woff2",t),tldraw_draw_italic:Ie("./fonts/Shantell_Sans-Informal_Regular_Italic.woff2",t)},icons:{"align-bottom":e+"#align-bottom","align-center-horizontal":e+"#align-center-horizontal","align-center-vertical":e+"#align-center-vertical","align-left":e+"#align-left","align-right":e+"#align-right","align-top":e+"#align-top",alt:e+"#alt","arrow-arc":e+"#arrow-arc","arrow-cycle":e+"#arrow-cycle","arrow-elbow":e+"#arrow-elbow","arrow-left":e+"#arrow-left","arrowhead-arrow":e+"#arrowhead-arrow","arrowhead-bar":e+"#arrowhead-bar","arrowhead-diamond":e+"#arrowhead-diamond","arrowhead-dot":e+"#arrowhead-dot","arrowhead-none":e+"#arrowhead-none","arrowhead-square":e+"#arrowhead-square","arrowhead-triangle-inverted":e+"#arrowhead-triangle-inverted","arrowhead-triangle":e+"#arrowhead-triangle",blob:e+"#blob",bold:e+"#bold",bookmark:e+"#bookmark","bring-forward":e+"#bring-forward","bring-to-front":e+"#bring-to-front",broken:e+"#broken",bulletList:e+"#bulletList","check-circle":e+"#check-circle",check:e+"#check","chevron-down":e+"#chevron-down","chevron-left":e+"#chevron-left","chevron-right":e+"#chevron-right","chevron-up":e+"#chevron-up","chevrons-ne":e+"#chevrons-ne","chevrons-sw":e+"#chevrons-sw","clipboard-copied":e+"#clipboard-copied","clipboard-copy":e+"#clipboard-copy",code:e+"#code",color:e+"#color",comment:e+"#comment",corners:e+"#corners",crop:e+"#crop","cross-2":e+"#cross-2","cross-circle":e+"#cross-circle","dash-dashed":e+"#dash-dashed","dash-dotted":e+"#dash-dotted","dash-draw":e+"#dash-draw","dash-solid":e+"#dash-solid",disconnected:e+"#disconnected",discord:e+"#discord","distribute-horizontal":e+"#distribute-horizontal","distribute-vertical":e+"#distribute-vertical",dot:e+"#dot","dots-horizontal":e+"#dots-horizontal","dots-vertical":e+"#dots-vertical",download:e+"#download","drag-handle-dots":e+"#drag-handle-dots",duplicate:e+"#duplicate",edit:e+"#edit","external-link":e+"#external-link","fill-fill":e+"#fill-fill","fill-none":e+"#fill-none","fill-pattern":e+"#fill-pattern","fill-semi":e+"#fill-semi","fill-solid":e+"#fill-solid",follow:e+"#follow",following:e+"#following","font-draw":e+"#font-draw","font-mono":e+"#font-mono","font-sans":e+"#font-sans","font-serif":e+"#font-serif","geo-arrow-down":e+"#geo-arrow-down","geo-arrow-left":e+"#geo-arrow-left","geo-arrow-right":e+"#geo-arrow-right","geo-arrow-up":e+"#geo-arrow-up","geo-check-box":e+"#geo-check-box","geo-cloud":e+"#geo-cloud","geo-diamond":e+"#geo-diamond","geo-ellipse":e+"#geo-ellipse","geo-heart":e+"#geo-heart","geo-hexagon":e+"#geo-hexagon","geo-octagon":e+"#geo-octagon","geo-oval":e+"#geo-oval","geo-pentagon":e+"#geo-pentagon","geo-rectangle":e+"#geo-rectangle","geo-rhombus-2":e+"#geo-rhombus-2","geo-rhombus":e+"#geo-rhombus","geo-star":e+"#geo-star","geo-trapezoid":e+"#geo-trapezoid","geo-triangle":e+"#geo-triangle","geo-x-box":e+"#geo-x-box",github:e+"#github",group:e+"#group",heading:e+"#heading","help-circle":e+"#help-circle",highlight:e+"#highlight","horizontal-align-end":e+"#horizontal-align-end","horizontal-align-middle":e+"#horizontal-align-middle","horizontal-align-start":e+"#horizontal-align-start","info-circle":e+"#info-circle",italic:e+"#italic",leading:e+"#leading",link:e+"#link",list:e+"#list",lock:e+"#lock",manual:e+"#manual",menu:e+"#menu",minus:e+"#minus",mixed:e+"#mixed",pack:e+"#pack",plus:e+"#plus","question-mark-circle":e+"#question-mark-circle","question-mark":e+"#question-mark",redo:e+"#redo","reset-zoom":e+"#reset-zoom","rotate-ccw":e+"#rotate-ccw","rotate-cw":e+"#rotate-cw","send-backward":e+"#send-backward","send-to-back":e+"#send-to-back","share-1":e+"#share-1","size-extra-large":e+"#size-extra-large","size-large":e+"#size-large","size-medium":e+"#size-medium","size-small":e+"#size-small","spline-cubic":e+"#spline-cubic","spline-line":e+"#spline-line","stack-horizontal":e+"#stack-horizontal","stack-vertical":e+"#stack-vertical","status-offline":e+"#status-offline","stretch-horizontal":e+"#stretch-horizontal","stretch-vertical":e+"#stretch-vertical",strike:e+"#strike","text-align-center":e+"#text-align-center","text-align-left":e+"#text-align-left","text-align-right":e+"#text-align-right","toggle-off":e+"#toggle-off","toggle-on":e+"#toggle-on","tool-arrow":e+"#tool-arrow","tool-eraser":e+"#tool-eraser","tool-frame":e+"#tool-frame","tool-hand":e+"#tool-hand","tool-highlight":e+"#tool-highlight","tool-laser":e+"#tool-laser","tool-line":e+"#tool-line","tool-media":e+"#tool-media","tool-note":e+"#tool-note","tool-pencil":e+"#tool-pencil","tool-pointer":e+"#tool-pointer","tool-screenshot":e+"#tool-screenshot","tool-text":e+"#tool-text",trash:e+"#trash",twitter:e+"#twitter",underline:e+"#underline",undo:e+"#undo",ungroup:e+"#ungroup",unlock:e+"#unlock","vertical-align-end":e+"#vertical-align-end","vertical-align-middle":e+"#vertical-align-middle","vertical-align-start":e+"#vertical-align-start","warning-triangle":e+"#warning-triangle","zoom-in":e+"#zoom-in","zoom-out":e+"#zoom-out"},translations:{ar:Ie("./translations/ar.json",t),bn:Ie("./translations/bn.json",t),ca:Ie("./translations/ca.json",t),cs:Ie("./translations/cs.json",t),da:Ie("./translations/da.json",t),de:Ie("./translations/de.json",t),el:Ie("./translations/el.json",t),en:Ie("./translations/en.json",t),es:Ie("./translations/es.json",t),fa:Ie("./translations/fa.json",t),fi:Ie("./translations/fi.json",t),fr:Ie("./translations/fr.json",t),gl:Ie("./translations/gl.json",t),"gu-in":Ie("./translations/gu-in.json",t),he:Ie("./translations/he.json",t),"hi-in":Ie("./translations/hi-in.json",t),hr:Ie("./translations/hr.json",t),hu:Ie("./translations/hu.json",t),id:Ie("./translations/id.json",t),it:Ie("./translations/it.json",t),ja:Ie("./translations/ja.json",t),"km-kh":Ie("./translations/km-kh.json",t),kn:Ie("./translations/kn.json",t),"ko-kr":Ie("./translations/ko-kr.json",t),ku:Ie("./translations/ku.json",t),languages:Ie("./translations/languages.json",t),main:Ie("./translations/main.json",t),ml:Ie("./translations/ml.json",t),mr:Ie("./translations/mr.json",t),ms:Ie("./translations/ms.json",t),my:Ie("./translations/my.json",t),ne:Ie("./translations/ne.json",t),nl:Ie("./translations/nl.json",t),no:Ie("./translations/no.json",t),pa:Ie("./translations/pa.json",t),pl:Ie("./translations/pl.json",t),"pt-br":Ie("./translations/pt-br.json",t),"pt-pt":Ie("./translations/pt-pt.json",t),ro:Ie("./translations/ro.json",t),ru:Ie("./translations/ru.json",t),sl:Ie("./translations/sl.json",t),so:Ie("./translations/so.json",t),sv:Ie("./translations/sv.json",t),ta:Ie("./translations/ta.json",t),te:Ie("./translations/te.json",t),th:Ie("./translations/th.json",t),tl:Ie("./translations/tl.json",t),tr:Ie("./translations/tr.json",t),uk:Ie("./translations/uk.json",t),ur:Ie("./translations/ur.json",t),vi:Ie("./translations/vi.json",t),"zh-cn":Ie("./translations/zh-cn.json",t),"zh-tw":Ie("./translations/zh-tw.json",t)},embedIcons:{codepen:Ie("./embed-icons/codepen.png",t),codesandbox:Ie("./embed-icons/codesandbox.png",t),desmos:Ie("./embed-icons/desmos.png",t),excalidraw:Ie("./embed-icons/excalidraw.png",t),felt:Ie("./embed-icons/felt.png",t),figma:Ie("./embed-icons/figma.png",t),github_gist:Ie("./embed-icons/github_gist.png",t),google_calendar:Ie("./embed-icons/google_calendar.png",t),google_maps:Ie("./embed-icons/google_maps.png",t),google_slides:Ie("./embed-icons/google_slides.png",t),observable:Ie("./embed-icons/observable.png",t),replit:Ie("./embed-icons/replit.png",t),scratch:Ie("./embed-icons/scratch.png",t),spotify:Ie("./embed-icons/spotify.png",t),tldraw:Ie("./embed-icons/tldraw.png",t),val_town:Ie("./embed-icons/val_town.png",t),vimeo:Ie("./embed-icons/vimeo.png",t),youtube:Ie("./embed-icons/youtube.png",t)}}}const dC="__TLDRAW_LIBRARY_VERSIONS__";function MZ(){if(globalThis[dC])return globalThis[dC];const t={versions:[],didWarn:!1,scheduledNotice:null};return Object.defineProperty(globalThis,dC,{value:t,writable:!1,configurable:!1,enumerable:!1}),t}function Cu(t,e,n){if(!t||!e||!n)throw new Error("Missing name/version/module system in built version of tldraw library");const r=MZ();if(r.versions.push({name:t,version:e,modules:n}),!r.scheduledNotice)try{r.scheduledNotice=setTimeout(()=>{r.scheduledNotice=null,CR(r)},100)}catch{CR(r)}}function CR(t){if(!t.versions.length||t.didWarn)return;const e=t.versions.sort((a,l)=>TR(a.version,l.version)),n=e[e.length-1].version,r=new Set,i=new Map;for(const a of e){if(i.has(a.name)){r.delete(a.name),hC(i,a.name,new Set).add(a.version);continue}a.version===n?r.add(a.name):(r.delete(a.name),hC(i,a.name,new Set).add(a.version))}if(i.size>0){const a=[`${Al("[tldraw]",["bold","bgRed","textWhite"])} ${Al("You have multiple versions of tldraw libraries installed. This can lead to bugs and unexpected behavior.",["textRed","bold"])}`,"",`The latest version you have installed is ${Al(`v${n}`,["bold","textBlue"])}. The following libraries are on the latest version:`,...Array.from(r,l=>` • ✅ ${Al(l,["bold"])}`),"","The following libraries are not on the latest version, or have multiple versions installed:",...Array.from(i,([l,u])=>{const f=Array.from(u).sort(TR).map(h=>Al(`v${h}`,h===n?["textGreen"]:["textRed"]));return` • ❌ ${Al(l,["bold"])} (${f.join(", ")})`})];console.log(a.join(`
10
10
  `)),t.didWarn=!0;return}const s=new Map;for(const a of e)hC(s,a.name,{version:a.version,modules:[]}).modules.push(a.modules);const o=new Map;for(const[a,l]of s)l.modules.length>1&&o.set(a,l);if(o.size>0){const a=[`${Al("[tldraw]",["bold","bgRed","textWhite"])} ${Al("You have multiple instances of some tldraw libraries active. This can lead to bugs and unexpected behavior. ",["textRed","bold"])}`,"","This usually means that your bundler is misconfigured, and is importing the same library multiple times - usually once as an ES Module, and once as a CommonJS module.","","The following libraries have been imported multiple times:",...Array.from(o,([l,u])=>{const f=u.modules.map((h,g)=>h==="esm"?` ${g+1}. ES Modules`:` ${g+1}. CommonJS`).join(`
11
11
  `);return` • ❌ ${Al(l,["bold"])} v${u.version}:
12
12
  ${f}`}),"","You should configure your bundler to only import one version of each library."];console.log(a.join(`
@@ -159,7 +159,7 @@ To remove the watermark, please purchase a license at tldraw.dev.
159
159
  opacity: 1;
160
160
  pointer-events: all;
161
161
  }
162
- }`;return y.jsx("style",{nonce:e.options.nonce,children:r})}),doe=[],hoe=[],foe=[],poe="tl-container",goe=E.memo(function({store:e,components:n,className:r,user:i,options:s,...o}){const[a,l]=E.useState(null),u=E.useMemo(()=>i??Q4(),[i]),f=n?.ErrorFallback===void 0?H4:n?.ErrorFallback,h={...o,shapeUtils:o.shapeUtils??doe,bindingUtils:o.bindingUtils??hoe,tools:o.tools??foe,components:n,options:Qf(s)};return y.jsx("div",{ref:l,"data-tldraw":Sk,draggable:!1,className:Fe(`${poe} tl-theme__light`,r),tabIndex:-1,role:"application","aria-label":s?.branding??"tldraw",children:y.jsx(fm,{fallback:f,onError:g=>EI(g,{tags:{origin:"react.tldraw-before-app"}}),children:a&&y.jsx(Qse,{licenseKey:o.licenseKey,children:y.jsx(F4,{container:a,children:y.jsx(Moe,{overrides:n,children:e?e instanceof ek?y.jsx(vH,{...h,store:e,user:u}):y.jsx(bH,{...h,store:e,user:u}):y.jsx(moe,{...h,store:e,user:u})})})})})})});function moe(t){const{defaultName:e,snapshot:n,initialData:r,shapeUtils:i,bindingUtils:s,persistenceKey:o,sessionId:a,user:l,assets:u,migrations:f}=t,h=Hse({shapeUtils:i,bindingUtils:s,initialData:r,persistenceKey:o,sessionId:a,defaultName:e,snapshot:n,assets:u,migrations:f});return y.jsx(bH,{...t,store:h,user:l})}const bH=E.memo(function({store:e,user:n,...r}){const i=ur();E.useLayoutEffect(()=>{n.userPreferences.get().colorScheme==="dark"&&(i.classList.remove("tl-theme__light"),i.classList.add("tl-theme__dark"))},[i,n]);const{LoadingScreen:s}=on();switch(e.status){case"error":throw e.error;case"loading":return s?y.jsx(s,{}):null}return y.jsx(vH,{...r,store:e.store,user:n})}),zE=()=>document.location.search.includes("tldraw_preserve_focus");function vH({onMount:t,children:e,store:n,tools:r,shapeUtils:i,bindingUtils:s,user:o,initialState:a,autoFocus:l=!0,inferDarkMode:u,cameraOptions:f,textOptions:h,options:g,licenseKey:m,deepLinks:b,getShapeVisibility:w,assetUrls:x}){const{ErrorFallback:v}=on(),C=ur(),[P,k]=yH(null),M=E.useRef(null),A=Qf(b===!0?{}:b),O=E.useRef({autoFocus:l&&!zE(),inferDarkMode:u,initialState:a,cameraOptions:f,deepLinks:A});E.useLayoutEffect(()=>{O.current={autoFocus:l&&!zE(),inferDarkMode:u,initialState:a,cameraOptions:f,deepLinks:A}},[l,u,a,f,A]),E.useLayoutEffect(()=>{const{autoFocus:z,inferDarkMode:K,initialState:B,cameraOptions:G,deepLinks:W}=O.current,Z=new Ae({store:n,shapeUtils:i,bindingUtils:s,tools:r,getContainer:()=>C,user:o,initialState:B,autoFocus:z,inferDarkMode:K,cameraOptions:G,textOptions:h,options:g,licenseKey:m,getShapeVisibility:w,fontAssetUrls:x?.fonts});return Z.updateViewportScreenBounds(M.current??C),W&&(W?.getUrl?Z.navigateToDeepLink({...W,url:W.getUrl(Z)}):Z.navigateToDeepLink(W)),k(Z),()=>{Z.dispose()}},[s,C,g,i,n,r,o,k,m,w,h,x]),E.useLayoutEffect(()=>{if(P&&A)return P.registerDeepLinkListener(A)},[P,A]),E.useLayoutEffect(()=>{P&&f&&P.setCameraOptions(f)},[P,f]);const R=E.useSyncExternalStore(E.useCallback(z=>P?(P.on("crash",z),()=>P.off("crash",z)):()=>{},[P]),()=>P?.getCrashingError()??null);E.useEffect(function(){if(!P)return;function K(){P&&P.focus()}function B(){P&&P.blur()}if(l&&zE())return P.getContainer().addEventListener("pointerdown",K),document.body.addEventListener("pointerdown",B),()=>{P.getContainer()?.removeEventListener("pointerdown",K),document.body.removeEventListener("pointerdown",B)}},[P,l]);const[F,N]=E.useState(null);let j=F;P!==j?.editor&&(j=null),E.useLayoutEffect(()=>{if(!P)return;if(P.options.maxFontsToLoadBeforeRender===0){N({editor:P,isLoaded:!0});return}let z=!1;return N({editor:P,isLoaded:!1}),P.fonts.loadRequiredFontsForCurrentPage(P.options.maxFontsToLoadBeforeRender).finally(()=>{z||N({editor:P,isLoaded:!0})}),()=>{z=!0}},[P]);const{Canvas:H,LoadingScreen:V}=on();return!P||!j?.isLoaded?y.jsxs(y.Fragment,{children:[V&&y.jsx(V,{}),y.jsx("div",{className:"tl-canvas",ref:M})]}):y.jsx(fm,{fallback:v,onError:z=>P.annotateError(z,{origin:"react.tldraw",willCrashApp:!0}),children:R?y.jsx(Soe,{crashingError:R}):y.jsx(mk,{editor:P,children:y.jsxs(yoe,{onMount:t,children:[e??(H?y.jsx(H,{},P.contextId):null),y.jsx(aoe,{})]})})})}function yoe({children:t,onMount:e}){return Kse(),pse(),gse(),mse(),$se(),wH(n=>{const r=n.store.props.onMount(n),i=e?.(n);return()=>{r?.(),i?.()}}),t}function Soe({crashingError:t}){throw t}function xH({children:t}){return y.jsx("div",{className:"tl-loading","aria-busy":"true",tabIndex:0,children:t})}function wH(t){const e=te(),n=za(r=>{let i;return r.run(()=>{i=t?.(r),r.emit("mount")},{history:"ignore"}),window.tldrawReady=!0,i});qe.useLayoutEffect(()=>{if(e)return n?.(e)},[e,n])}const boe=()=>{const{Spinner:t}=on();return y.jsx(xH,{children:t?y.jsx(t,{}):null})};function CH(t,e=!0){const n=t.length;if(n<2)return"";let r=t[0],i=t[1];if(n===2)return`M${ii(r)}L${ii(i)}`;let s="";for(let o=2,a=n-1;o<a;o++)r=t[o],i=t[o+1],s+=Ps(r,i);return e?`M${Ps(t[0],t[1])}Q${ii(t[1])}${Ps(t[1],t[2])}T${s}${Ps(t[n-1],t[0])}${Ps(t[0],t[1])}Z`:`M${ii(t[0])}Q${ii(t[1])}${Ps(t[1],t[2])}${t.length>3?"T":""}${s}L${ii(t[n-1])}`}function dN({scribble:t,zoom:e,color:n,opacity:r,className:i}){return t.points.length?y.jsx("svg",{className:i&&Fe("tl-overlays__item",i),children:y.jsx("path",{className:"tl-scribble",d:CH(t.points,!1),stroke:n??`var(--tl-color-${t.color})`,fill:"none",strokeWidth:8/e,opacity:r??t.opacity})}):null}function voe({bounds:t,rotation:e}){const n=te(),r=E.useRef(null),i=ee("only selected shape",()=>n.getOnlySelectedShape(),[n]),s=i?n.getShapeUtil(i).expandSelectionOutlinePx(i):0;return Jm(r,t?.x,t?.y,1,e,{x:-s,y:-s}),t=s instanceof we?t.clone().expand(s).zeroFix():t.clone().expandBy(s).zeroFix(),y.jsx("svg",{ref:r,className:"tl-overlays__item tl-selection__fg","data-testid":"selection-foreground",children:y.jsx("rect",{className:Fe("tl-selection__fg__outline"),width:J(t.width),height:J(t.height)})})}const xoe=()=>y.jsx("div",{className:"tl-shape-error-boundary"}),woe=E.memo(({shape:t,util:e})=>Px("Indicator: "+t.type,()=>e.indicator(e.editor.store.unsafeGetWithoutCapture(t.id))),(t,e)=>t.shape.props===e.shape.props&&t.shape.meta===e.shape.meta),Coe=E.memo(({editor:t,id:e})=>{const n=ee("shape for indicator",()=>t.store.get(e),[t,e]),{ShapeIndicatorErrorFallback:r}=on();return!n||n.isLocked?null:y.jsx(fm,{fallback:r,onError:i=>t.annotateError(i,{origin:"react.shapeIndicator",willCrashApp:!1}),children:y.jsx(woe,{shape:n,util:t.getShapeUtil(n)},n.id)})}),hN=E.memo(function({shapeId:e,className:n,color:r,hidden:i,opacity:s}){const o=te(),a=E.useRef(null);return xd("indicator transform",()=>{if(i)return;const l=a.current;if(!l)return;const u=o.getShapePageTransform(e);u&&l.style.setProperty("transform",u.toCssString())},[o,e,i]),E.useLayoutEffect(()=>{const l=a.current;l&&l.style.setProperty("display",i?"none":"block")},[i]),y.jsx("svg",{ref:a,className:Fe("tl-overlays__item",n),"aria-hidden":"true",children:y.jsx("g",{className:"tl-shape-indicator",stroke:r??"var(--tl-color-selected)",opacity:s,children:y.jsx(Coe,{editor:o,id:e})})})}),Toe=()=>y.jsx("circle",{cx:4,cy:4,r:8,strokeWidth:"1",stroke:"red"}),TH=E.memo(function({hideAll:e,showAll:n}){const r=te();if(e&&n)throw Error("You cannot set both hideAll and showAll props to true, cmon now");const i=E.useRef(new Set),s=ee("should display selected ids",()=>{const l=i.current,u=new Set,f=r.getInstanceState(),h=f.isChangingStyle,g=r.isInAny("select.idle","select.editing_shape"),m=r.isInAny("select.brushing","select.scribble_brushing","select.pointing_shape","select.pointing_selection","select.pointing_handle");if(h||!(g||m))return i.current=u,u;for(const b of r.getSelectedShapeIds())u.add(b);if(g&&f.isHoveringCanvas&&!f.isCoarsePointer){const b=r.getHoveredShapeId();b&&u.add(b)}if(l.size!==u.size)return i.current=u,u;for(const b of u)if(!l.has(b))return i.current=u,u;return l},[r]),o=ee("rendering shapes",()=>r.getRenderingShapes(),[r]),{ShapeIndicator:a}=on();return a?o.map(({id:l})=>y.jsx(a,{shapeId:l,hidden:!n&&(e||!s.has(l))},l+"_indicator")):null}),Eoe=E.forwardRef(function({children:e,shape:n,isBackground:r,...i},s){const o="fill"in n.props&&n.props.fill!=="none";return y.jsx("div",{ref:s,"data-shape-type":n.type,"data-shape-is-filled":r?void 0:o,"data-shape-id":n.id,draggable:!1,...i,className:Fe("tl-shape",r&&"tl-shape-background",i.className),children:e})});function _oe({points:t,zoom:e}){const n=2.5/e,r=t.reduce((g,m)=>Math.min(g,m.x),1/0),i=t.reduce((g,m)=>Math.max(g,m.x),-1/0),s=t.reduce((g,m)=>Math.min(g,m.y),1/0),o=t.reduce((g,m)=>Math.max(g,m.y),-1/0),a=t.some(g=>g.x===r&&g.y===s);let l,u,f,h;return a?(l=r,u=s,f=i,h=o):(l=r,u=o,f=i,h=s),y.jsxs("g",{className:"tl-snap-indicator",stroke:"lime",children:[y.jsx("line",{x1:l,y1:u,x2:f,y2:h}),t.map((g,m)=>y.jsx("g",{transform:`translate(${g.x},${g.y})`,children:y.jsx("path",{className:"tl-snap-point",d:`M ${-n},${-n} L ${n},${n} M ${-n},${n} L ${n},${-n}`})},m))]})}function Poe({gaps:t,direction:e,zoom:n}){const r=3.5/n;let i=[-1/0,1/0],s=null;const o=e==="horizontal";for(const l of t){if(s=oa(i[0],i[1],o?l.startEdge[0].y:l.startEdge[0].x,o?l.startEdge[1].y:l.startEdge[1].x),s)i=s;else continue;if(s=oa(i[0],i[1],o?l.endEdge[0].y:l.endEdge[0].x,o?l.endEdge[1].y:l.endEdge[1].x),s)i=s;else continue}if(i===null)return null;const a=(i[0]+i[1])/2;return y.jsx("g",{className:"tl-snap-indicator",stroke:"cyan",children:t.map(({startEdge:l,endEdge:u},f)=>y.jsx(E.Fragment,{children:o?y.jsxs(y.Fragment,{children:[y.jsx("line",{x1:l[0].x,y1:a-2*r,x2:l[1].x,y2:a+2*r}),y.jsx("line",{x1:u[0].x,y1:a-2*r,x2:u[1].x,y2:a+2*r}),y.jsx("line",{x1:l[0].x,y1:a,x2:u[0].x,y2:a}),y.jsx("line",{x1:(l[0].x+u[0].x)/2,y1:a-r,x2:(l[0].x+u[0].x)/2,y2:a+r})]}):y.jsxs(y.Fragment,{children:[y.jsx("line",{x1:a-2*r,y1:l[0].y,x2:a+2*r,y2:l[1].y}),y.jsx("line",{x1:a-2*r,y1:u[0].y,x2:a+2*r,y2:u[1].y}),y.jsx("line",{x1:a,y1:l[0].y,x2:a,y2:u[0].y}),y.jsx("line",{x1:a-r,y1:(l[0].y+u[0].y)/2,x2:a+r,y2:(l[0].y+u[0].y)/2})]})},f))})}function Ioe({className:t,line:e,zoom:n}){return y.jsx("svg",{className:Fe("tl-overlays__item",t),"aria-hidden":"true",children:e.type==="points"?y.jsx(_oe,{...e,zoom:n}):e.type==="gaps"?y.jsx(Poe,{...e,zoom:n}):null})}function EH(t){return y.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16","aria-hidden":"false",...t,className:Fe("tl-spinner",t.className),children:y.jsxs("g",{strokeWidth:2,fill:"none",fillRule:"evenodd",children:[y.jsx("circle",{strokeOpacity:.25,cx:8,cy:8,r:7,stroke:"currentColor"}),y.jsx("path",{strokeLinecap:"round",d:"M15 8c0-4.5-4.5-7-7-7",stroke:"currentColor"})]})})}const koe=()=>null,_H=E.createContext(null);function Moe({overrides:t={},children:e}){const n=Qf(t),r=E.useMemo(()=>({Background:Nte,Brush:wE,Canvas:qae,CollaboratorBrush:wE,CollaboratorCursor:D3,CollaboratorHint:nne,CollaboratorScribble:dN,CollaboratorShapeIndicator:hN,Cursor:D3,Grid:one,Handle:ane,Handles:lne,InFrontOfTheCanvas:null,LoadingScreen:boe,OnTheCanvas:null,Overlays:null,Scribble:dN,SelectionBackground:null,SelectionForeground:voe,ShapeIndicator:hN,ShapeIndicators:TH,ShapeWrapper:Eoe,SnapIndicator:Ioe,Spinner:EH,SvgDefs:koe,ZoomBrush:wE,ErrorFallback:H4,ShapeErrorFallback:xoe,ShapeIndicatorErrorFallback:Toe,...n}),[n]);return y.jsx(_H.Provider,{value:r,children:e})}function on(){const t=E.useContext(_H);if(!t)throw new Error("useEditorComponents must be used inside of <EditorComponentsProvider />");return t}const Aoe=["textarea","input"];function Ooe(t){const e=te();E.useEffect(()=>{const n=t.current;if(!n)return;const r=i=>{if(i instanceof PointerEvent&&i.pointerType==="pen"){e.markEventAsHandled(i);const{target:s}=i;if(Aoe.includes(s.tagName?.toLocaleLowerCase())||s.isContentEditable||e.isIn("select.editing_shape"))return;nt(i)}};return n.addEventListener("touchstart",r),n.addEventListener("touchend",r),()=>{n.removeEventListener("touchstart",r),n.removeEventListener("touchend",r)}},[e,t])}function Doe(t,e,n){return Math.max(e,Math.min(t,n))}const ci={toVector(t,e){return t===void 0&&(t=e),Array.isArray(t)?t:[t,t]},add(t,e){return[t[0]+e[0],t[1]+e[1]]},sub(t,e){return[t[0]-e[0],t[1]-e[1]]},addTo(t,e){t[0]+=e[0],t[1]+=e[1]},subTo(t,e){t[0]-=e[0],t[1]-=e[1]}};function fN(t,e,n){return e===0||Math.abs(e)===1/0?Math.pow(t,n*5):t*e*n/(e+n*t)}function pN(t,e,n,r=.15){return r===0?Doe(t,e,n):t<e?-fN(e-t,n-e,r)+e:t>n?+fN(t-n,n-e,r)+n:t}function Roe(t,[e,n],[r,i]){const[[s,o],[a,l]]=t;return[pN(e,s,o,r),pN(n,a,l,i)]}function joe(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Loe(t){var e=joe(t,"string");return typeof e=="symbol"?e:String(e)}function _i(t,e,n){return e=Loe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gN(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Rn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?gN(Object(n),!0).forEach(function(r){_i(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gN(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const PH={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function mN(t){return t?t[0].toUpperCase()+t.slice(1):""}const Noe=["enter","leave"];function zoe(t=!1,e){return t&&!Noe.includes(e)}function Boe(t,e="",n=!1){const r=PH[t],i=r&&r[e]||e;return"on"+mN(t)+mN(i)+(zoe(n,i)?"Capture":"")}const Foe=["gotpointercapture","lostpointercapture"];function Uoe(t){let e=t.substring(2).toLowerCase();const n=!!~e.indexOf("passive");n&&(e=e.replace("passive",""));const r=Foe.includes(e)?"capturecapture":"capture",i=!!~e.indexOf(r);return i&&(e=e.replace("capture","")),{device:e,capture:i,passive:n}}function Hoe(t,e=""){const n=PH[t],r=n&&n[e]||e;return t+r}function IH(t){return"touches"in t}function $oe(t){return IH(t)?"touch":"pointerType"in t?t.pointerType:"mouse"}function Koe(t){return Array.from(t.touches).filter(e=>{var n,r;return e.target===t.currentTarget||((n=t.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,e.target))})}function uP(t,e){try{const n=e.clientX-t.clientX,r=e.clientY-t.clientY,i=(e.clientX+t.clientX)/2,s=(e.clientY+t.clientY)/2,o=Math.hypot(n,r);return{angle:-(Math.atan2(n,r)*180)/Math.PI,distance:o,origin:[i,s]}}catch{}return null}function Voe(t){return Koe(t).map(e=>e.identifier)}function yN(t,e){const[n,r]=Array.from(t.touches).filter(i=>e.includes(i.identifier));return uP(n,r)}const SN=40,bN=800;function kH(t){let{deltaX:e,deltaY:n,deltaMode:r}=t;return r===1?(e*=SN,n*=SN):r===2&&(e*=bN,n*=bN),[e,n]}function qoe(t){const e={};if("buttons"in t&&(e.buttons=t.buttons),"shiftKey"in t){const{shiftKey:n,altKey:r,metaKey:i,ctrlKey:s}=t;Object.assign(e,{shiftKey:n,altKey:r,metaKey:i,ctrlKey:s})}return e}function pv(t,...e){return typeof t=="function"?t(...e):t}function Goe(){}function Yoe(...t){return t.length===0?Goe:t.length===1?t[0]:function(){let e;for(const n of t)e=n.apply(this,arguments)||e;return e}}function vN(t,e){return Object.assign({},e,t||{})}const Woe=32;class MH{constructor(e,n,r){this.ctrl=e,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:n,ingKey:r,args:i}=this;n[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=i,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=e.target,n.currentTarget=e.currentTarget,n.lastOffset=r.from?pv(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=e.timeStamp)}computeValues(e){const n=this.state;n._values=e,n.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:n,config:r,shared:i}=this;n.args=this.args;let s=0;if(e&&(n.event=e,r.preventDefault&&e.cancelable&&n.event.preventDefault(),n.type=e.type,i.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,i.locked=!!document.pointerLockElement,Object.assign(i,qoe(e)),i.down=i.pressed=i.buttons%2===1||i.touches>0,s=e.timeStamp-n.timeStamp,n.timeStamp=e.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const A=n._delta.map(Math.abs);ci.addTo(n._distance,A)}this.axisIntent&&this.axisIntent(e);const[o,a]=n._movement,[l,u]=r.threshold,{_step:f,values:h}=n;if(r.hasCustomTransform?(f[0]===!1&&(f[0]=Math.abs(o)>=l&&h[0]),f[1]===!1&&(f[1]=Math.abs(a)>=u&&h[1])):(f[0]===!1&&(f[0]=Math.abs(o)>=l&&Math.sign(o)*l),f[1]===!1&&(f[1]=Math.abs(a)>=u&&Math.sign(a)*u)),n.intentional=f[0]!==!1||f[1]!==!1,!n.intentional)return;const g=[0,0];if(r.hasCustomTransform){const[A,O]=h;g[0]=f[0]!==!1?A-f[0]:0,g[1]=f[1]!==!1?O-f[1]:0}else g[0]=f[0]!==!1?o-f[0]:0,g[1]=f[1]!==!1?a-f[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(g);const m=n.offset,b=n._active&&!n._blocked||n.active;b&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=i[this.ingKey]=n._active,e&&(n.first&&("bounds"in r&&(n._bounds=pv(r.bounds,n)),this.setup&&this.setup()),n.movement=g,this.computeOffset()));const[w,x]=n.offset,[[v,C],[P,k]]=n._bounds;n.overflow=[w<v?-1:w>C?1:0,x<P?-1:x>k?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const M=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=Roe(n._bounds,n.offset,M),n.delta=ci.sub(n.offset,m),this.computeMovement(),b&&(!n.last||s>Woe)){n.delta=ci.sub(n.offset,m);const A=n.delta.map(Math.abs);ci.addTo(n.distance,A),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&s>0&&(n.velocity=[A[0]/s,A[1]/s],n.timeDelta=s)}}emit(){const e=this.state,n=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const i=this.handler(Rn(Rn(Rn({},n),e),{},{[this.aliasKey]:e.values}));i!==void 0&&(e.memo=i)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function Xoe([t,e],n){const r=Math.abs(t),i=Math.abs(e);if(r>i&&r>n)return"x";if(i>r&&i>n)return"y"}class Zoe extends MH{constructor(...e){super(...e),_i(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=ci.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ci.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const n=this.state,r=this.config;if(!n.axis&&e){const i=typeof r.axisThreshold=="object"?r.axisThreshold[$oe(e)]:r.axisThreshold;n.axis=Xoe(n._movement,i)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const Joe=t=>t,xN=.15,AH={enabled(t=!0){return t},eventOptions(t,e,n){return Rn(Rn({},n.shared.eventOptions),t)},preventDefault(t=!1){return t},triggerAllEvents(t=!1){return t},rubberband(t=0){switch(t){case!0:return[xN,xN];case!1:return[0,0];default:return ci.toVector(t)}},from(t){if(typeof t=="function")return t;if(t!=null)return ci.toVector(t)},transform(t,e,n){const r=t||n.shared.transform;return this.hasCustomTransform=!!r,r||Joe},threshold(t){return ci.toVector(t,0)}},Qoe=0,ly=Rn(Rn({},AH),{},{axis(t,e,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(t=Qoe){return t},bounds(t={}){if(typeof t=="function")return s=>ly.bounds(t(s));if("current"in t)return()=>t.current;if(typeof HTMLElement=="function"&&t instanceof HTMLElement)return t;const{left:e=-1/0,right:n=1/0,top:r=-1/0,bottom:i=1/0}=t;return[[e,n],[r,i]]}}),cy=typeof window<"u"&&window.document&&window.document.createElement;function OH(){return cy&&"ontouchstart"in window}function eae(){return OH()||cy&&window.navigator.maxTouchPoints>1}function tae(){return cy&&"onpointerdown"in window}function nae(){return cy&&"exitPointerLock"in window.document}function rae(){try{return"constructor"in GestureEvent}catch{return!1}}const No={isBrowser:cy,gesture:rae(),touch:OH(),touchscreen:eae(),pointer:tae(),pointerLock:nae()},iae=250,sae=180,oae=.5,aae=50,lae=250,cae=10,wN={mouse:0,touch:0,pen:8};Rn(Rn({},ly),{},{device(t,e,{pointer:{touch:n=!1,lock:r=!1,mouse:i=!1}={}}){return this.pointerLock=r&&No.pointerLock,No.touch&&n?"touch":this.pointerLock?"mouse":No.pointer&&!i?"pointer":No.touch?"touch":"mouse"},preventScrollAxis(t,e,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&t?iae:void 0,!(!No.touchscreen||n===!1))return t||(n!==void 0?"y":void 0)},pointerCapture(t,e,{pointer:{capture:n=!0,buttons:r=1,keys:i=!0}={}}){return this.pointerButtons=r,this.keys=i,!this.pointerLock&&this.device==="pointer"&&n},threshold(t,e,{filterTaps:n=!1,tapsThreshold:r=3,axis:i=void 0}){const s=ci.toVector(t,n?r:i?1:0);return this.filterTaps=n,this.tapsThreshold=r,s},swipe({velocity:t=oae,distance:e=aae,duration:n=lae}={}){return{velocity:this.transform(ci.toVector(t)),distance:this.transform(ci.toVector(e)),duration:n}},delay(t=0){switch(t){case!0:return sae;case!1:return 0;default:return t}},axisThreshold(t){return t?Rn(Rn({},wN),t):wN},keyboardDisplacement(t=cae){return t}});function DH(t){const[e,n]=t.overflow,[r,i]=t._delta,[s,o]=t._direction;(e<0&&r>0&&s<0||e>0&&r<0&&s>0)&&(t._movement[0]=t._movementBound[0]),(n<0&&i>0&&o<0||n>0&&i<0&&o>0)&&(t._movement[1]=t._movementBound[1])}const uae=30,dae=100;class hae extends MH{constructor(...e){super(...e),_i(this,"ingKey","pinching"),_i(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:n,lastOffset:r}=this.state;e==="wheel"?this.state.offset=ci.add(n,r):this.state.offset=[(1+n[0])*r[0],n[1]+r[1]]}computeMovement(){const{offset:e,lastOffset:n}=this.state;this.state.movement=[e[0]/n[0],e[1]-n[1]]}axisIntent(){const e=this.state,[n,r]=e._movement;if(!e.axis){const i=Math.abs(n)*uae-Math.abs(r);i<0?e.axis="angle":i>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&(this.state.axis==="scale"?e[1]=0:this.state.axis==="angle"&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);const n=this.state,r=this.ctrl.touchIds;if(n._active&&n._touchIds.every(s=>r.has(s))||r.size<2)return;this.start(e),n._touchIds=Array.from(r).slice(0,2);const i=yN(e,n._touchIds);i&&this.pinchStart(e,i)}pointerStart(e){if(e.buttons!=null&&e.buttons%2!==1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const n=this.state,r=n._pointerEvents,i=this.ctrl.pointerIds;if(n._active&&Array.from(r.keys()).every(o=>i.has(o))||(r.size<2&&r.set(e.pointerId,e),n._pointerEvents.size<2))return;this.start(e);const s=uP(...Array.from(r.values()));s&&this.pinchStart(e,s)}pinchStart(e,n){const r=this.state;r.origin=n.origin,this.computeValues([n.distance,n.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const n=yN(e,this.state._touchIds);n&&this.pinchMove(e,n)}pointerMove(e){const n=this.state._pointerEvents;if(n.has(e.pointerId)&&n.set(e.pointerId,e),!this.state._active)return;const r=uP(...Array.from(n.values()));r&&this.pinchMove(e,r)}pinchMove(e,n){const r=this.state,i=r._values[1],s=n.angle-i;let o=0;Math.abs(s)>270&&(o+=Math.sign(s)),this.computeValues([n.distance,n.angle-360*o]),r.origin=n.origin,r.turns=o,r._movement=[r._values[0]/r._initial[0]-1,r._values[1]-r._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(n=>!this.ctrl.touchIds.has(n))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const n=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch{}n._pointerEvents.has(e.pointerId)&&n._pointerEvents.delete(e.pointerId),n._active&&n._pointerEvents.size<2&&(n._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const n=this.state;n._active||(this.start(e),this.computeValues([e.scale,e.rotation]),n.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const n=this.state;this.computeValues([e.scale,e.rotation]),n.origin=[e.clientX,e.clientY];const r=n._movement;n._movement=[e.scale-1,e.rotation],n._delta=ci.sub(n._movement,r),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const n=this.config.modifierKey;n&&(Array.isArray(n)?!n.find(r=>e[r]):!e[n])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const r=this.state;r._delta=[-kH(e)[1]/dae*r.offset[0],0],ci.addTo(r._movement,r._delta),DH(r),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const n=this.config.device;n&&(e(n,"start",this[n+"Start"].bind(this)),e(n,"change",this[n+"Move"].bind(this)),e(n,"end",this[n+"End"].bind(this)),e(n,"cancel",this[n+"End"].bind(this)),e("lostPointerCapture","",this[n+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}}const fae=Rn(Rn({},AH),{},{device(t,e,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!No.touch&&No.gesture)return"gesture";if(No.touch&&r)return"touch";if(No.touchscreen){if(No.pointer)return"pointer";if(No.touch)return"touch"}},bounds(t,e,{scaleBounds:n={},angleBounds:r={}}){const i=o=>{const a=vN(pv(n,o),{min:-1/0,max:1/0});return[a.min,a.max]},s=o=>{const a=vN(pv(r,o),{min:-1/0,max:1/0});return[a.min,a.max]};return typeof n!="function"&&typeof r!="function"?[i(),s()]:o=>[i(o),s(o)]},threshold(t,e,n){return this.lockDirection=n.axis==="lock",ci.toVector(t,this.lockDirection?[.1,3]:0)},modifierKey(t){return t===void 0?"ctrlKey":t},pinchOnWheel(t=!0){return t}});Rn(Rn({},ly),{},{mouseOnly:(t=!0)=>t});class pae extends Zoe{constructor(...e){super(...e),_i(this,"ingKey","wheeling")}wheel(e){this.state._active||this.start(e),this.wheelChange(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(e){const n=this.state;n._delta=kH(e),ci.addTo(n._movement,n._delta),DH(n),this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("wheel","",this.wheel.bind(this))}}const gae=ly;Rn(Rn({},ly),{},{mouseOnly:(t=!0)=>t});const Dk=new Map,dP=new Map;function mae(t){Dk.set(t.key,t.engine),dP.set(t.key,t.resolver)}const yae={key:"pinch",engine:hae,resolver:fae},Sae={key:"wheel",engine:pae,resolver:gae};function bae(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function vae(t,e){if(t==null)return{};var n=bae(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}const xae={target(t){if(t)return()=>"current"in t?t.current:t},enabled(t=!0){return t},window(t=No.isBrowser?window:void 0){return t},eventOptions({passive:t=!0,capture:e=!1}={}){return{passive:t,capture:e}},transform(t){return t}},wae=["target","eventOptions","window","enabled","transform"];function jb(t={},e){const n={};for(const[r,i]of Object.entries(e))switch(typeof i){case"function":n[r]=i.call(n,t[r],r,t);break;case"object":n[r]=jb(t[r],i);break;case"boolean":i&&(n[r]=t[r]);break}return n}function Cae(t,e,n={}){const r=t,{target:i,eventOptions:s,window:o,enabled:a,transform:l}=r,u=vae(r,wae);if(n.shared=jb({target:i,eventOptions:s,window:o,enabled:a,transform:l},xae),e){const f=dP.get(e);n[e]=jb(Rn({shared:n.shared},u),f)}else for(const f in u){const h=dP.get(f);h&&(n[f]=jb(Rn({shared:n.shared},u[f]),h))}return n}class RH{constructor(e,n){_i(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=n}add(e,n,r,i,s){const o=this._listeners,a=Hoe(n,r),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=Rn(Rn({},l),s);e.addEventListener(a,i,u);const f=()=>{e.removeEventListener(a,i,u),o.delete(f)};return o.add(f),f}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class Tae{constructor(){_i(this,"_timeouts",new Map)}add(e,n,r=140,...i){this.remove(e),this._timeouts.set(e,window.setTimeout(n,r,...i))}remove(e){const n=this._timeouts.get(e);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class Eae{constructor(e){_i(this,"gestures",new Set),_i(this,"_targetEventStore",new RH(this)),_i(this,"gestureEventStores",{}),_i(this,"gestureTimeoutStores",{}),_i(this,"handlers",{}),_i(this,"config",{}),_i(this,"pointerIds",new Set),_i(this,"touchIds",new Set),_i(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),_ae(this,e)}setEventIds(e){if(IH(e))return this.touchIds=new Set(Voe(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,n){this.handlers=e,this.nativeHandlers=n}applyConfig(e,n){this.config=Cae(e,n,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const n=this.config.shared,r={};let i;if(!(n.target&&(i=n.target(),!i))){if(n.enabled){for(const o of this.gestures){const a=this.config[o],l=CN(r,a.eventOptions,!!i);if(a.enabled){const u=Dk.get(o);new u(this,e,o).bind(l)}}const s=CN(r,n.eventOptions,!!i);for(const o in this.nativeHandlers)s(o,"",a=>this.nativeHandlers[o](Rn(Rn({},this.state.shared),{},{event:a,args:e})),void 0,!0)}for(const s in r)r[s]=Yoe(...r[s]);if(!i)return r;for(const s in r){const{device:o,capture:a,passive:l}=Uoe(s);this._targetEventStore.add(i,o,"",r[s],{capture:a,passive:l})}}}}function Hh(t,e){t.gestures.add(e),t.gestureEventStores[e]=new RH(t,e),t.gestureTimeoutStores[e]=new Tae}function _ae(t,e){e.drag&&Hh(t,"drag"),e.wheel&&Hh(t,"wheel"),e.scroll&&Hh(t,"scroll"),e.move&&Hh(t,"move"),e.pinch&&Hh(t,"pinch"),e.hover&&Hh(t,"hover")}const CN=(t,e,n)=>(r,i,s,o={},a=!1)=>{var l,u;const f=(l=o.capture)!==null&&l!==void 0?l:e.capture,h=(u=o.passive)!==null&&u!==void 0?u:e.passive;let g=a?r:Boe(r,i,f);n&&h&&(g+="Passive"),t[g]=t[g]||[],t[g].push(s)},Pae=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function Iae(t){const e={},n={},r=new Set;for(let i in t)Pae.test(i)?(r.add(RegExp.lastMatch),n[i]=t[i]):e[i]=t[i];return[n,e,r]}function $h(t,e,n,r,i,s){if(!t.has(n)||!Dk.has(r))return;const o=n+"Start",a=n+"End",l=u=>{let f;return u.first&&o in e&&e[o](u),n in e&&(f=e[n](u)),u.last&&a in e&&e[a](u),f};i[r]=l,s[r]=s[r]||{}}function kae(t,e){const[n,r,i]=Iae(t),s={};return $h(i,n,"onDrag","drag",s,e),$h(i,n,"onWheel","wheel",s,e),$h(i,n,"onScroll","scroll",s,e),$h(i,n,"onPinch","pinch",s,e),$h(i,n,"onMove","move",s,e),$h(i,n,"onHover","hover",s,e),{handlers:s,config:e,nativeHandlers:r}}function Mae(t,e={},n,r){const i=qe.useMemo(()=>new Eae(t),[]);if(i.applyHandlers(t,r),i.applyConfig(e,n),qe.useEffect(i.effect.bind(i)),qe.useEffect(()=>i.clean.bind(i),[]),e.target===void 0)return i.bind.bind(i)}function Aae(t){return t.forEach(mae),function(n,r){const{handlers:i,nativeHandlers:s,config:o}=kae(n,r||{});return Mae(i,o,void 0,s)}}const TN=10,Oae=/Mac|iPod|iPhone|iPad/.test(typeof window>"u"?"node":window.navigator.platform);function jH(t){let{deltaY:e,deltaX:n}=t,r=0;return t.ctrlKey||t.altKey||t.metaKey?r=(Math.abs(e)>TN?TN*Math.sign(e):e)/100:t.shiftKey&&!Oae&&(n=e,e=0),{x:-n,y:-e,z:-r}}const Dae=Aae([Sae,yae]);let Kh;const Rae=t=>Kh===void 0?(Kh=t,!1):t-Kh>120&&t-Kh<160?(Kh=t,!0):(Kh=t,!1);function jae(t){const e=te(),n=E.useMemo(()=>{let r="not sure";const i=({event:b})=>{if(!e.getInstanceState().isFocused||(r="not sure",Rae(Date.now())))return;const w=e.getEditingShapeId();if(w){const C=e.getShape(w);if(C&&e.getShapeUtil(C).canScroll(C)&&e.getShapePageBounds(w)?.containsPoint(e.inputs.currentPagePoint))return}nt(b),b.stopPropagation();const x=jH(b);if(x.x===0&&x.y===0)return;const v={type:"wheel",name:"wheel",delta:x,point:new I(b.clientX,b.clientY),shiftKey:b.shiftKey,altKey:b.altKey,ctrlKey:b.metaKey||b.ctrlKey,metaKey:b.metaKey,accelKey:vn(b)};e.dispatch(v)};let s=1,o=1,a=0;const l=new I,u=new I,f=b=>{const w=t.current;r="not sure";const{event:x,origin:v,da:C}=b;x instanceof WheelEvent||(x.target===w||w?.contains(x.target))&&(u.x=v[0],u.y=v[1],l.x=v[0],l.y=v[1],s=C[0],o=e.getZoomLevel(),e.dispatch({type:"pinch",name:"pinch_start",point:{x:v[0],y:v[1],z:e.getZoomLevel()},delta:{x:0,y:0},shiftKey:x.shiftKey,altKey:x.altKey,ctrlKey:x.metaKey||x.ctrlKey,metaKey:x.metaKey,accelKey:vn(x)}))},h=b=>{if(b&&(r="zooming"),r==="zooming")return;const w=Math.abs(a-s),x=I.Dist(l,u);switch(r){case"not sure":{w>24?r="zooming":x>16&&(r="panning");break}case"panning":{w>64&&(r="zooming");break}}};return{onWheel:i,onPinchStart:f,onPinchEnd:b=>{const w=t.current,{event:x,origin:v,offset:C}=b;if(x instanceof WheelEvent||!(x.target===w||w?.contains(x.target)))return;const P=C[0]**e.getCameraOptions().zoomSpeed;r="not sure",e.timers.requestAnimationFrame(()=>{e.dispatch({type:"pinch",name:"pinch_end",point:{x:v[0],y:v[1],z:P},delta:{x:v[0],y:v[1]},shiftKey:x.shiftKey,altKey:x.altKey,ctrlKey:x.metaKey||x.ctrlKey,metaKey:x.metaKey,accelKey:vn(x)})})},onPinch:b=>{const w=t.current,{event:x,origin:v,offset:C,da:P}=b;if(x instanceof WheelEvent||!(x.target===w||w?.contains(x.target)))return;const k=b.type==="gesturechange"||b.type==="gestureend";a=P[0];const M=v[0]-u.x,A=v[1]-u.y;switch(u.x=v[0],u.y=v[1],h(k),r){case"zooming":{const O=C[0]**e.getCameraOptions().zoomSpeed;e.dispatch({type:"pinch",name:"pinch",point:{x:v[0],y:v[1],z:O},delta:{x:M,y:A},shiftKey:x.shiftKey,altKey:x.altKey,ctrlKey:x.metaKey||x.ctrlKey,metaKey:x.metaKey,accelKey:vn(x)});break}case"panning":{e.dispatch({type:"pinch",name:"pinch",point:{x:v[0],y:v[1],z:o},delta:{x:M,y:A},shiftKey:x.shiftKey,altKey:x.altKey,ctrlKey:x.metaKey||x.ctrlKey,metaKey:x.metaKey,accelKey:vn(x)});break}}}}},[e,t]);Dae(n,{target:t,eventOptions:{passive:!1},pinch:{from:()=>{const{zoomSpeed:r}=e.getCameraOptions();return[e.getZoomLevel()**(1/r),0]},scaleBounds:()=>{const r=e.getBaseZoom(),{zoomSteps:i,zoomSpeed:s}=e.getCameraOptions(),o=i[0]*r;return{max:(i[i.length-1]*r)**(1/s),min:o**(1/s)}}}})}function BE(t,e,n){const r=t.getShape(e),i=t.getShapeHandles(r);return{shape:r,handle:i.find(s=>s.id===n)}}function Lae(t,e){const n=te();return E.useMemo(()=>{const r=l=>{if(n.wasEventAlreadyHandled(l))return;const u=uv(l.currentTarget);Qm(u,l);const{shape:f,handle:h}=BE(n,t,e);h&&n.dispatch({type:"pointer",target:"handle",handle:h,shape:f,name:"pointer_down",...li(n,l)})};let i,s;return{onPointerDown:r,onPointerMove:l=>{if(n.wasEventAlreadyHandled(l)||l.clientX===i&&l.clientY===s)return;i=l.clientX,s=l.clientY;const{shape:u,handle:f}=BE(n,t,e);f&&n.dispatch({type:"pointer",target:"handle",handle:f,shape:u,name:"pointer_move",...li(n,l)})},onPointerUp:l=>{if(n.wasEventAlreadyHandled(l))return;const u=uv(l.currentTarget);ey(u,l);const{shape:f,handle:h}=BE(n,t,e);h&&n.dispatch({type:"pointer",target:"handle",handle:h,shape:f,name:"pointer_up",...li(n,l)})}}},[n,t,e])}function Nae(t){const e=te();E.useLayoutEffect(()=>{const n=RB(()=>{t.current&&e.updateViewportScreenBounds(t.current)},200,{trailing:!0}),r=e.timers.setInterval(n,1e3);window.addEventListener("resize",n);const i=new ResizeObserver(a=>{a[0].contentRect&&n()}),s=t.current;let o=null;return s&&(i.observe(s),o=zae(s),o.addEventListener("scroll",n)),()=>{clearInterval(r),window.removeEventListener("resize",n),i.disconnect(),o?.removeEventListener("scroll",n),n.cancel()}},[e,t])}const zae=t=>{let e=t.parentElement;for(;e;){if(e===document.body)return document;const{overflowY:n}=window.getComputedStyle(e);if(e.scrollHeight>e.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return e;e=e.parentElement}return document};function Bae(t=!0){const[e,n]=E.useState(0),r=te();E.useEffect(()=>{if(!t)return;const i=()=>n(s=>s+1);return r.on("tick",i),()=>{r.off("tick",i)}},[r,t])}const Fae=cr(function({showStroke:e=!0,showVertices:n=!0,showClosestPointOnOutline:r=!0}){const i=te();Bae(r);const s=i.getZoomLevel(),o=i.getRenderingShapes(),{inputs:{currentPagePoint:a}}=i;return y.jsx("svg",{style:{position:"absolute",pointerEvents:"none",zIndex:999999999,top:0,left:0,overflow:"visible"},children:o.map(l=>{const u=i.getShape(l.id);if(u.type==="group")return null;const f=i.getShapeGeometry(u),h=i.getShapePageTransform(u),g=i.getPointInShapeSpace(u,a),m=f.nearestPoint(g),b=f.distanceToPoint(g,!0),w=Math.abs(b)*s,x=b<0,{vertices:v}=f;return y.jsxs("g",{transform:h.toCssString(),strokeLinecap:"round",strokeLinejoin:"round",children:[e&&y.jsx("g",{stroke:f.debugColor??"red",opacity:"1",strokeWidth:2/s,fill:"none",children:y.jsx(LH,{geometry:f})}),n&&v.map((C,P)=>y.jsx("circle",{cx:C.x,cy:C.y,r:2/s,fill:`hsl(${ma(P,[0,v.length-1],[120,200])}, 100%, 50%)`,stroke:"black",strokeWidth:1/s},`v${P}`)),r&&w<150&&y.jsx("line",{x1:m.x,y1:m.y,x2:g.x,y2:g.y,opacity:1-w/150,stroke:x?"goldenrod":"dodgerblue",strokeWidth:2/s})]},l.id+"_outline")})})});function LH({geometry:t}){return t instanceof js?y.jsx("g",{stroke:t.debugColor,children:[...t.children,...t.ignoredChildren].map((e,n)=>y.jsx(LH,{geometry:e},n))}):y.jsx("path",{d:t.toSimpleSvgPath(),stroke:t.debugColor})}function NH(t){return UZ(t)}function zH(){const t=te(),e=UQ("userIds",()=>NH(t.getCollaborators().map(n=>n.userId)).sort(),{isEqual:(n,r)=>n.join(",")===r.join?.(",")},[t]);return ee(e)}function Zx(t){const e=te();return ee(`latestPresence:${t}`,()=>e.getCollaborators().find(r=>r.userId===t),[e,t])??null}const Uae=cr(function(){return zH().map(n=>y.jsx(Hae,{collaboratorId:n},n))}),Hae=cr(function({collaboratorId:e}){const n=te(),r=Zx(e),i=Kae(n,r);if(!(r&&r.currentPageId===n.getCurrentPageId()))return null;switch(i){case"inactive":{const{followingUserId:s,highlightedUserIds:o}=n.getInstanceState();if(!(s===r.userId||o.includes(r.userId)))return null;break}case"idle":{const{highlightedUserIds:s}=n.getInstanceState();if(r.followingUserId===n.user.getId()&&!(r.chatMessage||s.includes(r.userId)))return null;break}}return y.jsx($ae,{latestPresence:r})}),$ae=cr(function({latestPresence:e}){const n=te(),{CollaboratorBrush:r,CollaboratorScribble:i,CollaboratorCursor:s,CollaboratorHint:o,CollaboratorShapeIndicator:a}=on(),l=n.getZoomLevel(),u=n.getViewportPageBounds(),{userId:f,chatMessage:h,brush:g,scribbles:m,selectedShapeIds:b,userName:w,cursor:x,color:v}=e;if(!x)return null;const C=!(x.x<u.minX-12/l||x.y<u.minY-16/l||x.x>u.maxX-12/l||x.y>u.maxY-16/l);return y.jsxs(y.Fragment,{children:[g&&r?y.jsx(r,{className:"tl-collaborator__brush",userId:f,brush:g,color:v,opacity:.1},f+"_brush"):null,C&&s?y.jsx(s,{className:"tl-collaborator__cursor",userId:f,point:x,color:v,zoom:l,name:w!=="New User"?w:null,chatMessage:h??""},f+"_cursor"):o?y.jsx(o,{className:"tl-collaborator__cursor-hint",userId:f,point:x,color:v,zoom:l,viewport:u},f+"_cursor_hint"):null,i&&m.length?y.jsx(y.Fragment,{children:m.map(P=>y.jsx(i,{className:"tl-collaborator__scribble",userId:f,scribble:P,color:v,zoom:l,opacity:P.color==="laser"?.5:.1},f+"_scribble_"+P.id))}):null,a&&b.filter(P=>!n.isShapeHidden(P)).map(P=>y.jsx(a,{className:"tl-collaborator__shape-indicator",userId:f,shapeId:P,color:v,opacity:.5},f+"_"+P))]})});function EN(t,e){return e>t.options.collaboratorInactiveTimeoutMs?"inactive":e>t.options.collaboratorIdleTimeoutMs?"idle":"active"}function Kae(t,e){const n=E.useRef(e?.lastActivityTimestamp??-1),[r,i]=E.useState(()=>EN(t,Date.now()-n.current));return E.useEffect(()=>{const s=t.timers.setInterval(()=>{i(EN(t,Date.now()-n.current))},t.options.collaboratorCheckIntervalMs);return()=>clearInterval(s)},[t]),e&&(n.current=e.lastActivityTimestamp??1/0),r}function Vae(){const t=te(),e=ee("is menu open",()=>t.menus.hasAnyOpenMenus(),[t]),[n,r]=E.useState(!1),i=e||n,s=Nx(),o=E.useRef({isDown:!1,isDragging:!1,start:new I}),a=E.useCallback(h=>{h.button===0&&(r(!0),o.current={isDown:!0,isDragging:!1,start:new I(h.clientX,h.clientY)},l.current=!1),t.menus.clearOpenMenus()},[t]),l=E.useRef(!1),u=E.useCallback(h=>{if(!o.current.isDown)return;const{x:g,y:m}=o.current.start;l.current||I.Dist2(o.current.start,new I(h.clientX,h.clientY))>t.options.dragDistanceSquared&&(l.current=!0,o.current={...o.current,isDown:!0,isDragging:!0},s.onPointerDown?.({...h,clientX:g,clientY:m,button:0})),l.current&&t.dispatch({type:"pointer",target:"canvas",name:"pointer_move",...li(t,h)})},[s,t]),f=E.useCallback(h=>{s.onPointerUp?.(h),r(!1),o.current={isDown:!1,isDragging:!1,start:new I(h.clientX,h.clientY)},l.current=!1},[s]);return i&&y.jsx("div",{className:"tlui-menu-click-capture","data-testid":"menu-click-capture.content",...s,onPointerDown:a,onPointerMove:u,onPointerUp:f})}function qae({className:t}){const e=te(),{SelectionBackground:n,Background:r,SvgDefs:i,ShapeIndicators:s}=on(),o=E.useRef(null),a=E.useRef(null),l=E.useRef(null),u=ur();Nae(o),tne(),ene(),jae(o),Ooe(o);const f=E.useRef({lodDisableTextOutline:!1,allowTextOutline:!0});xd("position layers",function(){const{x:P,y:k,z:M}=e.getCamera();if(f.current.allowTextOutline&&Lt.isSafari&&(u.style.setProperty("--tl-text-outline","none"),f.current.allowTextOutline=!1),f.current.allowTextOutline&&M<e.options.textShadowLod!==f.current.lodDisableTextOutline){const R=M<e.options.textShadowLod;u.style.setProperty("--tl-text-outline",R?"none":"var(--tl-text-outline-reference)"),f.current.lodDisableTextOutline=R}const A=M>=1?ma(M,[1,8],[.125,.5],!0):ma(M,[.1,1],[-2,.125],!0),O=`scale(${J(M)}) translate(${J(P+A)}px,${J(k+A)}px)`;Ci(a.current,"transform",O),Ci(l.current,"transform",O)},[e,u]);const h=Nx(),g=ee("shapeSvgDefs",()=>{const C=new Map;for(const P of $n(e.shapeUtils)){if(!P)return;const k=P.getCanvasSvgDefs();for(const{key:M,component:A}of k)C.has(M)||C.set(M,y.jsx(A,{},M))}return[...C.values()]},[e]),m=ee("debug_shapes",()=>In.hideShapes.get(),[In]),b=ee("debug_svg",()=>In.debugSvg.get(),[In]),w=ee("debug_geometry",()=>In.debugGeometry.get(),[In]),x=ee("isEditingAnything",()=>e.getEditingShapeId()!==null,[e]),v=ee("isSelectingAnything",()=>!!e.getSelectedShapeIds().length,[e]);return y.jsxs(y.Fragment,{children:[y.jsxs("div",{ref:o,draggable:!1,"data-iseditinganything":x,"data-isselectinganything":v,className:Fe("tl-canvas",t),"data-testid":"canvas",...h,children:[y.jsx("svg",{className:"tl-svg-context","aria-hidden":"true",children:y.jsxs("defs",{children:[g,y.jsx(ale,{}),y.jsx(lle,{}),i&&y.jsx(i,{})]})}),r&&y.jsx("div",{className:"tl-background__wrapper",children:y.jsx(r,{})}),y.jsx(Yae,{}),y.jsxs("div",{ref:a,className:"tl-html-layer tl-shapes",draggable:!1,children:[y.jsx(hle,{}),n&&y.jsx(dle,{}),m?null:b?y.jsx(rle,{}):y.jsx(sle,{})]}),y.jsx("div",{className:"tl-overlays",children:y.jsxs("div",{ref:l,className:"tl-html-layer",children:[w?y.jsx(Fae,{}):null,y.jsx(Xae,{}),y.jsx(Wae,{}),y.jsx(Zae,{}),s&&y.jsx(s,{}),y.jsx(ole,{}),y.jsx(Jae,{}),y.jsx(ule,{}),y.jsx(Qae,{}),y.jsx(nle,{}),y.jsx(Uae,{})]})}),y.jsx(fle,{})]}),y.jsx("div",{className:"tl-canvas__in-front",onPointerDown:e.markEventAsHandled,onPointerUp:e.markEventAsHandled,onTouchStart:e.markEventAsHandled,onTouchEnd:e.markEventAsHandled,children:y.jsx(Gae,{})}),y.jsx(Vae,{})]})}function Gae(){const{InFrontOfTheCanvas:t}=on();return t?y.jsx(t,{}):null}function Yae(){const t=te(),e=ee("gridSize",()=>t.getDocumentSettings().gridSize,[t]),{x:n,y:r,z:i}=ee("camera",()=>t.getCamera(),[t]),s=ee("isGridMode",()=>t.getInstanceState().isGridMode,[t]),{Grid:o}=on();return o&&s?y.jsx(o,{x:n,y:r,z:i,size:e}):null}function Wae(){const t=te(),e=ee("scribbles",()=>t.getInstanceState().scribbles,[t]),n=ee("zoomLevel",()=>t.getZoomLevel(),[t]),{Scribble:r}=on();return r&&e.length?e.map(i=>y.jsx(r,{className:"tl-user-scribble",scribble:i,zoom:n},i.id)):null}function Xae(){const t=te(),e=ee("brush",()=>t.getInstanceState().brush,[t]),{Brush:n}=on();return n&&e?y.jsx(n,{className:"tl-user-brush",brush:e}):null}function Zae(){const t=te(),e=ee("zoomBrush",()=>t.getInstanceState().zoomBrush,[t]),{ZoomBrush:n}=on();return n&&e?y.jsx(n,{className:"tl-user-brush tl-zoom-brush",brush:e}):null}function Jae(){const t=te(),e=ee("snapLines",()=>t.snaps.getIndicators(),[t]),n=ee("zoomLevel",()=>t.getZoomLevel(),[t]),{SnapIndicator:r}=on();return r&&e.length>0?e.map(i=>y.jsx(r,{className:"tl-user-snapline",line:i,zoom:n},i.id)):null}function Qae(){const t=te(),e=ee("handles shapeIdWithHandles",()=>{const{isReadonly:n,isChangingStyle:r}=t.getInstanceState();if(n||r)return!1;const i=t.getOnlySelectedShape();return!i||!t.getShapeHandles(i)?!1:i.id},[t]);return e?y.jsx(ele,{shapeId:e}):null}function ele({shapeId:t}){const e=te(),{Handles:n}=on(),r=ee("zoomLevel",()=>e.getZoomLevel(),[e]),i=ee("coarse pointer",()=>e.getInstanceState().isCoarsePointer,[e]),s=ee("handles transform",()=>e.getShapePageTransform(t),[e,t]),o=ee("handles",()=>{const l=e.getShapeHandles(t);if(!l)return null;const u=(i?e.options.coarseHandleRadius:e.options.handleRadius)/r*2;return l.filter(f=>f.type!=="virtual"||!l.some(h=>h!==f&&h.type==="vertex"&&I.Dist(f,h)<u)).sort(f=>f.type==="vertex"?1:-1)},[e,r,i,t]),a=ee("isHidden",()=>e.isShapeHidden(t),[e,t]);return!n||!o||!s||a?null:y.jsx(n,{children:y.jsx("g",{transform:ve.toCssString(s),children:o.map(l=>y.jsx(tle,{shapeId:t,handle:l,zoom:r,isCoarse:i},l.id))})})}function tle({shapeId:t,handle:e,zoom:n,isCoarse:r}){const i=Lae(t,e.id),{Handle:s}=on();return s?y.jsx("g",{role:"button","aria-label":e.label||"handle",transform:`translate(${e.x}, ${e.y})`,...i,children:y.jsx(s,{shapeId:t,handle:e,zoom:n,isCoarse:r})}):null}function nle(){const{Overlays:t}=on();return t?y.jsx("div",{className:"tl-custom-overlays tl-overlays__item",children:y.jsx(t,{})}):null}function rle(){const t=te();return ee("rendering shapes",()=>t.getRenderingShapes(),[t]).map(n=>y.jsxs(E.Fragment,{children:[y.jsx(E6,{...n}),y.jsx(cle,{id:n.id,mode:"iframe"})]},n.id+"_fragment"))}function ile(){const t=te(),e=E.useRef(new Set);return xd("reflow for culled shapes",()=>{const n=t.getCulledShapes();if(e.current.size===n.size&&[...n].every(i=>e.current.has(i)))return;e.current=n;const r=document.getElementsByClassName("tl-canvas");r.length!==0&&r[0].offsetHeight},[t]),null}function sle(){const t=te(),e=ee("rendering shapes",()=>t.getRenderingShapes(),[t]);return y.jsxs(y.Fragment,{children:[e.map(n=>y.jsx(E6,{...n},n.id+"_shape")),Lt.isSafari&&y.jsx(ile,{})]})}function ole(){const t=te(),{ShapeIndicator:e}=on(),n=ee("hinting shape ids",()=>CI(t.getHintingShapeIds()),[t]);return!n.length||!e?null:n.map(r=>y.jsx(e,{className:"tl-user-indicator__hint",shapeId:r},r+"_hinting"))}function ale(){return y.jsxs("g",{id:fa("cursor"),children:[y.jsxs("g",{fill:"rgba(0,0,0,.2)",transform:"translate(-11,-11)",children:[y.jsx("path",{d:"m12 24.4219v-16.015l11.591 11.619h-6.781l-.411.124z"}),y.jsx("path",{d:"m21.0845 25.0962-3.605 1.535-4.682-11.089 3.686-1.553z"})]}),y.jsxs("g",{fill:"white",transform:"translate(-12,-12)",children:[y.jsx("path",{d:"m12 24.4219v-16.015l11.591 11.619h-6.781l-.411.124z"}),y.jsx("path",{d:"m21.0845 25.0962-3.605 1.535-4.682-11.089 3.686-1.553z"})]}),y.jsxs("g",{fill:"currentColor",transform:"translate(-12,-12)",children:[y.jsx("path",{d:"m19.751 24.4155-1.844.774-3.1-7.374 1.841-.775z"}),y.jsx("path",{d:"m13 10.814v11.188l2.969-2.866.428-.139h4.768z"})]})]})}function lle(){const t=fa("cursor_hint");return y.jsx("path",{id:t,fill:"currentColor",d:"M -2,-5 2,0 -2,5 Z"})}function cle({id:t,mode:e}){const n=te(),[r,i]=E.useState(null),s=ee("is in root",()=>n.getShape(t)?.parentId===n.getCurrentPageId(),[n,t]);return E.useEffect(()=>{if(!s)return;let o=null;const a=Os("shape to svg",async()=>{const l=Math.random();o=l;const f=n.isShapeOfType(t,"frame")?0:10;let h=n.getShapePageBounds(t);if(!h)return;h=h.clone().expandBy(f);const g=await n.getSvgString([t],{padding:f});if(o!==l||!g)return;const m=`data:image/svg+xml;utf8,${encodeURIComponent(g.svg)}`;i({src:m,bounds:h})});return()=>{o=null,a()}},[n,t,s]),!s||!r?null:e==="iframe"?y.jsx("iframe",{src:r.src,width:r.bounds.width,height:r.bounds.height,referrerPolicy:"no-referrer",style:{position:"absolute",top:0,left:0,border:"none",transform:`translate(${r.bounds.x}px, ${r.bounds.maxY+12}px)`,outline:"1px solid black",maxWidth:"none"}}):y.jsx("img",{src:r.src,width:r.bounds.width,height:r.bounds.height,referrerPolicy:"no-referrer",style:{position:"absolute",top:0,left:0,transform:`translate(${r.bounds.x}px, ${r.bounds.maxY+12}px)`,outline:"1px solid black",maxWidth:"none"}})}function ule(){const t=te(),e=ee("selection rotation",function(){return t.getSelectionRotation()},[t]),n=ee("selection bounds",()=>t.getSelectionRotatedPageBounds(),[t]),{SelectionForeground:r}=on();return!n||!r?null:y.jsx(r,{bounds:n,rotation:e})}function dle(){const t=te(),e=ee("selection rotation",()=>t.getSelectionRotation(),[t]),n=ee("selection bounds",()=>t.getSelectionRotatedPageBounds(),[t]),{SelectionBackground:r}=on();return!n||!r?null:y.jsx(r,{bounds:n,rotation:e})}function hle(){const{OnTheCanvas:t}=on();return t?y.jsx(t,{}):null}function fle(){const t=te(),e=ee("camera state",()=>t.getCameraState(),[t]);return y.jsx("div",{className:Fe("tl-hit-test-blocker",{"tl-hit-test-blocker__hidden":e==="idle"})})}function ou({children:t,className:e="",...n}){return y.jsx("div",{...n,className:Fe("tl-html-container",e),children:t})}class ple{constructor(e){this.editor=e}static props;static migrations;static type}function Jx(t,e,n={}){const{newPoint:r,handle:i,scaleX:s,scaleY:o}=e,{minWidth:a=1,maxWidth:l=1/0,minHeight:u=1,maxHeight:f=1/0}=n;let h=t.props.w*s,g=t.props.h*o;const m=new I(0,0);if(h>0){if(h<a){switch(i){case"top_left":case"left":case"bottom_left":{m.x=h-a;break}case"top":case"bottom":{m.x=(h-a)/2;break}default:m.x=0}h=a}}else if(m.x=h,h=-h,h<a){switch(i){case"top_left":case"left":case"bottom_left":{m.x=-h;break}default:m.x=-a}h=a}if(g>0){if(g<u){switch(i){case"top_left":case"top":case"top_right":{m.y=g-u;break}case"right":case"left":{m.y=(g-u)/2;break}default:m.y=0}g=u}}else if(m.y=g,g=-g,g<u){switch(i){case"top_left":case"top":case"top_right":{m.y=-g;break}default:m.y=-u}g=u}const{x:b,y:w}=m.rot(t.rotation).add(r);return{...t,x:b,y:w,props:{w:Math.min(l,h),h:Math.min(f,g)}}}class np extends Au{getGeometry(e){return new ya({width:e.props.w,height:e.props.h,isFilled:!0})}onResize(e,n){return Jx(e,n)}getHandleSnapGeometry(e){return{points:this.getGeometry(e).bounds.cornersAndCenter}}getInterpolatedProps(e,n,r){return{...n.props,w:lt(e.props.w,n.props.w,r),h:lt(e.props.h,n.props.h,r)}}}function BH(t,{initialBounds:e,scaleX:n,scaleY:r,newPoint:i,handle:s}){let o;switch(s){case"bottom_left":case"bottom_right":case"top_left":case"top_right":{o=Math.max(.01,Math.max(Math.abs(n),Math.abs(r)));break}case"left":case"right":{o=Math.max(.01,Math.abs(n));break}case"bottom":case"top":{o=Math.max(.01,Math.abs(r));break}default:throw kt(s)}const a=new I(0,0);n<0&&(a.x=-(e.width*o)),r<0&&(a.y=-(e.height*o));const{x:l,y:u}=I.Add(i,a.rot(t.rotation));return{x:l,y:u,props:{scale:o*t.props.scale}}}let gle=class extends Ve{static id="idle";onPointerDown(e){this.parent.transition("pointing",e)}onEnter(){this.editor.setCursor({type:"cross",rotation:0})}onCancel(){this.editor.setCurrentTool("select")}},mle=class extends Ve{static id="pointing";onPointerMove(e){const{editor:n}=this;if(n.inputs.isDragging){const{originPagePoint:r}=n.inputs,i=this.parent.shapeType,s=sn(),o=n.markHistoryStoppingPoint(`creating_box:${s}`),a=co(r,n);if(this.editor.createShapes([{id:s,type:i,x:a.x,y:a.y,props:{w:1,h:1}}]),!n.getShape(s)){this.cancel();return}n.select(s);const u=this.parent;this.editor.setCurrentTool("select.resizing",{...e,target:"selection",handle:"bottom_right",isCreating:!0,creatingMarkId:o,creationCursorOffset:{x:1,y:1},onInteractionEnd:this.parent.id,onCreate:u.onCreate?f=>u.onCreate?.(f):void 0})}}onPointerUp(){this.complete()}onCancel(){this.cancel()}onComplete(){this.complete()}onInterrupt(){this.cancel()}complete(){const{originPagePoint:e}=this.editor.inputs,n=this.parent.shapeType,r=sn();this.editor.markHistoryStoppingPoint(`creating_box:${r}`),this.editor.createShapes([{id:r,type:n,x:e.x,y:e.y}]);const i=this.editor.getShape(r);if(!i){this.cancel();return}let{w:s,h:o}=i.props;const a=new I(s/2,o/2),l=this.editor.getShapeParentTransform(i);l&&a.rot(-l.rotation());let u=1;this.editor.user.getIsDynamicResizeMode()&&(u=1/this.editor.getZoomLevel(),s*=u,o*=u,a.mul(u));const f=nr(i),h=co(new I(i.x-a.x,i.y-a.y),this.editor);f.x=h.x,f.y=h.y,f.props.w=s,f.props.h=o,"scale"in i.props&&(f.props.scale=u),this.editor.updateShape(f),this.editor.setSelectedShapes([r]),this.editor.getInstanceState().isToolLocked?this.parent.transition("idle"):this.editor.setCurrentTool("select.idle")}cancel(){this.parent.transition("idle")}};function co(t,e){const n=e.getInstanceState().isGridMode,r=e.getDocumentSettings().gridSize;return n?t.clone().snapToGrid(r):t.clone()}class yle extends Ve{static id="box";static initial="idle";static children(){return[gle,mle]}}function Sle(t,e,n){const r=E.useRef(!1),i=E.useCallback(o=>{r.current=o,o?Gi.addOpenMenu(t):Gi.deleteOpenMenu(t),e?.(o)},[t,e]),s=ee("is menu open",()=>Gi.getOpenMenus().includes(t),[t]);return E.useEffect(()=>(r.current&&(n?.("open-menu"),Gi.addOpenMenu(t)),()=>{r.current&&(Gi.deleteOpenMenu(t),Gi.getOpenMenus().forEach(o=>{o.startsWith(t)&&(n?.("close-menu"),Gi.deleteOpenMenu(o))}),r.current=!1)}),[t,n]),[s,i]}function uy(t){const e=te();return ee("isEditing",()=>e.getEditingShapeId()===t,[e,t])}function ble(t){if(!t)throw Error("usePassThroughWheelEvents must be passed a ref");const e=ur(),n=Gn();E.useEffect(()=>{function r(s){if(!n?.getInstanceState().isFocused||s.isSpecialRedispatchedEvent)return;nt(s);const o=e.querySelector(".tl-canvas");if(!o)return;const a=new PointerEvent(s.type,s);a.isSpecialRedispatchedEvent=!0,o.dispatchEvent(a)}const i=t.current;if(i)return i.addEventListener("mouseover",r,{passive:!1}),()=>{i.removeEventListener("mouseover",r)}},[e,n,t])}function Ra(t){const e=te();return E.useMemo(function(){const i=u=>{if(e.wasEventAlreadyHandled(u))return;if(u.button===fk){e.dispatch({type:"pointer",target:"selection",handle:t,name:"right_click",...li(e,u)});return}if(u.button!==0)return;const f=uv(u.currentTarget);function h(){f.removeEventListener("pointerup",h),ey(f,u)}Qm(f,u),f.addEventListener("pointerup",h),e.dispatch({name:"pointer_down",type:"pointer",target:"selection",handle:t,...li(e,u)}),e.markEventAsHandled(u)};let s,o;function a(u){e.wasEventAlreadyHandled(u)||u.button===0&&(u.clientX===s&&u.clientY===o||(s=u.clientX,o=u.clientY,e.dispatch({name:"pointer_move",type:"pointer",target:"selection",handle:t,...li(e,u)})))}return{onPointerDown:i,onPointerMove:a,onPointerUp:u=>{e.wasEventAlreadyHandled(u)||u.button===0&&e.dispatch({name:"pointer_up",type:"pointer",target:"selection",handle:t,...li(e,u)})}}},[e,t])}function vle(t){const[e,n]=E.useState(()=>({store:gm(t),opts:t}));if(!$B(e.opts,t)){const r={store:gm(t),opts:t};return n(r),r.store}return e.store}const xle=20,wle=8;function Qx(t,e=xle){return Math.max(wle,Math.ceil(t/e))}class FH extends Mu{_center;_radius;_start;_end;_largeArcFlag;_sweepFlag;_measure;_angleStart;_angleEnd;constructor(e){super({...e,isFilled:!1,isClosed:!1});const{center:n,sweepFlag:r,largeArcFlag:i,start:s,end:o}=e;if(s.equals(o))throw Error("Arc must have different start and end points.");this._angleStart=I.Angle(n,s),this._angleEnd=I.Angle(n,o),this._radius=I.Dist(n,s),this._measure=Kte(this._angleStart,this._angleEnd,r,i),this._start=s,this._end=o,this._sweepFlag=r,this._largeArcFlag=i,this._center=n}nearestPoint(e){const{_center:n,_measure:r,_radius:i,_angleEnd:s,_angleStart:o,_start:a,_end:l}=this,u=P3(r,o,s,n.angle(e));if(u<=0)return a;if(u>=1)return l;const f=I.Sub(e,n).uni().mul(i).add(n);let h,g=1/0,m;for(const b of[a,l,f])m=I.Dist2(e,b),m<g&&(h=b,g=m);if(!h)throw Error("nearest point not found");return h}hitTestLineSegment(e,n){const{_center:r,_radius:i,_measure:s,_angleStart:o,_angleEnd:a}=this,l=ny(e,n,r,i);return l===null?!1:l.some(u=>{const f=P3(s,o,a,r.angle(u));return f>=0&&f<=1})}getVertices(){const{_center:e,_measure:n,length:r,_radius:i,_angleStart:s}=this,o=[];for(let a=0,l=Qx(Math.abs(r));a<l+1;a++){const u=a/l*n,f=s+u;o.push(hk(e,i,f))}return o}getSvgPathData(e=!0){const{_start:n,_end:r,_radius:i,_largeArcFlag:s,_sweepFlag:o}=this;return`${e?`M${n.toFixed()}`:""} A${i} ${i} 0 ${s} ${o} ${r.toFixed()}`}getLength(){return Math.abs(this._measure*this._radius)}}class gv extends Mu{constructor(e){super({isClosed:!0,...e}),this.config=e;const{x:n=0,y:r=0,radius:i}=e;this._x=n,this._y=r,this._center=new I(i+n,i+r),this._radius=i}_center;_radius;_x;_y;getBounds(){return new we(this._x,this._y,this._radius*2,this._radius*2)}getVertices(){const{_center:e,_radius:n}=this,r=hn*n,i=[];for(let s=0,o=Qx(r);s<o;s++){const a=s/o*hn;i.push(hk(e,n,a))}return i}nearestPoint(e){const{_center:n,_radius:r}=this;return n.equals(e)?I.AddXY(n,r,0):I.Sub(e,n).uni().mul(r).add(n)}hitTestLineSegment(e,n,r=0){const{_center:i,_radius:s}=this;return ny(e,n,i,s+r)!==null}getSvgPathData(){const{_center:e,_radius:n}=this;return`M${e.x+n},${e.y} a${n},${n} 0 1,0 ${n*2},0a${n},${n} 0 1,0 -${n*2},0`}}class Rk extends ry{_a;_b;_c;_d;_resolution;constructor(e){const{start:n,cp1:r,cp2:i,end:s}=e;super({...e,points:[n,s]}),this._a=n,this._b=r,this._c=i,this._d=s,this._resolution=e.resolution??10}getVertices(){const e=[],{_a:n,_b:r,_c:i,_d:s}=this;for(let o=0,a=this._resolution;o<=a;o++){const l=o/a;e.push(new I((1-l)*(1-l)*(1-l)*n.x+3*((1-l)*(1-l))*l*r.x+3*(1-l)*(l*l)*i.x+l*l*l*s.x,(1-l)*(1-l)*(1-l)*n.y+3*((1-l)*(1-l))*l*r.y+3*(1-l)*(l*l)*i.y+l*l*l*s.y))}return e}nearestPoint(e){let n,r=1/0,i,s;for(const o of this.segments)s=o.nearestPoint(e),i=I.Dist2(s,e),i<r&&(n=s,r=i);if(!n)throw Error("nearest point not found");return n}getSvgPathData(e=!0){const{_a:n,_b:r,_c:i,_d:s}=this;return`${e?`M ${n.toFixed()} `:""} C${r.toFixed()} ${i.toFixed()} ${s.toFixed()}`}static GetAtT(e,n){const{_a:r,_b:i,_c:s,_d:o}=e;return new I((1-n)*(1-n)*(1-n)*r.x+3*((1-n)*(1-n))*n*i.x+3*(1-n)*(n*n)*s.x+n*n*n*o.x,(1-n)*(1-n)*(1-n)*r.y+3*((1-n)*(1-n))*n*i.y+3*(1-n)*(n*n)*s.y+n*n*n*o.y)}getLength(e,n=32){let r,i=this._a,s=0;for(let o=1;o<=n;o++)r=Rk.GetAtT(this,o/n),s+=I.Dist(i,r),i=r;return s}}class Cle extends Mu{constructor(e){super({...e,isClosed:!0}),this.config=e;const{width:n,height:r}=e;this._w=n,this._h=r}_w;_h;_edges;get edges(){if(!this._edges){const{vertices:e}=this;this._edges=[];for(let n=0,r=e.length;n<r;n++){const i=e[n],s=e[(n+1)%r];this._edges.push(new Df({start:i,end:s}))}}return this._edges}getVertices(){const e=Math.max(1,this._w),n=Math.max(1,this._h),r=e/2,i=n/2,s=Math.pow(r-i,2)/Math.pow(r+i,2),o=Ut*(r+i)*(1+3*s/(10+Math.sqrt(4-3*s))),a=Qx(o),l=hn/a,u=Math.cos(l),f=Math.sin(l);let h=0,g=1,m=0,b=1;const w=Array(a);for(let x=0;x<a;x++)w[x]=new I(it(r+r*g,0,e),it(i+i*h,0,n)),m=f*g+u*h,b=u*g-f*h,h=m,g=b;return w}nearestPoint(e){let n,r=1/0,i,s;for(const o of this.edges)s=o.nearestPoint(e),i=I.Dist2(s,e),i<r&&(n=s,r=i);if(!n)throw Error("nearest point not found");return n}hitTestLineSegment(e,n){return this.edges.some(r=>r.hitTestLineSegment(e,n))}getBounds(){return new we(0,0,this._w,this._h)}getLength(){const{_w:e,_h:n}=this,r=e/2,i=n/2,s=Math.max(0,r),o=Math.max(0,i);return Fte(s,o)}getSvgPathData(e=!1){const{_w:n,_h:r}=this,i=n/2,s=r/2,o=Math.max(0,i),a=Math.max(0,s);return`${e?`M${i-o},${s}`:""} a${o},${a},0,1,1,${o*2},0a${o},${a},0,1,1,-${o*2},0`}}function Xt(t,e,n){const r=new Set;for(const a of e){const l=t.getShape(a);if(!l)continue;r.add(l);const u=t.getShape(l.parentId);u&&r.add(u)}const i=new Map;for(const a of r){const l=t.getSortedChildIdsForParent(a);if(n?.filter&&!n.filter(a))i.set(a,l);else{const u=Tle(t,a.id,l);u.length<l.length&&i.set(a,l.filter(f=>!u.includes(f)))}}const s=t.getCurrentPageShapesSorted().map(a=>a.id),o={};for(const[a,l]of i){const u=tt(l.map(g=>t.getShape(g))),{reparenting:f,remainingShapesToReparent:h}=Ele(t,u,(g,m)=>n?.filter&&!n.filter(m)?!1:m.id!==a.id&&s.indexOf(m.id)<s.indexOf(g.id));if(f.forEach((g,m)=>{g.length!==0&&(o[m]||(o[m]={parentId:m,shapeIds:[]}),o[m].shapeIds.push(...g.map(b=>b.id)))}),h.size>0){const g=t.findShapeAncestor(a,m=>t.isShapeOfType(m,"group"))?.id??t.getCurrentPageId();h.forEach(m=>{if(!o[g]){let b;const w=t.getSortedChildIdsForParent(g),x=w.indexOf(a.id);if(x>-1){const v=w[x+1],C=v?t.getShape(v).index:Bo(a.index);b=kf(a.index,C)}o[g]={parentId:g,shapeIds:[],index:b}}o[g].shapeIds.push(m.id)})}}t.run(()=>{Object.values(o).forEach(({parentId:a,shapeIds:l,index:u})=>{l.length!==0&&(l.sort((f,h)=>s.indexOf(f)<s.indexOf(h)?-1:1),t.reparentShapes(l,a,u))})})}function Tle(t,e,n){if(n.length===0)return qn;const r=t.getShapePageBounds(e);if(!r)return qn;const i=t.getShapeGeometry(e),o=t.getShapePageTransform(e).applyToPoints(i.vertices),a=t.getShape(e);if(!a)return qn;const l=t.getShapePageTransform(e),u=t.getShapeUtil(a.type).getClipPath?.(a),f=u?l.applyToPoints(u):void 0,h=f?hv(f,o):o;return h?n.filter(g=>{const m=t.getShapePageBounds(g);if(!m||!r.includes(m))return!1;const b=t.getShapePageTransform(g).clone().invert().applyToPoints(h);return t.getShapeGeometry(g).overlapsPolygon(b)}):qn}function Ele(t,e,n){const r=new Set(e),i=new Set;for(const u of e){const f=t.getShapeParent(u);f&&t.isShapeOfType(f,"group")&&(i.has(f)||i.add(f))}for(const u of i){const f=tt(t.getSortedChildIdsForParent(u).map(h=>t.getShape(h)));for(const h of f)r.delete(h);r.add(u)}const s=new Map,o=new Map,a=new Set(r),l=t.getCurrentPageShapesSorted().filter(u=>t.getShapeUtil(u).canReceiveNewChildrenOfType?.(u,u.type)&&!a.has(u));e:for(let u=l.length-1;u>=0;u--){const f=l[u],h=t.findShapeAncestor(f,C=>t.isShapeOfType(C,"group"))?.id,g=t.getShapeGeometry(f),m=t.getShapePageTransform(f),b=t.getShapeMask(f),w=m.applyToPoints(g.vertices),x=b?hv(b,w):w;if(!x)continue e;const v=[];t:for(const C of a){if(f.id===C.id||n&&!n(C,f)||(s.has(C.id)||s.set(C.id,t.findShapeAncestor(C,M=>t.isShapeOfType(M,"group"))?.id),s.get(C.id)!==h)||t.findShapeAncestor(f,M=>C.id===M.id))continue t;const k=t.getShapePageTransform(C).clone().invert().applyToPoints(x);if(t.getShapeGeometry(C).overlapsPolygon(k)){if(!t.getShapeUtil(f).canReceiveNewChildrenOfType?.(f,C.type))continue t;C.parentId!==f.id&&v.push(C),a.delete(C);continue t}}v.length&&o.set(f.id,v)}return{reparenting:o,remainingShapesToReparent:a}}function ei(t){this.content=t}ei.prototype={constructor:ei,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new ei(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new ei(n)},addToStart:function(t,e){return new ei([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new ei(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new ei(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=ei.from(t),t.size?new ei(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=ei.from(t),t.size?new ei(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=ei.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};ei.from=function(t){if(t instanceof ei)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new ei(e)};function UH(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)n++;return n}if(i.content.size||s.content.size){let o=UH(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function HH(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let u=0,f=Math.min(o.text.length,a.text.length);for(;u<f&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let u=HH(o.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class Te{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,a=0;a<n;o++){let l=this.content[o],u=a+l.nodeSize;if(u>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let f=a+1;l.nodesBetween(Math.max(0,e-f),Math.min(l.content.size,n-f),r,i+f)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new Te(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new Te(r,i)}cutByIndex(e,n){return e==n?Te.empty:e==0&&n==this.content.length?this:new Te(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new Te(i,s)}addToStart(e){return new Te([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Te(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.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(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return UH(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return HH(this,e,n,r)}findIndex(e){if(e==0)return GS(0,e);if(e==this.size)return GS(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?GS(n+1,s):GS(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Te.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Te(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Te.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new Te(n||e,r)}static from(e){if(!e)return Te.empty;if(e instanceof Te)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Te([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Te.empty=new Te([],0);const FE={index:0,offset:0};function GS(t,e){return FE.index=t,FE.offset=e,FE}function mv(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!mv(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!mv(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let dn=class hP{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&mv(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return hP.none;if(e instanceof hP)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};dn.none=[];class yv extends Error{}class Le{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=KH(this.content,e+this.openStart,n);return r&&new Le(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Le($H(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Le.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Le(Te.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new Le(e,r,i)}}Le.empty=new Le(Te.empty,0,0);function $H(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy($H(s.content,e-i-1,n-i-1)))}function KH(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),o=t.maybeChild(i);if(s==e||o.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=KH(o.content,e-s-1,n,o);return a&&t.replaceChild(i,o.copy(a))}function _le(t,e,n){if(n.openStart>t.depth)throw new yv("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new yv("Inconsistent open depths");return VH(t,e,n,0)}function VH(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=VH(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,a=o.content;return md(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=Ple(n,t);return md(s,GH(t,o,a,e,r))}else return md(s,Sv(t,e,r))}function qH(t,e){if(!e.type.compatibleContent(t.type))throw new yv("Cannot join "+e.type.name+" onto "+t.type.name)}function fP(t,e,n){let r=t.node(n);return qH(r,e.node(n)),r}function gd(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Gg(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(gd(t.nodeAfter,r),s++));for(let a=s;a<o;a++)gd(i.child(a),r);e&&e.depth==n&&e.textOffset&&gd(e.nodeBefore,r)}function md(t,e){return t.type.checkContent(e),t.copy(e)}function GH(t,e,n,r,i){let s=t.depth>i&&fP(t,e,i+1),o=r.depth>i&&fP(n,r,i+1),a=[];return Gg(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(qH(s,o),gd(md(s,GH(t,e,n,r,i+1)),a)):(s&&gd(md(s,Sv(t,e,i+1)),a),Gg(e,n,i,a),o&&gd(md(o,Sv(n,r,i+1)),a)),Gg(r,null,i,a),new Te(a)}function Sv(t,e,n){let r=[];if(Gg(null,t,n,r),t.depth>n){let i=fP(t,e,n+1);gd(md(i,Sv(t,e,n+1)),r)}return Gg(e,null,n,r),new Te(r)}function Ple(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(Te.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class ym{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return dn.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new bv(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),u=s-l;if(r.push(o,a,i+l),!u||(o=o.child(a),o.isText))break;s=u-1,i+=l+1}return new ym(n,r,s)}static resolveCached(e,n){let r=_N.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else _N.set(e,r=new Ile);let i=r.elts[r.i]=ym.resolve(e,n);return r.i=(r.i+1)%kle,i}}class Ile{constructor(){this.elts=[],this.i=0}}const kle=12,_N=new WeakMap;class bv{constructor(e,n,r){this.$from=e,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 Mle=Object.create(null);let pa=class pP{constructor(e,n,r,i=dn.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||Te.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&mv(this.attrs,n||e.defaultAttrs||Mle)&&dn.sameSet(this.marks,r||dn.none)}copy(e=null){return e==this.content?this:new pP(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new pP(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return Le.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),a=i.start(o),u=i.node(o).content.cut(i.pos-a,s.pos-a);return new Le(u,i.depth-o,s.depth-o)}replace(e,n,r){return _le(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return ym.resolveCached(this,e)}resolveNoCache(e){return ym.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),YH(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=Te.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=dn.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!dn.sameSet(e,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 e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,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(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=Te.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};pa.prototype.text=void 0;class vv extends pa{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):YH(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new vv(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new vv(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function YH(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Id{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Ale(e,n);if(r.next==null)return Id.empty;let i=WH(r);r.next&&r.err("Unexpected trailing text");let s=zle(Nle(i));return Ble(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!n||l.validEnd))return Te.from(a.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:f,next:h}=o.next[u];if(!(f.isText||f.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let g=s(h,a.concat(f));if(g)return g}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
162
+ }`;return y.jsx("style",{nonce:e.options.nonce,children:r})}),doe=[],hoe=[],foe=[],poe="tl-container",goe=E.memo(function({store:e,components:n,className:r,user:i,options:s,...o}){const[a,l]=E.useState(null),u=E.useMemo(()=>i??Q4(),[i]),f=n?.ErrorFallback===void 0?H4:n?.ErrorFallback,h={...o,shapeUtils:o.shapeUtils??doe,bindingUtils:o.bindingUtils??hoe,tools:o.tools??foe,components:n,options:Qf(s)};return y.jsx("div",{ref:l,"data-tldraw":Sk,draggable:!1,className:Fe(`${poe} tl-theme__light`,r),tabIndex:-1,role:"application","aria-label":s?.branding??"tldraw",children:y.jsx(fm,{fallback:f,onError:g=>EI(g,{tags:{origin:"react.tldraw-before-app"}}),children:a&&y.jsx(Qse,{licenseKey:o.licenseKey,children:y.jsx(F4,{container:a,children:y.jsx(Moe,{overrides:n,children:e?e instanceof ek?y.jsx(vH,{...h,store:e,user:u}):y.jsx(bH,{...h,store:e,user:u}):y.jsx(moe,{...h,store:e,user:u})})})})})})});function moe(t){const{defaultName:e,snapshot:n,initialData:r,shapeUtils:i,bindingUtils:s,persistenceKey:o,sessionId:a,user:l,assets:u,migrations:f}=t,h=Hse({shapeUtils:i,bindingUtils:s,initialData:r,persistenceKey:o,sessionId:a,defaultName:e,snapshot:n,assets:u,migrations:f});return y.jsx(bH,{...t,store:h,user:l})}const bH=E.memo(function({store:e,user:n,...r}){const i=ur();E.useLayoutEffect(()=>{n.userPreferences.get().colorScheme==="dark"&&(i.classList.remove("tl-theme__light"),i.classList.add("tl-theme__dark"))},[i,n]);const{LoadingScreen:s}=on();switch(e.status){case"error":throw e.error;case"loading":return s?y.jsx(s,{}):null}return y.jsx(vH,{...r,store:e.store,user:n})}),zE=()=>document.location.search.includes("tldraw_preserve_focus");function vH({onMount:t,children:e,store:n,tools:r,shapeUtils:i,bindingUtils:s,user:o,initialState:a,autoFocus:l=!0,inferDarkMode:u,cameraOptions:f,textOptions:h,options:g,licenseKey:m,deepLinks:b,getShapeVisibility:w,assetUrls:x}){const{ErrorFallback:v}=on(),C=ur(),[P,k]=yH(null),M=E.useRef(null),A=Qf(b===!0?{}:b),O=E.useRef({autoFocus:l&&!zE(),inferDarkMode:u,initialState:a,cameraOptions:f,deepLinks:A});E.useLayoutEffect(()=>{O.current={autoFocus:l&&!zE(),inferDarkMode:u,initialState:a,cameraOptions:f,deepLinks:A}},[l,u,a,f,A]),E.useLayoutEffect(()=>{const{autoFocus:z,inferDarkMode:K,initialState:B,cameraOptions:G,deepLinks:W}=O.current,Z=new Ae({store:n,shapeUtils:i,bindingUtils:s,tools:r,getContainer:()=>C,user:o,initialState:B,autoFocus:z,inferDarkMode:K,cameraOptions:G,textOptions:h,options:g,licenseKey:m,getShapeVisibility:w,fontAssetUrls:x?.fonts});return Z.updateViewportScreenBounds(M.current??C),W&&(W?.getUrl?Z.navigateToDeepLink({...W,url:W.getUrl(Z)}):Z.navigateToDeepLink(W)),k(Z),()=>{Z.dispose()}},[s,C,g,i,n,r,o,k,m,w,h,x]),E.useLayoutEffect(()=>{if(P&&A)return P.registerDeepLinkListener(A)},[P,A]),E.useLayoutEffect(()=>{P&&f&&P.setCameraOptions(f)},[P,f]);const R=E.useSyncExternalStore(E.useCallback(z=>P?(P.on("crash",z),()=>P.off("crash",z)):()=>{},[P]),()=>P?.getCrashingError()??null);E.useEffect(function(){if(!P)return;function K(){P&&P.focus()}function B(){P&&P.blur()}if(l&&zE())return P.getContainer().addEventListener("pointerdown",K),document.body.addEventListener("pointerdown",B),()=>{P.getContainer()?.removeEventListener("pointerdown",K),document.body.removeEventListener("pointerdown",B)}},[P,l]);const[F,N]=E.useState(null);let j=F;P!==j?.editor&&(j=null),E.useLayoutEffect(()=>{if(!P)return;if(P.options.maxFontsToLoadBeforeRender===0){N({editor:P,isLoaded:!0});return}let z=!1;return N({editor:P,isLoaded:!1}),P.fonts.loadRequiredFontsForCurrentPage(P.options.maxFontsToLoadBeforeRender).finally(()=>{z||N({editor:P,isLoaded:!0})}),()=>{z=!0}},[P]);const{Canvas:H,LoadingScreen:V}=on();return!P||!j?.isLoaded?y.jsxs(y.Fragment,{children:[V&&y.jsx(V,{}),y.jsx("div",{className:"tl-canvas",ref:M})]}):y.jsx(fm,{fallback:v,onError:z=>P.annotateError(z,{origin:"react.tldraw",willCrashApp:!0}),children:R?y.jsx(Soe,{crashingError:R}):y.jsx(mk,{editor:P,children:y.jsxs(yoe,{onMount:t,children:[e??(H?y.jsx(H,{},P.contextId):null),y.jsx(aoe,{})]})})})}function yoe({children:t,onMount:e}){return Kse(),pse(),gse(),mse(),$se(),wH(n=>{const r=n.store.props.onMount(n),i=e?.(n);return()=>{r?.(),i?.()}}),t}function Soe({crashingError:t}){throw t}function xH({children:t}){return y.jsx("div",{className:"tl-loading","aria-busy":"true",tabIndex:0,children:t})}function wH(t){const e=te(),n=za(r=>{let i;return r.run(()=>{i=t?.(r),r.emit("mount")},{history:"ignore"}),window.tldrawReady=!0,i});qe.useLayoutEffect(()=>{if(e)return n?.(e)},[e,n])}const boe=()=>{const{Spinner:t}=on();return y.jsx(xH,{children:t?y.jsx(t,{}):null})};function CH(t,e=!0){const n=t.length;if(n<2)return"";let r=t[0],i=t[1];if(n===2)return`M${ii(r)}L${ii(i)}`;let s="";for(let o=2,a=n-1;o<a;o++)r=t[o],i=t[o+1],s+=Ps(r,i);return e?`M${Ps(t[0],t[1])}Q${ii(t[1])}${Ps(t[1],t[2])}T${s}${Ps(t[n-1],t[0])}${Ps(t[0],t[1])}Z`:`M${ii(t[0])}Q${ii(t[1])}${Ps(t[1],t[2])}${t.length>3?"T":""}${s}L${ii(t[n-1])}`}function dN({scribble:t,zoom:e,color:n,opacity:r,className:i}){return t.points.length?y.jsx("svg",{className:i&&Fe("tl-overlays__item",i),children:y.jsx("path",{className:"tl-scribble",d:CH(t.points,!1),stroke:n??`var(--tl-color-${t.color})`,fill:"none",strokeWidth:8/e,opacity:r??t.opacity})}):null}function voe({bounds:t,rotation:e}){const n=te(),r=E.useRef(null),i=ee("only selected shape",()=>n.getOnlySelectedShape(),[n]),s=i?n.getShapeUtil(i).expandSelectionOutlinePx(i):0;return Jm(r,t?.x,t?.y,1,e,{x:-s,y:-s}),t=s instanceof we?t.clone().expand(s).zeroFix():t.clone().expandBy(s).zeroFix(),y.jsx("svg",{ref:r,className:"tl-overlays__item tl-selection__fg","data-testid":"selection-foreground",children:y.jsx("rect",{className:Fe("tl-selection__fg__outline"),width:J(t.width),height:J(t.height)})})}const xoe=()=>y.jsx("div",{className:"tl-shape-error-boundary"}),woe=E.memo(({shape:t,util:e})=>Px("Indicator: "+t.type,()=>e.indicator(e.editor.store.unsafeGetWithoutCapture(t.id))),(t,e)=>t.shape.props===e.shape.props&&t.shape.meta===e.shape.meta),Coe=E.memo(({editor:t,id:e})=>{const n=ee("shape for indicator",()=>t.store.get(e),[t,e]),{ShapeIndicatorErrorFallback:r}=on();return!n||n.isLocked?null:y.jsx(fm,{fallback:r,onError:i=>t.annotateError(i,{origin:"react.shapeIndicator",willCrashApp:!1}),children:y.jsx(woe,{shape:n,util:t.getShapeUtil(n)},n.id)})}),hN=E.memo(function({shapeId:e,className:n,color:r,hidden:i,opacity:s}){const o=te(),a=E.useRef(null);return xd("indicator transform",()=>{if(i)return;const l=a.current;if(!l)return;const u=o.getShapePageTransform(e);u&&l.style.setProperty("transform",u.toCssString())},[o,e,i]),E.useLayoutEffect(()=>{const l=a.current;l&&l.style.setProperty("display",i?"none":"block")},[i]),y.jsx("svg",{ref:a,className:Fe("tl-overlays__item",n),"aria-hidden":"true",children:y.jsx("g",{className:"tl-shape-indicator",stroke:r??"var(--tl-color-selected)",opacity:s,children:y.jsx(Coe,{editor:o,id:e})})})}),Toe=()=>y.jsx("circle",{cx:4,cy:4,r:8,strokeWidth:"1",stroke:"red"}),TH=E.memo(function({hideAll:e,showAll:n}){const r=te();if(e&&n)throw Error("You cannot set both hideAll and showAll props to true, cmon now");const i=E.useRef(new Set),s=ee("should display selected ids",()=>{const l=i.current,u=new Set,f=r.getInstanceState(),h=f.isChangingStyle,g=r.isInAny("select.idle","select.editing_shape"),m=r.isInAny("select.brushing","select.scribble_brushing","select.pointing_shape","select.pointing_selection","select.pointing_handle");if(h||!(g||m))return i.current=u,u;for(const b of r.getSelectedShapeIds())u.add(b);if(g&&f.isHoveringCanvas&&!f.isCoarsePointer){const b=r.getHoveredShapeId();b&&u.add(b)}if(l.size!==u.size)return i.current=u,u;for(const b of u)if(!l.has(b))return i.current=u,u;return l},[r]),o=ee("rendering shapes",()=>r.getRenderingShapes(),[r]),{ShapeIndicator:a}=on();return a?o.map(({id:l})=>y.jsx(a,{shapeId:l,hidden:!n&&(e||!s.has(l))},l+"_indicator")):null}),Eoe=E.forwardRef(function({children:e,shape:n,isBackground:r,...i},s){const o="fill"in n.props&&n.props.fill!=="none";return y.jsx("div",{ref:s,"data-shape-type":n.type,"data-shape-is-filled":r?void 0:o,"data-shape-id":n.id,draggable:!1,...i,className:Fe("tl-shape",r&&"tl-shape-background",i.className),children:e})});function _oe({points:t,zoom:e}){const n=2.5/e,r=t.reduce((g,m)=>Math.min(g,m.x),1/0),i=t.reduce((g,m)=>Math.max(g,m.x),-1/0),s=t.reduce((g,m)=>Math.min(g,m.y),1/0),o=t.reduce((g,m)=>Math.max(g,m.y),-1/0),a=t.some(g=>g.x===r&&g.y===s);let l,u,f,h;return a?(l=r,u=s,f=i,h=o):(l=r,u=o,f=i,h=s),y.jsxs("g",{className:"tl-snap-indicator",stroke:"lime",children:[y.jsx("line",{x1:l,y1:u,x2:f,y2:h}),t.map((g,m)=>y.jsx("g",{transform:`translate(${g.x},${g.y})`,children:y.jsx("path",{className:"tl-snap-point",d:`M ${-n},${-n} L ${n},${n} M ${-n},${n} L ${n},${-n}`})},m))]})}function Poe({gaps:t,direction:e,zoom:n}){const r=3.5/n;let i=[-1/0,1/0],s=null;const o=e==="horizontal";for(const l of t){if(s=oa(i[0],i[1],o?l.startEdge[0].y:l.startEdge[0].x,o?l.startEdge[1].y:l.startEdge[1].x),s)i=s;else continue;if(s=oa(i[0],i[1],o?l.endEdge[0].y:l.endEdge[0].x,o?l.endEdge[1].y:l.endEdge[1].x),s)i=s;else continue}if(i===null)return null;const a=(i[0]+i[1])/2;return y.jsx("g",{className:"tl-snap-indicator",stroke:"cyan",children:t.map(({startEdge:l,endEdge:u},f)=>y.jsx(E.Fragment,{children:o?y.jsxs(y.Fragment,{children:[y.jsx("line",{x1:l[0].x,y1:a-2*r,x2:l[1].x,y2:a+2*r}),y.jsx("line",{x1:u[0].x,y1:a-2*r,x2:u[1].x,y2:a+2*r}),y.jsx("line",{x1:l[0].x,y1:a,x2:u[0].x,y2:a}),y.jsx("line",{x1:(l[0].x+u[0].x)/2,y1:a-r,x2:(l[0].x+u[0].x)/2,y2:a+r})]}):y.jsxs(y.Fragment,{children:[y.jsx("line",{x1:a-2*r,y1:l[0].y,x2:a+2*r,y2:l[1].y}),y.jsx("line",{x1:a-2*r,y1:u[0].y,x2:a+2*r,y2:u[1].y}),y.jsx("line",{x1:a,y1:l[0].y,x2:a,y2:u[0].y}),y.jsx("line",{x1:a-r,y1:(l[0].y+u[0].y)/2,x2:a+r,y2:(l[0].y+u[0].y)/2})]})},f))})}function Ioe({className:t,line:e,zoom:n}){return y.jsx("svg",{className:Fe("tl-overlays__item",t),"aria-hidden":"true",children:e.type==="points"?y.jsx(_oe,{...e,zoom:n}):e.type==="gaps"?y.jsx(Poe,{...e,zoom:n}):null})}function EH(t){return y.jsx("svg",{width:16,height:16,viewBox:"0 0 16 16","aria-hidden":"false",...t,className:Fe("tl-spinner",t.className),children:y.jsxs("g",{strokeWidth:2,fill:"none",fillRule:"evenodd",children:[y.jsx("circle",{strokeOpacity:.25,cx:8,cy:8,r:7,stroke:"currentColor"}),y.jsx("path",{strokeLinecap:"round",d:"M15 8c0-4.5-4.5-7-7-7",stroke:"currentColor"})]})})}const koe=()=>null,_H=E.createContext(null);function Moe({overrides:t={},children:e}){const n=Qf(t),r=E.useMemo(()=>({Background:Nte,Brush:wE,Canvas:qae,CollaboratorBrush:wE,CollaboratorCursor:D3,CollaboratorHint:nne,CollaboratorScribble:dN,CollaboratorShapeIndicator:hN,Cursor:D3,Grid:one,Handle:ane,Handles:lne,InFrontOfTheCanvas:null,LoadingScreen:boe,OnTheCanvas:null,Overlays:null,Scribble:dN,SelectionBackground:null,SelectionForeground:voe,ShapeIndicator:hN,ShapeIndicators:TH,ShapeWrapper:Eoe,SnapIndicator:Ioe,Spinner:EH,SvgDefs:koe,ZoomBrush:wE,ErrorFallback:H4,ShapeErrorFallback:xoe,ShapeIndicatorErrorFallback:Toe,...n}),[n]);return y.jsx(_H.Provider,{value:r,children:e})}function on(){const t=E.useContext(_H);if(!t)throw new Error("useEditorComponents must be used inside of <EditorComponentsProvider />");return t}const Aoe=["textarea","input"];function Ooe(t){const e=te();E.useEffect(()=>{const n=t.current;if(!n)return;const r=i=>{if(i instanceof PointerEvent&&i.pointerType==="pen"){e.markEventAsHandled(i);const{target:s}=i;if(Aoe.includes(s.tagName?.toLocaleLowerCase())||s.isContentEditable||e.isIn("select.editing_shape"))return;nt(i)}};return n.addEventListener("touchstart",r),n.addEventListener("touchend",r),()=>{n.removeEventListener("touchstart",r),n.removeEventListener("touchend",r)}},[e,t])}function Doe(t,e,n){return Math.max(e,Math.min(t,n))}const ci={toVector(t,e){return t===void 0&&(t=e),Array.isArray(t)?t:[t,t]},add(t,e){return[t[0]+e[0],t[1]+e[1]]},sub(t,e){return[t[0]-e[0],t[1]-e[1]]},addTo(t,e){t[0]+=e[0],t[1]+=e[1]},subTo(t,e){t[0]-=e[0],t[1]-=e[1]}};function fN(t,e,n){return e===0||Math.abs(e)===1/0?Math.pow(t,n*5):t*e*n/(e+n*t)}function pN(t,e,n,r=.15){return r===0?Doe(t,e,n):t<e?-fN(e-t,n-e,r)+e:t>n?+fN(t-n,n-e,r)+n:t}function Roe(t,[e,n],[r,i]){const[[s,o],[a,l]]=t;return[pN(e,s,o,r),pN(n,a,l,i)]}function joe(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Loe(t){var e=joe(t,"string");return typeof e=="symbol"?e:String(e)}function _i(t,e,n){return e=Loe(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function gN(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Rn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?gN(Object(n),!0).forEach(function(r){_i(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gN(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const PH={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function mN(t){return t?t[0].toUpperCase()+t.slice(1):""}const Noe=["enter","leave"];function zoe(t=!1,e){return t&&!Noe.includes(e)}function Boe(t,e="",n=!1){const r=PH[t],i=r&&r[e]||e;return"on"+mN(t)+mN(i)+(zoe(n,i)?"Capture":"")}const Foe=["gotpointercapture","lostpointercapture"];function Uoe(t){let e=t.substring(2).toLowerCase();const n=!!~e.indexOf("passive");n&&(e=e.replace("passive",""));const r=Foe.includes(e)?"capturecapture":"capture",i=!!~e.indexOf(r);return i&&(e=e.replace("capture","")),{device:e,capture:i,passive:n}}function Hoe(t,e=""){const n=PH[t],r=n&&n[e]||e;return t+r}function IH(t){return"touches"in t}function $oe(t){return IH(t)?"touch":"pointerType"in t?t.pointerType:"mouse"}function Koe(t){return Array.from(t.touches).filter(e=>{var n,r;return e.target===t.currentTarget||((n=t.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,e.target))})}function uP(t,e){try{const n=e.clientX-t.clientX,r=e.clientY-t.clientY,i=(e.clientX+t.clientX)/2,s=(e.clientY+t.clientY)/2,o=Math.hypot(n,r);return{angle:-(Math.atan2(n,r)*180)/Math.PI,distance:o,origin:[i,s]}}catch{}return null}function Voe(t){return Koe(t).map(e=>e.identifier)}function yN(t,e){const[n,r]=Array.from(t.touches).filter(i=>e.includes(i.identifier));return uP(n,r)}const SN=40,bN=800;function kH(t){let{deltaX:e,deltaY:n,deltaMode:r}=t;return r===1?(e*=SN,n*=SN):r===2&&(e*=bN,n*=bN),[e,n]}function qoe(t){const e={};if("buttons"in t&&(e.buttons=t.buttons),"shiftKey"in t){const{shiftKey:n,altKey:r,metaKey:i,ctrlKey:s}=t;Object.assign(e,{shiftKey:n,altKey:r,metaKey:i,ctrlKey:s})}return e}function pv(t,...e){return typeof t=="function"?t(...e):t}function Goe(){}function Yoe(...t){return t.length===0?Goe:t.length===1?t[0]:function(){let e;for(const n of t)e=n.apply(this,arguments)||e;return e}}function vN(t,e){return Object.assign({},e,t||{})}const Woe=32;class MH{constructor(e,n,r){this.ctrl=e,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:n,ingKey:r,args:i}=this;n[r]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=i,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=e.target,n.currentTarget=e.currentTarget,n.lastOffset=r.from?pv(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=e.timeStamp)}computeValues(e){const n=this.state;n._values=e,n.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:n,config:r,shared:i}=this;n.args=this.args;let s=0;if(e&&(n.event=e,r.preventDefault&&e.cancelable&&n.event.preventDefault(),n.type=e.type,i.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,i.locked=!!document.pointerLockElement,Object.assign(i,qoe(e)),i.down=i.pressed=i.buttons%2===1||i.touches>0,s=e.timeStamp-n.timeStamp,n.timeStamp=e.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const A=n._delta.map(Math.abs);ci.addTo(n._distance,A)}this.axisIntent&&this.axisIntent(e);const[o,a]=n._movement,[l,u]=r.threshold,{_step:f,values:h}=n;if(r.hasCustomTransform?(f[0]===!1&&(f[0]=Math.abs(o)>=l&&h[0]),f[1]===!1&&(f[1]=Math.abs(a)>=u&&h[1])):(f[0]===!1&&(f[0]=Math.abs(o)>=l&&Math.sign(o)*l),f[1]===!1&&(f[1]=Math.abs(a)>=u&&Math.sign(a)*u)),n.intentional=f[0]!==!1||f[1]!==!1,!n.intentional)return;const g=[0,0];if(r.hasCustomTransform){const[A,O]=h;g[0]=f[0]!==!1?A-f[0]:0,g[1]=f[1]!==!1?O-f[1]:0}else g[0]=f[0]!==!1?o-f[0]:0,g[1]=f[1]!==!1?a-f[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(g);const m=n.offset,b=n._active&&!n._blocked||n.active;b&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=i[this.ingKey]=n._active,e&&(n.first&&("bounds"in r&&(n._bounds=pv(r.bounds,n)),this.setup&&this.setup()),n.movement=g,this.computeOffset()));const[w,x]=n.offset,[[v,C],[P,k]]=n._bounds;n.overflow=[w<v?-1:w>C?1:0,x<P?-1:x>k?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const M=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=Roe(n._bounds,n.offset,M),n.delta=ci.sub(n.offset,m),this.computeMovement(),b&&(!n.last||s>Woe)){n.delta=ci.sub(n.offset,m);const A=n.delta.map(Math.abs);ci.addTo(n.distance,A),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&s>0&&(n.velocity=[A[0]/s,A[1]/s],n.timeDelta=s)}}emit(){const e=this.state,n=this.shared,r=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!r.triggerAllEvents)return;const i=this.handler(Rn(Rn(Rn({},n),e),{},{[this.aliasKey]:e.values}));i!==void 0&&(e.memo=i)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function Xoe([t,e],n){const r=Math.abs(t),i=Math.abs(e);if(r>i&&r>n)return"x";if(i>r&&i>n)return"y"}class Zoe extends MH{constructor(...e){super(...e),_i(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=ci.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ci.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const n=this.state,r=this.config;if(!n.axis&&e){const i=typeof r.axisThreshold=="object"?r.axisThreshold[$oe(e)]:r.axisThreshold;n.axis=Xoe(n._movement,i)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const Joe=t=>t,xN=.15,AH={enabled(t=!0){return t},eventOptions(t,e,n){return Rn(Rn({},n.shared.eventOptions),t)},preventDefault(t=!1){return t},triggerAllEvents(t=!1){return t},rubberband(t=0){switch(t){case!0:return[xN,xN];case!1:return[0,0];default:return ci.toVector(t)}},from(t){if(typeof t=="function")return t;if(t!=null)return ci.toVector(t)},transform(t,e,n){const r=t||n.shared.transform;return this.hasCustomTransform=!!r,r||Joe},threshold(t){return ci.toVector(t,0)}},Qoe=0,ly=Rn(Rn({},AH),{},{axis(t,e,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(t=Qoe){return t},bounds(t={}){if(typeof t=="function")return s=>ly.bounds(t(s));if("current"in t)return()=>t.current;if(typeof HTMLElement=="function"&&t instanceof HTMLElement)return t;const{left:e=-1/0,right:n=1/0,top:r=-1/0,bottom:i=1/0}=t;return[[e,n],[r,i]]}}),cy=typeof window<"u"&&window.document&&window.document.createElement;function OH(){return cy&&"ontouchstart"in window}function eae(){return OH()||cy&&window.navigator.maxTouchPoints>1}function tae(){return cy&&"onpointerdown"in window}function nae(){return cy&&"exitPointerLock"in window.document}function rae(){try{return"constructor"in GestureEvent}catch{return!1}}const No={isBrowser:cy,gesture:rae(),touch:OH(),touchscreen:eae(),pointer:tae(),pointerLock:nae()},iae=250,sae=180,oae=.5,aae=50,lae=250,cae=10,wN={mouse:0,touch:0,pen:8};Rn(Rn({},ly),{},{device(t,e,{pointer:{touch:n=!1,lock:r=!1,mouse:i=!1}={}}){return this.pointerLock=r&&No.pointerLock,No.touch&&n?"touch":this.pointerLock?"mouse":No.pointer&&!i?"pointer":No.touch?"touch":"mouse"},preventScrollAxis(t,e,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&t?iae:void 0,!(!No.touchscreen||n===!1))return t||(n!==void 0?"y":void 0)},pointerCapture(t,e,{pointer:{capture:n=!0,buttons:r=1,keys:i=!0}={}}){return this.pointerButtons=r,this.keys=i,!this.pointerLock&&this.device==="pointer"&&n},threshold(t,e,{filterTaps:n=!1,tapsThreshold:r=3,axis:i=void 0}){const s=ci.toVector(t,n?r:i?1:0);return this.filterTaps=n,this.tapsThreshold=r,s},swipe({velocity:t=oae,distance:e=aae,duration:n=lae}={}){return{velocity:this.transform(ci.toVector(t)),distance:this.transform(ci.toVector(e)),duration:n}},delay(t=0){switch(t){case!0:return sae;case!1:return 0;default:return t}},axisThreshold(t){return t?Rn(Rn({},wN),t):wN},keyboardDisplacement(t=cae){return t}});function DH(t){const[e,n]=t.overflow,[r,i]=t._delta,[s,o]=t._direction;(e<0&&r>0&&s<0||e>0&&r<0&&s>0)&&(t._movement[0]=t._movementBound[0]),(n<0&&i>0&&o<0||n>0&&i<0&&o>0)&&(t._movement[1]=t._movementBound[1])}const uae=30,dae=100;class hae extends MH{constructor(...e){super(...e),_i(this,"ingKey","pinching"),_i(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:n,lastOffset:r}=this.state;e==="wheel"?this.state.offset=ci.add(n,r):this.state.offset=[(1+n[0])*r[0],n[1]+r[1]]}computeMovement(){const{offset:e,lastOffset:n}=this.state;this.state.movement=[e[0]/n[0],e[1]-n[1]]}axisIntent(){const e=this.state,[n,r]=e._movement;if(!e.axis){const i=Math.abs(n)*uae-Math.abs(r);i<0?e.axis="angle":i>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&(this.state.axis==="scale"?e[1]=0:this.state.axis==="angle"&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);const n=this.state,r=this.ctrl.touchIds;if(n._active&&n._touchIds.every(s=>r.has(s))||r.size<2)return;this.start(e),n._touchIds=Array.from(r).slice(0,2);const i=yN(e,n._touchIds);i&&this.pinchStart(e,i)}pointerStart(e){if(e.buttons!=null&&e.buttons%2!==1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const n=this.state,r=n._pointerEvents,i=this.ctrl.pointerIds;if(n._active&&Array.from(r.keys()).every(o=>i.has(o))||(r.size<2&&r.set(e.pointerId,e),n._pointerEvents.size<2))return;this.start(e);const s=uP(...Array.from(r.values()));s&&this.pinchStart(e,s)}pinchStart(e,n){const r=this.state;r.origin=n.origin,this.computeValues([n.distance,n.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const n=yN(e,this.state._touchIds);n&&this.pinchMove(e,n)}pointerMove(e){const n=this.state._pointerEvents;if(n.has(e.pointerId)&&n.set(e.pointerId,e),!this.state._active)return;const r=uP(...Array.from(n.values()));r&&this.pinchMove(e,r)}pinchMove(e,n){const r=this.state,i=r._values[1],s=n.angle-i;let o=0;Math.abs(s)>270&&(o+=Math.sign(s)),this.computeValues([n.distance,n.angle-360*o]),r.origin=n.origin,r.turns=o,r._movement=[r._values[0]/r._initial[0]-1,r._values[1]-r._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(n=>!this.ctrl.touchIds.has(n))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const n=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch{}n._pointerEvents.has(e.pointerId)&&n._pointerEvents.delete(e.pointerId),n._active&&n._pointerEvents.size<2&&(n._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const n=this.state;n._active||(this.start(e),this.computeValues([e.scale,e.rotation]),n.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const n=this.state;this.computeValues([e.scale,e.rotation]),n.origin=[e.clientX,e.clientY];const r=n._movement;n._movement=[e.scale-1,e.rotation],n._delta=ci.sub(n._movement,r),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const n=this.config.modifierKey;n&&(Array.isArray(n)?!n.find(r=>e[r]):!e[n])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const r=this.state;r._delta=[-kH(e)[1]/dae*r.offset[0],0],ci.addTo(r._movement,r._delta),DH(r),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const n=this.config.device;n&&(e(n,"start",this[n+"Start"].bind(this)),e(n,"change",this[n+"Move"].bind(this)),e(n,"end",this[n+"End"].bind(this)),e(n,"cancel",this[n+"End"].bind(this)),e("lostPointerCapture","",this[n+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}}const fae=Rn(Rn({},AH),{},{device(t,e,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!No.touch&&No.gesture)return"gesture";if(No.touch&&r)return"touch";if(No.touchscreen){if(No.pointer)return"pointer";if(No.touch)return"touch"}},bounds(t,e,{scaleBounds:n={},angleBounds:r={}}){const i=o=>{const a=vN(pv(n,o),{min:-1/0,max:1/0});return[a.min,a.max]},s=o=>{const a=vN(pv(r,o),{min:-1/0,max:1/0});return[a.min,a.max]};return typeof n!="function"&&typeof r!="function"?[i(),s()]:o=>[i(o),s(o)]},threshold(t,e,n){return this.lockDirection=n.axis==="lock",ci.toVector(t,this.lockDirection?[.1,3]:0)},modifierKey(t){return t===void 0?"ctrlKey":t},pinchOnWheel(t=!0){return t}});Rn(Rn({},ly),{},{mouseOnly:(t=!0)=>t});class pae extends Zoe{constructor(...e){super(...e),_i(this,"ingKey","wheeling")}wheel(e){this.state._active||this.start(e),this.wheelChange(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(e){const n=this.state;n._delta=kH(e),ci.addTo(n._movement,n._delta),DH(n),this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("wheel","",this.wheel.bind(this))}}const gae=ly;Rn(Rn({},ly),{},{mouseOnly:(t=!0)=>t});const Dk=new Map,dP=new Map;function mae(t){Dk.set(t.key,t.engine),dP.set(t.key,t.resolver)}const yae={key:"pinch",engine:hae,resolver:fae},Sae={key:"wheel",engine:pae,resolver:gae};function bae(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function vae(t,e){if(t==null)return{};var n=bae(t,e),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)r=s[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}const xae={target(t){if(t)return()=>"current"in t?t.current:t},enabled(t=!0){return t},window(t=No.isBrowser?window:void 0){return t},eventOptions({passive:t=!0,capture:e=!1}={}){return{passive:t,capture:e}},transform(t){return t}},wae=["target","eventOptions","window","enabled","transform"];function jb(t={},e){const n={};for(const[r,i]of Object.entries(e))switch(typeof i){case"function":n[r]=i.call(n,t[r],r,t);break;case"object":n[r]=jb(t[r],i);break;case"boolean":i&&(n[r]=t[r]);break}return n}function Cae(t,e,n={}){const r=t,{target:i,eventOptions:s,window:o,enabled:a,transform:l}=r,u=vae(r,wae);if(n.shared=jb({target:i,eventOptions:s,window:o,enabled:a,transform:l},xae),e){const f=dP.get(e);n[e]=jb(Rn({shared:n.shared},u),f)}else for(const f in u){const h=dP.get(f);h&&(n[f]=jb(Rn({shared:n.shared},u[f]),h))}return n}class RH{constructor(e,n){_i(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=n}add(e,n,r,i,s){const o=this._listeners,a=Hoe(n,r),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=Rn(Rn({},l),s);e.addEventListener(a,i,u);const f=()=>{e.removeEventListener(a,i,u),o.delete(f)};return o.add(f),f}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class Tae{constructor(){_i(this,"_timeouts",new Map)}add(e,n,r=140,...i){this.remove(e),this._timeouts.set(e,window.setTimeout(n,r,...i))}remove(e){const n=this._timeouts.get(e);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(e=>{window.clearTimeout(e)}),this._timeouts.clear()}}class Eae{constructor(e){_i(this,"gestures",new Set),_i(this,"_targetEventStore",new RH(this)),_i(this,"gestureEventStores",{}),_i(this,"gestureTimeoutStores",{}),_i(this,"handlers",{}),_i(this,"config",{}),_i(this,"pointerIds",new Set),_i(this,"touchIds",new Set),_i(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),_ae(this,e)}setEventIds(e){if(IH(e))return this.touchIds=new Set(Voe(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,n){this.handlers=e,this.nativeHandlers=n}applyConfig(e,n){this.config=Cae(e,n,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const n=this.config.shared,r={};let i;if(!(n.target&&(i=n.target(),!i))){if(n.enabled){for(const o of this.gestures){const a=this.config[o],l=CN(r,a.eventOptions,!!i);if(a.enabled){const u=Dk.get(o);new u(this,e,o).bind(l)}}const s=CN(r,n.eventOptions,!!i);for(const o in this.nativeHandlers)s(o,"",a=>this.nativeHandlers[o](Rn(Rn({},this.state.shared),{},{event:a,args:e})),void 0,!0)}for(const s in r)r[s]=Yoe(...r[s]);if(!i)return r;for(const s in r){const{device:o,capture:a,passive:l}=Uoe(s);this._targetEventStore.add(i,o,"",r[s],{capture:a,passive:l})}}}}function Hh(t,e){t.gestures.add(e),t.gestureEventStores[e]=new RH(t,e),t.gestureTimeoutStores[e]=new Tae}function _ae(t,e){e.drag&&Hh(t,"drag"),e.wheel&&Hh(t,"wheel"),e.scroll&&Hh(t,"scroll"),e.move&&Hh(t,"move"),e.pinch&&Hh(t,"pinch"),e.hover&&Hh(t,"hover")}const CN=(t,e,n)=>(r,i,s,o={},a=!1)=>{var l,u;const f=(l=o.capture)!==null&&l!==void 0?l:e.capture,h=(u=o.passive)!==null&&u!==void 0?u:e.passive;let g=a?r:Boe(r,i,f);n&&h&&(g+="Passive"),t[g]=t[g]||[],t[g].push(s)},Pae=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function Iae(t){const e={},n={},r=new Set;for(let i in t)Pae.test(i)?(r.add(RegExp.lastMatch),n[i]=t[i]):e[i]=t[i];return[n,e,r]}function $h(t,e,n,r,i,s){if(!t.has(n)||!Dk.has(r))return;const o=n+"Start",a=n+"End",l=u=>{let f;return u.first&&o in e&&e[o](u),n in e&&(f=e[n](u)),u.last&&a in e&&e[a](u),f};i[r]=l,s[r]=s[r]||{}}function kae(t,e){const[n,r,i]=Iae(t),s={};return $h(i,n,"onDrag","drag",s,e),$h(i,n,"onWheel","wheel",s,e),$h(i,n,"onScroll","scroll",s,e),$h(i,n,"onPinch","pinch",s,e),$h(i,n,"onMove","move",s,e),$h(i,n,"onHover","hover",s,e),{handlers:s,config:e,nativeHandlers:r}}function Mae(t,e={},n,r){const i=qe.useMemo(()=>new Eae(t),[]);if(i.applyHandlers(t,r),i.applyConfig(e,n),qe.useEffect(i.effect.bind(i)),qe.useEffect(()=>i.clean.bind(i),[]),e.target===void 0)return i.bind.bind(i)}function Aae(t){return t.forEach(mae),function(n,r){const{handlers:i,nativeHandlers:s,config:o}=kae(n,r||{});return Mae(i,o,void 0,s)}}const TN=10,Oae=/Mac|iPod|iPhone|iPad/.test(typeof window>"u"?"node":window.navigator.platform);function jH(t){let{deltaY:e,deltaX:n}=t,r=0;return t.ctrlKey||t.altKey||t.metaKey?r=(Math.abs(e)>TN?TN*Math.sign(e):e)/100:t.shiftKey&&!Oae&&(n=e,e=0),{x:-n,y:-e,z:-r}}const Dae=Aae([Sae,yae]);let Kh;const Rae=t=>Kh===void 0?(Kh=t,!1):t-Kh>120&&t-Kh<160?(Kh=t,!0):(Kh=t,!1);function jae(t){const e=te(),n=E.useMemo(()=>{let r="not sure";const i=({event:b})=>{if(!e.getInstanceState().isFocused||(r="not sure",Rae(Date.now())))return;const w=e.getEditingShapeId();if(w){const C=e.getShape(w);if(C&&e.getShapeUtil(C).canScroll(C)&&e.getShapePageBounds(w)?.containsPoint(e.inputs.currentPagePoint))return}nt(b),b.stopPropagation();const x=jH(b);if(x.x===0&&x.y===0)return;const v={type:"wheel",name:"wheel",delta:x,point:new I(b.clientX,b.clientY),shiftKey:b.shiftKey,altKey:b.altKey,ctrlKey:b.metaKey||b.ctrlKey,metaKey:b.metaKey,accelKey:vn(b)};e.dispatch(v)};let s=1,o=1,a=0;const l=new I,u=new I,f=b=>{const w=t.current;r="not sure";const{event:x,origin:v,da:C}=b;x instanceof WheelEvent||(x.target===w||w?.contains(x.target))&&(u.x=v[0],u.y=v[1],l.x=v[0],l.y=v[1],s=C[0],o=e.getZoomLevel(),e.dispatch({type:"pinch",name:"pinch_start",point:{x:v[0],y:v[1],z:e.getZoomLevel()},delta:{x:0,y:0},shiftKey:x.shiftKey,altKey:x.altKey,ctrlKey:x.metaKey||x.ctrlKey,metaKey:x.metaKey,accelKey:vn(x)}))},h=b=>{if(b&&(r="zooming"),r==="zooming")return;const w=Math.abs(a-s),x=I.Dist(l,u);switch(r){case"not sure":{w>24?r="zooming":x>16&&(r="panning");break}case"panning":{w>64&&(r="zooming");break}}};return{onWheel:i,onPinchStart:f,onPinchEnd:b=>{const w=t.current,{event:x,origin:v,offset:C}=b;if(x instanceof WheelEvent||!(x.target===w||w?.contains(x.target)))return;const P=C[0]**e.getCameraOptions().zoomSpeed;r="not sure",e.timers.requestAnimationFrame(()=>{e.dispatch({type:"pinch",name:"pinch_end",point:{x:v[0],y:v[1],z:P},delta:{x:v[0],y:v[1]},shiftKey:x.shiftKey,altKey:x.altKey,ctrlKey:x.metaKey||x.ctrlKey,metaKey:x.metaKey,accelKey:vn(x)})})},onPinch:b=>{const w=t.current,{event:x,origin:v,offset:C,da:P}=b;if(x instanceof WheelEvent||!(x.target===w||w?.contains(x.target)))return;const k=b.type==="gesturechange"||b.type==="gestureend";a=P[0];const M=v[0]-u.x,A=v[1]-u.y;switch(u.x=v[0],u.y=v[1],h(k),r){case"zooming":{const O=C[0]**e.getCameraOptions().zoomSpeed;e.dispatch({type:"pinch",name:"pinch",point:{x:v[0],y:v[1],z:O},delta:{x:M,y:A},shiftKey:x.shiftKey,altKey:x.altKey,ctrlKey:x.metaKey||x.ctrlKey,metaKey:x.metaKey,accelKey:vn(x)});break}case"panning":{e.dispatch({type:"pinch",name:"pinch",point:{x:v[0],y:v[1],z:o},delta:{x:M,y:A},shiftKey:x.shiftKey,altKey:x.altKey,ctrlKey:x.metaKey||x.ctrlKey,metaKey:x.metaKey,accelKey:vn(x)});break}}}}},[e,t]);Dae(n,{target:t,eventOptions:{passive:!1},pinch:{from:()=>{const{zoomSpeed:r}=e.getCameraOptions();return[e.getZoomLevel()**(1/r),0]},scaleBounds:()=>{const r=e.getBaseZoom(),{zoomSteps:i,zoomSpeed:s}=e.getCameraOptions(),o=i[0]*r;return{max:(i[i.length-1]*r)**(1/s),min:o**(1/s)}}}})}function BE(t,e,n){const r=t.getShape(e),i=t.getShapeHandles(r);return{shape:r,handle:i.find(s=>s.id===n)}}function Lae(t,e){const n=te();return E.useMemo(()=>{const r=l=>{if(n.wasEventAlreadyHandled(l))return;const u=uv(l.currentTarget);Qm(u,l);const{shape:f,handle:h}=BE(n,t,e);h&&n.dispatch({type:"pointer",target:"handle",handle:h,shape:f,name:"pointer_down",...li(n,l)})};let i,s;return{onPointerDown:r,onPointerMove:l=>{if(n.wasEventAlreadyHandled(l)||l.clientX===i&&l.clientY===s)return;i=l.clientX,s=l.clientY;const{shape:u,handle:f}=BE(n,t,e);f&&n.dispatch({type:"pointer",target:"handle",handle:f,shape:u,name:"pointer_move",...li(n,l)})},onPointerUp:l=>{if(n.wasEventAlreadyHandled(l))return;const u=uv(l.currentTarget);ey(u,l);const{shape:f,handle:h}=BE(n,t,e);h&&n.dispatch({type:"pointer",target:"handle",handle:h,shape:f,name:"pointer_up",...li(n,l)})}}},[n,t,e])}function Nae(t){const e=te();E.useLayoutEffect(()=>{const n=RB(()=>{t.current&&e.updateViewportScreenBounds(t.current)},200,{trailing:!0}),r=e.timers.setInterval(n,1e3);window.addEventListener("resize",n);const i=new ResizeObserver(a=>{a[0].contentRect&&n()}),s=t.current;let o=null;return s&&(i.observe(s),o=zae(s),o.addEventListener("scroll",n)),()=>{clearInterval(r),window.removeEventListener("resize",n),i.disconnect(),o?.removeEventListener("scroll",n),n.cancel()}},[e,t])}const zae=t=>{let e=t.parentElement;for(;e;){if(e===document.body)return document;const{overflowY:n}=window.getComputedStyle(e);if(e.scrollHeight>e.clientHeight&&(n==="auto"||n==="scroll"||n==="overlay"))return e;e=e.parentElement}return document};function Bae(t=!0){const[e,n]=E.useState(0),r=te();E.useEffect(()=>{if(!t)return;const i=()=>n(s=>s+1);return r.on("tick",i),()=>{r.off("tick",i)}},[r,t])}const Fae=cr(function({showStroke:e=!0,showVertices:n=!0,showClosestPointOnOutline:r=!0}){const i=te();Bae(r);const s=i.getZoomLevel(),o=i.getRenderingShapes(),{inputs:{currentPagePoint:a}}=i;return y.jsx("svg",{style:{position:"absolute",pointerEvents:"none",zIndex:999999999,top:0,left:0,overflow:"visible"},children:o.map(l=>{const u=i.getShape(l.id);if(u.type==="group")return null;const f=i.getShapeGeometry(u),h=i.getShapePageTransform(u),g=i.getPointInShapeSpace(u,a),m=f.nearestPoint(g),b=f.distanceToPoint(g,!0),w=Math.abs(b)*s,x=b<0,{vertices:v}=f;return y.jsxs("g",{transform:h.toCssString(),strokeLinecap:"round",strokeLinejoin:"round",children:[e&&y.jsx("g",{stroke:f.debugColor??"red",opacity:"1",strokeWidth:2/s,fill:"none",children:y.jsx(LH,{geometry:f})}),n&&v.map((C,P)=>y.jsx("circle",{cx:C.x,cy:C.y,r:2/s,fill:`hsl(${ma(P,[0,v.length-1],[120,200])}, 100%, 50%)`,stroke:"black",strokeWidth:1/s},`v${P}`)),r&&w<150&&y.jsx("line",{x1:m.x,y1:m.y,x2:g.x,y2:g.y,opacity:1-w/150,stroke:x?"goldenrod":"dodgerblue",strokeWidth:2/s})]},l.id+"_outline")})})});function LH({geometry:t}){return t instanceof js?y.jsx("g",{stroke:t.debugColor,children:[...t.children,...t.ignoredChildren].map((e,n)=>y.jsx(LH,{geometry:e},n))}):y.jsx("path",{d:t.toSimpleSvgPath(),stroke:t.debugColor})}function NH(t){return UZ(t)}function zH(){const t=te(),e=UQ("userIds",()=>NH(t.getCollaborators().map(n=>n.userId)).sort(),{isEqual:(n,r)=>n.join(",")===r.join?.(",")},[t]);return ee(e)}function Zx(t){const e=te();return ee(`latestPresence:${t}`,()=>e.getCollaborators().find(r=>r.userId===t),[e,t])??null}const Uae=cr(function(){return zH().map(n=>y.jsx(Hae,{collaboratorId:n},n))}),Hae=cr(function({collaboratorId:e}){const n=te(),r=Zx(e),i=Kae(n,r);if(!(r&&r.currentPageId===n.getCurrentPageId()))return null;switch(i){case"inactive":{const{followingUserId:s,highlightedUserIds:o}=n.getInstanceState();if(!(s===r.userId||o.includes(r.userId)))return null;break}case"idle":{const{highlightedUserIds:s}=n.getInstanceState();if(r.followingUserId===n.user.getId()&&!(r.chatMessage||s.includes(r.userId)))return null;break}}return y.jsx($ae,{latestPresence:r})}),$ae=cr(function({latestPresence:e}){const n=te(),{CollaboratorBrush:r,CollaboratorScribble:i,CollaboratorCursor:s,CollaboratorHint:o,CollaboratorShapeIndicator:a}=on(),l=n.getZoomLevel(),u=n.getViewportPageBounds(),{userId:f,chatMessage:h,brush:g,scribbles:m,selectedShapeIds:b,userName:w,cursor:x,color:v}=e;if(!x)return null;const C=!(x.x<u.minX-12/l||x.y<u.minY-16/l||x.x>u.maxX-12/l||x.y>u.maxY-16/l);return y.jsxs(y.Fragment,{children:[g&&r?y.jsx(r,{className:"tl-collaborator__brush",userId:f,brush:g,color:v,opacity:.1},f+"_brush"):null,C&&s?y.jsx(s,{className:"tl-collaborator__cursor",userId:f,point:x,color:v,zoom:l,name:w!=="New User"?w:null,chatMessage:h??""},f+"_cursor"):o?y.jsx(o,{className:"tl-collaborator__cursor-hint",userId:f,point:x,color:v,zoom:l,viewport:u},f+"_cursor_hint"):null,i&&m.length?y.jsx(y.Fragment,{children:m.map(P=>y.jsx(i,{className:"tl-collaborator__scribble",userId:f,scribble:P,color:v,zoom:l,opacity:P.color==="laser"?.5:.1},f+"_scribble_"+P.id))}):null,a&&b.filter(P=>!n.isShapeHidden(P)).map(P=>y.jsx(a,{className:"tl-collaborator__shape-indicator",userId:f,shapeId:P,color:v,opacity:.5},f+"_"+P))]})});function EN(t,e){return e>t.options.collaboratorInactiveTimeoutMs?"inactive":e>t.options.collaboratorIdleTimeoutMs?"idle":"active"}function Kae(t,e){const n=E.useRef(e?.lastActivityTimestamp??-1),[r,i]=E.useState(()=>EN(t,Date.now()-n.current));return E.useEffect(()=>{const s=t.timers.setInterval(()=>{i(EN(t,Date.now()-n.current))},t.options.collaboratorCheckIntervalMs);return()=>clearInterval(s)},[t]),e&&(n.current=e.lastActivityTimestamp??1/0),r}function Vae(){const t=te(),e=ee("is menu open",()=>t.menus.hasAnyOpenMenus(),[t]),[n,r]=E.useState(!1),i=e||n,s=Nx(),o=E.useRef({isDown:!1,isDragging:!1,start:new I}),a=E.useCallback(h=>{h.button===0&&(r(!0),o.current={isDown:!0,isDragging:!1,start:new I(h.clientX,h.clientY)},l.current=!1),t.menus.clearOpenMenus()},[t]),l=E.useRef(!1),u=E.useCallback(h=>{if(!o.current.isDown)return;const{x:g,y:m}=o.current.start;l.current||I.Dist2(o.current.start,new I(h.clientX,h.clientY))>t.options.dragDistanceSquared&&(l.current=!0,o.current={...o.current,isDown:!0,isDragging:!0},s.onPointerDown?.({...h,clientX:g,clientY:m,button:0})),l.current&&t.dispatch({type:"pointer",target:"canvas",name:"pointer_move",...li(t,h)})},[s,t]),f=E.useCallback(h=>{s.onPointerUp?.(h),r(!1),o.current={isDown:!1,isDragging:!1,start:new I(h.clientX,h.clientY)},l.current=!1},[s]);return i&&y.jsx("div",{className:"tlui-menu-click-capture","data-testid":"menu-click-capture.content",...s,onPointerDown:a,onPointerMove:u,onPointerUp:f})}function qae({className:t}){const e=te(),{SelectionBackground:n,Background:r,SvgDefs:i,ShapeIndicators:s}=on(),o=E.useRef(null),a=E.useRef(null),l=E.useRef(null),u=ur();Nae(o),tne(),ene(),jae(o),Ooe(o);const f=E.useRef({lodDisableTextOutline:!1,allowTextOutline:!0});xd("position layers",function(){const{x:P,y:k,z:M}=e.getCamera();if(f.current.allowTextOutline&&Lt.isSafari&&(u.style.setProperty("--tl-text-outline","none"),f.current.allowTextOutline=!1),f.current.allowTextOutline&&M<e.options.textShadowLod!==f.current.lodDisableTextOutline){const R=M<e.options.textShadowLod;u.style.setProperty("--tl-text-outline",R?"none":"var(--tl-text-outline-reference)"),f.current.lodDisableTextOutline=R}const A=M>=1?ma(M,[1,8],[.125,.5],!0):ma(M,[.1,1],[-2,.125],!0),O=`scale(${J(M)}) translate(${J(P+A)}px,${J(k+A)}px)`;Ci(a.current,"transform",O),Ci(l.current,"transform",O)},[e,u]);const h=Nx(),g=ee("shapeSvgDefs",()=>{const C=new Map;for(const P of $n(e.shapeUtils)){if(!P)return;const k=P.getCanvasSvgDefs();for(const{key:M,component:A}of k)C.has(M)||C.set(M,y.jsx(A,{},M))}return[...C.values()]},[e]),m=ee("debug_shapes",()=>In.hideShapes.get(),[In]),b=ee("debug_svg",()=>In.debugSvg.get(),[In]),w=ee("debug_geometry",()=>In.debugGeometry.get(),[In]),x=ee("isEditingAnything",()=>e.getEditingShapeId()!==null,[e]),v=ee("isSelectingAnything",()=>!!e.getSelectedShapeIds().length,[e]);return y.jsxs(y.Fragment,{children:[y.jsxs("div",{ref:o,draggable:!1,"data-iseditinganything":x,"data-isselectinganything":v,className:Fe("tl-canvas",t),"data-testid":"canvas",...h,children:[y.jsx("svg",{className:"tl-svg-context","aria-hidden":"true",children:y.jsxs("defs",{children:[g,y.jsx(ale,{}),y.jsx(lle,{}),i&&y.jsx(i,{})]})}),r&&y.jsx("div",{className:"tl-background__wrapper",children:y.jsx(r,{})}),y.jsx(Yae,{}),y.jsxs("div",{ref:a,className:"tl-html-layer tl-shapes",draggable:!1,children:[y.jsx(hle,{}),n&&y.jsx(dle,{}),m?null:b?y.jsx(rle,{}):y.jsx(sle,{})]}),y.jsx("div",{className:"tl-overlays",children:y.jsxs("div",{ref:l,className:"tl-html-layer",children:[w?y.jsx(Fae,{}):null,y.jsx(Xae,{}),y.jsx(Wae,{}),y.jsx(Zae,{}),s&&y.jsx(s,{}),y.jsx(ole,{}),y.jsx(Jae,{}),y.jsx(ule,{}),y.jsx(Qae,{}),y.jsx(nle,{}),y.jsx(Uae,{})]})}),y.jsx(fle,{})]}),y.jsx("div",{className:"tl-canvas__in-front",onPointerDown:e.markEventAsHandled,onPointerUp:e.markEventAsHandled,onTouchStart:e.markEventAsHandled,onTouchEnd:e.markEventAsHandled,children:y.jsx(Gae,{})}),y.jsx(Vae,{})]})}function Gae(){const{InFrontOfTheCanvas:t}=on();return t?y.jsx(t,{}):null}function Yae(){const t=te(),e=ee("gridSize",()=>t.getDocumentSettings().gridSize,[t]),{x:n,y:r,z:i}=ee("camera",()=>t.getCamera(),[t]),s=ee("isGridMode",()=>t.getInstanceState().isGridMode,[t]),{Grid:o}=on();return o&&s?y.jsx(o,{x:n,y:r,z:i,size:e}):null}function Wae(){const t=te(),e=ee("scribbles",()=>t.getInstanceState().scribbles,[t]),n=ee("zoomLevel",()=>t.getZoomLevel(),[t]),{Scribble:r}=on();return r&&e.length?e.map(i=>y.jsx(r,{className:"tl-user-scribble",scribble:i,zoom:n},i.id)):null}function Xae(){const t=te(),e=ee("brush",()=>t.getInstanceState().brush,[t]),{Brush:n}=on();return n&&e?y.jsx(n,{className:"tl-user-brush",brush:e}):null}function Zae(){const t=te(),e=ee("zoomBrush",()=>t.getInstanceState().zoomBrush,[t]),{ZoomBrush:n}=on();return n&&e?y.jsx(n,{className:"tl-user-brush tl-zoom-brush",brush:e}):null}function Jae(){const t=te(),e=ee("snapLines",()=>t.snaps.getIndicators(),[t]),n=ee("zoomLevel",()=>t.getZoomLevel(),[t]),{SnapIndicator:r}=on();return r&&e.length>0?e.map(i=>y.jsx(r,{className:"tl-user-snapline",line:i,zoom:n},i.id)):null}function Qae(){const t=te(),e=ee("handles shapeIdWithHandles",()=>{const{isReadonly:n,isChangingStyle:r}=t.getInstanceState();if(n||r)return!1;const i=t.getOnlySelectedShape();return!i||!t.getShapeHandles(i)?!1:i.id},[t]);return e?y.jsx(ele,{shapeId:e}):null}function ele({shapeId:t}){const e=te(),{Handles:n}=on(),r=ee("zoomLevel",()=>e.getZoomLevel(),[e]),i=ee("coarse pointer",()=>e.getInstanceState().isCoarsePointer,[e]),s=ee("handles transform",()=>e.getShapePageTransform(t),[e,t]),o=ee("handles",()=>{const l=e.getShapeHandles(t);if(!l)return null;const u=(i?e.options.coarseHandleRadius:e.options.handleRadius)/r*2;return l.filter(f=>f.type!=="virtual"||!l.some(h=>h!==f&&h.type==="vertex"&&I.Dist(f,h)<u)).sort(f=>f.type==="vertex"?1:-1)},[e,r,i,t]),a=ee("isHidden",()=>e.isShapeHidden(t),[e,t]);return!n||!o||!s||a?null:y.jsx(n,{children:y.jsx("g",{transform:ve.toCssString(s),children:o.map(l=>y.jsx(tle,{shapeId:t,handle:l,zoom:r,isCoarse:i},l.id))})})}function tle({shapeId:t,handle:e,zoom:n,isCoarse:r}){const i=Lae(t,e.id),{Handle:s}=on();return s?y.jsx("g",{role:"button","aria-label":e.label||"handle",transform:`translate(${e.x}, ${e.y})`,...i,children:y.jsx(s,{shapeId:t,handle:e,zoom:n,isCoarse:r})}):null}function nle(){const{Overlays:t}=on();return t?y.jsx("div",{className:"tl-custom-overlays tl-overlays__item",children:y.jsx(t,{})}):null}function rle(){const t=te();return ee("rendering shapes",()=>t.getRenderingShapes(),[t]).map(n=>y.jsxs(E.Fragment,{children:[y.jsx(E6,{...n}),y.jsx(cle,{id:n.id,mode:"iframe"})]},n.id+"_fragment"))}function ile(){const t=te(),e=E.useRef(new Set);return xd("reflow for culled shapes",()=>{const n=t.getCulledShapes();if(e.current.size===n.size&&[...n].every(i=>e.current.has(i)))return;e.current=n;const r=document.getElementsByClassName("tl-canvas");r.length!==0&&r[0].offsetHeight},[t]),null}function sle(){const t=te(),e=ee("rendering shapes",()=>t.getRenderingShapes(),[t]);return y.jsxs(y.Fragment,{children:[e.map(n=>y.jsx(E6,{...n},n.id+"_shape")),Lt.isSafari&&y.jsx(ile,{})]})}function ole(){const t=te(),{ShapeIndicator:e}=on(),n=ee("hinting shape ids",()=>CI(t.getHintingShapeIds()),[t]);return!n.length||!e?null:n.map(r=>y.jsx(e,{className:"tl-user-indicator__hint",shapeId:r},r+"_hinting"))}function ale(){return y.jsxs("g",{id:fa("cursor"),children:[y.jsxs("g",{fill:"rgba(0,0,0,.2)",transform:"translate(-11,-11)",children:[y.jsx("path",{d:"m12 24.4219v-16.015l11.591 11.619h-6.781l-.411.124z"}),y.jsx("path",{d:"m21.0845 25.0962-3.605 1.535-4.682-11.089 3.686-1.553z"})]}),y.jsxs("g",{fill:"white",transform:"translate(-12,-12)",children:[y.jsx("path",{d:"m12 24.4219v-16.015l11.591 11.619h-6.781l-.411.124z"}),y.jsx("path",{d:"m21.0845 25.0962-3.605 1.535-4.682-11.089 3.686-1.553z"})]}),y.jsxs("g",{fill:"currentColor",transform:"translate(-12,-12)",children:[y.jsx("path",{d:"m19.751 24.4155-1.844.774-3.1-7.374 1.841-.775z"}),y.jsx("path",{d:"m13 10.814v11.188l2.969-2.866.428-.139h4.768z"})]})]})}function lle(){const t=fa("cursor_hint");return y.jsx("path",{id:t,fill:"currentColor",d:"M -2,-5 2,0 -2,5 Z"})}function cle({id:t,mode:e}){const n=te(),[r,i]=E.useState(null),s=ee("is in root",()=>n.getShape(t)?.parentId===n.getCurrentPageId(),[n,t]);return E.useEffect(()=>{if(!s)return;let o=null;const a=Os("shape to svg",async()=>{const l=Math.random();o=l;const f=n.isShapeOfType(t,"frame")?0:10;let h=n.getShapePageBounds(t);if(!h)return;h=h.clone().expandBy(f);const g=await n.getSvgString([t],{padding:f});if(o!==l||!g)return;const m=`data:image/svg+xml;utf8,${encodeURIComponent(g.svg)}`;i({src:m,bounds:h})});return()=>{o=null,a()}},[n,t,s]),!s||!r?null:e==="iframe"?y.jsx("iframe",{src:r.src,width:r.bounds.width,height:r.bounds.height,referrerPolicy:"no-referrer",style:{position:"absolute",top:0,left:0,border:"none",transform:`translate(${r.bounds.x}px, ${r.bounds.maxY+12}px)`,outline:"1px solid black",maxWidth:"none"}}):y.jsx("img",{src:r.src,width:r.bounds.width,height:r.bounds.height,referrerPolicy:"no-referrer",style:{position:"absolute",top:0,left:0,transform:`translate(${r.bounds.x}px, ${r.bounds.maxY+12}px)`,outline:"1px solid black",maxWidth:"none"}})}function ule(){const t=te(),e=ee("selection rotation",function(){return t.getSelectionRotation()},[t]),n=ee("selection bounds",()=>t.getSelectionRotatedPageBounds(),[t]),{SelectionForeground:r}=on();return!n||!r?null:y.jsx(r,{bounds:n,rotation:e})}function dle(){const t=te(),e=ee("selection rotation",()=>t.getSelectionRotation(),[t]),n=ee("selection bounds",()=>t.getSelectionRotatedPageBounds(),[t]),{SelectionBackground:r}=on();return!n||!r?null:y.jsx(r,{bounds:n,rotation:e})}function hle(){const{OnTheCanvas:t}=on();return t?y.jsx(t,{}):null}function fle(){const t=te(),e=ee("camera state",()=>t.getCameraState(),[t]);return y.jsx("div",{className:Fe("tl-hit-test-blocker",{"tl-hit-test-blocker__hidden":e==="idle"})})}function ou({children:t,className:e="",...n}){return y.jsx("div",{...n,className:Fe("tl-html-container",e),children:t})}class ple{constructor(e){this.editor=e}static props;static migrations;static type}function Jx(t,e,n={}){const{newPoint:r,handle:i,scaleX:s,scaleY:o}=e,{minWidth:a=1,maxWidth:l=1/0,minHeight:u=1,maxHeight:f=1/0}=n;let h=t.props.w*s,g=t.props.h*o;const m=new I(0,0);if(h>0){if(h<a){switch(i){case"top_left":case"left":case"bottom_left":{m.x=h-a;break}case"top":case"bottom":{m.x=(h-a)/2;break}default:m.x=0}h=a}}else if(m.x=h,h=-h,h<a){switch(i){case"top_left":case"left":case"bottom_left":{m.x=-h;break}default:m.x=-a}h=a}if(g>0){if(g<u){switch(i){case"top_left":case"top":case"top_right":{m.y=g-u;break}case"right":case"left":{m.y=(g-u)/2;break}default:m.y=0}g=u}}else if(m.y=g,g=-g,g<u){switch(i){case"top_left":case"top":case"top_right":{m.y=-g;break}default:m.y=-u}g=u}const{x:b,y:w}=m.rot(t.rotation).add(r);return{...t,x:b,y:w,props:{w:Math.min(l,h),h:Math.min(f,g)}}}class np extends Au{getGeometry(e){return new ya({width:e.props.w,height:e.props.h,isFilled:!0})}onResize(e,n){return Jx(e,n)}getHandleSnapGeometry(e){return{points:this.getGeometry(e).bounds.cornersAndCenter}}getInterpolatedProps(e,n,r){return{...n.props,w:lt(e.props.w,n.props.w,r),h:lt(e.props.h,n.props.h,r)}}}function BH(t,{initialBounds:e,scaleX:n,scaleY:r,newPoint:i,handle:s}){let o;switch(s){case"bottom_left":case"bottom_right":case"top_left":case"top_right":{o=Math.max(.01,Math.max(Math.abs(n),Math.abs(r)));break}case"left":case"right":{o=Math.max(.01,Math.abs(n));break}case"bottom":case"top":{o=Math.max(.01,Math.abs(r));break}default:throw kt(s)}const a=new I(0,0);n<0&&(a.x=-(e.width*o)),r<0&&(a.y=-(e.height*o));const{x:l,y:u}=I.Add(i,a.rot(t.rotation));return{x:l,y:u,props:{scale:o*t.props.scale}}}let gle=class extends Ve{static id="idle";onPointerDown(e){this.parent.transition("pointing",e)}onEnter(){this.editor.setCursor({type:"cross",rotation:0})}onCancel(){this.editor.setCurrentTool("select")}},mle=class extends Ve{static id="pointing";onPointerMove(e){const{editor:n}=this;if(n.inputs.isDragging){const{originPagePoint:r}=n.inputs,i=this.parent.shapeType,s=sn(),o=n.markHistoryStoppingPoint(`creating_box:${s}`),a=co(r,n);if(this.editor.createShapes([{id:s,type:i,x:a.x,y:a.y,props:{w:1,h:1}}]),!n.getShape(s)){this.cancel();return}n.select(s);const u=this.parent;this.editor.setCurrentTool("select.resizing",{...e,target:"selection",handle:"bottom_right",isCreating:!0,creatingMarkId:o,creationCursorOffset:{x:1,y:1},onInteractionEnd:this.parent.id,onCreate:u.onCreate?f=>u.onCreate?.(f):void 0})}}onPointerUp(){this.complete()}onCancel(){this.cancel()}onComplete(){this.complete()}onInterrupt(){this.cancel()}complete(){const{originPagePoint:e}=this.editor.inputs,n=this.parent.shapeType,r=sn();this.editor.markHistoryStoppingPoint(`creating_box:${r}`),this.editor.createShapes([{id:r,type:n,x:e.x,y:e.y}]);const i=this.editor.getShape(r);if(!i){this.cancel();return}let{w:s,h:o}=i.props;const a=new I(s/2,o/2),l=this.editor.getShapeParentTransform(i);l&&a.rot(-l.rotation());let u=1;this.editor.user.getIsDynamicResizeMode()&&(u=1/this.editor.getZoomLevel(),s*=u,o*=u,a.mul(u));const f=nr(i),h=co(new I(i.x-a.x,i.y-a.y),this.editor);f.x=h.x,f.y=h.y,f.props.w=s,f.props.h=o,"scale"in i.props&&(f.props.scale=u),this.editor.updateShape(f),this.editor.setSelectedShapes([r]),this.editor.getInstanceState().isToolLocked?this.parent.transition("idle"):this.editor.setCurrentTool("select.idle")}cancel(){this.parent.transition("idle")}};function co(t,e){const n=e.getInstanceState().isGridMode,r=e.getDocumentSettings().gridSize;return n?t.clone().snapToGrid(r):t.clone()}class yle extends Ve{static id="box";static initial="idle";static children(){return[gle,mle]}}function Sle(t,e,n){const r=E.useRef(!1),i=E.useCallback(o=>{r.current=o,o?Gi.addOpenMenu(t):Gi.deleteOpenMenu(t),e?.(o)},[t,e]),s=ee("is menu open",()=>Gi.getOpenMenus().includes(t),[t]);return E.useEffect(()=>(r.current&&(n?.("open-menu"),Gi.addOpenMenu(t)),()=>{r.current&&(Gi.deleteOpenMenu(t),Gi.getOpenMenus().forEach(o=>{o.startsWith(t)&&(n?.("close-menu"),Gi.deleteOpenMenu(o))}),r.current=!1)}),[t,n]),[s,i]}function uy(t){const e=te();return ee("isEditing",()=>e.getEditingShapeId()===t,[e,t])}function ble(t){if(!t)throw Error("usePassThroughWheelEvents must be passed a ref");const e=ur(),n=Gn();E.useEffect(()=>{function r(s){if(!n?.getInstanceState().isFocused||s.isSpecialRedispatchedEvent)return;nt(s);const o=e.querySelector(".tl-canvas");if(!o)return;const a=new PointerEvent(s.type,s);a.isSpecialRedispatchedEvent=!0,o.dispatchEvent(a)}const i=t.current;if(i)return i.addEventListener("mouseover",r,{passive:!1}),()=>{i.removeEventListener("mouseover",r)}},[e,n,t])}function Ra(t){const e=te();return E.useMemo(function(){const i=u=>{if(e.wasEventAlreadyHandled(u))return;if(u.button===fk){e.dispatch({type:"pointer",target:"selection",handle:t,name:"right_click",...li(e,u)});return}if(u.button!==0)return;const f=uv(u.currentTarget);function h(){f.removeEventListener("pointerup",h),ey(f,u)}Qm(f,u),f.addEventListener("pointerup",h),e.dispatch({name:"pointer_down",type:"pointer",target:"selection",handle:t,...li(e,u)}),e.markEventAsHandled(u)};let s,o;function a(u){e.wasEventAlreadyHandled(u)||u.button===0&&(u.clientX===s&&u.clientY===o||(s=u.clientX,o=u.clientY,e.dispatch({name:"pointer_move",type:"pointer",target:"selection",handle:t,...li(e,u)})))}return{onPointerDown:i,onPointerMove:a,onPointerUp:u=>{e.wasEventAlreadyHandled(u)||u.button===0&&e.dispatch({name:"pointer_up",type:"pointer",target:"selection",handle:t,...li(e,u)})}}},[e,t])}function vle(t){const[e,n]=E.useState(()=>({store:gm(t),opts:t}));if(!$B(e.opts,t)){const r={store:gm(t),opts:t};return n(r),r.store}return e.store}const xle=20,wle=8;function Qx(t,e=xle){return Math.max(wle,Math.ceil(t/e))}class FH extends Mu{_center;_radius;_start;_end;_largeArcFlag;_sweepFlag;_measure;_angleStart;_angleEnd;constructor(e){super({...e,isFilled:!1,isClosed:!1});const{center:n,sweepFlag:r,largeArcFlag:i,start:s,end:o}=e;if(s.equals(o))throw Error("Arc must have different start and end points.");this._angleStart=I.Angle(n,s),this._angleEnd=I.Angle(n,o),this._radius=I.Dist(n,s),this._measure=Kte(this._angleStart,this._angleEnd,r,i),this._start=s,this._end=o,this._sweepFlag=r,this._largeArcFlag=i,this._center=n}nearestPoint(e){const{_center:n,_measure:r,_radius:i,_angleEnd:s,_angleStart:o,_start:a,_end:l}=this,u=P3(r,o,s,n.angle(e));if(u<=0)return a;if(u>=1)return l;const f=I.Sub(e,n).uni().mul(i).add(n);let h,g=1/0,m;for(const b of[a,l,f])m=I.Dist2(e,b),m<g&&(h=b,g=m);if(!h)throw Error("nearest point not found");return h}hitTestLineSegment(e,n){const{_center:r,_radius:i,_measure:s,_angleStart:o,_angleEnd:a}=this,l=ny(e,n,r,i);return l===null?!1:l.some(u=>{const f=P3(s,o,a,r.angle(u));return f>=0&&f<=1})}getVertices(){const{_center:e,_measure:n,length:r,_radius:i,_angleStart:s}=this,o=[];for(let a=0,l=Qx(Math.abs(r));a<l+1;a++){const u=a/l*n,f=s+u;o.push(hk(e,i,f))}return o}getSvgPathData(e=!0){const{_start:n,_end:r,_radius:i,_largeArcFlag:s,_sweepFlag:o}=this;return`${e?`M${n.toFixed()}`:""} A${i} ${i} 0 ${s} ${o} ${r.toFixed()}`}getLength(){return Math.abs(this._measure*this._radius)}}class gv extends Mu{constructor(e){super({isClosed:!0,...e}),this.config=e;const{x:n=0,y:r=0,radius:i}=e;this._x=n,this._y=r,this._center=new I(i+n,i+r),this._radius=i}_center;_radius;_x;_y;getBounds(){return new we(this._x,this._y,this._radius*2,this._radius*2)}getVertices(){const{_center:e,_radius:n}=this,r=hn*n,i=[];for(let s=0,o=Qx(r);s<o;s++){const a=s/o*hn;i.push(hk(e,n,a))}return i}nearestPoint(e){const{_center:n,_radius:r}=this;return n.equals(e)?I.AddXY(n,r,0):I.Sub(e,n).uni().mul(r).add(n)}hitTestLineSegment(e,n,r=0){const{_center:i,_radius:s}=this;return ny(e,n,i,s+r)!==null}getSvgPathData(){const{_center:e,_radius:n}=this;return`M${e.x+n},${e.y} a${n},${n} 0 1,0 ${n*2},0a${n},${n} 0 1,0 -${n*2},0`}}class Rk extends ry{_a;_b;_c;_d;_resolution;constructor(e){const{start:n,cp1:r,cp2:i,end:s}=e;super({...e,points:[n,s]}),this._a=n,this._b=r,this._c=i,this._d=s,this._resolution=e.resolution??10}getVertices(){const e=[],{_a:n,_b:r,_c:i,_d:s}=this;for(let o=0,a=this._resolution;o<=a;o++){const l=o/a;e.push(new I((1-l)*(1-l)*(1-l)*n.x+3*((1-l)*(1-l))*l*r.x+3*(1-l)*(l*l)*i.x+l*l*l*s.x,(1-l)*(1-l)*(1-l)*n.y+3*((1-l)*(1-l))*l*r.y+3*(1-l)*(l*l)*i.y+l*l*l*s.y))}return e}nearestPoint(e){let n,r=1/0,i,s;for(const o of this.segments)s=o.nearestPoint(e),i=I.Dist2(s,e),i<r&&(n=s,r=i);if(!n)throw Error("nearest point not found");return n}getSvgPathData(e=!0){const{_a:n,_b:r,_c:i,_d:s}=this;return`${e?`M ${n.toFixed()} `:""} C${r.toFixed()} ${i.toFixed()} ${s.toFixed()}`}static GetAtT(e,n){const{_a:r,_b:i,_c:s,_d:o}=e;return new I((1-n)*(1-n)*(1-n)*r.x+3*((1-n)*(1-n))*n*i.x+3*(1-n)*(n*n)*s.x+n*n*n*o.x,(1-n)*(1-n)*(1-n)*r.y+3*((1-n)*(1-n))*n*i.y+3*(1-n)*(n*n)*s.y+n*n*n*o.y)}getLength(e,n=32){let r,i=this._a,s=0;for(let o=1;o<=n;o++)r=Rk.GetAtT(this,o/n),s+=I.Dist(i,r),i=r;return s}}class Cle extends Mu{constructor(e){super({...e,isClosed:!0}),this.config=e;const{width:n,height:r}=e;this._w=n,this._h=r}_w;_h;_edges;get edges(){if(!this._edges){const{vertices:e}=this;this._edges=[];for(let n=0,r=e.length;n<r;n++){const i=e[n],s=e[(n+1)%r];this._edges.push(new Df({start:i,end:s}))}}return this._edges}getVertices(){const e=Math.max(1,this._w),n=Math.max(1,this._h),r=e/2,i=n/2,s=Math.pow(r-i,2)/Math.pow(r+i,2),o=Ut*(r+i)*(1+3*s/(10+Math.sqrt(4-3*s))),a=Qx(o),l=hn/a,u=Math.cos(l),f=Math.sin(l);let h=0,g=1,m=0,b=1;const w=Array(a);for(let x=0;x<a;x++)w[x]=new I(it(r+r*g,0,e),it(i+i*h,0,n)),m=f*g+u*h,b=u*g-f*h,h=m,g=b;return w}nearestPoint(e){let n,r=1/0,i,s;for(const o of this.edges)s=o.nearestPoint(e),i=I.Dist2(s,e),i<r&&(n=s,r=i);if(!n)throw Error("nearest point not found");return n}hitTestLineSegment(e,n){return this.edges.some(r=>r.hitTestLineSegment(e,n))}getBounds(){return new we(0,0,this._w,this._h)}getLength(){const{_w:e,_h:n}=this,r=e/2,i=n/2,s=Math.max(0,r),o=Math.max(0,i);return Fte(s,o)}getSvgPathData(e=!1){const{_w:n,_h:r}=this,i=n/2,s=r/2,o=Math.max(0,i),a=Math.max(0,s);return`${e?`M${i-o},${s}`:""} a${o},${a},0,1,1,${o*2},0a${o},${a},0,1,1,-${o*2},0`}}function Xt(t,e,n){const r=new Set;for(const a of e){const l=t.getShape(a);if(!l)continue;r.add(l);const u=t.getShape(l.parentId);u&&r.add(u)}const i=new Map;for(const a of r){const l=t.getSortedChildIdsForParent(a);if(n?.filter&&!n.filter(a))i.set(a,l);else{const u=Tle(t,a.id,l);u.length<l.length&&i.set(a,l.filter(f=>!u.includes(f)))}}const s=t.getCurrentPageShapesSorted().map(a=>a.id),o={};for(const[a,l]of i){const u=tt(l.map(g=>t.getShape(g))),{reparenting:f,remainingShapesToReparent:h}=Ele(t,u,(g,m)=>n?.filter&&!n.filter(m)?!1:m.id!==a.id&&s.indexOf(m.id)<s.indexOf(g.id));if(f.forEach((g,m)=>{g.length!==0&&(o[m]||(o[m]={parentId:m,shapeIds:[]}),o[m].shapeIds.push(...g.map(b=>b.id)))}),h.size>0){const g=t.findShapeAncestor(a,m=>t.isShapeOfType(m,"group"))?.id??t.getCurrentPageId();h.forEach(m=>{if(!o[g]){let b;const w=t.getSortedChildIdsForParent(g),x=w.indexOf(a.id);if(x>-1){const v=w[x+1],C=v?t.getShape(v).index:Bo(a.index);b=kf(a.index,C)}o[g]={parentId:g,shapeIds:[],index:b}}o[g].shapeIds.push(m.id)})}}t.run(()=>{Object.values(o).forEach(({parentId:a,shapeIds:l,index:u})=>{l.length!==0&&(l.sort((f,h)=>s.indexOf(f)<s.indexOf(h)?-1:1),t.reparentShapes(l,a,u))})})}function Tle(t,e,n){if(n.length===0)return qn;const r=t.getShapePageBounds(e);if(!r)return qn;const i=t.getShapeGeometry(e),o=t.getShapePageTransform(e).applyToPoints(i.vertices),a=t.getShape(e);if(!a)return qn;const l=t.getShapePageTransform(e),u=t.getShapeUtil(a.type).getClipPath?.(a),f=u?l.applyToPoints(u):void 0,h=f?hv(f,o):o;return h?n.filter(g=>{const m=t.getShapePageBounds(g);if(!m||!r.includes(m))return!1;const b=t.getShapePageTransform(g).clone().invert().applyToPoints(h);return t.getShapeGeometry(g).overlapsPolygon(b)}):qn}function Ele(t,e,n){const r=new Set(e),i=new Set;for(const u of e){const f=t.getShapeParent(u);f&&t.isShapeOfType(f,"group")&&(i.has(f)||i.add(f))}for(const u of i){const f=tt(t.getSortedChildIdsForParent(u).map(h=>t.getShape(h)));for(const h of f)r.delete(h);r.add(u)}const s=new Map,o=new Map,a=new Set(r),l=t.getCurrentPageShapesSorted().filter(u=>t.getShapeUtil(u).canReceiveNewChildrenOfType?.(u,u.type)&&!a.has(u));e:for(let u=l.length-1;u>=0;u--){const f=l[u],h=t.findShapeAncestor(f,C=>t.isShapeOfType(C,"group"))?.id,g=t.getShapeGeometry(f),m=t.getShapePageTransform(f),b=t.getShapeMask(f),w=m.applyToPoints(g.vertices),x=b?hv(b,w):w;if(!x)continue e;const v=[];t:for(const C of a){if(f.id===C.id||n&&!n(C,f)||(s.has(C.id)||s.set(C.id,t.findShapeAncestor(C,M=>t.isShapeOfType(M,"group"))?.id),s.get(C.id)!==h)||t.findShapeAncestor(f,M=>C.id===M.id))continue t;const k=t.getShapePageTransform(C).clone().invert().applyToPoints(x);if(t.getShapeGeometry(C).overlapsPolygon(k)){if(!t.getShapeUtil(f).canReceiveNewChildrenOfType?.(f,C.type))continue t;C.parentId!==f.id&&v.push(C),a.delete(C);continue t}}v.length&&o.set(f.id,v)}return{reparenting:o,remainingShapesToReparent:a}}function ei(t){this.content=t}ei.prototype={constructor:ei,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new ei(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new ei(n)},addToStart:function(t,e){return new ei([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new ei(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new ei(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=ei.from(t),t.size?new ei(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=ei.from(t),t.size?new ei(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=ei.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}};ei.from=function(t){if(t instanceof ei)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new ei(e)};function UH(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)n++;return n}if(i.content.size||s.content.size){let o=UH(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function HH(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let u=0,f=Math.min(o.text.length,a.text.length);for(;u<f&&o.text[o.text.length-u-1]==a.text[a.text.length-u-1];)u++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let u=HH(o.content,a.content,n-1,r-1);if(u)return u}n-=l,r-=l}}class Te{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,a=0;a<n;o++){let l=this.content[o],u=a+l.nodeSize;if(u>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let f=a+1;l.nodesBetween(Math.max(0,e-f),Math.min(l.content.size,n-f),r,i+f)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=u},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new Te(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new Te(r,i)}cutByIndex(e,n){return e==n?Te.empty:e==0&&n==this.content.length?this:new Te(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new Te(i,s)}addToStart(e){return new Te([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Te(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.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(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return UH(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return HH(this,e,n,r)}findIndex(e){if(e==0)return GS(0,e);if(e==this.size)return GS(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=e)return s==e?GS(n+1,s):GS(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return Te.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Te(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Te.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new Te(n||e,r)}static from(e){if(!e)return Te.empty;if(e instanceof Te)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Te([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Te.empty=new Te([],0);const FE={index:0,offset:0};function GS(t,e){return FE.index=t,FE.offset=e,FE}function mv(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!mv(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!mv(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let dn=class hP{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&mv(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return hP.none;if(e instanceof hP)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};dn.none=[];class yv extends Error{}class Le{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=KH(this.content,e+this.openStart,n);return r&&new Le(r,this.openStart,this.openEnd)}removeBetween(e,n){return new Le($H(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return Le.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Le(Te.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new Le(e,r,i)}}Le.empty=new Le(Te.empty,0,0);function $H(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy($H(s.content,e-i-1,n-i-1)))}function KH(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),o=t.maybeChild(i);if(s==e||o.isText)return r&&!r.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let a=KH(o.content,e-s-1,n,o);return a&&t.replaceChild(i,o.copy(a))}function _le(t,e,n){if(n.openStart>t.depth)throw new yv("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new yv("Inconsistent open depths");return VH(t,e,n,0)}function VH(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=VH(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,a=o.content;return md(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=Ple(n,t);return md(s,GH(t,o,a,e,r))}else return md(s,Sv(t,e,r))}function qH(t,e){if(!e.type.compatibleContent(t.type))throw new yv("Cannot join "+e.type.name+" onto "+t.type.name)}function fP(t,e,n){let r=t.node(n);return qH(r,e.node(n)),r}function gd(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Gg(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(gd(t.nodeAfter,r),s++));for(let a=s;a<o;a++)gd(i.child(a),r);e&&e.depth==n&&e.textOffset&&gd(e.nodeBefore,r)}function md(t,e){return t.type.checkContent(e),t.copy(e)}function GH(t,e,n,r,i){let s=t.depth>i&&fP(t,e,i+1),o=r.depth>i&&fP(n,r,i+1),a=[];return Gg(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(qH(s,o),gd(md(s,GH(t,e,n,r,i+1)),a)):(s&&gd(md(s,Sv(t,e,i+1)),a),Gg(e,n,i,a),o&&gd(md(o,Sv(n,r,i+1)),a)),Gg(r,null,i,a),new Te(a)}function Sv(t,e,n){let r=[];if(Gg(null,t,n,r),t.depth>n){let i=fP(t,e,n+1);gd(md(i,Sv(t,e,n+1)),r)}return Gg(e,null,n,r),new Te(r)}function Ple(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(Te.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class ym{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return dn.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new bv(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),u=s-l;if(r.push(o,a,i+l),!u||(o=o.child(a),o.isText))break;s=u-1,i+=l+1}return new ym(n,r,s)}static resolveCached(e,n){let r=_N.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else _N.set(e,r=new Ile);let i=r.elts[r.i]=ym.resolve(e,n);return r.i=(r.i+1)%kle,i}}class Ile{constructor(){this.elts=[],this.i=0}}const kle=12,_N=new WeakMap;class bv{constructor(e,n,r){this.$from=e,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 Mle=Object.create(null);let pa=class pP{constructor(e,n,r,i=dn.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||Te.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&mv(this.attrs,n||e.defaultAttrs||Mle)&&dn.sameSet(this.marks,r||dn.none)}copy(e=null){return e==this.content?this:new pP(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new pP(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return Le.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),a=i.start(o),u=i.node(o).content.cut(i.pos-a,s.pos-a);return new Le(u,i.depth-o,s.depth-o)}replace(e,n,r){return _le(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return ym.resolveCached(this,e)}resolveNoCache(e){return ym.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),YH(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=Te.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=dn.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!dn.sameSet(e,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 e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,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(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=Te.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};pa.prototype.text=void 0;class vv extends pa{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):YH(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new vv(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new vv(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function YH(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Id{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new Ale(e,n);if(r.next==null)return Id.empty;let i=WH(r);r.next&&r.err("Unexpected trailing text");let s=zle(Nle(i));return Ble(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!n||l.validEnd))return Te.from(a.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:f,next:h}=o.next[u];if(!(f.isText||f.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let g=s(h,a.concat(f));if(g)return g}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
163
163
  `)}}Id.empty=new Id(!0);class Ale{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function WH(t){let e=[];do e.push(Ole(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Ole(t){let e=[];do e.push(Dle(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Dle(t){let e=Lle(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=Rle(t,e);else break;return e}function PN(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Rle(t,e){let n=PN(t),r=n;return t.eat(",")&&(t.next!="}"?r=PN(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function jle(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function Lle(t){if(t.eat("(")){let e=WH(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=jle(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Nle(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let u={term:l,to:a};return e[o].push(u),u}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(s(u,a)),[]);if(o.type=="seq")for(let l=0;;l++){let u=s(o.exprs[l],a);if(l==o.exprs.length-1)return u;i(u,a=n())}else if(o.type=="star"){let l=n();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let u=0;u<o.min;u++){let f=n();i(s(o.expr,l),f),l=f}if(o.max==-1)i(s(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let f=n();r(l,f),i(s(o.expr,l),f),l=f}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function XH(t,e){return e-t}function IN(t,e){let n=[];return r(e),n.sort(XH);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&n.indexOf(l)==-1&&r(l)}}}function zle(t){let e=Object.create(null);return n(IN(t,0));function n(r){let i=[];r.forEach(o=>{t[o].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let f=0;f<i.length;f++)i[f][0]==a&&(u=i[f][1]);IN(t,l).forEach(f=>{u||i.push([a,u=[]]),u.indexOf(f)==-1&&u.push(f)})})});let s=e[r.join(",")]=new Id(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(XH);s.next.push({type:i[o][0],next:e[a.join(",")]||n(a)})}return s}}function Ble(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:u}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(u)==-1&&r.push(u)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function ZH(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function JH(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function QH(t,e,n,r){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function e9(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new Ule(t,r,e[r]);return n}let kN=class t9{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=e9(e,r.attrs),this.defaultAttrs=ZH(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Id.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:JH(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new pa(this,this.computeAttrs(e),Te.from(n),dn.setFrom(r))}createChecked(e=null,n,r){return n=Te.from(n),this.checkContent(n),new pa(this,this.computeAttrs(e),n,dn.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=Te.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(Te.empty,!0);return s?new pa(this,e,n.append(s),dn.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){QH(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:dn.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new t9(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Fle(t,e,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class Ule{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Fle(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class e0{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=e9(e,i.attrs),this.excluded=null;let s=ZH(this.attrs);this.instance=s?new dn(this,s):null}create(e=null){return!e&&this.instance?this.instance:new dn(this,JH(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new e0(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){QH(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class n9{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=ei.from(e.nodes),n.marks=ei.from(e.marks||{}),this.nodes=kN.compile(this.spec.nodes,this),this.marks=e0.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=Id.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?MN(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:MN(this,o.split(" "))}this.nodeFromJSON=i=>pa.fromJSON(this,i),this.markFromJSON=i=>dn.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof kN){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new vv(r,r.defaultAttrs,e,dn.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function MN(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function Hle(t){return t.tag!=null}function $le(t){return t.style!=null}let wf=class gP{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Hle(i))this.tags.push(i);else if($le(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new ON(this,n,!1);return r.addAll(e,dn.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new ON(this,n,!0);return r.addAll(e,dn.none,n.from,n.to),Le.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(qle(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=DN(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=DN(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new gP(e,gP.schemaRules(e)))}};const r9={address:!0,article:!0,aside:!0,blockquote:!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},Kle={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},i9={ol:!0,ul:!0},Sm=1,mP=2,Yg=4;function AN(t,e,n){return e!=null?(e?Sm:0)|(e==="full"?mP:0):t&&t.whitespace=="pre"?Sm|mP:n&~Yg}class YS{constructor(e,n,r,i,s,o){this.type=e,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=dn.none,this.match=s||(o&Yg?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Te.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Sm)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=Te.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(Te.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!r9.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class ON{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=AN(null,n.preserveWhitespace,0)|(r?Yg:0);i?s=new YS(i.type,i.attrs,dn.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new YS(null,null,dn.none,!0,null,o):s=new YS(e.schema.topNodeType,null,dn.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let r=e.nodeValue,i=this.top,s=i.options&mP?"full":this.localPreserveWS||(i.options&Sm)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
164
164
  `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(o.text(a[l]),n,!/\S/.test(a[l]));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 a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;i9.hasOwnProperty(o)&&this.parser.normalizeLists&&Vle(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:Kle.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,f=this.needsBlock;if(r9.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),u=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let h=l&&l.skip?n:this.readStyles(e,n);h&&this.addAll(e,h),u&&this.sync(s),this.needsBlock=f}else{let u=this.readStyles(e,n);u&&this.addElementByRule(e,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
165
165
  `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(e,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(o,n.attrs||null,r,n.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[n.mark];r=r.concat(l.create(n.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,n,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,n);this.findAtPoint(e,s)}findPlace(e,n,r){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+a)&&(i=u,s=l,!u.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)n=this.enterInner(i[o],null,n,!1);return n}insertNode(e,n,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=dn.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):RN(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,n,r,i){let s=this.findPlace(e.create(n),r,!1);return s&&(s=this.enterInner(e,n,r,!0,i)),s}enterInner(e,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=AN(e,s,o.options);o.options&Yg&&o.content.length==0&&(a|=Yg);let l=dn.none;return r=r.filter(u=>(o.type?o.type.allowsMarkType(u.type):RN(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new YS(e,n,l,i,null,a)),this.open++,r}closeExtra(e=!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(e));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(e){for(let n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Sm)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let f=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!f||f.name!=u&&!f.isInGroup(u))return!1;l--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.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 Vle(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&i9.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function qle(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function DN(t){let e={};for(let n in t)e[n]=t[n];return e}function RN(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:f}=a.edge(l);if(u==e||s.indexOf(f)<0&&o(f))return!0}};if(o(i.contentMatch))return!0}}class Yd{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=UE(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(s[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],f=this.serializeMark(u,o.isInline,n);f&&(s.push([u,i]),i.appendChild(f.dom),i=f.contentDOM||f.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=Lb(UE(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Lb(UE(r),i(e,n),null,e.attrs)}static renderSpec(e,n,r=null,i){return Lb(e,n,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Yd(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=jN(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return jN(e.marks)}}function jN(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function UE(t){return t.document||window.document}const LN=new WeakMap;function Gle(t){let e=LN.get(t);return e===void 0&&LN.set(t,e=Yle(t)),e}function Yle(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(t),e}function Lb(t,e,n,r){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=Gle(r))&&s.indexOf(e)>-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 o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let a,l=n?t.createElementNS(n,i):t.createElement(i),u=e[1],f=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){f=2;for(let h in u)if(u[h]!=null){let g=h.indexOf(" ");g>0?l.setAttributeNS(h.slice(0,g),h.slice(g+1),u[h]):h=="style"&&l.style?l.style.cssText=u[h]:l.setAttribute(h,u[h])}}for(let h=f;h<e.length;h++){let g=e[h];if(g===0){if(h<e.length-1||h>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:m,contentDOM:b}=Lb(t,g,n,r);if(l.appendChild(m),b){if(a)throw new RangeError("Multiple content holes");a=b}}}return{dom:l,contentDOM:a}}const s9=65535,o9=Math.pow(2,16);function Wle(t,e){return t+e*o9}function NN(t){return t&s9}function Xle(t){return(t-(t&s9))/o9}const a9=1,l9=2,Nb=4,c9=8;class yP{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&c9)>0}get deletedBefore(){return(this.delInfo&(a9|Nb))>0}get deletedAfter(){return(this.delInfo&(l9|Nb))>0}get deletedAcross(){return(this.delInfo&Nb)>0}}class eo{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&eo.empty)return eo.empty}recover(e){let n=0,r=NN(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Xle(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+s],f=this.ranges[a+o],h=l+u;if(e<=h){let g=u?e==l?-1:e==h?1:n:n,m=l+i+(g<0?0:f);if(r)return m;let b=e==(n<0?l:h)?null:Wle(a/3,e-l),w=e==l?l9:e==h?a9:Nb;return(n<0?e!=l:e!=h)&&(w|=c9),new yP(m,w,b)}i+=f-u}return r?e+i:new yP(e+i,0,null)}touches(e,n){let r=0,i=NN(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+s],f=l+u;if(e<=f&&a==i*3)return!0;r+=this.ranges[a+o]-u}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),u=this.ranges[i+n],f=this.ranges[i+r];e(a,a+u,l,l+f),s+=f-u}}invert(){return new eo(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?eo.empty:new eo(e<0?[0,-e,0]:[0,0,e])}}eo.empty=new eo([]);class bm{constructor(e,n,r=0,i=e?e.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new bm(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,r=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new bm;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new yP(e,i,null)}}const HE=Object.create(null);class ji{getMap(){return eo.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=HE[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in HE)throw new RangeError("Duplicate use of step JSON ID "+e);return HE[e]=n,n.prototype.jsonID=e,n}}class vr{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new vr(e,null)}static fail(e){return new vr(null,e)}static fromReplace(e,n,r,i){try{return vr.ok(e.replace(n,r,i))}catch(s){if(s instanceof yv)return vr.fail(s.message);throw s}}}function jk(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(jk(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return Te.fromArray(r)}class nu extends ji{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new Le(jk(n.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return vr.fromReplace(e,this.from,this.to,s)}invert(){return new da(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new nu(n.pos,r.pos,this.mark)}merge(e){return e instanceof nu&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new nu(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new nu(n.from,n.to,e.markFromJSON(n.mark))}}ji.jsonID("addMark",nu);class da extends ji{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new Le(jk(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return vr.fromReplace(e,this.from,this.to,r)}invert(){return new nu(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new da(n.pos,r.pos,this.mark)}merge(e){return e instanceof da&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new da(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new da(n.from,n.to,e.markFromJSON(n.mark))}}ji.jsonID("removeMark",da);class ru extends ji{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return vr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return vr.fromReplace(e,this.pos,this.pos+1,new Le(Te.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new ru(this.pos,n.marks[i]);return new ru(this.pos,this.mark)}}return new kd(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new ru(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ru(n.pos,e.markFromJSON(n.mark))}}ji.jsonID("addNodeMark",ru);class kd extends ji{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return vr.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return vr.fromReplace(e,this.pos,this.pos+1,new Le(Te.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new ru(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new kd(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new kd(n.pos,e.markFromJSON(n.mark))}}ji.jsonID("removeNodeMark",kd);class jr extends ji{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&SP(e,this.from,this.to)?vr.fail("Structure replace would overwrite content"):vr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new eo([this.from,this.to-this.from,this.slice.size])}invert(e){return new jr(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new jr(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(e){if(!(e instanceof jr)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?Le.empty:new Le(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new jr(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?Le.empty:new Le(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new jr(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new jr(n.from,n.to,Le.fromJSON(e,n.slice),!!n.structure)}}ji.jsonID("replace",jr);class Fr extends ji{constructor(e,n,r,i,s,o,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(SP(e,this.from,this.gapFrom)||SP(e,this.gapTo,this.to)))return vr.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return vr.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?vr.fromReplace(e,this.from,this.to,r):vr.fail("Content does not fit in gap")}getMap(){return new eo([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Fr(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new Fr(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,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 Fr(n.from,n.to,n.gapFrom,n.gapTo,Le.fromJSON(e,n.slice),n.insert,!!n.structure)}}ji.jsonID("replaceAround",Fr);function SP(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Zle(t,e,n,r){let i=[],s=[],o,a;t.doc.nodesBetween(e,n,(l,u,f)=>{if(!l.isInline)return;let h=l.marks;if(!r.isInSet(h)&&f.type.allowsMarkType(r.type)){let g=Math.max(u,e),m=Math.min(u+l.nodeSize,n),b=r.addToSet(h);for(let w=0;w<h.length;w++)h[w].isInSet(b)||(o&&o.to==g&&o.mark.eq(h[w])?o.to=m:i.push(o=new da(g,m,h[w])));a&&a.to==g?a.to=m:s.push(a=new nu(g,m,r))}}),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function Jle(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof e0){let u=o.marks,f;for(;f=r.isInSet(u);)(l||(l=[])).push(f),u=f.removeFromSet(u)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let u=Math.min(a+o.nodeSize,n);for(let f=0;f<l.length;f++){let h=l[f],g;for(let m=0;m<i.length;m++){let b=i[m];b.step==s-1&&h.eq(i[m].style)&&(g=b)}g?(g.to=u,g.step=s):i.push({style:h,from:Math.max(a,e),to:u,step:s})}}}),i.forEach(o=>t.step(new da(o.from,o.to,o.style)))}function Lk(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let u=s.child(l),f=a+u.nodeSize,h=r.matchType(u.type);if(!h)o.push(new jr(a,f,Le.empty));else{r=h;for(let g=0;g<u.marks.length;g++)n.allowsMarkType(u.marks[g].type)||t.step(new da(a,f,u.marks[g]));if(i&&u.isText&&n.whitespace!="pre"){let g,m=/\r?\n|\r/g,b;for(;g=m.exec(u.text);)b||(b=new Le(Te.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),o.push(new jr(a+g.index,a+g.index+g[0].length,b))}}a=f}if(!r.validEnd){let l=r.fillBefore(Te.empty,!0);t.replace(a,a,new Le(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function Qle(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function rp(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth,i=0,s=0;;--r){let o=t.$from.node(r),a=t.$from.index(r)+i,l=t.$to.indexAfter(r)-s;if(r<t.depth&&o.canReplace(a,l,n))return r;if(r==0||o.type.spec.isolating||!Qle(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function ece(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,u=a,f=Te.empty,h=0;for(let b=s,w=!1;b>n;b--)w||r.index(b)>0?(w=!0,f=Te.from(r.node(b).copy(f)),h++):l--;let g=Te.empty,m=0;for(let b=s,w=!1;b>n;b--)w||i.after(b+1)<i.end(b)?(w=!0,g=Te.from(i.node(b).copy(g)),m++):u++;t.step(new Fr(l,u,o,a,new Le(f.append(g),h,m),f.size-h,!0))}function Nk(t,e,n=null,r=t){let i=tce(t,e),s=i&&nce(r,e);return s?i.map(zN).concat({type:e,attrs:n}).concat(s.map(zN)):null}function zN(t){return{type:t,attrs:null}}function tce(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function nce(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=r;l&&u<i;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:o}function rce(t,e,n){let r=Te.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Te.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new Fr(i,s,i,s,new Le(r,0,0),n.length,!0))}function ice(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&sce(t.doc,t.mapping.slice(s).map(a),r)){let u=null;if(r.schema.linebreakReplacement){let m=r.whitespace=="pre",b=!!r.contentMatch.matchType(r.schema.linebreakReplacement);m&&!b?u=!1:!m&&b&&(u=!0)}u===!1&&d9(t,o,a,s),Lk(t,t.mapping.slice(s).map(a,1),r,void 0,u===null);let f=t.mapping.slice(s),h=f.map(a,1),g=f.map(a+o.nodeSize,1);return t.step(new Fr(h,g,h+1,g-1,new Le(Te.from(r.create(l,null,o.marks)),0,0),1,!0)),u===!0&&u9(t,o,a,s),!1}})}function u9(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function d9(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
@@ -172,7 +172,7 @@ To remove the watermark, please purchase a license at tldraw.dev.
172
172
 
173
173
  `,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,i,(l,u,f,h)=>{var g;l.isBlock&&u>r&&(a+=s);const m=o?.[l.type.name];if(m)return f&&(a+=m({node:l,pos:u,parent:f,index:h,range:e})),!1;l.isText&&(a+=(g=l?.text)==null?void 0:g.slice(Math.max(r,u)-u,i-u))}),a}function w$(t,e){const n={from:0,to:t.content.size};return x$(t,n,e)}function nM(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function Fde(t,e,n){const{blockSeparator:r=`
174
174
 
175
- `,textSerializers:i={}}=n||{},s=d0(e),o=pa.fromJSON(s,t);return w$(o,{blockSeparator:r,textSerializers:{...nM(s),...i}})}function tc(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function C$(t,e){const n=tc(e,t.schema),{from:r,to:i,empty:s}=t.selection,o=[];s?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function xr(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Ude(t,e){const n=xr(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function h0(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function T$(t,e){const n=h0(typeof e=="string"?e:e.name,t.schema);return n==="node"?Ude(t,e):n==="mark"?C$(t,e):{}}function Hde(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function $de(t){const e=Hde(t);return e.length===1?e:e.filter((n,r)=>!e.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 E$(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=n[s];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const u=e.slice(s).map(a,-1),f=e.slice(s).map(l),h=e.invert().map(u,-1),g=e.invert().map(f);r.push({oldRange:{from:h,to:g},newRange:{from:u,to:f}})})}),$de(r)}function rM(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Iv(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:rM(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function _$(t,e,n={}){return t.find(r=>r.type===e&&Iv(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function P5(t,e,n={}){return!!_$(t,e,n)}function f0(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(f=>f.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(f=>f.type===e)||(n=n||((r=i.node.marks[0])==null?void 0:r.attrs),!_$([...i.node.marks],e,n)))return;let o=i.index,a=t.start()+i.offset,l=o+1,u=a+i.node.nodeSize;for(;o>0&&P5([...t.parent.child(o-1).marks],e,n);)o-=1,a-=t.parent.child(o).nodeSize;for(;l<t.parent.childCount&&P5([...t.parent.child(l).marks],e,n);)u+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:u}}function iM(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),o=f0(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,s)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}var Kde=(t,e,n,r=20)=>{const i=t.doc.resolve(n);let s=r,o=null;for(;s>0&&o===null;){const a=i.node(s);a?.type.name===e?o=a:s-=1}return[o,s]};function t_(t,e){return e.nodes[t]||e.marks[t]||null}function zb(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}var Vde=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,u;const f=((u=(l=i.type.spec).toText)==null?void 0:u.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?f:f.slice(0,Math.max(0,r-s))}),n};function MP(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?tc(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>s?s.name===h.type.name:!0).find(h=>Iv(h.attrs,n,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:h,$to:g})=>{const m=h.pos,b=g.pos;t.doc.nodesBetween(m,b,(w,x)=>{if(!w.isText&&!w.marks.length)return;const v=Math.max(m,x),C=Math.min(b,x+w.nodeSize),P=C-v;o+=P,a.push(...w.marks.map(k=>({mark:k,from:v,to:C})))})}),o===0)return!1;const l=a.filter(h=>s?s.name===h.mark.type.name:!0).filter(h=>Iv(h.mark.attrs,n,{strict:!1})).reduce((h,g)=>h+g.to-g.from,0),u=a.filter(h=>s?h.mark.type!==s&&h.mark.type.excludes(s):!0).reduce((h,g)=>h+g.to-g.from,0);return(l>0?l+u:l)>=o}function mu(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?xr(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(h,g)=>{if(h.isText)return;const m=Math.max(r,g),b=Math.min(i,g+h.nodeSize);a.push({node:h,from:m,to:b})});const l=i-r,u=a.filter(h=>o?o.name===h.node.type.name:!0).filter(h=>Iv(h.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((h,g)=>h+g.to-g.from,0)>=l}function qde(t,e,n={}){if(!e)return mu(t,null,n)||MP(t,null,n);const r=h0(e,t.schema);return r==="node"?mu(t,e,n):r==="mark"?MP(t,e,n):!1}var Gde=(t,e)=>{const{$from:n,$to:r,$anchor:i}=t.selection;if(e){const s=c0(a=>a.type.name===e)(t.selection);if(!s)return!1;const o=t.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Yde=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function I5(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function k5(t,e){const{nodeExtensions:n}=Em(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=Wt(Ye(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function p0(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(p0(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function P$(t){return t instanceof We}function I$(t){return t instanceof at}function ud(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function k$(t,e=null){if(!e)return null;const n=St.atStart(t),r=St.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?at.create(t,ud(0,i,s),ud(t.content.size,i,s)):at.create(t,ud(e,i,s),ud(e,i,s))}function Wde(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof jr||i instanceof Fr))return;const s=t.mapping.maps[r];let o=0;s.forEach((a,l,u,f)=>{o===0&&(o=f)}),t.setSelection(St.near(t.doc.resolve(o),n))}var g0=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},Xde=(t,e)=>{if(rM(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,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 XS(t){var e;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(e=u.nodeBefore||u.nodeAfter)!=null&&e.marks.find(g=>g.type.spec.code))return!1;let f=!1;const h=Vde(u)+s;return o.forEach(g=>{if(f)return;const m=Xde(h,g.find);if(!m)return;const b=l.state.tr,w=a0({state:l.state,transaction:b}),x={from:r-(m[0].length-s.length),to:i},{commands:v,chain:C,can:P}=new l0({editor:n,state:w});g.handler({state:w,range:x,match:m,commands:v,chain:C,can:P})===null||!b.steps.length||(g.undoable&&b.setMeta(a,{transform:b,from:r,to:i,text:s}),l.dispatch(b),f=!0)}),f}function Zde(t){const{editor:e,rules:n}=t,r=new Yn({state:{init(){return null},apply(i,s,o){const a=i.getMeta(r);if(a)return a;const l=i.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:f}=l;typeof f=="string"?f=f:f=u0(Te.from(f),o.schema);const{from:h}=l,g=h+f.length;XS({editor:e,from:h,to:g,text:f,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return XS({editor:e,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&XS({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?XS({editor:e,from:o.pos,to:o.pos,text:`
175
+ `,textSerializers:i={}}=n||{},s=d0(e),o=pa.fromJSON(s,t);return w$(o,{blockSeparator:r,textSerializers:{...nM(s),...i}})}function tc(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}function C$(t,e){const n=tc(e,t.schema),{from:r,to:i,empty:s}=t.selection,o=[];s?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function xr(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Ude(t,e){const n=xr(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function h0(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function T$(t,e){const n=h0(typeof e=="string"?e:e.name,t.schema);return n==="node"?Ude(t,e):n==="mark"?C$(t,e):{}}function Hde(t,e=JSON.stringify){const n={};return t.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function $de(t){const e=Hde(t);return e.length===1?e:e.filter((n,r)=>!e.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 E$(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((a,l)=>{o.push({from:a,to:l})});else{const{from:a,to:l}=n[s];if(a===void 0||l===void 0)return;o.push({from:a,to:l})}o.forEach(({from:a,to:l})=>{const u=e.slice(s).map(a,-1),f=e.slice(s).map(l),h=e.invert().map(u,-1),g=e.invert().map(f);r.push({oldRange:{from:h,to:g},newRange:{from:u,to:f}})})}),$de(r)}function rM(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Iv(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:rM(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function _$(t,e,n={}){return t.find(r=>r.type===e&&Iv(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function P5(t,e,n={}){return!!_$(t,e,n)}function f0(t,e,n){var r;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if((!i.node||!i.node.marks.some(f=>f.type===e))&&(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(f=>f.type===e)||(n=n||((r=i.node.marks[0])==null?void 0:r.attrs),!_$([...i.node.marks],e,n)))return;let o=i.index,a=t.start()+i.offset,l=o+1,u=a+i.node.nodeSize;for(;o>0&&P5([...t.parent.child(o-1).marks],e,n);)o-=1,a-=t.parent.child(o).nodeSize;for(;l<t.parent.childCount&&P5([...t.parent.child(l).marks],e,n);)u+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:u}}function iM(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t),o=f0(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,s)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}var Kde=(t,e,n,r=20)=>{const i=t.doc.resolve(n);let s=r,o=null;for(;s>0&&o===null;){const a=i.node(s);a?.type.name===e?o=a:s-=1}return[o,s]};function t_(t,e){return e.nodes[t]||e.marks[t]||null}function zb(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}var Vde=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,u;const f=((u=(l=i.type.spec).toText)==null?void 0:u.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?f:f.slice(0,Math.max(0,r-s))}),n};function MP(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?tc(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>s?s.name===h.type.name:!0).find(h=>Iv(h.attrs,n,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:h,$to:g})=>{const m=h.pos,b=g.pos;t.doc.nodesBetween(m,b,(w,x)=>{if(!w.isText&&!w.marks.length)return;const v=Math.max(m,x),C=Math.min(b,x+w.nodeSize),P=C-v;o+=P,a.push(...w.marks.map(k=>({mark:k,from:v,to:C})))})}),o===0)return!1;const l=a.filter(h=>s?s.name===h.mark.type.name:!0).filter(h=>Iv(h.mark.attrs,n,{strict:!1})).reduce((h,g)=>h+g.to-g.from,0),u=a.filter(h=>s?h.mark.type!==s&&h.mark.type.excludes(s):!0).reduce((h,g)=>h+g.to-g.from,0);return(l>0?l+u:l)>=o}function mu(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?xr(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(h,g)=>{if(h.isText)return;const m=Math.max(r,g),b=Math.min(i,g+h.nodeSize);a.push({node:h,from:m,to:b})});const l=i-r,u=a.filter(h=>o?o.name===h.node.type.name:!0).filter(h=>Iv(h.node.attrs,n,{strict:!1}));return s?!!u.length:u.reduce((h,g)=>h+g.to-g.from,0)>=l}function qde(t,e,n={}){if(!e)return mu(t,null,n)||MP(t,null,n);const r=h0(e,t.schema);return r==="node"?mu(t,e,n):r==="mark"?MP(t,e,n):!1}var Gde=(t,e)=>{const{$from:n,$to:r,$anchor:i}=t.selection;if(e){const s=c0(a=>a.type.name===e)(t.selection);if(!s)return!1;const o=t.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Yde=t=>{const{$from:e,$to:n}=t.selection;return!(e.parentOffset>0||e.pos!==n.pos)};function I5(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function k5(t,e){const{nodeExtensions:n}=Em(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=Wt(Ye(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function p0(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!=null?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(p0(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function P$(t){return t instanceof We}function I$(t){return t instanceof at}function ud(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function k$(t,e=null){if(!e)return null;const n=St.atStart(t),r=St.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?at.create(t,ud(0,i,s),ud(t.content.size,i,s)):at.create(t,ud(e,i,s),ud(e,i,s))}function Wde(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof jr||i instanceof Fr))return;const s=t.mapping.maps[r];let o=0;s.forEach((a,l,u,f)=>{o===0&&(o=f)}),t.setSelection(St.near(t.doc.resolve(o),n))}var g0=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},Xde=(t,e)=>{if(rM(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,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 XS(t){var e;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(e=u.nodeBefore||u.nodeAfter)!=null&&e.marks.find(g=>g.type.spec.code))return!1;let f=!1;const h=Vde(u)+s;return o.forEach(g=>{if(f)return;const m=Xde(h,g.find);if(!m)return;const b=l.state.tr,w=a0({state:l.state,transaction:b}),x={from:r-(m[0].length-s.length),to:i},{commands:v,chain:C,can:P}=new l0({editor:n,state:w});g.handler({state:w,range:x,match:m,commands:v,chain:C,can:P})===null||!b.steps.length||(g.undoable&&b.setMeta(a,{transform:b,from:r,to:i,text:s}),l.dispatch(b),f=!0)}),f}function Zde(t){const{editor:e,rules:n}=t,r=new Yn({state:{init(){return null},apply(i,s,o){const a=i.getMeta(r);if(a)return a;const l=i.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:f}=l;typeof f=="string"?f=f:f=u0(Te.from(f),o.schema);const{from:h}=l,g=h+f.length;XS({editor:e,from:h,to:g,text:f,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return XS({editor:e,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&XS({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?XS({editor:e,from:o.pos,to:o.pos,text:`
176
176
  `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Jde(t){return Object.prototype.toString.call(t).slice(8,-1)}function ZS(t){return Jde(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function M$(t,e){const n={...t};return ZS(t)&&ZS(e)&&Object.keys(e).forEach(r=>{ZS(e[r])&&ZS(t[r])?n[r]=M$(t[r],e[r]):n[r]=e[r]}),n}var sM=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...Wt(Ye(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Wt(Ye(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>M$(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},Ru=class A$ extends sM{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new A$(n)}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>u?.type.name===n.name))return!1;const l=o.find(u=>u?.type.name===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function Qde(t){return typeof t=="number"}var ehe=class{constructor(t){this.find=t.find,this.handler=t.handler}},the=(t,e,n)=>{if(rM(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=t,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function nhe(t){const{editor:e,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:a}=t,{commands:l,chain:u,can:f}=new l0({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,i,(m,b)=>{var w,x,v,C,P;if((x=(w=m.type)==null?void 0:w.spec)!=null&&x.code||!(m.isText||m.isTextblock||m.isInline))return;const k=(P=(C=(v=m.content)==null?void 0:v.size)!=null?C:m.nodeSize)!=null?P:0,M=Math.max(r,b),A=Math.min(i,b+k);if(M>=A)return;const O=m.isText?m.text||"":m.textBetween(M-b,A-b,void 0,"");the(O,s.find,o).forEach(F=>{if(F.index===void 0)return;const N=M+F.index+1,j=N+F[0].length,H={from:n.tr.mapping.map(N),to:n.tr.mapping.map(j)},V=s.handler({state:n,range:H,match:F,commands:l,chain:u,can:f,pasteEvent:o,dropEvent:a});h.push(V)})}),h.every(m=>m!==null)}var JS=null,rhe=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)==null||e.setData("text/html",t),n};function ihe(t){const{editor:e,rules:n}=t;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:f,from:h,to:g,rule:m,pasteEvt:b})=>{const w=f.tr,x=a0({state:f,transaction:w});if(!(!nhe({editor:e,state:x,from:Math.max(h-1,0),to:g.b-1,rule:m,pasteEvent:b,dropEvent:a})||!w.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,w}};return n.map(f=>new Yn({view(h){const g=b=>{var w;r=(w=h.dom.parentElement)!=null&&w.contains(b.target)?h.dom.parentElement:null,r&&(JS=e)},m=()=>{JS&&(JS=null)};return window.addEventListener("dragstart",g),window.addEventListener("dragend",m),{destroy(){window.removeEventListener("dragstart",g),window.removeEventListener("dragend",m)}}},props:{handleDOMEvents:{drop:(h,g)=>{if(s=r===h.dom.parentElement,a=g,!s){const m=JS;m?.isEditable&&setTimeout(()=>{const b=m.state.selection;b&&m.commands.deleteRange({from:b.from,to:b.to})},10)}return!1},paste:(h,g)=>{var m;const b=(m=g.clipboardData)==null?void 0:m.getData("text/html");return o=g,i=!!b?.includes("data-pm-slice"),!1}}},appendTransaction:(h,g,m)=>{const b=h[0],w=b.getMeta("uiEvent")==="paste"&&!i,x=b.getMeta("uiEvent")==="drop"&&!s,v=b.getMeta("applyPasteRules"),C=!!v;if(!w&&!x&&!C)return;if(C){let{text:M}=v;typeof M=="string"?M=M:M=u0(Te.from(M),m.schema);const{from:A}=v,O=A+M.length,R=rhe(M);return l({rule:f,state:m,from:A,to:{b:O},pasteEvt:R})}const P=g.doc.content.findDiffStart(m.doc.content),k=g.doc.content.findDiffEnd(m.doc.content);if(!(!Qde(P)||!k||P===k.b))return l({rule:f,state:m,from:P,to:k,pasteEvt:o})}}))}var m0=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.extensions=tM(t),this.schema=v$(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:t_(e.name,this.schema)},r=Ye(e,"addCommands",n);return r?{...t,...r()}:t},{})}get plugins(){const{editor:t}=this;return eM([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:t,type:t_(r.name,this.schema)},s=[],o=Ye(r,"addKeyboardShortcuts",i);let a={};if(r.type==="mark"&&Ye(r,"exitable",i)&&(a.ArrowRight=()=>Ru.handleExit({editor:t,mark:r})),o){const g=Object.fromEntries(Object.entries(o()).map(([m,b])=>[m,()=>b({editor:t})]));a={...a,...g}}const l=cde(a);s.push(l);const u=Ye(r,"addInputRules",i);if(I5(r,t.options.enableInputRules)&&u){const g=u();if(g&&g.length){const m=Zde({editor:t,rules:g}),b=Array.isArray(m)?m:[m];s.push(...b)}}const f=Ye(r,"addPasteRules",i);if(I5(r,t.options.enablePasteRules)&&f){const g=f();if(g&&g.length){const m=ihe({editor:t,rules:g});s.push(...m)}}const h=Ye(r,"addProseMirrorPlugins",i);if(h){const g=h();s.push(...g)}return s})}get attributes(){return b$(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=Em(this.extensions);return Object.fromEntries(e.filter(n=>!!Ye(n,"addNodeView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:xr(n.name,this.schema)},s=Ye(n,"addNodeView",i);if(!s)return[];const o=(a,l,u,f,h)=>{const g=Pv(a,r);return s()({node:a,view:l,getPos:u,decorations:f,innerDecorations:h,editor:t,extension:n,HTMLAttributes:g})};return[n.name,o]}))}get markViews(){const{editor:t}=this,{markExtensions:e}=Em(this.extensions);return Object.fromEntries(e.filter(n=>!!Ye(n,"addMarkView")).map(n=>{const r=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:tc(n.name,this.schema)},s=Ye(n,"addMarkView",i);if(!s)return[];const o=(a,l,u)=>{const f=Pv(a,r);return s()({mark:a,view:l,inline:u,editor:t,extension:n,HTMLAttributes:f,updateAttributes:h=>{vfe(a,t,h)}})};return[n.name,o]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:t_(e.name,this.schema)};e.type==="mark"&&((n=Wt(Ye(e,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(e.name);const i=Ye(e,"onBeforeCreate",r),s=Ye(e,"onCreate",r),o=Ye(e,"onUpdate",r),a=Ye(e,"onSelectionUpdate",r),l=Ye(e,"onTransaction",r),u=Ye(e,"onFocus",r),f=Ye(e,"onBlur",r),h=Ye(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),u&&this.editor.on("focus",u),f&&this.editor.on("blur",f),h&&this.editor.on("destroy",h)})}};m0.resolve=tM;m0.sort=eM;m0.flatten=Qk;var she={};g$(she,{ClipboardTextSerializer:()=>D$,Commands:()=>L$,Delete:()=>N$,Drop:()=>z$,Editable:()=>B$,FocusEvents:()=>U$,Keymap:()=>H$,Paste:()=>$$,Tabindex:()=>K$,focusEventsPluginKey:()=>F$});var Wn=class O$ extends sM{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new O$(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},D$=Wn.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Yn({key:new Vr("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(f=>f.$from.pos)),a=Math.max(...s.map(f=>f.$to.pos)),l=nM(n);return x$(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),R$={};g$(R$,{blur:()=>ohe,clearContent:()=>ahe,clearNodes:()=>lhe,command:()=>che,createParagraphNear:()=>uhe,cut:()=>dhe,deleteCurrentNode:()=>hhe,deleteNode:()=>fhe,deleteRange:()=>phe,deleteSelection:()=>ghe,enter:()=>mhe,exitCode:()=>yhe,extendMarkRange:()=>She,first:()=>bhe,focus:()=>xhe,forEach:()=>whe,insertContent:()=>Che,insertContentAt:()=>Ehe,joinBackward:()=>Ihe,joinDown:()=>Phe,joinForward:()=>khe,joinItemBackward:()=>Mhe,joinItemForward:()=>Ahe,joinTextblockBackward:()=>Ohe,joinTextblockForward:()=>Dhe,joinUp:()=>_he,keyboardShortcut:()=>jhe,lift:()=>Lhe,liftEmptyBlock:()=>Nhe,liftListItem:()=>zhe,newlineInCode:()=>Bhe,resetAttributes:()=>Fhe,scrollIntoView:()=>Uhe,selectAll:()=>Hhe,selectNodeBackward:()=>$he,selectNodeForward:()=>Khe,selectParentNode:()=>Vhe,selectTextblockEnd:()=>qhe,selectTextblockStart:()=>Ghe,setContent:()=>Yhe,setMark:()=>Xhe,setMeta:()=>Zhe,setNode:()=>Jhe,setNodeSelection:()=>Qhe,setTextSelection:()=>efe,sinkListItem:()=>tfe,splitBlock:()=>nfe,splitListItem:()=>rfe,toggleList:()=>ife,toggleMark:()=>sfe,toggleNode:()=>ofe,toggleWrap:()=>afe,undoInputRule:()=>lfe,unsetAllMarks:()=>cfe,unsetMark:()=>ufe,updateAttributes:()=>dfe,wrapIn:()=>hfe,wrapInList:()=>ffe});var ohe=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window?.getSelection())==null||n.removeAllRanges())}),!0),ahe=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),lhe=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{t.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:u,mapping:f}=e,h=u.resolve(f.map(l)),g=u.resolve(f.map(l+a.nodeSize)),m=h.blockRange(g);if(!m)return;const b=rp(m);if(a.type.isTextblock){const{defaultType:w}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(m.start,w)}(b||b===0)&&e.lift(m,b)})}),!0},che=t=>e=>t(e),uhe=()=>({state:t,dispatch:e})=>d$(t,e),dhe=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new at(r.doc.resolve(Math.max(o-1,0)))),!0},hhe=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1},fhe=t=>({tr:e,state:n,dispatch:r})=>{const i=xr(t,n.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const l=s.before(o),u=s.after(o);e.delete(l,u).scrollIntoView()}return!0}return!1},phe=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},ghe=()=>({state:t,dispatch:e})=>Yk(t,e),mhe=()=>({commands:t})=>t.keyboardShortcut("Enter"),yhe=()=>({state:t,dispatch:e})=>gde(t,e),She=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const s=tc(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:u,to:f}=a;if(i){const h=f0(l,s,e);if(h&&h.from<=u&&h.to>=f){const g=at.create(o,h.from,h.to);n.setSelection(g)}}return!0},bhe=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function vhe(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function oM(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var xhe=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{(oM()||vhe())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e?.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!I$(n.state.selection))return o(),!0;const a=k$(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},whe=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),Che=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),The=t=>!("type"in t),Ehe=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a;const l=x=>{s.emit("contentError",{editor:s,error:x,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{Tm(e,s.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(x){l(x)}try{a=Tm(e,s.schema,{parseOptions:u,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:s.options.enableContentCheck})}catch(x){return l(x),!1}let{from:f,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},g=!0,m=!0;if((The(a)?a:[a]).forEach(x=>{x.check(),g=g?x.isText&&x.marks.length===0:!1,m=m?x.isBlock:!1}),f===h&&m){const{parent:x}=r.doc.resolve(f);x.isTextblock&&!x.type.spec.code&&!x.childCount&&(f-=1,h+=1)}let w;if(g){if(Array.isArray(e))w=e.map(x=>x.text||"").join("");else if(e instanceof Te){let x="";e.forEach(v=>{v.text&&(x+=v.text)}),w=x}else typeof e=="object"&&e&&e.text?w=e.text:w=e;r.insertText(w,f,h)}else{w=a;const x=r.doc.resolve(f),v=x.node(),C=x.parentOffset===0,P=v.isText||v.isTextblock,k=v.content.size>0;C&&P&&k&&(f=Math.max(0,f-1)),r.replaceWith(f,h,w)}n.updateSelection&&Wde(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:f,text:w}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:f,text:w})}return!0},_he=()=>({state:t,dispatch:e})=>hde(t,e),Phe=()=>({state:t,dispatch:e})=>fde(t,e),Ihe=()=>({state:t,dispatch:e})=>i$(t,e),khe=()=>({state:t,dispatch:e})=>l$(t,e),Mhe=()=>({state:t,dispatch:e,tr:n})=>{try{const r=t0(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Ahe=()=>({state:t,dispatch:e,tr:n})=>{try{const r=t0(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},Ohe=()=>({state:t,dispatch:e})=>ude(t,e),Dhe=()=>({state:t,dispatch:e})=>dde(t,e);function j$(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Rhe(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))oM()||j$()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var jhe=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=Rhe(t).split(/-(?!$)/),o=s.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l?.steps.forEach(u=>{const f=u.map(r.mapping);f&&i&&r.maybeStep(f)}),!0},Lhe=(t,e={})=>({state:n,dispatch:r})=>{const i=xr(t,n.schema);return mu(n,i,e)?pde(n,r):!1},Nhe=()=>({state:t,dispatch:e})=>h$(t,e),zhe=t=>({state:e,dispatch:n})=>{const r=xr(t,e.schema);return _de(r)(e,n)},Bhe=()=>({state:t,dispatch:e})=>u$(t,e);function M5(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}var Fhe=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=h0(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=xr(t,r.schema)),a==="mark"&&(o=tc(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,f)=>{s&&s===u.type&&n.setNodeMarkup(f,void 0,M5(u.attrs,e)),o&&u.marks.length&&u.marks.forEach(h=>{o===h.type&&n.addMark(f,f+u.nodeSize,o.create(M5(h.attrs,e)))})})}),!0):!1},Uhe=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),Hhe=()=>({tr:t,dispatch:e})=>{if(e){const n=new oo(t.doc);t.setSelection(n)}return!0},$he=()=>({state:t,dispatch:e})=>o$(t,e),Khe=()=>({state:t,dispatch:e})=>c$(t,e),Vhe=()=>({state:t,dispatch:e})=>Sde(t,e),qhe=()=>({state:t,dispatch:e})=>xde(t,e),Ghe=()=>({state:t,dispatch:e})=>vde(t,e),Yhe=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:a})=>{const{doc:l}=s;if(r.preserveWhitespace!=="full"){const u=kP(t,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return o&&s.replaceWith(0,l.content.size,u).setMeta("preventUpdate",!n),!0}return o&&s.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},t,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function Whe(t,e,n){var r;const{selection:i}=e;let s=null;if(I$(i)&&(s=i.$cursor),s){const a=(r=t.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(u=>u.type.excludes(n)))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let u=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(f,h,g)=>{if(u)return!1;if(f.isInline){const m=!g||g.type.allowsMarkType(n),b=!!n.isInSet(f.marks)||!f.marks.some(w=>w.type.excludes(n));u=m&&b}return!u}),u})}var Xhe=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=tc(t,r.schema);if(i)if(o){const u=C$(r,l);n.addStoredMark(l.create({...u,...e}))}else a.forEach(u=>{const f=u.$from.pos,h=u.$to.pos;r.doc.nodesBetween(f,h,(g,m)=>{const b=Math.max(m,f),w=Math.min(m+g.nodeSize,h);g.marks.find(v=>v.type===l)?g.marks.forEach(v=>{l===v.type&&n.addMark(b,w,l.create({...v.attrs,...e}))}):n.addMark(b,w,l.create(e))})});return Whe(r,n,l)},Zhe=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),Jhe=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=xr(t,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:a})=>T5(s,{...o,...e})(n)?!0:a.clearNodes()).command(({state:a})=>T5(s,{...o,...e})(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Qhe=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=ud(t,0,r.content.size),s=We.create(r,i);e.setSelection(s)}return!0},efe=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,o=at.atStart(r).from,a=at.atEnd(r).to,l=ud(i,o,a),u=ud(s,o,a),f=at.create(r,l,u);e.setSelection(f)}return!0},tfe=t=>({state:e,dispatch:n})=>{const r=xr(t,e.schema);return kde(r)(e,n)};function A5(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e?.includes(i.type.name));t.tr.ensureMarks(r)}}var nfe=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,u=i.extensionManager.attributes,f=zb(u,a.node().type.name,a.node().attrs);if(s instanceof We&&s.node.isBlock)return!a.parentOffset||!Vl(o,a.pos)?!1:(r&&(t&&A5(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const h=l.parentOffset===l.parent.content.size,g=a.depth===0?void 0:Ode(a.node(-1).contentMatchAt(a.indexAfter(-1)));let m=h&&g?[{type:g,attrs:f}]:void 0,b=Vl(e.doc,e.mapping.map(a.pos),1,m);if(!m&&!b&&Vl(e.doc,e.mapping.map(a.pos),1,g?[{type:g}]:void 0)&&(b=!0,m=g?[{type:g,attrs:f}]:void 0),r){if(b&&(s instanceof at&&e.deleteSelection(),e.split(e.mapping.map(a.pos),1,m),g&&!h&&!a.parentOffset&&a.parent.type!==g)){const w=e.mapping.map(a.before()),x=e.doc.resolve(w);a.node(-1).canReplaceWith(x.index(),x.index()+1,g)&&e.setNodeMarkup(e.mapping.map(a.before()),g)}t&&A5(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return b},rfe=(t,e={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const a=xr(t,r.schema),{$from:l,$to:u}=r.selection,f=r.selection.node;if(f&&f.isBlock||l.depth<2||!l.sameParent(u))return!1;const h=l.node(-1);if(h.type!==a)return!1;const g=s.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let v=Te.empty;const C=l.index(-1)?1:l.index(-2)?2:3;for(let R=l.depth-C;R>=l.depth-3;R-=1)v=Te.from(l.node(R).copy(v));const P=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,k={...zb(g,l.node().type.name,l.node().attrs),...e},M=((o=a.contentMatch.defaultType)==null?void 0:o.createAndFill(k))||void 0;v=v.append(Te.from(a.createAndFill(null,M)||void 0));const A=l.before(l.depth-(C-1));n.replace(A,l.after(-P),new Le(v,4-C,0));let O=-1;n.doc.nodesBetween(A,n.doc.content.size,(R,F)=>{if(O>-1)return!1;R.isTextblock&&R.content.size===0&&(O=F+1)}),O>-1&&n.setSelection(at.near(n.doc.resolve(O))),n.scrollIntoView()}return!0}const m=u.pos===l.end()?h.contentMatchAt(0).defaultType:null,b={...zb(g,h.type.name,h.attrs),...e},w={...zb(g,l.node().type.name,l.node().attrs),...e};n.delete(l.pos,u.pos);const x=m?[{type:a,attrs:b},{type:m,attrs:w}]:[{type:a,attrs:b}];if(!Vl(n.doc,l.pos,2))return!1;if(i){const{selection:v,storedMarks:C}=r,{splittableMarks:P}=s.extensionManager,k=C||v.$to.parentOffset&&v.$from.marks();if(n.split(l.pos,2,x).scrollIntoView(),!k||!i)return!0;const M=k.filter(A=>P.includes(A.type.name));n.ensureMarks(M)}return!0},n_=(t,e)=>{const n=c0(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===i?.type&&Ou(t.doc,n.pos)&&t.join(n.pos),!0},r_=(t,e)=>{const n=c0(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===i?.type&&Ou(t.doc,r)&&t.join(r),!0},ife=(t,e,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:u,can:f})=>{const{extensions:h,splittableMarks:g}=i.extensionManager,m=xr(t,o.schema),b=xr(e,o.schema),{selection:w,storedMarks:x}=o,{$from:v,$to:C}=w,P=v.blockRange(C),k=x||w.$to.parentOffset&&w.$from.marks();if(!P)return!1;const M=c0(A=>k5(A.type.name,h))(w);if(P.depth>=1&&M&&P.depth-M.depth<=1){if(M.node.type===m)return u.liftListItem(b);if(k5(M.node.type.name,h)&&m.validContent(M.node.content)&&a)return l().command(()=>(s.setNodeMarkup(M.pos,m),!0)).command(()=>n_(s,m)).command(()=>r_(s,m)).run()}return!n||!k||!a?l().command(()=>f().wrapInList(m,r)?!0:u.clearNodes()).wrapInList(m,r).command(()=>n_(s,m)).command(()=>r_(s,m)).run():l().command(()=>{const A=f().wrapInList(m,r),O=k.filter(R=>g.includes(R.type.name));return s.ensureMarks(O),A?!0:u.clearNodes()}).wrapInList(m,r).command(()=>n_(s,m)).command(()=>r_(s,m)).run()},sfe=(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=tc(t,r.schema);return MP(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},ofe=(t,e,n={})=>({state:r,commands:i})=>{const s=xr(t,r.schema),o=xr(e,r.schema),a=mu(r,s,n);let l;return r.selection.$anchor.sameParent(r.selection.$head)&&(l=r.selection.$anchor.parent.attrs),a?i.setNode(o,l):i.setNode(s,{...l,...n})},afe=(t,e={})=>({state:n,commands:r})=>{const i=xr(t,n.schema);return mu(n,i,e)?r.lift(i):r.wrapIn(i,e)},lfe=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const o=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},cfe=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},ufe=(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=tc(t,r.schema),{$from:u,empty:f,ranges:h}=a;if(!i)return!0;if(f&&o){let{from:g,to:m}=a;const b=(s=u.marks().find(x=>x.type===l))==null?void 0:s.attrs,w=f0(u,l,b);w&&(g=w.from,m=w.to),n.removeMark(g,m,l)}else h.forEach(g=>{n.removeMark(g.$from.pos,g.$to.pos,l)});return n.removeStoredMark(l),!0},dfe=(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=h0(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=xr(t,r.schema)),a==="mark"&&(o=tc(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const u=l.$from.pos,f=l.$to.pos;let h,g,m,b;n.selection.empty?r.doc.nodesBetween(u,f,(w,x)=>{s&&s===w.type&&(m=Math.max(x,u),b=Math.min(x+w.nodeSize,f),h=x,g=w)}):r.doc.nodesBetween(u,f,(w,x)=>{x<u&&s&&s===w.type&&(m=Math.max(x,u),b=Math.min(x+w.nodeSize,f),h=x,g=w),x>=u&&x<=f&&(s&&s===w.type&&n.setNodeMarkup(x,void 0,{...w.attrs,...e}),o&&w.marks.length&&w.marks.forEach(v=>{if(o===v.type){const C=Math.max(x,u),P=Math.min(x+w.nodeSize,f);n.addMark(C,P,o.create({...v.attrs,...e}))}}))}),g&&(h!==void 0&&n.setNodeMarkup(h,void 0,{...g.attrs,...e}),o&&g.marks.length&&g.marks.forEach(w=>{o===w.type&&n.addMark(m,b,o.create({...w.attrs,...e}))}))}),!0):!1},hfe=(t,e={})=>({state:n,dispatch:r})=>{const i=xr(t,n.schema);return wde(i,e)(n,r)},ffe=(t,e={})=>({state:n,dispatch:r})=>{const i=xr(t,n.schema);return Cde(i,e)(n,r)},L$=Wn.create({name:"commands",addCommands(){return{...R$}}}),N$=Wn.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,r,i;const s=()=>{var o,a,l,u;if((u=(l=(a=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,t))!=null?u:t.getMeta("y-sync$"))return;const f=m$(t.before,[t,...e]);E$(f).forEach(m=>{f.mapping.mapResult(m.oldRange.from).deletedAfter&&f.mapping.mapResult(m.oldRange.to).deletedBefore&&f.before.nodesBetween(m.oldRange.from,m.oldRange.to,(b,w)=>{const x=w+b.nodeSize-2,v=m.oldRange.from<=w&&x<=m.oldRange.to;this.editor.emit("delete",{type:"node",node:b,from:w,to:x,newFrom:f.mapping.map(w),newTo:f.mapping.map(x),deletedRange:m.oldRange,newRange:m.newRange,partial:!v,editor:this.editor,transaction:t,combinedTransform:f})})});const g=f.mapping;f.steps.forEach((m,b)=>{var w,x;if(m instanceof da){const v=g.slice(b).map(m.from,-1),C=g.slice(b).map(m.to),P=g.invert().map(v,-1),k=g.invert().map(C),M=(w=f.doc.nodeAt(v-1))==null?void 0:w.marks.some(O=>O.eq(m.mark)),A=(x=f.doc.nodeAt(C))==null?void 0:x.marks.some(O=>O.eq(m.mark));this.editor.emit("delete",{type:"mark",mark:m.mark,from:m.from,to:m.to,deletedRange:{from:P,to:k},newRange:{from:v,to:C},partial:!!(A||M),editor:this.editor,transaction:t,combinedTransform:f})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(s,0):s()}}),z$=Wn.create({name:"drop",addProseMirrorPlugins(){return[new Yn({key:new Vr("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),B$=Wn.create({name:"editable",addProseMirrorPlugins(){return[new Yn({key:new Vr("editable"),props:{editable:()=>this.editor.options.editable}})]}}),F$=new Vr("focusEvents"),U$=Wn.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Yn({key:F$,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),H$=Wn.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:u}=a,{empty:f,$anchor:h}=l,{pos:g,parent:m}=h,b=h.parent.isTextblock&&g>0?a.doc.resolve(g-1):h,w=b.parent.type.spec.isolating,x=h.pos-h.parentOffset,v=w&&b.parent.childCount===1?x===h.pos:St.atStart(u).from===g;return!f||!m.type.isTextblock||m.textContent.length||!v||v&&h.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return oM()||j$()?s:i},addProseMirrorPlugins(){return[new Yn({key:new Vr("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(w=>w.getMeta("composition")))return;const r=t.some(w=>w.docChanged)&&!e.doc.eq(n.doc),i=t.some(w=>w.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:a}=e.selection,l=St.atStart(e.doc).from,u=St.atEnd(e.doc).to;if(s||!(o===l&&a===u)||!p0(n.doc))return;const g=n.tr,m=a0({state:n,transaction:g}),{commands:b}=new l0({editor:this.editor,state:m});if(b.clearNodes(),!!g.steps.length)return g}})]}}),$$=Wn.create({name:"paste",addProseMirrorPlugins(){return[new Yn({key:new Vr("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),K$=Wn.create({name:"tabindex",addProseMirrorPlugins(){return[new Yn({key:new Vr("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),pfe=class sf{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){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},e)}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 e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new sf(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new sf(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new sf(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=this.pos+r+(s?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(o);if(!i&&a.depth<=this.depth)return;const l=new sf(a,this.editor,i,i?n:null);i&&(l.actualDepth=this.depth+1),e.push(new sf(a,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===e&&s.every(l=>n[l]===o.node.attrs[l])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,n,r))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},gfe=`.ProseMirror {
177
177
  position: relative;
178
178
  }
@@ -245,7 +245,7 @@ img.ProseMirror-separator {
245
245
  display: block;
246
246
  }`;function mfe(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}var yfe=class extends Ade{constructor(t={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!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:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),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:r,slice:i,moved:s})=>this.options.onDrop(r,i,s)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=k$(e,this.options.autofocus);this.editorState=ff.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){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(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t?.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=mfe(gfe,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&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:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=S$(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(o=>!o.key.startsWith(s))}),e.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var t,e;const r=[...this.options.enableCoreExtensions?[B$,D$.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),L$,U$,H$,K$,z$,$$,N$].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i?.type));this.extensionManager=new m0(r,this)}createCommandManager(){this.commandManager=new l0({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=kP(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,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(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=kP(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){var e;this.editorView=new t$(t,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)==null?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.prependClass(),this.injectCSS();const r=this.view.dom;r.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(u=>{var f;return(f=this.capturedTransaction)==null?void 0:f.step(u)});return}const{state:e,transactions:n}=this.state.applyTransaction(t),r=!this.state.selection.eq(e.selection),i=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=n.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),a=o?.getMeta("focus"),l=o?.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:o}),l&&this.emit("blur",{editor:this,event:l.event,transaction:o}),!(t.getMeta("preventUpdate")||!n.some(u=>u.docChanged)||s.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return T$(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,r=typeof t=="string"?e:t;return qde(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return u0(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
247
247
 
248
- `,textSerializers:n={}}=t||{};return w$(this.state.doc,{blockSeparator:e,textSerializers:{...nM(this.schema),...n}})}get isEmpty(){return p0(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new pfe(e,this)}get $doc(){return this.$pos(0)}};function Od(t){return new g0({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Wt(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),u=n.from+a.indexOf(o),f=u+o.length;if(iM(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(w=>w===t.type&&w!==m.mark.type)).filter(m=>m.to>u).length)return null;f<n.to&&s.delete(f,n.to),u>n.from&&s.delete(n.from+l,u);const g=n.from+l+o.length;s.addMark(n.from+l,g,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function Sfe(t){return new g0({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Wt(t.getAttributes,void 0,r)||{},{tr:s}=e,o=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let f=o+u;f>a?f=a:a=f+r[1].length;const h=r[0][r[0].length-1];s.insertText(h,o+r[0].length-1),s.replaceWith(f,a,l)}else if(r[0]){const u=t.type.isInline?o:o-1;s.insert(u,t.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()},undoable:t.undoable})}function AP(t){return new g0({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=Wt(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function Bf(t){return new g0({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=Wt(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),u=l&&Nk(l,t.type,s);if(!u)return null;if(o.wrap(l,u),t.keepMarks&&t.editor){const{selection:h,storedMarks:g}=e,{splittableMarks:m}=t.editor.extensionManager,b=g||h.$to.parentOffset&&h.$from.marks();if(b){const w=b.filter(x=>m.includes(x.type.name));o.ensureMarks(w)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,s).run()}const f=o.doc.resolve(n.from-1).nodeBefore;f&&f.type===t.type&&Ou(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,f))&&o.join(n.from-1)},undoable:t.undoable})}function bfe(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof We){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function vfe(t,e,n={}){const{state:r}=e,{doc:i,tr:s}=r,o=t;i.descendants((a,l)=>{const u=s.mapping.map(l),f=s.mapping.map(l)+a.nodeSize;let h=null;if(a.marks.forEach(m=>{if(m!==o)return!1;h=m}),!h)return;let g=!1;if(Object.keys(n).forEach(m=>{n[m]!==h.attrs[m]&&(g=!0)}),g){const m=t.type.create({...t.attrs,...n});s.removeMark(u,f,t.type),s.addMark(u,f,m)}}),s.docChanged&&e.view.dispatch(s)}var fo=class V$ extends sM{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new V$(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function yu(t){return new ehe({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=Wt(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const f=l.search(/\S/),h=n.from+l.indexOf(a),g=h+a.length;if(iM(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(x=>x===t.type&&x!==b.mark.type)).filter(b=>b.to>h).length)return null;g<n.to&&o.delete(g,n.to),h>n.from&&o.delete(n.from+f,h),u=n.from+f+a.length,o.addMark(n.from+f,u,t.type.create(s||{})),o.removeStoredMark(t.type)}}})}const xfe=new Ai;function wfe(t){return xfe.get(t,()=>d0(t.extensions??[]))}function y0(t,e,n){const{tipTapConfig:r,addFontsFromNode:i}=t.getTextOptions();Be(r,"textOptions.tipTapConfig must be set to use rich text"),Be(i,"textOptions.addFontsFromNode must be set to use rich text");const s=wfe(r),o=pa.fromJSON(s,e),a=new Set;function l(f){a.add(f)}function u(f,h){h=i(f,h,l);for(const g of f.children)u(g,h)}return u(o,n),Array.from(a)}async function Cfe({shouldReload:t=!0}={}){fJ();for(const e of mm.connectedInstances)await e.close();await Promise.all(Ok().map(e=>pH(e))),hJ(),t&&window.location.reload()}typeof window<"u"&&(window.__tldraw__hardReset=Cfe);function aM(t,e="_blank",n){return ty.openWindow(t,e,n)}Cu("@tldraw/editor","4.2.1","esm");class jt{static lineThroughPoints(e,n){const r=new jt;r.moveTo(e[0].x,e[0].y,{...n,offset:n?.endOffsets??n?.offset});for(let i=1;i<e.length;i++){const s=i===e.length-1;r.lineTo(e[i].x,e[i].y,s?{offset:n?.endOffsets}:void 0)}return r}static cubicSplineThroughPoints(e,n){const r=new jt,i=e.length,s=i-2,o=1.25;r.moveTo(e[0].x,e[0].y,{...n,offset:n?.endOffsets??n?.offset});for(let a=0;a<i-1;a++){const l=a===0?e[0]:e[a-1],u=e[a],f=e[a+1],h=a===s?f:e[a+2];let g,m,b,w;a===0?(g=l.x,m=l.y):(g=u.x+(f.x-l.x)/6*o,m=u.y+(f.y-l.y)/6*o);let x;a===s?(b=f.x,w=f.y,x={offset:n?.endOffsets}):(b=f.x-(h.x-u.x)/6*o,w=f.y-(h.y-u.y)/6*o),r.cubicBezierTo(f.x,f.y,g,m,b,w,x)}return r}constructor(){}commands=[];lastMoveTo=null;assertHasMoveTo(){return Be(this.lastMoveTo,"Start an SVGPathBuilder with `.moveTo()`"),this.lastMoveTo}moveTo(e,n,r){return this.lastMoveTo={type:"move",x:e,y:n,closeIdx:null,isClose:!1,opts:r},this.commands.push(this.lastMoveTo),this}lineTo(e,n,r){return this.assertHasMoveTo(),this.commands.push({type:"line",x:e,y:n,isClose:!1,opts:r}),this}circularArcTo(e,n,r,i,s,o){return this.arcTo(e,e,n,r,0,i,s,o)}arcTo(e,n,r,i,s,o,a,l){this.assertHasMoveTo();const u=this.commands[this.commands.length-1].x,f=this.commands[this.commands.length-1].y;if(u===o&&f===a)return this;if(e===0||n===0)return this.lineTo(o,a,l);const h=s,g=Math.sin(h),m=Math.cos(h);let b=Math.abs(e),w=Math.abs(n);const x=(u-o)/2,v=(f-a)/2,C=m*x+g*v,P=-g*x+m*v,k=C*C/(b*b)+P*P/(w*w);if(k>1){const xe=Math.sqrt(k);b*=xe,w*=xe}const M=r!==i?1:-1,A=b*b*w*w-b*b*P*P-w*w*C*C,O=b*b*P*P+w*w*C*C;let R=A/O;R=R<0?0:R;const F=M*Math.sqrt(R),N=F*(b*P/w),j=F*(-(w*C)/b),H=m*N-g*j+(u+o)/2,V=g*N+m*j+(f+a)/2,z=(C-N)/b,K=(P-j)/w,B=(-C-N)/b,G=(-P-j)/w,W=Math.atan2(K,z);let Z=Math.atan2(G,B);!i&&Z>W?Z-=2*Math.PI:i&&Z<W&&(Z+=2*Math.PI);const de=Z-W,U=Math.max(b,w)*Math.abs(de),ne=Math.min(4,Math.ceil(Math.abs(de)/(Math.PI/2))),le=Math.ceil(Qx(U)/ne),fe=de/ne,me=xe=>({x:H+b*Math.cos(xe)*m-w*Math.sin(xe)*g,y:V+b*Math.cos(xe)*g+w*Math.sin(xe)*m}),_e=xe=>({x:-b*Math.sin(xe)*m-w*Math.cos(xe)*g,y:-b*Math.sin(xe)*g+w*Math.cos(xe)*m});for(let xe=0;xe<ne;xe++){const Pe=W+xe*fe,Oe=W+(xe+1)*fe,He=Oe-Pe,zt=me(Pe),Kt=me(Oe),Mt=_e(Pe),_t=_e(Oe),Ht=4/3*Math.tan(He/4),Xn=zt.x+Ht*Mt.x,wr=zt.y+Ht*Mt.y,kr=Kt.x-Ht*_t.x,Gr=Kt.y-Ht*_t.y,hi=xe===0?l:{...l,mergeWithPrevious:!0};this.cubicBezierToWithResolution(Kt.x,Kt.y,Xn,wr,kr,Gr,hi,le)}return this}cubicBezierTo(e,n,r,i,s,o,a){return this.cubicBezierToWithResolution(e,n,r,i,s,o,a)}cubicBezierToWithResolution(e,n,r,i,s,o,a,l){return this.assertHasMoveTo(),this.commands.push({type:"cubic",x:e,y:n,cp1:{x:r,y:i},cp2:{x:s,y:o},isClose:!1,opts:a,resolution:l}),this}close(){const e=this.assertHasMoveTo(),n=this.commands[this.commands.length-1];return ar(e.x,n.x)&&ar(e.y,n.y)?n.isClose=!0:this.commands.push({type:"line",x:e.x,y:e.y,isClose:!0}),e.closeIdx=this.commands.length-1,this.lastMoveTo=null,this}toD(e={}){const{startIdx:n=0,endIdx:r=this.commands.length,onlyFilled:i=!1}=e,s=[];let o=!1,a=!1,l=!1;const u=f=>{if(a||f===0)return;a=!0;const h=this.commands[f-1];s.push("M",J(h.x),J(h.y))};for(let f=n;f<r;f++){const h=this.commands[f];switch(h.type){case"move":{const g=h.opts?.geometry===!1?!1:h.opts?.geometry?.isFilled??!1;i&&!g?o=!0:(o=!1,a=!0,l=!0,s.push("M",J(h.x),J(h.y)));break}case"line":if(o)break;u(f),h.isClose&&l?s.push("Z"):s.push("L",J(h.x),J(h.y));break;case"cubic":if(o)break;u(f),s.push("C",J(h.cp1.x),J(h.cp1.y),J(h.cp2.x),J(h.cp2.y),J(h.x),J(h.y));break;default:kt(h,"type")}}return s.join(" ")}toSvg(e){if(e.forceSolid)return this.toSolidSvg(e);switch(e.style){case"solid":return this.toSolidSvg(e);case"dashed":case"dotted":return this.toDashedSvg(e);case"draw":return this.toDrawSvg(e);default:kt(e,"style")}}toGeometry(){const e=[];let n=null;for(let r=0;r<this.commands.length;r++){const i=this.commands[r];i.type==="move"&&(n&&n.opts?.geometry!==!1&&e.push(new OP(this,n.startIdx,r,{...n.opts?.geometry,isFilled:n.opts?.geometry?.isFilled??!1,isClosed:n.moveCommand.closeIdx!==null})),n={startIdx:r,moveCommand:i,opts:i.opts,isClosed:!1}),i.isClose&&(Be(n,"No current move command"),n.isClosed=!0)}return n&&n.opts?.geometry!==!1&&e.push(new OP(this,n.startIdx,this.commands.length,{...n.opts?.geometry,isFilled:n.opts?.geometry?.isFilled??!1,isClosed:n.moveCommand.closeIdx!==null})),Be(e.length>0),e.length===1?e[0]:new js({children:e})}toSolidSvg(e){const{strokeWidth:n,props:r}=e;return y.jsx("path",{strokeWidth:n,d:this.toD({onlyFilled:e.onlyFilled}),...r})}toDashedSvg(e){const{style:n,strokeWidth:r,snap:i,lengthRatio:s,props:{markerStart:o,markerEnd:a,...l}={}}=e,u=[];let f=!1,h=!1,g,m=null;const b=()=>{if(!m)return;const{startIdx:w,endIdx:x,isFirst:v,isLast:C,length:P,lineOpts:k,pathIsClosed:M}=m;if(m=null,w===x&&this.commands[w].type==="move")return;const A=k?.dashStart??e.start,O=k?.dashEnd??e.end,{strokeDasharray:R,strokeDashoffset:F}=a6(P,r,{style:n,snap:i,lengthRatio:s,start:v?A??(M?"outset":"none"):"outset",end:C?O??(M?"outset":"none"):"outset"}),N=this.toD({startIdx:w,endIdx:x+1});u.push(y.jsx("path",{d:N,strokeDasharray:R,strokeDashoffset:F,markerStart:v?o:void 0,markerEnd:C?a:void 0},u.length))};for(let w=0;w<this.commands.length;w++){const x=this.commands[w],v=this.commands[w-1];if(x.type==="move"){f=x.closeIdx!==null;const M=x.opts?.geometry===!1?!1:x.opts?.geometry?.isFilled??!1;e.onlyFilled&&!M?h=!0:(h=!1,g=x.opts);continue}if(h)continue;const C=this.calculateSegmentLength(v,x),P=v.type==="move",k=x.isClose||w===this.commands.length-1||this.commands[w+1]?.type==="move";m&&x.opts?.mergeWithPrevious?(m.length+=C,m.endIdx=w,m.isLast=k):(b(),m={startIdx:w,endIdx:w,isFirst:P,isLast:k,length:C,lineOpts:g,pathIsClosed:f})}return b(),y.jsx("g",{strokeWidth:r,...l,children:u})}toDrawSvg(e){return y.jsx("path",{strokeWidth:e.strokeWidth,d:this.toDrawD(e),...e.props})}toDrawD(e){const{strokeWidth:n,randomSeed:r,offset:i=n/3,roundness:s=n*2,passes:o=2,onlyFilled:a=!1}=e,l=[],u=this.getCommandInfo(),f=[];let h=null;for(let g=0;g<this.commands.length;g++){const m=this.commands[g],b=m.opts?.offset??i,w=m.opts?.roundness??s;m.type==="move"&&(h=g);const x=m.isClose?Dr(h)+1:!this.commands[g+1]||this.commands[g+1].type==="move"?void 0:g+1,v=x!==void 0&&this.commands[x]&&this.commands[x]?.type!=="move"?u[x]:void 0,C=O5[m.type],P=x!==void 0?O5[this.commands[x].type]:!1,k=u[g],M=k?.tangentEnd,A=v?.tangentStart,O=C&&P&&M&&A&&I.Len2(M)>.01&&I.Len2(A)>.01?ma(Math.abs(I.AngleBetween(M,A)),[Math.PI/2,Math.PI],[w,0],!0):0,F=Math.min(k?.length??1/0,v?.length??1/0)-O*2,N=it(b,0,F/4),j=Math.min(O,(k?.length??1/0)/4),H=Math.min(O,(v?.length??1/0)/4),V={command:m,offsetAmount:N,roundnessBefore:j,roundnessAfter:H,tangentToPrev:u[g]?.tangentEnd,tangentToNext:v?.tangentStart,moveDidClose:!1};if(f.push(V),m.isClose&&h!==null){const z=f[h];z.moveDidClose=!0,z.roundnessAfter=H}else m.type==="move"&&(h=g)}for(let g=0;g<o;g++){const m=Bd(r+g);let b={x:0,y:0},w=!1;for(const{command:x,offsetAmount:v,roundnessBefore:C,roundnessAfter:P,tangentToNext:k,tangentToPrev:M}of f){const A=x.isClose?b:{x:m()*v,y:m()*v};if(x.type==="move"){b=A;const N=x.opts?.geometry===!1?!1:x.opts?.geometry?.isFilled??!1;a&&!N?w=!0:w=!1}if(w)continue;const O=I.Add(x,A),R=k&&P>0?I.Mul(k,-P).add(O):O,F=M&&C>0?I.Mul(M,C).add(O):O;if(R===O||F===O)switch(x.type){case"move":l.push("M",J(R.x),J(R.y));break;case"line":l.push("L",J(R.x),J(R.y));break;case"cubic":{const N=I.Add(x.cp1,A),j=I.Add(x.cp2,A);l.push("C",J(N.x),J(N.y),J(j.x),J(j.y),J(R.x),J(R.y));break}default:kt(x,"type")}else switch(x.type){case"move":l.push("M",J(R.x),J(R.y));break;case"line":l.push("L",J(F.x),J(F.y),"Q",J(O.x),J(O.y),J(R.x),J(R.y));break;case"cubic":{const N=I.Add(x.cp1,A),j=I.Add(x.cp2,A);l.push("C",J(N.x),J(N.y),J(j.x),J(j.y),J(O.x),J(O.y));break}default:kt(x,"type")}}}return l.join(" ")}calculateSegmentLength(e,n){switch(n.type){case"move":return 0;case"line":return I.Dist(e,n);case"cubic":return Mg.length(e.x,e.y,n.cp1.x,n.cp1.y,n.cp2.x,n.cp2.y,n.x,n.y);default:kt(n,"type")}}getCommands(){return this.commands}getCommandInfo(){const e=[];for(let n=1;n<this.commands.length;n++){const r=this.commands[n-1],i=this.commands[n];if(i._info){e[n]=i._info;continue}if(i.type==="move")continue;let s,o;switch(i.type){case"line":s=o=I.Sub(r,i).uni();break;case"cubic":{s=I.Sub(i.cp1,r).uni(),o=I.Sub(i.cp2,i).uni();break}default:kt(i,"type")}i._info={tangentStart:s,tangentEnd:o,length:this.calculateSegmentLength(r,i)},e[n]=i._info}return e}}const O5={line:!0,move:!0,cubic:!1};class OP extends Mu{constructor(e,n,r,i){super(i),this.path=e,this.startIdx=n,this.endIdx=r}_segments=null;getSegments(){if(this._segments)return this._segments;this._segments=[];let e=this.path.commands[this.startIdx];Be(e.type==="move");for(let n=this.startIdx+1;n<this.endIdx;n++){const r=this.path.commands[n];switch(Be(r.type!=="move"),r.type){case"line":this._segments.push(new Df({start:I.From(e),end:I.From(r)}));break;case"cubic":{this._segments.push(new Rk({start:I.From(e),cp1:I.From(r.cp1),cp2:I.From(r.cp2),end:I.From(r),resolution:r.resolution}));break}default:kt(r,"type")}e=r}return this._segments}getVertices(e){const n=this.getSegments().flatMap(r=>r.getVertices(e)).filter((r,i,s)=>{const o=s[i-1];return o?!I.Equals(o,r):!0});if(this.isClosed){const r=n[n.length-1],i=n[0];I.Equals(r,i)||n.push(i)}return n}nearestPoint(e,n){let r=null,i=1/0;for(const s of this.getSegments()){const o=s.nearestPoint(e),a=I.Dist2(e,o);a<i&&(i=a,r=o)}return Be(r,"No nearest point found"),r}hitTestLineSegment(e,n,r=0,i){return super.hitTestLineSegment(e,n,r,i)}getSvgPathData(){return this.path.toD({startIdx:this.startIdx,endIdx:this.endIdx})}}const Mg={base3(t,e,n,r,i){const s=-3*e+9*n-9*r+3*i,o=t*s+6*e-12*n+6*r;return t*o-3*e+3*n},length(t,e,n,r,i,s,o,a,l=1){l=l>1?1:l<0?0:l;const u=l/2,f=12;let h=0;h=0;for(let g=0;g<f;g++){const m=u*Mg.Tvalues[g]+u,b=Mg.base3(m,t,n,i,o),w=Mg.base3(m,e,r,s,a),x=b*b+w*w;h+=Mg.Cvalues[g]*Math.sqrt(x)}return u*h},Tvalues:[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],Cvalues:[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472]};function q$(){const t=Gn(),e=ee("animationSpeed",()=>t?.user.getAnimationSpeed(),[t]),[n,r]=E.useState(!1);return E.useEffect(()=>{if(e!==void 0){r(e===0);return}if(typeof window>"u"||!("matchMedia"in window))return;const i=window.matchMedia("(prefers-reduced-motion: reduce)"),s=()=>{r(i.matches)};return s(),i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[e]),n}const DP=E.createContext(null);function Tfe({children:t}){const e=Xm("a11y",{msg:"",priority:"assertive"}),n=E.useContext(DP),r=E.useMemo(()=>({currentMsg:e,announce(i){i&&e.set(i)}}),[e]);return n?y.jsx(y.Fragment,{children:t}):y.jsx(DP.Provider,{value:r,children:t})}function S0(){const t=E.useContext(DP);if(!t)throw new Error("useA11y must be used within a A11yContext.Provider");return t}const G$=E.createContext(null);function Y$({assetUrls:t,children:e}){return E.useEffect(()=>{for(const n of Object.values(t.icons)){if(!n)continue;const r=lm();r.crossOrigin="anonymous",r.src=n,r.decode()}for(const n of Object.values(t.embedIcons)){if(!n)continue;const r=lm();r.crossOrigin="anonymous",r.src=n,r.decode()}},[t]),y.jsx(G$.Provider,{value:t,children:e})}function lM(){const t=E.useContext(G$);if(!t)throw new Error("useAssetUrls must be used within an AssetUrlsProvider");return t}const RP={"action.toggle-auto-pan":"Auto (trackpad)","action.toggle-auto-zoom":"Auto (mouse)","action.toggle-auto-none":"Auto","action.toggle-mouse":"Mouse","action.toggle-trackpad":"Trackpad","action.convert-to-bookmark":"Convert to bookmark","action.convert-to-embed":"Convert to embed","action.open-embed-link":"Open link","action.align-bottom":"Align bottom","action.align-center-horizontal":"Align horizontally","action.align-center-vertical":"Align vertically","action.align-center-horizontal.short":"Align H","action.align-center-vertical.short":"Align V","action.align-left":"Align left","action.align-right":"Align right","action.align-top":"Align top","action.back-to-content":"Back to content","action.bring-forward":"Bring forward","action.bring-to-front":"Bring to front","action.copy-as-png.short":"PNG","action.copy-as-png":"Copy as PNG","action.copy-as-svg.short":"SVG","action.copy-as-svg":"Copy as SVG","action.copy":"Copy","action.cut":"Cut","action.delete":"Delete","action.unlock-all":"Unlock all","action.distribute-horizontal":"Distribute horizontally","action.distribute-vertical":"Distribute vertically","action.distribute-horizontal.short":"Distribute H","action.distribute-vertical.short":"Distribute V","action.download-original":"Download original","action.duplicate":"Duplicate","action.edit-link":"Edit link","action.exit-pen-mode":"Exit pen mode","action.export-as-png.short":"PNG","action.export-as-png":"Export as PNG","action.export-as-svg.short":"SVG","action.export-as-svg":"Export as SVG","action.export-all-as-png.short":"PNG","action.export-all-as-png":"Export as PNG","action.export-all-as-svg.short":"SVG","action.export-all-as-svg":"Export as SVG","action.fit-frame-to-content":"Fit to content","action.flip-horizontal":"Flip horizontally","action.flip-vertical":"Flip vertically","action.flip-horizontal.short":"Flip H","action.flip-vertical.short":"Flip V","action.fork-project":"Fork this project","action.fork-project-on-tldraw":"Fork project on tldraw","action.group":"Group","action.insert-embed":"Insert embed","action.insert-media":"Upload media","action.leave-shared-project":"Leave shared project","action.new-project":"New project","action.new-shared-project":"New shared project","action.open-cursor-chat":"Cursor chat","action.open-kbd-shortcuts":"Open keyboard shortcuts","action.open-file":"Open file","action.pack":"Pack","action.paste":"Paste","action.paste-error-title":"Pasting failed","action.paste-error-description":"Could not paste due to missing clipboard permissions. Please enable the permissions and try again.","action.print":"Print","action.redo":"Redo","action.remove-frame":"Remove frame","action.rename":"Rename","action.rotate-ccw":"Rotate counterclockwise","action.rotate-cw":"Rotate clockwise","action.save-copy":"Save a copy","action.select-all":"Select all","action.select-none":"Select none","action.send-backward":"Send backward","action.send-to-back":"Send to back","action.share-project":"Share this project","action.stack-horizontal":"Stack horizontally","action.stack-vertical":"Stack vertically","action.stack-horizontal.short":"Stack H","action.stack-vertical.short":"Stack V","action.stop-following":"Stop following","action.stretch-horizontal":"Stretch horizontally","action.stretch-vertical":"Stretch vertically","action.stretch-horizontal.short":"Stretch H","action.stretch-vertical.short":"Stretch V","action.toggle-auto-size":"Toggle auto size","action.toggle-dark-mode.menu":"Dark mode","action.toggle-dark-mode":"Toggle dark mode","action.toggle-paste-at-cursor.menu":"Paste at cursor","action.toggle-paste-at-cursor":"Toggle paste at cursor","action.toggle-wrap-mode.menu":"Select on wrap","action.toggle-wrap-mode":"Toggle select on wrap","action.toggle-reduce-motion.menu":"Reduce motion","action.toggle-reduce-motion":"Toggle reduce motion","action.toggle-keyboard-shortcuts.menu":"Enable keyboard shortcuts","action.toggle-keyboard-shortcuts":"Toggle keyboard shortcuts","action.enhanced-a11y-mode.menu":"Enhanced accessibility mode","action.enhanced-a11y-mode":"Toggle enhanced accessibility mode","action.toggle-edge-scrolling.menu":"Edge scrolling","action.toggle-edge-scrolling":"Toggle edge scrolling","action.toggle-debug-mode.menu":"Debug mode","action.toggle-debug-mode":"Toggle debug mode","action.toggle-focus-mode.menu":"Focus mode","action.toggle-focus-mode":"Toggle focus mode","action.toggle-dynamic-size-mode.menu":"Dynamic size","action.toggle-dynamic-size-mode":"Toggle dynamic size","action.toggle-grid.menu":"Show grid","action.toggle-grid":"Toggle grid","action.toggle-lock":"Toggle locked","action.flatten-to-image":"Flatten","action.toggle-snap-mode.menu":"Always snap","action.toggle-snap-mode":"Toggle always snap","action.toggle-tool-lock.menu":"Tool lock","action.toggle-tool-lock":"Toggle tool lock","action.toggle-transparent.context-menu":"Transparent","action.toggle-transparent.menu":"Transparent","action.toggle-transparent":"Toggle transparent background","action.undo":"Undo","action.ungroup":"Ungroup","action.zoom-in":"Zoom in","action.zoom-out":"Zoom out","action.zoom-to-100":"Zoom to 100%","action.zoom-to-fit":"Zoom to fit","action.zoom-to-selection":"Zoom to selection","assets.files.size-too-big":"File size is too big","assets.files.maximum-size":"Maximum file size is {size}","assets.files.type-not-allowed":"File type is not allowed","assets.files.upload-failed":"Upload failed","assets.files.amount-too-many":"Too many files","assets.url.failed":"Couldn’t load URL preview","theme.dark":"Dark","theme.light":"Light","theme.system":"System","color-style.white":"White","color-style.black":"Black","color-style.blue":"Blue","color-style.green":"Green","color-style.grey":"Grey","color-style.light-blue":"Light blue","color-style.light-green":"Light green","color-style.light-red":"Light red","color-style.light-violet":"Light violet","color-style.orange":"Orange","color-style.red":"Red","color-style.violet":"Violet","color-style.yellow":"Yellow","fill-style.none":"None","document.default-name":"Untitled","fill-style.semi":"Semi","fill-style.solid":"Solid","fill-style.pattern":"Pattern","fill-style.fill":"Fill","fill-style.lined-fill":"Lined fill","dash-style.dashed":"Dashed","dash-style.dotted":"Dotted","dash-style.draw":"Draw","dash-style.solid":"Solid","size-style.s":"Small","size-style.m":"Medium","size-style.l":"Large","size-style.xl":"Extra large","opacity-style.0.1":"10%","opacity-style.0.25":"25%","opacity-style.0.5":"50%","opacity-style.0.75":"75%","opacity-style.1":"100%","font-style.draw":"Draw","font-style.sans":"Sans","font-style.serif":"Serif","font-style.mono":"Mono","align-style.start":"Start","align-style.middle":"Middle","align-style.end":"End","align-style.justify":"Justify","verticalAlign-style.start":"Top","verticalAlign-style.middle":"Middle","verticalAlign-style.end":"Bottom","geo-style.arrow-down":"Arrow down","geo-style.arrow-left":"Arrow left","geo-style.arrow-right":"Arrow right","geo-style.arrow-up":"Arrow up","geo-style.cloud":"Cloud","geo-style.diamond":"Diamond","geo-style.ellipse":"Ellipse","geo-style.heart":"Heart","geo-style.hexagon":"Hexagon","geo-style.octagon":"Octagon","geo-style.oval":"Oval","geo-style.pentagon":"Pentagon","geo-style.rectangle":"Rectangle","geo-style.rhombus":"Rhombus","geo-style.rhombus-2":"Rhombus left","geo-style.star":"Star","geo-style.trapezoid":"Trapezoid","geo-style.triangle":"Triangle","geo-style.x-box":"X box","geo-style.check-box":"Check box","arrowheadStart-style.none":"None","arrowheadStart-style.arrow":"Arrow","arrowheadStart-style.bar":"Bar","arrowheadStart-style.diamond":"Diamond","arrowheadStart-style.dot":"Dot","arrowheadStart-style.inverted":"Inverted","arrowheadStart-style.pipe":"Pipe","arrowheadStart-style.square":"Square","arrowheadStart-style.triangle":"Triangle","arrowheadEnd-style.none":"None","arrowheadEnd-style.arrow":"Arrow","arrowheadEnd-style.bar":"Bar","arrowheadEnd-style.diamond":"Diamond","arrowheadEnd-style.dot":"Dot","arrowheadEnd-style.inverted":"Inverted","arrowheadEnd-style.pipe":"Pipe","arrowheadEnd-style.square":"Square","arrowheadEnd-style.triangle":"Triangle","spline-style.line":"Line","spline-style.cubic":"Cubic","arrow-kind-style.arc":"Arc","arrow-kind-style.elbow":"Elbow","tool.select":"Select","tool.hand":"Hand","tool.draw":"Draw","tool.eraser":"Eraser","tool.arrow-down":"Arrow down","tool.arrow-left":"Arrow left","tool.arrow-right":"Arrow right","tool.arrow-up":"Arrow up","tool.arrow":"Arrow","tool.cloud":"Cloud","tool.diamond":"Diamond","tool.ellipse":"Ellipse","tool.heart":"Heart","tool.hexagon":"Hexagon","tool.highlight":"Highlight","tool.line":"Line","tool.octagon":"Octagon","tool.oval":"Oval","tool.pentagon":"Pentagon","tool.rectangle":"Rectangle","tool.rhombus":"Rhombus","tool.star":"Star","tool.trapezoid":"Trapezoid","tool.triangle":"Triangle","tool.x-box":"X box","tool.check-box":"Check box","tool.media":"Media","tool.frame":"Frame","tool.note":"Note","tool.laser":"Laser","tool.embed":"Embed","tool.text":"Text","tool.pointer-down":"Pointer down","tool.image-zoom":"Zoom","tool.replace-media":"Replace media","tool.flip-horz":"Flip horizontally","tool.flip-vert":"Flip vertically","tool.rotate-cw":"Rotate","tool.aspect-ratio":"Aspect ratio","tool.aspect-ratio.original":"Original","tool.aspect-ratio.square":"Square (1:1)","tool.aspect-ratio.circle":"Circle (1:1)","tool.aspect-ratio.landscape":"Landscape (4:3)","tool.aspect-ratio.portrait":"Portrait (3:4)","tool.aspect-ratio.wide":"Wide (16:9)","tool.image-toolbar-title":"Image tools","tool.image-crop":"Crop image","tool.image-crop-confirm":"Confirm","tool.media-alt-text":"Alternative text","tool.media-alt-text-desc":"Give a description…","tool.media-alt-text-confirm":"Confirm","tool.rich-text-bold":"Bold","tool.rich-text-italic":"Italic","tool.rich-text-code":"Code","tool.rich-text-highlight":"Highlight","tool.rich-text-strikethrough":"Strikethrough","tool.rich-text-link":"Link","tool.rich-text-link-visit":"Visit link","tool.rich-text-link-remove":"Remove link","tool.rich-text-header":"Header","tool.rich-text-bulletList":"Bulleted list","tool.rich-text-toolbar-title":"Text formatting","tool.rich-text-orderedList":"Ordered list","tool.bookmark":"Bookmark","a11y.status":"Status","a11y.skip-to-main-content":"Move focus to canvas","a11y.shape-index":"{num} of {total}","a11y.shape-image":"Image","a11y.shape-video":"Video","a11y.multiple-shapes":"{num} shapes selected","a11y.select-shape":"Select next shape","a11y.select-shape-direction":"Select shape in direction","a11y.enter-leave-container":"Enter/leave container","a11y.repeat-shape":"Repeat shape","a11y.move-shape":"Move shape","a11y.move-shape-faster":"Move shape faster","a11y.rotate-shape-cw":"Rotate shape clockwise","a11y.rotate-shape-ccw":"Rotate shape counterclockwise","a11y.rotate-shape-cw-fine":"Rotate shape clockwise (fine)","a11y.rotate-shape-ccw-fine":"Rotate shape counterclockwise (fine)","a11y.enlarge-shape":"Enlarge shape","a11y.shrink-shape":"Shrink shape","a11y.pan-camera":"Pan camera","a11y.adjust-shape-styles":"Adjust shape styles","a11y.open-context-menu":"Open context menu","a11y.open-keyboard-shortcuts":"Open keyboard shortcuts","menu.title":"Menu","menu.theme":"Theme","menu.accessibility":"Accessibility","menu.copy-as":"Copy as","menu.edit":"Edit","menu.export-as":"Export as","menu.file":"File","menu.language":"Language","menu.preferences":"Preferences","menu.view":"View","menu.input-mode":"Input mode","context-menu.title":"Context menu","context-menu.edit":"Edit","context-menu.arrange":"Arrange","context-menu.copy-as":"Copy as","context-menu.export-as":"Export as","context-menu.export-all-as":"Export","context-menu.move-to-page":"Move to page","context-menu.reorder":"Reorder","page-menu.title":"Pages","page-menu.create-new-page":"Create new page","page-menu.max-page-count-reached":"Max pages reached","page-menu.new-page-initial-name":"Page 1","page-menu.edit-start":"Edit","page-menu.edit-done":"Done","page-menu.go-to-page":"Go to page","page-menu.submenu.rename":"Rename","page-menu.submenu.duplicate-page":"Duplicate","page-menu.submenu.title":"Menu","page-menu.submenu.move-down":"Move down","page-menu.submenu.move-up":"Move up","page-menu.submenu.delete":"Delete","share-menu.title":"Share","share-menu.save-note":"Download this project to your computer as a .tldr file.","share-menu.fork-note":"Create a new shared project based on this snapshot.","share-menu.share-project":"Share this project","share-menu.copy-link":"Copy editor link","share-menu.create-snapshot-link":"Copy snapshot link","share-menu.snapshot-link-note":"Capture and share this project as a read-only snapshot link.","share-menu.copy-readonly-link":"Copy viewer link","share-menu.offline-note":"Create a new shared project based on your current project.","share-menu.copy-link-note":"Anyone with the link will be able to view and edit this project.","share-menu.copy-readonly-link-note":"Anyone with the link will be able to access this project.","share-menu.project-too-large":"Sorry, this project can’t be shared because it’s too large. We’re working on it!","share-menu.upload-failed":"Sorry, we couldn’t upload your project at the moment. Please try again or let us know if the problem persists.","share-menu.creating-project":"Creating the new project…","share-menu.copied":"Copied link","document-name-menu.copy-link":"Copy link","status.offline":"Offline","people-menu.title":"People","people-menu.change-name":"Change name","people-menu.avatar-color":"Avatar color","people-menu.change-color":"Change color","people-menu.follow":"Following","people-menu.following":"Following","people-menu.leading":"Following you","people-menu.user":"(You)","people-menu.invite":"Invite others","people-menu.anonymous-user":"New user","help-menu.import-tldr-file":"Import file…","help-menu.title":"Help and resources","help-menu.about":"About tldraw","help-menu.discord":"Discord","help-menu.github":"GitHub","help-menu.keyboard-shortcuts":"Keyboard shortcuts","help-menu.twitter":"Twitter","help-menu.terms":"Terms of service","help-menu.privacy":"Privacy policy","actions-menu.title":"Actions","edit-link-dialog.title":"Edit link","edit-link-dialog.invalid-url":"A link must be a valid URL.","edit-link-dialog.detail":"Links will open in a new tab.","edit-link-dialog.url":"URL","edit-link-dialog.clear":"Clear","edit-link-dialog.save":"Continue","edit-link-dialog.cancel":"Cancel","edit-link-dialog.external-link":"External link","embed-dialog.title":"Insert embed","embed-dialog.back":"Back","embed-dialog.create":"Create","embed-dialog.cancel":"Cancel","embed-dialog.url":"URL","embed-dialog.instruction":"Paste in the site’s URL to create the embed.","embed-dialog.invalid-url":"We could not create an embed from that URL.","shortcuts-dialog.title":"Keyboard shortcuts","shortcuts-dialog.edit":"Edit","shortcuts-dialog.file":"File","shortcuts-dialog.preferences":"Preferences","shortcuts-dialog.tools":"Tools","shortcuts-dialog.transform":"Transform","shortcuts-dialog.view":"View","shortcuts-dialog.collaboration":"Collaboration","shortcuts-dialog.a11y":"Accessibility","shortcuts-dialog.text-formatting":"Text formatting","style-panel.title":"Styles","style-panel.align":"Align","style-panel.label-align":"Label align","style-panel.vertical-align":"Vertical align","style-panel.position":"Position","style-panel.arrowheads":"Arrows","style-panel.arrowhead-start":"Start","style-panel.arrowhead-end":"End","style-panel.arrow-kind":"Line","style-panel.color":"Color","style-panel.dash":"Dash","style-panel.fill":"Fill","style-panel.font":"Font","style-panel.geo":"Shape","style-panel.mixed":"Mixed","style-panel.opacity":"Opacity","style-panel.size":"Size","style-panel.spline":"Spline","style-panel.selected":"selected","tool-panel.title":"Tools","tool-panel.more":"More","navigation-zone.title":"Navigation","navigation-zone.minimap":"Minimap","navigation-zone.toggle-minimap":"Toggle minimap","navigation-zone.zoom":"Zoom","focus-mode.toggle-focus-mode":"Toggle focus mode","toast.close":"Close","toast.success":"Success","toast.error":"Error","toast.info":"Info","toast.warning":"Warning","file-system.file-open-error.title":"Could not open file","file-system.file-open-error.not-a-tldraw-file":"The file you tried to open doesn’t look like a tldraw file.","file-system.file-open-error.file-format-version-too-new":"The file you tried to open is from a newer version of tldraw. Please reload the page and try again.","file-system.file-open-error.generic-corrupted-file":"The file you tried to open is corrupted.","file-system.confirm-open.title":"Overwrite current project?","file-system.confirm-open.description":"Opening a file will replace your current project and any unsaved changes will be lost. Are you sure you want to continue?","file-system.confirm-open.cancel":"Cancel","file-system.confirm-open.open":"Open file","file-system.confirm-open.dont-show-again":"Don’t ask again","file-system.confirm-clear.title":"Clear current project?","file-system.confirm-clear.description":"Creating a new project will clear your current project and any unsaved changes will be lost. Are you sure you want to continue?","file-system.confirm-clear.cancel":"Cancel","file-system.confirm-clear.continue":"Continue","file-system.confirm-clear.dont-show-again":"Don’t ask again","file-system.shared-document-file-open-error.title":"Could not open file","file-system.shared-document-file-open-error.description":"Opening files from shared projects is not supported.","sharing.confirm-leave.title":"Leave current project?","sharing.confirm-leave.description":"Are you sure you want to leave this shared project? You can return to it by navigating to its URL.","sharing.confirm-leave.cancel":"Cancel","sharing.confirm-leave.leave":"Leave","sharing.confirm-leave.dont-show-again":"Don’t ask again","toast.error.export-fail.title":"Failed export","toast.error.export-fail.desc":"Failed to export image","toast.error.copy-fail.title":"Failed copy","toast.error.copy-fail.desc":"Failed to copy image","context.pages.new-page":"New page","vscode.file-open.desc":"We’ve updated this document to work with the current version of tldraw. If you’d like to keep the original version (which will work on old.tldraw.com), click below to create a backup.","vscode.file-open.open":"Continue","vscode.file-open.backup":"Backup","vscode.file-open.backup-saved":"Backup saved","vscode.file-open.backup-failed":"Backup failed: this is not a .tldr file.","vscode.file-open.dont-show-again":"Don’t ask again","cursor-chat.type-to-chat":"Type to chat…","app.loading":"Loading tldraw…","handle.resize-top":"Resize top","handle.resize-bottom":"Resize bottom","handle.resize-left":"Resize left","handle.resize-right":"Resize right","handle.resize-top-left":"Resize top left","handle.resize-top-right":"Resize top right","handle.resize-bottom-left":"Resize bottom left","handle.resize-bottom-right":"Resize bottom right","handle.rotate.top_left_rotate":"Rotate top left","handle.rotate.top_right_rotate":"Rotate top right","handle.rotate.bottom_left_rotate":"Rotate bottom left","handle.rotate.bottom_right_rotate":"Rotate bottom right","handle.rotate.mobile_rotate":"Rotate","handle.crop.top":"Crop top","handle.crop.bottom":"Crop bottom","handle.crop.left":"Crop left","handle.crop.right":"Crop right","handle.crop.top-left":"Crop top left","handle.crop.top-right":"Crop top right","handle.crop.bottom-left":"Crop bottom left","handle.crop.bottom-right":"Crop bottom right","ui.close":"Close","ui.checked":"Checked","ui.unchecked":"Unchecked"},Efe=new Set(["ar","fa","he","ur","ku"]),Gh={locale:"en",label:"English",messages:RP,dir:"ltr"};async function _fe(t,e){if(!(await Gl(e.translations.en)).ok)return console.warn("No main translations found."),Gh;if(t==="en")return Gh;const r=hm.find(o=>o.locale===t);if(!r)return console.warn(`No translation found for locale ${t}`),Gh;const s=await(await Gl(e.translations[r.locale])).json();if(!s)return console.warn(`No messages found for locale ${t}`),Gh;for(const o in Gh.messages)s[o];return{locale:t,label:r.label,dir:Efe.has(r.locale)?"rtl":"ltr",messages:{...Gh.messages,...s}}}const cM=E.createContext(null);function Pfe(){const t=E.useContext(cM);if(!t)throw new Error("useCurrentTranslation must be used inside of <TldrawUiContextProvider />");return t}function W$({overrides:t,locale:e,children:n}){const r=lM(),[i,s]=E.useState(()=>t&&t.en?{locale:"en",label:"English",dir:"ltr",messages:{...RP,...t.en}}:{locale:"en",label:"English",dir:"ltr",messages:RP});return E.useEffect(()=>{let o=!1;async function a(){const l=await _fe(e,r);l&&!o&&(t&&t[e]?s({...l,messages:{...l.messages,...t[e]}}):s(l))}return a(),()=>{o=!0}},[r,e,t]),y.jsx(cM.Provider,{value:i,children:n})}function Ne(){const t=Pfe();return E.useCallback(function(n){return t.messages[n]??n},[t])}const Ife={normal:"tlui-button__normal",primary:"tlui-button__primary",danger:"tlui-button__danger",low:"tlui-button__low",icon:"tlui-button__icon",tool:"tlui-button__tool",menu:"tlui-button__menu",help:"tlui-button__help"},gt=E.forwardRef(function({children:e,type:n,htmlButtonType:r,isActive:i,...s},o){return y.jsx("button",{ref:o,type:r||"button",draggable:!1,"data-isactive":i,...s,className:Fe("tlui-button",Ife[n],s.className),children:e})});function kfe(){const t=te(),e=Ne(),n=E.useRef(null),r=E.useCallback(i=>{t.markEventAsHandled(i),n.current?.blur();const s=t.getCurrentPageShapesInReadingOrder();s.length&&(t.setSelectedShapes([s[0].id]),t.zoomToSelectionIfOffscreen(256,{animation:{duration:t.options.animationMediumMs},inset:0}),t.timers.setTimeout(()=>t.getContainer().focus(),100))},[t]);return y.jsx(gt,{ref:n,type:"low",tabIndex:0,className:"tl-skip-to-main-content",onClick:r,children:e("a11y.skip-to-main-content")})}const Mfe=E.memo(function(){const e=S0(),n=Ne(),r=ee("a11y-msg",()=>e.currentMsg.get(),[]);return Ofe(r.msg),Afe(),r.msg&&y.jsx("div",{"aria-label":n("a11y.status"),"aria-live":r.priority||"assertive",role:"status","aria-hidden":"false",style:{position:"absolute",top:"-10000px",left:"-10000px"},children:r.msg})});function X$(t){const{editor:e,selectedShapeIds:n,msg:r}=t;let i="";const s=n.length;if(s>1)i=r("a11y.multiple-shapes").replace("{num}",s.toString());else if(s===1){const o=n[0],a=e.getShape(o);if(!a)return"";const l=e.getShapeUtil(a.type),u=["image","video"].includes(a.type);let f="";a.type==="geo"?f=r(`geo-style.${a.props.geo}`):u?f=r(`a11y.shape-${a.type}`):f=r(`tool.${a.type}`);const h=e.getCurrentPageShapesInReadingOrder(),g=(h.findIndex(x=>x.id===o)+1).toString(),m=h.length.toString(),b=r("a11y.shape-index").replace("{num}",g).replace("{total}",m),w=l.getAriaDescriptor(a)||l.getText(a)||"";i=(w?`${w}, `:"")+`${f}. ${b}`}return i}const Afe=()=>{const t=Gn(),e=S0(),n=Ne(),r=E.useRef([]);KI("announce selection",()=>{if(!t)return;if(t.isIn("select.idle")){const s=t.getSelectedShapeIds();s!==r.current&&(r.current=s,Tg(()=>{const o=X$({editor:t,selectedShapeIds:s,msg:n});o&&e.announce({msg:o})}))}},[t,e,n])},Ofe=t=>{const e=ur();E.useEffect(()=>{if(In.a11y.get()){const n=i=>{console.debug(`%ca11y%c: ${i}`,"color: white; background: #40C057; padding: 2px;border-radius: 3px;","font-weight: normal")},r=i=>{const s=document.activeElement;if(i.key==="Tab"&&s&&s!==document.body&&!s.classList.contains("tl-container")){const o=s.getAttribute("aria-label")||s.getAttribute("title")||s.textContent;o&&n(o)}};return t&&n(t),document.addEventListener("keyup",r),()=>document.removeEventListener("keyup",r)}},[e,t])},_m=300,uM=320,jP=46,Dfe=101;function Z$(t,e){const n=e?t.getAsset(e):null;return n&&!n.props.image?n.props.title?Dfe:jP:uM}function D5(t,e){return{...e,props:{...e.props,h:Z$(t,e.props.assetId)}}}const Rfe=t=>{try{return new URL(t).hostname.replace(/^www\./,"")}catch{return t}};function jfe(t,e){const{url:n}=e.props,r=Kd.createId(NB(n));t.getAsset(r)?e.props.assetId!==r&&t.updateShapes([{id:e.id,type:e.type,props:{assetId:r}}]):(t.updateShapes([{id:e.id,type:e.type,props:{assetId:null}}]),Lfe(t,e))}const Lfe=wx(async(t,e)=>{if(t.isDisposed)return;const{url:n}=e.props,r=await t.getAssetForExternalContent({type:"url",url:n});r&&t.run(()=>{t.createAssets([r]),t.updateShapes([{id:e.id,type:e.type,props:{assetId:r.id}}])})},500);async function J$(t,{url:e,center:n=t.getViewportPageBounds().center}){try{const r=await t.getAssetForExternalContent({type:"url",url:e}),i=sn(),s={id:i,type:"bookmark",x:n.x-_m/2,y:n.y-uM/2,rotation:0,opacity:1,props:{url:e,assetId:r?.id||null,w:_m,h:Z$(t,r?.id)}};t.run(()=>{r&&t.createAssets([r]),t.createShapes([s])});const o=t.getShape(i);return ri.ok(o)}catch(r){return ri.err(r instanceof Error?r.message:"Failed to create bookmark")}}function Nfe(t,e){const n=tt(e.map(i=>t.getShape(i)).filter(i=>i&&t.isShapeOfType(i,"frame")));if(!n.length)return;const r=[];t.run(()=>{n.map(i=>{const s=t.getSortedChildIdsForParent(i.id);s.length&&(Xt(t,s,{filter:o=>!n.find(a=>a.id===o.id)}),r.push(...s))}),t.setSelectedShapes(r),t.deleteShapes(e)})}const R5=50;function Q$(t,e,n={padding:R5}){const r=we.FromPoints(t.flatMap(u=>{if(!u)return[];const f=e.getShapeGeometry(u.id);return e.getShapeLocalTransform(u)?.applyToPoints(f.vertices)??[]})),i=n.padding??R5,s=r.w+2*i,o=r.h+2*i,a=i-r.minX,l=i-r.minY;return{w:s,h:o,dx:a,dy:l}}function e7(t,e,n={}){const r=t.getShape(e);if(!r)return;const i=t.getSortedChildIdsForParent(r.id),s=tt(i.map(h=>t.getShape(h)));if(!s.length)return;const{w:o,h:a,dx:l,dy:u}=Q$(s,t,n);if(l===0&&u===0&&r.props.w===o&&r.props.h===a)return;const f=new I(l,u).rot(r.rotation);t.run(()=>{const h=i.map(g=>{const m=t.getShape(g);return{id:m.id,type:m.type,x:m.x+l,y:m.y+u}});h.push({id:r.id,type:r.type,x:r.x-f.x,y:r.y-f.y,props:{w:o,h:a}}),t.updateShapes(h)})}function sr({children:t}){return y.jsx("span",{className:"tlui-button__label",children:t})}function j5(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function b0(...t){return e=>{let n=!1;const r=t.map(i=>{const s=j5(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():j5(t[i],null)}}}}function Zt(...t){return E.useCallback(b0(...t),t)}function Dd(t){const e=zfe(t),n=E.forwardRef((r,i)=>{const{children:s,...o}=r,a=E.Children.toArray(s),l=a.find(Ffe);if(l){const u=l.props.children,f=a.map(h=>h===l?E.Children.count(u)>1?E.Children.only(null):E.isValidElement(u)?u.props.children:null:h);return y.jsx(e,{...o,ref:i,children:E.isValidElement(u)?E.cloneElement(u,void 0,f):null})}return y.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}var dM=Dd("Slot");function zfe(t){const e=E.forwardRef((n,r)=>{const{children:i,...s}=n;if(E.isValidElement(i)){const o=Hfe(i),a=Ufe(s,i.props);return i.type!==E.Fragment&&(a.ref=r?b0(r,o):o),E.cloneElement(i,a)}return E.Children.count(i)>1?E.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var t7=Symbol("radix.slottable");function Bfe(t){const e=({children:n})=>y.jsx(y.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=t7,e}function Ffe(t){return E.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===t7}function Ufe(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function Hfe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var $fe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ht=$fe.reduce((t,e)=>{const n=Dd(`Primitive.${e}`),r=E.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function hM(t,e){t&&qd.flushSync(()=>t.dispatchEvent(e))}var Kfe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Vfe="VisuallyHidden",v0=E.forwardRef((t,e)=>y.jsx(ht.span,{...t,ref:e,style:{...Kfe,...t.style}}));v0.displayName=Vfe;var qfe=v0;function Gfe(t,e){const n=E.createContext(e),r=s=>{const{children:o,...a}=s,l=E.useMemo(()=>a,Object.values(a));return y.jsx(n.Provider,{value:l,children:o})};r.displayName=t+"Provider";function i(s){const o=E.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function po(t,e=[]){let n=[];function r(s,o){const a=E.createContext(o),l=n.length;n=[...n,o];const u=h=>{const{scope:g,children:m,...b}=h,w=g?.[t]?.[l]||a,x=E.useMemo(()=>b,Object.values(b));return y.jsx(w.Provider,{value:x,children:m})};u.displayName=s+"Provider";function f(h,g){const m=g?.[t]?.[l]||a,b=E.useContext(m);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[u,f]}const i=()=>{const s=n.map(o=>E.createContext(o));return function(a){const l=a?.[t]||s;return E.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,Yfe(i,...e)]}function Yfe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(s)[`__scope${u}`];return{...a,...h}},{});return E.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function x0(t){const e=t+"CollectionProvider",[n,r]=po(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:x,children:v}=w,C=qe.useRef(null),P=qe.useRef(new Map).current;return y.jsx(i,{scope:x,itemMap:P,collectionRef:C,children:v})};o.displayName=e;const a=t+"CollectionSlot",l=Dd(a),u=qe.forwardRef((w,x)=>{const{scope:v,children:C}=w,P=s(a,v),k=Zt(x,P.collectionRef);return y.jsx(l,{ref:k,children:C})});u.displayName=a;const f=t+"CollectionItemSlot",h="data-radix-collection-item",g=Dd(f),m=qe.forwardRef((w,x)=>{const{scope:v,children:C,...P}=w,k=qe.useRef(null),M=Zt(x,k),A=s(f,v);return qe.useEffect(()=>(A.itemMap.set(k,{ref:k,...P}),()=>void A.itemMap.delete(k))),y.jsx(g,{[h]:"",ref:M,children:C})});m.displayName=f;function b(w){const x=s(t+"CollectionConsumer",w);return qe.useCallback(()=>{const C=x.collectionRef.current;if(!C)return[];const P=Array.from(C.querySelectorAll(`[${h}]`));return Array.from(x.itemMap.values()).sort((A,O)=>P.indexOf(A.ref.current)-P.indexOf(O.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:u,ItemSlot:m},b,r]}function Re(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t?.(i),n===!1||!i.defaultPrevented)return e?.(i)}}var Wl=globalThis?.document?E.useLayoutEffect:()=>{},Wfe=AB[" useInsertionEffect ".trim().toString()]||Wl;function qo({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,s,o]=Xfe({defaultProp:e,onChange:n}),a=t!==void 0,l=a?t:i;{const f=E.useRef(t!==void 0);E.useEffect(()=>{const h=f.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=E.useCallback(f=>{if(a){const h=Zfe(f)?f(t):f;h!==t&&o.current?.(h)}else s(f)},[a,t,s,o]);return[l,u]}function Xfe({defaultProp:t,onChange:e}){const[n,r]=E.useState(t),i=E.useRef(n),s=E.useRef(e);return Wfe(()=>{s.current=e},[e]),E.useEffect(()=>{i.current!==n&&(s.current?.(n),i.current=n)},[n,i]),[n,r,s]}function Zfe(t){return typeof t=="function"}function Jfe(t,e){return E.useReducer((n,r)=>e[n][r]??n,t)}var Go=t=>{const{present:e,children:n}=t,r=Qfe(e),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),s=Zt(r.ref,epe(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:s}):null};Go.displayName="Presence";function Qfe(t){const[e,n]=E.useState(),r=E.useRef(null),i=E.useRef(t),s=E.useRef("none"),o=t?"mounted":"unmounted",[a,l]=Jfe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const u=QS(r.current);s.current=a==="mounted"?u:"none"},[a]),Wl(()=>{const u=r.current,f=i.current;if(f!==t){const g=s.current,m=QS(u);t?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(f&&g!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Wl(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,h=m=>{const w=QS(r.current).includes(CSS.escape(m.animationName));if(m.target===e&&w&&(l("ANIMATION_END"),!i.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},g=m=>{m.target===e&&(s.current=QS(r.current))};return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:E.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function QS(t){return t?.animationName||"none"}function epe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var tpe=AB[" useId ".trim().toString()]||(()=>{}),npe=0;function Va(t){const[e,n]=E.useState(tpe());return Wl(()=>{n(r=>r??String(npe++))},[t]),e?`radix-${e}`:""}var rpe=E.createContext(void 0);function py(t){const e=E.useContext(rpe);return t||e||"ltr"}function rs(t){const e=E.useRef(t);return E.useEffect(()=>{e.current=t}),E.useMemo(()=>(...n)=>e.current?.(...n),[])}function ipe(t,e=globalThis?.document){const n=rs(t);E.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var spe="DismissableLayer",LP="dismissableLayer.update",ope="dismissableLayer.pointerDownOutside",ape="dismissableLayer.focusOutside",L5,n7=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ip=E.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=t,u=E.useContext(n7),[f,h]=E.useState(null),g=f?.ownerDocument??globalThis?.document,[,m]=E.useState({}),b=Zt(e,O=>h(O)),w=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=w.indexOf(x),C=f?w.indexOf(f):-1,P=u.layersWithOutsidePointerEventsDisabled.size>0,k=C>=v,M=cpe(O=>{const R=O.target,F=[...u.branches].some(N=>N.contains(R));!k||F||(i?.(O),o?.(O),O.defaultPrevented||a?.())},g),A=upe(O=>{const R=O.target;[...u.branches].some(N=>N.contains(R))||(s?.(O),o?.(O),O.defaultPrevented||a?.())},g);return ipe(O=>{C===u.layers.size-1&&(r?.(O),!O.defaultPrevented&&a&&(O.preventDefault(),a()))},g),E.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(L5=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),N5(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=L5)}},[f,g,n,u]),E.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),N5())},[f,u]),E.useEffect(()=>{const O=()=>m({});return document.addEventListener(LP,O),()=>document.removeEventListener(LP,O)},[]),y.jsx(ht.div,{...l,ref:b,style:{pointerEvents:P?k?"auto":"none":void 0,...t.style},onFocusCapture:Re(t.onFocusCapture,A.onFocusCapture),onBlurCapture:Re(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Re(t.onPointerDownCapture,M.onPointerDownCapture)})});ip.displayName=spe;var lpe="DismissableLayerBranch",r7=E.forwardRef((t,e)=>{const n=E.useContext(n7),r=E.useRef(null),i=Zt(e,r);return E.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),y.jsx(ht.div,{...t,ref:i})});r7.displayName=lpe;function cpe(t,e=globalThis?.document){const n=rs(t),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){i7(ope,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function upe(t,e=globalThis?.document){const n=rs(t),r=E.useRef(!1);return E.useEffect(()=>{const i=s=>{s.target&&!r.current&&i7(ape,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function N5(){const t=new CustomEvent(LP);document.dispatchEvent(t)}function i7(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?hM(i,s):i.dispatchEvent(s)}var dpe=ip,hpe=r7,i_="focusScope.autoFocusOnMount",s_="focusScope.autoFocusOnUnmount",z5={bubbles:!1,cancelable:!0},fpe="FocusScope",w0=E.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,l]=E.useState(null),u=rs(i),f=rs(s),h=E.useRef(null),g=Zt(e,w=>l(w)),m=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let w=function(P){if(m.paused||!a)return;const k=P.target;a.contains(k)?h.current=k:Vc(h.current,{select:!0})},x=function(P){if(m.paused||!a)return;const k=P.relatedTarget;k!==null&&(a.contains(k)||Vc(h.current,{select:!0}))},v=function(P){if(document.activeElement===document.body)for(const M of P)M.removedNodes.length>0&&Vc(a)};document.addEventListener("focusin",w),document.addEventListener("focusout",x);const C=new MutationObserver(v);return a&&C.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",x),C.disconnect()}}},[r,a,m.paused]),E.useEffect(()=>{if(a){F5.add(m);const w=document.activeElement;if(!a.contains(w)){const v=new CustomEvent(i_,z5);a.addEventListener(i_,u),a.dispatchEvent(v),v.defaultPrevented||(ppe(bpe(s7(a)),{select:!0}),document.activeElement===w&&Vc(a))}return()=>{a.removeEventListener(i_,u),setTimeout(()=>{const v=new CustomEvent(s_,z5);a.addEventListener(s_,f),a.dispatchEvent(v),v.defaultPrevented||Vc(w??document.body,{select:!0}),a.removeEventListener(s_,f),F5.remove(m)},0)}}},[a,u,f,m]);const b=E.useCallback(w=>{if(!n&&!r||m.paused)return;const x=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,v=document.activeElement;if(x&&v){const C=w.currentTarget,[P,k]=gpe(C);P&&k?!w.shiftKey&&v===k?(w.preventDefault(),n&&Vc(P,{select:!0})):w.shiftKey&&v===P&&(w.preventDefault(),n&&Vc(k,{select:!0})):v===C&&w.preventDefault()}},[n,r,m.paused]);return y.jsx(ht.div,{tabIndex:-1,...o,ref:g,onKeyDown:b})});w0.displayName=fpe;function ppe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Vc(r,{select:e}),document.activeElement!==n)return}function gpe(t){const e=s7(t),n=B5(e,t),r=B5(e.reverse(),t);return[n,r]}function s7(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function B5(t,e){for(const n of t)if(!mpe(n,{upTo:e}))return n}function mpe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function ype(t){return t instanceof HTMLInputElement&&"select"in t}function Vc(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&ype(t)&&e&&t.select()}}var F5=Spe();function Spe(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=U5(t,e),t.unshift(e)},remove(e){t=U5(t,e),t[0]?.resume()}}}function U5(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function bpe(t){return t.filter(e=>e.tagName!=="A")}var vpe="Portal",gy=E.forwardRef((t,e)=>{const{container:n,...r}=t,[i,s]=E.useState(!1);Wl(()=>s(!0),[]);const o=n||i&&globalThis?.document?.body;return o?Lne.createPortal(y.jsx(ht.div,{...r,ref:e}),o):null});gy.displayName=vpe;var o_=0;function fM(){E.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??H5()),document.body.insertAdjacentElement("beforeend",t[1]??H5()),o_++,()=>{o_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),o_--}},[])}function H5(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Fa=function(){return Fa=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Fa.apply(this,arguments)};function o7(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function xpe(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Bb="right-scroll-bar-position",Fb="width-before-scroll-bar",wpe="with-scroll-bars-hidden",Cpe="--removed-body-scroll-bar-size";function a_(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Tpe(t,e){var n=E.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var Epe=typeof window<"u"?E.useLayoutEffect:E.useEffect,$5=new WeakMap;function _pe(t,e){var n=Tpe(null,function(r){return t.forEach(function(i){return a_(i,r)})});return Epe(function(){var r=$5.get(n);if(r){var i=new Set(r),s=new Set(t),o=n.current;i.forEach(function(a){s.has(a)||a_(a,null)}),s.forEach(function(a){i.has(a)||a_(a,o)})}$5.set(n,t)},[t]),n}function Ppe(t){return t}function Ipe(t,e){e===void 0&&(e=Ppe);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var o=e(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var l=function(){var f=o;o=[],f.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){o.push(f),u()},filter:function(f){return o=o.filter(f),n}}}};return i}function kpe(t){t===void 0&&(t={});var e=Ipe(null);return e.options=Fa({async:!0,ssr:!1},t),e}var a7=function(t){var e=t.sideCar,n=o7(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return E.createElement(r,Fa({},n))};a7.isSideCarExport=!0;function Mpe(t,e){return t.useMedium(e),a7}var l7=kpe(),l_=function(){},C0=E.forwardRef(function(t,e){var n=E.useRef(null),r=E.useState({onScrollCapture:l_,onWheelCapture:l_,onTouchMoveCapture:l_}),i=r[0],s=r[1],o=t.forwardProps,a=t.children,l=t.className,u=t.removeScrollBar,f=t.enabled,h=t.shards,g=t.sideCar,m=t.noRelative,b=t.noIsolation,w=t.inert,x=t.allowPinchZoom,v=t.as,C=v===void 0?"div":v,P=t.gapMode,k=o7(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=g,A=_pe([n,e]),O=Fa(Fa({},k),i);return E.createElement(E.Fragment,null,f&&E.createElement(M,{sideCar:l7,removeScrollBar:u,shards:h,noRelative:m,noIsolation:b,inert:w,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:P}),o?E.cloneElement(E.Children.only(a),Fa(Fa({},O),{ref:A})):E.createElement(C,Fa({},O,{className:l,ref:A}),a))});C0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};C0.classNames={fullWidth:Fb,zeroRight:Bb};var Ape=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ope(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Ape();return e&&t.setAttribute("nonce",e),t}function Dpe(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Rpe(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var jpe=function(){var t=0,e=null;return{add:function(n){t==0&&(e=Ope())&&(Dpe(e,n),Rpe(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Lpe=function(){var t=jpe();return function(e,n){E.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},c7=function(){var t=Lpe(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},Npe={left:0,top:0,right:0,gap:0},c_=function(t){return parseInt(t||"",10)||0},zpe=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[c_(n),c_(r),c_(i)]},Bpe=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Npe;var e=zpe(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},Fpe=c7(),Ef="data-scroll-locked",Upe=function(t,e,n,r){var i=t.left,s=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
248
+ `,textSerializers:n={}}=t||{};return w$(this.state.doc,{blockSeparator:e,textSerializers:{...nM(this.schema),...n}})}get isEmpty(){return p0(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new pfe(e,this)}get $doc(){return this.$pos(0)}};function Od(t){return new g0({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Wt(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),u=n.from+a.indexOf(o),f=u+o.length;if(iM(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(w=>w===t.type&&w!==m.mark.type)).filter(m=>m.to>u).length)return null;f<n.to&&s.delete(f,n.to),u>n.from&&s.delete(n.from+l,u);const g=n.from+l+o.length;s.addMark(n.from+l,g,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function Sfe(t){return new g0({find:t.find,handler:({state:e,range:n,match:r})=>{const i=Wt(t.getAttributes,void 0,r)||{},{tr:s}=e,o=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const u=r[0].lastIndexOf(r[1]);let f=o+u;f>a?f=a:a=f+r[1].length;const h=r[0][r[0].length-1];s.insertText(h,o+r[0].length-1),s.replaceWith(f,a,l)}else if(r[0]){const u=t.type.isInline?o:o-1;s.insert(u,t.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a))}s.scrollIntoView()},undoable:t.undoable})}function AP(t){return new g0({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=Wt(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function Bf(t){return new g0({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=Wt(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),u=l&&Nk(l,t.type,s);if(!u)return null;if(o.wrap(l,u),t.keepMarks&&t.editor){const{selection:h,storedMarks:g}=e,{splittableMarks:m}=t.editor.extensionManager,b=g||h.$to.parentOffset&&h.$from.marks();if(b){const w=b.filter(x=>m.includes(x.type.name));o.ensureMarks(w)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(h,s).run()}const f=o.doc.resolve(n.from-1).nodeBefore;f&&f.type===t.type&&Ou(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,f))&&o.join(n.from-1)},undoable:t.undoable})}function bfe(t,e){const{selection:n}=t,{$from:r}=n;if(n instanceof We){const s=r.index();return r.parent.canReplaceWith(s,s+1,e)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(e))return!0;i-=1}return!1}function vfe(t,e,n={}){const{state:r}=e,{doc:i,tr:s}=r,o=t;i.descendants((a,l)=>{const u=s.mapping.map(l),f=s.mapping.map(l)+a.nodeSize;let h=null;if(a.marks.forEach(m=>{if(m!==o)return!1;h=m}),!h)return;let g=!1;if(Object.keys(n).forEach(m=>{n[m]!==h.attrs[m]&&(g=!0)}),g){const m=t.type.create({...t.attrs,...n});s.removeMark(u,f,t.type),s.addMark(u,f,m)}}),s.docChanged&&e.view.dispatch(s)}var fo=class V$ extends sM{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new V$(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function yu(t){return new ehe({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=Wt(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let u=n.to;if(a){const f=l.search(/\S/),h=n.from+l.indexOf(a),g=h+a.length;if(iM(n.from,n.to,e.doc).filter(b=>b.mark.type.excluded.find(x=>x===t.type&&x!==b.mark.type)).filter(b=>b.to>h).length)return null;g<n.to&&o.delete(g,n.to),h>n.from&&o.delete(n.from+f,h),u=n.from+f+a.length,o.addMark(n.from+f,u,t.type.create(s||{})),o.removeStoredMark(t.type)}}})}const xfe=new Ai;function wfe(t){return xfe.get(t,()=>d0(t.extensions??[]))}function y0(t,e,n){const{tipTapConfig:r,addFontsFromNode:i}=t.getTextOptions();Be(r,"textOptions.tipTapConfig must be set to use rich text"),Be(i,"textOptions.addFontsFromNode must be set to use rich text");const s=wfe(r),o=pa.fromJSON(s,e),a=new Set;function l(f){a.add(f)}function u(f,h){h=i(f,h,l);for(const g of f.children)u(g,h)}return u(o,n),Array.from(a)}async function Cfe({shouldReload:t=!0}={}){fJ();for(const e of mm.connectedInstances)await e.close();await Promise.all(Ok().map(e=>pH(e))),hJ(),t&&window.location.reload()}typeof window<"u"&&(window.__tldraw__hardReset=Cfe);function aM(t,e="_blank",n){return ty.openWindow(t,e,n)}Cu("@tldraw/editor","4.2.1","esm");class jt{static lineThroughPoints(e,n){const r=new jt;r.moveTo(e[0].x,e[0].y,{...n,offset:n?.endOffsets??n?.offset});for(let i=1;i<e.length;i++){const s=i===e.length-1;r.lineTo(e[i].x,e[i].y,s?{offset:n?.endOffsets}:void 0)}return r}static cubicSplineThroughPoints(e,n){const r=new jt,i=e.length,s=i-2,o=1.25;r.moveTo(e[0].x,e[0].y,{...n,offset:n?.endOffsets??n?.offset});for(let a=0;a<i-1;a++){const l=a===0?e[0]:e[a-1],u=e[a],f=e[a+1],h=a===s?f:e[a+2];let g,m,b,w;a===0?(g=l.x,m=l.y):(g=u.x+(f.x-l.x)/6*o,m=u.y+(f.y-l.y)/6*o);let x;a===s?(b=f.x,w=f.y,x={offset:n?.endOffsets}):(b=f.x-(h.x-u.x)/6*o,w=f.y-(h.y-u.y)/6*o),r.cubicBezierTo(f.x,f.y,g,m,b,w,x)}return r}constructor(){}commands=[];lastMoveTo=null;assertHasMoveTo(){return Be(this.lastMoveTo,"Start an SVGPathBuilder with `.moveTo()`"),this.lastMoveTo}moveTo(e,n,r){return this.lastMoveTo={type:"move",x:e,y:n,closeIdx:null,isClose:!1,opts:r},this.commands.push(this.lastMoveTo),this}lineTo(e,n,r){return this.assertHasMoveTo(),this.commands.push({type:"line",x:e,y:n,isClose:!1,opts:r}),this}circularArcTo(e,n,r,i,s,o){return this.arcTo(e,e,n,r,0,i,s,o)}arcTo(e,n,r,i,s,o,a,l){this.assertHasMoveTo();const u=this.commands[this.commands.length-1].x,f=this.commands[this.commands.length-1].y;if(u===o&&f===a)return this;if(e===0||n===0)return this.lineTo(o,a,l);const h=s,g=Math.sin(h),m=Math.cos(h);let b=Math.abs(e),w=Math.abs(n);const x=(u-o)/2,v=(f-a)/2,C=m*x+g*v,P=-g*x+m*v,k=C*C/(b*b)+P*P/(w*w);if(k>1){const xe=Math.sqrt(k);b*=xe,w*=xe}const M=r!==i?1:-1,A=b*b*w*w-b*b*P*P-w*w*C*C,O=b*b*P*P+w*w*C*C;let R=A/O;R=R<0?0:R;const F=M*Math.sqrt(R),N=F*(b*P/w),j=F*(-(w*C)/b),H=m*N-g*j+(u+o)/2,V=g*N+m*j+(f+a)/2,z=(C-N)/b,K=(P-j)/w,B=(-C-N)/b,G=(-P-j)/w,W=Math.atan2(K,z);let Z=Math.atan2(G,B);!i&&Z>W?Z-=2*Math.PI:i&&Z<W&&(Z+=2*Math.PI);const de=Z-W,U=Math.max(b,w)*Math.abs(de),ne=Math.min(4,Math.ceil(Math.abs(de)/(Math.PI/2))),le=Math.ceil(Qx(U)/ne),fe=de/ne,me=xe=>({x:H+b*Math.cos(xe)*m-w*Math.sin(xe)*g,y:V+b*Math.cos(xe)*g+w*Math.sin(xe)*m}),_e=xe=>({x:-b*Math.sin(xe)*m-w*Math.cos(xe)*g,y:-b*Math.sin(xe)*g+w*Math.cos(xe)*m});for(let xe=0;xe<ne;xe++){const Pe=W+xe*fe,Oe=W+(xe+1)*fe,He=Oe-Pe,zt=me(Pe),Kt=me(Oe),Mt=_e(Pe),_t=_e(Oe),Ht=4/3*Math.tan(He/4),Xn=zt.x+Ht*Mt.x,wr=zt.y+Ht*Mt.y,kr=Kt.x-Ht*_t.x,Gr=Kt.y-Ht*_t.y,hi=xe===0?l:{...l,mergeWithPrevious:!0};this.cubicBezierToWithResolution(Kt.x,Kt.y,Xn,wr,kr,Gr,hi,le)}return this}cubicBezierTo(e,n,r,i,s,o,a){return this.cubicBezierToWithResolution(e,n,r,i,s,o,a)}cubicBezierToWithResolution(e,n,r,i,s,o,a,l){return this.assertHasMoveTo(),this.commands.push({type:"cubic",x:e,y:n,cp1:{x:r,y:i},cp2:{x:s,y:o},isClose:!1,opts:a,resolution:l}),this}close(){const e=this.assertHasMoveTo(),n=this.commands[this.commands.length-1];return ar(e.x,n.x)&&ar(e.y,n.y)?n.isClose=!0:this.commands.push({type:"line",x:e.x,y:e.y,isClose:!0}),e.closeIdx=this.commands.length-1,this.lastMoveTo=null,this}toD(e={}){const{startIdx:n=0,endIdx:r=this.commands.length,onlyFilled:i=!1}=e,s=[];let o=!1,a=!1,l=!1;const u=f=>{if(a||f===0)return;a=!0;const h=this.commands[f-1];s.push("M",J(h.x),J(h.y))};for(let f=n;f<r;f++){const h=this.commands[f];switch(h.type){case"move":{const g=h.opts?.geometry===!1?!1:h.opts?.geometry?.isFilled??!1;i&&!g?o=!0:(o=!1,a=!0,l=!0,s.push("M",J(h.x),J(h.y)));break}case"line":if(o)break;u(f),h.isClose&&l?s.push("Z"):s.push("L",J(h.x),J(h.y));break;case"cubic":if(o)break;u(f),s.push("C",J(h.cp1.x),J(h.cp1.y),J(h.cp2.x),J(h.cp2.y),J(h.x),J(h.y));break;default:kt(h,"type")}}return s.join(" ")}toSvg(e){if(e.forceSolid)return this.toSolidSvg(e);switch(e.style){case"solid":return this.toSolidSvg(e);case"dashed":case"dotted":return this.toDashedSvg(e);case"draw":return this.toDrawSvg(e);default:kt(e,"style")}}toGeometry(){const e=[];let n=null;for(let r=0;r<this.commands.length;r++){const i=this.commands[r];i.type==="move"&&(n&&n.opts?.geometry!==!1&&e.push(new OP(this,n.startIdx,r,{...n.opts?.geometry,isFilled:n.opts?.geometry?.isFilled??!1,isClosed:n.moveCommand.closeIdx!==null})),n={startIdx:r,moveCommand:i,opts:i.opts,isClosed:!1}),i.isClose&&(Be(n,"No current move command"),n.isClosed=!0)}return n&&n.opts?.geometry!==!1&&e.push(new OP(this,n.startIdx,this.commands.length,{...n.opts?.geometry,isFilled:n.opts?.geometry?.isFilled??!1,isClosed:n.moveCommand.closeIdx!==null})),Be(e.length>0),e.length===1?e[0]:new js({children:e})}toSolidSvg(e){const{strokeWidth:n,props:r}=e;return y.jsx("path",{strokeWidth:n,d:this.toD({onlyFilled:e.onlyFilled}),...r})}toDashedSvg(e){const{style:n,strokeWidth:r,snap:i,lengthRatio:s,props:{markerStart:o,markerEnd:a,...l}={}}=e,u=[];let f=!1,h=!1,g,m=null;const b=()=>{if(!m)return;const{startIdx:w,endIdx:x,isFirst:v,isLast:C,length:P,lineOpts:k,pathIsClosed:M}=m;if(m=null,w===x&&this.commands[w].type==="move")return;const A=k?.dashStart??e.start,O=k?.dashEnd??e.end,{strokeDasharray:R,strokeDashoffset:F}=a6(P,r,{style:n,snap:i,lengthRatio:s,start:v?A??(M?"outset":"none"):"outset",end:C?O??(M?"outset":"none"):"outset"}),N=this.toD({startIdx:w,endIdx:x+1});u.push(y.jsx("path",{d:N,strokeDasharray:R,strokeDashoffset:F,markerStart:v?o:void 0,markerEnd:C?a:void 0},u.length))};for(let w=0;w<this.commands.length;w++){const x=this.commands[w],v=this.commands[w-1];if(x.type==="move"){f=x.closeIdx!==null;const M=x.opts?.geometry===!1?!1:x.opts?.geometry?.isFilled??!1;e.onlyFilled&&!M?h=!0:(h=!1,g=x.opts);continue}if(h)continue;const C=this.calculateSegmentLength(v,x),P=v.type==="move",k=x.isClose||w===this.commands.length-1||this.commands[w+1]?.type==="move";m&&x.opts?.mergeWithPrevious?(m.length+=C,m.endIdx=w,m.isLast=k):(b(),m={startIdx:w,endIdx:w,isFirst:P,isLast:k,length:C,lineOpts:g,pathIsClosed:f})}return b(),y.jsx("g",{strokeWidth:r,...l,children:u})}toDrawSvg(e){return y.jsx("path",{strokeWidth:e.strokeWidth,d:this.toDrawD(e),...e.props})}toDrawD(e){const{strokeWidth:n,randomSeed:r,offset:i=n/3,roundness:s=n*2,passes:o=2,onlyFilled:a=!1}=e,l=[],u=this.getCommandInfo(),f=[];let h=null;for(let g=0;g<this.commands.length;g++){const m=this.commands[g],b=m.opts?.offset??i,w=m.opts?.roundness??s;m.type==="move"&&(h=g);const x=m.isClose?Dr(h)+1:!this.commands[g+1]||this.commands[g+1].type==="move"?void 0:g+1,v=x!==void 0&&this.commands[x]&&this.commands[x]?.type!=="move"?u[x]:void 0,C=O5[m.type],P=x!==void 0?O5[this.commands[x].type]:!1,k=u[g],M=k?.tangentEnd,A=v?.tangentStart,O=C&&P&&M&&A&&I.Len2(M)>.01&&I.Len2(A)>.01?ma(Math.abs(I.AngleBetween(M,A)),[Math.PI/2,Math.PI],[w,0],!0):0,F=Math.min(k?.length??1/0,v?.length??1/0)-O*2,N=it(b,0,F/4),j=Math.min(O,(k?.length??1/0)/4),H=Math.min(O,(v?.length??1/0)/4),V={command:m,offsetAmount:N,roundnessBefore:j,roundnessAfter:H,tangentToPrev:u[g]?.tangentEnd,tangentToNext:v?.tangentStart,moveDidClose:!1};if(f.push(V),m.isClose&&h!==null){const z=f[h];z.moveDidClose=!0,z.roundnessAfter=H}else m.type==="move"&&(h=g)}for(let g=0;g<o;g++){const m=Bd(r+g);let b={x:0,y:0},w=!1;for(const{command:x,offsetAmount:v,roundnessBefore:C,roundnessAfter:P,tangentToNext:k,tangentToPrev:M}of f){const A=x.isClose?b:{x:m()*v,y:m()*v};if(x.type==="move"){b=A;const N=x.opts?.geometry===!1?!1:x.opts?.geometry?.isFilled??!1;a&&!N?w=!0:w=!1}if(w)continue;const O=I.Add(x,A),R=k&&P>0?I.Mul(k,-P).add(O):O,F=M&&C>0?I.Mul(M,C).add(O):O;if(R===O||F===O)switch(x.type){case"move":l.push("M",J(R.x),J(R.y));break;case"line":l.push("L",J(R.x),J(R.y));break;case"cubic":{const N=I.Add(x.cp1,A),j=I.Add(x.cp2,A);l.push("C",J(N.x),J(N.y),J(j.x),J(j.y),J(R.x),J(R.y));break}default:kt(x,"type")}else switch(x.type){case"move":l.push("M",J(R.x),J(R.y));break;case"line":l.push("L",J(F.x),J(F.y),"Q",J(O.x),J(O.y),J(R.x),J(R.y));break;case"cubic":{const N=I.Add(x.cp1,A),j=I.Add(x.cp2,A);l.push("C",J(N.x),J(N.y),J(j.x),J(j.y),J(O.x),J(O.y));break}default:kt(x,"type")}}}return l.join(" ")}calculateSegmentLength(e,n){switch(n.type){case"move":return 0;case"line":return I.Dist(e,n);case"cubic":return Mg.length(e.x,e.y,n.cp1.x,n.cp1.y,n.cp2.x,n.cp2.y,n.x,n.y);default:kt(n,"type")}}getCommands(){return this.commands}getCommandInfo(){const e=[];for(let n=1;n<this.commands.length;n++){const r=this.commands[n-1],i=this.commands[n];if(i._info){e[n]=i._info;continue}if(i.type==="move")continue;let s,o;switch(i.type){case"line":s=o=I.Sub(r,i).uni();break;case"cubic":{s=I.Sub(i.cp1,r).uni(),o=I.Sub(i.cp2,i).uni();break}default:kt(i,"type")}i._info={tangentStart:s,tangentEnd:o,length:this.calculateSegmentLength(r,i)},e[n]=i._info}return e}}const O5={line:!0,move:!0,cubic:!1};class OP extends Mu{constructor(e,n,r,i){super(i),this.path=e,this.startIdx=n,this.endIdx=r}_segments=null;getSegments(){if(this._segments)return this._segments;this._segments=[];let e=this.path.commands[this.startIdx];Be(e.type==="move");for(let n=this.startIdx+1;n<this.endIdx;n++){const r=this.path.commands[n];switch(Be(r.type!=="move"),r.type){case"line":this._segments.push(new Df({start:I.From(e),end:I.From(r)}));break;case"cubic":{this._segments.push(new Rk({start:I.From(e),cp1:I.From(r.cp1),cp2:I.From(r.cp2),end:I.From(r),resolution:r.resolution}));break}default:kt(r,"type")}e=r}return this._segments}getVertices(e){const n=this.getSegments().flatMap(r=>r.getVertices(e)).filter((r,i,s)=>{const o=s[i-1];return o?!I.Equals(o,r):!0});if(this.isClosed){const r=n[n.length-1],i=n[0];I.Equals(r,i)||n.push(i)}return n}nearestPoint(e,n){let r=null,i=1/0;for(const s of this.getSegments()){const o=s.nearestPoint(e),a=I.Dist2(e,o);a<i&&(i=a,r=o)}return Be(r,"No nearest point found"),r}hitTestLineSegment(e,n,r=0,i){return super.hitTestLineSegment(e,n,r,i)}getSvgPathData(){return this.path.toD({startIdx:this.startIdx,endIdx:this.endIdx})}}const Mg={base3(t,e,n,r,i){const s=-3*e+9*n-9*r+3*i,o=t*s+6*e-12*n+6*r;return t*o-3*e+3*n},length(t,e,n,r,i,s,o,a,l=1){l=l>1?1:l<0?0:l;const u=l/2,f=12;let h=0;h=0;for(let g=0;g<f;g++){const m=u*Mg.Tvalues[g]+u,b=Mg.base3(m,t,n,i,o),w=Mg.base3(m,e,r,s,a),x=b*b+w*w;h+=Mg.Cvalues[g]*Math.sqrt(x)}return u*h},Tvalues:[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],Cvalues:[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472]};function q$(){const t=Gn(),e=ee("animationSpeed",()=>t?.user.getAnimationSpeed(),[t]),[n,r]=E.useState(!1);return E.useEffect(()=>{if(e!==void 0){r(e===0);return}if(typeof window>"u"||!("matchMedia"in window))return;const i=window.matchMedia("(prefers-reduced-motion: reduce)"),s=()=>{r(i.matches)};return s(),i.addEventListener("change",s),()=>i.removeEventListener("change",s)},[e]),n}const DP=E.createContext(null);function Tfe({children:t}){const e=Xm("a11y",{msg:"",priority:"assertive"}),n=E.useContext(DP),r=E.useMemo(()=>({currentMsg:e,announce(i){i&&e.set(i)}}),[e]);return n?y.jsx(y.Fragment,{children:t}):y.jsx(DP.Provider,{value:r,children:t})}function S0(){const t=E.useContext(DP);if(!t)throw new Error("useA11y must be used within a A11yContext.Provider");return t}const G$=E.createContext(null);function Y$({assetUrls:t,children:e}){return E.useEffect(()=>{for(const n of Object.values(t.icons)){if(!n)continue;const r=lm();r.crossOrigin="anonymous",r.src=n,r.decode()}for(const n of Object.values(t.embedIcons)){if(!n)continue;const r=lm();r.crossOrigin="anonymous",r.src=n,r.decode()}},[t]),y.jsx(G$.Provider,{value:t,children:e})}function lM(){const t=E.useContext(G$);if(!t)throw new Error("useAssetUrls must be used within an AssetUrlsProvider");return t}const RP={"action.toggle-auto-pan":"Auto (trackpad)","action.toggle-auto-zoom":"Auto (mouse)","action.toggle-auto-none":"Auto","action.toggle-mouse":"Mouse","action.toggle-trackpad":"Trackpad","action.convert-to-bookmark":"Convert to bookmark","action.convert-to-embed":"Convert to embed","action.open-embed-link":"Open link","action.align-bottom":"Align bottom","action.align-center-horizontal":"Align horizontally","action.align-center-vertical":"Align vertically","action.align-center-horizontal.short":"Align H","action.align-center-vertical.short":"Align V","action.align-left":"Align left","action.align-right":"Align right","action.align-top":"Align top","action.back-to-content":"Back to content","action.bring-forward":"Bring forward","action.bring-to-front":"Bring to front","action.copy-as-png.short":"PNG","action.copy-as-png":"Copy as PNG","action.copy-as-svg.short":"SVG","action.copy-as-svg":"Copy as SVG","action.copy":"Copy","action.cut":"Cut","action.delete":"Delete","action.unlock-all":"Unlock all","action.distribute-horizontal":"Distribute horizontally","action.distribute-vertical":"Distribute vertically","action.distribute-horizontal.short":"Distribute H","action.distribute-vertical.short":"Distribute V","action.download-original":"Download original","action.duplicate":"Duplicate","action.edit-link":"Edit link","action.exit-pen-mode":"Exit pen mode","action.export-as-png.short":"PNG","action.export-as-png":"Export as PNG","action.export-as-svg.short":"SVG","action.export-as-svg":"Export as SVG","action.export-all-as-png.short":"PNG","action.export-all-as-png":"Export as PNG","action.export-all-as-svg.short":"SVG","action.export-all-as-svg":"Export as SVG","action.fit-frame-to-content":"Fit to content","action.flip-horizontal":"Flip horizontally","action.flip-vertical":"Flip vertically","action.flip-horizontal.short":"Flip H","action.flip-vertical.short":"Flip V","action.fork-project":"Fork this project","action.fork-project-on-tldraw":"Fork project on tldraw","action.group":"Group","action.insert-embed":"Insert embed","action.insert-media":"Upload media","action.leave-shared-project":"Leave shared project","action.new-project":"New project","action.new-shared-project":"New shared project","action.open-cursor-chat":"Cursor chat","action.open-kbd-shortcuts":"Open keyboard shortcuts","action.open-file":"Open file","action.pack":"Pack","action.paste":"Paste","action.paste-error-title":"Pasting failed","action.paste-error-description":"Could not paste due to missing clipboard permissions. Please enable the permissions and try again.","action.print":"Print","action.redo":"Redo","action.remove-frame":"Remove frame","action.rename":"Rename","action.rotate-ccw":"Rotate counterclockwise","action.rotate-cw":"Rotate clockwise","action.save-copy":"Save a copy","action.select-all":"Select all","action.select-none":"Select none","action.send-backward":"Send backward","action.send-to-back":"Send to back","action.share-project":"Share this project","action.stack-horizontal":"Stack horizontally","action.stack-vertical":"Stack vertically","action.stack-horizontal.short":"Stack H","action.stack-vertical.short":"Stack V","action.stop-following":"Stop following","action.stretch-horizontal":"Stretch horizontally","action.stretch-vertical":"Stretch vertically","action.stretch-horizontal.short":"Stretch H","action.stretch-vertical.short":"Stretch V","action.toggle-auto-size":"Toggle auto size","action.toggle-dark-mode.menu":"Dark mode","action.toggle-dark-mode":"Toggle dark mode","action.toggle-paste-at-cursor.menu":"Paste at cursor","action.toggle-paste-at-cursor":"Toggle paste at cursor","action.toggle-wrap-mode.menu":"Select on wrap","action.toggle-wrap-mode":"Toggle select on wrap","action.toggle-reduce-motion.menu":"Reduce motion","action.toggle-reduce-motion":"Toggle reduce motion","action.toggle-keyboard-shortcuts.menu":"Enable keyboard shortcuts","action.toggle-keyboard-shortcuts":"Toggle keyboard shortcuts","action.enhanced-a11y-mode.menu":"Enhanced accessibility mode","action.enhanced-a11y-mode":"Toggle enhanced accessibility mode","action.toggle-edge-scrolling.menu":"Edge scrolling","action.toggle-edge-scrolling":"Toggle edge scrolling","action.toggle-debug-mode.menu":"Debug mode","action.toggle-debug-mode":"Toggle debug mode","action.toggle-focus-mode.menu":"Focus mode","action.toggle-focus-mode":"Toggle focus mode","action.toggle-dynamic-size-mode.menu":"Dynamic size","action.toggle-dynamic-size-mode":"Toggle dynamic size","action.toggle-grid.menu":"Show grid","action.toggle-grid":"Toggle grid","action.toggle-lock":"Toggle locked","action.flatten-to-image":"Flatten","action.toggle-snap-mode.menu":"Always snap","action.toggle-snap-mode":"Toggle always snap","action.toggle-tool-lock.menu":"Tool lock","action.toggle-tool-lock":"Toggle tool lock","action.toggle-transparent.context-menu":"Transparent","action.toggle-transparent.menu":"Transparent","action.toggle-transparent":"Toggle transparent background","action.undo":"Undo","action.ungroup":"Ungroup","action.zoom-in":"Zoom in","action.zoom-out":"Zoom out","action.zoom-to-100":"Zoom to 100%","action.zoom-to-fit":"Zoom to fit","action.zoom-to-selection":"Zoom to selection","assets.files.size-too-big":"File size is too big","assets.files.maximum-size":"Maximum file size is {size}","assets.files.type-not-allowed":"File type is not allowed","assets.files.upload-failed":"Upload failed","assets.files.amount-too-many":"Too many files","assets.url.failed":"Couldn’t load URL preview","theme.dark":"Dark","theme.light":"Light","theme.system":"System","color-style.white":"White","color-style.black":"Black","color-style.blue":"Blue","color-style.green":"Green","color-style.grey":"Grey","color-style.light-blue":"Light blue","color-style.light-green":"Light green","color-style.light-red":"Light red","color-style.light-violet":"Light violet","color-style.orange":"Orange","color-style.red":"Red","color-style.violet":"Violet","color-style.yellow":"Yellow","fill-style.none":"None","document.default-name":"Untitled","fill-style.semi":"Semi","fill-style.solid":"Solid","fill-style.pattern":"Pattern","fill-style.fill":"Fill","fill-style.lined-fill":"Lined fill","dash-style.dashed":"Dashed","dash-style.dotted":"Dotted","dash-style.draw":"Draw","dash-style.solid":"Solid","size-style.s":"Small","size-style.m":"Medium","size-style.l":"Large","size-style.xl":"Extra large","opacity-style.0.1":"10%","opacity-style.0.25":"25%","opacity-style.0.5":"50%","opacity-style.0.75":"75%","opacity-style.1":"100%","font-style.draw":"Draw","font-style.sans":"Sans","font-style.serif":"Serif","font-style.mono":"Mono","align-style.start":"Start","align-style.middle":"Middle","align-style.end":"End","align-style.justify":"Justify","verticalAlign-style.start":"Top","verticalAlign-style.middle":"Middle","verticalAlign-style.end":"Bottom","geo-style.arrow-down":"Arrow down","geo-style.arrow-left":"Arrow left","geo-style.arrow-right":"Arrow right","geo-style.arrow-up":"Arrow up","geo-style.cloud":"Cloud","geo-style.diamond":"Diamond","geo-style.ellipse":"Ellipse","geo-style.heart":"Heart","geo-style.hexagon":"Hexagon","geo-style.octagon":"Octagon","geo-style.oval":"Oval","geo-style.pentagon":"Pentagon","geo-style.rectangle":"Rectangle","geo-style.rhombus":"Rhombus","geo-style.rhombus-2":"Rhombus left","geo-style.star":"Star","geo-style.trapezoid":"Trapezoid","geo-style.triangle":"Triangle","geo-style.x-box":"X box","geo-style.check-box":"Check box","arrowheadStart-style.none":"None","arrowheadStart-style.arrow":"Arrow","arrowheadStart-style.bar":"Bar","arrowheadStart-style.diamond":"Diamond","arrowheadStart-style.dot":"Dot","arrowheadStart-style.inverted":"Inverted","arrowheadStart-style.pipe":"Pipe","arrowheadStart-style.square":"Square","arrowheadStart-style.triangle":"Triangle","arrowheadEnd-style.none":"None","arrowheadEnd-style.arrow":"Arrow","arrowheadEnd-style.bar":"Bar","arrowheadEnd-style.diamond":"Diamond","arrowheadEnd-style.dot":"Dot","arrowheadEnd-style.inverted":"Inverted","arrowheadEnd-style.pipe":"Pipe","arrowheadEnd-style.square":"Square","arrowheadEnd-style.triangle":"Triangle","spline-style.line":"Line","spline-style.cubic":"Cubic","arrow-kind-style.arc":"Arc","arrow-kind-style.elbow":"Elbow","tool.select":"Select","tool.hand":"Hand","tool.draw":"Draw","tool.eraser":"Eraser","tool.arrow-down":"Arrow down","tool.arrow-left":"Arrow left","tool.arrow-right":"Arrow right","tool.arrow-up":"Arrow up","tool.arrow":"Arrow","tool.cloud":"Cloud","tool.diamond":"Diamond","tool.ellipse":"Ellipse","tool.heart":"Heart","tool.hexagon":"Hexagon","tool.highlight":"Highlight","tool.line":"Line","tool.octagon":"Octagon","tool.oval":"Oval","tool.pentagon":"Pentagon","tool.rectangle":"Rectangle","tool.rhombus":"Rhombus","tool.star":"Star","tool.trapezoid":"Trapezoid","tool.triangle":"Triangle","tool.x-box":"X box","tool.check-box":"Check box","tool.media":"Media","tool.frame":"Frame","tool.note":"Note","tool.laser":"Laser","tool.embed":"Embed","tool.text":"Text","tool.pointer-down":"Pointer down","tool.image-zoom":"Zoom","tool.replace-media":"Replace media","tool.flip-horz":"Flip horizontally","tool.flip-vert":"Flip vertically","tool.rotate-cw":"Rotate","tool.aspect-ratio":"Aspect ratio","tool.aspect-ratio.original":"Original","tool.aspect-ratio.square":"Square (1:1)","tool.aspect-ratio.circle":"Circle (1:1)","tool.aspect-ratio.landscape":"Landscape (4:3)","tool.aspect-ratio.portrait":"Portrait (3:4)","tool.aspect-ratio.wide":"Wide (16:9)","tool.image-toolbar-title":"Image tools","tool.image-crop":"Crop image","tool.image-crop-confirm":"Confirm","tool.media-alt-text":"Alternative text","tool.media-alt-text-desc":"Give a description…","tool.media-alt-text-confirm":"Confirm","tool.rich-text-bold":"Bold","tool.rich-text-italic":"Italic","tool.rich-text-code":"Code","tool.rich-text-highlight":"Highlight","tool.rich-text-strikethrough":"Strikethrough","tool.rich-text-link":"Link","tool.rich-text-link-visit":"Visit link","tool.rich-text-link-remove":"Remove link","tool.rich-text-header":"Header","tool.rich-text-bulletList":"Bulleted list","tool.rich-text-toolbar-title":"Text formatting","tool.rich-text-orderedList":"Ordered list","tool.bookmark":"Bookmark","a11y.status":"Status","a11y.skip-to-main-content":"Move focus to canvas","a11y.shape-index":"{num} of {total}","a11y.shape-image":"Image","a11y.shape-video":"Video","a11y.multiple-shapes":"{num} shapes selected","a11y.select-shape":"Select next shape","a11y.select-shape-direction":"Select shape in direction","a11y.enter-leave-container":"Enter/leave container","a11y.repeat-shape":"Repeat shape","a11y.move-shape":"Move shape","a11y.move-shape-faster":"Move shape faster","a11y.rotate-shape-cw":"Rotate shape clockwise","a11y.rotate-shape-ccw":"Rotate shape counterclockwise","a11y.rotate-shape-cw-fine":"Rotate shape clockwise (fine)","a11y.rotate-shape-ccw-fine":"Rotate shape counterclockwise (fine)","a11y.enlarge-shape":"Enlarge shape","a11y.shrink-shape":"Shrink shape","a11y.pan-camera":"Pan camera","a11y.adjust-shape-styles":"Adjust shape styles","a11y.open-context-menu":"Open context menu","a11y.open-keyboard-shortcuts":"Open keyboard shortcuts","menu.title":"Menu","menu.theme":"Theme","menu.accessibility":"Accessibility","menu.copy-as":"Copy as","menu.edit":"Edit","menu.export-as":"Export as","menu.file":"File","menu.language":"Language","menu.preferences":"Preferences","menu.view":"View","menu.input-mode":"Input mode","context-menu.title":"Context menu","context-menu.edit":"Edit","context-menu.arrange":"Arrange","context-menu.copy-as":"Copy as","context-menu.export-as":"Export as","context-menu.export-all-as":"Export","context-menu.move-to-page":"Move to page","context-menu.reorder":"Reorder","page-menu.title":"Pages","page-menu.create-new-page":"Create new page","page-menu.max-page-count-reached":"Max pages reached","page-menu.new-page-initial-name":"Page 1","page-menu.edit-start":"Edit","page-menu.edit-done":"Done","page-menu.go-to-page":"Go to page","page-menu.submenu.rename":"Rename","page-menu.submenu.duplicate-page":"Duplicate","page-menu.submenu.title":"Menu","page-menu.submenu.move-down":"Move down","page-menu.submenu.move-up":"Move up","page-menu.submenu.delete":"Delete","share-menu.title":"Share","share-menu.save-note":"Download this project to your computer as a .tldr file.","share-menu.fork-note":"Create a new shared project based on this snapshot.","share-menu.share-project":"Share this project","share-menu.copy-link":"Copy editor link","share-menu.create-snapshot-link":"Copy snapshot link","share-menu.snapshot-link-note":"Capture and share this project as a read-only snapshot link.","share-menu.copy-readonly-link":"Copy viewer link","share-menu.offline-note":"Create a new shared project based on your current project.","share-menu.copy-link-note":"Anyone with the link will be able to view and edit this project.","share-menu.copy-readonly-link-note":"Anyone with the link will be able to access this project.","share-menu.project-too-large":"Sorry, this project can’t be shared because it’s too large. We’re working on it!","share-menu.upload-failed":"Sorry, we couldn’t upload your project at the moment. Please try again or let us know if the problem persists.","share-menu.creating-project":"Creating the new project…","share-menu.copied":"Copied link","document-name-menu.copy-link":"Copy link","status.offline":"Offline","people-menu.title":"People","people-menu.change-name":"Change name","people-menu.avatar-color":"Avatar color","people-menu.change-color":"Change color","people-menu.follow":"Following","people-menu.following":"Following","people-menu.leading":"Following you","people-menu.user":"(You)","people-menu.invite":"Invite others","people-menu.anonymous-user":"New user","help-menu.import-tldr-file":"Import file…","help-menu.title":"Help and resources","help-menu.about":"About tldraw","help-menu.discord":"Discord","help-menu.github":"GitHub","help-menu.keyboard-shortcuts":"Keyboard shortcuts","help-menu.twitter":"Twitter","help-menu.terms":"Terms of service","help-menu.privacy":"Privacy policy","actions-menu.title":"Actions","edit-link-dialog.title":"Edit link","edit-link-dialog.invalid-url":"A link must be a valid URL.","edit-link-dialog.detail":"Links will open in a new tab.","edit-link-dialog.url":"URL","edit-link-dialog.clear":"Clear","edit-link-dialog.save":"Continue","edit-link-dialog.cancel":"Cancel","edit-link-dialog.external-link":"External link","embed-dialog.title":"Insert embed","embed-dialog.back":"Back","embed-dialog.create":"Create","embed-dialog.cancel":"Cancel","embed-dialog.url":"URL","embed-dialog.instruction":"Paste in the site’s URL to create the embed.","embed-dialog.invalid-url":"We could not create an embed from that URL.","shortcuts-dialog.title":"Keyboard shortcuts","shortcuts-dialog.edit":"Edit","shortcuts-dialog.file":"File","shortcuts-dialog.preferences":"Preferences","shortcuts-dialog.tools":"Tools","shortcuts-dialog.transform":"Transform","shortcuts-dialog.view":"View","shortcuts-dialog.collaboration":"Collaboration","shortcuts-dialog.a11y":"Accessibility","shortcuts-dialog.text-formatting":"Text formatting","style-panel.title":"Styles","style-panel.align":"Align","style-panel.label-align":"Label align","style-panel.vertical-align":"Vertical align","style-panel.position":"Position","style-panel.arrowheads":"Arrows","style-panel.arrowhead-start":"Start","style-panel.arrowhead-end":"End","style-panel.arrow-kind":"Line","style-panel.color":"Color","style-panel.dash":"Dash","style-panel.fill":"Fill","style-panel.font":"Font","style-panel.geo":"Shape","style-panel.mixed":"Mixed","style-panel.opacity":"Opacity","style-panel.size":"Size","style-panel.spline":"Spline","style-panel.selected":"selected","tool-panel.title":"Tools","tool-panel.more":"More","navigation-zone.title":"Navigation","navigation-zone.minimap":"Minimap","navigation-zone.toggle-minimap":"Toggle minimap","navigation-zone.zoom":"Zoom","focus-mode.toggle-focus-mode":"Toggle focus mode","toast.close":"Close","toast.success":"Success","toast.error":"Error","toast.info":"Info","toast.warning":"Warning","file-system.file-open-error.title":"Could not open file","file-system.file-open-error.not-a-tldraw-file":"The file you tried to open doesn’t look like a tldraw file.","file-system.file-open-error.file-format-version-too-new":"The file you tried to open is from a newer version of tldraw. Please reload the page and try again.","file-system.file-open-error.generic-corrupted-file":"The file you tried to open is corrupted.","file-system.confirm-open.title":"Overwrite current project?","file-system.confirm-open.description":"Opening a file will replace your current project and any unsaved changes will be lost. Are you sure you want to continue?","file-system.confirm-open.cancel":"Cancel","file-system.confirm-open.open":"Open file","file-system.confirm-open.dont-show-again":"Don’t ask again","file-system.confirm-clear.title":"Clear current project?","file-system.confirm-clear.description":"Creating a new project will clear your current project and any unsaved changes will be lost. Are you sure you want to continue?","file-system.confirm-clear.cancel":"Cancel","file-system.confirm-clear.continue":"Continue","file-system.confirm-clear.dont-show-again":"Don’t ask again","file-system.shared-document-file-open-error.title":"Could not open file","file-system.shared-document-file-open-error.description":"Opening files from shared projects is not supported.","sharing.confirm-leave.title":"Leave current project?","sharing.confirm-leave.description":"Are you sure you want to leave this shared project? You can return to it by navigating to its URL.","sharing.confirm-leave.cancel":"Cancel","sharing.confirm-leave.leave":"Leave","sharing.confirm-leave.dont-show-again":"Don’t ask again","toast.error.export-fail.title":"Failed export","toast.error.export-fail.desc":"Failed to export image","toast.error.copy-fail.title":"Failed copy","toast.error.copy-fail.desc":"Failed to copy image","context.pages.new-page":"New page","vscode.file-open.desc":"We’ve updated this document to work with the current version of tldraw. If you’d like to keep the original version (which will work on old.tldraw.com), click below to create a backup.","vscode.file-open.open":"Continue","vscode.file-open.backup":"Backup","vscode.file-open.backup-saved":"Backup saved","vscode.file-open.backup-failed":"Backup failed: this is not a .tldr file.","vscode.file-open.dont-show-again":"Don’t ask again","cursor-chat.type-to-chat":"Type to chat…","app.loading":"Loading tldraw…","handle.resize-top":"Resize top","handle.resize-bottom":"Resize bottom","handle.resize-left":"Resize left","handle.resize-right":"Resize right","handle.resize-top-left":"Resize top left","handle.resize-top-right":"Resize top right","handle.resize-bottom-left":"Resize bottom left","handle.resize-bottom-right":"Resize bottom right","handle.rotate.top_left_rotate":"Rotate top left","handle.rotate.top_right_rotate":"Rotate top right","handle.rotate.bottom_left_rotate":"Rotate bottom left","handle.rotate.bottom_right_rotate":"Rotate bottom right","handle.rotate.mobile_rotate":"Rotate","handle.crop.top":"Crop top","handle.crop.bottom":"Crop bottom","handle.crop.left":"Crop left","handle.crop.right":"Crop right","handle.crop.top-left":"Crop top left","handle.crop.top-right":"Crop top right","handle.crop.bottom-left":"Crop bottom left","handle.crop.bottom-right":"Crop bottom right","ui.close":"Close","ui.checked":"Checked","ui.unchecked":"Unchecked"},Efe=new Set(["ar","fa","he","ur","ku"]),Gh={locale:"en",label:"English",messages:RP,dir:"ltr"};async function _fe(t,e){if(!(await Gl(e.translations.en)).ok)return console.warn("No main translations found."),Gh;if(t==="en")return Gh;const r=hm.find(o=>o.locale===t);if(!r)return console.warn(`No translation found for locale ${t}`),Gh;const s=await(await Gl(e.translations[r.locale])).json();if(!s)return console.warn(`No messages found for locale ${t}`),Gh;for(const o in Gh.messages)s[o];return{locale:t,label:r.label,dir:Efe.has(r.locale)?"rtl":"ltr",messages:{...Gh.messages,...s}}}const cM=E.createContext(null);function Pfe(){const t=E.useContext(cM);if(!t)throw new Error("useCurrentTranslation must be used inside of <TldrawUiContextProvider />");return t}function W$({overrides:t,locale:e,children:n}){const r=lM(),[i,s]=E.useState(()=>t&&t.en?{locale:"en",label:"English",dir:"ltr",messages:{...RP,...t.en}}:{locale:"en",label:"English",dir:"ltr",messages:RP});return E.useEffect(()=>{let o=!1;async function a(){const l=await _fe(e,r);l&&!o&&(t&&t[e]?s({...l,messages:{...l.messages,...t[e]}}):s(l))}return a(),()=>{o=!0}},[r,e,t]),y.jsx(cM.Provider,{value:i,children:n})}function Ne(){const t=Pfe();return E.useCallback(function(n){return t.messages[n]??n},[t])}const Ife={normal:"tlui-button__normal",primary:"tlui-button__primary",danger:"tlui-button__danger",low:"tlui-button__low",icon:"tlui-button__icon",tool:"tlui-button__tool",menu:"tlui-button__menu",help:"tlui-button__help"},gt=E.forwardRef(function({children:e,type:n,htmlButtonType:r,isActive:i,...s},o){return y.jsx("button",{ref:o,type:r||"button",draggable:!1,"data-isactive":i,...s,className:Fe("tlui-button",Ife[n],s.className),children:e})});function kfe(){const t=te(),e=Ne(),n=E.useRef(null),r=E.useCallback(i=>{t.markEventAsHandled(i),n.current?.blur();const s=t.getCurrentPageShapesInReadingOrder();s.length&&(t.setSelectedShapes([s[0].id]),t.zoomToSelectionIfOffscreen(256,{animation:{duration:t.options.animationMediumMs},inset:0}),t.timers.setTimeout(()=>t.getContainer().focus(),100))},[t]);return y.jsx(gt,{ref:n,type:"low",tabIndex:0,className:"tl-skip-to-main-content",onClick:r,children:e("a11y.skip-to-main-content")})}const Mfe=E.memo(function(){const e=S0(),n=Ne(),r=ee("a11y-msg",()=>e.currentMsg.get(),[]);return Ofe(r.msg),Afe(),r.msg&&y.jsx("div",{"aria-label":n("a11y.status"),"aria-live":r.priority||"assertive",role:"status","aria-hidden":"false",style:{position:"absolute",top:"-10000px",left:"-10000px"},children:r.msg})});function X$(t){const{editor:e,selectedShapeIds:n,msg:r}=t;let i="";const s=n.length;if(s>1)i=r("a11y.multiple-shapes").replace("{num}",s.toString());else if(s===1){const o=n[0],a=e.getShape(o);if(!a)return"";const l=e.getShapeUtil(a.type),u=["image","video"].includes(a.type);let f="";a.type==="geo"?f=r(`geo-style.${a.props.geo}`):u?f=r(`a11y.shape-${a.type}`):f=r(`tool.${a.type}`);const h=e.getCurrentPageShapesInReadingOrder(),g=(h.findIndex(x=>x.id===o)+1).toString(),m=h.length.toString(),b=r("a11y.shape-index").replace("{num}",g).replace("{total}",m),w=l.getAriaDescriptor(a)||l.getText(a)||"";i=(w?`${w}, `:"")+`${f}. ${b}`}return i}const Afe=()=>{const t=Gn(),e=S0(),n=Ne(),r=E.useRef([]);KI("announce selection",()=>{if(!t)return;if(t.isIn("select.idle")){const s=t.getSelectedShapeIds();s!==r.current&&(r.current=s,Tg(()=>{const o=X$({editor:t,selectedShapeIds:s,msg:n});o&&e.announce({msg:o})}))}},[t,e,n])},Ofe=t=>{const e=ur();E.useEffect(()=>{if(In.a11y.get()){const n=i=>{console.debug(`%ca11y%c: ${i}`,"color: white; background: #40C057; padding: 2px;border-radius: 3px;","font-weight: normal")},r=i=>{const s=document.activeElement;if(i.key==="Tab"&&s&&s!==document.body&&!s.classList.contains("tl-container")){const o=s.getAttribute("aria-label")||s.getAttribute("title")||s.textContent;o&&n(o)}};return t&&n(t),document.addEventListener("keyup",r),()=>document.removeEventListener("keyup",r)}},[e,t])},_m=300,uM=320,jP=46,Dfe=101;function Z$(t,e){const n=e?t.getAsset(e):null;return n&&!n.props.image?n.props.title?Dfe:jP:uM}function D5(t,e){return{...e,props:{...e.props,h:Z$(t,e.props.assetId)}}}const Rfe=t=>{try{return new URL(t).hostname.replace(/^www\./,"")}catch{return t}};function jfe(t,e){const{url:n}=e.props,r=Kd.createId(NB(n));t.getAsset(r)?e.props.assetId!==r&&t.updateShapes([{id:e.id,type:e.type,props:{assetId:r}}]):(t.updateShapes([{id:e.id,type:e.type,props:{assetId:null}}]),Lfe(t,e))}const Lfe=wx(async(t,e)=>{if(t.isDisposed)return;const{url:n}=e.props,r=await t.getAssetForExternalContent({type:"url",url:n});r&&t.run(()=>{t.createAssets([r]),t.updateShapes([{id:e.id,type:e.type,props:{assetId:r.id}}])})},500);async function J$(t,{url:e,center:n=t.getViewportPageBounds().center}){try{const r=await t.getAssetForExternalContent({type:"url",url:e}),i=sn(),s={id:i,type:"bookmark",x:n.x-_m/2,y:n.y-uM/2,rotation:0,opacity:1,props:{url:e,assetId:r?.id||null,w:_m,h:Z$(t,r?.id)}};t.run(()=>{r&&t.createAssets([r]),t.createShapes([s])});const o=t.getShape(i);return ri.ok(o)}catch(r){return ri.err(r instanceof Error?r.message:"Failed to create bookmark")}}function Nfe(t,e){const n=tt(e.map(i=>t.getShape(i)).filter(i=>i&&t.isShapeOfType(i,"frame")));if(!n.length)return;const r=[];t.run(()=>{n.map(i=>{const s=t.getSortedChildIdsForParent(i.id);s.length&&(Xt(t,s,{filter:o=>!n.find(a=>a.id===o.id)}),r.push(...s))}),t.setSelectedShapes(r),t.deleteShapes(e)})}const R5=50;function Q$(t,e,n={padding:R5}){const r=we.FromPoints(t.flatMap(u=>{if(!u)return[];const f=e.getShapeGeometry(u.id);return e.getShapeLocalTransform(u)?.applyToPoints(f.vertices)??[]})),i=n.padding??R5,s=r.w+2*i,o=r.h+2*i,a=i-r.minX,l=i-r.minY;return{w:s,h:o,dx:a,dy:l}}function e7(t,e,n={}){const r=t.getShape(e);if(!r)return;const i=t.getSortedChildIdsForParent(r.id),s=tt(i.map(h=>t.getShape(h)));if(!s.length)return;const{w:o,h:a,dx:l,dy:u}=Q$(s,t,n);if(l===0&&u===0&&r.props.w===o&&r.props.h===a)return;const f=new I(l,u).rot(r.rotation);t.run(()=>{const h=i.map(g=>{const m=t.getShape(g);return{id:m.id,type:m.type,x:m.x+l,y:m.y+u}});h.push({id:r.id,type:r.type,x:r.x-f.x,y:r.y-f.y,props:{w:o,h:a}}),t.updateShapes(h)})}function sr({children:t}){return y.jsx("span",{className:"tlui-button__label",children:t})}function j5(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function b0(...t){return e=>{let n=!1;const r=t.map(i=>{const s=j5(i,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():j5(t[i],null)}}}}function Zt(...t){return E.useCallback(b0(...t),t)}function Dd(t){const e=zfe(t),n=E.forwardRef((r,i)=>{const{children:s,...o}=r,a=E.Children.toArray(s),l=a.find(Ffe);if(l){const u=l.props.children,f=a.map(h=>h===l?E.Children.count(u)>1?E.Children.only(null):E.isValidElement(u)?u.props.children:null:h);return y.jsx(e,{...o,ref:i,children:E.isValidElement(u)?E.cloneElement(u,void 0,f):null})}return y.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}var dM=Dd("Slot");function zfe(t){const e=E.forwardRef((n,r)=>{const{children:i,...s}=n;if(E.isValidElement(i)){const o=Hfe(i),a=Ufe(s,i.props);return i.type!==E.Fragment&&(a.ref=r?b0(r,o):o),E.cloneElement(i,a)}return E.Children.count(i)>1?E.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var t7=Symbol("radix.slottable");function Bfe(t){const e=({children:n})=>y.jsx(y.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=t7,e}function Ffe(t){return E.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===t7}function Ufe(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function Hfe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var $fe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ht=$fe.reduce((t,e)=>{const n=Dd(`Primitive.${e}`),r=E.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{});function hM(t,e){t&&qd.flushSync(()=>t.dispatchEvent(e))}var Kfe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Vfe="VisuallyHidden",v0=E.forwardRef((t,e)=>y.jsx(ht.span,{...t,ref:e,style:{...Kfe,...t.style}}));v0.displayName=Vfe;var qfe=v0;function Gfe(t,e){const n=E.createContext(e),r=s=>{const{children:o,...a}=s,l=E.useMemo(()=>a,Object.values(a));return y.jsx(n.Provider,{value:l,children:o})};r.displayName=t+"Provider";function i(s){const o=E.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${s}\` must be used within \`${t}\``)}return[r,i]}function po(t,e=[]){let n=[];function r(s,o){const a=E.createContext(o),l=n.length;n=[...n,o];const u=h=>{const{scope:g,children:m,...b}=h,w=g?.[t]?.[l]||a,x=E.useMemo(()=>b,Object.values(b));return y.jsx(w.Provider,{value:x,children:m})};u.displayName=s+"Provider";function f(h,g){const m=g?.[t]?.[l]||a,b=E.useContext(m);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${s}\``)}return[u,f]}const i=()=>{const s=n.map(o=>E.createContext(o));return function(a){const l=a?.[t]||s;return E.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return i.scopeName=t,[r,Yfe(i,...e)]}function Yfe(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(s)[`__scope${u}`];return{...a,...h}},{});return E.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function x0(t){const e=t+"CollectionProvider",[n,r]=po(e),[i,s]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:x,children:v}=w,C=qe.useRef(null),P=qe.useRef(new Map).current;return y.jsx(i,{scope:x,itemMap:P,collectionRef:C,children:v})};o.displayName=e;const a=t+"CollectionSlot",l=Dd(a),u=qe.forwardRef((w,x)=>{const{scope:v,children:C}=w,P=s(a,v),k=Zt(x,P.collectionRef);return y.jsx(l,{ref:k,children:C})});u.displayName=a;const f=t+"CollectionItemSlot",h="data-radix-collection-item",g=Dd(f),m=qe.forwardRef((w,x)=>{const{scope:v,children:C,...P}=w,k=qe.useRef(null),M=Zt(x,k),A=s(f,v);return qe.useEffect(()=>(A.itemMap.set(k,{ref:k,...P}),()=>{A.itemMap.delete(k)})),y.jsx(g,{[h]:"",ref:M,children:C})});m.displayName=f;function b(w){const x=s(t+"CollectionConsumer",w);return qe.useCallback(()=>{const C=x.collectionRef.current;if(!C)return[];const P=Array.from(C.querySelectorAll(`[${h}]`));return Array.from(x.itemMap.values()).sort((A,O)=>P.indexOf(A.ref.current)-P.indexOf(O.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:u,ItemSlot:m},b,r]}function Re(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t?.(i),n===!1||!i.defaultPrevented)return e?.(i)}}var Wl=globalThis?.document?E.useLayoutEffect:()=>{},Wfe=AB[" useInsertionEffect ".trim().toString()]||Wl;function qo({prop:t,defaultProp:e,onChange:n=()=>{},caller:r}){const[i,s,o]=Xfe({defaultProp:e,onChange:n}),a=t!==void 0,l=a?t:i;{const f=E.useRef(t!==void 0);E.useEffect(()=>{const h=f.current;h!==a&&console.warn(`${r} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=E.useCallback(f=>{if(a){const h=Zfe(f)?f(t):f;h!==t&&o.current?.(h)}else s(f)},[a,t,s,o]);return[l,u]}function Xfe({defaultProp:t,onChange:e}){const[n,r]=E.useState(t),i=E.useRef(n),s=E.useRef(e);return Wfe(()=>{s.current=e},[e]),E.useEffect(()=>{i.current!==n&&(s.current?.(n),i.current=n)},[n,i]),[n,r,s]}function Zfe(t){return typeof t=="function"}function Jfe(t,e){return E.useReducer((n,r)=>e[n][r]??n,t)}var Go=t=>{const{present:e,children:n}=t,r=Qfe(e),i=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),s=Zt(r.ref,epe(i));return typeof n=="function"||r.isPresent?E.cloneElement(i,{ref:s}):null};Go.displayName="Presence";function Qfe(t){const[e,n]=E.useState(),r=E.useRef(null),i=E.useRef(t),s=E.useRef("none"),o=t?"mounted":"unmounted",[a,l]=Jfe(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const u=QS(r.current);s.current=a==="mounted"?u:"none"},[a]),Wl(()=>{const u=r.current,f=i.current;if(f!==t){const g=s.current,m=QS(u);t?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(f&&g!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Wl(()=>{if(e){let u;const f=e.ownerDocument.defaultView??window,h=m=>{const w=QS(r.current).includes(CSS.escape(m.animationName));if(m.target===e&&w&&(l("ANIMATION_END"),!i.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",u=f.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},g=m=>{m.target===e&&(s.current=QS(r.current))};return e.addEventListener("animationstart",g),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{f.clearTimeout(u),e.removeEventListener("animationstart",g),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:E.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function QS(t){return t?.animationName||"none"}function epe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var tpe=AB[" useId ".trim().toString()]||(()=>{}),npe=0;function Va(t){const[e,n]=E.useState(tpe());return Wl(()=>{n(r=>r??String(npe++))},[t]),e?`radix-${e}`:""}var rpe=E.createContext(void 0);function py(t){const e=E.useContext(rpe);return t||e||"ltr"}function rs(t){const e=E.useRef(t);return E.useEffect(()=>{e.current=t}),E.useMemo(()=>(...n)=>e.current?.(...n),[])}function ipe(t,e=globalThis?.document){const n=rs(t);E.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var spe="DismissableLayer",LP="dismissableLayer.update",ope="dismissableLayer.pointerDownOutside",ape="dismissableLayer.focusOutside",L5,n7=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ip=E.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=t,u=E.useContext(n7),[f,h]=E.useState(null),g=f?.ownerDocument??globalThis?.document,[,m]=E.useState({}),b=Zt(e,O=>h(O)),w=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=w.indexOf(x),C=f?w.indexOf(f):-1,P=u.layersWithOutsidePointerEventsDisabled.size>0,k=C>=v,M=cpe(O=>{const R=O.target,F=[...u.branches].some(N=>N.contains(R));!k||F||(i?.(O),o?.(O),O.defaultPrevented||a?.())},g),A=upe(O=>{const R=O.target;[...u.branches].some(N=>N.contains(R))||(s?.(O),o?.(O),O.defaultPrevented||a?.())},g);return ipe(O=>{C===u.layers.size-1&&(r?.(O),!O.defaultPrevented&&a&&(O.preventDefault(),a()))},g),E.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(L5=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),N5(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=L5)}},[f,g,n,u]),E.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),N5())},[f,u]),E.useEffect(()=>{const O=()=>m({});return document.addEventListener(LP,O),()=>document.removeEventListener(LP,O)},[]),y.jsx(ht.div,{...l,ref:b,style:{pointerEvents:P?k?"auto":"none":void 0,...t.style},onFocusCapture:Re(t.onFocusCapture,A.onFocusCapture),onBlurCapture:Re(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Re(t.onPointerDownCapture,M.onPointerDownCapture)})});ip.displayName=spe;var lpe="DismissableLayerBranch",r7=E.forwardRef((t,e)=>{const n=E.useContext(n7),r=E.useRef(null),i=Zt(e,r);return E.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),y.jsx(ht.div,{...t,ref:i})});r7.displayName=lpe;function cpe(t,e=globalThis?.document){const n=rs(t),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){i7(ope,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",s),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function upe(t,e=globalThis?.document){const n=rs(t),r=E.useRef(!1);return E.useEffect(()=>{const i=s=>{s.target&&!r.current&&i7(ape,n,{originalEvent:s},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function N5(){const t=new CustomEvent(LP);document.dispatchEvent(t)}function i7(t,e,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?hM(i,s):i.dispatchEvent(s)}var dpe=ip,hpe=r7,i_="focusScope.autoFocusOnMount",s_="focusScope.autoFocusOnUnmount",z5={bubbles:!1,cancelable:!0},fpe="FocusScope",w0=E.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=t,[a,l]=E.useState(null),u=rs(i),f=rs(s),h=E.useRef(null),g=Zt(e,w=>l(w)),m=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let w=function(P){if(m.paused||!a)return;const k=P.target;a.contains(k)?h.current=k:Vc(h.current,{select:!0})},x=function(P){if(m.paused||!a)return;const k=P.relatedTarget;k!==null&&(a.contains(k)||Vc(h.current,{select:!0}))},v=function(P){if(document.activeElement===document.body)for(const M of P)M.removedNodes.length>0&&Vc(a)};document.addEventListener("focusin",w),document.addEventListener("focusout",x);const C=new MutationObserver(v);return a&&C.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",x),C.disconnect()}}},[r,a,m.paused]),E.useEffect(()=>{if(a){F5.add(m);const w=document.activeElement;if(!a.contains(w)){const v=new CustomEvent(i_,z5);a.addEventListener(i_,u),a.dispatchEvent(v),v.defaultPrevented||(ppe(bpe(s7(a)),{select:!0}),document.activeElement===w&&Vc(a))}return()=>{a.removeEventListener(i_,u),setTimeout(()=>{const v=new CustomEvent(s_,z5);a.addEventListener(s_,f),a.dispatchEvent(v),v.defaultPrevented||Vc(w??document.body,{select:!0}),a.removeEventListener(s_,f),F5.remove(m)},0)}}},[a,u,f,m]);const b=E.useCallback(w=>{if(!n&&!r||m.paused)return;const x=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,v=document.activeElement;if(x&&v){const C=w.currentTarget,[P,k]=gpe(C);P&&k?!w.shiftKey&&v===k?(w.preventDefault(),n&&Vc(P,{select:!0})):w.shiftKey&&v===P&&(w.preventDefault(),n&&Vc(k,{select:!0})):v===C&&w.preventDefault()}},[n,r,m.paused]);return y.jsx(ht.div,{tabIndex:-1,...o,ref:g,onKeyDown:b})});w0.displayName=fpe;function ppe(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(Vc(r,{select:e}),document.activeElement!==n)return}function gpe(t){const e=s7(t),n=B5(e,t),r=B5(e.reverse(),t);return[n,r]}function s7(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function B5(t,e){for(const n of t)if(!mpe(n,{upTo:e}))return n}function mpe(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function ype(t){return t instanceof HTMLInputElement&&"select"in t}function Vc(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&ype(t)&&e&&t.select()}}var F5=Spe();function Spe(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=U5(t,e),t.unshift(e)},remove(e){t=U5(t,e),t[0]?.resume()}}}function U5(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function bpe(t){return t.filter(e=>e.tagName!=="A")}var vpe="Portal",gy=E.forwardRef((t,e)=>{const{container:n,...r}=t,[i,s]=E.useState(!1);Wl(()=>s(!0),[]);const o=n||i&&globalThis?.document?.body;return o?Lne.createPortal(y.jsx(ht.div,{...r,ref:e}),o):null});gy.displayName=vpe;var o_=0;function fM(){E.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??H5()),document.body.insertAdjacentElement("beforeend",t[1]??H5()),o_++,()=>{o_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),o_--}},[])}function H5(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Fa=function(){return Fa=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Fa.apply(this,arguments)};function o7(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function xpe(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}var Bb="right-scroll-bar-position",Fb="width-before-scroll-bar",wpe="with-scroll-bars-hidden",Cpe="--removed-body-scroll-bar-size";function a_(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Tpe(t,e){var n=E.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var Epe=typeof window<"u"?E.useLayoutEffect:E.useEffect,$5=new WeakMap;function _pe(t,e){var n=Tpe(null,function(r){return t.forEach(function(i){return a_(i,r)})});return Epe(function(){var r=$5.get(n);if(r){var i=new Set(r),s=new Set(t),o=n.current;i.forEach(function(a){s.has(a)||a_(a,null)}),s.forEach(function(a){i.has(a)||a_(a,o)})}$5.set(n,t)},[t]),n}function Ppe(t){return t}function Ipe(t,e){e===void 0&&(e=Ppe);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(s){var o=e(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var l=function(){var f=o;o=[],f.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){o.push(f),u()},filter:function(f){return o=o.filter(f),n}}}};return i}function kpe(t){t===void 0&&(t={});var e=Ipe(null);return e.options=Fa({async:!0,ssr:!1},t),e}var a7=function(t){var e=t.sideCar,n=o7(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return E.createElement(r,Fa({},n))};a7.isSideCarExport=!0;function Mpe(t,e){return t.useMedium(e),a7}var l7=kpe(),l_=function(){},C0=E.forwardRef(function(t,e){var n=E.useRef(null),r=E.useState({onScrollCapture:l_,onWheelCapture:l_,onTouchMoveCapture:l_}),i=r[0],s=r[1],o=t.forwardProps,a=t.children,l=t.className,u=t.removeScrollBar,f=t.enabled,h=t.shards,g=t.sideCar,m=t.noRelative,b=t.noIsolation,w=t.inert,x=t.allowPinchZoom,v=t.as,C=v===void 0?"div":v,P=t.gapMode,k=o7(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=g,A=_pe([n,e]),O=Fa(Fa({},k),i);return E.createElement(E.Fragment,null,f&&E.createElement(M,{sideCar:l7,removeScrollBar:u,shards:h,noRelative:m,noIsolation:b,inert:w,setCallbacks:s,allowPinchZoom:!!x,lockRef:n,gapMode:P}),o?E.cloneElement(E.Children.only(a),Fa(Fa({},O),{ref:A})):E.createElement(C,Fa({},O,{className:l,ref:A}),a))});C0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};C0.classNames={fullWidth:Fb,zeroRight:Bb};var Ape=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ope(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Ape();return e&&t.setAttribute("nonce",e),t}function Dpe(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function Rpe(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var jpe=function(){var t=0,e=null;return{add:function(n){t==0&&(e=Ope())&&(Dpe(e,n),Rpe(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Lpe=function(){var t=jpe();return function(e,n){E.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},c7=function(){var t=Lpe(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},Npe={left:0,top:0,right:0,gap:0},c_=function(t){return parseInt(t||"",10)||0},zpe=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[c_(n),c_(r),c_(i)]},Bpe=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Npe;var e=zpe(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},Fpe=c7(),Ef="data-scroll-locked",Upe=function(t,e,n,r){var i=t.left,s=t.top,o=t.right,a=t.gap;return n===void 0&&(n="margin"),`
249
249
  .`.concat(wpe,` {
250
250
  overflow: hidden `).concat(r,`;
251
251
  padding-right: `).concat(a,"px ").concat(r,`;
@@ -289,7 +289,7 @@ img.ProseMirror-separator {
289
289
 
290
290
  If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
291
291
 
292
- For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return E.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},gge="DialogDescriptionWarning",mge=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${P7(gge).contentName}}.`;return E.useEffect(()=>{const i=t.current?.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},yge=g7,Sge=S7,bge=b7,vge=v7,xge=w7;function wge(t){const e=E.useRef({value:t,previous:t});return E.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function I7(t){const[e,n]=E.useState(void 0);return Wl(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const Cge=["top","right","bottom","left"],Su=Math.min,Qs=Math.max,Mv=Math.round,ib=Math.floor,qa=t=>({x:t,y:t}),Tge={left:"right",right:"left",bottom:"top",top:"bottom"},Ege={start:"end",end:"start"};function zP(t,e,n){return Qs(t,Su(e,n))}function Xl(t,e){return typeof t=="function"?t(e):t}function Zl(t){return t.split("-")[0]}function sp(t){return t.split("-")[1]}function SM(t){return t==="x"?"y":"x"}function bM(t){return t==="y"?"height":"width"}const _ge=new Set(["top","bottom"]);function $a(t){return _ge.has(Zl(t))?"y":"x"}function vM(t){return SM($a(t))}function Pge(t,e,n){n===void 0&&(n=!1);const r=sp(t),i=vM(t),s=bM(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Av(o)),[o,Av(o)]}function Ige(t){const e=Av(t);return[BP(t),e,BP(e)]}function BP(t){return t.replace(/start|end/g,e=>Ege[e])}const Y5=["left","right"],W5=["right","left"],kge=["top","bottom"],Mge=["bottom","top"];function Age(t,e,n){switch(t){case"top":case"bottom":return n?e?W5:Y5:e?Y5:W5;case"left":case"right":return e?kge:Mge;default:return[]}}function Oge(t,e,n,r){const i=sp(t);let s=Age(Zl(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(BP)))),s}function Av(t){return t.replace(/left|right|bottom|top/g,e=>Tge[e])}function Dge(t){return{top:0,right:0,bottom:0,left:0,...t}}function k7(t){return typeof t!="number"?Dge(t):{top:t,right:t,bottom:t,left:t}}function Ov(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function X5(t,e,n){let{reference:r,floating:i}=t;const s=$a(e),o=vM(e),a=bM(o),l=Zl(e),u=s==="y",f=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let m;switch(l){case"top":m={x:f,y:r.y-i.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-i.width,y:h};break;default:m={x:r.x,y:r.y}}switch(sp(e)){case"start":m[o]-=g*(n&&u?-1:1);break;case"end":m[o]+=g*(n&&u?-1:1);break}return m}const Rge=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:h}=X5(u,r,l),g=r,m={},b=0;for(let w=0;w<a.length;w++){const{name:x,fn:v}=a[w],{x:C,y:P,data:k,reset:M}=await v({x:f,y:h,initialPlacement:r,placement:g,strategy:i,middlewareData:m,rects:u,platform:o,elements:{reference:t,floating:e}});f=C??f,h=P??h,m={...m,[x]:{...m[x],...k}},M&&b<=50&&(b++,typeof M=="object"&&(M.placement&&(g=M.placement),M.rects&&(u=M.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):M.rects),{x:f,y:h}=X5(u,g,l)),w=-1)}return{x:f,y:h,placement:g,strategy:i,middlewareData:m}};async function Pm(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:g=!1,padding:m=0}=Xl(e,t),b=k7(m),x=a[g?h==="floating"?"reference":"floating":h],v=Ov(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),C=h==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),k=await(s.isElement==null?void 0:s.isElement(P))?await(s.getScale==null?void 0:s.getScale(P))||{x:1,y:1}:{x:1,y:1},M=Ov(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:P,strategy:l}):C);return{top:(v.top-M.top+b.top)/k.y,bottom:(M.bottom-v.bottom+b.bottom)/k.y,left:(v.left-M.left+b.left)/k.x,right:(M.right-v.right+b.right)/k.x}}const jge=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:f=0}=Xl(t,e)||{};if(u==null)return{};const h=k7(f),g={x:n,y:r},m=vM(i),b=bM(m),w=await o.getDimensions(u),x=m==="y",v=x?"top":"left",C=x?"bottom":"right",P=x?"clientHeight":"clientWidth",k=s.reference[b]+s.reference[m]-g[m]-s.floating[b],M=g[m]-s.reference[m],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let O=A?A[P]:0;(!O||!await(o.isElement==null?void 0:o.isElement(A)))&&(O=a.floating[P]||s.floating[b]);const R=k/2-M/2,F=O/2-w[b]/2-1,N=Su(h[v],F),j=Su(h[C],F),H=N,V=O-w[b]-j,z=O/2-w[b]/2+R,K=zP(H,z,V),B=!l.arrow&&sp(i)!=null&&z!==K&&s.reference[b]/2-(z<H?N:j)-w[b]/2<0,G=B?z<H?z-H:z-V:0;return{[m]:g[m]+G,data:{[m]:K,centerOffset:z-K-G,...B&&{alignmentOffset:G}},reset:B}}}),Lge=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...x}=Xl(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Zl(i),C=$a(a),P=Zl(a)===a,k=await(l.isRTL==null?void 0:l.isRTL(u.floating)),M=g||(P||!w?[Av(a)]:Ige(a)),A=b!=="none";!g&&A&&M.push(...Oge(a,w,b,k));const O=[a,...M],R=await Pm(e,x),F=[];let N=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&F.push(R[v]),h){const z=Pge(i,o,k);F.push(R[z[0]],R[z[1]])}if(N=[...N,{placement:i,overflows:F}],!F.every(z=>z<=0)){var j,H;const z=(((j=s.flip)==null?void 0:j.index)||0)+1,K=O[z];if(K&&(!(h==="alignment"?C!==$a(K):!1)||N.every(W=>$a(W.placement)===C?W.overflows[0]>0:!0)))return{data:{index:z,overflows:N},reset:{placement:K}};let B=(H=N.filter(G=>G.overflows[0]<=0).sort((G,W)=>G.overflows[1]-W.overflows[1])[0])==null?void 0:H.placement;if(!B)switch(m){case"bestFit":{var V;const G=(V=N.filter(W=>{if(A){const Z=$a(W.placement);return Z===C||Z==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(Z=>Z>0).reduce((Z,de)=>Z+de,0)]).sort((W,Z)=>W[1]-Z[1])[0])==null?void 0:V[0];G&&(B=G);break}case"initialPlacement":B=a;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function Z5(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function J5(t){return Cge.some(e=>t[e]>=0)}const Nge=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Xl(t,e);switch(r){case"referenceHidden":{const s=await Pm(e,{...i,elementContext:"reference"}),o=Z5(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:J5(o)}}}case"escaped":{const s=await Pm(e,{...i,altBoundary:!0}),o=Z5(s,n.floating);return{data:{escapedOffsets:o,escaped:J5(o)}}}default:return{}}}}},M7=new Set(["left","top"]);async function zge(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Zl(n),a=sp(n),l=$a(n)==="y",u=M7.has(o)?-1:1,f=s&&l?-1:1,h=Xl(e,t);let{mainAxis:g,crossAxis:m,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof b=="number"&&(m=a==="end"?b*-1:b),l?{x:m*f,y:g*u}:{x:g*u,y:m*f}}const Bge=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await zge(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},Fge=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:x=>{let{x:v,y:C}=x;return{x:v,y:C}}},...l}=Xl(t,e),u={x:n,y:r},f=await Pm(e,l),h=$a(Zl(i)),g=SM(h);let m=u[g],b=u[h];if(s){const x=g==="y"?"top":"left",v=g==="y"?"bottom":"right",C=m+f[x],P=m-f[v];m=zP(C,m,P)}if(o){const x=h==="y"?"top":"left",v=h==="y"?"bottom":"right",C=b+f[x],P=b-f[v];b=zP(C,b,P)}const w=a.fn({...e,[g]:m,[h]:b});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[g]:s,[h]:o}}}}}},Uge=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Xl(t,e),f={x:n,y:r},h=$a(i),g=SM(h);let m=f[g],b=f[h];const w=Xl(a,e),x=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(l){const P=g==="y"?"height":"width",k=s.reference[g]-s.floating[P]+x.mainAxis,M=s.reference[g]+s.reference[P]-x.mainAxis;m<k?m=k:m>M&&(m=M)}if(u){var v,C;const P=g==="y"?"width":"height",k=M7.has(Zl(i)),M=s.reference[h]-s.floating[P]+(k&&((v=o.offset)==null?void 0:v[h])||0)+(k?0:x.crossAxis),A=s.reference[h]+s.reference[P]+(k?0:((C=o.offset)==null?void 0:C[h])||0)-(k?x.crossAxis:0);b<M?b=M:b>A&&(b=A)}return{[g]:m,[h]:b}}}},Hge=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...u}=Xl(t,e),f=await Pm(e,u),h=Zl(i),g=sp(i),m=$a(i)==="y",{width:b,height:w}=s.floating;let x,v;h==="top"||h==="bottom"?(x=h,v=g===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(v=h,x=g==="end"?"top":"bottom");const C=w-f.top-f.bottom,P=b-f.left-f.right,k=Su(w-f[x],C),M=Su(b-f[v],P),A=!e.middlewareData.shift;let O=k,R=M;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(R=P),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(O=C),A&&!g){const N=Qs(f.left,0),j=Qs(f.right,0),H=Qs(f.top,0),V=Qs(f.bottom,0);m?R=b-2*(N!==0||j!==0?N+j:Qs(f.left,f.right)):O=w-2*(H!==0||V!==0?H+V:Qs(f.top,f.bottom))}await l({...e,availableWidth:R,availableHeight:O});const F=await o.getDimensions(a.floating);return b!==F.width||w!==F.height?{reset:{rects:!0}}:{}}}};function _0(){return typeof window<"u"}function op(t){return A7(t)?(t.nodeName||"").toLowerCase():"#document"}function ao(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function nl(t){var e;return(e=(A7(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function A7(t){return _0()?t instanceof Node||t instanceof ao(t).Node:!1}function Sa(t){return _0()?t instanceof Element||t instanceof ao(t).Element:!1}function Xa(t){return _0()?t instanceof HTMLElement||t instanceof ao(t).HTMLElement:!1}function Q5(t){return!_0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ao(t).ShadowRoot}const $ge=new Set(["inline","contents"]);function my(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=ba(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!$ge.has(i)}const Kge=new Set(["table","td","th"]);function Vge(t){return Kge.has(op(t))}const qge=[":popover-open",":modal"];function P0(t){return qge.some(e=>{try{return t.matches(e)}catch{return!1}})}const Gge=["transform","translate","scale","rotate","perspective"],Yge=["transform","translate","scale","rotate","perspective","filter"],Wge=["paint","layout","strict","content"];function xM(t){const e=wM(),n=Sa(t)?ba(t):t;return Gge.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Yge.some(r=>(n.willChange||"").includes(r))||Wge.some(r=>(n.contain||"").includes(r))}function Xge(t){let e=bu(t);for(;Xa(e)&&!Ff(e);){if(xM(e))return e;if(P0(e))return null;e=bu(e)}return null}function wM(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Zge=new Set(["html","body","#document"]);function Ff(t){return Zge.has(op(t))}function ba(t){return ao(t).getComputedStyle(t)}function I0(t){return Sa(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function bu(t){if(op(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Q5(t)&&t.host||nl(t);return Q5(e)?e.host:e}function O7(t){const e=bu(t);return Ff(e)?t.ownerDocument?t.ownerDocument.body:t.body:Xa(e)&&my(e)?e:O7(e)}function Im(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=O7(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=ao(i);if(s){const a=FP(o);return e.concat(o,o.visualViewport||[],my(i)?i:[],a&&n?Im(a):[])}return e.concat(i,Im(i,[],n))}function FP(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function D7(t){const e=ba(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Xa(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=Mv(n)!==s||Mv(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function CM(t){return Sa(t)?t:t.contextElement}function _f(t){const e=CM(t);if(!Xa(e))return qa(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=D7(e);let o=(s?Mv(n.width):n.width)/r,a=(s?Mv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Jge=qa(0);function R7(t){const e=ao(t);return!wM()||!e.visualViewport?Jge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Qge(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ao(t)?!1:e}function jd(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=CM(t);let o=qa(1);e&&(r?Sa(r)&&(o=_f(r)):o=_f(t));const a=Qge(s,n,r)?R7(s):qa(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,f=i.width/o.x,h=i.height/o.y;if(s){const g=ao(s),m=r&&Sa(r)?ao(r):r;let b=g,w=FP(b);for(;w&&r&&m!==b;){const x=_f(w),v=w.getBoundingClientRect(),C=ba(w),P=v.left+(w.clientLeft+parseFloat(C.paddingLeft))*x.x,k=v.top+(w.clientTop+parseFloat(C.paddingTop))*x.y;l*=x.x,u*=x.y,f*=x.x,h*=x.y,l+=P,u+=k,b=ao(w),w=FP(b)}}return Ov({width:f,height:h,x:l,y:u})}function k0(t,e){const n=I0(t).scrollLeft;return e?e.left+n:jd(nl(t)).left+n}function j7(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-k0(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function eme(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=nl(r),a=e?P0(e.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=qa(1);const f=qa(0),h=Xa(r);if((h||!h&&!s)&&((op(r)!=="body"||my(o))&&(l=I0(r)),Xa(r))){const m=jd(r);u=_f(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const g=o&&!h&&!s?j7(o,l):qa(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+g.x,y:n.y*u.y-l.scrollTop*u.y+f.y+g.y}}function tme(t){return Array.from(t.getClientRects())}function nme(t){const e=nl(t),n=I0(t),r=t.ownerDocument.body,i=Qs(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Qs(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+k0(t);const a=-n.scrollTop;return ba(r).direction==="rtl"&&(o+=Qs(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const ez=25;function rme(t,e){const n=ao(t),r=nl(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const f=wM();(!f||f&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=k0(r);if(u<=0){const f=r.ownerDocument,h=f.body,g=getComputedStyle(h),m=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-h.clientWidth-m);b<=ez&&(s-=b)}else u<=ez&&(s+=u);return{width:s,height:o,x:a,y:l}}const ime=new Set(["absolute","fixed"]);function sme(t,e){const n=jd(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=Xa(t)?_f(t):qa(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function tz(t,e,n){let r;if(e==="viewport")r=rme(t,n);else if(e==="document")r=nme(nl(t));else if(Sa(e))r=sme(e,n);else{const i=R7(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Ov(r)}function L7(t,e){const n=bu(t);return n===e||!Sa(n)||Ff(n)?!1:ba(n).position==="fixed"||L7(n,e)}function ome(t,e){const n=e.get(t);if(n)return n;let r=Im(t,[],!1).filter(a=>Sa(a)&&op(a)!=="body"),i=null;const s=ba(t).position==="fixed";let o=s?bu(t):t;for(;Sa(o)&&!Ff(o);){const a=ba(o),l=xM(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&ime.has(i.position)||my(o)&&!l&&L7(t,o))?r=r.filter(f=>f!==o):i=a,o=bu(o)}return e.set(t,r),r}function ame(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?P0(e)?[]:ome(e,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,f)=>{const h=tz(e,f,i);return u.top=Qs(h.top,u.top),u.right=Su(h.right,u.right),u.bottom=Su(h.bottom,u.bottom),u.left=Qs(h.left,u.left),u},tz(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function lme(t){const{width:e,height:n}=D7(t);return{width:e,height:n}}function cme(t,e,n){const r=Xa(e),i=nl(e),s=n==="fixed",o=jd(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=qa(0);function u(){l.x=k0(i)}if(r||!r&&!s)if((op(e)!=="body"||my(i))&&(a=I0(e)),r){const m=jd(e,!0,s,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else i&&u();s&&!r&&i&&u();const f=i&&!r&&!s?j7(i,a):qa(0),h=o.left+a.scrollLeft-l.x-f.x,g=o.top+a.scrollTop-l.y-f.y;return{x:h,y:g,width:o.width,height:o.height}}function d_(t){return ba(t).position==="static"}function nz(t,e){if(!Xa(t)||ba(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return nl(t)===n&&(n=n.ownerDocument.body),n}function N7(t,e){const n=ao(t);if(P0(t))return n;if(!Xa(t)){let i=bu(t);for(;i&&!Ff(i);){if(Sa(i)&&!d_(i))return i;i=bu(i)}return n}let r=nz(t,e);for(;r&&Vge(r)&&d_(r);)r=nz(r,e);return r&&Ff(r)&&d_(r)&&!xM(r)?n:r||Xge(t)||n}const ume=async function(t){const e=this.getOffsetParent||N7,n=this.getDimensions,r=await n(t.floating);return{reference:cme(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dme(t){return ba(t).direction==="rtl"}const hme={convertOffsetParentRelativeRectToViewportRelativeRect:eme,getDocumentElement:nl,getClippingRect:ame,getOffsetParent:N7,getElementRects:ume,getClientRects:tme,getDimensions:lme,getScale:_f,isElement:Sa,isRTL:dme};function z7(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function fme(t,e){let n=null,r;const i=nl(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=t.getBoundingClientRect(),{left:f,top:h,width:g,height:m}=u;if(a||e(),!g||!m)return;const b=ib(h),w=ib(i.clientWidth-(f+g)),x=ib(i.clientHeight-(h+m)),v=ib(f),P={rootMargin:-b+"px "+-w+"px "+-x+"px "+-v+"px",threshold:Qs(0,Su(1,l))||1};let k=!0;function M(A){const O=A[0].intersectionRatio;if(O!==l){if(!k)return o();O?o(!1,O):r=setTimeout(()=>{o(!1,1e-7)},1e3)}O===1&&!z7(u,t.getBoundingClientRect())&&o(),k=!1}try{n=new IntersectionObserver(M,{...P,root:i.ownerDocument})}catch{n=new IntersectionObserver(M,P)}n.observe(t)}return o(!0),s}function pme(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=CM(t),f=i||s?[...u?Im(u):[],...Im(e)]:[];f.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const h=u&&a?fme(u,n):null;let g=-1,m=null;o&&(m=new ResizeObserver(v=>{let[C]=v;C&&C.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var P;(P=m)==null||P.observe(e)})),n()}),u&&!l&&m.observe(u),m.observe(e));let b,w=l?jd(t):null;l&&x();function x(){const v=jd(t);w&&!z7(w,v)&&n(),w=v,b=requestAnimationFrame(x)}return n(),()=>{var v;f.forEach(C=>{i&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),h?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(b)}}const gme=Bge,mme=Fge,yme=Lge,Sme=Hge,bme=Nge,rz=jge,vme=Uge,xme=(t,e,n)=>{const r=new Map,i={platform:hme,...n},s={...i.platform,_c:r};return Rge(t,e,{...i,platform:s})};var wme=typeof document<"u",Cme=function(){},Ub=wme?E.useLayoutEffect:Cme;function Dv(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Dv(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!Dv(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function B7(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function iz(t,e){const n=B7(t);return Math.round(e*n)/n}function h_(t){const e=E.useRef(t);return Ub(()=>{e.current=t}),e}function Tme(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[f,h]=E.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,m]=E.useState(r);Dv(g,r)||m(r);const[b,w]=E.useState(null),[x,v]=E.useState(null),C=E.useCallback(W=>{W!==A.current&&(A.current=W,w(W))},[]),P=E.useCallback(W=>{W!==O.current&&(O.current=W,v(W))},[]),k=s||b,M=o||x,A=E.useRef(null),O=E.useRef(null),R=E.useRef(f),F=l!=null,N=h_(l),j=h_(i),H=h_(u),V=E.useCallback(()=>{if(!A.current||!O.current)return;const W={placement:e,strategy:n,middleware:g};j.current&&(W.platform=j.current),xme(A.current,O.current,W).then(Z=>{const de={...Z,isPositioned:H.current!==!1};z.current&&!Dv(R.current,de)&&(R.current=de,qd.flushSync(()=>{h(de)}))})},[g,e,n,j,H]);Ub(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,h(W=>({...W,isPositioned:!1})))},[u]);const z=E.useRef(!1);Ub(()=>(z.current=!0,()=>{z.current=!1}),[]),Ub(()=>{if(k&&(A.current=k),M&&(O.current=M),k&&M){if(N.current)return N.current(k,M,V);V()}},[k,M,V,N,F]);const K=E.useMemo(()=>({reference:A,floating:O,setReference:C,setFloating:P}),[C,P]),B=E.useMemo(()=>({reference:k,floating:M}),[k,M]),G=E.useMemo(()=>{const W={position:n,left:0,top:0};if(!B.floating)return W;const Z=iz(B.floating,f.x),de=iz(B.floating,f.y);return a?{...W,transform:"translate("+Z+"px, "+de+"px)",...B7(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:de}},[n,a,B.floating,f.x,f.y]);return E.useMemo(()=>({...f,update:V,refs:K,elements:B,floatingStyles:G}),[f,V,K,B,G])}const Eme=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?rz({element:r.current,padding:i}).fn(n):{}:r?rz({element:r,padding:i}).fn(n):{}}}},_me=(t,e)=>({...gme(t),options:[t,e]}),Pme=(t,e)=>({...mme(t),options:[t,e]}),Ime=(t,e)=>({...vme(t),options:[t,e]}),kme=(t,e)=>({...yme(t),options:[t,e]}),Mme=(t,e)=>({...Sme(t),options:[t,e]}),Ame=(t,e)=>({...bme(t),options:[t,e]}),Ome=(t,e)=>({...Eme(t),options:[t,e]});var Dme="Arrow",F7=E.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return y.jsx(ht.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});F7.displayName=Dme;var Rme=F7,TM="Popper",[U7,ap]=po(TM),[jme,H7]=U7(TM),$7=t=>{const{__scopePopper:e,children:n}=t,[r,i]=E.useState(null);return y.jsx(jme,{scope:e,anchor:r,onAnchorChange:i,children:n})};$7.displayName=TM;var K7="PopperAnchor",V7=E.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=H7(K7,n),o=E.useRef(null),a=Zt(e,o),l=E.useRef(null);return E.useEffect(()=>{const u=l.current;l.current=r?.current||o.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:y.jsx(ht.div,{...i,ref:a})});V7.displayName=K7;var EM="PopperContent",[Lme,Nme]=U7(EM),q7=E.forwardRef((t,e)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:m="optimized",onPlaced:b,...w}=t,x=H7(EM,n),[v,C]=E.useState(null),P=Zt(e,xe=>C(xe)),[k,M]=E.useState(null),A=I7(k),O=A?.width??0,R=A?.height??0,F=r+(s!=="center"?"-"+s:""),N=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},j=Array.isArray(u)?u:[u],H=j.length>0,V={padding:N,boundary:j.filter(Bme),altBoundary:H},{refs:z,floatingStyles:K,placement:B,isPositioned:G,middlewareData:W}=Tme({strategy:"fixed",placement:F,whileElementsMounted:(...xe)=>pme(...xe,{animationFrame:m==="always"}),elements:{reference:x.anchor},middleware:[_me({mainAxis:i+R,alignmentAxis:o}),l&&Pme({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Ime():void 0,...V}),l&&kme({...V}),Mme({...V,apply:({elements:xe,rects:Pe,availableWidth:Oe,availableHeight:He})=>{const{width:zt,height:Kt}=Pe.reference,Mt=xe.floating.style;Mt.setProperty("--radix-popper-available-width",`${Oe}px`),Mt.setProperty("--radix-popper-available-height",`${He}px`),Mt.setProperty("--radix-popper-anchor-width",`${zt}px`),Mt.setProperty("--radix-popper-anchor-height",`${Kt}px`)}}),k&&Ome({element:k,padding:a}),Fme({arrowWidth:O,arrowHeight:R}),g&&Ame({strategy:"referenceHidden",...V})]}),[Z,de]=W7(B),U=rs(b);Wl(()=>{G&&U?.()},[G,U]);const ne=W.arrow?.x,le=W.arrow?.y,fe=W.arrow?.centerOffset!==0,[me,_e]=E.useState();return Wl(()=>{v&&_e(window.getComputedStyle(v).zIndex)},[v]),y.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:G?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:y.jsx(Lme,{scope:n,placedSide:Z,onArrowChange:M,arrowX:ne,arrowY:le,shouldHideArrow:fe,children:y.jsx(ht.div,{"data-side":Z,"data-align":de,...w,ref:P,style:{...w.style,animation:G?void 0:"none"}})})})});q7.displayName=EM;var G7="PopperArrow",zme={top:"bottom",right:"left",bottom:"top",left:"right"},Y7=E.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=Nme(G7,r),o=zme[s.placedSide];return y.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:y.jsx(Rme,{...i,ref:n,style:{...i.style,display:"block"}})})});Y7.displayName=G7;function Bme(t){return t!==null}var Fme=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:i}=e,o=i.arrow?.centerOffset!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,f]=W7(n),h={start:"0%",center:"50%",end:"100%"}[f],g=(i.arrow?.x??0)+a/2,m=(i.arrow?.y??0)+l/2;let b="",w="";return u==="bottom"?(b=o?h:`${g}px`,w=`${-l}px`):u==="top"?(b=o?h:`${g}px`,w=`${r.floating.height+l}px`):u==="right"?(b=`${-l}px`,w=o?h:`${m}px`):u==="left"&&(b=`${r.floating.width+l}px`,w=o?h:`${m}px`),{data:{x:b,y:w}}}});function W7(t){const[e,n="center"]=t.split("-");return[e,n]}var M0=$7,A0=V7,_M=q7,PM=Y7,f_="rovingFocusGroup.onEntryFocus",Ume={bubbles:!1,cancelable:!0},yy="RovingFocusGroup",[UP,X7,Hme]=x0(yy),[$me,lp]=po(yy,[Hme]),[Kme,Vme]=$me(yy),Z7=E.forwardRef((t,e)=>y.jsx(UP.Provider,{scope:t.__scopeRovingFocusGroup,children:y.jsx(UP.Slot,{scope:t.__scopeRovingFocusGroup,children:y.jsx(qme,{...t,ref:e})})}));Z7.displayName=yy;var qme=E.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...h}=t,g=E.useRef(null),m=Zt(e,g),b=py(s),[w,x]=qo({prop:o,defaultProp:a??null,onChange:l,caller:yy}),[v,C]=E.useState(!1),P=rs(u),k=X7(n),M=E.useRef(!1),[A,O]=E.useState(0);return E.useEffect(()=>{const R=g.current;if(R)return R.addEventListener(f_,P),()=>R.removeEventListener(f_,P)},[P]),y.jsx(Kme,{scope:n,orientation:r,dir:b,loop:i,currentTabStopId:w,onItemFocus:E.useCallback(R=>x(R),[x]),onItemShiftTab:E.useCallback(()=>C(!0),[]),onFocusableItemAdd:E.useCallback(()=>O(R=>R+1),[]),onFocusableItemRemove:E.useCallback(()=>O(R=>R-1),[]),children:y.jsx(ht.div,{tabIndex:v||A===0?-1:0,"data-orientation":r,...h,ref:m,style:{outline:"none",...t.style},onMouseDown:Re(t.onMouseDown,()=>{M.current=!0}),onFocus:Re(t.onFocus,R=>{const F=!M.current;if(R.target===R.currentTarget&&F&&!v){const N=new CustomEvent(f_,Ume);if(R.currentTarget.dispatchEvent(N),!N.defaultPrevented){const j=k().filter(B=>B.focusable),H=j.find(B=>B.active),V=j.find(B=>B.id===w),K=[H,V,...j].filter(Boolean).map(B=>B.ref.current);eK(K,f)}}M.current=!1}),onBlur:Re(t.onBlur,()=>C(!1))})})}),J7="RovingFocusGroupItem",Q7=E.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...a}=t,l=Va(),u=s||l,f=Vme(J7,n),h=f.currentTabStopId===u,g=X7(n),{onFocusableItemAdd:m,onFocusableItemRemove:b,currentTabStopId:w}=f;return E.useEffect(()=>{if(r)return m(),()=>b()},[r,m,b]),y.jsx(UP.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:y.jsx(ht.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...a,ref:e,onMouseDown:Re(t.onMouseDown,x=>{r?f.onItemFocus(u):x.preventDefault()}),onFocus:Re(t.onFocus,()=>f.onItemFocus(u)),onKeyDown:Re(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=Wme(x,f.orientation,f.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let P=g().filter(k=>k.focusable).map(k=>k.ref.current);if(v==="last")P.reverse();else if(v==="prev"||v==="next"){v==="prev"&&P.reverse();const k=P.indexOf(x.currentTarget);P=f.loop?Xme(P,k+1):P.slice(k+1)}setTimeout(()=>eK(P))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:w!=null}):o})})});Q7.displayName=J7;var Gme={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Yme(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Wme(t,e,n){const r=Yme(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Gme[r]}function eK(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Xme(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var IM=Z7,O0=Q7,HP=["Enter"," "],Zme=["ArrowDown","PageUp","Home"],tK=["ArrowUp","PageDown","End"],Jme=[...Zme,...tK],Qme={ltr:[...HP,"ArrowRight"],rtl:[...HP,"ArrowLeft"]},eye={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sy="Menu",[km,tye,nye]=x0(Sy),[Wd,D0]=po(Sy,[nye,ap,lp]),by=ap(),nK=lp(),[rK,ju]=Wd(Sy),[rye,vy]=Wd(Sy),iK=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=t,a=by(e),[l,u]=E.useState(null),f=E.useRef(!1),h=rs(s),g=py(i);return E.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),y.jsx(M0,{...a,children:y.jsx(rK,{scope:e,open:n,onOpenChange:h,content:l,onContentChange:u,children:y.jsx(rye,{scope:e,onClose:E.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:g,modal:o,children:r})})})};iK.displayName=Sy;var iye="MenuAnchor",kM=E.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=by(n);return y.jsx(A0,{...i,...r,ref:e})});kM.displayName=iye;var MM="MenuPortal",[sye,sK]=Wd(MM,{forceMount:void 0}),oK=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,s=ju(MM,e);return y.jsx(sye,{scope:e,forceMount:n,children:y.jsx(Go,{present:n||s.open,children:y.jsx(gy,{asChild:!0,container:i,children:r})})})};oK.displayName=MM;var Ko="MenuContent",[oye,AM]=Wd(Ko),aK=E.forwardRef((t,e)=>{const n=sK(Ko,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=ju(Ko,t.__scopeMenu),o=vy(Ko,t.__scopeMenu);return y.jsx(km.Provider,{scope:t.__scopeMenu,children:y.jsx(Go,{present:r||s.open,children:y.jsx(km.Slot,{scope:t.__scopeMenu,children:o.modal?y.jsx(aye,{...i,ref:e}):y.jsx(lye,{...i,ref:e})})})})}),aye=E.forwardRef((t,e)=>{const n=ju(Ko,t.__scopeMenu),r=E.useRef(null),i=Zt(e,r);return E.useEffect(()=>{const s=r.current;if(s)return pM(s)},[]),y.jsx(OM,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),lye=E.forwardRef((t,e)=>{const n=ju(Ko,t.__scopeMenu);return y.jsx(OM,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),cye=Dd("MenuContent.ScrollLock"),OM=E.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:g,onDismiss:m,disableOutsideScroll:b,...w}=t,x=ju(Ko,n),v=vy(Ko,n),C=by(n),P=nK(n),k=tye(n),[M,A]=E.useState(null),O=E.useRef(null),R=Zt(e,O,x.onContentChange),F=E.useRef(0),N=E.useRef(""),j=E.useRef(0),H=E.useRef(null),V=E.useRef("right"),z=E.useRef(0),K=b?T0:E.Fragment,B=b?{as:cye,allowPinchZoom:!0}:void 0,G=Z=>{const de=N.current+Z,U=k().filter(xe=>!xe.disabled),ne=document.activeElement,le=U.find(xe=>xe.ref.current===ne)?.textValue,fe=U.map(xe=>xe.textValue),me=xye(fe,de,le),_e=U.find(xe=>xe.textValue===me)?.ref.current;(function xe(Pe){N.current=Pe,window.clearTimeout(F.current),Pe!==""&&(F.current=window.setTimeout(()=>xe(""),1e3))})(de),_e&&setTimeout(()=>_e.focus())};E.useEffect(()=>()=>window.clearTimeout(F.current),[]),fM();const W=E.useCallback(Z=>V.current===H.current?.side&&Cye(Z,H.current?.area),[]);return y.jsx(oye,{scope:n,searchRef:N,onItemEnter:E.useCallback(Z=>{W(Z)&&Z.preventDefault()},[W]),onItemLeave:E.useCallback(Z=>{W(Z)||(O.current?.focus(),A(null))},[W]),onTriggerLeave:E.useCallback(Z=>{W(Z)&&Z.preventDefault()},[W]),pointerGraceTimerRef:j,onPointerGraceIntentChange:E.useCallback(Z=>{H.current=Z},[]),children:y.jsx(K,{...B,children:y.jsx(w0,{asChild:!0,trapped:i,onMountAutoFocus:Re(s,Z=>{Z.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:y.jsx(ip,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:g,onDismiss:m,children:y.jsx(IM,{asChild:!0,...P,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:M,onCurrentTabStopIdChange:A,onEntryFocus:Re(l,Z=>{v.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:y.jsx(_M,{role:"menu","aria-orientation":"vertical","data-state":TK(x.open),"data-radix-menu-content":"",dir:v.dir,...C,...w,ref:R,style:{outline:"none",...w.style},onKeyDown:Re(w.onKeyDown,Z=>{const U=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,ne=Z.ctrlKey||Z.altKey||Z.metaKey,le=Z.key.length===1;U&&(Z.key==="Tab"&&Z.preventDefault(),!ne&&le&&G(Z.key));const fe=O.current;if(Z.target!==fe||!Jme.includes(Z.key))return;Z.preventDefault();const _e=k().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);tK.includes(Z.key)&&_e.reverse(),bye(_e)}),onBlur:Re(t.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(F.current),N.current="")}),onPointerMove:Re(t.onPointerMove,Mm(Z=>{const de=Z.target,U=z.current!==Z.clientX;if(Z.currentTarget.contains(de)&&U){const ne=Z.clientX>z.current?"right":"left";V.current=ne,z.current=Z.clientX}}))})})})})})})});aK.displayName=Ko;var uye="MenuGroup",DM=E.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return y.jsx(ht.div,{role:"group",...r,ref:e})});DM.displayName=uye;var dye="MenuLabel",lK=E.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return y.jsx(ht.div,{...r,ref:e})});lK.displayName=dye;var Rv="MenuItem",sz="menu.itemSelect",R0=E.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,s=E.useRef(null),o=vy(Rv,t.__scopeMenu),a=AM(Rv,t.__scopeMenu),l=Zt(e,s),u=E.useRef(!1),f=()=>{const h=s.current;if(!n&&h){const g=new CustomEvent(sz,{bubbles:!0,cancelable:!0});h.addEventListener(sz,m=>r?.(m),{once:!0}),hM(h,g),g.defaultPrevented?u.current=!1:o.onClose()}};return y.jsx(cK,{...i,ref:l,disabled:n,onClick:Re(t.onClick,f),onPointerDown:h=>{t.onPointerDown?.(h),u.current=!0},onPointerUp:Re(t.onPointerUp,h=>{u.current||h.currentTarget?.click()}),onKeyDown:Re(t.onKeyDown,h=>{const g=a.searchRef.current!=="";n||g&&h.key===" "||HP.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});R0.displayName=Rv;var cK=E.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=t,o=AM(Rv,n),a=nK(n),l=E.useRef(null),u=Zt(e,l),[f,h]=E.useState(!1),[g,m]=E.useState("");return E.useEffect(()=>{const b=l.current;b&&m((b.textContent??"").trim())},[s.children]),y.jsx(km.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:y.jsx(O0,{asChild:!0,...a,focusable:!r,children:y.jsx(ht.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:Re(t.onPointerMove,Mm(b=>{r?o.onItemLeave(b):(o.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(t.onPointerLeave,Mm(b=>o.onItemLeave(b))),onFocus:Re(t.onFocus,()=>h(!0)),onBlur:Re(t.onBlur,()=>h(!1))})})})}),hye="MenuCheckboxItem",uK=E.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return y.jsx(gK,{scope:t.__scopeMenu,checked:n,children:y.jsx(R0,{role:"menuitemcheckbox","aria-checked":jv(n)?"mixed":n,...i,ref:e,"data-state":LM(n),onSelect:Re(i.onSelect,()=>r?.(jv(n)?!0:!n),{checkForDefaultPrevented:!1})})})});uK.displayName=hye;var dK="MenuRadioGroup",[fye,pye]=Wd(dK,{value:void 0,onValueChange:()=>{}}),hK=E.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,s=rs(r);return y.jsx(fye,{scope:t.__scopeMenu,value:n,onValueChange:s,children:y.jsx(DM,{...i,ref:e})})});hK.displayName=dK;var fK="MenuRadioItem",pK=E.forwardRef((t,e)=>{const{value:n,...r}=t,i=pye(fK,t.__scopeMenu),s=n===i.value;return y.jsx(gK,{scope:t.__scopeMenu,checked:s,children:y.jsx(R0,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":LM(s),onSelect:Re(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});pK.displayName=fK;var RM="MenuItemIndicator",[gK,gye]=Wd(RM,{checked:!1}),mK=E.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,s=gye(RM,n);return y.jsx(Go,{present:r||jv(s.checked)||s.checked===!0,children:y.jsx(ht.span,{...i,ref:e,"data-state":LM(s.checked)})})});mK.displayName=RM;var mye="MenuSeparator",yK=E.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return y.jsx(ht.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});yK.displayName=mye;var yye="MenuArrow",SK=E.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=by(n);return y.jsx(PM,{...i,...r,ref:e})});SK.displayName=yye;var jM="MenuSub",[Sye,bK]=Wd(jM),vK=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:i}=t,s=ju(jM,e),o=by(e),[a,l]=E.useState(null),[u,f]=E.useState(null),h=rs(i);return E.useEffect(()=>(s.open===!1&&h(!1),()=>h(!1)),[s.open,h]),y.jsx(M0,{...o,children:y.jsx(rK,{scope:e,open:r,onOpenChange:h,content:u,onContentChange:f,children:y.jsx(Sye,{scope:e,contentId:Va(),triggerId:Va(),trigger:a,onTriggerChange:l,children:n})})})};vK.displayName=jM;var Ag="MenuSubTrigger",xK=E.forwardRef((t,e)=>{const n=ju(Ag,t.__scopeMenu),r=vy(Ag,t.__scopeMenu),i=bK(Ag,t.__scopeMenu),s=AM(Ag,t.__scopeMenu),o=E.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,u={__scopeMenu:t.__scopeMenu},f=E.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return E.useEffect(()=>f,[f]),E.useEffect(()=>{const h=a.current;return()=>{window.clearTimeout(h),l(null)}},[a,l]),y.jsx(kM,{asChild:!0,...u,children:y.jsx(cK,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":TK(n.open),...t,ref:b0(e,i.onTriggerChange),onClick:h=>{t.onClick?.(h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(t.onPointerMove,Mm(h=>{s.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:Re(t.onPointerLeave,Mm(h=>{f();const g=n.content?.getBoundingClientRect();if(g){const m=n.content?.dataset.side,b=m==="right",w=b?-5:5,x=g[b?"left":"right"],v=g[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:h.clientX+w,y:h.clientY},{x,y:g.top},{x:v,y:g.top},{x:v,y:g.bottom},{x,y:g.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(h),h.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Re(t.onKeyDown,h=>{const g=s.searchRef.current!=="";t.disabled||g&&h.key===" "||Qme[r.dir].includes(h.key)&&(n.onOpenChange(!0),n.content?.focus(),h.preventDefault())})})})});xK.displayName=Ag;var wK="MenuSubContent",CK=E.forwardRef((t,e)=>{const n=sK(Ko,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=ju(Ko,t.__scopeMenu),o=vy(Ko,t.__scopeMenu),a=bK(wK,t.__scopeMenu),l=E.useRef(null),u=Zt(e,l);return y.jsx(km.Provider,{scope:t.__scopeMenu,children:y.jsx(Go,{present:r||s.open,children:y.jsx(km.Slot,{scope:t.__scopeMenu,children:y.jsx(OM,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{o.isUsingKeyboardRef.current&&l.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:Re(t.onFocusOutside,f=>{f.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Re(t.onEscapeKeyDown,f=>{o.onClose(),f.preventDefault()}),onKeyDown:Re(t.onKeyDown,f=>{const h=f.currentTarget.contains(f.target),g=eye[o.dir].includes(f.key);h&&g&&(s.onOpenChange(!1),a.trigger?.focus(),f.preventDefault())})})})})})});CK.displayName=wK;function TK(t){return t?"open":"closed"}function jv(t){return t==="indeterminate"}function LM(t){return jv(t)?"indeterminate":t?"checked":"unchecked"}function bye(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function vye(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function xye(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=vye(t,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function wye(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s],l=e[o],u=a.x,f=a.y,h=l.x,g=l.y;f>r!=g>r&&n<(h-u)*(r-f)/(g-f)+u&&(i=!i)}return i}function Cye(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return wye(n,e)}function Mm(t){return e=>e.pointerType==="mouse"?t(e):void 0}var EK=iK,_K=kM,PK=oK,IK=aK,kK=DM,MK=lK,AK=R0,OK=uK,DK=hK,RK=pK,jK=mK,LK=yK,NK=SK,zK=vK,BK=xK,FK=CK,NM="ContextMenu",[Tye]=po(NM,[D0]),Li=D0(),[Eye,UK]=Tye(NM),HK=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:i,modal:s=!0}=t,[o,a]=E.useState(!1),l=Li(e),u=rs(r),f=E.useCallback(h=>{a(h),u(h)},[u]);return y.jsx(Eye,{scope:e,open:o,onOpenChange:f,modal:s,children:y.jsx(EK,{...l,dir:i,open:o,onOpenChange:f,modal:s,children:n})})};HK.displayName=NM;var $K="ContextMenuTrigger",KK=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...i}=t,s=UK($K,n),o=Li(n),a=E.useRef({x:0,y:0}),l=E.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=E.useRef(0),f=E.useCallback(()=>window.clearTimeout(u.current),[]),h=g=>{a.current={x:g.clientX,y:g.clientY},s.onOpenChange(!0)};return E.useEffect(()=>f,[f]),E.useEffect(()=>void(r&&f()),[r,f]),y.jsxs(y.Fragment,{children:[y.jsx(_K,{...o,virtualRef:l}),y.jsx(ht.span,{"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,...i,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:Re(t.onContextMenu,g=>{f(),h(g),g.preventDefault()}),onPointerDown:r?t.onPointerDown:Re(t.onPointerDown,sb(g=>{f(),u.current=window.setTimeout(()=>h(g),700)})),onPointerMove:r?t.onPointerMove:Re(t.onPointerMove,sb(f)),onPointerCancel:r?t.onPointerCancel:Re(t.onPointerCancel,sb(f)),onPointerUp:r?t.onPointerUp:Re(t.onPointerUp,sb(f))})]})});KK.displayName=$K;var _ye="ContextMenuPortal",zM=t=>{const{__scopeContextMenu:e,...n}=t,r=Li(e);return y.jsx(PK,{...r,...n})};zM.displayName=_ye;var VK="ContextMenuContent",qK=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=UK(VK,n),s=Li(n),o=E.useRef(!1);return y.jsx(IK,{...s,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&o.current&&a.preventDefault(),o.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});qK.displayName=VK;var Pye="ContextMenuGroup",Iye=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(kK,{...i,...r,ref:e})});Iye.displayName=Pye;var kye="ContextMenuLabel",Mye=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(MK,{...i,...r,ref:e})});Mye.displayName=kye;var Aye="ContextMenuItem",GK=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(AK,{...i,...r,ref:e})});GK.displayName=Aye;var Oye="ContextMenuCheckboxItem",YK=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(OK,{...i,...r,ref:e})});YK.displayName=Oye;var Dye="ContextMenuRadioGroup",Rye=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(DK,{...i,...r,ref:e})});Rye.displayName=Dye;var jye="ContextMenuRadioItem",Lye=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(RK,{...i,...r,ref:e})});Lye.displayName=jye;var Nye="ContextMenuItemIndicator",zye=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(jK,{...i,...r,ref:e})});zye.displayName=Nye;var Bye="ContextMenuSeparator",Fye=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(LK,{...i,...r,ref:e})});Fye.displayName=Bye;var Uye="ContextMenuArrow",Hye=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(NK,{...i,...r,ref:e})});Hye.displayName=Uye;var WK="ContextMenuSub",XK=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:i,defaultOpen:s}=t,o=Li(e),[a,l]=qo({prop:i,defaultProp:s??!1,onChange:r,caller:WK});return y.jsx(zK,{...o,open:a,onOpenChange:l,children:n})};XK.displayName=WK;var $ye="ContextMenuSubTrigger",ZK=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(BK,{...i,...r,ref:e})});ZK.displayName=$ye;var Kye="ContextMenuSubContent",JK=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(FK,{...i,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});JK.displayName=Kye;function sb(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var Vye=HK,qye=KK,Gye=zM,Yye=qK,Wye=GK,Xye=YK,j0="DropdownMenu",[Zye]=po(j0,[D0]),Ni=D0(),[Jye,QK]=Zye(j0),eV=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=t,l=Ni(e),u=E.useRef(null),[f,h]=qo({prop:i,defaultProp:s??!1,onChange:o,caller:j0});return y.jsx(Jye,{scope:e,triggerId:Va(),triggerRef:u,contentId:Va(),open:f,onOpenChange:h,onOpenToggle:E.useCallback(()=>h(g=>!g),[h]),modal:a,children:y.jsx(EK,{...l,open:f,onOpenChange:h,dir:r,modal:a,children:n})})};eV.displayName=j0;var tV="DropdownMenuTrigger",nV=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,s=QK(tV,n),o=Ni(n);return y.jsx(_K,{asChild:!0,...o,children:y.jsx(ht.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:b0(e,s.triggerRef),onPointerDown:Re(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:Re(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});nV.displayName=tV;var Qye="DropdownMenuPortal",rV=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Ni(e);return y.jsx(PK,{...r,...n})};rV.displayName=Qye;var iV="DropdownMenuContent",sV=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=QK(iV,n),s=Ni(n),o=E.useRef(!1);return y.jsx(IK,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:e,onCloseAutoFocus:Re(t.onCloseAutoFocus,a=>{o.current||i.triggerRef.current?.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:Re(t.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;(!i.modal||f)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});sV.displayName=iV;var eSe="DropdownMenuGroup",tSe=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(kK,{...i,...r,ref:e})});tSe.displayName=eSe;var nSe="DropdownMenuLabel",rSe=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(MK,{...i,...r,ref:e})});rSe.displayName=nSe;var iSe="DropdownMenuItem",oV=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(AK,{...i,...r,ref:e})});oV.displayName=iSe;var sSe="DropdownMenuCheckboxItem",aV=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(OK,{...i,...r,ref:e})});aV.displayName=sSe;var oSe="DropdownMenuRadioGroup",aSe=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(DK,{...i,...r,ref:e})});aSe.displayName=oSe;var lSe="DropdownMenuRadioItem",cSe=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(RK,{...i,...r,ref:e})});cSe.displayName=lSe;var uSe="DropdownMenuItemIndicator",lV=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(jK,{...i,...r,ref:e})});lV.displayName=uSe;var dSe="DropdownMenuSeparator",hSe=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(LK,{...i,...r,ref:e})});hSe.displayName=dSe;var fSe="DropdownMenuArrow",pSe=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(NK,{...i,...r,ref:e})});pSe.displayName=fSe;var gSe=t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:i,defaultOpen:s}=t,o=Ni(e),[a,l]=qo({prop:r,defaultProp:s??!1,onChange:i,caller:"DropdownMenuSub"});return y.jsx(zK,{...o,open:a,onOpenChange:l,children:n})},mSe="DropdownMenuSubTrigger",cV=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(BK,{...i,...r,ref:e})});cV.displayName=mSe;var ySe="DropdownMenuSubContent",uV=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(FK,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});uV.displayName=ySe;var BM=eV,FM=nV,L0=rV,UM=sV,SSe=oV,dV=aV,bSe=lV,vSe=gSe,xSe=cV,wSe=uV;function hV(t,[e,n]){return Math.min(n,Math.max(e,t))}var N0="Popover",[fV]=po(N0,[ap]),xy=ap(),[CSe,Lu]=fV(N0),pV=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=xy(e),l=E.useRef(null),[u,f]=E.useState(!1),[h,g]=qo({prop:r,defaultProp:i??!1,onChange:s,caller:N0});return y.jsx(M0,{...a,children:y.jsx(CSe,{scope:e,contentId:Va(),triggerRef:l,open:h,onOpenChange:g,onOpenToggle:E.useCallback(()=>g(m=>!m),[g]),hasCustomAnchor:u,onCustomAnchorAdd:E.useCallback(()=>f(!0),[]),onCustomAnchorRemove:E.useCallback(()=>f(!1),[]),modal:o,children:n})})};pV.displayName=N0;var gV="PopoverAnchor",TSe=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Lu(gV,n),s=xy(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return E.useEffect(()=>(o(),()=>a()),[o,a]),y.jsx(A0,{...s,...r,ref:e})});TSe.displayName=gV;var mV="PopoverTrigger",yV=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Lu(mV,n),s=xy(n),o=Zt(e,i.triggerRef),a=y.jsx(ht.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":wV(i.open),...r,ref:o,onClick:Re(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:y.jsx(A0,{asChild:!0,...s,children:a})});yV.displayName=mV;var HM="PopoverPortal",[ESe,_Se]=fV(HM,{forceMount:void 0}),SV=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,s=Lu(HM,e);return y.jsx(ESe,{scope:e,forceMount:n,children:y.jsx(Go,{present:n||s.open,children:y.jsx(gy,{asChild:!0,container:i,children:r})})})};SV.displayName=HM;var Uf="PopoverContent",bV=E.forwardRef((t,e)=>{const n=_Se(Uf,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,s=Lu(Uf,t.__scopePopover);return y.jsx(Go,{present:r||s.open,children:s.modal?y.jsx(ISe,{...i,ref:e}):y.jsx(kSe,{...i,ref:e})})});bV.displayName=Uf;var PSe=Dd("PopoverContent.RemoveScroll"),ISe=E.forwardRef((t,e)=>{const n=Lu(Uf,t.__scopePopover),r=E.useRef(null),i=Zt(e,r),s=E.useRef(!1);return E.useEffect(()=>{const o=r.current;if(o)return pM(o)},[]),y.jsx(T0,{as:PSe,allowPinchZoom:!0,children:y.jsx(vV,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(t.onCloseAutoFocus,o=>{o.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Re(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Re(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),kSe=E.forwardRef((t,e)=>{const n=Lu(Uf,t.__scopePopover),r=E.useRef(!1),i=E.useRef(!1);return y.jsx(vV,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;n.triggerRef.current?.contains(o)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),vV=E.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,...h}=t,g=Lu(Uf,n),m=xy(n);return fM(),y.jsx(w0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:y.jsx(ip,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>g.onOpenChange(!1),children:y.jsx(_M,{"data-state":wV(g.open),role:"dialog",id:g.contentId,...m,...h,ref:e,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),xV="PopoverClose",MSe=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Lu(xV,n);return y.jsx(ht.button,{type:"button",...r,ref:e,onClick:Re(t.onClick,()=>i.onOpenChange(!1))})});MSe.displayName=xV;var ASe="PopoverArrow",OSe=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=xy(n);return y.jsx(PM,{...i,...r,ref:e})});OSe.displayName=ASe;function wV(t){return t?"open":"closed"}var $M=pV,KM=yV,VM=SV,qM=bV,DSe="Separator",oz="horizontal",RSe=["horizontal","vertical"],CV=E.forwardRef((t,e)=>{const{decorative:n,orientation:r=oz,...i}=t,s=jSe(r)?r:oz,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return y.jsx(ht.div,{"data-orientation":s,...a,...i,ref:e})});CV.displayName=DSe;function jSe(t){return RSe.includes(t)}var LSe=CV,TV=["PageUp","PageDown"],EV=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],_V={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},cp="Slider",[$P,NSe,zSe]=x0(cp),[PV]=po(cp,[zSe]),[BSe,z0]=PV(cp),IV=E.forwardRef((t,e)=>{const{name:n,min:r=0,max:i=100,step:s=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:l=0,defaultValue:u=[r],value:f,onValueChange:h=()=>{},onValueCommit:g=()=>{},inverted:m=!1,form:b,...w}=t,x=E.useRef(new Set),v=E.useRef(0),P=o==="horizontal"?FSe:USe,[k=[],M]=qo({prop:f,defaultProp:u,onChange:j=>{[...x.current][v.current]?.focus(),h(j)}}),A=E.useRef(k);function O(j){const H=qSe(k,j);N(j,H)}function R(j){N(j,v.current)}function F(){const j=A.current[v.current];k[v.current]!==j&&g(k)}function N(j,H,{commit:V}={commit:!1}){const z=XSe(s),K=ZSe(Math.round((j-r)/s)*s+r,z),B=hV(K,[r,i]);M((G=[])=>{const W=KSe(G,B,H);if(WSe(W,l*s)){v.current=W.indexOf(B);const Z=String(W)!==String(G);return Z&&V&&g(W),Z?W:G}else return G})}return y.jsx(BSe,{scope:t.__scopeSlider,name:n,disabled:a,min:r,max:i,valueIndexToChangeRef:v,thumbs:x.current,values:k,orientation:o,form:b,children:y.jsx($P.Provider,{scope:t.__scopeSlider,children:y.jsx($P.Slot,{scope:t.__scopeSlider,children:y.jsx(P,{"aria-disabled":a,"data-disabled":a?"":void 0,...w,ref:e,onPointerDown:Re(w.onPointerDown,()=>{a||(A.current=k)}),min:r,max:i,inverted:m,onSlideStart:a?void 0:O,onSlideMove:a?void 0:R,onSlideEnd:a?void 0:F,onHomeKeyDown:()=>!a&&N(r,0,{commit:!0}),onEndKeyDown:()=>!a&&N(i,k.length-1,{commit:!0}),onStepKeyDown:({event:j,direction:H})=>{if(!a){const K=TV.includes(j.key)||j.shiftKey&&EV.includes(j.key)?10:1,B=v.current,G=k[B],W=s*K*H;N(G+W,B,{commit:!0})}}})})})})});IV.displayName=cp;var[kV,MV]=PV(cp,{startEdge:"left",endEdge:"right",size:"width",direction:1}),FSe=E.forwardRef((t,e)=>{const{min:n,max:r,dir:i,inverted:s,onSlideStart:o,onSlideMove:a,onSlideEnd:l,onStepKeyDown:u,...f}=t,[h,g]=E.useState(null),m=Zt(e,P=>g(P)),b=E.useRef(void 0),w=py(i),x=w==="ltr",v=x&&!s||!x&&s;function C(P){const k=b.current||h.getBoundingClientRect(),M=[0,k.width],O=GM(M,v?[n,r]:[r,n]);return b.current=k,O(P-k.left)}return y.jsx(kV,{scope:t.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:y.jsx(AV,{dir:w,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:P=>{const k=C(P.clientX);o?.(k)},onSlideMove:P=>{const k=C(P.clientX);a?.(k)},onSlideEnd:()=>{b.current=void 0,l?.()},onStepKeyDown:P=>{const M=_V[v?"from-left":"from-right"].includes(P.key);u?.({event:P,direction:M?-1:1})}})})}),USe=E.forwardRef((t,e)=>{const{min:n,max:r,inverted:i,onSlideStart:s,onSlideMove:o,onSlideEnd:a,onStepKeyDown:l,...u}=t,f=E.useRef(null),h=Zt(e,f),g=E.useRef(void 0),m=!i;function b(w){const x=g.current||f.current.getBoundingClientRect(),v=[0,x.height],P=GM(v,m?[r,n]:[n,r]);return g.current=x,P(w-x.top)}return y.jsx(kV,{scope:t.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:y.jsx(AV,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const x=b(w.clientY);s?.(x)},onSlideMove:w=>{const x=b(w.clientY);o?.(x)},onSlideEnd:()=>{g.current=void 0,a?.()},onStepKeyDown:w=>{const v=_V[m?"from-bottom":"from-top"].includes(w.key);l?.({event:w,direction:v?-1:1})}})})}),AV=E.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:l,...u}=t,f=z0(cp,n);return y.jsx(ht.span,{...u,ref:e,onKeyDown:Re(t.onKeyDown,h=>{h.key==="Home"?(o(h),h.preventDefault()):h.key==="End"?(a(h),h.preventDefault()):TV.concat(EV).includes(h.key)&&(l(h),h.preventDefault())}),onPointerDown:Re(t.onPointerDown,h=>{const g=h.target;g.setPointerCapture(h.pointerId),h.preventDefault(),f.thumbs.has(g)?g.focus():r(h)}),onPointerMove:Re(t.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&i(h)}),onPointerUp:Re(t.onPointerUp,h=>{const g=h.target;g.hasPointerCapture(h.pointerId)&&(g.releasePointerCapture(h.pointerId),s(h))})})}),OV="SliderTrack",DV=E.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=z0(OV,n);return y.jsx(ht.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:e})});DV.displayName=OV;var KP="SliderRange",RV=E.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=z0(KP,n),s=MV(KP,n),o=E.useRef(null),a=Zt(e,o),l=i.values.length,u=i.values.map(g=>NV(g,i.min,i.max)),f=l>1?Math.min(...u):0,h=100-Math.max(...u);return y.jsx(ht.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:a,style:{...t.style,[s.startEdge]:f+"%",[s.endEdge]:h+"%"}})});RV.displayName=KP;var VP="SliderThumb",jV=E.forwardRef((t,e)=>{const n=NSe(t.__scopeSlider),[r,i]=E.useState(null),s=Zt(e,a=>i(a)),o=E.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return y.jsx(HSe,{...t,ref:s,index:o})}),HSe=E.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:i,...s}=t,o=z0(VP,n),a=MV(VP,n),[l,u]=E.useState(null),f=Zt(e,C=>u(C)),h=l?o.form||!!l.closest("form"):!0,g=I7(l),m=o.values[r],b=m===void 0?0:NV(m,o.min,o.max),w=VSe(r,o.values.length),x=g?.[a.size],v=x?GSe(x,b,a.direction):0;return E.useEffect(()=>{if(l)return o.thumbs.add(l),()=>{o.thumbs.delete(l)}},[l,o.thumbs]),y.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${b}% + ${v}px)`},children:[y.jsx($P.ItemSlot,{scope:t.__scopeSlider,children:y.jsx(ht.span,{role:"slider","aria-label":t["aria-label"]||w,"aria-valuemin":o.min,"aria-valuenow":m,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...s,ref:f,style:m===void 0?{display:"none"}:t.style,onFocus:Re(t.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),h&&y.jsx(LV,{name:i??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:m},r)]})});jV.displayName=VP;var $Se="RadioBubbleInput",LV=E.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const i=E.useRef(null),s=Zt(i,r),o=wge(e);return E.useEffect(()=>{const a=i.current;if(!a)return;const l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==e&&f){const h=new Event("input",{bubbles:!0});f.call(a,e),a.dispatchEvent(h)}},[o,e]),y.jsx(ht.input,{style:{display:"none"},...n,ref:s,defaultValue:e})});LV.displayName=$Se;function KSe(t=[],e,n){const r=[...t];return r[n]=e,r.sort((i,s)=>i-s)}function NV(t,e,n){const s=100/(n-e)*(t-e);return hV(s,[0,100])}function VSe(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function qSe(t,e){if(t.length===1)return 0;const n=t.map(i=>Math.abs(i-e)),r=Math.min(...n);return n.indexOf(r)}function GSe(t,e,n){const r=t/2,s=GM([0,50],[0,r]);return(r-s(e)*n)*n}function YSe(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function WSe(t,e){if(e>0){const n=YSe(t);return Math.min(...n)>=e}return!0}function GM(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function XSe(t){return(String(t).split(".")[1]||"").length}function ZSe(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var JSe=IV,QSe=DV,ebe=RV,tbe=jV,YM="ToastProvider",[WM,nbe,rbe]=x0("Toast"),[zV]=po("Toast",[rbe]),[ibe,B0]=zV(YM),BV=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=t,[a,l]=E.useState(null),[u,f]=E.useState(0),h=E.useRef(!1),g=E.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${YM}\`. Expected non-empty \`string\`.`),y.jsx(WM.Provider,{scope:e,children:y.jsx(ibe,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:E.useCallback(()=>f(m=>m+1),[]),onToastRemove:E.useCallback(()=>f(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:g,children:o})})};BV.displayName=YM;var FV="ToastViewport",sbe=["F8"],qP="toast.viewportPause",GP="toast.viewportResume",UV=E.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=sbe,label:i="Notifications ({hotkey})",...s}=t,o=B0(FV,n),a=nbe(n),l=E.useRef(null),u=E.useRef(null),f=E.useRef(null),h=E.useRef(null),g=Zt(e,h,o.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=o.toastCount>0;E.useEffect(()=>{const x=v=>{r.length!==0&&r.every(P=>v[P]||v.code===P)&&h.current?.focus()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),E.useEffect(()=>{const x=l.current,v=h.current;if(b&&x&&v){const C=()=>{if(!o.isClosePausedRef.current){const A=new CustomEvent(qP);v.dispatchEvent(A),o.isClosePausedRef.current=!0}},P=()=>{if(o.isClosePausedRef.current){const A=new CustomEvent(GP);v.dispatchEvent(A),o.isClosePausedRef.current=!1}},k=A=>{!x.contains(A.relatedTarget)&&P()},M=()=>{x.contains(document.activeElement)||P()};return x.addEventListener("focusin",C),x.addEventListener("focusout",k),x.addEventListener("pointermove",C),x.addEventListener("pointerleave",M),window.addEventListener("blur",C),window.addEventListener("focus",P),()=>{x.removeEventListener("focusin",C),x.removeEventListener("focusout",k),x.removeEventListener("pointermove",C),x.removeEventListener("pointerleave",M),window.removeEventListener("blur",C),window.removeEventListener("focus",P)}}},[b,o.isClosePausedRef]);const w=E.useCallback(({tabbingDirection:x})=>{const C=a().map(P=>{const k=P.ref.current,M=[k,...Sbe(k)];return x==="forwards"?M:M.reverse()});return(x==="forwards"?C.reverse():C).flat()},[a]);return E.useEffect(()=>{const x=h.current;if(x){const v=C=>{const P=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!P){const M=document.activeElement,A=C.shiftKey;if(C.target===x&&A){u.current?.focus();return}const F=w({tabbingDirection:A?"backwards":"forwards"}),N=F.findIndex(j=>j===M);p_(F.slice(N+1))?C.preventDefault():A?u.current?.focus():f.current?.focus()}};return x.addEventListener("keydown",v),()=>x.removeEventListener("keydown",v)}},[a,w]),y.jsxs(hpe,{ref:l,role:"region","aria-label":i.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&y.jsx(YP,{ref:u,onFocusFromOutsideViewport:()=>{const x=w({tabbingDirection:"forwards"});p_(x)}}),y.jsx(WM.Slot,{scope:n,children:y.jsx(ht.ol,{tabIndex:-1,...s,ref:g})}),b&&y.jsx(YP,{ref:f,onFocusFromOutsideViewport:()=>{const x=w({tabbingDirection:"backwards"});p_(x)}})]})});UV.displayName=FV;var HV="ToastFocusProxy",YP=E.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,s=B0(HV,n);return y.jsx(v0,{tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:o=>{const a=o.relatedTarget;!s.viewport?.contains(a)&&r()}})});YP.displayName=HV;var wy="Toast",obe="toast.swipeStart",abe="toast.swipeMove",lbe="toast.swipeCancel",cbe="toast.swipeEnd",$V=E.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...o}=t,[a,l]=qo({prop:r,defaultProp:i??!0,onChange:s,caller:wy});return y.jsx(Go,{present:n||a,children:y.jsx(hbe,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:rs(t.onPause),onResume:rs(t.onResume),onSwipeStart:Re(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Re(t.onSwipeMove,u=>{const{x:f,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:Re(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Re(t.onSwipeEnd,u=>{const{x:f,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),l(!1)})})})});$V.displayName=wy;var[ube,dbe]=zV(wy,{onClose(){}}),hbe=E.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:f,onSwipeMove:h,onSwipeCancel:g,onSwipeEnd:m,...b}=t,w=B0(wy,n),[x,v]=E.useState(null),C=Zt(e,z=>v(z)),P=E.useRef(null),k=E.useRef(null),M=i||w.duration,A=E.useRef(0),O=E.useRef(M),R=E.useRef(0),{onToastAdd:F,onToastRemove:N}=w,j=rs(()=>{x?.contains(document.activeElement)&&w.viewport?.focus(),o()}),H=E.useCallback(z=>{!z||z===1/0||(window.clearTimeout(R.current),A.current=new Date().getTime(),R.current=window.setTimeout(j,z))},[j]);E.useEffect(()=>{const z=w.viewport;if(z){const K=()=>{H(O.current),u?.()},B=()=>{const G=new Date().getTime()-A.current;O.current=O.current-G,window.clearTimeout(R.current),l?.()};return z.addEventListener(qP,B),z.addEventListener(GP,K),()=>{z.removeEventListener(qP,B),z.removeEventListener(GP,K)}}},[w.viewport,M,l,u,H]),E.useEffect(()=>{s&&!w.isClosePausedRef.current&&H(M)},[s,M,w.isClosePausedRef,H]),E.useEffect(()=>(F(),()=>N()),[F,N]);const V=E.useMemo(()=>x?XV(x):null,[x]);return w.viewport?y.jsxs(y.Fragment,{children:[V&&y.jsx(fbe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:V}),y.jsx(ube,{scope:n,onClose:j,children:qd.createPortal(y.jsx(WM.ItemSlot,{scope:n,children:y.jsx(dpe,{asChild:!0,onEscapeKeyDown:Re(a,()=>{w.isFocusedToastEscapeKeyDownRef.current||j(),w.isFocusedToastEscapeKeyDownRef.current=!1}),children:y.jsx(ht.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":w.swipeDirection,...b,ref:C,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Re(t.onKeyDown,z=>{z.key==="Escape"&&(a?.(z.nativeEvent),z.nativeEvent.defaultPrevented||(w.isFocusedToastEscapeKeyDownRef.current=!0,j()))}),onPointerDown:Re(t.onPointerDown,z=>{z.button===0&&(P.current={x:z.clientX,y:z.clientY})}),onPointerMove:Re(t.onPointerMove,z=>{if(!P.current)return;const K=z.clientX-P.current.x,B=z.clientY-P.current.y,G=!!k.current,W=["left","right"].includes(w.swipeDirection),Z=["left","up"].includes(w.swipeDirection)?Math.min:Math.max,de=W?Z(0,K):0,U=W?0:Z(0,B),ne=z.pointerType==="touch"?10:2,le={x:de,y:U},fe={originalEvent:z,delta:le};G?(k.current=le,ob(abe,h,fe,{discrete:!1})):az(le,w.swipeDirection,ne)?(k.current=le,ob(obe,f,fe,{discrete:!1}),z.target.setPointerCapture(z.pointerId)):(Math.abs(K)>ne||Math.abs(B)>ne)&&(P.current=null)}),onPointerUp:Re(t.onPointerUp,z=>{const K=k.current,B=z.target;if(B.hasPointerCapture(z.pointerId)&&B.releasePointerCapture(z.pointerId),k.current=null,P.current=null,K){const G=z.currentTarget,W={originalEvent:z,delta:K};az(K,w.swipeDirection,w.swipeThreshold)?ob(cbe,m,W,{discrete:!0}):ob(lbe,g,W,{discrete:!0}),G.addEventListener("click",Z=>Z.preventDefault(),{once:!0})}})})})}),w.viewport)})]}):null}),fbe=t=>{const{__scopeToast:e,children:n,...r}=t,i=B0(wy,e),[s,o]=E.useState(!1),[a,l]=E.useState(!1);return mbe(()=>o(!0)),E.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:y.jsx(gy,{asChild:!0,children:y.jsx(v0,{...r,children:s&&y.jsxs(y.Fragment,{children:[i.label," ",n]})})})},pbe="ToastTitle",KV=E.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return y.jsx(ht.div,{...r,ref:e})});KV.displayName=pbe;var gbe="ToastDescription",VV=E.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return y.jsx(ht.div,{...r,ref:e})});VV.displayName=gbe;var qV="ToastAction",GV=E.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?y.jsx(WV,{altText:n,asChild:!0,children:y.jsx(XM,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${qV}\`. Expected non-empty \`string\`.`),null)});GV.displayName=qV;var YV="ToastClose",XM=E.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=dbe(YV,n);return y.jsx(WV,{asChild:!0,children:y.jsx(ht.button,{type:"button",...r,ref:e,onClick:Re(t.onClick,i.onClose)})})});XM.displayName=YV;var WV=E.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return y.jsx(ht.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function XV(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),ybe(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...XV(r))}}),e}function ob(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?hM(i,s):i.dispatchEvent(s)}var az=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),s=r>i;return e==="left"||e==="right"?s&&r>n:!s&&i>n};function mbe(t=()=>{}){const e=rs(t);Wl(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function ybe(t){return t.nodeType===t.ELEMENT_NODE}function Sbe(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function p_(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var bbe=BV,vbe=$V,xbe=KV,wbe=VV,Cbe=GV,lz=XM,ZV="Toggle",JV=E.forwardRef((t,e)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...s}=t,[o,a]=qo({prop:n,onChange:i,defaultProp:r??!1,caller:ZV});return y.jsx(ht.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":t.disabled?"":void 0,...s,ref:e,onClick:Re(t.onClick,()=>{t.disabled||a(!o)})})});JV.displayName=ZV;var Nu="ToggleGroup",[QV,eq]=po(Nu,[lp]),tq=lp(),ZM=qe.forwardRef((t,e)=>{const{type:n,...r}=t;if(n==="single"){const i=r;return y.jsx(Tbe,{...i,ref:e})}if(n==="multiple"){const i=r;return y.jsx(Ebe,{...i,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Nu}\``)});ZM.displayName=Nu;var[nq,rq]=QV(Nu),Tbe=qe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...s}=t,[o,a]=qo({prop:n,defaultProp:r??"",onChange:i,caller:Nu});return y.jsx(nq,{scope:t.__scopeToggleGroup,type:"single",value:qe.useMemo(()=>o?[o]:[],[o]),onItemActivate:a,onItemDeactivate:qe.useCallback(()=>a(""),[a]),children:y.jsx(iq,{...s,ref:e})})}),Ebe=qe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...s}=t,[o,a]=qo({prop:n,defaultProp:r??[],onChange:i,caller:Nu}),l=qe.useCallback(f=>a((h=[])=>[...h,f]),[a]),u=qe.useCallback(f=>a((h=[])=>h.filter(g=>g!==f)),[a]);return y.jsx(nq,{scope:t.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:l,onItemDeactivate:u,children:y.jsx(iq,{...s,ref:e})})});ZM.displayName=Nu;var[_be,Pbe]=QV(Nu),iq=qe.forwardRef((t,e)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:s,dir:o,loop:a=!0,...l}=t,u=tq(n),f=py(o),h={role:"group",dir:f,...l};return y.jsx(_be,{scope:n,rovingFocus:i,disabled:r,children:i?y.jsx(IM,{asChild:!0,...u,orientation:s,dir:f,loop:a,children:y.jsx(ht.div,{...h,ref:e})}):y.jsx(ht.div,{...h,ref:e})})}),Lv="ToggleGroupItem",sq=qe.forwardRef((t,e)=>{const n=rq(Lv,t.__scopeToggleGroup),r=Pbe(Lv,t.__scopeToggleGroup),i=tq(t.__scopeToggleGroup),s=n.value.includes(t.value),o=r.disabled||t.disabled,a={...t,pressed:s,disabled:o},l=qe.useRef(null);return r.rovingFocus?y.jsx(O0,{asChild:!0,...i,focusable:!o,active:s,ref:l,children:y.jsx(cz,{...a,ref:e})}):y.jsx(cz,{...a,ref:e})});sq.displayName=Lv;var cz=qe.forwardRef((t,e)=>{const{__scopeToggleGroup:n,value:r,...i}=t,s=rq(Lv,n),o={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},a=s.type==="single"?o:void 0;return y.jsx(JV,{...a,...i,ref:e,onPressedChange:l=>{l?s.onItemActivate(r):s.onItemDeactivate(r)}})}),Ibe=ZM,kbe=sq,JM="Toolbar",[Mbe]=po(JM,[lp,eq]),QM=lp(),oq=eq(),[Abe,aq]=Mbe(JM),lq=E.forwardRef((t,e)=>{const{__scopeToolbar:n,orientation:r="horizontal",dir:i,loop:s=!0,...o}=t,a=QM(n),l=py(i);return y.jsx(Abe,{scope:n,orientation:r,dir:l,children:y.jsx(IM,{asChild:!0,...a,orientation:r,dir:l,loop:s,children:y.jsx(ht.div,{role:"toolbar","aria-orientation":r,dir:l,...o,ref:e})})})});lq.displayName=JM;var cq="ToolbarSeparator",Obe=E.forwardRef((t,e)=>{const{__scopeToolbar:n,...r}=t,i=aq(cq,n);return y.jsx(LSe,{orientation:i.orientation==="horizontal"?"vertical":"horizontal",...r,ref:e})});Obe.displayName=cq;var Dbe="ToolbarButton",e2=E.forwardRef((t,e)=>{const{__scopeToolbar:n,...r}=t,i=QM(n);return y.jsx(O0,{asChild:!0,...i,focusable:!t.disabled,children:y.jsx(ht.button,{type:"button",...r,ref:e})})});e2.displayName=Dbe;var Rbe="ToolbarLink",jbe=E.forwardRef((t,e)=>{const{__scopeToolbar:n,...r}=t,i=QM(n);return y.jsx(O0,{asChild:!0,...i,focusable:!0,children:y.jsx(ht.a,{...r,ref:e,onKeyDown:Re(t.onKeyDown,s=>{s.key===" "&&s.currentTarget.click()})})})});jbe.displayName=Rbe;var uq="ToolbarToggleGroup",dq=E.forwardRef((t,e)=>{const{__scopeToolbar:n,...r}=t,i=aq(uq,n),s=oq(n);return y.jsx(Ibe,{"data-orientation":i.orientation,dir:i.dir,...s,...r,ref:e,rovingFocus:!1})});dq.displayName=uq;var Lbe="ToolbarToggleItem",hq=E.forwardRef((t,e)=>{const{__scopeToolbar:n,...r}=t,i=oq(n),s={__scopeToolbar:t.__scopeToolbar};return y.jsx(e2,{asChild:!0,...s,children:y.jsx(kbe,{...i,...r,ref:e})})});hq.displayName=Lbe;var Nbe=lq,zbe=e2,Bbe=dq,Fbe=hq,[F0]=po("Tooltip",[ap]),U0=ap(),fq="TooltipProvider",Ube=700,WP="tooltip.open",[Hbe,t2]=F0(fq),pq=t=>{const{__scopeTooltip:e,delayDuration:n=Ube,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,o=E.useRef(!0),a=E.useRef(!1),l=E.useRef(0);return E.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),y.jsx(Hbe,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:E.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:E.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:E.useCallback(u=>{a.current=u},[]),disableHoverableContent:i,children:s})};pq.displayName=fq;var Am="Tooltip",[$be,H0]=F0(Am),gq=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=t,l=t2(Am,t.__scopeTooltip),u=U0(e),[f,h]=E.useState(null),g=Va(),m=E.useRef(0),b=o??l.disableHoverableContent,w=a??l.delayDuration,x=E.useRef(!1),[v,C]=qo({prop:r,defaultProp:i??!1,onChange:O=>{O?(l.onOpen(),document.dispatchEvent(new CustomEvent(WP))):l.onClose(),s?.(O)},caller:Am}),P=E.useMemo(()=>v?x.current?"delayed-open":"instant-open":"closed",[v]),k=E.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x.current=!1,C(!0)},[C]),M=E.useCallback(()=>{window.clearTimeout(m.current),m.current=0,C(!1)},[C]),A=E.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{x.current=!0,C(!0),m.current=0},w)},[w,C]);return E.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),y.jsx(M0,{...u,children:y.jsx($be,{scope:e,contentId:g,open:v,stateAttribute:P,trigger:f,onTriggerChange:h,onTriggerEnter:E.useCallback(()=>{l.isOpenDelayedRef.current?A():k()},[l.isOpenDelayedRef,A,k]),onTriggerLeave:E.useCallback(()=>{b?M():(window.clearTimeout(m.current),m.current=0)},[M,b]),onOpen:k,onClose:M,disableHoverableContent:b,children:n})})};gq.displayName=Am;var XP="TooltipTrigger",mq=E.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=H0(XP,n),s=t2(XP,n),o=U0(n),a=E.useRef(null),l=Zt(e,a,i.onTriggerChange),u=E.useRef(!1),f=E.useRef(!1),h=E.useCallback(()=>u.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),y.jsx(A0,{asChild:!0,...o,children:y.jsx(ht.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Re(t.onPointerMove,g=>{g.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:Re(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:Re(t.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Re(t.onFocus,()=>{u.current||i.onOpen()}),onBlur:Re(t.onBlur,i.onClose),onClick:Re(t.onClick,i.onClose)})})});mq.displayName=XP;var Kbe="TooltipPortal",[dMe,Vbe]=F0(Kbe,{forceMount:void 0}),Hf="TooltipContent",yq=E.forwardRef((t,e)=>{const n=Vbe(Hf,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,o=H0(Hf,t.__scopeTooltip);return y.jsx(Go,{present:r||o.open,children:o.disableHoverableContent?y.jsx(Sq,{side:i,...s,ref:e}):y.jsx(qbe,{side:i,...s,ref:e})})}),qbe=E.forwardRef((t,e)=>{const n=H0(Hf,t.__scopeTooltip),r=t2(Hf,t.__scopeTooltip),i=E.useRef(null),s=Zt(e,i),[o,a]=E.useState(null),{trigger:l,onClose:u}=n,f=i.current,{onPointerInTransitChange:h}=r,g=E.useCallback(()=>{a(null),h(!1)},[h]),m=E.useCallback((b,w)=>{const x=b.currentTarget,v={x:b.clientX,y:b.clientY},C=Xbe(v,x.getBoundingClientRect()),P=Zbe(v,C),k=Jbe(w.getBoundingClientRect()),M=eve([...P,...k]);a(M),h(!0)},[h]);return E.useEffect(()=>()=>g(),[g]),E.useEffect(()=>{if(l&&f){const b=x=>m(x,f),w=x=>m(x,l);return l.addEventListener("pointerleave",b),f.addEventListener("pointerleave",w),()=>{l.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",w)}}},[l,f,m,g]),E.useEffect(()=>{if(o){const b=w=>{const x=w.target,v={x:w.clientX,y:w.clientY},C=l?.contains(x)||f?.contains(x),P=!Qbe(v,o);C?g():P&&(g(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,f,o,u,g]),y.jsx(Sq,{...t,ref:s})}),[Gbe,Ybe]=F0(Am,{isInside:!1}),Wbe=Bfe("TooltipContent"),Sq=E.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=t,l=H0(Hf,n),u=U0(n),{onClose:f}=l;return E.useEffect(()=>(document.addEventListener(WP,f),()=>document.removeEventListener(WP,f)),[f]),E.useEffect(()=>{if(l.trigger){const h=g=>{g.target?.contains(l.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,f]),y.jsx(ip,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:y.jsxs(_M,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[y.jsx(Wbe,{children:r}),y.jsx(Gbe,{scope:n,isInside:!0,children:y.jsx(qfe,{id:l.contentId,role:"tooltip",children:i||r})})]})})});yq.displayName=Hf;var bq="TooltipArrow",vq=E.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=U0(n);return Ybe(bq,n).isInside?null:y.jsx(PM,{...i,...r,ref:e})});vq.displayName=bq;function Xbe(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Zbe(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function Jbe(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function Qbe(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s],l=e[o],u=a.x,f=a.y,h=l.x,g=l.y;f>r!=g>r&&n<(h-u)*(r-f)/(g-f)+u&&(i=!i)}return i}function eve(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),tve(e)}function tve(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var nve=pq,xq=gq,wq=mq,Cq=yq,Tq=vq;const Za=E.memo(function({label:e,small:n,invertIcon:r,icon:i,color:s,className:o,...a}){return typeof i=="string"?y.jsx(rve,{label:e,small:n,invertIcon:r,icon:i,color:s,className:o,...a}):E.cloneElement(i,{...a,className:Fe({"tlui-icon__small":n},o,i.props.className),"aria-label":e,style:{color:s,transform:r?"scale(-1, 1)":void 0,...i.props.style}})});function rve({label:t,small:e,invertIcon:n,icon:r,color:i,className:s,...o}){const a=lM(),l=a.icons[r]??a.icons["question-mark-circle"],u=E.useRef(null);return E.useLayoutEffect(()=>{l||console.error(`Icon not found: ${r}. Add it to the assetUrls.icons object.`),u?.current&&(u.current.style.webkitMask=`url(${l}) center 100% / 100% no-repeat`)},[u,l,r]),r==="none"?y.jsx("div",{className:Fe("tlui-icon tlui-icon__placeholder",{"tlui-icon__small":e},s),...o}):y.jsx("div",{...o,ref:u,"aria-label":t,role:"img",className:Fe("tlui-icon",{"tlui-icon__small":e},s),style:{color:i,mask:`url(${l}) center 100% / 100% no-repeat`,transform:n?"scale(-1, 1)":void 0}})}function Ze({icon:t,small:e,invertIcon:n}){return y.jsx(Za,{"aria-hidden":"true",label:"",className:"tlui-button__icon",icon:t,small:e,invertIcon:n})}function $0({className:t,children:e}){return y.jsx("div",{className:Fe("tlui-dialog__header",t),children:e})}function K0({className:t,children:e,style:n}){return y.jsx(xge,{dir:"ltr",className:Fe("tlui-dialog__header__title",t),style:n,children:e})}function V0(){const t=Ne();return y.jsx("div",{className:"tlui-dialog__header__close",children:y.jsx(E7,{"data-testid":"dialog.close",dir:"ltr",asChild:!0,children:y.jsx(gt,{type:"icon","aria-label":t("ui.close"),onTouchEnd:e=>e.target.click(),children:y.jsx(Ze,{small:!0,icon:"cross-2"})})})})}function Om({className:t,children:e,style:n}){return y.jsx("div",{className:Fe("tlui-dialog__body",t),style:n,tabIndex:0,children:e})}function n2({className:t,children:e}){return y.jsx("div",{className:Fe("tlui-dialog__footer",t),children:e})}const up=E.forwardRef(function({className:e,label:n,icon:r,iconLeft:i,iconLabel:s,autoSelect:o=!1,autoFocus:a=!1,defaultValue:l,placeholder:u,onComplete:f,onValueChange:h,onCancel:g,onFocus:m,onBlur:b,shouldManuallyMaintainScrollPositionWhenFocused:w=!1,children:x,value:v,"data-testid":C,disabled:P,"aria-label":k},M){const A=Gn(),O=E.useRef(null);E.useImperativeHandle(M,()=>O.current);const R=Ne(),F=E.useRef(l??""),N=E.useRef(l??""),j=E.useRef(!1),[H,V]=E.useState(!1),z=E.useCallback(de=>{V(!0);const U=de.currentTarget;N.current=U.value,A?A.timers.requestAnimationFrame(()=>{o&&U.select()}):fv.requestAnimationFrame("anon",()=>{o&&U.select()}),m?.()},[o,A,m]),K=E.useCallback(de=>{const U=de.currentTarget.value;N.current=U,h?.(U)},[h]),B=E.useCallback(de=>{switch(de.key){case"Enter":{if(j.current)return;de.currentTarget.blur(),de.stopPropagation(),f?.(de.currentTarget.value);break}case"Escape":{de.currentTarget.value=F.current,g?.(de.currentTarget.value),de.currentTarget.blur(),de.stopPropagation();break}}},[f,g]),G=E.useCallback(de=>{V(!1);const U=de.currentTarget.value;b?.(U)},[b]),W=E.useCallback(()=>j.current=!0,[]),Z=E.useCallback(()=>j.current=!1,[]);return E.useEffect(()=>{if(!Lt.isIos)return;const de=window.visualViewport;if(H&&w&&de){const U=()=>{O.current?.scrollIntoView({block:"center"})};return de.addEventListener("resize",U),de.addEventListener("scroll",U),A?A.timers.requestAnimationFrame(()=>{O.current?.scrollIntoView({block:"center"})}):fv.requestAnimationFrame("anon",()=>{O.current?.scrollIntoView({block:"center"})}),()=>{de.removeEventListener("resize",U),de.removeEventListener("scroll",U)}}},[H,A,w]),y.jsxs("div",{draggable:!1,className:"tlui-input__wrapper",children:[x,n&&y.jsx("label",{children:R(n)}),i&&y.jsx(Za,{label:s?R(s):"",icon:i,className:"tlui-icon-left",small:!0}),y.jsx("input",{ref:O,className:Fe("tlui-input",e),type:"text",defaultValue:l,onKeyDownCapture:B,onChange:K,onFocus:z,onBlur:G,onCompositionStart:W,onCompositionEnd:Z,autoFocus:a,"aria-label":k,placeholder:u,value:v,"data-testid":C,disabled:P}),r&&y.jsx(Za,{label:s?R(s):"",icon:r,small:!!n})]})});function uz(t){return lo.isValid(t)?{isValid:!0,hasProtocol:!0}:lo.isValid("https://"+t)?{isValid:!0,hasProtocol:!1}:{isValid:!1,hasProtocol:!1}}const ive=cr(function({onClose:e}){const r=te().getOnlySelectedShape();return r&&"url"in r.props&&typeof r.props.url=="string"?y.jsx(sve,{onClose:e,selectedShape:r}):null}),sve=cr(function({onClose:e,selectedShape:n}){const r=te(),i=Ne(),s=E.useRef(null);E.useEffect(()=>{r.timers.requestAnimationFrame(()=>s.current?.focus())},[r]);const o=E.useRef(n.props.url),[a,l]=E.useState(()=>{const b=uz(n.props.url),w=b.isValid===!0?b.hasProtocol?n.props.url:"https://"+n.props.url:"https://";return{actual:w,safe:w,valid:!0}}),u=E.useCallback(b=>{const w=b.replace(/https?:\/\/(https?:\/\/)/,(C,P)=>P),x=uz(w),v=x.isValid===!0?x.hasProtocol?w:"https://"+w:"https://";l({actual:w,safe:v,valid:x.isValid})},[]),f=E.useCallback(()=>{const b=r.getOnlySelectedShape();b&&(r.updateShapes([{id:b.id,type:b.type,props:{url:""}}]),e())},[r,e]),h=E.useCallback(()=>{const b=r.getOnlySelectedShape();b&&(b&&"url"in b.props&&b.props.url!==a.safe&&r.updateShapes([{id:b.id,type:b.type,props:{url:a.safe}}]),e())},[r,e,a]),g=E.useCallback(()=>{e()},[e]);if(!n)return e(),null;const m=o.current&&!a.valid;return y.jsxs(y.Fragment,{children:[y.jsxs($0,{children:[y.jsx(K0,{children:i("edit-link-dialog.title")}),y.jsx(V0,{})]}),y.jsx(Om,{children:y.jsxs("div",{className:"tlui-edit-link-dialog",children:[y.jsx(up,{ref:s,className:"tlui-edit-link-dialog__input",label:"edit-link-dialog.url",autoFocus:!0,autoSelect:!0,placeholder:"https://example.com",value:a.actual,onValueChange:u,onComplete:h,onCancel:g}),y.jsx("div",{children:a.valid?i("edit-link-dialog.detail"):i("edit-link-dialog.invalid-url")})]})}),y.jsxs(n2,{className:"tlui-dialog__footer__actions",children:[y.jsx(gt,{type:"normal",onClick:g,onTouchEnd:g,children:y.jsx(sr,{children:i("edit-link-dialog.cancel")})}),m?y.jsx(gt,{type:"danger",onTouchEnd:f,onClick:f,children:y.jsx(sr,{children:i("edit-link-dialog.clear")})}):y.jsx(gt,{type:"primary",disabled:!a.valid,onTouchEnd:h,onClick:h,children:y.jsx(sr,{children:i("edit-link-dialog.save")})})]})]})});var ove={};const dz=/(^\/[f|p|r|ro|s|v]\/[^/]+\/?$)/,r2=[{type:"tldraw",title:"tldraw",hostnames:["beta.tldraw.com","tldraw.com","localhost:3000"],minWidth:300,minHeight:300,width:720,height:500,doesResize:!0,overridePermissions:{"allow-top-navigation":!0},toEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(dz))return e.searchParams.append("embed","true"),t},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(dz))return e.searchParams.delete("embed"),t},embedOnPaste:!1},{type:"figma",title:"Figma",hostnames:["figma.com"],width:720,height:500,doesResize:!0,toEmbedUrl:t=>{if(t.match(/https:\/\/([\w\.-]+\.)?figma.com\/(file|proto|design)\/([0-9a-zA-Z]{22,128})(?:\/.*)?$/)&&!t.includes("figma.com/embed"))return`https://www.figma.com/embed?embed_host=share&url=${t}`},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/^\/embed\/?$/)){const n=e.searchParams.get("url");if(n)return n}},embedOnPaste:!0},{type:"google_maps",title:"Google Maps",hostnames:["google.*"],width:720,height:500,doesResize:!0,overridePermissions:{"allow-presentation":!0},toEmbedUrl:t=>{if(t.includes("/maps/embed?"))return t;if(t.includes("/maps/")){const e=t.match(/@(.*?),(.*?),(.*?)(z|m)/);let n;if(e){const[,r,i,s,o]=e,a=o==="z"?"roadmap":"satellite",l=a==="roadmap"?s:-Math.log2(parseInt(s)/14772321)/.8;n=`https://${new URL(t).host.replace("www.","")}/maps/embed/v1/view?key=${ove.NEXT_PUBLIC_GC_API_KEY}&center=${r},${i}&zoom=${l}&maptype=${a}`}else n="";return n}},fromEmbedUrl:t=>{const e=ot(t);if(!e)return;if(e.pathname.match(/^\/maps\/embed\/v1\/view\/?$/)&&e.searchParams.has("center")&&e.searchParams.get("zoom")){const r=e.searchParams.get("zoom")??"12",i=e.searchParams.get("maptype")??"roadmap",s=i==="roadmap"?r:14772321*Math.pow(2,parseInt(r)*-.8),[o,a]=e.searchParams.get("center").split(",");return`https://www.google.com/maps/@${o},${a},${s}${i==="roadmap"?"z":"m"}`}},embedOnPaste:!0},{type:"val_town",title:"Val Town",hostnames:["val.town"],minWidth:260,minHeight:100,width:720,height:500,doesResize:!0,toEmbedUrl:t=>{const e=ot(t),n=e&&e.pathname.match(/\/v\/(.+)\/?/);if(n)return`https://www.val.town/embed/${n[1]}`},fromEmbedUrl:t=>{const e=ot(t),n=e&&e.pathname.match(/\/embed\/(.+)\/?/);if(n)return`https://www.val.town/v/${n[1]}`},embedOnPaste:!0},{type:"codesandbox",title:"CodeSandbox",hostnames:["codesandbox.io"],minWidth:300,minHeight:300,width:720,height:500,doesResize:!0,toEmbedUrl:t=>{const e=ot(t),n=e&&e.pathname.match(/\/s\/([^/]+)\/?/);if(n)return`https://codesandbox.io/embed/${n[1]}`},fromEmbedUrl:t=>{const e=ot(t),n=e&&e.pathname.match(/\/embed\/([^/]+)\/?/);if(n)return`https://codesandbox.io/s/${n[1]}`},embedOnPaste:!0},{type:"codepen",title:"Codepen",hostnames:["codepen.io"],minWidth:300,minHeight:300,width:520,height:400,doesResize:!0,toEmbedUrl:t=>{const e=/https:\/\/codepen.io\/([^/]+)\/pen\/([^/]+)/,n=t.match(e);if(n){const[r,i,s]=n;return`https://codepen.io/${i}/embed/${s}`}},fromEmbedUrl:t=>{const e=/https:\/\/codepen.io\/([^/]+)\/embed\/([^/]+)/,n=t.match(e);if(n){const[r,i,s]=n;return`https://codepen.io/${i}/pen/${s}`}},embedOnPaste:!0},{type:"scratch",title:"Scratch",hostnames:["scratch.mit.edu"],width:520,height:400,doesResize:!1,embedOnPaste:!0,toEmbedUrl:t=>{const e=/https?:\/\/scratch.mit.edu\/projects\/([^/]+)/,n=t.match(e);if(n){const[r,i]=n;return`https://scratch.mit.edu/projects/embed/${i}`}},fromEmbedUrl:t=>{const e=/https:\/\/scratch.mit.edu\/projects\/embed\/([^/]+)/,n=t.match(e);if(n){const[r,i]=n;return`https://scratch.mit.edu/projects/${i}`}}},{type:"youtube",title:"YouTube",hostnames:["*.youtube.com","youtube.com","youtu.be"],width:800,height:450,doesResize:!0,overridePermissions:{"allow-presentation":!0,"allow-popups-to-escape-sandbox":!0},isAspectRatioLocked:!0,embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(!e)return;const n=e.hostname.replace(/^www./,"");if(n==="youtu.be"){const r=e.pathname.split("/").filter(Boolean)[0],i=new URLSearchParams(e.search),s=i.get("t");s&&(i.set("start",s),i.delete("t"));const o=i.toString()?"?"+i.toString():"";return`https://www.youtube.com/embed/${r}${o}`}else if((n==="youtube.com"||n==="m.youtube.com")&&e.pathname.match(/^\/watch/)){const r=e.searchParams.get("v"),i=new URLSearchParams(e.search);i.delete("v");const s=i.get("t");s&&(i.set("start",s),i.delete("t"));const o=i.toString()?"?"+i.toString():"";return`https://www.youtube.com/embed/${r}${o}`}},fromEmbedUrl:t=>{const e=ot(t);if(!e)return;if(e.hostname.replace(/^www./,"")==="youtube.com"){const r=e.pathname.match(/^\/embed\/([^/]+)\/?/);if(r){const i=new URLSearchParams(e.search);i.set("v",r?.[1]??"");const s=i.get("start");return s&&(i.set("t",s),i.delete("start")),`https://www.youtube.com/watch?${i.toString()}`}}}},{type:"google_calendar",title:"Google Calendar",hostnames:["calendar.google.*"],width:720,height:500,minWidth:460,minHeight:360,doesResize:!0,instructionLink:"https://support.google.com/calendar/answer/41207?hl=en",overridePermissions:{"allow-popups-to-escape-sandbox":!0},embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t),n=e?.searchParams.get("cid");if(e?.pathname.match(/\/calendar\/u\/0/)&&n){e.pathname="/calendar/embed";const r=Array.from(e.searchParams.keys());for(const i of r)e.searchParams.delete(i);return e.searchParams.set("src",n),e.href}},fromEmbedUrl:t=>{const e=ot(t),n=e?.searchParams.get("src");if(e?.pathname.match(/\/calendar\/embed/)&&n){e.pathname="/calendar/u/0";const r=Array.from(e.searchParams.keys());for(const i of r)e.searchParams.delete(i);return e.searchParams.set("cid",n),e.href}}},{type:"google_slides",title:"Google Slides",hostnames:["docs.google.*"],width:720,height:500,minWidth:460,minHeight:360,doesResize:!0,overridePermissions:{"allow-popups-to-escape-sandbox":!0},embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e?.pathname.match(/^\/presentation/)&&e?.pathname.match(/\/pub\/?$/)){e.pathname=e.pathname.replace(/\/pub$/,"/embed");const n=Array.from(e.searchParams.keys());for(const r of n)e.searchParams.delete(r);return e.href}},fromEmbedUrl:t=>{const e=ot(t);if(e?.pathname.match(/^\/presentation/)&&e?.pathname.match(/\/embed\/?$/)){e.pathname=e.pathname.replace(/\/embed$/,"/pub");const n=Array.from(e.searchParams.keys());for(const r of n)e.searchParams.delete(r);return e.href}}},{type:"github_gist",title:"GitHub Gist",hostnames:["gist.github.com"],width:720,height:500,doesResize:!0,embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/\/([^/]+)\/([0-9a-f]+)$/))return t.split("/").pop()?t:void 0},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/\/([^/]+)\/([0-9a-f]+)$/))return t.split("/").pop()?t:void 0}},{type:"replit",title:"Replit",hostnames:["replit.com"],width:720,height:500,doesResize:!0,embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/\/@([^/]+)\/([^/]+)/))return e.searchParams.append("embed","true"),e.href},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/\/@([^/]+)\/([^/]+)/)&&e.searchParams.has("embed"))return e.searchParams.delete("embed"),e.href}},{type:"felt",title:"Felt",hostnames:["felt.com"],width:720,height:500,doesResize:!0,embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/^\/map\//))return e.origin+"/embed"+e.pathname},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/^\/embed\/map\//))return e.pathname=e.pathname.replace(/^\/embed/,""),e.href}},{type:"spotify",title:"Spotify",hostnames:["open.spotify.com"],width:720,height:500,minHeight:500,overrideOutlineRadius:12,doesResize:!0,embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/^\/(artist|album)\//))return e.origin+"/embed"+e.pathname},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/^\/embed\/(artist|album)\//))return e.origin+e.pathname.replace(/^\/embed/,"")}},{type:"vimeo",title:"Vimeo",hostnames:["vimeo.com","player.vimeo.com"],width:640,height:360,doesResize:!0,isAspectRatioLocked:!0,embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e&&e.hostname==="vimeo.com"&&e.pathname.match(/^\/[0-9]+/))return"https://player.vimeo.com/video/"+e.pathname.split("/")[1]+"?title=0&byline=0"},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.hostname==="player.vimeo.com"){const n=e.pathname.match(/^\/video\/([^/]+)\/?$/);if(n)return"https://vimeo.com/"+n[1]}}},{type:"observable",title:"Observable",hostnames:["observablehq.com"],width:720,height:500,doesResize:!0,isAspectRatioLocked:!1,backgroundColor:"#fff",embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/^\/@([^/]+)\/([^/]+)\/?$/))return`${e.origin}/embed${e.pathname}?cell=*`;if(e&&e.pathname.match(/^\/d\/([^/]+)\/?$/)){const n=e.pathname.replace(/^\/d/,"");return`${e.origin}/embed${n}?cell=*`}},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/^\/embed\/@([^/]+)\/([^/]+)\/?$/))return`${e.origin}${e.pathname.replace("/embed","")}#cell-*`;if(e&&e.pathname.match(/^\/embed\/([^/]+)\/?$/))return`${e.origin}${e.pathname.replace("/embed","/d")}#cell-*`}},{type:"desmos",title:"Desmos",hostnames:["desmos.com"],width:700,height:450,doesResize:!0,embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e&&e.hostname==="www.desmos.com"&&e.pathname.match(/^\/calculator\/([^/]+)\/?$/)&&e.search===""&&e.hash==="")return`${t}?embed`},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.hostname==="www.desmos.com"&&e.pathname.match(/^\/calculator\/([^/]+)\/?$/)&&e.search==="?embed"&&e.hash==="")return t.replace("?embed","")}}],ave={"allow-downloads-without-user-activation":!1,"allow-downloads":!1,"allow-modals":!1,"allow-orientation-lock":!1,"allow-pointer-lock":!1,"allow-popups":!0,"allow-popups-to-escape-sandbox":!1,"allow-presentation":!1,"allow-storage-access-by-user-activation":!1,"allow-top-navigation":!1,"allow-top-navigation-by-user-activation":!1,"allow-scripts":!0,"allow-same-origin":!0,"allow-forms":!0},lve=r2.map(t=>t.type);function cve(t){return lve.includes(t)}function uve(t){return"icon"in t}function Eq(){const t=Gn();if(t&&t.hasShapeUtil("embed"))return t.getShapeUtil("embed")}function i2(){const t=Eq();return e=>t?t.getEmbedDefinition(e):void 0}function dve(){const t=Eq();return t?t.getEmbedDefinitions():[]}const _q=cr(function({onClose:e}){const n=te(),r=Ne(),i=lM(),[s,o]=E.useState(null),[a,l]=E.useState(""),[u,f]=E.useState(null),[h,g]=E.useState(!1),m=E.useRef(-1),b=dve(),w=i2();return y.jsxs(y.Fragment,{children:[y.jsxs($0,{children:[y.jsx(K0,{children:s?`${r("embed-dialog.title")} — ${s.title}`:r("embed-dialog.title")}),y.jsx(V0,{})]}),s?y.jsxs(y.Fragment,{children:[y.jsxs(Om,{className:"tlui-embed-dialog__enter",children:[y.jsx(up,{className:"tlui-embed-dialog__input",label:"embed-dialog.url",placeholder:"https://example.com",autoFocus:!0,onValueChange:x=>{l(x);const v=w(x);f(v&&v.definition.type===s.type?v:null),g(!1),clearTimeout(m.current),m.current=n.timers.setTimeout(()=>g(!v),320)}}),a===""?y.jsxs("div",{className:"tlui-embed-dialog__instruction",children:[y.jsx("span",{children:r("embed-dialog.instruction")})," ",s.instructionLink&&y.jsxs(y.Fragment,{children:[y.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:s.instructionLink,className:"tlui-embed-dialog__instruction__link",children:"Learn more"}),"."]})]}):y.jsx("div",{className:"tlui-embed-dialog__warning",children:h?r("embed-dialog.invalid-url"):" "})]}),y.jsxs(n2,{className:"tlui-dialog__footer__actions",children:[y.jsx(gt,{type:"normal",onClick:()=>{o(null),f(null),l("")},children:y.jsx(sr,{children:r("embed-dialog.back")})}),y.jsx("div",{className:"tlui-embed__spacer"}),y.jsx(gt,{type:"normal",onClick:e,children:y.jsx(sr,{children:r("embed-dialog.cancel")})}),y.jsx(gt,{type:"primary",disabled:!u,onClick:()=>{u&&(n.putExternalContent({type:"embed",url:a,point:n.getViewportPageBounds().center,embed:u.definition}),e())},children:y.jsx(sr,{children:r("embed-dialog.create")})})]})]}):y.jsx(y.Fragment,{children:y.jsx(Om,{className:"tlui-embed-dialog__list",children:b.map(x=>{const v=cve(x.type)?i.embedIcons[x.type]:uve(x)?x.icon:void 0;return y.jsxs(gt,{type:"menu",onClick:()=>o(x),children:[y.jsx(sr,{children:x.title}),v&&y.jsx("div",{className:"tlui-embed-dialog__item__image",style:{backgroundImage:`url(${v})`}})]},x.type)})})})]})}),Hb=[0,389,436,476,580,640,840,1023];var kn=(t=>(t[t.ZERO=0]="ZERO",t[t.MOBILE_XXS=1]="MOBILE_XXS",t[t.MOBILE_XS=2]="MOBILE_XS",t[t.MOBILE_SM=3]="MOBILE_SM",t[t.MOBILE=4]="MOBILE",t[t.TABLET_SM=5]="TABLET_SM",t[t.TABLET=6]="TABLET",t[t.DESKTOP=7]="DESKTOP",t))(kn||{});const Pq=qe.createContext(null);function hve({forceMobile:t=!1,children:e}){const n=Gn(),r=ee("breakpoint",()=>{const{width:i}=n?.getViewportScreenBounds()??{width:window.innerWidth},s=t?kn.MOBILE_SM:Hb.length-1;for(let o=0;o<s;o++)if(i>Hb[o]&&i<=Hb[o+1])return o;return s},[n]);return y.jsx(Pq.Provider,{value:r,children:e})}function qr(){const t=E.useContext(Pq);if(t===null)throw new Error("useBreakpoint must be used inside of the <BreakpointProvider /> component");return t}const Iq=E.createContext(null);function q0(){const t=E.useContext(Iq);if(!t)throw new Error("useTldrawUiMenuContext must be used within a TldrawUiMenuContextProvider");return t}function is({type:t,sourceId:e,children:n}){return y.jsx(Iq.Provider,{value:{type:t,sourceId:e},children:n})}function G0(){return Gn()?.store.props.collaboration!==void 0}function fve(){const t=Gn();return ee("sync status",()=>t?.store.props.collaboration?.status?t.store.props.collaboration.status.get():null,[t])}function go(){const t=Gn();return ee("isReadonlyMode",()=>!!t?.getIsReadonly(),[t])}const hz=Lt.isDarwin?"⌘":"__CTRL__",pve=Lt.isDarwin?"⌃":"__CTRL__",fz=Lt.isDarwin?"⌥":"__ALT__";function kq(t){return t===","?[","]:t.split(",")[0].split(/(\[\[[^\]]+\]\])/g).map(e=>e.startsWith("[[")?e.replace(/[[\]]/g,""):e.replace(/cmd\+/g,hz).replace(/ctrl\+/g,pve).replace(/alt\+/g,fz).replace(/shift\+/g,"⇧").replace(/\$/g,hz).replace(/\?/g,fz).replace(/!/g,"⇧").match(/__CTRL__|__ALT__|./g)||[]).flat().map((e,n)=>{if(e[0]==="+")return[];let r;return e==="__CTRL__"?r="Ctrl":e==="__ALT__"?r="Alt":r=e[0].toUpperCase()+e.slice(1),Lt.isDarwin||!n?r:["+",r]}).flat()}function Nv(t){return"— "+kq(t).join(" ")}function Mq(t){const e=Ne();return y.jsx(EH,{"aria-label":e("app.loading"),...t})}const Aq=()=>{},Oq=E.createContext(null);function gve({onEvent:t,children:e}){return y.jsx(Oq.Provider,{value:t??Aq,children:e})}function Mn(){return E.useContext(Oq)??Aq}function nc(t,e){const n=Gn(),r=E.useCallback(o=>{o&&n?.complete(),e?.(o)},[n,e]),i=Mn(),s=E.useCallback(o=>{i(o,{source:"unknown",id:t})},[t,i]);return Sle(n?`${t}-${n.contextId}`:t,r,s)}function Y0({id:t,children:e,modal:n=!1,debugOpen:r=!1}){const[i,s]=nc(t);return y.jsx(BM,{open:r||i,dir:"ltr",modal:n,onOpenChange:s,children:e})}function W0({children:t,...e}){return y.jsx(FM,{dir:"ltr",asChild:!0,onTouchEnd:n=>nt(n),...e,children:t})}function X0({className:t,side:e="bottom",align:n="start",sideOffset:r=8,alignOffset:i=8,children:s}){const o=ur();return y.jsx(L0,{container:o,children:y.jsx(UM,{className:Fe("tlui-menu",t),side:e,sideOffset:r,align:n,alignOffset:i,collisionPadding:4,children:s})})}function mve({id:t,children:e}){const[n,r]=nc(t);return y.jsx(vSe,{open:n,onOpenChange:r,children:e})}function yve({id:t,label:e,title:n,disabled:r}){return y.jsx(xSe,{dir:"ltr",asChild:!0,disabled:r,children:y.jsxs(gt,{"data-testid":t,type:"menu",className:"tlui-menu__submenu__trigger",disabled:r,title:n,children:[y.jsx(sr,{children:e}),y.jsx(Ze,{icon:"chevron-right",small:!0})]})})}function Sve({id:t,alignOffset:e=-1,sideOffset:n=-6,size:r="small",children:i}){const s=ur();return y.jsx(L0,{container:s,children:y.jsx(wSe,{"data-testid":t,className:"tlui-menu tlui-menu__submenu__content",alignOffset:e,sideOffset:n,collisionPadding:4,"data-size":r,children:i})})}function bve({className:t,children:e}){return y.jsx("div",{dir:"ltr",className:Fe("tlui-menu__group",t),children:e})}function vve({noClose:t,children:e}){return y.jsx(SSe,{dir:"ltr",asChild:!0,onClick:t?nt:void 0,children:e})}function xve({children:t,onSelect:e,...n}){const r=Ne();return y.jsxs(dV,{dir:"ltr",className:"tlui-button tlui-button__menu tlui-button__checkbox",onSelect:i=>{e?.(i),nt(i)},...n,children:[y.jsx("div",{className:"tlui-button__checkbox__indicator",children:y.jsx(bSe,{dir:"ltr",children:y.jsx(Za,{label:r("ui.checked"),icon:"check",small:!0})})}),t]})}function Zg({children:t,visibleOnMobileLayout:e=!1}){const n=qr();return!e&&n<kn.MOBILE?null:y.jsx("kbd",{className:"tlui-kbd",children:kq(t).map((r,i)=>y.jsx("span",{children:r},i))})}const Dq=E.createContext({orientation:"horizontal",tooltipSide:"bottom"});function Z0({children:t,orientation:e,tooltipSide:n}){const r=Cy(),i=n??(e===r.orientation?r.tooltipSide:e==="horizontal"?"bottom":"right");return y.jsx(Dq.Provider,{value:{orientation:e,tooltipSide:i},children:t})}function Cy(){return E.useContext(Dq)}const Xd=E.forwardRef(({asChild:t,className:e,tooltipSide:n,...r},i)=>{const s=t?dM:"div";return y.jsx(Z0,{orientation:"horizontal",tooltipSide:n,children:y.jsx(s,{ref:i,className:Fe("tlui-row",e),...r})})}),s2=E.forwardRef(({asChild:t,className:e,tooltipSide:n,...r},i)=>{const s=t?dM:"div";return y.jsx(Z0,{orientation:"vertical",tooltipSide:n,children:y.jsx(s,{ref:i,className:Fe("tlui-column",e),...r})})}),J0=E.forwardRef(({asChild:t,className:e,tooltipSide:n,...r},i)=>{const s=t?dM:"div";return y.jsx(Z0,{orientation:"horizontal",tooltipSide:n,children:y.jsx(s,{ref:i,className:Fe("tlui-grid",e),...r})})}),wve=700;class pf{static instance=null;currentTooltip=bn("current tooltip",null);destroyTimeoutId=null;static getInstance(){return pf.instance||(pf.instance=new pf),pf.instance}showTooltip(e,n,r,i,s,o,a){this.destroyTimeoutId&&(clearTimeout(this.destroyTimeoutId),this.destroyTimeoutId=null),this.currentTooltip.set({id:e,content:n,side:i,sideOffset:s,showOnMobile:o,targetElement:r,delayDuration:a})}updateCurrentTooltip(e,n){this.currentTooltip.update(r=>r?.id===e?n(r):r)}hideTooltip(e,n,r=!1){const i=()=>{this.currentTooltip.get()?.id===n&&(this.currentTooltip.set(null),this.destroyTimeoutId=null)};e&&!r?this.destroyTimeoutId=e.timers.setTimeout(i,300):i()}hideAllTooltips(){this.currentTooltip.set(null),this.destroyTimeoutId=null}getCurrentTooltipData(){const e=this.currentTooltip.get();return!e||!this.supportsHover()&&!e.showOnMobile?null:e}supportsHoverAtom=null;supportsHover(){if(!this.supportsHoverAtom){const e=window.matchMedia("(hover: hover)"),n=bn("has hover",e.matches);this.supportsHoverAtom=n,e.addEventListener("change",r=>{n.set(r.matches)})}return this.supportsHoverAtom.get()}}const Lo=pf.getInstance(),Rq=E.createContext(!1);function Cve({children:t}){return y.jsx(nve,{skipDelayDuration:700,children:y.jsxs(Rq.Provider,{value:!0,children:[t,y.jsx(Tve,{})]})})}function Tve(){const[t,e]=E.useState(!1),n=E.useRef(null),r=E.useRef(!0),i=Gn(),s=ee("current tooltip",()=>Lo.getCurrentTooltipData(),[]),o=ee("camera state",()=>i?.getCameraState(),[i]);return E.useEffect(()=>{o==="moving"&&t&&s&&Lo.hideTooltip(i,s.id,!0)},[o,t,s,i]),E.useEffect(()=>{function a(l){l.key==="Escape"&&s&&t&&(Lo.hideTooltip(i,s.id),l.stopPropagation())}return document.addEventListener("keydown",a,{capture:!0}),()=>{document.removeEventListener("keydown",a,{capture:!0})}},[i,s,t]),E.useEffect(()=>{let a=null;if(s&&n.current){const l=s.targetElement.getBoundingClientRect(),u=n.current;u.style.position="fixed",u.style.left=`${l.left}px`,u.style.top=`${l.top}px`,u.style.width=`${l.width}px`,u.style.height=`${l.height}px`,u.style.pointerEvents="none",u.style.zIndex="9999",r.current?a=setTimeout(()=>{e(!0),r.current=!1},s.delayDuration):e(!0)}else e(!1),r.current=!0;return()=>{a!==null&&clearTimeout(a)}},[s]),s?y.jsxs(xq,{open:t,delayDuration:0,children:[y.jsx(wq,{asChild:!0,children:y.jsx("div",{ref:n})}),y.jsxs(Cq,{className:"tlui-tooltip",side:s.side,sideOffset:s.sideOffset,avoidCollisions:!0,collisionPadding:8,dir:"ltr",children:[s.content,y.jsx(Tq,{className:"tlui-tooltip__arrow"})]})]}):null}const Q0=E.forwardRef(({children:t,content:e,side:n,sideOffset:r=5,disabled:i=!1,showOnMobile:s=!1,delayDuration:o},a)=>{const l=Gn(),u=E.useRef(Nt()),f=E.useContext(Rq),h=ee("enhancedA11yMode",()=>l?.user.getEnhancedA11yMode(),[l]),g=Cy(),m=n??g.tooltipSide;if(E.useEffect(()=>{const M=u.current;return()=>{f&&Lo.hideTooltip(l,M,!0)}},[l,f]),E.useLayoutEffect(()=>{f&&Lo.getCurrentTooltipData()?.id===u.current&&Lo.updateCurrentTooltip(u.current,M=>({...M,content:e,side:m,sideOffset:r,showOnMobile:s}))},[e,m,r,s,f]),i||!e)return y.jsx(y.Fragment,{children:t});let b;if(h?b=0:b=o??(l?.options.tooltipDelayMs||wve),!f||h)return y.jsxs(xq,{delayDuration:b,disableHoverableContent:!h,children:[y.jsx(wq,{asChild:!0,ref:a,children:t}),y.jsxs(Cq,{className:"tlui-tooltip",side:m,sideOffset:r,avoidCollisions:!0,collisionPadding:8,dir:"ltr",children:[e,y.jsx(Tq,{className:"tlui-tooltip__arrow"})]})]});const w=qe.Children.only(t);Be(qe.isValidElement(w),"TldrawUiTooltip children must be a single element");const x=M=>{w.props.onMouseEnter?.(M),Lo.showTooltip(u.current,e,M.currentTarget,m,r,s,b)},v=M=>{w.props.onMouseLeave?.(M),Lo.hideTooltip(l,u.current)},C=M=>{w.props.onFocus?.(M),Lo.showTooltip(u.current,e,M.currentTarget,m,r,s,b)},P=M=>{w.props.onBlur?.(M),Lo.hideTooltip(l,u.current)};return qe.cloneElement(t,{onMouseEnter:x,onMouseLeave:v,onFocus:C,onBlur:P})}),Eve={horizontal:Xd,vertical:s2,grid:J0},ss=qe.forwardRef(({children:t,className:e,label:n,orientation:r="horizontal",tooltipSide:i,...s},o)=>{const a=Eve[r];return y.jsx(a,{asChild:!0,tooltipSide:i,children:y.jsx(Nbe,{ref:o,...s,className:Fe("tlui-toolbar",e),"aria-label":n,orientation:r==="grid"?"horizontal":r,children:t})})}),un=qe.forwardRef(({asChild:t,children:e,type:n,isActive:r,tooltip:i,...s},o)=>{const a=y.jsx(zbe,{ref:o,asChild:t,draggable:!1,"data-isactive":r,...s,"aria-label":s.title,title:void 0,className:Fe("tlui-button",`tlui-button__${n}`,s.className),children:e}),l=i||s.title;return y.jsx(Q0,{content:l,children:a})}),_ve=({children:t,className:e,type:n,asChild:r,...i})=>y.jsx(Bbe,{asChild:r,type:n,...i,role:"radiogroup",className:Fe("tlui-toolbar-toggle-group",e),children:t}),Pve=({children:t,className:e,type:n,value:r,tooltip:i,...s})=>{const o=y.jsx(Fbe,{...s,title:void 0,className:Fe("tlui-button",`tlui-button__${n}`,"tlui-toolbar-toggle-group-item",e),value:r,children:t}),a=i||s.title;return y.jsx(Q0,{content:a,children:o})};function xt({disabled:t=!1,spinner:e=!1,readonlyOk:n=!1,id:r,kbd:i,label:s,icon:o,iconLeft:a,onSelect:l,noClose:u,isSelected:f,onDragStart:h}){const{type:g,sourceId:m}=q0(),b=Ne(),[w,x]=E.useState(!1);if(go()&&!n)return null;const C=Nm(s,g),P=i?Nv(i):void 0,k=C?b(C):void 0,M=k&&P?`${k} ${P}`:k;switch(g){case"menu":return y.jsx(vve,{children:y.jsxs(gt,{type:"menu","data-testid":`${m}.${r}`,disabled:t,onClick:A=>{u&&nt(A),w?x(!1):l(m)},children:[a&&y.jsx(Ze,{icon:a,small:!0}),y.jsx(sr,{children:k}),i&&y.jsx(Zg,{children:i})]})});case"context-menu":return t?null:y.jsxs(Wye,{dir:"ltr",draggable:!1,className:"tlui-button tlui-button__menu","data-testid":`${m}.${r}`,onSelect:A=>{u&&nt(A),w?x(!1):l(m)},children:[y.jsx("span",{className:"tlui-button__label",draggable:!1,children:k}),a&&y.jsx(Ze,{icon:a,small:!0}),i&&y.jsx(Zg,{children:i}),e&&y.jsx(Mq,{})]});case"small-icons":case"icons":return y.jsx(un,{"data-testid":`${m}.${r}`,type:"icon",title:M,disabled:t,onClick:()=>l(m),children:y.jsx(Ze,{icon:o,small:!0})});case"keyboard-shortcuts":return i?y.jsxs("div",{className:"tlui-shortcuts-dialog__key-pair","data-testid":`${m}.${r}`,children:[y.jsx("div",{className:"tlui-shortcuts-dialog__key-pair__key",children:k}),y.jsx("div",{className:"tlui-shortcuts-dialog__key-pair__value",children:y.jsx(Zg,{visibleOnMobileLayout:!0,children:i})})]}):(console.warn(`Menu item '${s}' isn't shown in the keyboard shortcuts dialog because it doesn't have a keyboard shortcut.`),null);case"helper-buttons":return y.jsxs(gt,{type:"low",onClick:()=>l(m),children:[y.jsx(Ze,{icon:o}),y.jsx(sr,{children:k})]});case"toolbar":return h?y.jsx(pz,{id:r,icon:o,onSelect:l,onDragStart:h,labelStr:k,titleStr:M,disabled:t,isSelected:f}):y.jsx(un,{"aria-label":k,"aria-pressed":f?"true":"false","data-testid":`tools.${r}`,"data-value":r,disabled:t,onClick:()=>l("toolbar"),onTouchStart:A=>{nt(A),l("toolbar")},title:M,type:"tool",children:y.jsx(Ze,{icon:o})});case"toolbar-overflow":return h?y.jsx(pz,{id:r,icon:o,onSelect:l,onDragStart:h,labelStr:k,titleStr:M,disabled:t,isSelected:f,overflow:!0}):y.jsx(un,{"aria-label":k,"aria-pressed":f?"true":"false",isActive:f,"data-testid":`tools.more.${r}`,"data-value":r,disabled:t,onClick:()=>l("toolbar"),title:M,type:"icon",children:y.jsx(Ze,{icon:o})});default:throw kt(g)}}function Ive(t,e){const n=te();return E.useMemo(()=>{let i={name:"idle"};function s(u){i={name:"pointing",screenSpaceStart:{x:u.clientX,y:u.clientY}},u.currentTarget.setPointerCapture(u.pointerId)}function o(u){if(!u.isSpecialRedispatchedEvent&&i.name==="pointing"&&I.Dist2(i.screenSpaceStart,{x:u.clientX,y:u.clientY})>(n.getInstanceState().isCoarsePointer?n.options.uiCoarseDragDistanceSquared:n.options.uiDragDistanceSquared)){const h=i.screenSpaceStart;i={name:"dragging",screenSpaceStart:h},n.run(()=>{n.setCurrentTool("select"),n.dispatch({type:"pointer",target:"canvas",name:"pointer_down",...li(n,u),point:h}),n.selectNone(),t?.("toolbar",{type:"pointer",target:"canvas",name:"pointer_move",...li(n,u),point:h}),Lo.hideAllTooltips(),n.getContainer().focus()})}}function a(u){u.isSpecialRedispatchedEvent||(u.currentTarget.releasePointerCapture(u.pointerId),n.dispatch({type:"pointer",target:"canvas",name:"pointer_up",...li(n,u)}))}function l(){if(i.name==="dragging"||i.name==="dragged")return i={name:"idle"},!0;i={name:"idle"},e?.("toolbar")}return{onPointerDown:s,onPointerMove:o,onPointerUp:a,onClick:l}},[t,n,e])}function pz({id:t,labelStr:e,titleStr:n,disabled:r,isSelected:i,icon:s,onSelect:o,onDragStart:a,overflow:l}){const u=Ive(a,o);return l?y.jsx(un,{"aria-label":e,"aria-pressed":i?"true":"false",isActive:i,className:"tlui-button-grid__button","data-testid":`tools.more.${t}`,"data-value":t,disabled:r,title:n,type:"icon",...u,children:y.jsx(Ze,{icon:s})}):y.jsx(un,{"aria-label":e,"aria-pressed":i?"true":"false","data-testid":`tools.${t}`,"data-value":t,disabled:r,onTouchStart:f=>{nt(f),o("toolbar")},title:n,type:"tool",...u,children:y.jsx(Ze,{icon:s})})}function ge({actionId:t="",...e}){const r=sl()[t];return r?y.jsx(xt,{...r,...e}):null}function ct({id:t,label:e,className:n,children:r}){const i=q0(),{orientation:s}=Cy(),o=Ne(),a=Nm(e,i.type),l=a?o(a):void 0;switch(i.type){case"menu":return y.jsx(bve,{className:n,"data-testid":`${i.sourceId}-group.${t}`,children:r});case"context-menu":return y.jsx("div",{dir:"ltr",className:Fe("tlui-menu__group",n),"data-testid":`${i.sourceId}-group.${t}`,children:r});case"keyboard-shortcuts":return y.jsxs("div",{className:"tlui-shortcuts-dialog__group","data-testid":`${i.sourceId}-group.${t}`,children:[y.jsx("h2",{className:"tlui-shortcuts-dialog__group__title",children:l}),y.jsx("div",{className:"tlui-shortcuts-dialog__group__content",children:r})]});case"toolbar":{const u=s==="horizontal"?Xd:s2;return y.jsx(u,{className:"tlui-main-toolbar__group","data-testid":`${i.sourceId}-group.${t}`,children:r})}case"toolbar-overflow":return y.jsx(J0,{className:"tlui-main-toolbar__group","data-testid":`${i.sourceId}-group.${t}`,children:r});default:return r}}const ZP=E.createContext(null);function kve({context:t,children:e}){const n=E.useContext(ZP),r=Mn(),i=Xm("dialogs",[]),s=E.useMemo(()=>({dialogs:i,addDialog(o){const a=o.id??Nt();return i.update(l=>[...l.filter(u=>u.id!==o.id),{...o,id:a}]),r("open-menu",{source:"dialog",id:a}),Gi.addOpenMenu(a,t),a},removeDialog(o){const a=i.get().find(l=>l.id===o);return a&&(a.onClose?.(),r("close-menu",{source:"dialog",id:o}),Gi.deleteOpenMenu(o,t),i.update(l=>l.filter(u=>u!==a))),o},clearDialogs(){const o=i.get();o.length!==0&&(o.forEach(a=>{a.onClose?.(),r("close-menu",{source:"dialog",id:a.id}),Gi.deleteOpenMenu(a.id,t)}),i.set([]))}}),[r,i,t]);return n?y.jsx(y.Fragment,{children:e}):y.jsx(ZP.Provider,{value:s,children:e})}function Ty(){const t=E.useContext(ZP);if(!t)throw new Error("useDialogs must be used within a DialogsProvider");return t}const JP=E.createContext(null);function Mve({children:t}){const e=Xm("toasts",[]),n=E.useContext(JP),r=E.useMemo(()=>({toasts:e,addToast(i){const s=i.id??Nt();return e.update(o=>[...o.filter(a=>a.id!==i.id),{...i,id:s}]),s},removeToast(i){return e.update(s=>s.filter(o=>o.id!==i)),i},clearToasts(){e.set([])}}),[e]);return n?y.jsx(y.Fragment,{children:t}):y.jsx(bbe,{children:y.jsx(JP.Provider,{value:r,children:t})})}function rc(){const t=E.useContext(JP);if(!t)throw new Error("useToasts must be used within a ToastsProvider");return t}function gz(t){return new Promise(e=>{const{allowMultiple:n=!0,mimeTypes:r=[]}=t||{},i=document.createElement("input");i.type="file",i.accept=r?.join(","),i.multiple=n,i.style.display="none";function s(){i.removeEventListener("change",o),i.removeEventListener("cancel",a),i.remove()}async function o(l){const u=l.target.files;if(!u||u.length===0){e([]),s();return}const f=Array.from(u);i.value="",e(f),s()}function a(){e([]),s()}document.body.appendChild(i),i.addEventListener("cancel",a),i.addEventListener("change",o),i?.click()})}var g_={exports:{}},mz;function Ave(){return mz||(mz=1,(function(t){var e=(function(){var n=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",s={};function o(l,u){if(!s[l]){s[l]={};for(var f=0;f<l.length;f++)s[l][l.charAt(f)]=f}return s[l][u]}var a={compressToBase64:function(l){if(l==null)return"";var u=a._compress(l,6,function(f){return r.charAt(f)});switch(u.length%4){default:case 0:return u;case 1:return u+"===";case 2:return u+"==";case 3:return u+"="}},decompressFromBase64:function(l){return l==null?"":l==""?null:a._decompress(l.length,32,function(u){return o(r,l.charAt(u))})},compressToUTF16:function(l){return l==null?"":a._compress(l,15,function(u){return n(u+32)})+" "},decompressFromUTF16:function(l){return l==null?"":l==""?null:a._decompress(l.length,16384,function(u){return l.charCodeAt(u)-32})},compressToUint8Array:function(l){for(var u=a.compress(l),f=new Uint8Array(u.length*2),h=0,g=u.length;h<g;h++){var m=u.charCodeAt(h);f[h*2]=m>>>8,f[h*2+1]=m%256}return f},decompressFromUint8Array:function(l){if(l==null)return a.decompress(l);for(var u=new Array(l.length/2),f=0,h=u.length;f<h;f++)u[f]=l[f*2]*256+l[f*2+1];var g=[];return u.forEach(function(m){g.push(n(m))}),a.decompress(g.join(""))},compressToEncodedURIComponent:function(l){return l==null?"":a._compress(l,6,function(u){return i.charAt(u)})},decompressFromEncodedURIComponent:function(l){return l==null?"":l==""?null:(l=l.replace(/ /g,"+"),a._decompress(l.length,32,function(u){return o(i,l.charAt(u))}))},compress:function(l){return a._compress(l,16,function(u){return n(u)})},_compress:function(l,u,f){if(l==null)return"";var h,g,m={},b={},w="",x="",v="",C=2,P=3,k=2,M=[],A=0,O=0,R;for(R=0;R<l.length;R+=1)if(w=l.charAt(R),Object.prototype.hasOwnProperty.call(m,w)||(m[w]=P++,b[w]=!0),x=v+w,Object.prototype.hasOwnProperty.call(m,x))v=x;else{if(Object.prototype.hasOwnProperty.call(b,v)){if(v.charCodeAt(0)<256){for(h=0;h<k;h++)A=A<<1,O==u-1?(O=0,M.push(f(A)),A=0):O++;for(g=v.charCodeAt(0),h=0;h<8;h++)A=A<<1|g&1,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=g>>1}else{for(g=1,h=0;h<k;h++)A=A<<1|g,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=0;for(g=v.charCodeAt(0),h=0;h<16;h++)A=A<<1|g&1,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=g>>1}C--,C==0&&(C=Math.pow(2,k),k++),delete b[v]}else for(g=m[v],h=0;h<k;h++)A=A<<1|g&1,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=g>>1;C--,C==0&&(C=Math.pow(2,k),k++),m[x]=P++,v=String(w)}if(v!==""){if(Object.prototype.hasOwnProperty.call(b,v)){if(v.charCodeAt(0)<256){for(h=0;h<k;h++)A=A<<1,O==u-1?(O=0,M.push(f(A)),A=0):O++;for(g=v.charCodeAt(0),h=0;h<8;h++)A=A<<1|g&1,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=g>>1}else{for(g=1,h=0;h<k;h++)A=A<<1|g,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=0;for(g=v.charCodeAt(0),h=0;h<16;h++)A=A<<1|g&1,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=g>>1}C--,C==0&&(C=Math.pow(2,k),k++),delete b[v]}else for(g=m[v],h=0;h<k;h++)A=A<<1|g&1,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=g>>1;C--,C==0&&(C=Math.pow(2,k),k++)}for(g=2,h=0;h<k;h++)A=A<<1|g&1,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=g>>1;for(;;)if(A=A<<1,O==u-1){M.push(f(A));break}else O++;return M.join("")},decompress:function(l){return l==null?"":l==""?null:a._decompress(l.length,32768,function(u){return l.charCodeAt(u)})},_decompress:function(l,u,f){var h=[],g=4,m=4,b=3,w="",x=[],v,C,P,k,M,A,O,R={val:f(0),position:u,index:1};for(v=0;v<3;v+=1)h[v]=v;for(P=0,M=Math.pow(2,2),A=1;A!=M;)k=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=f(R.index++)),P|=(k>0?1:0)*A,A<<=1;switch(P){case 0:for(P=0,M=Math.pow(2,8),A=1;A!=M;)k=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=f(R.index++)),P|=(k>0?1:0)*A,A<<=1;O=n(P);break;case 1:for(P=0,M=Math.pow(2,16),A=1;A!=M;)k=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=f(R.index++)),P|=(k>0?1:0)*A,A<<=1;O=n(P);break;case 2:return""}for(h[3]=O,C=O,x.push(O);;){if(R.index>l)return"";for(P=0,M=Math.pow(2,b),A=1;A!=M;)k=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=f(R.index++)),P|=(k>0?1:0)*A,A<<=1;switch(O=P){case 0:for(P=0,M=Math.pow(2,8),A=1;A!=M;)k=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=f(R.index++)),P|=(k>0?1:0)*A,A<<=1;h[m++]=n(P),O=m-1,g--;break;case 1:for(P=0,M=Math.pow(2,16),A=1;A!=M;)k=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=f(R.index++)),P|=(k>0?1:0)*A,A<<=1;h[m++]=n(P),O=m-1,g--;break;case 2:return x.join("")}if(g==0&&(g=Math.pow(2,b),b++),h[O])w=h[O];else if(O===m)w=C+C.charAt(0);else return null;x.push(w),h[m++]=C+w.charAt(0),g--,C=w,g==0&&(g=Math.pow(2,b),b++)}}};return a})();t!=null?t.exports=e:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return e})})(g_)),g_.exports}var Ove=Ave();const QP=Ja(Ove),o2="web image/vnd.tldraw+png",Dve={png:o2},Rve={[o2]:"image/png"};function jve(t){return ir(Dve,t)??null}function Lve(t){return ir(Rve,t)??t}function Nve(t){return typeof ClipboardItem<"u"&&"supports"in ClipboardItem&&ClipboardItem.supports(t)}function zve(t){const e=Object.entries(t);for(const[n,r]of e)r.catch(i=>console.error(i));return navigator.clipboard.write([new ClipboardItem(t)]).catch(n=>(console.error(n),Promise.all(e.map(async([r,i])=>[r,await i])).then(r=>{const i=HB(r);return navigator.clipboard.write([new ClipboardItem(i)])})))}async function Bve(t,e,n,r){const i=e.map(s=>s instanceof File?s:new File([s],"tldrawFile",{type:s.type}));t.markHistoryStoppingPoint("paste"),await t.putExternalContent({type:"files",files:i,point:n,sources:r})}async function eI(t,e,n,r){return t.markHistoryStoppingPoint("paste"),await t.putExternalContent({type:"url",point:n,url:e,sources:r})}const Fve=[o2,"image/png","image/jpeg","image/webp","image/svg+xml"];function m_(t){const e=document.implementation.createHTMLDocument("");return e.documentElement.innerHTML=t.trim(),e.body.textContent||e.body.innerText||""}const Uve=t=>{try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},Hve=t=>{const e=t.split(/[\n\s]/);for(const n of e)try{const r=new URL(n);if(!(r.protocol==="http:"||r.protocol==="https:"))return}catch{return}return NH(e)},$ve=t=>/^<svg/.test(t),Kve=["input","select","textarea"];function y_(t){const{activeElement:e}=document;return t.menus.hasAnyOpenMenus()||e&&(e.isContentEditable||Kve.indexOf(e.tagName.toLowerCase())>-1)}const ab=(t,e,n,r)=>{const i=Hve(e);if(i)for(const s of i)eI(t,s,n);else Uve(e)?eI(t,e,n):$ve(e)?(t.markHistoryStoppingPoint("paste"),t.putExternalContent({type:"svg-text",text:e,point:n,sources:r})):(t.markHistoryStoppingPoint("paste"),t.putExternalContent({type:"text",text:e,point:n,sources:r}))},Vve=async(t,e,n)=>{if(t.getEditingShapeId()!==null)return;if(!e)throw Error("No clipboard data");const r=[];for(const i of Object.values(e.items))switch(i.kind){case"file":{r.push({type:"file",source:new Promise(s=>s(i.getAsFile()))});break}case"string":{i.type==="text/html"?r.push({type:"html",source:new Promise(s=>i.getAsString(s))}):i.type==="text/plain"?r.push({type:"text",source:new Promise(s=>i.getAsString(s))}):r.push({type:i.type,source:new Promise(s=>i.getAsString(s))});break}}Lq(t,r,n)},jq=async({editor:t,clipboardItems:e,point:n,fallbackFiles:r})=>{const i=[];for(const s of e){for(const o of Fve)if(s.types.includes(o)){const a=s.getType(o).then(l=>Pi.rewriteMimeType(l,Lve(o)));i.push({type:"blob",source:a});break}s.types.includes("text/html")&&i.push({type:"html",source:(async()=>{const o=await s.getType("text/html");return await Pi.blobToText(o)})()}),s.types.includes("text/uri-list")&&i.push({type:"url",source:(async()=>{const o=await s.getType("text/uri-list");return await Pi.blobToText(o)})()}),s.types.includes("text/plain")&&i.push({type:"text",source:(async()=>{const o=await s.getType("text/plain");return await Pi.blobToText(o)})()})}return r?.length&&i.length===1&&i[0].type==="text"?(i.pop(),i.push(...r.map(s=>({type:"file",source:Promise.resolve(s)})))):r?.length&&i.length===0&&i.push(...r.map(s=>({type:"file",source:Promise.resolve(s)}))),await Lq(t,i,n)};async function Lq(t,e,n){const r=e.filter(s=>(s.type==="file"||s.type==="blob")&&s.source!==null);if(r.length){if(r.length>t.options.maxFilesAtOnce)throw Error("Too many files");const s=tt(await Promise.all(r.map(o=>o.source)));return await Bve(t,s,n)}const i=await Promise.all(e.filter(s=>s.type!=="file").map(s=>new Promise(o=>{const a=s;if(a.type==="file"){o({type:"error",data:null,reason:"unexpected file"});return}a.source.then(l=>{const u=l.match(/<div data-tldraw[^>]*>(.*)<\/div>/)?.[1];if(u)try{let f;try{f=JSON.parse(u)}catch{const h=QP.decompressFromBase64(u);if(h===null){o({type:"error",data:null,reason:"found tldraw data comment but could not parse"});return}f=JSON.parse(h)}if(f.type!=="application/tldraw"){o({type:"error",data:f,reason:`found tldraw data comment but JSON was of a different type: ${f.type}`});return}if(f.version===3)try{const h=JSON.parse(QP.decompressFromBase64(f.data.otherCompressed)||"{}"),g={assets:f.data.assets||[],...h};o({type:"tldraw",data:g});return}catch(h){o({type:"error",data:f,reason:`failed to decompress version 2 clipboard data: ${h}`});return}if(f.version===2)o({type:"tldraw",data:f.data});else{if(typeof f.data=="string"){o({type:"error",data:f,reason:"found tldraw json but data was a string instead of a TLClipboardModel object"});return}o({type:"tldraw",data:f.data});return}}catch{o({type:"error",data:u,reason:"found tldraw json but data was a string instead of a TLClipboardModel object"});return}else{if(a.type==="html"){o({type:"text",data:l,subtype:"html"});return}if(a.type==="url"){o({type:"text",data:l,subtype:"url"});return}try{const f=JSON.parse(l);if(f.type==="excalidraw/clipboard"){o({type:"excalidraw",data:f});return}else{o({type:"text",data:l,subtype:"json"});return}}catch{o({type:"text",data:l,subtype:"text"});return}}o({type:"error",data:l,reason:"unhandled case"})})})));for(const s of i)if(s.type==="tldraw"){t.markHistoryStoppingPoint("paste"),t.putExternalContent({type:"tldraw",content:s.data,point:n});return}for(const s of i)if(s.type==="excalidraw"){t.markHistoryStoppingPoint("paste"),t.putExternalContent({type:"excalidraw",content:s.data,point:n});return}for(const s of i){if(s.type==="text"&&s.subtype==="html"){const a=new DOMParser().parseFromString(s.data,"text/html").querySelector("body");if(a&&Array.from(a.children).filter(u=>u.nodeType===1).length===1&&a.firstElementChild&&a.firstElementChild.tagName==="A"&&a.firstElementChild.hasAttribute("href")&&a.firstElementChild.getAttribute("href")!==""){const u=a.firstElementChild.getAttribute("href");ab(t,u,n,i);return}if(!i.some(u=>u.type==="text"&&u.subtype!=="html")&&s.data.trim()&&(m_(s.data)??"")){ab(t,m_(s.data),n,i);return}if(i.some(u=>u.type==="text"&&u.subtype!=="html")){const u=m_(s.data)??"";if(u){t.markHistoryStoppingPoint("paste"),t.putExternalContent({type:"text",text:u,html:s.data,point:n,sources:i});return}}}if(s.type==="text"&&s.subtype==="text"&&s.data.startsWith("<iframe ")){const a=new DOMParser().parseFromString(s.data,"text/html").querySelector("body");if(a&&Array.from(a.children).filter(u=>u.nodeType===1).length===1&&a.firstElementChild&&a.firstElementChild.tagName==="IFRAME"&&a.firstElementChild.hasAttribute("src")&&a.firstElementChild.getAttribute("src")!==""){const u=a.firstElementChild.getAttribute("src");ab(t,u,n,i);return}}}for(const s of i)if(s.type==="text"&&s.subtype==="url"){eI(t,s.data,n,i);return}for(const s of i)if(s.type==="text"&&s.subtype==="text"&&s.data.trim()){ab(t,s.data,n,i);return}}const zv=async t=>{const e=t.getContainer().ownerDocument?.defaultView?.navigator??globalThis.navigator,n=await t.resolveAssetsInContent(t.getContentFromCurrentPage(t.getSelectedShapeIds()));if(!n){e&&e.clipboard&&e.clipboard.writeText("");return}const{assets:r,...i}=n,s={type:"application/tldraw",kind:"content",version:3,data:{assets:r||[],otherCompressed:QP.compressToBase64(JSON.stringify(i))}},o=JSON.stringify(s);if(!(typeof e>"u")){const a=n.shapes.map(l=>t.getShapeUtil(l).getText(l)).filter(mJ);if(e.clipboard?.write){const l=new Blob([`<div data-tldraw>${o}</div>`],{type:"text/html"});let u=a.join(" ");u===""&&(u=" "),e.clipboard.write([new ClipboardItem({"text/html":l,"text/plain":new Blob([u],{type:"text/plain"})})])}else e.clipboard.writeText&&e.clipboard.writeText(`<div data-tldraw>${o}</div>`)}};function qve(){const t=Gn(),e=Mn(),n=E.useCallback(async function(o){Be(t,"editor is required for copy"),t.getSelectedShapeIds().length!==0&&(await zv(t),e("copy",{source:o}))},[t,e]),r=E.useCallback(async function(o){t&&t.getSelectedShapeIds().length!==0&&(await zv(t),t.deleteShapes(t.getSelectedShapeIds()),e("cut",{source:o}))},[t,e]),i=E.useCallback(async function(o,a,l){t&&t.getEditingShapeId()===null&&(Array.isArray(o)&&o[0]instanceof ClipboardItem?(jq({editor:t,clipboardItems:o,point:l}),e("paste",{source:"menu"})):navigator.clipboard.read().then(u=>{i(u,a,l)}))},[t,e]);return{copy:n,cut:r,paste:i}}function Gve(){const t=te(),e=t.getContainer().ownerDocument,n=Mn(),r=ee("editor.isFocused",()=>t.getInstanceState().isFocused,[t]);E.useEffect(()=>{if(!r)return;const i=async u=>{t.getSelectedShapeIds().length===0||t.getEditingShapeId()!==null||y_(t)||(nt(u),await zv(t),n("copy",{source:"kbd"}))};async function s(u){t.getSelectedShapeIds().length===0||t.getEditingShapeId()!==null||y_(t)||(nt(u),await zv(t),t.deleteShapes(t.getSelectedShapeIds()),n("cut",{source:"kbd"}))}let o=!1;const a=u=>{u.button===1&&(o=!0,t.timers.requestAnimationFrame(()=>{o=!1}))},l=u=>{if(o){t.markEventAsHandled(u);return}if(t.getEditingShapeId()!==null||y_(t))return;let f,h=!1;t.inputs.shiftKey&&(h=!0),t.user.getIsPasteAtCursorMode()&&(h=!h),h&&(f=t.inputs.currentPagePoint);const g=()=>{u.clipboardData&&Vve(t,u.clipboardData,f)};if(navigator.clipboard?.read){const m=Array.from(u.clipboardData?.files||[]);navigator.clipboard.read().then(b=>{Array.isArray(b)&&b[0]instanceof ClipboardItem&&jq({editor:t,clipboardItems:b,point:f,fallbackFiles:m})},()=>{g()})}else g();nt(u),n("paste",{source:"kbd"})};return e?.addEventListener("copy",i),e?.addEventListener("cut",s),e?.addEventListener("paste",l),e?.addEventListener("pointerup",a),()=>{e?.removeEventListener("copy",i),e?.removeEventListener("cut",s),e?.removeEventListener("paste",l),e?.removeEventListener("pointerup",a)}},[t,n,r,e])}const yz={jpeg:"image/jpeg",png:"image/png",webp:"image/webp",svg:"text/plain"};function Yve(t,e,n={}){const r=e?.length?e:[...t.getCurrentPageShapeIds()],i=n.format??"png";return{blobPromise:t.toImage(r,n).then(s=>Pi.rewriteMimeType(s.blob,yz[i])),mimeType:yz[i]}}function Wve(t,e,n){if(!navigator.clipboard)return Promise.reject(new Error("Copy not supported"));if(navigator.clipboard.write){const{blobPromise:r,mimeType:i}=Yve(t,e,n),s={[i]:r},o=jve(n.format);return o&&Nve(o)&&(s[o]=r.then(a=>Pi.rewriteMimeType(a,o))),zve(s)}switch(n.format){case"svg":return Xve(async()=>{const r=await t.getSvgString(e,n);if(!r)throw new Error("Failed to copy");return r.svg});case"png":throw new Error("Copy not supported");default:kt(n.format)}}async function Xve(t){await navigator.clipboard?.writeText?.(await t())}function Zve(){const t=Gn(),{addToast:e}=rc(),n=Ne();return E.useCallback((r,i="svg")=>{Be(t,"useCopyAs: editor is required"),Wve(t,r,{format:i}).catch(()=>{e({id:"copy-fail",severity:"warning",title:n("toast.error.copy-fail.title"),description:n("toast.error.copy-fail.desc")})})},[t,e,n])}async function Jve(t,e,n){let r=n.name;if(!r&&(r=`shapes at ${Sz()}`,e.length===1)){const o=t.getShape(e[0]);t.isShapeOfType(o,"frame")?r=o.props.name||"frame":r=`${Lx(o.id)} at ${Sz()}`}r+=`.${n.format}`;const{blob:i}=await t.toImage(e,n),s=new File([i],r,{type:i.type});Qve(s)}function Sz(){const t=new Date,e=String(t.getFullYear()).slice(2),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return`${e}-${n}-${r} ${i}.${s}.${o}`}function Qve(t){const e=document.createElement("a"),n=URL.createObjectURL(t);e.href=n,e.download=t.name,e.click(),URL.revokeObjectURL(n)}function exe(){const t=Gn(),{addToast:e}=rc(),n=Ne();return E.useCallback((r,i={})=>{Be(t,"useExportAs: editor is required");const{format:s="png",name:o,scale:a=1}=i;Jve(t,r,{format:s,name:o,scale:a}).catch(l=>{console.error(l.message),e({id:"export-fail",title:n("toast.error.export-fail.title"),description:n("toast.error.export-fail.desc"),severity:"error"})})},[t,e,n])}function txe(){const t=Gn(),e=E.useRef(null),n=E.useRef(null);return E.useCallback(async function(){Be(t,"usePrint: editor is required");const i=document.createElement("div"),s=document.createElement("style"),o=(v,C)=>{v&&(v.innerHTML=""),C&&document.head.contains(C)&&document.head.removeChild(C),v&&document.body.contains(v)&&document.body.removeChild(v)};o(e.current,n.current),e.current=i,n.current=s;const a=`tl-print-surface-${Nt()}`;i.className=a,s.innerHTML=`
292
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return E.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},gge="DialogDescriptionWarning",mge=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${P7(gge).contentName}}.`;return E.useEffect(()=>{const i=t.current?.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},yge=g7,Sge=S7,bge=b7,vge=v7,xge=w7;function wge(t){const e=E.useRef({value:t,previous:t});return E.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function I7(t){const[e,n]=E.useState(void 0);return Wl(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}const Cge=["top","right","bottom","left"],Su=Math.min,Qs=Math.max,Mv=Math.round,ib=Math.floor,qa=t=>({x:t,y:t}),Tge={left:"right",right:"left",bottom:"top",top:"bottom"},Ege={start:"end",end:"start"};function zP(t,e,n){return Qs(t,Su(e,n))}function Xl(t,e){return typeof t=="function"?t(e):t}function Zl(t){return t.split("-")[0]}function sp(t){return t.split("-")[1]}function SM(t){return t==="x"?"y":"x"}function bM(t){return t==="y"?"height":"width"}const _ge=new Set(["top","bottom"]);function $a(t){return _ge.has(Zl(t))?"y":"x"}function vM(t){return SM($a(t))}function Pge(t,e,n){n===void 0&&(n=!1);const r=sp(t),i=vM(t),s=bM(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Av(o)),[o,Av(o)]}function Ige(t){const e=Av(t);return[BP(t),e,BP(e)]}function BP(t){return t.replace(/start|end/g,e=>Ege[e])}const Y5=["left","right"],W5=["right","left"],kge=["top","bottom"],Mge=["bottom","top"];function Age(t,e,n){switch(t){case"top":case"bottom":return n?e?W5:Y5:e?Y5:W5;case"left":case"right":return e?kge:Mge;default:return[]}}function Oge(t,e,n,r){const i=sp(t);let s=Age(Zl(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(BP)))),s}function Av(t){return t.replace(/left|right|bottom|top/g,e=>Tge[e])}function Dge(t){return{top:0,right:0,bottom:0,left:0,...t}}function k7(t){return typeof t!="number"?Dge(t):{top:t,right:t,bottom:t,left:t}}function Ov(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function X5(t,e,n){let{reference:r,floating:i}=t;const s=$a(e),o=vM(e),a=bM(o),l=Zl(e),u=s==="y",f=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,g=r[a]/2-i[a]/2;let m;switch(l){case"top":m={x:f,y:r.y-i.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-i.width,y:h};break;default:m={x:r.x,y:r.y}}switch(sp(e)){case"start":m[o]-=g*(n&&u?-1:1);break;case"end":m[o]+=g*(n&&u?-1:1);break}return m}const Rge=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:h}=X5(u,r,l),g=r,m={},b=0;for(let w=0;w<a.length;w++){const{name:x,fn:v}=a[w],{x:C,y:P,data:k,reset:M}=await v({x:f,y:h,initialPlacement:r,placement:g,strategy:i,middlewareData:m,rects:u,platform:o,elements:{reference:t,floating:e}});f=C??f,h=P??h,m={...m,[x]:{...m[x],...k}},M&&b<=50&&(b++,typeof M=="object"&&(M.placement&&(g=M.placement),M.rects&&(u=M.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):M.rects),{x:f,y:h}=X5(u,g,l)),w=-1)}return{x:f,y:h,placement:g,strategy:i,middlewareData:m}};async function Pm(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:g=!1,padding:m=0}=Xl(e,t),b=k7(m),x=a[g?h==="floating"?"reference":"floating":h],v=Ov(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(x)))==null||n?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),C=h==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),k=await(s.isElement==null?void 0:s.isElement(P))?await(s.getScale==null?void 0:s.getScale(P))||{x:1,y:1}:{x:1,y:1},M=Ov(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:C,offsetParent:P,strategy:l}):C);return{top:(v.top-M.top+b.top)/k.y,bottom:(M.bottom-v.bottom+b.bottom)/k.y,left:(v.left-M.left+b.left)/k.x,right:(M.right-v.right+b.right)/k.x}}const jge=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:f=0}=Xl(t,e)||{};if(u==null)return{};const h=k7(f),g={x:n,y:r},m=vM(i),b=bM(m),w=await o.getDimensions(u),x=m==="y",v=x?"top":"left",C=x?"bottom":"right",P=x?"clientHeight":"clientWidth",k=s.reference[b]+s.reference[m]-g[m]-s.floating[b],M=g[m]-s.reference[m],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let O=A?A[P]:0;(!O||!await(o.isElement==null?void 0:o.isElement(A)))&&(O=a.floating[P]||s.floating[b]);const R=k/2-M/2,F=O/2-w[b]/2-1,N=Su(h[v],F),j=Su(h[C],F),H=N,V=O-w[b]-j,z=O/2-w[b]/2+R,K=zP(H,z,V),B=!l.arrow&&sp(i)!=null&&z!==K&&s.reference[b]/2-(z<H?N:j)-w[b]/2<0,G=B?z<H?z-H:z-V:0;return{[m]:g[m]+G,data:{[m]:K,centerOffset:z-K-G,...B&&{alignmentOffset:G}},reset:B}}}),Lge=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...x}=Xl(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=Zl(i),C=$a(a),P=Zl(a)===a,k=await(l.isRTL==null?void 0:l.isRTL(u.floating)),M=g||(P||!w?[Av(a)]:Ige(a)),A=b!=="none";!g&&A&&M.push(...Oge(a,w,b,k));const O=[a,...M],R=await Pm(e,x),F=[];let N=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&F.push(R[v]),h){const z=Pge(i,o,k);F.push(R[z[0]],R[z[1]])}if(N=[...N,{placement:i,overflows:F}],!F.every(z=>z<=0)){var j,H;const z=(((j=s.flip)==null?void 0:j.index)||0)+1,K=O[z];if(K&&(!(h==="alignment"?C!==$a(K):!1)||N.every(W=>$a(W.placement)===C?W.overflows[0]>0:!0)))return{data:{index:z,overflows:N},reset:{placement:K}};let B=(H=N.filter(G=>G.overflows[0]<=0).sort((G,W)=>G.overflows[1]-W.overflows[1])[0])==null?void 0:H.placement;if(!B)switch(m){case"bestFit":{var V;const G=(V=N.filter(W=>{if(A){const Z=$a(W.placement);return Z===C||Z==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(Z=>Z>0).reduce((Z,de)=>Z+de,0)]).sort((W,Z)=>W[1]-Z[1])[0])==null?void 0:V[0];G&&(B=G);break}case"initialPlacement":B=a;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function Z5(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function J5(t){return Cge.some(e=>t[e]>=0)}const Nge=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Xl(t,e);switch(r){case"referenceHidden":{const s=await Pm(e,{...i,elementContext:"reference"}),o=Z5(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:J5(o)}}}case"escaped":{const s=await Pm(e,{...i,altBoundary:!0}),o=Z5(s,n.floating);return{data:{escapedOffsets:o,escaped:J5(o)}}}default:return{}}}}},M7=new Set(["left","top"]);async function zge(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Zl(n),a=sp(n),l=$a(n)==="y",u=M7.has(o)?-1:1,f=s&&l?-1:1,h=Xl(e,t);let{mainAxis:g,crossAxis:m,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof b=="number"&&(m=a==="end"?b*-1:b),l?{x:m*f,y:g*u}:{x:g*u,y:m*f}}const Bge=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await zge(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},Fge=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:x=>{let{x:v,y:C}=x;return{x:v,y:C}}},...l}=Xl(t,e),u={x:n,y:r},f=await Pm(e,l),h=$a(Zl(i)),g=SM(h);let m=u[g],b=u[h];if(s){const x=g==="y"?"top":"left",v=g==="y"?"bottom":"right",C=m+f[x],P=m-f[v];m=zP(C,m,P)}if(o){const x=h==="y"?"top":"left",v=h==="y"?"bottom":"right",C=b+f[x],P=b-f[v];b=zP(C,b,P)}const w=a.fn({...e,[g]:m,[h]:b});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[g]:s,[h]:o}}}}}},Uge=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Xl(t,e),f={x:n,y:r},h=$a(i),g=SM(h);let m=f[g],b=f[h];const w=Xl(a,e),x=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(l){const P=g==="y"?"height":"width",k=s.reference[g]-s.floating[P]+x.mainAxis,M=s.reference[g]+s.reference[P]-x.mainAxis;m<k?m=k:m>M&&(m=M)}if(u){var v,C;const P=g==="y"?"width":"height",k=M7.has(Zl(i)),M=s.reference[h]-s.floating[P]+(k&&((v=o.offset)==null?void 0:v[h])||0)+(k?0:x.crossAxis),A=s.reference[h]+s.reference[P]+(k?0:((C=o.offset)==null?void 0:C[h])||0)-(k?x.crossAxis:0);b<M?b=M:b>A&&(b=A)}return{[g]:m,[h]:b}}}},Hge=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:a}=e,{apply:l=()=>{},...u}=Xl(t,e),f=await Pm(e,u),h=Zl(i),g=sp(i),m=$a(i)==="y",{width:b,height:w}=s.floating;let x,v;h==="top"||h==="bottom"?(x=h,v=g===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(v=h,x=g==="end"?"top":"bottom");const C=w-f.top-f.bottom,P=b-f.left-f.right,k=Su(w-f[x],C),M=Su(b-f[v],P),A=!e.middlewareData.shift;let O=k,R=M;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(R=P),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(O=C),A&&!g){const N=Qs(f.left,0),j=Qs(f.right,0),H=Qs(f.top,0),V=Qs(f.bottom,0);m?R=b-2*(N!==0||j!==0?N+j:Qs(f.left,f.right)):O=w-2*(H!==0||V!==0?H+V:Qs(f.top,f.bottom))}await l({...e,availableWidth:R,availableHeight:O});const F=await o.getDimensions(a.floating);return b!==F.width||w!==F.height?{reset:{rects:!0}}:{}}}};function _0(){return typeof window<"u"}function op(t){return A7(t)?(t.nodeName||"").toLowerCase():"#document"}function ao(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function nl(t){var e;return(e=(A7(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function A7(t){return _0()?t instanceof Node||t instanceof ao(t).Node:!1}function Sa(t){return _0()?t instanceof Element||t instanceof ao(t).Element:!1}function Xa(t){return _0()?t instanceof HTMLElement||t instanceof ao(t).HTMLElement:!1}function Q5(t){return!_0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ao(t).ShadowRoot}const $ge=new Set(["inline","contents"]);function my(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=ba(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!$ge.has(i)}const Kge=new Set(["table","td","th"]);function Vge(t){return Kge.has(op(t))}const qge=[":popover-open",":modal"];function P0(t){return qge.some(e=>{try{return t.matches(e)}catch{return!1}})}const Gge=["transform","translate","scale","rotate","perspective"],Yge=["transform","translate","scale","rotate","perspective","filter"],Wge=["paint","layout","strict","content"];function xM(t){const e=wM(),n=Sa(t)?ba(t):t;return Gge.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Yge.some(r=>(n.willChange||"").includes(r))||Wge.some(r=>(n.contain||"").includes(r))}function Xge(t){let e=bu(t);for(;Xa(e)&&!Ff(e);){if(xM(e))return e;if(P0(e))return null;e=bu(e)}return null}function wM(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Zge=new Set(["html","body","#document"]);function Ff(t){return Zge.has(op(t))}function ba(t){return ao(t).getComputedStyle(t)}function I0(t){return Sa(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function bu(t){if(op(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Q5(t)&&t.host||nl(t);return Q5(e)?e.host:e}function O7(t){const e=bu(t);return Ff(e)?t.ownerDocument?t.ownerDocument.body:t.body:Xa(e)&&my(e)?e:O7(e)}function Im(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=O7(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=ao(i);if(s){const a=FP(o);return e.concat(o,o.visualViewport||[],my(i)?i:[],a&&n?Im(a):[])}return e.concat(i,Im(i,[],n))}function FP(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function D7(t){const e=ba(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Xa(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=Mv(n)!==s||Mv(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function CM(t){return Sa(t)?t:t.contextElement}function _f(t){const e=CM(t);if(!Xa(e))return qa(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=D7(e);let o=(s?Mv(n.width):n.width)/r,a=(s?Mv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Jge=qa(0);function R7(t){const e=ao(t);return!wM()||!e.visualViewport?Jge:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Qge(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ao(t)?!1:e}function jd(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=CM(t);let o=qa(1);e&&(r?Sa(r)&&(o=_f(r)):o=_f(t));const a=Qge(s,n,r)?R7(s):qa(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,f=i.width/o.x,h=i.height/o.y;if(s){const g=ao(s),m=r&&Sa(r)?ao(r):r;let b=g,w=FP(b);for(;w&&r&&m!==b;){const x=_f(w),v=w.getBoundingClientRect(),C=ba(w),P=v.left+(w.clientLeft+parseFloat(C.paddingLeft))*x.x,k=v.top+(w.clientTop+parseFloat(C.paddingTop))*x.y;l*=x.x,u*=x.y,f*=x.x,h*=x.y,l+=P,u+=k,b=ao(w),w=FP(b)}}return Ov({width:f,height:h,x:l,y:u})}function k0(t,e){const n=I0(t).scrollLeft;return e?e.left+n:jd(nl(t)).left+n}function j7(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-k0(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function eme(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=nl(r),a=e?P0(e.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=qa(1);const f=qa(0),h=Xa(r);if((h||!h&&!s)&&((op(r)!=="body"||my(o))&&(l=I0(r)),Xa(r))){const m=jd(r);u=_f(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const g=o&&!h&&!s?j7(o,l):qa(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+g.x,y:n.y*u.y-l.scrollTop*u.y+f.y+g.y}}function tme(t){return Array.from(t.getClientRects())}function nme(t){const e=nl(t),n=I0(t),r=t.ownerDocument.body,i=Qs(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Qs(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+k0(t);const a=-n.scrollTop;return ba(r).direction==="rtl"&&(o+=Qs(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}const ez=25;function rme(t,e){const n=ao(t),r=nl(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const f=wM();(!f||f&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=k0(r);if(u<=0){const f=r.ownerDocument,h=f.body,g=getComputedStyle(h),m=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(r.clientWidth-h.clientWidth-m);b<=ez&&(s-=b)}else u<=ez&&(s+=u);return{width:s,height:o,x:a,y:l}}const ime=new Set(["absolute","fixed"]);function sme(t,e){const n=jd(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=Xa(t)?_f(t):qa(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function tz(t,e,n){let r;if(e==="viewport")r=rme(t,n);else if(e==="document")r=nme(nl(t));else if(Sa(e))r=sme(e,n);else{const i=R7(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Ov(r)}function L7(t,e){const n=bu(t);return n===e||!Sa(n)||Ff(n)?!1:ba(n).position==="fixed"||L7(n,e)}function ome(t,e){const n=e.get(t);if(n)return n;let r=Im(t,[],!1).filter(a=>Sa(a)&&op(a)!=="body"),i=null;const s=ba(t).position==="fixed";let o=s?bu(t):t;for(;Sa(o)&&!Ff(o);){const a=ba(o),l=xM(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&ime.has(i.position)||my(o)&&!l&&L7(t,o))?r=r.filter(f=>f!==o):i=a,o=bu(o)}return e.set(t,r),r}function ame(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?P0(e)?[]:ome(e,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,f)=>{const h=tz(e,f,i);return u.top=Qs(h.top,u.top),u.right=Su(h.right,u.right),u.bottom=Su(h.bottom,u.bottom),u.left=Qs(h.left,u.left),u},tz(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function lme(t){const{width:e,height:n}=D7(t);return{width:e,height:n}}function cme(t,e,n){const r=Xa(e),i=nl(e),s=n==="fixed",o=jd(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=qa(0);function u(){l.x=k0(i)}if(r||!r&&!s)if((op(e)!=="body"||my(i))&&(a=I0(e)),r){const m=jd(e,!0,s,e);l.x=m.x+e.clientLeft,l.y=m.y+e.clientTop}else i&&u();s&&!r&&i&&u();const f=i&&!r&&!s?j7(i,a):qa(0),h=o.left+a.scrollLeft-l.x-f.x,g=o.top+a.scrollTop-l.y-f.y;return{x:h,y:g,width:o.width,height:o.height}}function d_(t){return ba(t).position==="static"}function nz(t,e){if(!Xa(t)||ba(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return nl(t)===n&&(n=n.ownerDocument.body),n}function N7(t,e){const n=ao(t);if(P0(t))return n;if(!Xa(t)){let i=bu(t);for(;i&&!Ff(i);){if(Sa(i)&&!d_(i))return i;i=bu(i)}return n}let r=nz(t,e);for(;r&&Vge(r)&&d_(r);)r=nz(r,e);return r&&Ff(r)&&d_(r)&&!xM(r)?n:r||Xge(t)||n}const ume=async function(t){const e=this.getOffsetParent||N7,n=this.getDimensions,r=await n(t.floating);return{reference:cme(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dme(t){return ba(t).direction==="rtl"}const hme={convertOffsetParentRelativeRectToViewportRelativeRect:eme,getDocumentElement:nl,getClippingRect:ame,getOffsetParent:N7,getElementRects:ume,getClientRects:tme,getDimensions:lme,getScale:_f,isElement:Sa,isRTL:dme};function z7(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function fme(t,e){let n=null,r;const i=nl(t);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=t.getBoundingClientRect(),{left:f,top:h,width:g,height:m}=u;if(a||e(),!g||!m)return;const b=ib(h),w=ib(i.clientWidth-(f+g)),x=ib(i.clientHeight-(h+m)),v=ib(f),P={rootMargin:-b+"px "+-w+"px "+-x+"px "+-v+"px",threshold:Qs(0,Su(1,l))||1};let k=!0;function M(A){const O=A[0].intersectionRatio;if(O!==l){if(!k)return o();O?o(!1,O):r=setTimeout(()=>{o(!1,1e-7)},1e3)}O===1&&!z7(u,t.getBoundingClientRect())&&o(),k=!1}try{n=new IntersectionObserver(M,{...P,root:i.ownerDocument})}catch{n=new IntersectionObserver(M,P)}n.observe(t)}return o(!0),s}function pme(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=CM(t),f=i||s?[...u?Im(u):[],...Im(e)]:[];f.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const h=u&&a?fme(u,n):null;let g=-1,m=null;o&&(m=new ResizeObserver(v=>{let[C]=v;C&&C.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var P;(P=m)==null||P.observe(e)})),n()}),u&&!l&&m.observe(u),m.observe(e));let b,w=l?jd(t):null;l&&x();function x(){const v=jd(t);w&&!z7(w,v)&&n(),w=v,b=requestAnimationFrame(x)}return n(),()=>{var v;f.forEach(C=>{i&&C.removeEventListener("scroll",n),s&&C.removeEventListener("resize",n)}),h?.(),(v=m)==null||v.disconnect(),m=null,l&&cancelAnimationFrame(b)}}const gme=Bge,mme=Fge,yme=Lge,Sme=Hge,bme=Nge,rz=jge,vme=Uge,xme=(t,e,n)=>{const r=new Map,i={platform:hme,...n},s={...i.platform,_c:r};return Rge(t,e,{...i,platform:s})};var wme=typeof document<"u",Cme=function(){},Ub=wme?E.useLayoutEffect:Cme;function Dv(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,i;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Dv(t[r],e[r]))return!1;return!0}if(i=Object.keys(t),n=i.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!Dv(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function B7(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function iz(t,e){const n=B7(t);return Math.round(e*n)/n}function h_(t){const e=E.useRef(t);return Ub(()=>{e.current=t}),e}function Tme(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[f,h]=E.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,m]=E.useState(r);Dv(g,r)||m(r);const[b,w]=E.useState(null),[x,v]=E.useState(null),C=E.useCallback(W=>{W!==A.current&&(A.current=W,w(W))},[]),P=E.useCallback(W=>{W!==O.current&&(O.current=W,v(W))},[]),k=s||b,M=o||x,A=E.useRef(null),O=E.useRef(null),R=E.useRef(f),F=l!=null,N=h_(l),j=h_(i),H=h_(u),V=E.useCallback(()=>{if(!A.current||!O.current)return;const W={placement:e,strategy:n,middleware:g};j.current&&(W.platform=j.current),xme(A.current,O.current,W).then(Z=>{const de={...Z,isPositioned:H.current!==!1};z.current&&!Dv(R.current,de)&&(R.current=de,qd.flushSync(()=>{h(de)}))})},[g,e,n,j,H]);Ub(()=>{u===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,h(W=>({...W,isPositioned:!1})))},[u]);const z=E.useRef(!1);Ub(()=>(z.current=!0,()=>{z.current=!1}),[]),Ub(()=>{if(k&&(A.current=k),M&&(O.current=M),k&&M){if(N.current)return N.current(k,M,V);V()}},[k,M,V,N,F]);const K=E.useMemo(()=>({reference:A,floating:O,setReference:C,setFloating:P}),[C,P]),B=E.useMemo(()=>({reference:k,floating:M}),[k,M]),G=E.useMemo(()=>{const W={position:n,left:0,top:0};if(!B.floating)return W;const Z=iz(B.floating,f.x),de=iz(B.floating,f.y);return a?{...W,transform:"translate("+Z+"px, "+de+"px)",...B7(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:de}},[n,a,B.floating,f.x,f.y]);return E.useMemo(()=>({...f,update:V,refs:K,elements:B,floatingStyles:G}),[f,V,K,B,G])}const Eme=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:i}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?rz({element:r.current,padding:i}).fn(n):{}:r?rz({element:r,padding:i}).fn(n):{}}}},_me=(t,e)=>({...gme(t),options:[t,e]}),Pme=(t,e)=>({...mme(t),options:[t,e]}),Ime=(t,e)=>({...vme(t),options:[t,e]}),kme=(t,e)=>({...yme(t),options:[t,e]}),Mme=(t,e)=>({...Sme(t),options:[t,e]}),Ame=(t,e)=>({...bme(t),options:[t,e]}),Ome=(t,e)=>({...Eme(t),options:[t,e]});var Dme="Arrow",F7=E.forwardRef((t,e)=>{const{children:n,width:r=10,height:i=5,...s}=t;return y.jsx(ht.svg,{...s,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});F7.displayName=Dme;var Rme=F7,TM="Popper",[U7,ap]=po(TM),[jme,H7]=U7(TM),$7=t=>{const{__scopePopper:e,children:n}=t,[r,i]=E.useState(null);return y.jsx(jme,{scope:e,anchor:r,onAnchorChange:i,children:n})};$7.displayName=TM;var K7="PopperAnchor",V7=E.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...i}=t,s=H7(K7,n),o=E.useRef(null),a=Zt(e,o),l=E.useRef(null);return E.useEffect(()=>{const u=l.current;l.current=r?.current||o.current,u!==l.current&&s.onAnchorChange(l.current)}),r?null:y.jsx(ht.div,{...i,ref:a})});V7.displayName=K7;var EM="PopperContent",[Lme,Nme]=U7(EM),q7=E.forwardRef((t,e)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:h="partial",hideWhenDetached:g=!1,updatePositionStrategy:m="optimized",onPlaced:b,...w}=t,x=H7(EM,n),[v,C]=E.useState(null),P=Zt(e,xe=>C(xe)),[k,M]=E.useState(null),A=I7(k),O=A?.width??0,R=A?.height??0,F=r+(s!=="center"?"-"+s:""),N=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},j=Array.isArray(u)?u:[u],H=j.length>0,V={padding:N,boundary:j.filter(Bme),altBoundary:H},{refs:z,floatingStyles:K,placement:B,isPositioned:G,middlewareData:W}=Tme({strategy:"fixed",placement:F,whileElementsMounted:(...xe)=>pme(...xe,{animationFrame:m==="always"}),elements:{reference:x.anchor},middleware:[_me({mainAxis:i+R,alignmentAxis:o}),l&&Pme({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?Ime():void 0,...V}),l&&kme({...V}),Mme({...V,apply:({elements:xe,rects:Pe,availableWidth:Oe,availableHeight:He})=>{const{width:zt,height:Kt}=Pe.reference,Mt=xe.floating.style;Mt.setProperty("--radix-popper-available-width",`${Oe}px`),Mt.setProperty("--radix-popper-available-height",`${He}px`),Mt.setProperty("--radix-popper-anchor-width",`${zt}px`),Mt.setProperty("--radix-popper-anchor-height",`${Kt}px`)}}),k&&Ome({element:k,padding:a}),Fme({arrowWidth:O,arrowHeight:R}),g&&Ame({strategy:"referenceHidden",...V})]}),[Z,de]=W7(B),U=rs(b);Wl(()=>{G&&U?.()},[G,U]);const ne=W.arrow?.x,le=W.arrow?.y,fe=W.arrow?.centerOffset!==0,[me,_e]=E.useState();return Wl(()=>{v&&_e(window.getComputedStyle(v).zIndex)},[v]),y.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:G?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[W.transformOrigin?.x,W.transformOrigin?.y].join(" "),...W.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:y.jsx(Lme,{scope:n,placedSide:Z,onArrowChange:M,arrowX:ne,arrowY:le,shouldHideArrow:fe,children:y.jsx(ht.div,{"data-side":Z,"data-align":de,...w,ref:P,style:{...w.style,animation:G?void 0:"none"}})})})});q7.displayName=EM;var G7="PopperArrow",zme={top:"bottom",right:"left",bottom:"top",left:"right"},Y7=E.forwardRef(function(e,n){const{__scopePopper:r,...i}=e,s=Nme(G7,r),o=zme[s.placedSide];return y.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:y.jsx(Rme,{...i,ref:n,style:{...i.style,display:"block"}})})});Y7.displayName=G7;function Bme(t){return t!==null}var Fme=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:i}=e,o=i.arrow?.centerOffset!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,f]=W7(n),h={start:"0%",center:"50%",end:"100%"}[f],g=(i.arrow?.x??0)+a/2,m=(i.arrow?.y??0)+l/2;let b="",w="";return u==="bottom"?(b=o?h:`${g}px`,w=`${-l}px`):u==="top"?(b=o?h:`${g}px`,w=`${r.floating.height+l}px`):u==="right"?(b=`${-l}px`,w=o?h:`${m}px`):u==="left"&&(b=`${r.floating.width+l}px`,w=o?h:`${m}px`),{data:{x:b,y:w}}}});function W7(t){const[e,n="center"]=t.split("-");return[e,n]}var M0=$7,A0=V7,_M=q7,PM=Y7,f_="rovingFocusGroup.onEntryFocus",Ume={bubbles:!1,cancelable:!0},yy="RovingFocusGroup",[UP,X7,Hme]=x0(yy),[$me,lp]=po(yy,[Hme]),[Kme,Vme]=$me(yy),Z7=E.forwardRef((t,e)=>y.jsx(UP.Provider,{scope:t.__scopeRovingFocusGroup,children:y.jsx(UP.Slot,{scope:t.__scopeRovingFocusGroup,children:y.jsx(qme,{...t,ref:e})})}));Z7.displayName=yy;var qme=E.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...h}=t,g=E.useRef(null),m=Zt(e,g),b=py(s),[w,x]=qo({prop:o,defaultProp:a??null,onChange:l,caller:yy}),[v,C]=E.useState(!1),P=rs(u),k=X7(n),M=E.useRef(!1),[A,O]=E.useState(0);return E.useEffect(()=>{const R=g.current;if(R)return R.addEventListener(f_,P),()=>R.removeEventListener(f_,P)},[P]),y.jsx(Kme,{scope:n,orientation:r,dir:b,loop:i,currentTabStopId:w,onItemFocus:E.useCallback(R=>x(R),[x]),onItemShiftTab:E.useCallback(()=>C(!0),[]),onFocusableItemAdd:E.useCallback(()=>O(R=>R+1),[]),onFocusableItemRemove:E.useCallback(()=>O(R=>R-1),[]),children:y.jsx(ht.div,{tabIndex:v||A===0?-1:0,"data-orientation":r,...h,ref:m,style:{outline:"none",...t.style},onMouseDown:Re(t.onMouseDown,()=>{M.current=!0}),onFocus:Re(t.onFocus,R=>{const F=!M.current;if(R.target===R.currentTarget&&F&&!v){const N=new CustomEvent(f_,Ume);if(R.currentTarget.dispatchEvent(N),!N.defaultPrevented){const j=k().filter(B=>B.focusable),H=j.find(B=>B.active),V=j.find(B=>B.id===w),K=[H,V,...j].filter(Boolean).map(B=>B.ref.current);eK(K,f)}}M.current=!1}),onBlur:Re(t.onBlur,()=>C(!1))})})}),J7="RovingFocusGroupItem",Q7=E.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,children:o,...a}=t,l=Va(),u=s||l,f=Vme(J7,n),h=f.currentTabStopId===u,g=X7(n),{onFocusableItemAdd:m,onFocusableItemRemove:b,currentTabStopId:w}=f;return E.useEffect(()=>{if(r)return m(),()=>b()},[r,m,b]),y.jsx(UP.ItemSlot,{scope:n,id:u,focusable:r,active:i,children:y.jsx(ht.span,{tabIndex:h?0:-1,"data-orientation":f.orientation,...a,ref:e,onMouseDown:Re(t.onMouseDown,x=>{r?f.onItemFocus(u):x.preventDefault()}),onFocus:Re(t.onFocus,()=>f.onItemFocus(u)),onKeyDown:Re(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){f.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const v=Wme(x,f.orientation,f.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let P=g().filter(k=>k.focusable).map(k=>k.ref.current);if(v==="last")P.reverse();else if(v==="prev"||v==="next"){v==="prev"&&P.reverse();const k=P.indexOf(x.currentTarget);P=f.loop?Xme(P,k+1):P.slice(k+1)}setTimeout(()=>eK(P))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:w!=null}):o})})});Q7.displayName=J7;var Gme={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Yme(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Wme(t,e,n){const r=Yme(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Gme[r]}function eK(t,e=!1){const n=document.activeElement;for(const r of t)if(r===n||(r.focus({preventScroll:e}),document.activeElement!==n))return}function Xme(t,e){return t.map((n,r)=>t[(e+r)%t.length])}var IM=Z7,O0=Q7,HP=["Enter"," "],Zme=["ArrowDown","PageUp","Home"],tK=["ArrowUp","PageDown","End"],Jme=[...Zme,...tK],Qme={ltr:[...HP,"ArrowRight"],rtl:[...HP,"ArrowLeft"]},eye={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sy="Menu",[km,tye,nye]=x0(Sy),[Wd,D0]=po(Sy,[nye,ap,lp]),by=ap(),nK=lp(),[rK,ju]=Wd(Sy),[rye,vy]=Wd(Sy),iK=t=>{const{__scopeMenu:e,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=t,a=by(e),[l,u]=E.useState(null),f=E.useRef(!1),h=rs(s),g=py(i);return E.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),y.jsx(M0,{...a,children:y.jsx(rK,{scope:e,open:n,onOpenChange:h,content:l,onContentChange:u,children:y.jsx(rye,{scope:e,onClose:E.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:f,dir:g,modal:o,children:r})})})};iK.displayName=Sy;var iye="MenuAnchor",kM=E.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=by(n);return y.jsx(A0,{...i,...r,ref:e})});kM.displayName=iye;var MM="MenuPortal",[sye,sK]=Wd(MM,{forceMount:void 0}),oK=t=>{const{__scopeMenu:e,forceMount:n,children:r,container:i}=t,s=ju(MM,e);return y.jsx(sye,{scope:e,forceMount:n,children:y.jsx(Go,{present:n||s.open,children:y.jsx(gy,{asChild:!0,container:i,children:r})})})};oK.displayName=MM;var Ko="MenuContent",[oye,AM]=Wd(Ko),aK=E.forwardRef((t,e)=>{const n=sK(Ko,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=ju(Ko,t.__scopeMenu),o=vy(Ko,t.__scopeMenu);return y.jsx(km.Provider,{scope:t.__scopeMenu,children:y.jsx(Go,{present:r||s.open,children:y.jsx(km.Slot,{scope:t.__scopeMenu,children:o.modal?y.jsx(aye,{...i,ref:e}):y.jsx(lye,{...i,ref:e})})})})}),aye=E.forwardRef((t,e)=>{const n=ju(Ko,t.__scopeMenu),r=E.useRef(null),i=Zt(e,r);return E.useEffect(()=>{const s=r.current;if(s)return pM(s)},[]),y.jsx(OM,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(t.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),lye=E.forwardRef((t,e)=>{const n=ju(Ko,t.__scopeMenu);return y.jsx(OM,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),cye=Dd("MenuContent.ScrollLock"),OM=E.forwardRef((t,e)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:g,onDismiss:m,disableOutsideScroll:b,...w}=t,x=ju(Ko,n),v=vy(Ko,n),C=by(n),P=nK(n),k=tye(n),[M,A]=E.useState(null),O=E.useRef(null),R=Zt(e,O,x.onContentChange),F=E.useRef(0),N=E.useRef(""),j=E.useRef(0),H=E.useRef(null),V=E.useRef("right"),z=E.useRef(0),K=b?T0:E.Fragment,B=b?{as:cye,allowPinchZoom:!0}:void 0,G=Z=>{const de=N.current+Z,U=k().filter(xe=>!xe.disabled),ne=document.activeElement,le=U.find(xe=>xe.ref.current===ne)?.textValue,fe=U.map(xe=>xe.textValue),me=xye(fe,de,le),_e=U.find(xe=>xe.textValue===me)?.ref.current;(function xe(Pe){N.current=Pe,window.clearTimeout(F.current),Pe!==""&&(F.current=window.setTimeout(()=>xe(""),1e3))})(de),_e&&setTimeout(()=>_e.focus())};E.useEffect(()=>()=>window.clearTimeout(F.current),[]),fM();const W=E.useCallback(Z=>V.current===H.current?.side&&Cye(Z,H.current?.area),[]);return y.jsx(oye,{scope:n,searchRef:N,onItemEnter:E.useCallback(Z=>{W(Z)&&Z.preventDefault()},[W]),onItemLeave:E.useCallback(Z=>{W(Z)||(O.current?.focus(),A(null))},[W]),onTriggerLeave:E.useCallback(Z=>{W(Z)&&Z.preventDefault()},[W]),pointerGraceTimerRef:j,onPointerGraceIntentChange:E.useCallback(Z=>{H.current=Z},[]),children:y.jsx(K,{...B,children:y.jsx(w0,{asChild:!0,trapped:i,onMountAutoFocus:Re(s,Z=>{Z.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:y.jsx(ip,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:g,onDismiss:m,children:y.jsx(IM,{asChild:!0,...P,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:M,onCurrentTabStopIdChange:A,onEntryFocus:Re(l,Z=>{v.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:y.jsx(_M,{role:"menu","aria-orientation":"vertical","data-state":TK(x.open),"data-radix-menu-content":"",dir:v.dir,...C,...w,ref:R,style:{outline:"none",...w.style},onKeyDown:Re(w.onKeyDown,Z=>{const U=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,ne=Z.ctrlKey||Z.altKey||Z.metaKey,le=Z.key.length===1;U&&(Z.key==="Tab"&&Z.preventDefault(),!ne&&le&&G(Z.key));const fe=O.current;if(Z.target!==fe||!Jme.includes(Z.key))return;Z.preventDefault();const _e=k().filter(xe=>!xe.disabled).map(xe=>xe.ref.current);tK.includes(Z.key)&&_e.reverse(),bye(_e)}),onBlur:Re(t.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(F.current),N.current="")}),onPointerMove:Re(t.onPointerMove,Mm(Z=>{const de=Z.target,U=z.current!==Z.clientX;if(Z.currentTarget.contains(de)&&U){const ne=Z.clientX>z.current?"right":"left";V.current=ne,z.current=Z.clientX}}))})})})})})})});aK.displayName=Ko;var uye="MenuGroup",DM=E.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return y.jsx(ht.div,{role:"group",...r,ref:e})});DM.displayName=uye;var dye="MenuLabel",lK=E.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return y.jsx(ht.div,{...r,ref:e})});lK.displayName=dye;var Rv="MenuItem",sz="menu.itemSelect",R0=E.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:r,...i}=t,s=E.useRef(null),o=vy(Rv,t.__scopeMenu),a=AM(Rv,t.__scopeMenu),l=Zt(e,s),u=E.useRef(!1),f=()=>{const h=s.current;if(!n&&h){const g=new CustomEvent(sz,{bubbles:!0,cancelable:!0});h.addEventListener(sz,m=>r?.(m),{once:!0}),hM(h,g),g.defaultPrevented?u.current=!1:o.onClose()}};return y.jsx(cK,{...i,ref:l,disabled:n,onClick:Re(t.onClick,f),onPointerDown:h=>{t.onPointerDown?.(h),u.current=!0},onPointerUp:Re(t.onPointerUp,h=>{u.current||h.currentTarget?.click()}),onKeyDown:Re(t.onKeyDown,h=>{const g=a.searchRef.current!=="";n||g&&h.key===" "||HP.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});R0.displayName=Rv;var cK=E.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=t,o=AM(Rv,n),a=nK(n),l=E.useRef(null),u=Zt(e,l),[f,h]=E.useState(!1),[g,m]=E.useState("");return E.useEffect(()=>{const b=l.current;b&&m((b.textContent??"").trim())},[s.children]),y.jsx(km.ItemSlot,{scope:n,disabled:r,textValue:i??g,children:y.jsx(O0,{asChild:!0,...a,focusable:!r,children:y.jsx(ht.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:Re(t.onPointerMove,Mm(b=>{r?o.onItemLeave(b):(o.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(t.onPointerLeave,Mm(b=>o.onItemLeave(b))),onFocus:Re(t.onFocus,()=>h(!0)),onBlur:Re(t.onBlur,()=>h(!1))})})})}),hye="MenuCheckboxItem",uK=E.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:r,...i}=t;return y.jsx(gK,{scope:t.__scopeMenu,checked:n,children:y.jsx(R0,{role:"menuitemcheckbox","aria-checked":jv(n)?"mixed":n,...i,ref:e,"data-state":LM(n),onSelect:Re(i.onSelect,()=>r?.(jv(n)?!0:!n),{checkForDefaultPrevented:!1})})})});uK.displayName=hye;var dK="MenuRadioGroup",[fye,pye]=Wd(dK,{value:void 0,onValueChange:()=>{}}),hK=E.forwardRef((t,e)=>{const{value:n,onValueChange:r,...i}=t,s=rs(r);return y.jsx(fye,{scope:t.__scopeMenu,value:n,onValueChange:s,children:y.jsx(DM,{...i,ref:e})})});hK.displayName=dK;var fK="MenuRadioItem",pK=E.forwardRef((t,e)=>{const{value:n,...r}=t,i=pye(fK,t.__scopeMenu),s=n===i.value;return y.jsx(gK,{scope:t.__scopeMenu,checked:s,children:y.jsx(R0,{role:"menuitemradio","aria-checked":s,...r,ref:e,"data-state":LM(s),onSelect:Re(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});pK.displayName=fK;var RM="MenuItemIndicator",[gK,gye]=Wd(RM,{checked:!1}),mK=E.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:r,...i}=t,s=gye(RM,n);return y.jsx(Go,{present:r||jv(s.checked)||s.checked===!0,children:y.jsx(ht.span,{...i,ref:e,"data-state":LM(s.checked)})})});mK.displayName=RM;var mye="MenuSeparator",yK=E.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t;return y.jsx(ht.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});yK.displayName=mye;var yye="MenuArrow",SK=E.forwardRef((t,e)=>{const{__scopeMenu:n,...r}=t,i=by(n);return y.jsx(PM,{...i,...r,ref:e})});SK.displayName=yye;var jM="MenuSub",[Sye,bK]=Wd(jM),vK=t=>{const{__scopeMenu:e,children:n,open:r=!1,onOpenChange:i}=t,s=ju(jM,e),o=by(e),[a,l]=E.useState(null),[u,f]=E.useState(null),h=rs(i);return E.useEffect(()=>(s.open===!1&&h(!1),()=>h(!1)),[s.open,h]),y.jsx(M0,{...o,children:y.jsx(rK,{scope:e,open:r,onOpenChange:h,content:u,onContentChange:f,children:y.jsx(Sye,{scope:e,contentId:Va(),triggerId:Va(),trigger:a,onTriggerChange:l,children:n})})})};vK.displayName=jM;var Ag="MenuSubTrigger",xK=E.forwardRef((t,e)=>{const n=ju(Ag,t.__scopeMenu),r=vy(Ag,t.__scopeMenu),i=bK(Ag,t.__scopeMenu),s=AM(Ag,t.__scopeMenu),o=E.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,u={__scopeMenu:t.__scopeMenu},f=E.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return E.useEffect(()=>f,[f]),E.useEffect(()=>{const h=a.current;return()=>{window.clearTimeout(h),l(null)}},[a,l]),y.jsx(kM,{asChild:!0,...u,children:y.jsx(cK,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":TK(n.open),...t,ref:b0(e,i.onTriggerChange),onClick:h=>{t.onClick?.(h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(t.onPointerMove,Mm(h=>{s.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:Re(t.onPointerLeave,Mm(h=>{f();const g=n.content?.getBoundingClientRect();if(g){const m=n.content?.dataset.side,b=m==="right",w=b?-5:5,x=g[b?"left":"right"],v=g[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:h.clientX+w,y:h.clientY},{x,y:g.top},{x:v,y:g.top},{x:v,y:g.bottom},{x,y:g.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(h),h.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Re(t.onKeyDown,h=>{const g=s.searchRef.current!=="";t.disabled||g&&h.key===" "||Qme[r.dir].includes(h.key)&&(n.onOpenChange(!0),n.content?.focus(),h.preventDefault())})})})});xK.displayName=Ag;var wK="MenuSubContent",CK=E.forwardRef((t,e)=>{const n=sK(Ko,t.__scopeMenu),{forceMount:r=n.forceMount,...i}=t,s=ju(Ko,t.__scopeMenu),o=vy(Ko,t.__scopeMenu),a=bK(wK,t.__scopeMenu),l=E.useRef(null),u=Zt(e,l);return y.jsx(km.Provider,{scope:t.__scopeMenu,children:y.jsx(Go,{present:r||s.open,children:y.jsx(km.Slot,{scope:t.__scopeMenu,children:y.jsx(OM,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{o.isUsingKeyboardRef.current&&l.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:Re(t.onFocusOutside,f=>{f.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Re(t.onEscapeKeyDown,f=>{o.onClose(),f.preventDefault()}),onKeyDown:Re(t.onKeyDown,f=>{const h=f.currentTarget.contains(f.target),g=eye[o.dir].includes(f.key);h&&g&&(s.onOpenChange(!1),a.trigger?.focus(),f.preventDefault())})})})})})});CK.displayName=wK;function TK(t){return t?"open":"closed"}function jv(t){return t==="indeterminate"}function LM(t){return jv(t)?"indeterminate":t?"checked":"unchecked"}function bye(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function vye(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function xye(t,e,n){const i=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,s=n?t.indexOf(n):-1;let o=vye(t,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function wye(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s],l=e[o],u=a.x,f=a.y,h=l.x,g=l.y;f>r!=g>r&&n<(h-u)*(r-f)/(g-f)+u&&(i=!i)}return i}function Cye(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return wye(n,e)}function Mm(t){return e=>e.pointerType==="mouse"?t(e):void 0}var EK=iK,_K=kM,PK=oK,IK=aK,kK=DM,MK=lK,AK=R0,OK=uK,DK=hK,RK=pK,jK=mK,LK=yK,NK=SK,zK=vK,BK=xK,FK=CK,NM="ContextMenu",[Tye]=po(NM,[D0]),Li=D0(),[Eye,UK]=Tye(NM),HK=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,dir:i,modal:s=!0}=t,[o,a]=E.useState(!1),l=Li(e),u=rs(r),f=E.useCallback(h=>{a(h),u(h)},[u]);return y.jsx(Eye,{scope:e,open:o,onOpenChange:f,modal:s,children:y.jsx(EK,{...l,dir:i,open:o,onOpenChange:f,modal:s,children:n})})};HK.displayName=NM;var $K="ContextMenuTrigger",KK=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,disabled:r=!1,...i}=t,s=UK($K,n),o=Li(n),a=E.useRef({x:0,y:0}),l=E.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...a.current})}),u=E.useRef(0),f=E.useCallback(()=>window.clearTimeout(u.current),[]),h=g=>{a.current={x:g.clientX,y:g.clientY},s.onOpenChange(!0)};return E.useEffect(()=>f,[f]),E.useEffect(()=>{r&&f()},[r,f]),y.jsxs(y.Fragment,{children:[y.jsx(_K,{...o,virtualRef:l}),y.jsx(ht.span,{"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,...i,ref:e,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:r?t.onContextMenu:Re(t.onContextMenu,g=>{f(),h(g),g.preventDefault()}),onPointerDown:r?t.onPointerDown:Re(t.onPointerDown,sb(g=>{f(),u.current=window.setTimeout(()=>h(g),700)})),onPointerMove:r?t.onPointerMove:Re(t.onPointerMove,sb(f)),onPointerCancel:r?t.onPointerCancel:Re(t.onPointerCancel,sb(f)),onPointerUp:r?t.onPointerUp:Re(t.onPointerUp,sb(f))})]})});KK.displayName=$K;var _ye="ContextMenuPortal",zM=t=>{const{__scopeContextMenu:e,...n}=t,r=Li(e);return y.jsx(PK,{...r,...n})};zM.displayName=_ye;var VK="ContextMenuContent",qK=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=UK(VK,n),s=Li(n),o=E.useRef(!1);return y.jsx(IK,{...s,...r,ref:e,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:a=>{t.onCloseAutoFocus?.(a),!a.defaultPrevented&&o.current&&a.preventDefault(),o.current=!1},onInteractOutside:a=>{t.onInteractOutside?.(a),!a.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});qK.displayName=VK;var Pye="ContextMenuGroup",Iye=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(kK,{...i,...r,ref:e})});Iye.displayName=Pye;var kye="ContextMenuLabel",Mye=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(MK,{...i,...r,ref:e})});Mye.displayName=kye;var Aye="ContextMenuItem",GK=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(AK,{...i,...r,ref:e})});GK.displayName=Aye;var Oye="ContextMenuCheckboxItem",YK=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(OK,{...i,...r,ref:e})});YK.displayName=Oye;var Dye="ContextMenuRadioGroup",Rye=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(DK,{...i,...r,ref:e})});Rye.displayName=Dye;var jye="ContextMenuRadioItem",Lye=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(RK,{...i,...r,ref:e})});Lye.displayName=jye;var Nye="ContextMenuItemIndicator",zye=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(jK,{...i,...r,ref:e})});zye.displayName=Nye;var Bye="ContextMenuSeparator",Fye=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(LK,{...i,...r,ref:e})});Fye.displayName=Bye;var Uye="ContextMenuArrow",Hye=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(NK,{...i,...r,ref:e})});Hye.displayName=Uye;var WK="ContextMenuSub",XK=t=>{const{__scopeContextMenu:e,children:n,onOpenChange:r,open:i,defaultOpen:s}=t,o=Li(e),[a,l]=qo({prop:i,defaultProp:s??!1,onChange:r,caller:WK});return y.jsx(zK,{...o,open:a,onOpenChange:l,children:n})};XK.displayName=WK;var $ye="ContextMenuSubTrigger",ZK=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(BK,{...i,...r,ref:e})});ZK.displayName=$ye;var Kye="ContextMenuSubContent",JK=E.forwardRef((t,e)=>{const{__scopeContextMenu:n,...r}=t,i=Li(n);return y.jsx(FK,{...i,...r,ref:e,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});JK.displayName=Kye;function sb(t){return e=>e.pointerType!=="mouse"?t(e):void 0}var Vye=HK,qye=KK,Gye=zM,Yye=qK,Wye=GK,Xye=YK,j0="DropdownMenu",[Zye]=po(j0,[D0]),Ni=D0(),[Jye,QK]=Zye(j0),eV=t=>{const{__scopeDropdownMenu:e,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=t,l=Ni(e),u=E.useRef(null),[f,h]=qo({prop:i,defaultProp:s??!1,onChange:o,caller:j0});return y.jsx(Jye,{scope:e,triggerId:Va(),triggerRef:u,contentId:Va(),open:f,onOpenChange:h,onOpenToggle:E.useCallback(()=>h(g=>!g),[h]),modal:a,children:y.jsx(EK,{...l,open:f,onOpenChange:h,dir:r,modal:a,children:n})})};eV.displayName=j0;var tV="DropdownMenuTrigger",nV=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=t,s=QK(tV,n),o=Ni(n);return y.jsx(_K,{asChild:!0,...o,children:y.jsx(ht.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:b0(e,s.triggerRef),onPointerDown:Re(t.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:Re(t.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});nV.displayName=tV;var Qye="DropdownMenuPortal",rV=t=>{const{__scopeDropdownMenu:e,...n}=t,r=Ni(e);return y.jsx(PK,{...r,...n})};rV.displayName=Qye;var iV="DropdownMenuContent",sV=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=QK(iV,n),s=Ni(n),o=E.useRef(!1);return y.jsx(IK,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:e,onCloseAutoFocus:Re(t.onCloseAutoFocus,a=>{o.current||i.triggerRef.current?.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:Re(t.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;(!i.modal||f)&&(o.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});sV.displayName=iV;var eSe="DropdownMenuGroup",tSe=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(kK,{...i,...r,ref:e})});tSe.displayName=eSe;var nSe="DropdownMenuLabel",rSe=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(MK,{...i,...r,ref:e})});rSe.displayName=nSe;var iSe="DropdownMenuItem",oV=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(AK,{...i,...r,ref:e})});oV.displayName=iSe;var sSe="DropdownMenuCheckboxItem",aV=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(OK,{...i,...r,ref:e})});aV.displayName=sSe;var oSe="DropdownMenuRadioGroup",aSe=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(DK,{...i,...r,ref:e})});aSe.displayName=oSe;var lSe="DropdownMenuRadioItem",cSe=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(RK,{...i,...r,ref:e})});cSe.displayName=lSe;var uSe="DropdownMenuItemIndicator",lV=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(jK,{...i,...r,ref:e})});lV.displayName=uSe;var dSe="DropdownMenuSeparator",hSe=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(LK,{...i,...r,ref:e})});hSe.displayName=dSe;var fSe="DropdownMenuArrow",pSe=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(NK,{...i,...r,ref:e})});pSe.displayName=fSe;var gSe=t=>{const{__scopeDropdownMenu:e,children:n,open:r,onOpenChange:i,defaultOpen:s}=t,o=Ni(e),[a,l]=qo({prop:r,defaultProp:s??!1,onChange:i,caller:"DropdownMenuSub"});return y.jsx(zK,{...o,open:a,onOpenChange:l,children:n})},mSe="DropdownMenuSubTrigger",cV=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(BK,{...i,...r,ref:e})});cV.displayName=mSe;var ySe="DropdownMenuSubContent",uV=E.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...r}=t,i=Ni(n);return y.jsx(FK,{...i,...r,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});uV.displayName=ySe;var BM=eV,FM=nV,L0=rV,UM=sV,SSe=oV,dV=aV,bSe=lV,vSe=gSe,xSe=cV,wSe=uV;function hV(t,[e,n]){return Math.min(n,Math.max(e,t))}var N0="Popover",[fV]=po(N0,[ap]),xy=ap(),[CSe,Lu]=fV(N0),pV=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=xy(e),l=E.useRef(null),[u,f]=E.useState(!1),[h,g]=qo({prop:r,defaultProp:i??!1,onChange:s,caller:N0});return y.jsx(M0,{...a,children:y.jsx(CSe,{scope:e,contentId:Va(),triggerRef:l,open:h,onOpenChange:g,onOpenToggle:E.useCallback(()=>g(m=>!m),[g]),hasCustomAnchor:u,onCustomAnchorAdd:E.useCallback(()=>f(!0),[]),onCustomAnchorRemove:E.useCallback(()=>f(!1),[]),modal:o,children:n})})};pV.displayName=N0;var gV="PopoverAnchor",TSe=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Lu(gV,n),s=xy(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:a}=i;return E.useEffect(()=>(o(),()=>a()),[o,a]),y.jsx(A0,{...s,...r,ref:e})});TSe.displayName=gV;var mV="PopoverTrigger",yV=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Lu(mV,n),s=xy(n),o=Zt(e,i.triggerRef),a=y.jsx(ht.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":wV(i.open),...r,ref:o,onClick:Re(t.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:y.jsx(A0,{asChild:!0,...s,children:a})});yV.displayName=mV;var HM="PopoverPortal",[ESe,_Se]=fV(HM,{forceMount:void 0}),SV=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,s=Lu(HM,e);return y.jsx(ESe,{scope:e,forceMount:n,children:y.jsx(Go,{present:n||s.open,children:y.jsx(gy,{asChild:!0,container:i,children:r})})})};SV.displayName=HM;var Uf="PopoverContent",bV=E.forwardRef((t,e)=>{const n=_Se(Uf,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,s=Lu(Uf,t.__scopePopover);return y.jsx(Go,{present:r||s.open,children:s.modal?y.jsx(ISe,{...i,ref:e}):y.jsx(kSe,{...i,ref:e})})});bV.displayName=Uf;var PSe=Dd("PopoverContent.RemoveScroll"),ISe=E.forwardRef((t,e)=>{const n=Lu(Uf,t.__scopePopover),r=E.useRef(null),i=Zt(e,r),s=E.useRef(!1);return E.useEffect(()=>{const o=r.current;if(o)return pM(o)},[]),y.jsx(T0,{as:PSe,allowPinchZoom:!0,children:y.jsx(vV,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(t.onCloseAutoFocus,o=>{o.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Re(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Re(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),kSe=E.forwardRef((t,e)=>{const n=Lu(Uf,t.__scopePopover),r=E.useRef(!1),i=E.useRef(!1);return y.jsx(vV,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{t.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{t.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;n.triggerRef.current?.contains(o)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),vV=E.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:f,...h}=t,g=Lu(Uf,n),m=xy(n);return fM(),y.jsx(w0,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:y.jsx(ip,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:f,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>g.onOpenChange(!1),children:y.jsx(_M,{"data-state":wV(g.open),role:"dialog",id:g.contentId,...m,...h,ref:e,style:{...h.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),xV="PopoverClose",MSe=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Lu(xV,n);return y.jsx(ht.button,{type:"button",...r,ref:e,onClick:Re(t.onClick,()=>i.onOpenChange(!1))})});MSe.displayName=xV;var ASe="PopoverArrow",OSe=E.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=xy(n);return y.jsx(PM,{...i,...r,ref:e})});OSe.displayName=ASe;function wV(t){return t?"open":"closed"}var $M=pV,KM=yV,VM=SV,qM=bV,DSe="Separator",oz="horizontal",RSe=["horizontal","vertical"],CV=E.forwardRef((t,e)=>{const{decorative:n,orientation:r=oz,...i}=t,s=jSe(r)?r:oz,a=n?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return y.jsx(ht.div,{"data-orientation":s,...a,...i,ref:e})});CV.displayName=DSe;function jSe(t){return RSe.includes(t)}var LSe=CV,TV=["PageUp","PageDown"],EV=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],_V={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},cp="Slider",[$P,NSe,zSe]=x0(cp),[PV]=po(cp,[zSe]),[BSe,z0]=PV(cp),IV=E.forwardRef((t,e)=>{const{name:n,min:r=0,max:i=100,step:s=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:l=0,defaultValue:u=[r],value:f,onValueChange:h=()=>{},onValueCommit:g=()=>{},inverted:m=!1,form:b,...w}=t,x=E.useRef(new Set),v=E.useRef(0),P=o==="horizontal"?FSe:USe,[k=[],M]=qo({prop:f,defaultProp:u,onChange:j=>{[...x.current][v.current]?.focus(),h(j)}}),A=E.useRef(k);function O(j){const H=qSe(k,j);N(j,H)}function R(j){N(j,v.current)}function F(){const j=A.current[v.current];k[v.current]!==j&&g(k)}function N(j,H,{commit:V}={commit:!1}){const z=XSe(s),K=ZSe(Math.round((j-r)/s)*s+r,z),B=hV(K,[r,i]);M((G=[])=>{const W=KSe(G,B,H);if(WSe(W,l*s)){v.current=W.indexOf(B);const Z=String(W)!==String(G);return Z&&V&&g(W),Z?W:G}else return G})}return y.jsx(BSe,{scope:t.__scopeSlider,name:n,disabled:a,min:r,max:i,valueIndexToChangeRef:v,thumbs:x.current,values:k,orientation:o,form:b,children:y.jsx($P.Provider,{scope:t.__scopeSlider,children:y.jsx($P.Slot,{scope:t.__scopeSlider,children:y.jsx(P,{"aria-disabled":a,"data-disabled":a?"":void 0,...w,ref:e,onPointerDown:Re(w.onPointerDown,()=>{a||(A.current=k)}),min:r,max:i,inverted:m,onSlideStart:a?void 0:O,onSlideMove:a?void 0:R,onSlideEnd:a?void 0:F,onHomeKeyDown:()=>!a&&N(r,0,{commit:!0}),onEndKeyDown:()=>!a&&N(i,k.length-1,{commit:!0}),onStepKeyDown:({event:j,direction:H})=>{if(!a){const K=TV.includes(j.key)||j.shiftKey&&EV.includes(j.key)?10:1,B=v.current,G=k[B],W=s*K*H;N(G+W,B,{commit:!0})}}})})})})});IV.displayName=cp;var[kV,MV]=PV(cp,{startEdge:"left",endEdge:"right",size:"width",direction:1}),FSe=E.forwardRef((t,e)=>{const{min:n,max:r,dir:i,inverted:s,onSlideStart:o,onSlideMove:a,onSlideEnd:l,onStepKeyDown:u,...f}=t,[h,g]=E.useState(null),m=Zt(e,P=>g(P)),b=E.useRef(void 0),w=py(i),x=w==="ltr",v=x&&!s||!x&&s;function C(P){const k=b.current||h.getBoundingClientRect(),M=[0,k.width],O=GM(M,v?[n,r]:[r,n]);return b.current=k,O(P-k.left)}return y.jsx(kV,{scope:t.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:y.jsx(AV,{dir:w,"data-orientation":"horizontal",...f,ref:m,style:{...f.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:P=>{const k=C(P.clientX);o?.(k)},onSlideMove:P=>{const k=C(P.clientX);a?.(k)},onSlideEnd:()=>{b.current=void 0,l?.()},onStepKeyDown:P=>{const M=_V[v?"from-left":"from-right"].includes(P.key);u?.({event:P,direction:M?-1:1})}})})}),USe=E.forwardRef((t,e)=>{const{min:n,max:r,inverted:i,onSlideStart:s,onSlideMove:o,onSlideEnd:a,onStepKeyDown:l,...u}=t,f=E.useRef(null),h=Zt(e,f),g=E.useRef(void 0),m=!i;function b(w){const x=g.current||f.current.getBoundingClientRect(),v=[0,x.height],P=GM(v,m?[r,n]:[n,r]);return g.current=x,P(w-x.top)}return y.jsx(kV,{scope:t.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:y.jsx(AV,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const x=b(w.clientY);s?.(x)},onSlideMove:w=>{const x=b(w.clientY);o?.(x)},onSlideEnd:()=>{g.current=void 0,a?.()},onStepKeyDown:w=>{const v=_V[m?"from-bottom":"from-top"].includes(w.key);l?.({event:w,direction:v?-1:1})}})})}),AV=E.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:l,...u}=t,f=z0(cp,n);return y.jsx(ht.span,{...u,ref:e,onKeyDown:Re(t.onKeyDown,h=>{h.key==="Home"?(o(h),h.preventDefault()):h.key==="End"?(a(h),h.preventDefault()):TV.concat(EV).includes(h.key)&&(l(h),h.preventDefault())}),onPointerDown:Re(t.onPointerDown,h=>{const g=h.target;g.setPointerCapture(h.pointerId),h.preventDefault(),f.thumbs.has(g)?g.focus():r(h)}),onPointerMove:Re(t.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&i(h)}),onPointerUp:Re(t.onPointerUp,h=>{const g=h.target;g.hasPointerCapture(h.pointerId)&&(g.releasePointerCapture(h.pointerId),s(h))})})}),OV="SliderTrack",DV=E.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=z0(OV,n);return y.jsx(ht.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:e})});DV.displayName=OV;var KP="SliderRange",RV=E.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=z0(KP,n),s=MV(KP,n),o=E.useRef(null),a=Zt(e,o),l=i.values.length,u=i.values.map(g=>NV(g,i.min,i.max)),f=l>1?Math.min(...u):0,h=100-Math.max(...u);return y.jsx(ht.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:a,style:{...t.style,[s.startEdge]:f+"%",[s.endEdge]:h+"%"}})});RV.displayName=KP;var VP="SliderThumb",jV=E.forwardRef((t,e)=>{const n=NSe(t.__scopeSlider),[r,i]=E.useState(null),s=Zt(e,a=>i(a)),o=E.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return y.jsx(HSe,{...t,ref:s,index:o})}),HSe=E.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:i,...s}=t,o=z0(VP,n),a=MV(VP,n),[l,u]=E.useState(null),f=Zt(e,C=>u(C)),h=l?o.form||!!l.closest("form"):!0,g=I7(l),m=o.values[r],b=m===void 0?0:NV(m,o.min,o.max),w=VSe(r,o.values.length),x=g?.[a.size],v=x?GSe(x,b,a.direction):0;return E.useEffect(()=>{if(l)return o.thumbs.add(l),()=>{o.thumbs.delete(l)}},[l,o.thumbs]),y.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${b}% + ${v}px)`},children:[y.jsx($P.ItemSlot,{scope:t.__scopeSlider,children:y.jsx(ht.span,{role:"slider","aria-label":t["aria-label"]||w,"aria-valuemin":o.min,"aria-valuenow":m,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...s,ref:f,style:m===void 0?{display:"none"}:t.style,onFocus:Re(t.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),h&&y.jsx(LV,{name:i??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:m},r)]})});jV.displayName=VP;var $Se="RadioBubbleInput",LV=E.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const i=E.useRef(null),s=Zt(i,r),o=wge(e);return E.useEffect(()=>{const a=i.current;if(!a)return;const l=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(l,"value").set;if(o!==e&&f){const h=new Event("input",{bubbles:!0});f.call(a,e),a.dispatchEvent(h)}},[o,e]),y.jsx(ht.input,{style:{display:"none"},...n,ref:s,defaultValue:e})});LV.displayName=$Se;function KSe(t=[],e,n){const r=[...t];return r[n]=e,r.sort((i,s)=>i-s)}function NV(t,e,n){const s=100/(n-e)*(t-e);return hV(s,[0,100])}function VSe(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function qSe(t,e){if(t.length===1)return 0;const n=t.map(i=>Math.abs(i-e)),r=Math.min(...n);return n.indexOf(r)}function GSe(t,e,n){const r=t/2,s=GM([0,50],[0,r]);return(r-s(e)*n)*n}function YSe(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function WSe(t,e){if(e>0){const n=YSe(t);return Math.min(...n)>=e}return!0}function GM(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function XSe(t){return(String(t).split(".")[1]||"").length}function ZSe(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var JSe=IV,QSe=DV,ebe=RV,tbe=jV,YM="ToastProvider",[WM,nbe,rbe]=x0("Toast"),[zV]=po("Toast",[rbe]),[ibe,B0]=zV(YM),BV=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=t,[a,l]=E.useState(null),[u,f]=E.useState(0),h=E.useRef(!1),g=E.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${YM}\`. Expected non-empty \`string\`.`),y.jsx(WM.Provider,{scope:e,children:y.jsx(ibe,{scope:e,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:E.useCallback(()=>f(m=>m+1),[]),onToastRemove:E.useCallback(()=>f(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:g,children:o})})};BV.displayName=YM;var FV="ToastViewport",sbe=["F8"],qP="toast.viewportPause",GP="toast.viewportResume",UV=E.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=sbe,label:i="Notifications ({hotkey})",...s}=t,o=B0(FV,n),a=nbe(n),l=E.useRef(null),u=E.useRef(null),f=E.useRef(null),h=E.useRef(null),g=Zt(e,h,o.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),b=o.toastCount>0;E.useEffect(()=>{const x=v=>{r.length!==0&&r.every(P=>v[P]||v.code===P)&&h.current?.focus()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[r]),E.useEffect(()=>{const x=l.current,v=h.current;if(b&&x&&v){const C=()=>{if(!o.isClosePausedRef.current){const A=new CustomEvent(qP);v.dispatchEvent(A),o.isClosePausedRef.current=!0}},P=()=>{if(o.isClosePausedRef.current){const A=new CustomEvent(GP);v.dispatchEvent(A),o.isClosePausedRef.current=!1}},k=A=>{!x.contains(A.relatedTarget)&&P()},M=()=>{x.contains(document.activeElement)||P()};return x.addEventListener("focusin",C),x.addEventListener("focusout",k),x.addEventListener("pointermove",C),x.addEventListener("pointerleave",M),window.addEventListener("blur",C),window.addEventListener("focus",P),()=>{x.removeEventListener("focusin",C),x.removeEventListener("focusout",k),x.removeEventListener("pointermove",C),x.removeEventListener("pointerleave",M),window.removeEventListener("blur",C),window.removeEventListener("focus",P)}}},[b,o.isClosePausedRef]);const w=E.useCallback(({tabbingDirection:x})=>{const C=a().map(P=>{const k=P.ref.current,M=[k,...Sbe(k)];return x==="forwards"?M:M.reverse()});return(x==="forwards"?C.reverse():C).flat()},[a]);return E.useEffect(()=>{const x=h.current;if(x){const v=C=>{const P=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!P){const M=document.activeElement,A=C.shiftKey;if(C.target===x&&A){u.current?.focus();return}const F=w({tabbingDirection:A?"backwards":"forwards"}),N=F.findIndex(j=>j===M);p_(F.slice(N+1))?C.preventDefault():A?u.current?.focus():f.current?.focus()}};return x.addEventListener("keydown",v),()=>x.removeEventListener("keydown",v)}},[a,w]),y.jsxs(hpe,{ref:l,role:"region","aria-label":i.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:b?void 0:"none"},children:[b&&y.jsx(YP,{ref:u,onFocusFromOutsideViewport:()=>{const x=w({tabbingDirection:"forwards"});p_(x)}}),y.jsx(WM.Slot,{scope:n,children:y.jsx(ht.ol,{tabIndex:-1,...s,ref:g})}),b&&y.jsx(YP,{ref:f,onFocusFromOutsideViewport:()=>{const x=w({tabbingDirection:"backwards"});p_(x)}})]})});UV.displayName=FV;var HV="ToastFocusProxy",YP=E.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=t,s=B0(HV,n);return y.jsx(v0,{tabIndex:0,...i,ref:e,style:{position:"fixed"},onFocus:o=>{const a=o.relatedTarget;!s.viewport?.contains(a)&&r()}})});YP.displayName=HV;var wy="Toast",obe="toast.swipeStart",abe="toast.swipeMove",lbe="toast.swipeCancel",cbe="toast.swipeEnd",$V=E.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...o}=t,[a,l]=qo({prop:r,defaultProp:i??!0,onChange:s,caller:wy});return y.jsx(Go,{present:n||a,children:y.jsx(hbe,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:rs(t.onPause),onResume:rs(t.onResume),onSwipeStart:Re(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Re(t.onSwipeMove,u=>{const{x:f,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:Re(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Re(t.onSwipeEnd,u=>{const{x:f,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),l(!1)})})})});$V.displayName=wy;var[ube,dbe]=zV(wy,{onClose(){}}),hbe=E.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:f,onSwipeMove:h,onSwipeCancel:g,onSwipeEnd:m,...b}=t,w=B0(wy,n),[x,v]=E.useState(null),C=Zt(e,z=>v(z)),P=E.useRef(null),k=E.useRef(null),M=i||w.duration,A=E.useRef(0),O=E.useRef(M),R=E.useRef(0),{onToastAdd:F,onToastRemove:N}=w,j=rs(()=>{x?.contains(document.activeElement)&&w.viewport?.focus(),o()}),H=E.useCallback(z=>{!z||z===1/0||(window.clearTimeout(R.current),A.current=new Date().getTime(),R.current=window.setTimeout(j,z))},[j]);E.useEffect(()=>{const z=w.viewport;if(z){const K=()=>{H(O.current),u?.()},B=()=>{const G=new Date().getTime()-A.current;O.current=O.current-G,window.clearTimeout(R.current),l?.()};return z.addEventListener(qP,B),z.addEventListener(GP,K),()=>{z.removeEventListener(qP,B),z.removeEventListener(GP,K)}}},[w.viewport,M,l,u,H]),E.useEffect(()=>{s&&!w.isClosePausedRef.current&&H(M)},[s,M,w.isClosePausedRef,H]),E.useEffect(()=>(F(),()=>N()),[F,N]);const V=E.useMemo(()=>x?XV(x):null,[x]);return w.viewport?y.jsxs(y.Fragment,{children:[V&&y.jsx(fbe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:V}),y.jsx(ube,{scope:n,onClose:j,children:qd.createPortal(y.jsx(WM.ItemSlot,{scope:n,children:y.jsx(dpe,{asChild:!0,onEscapeKeyDown:Re(a,()=>{w.isFocusedToastEscapeKeyDownRef.current||j(),w.isFocusedToastEscapeKeyDownRef.current=!1}),children:y.jsx(ht.li,{tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":w.swipeDirection,...b,ref:C,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Re(t.onKeyDown,z=>{z.key==="Escape"&&(a?.(z.nativeEvent),z.nativeEvent.defaultPrevented||(w.isFocusedToastEscapeKeyDownRef.current=!0,j()))}),onPointerDown:Re(t.onPointerDown,z=>{z.button===0&&(P.current={x:z.clientX,y:z.clientY})}),onPointerMove:Re(t.onPointerMove,z=>{if(!P.current)return;const K=z.clientX-P.current.x,B=z.clientY-P.current.y,G=!!k.current,W=["left","right"].includes(w.swipeDirection),Z=["left","up"].includes(w.swipeDirection)?Math.min:Math.max,de=W?Z(0,K):0,U=W?0:Z(0,B),ne=z.pointerType==="touch"?10:2,le={x:de,y:U},fe={originalEvent:z,delta:le};G?(k.current=le,ob(abe,h,fe,{discrete:!1})):az(le,w.swipeDirection,ne)?(k.current=le,ob(obe,f,fe,{discrete:!1}),z.target.setPointerCapture(z.pointerId)):(Math.abs(K)>ne||Math.abs(B)>ne)&&(P.current=null)}),onPointerUp:Re(t.onPointerUp,z=>{const K=k.current,B=z.target;if(B.hasPointerCapture(z.pointerId)&&B.releasePointerCapture(z.pointerId),k.current=null,P.current=null,K){const G=z.currentTarget,W={originalEvent:z,delta:K};az(K,w.swipeDirection,w.swipeThreshold)?ob(cbe,m,W,{discrete:!0}):ob(lbe,g,W,{discrete:!0}),G.addEventListener("click",Z=>Z.preventDefault(),{once:!0})}})})})}),w.viewport)})]}):null}),fbe=t=>{const{__scopeToast:e,children:n,...r}=t,i=B0(wy,e),[s,o]=E.useState(!1),[a,l]=E.useState(!1);return mbe(()=>o(!0)),E.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:y.jsx(gy,{asChild:!0,children:y.jsx(v0,{...r,children:s&&y.jsxs(y.Fragment,{children:[i.label," ",n]})})})},pbe="ToastTitle",KV=E.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return y.jsx(ht.div,{...r,ref:e})});KV.displayName=pbe;var gbe="ToastDescription",VV=E.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return y.jsx(ht.div,{...r,ref:e})});VV.displayName=gbe;var qV="ToastAction",GV=E.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?y.jsx(WV,{altText:n,asChild:!0,children:y.jsx(XM,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${qV}\`. Expected non-empty \`string\`.`),null)});GV.displayName=qV;var YV="ToastClose",XM=E.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,i=dbe(YV,n);return y.jsx(WV,{asChild:!0,children:y.jsx(ht.button,{type:"button",...r,ref:e,onClick:Re(t.onClick,i.onClose)})})});XM.displayName=YV;var WV=E.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...i}=t;return y.jsx(ht.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:e})});function XV(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),ybe(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...XV(r))}}),e}function ob(t,e,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?hM(i,s):i.dispatchEvent(s)}var az=(t,e,n=0)=>{const r=Math.abs(t.x),i=Math.abs(t.y),s=r>i;return e==="left"||e==="right"?s&&r>n:!s&&i>n};function mbe(t=()=>{}){const e=rs(t);Wl(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function ybe(t){return t.nodeType===t.ELEMENT_NODE}function Sbe(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function p_(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var bbe=BV,vbe=$V,xbe=KV,wbe=VV,Cbe=GV,lz=XM,ZV="Toggle",JV=E.forwardRef((t,e)=>{const{pressed:n,defaultPressed:r,onPressedChange:i,...s}=t,[o,a]=qo({prop:n,onChange:i,defaultProp:r??!1,caller:ZV});return y.jsx(ht.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":t.disabled?"":void 0,...s,ref:e,onClick:Re(t.onClick,()=>{t.disabled||a(!o)})})});JV.displayName=ZV;var Nu="ToggleGroup",[QV,eq]=po(Nu,[lp]),tq=lp(),ZM=qe.forwardRef((t,e)=>{const{type:n,...r}=t;if(n==="single"){const i=r;return y.jsx(Tbe,{...i,ref:e})}if(n==="multiple"){const i=r;return y.jsx(Ebe,{...i,ref:e})}throw new Error(`Missing prop \`type\` expected on \`${Nu}\``)});ZM.displayName=Nu;var[nq,rq]=QV(Nu),Tbe=qe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...s}=t,[o,a]=qo({prop:n,defaultProp:r??"",onChange:i,caller:Nu});return y.jsx(nq,{scope:t.__scopeToggleGroup,type:"single",value:qe.useMemo(()=>o?[o]:[],[o]),onItemActivate:a,onItemDeactivate:qe.useCallback(()=>a(""),[a]),children:y.jsx(iq,{...s,ref:e})})}),Ebe=qe.forwardRef((t,e)=>{const{value:n,defaultValue:r,onValueChange:i=()=>{},...s}=t,[o,a]=qo({prop:n,defaultProp:r??[],onChange:i,caller:Nu}),l=qe.useCallback(f=>a((h=[])=>[...h,f]),[a]),u=qe.useCallback(f=>a((h=[])=>h.filter(g=>g!==f)),[a]);return y.jsx(nq,{scope:t.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:l,onItemDeactivate:u,children:y.jsx(iq,{...s,ref:e})})});ZM.displayName=Nu;var[_be,Pbe]=QV(Nu),iq=qe.forwardRef((t,e)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:s,dir:o,loop:a=!0,...l}=t,u=tq(n),f=py(o),h={role:"group",dir:f,...l};return y.jsx(_be,{scope:n,rovingFocus:i,disabled:r,children:i?y.jsx(IM,{asChild:!0,...u,orientation:s,dir:f,loop:a,children:y.jsx(ht.div,{...h,ref:e})}):y.jsx(ht.div,{...h,ref:e})})}),Lv="ToggleGroupItem",sq=qe.forwardRef((t,e)=>{const n=rq(Lv,t.__scopeToggleGroup),r=Pbe(Lv,t.__scopeToggleGroup),i=tq(t.__scopeToggleGroup),s=n.value.includes(t.value),o=r.disabled||t.disabled,a={...t,pressed:s,disabled:o},l=qe.useRef(null);return r.rovingFocus?y.jsx(O0,{asChild:!0,...i,focusable:!o,active:s,ref:l,children:y.jsx(cz,{...a,ref:e})}):y.jsx(cz,{...a,ref:e})});sq.displayName=Lv;var cz=qe.forwardRef((t,e)=>{const{__scopeToggleGroup:n,value:r,...i}=t,s=rq(Lv,n),o={role:"radio","aria-checked":t.pressed,"aria-pressed":void 0},a=s.type==="single"?o:void 0;return y.jsx(JV,{...a,...i,ref:e,onPressedChange:l=>{l?s.onItemActivate(r):s.onItemDeactivate(r)}})}),Ibe=ZM,kbe=sq,JM="Toolbar",[Mbe]=po(JM,[lp,eq]),QM=lp(),oq=eq(),[Abe,aq]=Mbe(JM),lq=E.forwardRef((t,e)=>{const{__scopeToolbar:n,orientation:r="horizontal",dir:i,loop:s=!0,...o}=t,a=QM(n),l=py(i);return y.jsx(Abe,{scope:n,orientation:r,dir:l,children:y.jsx(IM,{asChild:!0,...a,orientation:r,dir:l,loop:s,children:y.jsx(ht.div,{role:"toolbar","aria-orientation":r,dir:l,...o,ref:e})})})});lq.displayName=JM;var cq="ToolbarSeparator",Obe=E.forwardRef((t,e)=>{const{__scopeToolbar:n,...r}=t,i=aq(cq,n);return y.jsx(LSe,{orientation:i.orientation==="horizontal"?"vertical":"horizontal",...r,ref:e})});Obe.displayName=cq;var Dbe="ToolbarButton",e2=E.forwardRef((t,e)=>{const{__scopeToolbar:n,...r}=t,i=QM(n);return y.jsx(O0,{asChild:!0,...i,focusable:!t.disabled,children:y.jsx(ht.button,{type:"button",...r,ref:e})})});e2.displayName=Dbe;var Rbe="ToolbarLink",jbe=E.forwardRef((t,e)=>{const{__scopeToolbar:n,...r}=t,i=QM(n);return y.jsx(O0,{asChild:!0,...i,focusable:!0,children:y.jsx(ht.a,{...r,ref:e,onKeyDown:Re(t.onKeyDown,s=>{s.key===" "&&s.currentTarget.click()})})})});jbe.displayName=Rbe;var uq="ToolbarToggleGroup",dq=E.forwardRef((t,e)=>{const{__scopeToolbar:n,...r}=t,i=aq(uq,n),s=oq(n);return y.jsx(Ibe,{"data-orientation":i.orientation,dir:i.dir,...s,...r,ref:e,rovingFocus:!1})});dq.displayName=uq;var Lbe="ToolbarToggleItem",hq=E.forwardRef((t,e)=>{const{__scopeToolbar:n,...r}=t,i=oq(n),s={__scopeToolbar:t.__scopeToolbar};return y.jsx(e2,{asChild:!0,...s,children:y.jsx(kbe,{...i,...r,ref:e})})});hq.displayName=Lbe;var Nbe=lq,zbe=e2,Bbe=dq,Fbe=hq,[F0]=po("Tooltip",[ap]),U0=ap(),fq="TooltipProvider",Ube=700,WP="tooltip.open",[Hbe,t2]=F0(fq),pq=t=>{const{__scopeTooltip:e,delayDuration:n=Ube,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=t,o=E.useRef(!0),a=E.useRef(!1),l=E.useRef(0);return E.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),y.jsx(Hbe,{scope:e,isOpenDelayedRef:o,delayDuration:n,onOpen:E.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:E.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:E.useCallback(u=>{a.current=u},[]),disableHoverableContent:i,children:s})};pq.displayName=fq;var Am="Tooltip",[$be,H0]=F0(Am),gq=t=>{const{__scopeTooltip:e,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=t,l=t2(Am,t.__scopeTooltip),u=U0(e),[f,h]=E.useState(null),g=Va(),m=E.useRef(0),b=o??l.disableHoverableContent,w=a??l.delayDuration,x=E.useRef(!1),[v,C]=qo({prop:r,defaultProp:i??!1,onChange:O=>{O?(l.onOpen(),document.dispatchEvent(new CustomEvent(WP))):l.onClose(),s?.(O)},caller:Am}),P=E.useMemo(()=>v?x.current?"delayed-open":"instant-open":"closed",[v]),k=E.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x.current=!1,C(!0)},[C]),M=E.useCallback(()=>{window.clearTimeout(m.current),m.current=0,C(!1)},[C]),A=E.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{x.current=!0,C(!0),m.current=0},w)},[w,C]);return E.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),y.jsx(M0,{...u,children:y.jsx($be,{scope:e,contentId:g,open:v,stateAttribute:P,trigger:f,onTriggerChange:h,onTriggerEnter:E.useCallback(()=>{l.isOpenDelayedRef.current?A():k()},[l.isOpenDelayedRef,A,k]),onTriggerLeave:E.useCallback(()=>{b?M():(window.clearTimeout(m.current),m.current=0)},[M,b]),onOpen:k,onClose:M,disableHoverableContent:b,children:n})})};gq.displayName=Am;var XP="TooltipTrigger",mq=E.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=H0(XP,n),s=t2(XP,n),o=U0(n),a=E.useRef(null),l=Zt(e,a,i.onTriggerChange),u=E.useRef(!1),f=E.useRef(!1),h=E.useCallback(()=>u.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),y.jsx(A0,{asChild:!0,...o,children:y.jsx(ht.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Re(t.onPointerMove,g=>{g.pointerType!=="touch"&&!f.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:Re(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:Re(t.onPointerDown,()=>{i.open&&i.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Re(t.onFocus,()=>{u.current||i.onOpen()}),onBlur:Re(t.onBlur,i.onClose),onClick:Re(t.onClick,i.onClose)})})});mq.displayName=XP;var Kbe="TooltipPortal",[dMe,Vbe]=F0(Kbe,{forceMount:void 0}),Hf="TooltipContent",yq=E.forwardRef((t,e)=>{const n=Vbe(Hf,t.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=t,o=H0(Hf,t.__scopeTooltip);return y.jsx(Go,{present:r||o.open,children:o.disableHoverableContent?y.jsx(Sq,{side:i,...s,ref:e}):y.jsx(qbe,{side:i,...s,ref:e})})}),qbe=E.forwardRef((t,e)=>{const n=H0(Hf,t.__scopeTooltip),r=t2(Hf,t.__scopeTooltip),i=E.useRef(null),s=Zt(e,i),[o,a]=E.useState(null),{trigger:l,onClose:u}=n,f=i.current,{onPointerInTransitChange:h}=r,g=E.useCallback(()=>{a(null),h(!1)},[h]),m=E.useCallback((b,w)=>{const x=b.currentTarget,v={x:b.clientX,y:b.clientY},C=Xbe(v,x.getBoundingClientRect()),P=Zbe(v,C),k=Jbe(w.getBoundingClientRect()),M=eve([...P,...k]);a(M),h(!0)},[h]);return E.useEffect(()=>()=>g(),[g]),E.useEffect(()=>{if(l&&f){const b=x=>m(x,f),w=x=>m(x,l);return l.addEventListener("pointerleave",b),f.addEventListener("pointerleave",w),()=>{l.removeEventListener("pointerleave",b),f.removeEventListener("pointerleave",w)}}},[l,f,m,g]),E.useEffect(()=>{if(o){const b=w=>{const x=w.target,v={x:w.clientX,y:w.clientY},C=l?.contains(x)||f?.contains(x),P=!Qbe(v,o);C?g():P&&(g(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,f,o,u,g]),y.jsx(Sq,{...t,ref:s})}),[Gbe,Ybe]=F0(Am,{isInside:!1}),Wbe=Bfe("TooltipContent"),Sq=E.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=t,l=H0(Hf,n),u=U0(n),{onClose:f}=l;return E.useEffect(()=>(document.addEventListener(WP,f),()=>document.removeEventListener(WP,f)),[f]),E.useEffect(()=>{if(l.trigger){const h=g=>{g.target?.contains(l.trigger)&&f()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,f]),y.jsx(ip,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:f,children:y.jsxs(_M,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[y.jsx(Wbe,{children:r}),y.jsx(Gbe,{scope:n,isInside:!0,children:y.jsx(qfe,{id:l.contentId,role:"tooltip",children:i||r})})]})})});yq.displayName=Hf;var bq="TooltipArrow",vq=E.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,i=U0(n);return Ybe(bq,n).isInside?null:y.jsx(PM,{...i,...r,ref:e})});vq.displayName=bq;function Xbe(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),i=Math.abs(e.right-t.x),s=Math.abs(e.left-t.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Zbe(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function Jbe(t){const{top:e,right:n,bottom:r,left:i}=t;return[{x:i,y:e},{x:n,y:e},{x:n,y:r},{x:i,y:r}]}function Qbe(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const a=e[s],l=e[o],u=a.x,f=a.y,h=l.x,g=l.y;f>r!=g>r&&n<(h-u)*(r-f)/(g-f)+u&&(i=!i)}return i}function eve(t){const e=t.slice();return e.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),tve(e)}function tve(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r<t.length;r++){const i=t[r];for(;e.length>=2;){const s=e[e.length-1],o=e[e.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const i=t[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var nve=pq,xq=gq,wq=mq,Cq=yq,Tq=vq;const Za=E.memo(function({label:e,small:n,invertIcon:r,icon:i,color:s,className:o,...a}){return typeof i=="string"?y.jsx(rve,{label:e,small:n,invertIcon:r,icon:i,color:s,className:o,...a}):E.cloneElement(i,{...a,className:Fe({"tlui-icon__small":n},o,i.props.className),"aria-label":e,style:{color:s,transform:r?"scale(-1, 1)":void 0,...i.props.style}})});function rve({label:t,small:e,invertIcon:n,icon:r,color:i,className:s,...o}){const a=lM(),l=a.icons[r]??a.icons["question-mark-circle"],u=E.useRef(null);return E.useLayoutEffect(()=>{l||console.error(`Icon not found: ${r}. Add it to the assetUrls.icons object.`),u?.current&&(u.current.style.webkitMask=`url(${l}) center 100% / 100% no-repeat`)},[u,l,r]),r==="none"?y.jsx("div",{className:Fe("tlui-icon tlui-icon__placeholder",{"tlui-icon__small":e},s),...o}):y.jsx("div",{...o,ref:u,"aria-label":t,role:"img",className:Fe("tlui-icon",{"tlui-icon__small":e},s),style:{color:i,mask:`url(${l}) center 100% / 100% no-repeat`,transform:n?"scale(-1, 1)":void 0}})}function Ze({icon:t,small:e,invertIcon:n}){return y.jsx(Za,{"aria-hidden":"true",label:"",className:"tlui-button__icon",icon:t,small:e,invertIcon:n})}function $0({className:t,children:e}){return y.jsx("div",{className:Fe("tlui-dialog__header",t),children:e})}function K0({className:t,children:e,style:n}){return y.jsx(xge,{dir:"ltr",className:Fe("tlui-dialog__header__title",t),style:n,children:e})}function V0(){const t=Ne();return y.jsx("div",{className:"tlui-dialog__header__close",children:y.jsx(E7,{"data-testid":"dialog.close",dir:"ltr",asChild:!0,children:y.jsx(gt,{type:"icon","aria-label":t("ui.close"),onTouchEnd:e=>e.target.click(),children:y.jsx(Ze,{small:!0,icon:"cross-2"})})})})}function Om({className:t,children:e,style:n}){return y.jsx("div",{className:Fe("tlui-dialog__body",t),style:n,tabIndex:0,children:e})}function n2({className:t,children:e}){return y.jsx("div",{className:Fe("tlui-dialog__footer",t),children:e})}const up=E.forwardRef(function({className:e,label:n,icon:r,iconLeft:i,iconLabel:s,autoSelect:o=!1,autoFocus:a=!1,defaultValue:l,placeholder:u,onComplete:f,onValueChange:h,onCancel:g,onFocus:m,onBlur:b,shouldManuallyMaintainScrollPositionWhenFocused:w=!1,children:x,value:v,"data-testid":C,disabled:P,"aria-label":k},M){const A=Gn(),O=E.useRef(null);E.useImperativeHandle(M,()=>O.current);const R=Ne(),F=E.useRef(l??""),N=E.useRef(l??""),j=E.useRef(!1),[H,V]=E.useState(!1),z=E.useCallback(de=>{V(!0);const U=de.currentTarget;N.current=U.value,A?A.timers.requestAnimationFrame(()=>{o&&U.select()}):fv.requestAnimationFrame("anon",()=>{o&&U.select()}),m?.()},[o,A,m]),K=E.useCallback(de=>{const U=de.currentTarget.value;N.current=U,h?.(U)},[h]),B=E.useCallback(de=>{switch(de.key){case"Enter":{if(j.current)return;de.currentTarget.blur(),de.stopPropagation(),f?.(de.currentTarget.value);break}case"Escape":{de.currentTarget.value=F.current,g?.(de.currentTarget.value),de.currentTarget.blur(),de.stopPropagation();break}}},[f,g]),G=E.useCallback(de=>{V(!1);const U=de.currentTarget.value;b?.(U)},[b]),W=E.useCallback(()=>j.current=!0,[]),Z=E.useCallback(()=>j.current=!1,[]);return E.useEffect(()=>{if(!Lt.isIos)return;const de=window.visualViewport;if(H&&w&&de){const U=()=>{O.current?.scrollIntoView({block:"center"})};return de.addEventListener("resize",U),de.addEventListener("scroll",U),A?A.timers.requestAnimationFrame(()=>{O.current?.scrollIntoView({block:"center"})}):fv.requestAnimationFrame("anon",()=>{O.current?.scrollIntoView({block:"center"})}),()=>{de.removeEventListener("resize",U),de.removeEventListener("scroll",U)}}},[H,A,w]),y.jsxs("div",{draggable:!1,className:"tlui-input__wrapper",children:[x,n&&y.jsx("label",{children:R(n)}),i&&y.jsx(Za,{label:s?R(s):"",icon:i,className:"tlui-icon-left",small:!0}),y.jsx("input",{ref:O,className:Fe("tlui-input",e),type:"text",defaultValue:l,onKeyDownCapture:B,onChange:K,onFocus:z,onBlur:G,onCompositionStart:W,onCompositionEnd:Z,autoFocus:a,"aria-label":k,placeholder:u,value:v,"data-testid":C,disabled:P}),r&&y.jsx(Za,{label:s?R(s):"",icon:r,small:!!n})]})});function uz(t){return lo.isValid(t)?{isValid:!0,hasProtocol:!0}:lo.isValid("https://"+t)?{isValid:!0,hasProtocol:!1}:{isValid:!1,hasProtocol:!1}}const ive=cr(function({onClose:e}){const r=te().getOnlySelectedShape();return r&&"url"in r.props&&typeof r.props.url=="string"?y.jsx(sve,{onClose:e,selectedShape:r}):null}),sve=cr(function({onClose:e,selectedShape:n}){const r=te(),i=Ne(),s=E.useRef(null);E.useEffect(()=>{r.timers.requestAnimationFrame(()=>s.current?.focus())},[r]);const o=E.useRef(n.props.url),[a,l]=E.useState(()=>{const b=uz(n.props.url),w=b.isValid===!0?b.hasProtocol?n.props.url:"https://"+n.props.url:"https://";return{actual:w,safe:w,valid:!0}}),u=E.useCallback(b=>{const w=b.replace(/https?:\/\/(https?:\/\/)/,(C,P)=>P),x=uz(w),v=x.isValid===!0?x.hasProtocol?w:"https://"+w:"https://";l({actual:w,safe:v,valid:x.isValid})},[]),f=E.useCallback(()=>{const b=r.getOnlySelectedShape();b&&(r.updateShapes([{id:b.id,type:b.type,props:{url:""}}]),e())},[r,e]),h=E.useCallback(()=>{const b=r.getOnlySelectedShape();b&&(b&&"url"in b.props&&b.props.url!==a.safe&&r.updateShapes([{id:b.id,type:b.type,props:{url:a.safe}}]),e())},[r,e,a]),g=E.useCallback(()=>{e()},[e]);if(!n)return e(),null;const m=o.current&&!a.valid;return y.jsxs(y.Fragment,{children:[y.jsxs($0,{children:[y.jsx(K0,{children:i("edit-link-dialog.title")}),y.jsx(V0,{})]}),y.jsx(Om,{children:y.jsxs("div",{className:"tlui-edit-link-dialog",children:[y.jsx(up,{ref:s,className:"tlui-edit-link-dialog__input",label:"edit-link-dialog.url",autoFocus:!0,autoSelect:!0,placeholder:"https://example.com",value:a.actual,onValueChange:u,onComplete:h,onCancel:g}),y.jsx("div",{children:a.valid?i("edit-link-dialog.detail"):i("edit-link-dialog.invalid-url")})]})}),y.jsxs(n2,{className:"tlui-dialog__footer__actions",children:[y.jsx(gt,{type:"normal",onClick:g,onTouchEnd:g,children:y.jsx(sr,{children:i("edit-link-dialog.cancel")})}),m?y.jsx(gt,{type:"danger",onTouchEnd:f,onClick:f,children:y.jsx(sr,{children:i("edit-link-dialog.clear")})}):y.jsx(gt,{type:"primary",disabled:!a.valid,onTouchEnd:h,onClick:h,children:y.jsx(sr,{children:i("edit-link-dialog.save")})})]})]})});var ove={};const dz=/(^\/[f|p|r|ro|s|v]\/[^/]+\/?$)/,r2=[{type:"tldraw",title:"tldraw",hostnames:["beta.tldraw.com","tldraw.com","localhost:3000"],minWidth:300,minHeight:300,width:720,height:500,doesResize:!0,overridePermissions:{"allow-top-navigation":!0},toEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(dz))return e.searchParams.append("embed","true"),t},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(dz))return e.searchParams.delete("embed"),t},embedOnPaste:!1},{type:"figma",title:"Figma",hostnames:["figma.com"],width:720,height:500,doesResize:!0,toEmbedUrl:t=>{if(t.match(/https:\/\/([\w\.-]+\.)?figma.com\/(file|proto|design)\/([0-9a-zA-Z]{22,128})(?:\/.*)?$/)&&!t.includes("figma.com/embed"))return`https://www.figma.com/embed?embed_host=share&url=${t}`},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/^\/embed\/?$/)){const n=e.searchParams.get("url");if(n)return n}},embedOnPaste:!0},{type:"google_maps",title:"Google Maps",hostnames:["google.*"],width:720,height:500,doesResize:!0,overridePermissions:{"allow-presentation":!0},toEmbedUrl:t=>{if(t.includes("/maps/embed?"))return t;if(t.includes("/maps/")){const e=t.match(/@(.*?),(.*?),(.*?)(z|m)/);let n;if(e){const[,r,i,s,o]=e,a=o==="z"?"roadmap":"satellite",l=a==="roadmap"?s:-Math.log2(parseInt(s)/14772321)/.8;n=`https://${new URL(t).host.replace("www.","")}/maps/embed/v1/view?key=${ove.NEXT_PUBLIC_GC_API_KEY}&center=${r},${i}&zoom=${l}&maptype=${a}`}else n="";return n}},fromEmbedUrl:t=>{const e=ot(t);if(!e)return;if(e.pathname.match(/^\/maps\/embed\/v1\/view\/?$/)&&e.searchParams.has("center")&&e.searchParams.get("zoom")){const r=e.searchParams.get("zoom")??"12",i=e.searchParams.get("maptype")??"roadmap",s=i==="roadmap"?r:14772321*Math.pow(2,parseInt(r)*-.8),[o,a]=e.searchParams.get("center").split(",");return`https://www.google.com/maps/@${o},${a},${s}${i==="roadmap"?"z":"m"}`}},embedOnPaste:!0},{type:"val_town",title:"Val Town",hostnames:["val.town"],minWidth:260,minHeight:100,width:720,height:500,doesResize:!0,toEmbedUrl:t=>{const e=ot(t),n=e&&e.pathname.match(/\/v\/(.+)\/?/);if(n)return`https://www.val.town/embed/${n[1]}`},fromEmbedUrl:t=>{const e=ot(t),n=e&&e.pathname.match(/\/embed\/(.+)\/?/);if(n)return`https://www.val.town/v/${n[1]}`},embedOnPaste:!0},{type:"codesandbox",title:"CodeSandbox",hostnames:["codesandbox.io"],minWidth:300,minHeight:300,width:720,height:500,doesResize:!0,toEmbedUrl:t=>{const e=ot(t),n=e&&e.pathname.match(/\/s\/([^/]+)\/?/);if(n)return`https://codesandbox.io/embed/${n[1]}`},fromEmbedUrl:t=>{const e=ot(t),n=e&&e.pathname.match(/\/embed\/([^/]+)\/?/);if(n)return`https://codesandbox.io/s/${n[1]}`},embedOnPaste:!0},{type:"codepen",title:"Codepen",hostnames:["codepen.io"],minWidth:300,minHeight:300,width:520,height:400,doesResize:!0,toEmbedUrl:t=>{const e=/https:\/\/codepen.io\/([^/]+)\/pen\/([^/]+)/,n=t.match(e);if(n){const[r,i,s]=n;return`https://codepen.io/${i}/embed/${s}`}},fromEmbedUrl:t=>{const e=/https:\/\/codepen.io\/([^/]+)\/embed\/([^/]+)/,n=t.match(e);if(n){const[r,i,s]=n;return`https://codepen.io/${i}/pen/${s}`}},embedOnPaste:!0},{type:"scratch",title:"Scratch",hostnames:["scratch.mit.edu"],width:520,height:400,doesResize:!1,embedOnPaste:!0,toEmbedUrl:t=>{const e=/https?:\/\/scratch.mit.edu\/projects\/([^/]+)/,n=t.match(e);if(n){const[r,i]=n;return`https://scratch.mit.edu/projects/embed/${i}`}},fromEmbedUrl:t=>{const e=/https:\/\/scratch.mit.edu\/projects\/embed\/([^/]+)/,n=t.match(e);if(n){const[r,i]=n;return`https://scratch.mit.edu/projects/${i}`}}},{type:"youtube",title:"YouTube",hostnames:["*.youtube.com","youtube.com","youtu.be"],width:800,height:450,doesResize:!0,overridePermissions:{"allow-presentation":!0,"allow-popups-to-escape-sandbox":!0},isAspectRatioLocked:!0,embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(!e)return;const n=e.hostname.replace(/^www./,"");if(n==="youtu.be"){const r=e.pathname.split("/").filter(Boolean)[0],i=new URLSearchParams(e.search),s=i.get("t");s&&(i.set("start",s),i.delete("t"));const o=i.toString()?"?"+i.toString():"";return`https://www.youtube.com/embed/${r}${o}`}else if((n==="youtube.com"||n==="m.youtube.com")&&e.pathname.match(/^\/watch/)){const r=e.searchParams.get("v"),i=new URLSearchParams(e.search);i.delete("v");const s=i.get("t");s&&(i.set("start",s),i.delete("t"));const o=i.toString()?"?"+i.toString():"";return`https://www.youtube.com/embed/${r}${o}`}},fromEmbedUrl:t=>{const e=ot(t);if(!e)return;if(e.hostname.replace(/^www./,"")==="youtube.com"){const r=e.pathname.match(/^\/embed\/([^/]+)\/?/);if(r){const i=new URLSearchParams(e.search);i.set("v",r?.[1]??"");const s=i.get("start");return s&&(i.set("t",s),i.delete("start")),`https://www.youtube.com/watch?${i.toString()}`}}}},{type:"google_calendar",title:"Google Calendar",hostnames:["calendar.google.*"],width:720,height:500,minWidth:460,minHeight:360,doesResize:!0,instructionLink:"https://support.google.com/calendar/answer/41207?hl=en",overridePermissions:{"allow-popups-to-escape-sandbox":!0},embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t),n=e?.searchParams.get("cid");if(e?.pathname.match(/\/calendar\/u\/0/)&&n){e.pathname="/calendar/embed";const r=Array.from(e.searchParams.keys());for(const i of r)e.searchParams.delete(i);return e.searchParams.set("src",n),e.href}},fromEmbedUrl:t=>{const e=ot(t),n=e?.searchParams.get("src");if(e?.pathname.match(/\/calendar\/embed/)&&n){e.pathname="/calendar/u/0";const r=Array.from(e.searchParams.keys());for(const i of r)e.searchParams.delete(i);return e.searchParams.set("cid",n),e.href}}},{type:"google_slides",title:"Google Slides",hostnames:["docs.google.*"],width:720,height:500,minWidth:460,minHeight:360,doesResize:!0,overridePermissions:{"allow-popups-to-escape-sandbox":!0},embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e?.pathname.match(/^\/presentation/)&&e?.pathname.match(/\/pub\/?$/)){e.pathname=e.pathname.replace(/\/pub$/,"/embed");const n=Array.from(e.searchParams.keys());for(const r of n)e.searchParams.delete(r);return e.href}},fromEmbedUrl:t=>{const e=ot(t);if(e?.pathname.match(/^\/presentation/)&&e?.pathname.match(/\/embed\/?$/)){e.pathname=e.pathname.replace(/\/embed$/,"/pub");const n=Array.from(e.searchParams.keys());for(const r of n)e.searchParams.delete(r);return e.href}}},{type:"github_gist",title:"GitHub Gist",hostnames:["gist.github.com"],width:720,height:500,doesResize:!0,embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/\/([^/]+)\/([0-9a-f]+)$/))return t.split("/").pop()?t:void 0},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/\/([^/]+)\/([0-9a-f]+)$/))return t.split("/").pop()?t:void 0}},{type:"replit",title:"Replit",hostnames:["replit.com"],width:720,height:500,doesResize:!0,embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/\/@([^/]+)\/([^/]+)/))return e.searchParams.append("embed","true"),e.href},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/\/@([^/]+)\/([^/]+)/)&&e.searchParams.has("embed"))return e.searchParams.delete("embed"),e.href}},{type:"felt",title:"Felt",hostnames:["felt.com"],width:720,height:500,doesResize:!0,embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/^\/map\//))return e.origin+"/embed"+e.pathname},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/^\/embed\/map\//))return e.pathname=e.pathname.replace(/^\/embed/,""),e.href}},{type:"spotify",title:"Spotify",hostnames:["open.spotify.com"],width:720,height:500,minHeight:500,overrideOutlineRadius:12,doesResize:!0,embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/^\/(artist|album)\//))return e.origin+"/embed"+e.pathname},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/^\/embed\/(artist|album)\//))return e.origin+e.pathname.replace(/^\/embed/,"")}},{type:"vimeo",title:"Vimeo",hostnames:["vimeo.com","player.vimeo.com"],width:640,height:360,doesResize:!0,isAspectRatioLocked:!0,embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e&&e.hostname==="vimeo.com"&&e.pathname.match(/^\/[0-9]+/))return"https://player.vimeo.com/video/"+e.pathname.split("/")[1]+"?title=0&byline=0"},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.hostname==="player.vimeo.com"){const n=e.pathname.match(/^\/video\/([^/]+)\/?$/);if(n)return"https://vimeo.com/"+n[1]}}},{type:"observable",title:"Observable",hostnames:["observablehq.com"],width:720,height:500,doesResize:!0,isAspectRatioLocked:!1,backgroundColor:"#fff",embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/^\/@([^/]+)\/([^/]+)\/?$/))return`${e.origin}/embed${e.pathname}?cell=*`;if(e&&e.pathname.match(/^\/d\/([^/]+)\/?$/)){const n=e.pathname.replace(/^\/d/,"");return`${e.origin}/embed${n}?cell=*`}},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.pathname.match(/^\/embed\/@([^/]+)\/([^/]+)\/?$/))return`${e.origin}${e.pathname.replace("/embed","")}#cell-*`;if(e&&e.pathname.match(/^\/embed\/([^/]+)\/?$/))return`${e.origin}${e.pathname.replace("/embed","/d")}#cell-*`}},{type:"desmos",title:"Desmos",hostnames:["desmos.com"],width:700,height:450,doesResize:!0,embedOnPaste:!0,toEmbedUrl:t=>{const e=ot(t);if(e&&e.hostname==="www.desmos.com"&&e.pathname.match(/^\/calculator\/([^/]+)\/?$/)&&e.search===""&&e.hash==="")return`${t}?embed`},fromEmbedUrl:t=>{const e=ot(t);if(e&&e.hostname==="www.desmos.com"&&e.pathname.match(/^\/calculator\/([^/]+)\/?$/)&&e.search==="?embed"&&e.hash==="")return t.replace("?embed","")}}],ave={"allow-downloads-without-user-activation":!1,"allow-downloads":!1,"allow-modals":!1,"allow-orientation-lock":!1,"allow-pointer-lock":!1,"allow-popups":!0,"allow-popups-to-escape-sandbox":!1,"allow-presentation":!1,"allow-storage-access-by-user-activation":!1,"allow-top-navigation":!1,"allow-top-navigation-by-user-activation":!1,"allow-scripts":!0,"allow-same-origin":!0,"allow-forms":!0},lve=r2.map(t=>t.type);function cve(t){return lve.includes(t)}function uve(t){return"icon"in t}function Eq(){const t=Gn();if(t&&t.hasShapeUtil("embed"))return t.getShapeUtil("embed")}function i2(){const t=Eq();return e=>t?t.getEmbedDefinition(e):void 0}function dve(){const t=Eq();return t?t.getEmbedDefinitions():[]}const _q=cr(function({onClose:e}){const n=te(),r=Ne(),i=lM(),[s,o]=E.useState(null),[a,l]=E.useState(""),[u,f]=E.useState(null),[h,g]=E.useState(!1),m=E.useRef(-1),b=dve(),w=i2();return y.jsxs(y.Fragment,{children:[y.jsxs($0,{children:[y.jsx(K0,{children:s?`${r("embed-dialog.title")} — ${s.title}`:r("embed-dialog.title")}),y.jsx(V0,{})]}),s?y.jsxs(y.Fragment,{children:[y.jsxs(Om,{className:"tlui-embed-dialog__enter",children:[y.jsx(up,{className:"tlui-embed-dialog__input",label:"embed-dialog.url",placeholder:"https://example.com",autoFocus:!0,onValueChange:x=>{l(x);const v=w(x);f(v&&v.definition.type===s.type?v:null),g(!1),clearTimeout(m.current),m.current=n.timers.setTimeout(()=>g(!v),320)}}),a===""?y.jsxs("div",{className:"tlui-embed-dialog__instruction",children:[y.jsx("span",{children:r("embed-dialog.instruction")})," ",s.instructionLink&&y.jsxs(y.Fragment,{children:[y.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:s.instructionLink,className:"tlui-embed-dialog__instruction__link",children:"Learn more"}),"."]})]}):y.jsx("div",{className:"tlui-embed-dialog__warning",children:h?r("embed-dialog.invalid-url"):" "})]}),y.jsxs(n2,{className:"tlui-dialog__footer__actions",children:[y.jsx(gt,{type:"normal",onClick:()=>{o(null),f(null),l("")},children:y.jsx(sr,{children:r("embed-dialog.back")})}),y.jsx("div",{className:"tlui-embed__spacer"}),y.jsx(gt,{type:"normal",onClick:e,children:y.jsx(sr,{children:r("embed-dialog.cancel")})}),y.jsx(gt,{type:"primary",disabled:!u,onClick:()=>{u&&(n.putExternalContent({type:"embed",url:a,point:n.getViewportPageBounds().center,embed:u.definition}),e())},children:y.jsx(sr,{children:r("embed-dialog.create")})})]})]}):y.jsx(y.Fragment,{children:y.jsx(Om,{className:"tlui-embed-dialog__list",children:b.map(x=>{const v=cve(x.type)?i.embedIcons[x.type]:uve(x)?x.icon:void 0;return y.jsxs(gt,{type:"menu",onClick:()=>o(x),children:[y.jsx(sr,{children:x.title}),v&&y.jsx("div",{className:"tlui-embed-dialog__item__image",style:{backgroundImage:`url(${v})`}})]},x.type)})})})]})}),Hb=[0,389,436,476,580,640,840,1023];var kn=(t=>(t[t.ZERO=0]="ZERO",t[t.MOBILE_XXS=1]="MOBILE_XXS",t[t.MOBILE_XS=2]="MOBILE_XS",t[t.MOBILE_SM=3]="MOBILE_SM",t[t.MOBILE=4]="MOBILE",t[t.TABLET_SM=5]="TABLET_SM",t[t.TABLET=6]="TABLET",t[t.DESKTOP=7]="DESKTOP",t))(kn||{});const Pq=qe.createContext(null);function hve({forceMobile:t=!1,children:e}){const n=Gn(),r=ee("breakpoint",()=>{const{width:i}=n?.getViewportScreenBounds()??{width:window.innerWidth},s=t?kn.MOBILE_SM:Hb.length-1;for(let o=0;o<s;o++)if(i>Hb[o]&&i<=Hb[o+1])return o;return s},[n]);return y.jsx(Pq.Provider,{value:r,children:e})}function qr(){const t=E.useContext(Pq);if(t===null)throw new Error("useBreakpoint must be used inside of the <BreakpointProvider /> component");return t}const Iq=E.createContext(null);function q0(){const t=E.useContext(Iq);if(!t)throw new Error("useTldrawUiMenuContext must be used within a TldrawUiMenuContextProvider");return t}function is({type:t,sourceId:e,children:n}){return y.jsx(Iq.Provider,{value:{type:t,sourceId:e},children:n})}function G0(){return Gn()?.store.props.collaboration!==void 0}function fve(){const t=Gn();return ee("sync status",()=>t?.store.props.collaboration?.status?t.store.props.collaboration.status.get():null,[t])}function go(){const t=Gn();return ee("isReadonlyMode",()=>!!t?.getIsReadonly(),[t])}const hz=Lt.isDarwin?"⌘":"__CTRL__",pve=Lt.isDarwin?"⌃":"__CTRL__",fz=Lt.isDarwin?"⌥":"__ALT__";function kq(t){return t===","?[","]:t.split(",")[0].split(/(\[\[[^\]]+\]\])/g).map(e=>e.startsWith("[[")?e.replace(/[[\]]/g,""):e.replace(/cmd\+/g,hz).replace(/ctrl\+/g,pve).replace(/alt\+/g,fz).replace(/shift\+/g,"⇧").replace(/\$/g,hz).replace(/\?/g,fz).replace(/!/g,"⇧").match(/__CTRL__|__ALT__|./g)||[]).flat().map((e,n)=>{if(e[0]==="+")return[];let r;return e==="__CTRL__"?r="Ctrl":e==="__ALT__"?r="Alt":r=e[0].toUpperCase()+e.slice(1),Lt.isDarwin||!n?r:["+",r]}).flat()}function Nv(t){return"— "+kq(t).join(" ")}function Mq(t){const e=Ne();return y.jsx(EH,{"aria-label":e("app.loading"),...t})}const Aq=()=>{},Oq=E.createContext(null);function gve({onEvent:t,children:e}){return y.jsx(Oq.Provider,{value:t??Aq,children:e})}function Mn(){return E.useContext(Oq)??Aq}function nc(t,e){const n=Gn(),r=E.useCallback(o=>{o&&n?.complete(),e?.(o)},[n,e]),i=Mn(),s=E.useCallback(o=>{i(o,{source:"unknown",id:t})},[t,i]);return Sle(n?`${t}-${n.contextId}`:t,r,s)}function Y0({id:t,children:e,modal:n=!1,debugOpen:r=!1}){const[i,s]=nc(t);return y.jsx(BM,{open:r||i,dir:"ltr",modal:n,onOpenChange:s,children:e})}function W0({children:t,...e}){return y.jsx(FM,{dir:"ltr",asChild:!0,onTouchEnd:n=>nt(n),...e,children:t})}function X0({className:t,side:e="bottom",align:n="start",sideOffset:r=8,alignOffset:i=8,children:s}){const o=ur();return y.jsx(L0,{container:o,children:y.jsx(UM,{className:Fe("tlui-menu",t),side:e,sideOffset:r,align:n,alignOffset:i,collisionPadding:4,children:s})})}function mve({id:t,children:e}){const[n,r]=nc(t);return y.jsx(vSe,{open:n,onOpenChange:r,children:e})}function yve({id:t,label:e,title:n,disabled:r}){return y.jsx(xSe,{dir:"ltr",asChild:!0,disabled:r,children:y.jsxs(gt,{"data-testid":t,type:"menu",className:"tlui-menu__submenu__trigger",disabled:r,title:n,children:[y.jsx(sr,{children:e}),y.jsx(Ze,{icon:"chevron-right",small:!0})]})})}function Sve({id:t,alignOffset:e=-1,sideOffset:n=-6,size:r="small",children:i}){const s=ur();return y.jsx(L0,{container:s,children:y.jsx(wSe,{"data-testid":t,className:"tlui-menu tlui-menu__submenu__content",alignOffset:e,sideOffset:n,collisionPadding:4,"data-size":r,children:i})})}function bve({className:t,children:e}){return y.jsx("div",{dir:"ltr",className:Fe("tlui-menu__group",t),children:e})}function vve({noClose:t,children:e}){return y.jsx(SSe,{dir:"ltr",asChild:!0,onClick:t?nt:void 0,children:e})}function xve({children:t,onSelect:e,...n}){const r=Ne();return y.jsxs(dV,{dir:"ltr",className:"tlui-button tlui-button__menu tlui-button__checkbox",onSelect:i=>{e?.(i),nt(i)},...n,children:[y.jsx("div",{className:"tlui-button__checkbox__indicator",children:y.jsx(bSe,{dir:"ltr",children:y.jsx(Za,{label:r("ui.checked"),icon:"check",small:!0})})}),t]})}function Zg({children:t,visibleOnMobileLayout:e=!1}){const n=qr();return!e&&n<kn.MOBILE?null:y.jsx("kbd",{className:"tlui-kbd",children:kq(t).map((r,i)=>y.jsx("span",{children:r},i))})}const Dq=E.createContext({orientation:"horizontal",tooltipSide:"bottom"});function Z0({children:t,orientation:e,tooltipSide:n}){const r=Cy(),i=n??(e===r.orientation?r.tooltipSide:e==="horizontal"?"bottom":"right");return y.jsx(Dq.Provider,{value:{orientation:e,tooltipSide:i},children:t})}function Cy(){return E.useContext(Dq)}const Xd=E.forwardRef(({asChild:t,className:e,tooltipSide:n,...r},i)=>{const s=t?dM:"div";return y.jsx(Z0,{orientation:"horizontal",tooltipSide:n,children:y.jsx(s,{ref:i,className:Fe("tlui-row",e),...r})})}),s2=E.forwardRef(({asChild:t,className:e,tooltipSide:n,...r},i)=>{const s=t?dM:"div";return y.jsx(Z0,{orientation:"vertical",tooltipSide:n,children:y.jsx(s,{ref:i,className:Fe("tlui-column",e),...r})})}),J0=E.forwardRef(({asChild:t,className:e,tooltipSide:n,...r},i)=>{const s=t?dM:"div";return y.jsx(Z0,{orientation:"horizontal",tooltipSide:n,children:y.jsx(s,{ref:i,className:Fe("tlui-grid",e),...r})})}),wve=700;class pf{static instance=null;currentTooltip=bn("current tooltip",null);destroyTimeoutId=null;static getInstance(){return pf.instance||(pf.instance=new pf),pf.instance}showTooltip(e,n,r,i,s,o,a){this.destroyTimeoutId&&(clearTimeout(this.destroyTimeoutId),this.destroyTimeoutId=null),this.currentTooltip.set({id:e,content:n,side:i,sideOffset:s,showOnMobile:o,targetElement:r,delayDuration:a})}updateCurrentTooltip(e,n){this.currentTooltip.update(r=>r?.id===e?n(r):r)}hideTooltip(e,n,r=!1){const i=()=>{this.currentTooltip.get()?.id===n&&(this.currentTooltip.set(null),this.destroyTimeoutId=null)};e&&!r?this.destroyTimeoutId=e.timers.setTimeout(i,300):i()}hideAllTooltips(){this.currentTooltip.set(null),this.destroyTimeoutId=null}getCurrentTooltipData(){const e=this.currentTooltip.get();return!e||!this.supportsHover()&&!e.showOnMobile?null:e}supportsHoverAtom=null;supportsHover(){if(!this.supportsHoverAtom){const e=window.matchMedia("(hover: hover)"),n=bn("has hover",e.matches);this.supportsHoverAtom=n,e.addEventListener("change",r=>{n.set(r.matches)})}return this.supportsHoverAtom.get()}}const Lo=pf.getInstance(),Rq=E.createContext(!1);function Cve({children:t}){return y.jsx(nve,{skipDelayDuration:700,children:y.jsxs(Rq.Provider,{value:!0,children:[t,y.jsx(Tve,{})]})})}function Tve(){const[t,e]=E.useState(!1),n=E.useRef(null),r=E.useRef(!0),i=Gn(),s=ee("current tooltip",()=>Lo.getCurrentTooltipData(),[]),o=ee("camera state",()=>i?.getCameraState(),[i]);return E.useEffect(()=>{o==="moving"&&t&&s&&Lo.hideTooltip(i,s.id,!0)},[o,t,s,i]),E.useEffect(()=>{function a(l){l.key==="Escape"&&s&&t&&(Lo.hideTooltip(i,s.id),l.stopPropagation())}return document.addEventListener("keydown",a,{capture:!0}),()=>{document.removeEventListener("keydown",a,{capture:!0})}},[i,s,t]),E.useEffect(()=>{let a=null;if(s&&n.current){const l=s.targetElement.getBoundingClientRect(),u=n.current;u.style.position="fixed",u.style.left=`${l.left}px`,u.style.top=`${l.top}px`,u.style.width=`${l.width}px`,u.style.height=`${l.height}px`,u.style.pointerEvents="none",u.style.zIndex="9999",r.current?a=setTimeout(()=>{e(!0),r.current=!1},s.delayDuration):e(!0)}else e(!1),r.current=!0;return()=>{a!==null&&clearTimeout(a)}},[s]),s?y.jsxs(xq,{open:t,delayDuration:0,children:[y.jsx(wq,{asChild:!0,children:y.jsx("div",{ref:n})}),y.jsxs(Cq,{className:"tlui-tooltip",side:s.side,sideOffset:s.sideOffset,avoidCollisions:!0,collisionPadding:8,dir:"ltr",children:[s.content,y.jsx(Tq,{className:"tlui-tooltip__arrow"})]})]}):null}const Q0=E.forwardRef(({children:t,content:e,side:n,sideOffset:r=5,disabled:i=!1,showOnMobile:s=!1,delayDuration:o},a)=>{const l=Gn(),u=E.useRef(Nt()),f=E.useContext(Rq),h=ee("enhancedA11yMode",()=>l?.user.getEnhancedA11yMode(),[l]),g=Cy(),m=n??g.tooltipSide;if(E.useEffect(()=>{const M=u.current;return()=>{f&&Lo.hideTooltip(l,M,!0)}},[l,f]),E.useLayoutEffect(()=>{f&&Lo.getCurrentTooltipData()?.id===u.current&&Lo.updateCurrentTooltip(u.current,M=>({...M,content:e,side:m,sideOffset:r,showOnMobile:s}))},[e,m,r,s,f]),i||!e)return y.jsx(y.Fragment,{children:t});let b;if(h?b=0:b=o??(l?.options.tooltipDelayMs||wve),!f||h)return y.jsxs(xq,{delayDuration:b,disableHoverableContent:!h,children:[y.jsx(wq,{asChild:!0,ref:a,children:t}),y.jsxs(Cq,{className:"tlui-tooltip",side:m,sideOffset:r,avoidCollisions:!0,collisionPadding:8,dir:"ltr",children:[e,y.jsx(Tq,{className:"tlui-tooltip__arrow"})]})]});const w=qe.Children.only(t);Be(qe.isValidElement(w),"TldrawUiTooltip children must be a single element");const x=M=>{w.props.onMouseEnter?.(M),Lo.showTooltip(u.current,e,M.currentTarget,m,r,s,b)},v=M=>{w.props.onMouseLeave?.(M),Lo.hideTooltip(l,u.current)},C=M=>{w.props.onFocus?.(M),Lo.showTooltip(u.current,e,M.currentTarget,m,r,s,b)},P=M=>{w.props.onBlur?.(M),Lo.hideTooltip(l,u.current)};return qe.cloneElement(t,{onMouseEnter:x,onMouseLeave:v,onFocus:C,onBlur:P})}),Eve={horizontal:Xd,vertical:s2,grid:J0},ss=qe.forwardRef(({children:t,className:e,label:n,orientation:r="horizontal",tooltipSide:i,...s},o)=>{const a=Eve[r];return y.jsx(a,{asChild:!0,tooltipSide:i,children:y.jsx(Nbe,{ref:o,...s,className:Fe("tlui-toolbar",e),"aria-label":n,orientation:r==="grid"?"horizontal":r,children:t})})}),un=qe.forwardRef(({asChild:t,children:e,type:n,isActive:r,tooltip:i,...s},o)=>{const a=y.jsx(zbe,{ref:o,asChild:t,draggable:!1,"data-isactive":r,...s,"aria-label":s.title,title:void 0,className:Fe("tlui-button",`tlui-button__${n}`,s.className),children:e}),l=i||s.title;return y.jsx(Q0,{content:l,children:a})}),_ve=({children:t,className:e,type:n,asChild:r,...i})=>y.jsx(Bbe,{asChild:r,type:n,...i,role:"radiogroup",className:Fe("tlui-toolbar-toggle-group",e),children:t}),Pve=({children:t,className:e,type:n,value:r,tooltip:i,...s})=>{const o=y.jsx(Fbe,{...s,title:void 0,className:Fe("tlui-button",`tlui-button__${n}`,"tlui-toolbar-toggle-group-item",e),value:r,children:t}),a=i||s.title;return y.jsx(Q0,{content:a,children:o})};function xt({disabled:t=!1,spinner:e=!1,readonlyOk:n=!1,id:r,kbd:i,label:s,icon:o,iconLeft:a,onSelect:l,noClose:u,isSelected:f,onDragStart:h}){const{type:g,sourceId:m}=q0(),b=Ne(),[w,x]=E.useState(!1);if(go()&&!n)return null;const C=Nm(s,g),P=i?Nv(i):void 0,k=C?b(C):void 0,M=k&&P?`${k} ${P}`:k;switch(g){case"menu":return y.jsx(vve,{children:y.jsxs(gt,{type:"menu","data-testid":`${m}.${r}`,disabled:t,onClick:A=>{u&&nt(A),w?x(!1):l(m)},children:[a&&y.jsx(Ze,{icon:a,small:!0}),y.jsx(sr,{children:k}),i&&y.jsx(Zg,{children:i})]})});case"context-menu":return t?null:y.jsxs(Wye,{dir:"ltr",draggable:!1,className:"tlui-button tlui-button__menu","data-testid":`${m}.${r}`,onSelect:A=>{u&&nt(A),w?x(!1):l(m)},children:[y.jsx("span",{className:"tlui-button__label",draggable:!1,children:k}),a&&y.jsx(Ze,{icon:a,small:!0}),i&&y.jsx(Zg,{children:i}),e&&y.jsx(Mq,{})]});case"small-icons":case"icons":return y.jsx(un,{"data-testid":`${m}.${r}`,type:"icon",title:M,disabled:t,onClick:()=>l(m),children:y.jsx(Ze,{icon:o,small:!0})});case"keyboard-shortcuts":return i?y.jsxs("div",{className:"tlui-shortcuts-dialog__key-pair","data-testid":`${m}.${r}`,children:[y.jsx("div",{className:"tlui-shortcuts-dialog__key-pair__key",children:k}),y.jsx("div",{className:"tlui-shortcuts-dialog__key-pair__value",children:y.jsx(Zg,{visibleOnMobileLayout:!0,children:i})})]}):(console.warn(`Menu item '${s}' isn't shown in the keyboard shortcuts dialog because it doesn't have a keyboard shortcut.`),null);case"helper-buttons":return y.jsxs(gt,{type:"low",onClick:()=>l(m),children:[y.jsx(Ze,{icon:o}),y.jsx(sr,{children:k})]});case"toolbar":return h?y.jsx(pz,{id:r,icon:o,onSelect:l,onDragStart:h,labelStr:k,titleStr:M,disabled:t,isSelected:f}):y.jsx(un,{"aria-label":k,"aria-pressed":f?"true":"false","data-testid":`tools.${r}`,"data-value":r,disabled:t,onClick:()=>l("toolbar"),onTouchStart:A=>{nt(A),l("toolbar")},title:M,type:"tool",children:y.jsx(Ze,{icon:o})});case"toolbar-overflow":return h?y.jsx(pz,{id:r,icon:o,onSelect:l,onDragStart:h,labelStr:k,titleStr:M,disabled:t,isSelected:f,overflow:!0}):y.jsx(un,{"aria-label":k,"aria-pressed":f?"true":"false",isActive:f,"data-testid":`tools.more.${r}`,"data-value":r,disabled:t,onClick:()=>l("toolbar"),title:M,type:"icon",children:y.jsx(Ze,{icon:o})});default:throw kt(g)}}function Ive(t,e){const n=te();return E.useMemo(()=>{let i={name:"idle"};function s(u){i={name:"pointing",screenSpaceStart:{x:u.clientX,y:u.clientY}},u.currentTarget.setPointerCapture(u.pointerId)}function o(u){if(!u.isSpecialRedispatchedEvent&&i.name==="pointing"&&I.Dist2(i.screenSpaceStart,{x:u.clientX,y:u.clientY})>(n.getInstanceState().isCoarsePointer?n.options.uiCoarseDragDistanceSquared:n.options.uiDragDistanceSquared)){const h=i.screenSpaceStart;i={name:"dragging",screenSpaceStart:h},n.run(()=>{n.setCurrentTool("select"),n.dispatch({type:"pointer",target:"canvas",name:"pointer_down",...li(n,u),point:h}),n.selectNone(),t?.("toolbar",{type:"pointer",target:"canvas",name:"pointer_move",...li(n,u),point:h}),Lo.hideAllTooltips(),n.getContainer().focus()})}}function a(u){u.isSpecialRedispatchedEvent||(u.currentTarget.releasePointerCapture(u.pointerId),n.dispatch({type:"pointer",target:"canvas",name:"pointer_up",...li(n,u)}))}function l(){if(i.name==="dragging"||i.name==="dragged")return i={name:"idle"},!0;i={name:"idle"},e?.("toolbar")}return{onPointerDown:s,onPointerMove:o,onPointerUp:a,onClick:l}},[t,n,e])}function pz({id:t,labelStr:e,titleStr:n,disabled:r,isSelected:i,icon:s,onSelect:o,onDragStart:a,overflow:l}){const u=Ive(a,o);return l?y.jsx(un,{"aria-label":e,"aria-pressed":i?"true":"false",isActive:i,className:"tlui-button-grid__button","data-testid":`tools.more.${t}`,"data-value":t,disabled:r,title:n,type:"icon",...u,children:y.jsx(Ze,{icon:s})}):y.jsx(un,{"aria-label":e,"aria-pressed":i?"true":"false","data-testid":`tools.${t}`,"data-value":t,disabled:r,onTouchStart:f=>{nt(f),o("toolbar")},title:n,type:"tool",...u,children:y.jsx(Ze,{icon:s})})}function ge({actionId:t="",...e}){const r=sl()[t];return r?y.jsx(xt,{...r,...e}):null}function ct({id:t,label:e,className:n,children:r}){const i=q0(),{orientation:s}=Cy(),o=Ne(),a=Nm(e,i.type),l=a?o(a):void 0;switch(i.type){case"menu":return y.jsx(bve,{className:n,"data-testid":`${i.sourceId}-group.${t}`,children:r});case"context-menu":return y.jsx("div",{dir:"ltr",className:Fe("tlui-menu__group",n),"data-testid":`${i.sourceId}-group.${t}`,children:r});case"keyboard-shortcuts":return y.jsxs("div",{className:"tlui-shortcuts-dialog__group","data-testid":`${i.sourceId}-group.${t}`,children:[y.jsx("h2",{className:"tlui-shortcuts-dialog__group__title",children:l}),y.jsx("div",{className:"tlui-shortcuts-dialog__group__content",children:r})]});case"toolbar":{const u=s==="horizontal"?Xd:s2;return y.jsx(u,{className:"tlui-main-toolbar__group","data-testid":`${i.sourceId}-group.${t}`,children:r})}case"toolbar-overflow":return y.jsx(J0,{className:"tlui-main-toolbar__group","data-testid":`${i.sourceId}-group.${t}`,children:r});default:return r}}const ZP=E.createContext(null);function kve({context:t,children:e}){const n=E.useContext(ZP),r=Mn(),i=Xm("dialogs",[]),s=E.useMemo(()=>({dialogs:i,addDialog(o){const a=o.id??Nt();return i.update(l=>[...l.filter(u=>u.id!==o.id),{...o,id:a}]),r("open-menu",{source:"dialog",id:a}),Gi.addOpenMenu(a,t),a},removeDialog(o){const a=i.get().find(l=>l.id===o);return a&&(a.onClose?.(),r("close-menu",{source:"dialog",id:o}),Gi.deleteOpenMenu(o,t),i.update(l=>l.filter(u=>u!==a))),o},clearDialogs(){const o=i.get();o.length!==0&&(o.forEach(a=>{a.onClose?.(),r("close-menu",{source:"dialog",id:a.id}),Gi.deleteOpenMenu(a.id,t)}),i.set([]))}}),[r,i,t]);return n?y.jsx(y.Fragment,{children:e}):y.jsx(ZP.Provider,{value:s,children:e})}function Ty(){const t=E.useContext(ZP);if(!t)throw new Error("useDialogs must be used within a DialogsProvider");return t}const JP=E.createContext(null);function Mve({children:t}){const e=Xm("toasts",[]),n=E.useContext(JP),r=E.useMemo(()=>({toasts:e,addToast(i){const s=i.id??Nt();return e.update(o=>[...o.filter(a=>a.id!==i.id),{...i,id:s}]),s},removeToast(i){return e.update(s=>s.filter(o=>o.id!==i)),i},clearToasts(){e.set([])}}),[e]);return n?y.jsx(y.Fragment,{children:t}):y.jsx(bbe,{children:y.jsx(JP.Provider,{value:r,children:t})})}function rc(){const t=E.useContext(JP);if(!t)throw new Error("useToasts must be used within a ToastsProvider");return t}function gz(t){return new Promise(e=>{const{allowMultiple:n=!0,mimeTypes:r=[]}=t||{},i=document.createElement("input");i.type="file",i.accept=r?.join(","),i.multiple=n,i.style.display="none";function s(){i.removeEventListener("change",o),i.removeEventListener("cancel",a),i.remove()}async function o(l){const u=l.target.files;if(!u||u.length===0){e([]),s();return}const f=Array.from(u);i.value="",e(f),s()}function a(){e([]),s()}document.body.appendChild(i),i.addEventListener("cancel",a),i.addEventListener("change",o),i?.click()})}var g_={exports:{}},mz;function Ave(){return mz||(mz=1,(function(t){var e=(function(){var n=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",s={};function o(l,u){if(!s[l]){s[l]={};for(var f=0;f<l.length;f++)s[l][l.charAt(f)]=f}return s[l][u]}var a={compressToBase64:function(l){if(l==null)return"";var u=a._compress(l,6,function(f){return r.charAt(f)});switch(u.length%4){default:case 0:return u;case 1:return u+"===";case 2:return u+"==";case 3:return u+"="}},decompressFromBase64:function(l){return l==null?"":l==""?null:a._decompress(l.length,32,function(u){return o(r,l.charAt(u))})},compressToUTF16:function(l){return l==null?"":a._compress(l,15,function(u){return n(u+32)})+" "},decompressFromUTF16:function(l){return l==null?"":l==""?null:a._decompress(l.length,16384,function(u){return l.charCodeAt(u)-32})},compressToUint8Array:function(l){for(var u=a.compress(l),f=new Uint8Array(u.length*2),h=0,g=u.length;h<g;h++){var m=u.charCodeAt(h);f[h*2]=m>>>8,f[h*2+1]=m%256}return f},decompressFromUint8Array:function(l){if(l==null)return a.decompress(l);for(var u=new Array(l.length/2),f=0,h=u.length;f<h;f++)u[f]=l[f*2]*256+l[f*2+1];var g=[];return u.forEach(function(m){g.push(n(m))}),a.decompress(g.join(""))},compressToEncodedURIComponent:function(l){return l==null?"":a._compress(l,6,function(u){return i.charAt(u)})},decompressFromEncodedURIComponent:function(l){return l==null?"":l==""?null:(l=l.replace(/ /g,"+"),a._decompress(l.length,32,function(u){return o(i,l.charAt(u))}))},compress:function(l){return a._compress(l,16,function(u){return n(u)})},_compress:function(l,u,f){if(l==null)return"";var h,g,m={},b={},w="",x="",v="",C=2,P=3,k=2,M=[],A=0,O=0,R;for(R=0;R<l.length;R+=1)if(w=l.charAt(R),Object.prototype.hasOwnProperty.call(m,w)||(m[w]=P++,b[w]=!0),x=v+w,Object.prototype.hasOwnProperty.call(m,x))v=x;else{if(Object.prototype.hasOwnProperty.call(b,v)){if(v.charCodeAt(0)<256){for(h=0;h<k;h++)A=A<<1,O==u-1?(O=0,M.push(f(A)),A=0):O++;for(g=v.charCodeAt(0),h=0;h<8;h++)A=A<<1|g&1,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=g>>1}else{for(g=1,h=0;h<k;h++)A=A<<1|g,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=0;for(g=v.charCodeAt(0),h=0;h<16;h++)A=A<<1|g&1,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=g>>1}C--,C==0&&(C=Math.pow(2,k),k++),delete b[v]}else for(g=m[v],h=0;h<k;h++)A=A<<1|g&1,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=g>>1;C--,C==0&&(C=Math.pow(2,k),k++),m[x]=P++,v=String(w)}if(v!==""){if(Object.prototype.hasOwnProperty.call(b,v)){if(v.charCodeAt(0)<256){for(h=0;h<k;h++)A=A<<1,O==u-1?(O=0,M.push(f(A)),A=0):O++;for(g=v.charCodeAt(0),h=0;h<8;h++)A=A<<1|g&1,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=g>>1}else{for(g=1,h=0;h<k;h++)A=A<<1|g,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=0;for(g=v.charCodeAt(0),h=0;h<16;h++)A=A<<1|g&1,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=g>>1}C--,C==0&&(C=Math.pow(2,k),k++),delete b[v]}else for(g=m[v],h=0;h<k;h++)A=A<<1|g&1,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=g>>1;C--,C==0&&(C=Math.pow(2,k),k++)}for(g=2,h=0;h<k;h++)A=A<<1|g&1,O==u-1?(O=0,M.push(f(A)),A=0):O++,g=g>>1;for(;;)if(A=A<<1,O==u-1){M.push(f(A));break}else O++;return M.join("")},decompress:function(l){return l==null?"":l==""?null:a._decompress(l.length,32768,function(u){return l.charCodeAt(u)})},_decompress:function(l,u,f){var h=[],g=4,m=4,b=3,w="",x=[],v,C,P,k,M,A,O,R={val:f(0),position:u,index:1};for(v=0;v<3;v+=1)h[v]=v;for(P=0,M=Math.pow(2,2),A=1;A!=M;)k=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=f(R.index++)),P|=(k>0?1:0)*A,A<<=1;switch(P){case 0:for(P=0,M=Math.pow(2,8),A=1;A!=M;)k=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=f(R.index++)),P|=(k>0?1:0)*A,A<<=1;O=n(P);break;case 1:for(P=0,M=Math.pow(2,16),A=1;A!=M;)k=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=f(R.index++)),P|=(k>0?1:0)*A,A<<=1;O=n(P);break;case 2:return""}for(h[3]=O,C=O,x.push(O);;){if(R.index>l)return"";for(P=0,M=Math.pow(2,b),A=1;A!=M;)k=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=f(R.index++)),P|=(k>0?1:0)*A,A<<=1;switch(O=P){case 0:for(P=0,M=Math.pow(2,8),A=1;A!=M;)k=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=f(R.index++)),P|=(k>0?1:0)*A,A<<=1;h[m++]=n(P),O=m-1,g--;break;case 1:for(P=0,M=Math.pow(2,16),A=1;A!=M;)k=R.val&R.position,R.position>>=1,R.position==0&&(R.position=u,R.val=f(R.index++)),P|=(k>0?1:0)*A,A<<=1;h[m++]=n(P),O=m-1,g--;break;case 2:return x.join("")}if(g==0&&(g=Math.pow(2,b),b++),h[O])w=h[O];else if(O===m)w=C+C.charAt(0);else return null;x.push(w),h[m++]=C+w.charAt(0),g--,C=w,g==0&&(g=Math.pow(2,b),b++)}}};return a})();t!=null?t.exports=e:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return e})})(g_)),g_.exports}var Ove=Ave();const QP=Ja(Ove),o2="web image/vnd.tldraw+png",Dve={png:o2},Rve={[o2]:"image/png"};function jve(t){return ir(Dve,t)??null}function Lve(t){return ir(Rve,t)??t}function Nve(t){return typeof ClipboardItem<"u"&&"supports"in ClipboardItem&&ClipboardItem.supports(t)}function zve(t){const e=Object.entries(t);for(const[n,r]of e)r.catch(i=>console.error(i));return navigator.clipboard.write([new ClipboardItem(t)]).catch(n=>(console.error(n),Promise.all(e.map(async([r,i])=>[r,await i])).then(r=>{const i=HB(r);return navigator.clipboard.write([new ClipboardItem(i)])})))}async function Bve(t,e,n,r){const i=e.map(s=>s instanceof File?s:new File([s],"tldrawFile",{type:s.type}));t.markHistoryStoppingPoint("paste"),await t.putExternalContent({type:"files",files:i,point:n,sources:r})}async function eI(t,e,n,r){return t.markHistoryStoppingPoint("paste"),await t.putExternalContent({type:"url",point:n,url:e,sources:r})}const Fve=[o2,"image/png","image/jpeg","image/webp","image/svg+xml"];function m_(t){const e=document.implementation.createHTMLDocument("");return e.documentElement.innerHTML=t.trim(),e.body.textContent||e.body.innerText||""}const Uve=t=>{try{const e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}},Hve=t=>{const e=t.split(/[\n\s]/);for(const n of e)try{const r=new URL(n);if(!(r.protocol==="http:"||r.protocol==="https:"))return}catch{return}return NH(e)},$ve=t=>/^<svg/.test(t),Kve=["input","select","textarea"];function y_(t){const{activeElement:e}=document;return t.menus.hasAnyOpenMenus()||e&&(e.isContentEditable||Kve.indexOf(e.tagName.toLowerCase())>-1)}const ab=(t,e,n,r)=>{const i=Hve(e);if(i)for(const s of i)eI(t,s,n);else Uve(e)?eI(t,e,n):$ve(e)?(t.markHistoryStoppingPoint("paste"),t.putExternalContent({type:"svg-text",text:e,point:n,sources:r})):(t.markHistoryStoppingPoint("paste"),t.putExternalContent({type:"text",text:e,point:n,sources:r}))},Vve=async(t,e,n)=>{if(t.getEditingShapeId()!==null)return;if(!e)throw Error("No clipboard data");const r=[];for(const i of Object.values(e.items))switch(i.kind){case"file":{r.push({type:"file",source:new Promise(s=>s(i.getAsFile()))});break}case"string":{i.type==="text/html"?r.push({type:"html",source:new Promise(s=>i.getAsString(s))}):i.type==="text/plain"?r.push({type:"text",source:new Promise(s=>i.getAsString(s))}):r.push({type:i.type,source:new Promise(s=>i.getAsString(s))});break}}Lq(t,r,n)},jq=async({editor:t,clipboardItems:e,point:n,fallbackFiles:r})=>{const i=[];for(const s of e){for(const o of Fve)if(s.types.includes(o)){const a=s.getType(o).then(l=>Pi.rewriteMimeType(l,Lve(o)));i.push({type:"blob",source:a});break}s.types.includes("text/html")&&i.push({type:"html",source:(async()=>{const o=await s.getType("text/html");return await Pi.blobToText(o)})()}),s.types.includes("text/uri-list")&&i.push({type:"url",source:(async()=>{const o=await s.getType("text/uri-list");return await Pi.blobToText(o)})()}),s.types.includes("text/plain")&&i.push({type:"text",source:(async()=>{const o=await s.getType("text/plain");return await Pi.blobToText(o)})()})}return r?.length&&i.length===1&&i[0].type==="text"?(i.pop(),i.push(...r.map(s=>({type:"file",source:Promise.resolve(s)})))):r?.length&&i.length===0&&i.push(...r.map(s=>({type:"file",source:Promise.resolve(s)}))),await Lq(t,i,n)};async function Lq(t,e,n){const r=e.filter(s=>(s.type==="file"||s.type==="blob")&&s.source!==null);if(r.length){if(r.length>t.options.maxFilesAtOnce)throw Error("Too many files");const s=tt(await Promise.all(r.map(o=>o.source)));return await Bve(t,s,n)}const i=await Promise.all(e.filter(s=>s.type!=="file").map(s=>new Promise(o=>{const a=s;if(a.type==="file"){o({type:"error",data:null,reason:"unexpected file"});return}a.source.then(l=>{const u=l.match(/<div data-tldraw[^>]*>(.*)<\/div>/)?.[1];if(u)try{let f;try{f=JSON.parse(u)}catch{const h=QP.decompressFromBase64(u);if(h===null){o({type:"error",data:null,reason:"found tldraw data comment but could not parse"});return}f=JSON.parse(h)}if(f.type!=="application/tldraw"){o({type:"error",data:f,reason:`found tldraw data comment but JSON was of a different type: ${f.type}`});return}if(f.version===3)try{const h=JSON.parse(QP.decompressFromBase64(f.data.otherCompressed)||"{}"),g={assets:f.data.assets||[],...h};o({type:"tldraw",data:g});return}catch(h){o({type:"error",data:f,reason:`failed to decompress version 2 clipboard data: ${h}`});return}if(f.version===2)o({type:"tldraw",data:f.data});else{if(typeof f.data=="string"){o({type:"error",data:f,reason:"found tldraw json but data was a string instead of a TLClipboardModel object"});return}o({type:"tldraw",data:f.data});return}}catch{o({type:"error",data:u,reason:"found tldraw json but data was a string instead of a TLClipboardModel object"});return}else{if(a.type==="html"){o({type:"text",data:l,subtype:"html"});return}if(a.type==="url"){o({type:"text",data:l,subtype:"url"});return}try{const f=JSON.parse(l);if(f.type==="excalidraw/clipboard"){o({type:"excalidraw",data:f});return}else{o({type:"text",data:l,subtype:"json"});return}}catch{o({type:"text",data:l,subtype:"text"});return}}o({type:"error",data:l,reason:"unhandled case"})})})));for(const s of i)if(s.type==="tldraw"){t.markHistoryStoppingPoint("paste"),t.putExternalContent({type:"tldraw",content:s.data,point:n});return}for(const s of i)if(s.type==="excalidraw"){t.markHistoryStoppingPoint("paste"),t.putExternalContent({type:"excalidraw",content:s.data,point:n});return}for(const s of i){if(s.type==="text"&&s.subtype==="html"){const a=new DOMParser().parseFromString(s.data,"text/html").querySelector("body");if(a&&Array.from(a.children).filter(u=>u.nodeType===1).length===1&&a.firstElementChild&&a.firstElementChild.tagName==="A"&&a.firstElementChild.hasAttribute("href")&&a.firstElementChild.getAttribute("href")!==""){const u=a.firstElementChild.getAttribute("href");ab(t,u,n,i);return}if(!i.some(u=>u.type==="text"&&u.subtype!=="html")&&s.data.trim()&&(m_(s.data)??"")){ab(t,m_(s.data),n,i);return}if(i.some(u=>u.type==="text"&&u.subtype!=="html")){const u=m_(s.data)??"";if(u){t.markHistoryStoppingPoint("paste"),t.putExternalContent({type:"text",text:u,html:s.data,point:n,sources:i});return}}}if(s.type==="text"&&s.subtype==="text"&&s.data.startsWith("<iframe ")){const a=new DOMParser().parseFromString(s.data,"text/html").querySelector("body");if(a&&Array.from(a.children).filter(u=>u.nodeType===1).length===1&&a.firstElementChild&&a.firstElementChild.tagName==="IFRAME"&&a.firstElementChild.hasAttribute("src")&&a.firstElementChild.getAttribute("src")!==""){const u=a.firstElementChild.getAttribute("src");ab(t,u,n,i);return}}}for(const s of i)if(s.type==="text"&&s.subtype==="url"){eI(t,s.data,n,i);return}for(const s of i)if(s.type==="text"&&s.subtype==="text"&&s.data.trim()){ab(t,s.data,n,i);return}}const zv=async t=>{const e=t.getContainer().ownerDocument?.defaultView?.navigator??globalThis.navigator,n=await t.resolveAssetsInContent(t.getContentFromCurrentPage(t.getSelectedShapeIds()));if(!n){e&&e.clipboard&&e.clipboard.writeText("");return}const{assets:r,...i}=n,s={type:"application/tldraw",kind:"content",version:3,data:{assets:r||[],otherCompressed:QP.compressToBase64(JSON.stringify(i))}},o=JSON.stringify(s);if(!(typeof e>"u")){const a=n.shapes.map(l=>t.getShapeUtil(l).getText(l)).filter(mJ);if(e.clipboard?.write){const l=new Blob([`<div data-tldraw>${o}</div>`],{type:"text/html"});let u=a.join(" ");u===""&&(u=" "),e.clipboard.write([new ClipboardItem({"text/html":l,"text/plain":new Blob([u],{type:"text/plain"})})])}else e.clipboard.writeText&&e.clipboard.writeText(`<div data-tldraw>${o}</div>`)}};function qve(){const t=Gn(),e=Mn(),n=E.useCallback(async function(o){Be(t,"editor is required for copy"),t.getSelectedShapeIds().length!==0&&(await zv(t),e("copy",{source:o}))},[t,e]),r=E.useCallback(async function(o){t&&t.getSelectedShapeIds().length!==0&&(await zv(t),t.deleteShapes(t.getSelectedShapeIds()),e("cut",{source:o}))},[t,e]),i=E.useCallback(async function(o,a,l){t&&t.getEditingShapeId()===null&&(Array.isArray(o)&&o[0]instanceof ClipboardItem?(jq({editor:t,clipboardItems:o,point:l}),e("paste",{source:"menu"})):navigator.clipboard.read().then(u=>{i(u,a,l)}))},[t,e]);return{copy:n,cut:r,paste:i}}function Gve(){const t=te(),e=t.getContainer().ownerDocument,n=Mn(),r=ee("editor.isFocused",()=>t.getInstanceState().isFocused,[t]);E.useEffect(()=>{if(!r)return;const i=async u=>{t.getSelectedShapeIds().length===0||t.getEditingShapeId()!==null||y_(t)||(nt(u),await zv(t),n("copy",{source:"kbd"}))};async function s(u){t.getSelectedShapeIds().length===0||t.getEditingShapeId()!==null||y_(t)||(nt(u),await zv(t),t.deleteShapes(t.getSelectedShapeIds()),n("cut",{source:"kbd"}))}let o=!1;const a=u=>{u.button===1&&(o=!0,t.timers.requestAnimationFrame(()=>{o=!1}))},l=u=>{if(o){t.markEventAsHandled(u);return}if(t.getEditingShapeId()!==null||y_(t))return;let f,h=!1;t.inputs.shiftKey&&(h=!0),t.user.getIsPasteAtCursorMode()&&(h=!h),h&&(f=t.inputs.currentPagePoint);const g=()=>{u.clipboardData&&Vve(t,u.clipboardData,f)};if(navigator.clipboard?.read){const m=Array.from(u.clipboardData?.files||[]);navigator.clipboard.read().then(b=>{Array.isArray(b)&&b[0]instanceof ClipboardItem&&jq({editor:t,clipboardItems:b,point:f,fallbackFiles:m})},()=>{g()})}else g();nt(u),n("paste",{source:"kbd"})};return e?.addEventListener("copy",i),e?.addEventListener("cut",s),e?.addEventListener("paste",l),e?.addEventListener("pointerup",a),()=>{e?.removeEventListener("copy",i),e?.removeEventListener("cut",s),e?.removeEventListener("paste",l),e?.removeEventListener("pointerup",a)}},[t,n,r,e])}const yz={jpeg:"image/jpeg",png:"image/png",webp:"image/webp",svg:"text/plain"};function Yve(t,e,n={}){const r=e?.length?e:[...t.getCurrentPageShapeIds()],i=n.format??"png";return{blobPromise:t.toImage(r,n).then(s=>Pi.rewriteMimeType(s.blob,yz[i])),mimeType:yz[i]}}function Wve(t,e,n){if(!navigator.clipboard)return Promise.reject(new Error("Copy not supported"));if(navigator.clipboard.write){const{blobPromise:r,mimeType:i}=Yve(t,e,n),s={[i]:r},o=jve(n.format);return o&&Nve(o)&&(s[o]=r.then(a=>Pi.rewriteMimeType(a,o))),zve(s)}switch(n.format){case"svg":return Xve(async()=>{const r=await t.getSvgString(e,n);if(!r)throw new Error("Failed to copy");return r.svg});case"png":throw new Error("Copy not supported");default:kt(n.format)}}async function Xve(t){await navigator.clipboard?.writeText?.(await t())}function Zve(){const t=Gn(),{addToast:e}=rc(),n=Ne();return E.useCallback((r,i="svg")=>{Be(t,"useCopyAs: editor is required"),Wve(t,r,{format:i}).catch(()=>{e({id:"copy-fail",severity:"warning",title:n("toast.error.copy-fail.title"),description:n("toast.error.copy-fail.desc")})})},[t,e,n])}async function Jve(t,e,n){let r=n.name;if(!r&&(r=`shapes at ${Sz()}`,e.length===1)){const o=t.getShape(e[0]);t.isShapeOfType(o,"frame")?r=o.props.name||"frame":r=`${Lx(o.id)} at ${Sz()}`}r+=`.${n.format}`;const{blob:i}=await t.toImage(e,n),s=new File([i],r,{type:i.type});Qve(s)}function Sz(){const t=new Date,e=String(t.getFullYear()).slice(2),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0"),i=String(t.getHours()).padStart(2,"0"),s=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return`${e}-${n}-${r} ${i}.${s}.${o}`}function Qve(t){const e=document.createElement("a"),n=URL.createObjectURL(t);e.href=n,e.download=t.name,e.click(),URL.revokeObjectURL(n)}function exe(){const t=Gn(),{addToast:e}=rc(),n=Ne();return E.useCallback((r,i={})=>{Be(t,"useExportAs: editor is required");const{format:s="png",name:o,scale:a=1}=i;Jve(t,r,{format:s,name:o,scale:a}).catch(l=>{console.error(l.message),e({id:"export-fail",title:n("toast.error.export-fail.title"),description:n("toast.error.export-fail.desc"),severity:"error"})})},[t,e,n])}function txe(){const t=Gn(),e=E.useRef(null),n=E.useRef(null);return E.useCallback(async function(){Be(t,"usePrint: editor is required");const i=document.createElement("div"),s=document.createElement("style"),o=(v,C)=>{v&&(v.innerHTML=""),C&&document.head.contains(C)&&document.head.removeChild(C),v&&document.body.contains(v)&&document.body.removeChild(v)};o(e.current,n.current),e.current=i,n.current=s;const a=`tl-print-surface-${Nt()}`;i.className=a,s.innerHTML=`
293
293
  .${a} {
294
294
  display: none;
295
295
  }