@iconoma/studio 0.2.0 → 0.2.1

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,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-lohWKmM3.js","assets/base-80a1f760-Dmh1zEm4.js","assets/consoleHook-59e792cb-BPY7C9Z6.js","assets/index-599aeaf7-DZk7eK7p.js","assets/index-De8hZx0A.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CDVAzgua.js","assets/base-80a1f760-DYj-LFsk.js","assets/consoleHook-59e792cb-9ulSFryp.js","assets/index-599aeaf7-BfDYnnrl.js","assets/index-BnqiXBcx.js"])))=>i.map(i=>d[i]);
2
2
  function vz(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 a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(t,i,a.get?a:{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 a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function Dc(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Lv={exports:{}},Lu={};var IC;function yz(){if(IC)return Lu;IC=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,a){var o=null;if(a!==void 0&&(o=""+a),i.key!==void 0&&(o=""+i.key),"key"in i){a={};for(var c in i)c!=="key"&&(a[c]=i[c])}else a=i;return i=a.ref,{$$typeof:t,type:r,key:o,ref:i!==void 0?i:null,props:a}}return Lu.Fragment=e,Lu.jsx=n,Lu.jsxs=n,Lu}var qC;function bz(){return qC||(qC=1,Lv.exports=yz()),Lv.exports}var v=bz(),Zv={exports:{}},nt={};var UC;function xz(){if(UC)return nt;UC=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"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),g=Symbol.iterator;function y(R){return R===null||typeof R!="object"?null:(R=g&&R[g]||R["@@iterator"],typeof R=="function"?R:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,k={};function T(R,N,L){this.props=R,this.context=N,this.refs=k,this.updater=L||x}T.prototype.isReactComponent={},T.prototype.setState=function(R,N){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,N,"setState")},T.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function C(){}C.prototype=T.prototype;function E(R,N,L){this.props=R,this.context=N,this.refs=k,this.updater=L||x}var A=E.prototype=new C;A.constructor=E,S(A,T.prototype),A.isPureReactComponent=!0;var $=Array.isArray;function P(){}var _={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function F(R,N,L){var q=L.ref;return{$$typeof:t,type:R,key:N,ref:q!==void 0?q:null,props:L}}function X(R,N){return F(R.type,N,R.props)}function K(R){return typeof R=="object"&&R!==null&&R.$$typeof===t}function B(R){var N={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(L){return N[L]})}var ne=/\/+/g;function G(R,N){return typeof R=="object"&&R!==null&&R.key!=null?B(""+R.key):N.toString(36)}function fe(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(P,P):(R.status="pending",R.then(function(N){R.status==="pending"&&(R.status="fulfilled",R.value=N)},function(N){R.status==="pending"&&(R.status="rejected",R.reason=N)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function D(R,N,L,q,se){var pe=typeof R;(pe==="undefined"||pe==="boolean")&&(R=null);var H=!1;if(R===null)H=!0;else switch(pe){case"bigint":case"string":case"number":H=!0;break;case"object":switch(R.$$typeof){case t:case e:H=!0;break;case h:return H=R._init,D(H(R._payload),N,L,q,se)}}if(H)return se=se(R),H=q===""?"."+G(R,0):q,$(se)?(L="",H!=null&&(L=H.replace(ne,"$&/")+"/"),D(se,N,L,"",function(ke){return ke})):se!=null&&(K(se)&&(se=X(se,L+(se.key==null||R&&R.key===se.key?"":(""+se.key).replace(ne,"$&/")+"/")+H)),N.push(se)),1;H=0;var ge=q===""?".":q+":";if($(R))for(var xe=0;xe<R.length;xe++)q=R[xe],pe=ge+G(q,xe),H+=D(q,N,L,pe,se);else if(xe=y(R),typeof xe=="function")for(R=xe.call(R),xe=0;!(q=R.next()).done;)q=q.value,pe=ge+G(q,xe++),H+=D(q,N,L,pe,se);else if(pe==="object"){if(typeof R.then=="function")return D(fe(R),N,L,q,se);throw N=String(R),Error("Objects are not valid as a React child (found: "+(N==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":N)+"). If you meant to render a collection of children, use an array instead.")}return H}function W(R,N,L){if(R==null)return R;var q=[],se=0;return D(R,q,"","",function(pe){return N.call(L,pe,se++)}),q}function I(R){if(R._status===-1){var N=R._result;N=N(),N.then(function(L){(R._status===0||R._status===-1)&&(R._status=1,R._result=L)},function(L){(R._status===0||R._status===-1)&&(R._status=2,R._result=L)}),R._status===-1&&(R._status=0,R._result=N)}if(R._status===1)return R._result.default;throw R._result}var ye=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var N=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(N))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},V={map:W,forEach:function(R,N,L){W(R,function(){N.apply(this,arguments)},L)},count:function(R){var N=0;return W(R,function(){N++}),N},toArray:function(R){return W(R,function(N){return N})||[]},only:function(R){if(!K(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return nt.Activity=m,nt.Children=V,nt.Component=T,nt.Fragment=n,nt.Profiler=i,nt.PureComponent=E,nt.StrictMode=r,nt.Suspense=u,nt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,nt.__COMPILER_RUNTIME={__proto__:null,c:function(R){return _.H.useMemoCache(R)}},nt.cache=function(R){return function(){return R.apply(null,arguments)}},nt.cacheSignal=function(){return null},nt.cloneElement=function(R,N,L){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var q=S({},R.props),se=R.key;if(N!=null)for(pe in N.key!==void 0&&(se=""+N.key),N)!M.call(N,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&N.ref===void 0||(q[pe]=N[pe]);var pe=arguments.length-2;if(pe===1)q.children=L;else if(1<pe){for(var H=Array(pe),ge=0;ge<pe;ge++)H[ge]=arguments[ge+2];q.children=H}return F(R.type,se,q)},nt.createContext=function(R){return R={$$typeof:o,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:a,_context:R},R},nt.createElement=function(R,N,L){var q,se={},pe=null;if(N!=null)for(q in N.key!==void 0&&(pe=""+N.key),N)M.call(N,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(se[q]=N[q]);var H=arguments.length-2;if(H===1)se.children=L;else if(1<H){for(var ge=Array(H),xe=0;xe<H;xe++)ge[xe]=arguments[xe+2];se.children=ge}if(R&&R.defaultProps)for(q in H=R.defaultProps,H)se[q]===void 0&&(se[q]=H[q]);return F(R,pe,se)},nt.createRef=function(){return{current:null}},nt.forwardRef=function(R){return{$$typeof:c,render:R}},nt.isValidElement=K,nt.lazy=function(R){return{$$typeof:h,_payload:{_status:-1,_result:R},_init:I}},nt.memo=function(R,N){return{$$typeof:f,type:R,compare:N===void 0?null:N}},nt.startTransition=function(R){var N=_.T,L={};_.T=L;try{var q=R(),se=_.S;se!==null&&se(L,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(P,ye)}catch(pe){ye(pe)}finally{N!==null&&L.types!==null&&(N.types=L.types),_.T=N}},nt.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},nt.use=function(R){return _.H.use(R)},nt.useActionState=function(R,N,L){return _.H.useActionState(R,N,L)},nt.useCallback=function(R,N){return _.H.useCallback(R,N)},nt.useContext=function(R){return _.H.useContext(R)},nt.useDebugValue=function(){},nt.useDeferredValue=function(R,N){return _.H.useDeferredValue(R,N)},nt.useEffect=function(R,N){return _.H.useEffect(R,N)},nt.useEffectEvent=function(R){return _.H.useEffectEvent(R)},nt.useId=function(){return _.H.useId()},nt.useImperativeHandle=function(R,N,L){return _.H.useImperativeHandle(R,N,L)},nt.useInsertionEffect=function(R,N){return _.H.useInsertionEffect(R,N)},nt.useLayoutEffect=function(R,N){return _.H.useLayoutEffect(R,N)},nt.useMemo=function(R,N){return _.H.useMemo(R,N)},nt.useOptimistic=function(R,N){return _.H.useOptimistic(R,N)},nt.useReducer=function(R,N,L){return _.H.useReducer(R,N,L)},nt.useRef=function(R){return _.H.useRef(R)},nt.useState=function(R){return _.H.useState(R)},nt.useSyncExternalStore=function(R,N,L){return _.H.useSyncExternalStore(R,N,L)},nt.useTransition=function(){return _.H.useTransition()},nt.version="19.2.3",nt}var YC;function nx(){return YC||(YC=1,Zv.exports=xz()),Zv.exports}var w=nx();const le=Dc(w),rx=vz({__proto__:null,default:le},[w]);var Vv={exports:{}},Zu={},Xv={exports:{}},Bv={};var FC;function Sz(){return FC||(FC=1,(function(t){function e(D,W){var I=D.length;D.push(W);e:for(;0<I;){var ye=I-1>>>1,V=D[ye];if(0<i(V,W))D[ye]=W,D[I]=V,I=ye;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var W=D[0],I=D.pop();if(I!==W){D[0]=I;e:for(var ye=0,V=D.length,R=V>>>1;ye<R;){var N=2*(ye+1)-1,L=D[N],q=N+1,se=D[q];if(0>i(L,I))q<V&&0>i(se,L)?(D[ye]=se,D[q]=I,ye=q):(D[ye]=L,D[N]=I,ye=N);else if(q<V&&0>i(se,I))D[ye]=se,D[q]=I,ye=q;else break e}}return W}function i(D,W){var I=D.sortIndex-W.sortIndex;return I!==0?I:D.id-W.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var o=Date,c=o.now();t.unstable_now=function(){return o.now()-c}}var u=[],f=[],h=1,m=null,g=3,y=!1,x=!1,S=!1,k=!1,T=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function A(D){for(var W=n(f);W!==null;){if(W.callback===null)r(f);else if(W.startTime<=D)r(f),W.sortIndex=W.expirationTime,e(u,W);else break;W=n(f)}}function $(D){if(S=!1,A(D),!x)if(n(u)!==null)x=!0,P||(P=!0,B());else{var W=n(f);W!==null&&fe($,W.startTime-D)}}var P=!1,_=-1,M=5,F=-1;function X(){return k?!0:!(t.unstable_now()-F<M)}function K(){if(k=!1,P){var D=t.unstable_now();F=D;var W=!0;try{e:{x=!1,S&&(S=!1,C(_),_=-1),y=!0;var I=g;try{t:{for(A(D),m=n(u);m!==null&&!(m.expirationTime>D&&X());){var ye=m.callback;if(typeof ye=="function"){m.callback=null,g=m.priorityLevel;var V=ye(m.expirationTime<=D);if(D=t.unstable_now(),typeof V=="function"){m.callback=V,A(D),W=!0;break t}m===n(u)&&r(u),A(D)}else r(u);m=n(u)}if(m!==null)W=!0;else{var R=n(f);R!==null&&fe($,R.startTime-D),W=!1}}break e}finally{m=null,g=I,y=!1}W=void 0}}finally{W?B():P=!1}}}var B;if(typeof E=="function")B=function(){E(K)};else if(typeof MessageChannel<"u"){var ne=new MessageChannel,G=ne.port2;ne.port1.onmessage=K,B=function(){G.postMessage(null)}}else B=function(){T(K,0)};function fe(D,W){_=T(function(){D(t.unstable_now())},W)}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(D){D.callback=null},t.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<D?Math.floor(1e3/D):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function(D){switch(g){case 1:case 2:case 3:var W=3;break;default:W=g}var I=g;g=W;try{return D()}finally{g=I}},t.unstable_requestPaint=function(){k=!0},t.unstable_runWithPriority=function(D,W){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var I=g;g=D;try{return W()}finally{g=I}},t.unstable_scheduleCallback=function(D,W,I){var ye=t.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?ye+I:ye):I=ye,D){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=I+V,D={id:h++,callback:W,priorityLevel:D,startTime:I,expirationTime:V,sortIndex:-1},I>ye?(D.sortIndex=I,e(f,D),n(u)===null&&D===n(f)&&(S?(C(_),_=-1):S=!0,fe($,I-ye))):(D.sortIndex=V,e(u,D),x||y||(x=!0,P||(P=!0,B()))),D},t.unstable_shouldYield=X,t.unstable_wrapCallback=function(D){var W=g;return function(){var I=g;g=W;try{return D.apply(this,arguments)}finally{g=I}}}})(Bv)),Bv}var WC;function wz(){return WC||(WC=1,Xv.exports=Sz()),Xv.exports}var Iv={exports:{}},Yn={};var GC;function kz(){if(GC)return Yn;GC=1;var t=nx();function e(u){var f="https://react.dev/errors/"+u;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)f+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+u+"; visit "+f+" 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 a(u,f,h){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:m==null?null:""+m,children:u,containerInfo:f,implementation:h}}var o=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,f){if(u==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Yn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Yn.createPortal=function(u,f){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(e(299));return a(u,f,null,h)},Yn.flushSync=function(u){var f=o.T,h=r.p;try{if(o.T=null,r.p=2,u)return u()}finally{o.T=f,r.p=h,r.d.f()}},Yn.preconnect=function(u,f){typeof u=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(u,f))},Yn.prefetchDNS=function(u){typeof u=="string"&&r.d.D(u)},Yn.preinit=function(u,f){if(typeof u=="string"&&f&&typeof f.as=="string"){var h=f.as,m=c(h,f.crossOrigin),g=typeof f.integrity=="string"?f.integrity:void 0,y=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;h==="style"?r.d.S(u,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:g,fetchPriority:y}):h==="script"&&r.d.X(u,{crossOrigin:m,integrity:g,fetchPriority:y,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Yn.preinitModule=function(u,f){if(typeof u=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var h=c(f.as,f.crossOrigin);r.d.M(u,{crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(u)},Yn.preload=function(u,f){if(typeof u=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var h=f.as,m=c(h,f.crossOrigin);r.d.L(u,h,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Yn.preloadModule=function(u,f){if(typeof u=="string")if(f){var h=c(f.as,f.crossOrigin);r.d.m(u,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:h,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(u)},Yn.requestFormReset=function(u){r.d.r(u)},Yn.unstable_batchedUpdates=function(u,f){return u(f)},Yn.useFormState=function(u,f,h){return o.H.useFormState(u,f,h)},Yn.useFormStatus=function(){return o.H.useHostTransitionStatus()},Yn.version="19.2.3",Yn}var HC;function $R(){if(HC)return Iv.exports;HC=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(),Iv.exports=kz(),Iv.exports}var KC;function Cz(){if(KC)return Zu;KC=1;var t=wz(),e=nx(),n=$R();function r(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function a(s){var l=s,d=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(d=l.return),s=l.return;while(s)}return l.tag===3?d:null}function o(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function c(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function u(s){if(a(s)!==s)throw Error(r(188))}function f(s){var l=s.alternate;if(!l){if(l=a(s),l===null)throw Error(r(188));return l!==s?null:s}for(var d=s,p=l;;){var O=d.return;if(O===null)break;var b=O.alternate;if(b===null){if(p=O.return,p!==null){d=p;continue}break}if(O.child===b.child){for(b=O.child;b;){if(b===d)return u(O),s;if(b===p)return u(O),l;b=b.sibling}throw Error(r(188))}if(d.return!==p.return)d=O,p=b;else{for(var Q=!1,j=O.child;j;){if(j===d){Q=!0,d=O,p=b;break}if(j===p){Q=!0,p=O,d=b;break}j=j.sibling}if(!Q){for(j=b.child;j;){if(j===d){Q=!0,d=b,p=O;break}if(j===p){Q=!0,p=b,d=O;break}j=j.sibling}if(!Q)throw Error(r(189))}}if(d.alternate!==p)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?s:l}function h(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=h(s),l!==null)return l;s=s.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),E=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function B(s){return s===null||typeof s!="object"?null:(s=K&&s[K]||s["@@iterator"],typeof s=="function"?s:null)}var ne=Symbol.for("react.client.reference");function G(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===ne?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case T:return"Profiler";case k:return"StrictMode";case $:return"Suspense";case P:return"SuspenseList";case F:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case x:return"Portal";case E:return s.displayName||"Context";case C:return(s._context.displayName||"Context")+".Consumer";case A:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case _:return l=s.displayName||null,l!==null?l:G(s.type)||"Memo";case M:l=s._payload,s=s._init;try{return G(s(l))}catch{}}return null}var fe=Array.isArray,D=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},ye=[],V=-1;function R(s){return{current:s}}function N(s){0>V||(s.current=ye[V],ye[V]=null,V--)}function L(s,l){V++,ye[V]=s.current,s.current=l}var q=R(null),se=R(null),pe=R(null),H=R(null);function ge(s,l){switch(L(pe,l),L(se,s),L(q,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?hC(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=hC(l),s=pC(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}N(q),L(q,s)}function xe(){N(q),N(se),N(pe)}function ke(s){s.memoizedState!==null&&L(H,s);var l=q.current,d=pC(l,s.type);l!==d&&(L(se,s),L(q,d))}function Ce(s){se.current===s&&(N(q),N(se)),H.current===s&&(N(H),Mu._currentValue=I)}var Ae,We;function Pe(s){if(Ae===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);Ae=l&&l[1]||"",We=-1<d.stack.indexOf(`
3
3
  at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
4
4
  `+Ae+s+We}var ht=!1;function Ke(s,l){if(!s||ht)return"";ht=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(l){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(de){var ae=de}Reflect.construct(s,[],be)}else{try{be.call()}catch(de){ae=de}s.call(be.prototype)}}else{try{throw Error()}catch(de){ae=de}(be=s())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(de){if(de&&ae&&typeof de.stack=="string")return[de.stack,ae.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var O=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");O&&O.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=p.DetermineComponentFrameRoot(),Q=b[0],j=b[1];if(Q&&j){var Z=Q.split(`
@@ -70,12 +70,12 @@ ${n}
70
70
 
71
71
  If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
72
72
 
73
- For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return w.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},QI="DialogDescriptionWarning",RI=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${L$(QI).contentName}}.`;return w.useEffect(()=>{const i=t.current?.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},Z$=T$,V$=R$,X$=A$,B$=_$,I$=P$,q$=M$,U$=D$;function AI({...t}){return v.jsx(Z$,{"data-slot":"sheet",...t})}function _I({...t}){return v.jsx(V$,{"data-slot":"sheet-portal",...t})}function $I({className:t,...e}){return v.jsx(X$,{"data-slot":"sheet-overlay",className:Be("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function PI({className:t,children:e,side:n="right",...r}){return v.jsxs(_I,{children:[v.jsx($I,{}),v.jsxs(B$,{"data-slot":"sheet-content",className:Be("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...r,children:[e,v.jsxs(U$,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[v.jsx(u_,{className:"size-4"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function jI({className:t,...e}){return v.jsx("div",{"data-slot":"sheet-header",className:Be("flex flex-col gap-1.5 p-4",t),...e})}function MI({className:t,...e}){return v.jsx("div",{"data-slot":"sheet-footer",className:Be("mt-auto flex flex-col gap-2 p-4",t),...e})}function NI({className:t,...e}){return v.jsx(I$,{"data-slot":"sheet-title",className:Be("text-foreground font-semibold",t),...e})}function DI({className:t,...e}){return v.jsx(q$,{"data-slot":"sheet-description",className:Be("text-muted-foreground text-sm",t),...e})}function zx({...t}){return v.jsx(Z$,{"data-slot":"dialog",...t})}function zI({...t}){return v.jsx(V$,{"data-slot":"dialog-portal",...t})}function LI({className:t,...e}){return v.jsx(X$,{"data-slot":"dialog-overlay",className:Be("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function Lx({className:t,children:e,showCloseButton:n=!0,...r}){return v.jsxs(zI,{"data-slot":"dialog-portal",children:[v.jsx(LI,{}),v.jsxs(B$,{"data-slot":"dialog-content",className:Be("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",t),...r,children:[e,n&&v.jsxs(U$,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[v.jsx(u_,{}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Zx({className:t,...e}){return v.jsx("div",{"data-slot":"dialog-header",className:Be("flex flex-col gap-2 text-center sm:text-left",t),...e})}function ZI({className:t,...e}){return v.jsx("div",{"data-slot":"dialog-footer",className:Be("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}function Vx({className:t,...e}){return v.jsx(I$,{"data-slot":"dialog-title",className:Be("text-lg leading-none font-semibold",t),...e})}function Xx({className:t,...e}){return v.jsx(q$,{"data-slot":"dialog-description",className:Be("text-muted-foreground text-sm",t),...e})}function VI({className:t,...e}){return v.jsx("div",{"data-slot":"empty",className:Be("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",t),...e})}function XI({className:t,...e}){return v.jsx("div",{"data-slot":"empty-header",className:Be("flex max-w-sm flex-col items-center gap-2 text-center",t),...e})}const BI=Nm("flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function II({className:t,variant:e="default",...n}){return v.jsx("div",{"data-slot":"empty-icon","data-variant":e,className:Be(BI({variant:e,className:t})),...n})}function qI({className:t,...e}){return v.jsx("div",{"data-slot":"empty-title",className:Be("text-lg font-medium tracking-tight",t),...e})}function UI({className:t,...e}){return v.jsx("div",{"data-slot":"empty-description",className:Be("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",t),...e})}function YI({className:t,...e}){return v.jsx("div",{"data-slot":"empty-content",className:Be("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",t),...e})}const FI=Nm("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Za({className:t,variant:e,asChild:n=!1,...r}){const i=n?XA:"span";return v.jsx(i,{"data-slot":"badge",className:Be(FI({variant:e}),t),...r})}function WI(){const t=Ko(),{data:e,isPending:n,error:r}=T6(),i=E6(),[a,o]=w.useState(""),[c,u]=w.useState("grid"),[f,h]=w.useState(null),[m,g]=w.useState(!1),y=e?.icons||[],x=w.useMemo(()=>{if(!a.trim())return y;const S=a.toLowerCase();return y.filter(k=>{const T=k.iconKey.toLowerCase().includes(S),C=k.icon.name.toLowerCase().includes(S),E=k.icon.tags.some(A=>A.toLowerCase().includes(S));return T||C||E})},[y,a]);return n?v.jsx("div",{className:"flex h-[calc(100vh-4rem)] items-center justify-center",children:v.jsx("div",{className:"text-muted-foreground",children:"Loading icons..."})}):r?v.jsx("div",{className:"flex h-[calc(100vh-4rem)] items-center justify-center",children:v.jsx("div",{className:"text-destructive",children:"Failed to load icons"})}):y.length===0?v.jsx("div",{className:"flex h-[calc(100vh-4rem)] w-full items-center justify-center p-6",children:v.jsxs(VI,{className:"max-w-md border border-dotted",children:[v.jsxs(XI,{children:[v.jsx(II,{variant:"icon",children:v.jsx("img",{src:"/icon.png",alt:"Iconoma Logo",className:"w-8 h-8"})}),v.jsx(qI,{children:"No icons yet"}),v.jsx(UI,{className:"whitespace-nowrap",children:"Create your first icon to get started with Iconoma Studio"})]}),v.jsx(YI,{children:v.jsxs(At,{onClick:()=>t("/icons/create"),size:"lg",children:[v.jsx(tf,{}),"Create Icon"]})})]})}):v.jsxs("div",{className:"flex h-[calc(100vh-4rem)] flex-col gap-6 p-6",children:[v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("div",{className:"flex-1",children:v.jsx(ai,{placeholder:"Search icons by name, key, or tags...",value:a,onChange:S=>o(S.target.value),className:"max-w-md"})}),v.jsxs(x$,{value:c,onValueChange:S=>u(S),children:[v.jsx(w$,{className:"w-[120px]",children:v.jsx(S$,{})}),v.jsxs(k$,{children:[v.jsx($0,{value:"grid",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(KV,{className:"size-4"}),v.jsx("span",{children:"Grid"})]})}),v.jsx($0,{value:"list",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(n8,{className:"size-4"}),v.jsx("span",{children:"List"})]})})]})]})]}),x.length===0?v.jsx("div",{className:"flex flex-1 items-center justify-center",children:v.jsx("div",{className:"text-center",children:v.jsx("p",{className:"text-muted-foreground",children:"No icons found matching your search"})})}):c==="grid"?v.jsx("div",{className:"grid grid-cols-8 gap-4 overflow-y-auto",children:x.map(S=>v.jsxs("button",{onClick:()=>h(S),className:"group flex flex-col items-center gap-3 p-4 rounded-xl border hover:bg-accent cursor-pointer transition-all",children:[v.jsx("div",{className:"flex items-center justify-center w-full aspect-square p-4",children:v.jsx(rc,{content:S.svgContent,className:"w-full h-full max-w-[64px] max-h-[64px]"})}),v.jsxs("div",{className:"flex flex-col items-center gap-2 w-full min-w-0",children:[v.jsx("p",{className:"text-sm font-medium truncate w-full text-center",children:S.icon.name}),S.icon.tags.length>0&&v.jsxs("div",{className:"flex flex-wrap gap-1 justify-center max-w-full",children:[S.icon.tags.slice(0,2).map(k=>v.jsx(Za,{variant:"outline",className:"text-xs px-1.5 py-0",children:k},k)),S.icon.tags.length>2&&v.jsxs(Za,{variant:"outline",className:"text-xs px-1.5 py-0",children:["+",S.icon.tags.length-2]})]})]})]},S.iconKey))}):v.jsx("div",{className:"flex flex-col gap-2 overflow-y-auto",children:x.map(S=>v.jsxs("button",{onClick:()=>h(S),className:"group flex items-center gap-4 p-4 rounded-lg border bg-gradient-to-r from-card to-card/50 hover:from-card/90 hover:to-card/40 transition-all hover:shadow-md cursor-pointer text-left",children:[v.jsx("div",{className:"flex items-center justify-center w-16 h-16 shrink-0",children:v.jsx(rc,{content:S.svgContent,className:"w-full h-full max-w-[48px] max-h-[48px]"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[v.jsx("p",{className:"text-sm font-medium truncate",children:S.icon.name}),S.icon.tags.length>0&&v.jsxs("div",{className:"flex gap-1 flex-wrap",children:[S.icon.tags.slice(0,3).map(k=>v.jsx(Za,{variant:"outline",className:"text-xs px-1.5 py-0",children:k},k)),S.icon.tags.length>3&&v.jsxs(Za,{variant:"outline",className:"text-xs px-1.5 py-0",children:["+",S.icon.tags.length-3]})]})]}),v.jsx("pre",{className:"text-xs text-muted-foreground font-mono truncate max-w-full overflow-hidden",children:v.jsxs("code",{children:[S.svgContent.substring(0,100),"..."]})})]})]},S.iconKey))}),f&&v.jsx(AI,{open:!!f,onOpenChange:S=>!S&&h(null),children:v.jsxs(PI,{side:"right",className:"w-full sm:max-w-2xl overflow-y-auto",children:[v.jsxs(jI,{children:[v.jsx(NI,{children:f.icon.name}),v.jsx(DI,{children:f.icon.tags.length>0&&v.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:f.icon.tags.map(S=>v.jsx(Za,{variant:"secondary",className:"text-xs",children:S},S))})})]}),v.jsxs("div",{className:"flex flex-col gap-6 mt-6 px-6",children:[v.jsx("div",{className:"flex items-center justify-center p-8 rounded-xl border bg-gradient-to-br from-card to-card/50",children:v.jsx(rc,{content:f.svgContent,className:"w-full h-full max-w-[200px] max-h-[200px]"})}),v.jsx(f_,{iconKey:f.iconKey,componentName:f.componentName,svgContent:f.svgContent,colorVariableKeys:f.icon.colorVariableKeys})]}),v.jsxs(MI,{className:"flex-col gap-2 sm:flex-row",children:[v.jsxs(At,{onClick:()=>g(!0),variant:"destructive",className:"w-full sm:w-auto",children:[v.jsx(c_,{}),"Delete"]}),v.jsxs(At,{onClick:()=>{h(null),t(`/icons/${f.iconKey}/edit`)},className:"w-full sm:w-auto",children:[v.jsx(O8,{}),"Edit Icon"]})]})]})}),v.jsx(zx,{open:m,onOpenChange:g,children:v.jsxs(Lx,{children:[v.jsxs(Zx,{children:[v.jsx(Vx,{children:"Delete Icon"}),v.jsxs(Xx,{children:['Are you sure you want to delete "',f?.icon.name,'"? This action cannot be undone and will remove the icon from all targets.']})]}),v.jsxs(ZI,{children:[v.jsx(At,{variant:"outline",onClick:()=>g(!1),disabled:i.isPending,children:"Cancel"}),v.jsx(At,{variant:"destructive",onClick:async()=>{if(f)try{await i.mutateAsync(f.iconKey),bn.success("Icon deleted successfully"),g(!1),h(null)}catch{bn.error("Failed to delete icon")}},disabled:i.isPending,children:i.isPending?"Deleting...":"Delete"})]})]})})]})}var Zt="colors",rr="sizes",Me="space",GI={gap:Me,gridGap:Me,columnGap:Me,gridColumnGap:Me,rowGap:Me,gridRowGap:Me,inset:Me,insetBlock:Me,insetBlockEnd:Me,insetBlockStart:Me,insetInline:Me,insetInlineEnd:Me,insetInlineStart:Me,margin:Me,marginTop:Me,marginRight:Me,marginBottom:Me,marginLeft:Me,marginBlock:Me,marginBlockEnd:Me,marginBlockStart:Me,marginInline:Me,marginInlineEnd:Me,marginInlineStart:Me,padding:Me,paddingTop:Me,paddingRight:Me,paddingBottom:Me,paddingLeft:Me,paddingBlock:Me,paddingBlockEnd:Me,paddingBlockStart:Me,paddingInline:Me,paddingInlineEnd:Me,paddingInlineStart:Me,top:Me,right:Me,bottom:Me,left:Me,scrollMargin:Me,scrollMarginTop:Me,scrollMarginRight:Me,scrollMarginBottom:Me,scrollMarginLeft:Me,scrollMarginX:Me,scrollMarginY:Me,scrollMarginBlock:Me,scrollMarginBlockEnd:Me,scrollMarginBlockStart:Me,scrollMarginInline:Me,scrollMarginInlineEnd:Me,scrollMarginInlineStart:Me,scrollPadding:Me,scrollPaddingTop:Me,scrollPaddingRight:Me,scrollPaddingBottom:Me,scrollPaddingLeft:Me,scrollPaddingX:Me,scrollPaddingY:Me,scrollPaddingBlock:Me,scrollPaddingBlockEnd:Me,scrollPaddingBlockStart:Me,scrollPaddingInline:Me,scrollPaddingInlineEnd:Me,scrollPaddingInlineStart:Me,fontSize:"fontSizes",background:Zt,backgroundColor:Zt,backgroundImage:Zt,borderImage:Zt,border:Zt,borderBlock:Zt,borderBlockEnd:Zt,borderBlockStart:Zt,borderBottom:Zt,borderBottomColor:Zt,borderColor:Zt,borderInline:Zt,borderInlineEnd:Zt,borderInlineStart:Zt,borderLeft:Zt,borderLeftColor:Zt,borderRight:Zt,borderRightColor:Zt,borderTop:Zt,borderTopColor:Zt,caretColor:Zt,color:Zt,columnRuleColor:Zt,fill:Zt,outline:Zt,outlineColor:Zt,stroke:Zt,textDecorationColor:Zt,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:rr,minBlockSize:rr,maxBlockSize:rr,inlineSize:rr,minInlineSize:rr,maxInlineSize:rr,width:rr,minWidth:rr,maxWidth:rr,height:rr,minHeight:rr,maxHeight:rr,flexBasis:rr,gridTemplateColumns:rr,gridTemplateRows:rr,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},HI=(t,e)=>typeof e=="function"?{"()":Function.prototype.toString.call(e)}:e,af=()=>{const t=Object.create(null);return(e,n,...r)=>{const i=(a=>JSON.stringify(a,HI))(e);return i in t?t[i]:t[i]=n(e,...r)}},Op=Symbol.for("sxs.internal"),Bx=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),f2=t=>{for(const e in t)return!0;return!1},{hasOwnProperty:KI}=Object.prototype,P0=t=>t.includes("-")?t:t.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),JI=/\s+(?![^()]*\))/,Yl=t=>e=>t(...typeof e=="string"?String(e).split(JI):[e]),h2={appearance:t=>({WebkitAppearance:t,appearance:t}),backfaceVisibility:t=>({WebkitBackfaceVisibility:t,backfaceVisibility:t}),backdropFilter:t=>({WebkitBackdropFilter:t,backdropFilter:t}),backgroundClip:t=>({WebkitBackgroundClip:t,backgroundClip:t}),boxDecorationBreak:t=>({WebkitBoxDecorationBreak:t,boxDecorationBreak:t}),clipPath:t=>({WebkitClipPath:t,clipPath:t}),content:t=>({content:t.includes('"')||t.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(t)?t:`"${t}"`}),hyphens:t=>({WebkitHyphens:t,hyphens:t}),maskImage:t=>({WebkitMaskImage:t,maskImage:t}),maskSize:t=>({WebkitMaskSize:t,maskSize:t}),tabSize:t=>({MozTabSize:t,tabSize:t}),textSizeAdjust:t=>({WebkitTextSizeAdjust:t,textSizeAdjust:t}),userSelect:t=>({WebkitUserSelect:t,userSelect:t}),marginBlock:Yl(((t,e)=>({marginBlockStart:t,marginBlockEnd:e||t}))),marginInline:Yl(((t,e)=>({marginInlineStart:t,marginInlineEnd:e||t}))),maxSize:Yl(((t,e)=>({maxBlockSize:t,maxInlineSize:e||t}))),minSize:Yl(((t,e)=>({minBlockSize:t,minInlineSize:e||t}))),paddingBlock:Yl(((t,e)=>({paddingBlockStart:t,paddingBlockEnd:e||t}))),paddingInline:Yl(((t,e)=>({paddingInlineStart:t,paddingInlineEnd:e||t})))},cy=/([\d.]+)([^]*)/,e9=(t,e)=>t.length?t.reduce(((n,r)=>(n.push(...e.map((i=>i.includes("&")?i.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(i)?`:is(${r})`:r):r+" "+i))),n)),[]):e,t9=(t,e)=>t in n9&&typeof e=="string"?e.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((n,r,i,a)=>r+(i==="stretch"?`-moz-available${a};${P0(t)}:${r}-webkit-fill-available`:`-moz-fit-content${a};${P0(t)}:${r}fit-content`)+a)):String(e),n9={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},Ka=t=>t?t+"-":"",Y$=(t,e,n)=>t.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,((r,i,a,o,c)=>o=="$"==!!a?r:(i||o=="--"?"calc(":"")+"var(--"+(o==="$"?Ka(e)+(c.includes("$")?"":Ka(n))+c.replace(/\$/g,"-"):c)+")"+(i||o=="--"?"*"+(i||"")+(a||"1")+")":""))),r9=/\s*,\s*(?![^()]*\))/,i9=Object.prototype.toString,Kl=(t,e,n,r,i)=>{let a,o,c;const u=(f,h,m)=>{let g,y;const x=S=>{for(g in S){const C=g.charCodeAt(0)===64,E=C&&Array.isArray(S[g])?S[g]:[S[g]];for(y of E){const A=/[A-Z]/.test(T=g)?T:T.replace(/-[^]/g,(P=>P[1].toUpperCase())),$=typeof y=="object"&&y&&y.toString===i9&&(!r.utils[A]||!h.length);if(A in r.utils&&!$){const P=r.utils[A];if(P!==o){o=P,x(P(y)),o=null;continue}}else if(A in h2){const P=h2[A];if(P!==c){c=P,x(P(y)),c=null;continue}}if(C&&(k=g.slice(1)in r.media?"@media "+r.media[g.slice(1)]:g,g=k.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,((P,_,M,F,X,K)=>{const B=cy.test(_),ne=.0625*(B?-1:1),[G,fe]=B?[F,_]:[_,F];return"("+(M[0]==="="?"":M[0]===">"===B?"max-":"min-")+G+":"+(M[0]!=="="&&M.length===1?fe.replace(cy,((D,W,I)=>Number(W)+ne*(M===">"?1:-1)+I)):fe)+(X?") and ("+(X[0]===">"?"min-":"max-")+G+":"+(X.length===1?K.replace(cy,((D,W,I)=>Number(W)+ne*(X===">"?-1:1)+I)):K):"")+")"}))),$){const P=C?m.concat(g):[...m],_=C?[...h]:e9(h,g.split(r9));a!==void 0&&i(p2(...a)),a=void 0,u(y,_,P)}else a===void 0&&(a=[[],h,m]),g=C||g.charCodeAt(0)!==36?g:`--${Ka(r.prefix)}${g.slice(1).replace(/\$/g,"-")}`,y=$?y:typeof y=="number"?y&&A in a9?String(y)+"px":String(y):Y$(t9(A,y??""),r.prefix,r.themeMap[A]),a[0].push(`${C?`${g} `:`${P0(g)}:`}${y}`)}}var k,T};x(f),a!==void 0&&i(p2(...a)),a=void 0};u(t,e,n)},p2=(t,e,n)=>`${n.map((r=>`${r}{`)).join("")}${e.length?`${e.join(",")}{`:""}${t.join(";")}${e.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,a9={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},m2=t=>String.fromCharCode(t+(t>25?39:97)),jo=t=>(e=>{let n,r="";for(n=Math.abs(e);n>52;n=n/52|0)r=m2(n%52)+r;return m2(n%52)+r})(((e,n)=>{let r=n.length;for(;r;)e=33*e^n.charCodeAt(--r);return e})(5381,JSON.stringify(t))>>>0),nd=["themed","global","styled","onevar","resonevar","allvar","inline"],s9=t=>{if(t.href&&!t.href.startsWith(location.origin))return!1;try{return!!t.cssRules}catch{return!1}},o9=t=>{let e;const n=()=>{const{cssRules:i}=e.sheet;return[].map.call(i,((a,o)=>{const{cssText:c}=a;let u="";if(c.startsWith("--sxs"))return"";if(i[o-1]&&(u=i[o-1].cssText).startsWith("--sxs")){if(!a.cssRules.length)return"";for(const f in e.rules)if(e.rules[f].group===a)return`--sxs{--sxs:${[...e.rules[f].cache].join(" ")}}${c}`;return a.cssRules.length?`${u}${c}`:""}return c})).join("")},r=()=>{if(e){const{rules:c,sheet:u}=e;if(!u.deleteRule){for(;Object(Object(u.cssRules)[0]).type===3;)u.cssRules.splice(0,1);u.cssRules=[]}for(const f in c)delete c[f]}const i=Object(t).styleSheets||[];for(const c of i)if(s9(c)){for(let u=0,f=c.cssRules;f[u];++u){const h=Object(f[u]);if(h.type!==1)continue;const m=Object(f[u+1]);if(m.type!==4)continue;++u;const{cssText:g}=h;if(!g.startsWith("--sxs"))continue;const y=g.slice(14,-3).trim().split(/\s+/),x=nd[y[0]];x&&(e||(e={sheet:c,reset:r,rules:{},toString:n}),e.rules[x]={group:m,index:u,cache:new Set(y)})}if(e)break}if(!e){const c=(u,f)=>({type:f,cssRules:[],insertRule(h,m){this.cssRules.splice(m,0,c(h,{import:3,undefined:1}[(h.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return u==="@media{}"?`@media{${[].map.call(this.cssRules,(h=>h.cssText)).join("")}}`:u}});e={sheet:t?(t.head||t).appendChild(document.createElement("style")).sheet:c("","text/css"),rules:{},reset:r,toString:n}}const{sheet:a,rules:o}=e;for(let c=nd.length-1;c>=0;--c){const u=nd[c];if(!o[u]){const f=nd[c+1],h=o[f]?o[f].index:a.cssRules.length;a.insertRule("@media{}",h),a.insertRule(`--sxs{--sxs:${c}}`,h),o[u]={group:a.cssRules[h+1],index:h,cache:new Set([c])}}l9(o[u])}};return r(),e},l9=t=>{const e=t.group;let n=e.cssRules.length;t.apply=r=>{try{e.insertRule(r,n),++n}catch{}}},Iu=Symbol(),c9=af(),u9=(t,e)=>c9(t,(()=>(...n)=>{let r={type:null,composers:new Set};for(const i of n)if(i!=null)if(i[Op]){r.type==null&&(r.type=i[Op].type);for(const a of i[Op].composers)r.composers.add(a)}else i.constructor!==Object||i.$$typeof?r.type==null&&(r.type=i):r.composers.add(d9(i,t));return r.type==null&&(r.type="span"),r.composers.size||r.composers.add(["PJLV",{},[],[],{},[]]),f9(t,r,e)})),d9=({variants:t,compoundVariants:e,defaultVariants:n,...r},i)=>{const a=`${Ka(i.prefix)}c-${jo(r)}`,o=[],c=[],u=Object.create(null),f=[];for(const g in n)u[g]=String(n[g]);if(typeof t=="object"&&t)for(const g in t){h=u,m=g,KI.call(h,m)||(u[g]="undefined");const y=t[g];for(const x in y){const S={[g]:String(x)};String(x)==="undefined"&&f.push(g);const k=y[x],T=[S,k,!f2(k)];o.push(T)}}var h,m;if(typeof e=="object"&&e)for(const g of e){let{css:y,...x}=g;y=typeof y=="object"&&y||{};for(const k in x)x[k]=String(x[k]);const S=[x,y,!f2(y)];c.push(S)}return[a,r,o,c,u,f]},f9=(t,e,n)=>{const[r,i,a,o]=h9(e.composers),c=typeof e.type=="function"||e.type.$$typeof?(m=>{function g(){for(let y=0;y<g[Iu].length;y++){const[x,S]=g[Iu][y];m.rules[x].apply(S)}return g[Iu]=[],null}return g[Iu]=[],g.rules={},nd.forEach((y=>g.rules[y]={apply:x=>g[Iu].push([y,x])})),g})(n):null,u=(c||n).rules,f=`.${r}${i.length>1?`:where(.${i.slice(1).join(".")})`:""}`,h=m=>{m=typeof m=="object"&&m||p9;const{css:g,...y}=m,x={};for(const T in a)if(delete y[T],T in m){let C=m[T];typeof C=="object"&&C?x[T]={"@initial":a[T],...C}:(C=String(C),x[T]=C!=="undefined"||o.has(T)?C:a[T])}else x[T]=a[T];const S=new Set([...i]);for(const[T,C,E,A]of e.composers){n.rules.styled.cache.has(T)||(n.rules.styled.cache.add(T),Kl(C,[`.${T}`],[],t,(_=>{u.styled.apply(_)})));const $=g2(E,x,t.media),P=g2(A,x,t.media,!0);for(const _ of $)if(_!==void 0)for(const[M,F,X]of _){const K=`${T}-${jo(F)}-${M}`;S.add(K);const B=(X?n.rules.resonevar:n.rules.onevar).cache,ne=X?u.resonevar:u.onevar;B.has(K)||(B.add(K),Kl(F,[`.${K}`],[],t,(G=>{ne.apply(G)})))}for(const _ of P)if(_!==void 0)for(const[M,F]of _){const X=`${T}-${jo(F)}-${M}`;S.add(X),n.rules.allvar.cache.has(X)||(n.rules.allvar.cache.add(X),Kl(F,[`.${X}`],[],t,(K=>{u.allvar.apply(K)})))}}if(typeof g=="object"&&g){const T=`${r}-i${jo(g)}-css`;S.add(T),n.rules.inline.cache.has(T)||(n.rules.inline.cache.add(T),Kl(g,[`.${T}`],[],t,(C=>{u.inline.apply(C)})))}for(const T of String(m.className||"").trim().split(/\s+/))T&&S.add(T);const k=y.className=[...S].join(" ");return{type:e.type,className:k,selector:f,props:y,toString:()=>k,deferredInjector:c}};return Bx(h,{className:r,selector:f,[Op]:e,toString:()=>(n.rules.styled.cache.has(r)||h(),r)})},h9=t=>{let e="";const n=[],r={},i=[];for(const[a,,,,o,c]of t){e===""&&(e=a),n.push(a),i.push(...c);for(const u in o){const f=o[u];(r[u]===void 0||f!=="undefined"||c.includes(f))&&(r[u]=f)}}return[e,n,r,new Set(i)]},g2=(t,e,n,r)=>{const i=[];e:for(let[a,o,c]of t){if(c)continue;let u,f=0,h=!1;for(u in a){const m=a[u];let g=e[u];if(g!==m){if(typeof g!="object"||!g)continue e;{let y,x,S=0;for(const k in g){if(m===String(g[k])){if(k!=="@initial"){const T=k.slice(1);(x=x||[]).push(T in n?n[T]:k.replace(/^@media ?/,"")),h=!0}f+=S,y=!0}++S}if(x&&x.length&&(o={["@media "+x.join(", ")]:o}),!y)continue e}}}(i[f]=i[f]||[]).push([r?"cv":`${u}-${a[u]}`,o,h])}return i},p9={},m9=af(),g9=(t,e)=>m9(t,(()=>(...n)=>{const r=()=>{for(let i of n){i=typeof i=="object"&&i||{};let a=jo(i);if(!e.rules.global.cache.has(a)){if(e.rules.global.cache.add(a),"@import"in i){let o=[].indexOf.call(e.sheet.cssRules,e.rules.themed.group)-1;for(let c of[].concat(i["@import"]))c=c.includes('"')||c.includes("'")?c:`"${c}"`,e.sheet.insertRule(`@import ${c};`,o++);delete i["@import"]}Kl(i,[],[],t,(o=>{e.rules.global.apply(o)}))}}return""};return Bx(r,{toString:r})})),O9=af(),v9=(t,e)=>O9(t,(()=>n=>{const r=`${Ka(t.prefix)}k-${jo(n)}`,i=()=>{if(!e.rules.global.cache.has(r)){e.rules.global.cache.add(r);const a=[];Kl(n,[],[],t,(c=>a.push(c)));const o=`@keyframes ${r}{${a.join("")}}`;e.rules.global.apply(o)}return r};return Bx(i,{get name(){return i()},toString:i})})),y9=class{constructor(t,e,n,r){this.token=t==null?"":String(t),this.value=e==null?"":String(e),this.scale=n==null?"":String(n),this.prefix=r==null?"":String(r)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+Ka(this.prefix)+Ka(this.scale)+this.token}toString(){return this.computedValue}},b9=af(),x9=(t,e)=>b9(t,(()=>(n,r)=>{r=typeof n=="object"&&n||Object(r);const i=`.${n=(n=typeof n=="string"?n:"")||`${Ka(t.prefix)}t-${jo(r)}`}`,a={},o=[];for(const u in r){a[u]={};for(const f in r[u]){const h=`--${Ka(t.prefix)}${u}-${f}`,m=Y$(String(r[u][f]),t.prefix,u);a[u][f]=new y9(f,m,u,t.prefix),o.push(`${h}:${m}`)}}const c=()=>{if(o.length&&!e.rules.themed.cache.has(n)){e.rules.themed.cache.add(n);const u=`${r===t.theme?":root,":""}.${n}{${o.join(";")}}`;e.rules.themed.apply(u)}return n};return{...a,get className(){return c()},selector:i,toString:c}})),S9=af(),w9=t=>{let e=!1;const n=S9(t,(r=>{e=!0;const i="prefix"in(r=typeof r=="object"&&r||{})?String(r.prefix):"",a=typeof r.media=="object"&&r.media||{},o=typeof r.root=="object"?r.root||null:globalThis.document||null,c=typeof r.theme=="object"&&r.theme||{},u={prefix:i,media:a,theme:c,themeMap:typeof r.themeMap=="object"&&r.themeMap||{...GI},utils:typeof r.utils=="object"&&r.utils||{}},f=o9(o),h={css:u9(u,f),globalCss:g9(u,f),keyframes:v9(u,f),createTheme:x9(u,f),reset(){f.reset(),h.theme.toString()},theme:{},sheet:f,config:u,prefix:i,getCssText:f.toString,toString:f.toString};return String(h.theme=h.createTheme(c)),h}));return e||n.reset(),n},O2=Object.prototype.hasOwnProperty;function v2(t,e,n){for(n of t.keys())if(ld(n,e))return n}function ld(t,e){var n,r,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&ld(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(i=r,i&&typeof i=="object"&&(i=v2(e,i),!i)||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(i=r[0],i&&typeof i=="object"&&(i=v2(e,i),!i)||!ld(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(O2.call(t,n)&&++r&&!O2.call(e,n)||!(n in e)||!ld(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}const k9="modulepreload",C9=function(t){return"/"+t},y2={},uy=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let u=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=o?.nonce||o?.getAttribute("nonce");i=u(n.map(f=>{if(f=C9(f),f in y2)return;y2[f]=!0;const h=f.endsWith(".css"),m=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${m}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":k9,h||(g.as="script"),g.crossOrigin="",g.href=f,c&&g.setAttribute("nonce",c),document.head.appendChild(g),h)return new Promise((y,x)=>{g.addEventListener("load",y),g.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return i.then(o=>{for(const c of o||[])c.status==="rejected"&&a(c.reason);return e().catch(a)})};var T9=/(%?)(%([sdjo]))/g;function E9(t,e){switch(e){case"s":return t;case"d":case"i":return Number(t);case"j":return JSON.stringify(t);case"o":{if(typeof t=="string")return t;const n=JSON.stringify(t);return n==="{}"||n==="[]"||/^\[object .+?\]$/.test(n)?t:n}}}function j0(t,...e){if(e.length===0)return t;let n=0,r=t.replace(T9,(i,a,o,c)=>{const u=e[n],f=E9(u,c);return a?i:(n++,f)});return n<e.length&&(r+=` ${e.slice(n).join(" ")}`),r=r.replace(/%{2,2}/g,"%"),r}var Q9=2;function R9(t){if(!t.stack)return;const e=t.stack.split(`
73
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return w.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},QI="DialogDescriptionWarning",RI=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${L$(QI).contentName}}.`;return w.useEffect(()=>{const i=t.current?.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},Z$=T$,V$=R$,X$=A$,B$=_$,I$=P$,q$=M$,U$=D$;function AI({...t}){return v.jsx(Z$,{"data-slot":"sheet",...t})}function _I({...t}){return v.jsx(V$,{"data-slot":"sheet-portal",...t})}function $I({className:t,...e}){return v.jsx(X$,{"data-slot":"sheet-overlay",className:Be("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function PI({className:t,children:e,side:n="right",...r}){return v.jsxs(_I,{children:[v.jsx($I,{}),v.jsxs(B$,{"data-slot":"sheet-content",className:Be("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...r,children:[e,v.jsxs(U$,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[v.jsx(u_,{className:"size-4"}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function jI({className:t,...e}){return v.jsx("div",{"data-slot":"sheet-header",className:Be("flex flex-col gap-1.5 p-4",t),...e})}function MI({className:t,...e}){return v.jsx("div",{"data-slot":"sheet-footer",className:Be("mt-auto flex flex-col gap-2 p-4",t),...e})}function NI({className:t,...e}){return v.jsx(I$,{"data-slot":"sheet-title",className:Be("text-foreground font-semibold",t),...e})}function DI({className:t,...e}){return v.jsx(q$,{"data-slot":"sheet-description",className:Be("text-muted-foreground text-sm",t),...e})}function zx({...t}){return v.jsx(Z$,{"data-slot":"dialog",...t})}function zI({...t}){return v.jsx(V$,{"data-slot":"dialog-portal",...t})}function LI({className:t,...e}){return v.jsx(X$,{"data-slot":"dialog-overlay",className:Be("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function Lx({className:t,children:e,showCloseButton:n=!0,...r}){return v.jsxs(zI,{"data-slot":"dialog-portal",children:[v.jsx(LI,{}),v.jsxs(B$,{"data-slot":"dialog-content",className:Be("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",t),...r,children:[e,n&&v.jsxs(U$,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[v.jsx(u_,{}),v.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Zx({className:t,...e}){return v.jsx("div",{"data-slot":"dialog-header",className:Be("flex flex-col gap-2 text-center sm:text-left",t),...e})}function ZI({className:t,...e}){return v.jsx("div",{"data-slot":"dialog-footer",className:Be("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...e})}function Vx({className:t,...e}){return v.jsx(I$,{"data-slot":"dialog-title",className:Be("text-lg leading-none font-semibold",t),...e})}function Xx({className:t,...e}){return v.jsx(q$,{"data-slot":"dialog-description",className:Be("text-muted-foreground text-sm",t),...e})}function VI({className:t,...e}){return v.jsx("div",{"data-slot":"empty",className:Be("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",t),...e})}function XI({className:t,...e}){return v.jsx("div",{"data-slot":"empty-header",className:Be("flex max-w-sm flex-col items-center gap-2 text-center",t),...e})}const BI=Nm("flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function II({className:t,variant:e="default",...n}){return v.jsx("div",{"data-slot":"empty-icon","data-variant":e,className:Be(BI({variant:e,className:t})),...n})}function qI({className:t,...e}){return v.jsx("div",{"data-slot":"empty-title",className:Be("text-lg font-medium tracking-tight",t),...e})}function UI({className:t,...e}){return v.jsx("div",{"data-slot":"empty-description",className:Be("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",t),...e})}function YI({className:t,...e}){return v.jsx("div",{"data-slot":"empty-content",className:Be("flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",t),...e})}const FI=Nm("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Za({className:t,variant:e,asChild:n=!1,...r}){const i=n?XA:"span";return v.jsx(i,{"data-slot":"badge",className:Be(FI({variant:e}),t),...r})}function WI(){const t=Ko(),{data:e,isPending:n,error:r}=T6(),i=E6(),[a,o]=w.useState(""),[c,u]=w.useState("grid"),[f,h]=w.useState(null),[m,g]=w.useState(!1),y=e?.icons||[],x=w.useMemo(()=>{if(!a.trim())return y;const S=a.toLowerCase();return y.filter(k=>{const T=k.iconKey.toLowerCase().includes(S),C=k.icon.name.toLowerCase().includes(S),E=k.icon.tags.some(A=>A.toLowerCase().includes(S));return T||C||E})},[y,a]);return n?v.jsx("div",{className:"flex h-[calc(100vh-4rem)] items-center justify-center",children:v.jsx("div",{className:"text-muted-foreground",children:"Loading icons..."})}):r?v.jsx("div",{className:"flex h-[calc(100vh-4rem)] items-center justify-center",children:v.jsx("div",{className:"text-destructive",children:"Failed to load icons"})}):y.length===0?v.jsx("div",{className:"flex h-[calc(100vh-4rem)] w-full items-center justify-center p-6",children:v.jsxs(VI,{className:"max-w-md border border-dotted",children:[v.jsxs(XI,{children:[v.jsx(II,{variant:"icon",children:v.jsx("img",{src:"/icon.png",alt:"Iconoma Logo",className:"w-8 h-8"})}),v.jsx(qI,{children:"No icons yet"}),v.jsx(UI,{className:"whitespace-nowrap",children:"Create your first icon to get started with Iconoma Studio"})]}),v.jsx(YI,{children:v.jsxs(At,{onClick:()=>t("/icons/create"),size:"lg",children:[v.jsx(tf,{}),"Create Icon"]})})]})}):v.jsxs("div",{className:"flex h-[calc(100vh-4rem)] flex-col gap-6 p-6",children:[v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx("div",{className:"flex-1",children:v.jsx(ai,{placeholder:"Search icons by name, key, or tags...",value:a,onChange:S=>o(S.target.value),className:"max-w-md"})}),v.jsxs(x$,{value:c,onValueChange:S=>u(S),children:[v.jsx(w$,{className:"w-[120px]",children:v.jsx(S$,{})}),v.jsxs(k$,{children:[v.jsx($0,{value:"grid",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(KV,{className:"size-4"}),v.jsx("span",{children:"Grid"})]})}),v.jsx($0,{value:"list",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(n8,{className:"size-4"}),v.jsx("span",{children:"List"})]})})]})]})]}),x.length===0?v.jsx("div",{className:"flex flex-1 items-center justify-center",children:v.jsx("div",{className:"text-center",children:v.jsx("p",{className:"text-muted-foreground",children:"No icons found matching your search"})})}):c==="grid"?v.jsx("div",{className:"grid grid-cols-8 gap-4 overflow-y-auto",children:x.map(S=>v.jsxs("button",{onClick:()=>h(S),className:"group flex flex-col items-center gap-3 p-4 rounded-xl border hover:bg-accent cursor-pointer transition-all",children:[v.jsx("div",{className:"flex items-center justify-center w-full aspect-square p-4",children:v.jsx(rc,{content:S.svgContent,className:"w-full h-full max-w-[64px] flex justify-center items-center object-contain"})}),v.jsxs("div",{className:"flex flex-col items-center gap-2 w-full min-w-0",children:[v.jsx("p",{className:"text-sm font-medium truncate w-full text-center",children:S.icon.name}),S.icon.tags.length>0&&v.jsxs("div",{className:"flex flex-wrap gap-1 justify-center max-w-full",children:[S.icon.tags.slice(0,2).map(k=>v.jsx(Za,{variant:"outline",className:"text-xs px-1.5 py-0",children:k},k)),S.icon.tags.length>2&&v.jsxs(Za,{variant:"outline",className:"text-xs px-1.5 py-0",children:["+",S.icon.tags.length-2]})]})]})]},S.iconKey))}):v.jsx("div",{className:"flex flex-col gap-2 overflow-y-auto",children:x.map(S=>v.jsxs("button",{onClick:()=>h(S),className:"group flex items-center gap-4 p-4 rounded-lg border bg-gradient-to-r from-card to-card/50 hover:from-card/90 hover:to-card/40 transition-all hover:shadow-md cursor-pointer text-left",children:[v.jsx("div",{className:"flex items-center justify-center w-16 h-16 shrink-0",children:v.jsx(rc,{content:S.svgContent,className:"w-full h-full max-w-[48px] flex justify-center items-center object-contain"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[v.jsx("p",{className:"text-sm font-medium truncate",children:S.icon.name}),S.icon.tags.length>0&&v.jsxs("div",{className:"flex gap-1 flex-wrap",children:[S.icon.tags.slice(0,3).map(k=>v.jsx(Za,{variant:"outline",className:"text-xs px-1.5 py-0",children:k},k)),S.icon.tags.length>3&&v.jsxs(Za,{variant:"outline",className:"text-xs px-1.5 py-0",children:["+",S.icon.tags.length-3]})]})]}),v.jsx("pre",{className:"text-xs text-muted-foreground font-mono truncate max-w-full overflow-hidden",children:v.jsxs("code",{children:[S.svgContent.substring(0,100),"..."]})})]})]},S.iconKey))}),f&&v.jsx(AI,{open:!!f,onOpenChange:S=>!S&&h(null),children:v.jsxs(PI,{side:"right",className:"w-full sm:max-w-2xl overflow-y-auto",children:[v.jsxs(jI,{children:[v.jsx(NI,{children:f.icon.name}),v.jsx(DI,{children:f.icon.tags.length>0&&v.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:f.icon.tags.map(S=>v.jsx(Za,{variant:"secondary",className:"text-xs",children:S},S))})})]}),v.jsxs("div",{className:"flex flex-col gap-6 mt-6 px-6",children:[v.jsx("div",{className:"flex items-center justify-center p-8 rounded-xl border bg-gradient-to-br from-card to-card/50",children:v.jsx(rc,{content:f.svgContent,className:"w-full h-full max-w-[200px] flex justify-center items-center object-contain"})}),v.jsx(f_,{iconKey:f.iconKey,componentName:f.componentName,svgContent:f.svgContent,colorVariableKeys:f.icon.colorVariableKeys})]}),v.jsxs(MI,{className:"flex-col gap-2 sm:flex-row",children:[v.jsxs(At,{onClick:()=>g(!0),variant:"destructive",className:"w-full sm:w-auto",children:[v.jsx(c_,{}),"Delete"]}),v.jsxs(At,{onClick:()=>{h(null),t(`/icons/${f.iconKey}/edit`)},className:"w-full sm:w-auto",children:[v.jsx(O8,{}),"Edit Icon"]})]})]})}),v.jsx(zx,{open:m,onOpenChange:g,children:v.jsxs(Lx,{children:[v.jsxs(Zx,{children:[v.jsx(Vx,{children:"Delete Icon"}),v.jsxs(Xx,{children:['Are you sure you want to delete "',f?.icon.name,'"? This action cannot be undone and will remove the icon from all targets.']})]}),v.jsxs(ZI,{children:[v.jsx(At,{variant:"outline",onClick:()=>g(!1),disabled:i.isPending,children:"Cancel"}),v.jsx(At,{variant:"destructive",onClick:async()=>{if(f)try{await i.mutateAsync(f.iconKey),bn.success("Icon deleted successfully"),g(!1),h(null)}catch{bn.error("Failed to delete icon")}},disabled:i.isPending,children:i.isPending?"Deleting...":"Delete"})]})]})})]})}var Zt="colors",rr="sizes",Me="space",GI={gap:Me,gridGap:Me,columnGap:Me,gridColumnGap:Me,rowGap:Me,gridRowGap:Me,inset:Me,insetBlock:Me,insetBlockEnd:Me,insetBlockStart:Me,insetInline:Me,insetInlineEnd:Me,insetInlineStart:Me,margin:Me,marginTop:Me,marginRight:Me,marginBottom:Me,marginLeft:Me,marginBlock:Me,marginBlockEnd:Me,marginBlockStart:Me,marginInline:Me,marginInlineEnd:Me,marginInlineStart:Me,padding:Me,paddingTop:Me,paddingRight:Me,paddingBottom:Me,paddingLeft:Me,paddingBlock:Me,paddingBlockEnd:Me,paddingBlockStart:Me,paddingInline:Me,paddingInlineEnd:Me,paddingInlineStart:Me,top:Me,right:Me,bottom:Me,left:Me,scrollMargin:Me,scrollMarginTop:Me,scrollMarginRight:Me,scrollMarginBottom:Me,scrollMarginLeft:Me,scrollMarginX:Me,scrollMarginY:Me,scrollMarginBlock:Me,scrollMarginBlockEnd:Me,scrollMarginBlockStart:Me,scrollMarginInline:Me,scrollMarginInlineEnd:Me,scrollMarginInlineStart:Me,scrollPadding:Me,scrollPaddingTop:Me,scrollPaddingRight:Me,scrollPaddingBottom:Me,scrollPaddingLeft:Me,scrollPaddingX:Me,scrollPaddingY:Me,scrollPaddingBlock:Me,scrollPaddingBlockEnd:Me,scrollPaddingBlockStart:Me,scrollPaddingInline:Me,scrollPaddingInlineEnd:Me,scrollPaddingInlineStart:Me,fontSize:"fontSizes",background:Zt,backgroundColor:Zt,backgroundImage:Zt,borderImage:Zt,border:Zt,borderBlock:Zt,borderBlockEnd:Zt,borderBlockStart:Zt,borderBottom:Zt,borderBottomColor:Zt,borderColor:Zt,borderInline:Zt,borderInlineEnd:Zt,borderInlineStart:Zt,borderLeft:Zt,borderLeftColor:Zt,borderRight:Zt,borderRightColor:Zt,borderTop:Zt,borderTopColor:Zt,caretColor:Zt,color:Zt,columnRuleColor:Zt,fill:Zt,outline:Zt,outlineColor:Zt,stroke:Zt,textDecorationColor:Zt,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:rr,minBlockSize:rr,maxBlockSize:rr,inlineSize:rr,minInlineSize:rr,maxInlineSize:rr,width:rr,minWidth:rr,maxWidth:rr,height:rr,minHeight:rr,maxHeight:rr,flexBasis:rr,gridTemplateColumns:rr,gridTemplateRows:rr,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},HI=(t,e)=>typeof e=="function"?{"()":Function.prototype.toString.call(e)}:e,af=()=>{const t=Object.create(null);return(e,n,...r)=>{const i=(a=>JSON.stringify(a,HI))(e);return i in t?t[i]:t[i]=n(e,...r)}},Op=Symbol.for("sxs.internal"),Bx=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),f2=t=>{for(const e in t)return!0;return!1},{hasOwnProperty:KI}=Object.prototype,P0=t=>t.includes("-")?t:t.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),JI=/\s+(?![^()]*\))/,Yl=t=>e=>t(...typeof e=="string"?String(e).split(JI):[e]),h2={appearance:t=>({WebkitAppearance:t,appearance:t}),backfaceVisibility:t=>({WebkitBackfaceVisibility:t,backfaceVisibility:t}),backdropFilter:t=>({WebkitBackdropFilter:t,backdropFilter:t}),backgroundClip:t=>({WebkitBackgroundClip:t,backgroundClip:t}),boxDecorationBreak:t=>({WebkitBoxDecorationBreak:t,boxDecorationBreak:t}),clipPath:t=>({WebkitClipPath:t,clipPath:t}),content:t=>({content:t.includes('"')||t.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(t)?t:`"${t}"`}),hyphens:t=>({WebkitHyphens:t,hyphens:t}),maskImage:t=>({WebkitMaskImage:t,maskImage:t}),maskSize:t=>({WebkitMaskSize:t,maskSize:t}),tabSize:t=>({MozTabSize:t,tabSize:t}),textSizeAdjust:t=>({WebkitTextSizeAdjust:t,textSizeAdjust:t}),userSelect:t=>({WebkitUserSelect:t,userSelect:t}),marginBlock:Yl(((t,e)=>({marginBlockStart:t,marginBlockEnd:e||t}))),marginInline:Yl(((t,e)=>({marginInlineStart:t,marginInlineEnd:e||t}))),maxSize:Yl(((t,e)=>({maxBlockSize:t,maxInlineSize:e||t}))),minSize:Yl(((t,e)=>({minBlockSize:t,minInlineSize:e||t}))),paddingBlock:Yl(((t,e)=>({paddingBlockStart:t,paddingBlockEnd:e||t}))),paddingInline:Yl(((t,e)=>({paddingInlineStart:t,paddingInlineEnd:e||t})))},cy=/([\d.]+)([^]*)/,e9=(t,e)=>t.length?t.reduce(((n,r)=>(n.push(...e.map((i=>i.includes("&")?i.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(i)?`:is(${r})`:r):r+" "+i))),n)),[]):e,t9=(t,e)=>t in n9&&typeof e=="string"?e.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((n,r,i,a)=>r+(i==="stretch"?`-moz-available${a};${P0(t)}:${r}-webkit-fill-available`:`-moz-fit-content${a};${P0(t)}:${r}fit-content`)+a)):String(e),n9={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},Ka=t=>t?t+"-":"",Y$=(t,e,n)=>t.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,((r,i,a,o,c)=>o=="$"==!!a?r:(i||o=="--"?"calc(":"")+"var(--"+(o==="$"?Ka(e)+(c.includes("$")?"":Ka(n))+c.replace(/\$/g,"-"):c)+")"+(i||o=="--"?"*"+(i||"")+(a||"1")+")":""))),r9=/\s*,\s*(?![^()]*\))/,i9=Object.prototype.toString,Kl=(t,e,n,r,i)=>{let a,o,c;const u=(f,h,m)=>{let g,y;const x=S=>{for(g in S){const C=g.charCodeAt(0)===64,E=C&&Array.isArray(S[g])?S[g]:[S[g]];for(y of E){const A=/[A-Z]/.test(T=g)?T:T.replace(/-[^]/g,(P=>P[1].toUpperCase())),$=typeof y=="object"&&y&&y.toString===i9&&(!r.utils[A]||!h.length);if(A in r.utils&&!$){const P=r.utils[A];if(P!==o){o=P,x(P(y)),o=null;continue}}else if(A in h2){const P=h2[A];if(P!==c){c=P,x(P(y)),c=null;continue}}if(C&&(k=g.slice(1)in r.media?"@media "+r.media[g.slice(1)]:g,g=k.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,((P,_,M,F,X,K)=>{const B=cy.test(_),ne=.0625*(B?-1:1),[G,fe]=B?[F,_]:[_,F];return"("+(M[0]==="="?"":M[0]===">"===B?"max-":"min-")+G+":"+(M[0]!=="="&&M.length===1?fe.replace(cy,((D,W,I)=>Number(W)+ne*(M===">"?1:-1)+I)):fe)+(X?") and ("+(X[0]===">"?"min-":"max-")+G+":"+(X.length===1?K.replace(cy,((D,W,I)=>Number(W)+ne*(X===">"?-1:1)+I)):K):"")+")"}))),$){const P=C?m.concat(g):[...m],_=C?[...h]:e9(h,g.split(r9));a!==void 0&&i(p2(...a)),a=void 0,u(y,_,P)}else a===void 0&&(a=[[],h,m]),g=C||g.charCodeAt(0)!==36?g:`--${Ka(r.prefix)}${g.slice(1).replace(/\$/g,"-")}`,y=$?y:typeof y=="number"?y&&A in a9?String(y)+"px":String(y):Y$(t9(A,y??""),r.prefix,r.themeMap[A]),a[0].push(`${C?`${g} `:`${P0(g)}:`}${y}`)}}var k,T};x(f),a!==void 0&&i(p2(...a)),a=void 0};u(t,e,n)},p2=(t,e,n)=>`${n.map((r=>`${r}{`)).join("")}${e.length?`${e.join(",")}{`:""}${t.join(";")}${e.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,a9={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},m2=t=>String.fromCharCode(t+(t>25?39:97)),jo=t=>(e=>{let n,r="";for(n=Math.abs(e);n>52;n=n/52|0)r=m2(n%52)+r;return m2(n%52)+r})(((e,n)=>{let r=n.length;for(;r;)e=33*e^n.charCodeAt(--r);return e})(5381,JSON.stringify(t))>>>0),nd=["themed","global","styled","onevar","resonevar","allvar","inline"],s9=t=>{if(t.href&&!t.href.startsWith(location.origin))return!1;try{return!!t.cssRules}catch{return!1}},o9=t=>{let e;const n=()=>{const{cssRules:i}=e.sheet;return[].map.call(i,((a,o)=>{const{cssText:c}=a;let u="";if(c.startsWith("--sxs"))return"";if(i[o-1]&&(u=i[o-1].cssText).startsWith("--sxs")){if(!a.cssRules.length)return"";for(const f in e.rules)if(e.rules[f].group===a)return`--sxs{--sxs:${[...e.rules[f].cache].join(" ")}}${c}`;return a.cssRules.length?`${u}${c}`:""}return c})).join("")},r=()=>{if(e){const{rules:c,sheet:u}=e;if(!u.deleteRule){for(;Object(Object(u.cssRules)[0]).type===3;)u.cssRules.splice(0,1);u.cssRules=[]}for(const f in c)delete c[f]}const i=Object(t).styleSheets||[];for(const c of i)if(s9(c)){for(let u=0,f=c.cssRules;f[u];++u){const h=Object(f[u]);if(h.type!==1)continue;const m=Object(f[u+1]);if(m.type!==4)continue;++u;const{cssText:g}=h;if(!g.startsWith("--sxs"))continue;const y=g.slice(14,-3).trim().split(/\s+/),x=nd[y[0]];x&&(e||(e={sheet:c,reset:r,rules:{},toString:n}),e.rules[x]={group:m,index:u,cache:new Set(y)})}if(e)break}if(!e){const c=(u,f)=>({type:f,cssRules:[],insertRule(h,m){this.cssRules.splice(m,0,c(h,{import:3,undefined:1}[(h.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return u==="@media{}"?`@media{${[].map.call(this.cssRules,(h=>h.cssText)).join("")}}`:u}});e={sheet:t?(t.head||t).appendChild(document.createElement("style")).sheet:c("","text/css"),rules:{},reset:r,toString:n}}const{sheet:a,rules:o}=e;for(let c=nd.length-1;c>=0;--c){const u=nd[c];if(!o[u]){const f=nd[c+1],h=o[f]?o[f].index:a.cssRules.length;a.insertRule("@media{}",h),a.insertRule(`--sxs{--sxs:${c}}`,h),o[u]={group:a.cssRules[h+1],index:h,cache:new Set([c])}}l9(o[u])}};return r(),e},l9=t=>{const e=t.group;let n=e.cssRules.length;t.apply=r=>{try{e.insertRule(r,n),++n}catch{}}},Iu=Symbol(),c9=af(),u9=(t,e)=>c9(t,(()=>(...n)=>{let r={type:null,composers:new Set};for(const i of n)if(i!=null)if(i[Op]){r.type==null&&(r.type=i[Op].type);for(const a of i[Op].composers)r.composers.add(a)}else i.constructor!==Object||i.$$typeof?r.type==null&&(r.type=i):r.composers.add(d9(i,t));return r.type==null&&(r.type="span"),r.composers.size||r.composers.add(["PJLV",{},[],[],{},[]]),f9(t,r,e)})),d9=({variants:t,compoundVariants:e,defaultVariants:n,...r},i)=>{const a=`${Ka(i.prefix)}c-${jo(r)}`,o=[],c=[],u=Object.create(null),f=[];for(const g in n)u[g]=String(n[g]);if(typeof t=="object"&&t)for(const g in t){h=u,m=g,KI.call(h,m)||(u[g]="undefined");const y=t[g];for(const x in y){const S={[g]:String(x)};String(x)==="undefined"&&f.push(g);const k=y[x],T=[S,k,!f2(k)];o.push(T)}}var h,m;if(typeof e=="object"&&e)for(const g of e){let{css:y,...x}=g;y=typeof y=="object"&&y||{};for(const k in x)x[k]=String(x[k]);const S=[x,y,!f2(y)];c.push(S)}return[a,r,o,c,u,f]},f9=(t,e,n)=>{const[r,i,a,o]=h9(e.composers),c=typeof e.type=="function"||e.type.$$typeof?(m=>{function g(){for(let y=0;y<g[Iu].length;y++){const[x,S]=g[Iu][y];m.rules[x].apply(S)}return g[Iu]=[],null}return g[Iu]=[],g.rules={},nd.forEach((y=>g.rules[y]={apply:x=>g[Iu].push([y,x])})),g})(n):null,u=(c||n).rules,f=`.${r}${i.length>1?`:where(.${i.slice(1).join(".")})`:""}`,h=m=>{m=typeof m=="object"&&m||p9;const{css:g,...y}=m,x={};for(const T in a)if(delete y[T],T in m){let C=m[T];typeof C=="object"&&C?x[T]={"@initial":a[T],...C}:(C=String(C),x[T]=C!=="undefined"||o.has(T)?C:a[T])}else x[T]=a[T];const S=new Set([...i]);for(const[T,C,E,A]of e.composers){n.rules.styled.cache.has(T)||(n.rules.styled.cache.add(T),Kl(C,[`.${T}`],[],t,(_=>{u.styled.apply(_)})));const $=g2(E,x,t.media),P=g2(A,x,t.media,!0);for(const _ of $)if(_!==void 0)for(const[M,F,X]of _){const K=`${T}-${jo(F)}-${M}`;S.add(K);const B=(X?n.rules.resonevar:n.rules.onevar).cache,ne=X?u.resonevar:u.onevar;B.has(K)||(B.add(K),Kl(F,[`.${K}`],[],t,(G=>{ne.apply(G)})))}for(const _ of P)if(_!==void 0)for(const[M,F]of _){const X=`${T}-${jo(F)}-${M}`;S.add(X),n.rules.allvar.cache.has(X)||(n.rules.allvar.cache.add(X),Kl(F,[`.${X}`],[],t,(K=>{u.allvar.apply(K)})))}}if(typeof g=="object"&&g){const T=`${r}-i${jo(g)}-css`;S.add(T),n.rules.inline.cache.has(T)||(n.rules.inline.cache.add(T),Kl(g,[`.${T}`],[],t,(C=>{u.inline.apply(C)})))}for(const T of String(m.className||"").trim().split(/\s+/))T&&S.add(T);const k=y.className=[...S].join(" ");return{type:e.type,className:k,selector:f,props:y,toString:()=>k,deferredInjector:c}};return Bx(h,{className:r,selector:f,[Op]:e,toString:()=>(n.rules.styled.cache.has(r)||h(),r)})},h9=t=>{let e="";const n=[],r={},i=[];for(const[a,,,,o,c]of t){e===""&&(e=a),n.push(a),i.push(...c);for(const u in o){const f=o[u];(r[u]===void 0||f!=="undefined"||c.includes(f))&&(r[u]=f)}}return[e,n,r,new Set(i)]},g2=(t,e,n,r)=>{const i=[];e:for(let[a,o,c]of t){if(c)continue;let u,f=0,h=!1;for(u in a){const m=a[u];let g=e[u];if(g!==m){if(typeof g!="object"||!g)continue e;{let y,x,S=0;for(const k in g){if(m===String(g[k])){if(k!=="@initial"){const T=k.slice(1);(x=x||[]).push(T in n?n[T]:k.replace(/^@media ?/,"")),h=!0}f+=S,y=!0}++S}if(x&&x.length&&(o={["@media "+x.join(", ")]:o}),!y)continue e}}}(i[f]=i[f]||[]).push([r?"cv":`${u}-${a[u]}`,o,h])}return i},p9={},m9=af(),g9=(t,e)=>m9(t,(()=>(...n)=>{const r=()=>{for(let i of n){i=typeof i=="object"&&i||{};let a=jo(i);if(!e.rules.global.cache.has(a)){if(e.rules.global.cache.add(a),"@import"in i){let o=[].indexOf.call(e.sheet.cssRules,e.rules.themed.group)-1;for(let c of[].concat(i["@import"]))c=c.includes('"')||c.includes("'")?c:`"${c}"`,e.sheet.insertRule(`@import ${c};`,o++);delete i["@import"]}Kl(i,[],[],t,(o=>{e.rules.global.apply(o)}))}}return""};return Bx(r,{toString:r})})),O9=af(),v9=(t,e)=>O9(t,(()=>n=>{const r=`${Ka(t.prefix)}k-${jo(n)}`,i=()=>{if(!e.rules.global.cache.has(r)){e.rules.global.cache.add(r);const a=[];Kl(n,[],[],t,(c=>a.push(c)));const o=`@keyframes ${r}{${a.join("")}}`;e.rules.global.apply(o)}return r};return Bx(i,{get name(){return i()},toString:i})})),y9=class{constructor(t,e,n,r){this.token=t==null?"":String(t),this.value=e==null?"":String(e),this.scale=n==null?"":String(n),this.prefix=r==null?"":String(r)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+Ka(this.prefix)+Ka(this.scale)+this.token}toString(){return this.computedValue}},b9=af(),x9=(t,e)=>b9(t,(()=>(n,r)=>{r=typeof n=="object"&&n||Object(r);const i=`.${n=(n=typeof n=="string"?n:"")||`${Ka(t.prefix)}t-${jo(r)}`}`,a={},o=[];for(const u in r){a[u]={};for(const f in r[u]){const h=`--${Ka(t.prefix)}${u}-${f}`,m=Y$(String(r[u][f]),t.prefix,u);a[u][f]=new y9(f,m,u,t.prefix),o.push(`${h}:${m}`)}}const c=()=>{if(o.length&&!e.rules.themed.cache.has(n)){e.rules.themed.cache.add(n);const u=`${r===t.theme?":root,":""}.${n}{${o.join(";")}}`;e.rules.themed.apply(u)}return n};return{...a,get className(){return c()},selector:i,toString:c}})),S9=af(),w9=t=>{let e=!1;const n=S9(t,(r=>{e=!0;const i="prefix"in(r=typeof r=="object"&&r||{})?String(r.prefix):"",a=typeof r.media=="object"&&r.media||{},o=typeof r.root=="object"?r.root||null:globalThis.document||null,c=typeof r.theme=="object"&&r.theme||{},u={prefix:i,media:a,theme:c,themeMap:typeof r.themeMap=="object"&&r.themeMap||{...GI},utils:typeof r.utils=="object"&&r.utils||{}},f=o9(o),h={css:u9(u,f),globalCss:g9(u,f),keyframes:v9(u,f),createTheme:x9(u,f),reset(){f.reset(),h.theme.toString()},theme:{},sheet:f,config:u,prefix:i,getCssText:f.toString,toString:f.toString};return String(h.theme=h.createTheme(c)),h}));return e||n.reset(),n},O2=Object.prototype.hasOwnProperty;function v2(t,e,n){for(n of t.keys())if(ld(n,e))return n}function ld(t,e){var n,r,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&ld(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(i=r,i&&typeof i=="object"&&(i=v2(e,i),!i)||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(i=r[0],i&&typeof i=="object"&&(i=v2(e,i),!i)||!ld(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(O2.call(t,n)&&++r&&!O2.call(e,n)||!(n in e)||!ld(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}const k9="modulepreload",C9=function(t){return"/"+t},y2={},uy=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let u=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),c=o?.nonce||o?.getAttribute("nonce");i=u(n.map(f=>{if(f=C9(f),f in y2)return;y2[f]=!0;const h=f.endsWith(".css"),m=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${m}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":k9,h||(g.as="script"),g.crossOrigin="",g.href=f,c&&g.setAttribute("nonce",c),document.head.appendChild(g),h)return new Promise((y,x)=>{g.addEventListener("load",y),g.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(o){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=o,window.dispatchEvent(c),!c.defaultPrevented)throw o}return i.then(o=>{for(const c of o||[])c.status==="rejected"&&a(c.reason);return e().catch(a)})};var T9=/(%?)(%([sdjo]))/g;function E9(t,e){switch(e){case"s":return t;case"d":case"i":return Number(t);case"j":return JSON.stringify(t);case"o":{if(typeof t=="string")return t;const n=JSON.stringify(t);return n==="{}"||n==="[]"||/^\[object .+?\]$/.test(n)?t:n}}}function j0(t,...e){if(e.length===0)return t;let n=0,r=t.replace(T9,(i,a,o,c)=>{const u=e[n],f=E9(u,c);return a?i:(n++,f)});return n<e.length&&(r+=` ${e.slice(n).join(" ")}`),r=r.replace(/%{2,2}/g,"%"),r}var Q9=2;function R9(t){if(!t.stack)return;const e=t.stack.split(`
74
74
  `);e.splice(1,Q9),t.stack=e.join(`
75
75
  `)}var A9=class extends Error{constructor(t,...e){super(t),this.message=t,this.name="Invariant Violation",this.message=j0(t,...e),R9(this)}},F$=(t,e,...n)=>{if(!t)throw new A9(e,...n)};F$.as=(t,e,n,...r)=>{if(!e)throw t.prototype.name!=null?new t(j0(n,r)):t(j0(n,r))};var M0=function(t,e){return M0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},M0(t,e)};function Bae(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");M0(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Jl=function(){return Jl=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Jl.apply(this,arguments)};function _9(t,e,n,r){function i(a){return a instanceof n?a:new n(function(o){o(a)})}return new(n||(n=Promise))(function(a,o){function c(h){try{f(r.next(h))}catch(m){o(m)}}function u(h){try{f(r.throw(h))}catch(m){o(m)}}function f(h){h.done?a(h.value):i(h.value).then(c,u)}f((r=r.apply(t,[])).next())})}function $9(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(f){return function(h){return u([f,h])}}function u(f){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(a=f[0]&2?i.return:f[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,f[1])).done)return a;switch(i=0,a&&(f=[f[0]&2,a.value]),f[0]){case 0:case 1:a=f;break;case 4:return n.label++,{value:f[1],done:!1};case 5:n.label++,i=f[1],f=[0];continue;case 7:f=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(f[0]===6||f[0]===2)){n=0;continue}if(f[0]===3&&(!a||f[1]>a[0]&&f[1]<a[3])){n.label=f[1];break}if(f[0]===6&&n.label<a[1]){n.label=a[1],a=f;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(f);break}a[2]&&n.ops.pop(),n.trys.pop();continue}f=e.call(t,n)}catch(h){f=[6,h],i=0}finally{r=a=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function Iae(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,a;r<i;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return t.concat(a||Array.prototype.slice.call(e))}var b2;(function(t){t[t.None=0]="None",t[t.Error=10]="Error",t[t.Warning=20]="Warning",t[t.Info=30]="Info",t[t.Debug=40]="Debug"})(b2||(b2={}));var P9=function(t){return"[sandpack-client]: ".concat(t)};function dy(t,e){return e===void 0&&(e="Value is nullish"),F$(t!=null,P9(e)),t}var j9='"dependencies" was not specified - provide either a package.json or a "dependencies" value',x2='"entry" was not specified - provide either a package.json with the "main" field or an "entry" value';function M9(t,e,n){return t===void 0&&(t={}),e===void 0&&(e={}),n===void 0&&(n="/index.js"),JSON.stringify({name:"sandpack-project",main:n,dependencies:t,devDependencies:e},null,2)}function N9(t,e,n,r){var i,a,o=qo(t),c=o["/package.json"];if(!c)return dy(e,j9),dy(r,x2),o["/package.json"]={code:M9(e,n,r)},o;if(c){var u=JSON.parse(c.code);dy(!(!e&&!u.dependencies),x2),e&&(u.dependencies=Jl(Jl({},(i=u.dependencies)!==null&&i!==void 0?i:{}),e??{})),n&&(u.devDependencies=Jl(Jl({},(a=u.devDependencies)!==null&&a!==void 0?a:{}),n??{})),r&&(u.main=r),o["/package.json"]={code:JSON.stringify(u,null,2)}}return o}function D9(t){var e;if(t.title==="SyntaxError"){var n=t.title,r=t.path,i=t.message,a=t.line,o=t.column;return{title:n,path:r,message:i,line:a,column:o}}var c=z9((e=t.payload)===null||e===void 0?void 0:e.frames);if(!c)return{message:t.message};var u=Z9(c),f=L9(c),h=V9(c._originalFileName,t.message,f,u);return{message:h,title:t.title,path:c._originalFileName,line:c._originalLineNumber,column:c._originalColumnNumber}}function z9(t){if(t)return t.find(function(e){return!!e._originalFileName})}function L9(t){return t?" (".concat(t._originalLineNumber,":").concat(t._originalColumnNumber,")"):""}function Z9(t){var e=t._originalScriptCode[t._originalScriptCode.length-1],n=e.lineNumber.toString().length,r=2,i=3,a=r+n+i+t._originalColumnNumber;return t._originalScriptCode.reduce(function(o,c){var u=c.highlight?">":" ",f=c.lineNumber.toString().length===n?"".concat(c.lineNumber):" ".concat(c.lineNumber),h=c.highlight?`
76
76
  `+" ".repeat(a)+"^":"";return o+`
77
77
  `+u+" "+f+" | "+c.content+h},"")}function V9(t,e,n,r){return"".concat(t,": ").concat(e).concat(n,`
78
- `).concat(r)}var qo=function(t){return typeof t=="string"?t.startsWith("/")?t:"/".concat(t):Array.isArray(t)?t.map(function(e){return e.startsWith("/")?e:"/".concat(e)}):typeof t=="object"&&t!==null?Object.entries(t).reduce(function(e,n){var r=n[0],i=n[1],a=r.startsWith("/")?r:"/".concat(r);return e[a]=i,e},{}):null};function X9(t,e,n){var r;return n===void 0&&(n={}),_9(this,void 0,void 0,function(){var i,a,o;return $9(this,function(c){switch(c.label){case 0:switch(i=(r=e.template)!==null&&r!==void 0?r:"parcel",o=i,o){case"node":return[3,1];case"static":return[3,3]}return[3,5];case 1:return[4,uy(()=>import("./index-lohWKmM3.js"),__vite__mapDeps([0,1,2])).then(function(u){return u.SandpackNode})];case 2:return a=c.sent(),[3,7];case 3:return[4,uy(()=>import("./index-599aeaf7-DZk7eK7p.js"),__vite__mapDeps([3,2,1])).then(function(u){return u.SandpackStatic})];case 4:return a=c.sent(),[3,7];case 5:return[4,uy(()=>import("./index-De8hZx0A.js"),__vite__mapDeps([4,1])).then(function(u){return u.SandpackRuntime})];case 6:a=c.sent(),c.label=7;case 7:return[2,new a(t,e,n)]}})})}let N0=[],W$=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?W$:N0).push(n=n+t[e])})();function B9(t){if(t<768)return!1;for(let e=0,n=N0.length;;){let r=e+n>>1;if(t<N0[r])n=r;else if(t>=W$[r])e=r+1;else return!0;if(e==n)return!1}}function S2(t){return t>=127462&&t<=127487}const w2=8205;function I9(t,e,n=!0,r=!0){return(n?G$:q9)(t,e,r)}function G$(t,e,n){if(e==t.length)return e;e&&H$(t.charCodeAt(e))&&K$(t.charCodeAt(e-1))&&e--;let r=fy(t,e);for(e+=k2(r);e<t.length;){let i=fy(t,e);if(r==w2||i==w2||n&&B9(i))e+=k2(i),r=i;else if(S2(i)){let a=0,o=e-2;for(;o>=0&&S2(fy(t,o));)a++,o-=2;if(a%2==0)break;e+=2}else break}return e}function q9(t,e,n){for(;e>0;){let r=G$(t,e-2,n);if(r<e)return r;e--}return 0}function fy(t,e){let n=t.charCodeAt(e);if(!K$(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return H$(r)?(n-55296<<10)+(r-56320)+65536:n}function H$(t){return t>=56320&&t<57344}function K$(t){return t>=55296&&t<56320}function k2(t){return t<65536?1:2}class St{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Oc(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),na.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Oc(this,e,n);let r=[];return this.decompose(e,n,r,0),na.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new cd(this),a=new cd(e);for(let o=n,c=n;;){if(i.next(o),a.next(o),o=0,i.lineBreak!=a.lineBreak||i.done!=a.done||i.value!=a.value)return!1;if(c+=i.value.length,i.done||c>=r)return!0}}iter(e=1){return new cd(this,e)}iterRange(e,n=this.length){return new J$(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new eP(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?St.empty:e.length<=32?new un(e):na.from(un.split(e,[]))}}class un extends St{constructor(e,n=U9(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let a=0;;a++){let o=this.text[a],c=i+o.length;if((n?r:c)>=e)return new Y9(i,c,r,o);i=c+1,r++}}decompose(e,n,r,i){let a=e<=0&&n>=this.length?this:new un(C2(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),c=vp(a.text,o.text.slice(),0,a.length);if(c.length<=32)r.push(new un(c,o.length+a.length));else{let u=c.length>>1;r.push(new un(c.slice(0,u)),new un(c.slice(u)))}}else r.push(a)}replace(e,n,r){if(!(r instanceof un))return super.replace(e,n,r);[e,n]=Oc(this,e,n);let i=vp(this.text,vp(r.text,C2(this.text,0,e)),n),a=this.length+r.length-(n-e);return i.length<=32?new un(i,a):na.from(un.split(i,[]),a)}sliceString(e,n=this.length,r=`
78
+ `).concat(r)}var qo=function(t){return typeof t=="string"?t.startsWith("/")?t:"/".concat(t):Array.isArray(t)?t.map(function(e){return e.startsWith("/")?e:"/".concat(e)}):typeof t=="object"&&t!==null?Object.entries(t).reduce(function(e,n){var r=n[0],i=n[1],a=r.startsWith("/")?r:"/".concat(r);return e[a]=i,e},{}):null};function X9(t,e,n){var r;return n===void 0&&(n={}),_9(this,void 0,void 0,function(){var i,a,o;return $9(this,function(c){switch(c.label){case 0:switch(i=(r=e.template)!==null&&r!==void 0?r:"parcel",o=i,o){case"node":return[3,1];case"static":return[3,3]}return[3,5];case 1:return[4,uy(()=>import("./index-CDVAzgua.js"),__vite__mapDeps([0,1,2])).then(function(u){return u.SandpackNode})];case 2:return a=c.sent(),[3,7];case 3:return[4,uy(()=>import("./index-599aeaf7-BfDYnnrl.js"),__vite__mapDeps([3,2,1])).then(function(u){return u.SandpackStatic})];case 4:return a=c.sent(),[3,7];case 5:return[4,uy(()=>import("./index-BnqiXBcx.js"),__vite__mapDeps([4,1])).then(function(u){return u.SandpackRuntime})];case 6:a=c.sent(),c.label=7;case 7:return[2,new a(t,e,n)]}})})}let N0=[],W$=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?W$:N0).push(n=n+t[e])})();function B9(t){if(t<768)return!1;for(let e=0,n=N0.length;;){let r=e+n>>1;if(t<N0[r])n=r;else if(t>=W$[r])e=r+1;else return!0;if(e==n)return!1}}function S2(t){return t>=127462&&t<=127487}const w2=8205;function I9(t,e,n=!0,r=!0){return(n?G$:q9)(t,e,r)}function G$(t,e,n){if(e==t.length)return e;e&&H$(t.charCodeAt(e))&&K$(t.charCodeAt(e-1))&&e--;let r=fy(t,e);for(e+=k2(r);e<t.length;){let i=fy(t,e);if(r==w2||i==w2||n&&B9(i))e+=k2(i),r=i;else if(S2(i)){let a=0,o=e-2;for(;o>=0&&S2(fy(t,o));)a++,o-=2;if(a%2==0)break;e+=2}else break}return e}function q9(t,e,n){for(;e>0;){let r=G$(t,e-2,n);if(r<e)return r;e--}return 0}function fy(t,e){let n=t.charCodeAt(e);if(!K$(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return H$(r)?(n-55296<<10)+(r-56320)+65536:n}function H$(t){return t>=56320&&t<57344}function K$(t){return t>=55296&&t<56320}function k2(t){return t<65536?1:2}class St{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=Oc(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),na.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=Oc(this,e,n);let r=[];return this.decompose(e,n,r,0),na.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new cd(this),a=new cd(e);for(let o=n,c=n;;){if(i.next(o),a.next(o),o=0,i.lineBreak!=a.lineBreak||i.done!=a.done||i.value!=a.value)return!1;if(c+=i.value.length,i.done||c>=r)return!0}}iter(e=1){return new cd(this,e)}iterRange(e,n=this.length){return new J$(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new eP(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?St.empty:e.length<=32?new un(e):na.from(un.split(e,[]))}}class un extends St{constructor(e,n=U9(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let a=0;;a++){let o=this.text[a],c=i+o.length;if((n?r:c)>=e)return new Y9(i,c,r,o);i=c+1,r++}}decompose(e,n,r,i){let a=e<=0&&n>=this.length?this:new un(C2(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),c=vp(a.text,o.text.slice(),0,a.length);if(c.length<=32)r.push(new un(c,o.length+a.length));else{let u=c.length>>1;r.push(new un(c.slice(0,u)),new un(c.slice(u)))}}else r.push(a)}replace(e,n,r){if(!(r instanceof un))return super.replace(e,n,r);[e,n]=Oc(this,e,n);let i=vp(this.text,vp(r.text,C2(this.text,0,e)),n),a=this.length+r.length-(n-e);return i.length<=32?new un(i,a):na.from(un.split(i,[]),a)}sliceString(e,n=this.length,r=`
79
79
  `){[e,n]=Oc(this,e,n);let i="";for(let a=0,o=0;a<=n&&o<this.text.length;o++){let c=this.text[o],u=a+c.length;a>e&&o&&(i+=r),e<u&&n>a&&(i+=c.slice(Math.max(0,e-a),n-a)),a=u+1}return i}flatten(e){for(let n of this.text)e.push(n)}scanIdentical(){return 0}static split(e,n){let r=[],i=-1;for(let a of e)r.push(a),i+=a.length+1,r.length==32&&(n.push(new un(r,i)),r=[],i=-1);return i>-1&&n.push(new un(r,i)),n}}class na extends St{constructor(e,n){super(),this.children=e,this.length=n,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,n,r,i){for(let a=0;;a++){let o=this.children[a],c=i+o.length,u=r+o.lines-1;if((n?u:c)>=e)return o.lineInner(e,n,r,i);i=c+1,r=u+1}}decompose(e,n,r,i){for(let a=0,o=0;o<=n&&a<this.children.length;a++){let c=this.children[a],u=o+c.length;if(e<=u&&n>=o){let f=i&((o<=e?1:0)|(u>=n?2:0));o>=e&&u<=n&&!f?r.push(c):c.decompose(e-o,n-o,r,f)}o=u+1}}replace(e,n,r){if([e,n]=Oc(this,e,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],c=a+o.length;if(e>=a&&n<=c){let u=o.replace(e-a,n-a,r),f=this.lines-o.lines+u.lines;if(u.lines<f>>4&&u.lines>f>>6){let h=this.children.slice();return h[i]=u,new na(h,this.length-(n-e)+r.length)}return super.replace(a,c,u)}a=c+1}return super.replace(e,n,r)}sliceString(e,n=this.length,r=`
80
80
  `){[e,n]=Oc(this,e,n);let i="";for(let a=0,o=0;a<this.children.length&&o<=n;a++){let c=this.children[a],u=o+c.length;o>e&&a&&(i+=r),e<u&&n>o&&(i+=c.sliceString(e-o,n-o,r)),o=u+1}return i}flatten(e){for(let n of this.children)n.flatten(e)}scanIdentical(e,n){if(!(e instanceof na))return 0;let r=0,[i,a,o,c]=n>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==c)return r;let u=this.children[i],f=e.children[a];if(u!=f)return r+u.scanIdentical(f,n);r+=u.length+1}}static from(e,n=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let y of e)r+=y.lines;if(r<32){let y=[];for(let x of e)x.flatten(y);return new un(y,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,c=[],u=0,f=-1,h=[];function m(y){let x;if(y.lines>a&&y instanceof na)for(let S of y.children)m(S);else y.lines>o&&(u>o||!u)?(g(),c.push(y)):y instanceof un&&u&&(x=h[h.length-1])instanceof un&&y.lines+x.lines<=32?(u+=y.lines,f+=y.length+1,h[h.length-1]=new un(x.text.concat(y.text),x.length+1+y.length)):(u+y.lines>i&&g(),u+=y.lines,f+=y.length+1,h.push(y))}function g(){u!=0&&(c.push(h.length==1?h[0]:na.from(h,f)),f=-1,u=h.length=0)}for(let y of e)m(y);return g(),c.length==1?c[0]:new na(c,n)}}St.empty=new un([""],0);function U9(t){let e=-1;for(let n of t)e+=n.length+1;return e}function vp(t,e,n=0,r=1e9){for(let i=0,a=0,o=!0;a<t.length&&i<=r;a++){let c=t[a],u=i+c.length;u>=n&&(u>r&&(c=c.slice(0,r-i)),i<n&&(c=c.slice(n-i)),o?(e[e.length-1]+=c,o=!1):e.push(c)),i=u+1}return e}function C2(t,e,n){return vp(t,[""],e,n)}class cd{constructor(e,n=1){this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[n>0?1:(e instanceof un?e.text.length:e.children.length)<<1]}nextInner(e,n){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],a=this.offsets[r],o=a>>1,c=i instanceof un?i.text.length:i.children.length;if(o==(n>0?c:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((a&1)==(n>0?0:1)){if(this.offsets[r]+=n,e==0)return this.lineBreak=!0,this.value=`
81
81
  `,this;e--}else if(i instanceof un){let u=i.text[o+(n<0?-1:0)];if(this.offsets[r]+=n,u.length>Math.max(0,e))return this.value=e==0?u:n>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=i.children[o+(n<0?-1:0)];e>u.length?(e-=u.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(u),this.offsets.push(n>0?1:(u instanceof un?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class J${constructor(e,n,r){this.value="",this.done=!1,this.cursor=new cd(e,n>r?-1:1),this.pos=n>r?e.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}nextInner(e,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);let r=n<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class eP{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:n,lineBreak:r,value:i}=this.inner.next(e);return n&&this.afterBreak?(this.value="",this.afterBreak=!1):n?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(St.prototype[Symbol.iterator]=function(){return this.iter()},cd.prototype[Symbol.iterator]=J$.prototype[Symbol.iterator]=eP.prototype[Symbol.iterator]=function(){return this});class Y9{constructor(e,n,r,i){this.from=e,this.to=n,this.number=r,this.text=i}get length(){return this.to-this.from}}function Oc(t,e,n){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,n))]}function qn(t,e,n=!0,r=!0){return I9(t,e,n,r)}function F9(t){return t>=56320&&t<57344}function W9(t){return t>=55296&&t<56320}function el(t,e){let n=t.charCodeAt(e);if(!W9(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return F9(r)?(n-55296<<10)+(r-56320)+65536:n}function G9(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function Km(t){return t<65536?1:2}const D0=/\r\n?|\n/;var Hn=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Hn||(Hn={}));class ua{constructor(e){this.sections=e}get length(){let e=0;for(let n=0;n<this.sections.length;n+=2)e+=this.sections[n];return e}get newLength(){let e=0;for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n+1];e+=r<0?this.sections[n]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let n=0,r=0,i=0;n<this.sections.length;){let a=this.sections[n++],o=this.sections[n++];o<0?(e(r,i,a),i+=a):i+=o,r+=a}}iterChangedRanges(e,n=!1){z0(this,e,n)}get invertedDesc(){let e=[];for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];i<0?e.push(r,i):e.push(i,r)}return new ua(e)}composeDesc(e){return this.empty?e:e.empty?this:tP(this,e)}mapDesc(e,n=!1){return e.empty?this:L0(this,e,n)}mapPos(e,n=-1,r=Hn.Simple){let i=0,a=0;for(let o=0;o<this.sections.length;){let c=this.sections[o++],u=this.sections[o++],f=i+c;if(u<0){if(f>e)return a+(e-i);a+=c}else{if(r!=Hn.Simple&&f>=e&&(r==Hn.TrackDel&&i<e&&f>e||r==Hn.TrackBefore&&i<e||r==Hn.TrackAfter&&f>e))return null;if(f>e||f==e&&n<0&&!c)return e==i||n<0?a:a+u;a+=u}i=f}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return a}touchesRange(e,n=e){for(let r=0,i=0;r<this.sections.length&&i<=n;){let a=this.sections[r++],o=this.sections[r++],c=i+a;if(o>=0&&i<=n&&c>=e)return i<e&&c>n?"cover":!0;i=c}return!1}toString(){let e="";for(let n=0;n<this.sections.length;){let r=this.sections[n++],i=this.sections[n++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(n=>typeof n!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ua(e)}static create(e){return new ua(e)}}class Qn extends ua{constructor(e,n){super(e),this.inserted=n}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return z0(this,(n,r,i,a,o)=>e=e.replace(i,i+(r-n),o),!1),e}mapDesc(e,n=!1){return L0(this,e,n,!0)}invert(e){let n=this.sections.slice(),r=[];for(let i=0,a=0;i<n.length;i+=2){let o=n[i],c=n[i+1];if(c>=0){n[i]=c,n[i+1]=o;let u=i>>1;for(;r.length<u;)r.push(St.empty);r.push(o?e.slice(a,a+o):St.empty)}a+=o}return new Qn(n,r)}compose(e){return this.empty?e:e.empty?this:tP(this,e,!0)}map(e,n=!1){return e.empty?this:L0(this,e,n,!0)}iterChanges(e,n=!1){z0(this,e,n)}get desc(){return ua.create(this.sections)}filter(e){let n=[],r=[],i=[],a=new wd(this);e:for(let o=0,c=0;;){let u=o==e.length?1e9:e[o++];for(;c<u||c==u&&a.len==0;){if(a.done)break e;let h=Math.min(a.len,u-c);Wn(i,h,-1);let m=a.ins==-1?-1:a.off==0?a.ins:0;Wn(n,h,m),m>0&&Ms(r,n,a.text),a.forward(h),c+=h}let f=e[o++];for(;c<f;){if(a.done)break e;let h=Math.min(a.len,f-c);Wn(n,h,-1),Wn(i,h,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(h),c+=h}}return{changes:new Qn(n,r),filtered:ua.create(i)}}toJSON(){let e=[];for(let n=0;n<this.sections.length;n+=2){let r=this.sections[n],i=this.sections[n+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[n>>1].toJSON()))}return e}static of(e,n,r){let i=[],a=[],o=0,c=null;function u(h=!1){if(!h&&!i.length)return;o<n&&Wn(i,n-o,-1);let m=new Qn(i,a);c=c?c.compose(m.map(c)):m,i=[],a=[],o=0}function f(h){if(Array.isArray(h))for(let m of h)f(m);else if(h instanceof Qn){if(h.length!=n)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${n})`);u(),c=c?c.compose(h.map(c)):h}else{let{from:m,to:g=m,insert:y}=h;if(m>g||m<0||g>n)throw new RangeError(`Invalid change range ${m} to ${g} (in doc of length ${n})`);let x=y?typeof y=="string"?St.of(y.split(r||D0)):y:St.empty,S=x.length;if(m==g&&S==0)return;m<o&&u(),m>o&&Wn(i,m-o,-1),Wn(i,g-m,S),Ms(a,i,x),o=g}}return f(e),u(!c),c}static empty(e){return new Qn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i];if(typeof a=="number")n.push(a,-1);else{if(!Array.isArray(a)||typeof a[0]!="number"||a.some((o,c)=>c&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(a.length==1)n.push(a[0],0);else{for(;r.length<i;)r.push(St.empty);r[i]=St.of(a.slice(1)),n.push(a[0],r[i].length)}}}return new Qn(n,r)}static createSet(e,n){return new Qn(e,n)}}function Wn(t,e,n,r=!1){if(e==0&&n<=0)return;let i=t.length-2;i>=0&&n<=0&&n==t[i+1]?t[i]+=e:i>=0&&e==0&&t[i]==0?t[i+1]+=n:r?(t[i]+=e,t[i+1]+=n):t.push(e,n)}function Ms(t,e,n){if(n.length==0)return;let r=e.length-2>>1;if(r<t.length)t[t.length-1]=t[t.length-1].append(n);else{for(;t.length<r;)t.push(St.empty);t.push(n)}}function z0(t,e,n){let r=t.inserted;for(let i=0,a=0,o=0;o<t.sections.length;){let c=t.sections[o++],u=t.sections[o++];if(u<0)i+=c,a+=c;else{let f=i,h=a,m=St.empty;for(;f+=c,h+=u,u&&r&&(m=m.append(r[o-2>>1])),!(n||o==t.sections.length||t.sections[o+1]<0);)c=t.sections[o++],u=t.sections[o++];e(i,f,a,h,m),i=f,a=h}}}function L0(t,e,n,r=!1){let i=[],a=r?[]:null,o=new wd(t),c=new wd(e);for(let u=-1;;){if(o.done&&c.len||c.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&c.ins==-1){let f=Math.min(o.len,c.len);Wn(i,f,-1),o.forward(f),c.forward(f)}else if(c.ins>=0&&(o.ins<0||u==o.i||o.off==0&&(c.len<o.len||c.len==o.len&&!n))){let f=c.len;for(Wn(i,c.ins,-1);f;){let h=Math.min(o.len,f);o.ins>=0&&u<o.i&&o.len<=h&&(Wn(i,0,o.ins),a&&Ms(a,i,o.text),u=o.i),o.forward(h),f-=h}c.next()}else if(o.ins>=0){let f=0,h=o.len;for(;h;)if(c.ins==-1){let m=Math.min(h,c.len);f+=m,h-=m,c.forward(m)}else if(c.ins==0&&c.len<h)h-=c.len,c.next();else break;Wn(i,f,u<o.i?o.ins:0),a&&u<o.i&&Ms(a,i,o.text),u=o.i,o.forward(o.len-h)}else{if(o.done&&c.done)return a?Qn.createSet(i,a):ua.create(i);throw new Error("Mismatched change set lengths")}}}function tP(t,e,n=!1){let r=[],i=n?[]:null,a=new wd(t),o=new wd(e);for(let c=!1;;){if(a.done&&o.done)return i?Qn.createSet(r,i):ua.create(r);if(a.ins==0)Wn(r,a.len,0,c),a.next();else if(o.len==0&&!o.done)Wn(r,0,o.ins,c),i&&Ms(i,r,o.text),o.next();else{if(a.done||o.done)throw new Error("Mismatched change set lengths");{let u=Math.min(a.len2,o.len),f=r.length;if(a.ins==-1){let h=o.ins==-1?-1:o.off?0:o.ins;Wn(r,u,h,c),i&&h&&Ms(i,r,o.text)}else o.ins==-1?(Wn(r,a.off?0:a.len,u,c),i&&Ms(i,r,a.textBit(u))):(Wn(r,a.off?0:a.len,o.off?0:o.ins,c),i&&!o.off&&Ms(i,r,o.text));c=(a.ins>u||o.ins>=0&&o.len>u)&&(c||r.length>f),a.forward2(u),o.forward(u)}}}}class wd{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,n=this.i-2>>1;return n>=e.length?St.empty:e[n]}textBit(e){let{inserted:n}=this.set,r=this.i-2>>1;return r>=n.length&&!e?St.empty:n[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Ro{constructor(e,n,r){this.from=e,this.to=n,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,n=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,n):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new Ro(r,i,this.flags)}extend(e,n=e){if(e<=this.anchor&&n>=this.anchor)return Se.range(e,n);let r=Math.abs(e-this.anchor)>Math.abs(n-this.anchor)?e:n;return Se.range(this.anchor,r)}eq(e,n=!1){return this.anchor==e.anchor&&this.head==e.head&&(!n||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Se.range(e.anchor,e.head)}static create(e,n,r){return new Ro(e,n,r)}}class Se{constructor(e,n){this.ranges=e,this.mainIndex=n}map(e,n=-1){return e.empty?this:Se.create(this.ranges.map(r=>r.map(e,n)),this.mainIndex)}eq(e,n=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],n))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Se([this.main],0)}addRange(e,n=!0){return Se.create([e].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(e,n=this.mainIndex){let r=this.ranges.slice();return r[n]=e,Se.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Se(e.ranges.map(n=>Ro.fromJSON(n)),e.main)}static single(e,n=e){return new Se([Se.range(e,n)],0)}static create(e,n=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let a=e[i];if(a.empty?a.from<=r:a.from<r)return Se.normalized(e.slice(),n);r=a.to}return new Se(e,n)}static cursor(e,n=0,r,i){return Ro.create(e,e,(n==0?0:n<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,n,r,i){let a=(r??16777215)<<6|(i==null?7:Math.min(6,i));return n<e?Ro.create(n,e,48|a):Ro.create(e,n,(n>e?8:0)|a)}static normalized(e,n=0){let r=e[n];e.sort((i,a)=>i.from-a.from),n=e.indexOf(r);for(let i=1;i<e.length;i++){let a=e[i],o=e[i-1];if(a.empty?a.from<=o.to:a.from<o.to){let c=o.from,u=Math.max(a.to,o.to);i<=n&&n--,e.splice(--i,2,a.anchor>a.head?Se.range(u,c):Se.range(c,u))}}return new Se(e,n)}}function nP(t,e){for(let n of t.ranges)if(n.to>e)throw new RangeError("Selection points outside of document")}let Ix=0;class Xe{constructor(e,n,r,i,a){this.combine=e,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=Ix++,this.default=e([]),this.extensions=typeof a=="function"?a(this):a}get reader(){return this}static define(e={}){return new Xe(e.combine||(n=>n),e.compareInput||((n,r)=>n===r),e.compare||(e.combine?(n,r)=>n===r:qx),!!e.static,e.enables)}of(e){return new yp([],this,0,e)}compute(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new yp(e,this,1,n)}computeN(e,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new yp(e,this,2,n)}from(e,n){return n||(n=r=>r),this.compute([e],r=>n(r.field(e)))}}function qx(t,e){return t==e||t.length==e.length&&t.every((n,r)=>n===e[r])}class yp{constructor(e,n,r,i){this.dependencies=e,this.facet=n,this.type=r,this.value=i,this.id=Ix++}dynamicSlot(e){var n;let r=this.value,i=this.facet.compareInput,a=this.id,o=e[a]>>1,c=this.type==2,u=!1,f=!1,h=[];for(let m of this.dependencies)m=="doc"?u=!0:m=="selection"?f=!0:(((n=e[m.id])!==null&&n!==void 0?n:1)&1)==0&&h.push(e[m.id]);return{create(m){return m.values[o]=r(m),1},update(m,g){if(u&&g.docChanged||f&&(g.docChanged||g.selection)||Z0(m,h)){let y=r(m);if(c?!T2(y,m.values[o],i):!i(y,m.values[o]))return m.values[o]=y,1}return 0},reconfigure:(m,g)=>{let y,x=g.config.address[a];if(x!=null){let S=Ip(g,x);if(this.dependencies.every(k=>k instanceof Xe?g.facet(k)===m.facet(k):k instanceof Ni?g.field(k,!1)==m.field(k,!1):!0)||(c?T2(y=r(m),S,i):i(y=r(m),S)))return m.values[o]=S,0}else y=r(m);return m.values[o]=y,1}}}}function T2(t,e,n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!n(t[r],e[r]))return!1;return!0}function Z0(t,e){let n=!1;for(let r of e)ud(t,r)&1&&(n=!0);return n}function H9(t,e,n){let r=n.map(u=>t[u.id]),i=n.map(u=>u.type),a=r.filter(u=>!(u&1)),o=t[e.id]>>1;function c(u){let f=[];for(let h=0;h<r.length;h++){let m=Ip(u,r[h]);if(i[h]==2)for(let g of m)f.push(g);else f.push(m)}return e.combine(f)}return{create(u){for(let f of r)ud(u,f);return u.values[o]=c(u),1},update(u,f){if(!Z0(u,a))return 0;let h=c(u);return e.compare(h,u.values[o])?0:(u.values[o]=h,1)},reconfigure(u,f){let h=Z0(u,r),m=f.config.facets[e.id],g=f.facet(e);if(m&&!h&&qx(n,m))return u.values[o]=g,0;let y=c(u);return e.compare(y,g)?(u.values[o]=g,0):(u.values[o]=y,1)}}}const Lh=Xe.define({static:!0});class Ni{constructor(e,n,r,i,a){this.id=e,this.createF=n,this.updateF=r,this.compareF=i,this.spec=a,this.provides=void 0}static define(e){let n=new Ni(Ix++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(n.provides=e.provide(n)),n}create(e){let n=e.facet(Lh).find(r=>r.field==this);return(n?.create||this.createF)(e)}slot(e){let n=e[this.id]>>1;return{create:r=>(r.values[n]=this.create(r),1),update:(r,i)=>{let a=r.values[n],o=this.updateF(a,i);return this.compareF(a,o)?0:(r.values[n]=o,1)},reconfigure:(r,i)=>{let a=r.facet(Lh),o=i.facet(Lh),c;return(c=a.find(u=>u.field==this))&&c!=o.find(u=>u.field==this)?(r.values[n]=c.create(r),1):i.config.address[this.id]!=null?(r.values[n]=i.field(this),0):(r.values[n]=this.create(r),1)}}}init(e){return[this,Lh.of({field:this,create:e})]}get extension(){return this}}const Co={lowest:4,low:3,default:2,high:1,highest:0};function qu(t){return e=>new rP(e,t)}const Jm={highest:qu(Co.highest),high:qu(Co.high),default:qu(Co.default),low:qu(Co.low),lowest:qu(Co.lowest)};class rP{constructor(e,n){this.inner=e,this.prec=n}}class eg{of(e){return new V0(this,e)}reconfigure(e){return eg.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class V0{constructor(e,n){this.compartment=e,this.inner=n}}class Bp{constructor(e,n,r,i,a,o){for(this.base=e,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=a,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let n=this.address[e.id];return n==null?e.default:this.staticValues[n>>1]}static resolve(e,n,r){let i=[],a=Object.create(null),o=new Map;for(let g of K9(e,n,o))g instanceof Ni?i.push(g):(a[g.facet.id]||(a[g.facet.id]=[])).push(g);let c=Object.create(null),u=[],f=[];for(let g of i)c[g.id]=f.length<<1,f.push(y=>g.slot(y));let h=r?.config.facets;for(let g in a){let y=a[g],x=y[0].facet,S=h&&h[g]||[];if(y.every(k=>k.type==0))if(c[x.id]=u.length<<1|1,qx(S,y))u.push(r.facet(x));else{let k=x.combine(y.map(T=>T.value));u.push(r&&x.compare(k,r.facet(x))?r.facet(x):k)}else{for(let k of y)k.type==0?(c[k.id]=u.length<<1|1,u.push(k.value)):(c[k.id]=f.length<<1,f.push(T=>k.dynamicSlot(T)));c[x.id]=f.length<<1,f.push(k=>H9(k,x,y))}}let m=f.map(g=>g(c));return new Bp(e,o,m,c,u,a)}}function K9(t,e,n){let r=[[],[],[],[],[]],i=new Map;function a(o,c){let u=i.get(o);if(u!=null){if(u<=c)return;let f=r[u].indexOf(o);f>-1&&r[u].splice(f,1),o instanceof V0&&n.delete(o.compartment)}if(i.set(o,c),Array.isArray(o))for(let f of o)a(f,c);else if(o instanceof V0){if(n.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let f=e.get(o.compartment)||o.inner;n.set(o.compartment,f),a(f,c)}else if(o instanceof rP)a(o.inner,o.prec);else if(o instanceof Ni)r[c].push(o),o.provides&&a(o.provides,c);else if(o instanceof yp)r[c].push(o),o.facet.extensions&&a(o.facet.extensions,Co.default);else{let f=o.extension;if(!f)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(f,c)}}return a(t,Co.default),r.reduce((o,c)=>o.concat(c))}function ud(t,e){if(e&1)return 2;let n=e>>1,r=t.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;t.status[n]=4;let i=t.computeSlot(t,t.config.dynamicSlots[n]);return t.status[n]=2|i}function Ip(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const iP=Xe.define(),X0=Xe.define({combine:t=>t.some(e=>e),static:!0}),aP=Xe.define({combine:t=>t.length?t[0]:void 0,static:!0}),sP=Xe.define(),oP=Xe.define(),lP=Xe.define(),cP=Xe.define({combine:t=>t.length?t[0]:!1});class _i{constructor(e,n){this.type=e,this.value=n}static define(){return new J9}}class J9{of(e){return new _i(this,e)}}class eq{constructor(e){this.map=e}of(e){return new Vt(this,e)}}class Vt{constructor(e,n){this.type=e,this.value=n}map(e){let n=this.type.map(this.value,e);return n===void 0?void 0:n==this.value?this:new Vt(this.type,n)}is(e){return this.type==e}static define(e={}){return new eq(e.map||(n=>n))}static mapEffects(e,n){if(!e.length)return e;let r=[];for(let i of e){let a=i.map(n);a&&r.push(a)}return r}}Vt.reconfigure=Vt.define();Vt.appendConfig=Vt.define();class xn{constructor(e,n,r,i,a,o){this.startState=e,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&nP(r,n.newLength),a.some(c=>c.type==xn.time)||(this.annotations=a.concat(xn.time.of(Date.now())))}static create(e,n,r,i,a,o){return new xn(e,n,r,i,a,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let n of this.annotations)if(n.type==e)return n.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let n=this.annotation(xn.userEvent);return!!(n&&(n==e||n.length>e.length&&n.slice(0,e.length)==e&&n[e.length]=="."))}}xn.time=_i.define();xn.userEvent=_i.define();xn.addToHistory=_i.define();xn.remote=_i.define();function tq(t,e){let n=[];for(let r=0,i=0;;){let a,o;if(r<t.length&&(i==e.length||e[i]>=t[r]))a=t[r++],o=t[r++];else if(i<e.length)a=e[i++],o=e[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function uP(t,e,n){var r;let i,a,o;return n?(i=e.changes,a=Qn.empty(e.changes.length),o=t.changes.compose(e.changes)):(i=e.changes.map(t.changes),a=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(i)),{changes:o,selection:e.selection?e.selection.map(a):(r=t.selection)===null||r===void 0?void 0:r.map(i),effects:Vt.mapEffects(t.effects,i).concat(Vt.mapEffects(e.effects,a)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function B0(t,e,n){let r=e.selection,i=oc(e.annotations);return e.userEvent&&(i=i.concat(xn.userEvent.of(e.userEvent))),{changes:e.changes instanceof Qn?e.changes:Qn.of(e.changes||[],n,t.facet(aP)),selection:r&&(r instanceof Se?r:Se.single(r.anchor,r.head)),effects:oc(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function dP(t,e,n){let r=B0(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(n=!1);for(let a=1;a<e.length;a++){e[a].filter===!1&&(n=!1);let o=!!e[a].sequential;r=uP(r,B0(t,e[a],o?r.changes.newLength:t.doc.length),o)}let i=xn.create(t,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return rq(n?nq(i):i)}function nq(t){let e=t.startState,n=!0;for(let i of e.facet(sP)){let a=i(t);if(a===!1){n=!1;break}Array.isArray(a)&&(n=n===!0?a:tq(n,a))}if(n!==!0){let i,a;if(n===!1)a=t.changes.invertedDesc,i=Qn.empty(e.doc.length);else{let o=t.changes.filter(n);i=o.changes,a=o.filtered.mapDesc(o.changes).invertedDesc}t=xn.create(e,i,t.selection&&t.selection.map(a),Vt.mapEffects(t.effects,a),t.annotations,t.scrollIntoView)}let r=e.facet(oP);for(let i=r.length-1;i>=0;i--){let a=r[i](t);a instanceof xn?t=a:Array.isArray(a)&&a.length==1&&a[0]instanceof xn?t=a[0]:t=dP(e,oc(a),!1)}return t}function rq(t){let e=t.startState,n=e.facet(lP),r=t;for(let i=n.length-1;i>=0;i--){let a=n[i](t);a&&Object.keys(a).length&&(r=uP(r,B0(e,a,t.changes.newLength),!0))}return r==t?t:xn.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}const iq=[];function oc(t){return t==null?iq:Array.isArray(t)?t:[t]}var si=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(si||(si={}));const aq=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let I0;try{I0=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function sq(t){if(I0)return I0.test(t);for(let e=0;e<t.length;e++){let n=t[e];if(/\w/.test(n)||n>"€"&&(n.toUpperCase()!=n.toLowerCase()||aq.test(n)))return!0}return!1}function oq(t){return e=>{if(!/\S/.test(e))return si.Space;if(sq(e))return si.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return si.Word;return si.Other}}class Rt{constructor(e,n,r,i,a,o){this.config=e,this.doc=n,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=a,o&&(o._state=this);for(let c=0;c<this.config.dynamicSlots.length;c++)ud(this,c<<1);this.computeSlot=null}field(e,n=!0){let r=this.config.address[e.id];if(r==null){if(n)throw new RangeError("Field is not present in this state");return}return ud(this,r),Ip(this,r)}update(...e){return dP(this,e,!0)}applyTransaction(e){let n=this.config,{base:r,compartments:i}=n;for(let c of e.effects)c.is(eg.reconfigure)?(n&&(i=new Map,n.compartments.forEach((u,f)=>i.set(f,u)),n=null),i.set(c.value.compartment,c.value.extension)):c.is(Vt.reconfigure)?(n=null,r=c.value):c.is(Vt.appendConfig)&&(n=null,r=oc(r).concat(c.value));let a;n?a=e.startState.values.slice():(n=Bp.resolve(r,i,this),a=new Rt(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(u,f)=>f.reconfigure(u,this),null).values);let o=e.startState.facet(X0)?e.newSelection:e.newSelection.asSingle();new Rt(n,e.newDoc,o,a,(c,u)=>u.update(c,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:e},range:Se.cursor(n.from+e.length)}))}changeByRange(e){let n=this.selection,r=e(n.ranges[0]),i=this.changes(r.changes),a=[r.range],o=oc(r.effects);for(let c=1;c<n.ranges.length;c++){let u=e(n.ranges[c]),f=this.changes(u.changes),h=f.map(i);for(let g=0;g<c;g++)a[g]=a[g].map(h);let m=i.mapDesc(f,!0);a.push(u.range.map(m)),i=i.compose(h),o=Vt.mapEffects(o,h).concat(Vt.mapEffects(oc(u.effects),m))}return{changes:i,selection:Se.create(a,n.mainIndex),effects:o}}changes(e=[]){return e instanceof Qn?e:Qn.of(e,this.doc.length,this.facet(Rt.lineSeparator))}toText(e){return St.of(e.split(this.facet(Rt.lineSeparator)||D0))}sliceDoc(e=0,n=this.doc.length){return this.doc.sliceString(e,n,this.lineBreak)}facet(e){let n=this.config.address[e.id];return n==null?e.default:(ud(this,n),Ip(this,n))}toJSON(e){let n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof Ni&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(e[r]),this))}return n}static fromJSON(e,n={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let a in r)if(Object.prototype.hasOwnProperty.call(e,a)){let o=r[a],c=e[a];i.push(o.init(u=>o.spec.fromJSON(c,u)))}}return Rt.create({doc:e.doc,selection:Se.fromJSON(e.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(e={}){let n=Bp.resolve(e.extensions||[],new Map),r=e.doc instanceof St?e.doc:St.of((e.doc||"").split(n.staticFacet(Rt.lineSeparator)||D0)),i=e.selection?e.selection instanceof Se?e.selection:Se.single(e.selection.anchor,e.selection.head):Se.single(0);return nP(i,r.length),n.staticFacet(X0)||(i=i.asSingle()),new Rt(n,r,i,n.dynamicSlots.map(()=>null),(a,o)=>o.create(a),null)}get tabSize(){return this.facet(Rt.tabSize)}get lineBreak(){return this.facet(Rt.lineSeparator)||`
@@ -1,4 +1,4 @@
1
- import{_ as X,a as _,b as E,c as k,d as H,n as D}from"./index-6Qr3P4GY.js";import{S as Q}from"./base-80a1f760-Dmh1zEm4.js";import{g as W,r as F,f as Z,w as x,a as $,b as ee,E as te,c as re}from"./consoleHook-59e792cb-BPY7C9Z6.js";var ne=Object.create,T=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,V=Object.getOwnPropertyNames,se=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty,ae=(t,n,e)=>n in t?T(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,P=(t,n)=>function(){return n||(0,t[V(t)[0]])((n={exports:{}}).exports,n),n.exports},ce=(t,n,e,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of V(n))!oe.call(t,s)&&s!==e&&T(t,s,{get:()=>n[s],enumerable:!(r=ie(n,s))||r.enumerable});return t},j=(t,n,e)=>(e=t!=null?ne(se(t)):{},ce(!t||!t.__esModule?T(e,"default",{value:t,enumerable:!0}):e,t)),de=(t,n,e)=>(ae(t,n+"",e),e),R=(t,n,e)=>{if(!n.has(t))throw TypeError("Cannot "+e)},g=(t,n,e)=>(R(t,n,"read from private field"),e?e.call(t):n.get(t)),M=(t,n,e)=>{if(n.has(t))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(t):n.set(t,e)},O=(t,n,e,r)=>(R(t,n,"write to private field"),n.set(t,e),e),y=(t,n,e)=>(R(t,n,"access private method"),e),z=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/lib/pad.js"(t,n){n.exports=function(r,s){var i="000000000"+r;return i.substr(i.length-s)}}}),le=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/lib/fingerprint.browser.js"(t,n){var e=z(),r=typeof window=="object"?window:self,s=Object.keys(r).length,i=navigator.mimeTypes?navigator.mimeTypes.length:0,o=e((i+navigator.userAgent.length).toString(36)+s.toString(36),4);n.exports=function(){return o}}}),ue=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/lib/getRandomValue.browser.js"(t,n){var e,r=typeof window<"u"&&(window.crypto||window.msCrypto)||typeof self<"u"&&self.crypto;r?(s=Math.pow(2,32)-1,e=function(){return Math.abs(r.getRandomValues(new Uint32Array(1))[0]/s)}):e=Math.random;var s;n.exports=e}}),G=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/index.js"(t,n){var e=le(),r=z(),s=ue(),i=0,o=4,a=36,d=Math.pow(a,o);function l(){return r((s()*d<<0).toString(a),o)}function h(){return i=i<d?i:0,i++,i-1}function p(){var m="c",v=new Date().getTime().toString(a),b=r(h().toString(a),o),c=e(),u=l()+l();return m+v+b+c+u}p.slug=function(){var v=new Date().getTime().toString(36),b=h().toString(36).slice(-4),c=e().slice(0,1)+e().slice(-1),u=l().slice(-2);return v.slice(-2)+b+c+u},p.isCuid=function(v){return typeof v!="string"?!1:!!v.startsWith("c")},p.isSlug=function(v){if(typeof v!="string")return!1;var b=v.length;return b>=7&&b<=10},p.fingerprint=e,n.exports=p}}),J=P({"../../node_modules/.pnpm/@open-draft+deferred-promise@2.1.0/node_modules/@open-draft/deferred-promise/build/createDeferredExecutor.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createDeferredExecutor=void 0;function n(){const e=(r,s)=>{e.state="pending",e.resolve=i=>{if(e.state!=="pending")return;e.result=i;const o=a=>(e.state="fulfilled",a);return r(i instanceof Promise?i:Promise.resolve(i).then(o))},e.reject=i=>{if(e.state==="pending")return queueMicrotask(()=>{e.state="rejected"}),s(e.rejectionReason=i)}};return e}t.createDeferredExecutor=n}}),he=P({"../../node_modules/.pnpm/@open-draft+deferred-promise@2.1.0/node_modules/@open-draft/deferred-promise/build/DeferredPromise.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeferredPromise=void 0;var n=J(),e=class extends Promise{#e;resolve;reject;constructor(r=null){const s=(0,n.createDeferredExecutor)();super((i,o)=>{s(i,o),r?.(s.resolve,s.reject)}),this.#e=s,this.resolve=this.#e.resolve,this.reject=this.#e.reject}get state(){return this.#e.state}get rejectionReason(){return this.#e.rejectionReason}then(r,s){return this.#t(super.then(r,s))}catch(r){return this.#t(super.catch(r))}finally(r){return this.#t(super.finally(r))}#t(r){return Object.defineProperties(r,{resolve:{configurable:!0,value:this.resolve},reject:{configurable:!0,value:this.reject}})}};t.DeferredPromise=e}}),U=P({"../../node_modules/.pnpm/@open-draft+deferred-promise@2.1.0/node_modules/@open-draft/deferred-promise/build/index.js"(t){var n=t&&t.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),e=t&&t.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&n(s,r,i)};Object.defineProperty(t,"__esModule",{value:!0}),e(J(),t),e(he(),t)}}),Y=P({"../../node_modules/.pnpm/strict-event-emitter@0.4.3/node_modules/strict-event-emitter/lib/MemoryLeakError.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MemoryLeakError=void 0;var n=class extends Error{emitter;type;count;constructor(e,r,s){super(`Possible EventEmitter memory leak detected. ${s} ${r.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`),this.emitter=e,this.type=r,this.count=s,this.name="MaxListenersExceededWarning"}};t.MemoryLeakError=n}}),fe=P({"../../node_modules/.pnpm/strict-event-emitter@0.4.3/node_modules/strict-event-emitter/lib/Emitter.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=void 0;var n=Y(),e,r,s,i,o,a,d,l,h,p,m,v=class{constructor(){M(this,i),M(this,a),M(this,l),M(this,p),M(this,e,void 0),M(this,r,void 0),M(this,s,void 0),O(this,e,new Map),O(this,r,v.defaultMaxListeners),O(this,s,!1)}static listenerCount(c,u){return c.listenerCount(u)}setMaxListeners(c){return O(this,r,c),this}getMaxListeners(){return g(this,r)}eventNames(){return Array.from(g(this,e).keys())}emit(c,...u){const f=y(this,i,o).call(this,c);return f.forEach(I=>{I.apply(this,u)}),f.length>0}addListener(c,u){y(this,p,m).call(this,"newListener",c,u);const f=y(this,i,o).call(this,c).concat(u);if(g(this,e).set(c,f),g(this,r)>0&&this.listenerCount(c)>g(this,r)&&!g(this,s)){O(this,s,!0);const I=new n.MemoryLeakError(this,c,this.listenerCount(c));console.warn(I)}return this}on(c,u){return this.addListener(c,u)}once(c,u){return this.addListener(c,y(this,l,h).call(this,c,u))}prependListener(c,u){const f=y(this,i,o).call(this,c);if(f.length>0){const I=[u].concat(f);g(this,e).set(c,I)}else g(this,e).set(c,f.concat(u));return this}prependOnceListener(c,u){return this.prependListener(c,y(this,l,h).call(this,c,u))}removeListener(c,u){const f=y(this,i,o).call(this,c);return f.length>0&&(y(this,a,d).call(this,f,u),g(this,e).set(c,f),y(this,p,m).call(this,"removeListener",c,u)),this}off(c,u){return this.removeListener(c,u)}removeAllListeners(c){return c?g(this,e).delete(c):g(this,e).clear(),this}listeners(c){return Array.from(y(this,i,o).call(this,c))}listenerCount(c){return y(this,i,o).call(this,c).length}rawListeners(c){return this.listeners(c)}},b=v;e=new WeakMap,r=new WeakMap,s=new WeakMap,i=new WeakSet,o=function(c){return g(this,e).get(c)||[]},a=new WeakSet,d=function(c,u){const f=c.indexOf(u);return f>-1&&c.splice(f,1),[]},l=new WeakSet,h=function(c,u){const f=(...I)=>{this.removeListener(c,f),u.apply(this,I)};return f},p=new WeakSet,m=function(c,u,f){this.emit(c,u,f)},de(b,"defaultMaxListeners",10),t.Emitter=b}}),pe=P({"../../node_modules/.pnpm/strict-event-emitter@0.4.3/node_modules/strict-event-emitter/lib/index.js"(t){var n=t&&t.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),e=t&&t.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&n(s,r,i)};Object.defineProperty(t,"__esModule",{value:!0}),e(fe(),t),e(Y(),t)}}),me=j(G()),ve=/(%?)(%([sdjo]))/g;function we(t,n){switch(n){case"s":return t;case"d":case"i":return Number(t);case"j":return JSON.stringify(t);case"o":{if(typeof t=="string")return t;const e=JSON.stringify(t);return e==="{}"||e==="[]"||/^\[object .+?\]$/.test(e)?t:e}}}function w(t,...n){if(n.length===0)return t;let e=0,r=t.replace(ve,(s,i,o,a)=>{const d=n[e],l=we(d,a);return i?s:(e++,l)});return e<n.length&&(r+=` ${n.slice(e).join(" ")}`),r=r.replace(/%{2,2}/g,"%"),r}var ge=2;function ye(t){if(!t.stack)return;const n=t.stack.split(`
1
+ import{_ as X,a as _,b as E,c as k,d as H,n as D}from"./index-C9L2omqr.js";import{S as Q}from"./base-80a1f760-DYj-LFsk.js";import{g as W,r as F,f as Z,w as x,a as $,b as ee,E as te,c as re}from"./consoleHook-59e792cb-9ulSFryp.js";var ne=Object.create,T=Object.defineProperty,ie=Object.getOwnPropertyDescriptor,V=Object.getOwnPropertyNames,se=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty,ae=(t,n,e)=>n in t?T(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,P=(t,n)=>function(){return n||(0,t[V(t)[0]])((n={exports:{}}).exports,n),n.exports},ce=(t,n,e,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of V(n))!oe.call(t,s)&&s!==e&&T(t,s,{get:()=>n[s],enumerable:!(r=ie(n,s))||r.enumerable});return t},j=(t,n,e)=>(e=t!=null?ne(se(t)):{},ce(!t||!t.__esModule?T(e,"default",{value:t,enumerable:!0}):e,t)),de=(t,n,e)=>(ae(t,n+"",e),e),R=(t,n,e)=>{if(!n.has(t))throw TypeError("Cannot "+e)},g=(t,n,e)=>(R(t,n,"read from private field"),e?e.call(t):n.get(t)),M=(t,n,e)=>{if(n.has(t))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(t):n.set(t,e)},O=(t,n,e,r)=>(R(t,n,"write to private field"),n.set(t,e),e),y=(t,n,e)=>(R(t,n,"access private method"),e),z=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/lib/pad.js"(t,n){n.exports=function(r,s){var i="000000000"+r;return i.substr(i.length-s)}}}),le=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/lib/fingerprint.browser.js"(t,n){var e=z(),r=typeof window=="object"?window:self,s=Object.keys(r).length,i=navigator.mimeTypes?navigator.mimeTypes.length:0,o=e((i+navigator.userAgent.length).toString(36)+s.toString(36),4);n.exports=function(){return o}}}),ue=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/lib/getRandomValue.browser.js"(t,n){var e,r=typeof window<"u"&&(window.crypto||window.msCrypto)||typeof self<"u"&&self.crypto;r?(s=Math.pow(2,32)-1,e=function(){return Math.abs(r.getRandomValues(new Uint32Array(1))[0]/s)}):e=Math.random;var s;n.exports=e}}),G=P({"../../node_modules/.pnpm/cuid@2.1.8/node_modules/cuid/index.js"(t,n){var e=le(),r=z(),s=ue(),i=0,o=4,a=36,d=Math.pow(a,o);function l(){return r((s()*d<<0).toString(a),o)}function h(){return i=i<d?i:0,i++,i-1}function p(){var m="c",v=new Date().getTime().toString(a),b=r(h().toString(a),o),c=e(),u=l()+l();return m+v+b+c+u}p.slug=function(){var v=new Date().getTime().toString(36),b=h().toString(36).slice(-4),c=e().slice(0,1)+e().slice(-1),u=l().slice(-2);return v.slice(-2)+b+c+u},p.isCuid=function(v){return typeof v!="string"?!1:!!v.startsWith("c")},p.isSlug=function(v){if(typeof v!="string")return!1;var b=v.length;return b>=7&&b<=10},p.fingerprint=e,n.exports=p}}),J=P({"../../node_modules/.pnpm/@open-draft+deferred-promise@2.1.0/node_modules/@open-draft/deferred-promise/build/createDeferredExecutor.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createDeferredExecutor=void 0;function n(){const e=(r,s)=>{e.state="pending",e.resolve=i=>{if(e.state!=="pending")return;e.result=i;const o=a=>(e.state="fulfilled",a);return r(i instanceof Promise?i:Promise.resolve(i).then(o))},e.reject=i=>{if(e.state==="pending")return queueMicrotask(()=>{e.state="rejected"}),s(e.rejectionReason=i)}};return e}t.createDeferredExecutor=n}}),he=P({"../../node_modules/.pnpm/@open-draft+deferred-promise@2.1.0/node_modules/@open-draft/deferred-promise/build/DeferredPromise.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DeferredPromise=void 0;var n=J(),e=class extends Promise{#e;resolve;reject;constructor(r=null){const s=(0,n.createDeferredExecutor)();super((i,o)=>{s(i,o),r?.(s.resolve,s.reject)}),this.#e=s,this.resolve=this.#e.resolve,this.reject=this.#e.reject}get state(){return this.#e.state}get rejectionReason(){return this.#e.rejectionReason}then(r,s){return this.#t(super.then(r,s))}catch(r){return this.#t(super.catch(r))}finally(r){return this.#t(super.finally(r))}#t(r){return Object.defineProperties(r,{resolve:{configurable:!0,value:this.resolve},reject:{configurable:!0,value:this.reject}})}};t.DeferredPromise=e}}),U=P({"../../node_modules/.pnpm/@open-draft+deferred-promise@2.1.0/node_modules/@open-draft/deferred-promise/build/index.js"(t){var n=t&&t.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),e=t&&t.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&n(s,r,i)};Object.defineProperty(t,"__esModule",{value:!0}),e(J(),t),e(he(),t)}}),Y=P({"../../node_modules/.pnpm/strict-event-emitter@0.4.3/node_modules/strict-event-emitter/lib/MemoryLeakError.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.MemoryLeakError=void 0;var n=class extends Error{emitter;type;count;constructor(e,r,s){super(`Possible EventEmitter memory leak detected. ${s} ${r.toString()} listeners added. Use emitter.setMaxListeners() to increase limit`),this.emitter=e,this.type=r,this.count=s,this.name="MaxListenersExceededWarning"}};t.MemoryLeakError=n}}),fe=P({"../../node_modules/.pnpm/strict-event-emitter@0.4.3/node_modules/strict-event-emitter/lib/Emitter.js"(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=void 0;var n=Y(),e,r,s,i,o,a,d,l,h,p,m,v=class{constructor(){M(this,i),M(this,a),M(this,l),M(this,p),M(this,e,void 0),M(this,r,void 0),M(this,s,void 0),O(this,e,new Map),O(this,r,v.defaultMaxListeners),O(this,s,!1)}static listenerCount(c,u){return c.listenerCount(u)}setMaxListeners(c){return O(this,r,c),this}getMaxListeners(){return g(this,r)}eventNames(){return Array.from(g(this,e).keys())}emit(c,...u){const f=y(this,i,o).call(this,c);return f.forEach(I=>{I.apply(this,u)}),f.length>0}addListener(c,u){y(this,p,m).call(this,"newListener",c,u);const f=y(this,i,o).call(this,c).concat(u);if(g(this,e).set(c,f),g(this,r)>0&&this.listenerCount(c)>g(this,r)&&!g(this,s)){O(this,s,!0);const I=new n.MemoryLeakError(this,c,this.listenerCount(c));console.warn(I)}return this}on(c,u){return this.addListener(c,u)}once(c,u){return this.addListener(c,y(this,l,h).call(this,c,u))}prependListener(c,u){const f=y(this,i,o).call(this,c);if(f.length>0){const I=[u].concat(f);g(this,e).set(c,I)}else g(this,e).set(c,f.concat(u));return this}prependOnceListener(c,u){return this.prependListener(c,y(this,l,h).call(this,c,u))}removeListener(c,u){const f=y(this,i,o).call(this,c);return f.length>0&&(y(this,a,d).call(this,f,u),g(this,e).set(c,f),y(this,p,m).call(this,"removeListener",c,u)),this}off(c,u){return this.removeListener(c,u)}removeAllListeners(c){return c?g(this,e).delete(c):g(this,e).clear(),this}listeners(c){return Array.from(y(this,i,o).call(this,c))}listenerCount(c){return y(this,i,o).call(this,c).length}rawListeners(c){return this.listeners(c)}},b=v;e=new WeakMap,r=new WeakMap,s=new WeakMap,i=new WeakSet,o=function(c){return g(this,e).get(c)||[]},a=new WeakSet,d=function(c,u){const f=c.indexOf(u);return f>-1&&c.splice(f,1),[]},l=new WeakSet,h=function(c,u){const f=(...I)=>{this.removeListener(c,f),u.apply(this,I)};return f},p=new WeakSet,m=function(c,u,f){this.emit(c,u,f)},de(b,"defaultMaxListeners",10),t.Emitter=b}}),pe=P({"../../node_modules/.pnpm/strict-event-emitter@0.4.3/node_modules/strict-event-emitter/lib/index.js"(t){var n=t&&t.__createBinding||(Object.create?function(r,s,i,o){o===void 0&&(o=i);var a=Object.getOwnPropertyDescriptor(s,i);(!a||("get"in a?!s.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return s[i]}}),Object.defineProperty(r,o,a)}:function(r,s,i,o){o===void 0&&(o=i),r[o]=s[i]}),e=t&&t.__exportStar||function(r,s){for(var i in r)i!=="default"&&!Object.prototype.hasOwnProperty.call(s,i)&&n(s,r,i)};Object.defineProperty(t,"__esModule",{value:!0}),e(fe(),t),e(Y(),t)}}),me=j(G()),ve=/(%?)(%([sdjo]))/g;function we(t,n){switch(n){case"s":return t;case"d":case"i":return Number(t);case"j":return JSON.stringify(t);case"o":{if(typeof t=="string")return t;const e=JSON.stringify(t);return e==="{}"||e==="[]"||/^\[object .+?\]$/.test(e)?t:e}}}function w(t,...n){if(n.length===0)return t;let e=0,r=t.replace(ve,(s,i,o,a)=>{const d=n[e],l=we(d,a);return i?s:(e++,l)});return e<n.length&&(r+=` ${n.slice(e).join(" ")}`),r=r.replace(/%{2,2}/g,"%"),r}var ge=2;function ye(t){if(!t.stack)return;const n=t.stack.split(`
2
2
  `);n.splice(1,ge),t.stack=n.join(`
3
3
  `)}var _e=class extends Error{constructor(t,...n){super(t),this.message=t,this.name="Invariant Violation",this.message=w(t,...n),ye(this)}},S=(t,n,...e)=>{if(!t)throw new _e(n,...e)};S.as=(t,n,e,...r)=>{if(!n)throw t.prototype.name!=null?new t(w(e,r)):t(w(e,r))};var A=j(U()),Ee=window.localStorage.CSB_EMULATOR_DEBUG,Pe="\x1B[0m",be="\x1B[32;1m",Se="\x1B[31m",Le="\x1B[34m",Ie="\x1B[33;1m",Me="\x1B[35;1m",B="\x1B[36;1m",je={preview:Ie,emulator:Me,runtime:B,bridge:Le,"runtime:worker":B};function K(t){return function(e,...r){if(Ee==="true"){const s=()=>e.includes("sender")?`${be}sender`:e.includes("receiver")?`${Se}receiver`:"",i=e.replace(/\[.+\]:/,"");console.debug(`${je[t]}${t}:${s()}${Pe}:${i}`,...r)}}}var L=K("emulator"),Oe=class{constructor(t){this.target=t,this.emitter=new EventTarget,this.channel=new MessageChannel,this.receiverPort=this.channel.port1;const n=new A.DeferredPromise,e=r=>{r.data.type==="internal/ready"&&(L("[message-sender]: runtime is ready"),n.resolve())};window.addEventListener("message",e),n.then(()=>{window.removeEventListener("message",e)}),this.receiverReadyPromise=n,this.receiverPort.onmessage=r=>{const s=r.data;s.type!=null&&(L('[message-sender]: emitting "%s" event...',s.type,s.payload),this.emitter.dispatchEvent(new MessageEvent(s.type,{data:s.payload})))}}emitter;channel;receiverPort;receiverReadyPromise;async handshake(){const t=new A.DeferredPromise;await this.receiverReadyPromise,L("[message-sender]: sending handshake"),this.target.postMessage({type:"internal/handshake"},"*",[this.channel.port2]),this.on("internal/handshake/done",()=>{t.resolve(),clearTimeout(n)});const n=setTimeout(()=>{t.reject(new Error("MessageSender: Handshake timeout"))},5e3);return t}on(t,n,e){L('[message-sender]: add listener "%s"',t),this.emitter.addEventListener(t,r=>{r instanceof MessageEvent&&n(r)},e)}off(t,n,e){this.emitter.removeEventListener(t,n,e)}async send(t,...n){const e=new A.DeferredPromise,r=(0,me.default)(),s=n[0]||{};L('[message-sender]: send "%s" (%s)',t,r,s),this.receiverPort.postMessage({type:t,payload:{operationId:r,payload:s}}),L('[message-sender]: adding done listener for "%s" (%s)',t,r);const i=a=>{const{data:d}=a;if(d.operationId===r){const l=d.listenerPayload||{};L('[message-sender]: resolving "%s (%s) promise!',t,r),e.resolve({...l,operationId:d.operationId})}},o=a=>{const{data:d}=a;d.operationId===r&&(L('[message-sender]: rejecting "%s (%s) promise!',t,r),e.reject(d.error))};return this.on("internal/operation/done",i),this.on("internal/operation/failed",o),e.finally(()=>{this.emitter.removeEventListener("internal/operation/done",i),this.emitter.removeEventListener("internal/operation/failed",o)})}},N=j(U()),ke=j(G()),Ce=class{constructor(t){this.channel=t}async init(t){await this.channel.send("fs/init",{files:t})}async readFile(t,n){const e=await this.channel.send("fs/readFile",{path:t,encoding:n}).catch(r=>{throw new Error(w('Failed to read file at path "%s"',t),{cause:r})});if(!e)throw new Error("File not found");return e.data}async writeFile(t,n,e){let r,s=!1;typeof e=="object"?(r=e.encoding,s=!!e.recursive):typeof e=="string"&&(r=e),await this.channel.send("fs/writeFile",{path:t,content:n,encoding:r,recursive:s}).catch(i=>{throw new Error(w('Failed to write file at path "%s"',t),{cause:i})})}async readdir(t){const n=await this.channel.send("fs/readdir",{path:t}).catch(e=>{throw new Error(w('Failed to read directory at path "%s"',t),{cause:e})});if(!n)throw new Error("Directory not found");return n.data}async mkdir(t,n){const e=!!n?.recursive;await this.channel.send("fs/mkdir",{path:t,recursive:e}).catch(r=>{throw new Error(w('Failed to make directory at path "%s"',t),{cause:r})})}async stat(t){const n=await this.channel.send("fs/stat",{path:t}).catch(e=>{throw new Error(w('Failed to stat file at path "%s"',t),{cause:e})});if(!n)throw new Error("File not found");return n.data}async rm(t,n){const{force:e,recursive:r}=n||{};await this.channel.send("fs/rm",{path:t,force:e,recursive:r}).catch(s=>{throw new Error(w('Failed to remove file at path "%s"',t),{cause:s})})}async watch(t,n,e){const r=(0,ke.default)();return await this.channel.send("fs/watch",{watcherId:r,includes:t,excludes:n}),this.channel.on("fs/watch-event",({data:s})=>{if(s.watcherId===r&&e){const i={...s};delete i.watcherId,e(i)}}),{dispose:()=>this.channel.send("fs/unwatch",{watcherId:r})}}},q=j(pe()),Fe=class{constructor(t){this.channel=t}create(){return new xe(this.channel)}},xe=class{constructor(t){this.channel=t,this.state="running",this.stdout=new q.Emitter,this.stderr=new q.Emitter,this.stdin={write:n=>{if(!this.id)throw new Error("Failed to write to stdin, no process is currently running");return this.channel.send("shell/stdin",{data:n,workerId:this.id})}},this.forwardStdEvents()}id;state;stdout;stderr;stdin;forwardStdEvents(){this.channel.on("worker/tty",t=>{const{data:n}=t;if(n.workerId===this.id)switch(n.payload.type){case"out":{this.stdout.emit("data",n.payload.data);break}case"err":{this.stderr.emit("data",n.payload.data);break}}})}async runCommand(t,n,e={}){S(!this.id,'Failed to run "runCommand" on a ShellProcess: there is already a process running.');const r=await this.channel.send("shell/runCommand",{command:t,args:n,options:e});return S(r,'Failed to run "runCommand" on a ShellProcess: was not able to retrieve a running process.'),this.id=r.id,this.state="running",r}async on(t,n){switch(t){case"progress":{this.channel.on("worker/progress",({data:e})=>{n(e.status)});return}case"exit":{this.channel.on("worker/exit",({data:e})=>{e.workerId===this.id&&n(e.exitCode,e.error)});return}}}async kill(){S(this.id,'Failed to run "kill" on a ShellProcess: there is no process running. Did you forget to run it?'),this.state="idle",await this.channel.send("shell/exit",{id:this.id}).catch(t=>{throw new Error(w('Failed to kill shell with ID "%s"',this.id),{cause:t})}),this.id=void 0}},Ae=j(U()),De=2e4,Te=class{constructor(t){this.channel=t}async waitFor(t,n,e=De){const r=new Ae.DeferredPromise,s=setTimeout(()=>{r.reject()},e),i=await this.channel.send("preview/get/info",t).catch(a=>{r.reject(new Error(w('Failed to look up preview information for shell ID "%s" (port: %d)',t.sourceShellId,t.port)))}),o=i&&n(i);return o&&r.resolve({url:i.url,port:i.port,sourceShellId:i.sourceShellId}),this.channel.on("preview/port/ready",({data:a})=>{!o&&n(a)&&r.resolve({url:a.url,port:a.port,sourceShellId:a.sourceShellId})}),r.finally(()=>{clearTimeout(s)})}async getByShellId(t,n){return this.waitFor({sourceShellId:t},e=>e.sourceShellId===t,n).catch(e=>{throw new Error(w('Failed to get shell by ID "%s"',t),{cause:e})})}async waitForPort(t,n){return this.waitFor({port:t},e=>e.port===t,n).catch(e=>{throw new Error(w("Failed to await port %d",t),{cause:e})})}},Re="https://nodebox-runtime.codesandbox.io",C=K("emulator"),Ue=class{constructor(t){this.options=t,S(this.options.iframe,'Failed to create a Nodebox: expected "iframe" argument to be a reference to an <iframe> element but got %j',this.options.iframe),this.url=this.options.runtimeUrl||Re,this.isConnected=!1}channel=null;isConnected;url;fileSystemApi=null;shellApi=null;previewApi=null;async connect(){const{iframe:t,cdnUrl:n}=this.options;C("[message-sender]: Connecting to node emulator...");const e=new N.DeferredPromise;this.url||e.reject(new Error("Nodebox URL is missing. Did you forget to provide it when creating this Nodebox instance?")),S(t.contentWindow,"Failed to create a MessageChannel with the Nodebox iframe: no content window found"),this.channel=new Oe(t.contentWindow);const r=new N.DeferredPromise;return t.setAttribute("src",this.url),t.addEventListener("load",()=>{r.resolve()},{once:!0}),t.addEventListener("error",s=>{r.reject(s.error)},{once:!0}),await r,C("[message-sender]: IFrame loaded..."),await this.channel.handshake(),C("[message-sender]: Handshake completed..."),this.channel.send("connect",{cdnUrl:n}),this.channel.on("runtime/ready",()=>{e.resolve()}),e.then(()=>{C("[message-sender]: Connected to runtime..."),this.isConnected=!0})}get fs(){return S(this.isConnected,'Failed to access the File System API: consumer is not connected. Did you forget to run "connect()"?'),this.fileSystemApi?this.fileSystemApi:(this.fileSystemApi=new Ce(this.channel),this.fileSystemApi)}get shell(){return S(this.isConnected,'Failed to access the Shell API: consumer is not connected. Did you forget to run "connect()"?'),this.shellApi?this.shellApi:(this.shellApi=new Fe(this.channel),this.shellApi)}get preview(){return S(this.isConnected,'Failed to access the Preview API: consumer is not connected. Did you forget to run "connect()"?'),this.previewApi?this.previewApi:(this.previewApi=new Te(this.channel),this.previewApi)}},We="INJECT_AND_INVOKE",Be="PREVIEW_LOADED";function Ne(t,n){return _(this,void 0,void 0,function(){var e,r,s,i,o;return E(this,function(a){return e=t.contentWindow,D(e,"Failed to await preview iframe: no content window found"),r=9e4,s=20,i=0,[2,new Promise(function(d,l){var h=function(){var p=function(){clearTimeout(o),i=s,d(),t.removeEventListener("load",p)};if(i>=s){l(H("Could not able to connect to preview."));return}t.setAttribute("src",n),o=setTimeout(function(){h(),t.removeEventListener("load",p)},r),i=i+1,t.addEventListener("load",p)};t.addEventListener("error",function(){return l(new Error("Iframe error"))}),t.addEventListener("abort",function(){return l(new Error("Aborted"))}),h()})]})})}var qe=function(t,n){t.style.border="0",t.style.width=n.width||"100%",t.style.height=n.height||"100%",t.style.overflow="hidden",t.allow="cross-origin-isolated"};function He(t){var n=t.scope,e=window.history.__proto__,r=[],s=0,i=function(d){parent.postMessage({type:"urlchange",url:d,back:s>0,forward:s<r.length-1,channelId:n.channelId},"*")};function o(d,l){r.splice(s+1),r.push({url:d,state:l}),s=r.length-1}Object.assign(window.history,{go:function(d){var l=s+d;if(l>=0&&l<=r.length-1){s=l;var h=r[s],p=h.url,m=h.state;e.replaceState.call(window.history,m,"",p);var v=document.location.href;i(v),window.dispatchEvent(new PopStateEvent("popstate",{state:m}))}},back:function(){window.history.go(-1)},forward:function(){window.history.go(1)},pushState:function(d,l,h){e.replaceState.call(window.history,d,l,h),o(h,d),i(document.location.href)},replaceState:function(d,l,h){e.replaceState.call(window.history,d,l,h),r[s]={state:d,url:h},i(document.location.href)}});function a(d){var l=d.data;l.type==="urlback"?history.back():l.type==="urlforward"?history.forward():l.type==="refresh"&&document.location.reload()}window.addEventListener("message",a)}function Ve(t){var n=t.scope,e=0;function r(){if(typeof window>"u")return 0;var a=document.body,d=document.documentElement;return Math.max(a.scrollHeight,a.offsetHeight,d.offsetHeight)}function s(){var a=r();e!==a&&window.parent.postMessage({type:"resize",height:a,codesandbox:!0,channelId:n.channelId},"*"),e=a}s();var i,o=new MutationObserver(function(){i===void 0&&(s(),i=setTimeout(function(){i=void 0},300))});o.observe(document,{attributes:!0,childList:!0,subtree:!0}),setInterval(s,300)}var ze=[{code:He.toString(),id:"historyListener"},{code:"function consoleHook({ scope }) {"+re+`
4
4
  };`,id:"consoleHook"},{code:Ve.toString(),id:"watchResize"}],Ge=function(t,n){ze.forEach(function(e){var r,s=e.code,i=e.id,o={uid:i,type:We,code:"exports.activate = ".concat(s),scope:{channelId:n}};(r=t.contentWindow)===null||r===void 0||r.postMessage(o,"*")})},Xe=(function(t){X(n,t);function n(e,r,s){s===void 0&&(s={});var i=t.call(this,e,r,k(k({},s),{bundlerURL:s.bundlerURL}))||this;return i._modulesCache=new Map,i.messageChannelId=ee(),i._initPromise=null,i.emitter=new te,i.manageIframes(e),i.emulator=new Ue({iframe:i.emulatorIframe,runtimeUrl:i.options.bundlerURL}),i.updateSandbox(r),i}return n.prototype._init=function(e){return _(this,void 0,void 0,function(){return E(this,function(r){switch(r.label){case 0:return[4,this.emulator.connect()];case 1:return r.sent(),[4,this.emulator.fs.init(e)];case 2:return r.sent(),[4,this.globalListeners()];case 3:return r.sent(),[2]}})})},n.prototype.compile=function(e){return _(this,void 0,void 0,function(){var r,s;return E(this,function(i){switch(i.label){case 0:return i.trys.push([0,5,,6]),this.status="initializing",this.dispatch({type:"start",firstLoad:!0}),this._initPromise||(this._initPromise=this._init(e)),[4,this._initPromise];case 1:return i.sent(),this.dispatch({type:"connected"}),[4,this.createShellProcessFromTask(e)];case 2:return r=i.sent().id,[4,this.createPreviewURLFromId(r)];case 3:return i.sent(),[4,this.setLocationURLIntoIFrame()];case 4:return i.sent(),this.dispatchDoneMessage(),[3,6];case 5:return s=i.sent(),this.dispatch({type:"action",action:"notification",notificationType:"error",title:W(s)}),this.dispatch({type:"done",compilatonError:!0}),[3,6];case 6:return[2]}})})},n.prototype.createShellProcessFromTask=function(e){return _(this,void 0,void 0,function(){var r,s,i=this;return E(this,function(o){switch(o.label){case 0:return r=F(e["/package.json"]),this.emulatorCommand=Z(r),this.emulatorShellProcess=this.emulator.shell.create(),[4,this.emulatorShellProcess.on("exit",function(a){i.dispatch({type:"action",action:"notification",notificationType:"error",title:H("Error: process.exit(".concat(a,") called."))})})];case 1:return o.sent(),[4,this.emulatorShellProcess.on("progress",function(a){var d,l;if(a.state==="command_running"||a.state==="starting_command"){i.dispatch({type:"shell/progress",data:k(k({},a),{command:[(d=i.emulatorCommand)===null||d===void 0?void 0:d[0],(l=i.emulatorCommand)===null||l===void 0?void 0:l[1].join(" ")].join(" ")})}),i.status="installing-dependencies";return}i.dispatch({type:"shell/progress",data:a})})];case 2:return o.sent(),this.emulatorShellProcess.stdout.on("data",function(a){i.dispatch({type:"stdout",payload:{data:a,type:"out"}})}),this.emulatorShellProcess.stderr.on("data",function(a){i.dispatch({type:"stdout",payload:{data:a,type:"err"}})}),[4,(s=this.emulatorShellProcess).runCommand.apply(s,this.emulatorCommand)];case 3:return[2,o.sent()]}})})},n.prototype.createPreviewURLFromId=function(e){var r;return _(this,void 0,void 0,function(){var s;return E(this,function(i){switch(i.label){case 0:return this.iframePreviewUrl=void 0,[4,this.emulator.preview.getByShellId(e)];case 1:return s=i.sent().url,this.iframePreviewUrl=s+((r=this.options.startRoute)!==null&&r!==void 0?r:""),[2]}})})},n.prototype.manageIframes=function(e){var r;if(typeof e=="string"){var s=document.querySelector(e);D(s,"The element '".concat(e,"' was not found")),this.iframe=document.createElement("iframe"),s?.appendChild(this.iframe)}else this.iframe=e;qe(this.iframe,this.options),D(this.iframe.parentNode,"The given iframe does not have a parent."),this.emulatorIframe=document.createElement("iframe"),this.emulatorIframe.classList.add("sp-bridge-frame"),(r=this.iframe.parentNode)===null||r===void 0||r.appendChild(this.emulatorIframe)},n.prototype.setLocationURLIntoIFrame=function(){return _(this,void 0,void 0,function(){return E(this,function(e){switch(e.label){case 0:return this.iframePreviewUrl?[4,Ne(this.iframe,this.iframePreviewUrl)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},n.prototype.dispatchDoneMessage=function(){this.status="done",this.dispatch({type:"done",compilatonError:!1}),this.iframePreviewUrl&&this.dispatch({type:"urlchange",url:this.iframePreviewUrl,back:!1,forward:!1})},n.prototype.globalListeners=function(){return _(this,void 0,void 0,function(){var e=this;return E(this,function(r){switch(r.label){case 0:return window.addEventListener("message",function(s){s.data.type===Be&&Ge(e.iframe,e.messageChannelId),s.data.type==="urlchange"&&s.data.channelId===e.messageChannelId?e.dispatch({type:"urlchange",url:s.data.url,back:s.data.back,forward:s.data.forward}):s.data.channelId===e.messageChannelId&&e.dispatch(s.data)}),[4,this.emulator.fs.watch(["*"],[".next","node_modules","build","dist","vendor",".config",".vuepress"],function(s){return _(e,void 0,void 0,function(){var i,o,a,d,l,h,p;return E(this,function(m){switch(m.label){case 0:return s?(i=s,o="newPath"in i?i.newPath:"path"in i?i.path:"",[4,this.emulator.fs.stat(o)]):[2];case 1:if(a=m.sent().type,a!=="file")return[2,null];m.label=2;case 2:switch(m.trys.push([2,10,,11]),d=i.type,d){case"change":return[3,3];case"create":return[3,3];case"remove":return[3,5];case"rename":return[3,6];case"close":return[3,8]}return[3,9];case 3:return[4,this.emulator.fs.readFile(i.path,"utf8")];case 4:return l=m.sent(),this.dispatch({type:"fs/change",path:i.path,content:l}),this._modulesCache.set(i.path,x(l)),[3,9];case 5:return this.dispatch({type:"fs/remove",path:i.path}),this._modulesCache.delete(i.path),[3,9];case 6:return this.dispatch({type:"fs/remove",path:i.oldPath}),this._modulesCache.delete(i.oldPath),[4,this.emulator.fs.readFile(i.newPath,"utf8")];case 7:return h=m.sent(),this.dispatch({type:"fs/change",path:i.newPath,content:h}),this._modulesCache.set(i.newPath,x(h)),[3,9];case 8:return[3,9];case 9:return[3,11];case 10:return p=m.sent(),this.dispatch({type:"action",action:"notification",notificationType:"error",title:W(p)}),[3,11];case 11:return[2]}})})})];case 1:return r.sent(),[2]}})})},n.prototype.restartShellProcess=function(){var e;return _(this,void 0,void 0,function(){return E(this,function(r){switch(r.label){case 0:return this.emulatorShellProcess&&this.emulatorCommand?(this.dispatch({type:"start",firstLoad:!0}),this.status="initializing",[4,this.emulatorShellProcess.kill()]):[3,3];case 1:return r.sent(),(e=this.iframe)===null||e===void 0||e.removeAttribute("attr"),this.emulator.fs.rm("/node_modules/.vite",{recursive:!0,force:!0}),[4,this.compile(Object.fromEntries(this._modulesCache))];case 2:r.sent(),r.label=3;case 3:return[2]}})})},n.prototype.updateSandbox=function(e){var r=this,s,i=$(e.files);if(((s=this.emulatorShellProcess)===null||s===void 0?void 0:s.state)==="running"){Object.entries(i).forEach(function(o){var a=o[0],d=o[1];(!r._modulesCache.get(a)||F(d)!==F(r._modulesCache.get(a)))&&r.emulator.fs.writeFile(a,d,{recursive:!0})});return}this.dispatch({codesandbox:!0,modules:i,template:e.template,type:"compile"}),Object.entries(i).forEach(function(o){var a=o[0],d=o[1];r._modulesCache.set(a,x(d))})},n.prototype.dispatch=function(e){var r,s;return _(this,void 0,void 0,function(){var i;return E(this,function(o){switch(o.label){case 0:switch(i=e.type,i){case"compile":return[3,1];case"refresh":return[3,2];case"urlback":return[3,4];case"urlforward":return[3,4];case"shell/restart":return[3,5];case"shell/openPreview":return[3,6]}return[3,7];case 1:return this.compile(e.modules),[3,8];case 2:return[4,this.setLocationURLIntoIFrame()];case 3:return o.sent(),[3,8];case 4:return(s=(r=this.iframe)===null||r===void 0?void 0:r.contentWindow)===null||s===void 0||s.postMessage(e,"*"),[3,8];case 5:return this.restartShellProcess(),[3,8];case 6:return window.open(this.iframePreviewUrl,"_blank"),[3,8];case 7:this.emitter.dispatch(e),o.label=8;case 8:return[2]}})})},n.prototype.listen=function(e){return this.emitter.listener(e)},n.prototype.destroy=function(){this.emulatorIframe.remove(),this.emitter.cleanup()},n})(Q);export{Xe as SandpackNode};