@gdquest/gd-exercise
Version:
Core package that handles logic for the GDExercise project.
1 lines • 223 kB
JavaScript
import{a as kr}from"./chunk-XAPRL75U.min.mjs";import{a as wn,b as lt}from"./chunk-2YCYAEJC.min.mjs";var Hi=wn((wf,Cr)=>{"use strict";var qa=Object.prototype.hasOwnProperty,_e="~";function Zt(){}Object.create&&(Zt.prototype=Object.create(null),new Zt().__proto__||(_e=!1));function ja(n,t,e){this.fn=n,this.context=t,this.once=e||!1}function Gi(n,t,e,r,s){if(typeof e!="function")throw new TypeError("The listener must be a function");var a=new ja(e,r||n,s),i=_e?_e+t:t;return n._events[i]?n._events[i].fn?n._events[i]=[n._events[i],a]:n._events[i].push(a):(n._events[i]=a,n._eventsCount++),n}function xn(n,t){--n._eventsCount===0?n._events=new Zt:delete n._events[t]}function ce(){this._events=new Zt,this._eventsCount=0}ce.prototype.eventNames=function(){var t=[],e,r;if(this._eventsCount===0)return t;for(r in e=this._events)qa.call(e,r)&&t.push(_e?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};ce.prototype.listeners=function(t){var e=_e?_e+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,a=r.length,i=new Array(a);s<a;s++)i[s]=r[s].fn;return i};ce.prototype.listenerCount=function(t){var e=_e?_e+t:t,r=this._events[e];return r?r.fn?1:r.length:0};ce.prototype.emit=function(t,e,r,s,a,i){var l=_e?_e+t:t;if(!this._events[l])return!1;var o=this._events[l],d=arguments.length,c,f;if(o.fn){switch(o.once&&this.removeListener(t,o.fn,void 0,!0),d){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,e),!0;case 3:return o.fn.call(o.context,e,r),!0;case 4:return o.fn.call(o.context,e,r,s),!0;case 5:return o.fn.call(o.context,e,r,s,a),!0;case 6:return o.fn.call(o.context,e,r,s,a,i),!0}for(f=1,c=new Array(d-1);f<d;f++)c[f-1]=arguments[f];o.fn.apply(o.context,c)}else{var m=o.length,g;for(f=0;f<m;f++)switch(o[f].once&&this.removeListener(t,o[f].fn,void 0,!0),d){case 1:o[f].fn.call(o[f].context);break;case 2:o[f].fn.call(o[f].context,e);break;case 3:o[f].fn.call(o[f].context,e,r);break;case 4:o[f].fn.call(o[f].context,e,r,s);break;default:if(!c)for(g=1,c=new Array(d-1);g<d;g++)c[g-1]=arguments[g];o[f].fn.apply(o[f].context,c)}}return!0};ce.prototype.on=function(t,e,r){return Gi(this,t,e,r,!1)};ce.prototype.once=function(t,e,r){return Gi(this,t,e,r,!0)};ce.prototype.removeListener=function(t,e,r,s){var a=_e?_e+t:t;if(!this._events[a])return this;if(!e)return xn(this,a),this;var i=this._events[a];if(i.fn)i.fn===e&&(!s||i.once)&&(!r||i.context===r)&&xn(this,a);else{for(var l=0,o=[],d=i.length;l<d;l++)(i[l].fn!==e||s&&!i[l].once||r&&i[l].context!==r)&&o.push(i[l]);o.length?this._events[a]=o.length===1?o[0]:o:xn(this,a)}return this};ce.prototype.removeAllListeners=function(t){var e;return t?(e=_e?_e+t:t,this._events[e]&&xn(this,e)):(this._events=new Zt,this._eventsCount=0),this};ce.prototype.off=ce.prototype.removeListener;ce.prototype.addListener=ce.prototype.on;ce.prefixed=_e;ce.EventEmitter=ce;typeof Cr<"u"&&(Cr.exports=ce)});var qt=wn((vf,Vi)=>{"use strict";function Ie(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}function zi(n,t){for(var e="",r=0,s=-1,a=0,i,l=0;l<=n.length;++l){if(l<n.length)i=n.charCodeAt(l);else{if(i===47)break;i=47}if(i===47){if(!(s===l-1||a===1))if(s!==l-1&&a===2){if(e.length<2||r!==2||e.charCodeAt(e.length-1)!==46||e.charCodeAt(e.length-2)!==46){if(e.length>2){var o=e.lastIndexOf("/");if(o!==e.length-1){o===-1?(e="",r=0):(e=e.slice(0,o),r=e.length-1-e.lastIndexOf("/")),s=l,a=0;continue}}else if(e.length===2||e.length===1){e="",r=0,s=l,a=0;continue}}t&&(e.length>0?e+="/..":e="..",r=2)}else e.length>0?e+="/"+n.slice(s+1,l):e=n.slice(s+1,l),r=l-s-1;s=l,a=0}else i===46&&a!==-1?++a:a=-1}return e}function Wa(n,t){var e=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return e?e===t.root?e+r:e+n+r:r}var yt={resolve:function(){for(var t="",e=!1,r,s=arguments.length-1;s>=-1&&!e;s--){var a;s>=0?a=arguments[s]:(r===void 0&&(r=process.cwd()),a=r),Ie(a),a.length!==0&&(t=a+"/"+t,e=a.charCodeAt(0)===47)}return t=zi(t,!e),e?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(Ie(t),t.length===0)return".";var e=t.charCodeAt(0)===47,r=t.charCodeAt(t.length-1)===47;return t=zi(t,!e),t.length===0&&!e&&(t="."),t.length>0&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return Ie(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,e=0;e<arguments.length;++e){var r=arguments[e];Ie(r),r.length>0&&(t===void 0?t=r:t+="/"+r)}return t===void 0?".":yt.normalize(t)},relative:function(t,e){if(Ie(t),Ie(e),t===e||(t=yt.resolve(t),e=yt.resolve(e),t===e))return"";for(var r=1;r<t.length&&t.charCodeAt(r)===47;++r);for(var s=t.length,a=s-r,i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var l=e.length,o=l-i,d=a<o?a:o,c=-1,f=0;f<=d;++f){if(f===d){if(o>d){if(e.charCodeAt(i+f)===47)return e.slice(i+f+1);if(f===0)return e.slice(i+f)}else a>d&&(t.charCodeAt(r+f)===47?c=f:f===0&&(c=0));break}var m=t.charCodeAt(r+f),g=e.charCodeAt(i+f);if(m!==g)break;m===47&&(c=f)}var p="";for(f=r+c+1;f<=s;++f)(f===s||t.charCodeAt(f)===47)&&(p.length===0?p+="..":p+="/..");return p.length>0?p+e.slice(i+c):(i+=c,e.charCodeAt(i)===47&&++i,e.slice(i))},_makeLong:function(t){return t},dirname:function(t){if(Ie(t),t.length===0)return".";for(var e=t.charCodeAt(0),r=e===47,s=-1,a=!0,i=t.length-1;i>=1;--i)if(e=t.charCodeAt(i),e===47){if(!a){s=i;break}}else a=!1;return s===-1?r?"/":".":r&&s===1?"//":t.slice(0,s)},basename:function(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');Ie(t);var r=0,s=-1,a=!0,i;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var l=e.length-1,o=-1;for(i=t.length-1;i>=0;--i){var d=t.charCodeAt(i);if(d===47){if(!a){r=i+1;break}}else o===-1&&(a=!1,o=i+1),l>=0&&(d===e.charCodeAt(l)?--l===-1&&(s=i):(l=-1,s=o))}return r===s?s=o:s===-1&&(s=t.length),t.slice(r,s)}else{for(i=t.length-1;i>=0;--i)if(t.charCodeAt(i)===47){if(!a){r=i+1;break}}else s===-1&&(a=!1,s=i+1);return s===-1?"":t.slice(r,s)}},extname:function(t){Ie(t);for(var e=-1,r=0,s=-1,a=!0,i=0,l=t.length-1;l>=0;--l){var o=t.charCodeAt(l);if(o===47){if(!a){r=l+1;break}continue}s===-1&&(a=!1,s=l+1),o===46?e===-1?e=l:i!==1&&(i=1):e!==-1&&(i=-1)}return e===-1||s===-1||i===0||i===1&&e===s-1&&e===r+1?"":t.slice(e,s)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return Wa("/",t)},parse:function(t){Ie(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;var r=t.charCodeAt(0),s=r===47,a;s?(e.root="/",a=1):a=0;for(var i=-1,l=0,o=-1,d=!0,c=t.length-1,f=0;c>=a;--c){if(r=t.charCodeAt(c),r===47){if(!d){l=c+1;break}continue}o===-1&&(d=!1,o=c+1),r===46?i===-1?i=c:f!==1&&(f=1):i!==-1&&(f=-1)}return i===-1||o===-1||f===0||f===1&&i===o-1&&i===l+1?o!==-1&&(l===0&&s?e.base=e.name=t.slice(1,o):e.base=e.name=t.slice(l,o)):(l===0&&s?(e.name=t.slice(1,i),e.base=t.slice(1,o)):(e.name=t.slice(l,i),e.base=t.slice(l,o)),e.ext=t.slice(i,o)),l>0?e.dir=t.slice(0,l-1):s&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};yt.posix=yt;Vi.exports=yt});var Ki=wn((bf,Or)=>{"use strict";var Ga=Object.prototype.hasOwnProperty,ge="~";function jt(){}Object.create&&(jt.prototype=Object.create(null),new jt().__proto__||(ge=!1));function Ha(n,t,e){this.fn=n,this.context=t,this.once=e||!1}function Yi(n,t,e,r,s){if(typeof e!="function")throw new TypeError("The listener must be a function");var a=new Ha(e,r||n,s),i=ge?ge+t:t;return n._events[i]?n._events[i].fn?n._events[i]=[n._events[i],a]:n._events[i].push(a):(n._events[i]=a,n._eventsCount++),n}function vn(n,t){--n._eventsCount===0?n._events=new jt:delete n._events[t]}function fe(){this._events=new jt,this._eventsCount=0}fe.prototype.eventNames=function(){var t=[],e,r;if(this._eventsCount===0)return t;for(r in e=this._events)Ga.call(e,r)&&t.push(ge?r.slice(1):r);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(e)):t};fe.prototype.listeners=function(t){var e=ge?ge+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,a=r.length,i=new Array(a);s<a;s++)i[s]=r[s].fn;return i};fe.prototype.listenerCount=function(t){var e=ge?ge+t:t,r=this._events[e];return r?r.fn?1:r.length:0};fe.prototype.emit=function(t,e,r,s,a,i){var l=ge?ge+t:t;if(!this._events[l])return!1;var o=this._events[l],d=arguments.length,c,f;if(o.fn){switch(o.once&&this.removeListener(t,o.fn,void 0,!0),d){case 1:return o.fn.call(o.context),!0;case 2:return o.fn.call(o.context,e),!0;case 3:return o.fn.call(o.context,e,r),!0;case 4:return o.fn.call(o.context,e,r,s),!0;case 5:return o.fn.call(o.context,e,r,s,a),!0;case 6:return o.fn.call(o.context,e,r,s,a,i),!0}for(f=1,c=new Array(d-1);f<d;f++)c[f-1]=arguments[f];o.fn.apply(o.context,c)}else{var m=o.length,g;for(f=0;f<m;f++)switch(o[f].once&&this.removeListener(t,o[f].fn,void 0,!0),d){case 1:o[f].fn.call(o[f].context);break;case 2:o[f].fn.call(o[f].context,e);break;case 3:o[f].fn.call(o[f].context,e,r);break;case 4:o[f].fn.call(o[f].context,e,r,s);break;default:if(!c)for(g=1,c=new Array(d-1);g<d;g++)c[g-1]=arguments[g];o[f].fn.apply(o[f].context,c)}}return!0};fe.prototype.on=function(t,e,r){return Yi(this,t,e,r,!1)};fe.prototype.once=function(t,e,r){return Yi(this,t,e,r,!0)};fe.prototype.removeListener=function(t,e,r,s){var a=ge?ge+t:t;if(!this._events[a])return this;if(!e)return vn(this,a),this;var i=this._events[a];if(i.fn)i.fn===e&&(!s||i.once)&&(!r||i.context===r)&&vn(this,a);else{for(var l=0,o=[],d=i.length;l<d;l++)(i[l].fn!==e||s&&!i[l].once||r&&i[l].context!==r)&&o.push(i[l]);o.length?this._events[a]=o.length===1?o[0]:o:vn(this,a)}return this};fe.prototype.removeAllListeners=function(t){var e;return t?(e=ge?ge+t:t,this._events[e]&&vn(this,e)):(this._events=new jt,this._eventsCount=0),this};fe.prototype.off=fe.prototype.removeListener;fe.prototype.addListener=fe.prototype.on;fe.prefixed=ge;fe.EventEmitter=fe;typeof Or<"u"&&(Or.exports=fe)});var va=wn((r0,xa)=>{"use strict";function nf(n){var t=/(%?)(%([jds]))/g,e=Array.prototype.slice.call(arguments,1);return e.length&&(n=n.replace(t,function(r,s,a,i){var l=e.shift();switch(i){case"s":l=""+l;break;case"d":l=Number(l);break;case"j":l=JSON.stringify(l);break}return s?(e.unshift(l),r):l})),e.length&&(n+=" "+e.join(" ")),n=n.replace(/%{2,2}/g,"%"),""+n}xa.exports=nf});var Ce=lt(Hi(),1);var at=lt(qt(),1);var is=lt(Ki(),1);var Wt=class extends Error{constructor(t){super(t),this.name="TimeoutError"}},Dr=class extends Error{constructor(t){super(),this.name="AbortError",this.message=t}},Xi=n=>globalThis.DOMException===void 0?new Dr(n):new DOMException(n),$i=n=>{let t=n.reason===void 0?Xi("This operation was aborted."):n.reason;return t instanceof Error?t:Xi(t)};function Ir(n,t,e,r){let s,a=new Promise((i,l)=>{if(typeof t!="number"||Math.sign(t)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(t===Number.POSITIVE_INFINITY){i(n);return}if(r={customTimers:{setTimeout,clearTimeout},...r},r.signal){let{signal:o}=r;o.aborted&&l($i(o)),o.addEventListener("abort",()=>{l($i(o))})}s=r.customTimers.setTimeout.call(void 0,()=>{if(typeof e=="function"){try{i(e())}catch(c){l(c)}return}let o=typeof e=="string"?e:`Promise timed out after ${t} milliseconds`,d=e instanceof Error?e:new Wt(o);typeof n.cancel=="function"&&n.cancel(),l(d)},t),(async()=>{try{i(await n)}catch(o){l(o)}finally{r.customTimers.clearTimeout.call(void 0,s)}})()});return a.clear=()=>{clearTimeout(s),s=void 0},a}function Nr(n,t,e){let r=0,s=n.length;for(;s>0;){let a=Math.trunc(s/2),i=r+a;e(n[i],t)<=0?(r=++i,s-=a+1):s=a}return r}var ct=function(n,t,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!r:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(n):r?r.value:t.get(n)},Ze,Gt=class{constructor(){Ze.set(this,[])}enqueue(t,e){e={priority:0,...e};let r={priority:e.priority,run:t};if(this.size&&ct(this,Ze,"f")[this.size-1].priority>=e.priority){ct(this,Ze,"f").push(r);return}let s=Nr(ct(this,Ze,"f"),r,(a,i)=>i.priority-a.priority);ct(this,Ze,"f").splice(s,0,r)}dequeue(){let t=ct(this,Ze,"f").shift();return t?.run}filter(t){return ct(this,Ze,"f").filter(e=>e.priority===t.priority).map(e=>e.run)}get size(){return ct(this,Ze,"f").length}};Ze=new WeakMap;var Q=function(n,t,e,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(n,e):s?s.value=e:t.set(n,e),e},M=function(n,t,e,r){if(e==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!r:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?r:e==="a"?r.call(n):r?r.value:t.get(n)},te,zt,Vt,ze,An,Yt,bn,Oe,Ht,xe,yn,ve,Kt,He,En,Qi,Ji,ns,es,ts,Rn,Fr,Lr,Tn,rs,Sn,kn=class extends Error{},Xt=class extends is.default{constructor(t){var e,r,s,a;if(super(),te.add(this),zt.set(this,void 0),Vt.set(this,void 0),ze.set(this,0),An.set(this,void 0),Yt.set(this,void 0),bn.set(this,0),Oe.set(this,void 0),Ht.set(this,void 0),xe.set(this,void 0),yn.set(this,void 0),ve.set(this,0),Kt.set(this,void 0),He.set(this,void 0),En.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:Gt,...t},!(typeof t.intervalCap=="number"&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(r=(e=t.intervalCap)===null||e===void 0?void 0:e.toString())!==null&&r!==void 0?r:""}\` (${typeof t.intervalCap})`);if(t.interval===void 0||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(a=(s=t.interval)===null||s===void 0?void 0:s.toString())!==null&&a!==void 0?a:""}\` (${typeof t.interval})`);Q(this,zt,t.carryoverConcurrencyCount,"f"),Q(this,Vt,t.intervalCap===Number.POSITIVE_INFINITY||t.interval===0,"f"),Q(this,An,t.intervalCap,"f"),Q(this,Yt,t.interval,"f"),Q(this,xe,new t.queueClass,"f"),Q(this,yn,t.queueClass,"f"),this.concurrency=t.concurrency,this.timeout=t.timeout,Q(this,En,t.throwOnTimeout===!0,"f"),Q(this,He,t.autoStart===!1,"f")}get concurrency(){return M(this,Kt,"f")}set concurrency(t){if(!(typeof t=="number"&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);Q(this,Kt,t,"f"),M(this,te,"m",Tn).call(this)}async add(t,e={}){return e={timeout:this.timeout,throwOnTimeout:M(this,En,"f"),...e},new Promise((r,s)=>{M(this,xe,"f").enqueue(async()=>{var a,i,l;Q(this,ve,(i=M(this,ve,"f"),i++,i),"f"),Q(this,ze,(l=M(this,ze,"f"),l++,l),"f");try{if(!((a=e.signal)===null||a===void 0)&&a.aborted)throw new kn("The task was aborted.");let o=t({signal:e.signal});e.timeout&&(o=Ir(Promise.resolve(o),e.timeout)),e.signal&&(o=Promise.race([o,M(this,te,"m",rs).call(this,e.signal)]));let d=await o;r(d),this.emit("completed",d)}catch(o){if(o instanceof Wt&&!e.throwOnTimeout){r();return}s(o),this.emit("error",o)}finally{M(this,te,"m",ns).call(this)}},e),this.emit("add"),M(this,te,"m",Rn).call(this)})}async addAll(t,e){return Promise.all(t.map(async r=>this.add(r,e)))}start(){return M(this,He,"f")?(Q(this,He,!1,"f"),M(this,te,"m",Tn).call(this),this):this}pause(){Q(this,He,!0,"f")}clear(){Q(this,xe,new(M(this,yn,"f")),"f")}async onEmpty(){M(this,xe,"f").size!==0&&await M(this,te,"m",Sn).call(this,"empty")}async onSizeLessThan(t){M(this,xe,"f").size<t||await M(this,te,"m",Sn).call(this,"next",()=>M(this,xe,"f").size<t)}async onIdle(){M(this,ve,"f")===0&&M(this,xe,"f").size===0||await M(this,te,"m",Sn).call(this,"idle")}get size(){return M(this,xe,"f").size}sizeBy(t){return M(this,xe,"f").filter(t).length}get pending(){return M(this,ve,"f")}get isPaused(){return M(this,He,"f")}};zt=new WeakMap,Vt=new WeakMap,ze=new WeakMap,An=new WeakMap,Yt=new WeakMap,bn=new WeakMap,Oe=new WeakMap,Ht=new WeakMap,xe=new WeakMap,yn=new WeakMap,ve=new WeakMap,Kt=new WeakMap,He=new WeakMap,En=new WeakMap,te=new WeakSet,Qi=function(){return M(this,Vt,"f")||M(this,ze,"f")<M(this,An,"f")},Ji=function(){return M(this,ve,"f")<M(this,Kt,"f")},ns=function(){var t;Q(this,ve,(t=M(this,ve,"f"),t--,t),"f"),M(this,te,"m",Rn).call(this),this.emit("next")},es=function(){M(this,te,"m",Lr).call(this),M(this,te,"m",Fr).call(this),Q(this,Ht,void 0,"f")},ts=function(){let t=Date.now();if(M(this,Oe,"f")===void 0){let e=M(this,bn,"f")-t;if(e<0)Q(this,ze,M(this,zt,"f")?M(this,ve,"f"):0,"f");else return M(this,Ht,"f")===void 0&&Q(this,Ht,setTimeout(()=>{M(this,te,"m",es).call(this)},e),"f"),!0}return!1},Rn=function(){if(M(this,xe,"f").size===0)return M(this,Oe,"f")&&clearInterval(M(this,Oe,"f")),Q(this,Oe,void 0,"f"),this.emit("empty"),M(this,ve,"f")===0&&this.emit("idle"),!1;if(!M(this,He,"f")){let t=!M(this,te,"a",ts);if(M(this,te,"a",Qi)&&M(this,te,"a",Ji)){let e=M(this,xe,"f").dequeue();return e?(this.emit("active"),e(),t&&M(this,te,"m",Fr).call(this),!0):!1}}return!1},Fr=function(){M(this,Vt,"f")||M(this,Oe,"f")!==void 0||(Q(this,Oe,setInterval(()=>{M(this,te,"m",Lr).call(this)},M(this,Yt,"f")),"f"),Q(this,bn,Date.now()+M(this,Yt,"f"),"f"))},Lr=function(){M(this,ze,"f")===0&&M(this,ve,"f")===0&&M(this,Oe,"f")&&(clearInterval(M(this,Oe,"f")),Q(this,Oe,void 0,"f")),Q(this,ze,M(this,zt,"f")?M(this,ve,"f"):0,"f"),M(this,te,"m",Tn).call(this)},Tn=function(){for(;M(this,te,"m",Rn).call(this););},rs=async function(t){return new Promise((e,r)=>{t.addEventListener("abort",()=>{r(new kn("The task was aborted."))},{once:!0})})},Sn=async function(t,e){return new Promise(r=>{let s=()=>{e&&!e()||(this.off(t,s),r())};this.on(t,s)})};var wa=lt(qt(),1);import{basicSetup as zc}from"codemirror";import{EditorView as Vc,keymap as Yc}from"@codemirror/view";import{Compartment as Pt,EditorState as Kc}from"@codemirror/state";import{indentWithTab as Xc}from"@codemirror/commands";import{indentUnit as $c}from"@codemirror/language";import{lintGutter as Qc,setDiagnostics as Jc}from"@codemirror/lint";import{EditorView as ys}from"@codemirror/view";import{HighlightStyle as Es,syntaxHighlighting as Rs}from"@codemirror/language";import"@codemirror/state";var za=Object.create,ds=Object.defineProperty,Va=Object.getOwnPropertyDescriptor,us=Object.getOwnPropertyNames,Ya=Object.getPrototypeOf,Ka=Object.prototype.hasOwnProperty,$e=(n,t)=>function(){return t||(0,n[us(n)[0]])((t={exports:{}}).exports,t),t.exports},Xa=(n,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of us(t))!Ka.call(n,s)&&s!==e&&ds(n,s,{get:()=>t[s],enumerable:!(r=Va(t,s))||r.enumerable});return n},$a=(n,t,e)=>(e=n!=null?za(Ya(n)):{},Xa(t||!n||!n.__esModule?ds(e,"default",{value:n,enumerable:!0}):e,n)),hs=$e({"../../node_modules/.pnpm/color-name@1.1.4/node_modules/color-name/index.js"(n,t){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}}),Qa=$e({"../../node_modules/.pnpm/is-arrayish@0.3.2/node_modules/is-arrayish/index.js"(n,t){"use strict";t.exports=function(r){return!r||typeof r=="string"?!1:r instanceof Array||Array.isArray(r)||r.length>=0&&(r.splice instanceof Function||Object.getOwnPropertyDescriptor(r,r.length-1)&&r.constructor.name!=="String")}}}),Ja=$e({"../../node_modules/.pnpm/simple-swizzle@0.2.2/node_modules/simple-swizzle/index.js"(n,t){"use strict";var e=Qa(),r=Array.prototype.concat,s=Array.prototype.slice,a=t.exports=function(l){for(var o=[],d=0,c=l.length;d<c;d++){var f=l[d];e(f)?o=r.call(o,s.call(f)):o.push(f)}return o};a.wrap=function(i){return function(){return i(a(arguments))}}}}),el=$e({"../../node_modules/.pnpm/color-string@1.9.1/node_modules/color-string/index.js"(n,t){"use strict";var e=hs(),r=Ja(),s=Object.hasOwnProperty,a=Object.create(null);for(i in e)s.call(e,i)&&(a[e[i]]=i);var i,l=t.exports={to:{},get:{}};l.get=function(c){var f=c.substring(0,3).toLowerCase(),m,g;switch(f){case"hsl":m=l.get.hsl(c),g="hsl";break;case"hwb":m=l.get.hwb(c),g="hwb";break;default:m=l.get.rgb(c),g="rgb";break}return m?{model:g,value:m}:null},l.get.rgb=function(c){if(!c)return null;var f=/^#([a-f0-9]{3,4})$/i,m=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,g=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,p=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,u=/^(\w+)$/,h=[0,0,0,1],_,w,b;if(_=c.match(m)){for(b=_[2],_=_[1],w=0;w<3;w++){var E=w*2;h[w]=parseInt(_.slice(E,E+2),16)}b&&(h[3]=parseInt(b,16)/255)}else if(_=c.match(f)){for(_=_[1],b=_[3],w=0;w<3;w++)h[w]=parseInt(_[w]+_[w],16);b&&(h[3]=parseInt(b+b,16)/255)}else if(_=c.match(g)){for(w=0;w<3;w++)h[w]=parseInt(_[w+1],0);_[4]&&(_[5]?h[3]=parseFloat(_[4])*.01:h[3]=parseFloat(_[4]))}else if(_=c.match(p)){for(w=0;w<3;w++)h[w]=Math.round(parseFloat(_[w+1])*2.55);_[4]&&(_[5]?h[3]=parseFloat(_[4])*.01:h[3]=parseFloat(_[4]))}else return(_=c.match(u))?_[1]==="transparent"?[0,0,0,0]:s.call(e,_[1])?(h=e[_[1]],h[3]=1,h):null:null;for(w=0;w<3;w++)h[w]=o(h[w],0,255);return h[3]=o(h[3],0,1),h},l.get.hsl=function(c){if(!c)return null;var f=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,m=c.match(f);if(m){var g=parseFloat(m[4]),p=(parseFloat(m[1])%360+360)%360,u=o(parseFloat(m[2]),0,100),h=o(parseFloat(m[3]),0,100),_=o(isNaN(g)?1:g,0,1);return[p,u,h,_]}return null},l.get.hwb=function(c){if(!c)return null;var f=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,m=c.match(f);if(m){var g=parseFloat(m[4]),p=(parseFloat(m[1])%360+360)%360,u=o(parseFloat(m[2]),0,100),h=o(parseFloat(m[3]),0,100),_=o(isNaN(g)?1:g,0,1);return[p,u,h,_]}return null},l.to.hex=function(){var c=r(arguments);return"#"+d(c[0])+d(c[1])+d(c[2])+(c[3]<1?d(Math.round(c[3]*255)):"")},l.to.rgb=function(){var c=r(arguments);return c.length<4||c[3]===1?"rgb("+Math.round(c[0])+", "+Math.round(c[1])+", "+Math.round(c[2])+")":"rgba("+Math.round(c[0])+", "+Math.round(c[1])+", "+Math.round(c[2])+", "+c[3]+")"},l.to.rgb.percent=function(){var c=r(arguments),f=Math.round(c[0]/255*100),m=Math.round(c[1]/255*100),g=Math.round(c[2]/255*100);return c.length<4||c[3]===1?"rgb("+f+"%, "+m+"%, "+g+"%)":"rgba("+f+"%, "+m+"%, "+g+"%, "+c[3]+")"},l.to.hsl=function(){var c=r(arguments);return c.length<4||c[3]===1?"hsl("+c[0]+", "+c[1]+"%, "+c[2]+"%)":"hsla("+c[0]+", "+c[1]+"%, "+c[2]+"%, "+c[3]+")"},l.to.hwb=function(){var c=r(arguments),f="";return c.length>=4&&c[3]!==1&&(f=", "+c[3]),"hwb("+c[0]+", "+c[1]+"%, "+c[2]+"%"+f+")"},l.to.keyword=function(c){return a[c.slice(0,3)]};function o(c,f,m){return Math.min(Math.max(f,c),m)}function d(c){var f=Math.round(c).toString(16).toUpperCase();return f.length<2?"0"+f:f}}}),ps=$e({"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/conversions.js"(n,t){"use strict";var e=hs(),r={};for(let i of Object.keys(e))r[e[i]]=i;var s={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};t.exports=s;for(let i of Object.keys(s)){if(!("channels"in s[i]))throw new Error("missing channels property: "+i);if(!("labels"in s[i]))throw new Error("missing channel labels property: "+i);if(s[i].labels.length!==s[i].channels)throw new Error("channel and label counts mismatch: "+i);let{channels:l,labels:o}=s[i];delete s[i].channels,delete s[i].labels,Object.defineProperty(s[i],"channels",{value:l}),Object.defineProperty(s[i],"labels",{value:o})}s.rgb.hsl=function(i){let l=i[0]/255,o=i[1]/255,d=i[2]/255,c=Math.min(l,o,d),f=Math.max(l,o,d),m=f-c,g,p;f===c?g=0:l===f?g=(o-d)/m:o===f?g=2+(d-l)/m:d===f&&(g=4+(l-o)/m),g=Math.min(g*60,360),g<0&&(g+=360);let u=(c+f)/2;return f===c?p=0:u<=.5?p=m/(f+c):p=m/(2-f-c),[g,p*100,u*100]},s.rgb.hsv=function(i){let l,o,d,c,f,m=i[0]/255,g=i[1]/255,p=i[2]/255,u=Math.max(m,g,p),h=u-Math.min(m,g,p),_=function(w){return(u-w)/6/h+1/2};return h===0?(c=0,f=0):(f=h/u,l=_(m),o=_(g),d=_(p),m===u?c=d-o:g===u?c=1/3+l-d:p===u&&(c=2/3+o-l),c<0?c+=1:c>1&&(c-=1)),[c*360,f*100,u*100]},s.rgb.hwb=function(i){let l=i[0],o=i[1],d=i[2],c=s.rgb.hsl(i)[0],f=1/255*Math.min(l,Math.min(o,d));return d=1-1/255*Math.max(l,Math.max(o,d)),[c,f*100,d*100]},s.rgb.cmyk=function(i){let l=i[0]/255,o=i[1]/255,d=i[2]/255,c=Math.min(1-l,1-o,1-d),f=(1-l-c)/(1-c)||0,m=(1-o-c)/(1-c)||0,g=(1-d-c)/(1-c)||0;return[f*100,m*100,g*100,c*100]};function a(i,l){return(i[0]-l[0])**2+(i[1]-l[1])**2+(i[2]-l[2])**2}s.rgb.keyword=function(i){let l=r[i];if(l)return l;let o=1/0,d;for(let c of Object.keys(e)){let f=e[c],m=a(i,f);m<o&&(o=m,d=c)}return d},s.keyword.rgb=function(i){return e[i]},s.rgb.xyz=function(i){let l=i[0]/255,o=i[1]/255,d=i[2]/255;l=l>.04045?((l+.055)/1.055)**2.4:l/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,d=d>.04045?((d+.055)/1.055)**2.4:d/12.92;let c=l*.4124+o*.3576+d*.1805,f=l*.2126+o*.7152+d*.0722,m=l*.0193+o*.1192+d*.9505;return[c*100,f*100,m*100]},s.rgb.lab=function(i){let l=s.rgb.xyz(i),o=l[0],d=l[1],c=l[2];o/=95.047,d/=100,c/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,d=d>.008856?d**(1/3):7.787*d+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;let f=116*d-16,m=500*(o-d),g=200*(d-c);return[f,m,g]},s.hsl.rgb=function(i){let l=i[0]/360,o=i[1]/100,d=i[2]/100,c,f,m;if(o===0)return m=d*255,[m,m,m];d<.5?c=d*(1+o):c=d+o-d*o;let g=2*d-c,p=[0,0,0];for(let u=0;u<3;u++)f=l+1/3*-(u-1),f<0&&f++,f>1&&f--,6*f<1?m=g+(c-g)*6*f:2*f<1?m=c:3*f<2?m=g+(c-g)*(2/3-f)*6:m=g,p[u]=m*255;return p},s.hsl.hsv=function(i){let l=i[0],o=i[1]/100,d=i[2]/100,c=o,f=Math.max(d,.01);d*=2,o*=d<=1?d:2-d,c*=f<=1?f:2-f;let m=(d+o)/2,g=d===0?2*c/(f+c):2*o/(d+o);return[l,g*100,m*100]},s.hsv.rgb=function(i){let l=i[0]/60,o=i[1]/100,d=i[2]/100,c=Math.floor(l)%6,f=l-Math.floor(l),m=255*d*(1-o),g=255*d*(1-o*f),p=255*d*(1-o*(1-f));switch(d*=255,c){case 0:return[d,p,m];case 1:return[g,d,m];case 2:return[m,d,p];case 3:return[m,g,d];case 4:return[p,m,d];case 5:return[d,m,g]}},s.hsv.hsl=function(i){let l=i[0],o=i[1]/100,d=i[2]/100,c=Math.max(d,.01),f,m;m=(2-o)*d;let g=(2-o)*c;return f=o*c,f/=g<=1?g:2-g,f=f||0,m/=2,[l,f*100,m*100]},s.hwb.rgb=function(i){let l=i[0]/360,o=i[1]/100,d=i[2]/100,c=o+d,f;c>1&&(o/=c,d/=c);let m=Math.floor(6*l),g=1-d;f=6*l-m,m&1&&(f=1-f);let p=o+f*(g-o),u,h,_;switch(m){default:case 6:case 0:u=g,h=p,_=o;break;case 1:u=p,h=g,_=o;break;case 2:u=o,h=g,_=p;break;case 3:u=o,h=p,_=g;break;case 4:u=p,h=o,_=g;break;case 5:u=g,h=o,_=p;break}return[u*255,h*255,_*255]},s.cmyk.rgb=function(i){let l=i[0]/100,o=i[1]/100,d=i[2]/100,c=i[3]/100,f=1-Math.min(1,l*(1-c)+c),m=1-Math.min(1,o*(1-c)+c),g=1-Math.min(1,d*(1-c)+c);return[f*255,m*255,g*255]},s.xyz.rgb=function(i){let l=i[0]/100,o=i[1]/100,d=i[2]/100,c,f,m;return c=l*3.2406+o*-1.5372+d*-.4986,f=l*-.9689+o*1.8758+d*.0415,m=l*.0557+o*-.204+d*1.057,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,f=f>.0031308?1.055*f**(1/2.4)-.055:f*12.92,m=m>.0031308?1.055*m**(1/2.4)-.055:m*12.92,c=Math.min(Math.max(0,c),1),f=Math.min(Math.max(0,f),1),m=Math.min(Math.max(0,m),1),[c*255,f*255,m*255]},s.xyz.lab=function(i){let l=i[0],o=i[1],d=i[2];l/=95.047,o/=100,d/=108.883,l=l>.008856?l**(1/3):7.787*l+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,d=d>.008856?d**(1/3):7.787*d+16/116;let c=116*o-16,f=500*(l-o),m=200*(o-d);return[c,f,m]},s.lab.xyz=function(i){let l=i[0],o=i[1],d=i[2],c,f,m;f=(l+16)/116,c=o/500+f,m=f-d/200;let g=f**3,p=c**3,u=m**3;return f=g>.008856?g:(f-16/116)/7.787,c=p>.008856?p:(c-16/116)/7.787,m=u>.008856?u:(m-16/116)/7.787,c*=95.047,f*=100,m*=108.883,[c,f,m]},s.lab.lch=function(i){let l=i[0],o=i[1],d=i[2],c;c=Math.atan2(d,o)*360/2/Math.PI,c<0&&(c+=360);let m=Math.sqrt(o*o+d*d);return[l,m,c]},s.lch.lab=function(i){let l=i[0],o=i[1],c=i[2]/360*2*Math.PI,f=o*Math.cos(c),m=o*Math.sin(c);return[l,f,m]},s.rgb.ansi16=function(i,l=null){let[o,d,c]=i,f=l===null?s.rgb.hsv(i)[2]:l;if(f=Math.round(f/50),f===0)return 30;let m=30+(Math.round(c/255)<<2|Math.round(d/255)<<1|Math.round(o/255));return f===2&&(m+=60),m},s.hsv.ansi16=function(i){return s.rgb.ansi16(s.hsv.rgb(i),i[2])},s.rgb.ansi256=function(i){let l=i[0],o=i[1],d=i[2];return l===o&&o===d?l<8?16:l>248?231:Math.round((l-8)/247*24)+232:16+36*Math.round(l/255*5)+6*Math.round(o/255*5)+Math.round(d/255*5)},s.ansi16.rgb=function(i){let l=i%10;if(l===0||l===7)return i>50&&(l+=3.5),l=l/10.5*255,[l,l,l];let o=(~~(i>50)+1)*.5,d=(l&1)*o*255,c=(l>>1&1)*o*255,f=(l>>2&1)*o*255;return[d,c,f]},s.ansi256.rgb=function(i){if(i>=232){let f=(i-232)*10+8;return[f,f,f]}i-=16;let l,o=Math.floor(i/36)/5*255,d=Math.floor((l=i%36)/6)/5*255,c=l%6/5*255;return[o,d,c]},s.rgb.hex=function(i){let o=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".substring(o.length)+o},s.hex.rgb=function(i){let l=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!l)return[0,0,0];let o=l[0];l[0].length===3&&(o=o.split("").map(g=>g+g).join(""));let d=parseInt(o,16),c=d>>16&255,f=d>>8&255,m=d&255;return[c,f,m]},s.rgb.hcg=function(i){let l=i[0]/255,o=i[1]/255,d=i[2]/255,c=Math.max(Math.max(l,o),d),f=Math.min(Math.min(l,o),d),m=c-f,g,p;return m<1?g=f/(1-m):g=0,m<=0?p=0:c===l?p=(o-d)/m%6:c===o?p=2+(d-l)/m:p=4+(l-o)/m,p/=6,p%=1,[p*360,m*100,g*100]},s.hsl.hcg=function(i){let l=i[1]/100,o=i[2]/100,d=o<.5?2*l*o:2*l*(1-o),c=0;return d<1&&(c=(o-.5*d)/(1-d)),[i[0],d*100,c*100]},s.hsv.hcg=function(i){let l=i[1]/100,o=i[2]/100,d=l*o,c=0;return d<1&&(c=(o-d)/(1-d)),[i[0],d*100,c*100]},s.hcg.rgb=function(i){let l=i[0]/360,o=i[1]/100,d=i[2]/100;if(o===0)return[d*255,d*255,d*255];let c=[0,0,0],f=l%1*6,m=f%1,g=1-m,p=0;switch(Math.floor(f)){case 0:c[0]=1,c[1]=m,c[2]=0;break;case 1:c[0]=g,c[1]=1,c[2]=0;break;case 2:c[0]=0,c[1]=1,c[2]=m;break;case 3:c[0]=0,c[1]=g,c[2]=1;break;case 4:c[0]=m,c[1]=0,c[2]=1;break;default:c[0]=1,c[1]=0,c[2]=g}return p=(1-o)*d,[(o*c[0]+p)*255,(o*c[1]+p)*255,(o*c[2]+p)*255]},s.hcg.hsv=function(i){let l=i[1]/100,o=i[2]/100,d=l+o*(1-l),c=0;return d>0&&(c=l/d),[i[0],c*100,d*100]},s.hcg.hsl=function(i){let l=i[1]/100,d=i[2]/100*(1-l)+.5*l,c=0;return d>0&&d<.5?c=l/(2*d):d>=.5&&d<1&&(c=l/(2*(1-d))),[i[0],c*100,d*100]},s.hcg.hwb=function(i){let l=i[1]/100,o=i[2]/100,d=l+o*(1-l);return[i[0],(d-l)*100,(1-d)*100]},s.hwb.hcg=function(i){let l=i[1]/100,d=1-i[2]/100,c=d-l,f=0;return c<1&&(f=(d-c)/(1-c)),[i[0],c*100,f*100]},s.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]},s.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]},s.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]},s.gray.hsl=function(i){return[0,0,i[0]]},s.gray.hsv=s.gray.hsl,s.gray.hwb=function(i){return[0,100,i[0]]},s.gray.cmyk=function(i){return[0,0,0,i[0]]},s.gray.lab=function(i){return[i[0],0,0]},s.gray.hex=function(i){let l=Math.round(i[0]/100*255)&255,d=((l<<16)+(l<<8)+l).toString(16).toUpperCase();return"000000".substring(d.length)+d},s.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]}}}),tl=$e({"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/route.js"(n,t){"use strict";var e=ps();function r(){let l={},o=Object.keys(e);for(let d=o.length,c=0;c<d;c++)l[o[c]]={distance:-1,parent:null};return l}function s(l){let o=r(),d=[l];for(o[l].distance=0;d.length;){let c=d.pop(),f=Object.keys(e[c]);for(let m=f.length,g=0;g<m;g++){let p=f[g],u=o[p];u.distance===-1&&(u.distance=o[c].distance+1,u.parent=c,d.unshift(p))}}return o}function a(l,o){return function(d){return o(l(d))}}function i(l,o){let d=[o[l].parent,l],c=e[o[l].parent][l],f=o[l].parent;for(;o[f].parent;)d.unshift(o[f].parent),c=a(e[o[f].parent][f],c),f=o[f].parent;return c.conversion=d,c}t.exports=function(l){let o=s(l),d={},c=Object.keys(o);for(let f=c.length,m=0;m<f;m++){let g=c[m];o[g].parent!==null&&(d[g]=i(g,o))}return d}}}),nl=$e({"../../node_modules/.pnpm/color-convert@2.0.1/node_modules/color-convert/index.js"(n,t){"use strict";var e=ps(),r=tl(),s={},a=Object.keys(e);function i(o){let d=function(...c){let f=c[0];return f==null?f:(f.length>1&&(c=f),o(c))};return"conversion"in o&&(d.conversion=o.conversion),d}function l(o){let d=function(...c){let f=c[0];if(f==null)return f;f.length>1&&(c=f);let m=o(c);if(typeof m=="object")for(let g=m.length,p=0;p<g;p++)m[p]=Math.round(m[p]);return m};return"conversion"in o&&(d.conversion=o.conversion),d}a.forEach(o=>{s[o]={},Object.defineProperty(s[o],"channels",{value:e[o].channels}),Object.defineProperty(s[o],"labels",{value:e[o].labels});let d=r(o);Object.keys(d).forEach(f=>{let m=d[f];s[o][f]=l(m),s[o][f].raw=i(m)})}),t.exports=s}}),rl=$e({"../../node_modules/.pnpm/color@4.2.3/node_modules/color/index.js"(n,t){"use strict";var e=el(),r=nl(),s=["keyword","gray","hex"],a={};for(let p of Object.keys(r))a[[...r[p].labels].sort().join("")]=p;var i={};function l(p,u){if(!(this instanceof l))return new l(p,u);if(u&&u in s&&(u=null),u&&!(u in r))throw new Error("Unknown model: "+u);let h,_;if(p==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(p instanceof l)this.model=p.model,this.color=[...p.color],this.valpha=p.valpha;else if(typeof p=="string"){let w=e.get(p);if(w===null)throw new Error("Unable to parse color from string: "+p);this.model=w.model,_=r[this.model].channels,this.color=w.value.slice(0,_),this.valpha=typeof w.value[_]=="number"?w.value[_]:1}else if(p.length>0){this.model=u||"rgb",_=r[this.model].channels;let w=Array.prototype.slice.call(p,0,_);this.color=g(w,_),this.valpha=typeof p[_]=="number"?p[_]:1}else if(typeof p=="number")this.model="rgb",this.color=[p>>16&255,p>>8&255,p&255],this.valpha=1;else{this.valpha=1;let w=Object.keys(p);"alpha"in p&&(w.splice(w.indexOf("alpha"),1),this.valpha=typeof p.alpha=="number"?p.alpha:0);let b=w.sort().join("");if(!(b in a))throw new Error("Unable to parse color from object: "+JSON.stringify(p));this.model=a[b];let{labels:E}=r[this.model],v=[];for(h=0;h<E.length;h++)v.push(p[E[h]]);this.color=g(v)}if(i[this.model])for(_=r[this.model].channels,h=0;h<_;h++){let w=i[this.model][h];w&&(this.color[h]=w(this.color[h]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}l.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(p){let u=this.model in e.to?this:this.rgb();u=u.round(typeof p=="number"?p:1);let h=u.valpha===1?u.color:[...u.color,this.valpha];return e.to[u.model](h)},percentString(p){let u=this.rgb().round(typeof p=="number"?p:1),h=u.valpha===1?u.color:[...u.color,this.valpha];return e.to.rgb.percent(h)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let p={},{channels:u}=r[this.model],{labels:h}=r[this.model];for(let _=0;_<u;_++)p[h[_]]=this.color[_];return this.valpha!==1&&(p.alpha=this.valpha),p},unitArray(){let p=this.rgb().color;return p[0]/=255,p[1]/=255,p[2]/=255,this.valpha!==1&&p.push(this.valpha),p},unitObject(){let p=this.rgb().object();return p.r/=255,p.g/=255,p.b/=255,this.valpha!==1&&(p.alpha=this.valpha),p},round(p){return p=Math.max(p||0,0),new l([...this.color.map(d(p)),this.valpha],this.model)},alpha(p){return p!==void 0?new l([...this.color,Math.max(0,Math.min(1,p))],this.model):this.valpha},red:c("rgb",0,f(255)),green:c("rgb",1,f(255)),blue:c("rgb",2,f(255)),hue:c(["hsl","hsv","hsl","hwb","hcg"],0,p=>(p%360+360)%360),saturationl:c("hsl",1,f(100)),lightness:c("hsl",2,f(100)),saturationv:c("hsv",1,f(100)),value:c("hsv",2,f(100)),chroma:c("hcg",1,f(100)),gray:c("hcg",2,f(100)),white:c("hwb",1,f(100)),wblack:c("hwb",2,f(100)),cyan:c("cmyk",0,f(100)),magenta:c("cmyk",1,f(100)),yellow:c("cmyk",2,f(100)),black:c("cmyk",3,f(100)),x:c("xyz",0,f(95.047)),y:c("xyz",1,f(100)),z:c("xyz",2,f(108.833)),l:c("lab",0,f(100)),a:c("lab",1),b:c("lab",2),keyword(p){return p!==void 0?new l(p):r[this.model].keyword(this.color)},hex(p){return p!==void 0?new l(p):e.to.hex(this.rgb().round().color)},hexa(p){if(p!==void 0)return new l(p);let u=this.rgb().round().color,h=Math.round(this.valpha*255).toString(16).toUpperCase();return h.length===1&&(h="0"+h),e.to.hex(u)+h},rgbNumber(){let p=this.rgb().color;return(p[0]&255)<<16|(p[1]&255)<<8|p[2]&255},luminosity(){let p=this.rgb().color,u=[];for(let[h,_]of p.entries()){let w=_/255;u[h]=w<=.04045?w/12.92:((w+.055)/1.055)**2.4}return .2126*u[0]+.7152*u[1]+.0722*u[2]},contrast(p){let u=this.luminosity(),h=p.luminosity();return u>h?(u+.05)/(h+.05):(h+.05)/(u+.05)},level(p){let u=this.contrast(p);return u>=7?"AAA":u>=4.5?"AA":""},isDark(){let p=this.rgb().color;return(p[0]*2126+p[1]*7152+p[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let p=this.rgb();for(let u=0;u<3;u++)p.color[u]=255-p.color[u];return p},lighten(p){let u=this.hsl();return u.color[2]+=u.color[2]*p,u},darken(p){let u=this.hsl();return u.color[2]-=u.color[2]*p,u},saturate(p){let u=this.hsl();return u.color[1]+=u.color[1]*p,u},desaturate(p){let u=this.hsl();return u.color[1]-=u.color[1]*p,u},whiten(p){let u=this.hwb();return u.color[1]+=u.color[1]*p,u},blacken(p){let u=this.hwb();return u.color[2]+=u.color[2]*p,u},grayscale(){let p=this.rgb().color,u=p[0]*.3+p[1]*.59+p[2]*.11;return l.rgb(u,u,u)},fade(p){return this.alpha(this.valpha-this.valpha*p)},opaquer(p){return this.alpha(this.valpha+this.valpha*p)},rotate(p){let u=this.hsl(),h=u.color[0];return h=(h+p)%360,h=h<0?360+h:h,u.color[0]=h,u},mix(p,u){if(!p||!p.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof p);let h=p.rgb(),_=this.rgb(),w=u===void 0?.5:u,b=2*w-1,E=h.alpha()-_.alpha(),v=((b*E===-1?b:(b+E)/(1+b*E))+1)/2,x=1-v;return l.rgb(v*h.red()+x*_.red(),v*h.green()+x*_.green(),v*h.blue()+x*_.blue(),h.alpha()*w+_.alpha()*(1-w))}};for(let p of Object.keys(r)){if(s.includes(p))continue;let{channels:u}=r[p];l.prototype[p]=function(...h){return this.model===p?new l(this):h.length>0?new l(h,p):new l([...m(r[this.model][p].raw(this.color)),this.valpha],p)},l[p]=function(...h){let _=h[0];return typeof _=="number"&&(_=g(h,u)),new l(_,p)}}function o(p,u){return Number(p.toFixed(u))}function d(p){return function(u){return o(u,p)}}function c(p,u,h){p=Array.isArray(p)?p:[p];for(let _ of p)(i[_]||(i[_]=[]))[u]=h;return p=p[0],function(_){let w;return _!==void 0?(h&&(_=h(_)),w=this[p](),w.color[u]=_,w):(w=this[p]().color[u],h&&(w=h(w)),w)}}function f(p){return function(u){return Math.max(0,Math.min(p,u))}}function m(p){return Array.isArray(p)?p:[p]}function g(p,u){for(let h=0;h<u;h++)typeof p[h]!="number"&&(p[h]=0);return p}t.exports=l}}),il=1024,sl=0,ee=class{constructor(n={}){this.id=sl++,this.perNode=!!n.perNode,this.deserialize=n.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(n){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof n!="function"&&(n=ht.match(n)),t=>{let e=n(t);return e===void 0?null:[this,e]}}};ee.closedBy=new ee({deserialize:n=>n.split(" ")});ee.openedBy=new ee({deserialize:n=>n.split(" ")});ee.group=new ee({deserialize:n=>n.split(" ")});ee.contextHash=new ee({perNode:!0});ee.lookAhead=new ee({perNode:!0});ee.mounted=new ee({perNode:!0});var ol=Object.create(null),ht=class ms{constructor(t,e,r,s=0){this.name=t,this.props=e,this.id=r,this.flags=s}static define(t){let e=t.props&&t.props.length?Object.create(null):ol,r=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),s=new ms(t.name||"",e,t.id,r);if(t.props){for(let a of t.props)if(Array.isArray(a)||(a=a(s)),a){if(a[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[a[0].id]=a[1]}}return s}prop(t){return this.props[t.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(t){if(typeof t=="string"){if(this.name==t)return!0;let e=this.prop(ee.group);return e?e.indexOf(t)>-1:!1}return this.id==t}static match(t){let e=Object.create(null);for(let r in t)for(let s of r.split(" "))e[s]=t[r];return r=>{for(let s=r.prop(ee.group),a=-1;a<(s?s.length:0);a++){let i=e[a<0?r.name:s[a]];if(i)return i}}}};ht.none=new ht("",Object.create(null),0,8);var Cn=new WeakMap,ss=new WeakMap,de;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(de||(de={}));var ut=class Mr{constructor(t,e,r,s,a){if(this.type=t,this.children=e,this.positions=r,this.length=s,this.props=null,a&&a.length){this.props=Object.create(null);for(let[i,l]of a)this.props[typeof i=="number"?i:i.id]=l}}toString(){let t=this.prop(ee.mounted);if(t&&!t.overlay)return t.tree.toString();let e="";for(let r of this.children){let s=r.toString();s&&(e&&(e+=","),e+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new Mn(this.topNode,t)}cursorAt(t,e=0,r=0){let s=Cn.get(this)||this.topNode,a=new Mn(s);return a.moveTo(t,e),Cn.set(this,a._tree),a}get topNode(){return new en(this,0,0,null)}resolve(t,e=0){let r=Et(Cn.get(this)||this.topNode,t,e,!1);return Cn.set(this,r),r}resolveInner(t,e=0){let r=Et(ss.get(this)||this.topNode,t,e,!0);return ss.set(this,r),r}iterate(t){let{enter:e,leave:r,from:s=0,to:a=this.length}=t,i=t.mode||0,l=(i&de.IncludeAnonymous)>0;for(let o=this.cursor(i|de.IncludeAnonymous);;){let d=!1;if(o.from<=a&&o.to>=s&&(!l&&o.type.isAnonymous||e(o)!==!1)){if(o.firstChild())continue;d=!0}for(;d&&r&&(l||!o.type.isAnonymous)&&r(o),!o.nextSibling();){if(!o.parent())return;d=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:qr(ht.none,this.children,this.positions,0,this.children.length,0,this.length,(e,r,s)=>new Mr(this.type,e,r,s,this.propValues),t.makeTree||((e,r,s)=>new Mr(ht.none,e,r,s)))}static build(t){return cl(t)}};ut.empty=new ut(ht.none,[],[],0);var al=class _s{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new _s(this.buffer,this.index)}},tn=class gs{constructor(t,e,r){this.buffer=t,this.length=e,this.set=r}get type(){return ht.none}toString(){let t=[];for(let e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}childString(t){let e=this.buffer[t],r=this.buffer[t+3],s=this.set.types[e],a=s.name;if(/\W/.test(a)&&!s.isError&&(a=JSON.stringify(a)),t+=4,r==t)return a;let i=[];for(;t<r;)i.push(this.childString(t)),t=this.buffer[t+3];return a+"("+i.join(",")+")"}findChild(t,e,r,s,a){let{buffer:i}=this,l=-1;for(let o=t;o!=e&&!(ws(a,s,i[o+1],i[o+2])&&(l=o,r>0));o=i[o+3]);return l}slice(t,e,r){let s=this.buffer,a=new Uint16Array(e-t),i=0;for(let l=t,o=0;l<e;){a[o++]=s[l++],a[o++]=s[l++]-r;let d=a[o++]=s[l++]-r;a[o++]=s[l++]-t,i=Math.max(i,d)}return new gs(a,i,this.set)}};function ws(n,t,e,r){switch(n){case-2:return e<t;case-1:return r>=t&&e<t;case 0:return e<t&&r>t;case 1:return e<=t&&r>t;case 2:return r>t;case 4:return!0}}function xs(n,t){let e=n.childBefore(t);for(;e;){let r=e.lastChild;if(!r||r.to!=e.to)break;r.type.isError&&r.from==r.to?(n=e,e=r.prevSibling):e=r}return n}function Et(n,t,e,r){for(var s;n.from==n.to||(e<1?n.from>=t:n.from>t)||(e>-1?n.to<=t:n.to<t);){let i=!r&&n instanceof en&&n.index<0?null:n.parent;if(!i)return n;n=i}let a=r?0:de.IgnoreOverlays;if(r)for(let i=n,l=i.parent;l;i=l,l=i.parent)i instanceof en&&i.index<0&&((s=l.enter(t,e,a))===null||s===void 0?void 0:s.from)!=i.from&&(n=l);for(;;){let i=n.enter(t,e,a);if(!i)return n;n=i}}var en=class Nn{constructor(t,e,r,s){this._tree=t,this.from=e,this.index=r,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,e,r,s,a=0){for(let i=this;;){for(let{children:l,positions:o}=i._tree,d=e>0?l.length:-1;t!=d;t+=e){let c=l[t],f=o[t]+i.from;if(ws(s,r,f,f+c.length)){if(c instanceof tn){if(a&de.ExcludeBuffers)continue;let m=c.findChild(0,c.buffer.length,e,r-f,s);if(m>-1)return new Ur(new ll(i,c,t,f),null,m)}else if(a&de.IncludeAnonymous||!c.type.isAnonymous||Zr(c)){let m;if(!(a&de.IgnoreMounts)&&c.props&&(m=c.prop(ee.mounted))&&!m.overlay)return new Nn(m.tree,f,t,i);let g=new Nn(c,f,t,i);return a&de.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(e<0?c.children.length-1:0,e,r,s)}}}if(a&de.IncludeAnonymous||!i.type.isAnonymous||(i.index>=0?t=i.index+e:t=e<0?-1:i._parent._tree.children.length,i=i._parent,!i))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,r=0){let s;if(!(r&de.IgnoreOverlays)&&(s=this._tree.prop(ee.mounted))&&s.overlay){let a=t-this.from;for(let{from:i,to:l}of s.overlay)if((e>0?i<=a:i<a)&&(e<0?l>=a:l>a))return new Nn(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,r)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(t=0){return new Mn(this,t)}get tree(){return this._tree}toTree(){return this._tree}resolve(t,e=0){return Et(this,t,e,!1)}resolveInner(t,e=0){return Et(this,t,e,!