From 6cc64e8ee7203ee22de5b074e6ef18648ba4ebca Mon Sep 17 00:00:00 2001 From: ojack Date: Wed, 19 Jul 2023 18:48:13 +0200 Subject: [PATCH] basic cm6 --- dist/assets/index-2318738e.js | 165 ++++++++++++ dist/assets/index-5be625e2.js | 342 ------------------------ dist/extensions/arithmetics.png | Bin 153532 -> 0 bytes dist/extensions/config.json | 16 -- dist/extensions/examples.json | 14 - dist/extensions/extensions.json | 59 ---- dist/extensions/external-libraries.json | 38 --- dist/extensions/gradient.png | Bin 280301 -> 0 bytes dist/extensions/op-art.png | Bin 110834 -> 0 bytes dist/extensions/shader-park.png | Bin 216839 -> 0 bytes dist/index.html | 2 +- src/stores/editor-store.js | 26 +- src/stores/gallery-store.js | 2 +- src/stores/store.js | 2 +- src/views/EditorCm6.js | 6 +- src/views/cm6-editor/editor.js | 20 +- 16 files changed, 200 insertions(+), 492 deletions(-) create mode 100644 dist/assets/index-2318738e.js delete mode 100644 dist/assets/index-5be625e2.js delete mode 100644 dist/extensions/arithmetics.png delete mode 100644 dist/extensions/config.json delete mode 100644 dist/extensions/examples.json delete mode 100644 dist/extensions/extensions.json delete mode 100644 dist/extensions/external-libraries.json delete mode 100644 dist/extensions/gradient.png delete mode 100644 dist/extensions/op-art.png delete mode 100644 dist/extensions/shader-park.png diff --git a/dist/assets/index-2318738e.js b/dist/assets/index-2318738e.js new file mode 100644 index 0000000..9844923 --- /dev/null +++ b/dist/assets/index-2318738e.js @@ -0,0 +1,165 @@ +var eb=Object.defineProperty;var tb=(r,e,t)=>e in r?eb(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var jf=(r,e,t)=>(tb(r,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();var lt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _r(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Fm(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){if(this instanceof n){var i=[null];i.push.apply(i,arguments);var o=Function.bind.apply(e,i);return new o}return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var Uh={exports:{}},hi=typeof Reflect=="object"?Reflect:null,Lf=hi&&typeof hi.apply=="function"?hi.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},Hs;hi&&typeof hi.ownKeys=="function"?Hs=hi.ownKeys:Object.getOwnPropertySymbols?Hs=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Hs=function(e){return Object.getOwnPropertyNames(e)};function rb(r){console&&console.warn&&console.warn(r)}var Xm=Number.isNaN||function(e){return e!==e};function _e(){_e.init.call(this)}Uh.exports=_e;Uh.exports.once=sb;_e.EventEmitter=_e;_e.prototype._events=void 0;_e.prototype._eventsCount=0;_e.prototype._maxListeners=void 0;var Df=10;function ol(r){if(typeof r!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r)}Object.defineProperty(_e,"defaultMaxListeners",{enumerable:!0,get:function(){return Df},set:function(r){if(typeof r!="number"||r<0||Xm(r))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+r+".");Df=r}});_e.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};_e.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Xm(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Ym(r){return r._maxListeners===void 0?_e.defaultMaxListeners:r._maxListeners}_e.prototype.getMaxListeners=function(){return Ym(this)};_e.prototype.emit=function(e){for(var t=[],n=1;n0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(l===void 0)return!1;if(typeof l=="function")Lf(l,this,t);else for(var c=l.length,u=Km(l,c),n=0;n0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=r,a.type=e,a.count=s.length,rb(a)}return r}_e.prototype.addListener=function(e,t){return Gm(this,e,t,!1)};_e.prototype.on=_e.prototype.addListener;_e.prototype.prependListener=function(e,t){return Gm(this,e,t,!0)};function nb(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Wm(r,e,t){var n={fired:!1,wrapFn:void 0,target:r,type:e,listener:t},i=nb.bind(n);return i.listener=t,n.wrapFn=i,i}_e.prototype.once=function(e,t){return ol(t),this.on(e,Wm(this,e,t)),this};_e.prototype.prependOnceListener=function(e,t){return ol(t),this.prependListener(e,Wm(this,e,t)),this};_e.prototype.removeListener=function(e,t){var n,i,o,s,a;if(ol(t),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(o=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){a=n[s].listener,o=s;break}if(o<0)return this;o===0?n.shift():ib(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||t)}return this};_e.prototype.off=_e.prototype.removeListener;_e.prototype.removeAllListeners=function(e){var t,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),s;for(i=0;i=0;i--)this.removeListener(e,t[i]);return this};function zm(r,e,t){var n=r._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?ob(i):Km(i,i.length)}_e.prototype.listeners=function(e){return zm(this,e,!0)};_e.prototype.rawListeners=function(e){return zm(this,e,!1)};_e.listenerCount=function(r,e){return typeof r.listenerCount=="function"?r.listenerCount(e):Vm.call(r,e)};_e.prototype.listenerCount=Vm;function Vm(r){var e=this._events;if(e!==void 0){var t=e[r];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}_e.prototype.eventNames=function(){return this._eventsCount>0?Hs(this._events):[]};function Km(r,e){for(var t=new Array(e),n=0;n=10||r%1===0?(e?"-":"")+r.toFixed(0)+" "+i:(e?"-":"")+r.toFixed(1)+" "+i}var ub=lb,hb=fb;function fb(){Object.defineProperty(window.choo,"storage",{get:r,set:db});function r(){if(navigator.storage)return navigator.storage.estimate().then(function(t){var n=(t.usage/t.quota).toFixed();Bl("Max storage:",Zf(t.quota)),Bl("Storage used:",Zf(t.usage)+" ("+n+"%)"),navigator.storage.persisted().then(function(i){var o=i?"enabled":"disabled";Bl("Persistent storage:",o)})}),"Calculating storage quota…";var e=window.location.protocol;return/https/.test(e)?"The Storage API is unavailable in this browser. We're sorry!":"The Storage API is unavailable. Serving this site over HTTPS might help enable it!"}}function Bl(r,e){var t="#cc99cc";console.log("%c"+r,"color: "+t,e)}function Zf(r){return ub(r).replace(" ","")}function db(){}Lr.notEqual=gb;Lr.notOk=mb;Lr.equal=pb;Lr.ok=Lr;var Jt=Lr;function pb(r,e,t){Lr(r==e,t)}function gb(r,e,t){Lr(r!=e,t)}function mb(r,e){Lr(!r,e)}function Lr(r,e){if(!r)throw new Error(e||"AssertionError")}var yb=Jt,Ob=typeof window<"u";function wb(){var r;return Ob?(window._nanoScheduler||(window._nanoScheduler=new Co(!0)),r=window._nanoScheduler):r=new Co,r}function Co(r){this.hasWindow=r,this.hasIdle=this.hasWindow&&window.requestIdleCallback,this.method=this.hasIdle?window.requestIdleCallback.bind(window):this.setTimeout,this.scheduled=!1,this.queue=[]}Co.prototype.push=function(r){yb.equal(typeof r,"function","nanoscheduler.push: cb should be type function"),this.queue.push(r),this.schedule()};Co.prototype.schedule=function(){if(!this.scheduled){this.scheduled=!0;var r=this;this.method(function(e){for(var t;r.queue.length&&e.timeRemaining()>0;)t=r.queue.shift(),t(e);r.scheduled=!1,r.queue.length&&r.schedule()})}};Co.prototype.setTimeout=function(r){setTimeout(r,0,{timeRemaining:function(){return 1}})};var es=wb,Hm={exports:{}};/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var Nf=Object.getOwnPropertySymbols,vb=Object.prototype.hasOwnProperty,bb=Object.prototype.propertyIsEnumerable;function Sb(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function Mb(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(o){return e[o]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(o){i[o]=o}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var kb=Mb()?Object.assign:function(r,e){for(var t,n=Sb(r),i,o=1;o=re)return de;switch(de){case"%s":return String(H[Y++]);case"%d":return Number(H[Y++]);case"%j":try{return JSON.stringify(H[Y++])}catch{return"[Circular]"}default:return de}}),ce=H[Y];Y=3&&(Y.depth=arguments[2]),arguments.length>=4&&(Y.colors=arguments[3]),b(J)?Y.showHidden=J:J&&r._extend(Y,J),x(Y.showHidden)&&(Y.showHidden=!1),x(Y.depth)&&(Y.depth=2),x(Y.colors)&&(Y.colors=!1),x(Y.customInspect)&&(Y.customInspect=!0),Y.colors&&(Y.stylize=o),l(Y,T,Y.depth)}r.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function o(T,J){var Y=i.styles[J];return Y?"\x1B["+i.colors[Y][0]+"m"+T+"\x1B["+i.colors[Y][1]+"m":T}function s(T,J){return T}function a(T){var J={};return T.forEach(function(Y,H){J[Y]=!0}),J}function l(T,J,Y){if(T.customInspect&&J&&D(J.inspect)&&J.inspect!==r.inspect&&!(J.constructor&&J.constructor.prototype===J)){var H=J.inspect(Y,T);return R(H)||(H=l(T,H,Y)),H}var re=c(T,J);if(re)return re;var le=Object.keys(J),ce=a(le);if(T.showHidden&&(le=Object.getOwnPropertyNames(J)),Z(J)&&(le.indexOf("message")>=0||le.indexOf("description")>=0))return u(J);if(le.length===0){if(D(J)){var de=J.name?": "+J.name:"";return T.stylize("[Function"+de+"]","special")}if($(J))return T.stylize(RegExp.prototype.toString.call(J),"regexp");if(L(J))return T.stylize(Date.prototype.toString.call(J),"date");if(Z(J))return u(J)}var Ae="",X=!1,F=["{","}"];if(w(J)&&(X=!0,F=["[","]"]),D(J)){var q=J.name?": "+J.name:"";Ae=" [Function"+q+"]"}if($(J)&&(Ae=" "+RegExp.prototype.toString.call(J)),L(J)&&(Ae=" "+Date.prototype.toUTCString.call(J)),Z(J)&&(Ae=" "+u(J)),le.length===0&&(!X||J.length==0))return F[0]+Ae+F[1];if(Y<0)return $(J)?T.stylize(RegExp.prototype.toString.call(J),"regexp"):T.stylize("[Object]","special");T.seen.push(J);var fe;return X?fe=h(T,J,Y,ce,le):fe=le.map(function(ye){return f(T,J,Y,ce,ye,X)}),T.seen.pop(),d(fe,Ae,F)}function c(T,J){if(x(J))return T.stylize("undefined","undefined");if(R(J)){var Y="'"+JSON.stringify(J).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return T.stylize(Y,"string")}if(M(J))return T.stylize(""+J,"number");if(b(J))return T.stylize(""+J,"boolean");if(v(J))return T.stylize("null","null")}function u(T){return"["+Error.prototype.toString.call(T)+"]"}function h(T,J,Y,H,re){for(var le=[],ce=0,de=J.length;ce-1&&(le?de=de.split(` +`).map(function(X){return" "+X}).join(` +`).substr(2):de=` +`+de.split(` +`).map(function(X){return" "+X}).join(` +`))):de=T.stylize("[Circular]","special")),x(ce)){if(le&&re.match(/^\d+$/))return de;ce=JSON.stringify(""+re),ce.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ce=ce.substr(1,ce.length-2),ce=T.stylize(ce,"name")):(ce=ce.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),ce=T.stylize(ce,"string"))}return ce+": "+de}function d(T,J,Y){var H=T.reduce(function(re,le){return le.indexOf(` +`)>=0,re+le.replace(/\u001b\[\d\d?m/g,"").length+1},0);return H>60?Y[0]+(J===""?"":J+` + `)+" "+T.join(`, + `)+" "+Y[1]:Y[0]+J+" "+T.join(", ")+" "+Y[1]}function w(T){return Array.isArray(T)}r.isArray=w;function b(T){return typeof T=="boolean"}r.isBoolean=b;function v(T){return T===null}r.isNull=v;function O(T){return T==null}r.isNullOrUndefined=O;function M(T){return typeof T=="number"}r.isNumber=M;function R(T){return typeof T=="string"}r.isString=R;function k(T){return typeof T=="symbol"}r.isSymbol=k;function x(T){return T===void 0}r.isUndefined=x;function $(T){return I(T)&&te(T)==="[object RegExp]"}r.isRegExp=$;function I(T){return typeof T=="object"&&T!==null}r.isObject=I;function L(T){return I(T)&&te(T)==="[object Date]"}r.isDate=L;function Z(T){return I(T)&&(te(T)==="[object Error]"||T instanceof Error)}r.isError=Z;function D(T){return typeof T=="function"}r.isFunction=D;function ne(T){return T===null||typeof T=="boolean"||typeof T=="number"||typeof T=="string"||typeof T=="symbol"||typeof T>"u"}r.isPrimitive=ne,r.isBuffer=xb;function te(T){return Object.prototype.toString.call(T)}function se(T){return T<10?"0"+T.toString(10):T.toString(10)}var ae=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var T=new Date,J=[se(T.getHours()),se(T.getMinutes()),se(T.getSeconds())].join(":");return[T.getDate(),ae[T.getMonth()],J].join(" ")}r.log=function(){console.log("%s - %s",P(),r.format.apply(r,arguments))},r.inherits=Cb,r._extend=function(T,J){if(!J||!I(J))return T;for(var Y=Object.keys(J),H=Y.length;H--;)T[Y[H]]=J[Y[H]];return T};function j(T,J){return Object.prototype.hasOwnProperty.call(T,J)}})(ey);var Tb=kb;/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */function Ff(r,e){if(r===e)return 0;for(var t=r.length,n=e.length,i=0,o=Math.min(t,n);i=0){var a=i.indexOf(` +`,s+1);i=i.substring(a+1)}this.stack=i}}};nr.inherits(Ce.AssertionError,Error);function Wf(r,e){return typeof r=="string"?r.length=0;c--)if(s[c]!==a[c])return!1;for(c=s.length-1;c>=0;c--)if(l=s[c],!Si(r[l],e[l],t,n))return!1;return!0}Ce.notDeepEqual=function(e,t,n){Si(e,t,!1)&&Rt(e,t,n,"notDeepEqual",Ce.notDeepEqual)};Ce.notDeepStrictEqual=iy;function iy(r,e,t){Si(r,e,!0)&&Rt(r,e,t,"notDeepStrictEqual",iy)}Ce.strictEqual=function(e,t,n){e!==t&&Rt(e,t,n,"===",Ce.strictEqual)};Ce.notStrictEqual=function(e,t,n){e===t&&Rt(e,t,n,"!==",Ce.notStrictEqual)};function Kf(r,e){if(!r||!e)return!1;if(Object.prototype.toString.call(e)=="[object RegExp]")return e.test(r);try{if(r instanceof e)return!0}catch{}return Error.isPrototypeOf(e)?!1:e.call({},r)===!0}function Rb(r){var e;try{r()}catch(t){e=t}return e}function oy(r,e,t,n){var i;if(typeof e!="function")throw new TypeError('"block" argument must be a function');typeof t=="string"&&(n=t,t=null),i=Rb(e),n=(t&&t.name?" ("+t.name+").":".")+(n?" "+n:"."),r&&!i&&Rt(i,t,"Missing expected exception"+n);var o=typeof n=="string",s=!r&&nr.isError(i),a=!r&&i&&!t;if((s&&o&&Kf(i,t)||a)&&Rt(i,t,"Got unwanted exception"+n),r&&i&&t&&!Kf(i,t)||!r&&i)throw i}Ce.throws=function(r,e,t){oy(!0,r,e,t)};Ce.doesNotThrow=function(r,e,t){oy(!1,r,e,t)};Ce.ifError=function(r){if(r)throw r};function sy(r,e){r||Rt(r,!0,e,"==",sy)}Ce.strict=Tb(sy,Ce,{equal:Ce.strictEqual,deepEqual:Ce.deepStrictEqual,notEqual:Ce.notStrictEqual,notDeepEqual:Ce.notDeepStrictEqual});Ce.strict.strict=Ce.strict;var qf=Object.keys||function(r){var e=[];for(var t in r)Eb.call(r,t)&&e.push(t);return e},al=Hm.exports,$b=al,_b={trace:"🔍",debug:"🐛",info:"✨",warn:"⚠️",error:"🚨",fatal:"💀"},ay={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Jb={foreground:"#d3c0c8",background:"#2d2d2d",black:"#2d2d2d",red:"#f2777a",green:"#99cc99",yellow:"#ffcc66",blue:"#6699cc",magenta:"#cc99cc",cyan:"#66cccc",white:"#d3d0c8",brightBlack:"#747369"},Rh=Rr;function Rr(r,e){if(e=e||{},!(this instanceof Rr))return new Rr(r,e);$b.equal(typeof e,"object","nanologger: opts should be type object"),this._name=r||"",this._colors=Object.assign({},Jb,e.colors||{});try{this.logLevel=window.localStorage.getItem("logLevel")||"info"}catch{this.logLevel="info"}this._logLevel=ay[this.logLevel]}Rr.prototype.trace=function(){for(var r=["trace"],e=0,t=arguments.length;e2?e.slice(2):e,e[0]=e[0].replace(/^ {4}at /,""),` +`+e.join(` +`)}var qb=Vb,Hb=Rh,eS=al,Ll="Debugging enabled. To disable run: `choo.debug = false`",tS="Debugging disabled. We hope it was helpful! 🙌",rS=nS;function nS(r,e,t,n){var i=Hb("choo-devtools"),o=window.localStorage.logLevel==="debug";o&&i.info(Ll),r=qb(r,function(s,a,l){o&&(l=l.split(` +`)[1].replace(/^ +/,""),i.info("state."+s,a,` +`+l))}),t.state=r,Object.defineProperty(window.choo,"debug",{get:function(){return window.localStorage.logLevel="debug",n.emit("debug",!0),o=!0,Ll},set:function(s){eS.equal(typeof s,"boolean","choo-devtools.debug: bool should be type boolean"),window.localStorage.logLevel=s?"debug":"info",o=s,n.emit("debug",o),o?i.info(Ll):i.info(tS)}})}var cy=To;To.default=To;To.stable=fy;To.stableStringify=fy;var ma="[...]",uy="[Circular]",Pn=[],Tn=[];function hy(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function To(r,e,t,n){typeof n>"u"&&(n=hy()),ru(r,"",0,[],void 0,0,n);var i;try{Tn.length===0?i=JSON.stringify(r,e,t):i=JSON.stringify(r,dy(e),t)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Pn.length!==0;){var o=Pn.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function fi(r,e,t,n){var i=Object.getOwnPropertyDescriptor(n,t);i.get!==void 0?i.configurable?(Object.defineProperty(n,t,{value:r}),Pn.push([n,t,e,i])):Tn.push([e,t,r]):(n[t]=r,Pn.push([n,t,e]))}function ru(r,e,t,n,i,o,s){o+=1;var a;if(typeof r=="object"&&r!==null){for(a=0;as.depthLimit){fi(ma,r,e,i);return}if(typeof s.edgesLimit<"u"&&t+1>s.edgesLimit){fi(ma,r,e,i);return}if(n.push(r),Array.isArray(r))for(a=0;ae?1:0}function fy(r,e,t,n){typeof n>"u"&&(n=hy());var i=nu(r,"",0,[],void 0,0,n)||r,o;try{Tn.length===0?o=JSON.stringify(i,e,t):o=JSON.stringify(i,dy(e),t)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Pn.length!==0;){var s=Pn.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return o}function nu(r,e,t,n,i,o,s){o+=1;var a;if(typeof r=="object"&&r!==null){for(a=0;as.depthLimit){fi(ma,r,e,i);return}if(typeof s.edgesLimit<"u"&&t+1>s.edgesLimit){fi(ma,r,e,i);return}if(n.push(r),Array.isArray(r))for(a=0;a0)for(var n=0;n */var oS=sS;function sS(r){if(navigator.clipboard)return navigator.clipboard.writeText(r).catch(function(o){throw o!==void 0?o:new DOMException("The request is not allowed","NotAllowedError")});var e=document.createElement("span");e.textContent=r,e.style.whiteSpace="pre",e.style.webkitUserSelect="auto",e.style.userSelect="all",document.body.appendChild(e);var t=window.getSelection(),n=window.document.createRange();t.removeAllRanges(),n.selectNode(e),t.addRange(n);var i=!1;try{i=window.document.execCommand("copy")}catch(o){console.log("error",o)}return t.removeAllRanges(),window.document.body.removeChild(e),i?Promise.resolve():Promise.reject(new DOMException("The request is not allowed","NotAllowedError"))}var aS=cy,lS=oS;function cS(r){try{return JSON.stringify(r)}catch{}}function uS(r){var e=cS(r)||aS(r);lS(e)}var hS=uS,fS=dS;function dS(r,e){return arguments.length>=2?td(r)(e):td(r)}function td(r){if(r=typeof r=="string"?String(r).trim().split("."):r,r.length<2)return r=r[0],t;var e=r.length;return n;function t(i){return i[r]}function n(i){for(var o=0;o"u");o++)i=i[r[o]];return i}}var pS=hS,gS=fS,mS=yS;function yS(r){var e=r&&typeof r=="string",t=e&&arguments.length===1&&r.indexOf("state.")===0;(!r||typeof r=="function")&&(r=window.choo.state),t&&[].push.call(arguments,{state:window.choo.state}),pS(e?gS.apply(this,arguments):r)}var OS=wS;function wS(){Object.defineProperty(window.choo,"help",{get:r,set:vS});function r(){return setTimeout(function(){fr("copy","Serialize the current state to the clipboard."),fr("debug","Enable Choo debug mode."),fr("emit","Emit an event in the Choo emitter."),fr("help","Print usage information."),fr("log","Print the last 150 events emitted."),fr("on","Listen for an event in the Choo emitter."),fr("once","Listen for an event once in the Choo emitter."),fr("perf","Print out performance metrics"),fr("state","Print the Choo state object."),fr("storage","Print browser storage information.")},0),"Choo command overview"}}function fr(r,e){var t="#cc99cc";console.log(" %cchoo."+r,"color: "+t,"— "+e)}function vS(){}var bS=ly,SS="█",MS=kS;function kS(r,e,t,n){var i={};window.choo.perf={};var o=new ao(i,"all");Object.defineProperty(window.choo.perf,"all",{get:o.get.bind(o),set:ds});var s=new ao(i,"core",function(c){return/^choo/.test(c)});Object.defineProperty(window.choo.perf,"core",{get:s.get.bind(s),set:ds});var a=new ao(i,"components",function(c){return!/^choo/.test(c)&&!/^bankai/.test(c)});Object.defineProperty(window.choo.perf,"components",{get:a.get.bind(a),set:ds});var l=new ao(i,"events",function(c){return/^choo\.emit/.test(c)},function(c){return c.replace(/^choo\.emit\('/,"").replace(/'\)$/,"")});Object.defineProperty(window.choo.perf,"events",{get:l.get.bind(l),set:ds}),bS(function(c){if(c.entryType==="measure"){var u=c.name.replace(/ .*$/,"");i[u]||(i[u]={name:u,count:0,entries:[]});var h=i[u];h.count+=1,h.entries.push(c.duration)}})}function ao(r,e,t,n){this.stats=r,this.name=e,this.filter=t||function(){return!0},this.rename=n||function(i){return i}}ao.prototype.get=function(){var r=Object.keys(this.stats).filter(this.filter),e=this,t=0,n=0,i=r.map(function(l){var c=e.stats[l],u=Number(c.entries.reduce(function(d,w){return d+w},0).toFixed(2));u>t&&(t=u);var h=CS(c.entries);h>n&&(n=h);var f=e.rename(c.name);return new xS(f,u,h,c.count)}),o=10;i.forEach(function(l){var c=l["Total Time (ms)"],u=l["Median (ms)"];l[" "]=s(c/t*100/o),l[" "]=s(u/n*100/o)});function s(l){for(var c="",u=0,h=Math.round(l);u=i||t<=0||e<0)){t=e+t>i?i-e:t;var o=i-t;for(n=e;n"u"&&(d=!0),typeof w>"u"&&(w=1/0);function k(x,$){if(x===null)return null;if($===0)return x;var I,L;if(typeof x!="object")return x;if(t(x,n))I=new n;else if(t(x,i))I=new i;else if(t(x,o))I=new o(function(T,J){x.then(function(Y){T(k(Y,$-1))},function(Y){J(k(Y,$-1))})});else if(s.__isArray(x))I=[];else if(s.__isRegExp(x))I=new RegExp(x.source,h(x)),x.lastIndex&&(I.lastIndex=x.lastIndex);else if(s.__isDate(x))I=new Date(x.getTime());else{if(R&&Buffer.isBuffer(x))return Buffer.allocUnsafe?I=Buffer.allocUnsafe(x.length):I=new Buffer(x.length),x.copy(I),I;t(x,Error)?I=Object.create(x):typeof b>"u"?(L=Object.getPrototypeOf(x),I=Object.create(L)):(I=Object.create(b),L=b)}if(d){var Z=O.indexOf(x);if(Z!=-1)return M[Z];O.push(x),M.push(I)}t(x,n)&&x.forEach(function(T,J){var Y=k(J,$-1),H=k(T,$-1);I.set(Y,H)}),t(x,i)&&x.forEach(function(T){var J=k(T,$-1);I.add(J)});for(var D in x){var ne;L&&(ne=Object.getOwnPropertyDescriptor(L,D)),!(ne&&ne.set==null)&&(I[D]=k(x[D],$-1))}if(Object.getOwnPropertySymbols)for(var te=Object.getOwnPropertySymbols(x),D=0;DZl&&US(o,0,w-Zl)})});function l(){setTimeout(function(){console.table(o)},0);var h=s===1?"event":"events",f=s+" "+h+" recorded, showing the last "+Zl+".";return i===!1?f+=" Enable state capture by calling `choo.debug`.":f+=" Disable state capture by calling `choo.debug = false`.",f}function c(h,f,d){this.name=h,this.data=f===void 0?"":f,this.state=i?u(d):""}function u(h){try{var f=JS(h);return a||(a=!0),f}catch{return a&&(_S.warn("Could not clone your app state. Make sure to have a serializable state so it can be cloned"),a=!1),""}}}function nd(){}var id=Jt,BS=jS,py=function(r,e){var t=e||"/",n={},i=r.nodes;return Object.keys(i).forEach(function(o){var s=(t==="/"?t:t+"/")+(o==="$$"?":"+r.name:o),a=i[o].cb;if(a!==void 0&&(n[s]=a),Object.keys(i[o].nodes).length!==0){var l=py(i[o],s);Object.keys(l).forEach(function(c){n[c]=l[c]})}}),n};function jS(r){id.equal(typeof r,"function","wayfarer.getAllRoutes: router should be an function");var e=r._trie;id.equal(typeof e,"object","wayfarer.getAllRoutes: trie should be an object");var t=e.trie;return py(t)}var LS=sl.EventEmitter,DS=hb,ZS=Wb,NS=rS,FS=mS,XS=OS,YS=MS,GS=PS,WS=BS,zS=VS;function VS(r){return r=r||{},e.storeName="choo-devtools",e;function e(t,n,i){var o=new LS;typeof window<"u"&&ZS(t,n,r),n.on("DOMContentLoaded",function(){typeof window>"u"||(window.choo={},window.choo.state=t,window.choo.emit=function(){n.emit.apply(n,arguments)},window.choo.on=function(s,a){n.on(s,a)},NS(t,n,i,o),GS(t,n,i,o),YS(),window.choo.copy=FS,i.router&&i.router.router&&(window.choo.routes=Object.keys(WS(i.router.router))),DS(),XS())})}}const KS=_r(zS);var qS=HS;function HS(r,e){if(r)try{var t=document.querySelector(r);t&&t.scrollIntoView(e)}catch{}}var e1=t1;function t1(r){if(typeof document>"u")throw new Error("document-ready only runs in the browser");var e=document.readyState;if(e==="complete"||e==="interactive")return setTimeout(r,0);document.addEventListener("DOMContentLoaded",function(){r()})}var gy=es(),r1=Jt,Vr;ll.disabled=!0;try{Vr=window.performance,ll.disabled=window.localStorage.DISABLE_NANOTIMING==="true"||!Vr.mark}catch{}var $h=ll;function ll(r){if(r1.equal(typeof r,"string","nanotiming: name should be type string"),ll.disabled)return n1;var e=(Vr.now()*1e4).toFixed()%Number.MAX_SAFE_INTEGER,t="start-"+e+"-"+r;Vr.mark(t);function n(i){var o="end-"+e+"-"+r;Vr.mark(o),gy.push(function(){var s=null;try{var a=r+" ["+e+"]";Vr.measure(a,t,o),Vr.clearMarks(t),Vr.clearMarks(o)}catch(l){s=l}i&&i(s,r)})}return n.uuid=e,n}function n1(r){r&&gy.push(function(){r(new Error("nanotiming: performance API unavailable"))})}var ya=Jt,i1=ki;function ki(){if(!(this instanceof ki))return new ki;this.trie={nodes:{}}}ki.prototype.create=function(r){ya.equal(typeof r,"string","route should be a string");var e=r.replace(/^\//,"").split("/");function t(n,i){var o=ea(e,n)&&e[n];if(o===!1)return i;var s=null;return/^:|^\*/.test(o)?(ea(i.nodes,"$$")?s=i.nodes.$$:(s={nodes:{}},i.nodes.$$=s),o[0]==="*"&&(i.wildcard=!0),i.name=o.replace(/^:|^\*/,"")):ea(i.nodes,o)?s=i.nodes[o]:(s={nodes:{}},i.nodes[o]=s),t(n+1,s)}return t(0,this.trie)};ki.prototype.match=function(r){ya.equal(typeof r,"string","route should be a string");var e=r.replace(/^\//,"").split("/"),t={};function n(o,s){if(s!==void 0){var a=e[o];if(a===void 0)return s;if(ea(s.nodes,a))return n(o+1,s.nodes[a]);if(s.name){try{t[s.name]=decodeURIComponent(a)}catch{return n(o,void 0)}return n(o+1,s.nodes.$$)}else if(s.wildcard){try{t.wildcard=decodeURIComponent(e.slice(o).join("/"))}catch{return n(o,void 0)}return s.nodes.$$}else return n(o+1)}}var i=n(0,this.trie);if(i)return i=Object.assign({},i),i.params=t,i};ki.prototype.mount=function(r,e){ya.equal(typeof r,"string","route should be a string"),ya.equal(typeof e,"object","trie should be a object");var t=r.replace(/^\//,"").split("/"),n=null,i=null;if(t.length===1)i=t[0],n=this.create(i);else{var o=t.join("/");i=t[0],n=this.create(o)}Object.assign(n.nodes,e.nodes),e.name&&(n.name=e.name),n.nodes[""]&&(Object.keys(n.nodes[""]).forEach(function(s){s!=="nodes"&&(n[s]=n.nodes[""][s])}),Object.assign(n.nodes,n.nodes[""].nodes),delete n.nodes[""].nodes)};function ea(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Nl=Jt,o1=i1,s1=iu;function iu(r){if(!(this instanceof iu))return new iu(r);var e=(r||"").replace(/^\//,""),t=o1();return i._trie=t,i.on=n,i.emit=i,i.match=o,i._wayfarer=!0,i;function n(a,l){if(Nl.equal(typeof a,"string"),Nl.equal(typeof l,"function"),a=a||"/",l._wayfarer&&l._trie)t.mount(a,l._trie.trie);else{var c=t.create(a);c.cb=l,c.route=a}return i}function i(a){var l=o(a),c=new Array(arguments.length);c[0]=l.params;for(var u=1;u=0;--c)l=n[c],a=l.name,i=l.namespaceURI,o=l.value,i?(a=l.localName||a,s=e.getAttributeNS(i,a),s!==o&&e.setAttributeNS(i,a,o)):e.hasAttribute(a)?(s=e.getAttribute(a),s!==o&&(o==="null"||o==="undefined"?e.removeAttribute(a):e.setAttribute(a,o))):e.setAttribute(a,o);for(var u=t.length-1;u>=0;--u)l=t[u],l.specified!==!1&&(a=l.name,i=l.namespaceURI,i?(a=l.localName||a,r.hasAttributeNS(i,a)||e.removeAttributeNS(i,a)):r.hasAttributeNS(null,a)||e.removeAttribute(a))}function x1(r,e){for(var t=0;t"u","nanoraf: raf should be a function or undefined"),e||(e=window.requestAnimationFrame);var t=!1,n=null;return function(){n===null&&!t&&(t=!0,e(function(){t=!1;for(var s=n.length,a=new Array(s),l=0;l=o||n===0)){n=t+n>o?o-t:n;var s=o-n;for(i=t;i0&&this._emit(this._listeners[r],e),this._starListeners.length>0&&this._emit(this._starListeners,r,e,i.uuid),i(),this};Dt.prototype.on=Dt.prototype.addListener=function(r,e){return ar.ok(typeof r=="string"||typeof r=="symbol","nanobus.on: eventName should be type string or symbol"),ar.equal(typeof e,"function","nanobus.on: listener should be type function"),r==="*"?this._starListeners.push(e):(this._listeners[r]||(this._listeners[r]=[]),this._listeners[r].push(e)),this};Dt.prototype.prependListener=function(r,e){return ar.ok(typeof r=="string"||typeof r=="symbol","nanobus.prependListener: eventName should be type string or symbol"),ar.equal(typeof e,"function","nanobus.prependListener: listener should be type function"),r==="*"?this._starListeners.unshift(e):(this._listeners[r]||(this._listeners[r]=[]),this._listeners[r].unshift(e)),this};Dt.prototype.once=function(r,e){ar.ok(typeof r=="string"||typeof r=="symbol","nanobus.once: eventName should be type string or symbol"),ar.equal(typeof e,"function","nanobus.once: listener should be type function");var t=this;this.on(r,n);function n(){e.apply(t,arguments),t.removeListener(r,n)}return this};Dt.prototype.prependOnceListener=function(r,e){ar.ok(typeof r=="string"||typeof r=="symbol","nanobus.prependOnceListener: eventName should be type string or symbol"),ar.equal(typeof e,"function","nanobus.prependOnceListener: listener should be type function");var t=this;this.prependListener(r,n);function n(){e.apply(t,arguments),t.removeListener(r,n)}return this};Dt.prototype.removeListener=function(r,e){if(ar.ok(typeof r=="string"||typeof r=="symbol","nanobus.removeListener: eventName should be type string or symbol"),ar.equal(typeof e,"function","nanobus.removeListener: listener should be type function"),r==="*")return this._starListeners=this._starListeners.slice(),t(this._starListeners,e);return typeof this._listeners[r]<"u"&&(this._listeners[r]=this._listeners[r].slice()),t(this._listeners[r],e);function t(n,i){if(n){var o=n.indexOf(i);if(o!==-1)return N1(n,o,1),!0}}};Dt.prototype.removeAllListeners=function(r){return r?r==="*"?this._starListeners=[]:this._listeners[r]=[]:(this._starListeners=[],this._listeners={}),this};Dt.prototype.listeners=function(r){var e=r!=="*"?this._listeners[r]:this._starListeners,t=[];if(e)for(var n=e.length,i=0;i"u")&&r.length!==0){t===void 0&&(t=e,e=null),e&&(n!==void 0?t=[e].concat(t,n):t=[e].concat(t));for(var i=r.length,o=0;othis.maxAge?(this.remove(r),!1):!0};Gt.prototype.get=function(r){if(typeof r!="string"&&(r=""+r),!!this.cache.hasOwnProperty(r)){var e=this.cache[r];if(this._checkAge(r,e))return this.head!==r&&(r===this.tail?(this.tail=e.next,this.cache[this.tail].prev=null):this.cache[e.prev].next=e.next,this.cache[e.next].prev=e.prev,this.cache[this.head].next=r,e.prev=this.head,e.next=null,this.head=r),e.value}};Gt.prototype.evict=function(){this.tail&&this.remove(this.tail)};var wo=Jt,ld=Y1,G1=Jh;function Jh(r,e,t){wo.ok(this instanceof Jh,"ChooComponentCache should be created with `new`"),wo.equal(typeof r,"object","ChooComponentCache: state should be type object"),wo.equal(typeof e,"function","ChooComponentCache: emit should be type function"),typeof t=="number"?this.cache=new ld(t):this.cache=t||new ld(100),this.state=r,this.emit=e}Jh.prototype.render=function(r,e){wo.equal(typeof r,"function","ChooComponentCache.render: Component should be type function"),wo.ok(typeof e=="string"||typeof e=="number","ChooComponentCache.render: id should be type string or type number");var t=this.cache.get(e);if(!t){for(var n=[],i=2,o=arguments.length;i is not the same type as the new node <"+n.nodeName.toLowerCase()+">.");var i=Qr("choo.morph");Sy(e._tree,n),i(),t()})),by(function(){e.emitter.emit(e._events.DOMCONTENTLOADED),e._loaded=!0}),r(),this._tree};lr.prototype.mount=function(e){var t=Qr("choo.mount('"+e+"')");if(typeof window!="object")return ze.ok(typeof e=="string","choo.mount: selector should be type String"),this.selector=e,t(),this;ze.ok(typeof e=="string"||typeof e=="object","choo.mount: selector should be type String or HTMLElement");var n=this;by(function(){var i=Qr("choo.render"),o=n.start();typeof e=="string"?n._tree=document.querySelector(e):n._tree=e,ze.ok(n._tree,"choo.mount: could not query selector: "+e),ze.equal(n._tree.nodeName,o.nodeName,"choo.mount: The target node <"+n._tree.nodeName.toLowerCase()+"> is not the same type as the new node <"+o.nodeName.toLowerCase()+">.");var s=Qr("choo.morph");Sy(n._tree,o),s(),i()}),t()};lr.prototype.toString=function(r,e){e=e||{},e.components=e.components||{},e.events=Object.assign({},e.events,this._events),ze.notEqual(typeof window,"object","choo.mount: window was found. .toString() must be called in Node, use .start() or .mount() if running in the browser"),ze.equal(typeof r,"string","choo.toString: location should be type string"),ze.equal(typeof e,"object","choo.toString: state should be type object"),this._setCache(e),this._matchRoute(e,r),this.emitter.removeAllListeners(),this._stores.forEach(function(n){n(e)});var t=this._prerender(e);return ze.ok(t,"choo.toString: no valid value returned for the route "+r),ze(!Array.isArray(t),"choo.toString: return value was an array for the route "+r),typeof t.outerHTML=="string"?t.outerHTML:t.toString()};lr.prototype._matchRoute=function(r,e){var t,n;e?(t=e.replace(/\?.+$/,"").replace(/\/$/,""),this._hashEnabled||(t=t.replace(/#.+$/,"")),n=e):(t=window.location.pathname.replace(/\/$/,""),this._hashEnabled&&(t+=window.location.hash.replace(/^#/,"/")),n=window.location.search);var i=this.router.match(t);this._handler=i.cb,r.href=t,r.query=z1(n),r.route=i.route,r.params=i.params};lr.prototype._prerender=function(r){var e=Qr("choo.prerender('"+r.route+"')"),t=this._handler(r,this.emit);return e(),t};lr.prototype._setCache=function(r){var e=new H1(r,this.emitter.emit.bind(this.emitter),this._cache);r.cache=t;function t(n,i){ze.equal(typeof n,"function","choo.state.cache: Component should be type function");for(var o=[],s=0,a=arguments.length;s{Ar=r},ra=(r,e="")=>{console.log("logging",r,e),Ar&&(Ar.innerHTML=` >> ${r} `)},nM=()=>{Ar&&(Ar.style.display="none")},iM=()=>{Ar&&(Ar.style.display="block")},oM=()=>{Ar.style.display=="none"?Ar.style.display="block":Ar.style.display="none"},sM={init:rM,log:ra,hide:nM,show:iM,toggle:oM},aM={eval:(r,e)=>{var t=`(async() => { + ${r} +})().catch(${i=>ra(i.message,"log-error")})`,n=!1;try{window.eval(t),ra("")}catch(i){n=!0,console.log("logging",i),ra(i.message,"log-error")}e&&e(t,n)}};function lM(r,e){r.showInfo=!1,r.showUI=!0,r.showExtensions=!1;const t="https://api.hydrasynth.xyz";r.serverURL=t,e.on("load and eval code",i=>{e.emit("repl: eval",i),e.emit("editor: load code",i)}),e.on("repl: eval",(i="",o)=>{aM.eval(i,o)}),e.on("screencap",()=>{screencap();const o=r.editor.editor.getValue(),s=new Blob([o],{type:"text/plain"}),a=document.createElement("a");a.style.display="none";let l=new Date;a.download=`hydra-${l.getFullYear()}-${l.getMonth()+1}-${l.getDate()}-${l.getHours()}.${l.getMinutes()}.${l.getSeconds()}.js`,a.href=URL.createObjectURL(s),a.click(),setTimeout(()=>{window.URL.revokeObjectURL(a.href)},300)});function n(){const i=r.editor.editor;hush(),speed=1,e.emit("gallery: clear"),i.clear()}e.on("clear all",()=>{n()}),e.on("ui: hide all",function(){r.showUI=!r.showUI,e.emit("render")}),e.on("ui: toggle info",function(i){r.showInfo?e.emit("ui: hide info"):e.emit("ui: show info")}),e.on("ui: show info",()=>{r.showInfo=!0,e.emit("render")}),e.on("ui: hide info",()=>{r.showInfo=!1,r.showExtensions=!1,e.emit("render")}),e.on("ui: show extensions",()=>{r.showExtensions=!0,r.showInfo=!0,e.emit("extensions: select category"),e.emit("render")}),e.on("ui: hide extensions",()=>{r.showExtensions=!1,e.emit("render")})}function or(r){"@babel/helpers - typeof";return or=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},or(r)}function cr(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function cM(r,e){if(or(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(or(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function My(r){var e=cM(r,"string");return or(e)==="symbol"?e:String(e)}function fd(r,e){for(var t=0;tr.length)&&(e=r.length);for(var t=0,n=new Array(e);t1&&arguments[1]!==void 0?arguments[1]:{};cr(this,r),this.init(e,t)}return ur(r,[{key:"init",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||gM,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,n=new Array(t),i=0;i1?n-1:0),o=1;o-1?a.replace(/###/g,"."):a}function i(){return!r||typeof r=="string"}for(var o=typeof e!="string"?[].concat(e):e.split(".");o.length>1;){if(i())return{};var s=n(o.shift());!r[s]&&t&&(r[s]=new t),Object.prototype.hasOwnProperty.call(r,s)?r=r[s]:r={}}return i()?{}:{obj:r,k:n(o.shift())}}function yd(r,e,t){var n=Ph(r,e,Object),i=n.obj,o=n.k;i[o]=t}function OM(r,e,t,n){var i=Ph(r,e,Object),o=i.obj,s=i.k;o[s]=o[s]||[],n&&(o[s]=o[s].concat(t)),n||o[s].push(t)}function Oa(r,e){var t=Ph(r,e),n=t.obj,i=t.k;if(n)return n[i]}function Od(r,e,t){var n=Oa(r,t);return n!==void 0?n:Oa(e,t)}function ky(r,e,t){for(var n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?typeof r[n]=="string"||r[n]instanceof String||typeof e[n]=="string"||e[n]instanceof String?t&&(r[n]=e[n]):ky(r[n],e[n],t):r[n]=e[n]);return r}function Wn(r){return r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var wM={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function vM(r){return typeof r=="string"?r.replace(/[&<>"'\/]/g,function(e){return wM[e]}):r}var ul=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,bM=[" ",",","?","!",";"];function SM(r,e,t){e=e||"",t=t||"";var n=bM.filter(function(a){return e.indexOf(a)<0&&t.indexOf(a)<0});if(n.length===0)return!0;var i=new RegExp("(".concat(n.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!i.test(r);if(!o){var s=r.indexOf(t);s>0&&!i.test(r.substring(0,s))&&(o=!0)}return o}function wd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ps(r){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function xy(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(r){if(r[e])return r[e];for(var n=e.split(t),i=r,o=0;oo+s;)s++,a=n.slice(o,o+s).join(t),l=i[a];if(l===void 0)return;if(l===null)return null;if(e.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var c=n.slice(o+s).join(t);return c?xy(l,c,t):void 0}i=i[n[o]]}return i}}var xM=function(r){cl(t,r);var e=MM(t);function t(n){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return cr(this,t),i=e.call(this),ul&&fn.call(cn(i)),i.data=n||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return ur(t,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,u=[i,o];s&&typeof s!="string"&&(u=u.concat(s)),s&&typeof s=="string"&&(u=u.concat(l?s.split(l):s)),i.indexOf(".")>-1&&(u=i.split("."));var h=Oa(this.data,u);return h||!c||typeof s!="string"?h:xy(this.data&&this.data[i]&&this.data[i][o],s,l)}},{key:"addResource",value:function(i,o,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=this.options.keySeparator;c===void 0&&(c=".");var u=[i,o];s&&(u=u.concat(c?s.split(c):s)),i.indexOf(".")>-1&&(u=i.split("."),a=o,o=u[1]),this.addNamespaces(o),yd(this.data,u,a),l.silent||this.emit("added",i,o,s,a)}},{key:"addResources",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(i,o,l,s[l],{silent:!0});a.silent||this.emit("added",i,o,s)}},{key:"addResourceBundle",value:function(i,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},u=[i,o];i.indexOf(".")>-1&&(u=i.split("."),a=s,s=o,o=u[1]),this.addNamespaces(o);var h=Oa(this.data,u)||{};a?ky(h,s,l):h=ps(ps({},h),s),yd(this.data,u,h),c.silent||this.emit("added",i,o,s)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?ps(ps({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),s=o&&Object.keys(o)||[];return!!s.find(function(a){return o[a]&&Object.keys(o[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),t}(fn),Cy={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,i,o){var s=this;return e.forEach(function(a){s.processors[a]&&(t=s.processors[a].process(t,n,i,o))}),t}};function vd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Mt(r){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var bd={},Sd=function(r){cl(t,r);var e=CM(t);function t(n){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return cr(this,t),i=e.call(this),ul&&fn.call(cn(i)),yM(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,cn(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=xr.create("translator"),i}return ur(t,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var s=this.resolve(i,o);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(i,o){var s=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],c=s&&i.indexOf(s)>-1,u=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!SM(i,s,a);if(c&&!u){var h=i.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:i,namespaces:l};var f=i.split(s);(s!==a||s===a&&this.options.ns.indexOf(f[0])>-1)&&(l=f.shift()),i=f.join(a)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,s){var a=this;if(or(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=this.extractFromKey(i[i.length-1],o),h=u.key,f=u.namespaces,d=f[f.length-1],w=o.lng||this.language,b=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(w&&w.toLowerCase()==="cimode"){if(b){var v=o.nsSeparator||this.options.nsSeparator;return l?(O.res="".concat(d).concat(v).concat(h),O):"".concat(d).concat(v).concat(h)}return l?(O.res=h,O):h}var O=this.resolve(i,o),M=O&&O.res,R=O&&O.usedKey||h,k=O&&O.exactUsedKey||h,x=Object.prototype.toString.apply(M),$=["[object Number]","[object Function]","[object RegExp]"],I=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,Z=typeof M!="string"&&typeof M!="boolean"&&typeof M!="number";if(L&&M&&Z&&$.indexOf(x)<0&&!(typeof I=="string"&&x==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(R,M,Mt(Mt({},o),{},{ns:f})):"key '".concat(h," (").concat(this.language,")' returned an object instead of string.");return l?(O.res=D,O):D}if(c){var ne=x==="[object Array]",te=ne?[]:{},se=ne?k:R;for(var ae in M)if(Object.prototype.hasOwnProperty.call(M,ae)){var P="".concat(se).concat(c).concat(ae);te[ae]=this.translate(P,Mt(Mt({},o),{joinArrays:!1,ns:f})),te[ae]===P&&(te[ae]=M[ae])}M=te}}else if(L&&typeof I=="string"&&x==="[object Array]")M=M.join(I),M&&(M=this.extendTranslation(M,i,o,s));else{var j=!1,T=!1,J=o.count!==void 0&&typeof o.count!="string",Y=t.hasDefaultValue(o),H=J?this.pluralResolver.getSuffix(w,o.count,o):"",re=o["defaultValue".concat(H)]||o.defaultValue;!this.isValidLookup(M)&&Y&&(j=!0,M=re),this.isValidLookup(M)||(T=!0,M=h);var le=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,ce=le&&T?void 0:M,de=Y&&re!==M&&this.options.updateMissing;if(T||j||de){if(this.logger.log(de?"updateKey":"missingKey",w,d,h,de?re:M),c){var Ae=this.resolve(h,Mt(Mt({},o),{},{keySeparator:!1}));Ae&&Ae.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var X=[],F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(var q=0;q1&&arguments[1]!==void 0?arguments[1]:{},a,l,c,u,h;return typeof i=="string"&&(i=[i]),i.forEach(function(f){if(!o.isValidLookup(a)){var d=o.extractFromKey(f,s),w=d.key;l=w;var b=d.namespaces;o.options.fallbackNS&&(b=b.concat(o.options.fallbackNS));var v=s.count!==void 0&&typeof s.count!="string",O=v&&!s.ordinal&&s.count===0&&o.pluralResolver.shouldUseIntlApi(),M=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",R=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);b.forEach(function(k){o.isValidLookup(a)||(h=k,!bd["".concat(R[0],"-").concat(k)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(h)&&(bd["".concat(R[0],"-").concat(k)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(R.join(", "),`" won't get resolved as namespace "`).concat(h,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),R.forEach(function(x){if(!o.isValidLookup(a)){u=x;var $=[w];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys($,w,x,k,s);else{var I;v&&(I=o.pluralResolver.getSuffix(x,s.count,s));var L="".concat(o.options.pluralSeparator,"zero");if(v&&($.push(w+I),O&&$.push(w+L)),M){var Z="".concat(w).concat(o.options.contextSeparator).concat(s.context);$.push(Z),v&&($.push(Z+I),O&&$.push(Z+L))}}for(var D;D=$.pop();)o.isValidLookup(a)||(c=D,a=o.getResource(x,k,D,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:c,usedLng:u,usedNS:h}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,s,a):this.resourceStore.getResource(i,o,s,a)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&o===s.substring(0,o.length)&&i[s]!==void 0)return!0;return!1}}]),t}(fn);function Yl(r){return r.charAt(0).toUpperCase()+r.slice(1)}var EM=function(){function r(e){cr(this,r),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=xr.create("languageUtils")}return ur(r,[{key:"getScriptPartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return null;var n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||t.indexOf("-")<0)return t;var n=t.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(t){if(typeof t=="string"&&t.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],i=t.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=Yl(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=Yl(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=Yl(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var n=this;if(!t)return null;var i;return t.forEach(function(o){if(!i){var s=n.formatLanguageCode(o);(!n.options.supportedLngs||n.isSupportedCode(s))&&(i=s)}}),!i&&this.options.supportedLngs&&t.forEach(function(o){if(!i){var s=n.getLanguagePartFromCode(o);if(n.isSupportedCode(s))return i=s;i=n.options.supportedLngs.find(function(a){if(a.indexOf(s)===0)return a})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!n)return t.default||[];var i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}},{key:"toResolveHierarchy",value:function(t,n){var i=this,o=this.getFallbackCodes(n||this.options.fallbackLng||[],t),s=[],a=function(c){c&&(i.isSupportedCode(c)?s.push(c):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof t=="string"&&t.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(t))):typeof t=="string"&&a(this.formatLanguageCode(t)),o.forEach(function(l){s.indexOf(l)<0&&a(i.formatLanguageCode(l))}),s}}]),r}(),QM=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],AM={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}},UM=["v1","v2","v3"],Md={zero:0,one:1,two:2,few:3,many:4,other:5};function RM(){var r={};return QM.forEach(function(e){e.lngs.forEach(function(t){r[t]={numbers:e.nr,plurals:AM[e.fc]}})}),r}var $M=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};cr(this,r),this.languageUtils=e,this.options=t,this.logger=xr.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=RM()}return ur(r,[{key:"addRule",value:function(t,n){this.rules[t]=n}},{key:"getRule",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(t,{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(t,n);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,i).map(function(o){return"".concat(n).concat(o)})}},{key:"getSuffixes",value:function(t){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(t,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(s,a){return Md[s]-Md[a]}).map(function(s){return"".concat(n.options.prepend).concat(s)}):o.numbers.map(function(s){return n.getSuffix(t,s,i)}):[]}},{key:"getSuffix",value:function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(t,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(n)):this.getSuffixRetroCompatible(o,n):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,n){var i=this,o=t.noAbs?t.plurals(n):t.plurals(Math.abs(n)),s=t.numbers[o];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return i.options.prepend&&s.toString()?i.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!UM.includes(this.options.compatibilityJSON)}}]),r}();function kd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Kt(r){for(var e=1;e0&&arguments[0]!==void 0?arguments[0]:{};cr(this,r),this.logger=xr.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(t){return t},this.init(e)}return ur(r,[{key:"init",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var n=t.interpolation;this.escape=n.escape!==void 0?n.escape:vM,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?Wn(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?Wn(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?Wn(n.nestingPrefix):n.nestingPrefixEscaped||Wn("$t("),this.nestingSuffix=n.nestingSuffix?Wn(n.nestingSuffix):n.nestingSuffixEscaped||Wn(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(t,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(n,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(t,n,i,o){var s=this,a,l,c,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function h(v){return v.replace(/\$/g,"$$$$")}var f=function(O){if(O.indexOf(s.formatSeparator)<0){var M=Od(n,u,O);return s.alwaysFormat?s.format(M,void 0,i,Kt(Kt(Kt({},o),n),{},{interpolationkey:O})):M}var R=O.split(s.formatSeparator),k=R.shift().trim(),x=R.join(s.formatSeparator).trim();return s.format(Od(n,u,k),x,i,Kt(Kt(Kt({},o),n),{},{interpolationkey:k}))};this.resetRegExp();var d=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,w=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,b=[{regex:this.regexpUnescape,safeValue:function(O){return h(O)}},{regex:this.regexp,safeValue:function(O){return s.escapeValue?h(s.escape(O)):h(O)}}];return b.forEach(function(v){for(c=0;a=v.regex.exec(t);){var O=a[1].trim();if(l=f(O),l===void 0)if(typeof d=="function"){var M=d(t,a,o);l=typeof M=="string"?M:""}else if(o&&o.hasOwnProperty(O))l="";else if(w){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(O," for interpolating ").concat(t)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=md(l));var R=v.safeValue(l);if(t=t.replace(a[0],R),w?(v.regex.lastIndex+=l.length,v.regex.lastIndex-=a[0].length):v.regex.lastIndex=0,c++,c>=s.maxReplaces)break}}),t}},{key:"nest",value:function(t,n){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l=Kt({},o);l.applyPostProcessor=!1,delete l.defaultValue;function c(d,w){var b=this.nestingOptionsSeparator;if(d.indexOf(b)<0)return d;var v=d.split(new RegExp("".concat(b,"[ ]*{"))),O="{".concat(v[1]);d=v[0],O=this.interpolate(O,l);var M=O.match(/'/g),R=O.match(/"/g);(M&&M.length%2===0&&!R||R.length%2!==0)&&(O=O.replace(/'/g,'"'));try{l=JSON.parse(O),w&&(l=Kt(Kt({},w),l))}catch(k){return this.logger.warn("failed parsing options string in nesting for key ".concat(d),k),"".concat(d).concat(b).concat(O)}return delete l.defaultValue,d}for(;s=this.nestingRegexp.exec(t);){var u=[],h=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var f=s[1].split(this.formatSeparator).map(function(d){return d.trim()});s[1]=f.shift(),u=f,h=!0}if(a=n(c.call(this,s[1].trim(),l),l),a&&s[0]===t&&typeof a!="string")return a;typeof a!="string"&&(a=md(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(t)),a=""),h&&(a=u.reduce(function(d,w){return i.format(d,w,o.lng,Kt(Kt({},o),{},{interpolationkey:s[1].trim()}))},a.trim())),t=t.replace(s[0],a),this.regexp.lastIndex=0}return t}}]),r}();function xd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function zr(r){for(var e=1;e-1){var n=r.split("(");e=n[0].toLowerCase().trim();var i=n[1].substring(0,n[1].length-1);if(e==="currency"&&i.indexOf(":")<0)t.currency||(t.currency=i.trim());else if(e==="relativetime"&&i.indexOf(":")<0)t.range||(t.range=i.trim());else{var o=i.split(";");o.forEach(function(s){if(s){var a=s.split(":"),l=pM(a),c=l[0],u=l.slice(1),h=u.join(":").trim().replace(/^'+|'+$/g,"");t[c.trim()]||(t[c.trim()]=h),h==="false"&&(t[c.trim()]=!1),h==="true"&&(t[c.trim()]=!0),isNaN(h)||(t[c.trim()]=parseInt(h,10))}})}}return{formatName:e,formatOptions:t}}function zn(r){var e={};return function(n,i,o){var s=i+JSON.stringify(o),a=e[s];return a||(a=r(i,o),e[s]=a),a(n)}}var PM=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};cr(this,r),this.logger=xr.create("formatter"),this.options=e,this.formats={number:zn(function(t,n){var i=new Intl.NumberFormat(t,n);return function(o){return i.format(o)}}),currency:zn(function(t,n){var i=new Intl.NumberFormat(t,zr(zr({},n),{},{style:"currency"}));return function(o){return i.format(o)}}),datetime:zn(function(t,n){var i=new Intl.DateTimeFormat(t,zr({},n));return function(o){return i.format(o)}}),relativetime:zn(function(t,n){var i=new Intl.RelativeTimeFormat(t,zr({},n));return function(o){return i.format(o,n.range||"day")}}),list:zn(function(t,n){var i=new Intl.ListFormat(t,zr({},n));return function(o){return i.format(o)}})},this.init(e)}return ur(r,[{key:"init",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=n.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(t,n){this.formats[t.toLowerCase().trim()]=n}},{key:"addCached",value:function(t,n){this.formats[t.toLowerCase().trim()]=zn(n)}},{key:"format",value:function(t,n,i,o){var s=this,a=n.split(this.formatSeparator),l=a.reduce(function(c,u){var h=JM(u),f=h.formatName,d=h.formatOptions;if(s.formats[f]){var w=c;try{var b=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},v=b.locale||b.lng||o.locale||o.lng||i;w=s.formats[f](c,v,zr(zr(zr({},d),o),b))}catch(O){s.logger.warn(O)}return w}else s.logger.warn("there was no format function for ".concat(f));return c},t);return l}}]),r}();function Cd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Td(r){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function jM(r,e){r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)}var LM=function(r){cl(t,r);var e=IM(t);function t(n,i,o){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return cr(this,t),s=e.call(this),ul&&fn.call(cn(s)),s.backend=n,s.store=i,s.services=o,s.languageUtils=o.languageUtils,s.options=a,s.logger=xr.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(o,a.backend,a),s}return ur(t,[{key:"queueLoad",value:function(i,o,s,a){var l=this,c={},u={},h={},f={};return i.forEach(function(d){var w=!0;o.forEach(function(b){var v="".concat(d,"|").concat(b);!s.reload&&l.store.hasResourceBundle(d,b)?l.state[v]=2:l.state[v]<0||(l.state[v]===1?u[v]===void 0&&(u[v]=!0):(l.state[v]=1,w=!1,u[v]===void 0&&(u[v]=!0),c[v]===void 0&&(c[v]=!0),f[b]===void 0&&(f[b]=!0)))}),w||(h[d]=!0)}),(Object.keys(c).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(c),pending:Object.keys(u),toLoadLanguages:Object.keys(h),toLoadNamespaces:Object.keys(f)}}},{key:"loaded",value:function(i,o,s){var a=i.split("|"),l=a[0],c=a[1];o&&this.emit("failedLoading",l,c,o),s&&this.store.addResourceBundle(l,c,s),this.state[i]=o?-1:2;var u={};this.queue.forEach(function(h){OM(h.loaded,[l],c),jM(h,i),o&&h.errors.push(o),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(function(f){u[f]||(u[f]={});var d=h.loaded[f];d.length&&d.forEach(function(w){u[f][w]===void 0&&(u[f][w]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(function(h){return!h.done})}},{key:"read",value:function(i,o,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,u=arguments.length>5?arguments[5]:void 0;if(!i.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:s,tried:l,wait:c,callback:u});return}return this.readingCalls++,this.backend[s](i,o,function(h,f){if(a.readingCalls--,a.waitingReads.length>0){var d=a.waitingReads.shift();a.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(h&&f&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var c=this.queueLoad(i,o,a,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(function(u){s.loadOne(u)})}},{key:"load",value:function(i,o,s){this.prepareLoading(i,o,{},s)}},{key:"reload",value:function(i,o,s){this.prepareLoading(i,o,{reload:!0},s)}},{key:"loadOne",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=i.split("|"),l=a[0],c=a[1];this.read(l,c,"read",void 0,void 0,function(u,h){u&&o.logger.warn("".concat(s,"loading namespace ").concat(c," for language ").concat(l," failed"),u),!u&&h&&o.logger.log("".concat(s,"loaded namespace ").concat(c," for language ").concat(l),h),o.loaded(i,u,h)})}},{key:"saveMissing",value:function(i,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}s==null||s===""||(this.backend&&this.backend.create&&this.backend.create(i,o,s,a,null,Td(Td({},c),{},{isUpdate:l})),!(!i||!i[0])&&this.store.addResource(i[0],o,s,a))}}]),t}(fn);function DM(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if(or(e[1])==="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),or(e[2])==="object"||or(e[3])==="object"){var n=e[3]||e[2];Object.keys(n).forEach(function(i){t[i]=n[i]})}return t},interpolation:{escapeValue:!0,format:function(e,t,n,i){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Ed(r){return typeof r.ns=="string"&&(r.ns=[r.ns]),typeof r.fallbackLng=="string"&&(r.fallbackLng=[r.fallbackLng]),typeof r.fallbackNS=="string"&&(r.fallbackNS=[r.fallbackNS]),r.supportedLngs&&r.supportedLngs.indexOf("cimode")<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),r}function Qd(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function dr(r){for(var e=1;e"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function gs(){}function FM(r){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(r));e.forEach(function(t){typeof r[t]=="function"&&(r[t]=r[t].bind(r))})}var wa=function(r){cl(t,r);var e=ZM(t);function t(){var n,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(cr(this,t),n=e.call(this),ul&&fn.call(cn(n)),n.options=Ed(i),n.services={},n.logger=xr,n.modules={external:[]},FM(cn(n)),o&&!n.isInitialized&&!i.isClone){if(!n.options.initImmediate)return n.init(i,o),ts(n,cn(n));setTimeout(function(){n.init(i,o)},0)}return n}return ur(t,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.defaultNS!==!1&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=DM();this.options=dr(dr(dr({},a),this.options),Ed(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=dr(dr({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(O){return O?typeof O=="function"?new O:O:null}if(!this.options.isClone){this.modules.logger?xr.init(l(this.modules.logger),this.options):xr.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=PM);var u=new EM(this.options);this.store=new xM(this.options.resources,this.options);var h=this.services;h.logger=xr,h.resourceStore=this.store,h.languageUtils=u,h.pluralResolver=new $M(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(h.formatter=l(c),h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new _M(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new LM(l(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",function(O){for(var M=arguments.length,R=new Array(M>1?M-1:0),k=1;k1?M-1:0),k=1;k0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var d=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];d.forEach(function(O){i[O]=function(){var M;return(M=i.store)[O].apply(M,arguments)}});var w=["addResource","addResources","addResourceBundle","removeResourceBundle"];w.forEach(function(O){i[O]=function(){var M;return(M=i.store)[O].apply(M,arguments),i}});var b=zi(),v=function(){var M=function(k,x){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),b.resolve(x),s(k,x)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return M(null,i.t.bind(i));i.changeLanguage(i.options.lng,M)};return this.options.resources||!this.options.initImmediate?v():setTimeout(v,0),b}},{key:"loadResources",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:gs,a=s,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(a=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var c=[],u=function(d){if(d){var w=o.services.languageUtils.toResolveHierarchy(d);w.forEach(function(b){c.indexOf(b)<0&&c.push(b)})}};if(l)u(l);else{var h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.forEach(function(f){return u(f)})}this.options.preload&&this.options.preload.forEach(function(f){return u(f)}),this.services.backendConnector.load(c,this.options.ns,function(f){!f&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(f)})}else a(null)}},{key:"reloadResources",value:function(i,o,s){var a=zi();return i||(i=this.languages),o||(o=this.options.ns),s||(s=gs),this.services.backendConnector.reload(i,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&Cy.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,o){var s=this;this.isLanguageChangingTo=i;var a=zi();this.emit("languageChanging",i);var l=function(f){s.language=f,s.languages=s.services.languageUtils.toResolveHierarchy(f),s.resolvedLanguage=void 0,s.setResolvedLanguage(f)},c=function(f,d){d?(l(d),s.translator.changeLanguage(d),s.isLanguageChangingTo=void 0,s.emit("languageChanged",d),s.logger.log("languageChanged",d)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(f,function(){return s.t.apply(s,arguments)})},u=function(f){!i&&!f&&s.services.languageDetector&&(f=[]);var d=typeof f=="string"?f:s.services.languageUtils.getBestMatchFromCodes(f);d&&(s.language||l(d),s.translator.language||s.translator.changeLanguage(d),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage(d)),s.loadResources(d,function(w){c(w,d)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(u):u(i),a}},{key:"getFixedT",value:function(i,o,s){var a=this,l=function c(u,h){var f;if(or(h)!=="object"){for(var d=arguments.length,w=new Array(d>2?d-2:0),b=2;b1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var u=function(d,w){var b=o.services.backendConnector.state["".concat(d,"|").concat(w)];return b===-1||b===2};if(s.precheck){var h=s.precheck(this,u);if(h!==void 0)return h}return!!(this.hasResourceBundle(a,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(a,i)&&(!l||u(c,i)))}},{key:"loadNamespaces",value:function(i,o){var s=this,a=zi();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var s=zi();typeof i=="string"&&(i=[i]);var a=this.options.preload||[],l=i.filter(function(c){return a.indexOf(c)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(c){s.resolve(),o&&o(c)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:gs,a=dr(dr(dr({},this.options),o),{isClone:!0}),l=new t(a);(o.debug!==void 0||o.prefix!==void 0)&&(l.logger=l.logger.clone(o));var c=["store","services","language"];return c.forEach(function(u){l[u]=i[u]}),l.services=dr({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new Sd(l.services,l.options),l.translator.on("*",function(u){for(var h=arguments.length,f=new Array(h>1?h-1:0),d=1;d0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new wa(r,e)});var Ye=wa.createInstance();Ye.createInstance=wa.createInstance;Ye.createInstance;Ye.init;Ye.loadResources;Ye.reloadResources;Ye.use;Ye.changeLanguage;Ye.getFixedT;Ye.t;Ye.exists;Ye.setDefaultNamespace;Ye.hasLoadedNamespace;Ye.loadNamespaces;Ye.loadLanguages;var Ty=[],XM=Ty.forEach,YM=Ty.slice;function GM(r){return XM.call(YM.call(arguments,1),function(e){if(e)for(var t in e)r[t]===void 0&&(r[t]=e[t])}),r}var Ad=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,WM=function(e,t,n){var i=n||{};i.path=i.path||"/";var o=encodeURIComponent(t),s="".concat(e,"=").concat(o);if(i.maxAge>0){var a=i.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");s+="; Max-Age=".concat(Math.floor(a))}if(i.domain){if(!Ad.test(i.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(i.domain)}if(i.path){if(!Ad.test(i.path))throw new TypeError("option path is invalid");s+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(s+="; HttpOnly"),i.secure&&(s+="; Secure"),i.sameSite){var l=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(l){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s},Ud={create:function(e,t,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),i&&(o.domain=i),document.cookie=WM(e,encodeURIComponent(t),o)},read:function(e){for(var t="".concat(e,"="),n=document.cookie.split(";"),i=0;i-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=n.substring(1),o=i.split("&"),s=0;s0){var l=o[s].substring(0,a);l===e.lookupQuerystring&&(t=o[s].substring(a+1))}}}return t}},Vi=null,Rd=function(){if(Vi!==null)return Vi;try{Vi=window!=="undefined"&&window.localStorage!==null;var e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Vi=!1}return Vi},KM={name:"localStorage",lookup:function(e){var t;if(e.lookupLocalStorage&&Rd()){var n=window.localStorage.getItem(e.lookupLocalStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&Rd()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},Ki=null,$d=function(){if(Ki!==null)return Ki;try{Ki=window!=="undefined"&&window.sessionStorage!==null;var e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Ki=!1}return Ki},qM={name:"sessionStorage",lookup:function(e){var t;if(e.lookupSessionStorage&&$d()){var n=window.sessionStorage.getItem(e.lookupSessionStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&$d()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},HM={name:"navigator",lookup:function(e){var t=[];if(typeof navigator<"u"){if(navigator.languages)for(var n=0;n0?t:void 0}},ek={name:"htmlTag",lookup:function(e){var t,n=e.htmlTag||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(t=n.getAttribute("lang")),t}},tk={name:"path",lookup:function(e){var t;if(typeof window<"u"){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if(typeof e.lookupFromPathIndex=="number"){if(typeof n[e.lookupFromPathIndex]!="string")return;t=n[e.lookupFromPathIndex].replace("/","")}else t=n[0].replace("/","")}return t}},rk={name:"subdomain",lookup:function(e){var t=typeof e.lookupFromSubdomainIndex=="number"?e.lookupFromSubdomainIndex+1:1,n=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};function nk(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Ey=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};cr(this,r),this.type="languageDetector",this.detectors={},this.init(e,t)}return ur(r,[{key:"init",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=GM(n,this.options||{},nk()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(zM),this.addDetector(VM),this.addDetector(KM),this.addDetector(qM),this.addDetector(HM),this.addDetector(ek),this.addDetector(tk),this.addDetector(rk)}},{key:"addDetector",value:function(t){this.detectors[t.name]=t}},{key:"detect",value:function(t){var n=this;t||(t=this.options.order);var i=[];return t.forEach(function(o){if(n.detectors[o]){var s=n.detectors[o].lookup(n.options);s&&typeof s=="string"&&(s=[s]),s&&(i=i.concat(s))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(t,n){var i=this;n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(function(o){i.detectors[o]&&i.detectors[o].cacheUserLanguage(t,i.options)}))}}]),r}();Ey.type="languageDetector";const Qy={en:{translation:{"language-name":"english",toolbar:{run:"Run all code (ctrl+shift+enter)",upload:"upload to gallery",clear:"clear all",shuffle:"show random sketch",random:"make random change","load-extension":"load library or extension","show-info":"show info window","hide-info":"hide info window"},info:{title:"hydra",subtitle:"live coding video synth",description:"Hydra is live code-able video synth and coding environment that runs directly in the browser. It is free and open-source and made for beginners and experts alike.","get-started-title":"To get started:","get-started-list":["Close this window","Change some numbers","Type Ctrl + Shift + Enter"],"description-detailed":"Hydra is written in JavaScript and compiles to WebGL under the hood. The syntax is inspired by analog modular synthesis, in which chaining or patching a set of transformations together generates a visual result.",uses:"Hydra can be used:","uses-list":["to mix and add effects to camera feeds, screenshares, live streams, and videos","to create generative and audio-reactive visuals, and share them online with others","in combination with other javascript libraries such as P5.js, Tone.js, THREE.js, or gibber","to add interactive video effects to a website","to experiment with and learn about video feedback, fractals, and pixel operations","to stream video between browsers and live-jam with others online"],author:"Created by olivia.","more-info":"For more information and instructions, see: the interactive documentation, a list of hydra functions, the community database of projects and tutorials, a gallery of user-generated sketches, and the source code on github,","more-info-forums":"There is also an active Discord server and facebook group for hydra users+contributors.",support:"If you enjoy using Hydra, please consider supporting continued development <3 ."},extensions:{"about-extensions":"Load community extensions to hydra-synth."}}}},ik=["ja","es","ar","id","pt-br","ch"],ok=r=>`https://raw.githubusercontent.com/hydra-synth/l10n/main/${r}/editor.json`;Ye.use(Ey).init({debug:!0,fallbackLng:"en",partialBundledLanguages:!0,resources:Qy});function sk(r,e){const t={};let n=new URLSearchParams(window.location.search),i=n.get("l10n-lang"),o=n.get("l10n-url");ik.forEach(l=>{a(l,ok(l))}),i!==null&&o!==null&&a(i,o),s(),e.on("set language",l=>{Ye.changeLanguage(l,(c,u)=>{r.translation.selectedLanguage=l,e.emit("render")})});function s(){Object.keys(Qy).forEach(l=>{const c=l.split("-")[0];t[c]=Ye.getFixedT(c)("language-name")}),r.translation={t:Ye.t,languages:t,selectedLanguage:Ye.language,textDirection:Ye.language==="ar"?"rtl":"ltr"}}function a(l="es",c){const u="color: purple; background: orange; font-size: 14px;padding:10px";console.log(`%cloading translation for ${l} from ${c}`,u),fetch(c).then(h=>h.ok?h.json():h.text().then(f=>{throw new Error(f)})).then(h=>{window.i18n=Ye,console.log("adding language",l,h);const f=l.split("-")[0];Ye.addResourceBundle(f,"translation",h),s(),e.emit("render")})}}const ak="https://raw.githubusercontent.com/hydra-synth/hydra-extensions/main/";async function lk(r,e){r.extensions={baseURL:ak,selectedCategoryIndex:0,categories:[{name:"extensions",slug:"extensions",entries:[],hasLoaded:!1},{name:"external libraries",slug:"external-libraries",entries:[],hasLoaded:!1},{name:"examples",slug:"examples",entries:[],hasLoaded:!1}]},e.on("extensions: select category",(t=r.extensions.selectedCategoryIndex)=>{r.extensions.selectedCategoryIndex=t,e.emit("render");const n=r.extensions.categories[t];if(!n.hasLoaded){const i=r.extensions.baseURL+n.slug+".json?laskd";fetch(i).then(o=>o.json()).then(o=>{console.log("loaded d",o),o.forEach(s=>{s.thumbnail=r.extensions.baseURL+"thumbnails/"+s.thumbnail}),n.entries=o,e.emit("render")})}}),e.on("extensions: add to editor",t=>{const{categories:n,selectedCategoryIndex:i}=r.extensions,o=n[i].entries[t].load;e.emit("editor: add code to top",o)}),e.on("extensions: load example",(t,n)=>{const{categories:i,selectedCategoryIndex:o}=r.extensions,s=i[o].entries[t].examples[n],a=new URL(s);console.log(a),r.gallery.setSketchFromURL(a.search,l=>{e.emit("load and eval code",l)})})}function ck(r,e){e.on("editor: randomize",function(t){const n=r.editor.editor;t.shiftKey?n.mutator.doUndo():(n.mutator.mutate({reroll:!1,changeTransform:t.metaKey}),n.formatCode(),e.emit("gallery: save locally",n.getValue()))}),e.on("editor: add code to top",t=>{r.editor.editor.addCodeToTop(t)}),e.on("editor: load code",t=>{r.editor.editor.setValue(t)})}var au={exports:{}},Ay={exports:{}};(function(r){r.exports=e;function e(n){if(n)return t(n)}function t(n){for(var i in e.prototype)n[i]=e.prototype[i];return n}e.prototype.on=e.prototype.addEventListener=function(n,i){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(i),this},e.prototype.once=function(n,i){function o(){this.off(n,o),i.apply(this,arguments)}return o.fn=i,this.on(n,o),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(n,i){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var o=this._callbacks["$"+n];if(!o)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,a=0;a"u"||!at?be:at(Uint8Array),Rn={"%AggregateError%":typeof AggregateError>"u"?be:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?be:ArrayBuffer,"%ArrayIteratorPrototype%":Vn&&at?at([][Symbol.iterator]()):be,"%AsyncFromSyncIteratorPrototype%":be,"%AsyncFunction%":ni,"%AsyncGenerator%":ni,"%AsyncGeneratorFunction%":ni,"%AsyncIteratorPrototype%":ni,"%Atomics%":typeof Atomics>"u"?be:Atomics,"%BigInt%":typeof BigInt>"u"?be:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?be:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?be:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?be:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?be:Float32Array,"%Float64Array%":typeof Float64Array>"u"?be:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?be:FinalizationRegistry,"%Function%":Uy,"%GeneratorFunction%":ni,"%Int8Array%":typeof Int8Array>"u"?be:Int8Array,"%Int16Array%":typeof Int16Array>"u"?be:Int16Array,"%Int32Array%":typeof Int32Array>"u"?be:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Vn&&at?at(at([][Symbol.iterator]())):be,"%JSON%":typeof JSON=="object"?JSON:be,"%Map%":typeof Map>"u"?be:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Vn||!at?be:at(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?be:Promise,"%Proxy%":typeof Proxy>"u"?be:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?be:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?be:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Vn||!at?be:at(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?be:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Vn&&at?at(""[Symbol.iterator]()):be,"%Symbol%":Vn?Symbol:be,"%SyntaxError%":Ci,"%ThrowTypeError%":Sk,"%TypedArray%":kk,"%TypeError%":di,"%Uint8Array%":typeof Uint8Array>"u"?be:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?be:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?be:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?be:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?be:WeakMap,"%WeakRef%":typeof WeakRef>"u"?be:WeakRef,"%WeakSet%":typeof WeakSet>"u"?be:WeakSet};if(at)try{null.error}catch(r){var xk=at(at(r));Rn["%Error.prototype%"]=xk}var Ck=function r(e){var t;if(e==="%AsyncFunction%")t=Wl("async function () {}");else if(e==="%GeneratorFunction%")t=Wl("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Wl("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&at&&(t=at(i.prototype))}return Rn[e]=t,t},Pd={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},rs=Ih,va=bk,Tk=rs.call(Function.call,Array.prototype.concat),Ek=rs.call(Function.apply,Array.prototype.splice),Id=rs.call(Function.call,String.prototype.replace),ba=rs.call(Function.call,String.prototype.slice),Qk=rs.call(Function.call,RegExp.prototype.exec),Ak=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Uk=/\\(\\)?/g,Rk=function(e){var t=ba(e,0,1),n=ba(e,-1);if(t==="%"&&n!=="%")throw new Ci("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Ci("invalid intrinsic syntax, expected opening `%`");var i=[];return Id(e,Ak,function(o,s,a,l){i[i.length]=a?Id(l,Uk,"$1"):s||o}),i},$k=function(e,t){var n=e,i;if(va(Pd,n)&&(i=Pd[n],n="%"+i[0]+"%"),va(Rn,n)){var o=Rn[n];if(o===ni&&(o=Ck(n)),typeof o>"u"&&!t)throw new di("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new Ci("intrinsic "+e+" does not exist!")},Bh=function(e,t){if(typeof e!="string"||e.length===0)throw new di("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new di('"allowMissing" argument must be a boolean');if(Qk(/^%?[^%]*%?$/,e)===null)throw new Ci("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Rk(e),i=n.length>0?n[0]:"",o=$k("%"+i+"%",t),s=o.name,a=o.value,l=!1,c=o.alias;c&&(i=c[0],Ek(n,Tk([0,1],c)));for(var u=1,h=!0;u=n.length){var b=Un(a,f);h=!!b,h&&"get"in b&&!("originalValue"in b.get)?a=b.get:a=a[f]}else h=va(a,f),a=a[f];h&&!l&&(Rn[s]=a)}}return a},Ry={exports:{}};(function(r){var e=Ih,t=Bh,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),o=t("%Reflect.apply%",!0)||e.call(i,n),s=t("%Object.getOwnPropertyDescriptor%",!0),a=t("%Object.defineProperty%",!0),l=t("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}r.exports=function(h){var f=o(e,i,arguments);if(s&&a){var d=s(f,"length");d.configurable&&a(f,"length",{value:1+l(0,h.length-(arguments.length-1))})}return f};var c=function(){return o(e,n,arguments)};a?a(r.exports,"apply",{value:c}):r.exports.apply=c})(Ry);var _k=Ry.exports,$y=Bh,_y=_k,Jk=_y($y("String.prototype.indexOf")),Pk=function(e,t){var n=$y(e,!!t);return typeof n=="function"&&Jk(e,".prototype.")>-1?_y(n):n};const Ik={},Bk=Object.freeze(Object.defineProperty({__proto__:null,default:Ik},Symbol.toStringTag,{value:"Module"})),Bi=Fm(Bk);var jh=typeof Map=="function"&&Map.prototype,Vl=Object.getOwnPropertyDescriptor&&jh?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Sa=jh&&Vl&&typeof Vl.get=="function"?Vl.get:null,Bd=jh&&Map.prototype.forEach,Lh=typeof Set=="function"&&Set.prototype,Kl=Object.getOwnPropertyDescriptor&&Lh?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ma=Lh&&Kl&&typeof Kl.get=="function"?Kl.get:null,jd=Lh&&Set.prototype.forEach,jk=typeof WeakMap=="function"&&WeakMap.prototype,vo=jk?WeakMap.prototype.has:null,Lk=typeof WeakSet=="function"&&WeakSet.prototype,bo=Lk?WeakSet.prototype.has:null,Dk=typeof WeakRef=="function"&&WeakRef.prototype,Ld=Dk?WeakRef.prototype.deref:null,Zk=Boolean.prototype.valueOf,Nk=Object.prototype.toString,Fk=Function.prototype.toString,Xk=String.prototype.match,Dh=String.prototype.slice,nn=String.prototype.replace,Yk=String.prototype.toUpperCase,Dd=String.prototype.toLowerCase,Jy=RegExp.prototype.test,Zd=Array.prototype.concat,vr=Array.prototype.join,Gk=Array.prototype.slice,Nd=Math.floor,lu=typeof BigInt=="function"?BigInt.prototype.valueOf:null,ql=Object.getOwnPropertySymbols,cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ti=typeof Symbol=="function"&&typeof Symbol.iterator=="object",bt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ti||"symbol")?Symbol.toStringTag:null,Py=Object.prototype.propertyIsEnumerable,Fd=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Xd(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Jy.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-Nd(-r):Nd(r);if(n!==r){var i=String(n),o=Dh.call(e,i.length+1);return nn.call(i,t,"$&_")+"."+nn.call(nn.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return nn.call(e,t,"$&_")}var uu=Bi,Yd=uu.custom,Gd=By(Yd)?Yd:null,Wk=function r(e,t,n,i){var o=t||{};if(Kr(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Kr(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=Kr(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Kr(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Kr(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Ly(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?Xd(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return a?Xd(e,c):c}var u=typeof o.depth>"u"?5:o.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof e=="object")return hu(e)?"[Array]":"[Object]";var h=fx(o,n);if(typeof i>"u")i=[];else if(jy(i,e)>=0)return"[Circular]";function f(se,ae,P){if(ae&&(i=Gk.call(i),i.push(ae)),P){var j={depth:o.depth};return Kr(o,"quoteStyle")&&(j.quoteStyle=o.quoteStyle),r(se,j,n+1,i)}return r(se,o,n+1,i)}if(typeof e=="function"&&!Wd(e)){var d=nx(e),w=ms(e,f);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(w.length>0?" { "+vr.call(w,", ")+" }":"")}if(By(e)){var b=Ti?nn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):cu.call(e);return typeof e=="object"&&!Ti?qi(b):b}if(cx(e)){for(var v="<"+Dd.call(String(e.nodeName)),O=e.attributes||[],M=0;M",v}if(hu(e)){if(e.length===0)return"[]";var R=ms(e,f);return h&&!hx(R)?"["+fu(R,h)+"]":"[ "+vr.call(R,", ")+" ]"}if(Kk(e)){var k=ms(e,f);return!("cause"in Error.prototype)&&"cause"in e&&!Py.call(e,"cause")?"{ ["+String(e)+"] "+vr.call(Zd.call("[cause]: "+f(e.cause),k),", ")+" }":k.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+vr.call(k,", ")+" }"}if(typeof e=="object"&&s){if(Gd&&typeof e[Gd]=="function"&&uu)return uu(e,{depth:u-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(ix(e)){var x=[];return Bd&&Bd.call(e,function(se,ae){x.push(f(ae,e,!0)+" => "+f(se,e))}),zd("Map",Sa.call(e),x,h)}if(ax(e)){var $=[];return jd&&jd.call(e,function(se){$.push(f(se,e))}),zd("Set",Ma.call(e),$,h)}if(ox(e))return Hl("WeakMap");if(lx(e))return Hl("WeakSet");if(sx(e))return Hl("WeakRef");if(Hk(e))return qi(f(Number(e)));if(tx(e))return qi(f(lu.call(e)));if(ex(e))return qi(Zk.call(e));if(qk(e))return qi(f(String(e)));if(!Vk(e)&&!Wd(e)){var I=ms(e,f),L=Fd?Fd(e)===Object.prototype:e instanceof Object||e.constructor===Object,Z=e instanceof Object?"":"null prototype",D=!L&&bt&&Object(e)===e&&bt in e?Dh.call(On(e),8,-1):Z?"Object":"",ne=L||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",te=ne+(D||Z?"["+vr.call(Zd.call([],D||[],Z||[]),": ")+"] ":"");return I.length===0?te+"{}":h?te+"{"+fu(I,h)+"}":te+"{ "+vr.call(I,", ")+" }"}return String(e)};function Iy(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function zk(r){return nn.call(String(r),/"/g,""")}function hu(r){return On(r)==="[object Array]"&&(!bt||!(typeof r=="object"&&bt in r))}function Vk(r){return On(r)==="[object Date]"&&(!bt||!(typeof r=="object"&&bt in r))}function Wd(r){return On(r)==="[object RegExp]"&&(!bt||!(typeof r=="object"&&bt in r))}function Kk(r){return On(r)==="[object Error]"&&(!bt||!(typeof r=="object"&&bt in r))}function qk(r){return On(r)==="[object String]"&&(!bt||!(typeof r=="object"&&bt in r))}function Hk(r){return On(r)==="[object Number]"&&(!bt||!(typeof r=="object"&&bt in r))}function ex(r){return On(r)==="[object Boolean]"&&(!bt||!(typeof r=="object"&&bt in r))}function By(r){if(Ti)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!cu)return!1;try{return cu.call(r),!0}catch{}return!1}function tx(r){if(!r||typeof r!="object"||!lu)return!1;try{return lu.call(r),!0}catch{}return!1}var rx=Object.prototype.hasOwnProperty||function(r){return r in this};function Kr(r,e){return rx.call(r,e)}function On(r){return Nk.call(r)}function nx(r){if(r.name)return r.name;var e=Xk.call(Fk.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function jy(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;te.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Ly(Dh.call(r,0,e.maxStringLength),e)+n}var i=nn.call(nn.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,ux);return Iy(i,"single",e)}function ux(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+Yk.call(e.toString(16))}function qi(r){return"Object("+r+")"}function Hl(r){return r+" { ? }"}function zd(r,e,t,n){var i=n?fu(t,n):vr.call(t,", ");return r+" ("+e+") {"+i+"}"}function hx(r){for(var e=0;e=0)return!1;return!0}function fx(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=vr.call(Array(r.indent+1)," ");else return null;return{base:t,prev:vr.call(Array(e+1),t)}}function fu(r,e){if(r.length===0)return"";var t=` +`+e.prev+e.base;return t+vr.call(r,","+t)+` +`+e.prev}function ms(r,e){var t=hu(r),n=[];if(t){n.length=r.length;for(var i=0;i1;){var t=e.pop(),n=t.obj[t.prop];if(Mn(n)){for(var i=[],o=0;o=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||o===Tx.RFC1738&&(c===40||c===41)){a+=s.charAt(l);continue}if(c<128){a=a+pr[c];continue}if(c<2048){a=a+(pr[192|c>>6]+pr[128|c&63]);continue}if(c<55296||c>=57344){a=a+(pr[224|c>>12]+pr[128|c>>6&63]+pr[128|c&63]);continue}l+=1,c=65536+((c&1023)<<10|s.charCodeAt(l)&1023),a+=pr[240|c>>18]+pr[128|c>>12&63]+pr[128|c>>6&63]+pr[128|c&63]}return a},$x=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i"u"&&(R=0)}if(typeof l=="function"?O=l(t,O):O instanceof Date?O=h(O):n==="comma"&&Br(O)&&(O=na.maybeMap(O,function(j){return j instanceof Date?h(j):j})),O===null){if(o)return a&&!w?a(t,Ot.encoder,b,"key",f):t;O=""}if(Dx(O)||na.isBuffer(O)){if(a){var $=w?t:a(t,Ot.encoder,b,"key",f);return[d($)+"="+d(a(O,Ot.encoder,b,"value",f))]}return[d(t)+"="+d(String(O))]}var I=[];if(typeof O>"u")return I;var L;if(n==="comma"&&Br(O))w&&a&&(O=na.maybeMap(O,a)),L=[{value:O.length>0?O.join(",")||null:void 0}];else if(Br(l))L=l;else{var Z=Object.keys(O);L=c?Z.sort(c):Z}for(var D=i&&Br(O)&&O.length===1?t+"[]":t,ne=0;ne"u"?Ot.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Ot.charsetSentinel,delimiter:typeof e.delimiter>"u"?Ot.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Ot.encode,encoder:typeof e.encoder=="function"?e.encoder:Ot.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Ot.encodeValuesOnly,filter:o,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Ot.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Ot.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Ot.strictNullHandling}},Fx=function(r,e){var t=r,n=Nx(e),i,o;typeof n.filter=="function"?(o=n.filter,t=o("",t)):Br(n.filter)&&(o=n.filter,i=o);var s=[];if(typeof t!="object"||t===null)return"";var a;e&&e.arrayFormat in Vd?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var l=Vd[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=l==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var u=Ny(),h=0;h0?w+d:""},Ei=Zy,du=Object.prototype.hasOwnProperty,Xx=Array.isArray,st={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Ei.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Yx=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},Xy=function(r,e){return r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1?r.split(","):r},Gx="utf8=%26%2310003%3B",Wx="utf8=%E2%9C%93",zx=function(e,t){var n={__proto__:null},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,o=t.parameterLimit===1/0?void 0:t.parameterLimit,s=i.split(t.delimiter,o),a=-1,l,c=t.charset;if(t.charsetSentinel)for(l=0;l-1&&(w=Xx(w)?[w]:w),du.call(n,d)?n[d]=Ei.combine(n[d],w):n[d]=w}return n},Vx=function(r,e,t,n){for(var i=n?e:Xy(e,t),o=r.length-1;o>=0;--o){var s,a=r[o];if(a==="[]"&&t.parseArrays)s=[].concat(i);else{s=t.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,c=parseInt(l,10);!t.parseArrays&&l===""?s={0:i}:!isNaN(c)&&a!==l&&String(c)===l&&c>=0&&t.parseArrays&&c<=t.arrayLimit?(s=[],s[c]=i):l!=="__proto__"&&(s[l]=i)}i=s}return i},Kx=function(e,t,n,i){if(e){var o=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=n.depth>0&&s.exec(o),c=l?o.slice(0,l.index):o,u=[];if(c){if(!n.plainObjects&&du.call(Object.prototype,c)&&!n.allowPrototypes)return;u.push(c)}for(var h=0;n.depth>0&&(l=a.exec(o))!==null&&h"u"?st.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?st.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:st.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:st.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:st.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:st.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:st.comma,decoder:typeof e.decoder=="function"?e.decoder:st.decoder,delimiter:typeof e.delimiter=="string"||Ei.isRegExp(e.delimiter)?e.delimiter:st.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:st.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:st.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:st.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:st.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:st.strictNullHandling}},Hx=function(r,e){var t=qx(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?Object.create(null):{};for(var n=typeof r=="string"?zx(r,t):r,i=t.plainObjects?Object.create(null):{},o=Object.keys(n),s=0;s=o.length?{done:!0}:{done:!1,value:o[l++]}},e:function(w){throw w},f:c}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var u=!0,h=!1,f;return{s:function(){a=a.call(o)},n:function(){var w=a.next();return u=w.done,w},e:function(w){h=!0,f=w},f:function(){try{!u&&a.return!=null&&a.return()}finally{if(h)throw f}}}}function n(o,s){if(o){if(typeof o=="string")return i(o,s);var a=Object.prototype.toString.call(o).slice(8,-1);if(a==="Object"&&o.constructor&&(a=o.constructor.name),a==="Map"||a==="Set")return Array.from(o);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return i(o,s)}}function i(o,s){(s==null||s>o.length)&&(s=o.length);for(var a=0,l=new Array(s);a=this._maxRetries)return!1;if(this._retryCallback)try{var t=this._retryCallback(r,e);if(t===!0)return!0;if(t===!1)return!1}catch(n){console.error(n)}return!!(e&&e.status&&sC.has(e.status)||r&&(r.code&&oC.has(r.code)||r.timeout&&r.code==="ECONNABORTED"||r.crossDomain))};Ee.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()};Ee.prototype.then=function(r,e){var t=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(i,o){n.on("abort",function(){if(!(t._maxRetries&&t._maxRetries>t._retries)){if(t.timedout&&t.timedoutError){o(t.timedoutError);return}var s=new Error("Aborted");s.code="ABORTED",s.status=t.status,s.method=t.method,s.url=t.url,o(s)}}),n.end(function(s,a){s?o(s):i(a)})})}return this._fullfilledPromise.then(r,e)};Ee.prototype.catch=function(r){return this.then(void 0,r)};Ee.prototype.use=function(r){return r(this),this};Ee.prototype.ok=function(r){if(typeof r!="function")throw new Error("Callback required");return this._okCallback=r,this};Ee.prototype._isResponseOK=function(r){return r?this._okCallback?this._okCallback(r):r.status>=200&&r.status<300:!1};Ee.prototype.get=function(r){return this._header[r.toLowerCase()]};Ee.prototype.getHeader=Ee.prototype.get;Ee.prototype.set=function(r,e){if(ka(r)){for(var t in r)Eo(r,t)&&this.set(t,r[t]);return this}return this._header[r.toLowerCase()]=e,this.header[r]=e,this};Ee.prototype.unset=function(r){return delete this._header[r.toLowerCase()],delete this.header[r],this};Ee.prototype.field=function(r,e,t){if(r==null)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(ka(r)){for(var n in r)Eo(r,n)&&this.field(n,r[n]);return this}if(Array.isArray(e)){for(var i in e)Eo(e,i)&&this.field(r,e[i]);return this}if(e==null)throw new Error(".field(name, val) val can not be empty");return typeof e=="boolean"&&(e=String(e)),t?this._getFormData().append(r,e,t):this._getFormData().append(r,e),this};Ee.prototype.abort=function(){if(this._aborted)return this;if(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req){if(nc.gte(process.version,"v13.0.0")&&nc.lt(process.version,"v14.0.0"))throw new Error("Superagent does not work in v13 properly with abort() due to Node.js core changes");nc.gte(process.version,"v14.0.0")&&(this.req.destroyed=!0),this.req.abort()}return this.clearTimeout(),this.emit("abort"),this};Ee.prototype._auth=function(r,e,t,n){switch(t.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(r,":").concat(e))));break;case"auto":this.username=r,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(r));break}return this};Ee.prototype.withCredentials=function(r){return r===void 0&&(r=!0),this._withCredentials=r,this};Ee.prototype.redirects=function(r){return this._maxRedirects=r,this};Ee.prototype.maxResponseSize=function(r){if(typeof r!="number")throw new TypeError("Invalid argument");return this._maxResponseSize=r,this};Ee.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}};Ee.prototype.send=function(r){var e=ka(r),t=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(r)?this._data=[]:this._isHost(r)||(this._data={});else if(r&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&ka(this._data))for(var n in r)Eo(r,n)&&(this._data[n]=r[n]);else typeof r=="string"?(t||this.type("form"),t=this._header["content-type"],t&&(t=t.toLowerCase().trim()),t==="application/x-www-form-urlencoded"?this._data=this._data?"".concat(this._data,"&").concat(r):r:this._data=(this._data||"")+r):this._data=r;return!e||this._isHost(r)?this:(t||this.type("json"),this)};Ee.prototype.sortQuery=function(r){return this._sort=typeof r>"u"?!0:r,this};Ee.prototype._finalizeQueryString=function(){var r=this._query.join("&");if(r&&(this.url+=(this.url.includes("?")?"&":"?")+r),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var t=this.url.slice(e+1).split("&");typeof this._sort=="function"?t.sort(this._sort):t.sort(),this.url=this.url.slice(0,e)+"?"+t.join("&")}}};Ee.prototype._appendQueryString=function(){console.warn("Unsupported")};Ee.prototype._timeoutError=function(r,e,t){if(!this._aborted){var n=new Error("".concat(r+e,"ms exceeded"));n.timeout=e,n.code="ECONNABORTED",n.errno=t,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}};Ee.prototype._setTimeouts=function(){var r=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){r._timeoutError("Timeout of ",r._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){r._timeoutError("Response timeout of ",r._responseTimeout,"ETIMEDOUT")},this._responseTimeout))};var ic=hl,aC=fl;function fl(){}fl.prototype.get=function(r){return this.header[r.toLowerCase()]};fl.prototype._setHeaderProperties=function(r){var e=r["content-type"]||"";this.type=ic.type(e);var t=ic.params(e);for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this[n]=t[n]);this.links={};try{r.link&&(this.links=ic.parseLinks(r.link))}catch{}};fl.prototype._setStatusProperties=function(r){var e=Math.trunc(r/100);this.statusCode=r,this.status=this.statusCode,this.statusType=e,this.info=e===1,this.ok=e===2,this.redirect=e===3,this.clientError=e===4,this.serverError=e===5,this.error=e===4||e===5?this.toError():!1,this.created=r===201,this.accepted=r===202,this.noContent=r===204,this.badRequest=r===400,this.unauthorized=r===401,this.notAcceptable=r===406,this.forbidden=r===403,this.notFound=r===404,this.unprocessableEntity=r===422};function lC(r){return hC(r)||uC(r)||Gy(r)||cC()}function cC(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uC(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function hC(r){if(Array.isArray(r))return gu(r)}function fC(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=Gy(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){t=t.call(r)},n:function(){var c=t.next();return o=c.done,c},e:function(c){s=!0,a=c},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(s)throw a}}}}function Gy(r,e){if(r){if(typeof r=="string")return gu(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return gu(r,e)}}function gu(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t=P.length?{done:!0}:{done:!1,value:P[J++]}},e:function(de){throw de},f:Y}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H=!0,re=!1,le;return{s:function(){T=T.call(P)},n:function(){var de=T.next();return H=de.done,de},e:function(de){re=!0,le=de},f:function(){try{!H&&T.return!=null&&T.return()}finally{if(re)throw le}}}}function i(P,j){if(P){if(typeof P=="string")return o(P,j);var T=Object.prototype.toString.call(P).slice(8,-1);if(T==="Object"&&P.constructor&&(T=P.constructor.name),T==="Map"||T==="Set")return Array.from(P);if(T==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(T))return o(P,j)}}function o(P,j){(j==null||j>P.length)&&(j=P.length);for(var T=0,J=new Array(j);T"u"?(console.warn("Using browser-only version of superagent in non-browser environment"),s=void 0):s=self;var a=Zn,l=cy,c=nC,u=iC,h=hl,f=h.isObject,d=h.mixin,w=h.hasOwn,b=aC,v=pC;function O(){}r.exports=function(P,j){return typeof j=="function"?new e.Request("GET",P).end(j):arguments.length===1?new e.Request("GET",P):new e.Request(P,j)},e=r.exports;var M=e;e.Request=D,M.getXHR=function(){if(s.XMLHttpRequest&&(!s.location||s.location.protocol!=="file:"||!s.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch{}throw new Error("Browser-only version of superagent could not find XHR")};var R="".trim?function(P){return P.trim()}:function(P){return P.replace(/(^\s*|\s*$)/g,"")};function k(P){if(!f(P))return P;var j=[];for(var T in P)w(P,T)&&x(j,T,P[T]);return j.join("&")}function x(P,j,T){if(T!==void 0){if(T===null){P.push(encodeURI(j));return}if(Array.isArray(T)){var J=n(T),Y;try{for(J.s();!(Y=J.n()).done;){var H=Y.value;x(P,j,H)}}catch(le){J.e(le)}finally{J.f()}}else if(f(T))for(var re in T)w(T,re)&&x(P,"".concat(j,"[").concat(re,"]"),T[re]);else P.push(encodeURI(j)+"="+encodeURIComponent(T))}}M.serializeObject=k;function $(P){for(var j={},T=P.split("&"),J,Y,H=0,re=T.length;H"u"?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var j=this.xhr.status;j===1223&&(j=204),this._setStatusProperties(j),this.headers=I(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),this.text===null&&P._responseType?this.body=this.xhr.response:this.body=this.req.method==="HEAD"?null:this._parseBody(this.text?this.text:this.xhr.response)}d(Z.prototype,b.prototype),Z.prototype._parseBody=function(P){var j=M.parse[this.type];return this.req._parser?this.req._parser(this,P):(!j&&L(this.type)&&(j=M.parse["application/json"]),j&&P&&(P.length>0||P instanceof Object)?j(P):null)},Z.prototype.toError=function(){var P=this.req,j=P.method,T=P.url,J="cannot ".concat(j," ").concat(T," (").concat(this.status,")"),Y=new Error(J);return Y.status=this.status,Y.method=j,Y.url=T,Y},M.Response=Z;function D(P,j){var T=this;this._query=this._query||[],this.method=P,this.url=j,this.header={},this._header={},this.on("end",function(){var J=null,Y=null;try{Y=new Z(T)}catch(re){return J=new Error("Parser is unable to parse the response"),J.parse=!0,J.original=re,T.xhr?(J.rawResponse=typeof T.xhr.responseType>"u"?T.xhr.responseText:T.xhr.response,J.status=T.xhr.status?T.xhr.status:null,J.statusCode=J.status):(J.rawResponse=null,J.status=null),T.callback(J)}T.emit("response",Y);var H;try{T._isResponseOK(Y)||(H=new Error(Y.statusText||Y.text||"Unsuccessful HTTP response"))}catch(re){H=re}H?(H.original=J,H.response=Y,H.status=Y.status,T.callback(H,Y)):T.callback(null,Y)})}a(D.prototype),d(D.prototype,u.prototype),D.prototype.type=function(P){return this.set("Content-Type",M.types[P]||P),this},D.prototype.accept=function(P){return this.set("Accept",M.types[P]||P),this},D.prototype.auth=function(P,j,T){arguments.length===1&&(j=""),t(j)==="object"&&j!==null&&(T=j,j=""),T||(T={type:typeof btoa=="function"?"basic":"auto"});var J=T.encoder?T.encoder:function(Y){if(typeof btoa=="function")return btoa(Y);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(P,j,T,J)},D.prototype.query=function(P){return typeof P!="string"&&(P=k(P)),P&&this._query.push(P),this},D.prototype.attach=function(P,j,T){if(j){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(P,j,T||j.name)}return this},D.prototype._getFormData=function(){return this._formData||(this._formData=new s.FormData),this._formData},D.prototype.callback=function(P,j){if(this._shouldRetry(P,j))return this._retry();var T=this._callback;this.clearTimeout(),P&&(this._maxRetries&&(P.retries=this._retries-1),this.emit("error",P)),T(P,j)},D.prototype.crossDomainError=function(){var P=new Error(`Request has been terminated +Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.`);P.crossDomain=!0,P.status=this.status,P.method=this.method,P.url=this.url,this.callback(P)},D.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},D.prototype.ca=D.prototype.agent,D.prototype.buffer=D.prototype.ca,D.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},D.prototype.pipe=D.prototype.write,D.prototype._isHost=function(P){return P&&t(P)==="object"&&!Array.isArray(P)&&Object.prototype.toString.call(P)!=="[object Object]"},D.prototype.end=function(P){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=P||O,this._finalizeQueryString(),this._end()},D.prototype._setUploadTimeout=function(){var P=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout(function(){P._timeoutError("Upload timeout of ",P._uploadTimeout,"ETIMEDOUT")},this._uploadTimeout))},D.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var P=this;this.xhr=M.getXHR();var j=this.xhr,T=this._formData||this._data;this._setTimeouts(),j.addEventListener("readystatechange",function(){var le=j.readyState;if(le>=2&&P._responseTimeoutTimer&&clearTimeout(P._responseTimeoutTimer),le===4){var ce;try{ce=j.status}catch{ce=0}if(!ce)return P.timedout||P._aborted?void 0:P.crossDomainError();P.emit("end")}});var J=function(ce,de){de.total>0&&(de.percent=de.loaded/de.total*100,de.percent===100&&clearTimeout(P._uploadTimeoutTimer)),de.direction=ce,P.emit("progress",de)};if(this.hasListeners("progress"))try{j.addEventListener("progress",J.bind(null,"download")),j.upload&&j.upload.addEventListener("progress",J.bind(null,"upload"))}catch{}j.upload&&this._setUploadTimeout();try{this.username&&this.password?j.open(this.method,this.url,!0,this.username,this.password):j.open(this.method,this.url,!0)}catch(le){return this.callback(le)}if(this._withCredentials&&(j.withCredentials=!0),!this._formData&&this.method!=="GET"&&this.method!=="HEAD"&&typeof T!="string"&&!this._isHost(T)){var Y=this._header["content-type"],H=this._serializer||M.serialize[Y?Y.split(";")[0]:""];!H&&L(Y)&&(H=M.serialize["application/json"]),H&&(T=H(T))}for(var re in this.header)this.header[re]!==null&&w(this.header,re)&&j.setRequestHeader(re,this.header[re]);this._responseType&&(j.responseType=this._responseType),this.emit("request",this),j.send(typeof T>"u"?null:T)},M.agent=function(){return new v};for(var ne=function(){var j=se[te];v.prototype[j.toLowerCase()]=function(T,J){var Y=new M.Request(j,T);return this._setDefaults(Y),J&&Y.end(J),Y}},te=0,se=["GET","POST","OPTIONS","PATCH","PUT","DELETE"];te{this.setSketchFromURL(window.location.search,e)}),this.setRandomSketch=this.setRandomSketch.bind(this)}clear(){this.current=null,this.code=null;let e=window.location.protocol+"//"+window.location.host+window.location.pathname;window.history.pushState({path:e},"",e),this.url=e}setSketchFromURL(e=window.location.search,t){hush(),render(o0);let n=new URLSearchParams(e);this.searchParams=n;let i=n.get("code"),o=n.get("sketch_id"),s=n.get("showCode");if(console.log("code is",i),this.foundSketch=!1,o){var a=this.getExampleById(o);a?(this.setSketch(a),t(this.code,!1)):oc.get(`${this.state.serverURL}/sketchById`).query({sketch_id:o}).end((l,c)=>{l?(console.log("err getting sketches",l),this.setSketchFromCode(i,t)):(this.sketches=JSON.parse(c.text),this.sketches.length>0?(this.setSketch(this.sketches[0]),this.foundSketch=!0,t(this.code,this.foundSketch)):this.setSketchFromCode(i,t))})}else this.setSketchFromCode(i,t);s==="false"&&(this.emitter.emit("ui: hide all"),this.emitter.emit("hide info"))}setSketchFromCode(e,t){e?(this.code=this.decodeBase64(e),this.foundSketch=!0):this.setRandomSketch(),t(this.code,this.foundSketch)}saveImage(){}setToURL(e){this.searchParams.delete("sketch_id"),this.searchParams.delete("code"),e.sketch_id?(`${e.sketch_id}`,this.searchParams.append("sketch_id",e.sketch_id)):(`${e.sketch_id}${e.code}`,this.searchParams.append("sketch_id",e.sketch_id),this.searchParams.append("code",e.code));let t=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+this.searchParams.toString();window.history.replaceState({path:t},"",t),this.url=t}encodeBase64(e){return btoa(encodeURIComponent(e))}decodeBase64(e){return decodeURIComponent(atob(e))}setSketch(e){let t=this.decodeBase64(e.code);t.indexOf(qd)<0&&(t=`${qd} +${t} +`),this.code=t,this.current=e,this.setToURL(e)}setRandomSketch(){if(this.examples.length>0){let t;for(t=Math.floor(Math.random()*this.examples.length);t===this.exampleIndex;)t=Math.floor(Math.random()*this.examples.length);this.exampleIndex=t,this.setSketch(this.examples[t])}else{var e="osc(2"+Math.floor(Math.pow(10,Math.random()*2))+")";e+=".color("+Math.random().toFixed(2)+","+Math.random().toFixed(2)+","+Math.random().toFixed(2)+")",e+=".rotate("+Math.random().toFixed(2)+")",e+=".out(o0)",this.code=e}}shareSketch(e,t,n){this.saveSketch(e,()=>{console.log("URL is",this.url,"sketch is",this.current),t.getScreenImage(i=>{oc.post(`${this.state.serverURL}/image`).attach("previewImage",i).query({url:this.url,sketch_id:this.current.sketch_id,name:n}).end((o,s)=>{o?console.log("error postingimage",o):console.log("image response",s.text)})})})}saveSketch(e,t){let n=this,i=this.encodeBase64(e),o={code:i,parent:this.current?this.current.sketch_id:null};console.log("saving in gallery",o),oc.post(`${this.state.serverURL}/sketch`).query(o).end((s,a)=>{s?(console.log("error posting sketch",s),t&&t(s)):(console.log("response",a.text),n.setSketch({sketch_id:a.text,code:i}),t&&t(null))})}saveLocally(e){let t=this.encodeBase64(e);this.searchParams.delete("sketch_id"),this.searchParams.delete("code"),this.searchParams.append("code",t);var n=this.searchParams.toString();let i=window.location.protocol+"//"+window.location.host+window.location.pathname+"?"+n;window.history.pushState({path:i},"",i),this.url=i}getExampleById(e){var t=this.examples.filter(n=>n.sketch_id===e);return t.length<=0&&(t=this.sketches.filter(n=>n.sketch_id===e)),t[0]}}let Ir;function OC(r,e){e.on("DOMContentLoaded",function(){Ir=new yC((t,n)=>{e.emit("load and eval code",t),n?e.emit("ui: hide info"):e.emit("ui: show info"),e.emit("render")},r,e),r.gallery=Ir}),e.on("gallery:saveToURL",function(){const n=r.editor.editor.getValue();Ir.saveLocally(n)}),e.on("gallery: save locally",function(t){Ir.saveLocally(t)}),e.on("gallery: clear",()=>{Ir.clear()}),e.on("gallery:shareSketch",function(){const n=r.editor.editor.getValue();e.emit("repl: eval",n,(i,o)=>{o?console.warn(o):wC(s=>{Ir.shareSketch(n,r.hydra.hydra,s)},()=>{})})}),e.on("gallery:showExample",()=>{const t=r.editor.editor;e.emit("clear all"),Ir.setRandomSketch(),e.emit("repl: eval",Ir.code),t.setValue(Ir.code)})}function wC(r,e){var t=prompt(`Pressing OK will share this sketch to +https://twitter.com/hydra_patterns. + +Include your name or twitter handle (optional):`);t!==null?r(t):e()}var vC=bC,Hd={class:"className",for:"htmlFor","http-equiv":"httpEquiv"};function bC(r){return function(e,t,n){for(var i in t)i in Hd&&(t[Hd[i]]=t[i],delete t[i]);return r(e,t,n)}}var SC=vC,Kn=0,gr=1,Tt=2,ws=3,qt=4,Xe=5,sc=6,vn=7,ot=8,ii=9,oi=10,Hi=11,bn=12,qn=13,MC=function(r,e){e||(e={});var t=e.concat||function(i,o){return String(i)+String(o)};return e.attrToProp!==!1&&(r=SC(r)),function(i){for(var o=gr,s="",a=arguments.length,l=[],c=0;c1&&(w.pop(),w[w.length-1][0][2][O]=r(b[0],b[1],b[2].length?b[2]:void 0))}else if(v===Tt){var M=[h[1],{},[]];b[2].push(M),w.push([M,b[2].length-1])}else if(v===Xe||v===Kn&&h[1]===Xe){for(var R="",k;c1&&/^\s*$/.test(d[2][0])&&d[2].shift(),d[2].length>2||d[2].length===2&&/\S/.test(d[2][1])){if(e.createFragment)return e.createFragment(d[2]);throw new Error("multiple root elements must be wrapped in an enclosing tag")}return Array.isArray(d[2][0])&&typeof d[2][0][0]=="string"&&Array.isArray(d[2][0][2])&&(d[2][0]=r(d[2][0][0],d[2][0][1],d[2][0][2])),d[2][0];function $(I){var L=[];o===vn&&(o=qt);for(var Z=0;Z"&&!kC(o)&&o!==qn?(o===Tt&&s.length?L.push([Tt,s]):o===Xe?L.push([Xe,s]):o===ot&&s.length&&L.push([ot,s]),L.push([ws]),s="",o=gr):o===qn&&/-$/.test(s)&&D==="-"?(e.comments&&L.push([ot,s.substr(0,s.length-1)]),s="",o=gr):o===Tt&&/^!--$/.test(s)?(e.comments&&L.push([Tt,s],[Xe,"comment"],[Hi]),s=D,o=qn):o===gr||o===qn?s+=D:o===Tt&&D==="/"&&s.length||(o===Tt&&/\s/.test(D)?(s.length&&L.push([Tt,s]),s="",o=qt):o===Tt?s+=D:o===qt&&/[^\s"'=/]/.test(D)?(o=Xe,s=D):o===qt&&/\s/.test(D)?(s.length&&L.push([Xe,s]),L.push([bn])):o===Xe&&/\s/.test(D)?(L.push([Xe,s]),s="",o=sc):o===Xe&&D==="="?(L.push([Xe,s],[Hi]),s="",o=vn):o===Xe?s+=D:(o===sc||o===qt)&&D==="="?(L.push([Hi]),o=vn):(o===sc||o===qt)&&!/\s/.test(D)?(L.push([bn]),/[\w-]/.test(D)?(s+=D,o=Xe):o=qt):o===vn&&D==='"'?o=oi:o===vn&&D==="'"?o=ii:o===oi&&D==='"'?(L.push([ot,s],[bn]),s="",o=qt):o===ii&&D==="'"?(L.push([ot,s],[bn]),s="",o=qt):o===vn&&!/\s/.test(D)?(o=ot,Z--):o===ot&&/\s/.test(D)?(L.push([ot,s],[bn]),s="",o=qt):(o===ot||o===ii||o===oi)&&(s+=D))}return o===gr&&s.length?(L.push([gr,s]),s=""):o===ot&&s.length?(L.push([ot,s]),s=""):o===oi&&s.length?(L.push([ot,s]),s=""):o===ii&&s.length?(L.push([ot,s]),s=""):o===Xe&&(L.push([Xe,s]),s=""),L}};function n(i){return typeof i=="function"||typeof i=="string"||i&&typeof i=="object"||i==null?i:t("",i)}};function kC(r){return r===ii||r===oi}var xC=RegExp("^("+["area","base","basefont","bgsound","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr","!--","animate","animateTransform","circle","cursor","desc","ellipse","feBlend","feColorMatrix","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","font-face-format","font-face-name","font-face-uri","glyph","glyphRef","hkern","image","line","missing-glyph","mpath","path","polygon","polyline","rect","set","stop","tref","use","view","vkern"].join("|")+")(?:[.#][a-zA-Z0-9-￿_:-]+)*$");function CC(r){return xC.test(r)}var vs=/\n[\s]+$/,bs=/^\n[\s]+/,ep=/[\s]+$/,tp=/^[\s]+/,Ss=/[\n\s]+/g,rp=["a","abbr","b","bdi","bdo","br","cite","data","dfn","em","i","kbd","mark","q","rp","rt","rtc","ruby","s","amp","small","span","strong","sub","sup","time","u","var","wbr"],Ms=["code","pre","textarea"],TC=function r(e,t){if(Array.isArray(t))for(var n=e.nodeName.toLowerCase(),i=!1,o,s,a=0,l=t.length;ac=>e(l,c),o=(l,c,u,h)=>nt` + `,s=r.showInfo?o("close","fa-times",n("toolbar.hide-info"),"ui: toggle info"):o("close","fa-question-circle",n("toolbar.show-info"),"ui: toggle info"),a=r.showExtensions?o("close","fa-question-circle",n("toolbar.show-info"),"ui: hide extensions"):o("add","fa-solid fa-puzzle-piece",n("toolbar.load-extension"),"ui: show extensions");return nt`
+ ${o("run",`fa-play-circle ${t}`,n("toolbar.run"),"editor: eval all")} + ${o("clear",`fa fa-trash ${t}`,n("toolbar.clear"),"clear all")} + ${a} + ${o("shuffle","fa-random",n("toolbar.shuffle"),"gallery:showExample")} + ${o("mutator",`fa-dice ${t}`,n("toolbar.random"),"editor: randomize")} + ${r.serverURL===null?"":o("share",`fa-upload ${t}`,n("toolbar.upload"),"gallery:shareSketch")} + ${s} +
`}const GC=({content:r,header:e},t,n)=>{t.translation;const i=t.translation.selectedLanguage==="ar"&&t.showInfo===!0?"rtl":"ltr";return nt` +
+ +
+`},WC=(r,e,t)=>()=>t(r,e),np=(r,e,t,n)=>nt` +`,zC=(r,e,t)=>nt`
+ + +
+
${r.name} - ${r.author}
+
${r.description}
+
+
+
+ ${np("add-extension","fa-solid fa-plus","add to editor",WC("extensions: add to editor",e,t))} + ${np("show-documentation","fa-book-open","show documentation",()=>{window.open(r.documentation,"_blank")})} +
+
+ ${r.examples.map((n,i)=>nt`
{t("extensions: load example",e,i)}}>${i+1}
`)} +
+
`,VC=(r,e)=>{const{categories:t,selectedCategoryIndex:n}=r.extensions,i=t[n].entries,{t:o}=r.translation,s=nt` +`,a=nt`
+ ${t.map((l,c)=>nt`
e("extensions: select category",c)} + >${l.name}
`)} +
`;return{content:s,header:a}},Ht=r=>`href=${r} target=_blank`,KC=r=>nt``;function qC(r,e){const{t,languages:n}=r.translation,i=Object.entries(n),o=r.showInfo&&i.length>1?nt`
${i.map(([a,l])=>nt` +
e("set language",a)}>${l}
+`)}
`:nt`
`,s=r.showExtensions?VC(r,e):{content:KC(t),header:o};return GC(s,r,e)}var ip=typeof lt<"u"?lt:typeof window<"u"?window:{},HC=Bi,co;typeof document<"u"?co=document:(co=ip["__GLOBAL_DOCUMENT_CACHE@4"],co||(co=ip["__GLOBAL_DOCUMENT_CACHE@4"]=HC));var zy=co,dl={exports:{}},uo;typeof window<"u"?uo=window:typeof lt<"u"?uo=lt:typeof self<"u"?uo=self:uo={};var eT=uo,ac=zy,op=eT,gt=Object.create(null),Vy="onloadid"+Math.random().toString(36).slice(2),In="data-"+Vy,lc=0;if(op&&op.MutationObserver){var tT=new MutationObserver(function(r){if(!(Object.keys(gt).length<1))for(var e=0;e0&&yu(r[n].childNodes,e)}}var iT=dl.exports,oT=qy;class Ky extends Error{}Ky.prototype.name="AssertionError";function qy(r,e){if(!r){var t=new Ky(e);throw Error.captureStackTrace&&Error.captureStackTrace(t,qy),t}}const Hy=zy,ho=$h,sT=wy,Yh=iT,Ou=oT,aT=Yh.KEY_ID,lT=Yh.KEY_ATTR;var cT=$t;function uT(){return"ncid-"+Math.floor((1+Math.random())*65536).toString(16).substring(1)}$t.makeID=uT;function $t(r){this._hasWindow=typeof window<"u",this._id=null,this._ncID=null,this._olID=null,this._proxy=null,this._loaded=!1,this._rootNodeName=null,this._name=r||"nanocomponent",this._rerender=!1,this._handleLoad=this._handleLoad.bind(this),this._handleUnload=this._handleUnload.bind(this),this._arguments=[];const e=this;Object.defineProperty(this,"element",{get:function(){const t=Hy.getElementById(e._id);if(t)return t.dataset.nanocomponent===e._ncID?t:void 0}})}$t.prototype.render=function(){const r=ho(this._name+".render"),e=this,t=new Array(arguments.length);let n;for(let i=0;i{i.setup=()=>{i.createCanvas(e,t,i[n])},i.draw=()=>{}},"hydra-ui"),this.width=e,this.height=t,this.mode=n,this.canvas.style.position="absolute",this.canvas.style.top="0px",this.canvas.style.left="0px",this.canvas.style.zIndex=-1}show(){this.canvas.style.visibility="visible"}hide(){this.canvas.style.visibility="hidden"}clear(){this.drawingContext.clearRect(0,0,this.canvas.width,this.canvas.height)}}var wu={exports:{}},dT=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,pT=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],tO=function(e){var t=e,n=e.indexOf("["),i=e.indexOf("]");n!=-1&&i!=-1&&(e=e.substring(0,n)+e.substring(n,i).replace(/:/g,";")+e.substring(i,e.length));for(var o=dT.exec(e||""),s={},a=14;a--;)s[pT[a]]=o[a]||"";return n!=-1&&i!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=gT(s,s.path),s.queryKey=mT(s,s.query),s};function gT(r,e){var t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.substr(0,1)=="/"||e.length===0)&&n.splice(0,1),e.substr(e.length-1,1)=="/"&&n.splice(n.length-1,1),n}function mT(r,e){var t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,o){i&&(t[i]=o)}),t}var vu={exports:{}},bu={exports:{}},Qo=1e3,Ao=Qo*60,Uo=Ao*60,Ro=Uo*24,yT=Ro*365.25,OT=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return wT(r);if(t==="number"&&isNaN(r)===!1)return e.long?bT(r):vT(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function wT(r){if(r=String(r),!(r.length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*yT;case"days":case"day":case"d":return t*Ro;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Uo;case"minutes":case"minute":case"mins":case"min":case"m":return t*Ao;case"seconds":case"second":case"secs":case"sec":case"s":return t*Qo;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function vT(r){return r>=Ro?Math.round(r/Ro)+"d":r>=Uo?Math.round(r/Uo)+"h":r>=Ao?Math.round(r/Ao)+"m":r>=Qo?Math.round(r/Qo)+"s":r+"ms"}function bT(r){return ks(r,Ro,"day")||ks(r,Uo,"hour")||ks(r,Ao,"minute")||ks(r,Qo,"second")||r+" ms"}function ks(r,e,t){if(!(r=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}e.formatters.j=function(l){try{return JSON.stringify(l)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}};function n(l){var c=this.useColors;if(l[0]=(c?"%c":"")+this.namespace+(c?" %c":" ")+l[0]+(c?"%c ":" ")+"+"+e.humanize(this.diff),!!c){var u="color: "+this.color;l.splice(1,0,u,"color: inherit");var h=0,f=0;l[0].replace(/%[a-zA-Z%]/g,function(d){d!=="%%"&&(h++,d==="%c"&&(f=h))}),l.splice(f,0,u)}}function i(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(l){try{l==null?e.storage.removeItem("debug"):e.storage.debug=l}catch{}}function s(){var l;try{l=e.storage.debug}catch{}return!l&&typeof process<"u"&&"env"in process&&(l={}.DEBUG),l}e.enable(s());function a(){try{return window.localStorage}catch{}}})(vu,vu.exports);var pl=vu.exports,MT=tO,lp=pl("socket.io-client:url"),kT=xT;function xT(r,e){var t=r;e=e||typeof location<"u"&&location,r==null&&(r=e.protocol+"//"+e.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=e.protocol+r:r=e.host+r),/^(https?|wss?):\/\//.test(r)||(lp("protocol-less url %s",r),typeof e<"u"?r=e.protocol+"//"+r:r="https://"+r),lp("parse %s",r),t=MT(r)),t.port||(/^(http|ws)$/.test(t.protocol)?t.port="80":/^(http|ws)s$/.test(t.protocol)&&(t.port="443")),t.path=t.path||"/";var n=t.host.indexOf(":")!==-1,i=n?"["+t.host+"]":t.host;return t.id=t.protocol+"://"+i+":"+t.port,t.href=t.protocol+"://"+i+(e&&e.port===t.port?"":":"+t.port),t}var gl={},Su={exports:{}},Mu={exports:{}},$o=1e3,_o=$o*60,Jo=_o*60,Po=Jo*24,CT=Po*365.25,TT=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return ET(r);if(t==="number"&&isNaN(r)===!1)return e.long?AT(r):QT(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function ET(r){if(r=String(r),!(r.length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*CT;case"days":case"day":case"d":return t*Po;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Jo;case"minutes":case"minute":case"mins":case"min":case"m":return t*_o;case"seconds":case"second":case"secs":case"sec":case"s":return t*$o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function QT(r){return r>=Po?Math.round(r/Po)+"d":r>=Jo?Math.round(r/Jo)+"h":r>=_o?Math.round(r/_o)+"m":r>=$o?Math.round(r/$o)+"s":r+"ms"}function AT(r){return xs(r,Po,"day")||xs(r,Jo,"hour")||xs(r,_o,"minute")||xs(r,$o,"second")||r+" ms"}function xs(r,e,t){if(!(r=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}e.formatters.j=function(l){try{return JSON.stringify(l)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}};function n(l){var c=this.useColors;if(l[0]=(c?"%c":"")+this.namespace+(c?" %c":" ")+l[0]+(c?"%c ":" ")+"+"+e.humanize(this.diff),!!c){var u="color: "+this.color;l.splice(1,0,u,"color: inherit");var h=0,f=0;l[0].replace(/%[a-zA-Z%]/g,function(d){d!=="%%"&&(h++,d==="%c"&&(f=h))}),l.splice(f,0,u)}}function i(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(l){try{l==null?e.storage.removeItem("debug"):e.storage.debug=l}catch{}}function s(){var l;try{l=e.storage.debug}catch{}return!l&&typeof process<"u"&&"env"in process&&(l={}.DEBUG),l}e.enable(s());function a(){try{return window.localStorage}catch{}}})(Su,Su.exports);var RT=Su.exports,ml={},$T={}.toString,rO=Array.isArray||function(r){return $T.call(r)=="[object Array]"},nO=IT,_T=typeof Buffer=="function"&&typeof Buffer.isBuffer=="function",JT=typeof ArrayBuffer=="function",PT=function(r){return typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer};function IT(r){return _T&&Buffer.isBuffer(r)||JT&&(r instanceof ArrayBuffer||PT(r))}var Gh=rO,iO=nO,oO=Object.prototype.toString,BT=typeof Blob=="function"||typeof Blob<"u"&&oO.call(Blob)==="[object BlobConstructor]",jT=typeof File=="function"||typeof File<"u"&&oO.call(File)==="[object FileConstructor]";ml.deconstructPacket=function(r){var e=[],t=r.data,n=r;return n.data=ku(t,e),n.attachments=e.length,{packet:n,buffers:e}};function ku(r,e){if(!r)return r;if(iO(r)){var t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Gh(r)){for(var n=new Array(r.length),i=0;i=0&&r.numn&&(t=n),e>=n||e>=t||n===0)return new ArrayBuffer(0);for(var i=new Uint8Array(r),o=new Uint8Array(t-e),s=e,a=0;s=55296&&i<=56319&&t65535&&(n-=65536,i+=tn(n>>>10&1023|55296),n=56320|n&1023),i+=tn(n);return i}function lO(r,e){if(r>=55296&&r<=57343){if(e)throw Error("Lone surrogate U+"+r.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function hc(r,e){return tn(r>>e&63|128)}function VT(r,e){if(!(r&4294967168))return tn(r);var t="";return r&4294965248?r&4294901760?r&4292870144||(t=tn(r>>18&7|240),t+=hc(r,12),t+=hc(r,6)):(lO(r,e)||(r=65533),t=tn(r>>12&15|224),t+=hc(r,6)):t=tn(r>>6&31|192),t+=tn(r&63|128),t}function KT(r,e){e=e||{};for(var t=e.strict!==!1,n=aO(r),i=n.length,o=-1,s,a="";++o=Ca)throw Error("Invalid byte index");var r=xa[on]&255;if(on++,(r&192)==128)return r&63;throw Error("Invalid continuation byte")}function qT(r){var e,t,n,i,o;if(on>Ca)throw Error("Invalid byte index");if(on==Ca)return!1;if(e=xa[on]&255,on++,!(e&128))return e;if((e&224)==192){if(t=Hn(),o=(e&31)<<6|t,o>=128)return o;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=Hn(),n=Hn(),o=(e&15)<<12|t<<6|n,o>=2048)return lO(o,r)?o:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=Hn(),n=Hn(),i=Hn(),o=(e&7)<<18|t<<12|n<<6|i,o>=65536&&o<=1114111))return o;throw Error("Invalid UTF-8 detected")}var xa,Ca,on;function HT(r,e){e=e||{};var t=e.strict!==!1;xa=aO(r),Ca=xa.length,on=0;for(var n=[],i;(i=qT(t))!==!1;)n.push(i);return zT(n)}var eE={version:"2.1.2",encode:KT,decode:HT},Cs={},hp;function tE(){return hp||(hp=1,function(r){Cs.encode=function(e){var t=new Uint8Array(e),n,i=t.length,o="";for(n=0;n>2],o+=r[(t[n]&3)<<4|t[n+1]>>4],o+=r[(t[n+1]&15)<<2|t[n+2]>>6],o+=r[t[n+2]&63];return i%3===2?o=o.substring(0,o.length-1)+"=":i%3===1&&(o=o.substring(0,o.length-2)+"=="),o},Cs.decode=function(e){var t=e.length*.75,n=e.length,i,o=0,s,a,l,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var u=new ArrayBuffer(t),h=new Uint8Array(u);for(i=0;i>4,h[o++]=(a&15)<<4|l>>2,h[o++]=(l&3)<<6|c&63;return u}}("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")),Cs}var fc,fp;function rE(){if(fp)return fc;fp=1;var r=typeof r<"u"?r:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:!1,e=function(){try{var a=new Blob(["hi"]);return a.size===2}catch{return!1}}(),t=e&&function(){try{var a=new Blob([new Uint8Array([1,2])]);return a.size===2}catch{return!1}}(),n=r&&r.prototype.append&&r.prototype.getBlob;function i(a){return a.map(function(l){if(l.buffer instanceof ArrayBuffer){var c=l.buffer;if(l.byteLength!==c.byteLength){var u=new Uint8Array(l.byteLength);u.set(new Uint8Array(c,l.byteOffset,l.byteLength)),c=u.buffer}return c}return l})}function o(a,l){l=l||{};var c=new r;return i(a).forEach(function(u){c.append(u)}),l.type?c.getBlob(l.type):c.getBlob()}function s(a,l){return new Blob(i(a),l||{})}return typeof Blob<"u"&&(o.prototype=Blob.prototype,s.prototype=Blob.prototype),fc=function(){return e?t?Blob:s:n?o:void 0}(),fc}(function(r){var e=NT,t=sO(),n=XT,i=YT,o=eE,s;typeof ArrayBuffer<"u"&&(s=tE());var a=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),l=typeof navigator<"u"&&/PhantomJS/i.test(navigator.userAgent),c=a||l;r.protocol=3;var u=r.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},h=e(u),f={type:"error",data:"parser error"},d=rE();r.encodePacket=function(k,x,$,I){typeof x=="function"&&(I=x,x=!1),typeof $=="function"&&(I=$,$=null);var L=k.data===void 0?void 0:k.data.buffer||k.data;if(typeof ArrayBuffer<"u"&&L instanceof ArrayBuffer)return b(k,x,I);if(typeof d<"u"&&L instanceof d)return O(k,x,I);if(L&&L.base64)return w(k,I);var Z=u[k.type];return k.data!==void 0&&(Z+=$?o.encode(String(k.data),{strict:!1}):String(k.data)),I(""+Z)};function w(k,x){var $="b"+r.packets[k.type]+k.data.data;return x($)}function b(k,x,$){if(!x)return r.encodeBase64Packet(k,$);var I=k.data,L=new Uint8Array(I),Z=new Uint8Array(1+I.byteLength);Z[0]=u[k.type];for(var D=0;D1?{type:h[L],data:k.substring(1)}:{type:h[L]}}var I=new Uint8Array(k),L=I[0],Z=n(k,1);return d&&x==="blob"&&(Z=new d([Z])),{type:h[L],data:Z}};function M(k){try{k=o.decode(k,{strict:!1})}catch{return!1}return k}r.decodeBase64Packet=function(k,x){var $=h[k.charAt(0)];if(!s)return{type:$,data:{base64:!0,data:k.substr(1)}};var I=s.decode(k.substr(1));return x==="blob"&&d&&(I=new d([I])),{type:$,data:I}},r.encodePayload=function(k,x,$){typeof x=="function"&&($=x,x=null);var I=t(k);if(x&&I)return d&&!c?r.encodePayloadAsBlob(k,$):r.encodePayloadAsArrayBuffer(k,$);if(!k.length)return $("0:");function L(D){return D.length+":"+D}function Z(D,ne){r.encodePacket(D,I?x:!1,!1,function(te){ne(null,L(te))})}R(k,Z,function(D,ne){return $(ne.join(""))})};function R(k,x,$){for(var I=new Array(k.length),L=i(k.length,$),Z=function(ne,te,se){x(te,function(ae,P){I[ne]=P,se(ae,I)})},D=0;D0;){for(var Z=new Uint8Array(I),D=Z[0]===0,ne="",te=1;Z[te]!==255;te++){if(ne.length>310)return $(f,0,1);ne+=Z[te]}I=n(I,2+ne.length),ne=parseInt(ne);var se=n(I,0,ne);if(D)try{se=String.fromCharCode.apply(null,new Uint8Array(se))}catch{var ae=new Uint8Array(se);se="";for(var te=0;te0);return e}function nE(r){var e=0;for(sn=0;sn0)return sE(r);if(t==="number"&&isNaN(r)===!1)return e.long?lE(r):aE(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function sE(r){if(r=String(r),!(r.length>100)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*iE;case"days":case"day":case"d":return t*Lo;case"hours":case"hour":case"hrs":case"hr":case"h":return t*jo;case"minutes":case"minute":case"mins":case"min":case"m":return t*Bo;case"seconds":case"second":case"secs":case"sec":case"s":return t*Io;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function aE(r){return r>=Lo?Math.round(r/Lo)+"d":r>=jo?Math.round(r/jo)+"h":r>=Bo?Math.round(r/Bo)+"m":r>=Io?Math.round(r/Io)+"s":r+"ms"}function lE(r){return Es(r,Lo,"day")||Es(r,jo,"hour")||Es(r,Bo,"minute")||Es(r,Io,"second")||r+" ms"}function Es(r,e,t){if(!(r=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}e.formatters.j=function(l){try{return JSON.stringify(l)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}};function n(l){var c=this.useColors;if(l[0]=(c?"%c":"")+this.namespace+(c?" %c":" ")+l[0]+(c?"%c ":" ")+"+"+e.humanize(this.diff),!!c){var u="color: "+this.color;l.splice(1,0,u,"color: inherit");var h=0,f=0;l[0].replace(/%[a-zA-Z%]/g,function(d){d!=="%%"&&(h++,d==="%c"&&(f=h))}),l.splice(f,0,u)}}function i(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(l){try{l==null?e.storage.removeItem("debug"):e.storage.debug=l}catch{}}function s(){var l;try{l=e.storage.debug}catch{}return!l&&typeof process<"u"&&"env"in process&&(l={}.DEBUG),l}e.enable(s());function a(){try{return window.localStorage}catch{}}})(Eu,Eu.exports);var vl=Eu.exports,fO=qh(),uE=Ol(),dO=Nn,hE=wl,fE=hO,rr=vl("engine.io-client:polling"),pO=Jr,dE=function(){var r=Vh,e=new r({xdomain:!1});return e.responseType!=null}();function Jr(r){var e=r&&r.forceBase64;(!dE||e)&&(this.supportsBinary=!1),fO.call(this,r)}hE(Jr,fO);Jr.prototype.name="polling";Jr.prototype.doOpen=function(){this.poll()};Jr.prototype.pause=function(r){var e=this;this.readyState="pausing";function t(){rr("paused"),e.readyState="paused",r()}if(this.polling||!this.writable){var n=0;this.polling&&(rr("we are currently polling - waiting to pause"),n++,this.once("pollComplete",function(){rr("pre-pause polling complete"),--n||t()})),this.writable||(rr("we are currently writing - waiting to pause"),n++,this.once("drain",function(){rr("pre-pause writing complete"),--n||t()}))}else t()};Jr.prototype.poll=function(){rr("polling"),this.polling=!0,this.doPoll(),this.emit("poll")};Jr.prototype.onData=function(r){var e=this;rr("polling got data %s",r);var t=function(n,i,o){if(e.readyState==="opening"&&n.type==="open"&&e.onOpen(),n.type==="close")return e.onClose(),!1;e.onPacket(n)};dO.decodePayload(r,this.socket.binaryType,t),this.readyState!=="closed"&&(this.polling=!1,this.emit("pollComplete"),this.readyState==="open"?this.poll():rr('ignoring poll - transport state "%s"',this.readyState))};Jr.prototype.doClose=function(){var r=this;function e(){rr("writing close packet"),r.write([{type:"close"}])}this.readyState==="open"?(rr("transport open - closing"),e()):(rr("transport not open - deferring close"),this.once("open",e))};Jr.prototype.write=function(r){var e=this;this.writable=!1;var t=function(){e.writable=!0,e.emit("drain")};dO.encodePayload(r,this.supportsBinary,function(n){e.doWrite(n,t)})};Jr.prototype.uri=function(){var r=this.query||{},e=this.secure?"https":"http",t="";this.timestampRequests!==!1&&(r[this.timestampParam]=fE()),!this.supportsBinary&&!r.sid&&(r.b64=1),r=uE.encode(r),this.port&&(e==="https"&&Number(this.port)!==443||e==="http"&&Number(this.port)!==80)&&(t=":"+this.port),r.length&&(r="?"+r);var n=this.hostname.indexOf(":")!==-1;return e+"://"+(n?"["+this.hostname+"]":this.hostname)+t+this.path+r};var pE=Vh,gO=pO,gE=Zn,mE=wl,Au=vl("engine.io-client:polling-xhr"),yE=zh;Kh.exports=Li;Kh.exports.Request=it;function yp(){}function Li(r){if(gO.call(this,r),this.requestTimeout=r.requestTimeout,this.extraHeaders=r.extraHeaders,typeof location<"u"){var e=location.protocol==="https:",t=location.port;t||(t=e?443:80),this.xd=typeof location<"u"&&r.hostname!==location.hostname||t!==r.port,this.xs=r.secure!==e}}mE(Li,gO);Li.prototype.supportsBinary=!0;Li.prototype.request=function(r){return r=r||{},r.uri=this.uri(),r.xd=this.xd,r.xs=this.xs,r.agent=this.agent||!1,r.supportsBinary=this.supportsBinary,r.enablesXDR=this.enablesXDR,r.withCredentials=this.withCredentials,r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized,r.requestTimeout=this.requestTimeout,r.extraHeaders=this.extraHeaders,new it(r)};Li.prototype.doWrite=function(r,e){var t=typeof r!="string"&&r!==void 0,n=this.request({method:"POST",data:r,isBinary:t}),i=this;n.on("success",e),n.on("error",function(o){i.onError("xhr post error",o)}),this.sendXhr=n};Li.prototype.doPoll=function(){Au("xhr poll");var r=this.request(),e=this;r.on("data",function(t){e.onData(t)}),r.on("error",function(t){e.onError("xhr poll error",t)}),this.pollXhr=r};function it(r){this.method=r.method||"GET",this.uri=r.uri,this.xd=!!r.xd,this.xs=!!r.xs,this.async=r.async!==!1,this.data=r.data!==void 0?r.data:null,this.agent=r.agent,this.isBinary=r.isBinary,this.supportsBinary=r.supportsBinary,this.enablesXDR=r.enablesXDR,this.withCredentials=r.withCredentials,this.requestTimeout=r.requestTimeout,this.pfx=r.pfx,this.key=r.key,this.passphrase=r.passphrase,this.cert=r.cert,this.ca=r.ca,this.ciphers=r.ciphers,this.rejectUnauthorized=r.rejectUnauthorized,this.extraHeaders=r.extraHeaders,this.create()}gE(it.prototype);it.prototype.create=function(){var r={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized;var e=this.xhr=new pE(r),t=this;try{Au("xhr open %s: %s",this.method,this.uri),e.open(this.method,this.uri,this.async);try{if(this.extraHeaders){e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0);for(var n in this.extraHeaders)this.extraHeaders.hasOwnProperty(n)&&e.setRequestHeader(n,this.extraHeaders[n])}}catch{}if(this.method==="POST")try{this.isBinary?e.setRequestHeader("Content-type","application/octet-stream"):e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{e.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in e&&(e.withCredentials=this.withCredentials),this.requestTimeout&&(e.timeout=this.requestTimeout),this.hasXDR()?(e.onload=function(){t.onLoad()},e.onerror=function(){t.onError(e.responseText)}):e.onreadystatechange=function(){if(e.readyState===2)try{var i=e.getResponseHeader("Content-Type");(t.supportsBinary&&i==="application/octet-stream"||i==="application/octet-stream; charset=UTF-8")&&(e.responseType="arraybuffer")}catch{}e.readyState===4&&(e.status===200||e.status===1223?t.onLoad():setTimeout(function(){t.onError(typeof e.status=="number"?e.status:0)},0))},Au("xhr data %s",this.data),e.send(this.data)}catch(i){setTimeout(function(){t.onError(i)},0);return}typeof document<"u"&&(this.index=it.requestsCount++,it.requests[this.index]=this)};it.prototype.onSuccess=function(){this.emit("success"),this.cleanup()};it.prototype.onData=function(r){this.emit("data",r),this.onSuccess()};it.prototype.onError=function(r){this.emit("error",r),this.cleanup(!0)};it.prototype.cleanup=function(r){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=yp:this.xhr.onreadystatechange=yp,r)try{this.xhr.abort()}catch{}typeof document<"u"&&delete it.requests[this.index],this.xhr=null}};it.prototype.onLoad=function(){var r;try{var e;try{e=this.xhr.getResponseHeader("Content-Type")}catch{}e==="application/octet-stream"||e==="application/octet-stream; charset=UTF-8"?r=this.xhr.response||this.xhr.responseText:r=this.xhr.responseText}catch(t){this.onError(t)}r!=null&&this.onData(r)};it.prototype.hasXDR=function(){return typeof XDomainRequest<"u"&&!this.xs&&this.enablesXDR};it.prototype.abort=function(){this.cleanup()};it.requestsCount=0;it.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Op);else if(typeof addEventListener=="function"){var OE="onpagehide"in yE?"pagehide":"unload";addEventListener(OE,Op,!1)}}function Op(){for(var r in it.requests)it.requests.hasOwnProperty(r)&&it.requests[r].abort()}var wE=Kh.exports,ef=pO,vE=wl,wp=zh,bE=Di,SE=/\n/g,ME=/\\n/g,Qs;function kE(){}function Di(r){ef.call(this,r),this.query=this.query||{},Qs||(Qs=wp.___eio=wp.___eio||[]),this.index=Qs.length;var e=this;Qs.push(function(t){e.onData(t)}),this.query.j=this.index,typeof addEventListener=="function"&&addEventListener("beforeunload",function(){e.script&&(e.script.onerror=kE)},!1)}vE(Di,ef);Di.prototype.supportsBinary=!1;Di.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),ef.prototype.doClose.call(this)};Di.prototype.doPoll=function(){var r=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(i){r.onError("jsonp poll error",i)};var t=document.getElementsByTagName("script")[0];t?t.parentNode.insertBefore(e,t):(document.head||document.body).appendChild(e),this.script=e;var n=typeof navigator<"u"&&/gecko/i.test(navigator.userAgent);n&&setTimeout(function(){var i=document.createElement("iframe");document.body.appendChild(i),document.body.removeChild(i)},100)};Di.prototype.doWrite=function(r,e){var t=this;if(!this.form){var n=document.createElement("form"),i=document.createElement("textarea"),o=this.iframeId="eio_iframe_"+this.index,s;n.className="socketio",n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.target=o,n.method="POST",n.setAttribute("accept-charset","utf-8"),i.name="d",n.appendChild(i),document.body.appendChild(n),this.form=n,this.area=i}this.form.action=this.uri();function a(){l(),e()}function l(){if(t.iframe)try{t.form.removeChild(t.iframe)}catch(u){t.onError("jsonp polling iframe removal error",u)}try{var c='