varCK=Object.create;varkc=Object.defineProperty;varkK=Object.getOwnPropertyDescriptor;varPK=Object.getOwnPropertyNames;varDK=Object.getPrototypeOf,LK=Object.prototype.hasOwnProperty;varC=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),dx=(t,e)=>{for(varnine)kc(t,n,{get:e[n],enumerable:!0})},hx=(t,e,n,r)=>{if(e&&typeofe=="object"||typeofe=="function")for(letlofPK(e))!LK.call(t,l)&&l!==n&&kc(t,l,{get:()=>e[l],enumerable:!(r=kK(e,l))||r.enumerable});returnt};varbr=(t,e,n)=>(n=t!=null?CK(DK(t)):{},hx(e||!t||!t.__esModule?kc(n,"default",{value:t,enumerable:!0}):n,t)),FK=t=>hx(kc({},"__esModule",{value:!0}),t);vargx=C(($Ee,mx)=>{"use strict";functionMK(t){vare=newt,n=e;functionr(){vari=e;returni.next?e=i.next:(e=newt,n=e),i.next=null,i}functionl(i){n.next=i,n=i}return{get:r,release:l}}mx.exports=MK});var_p=C((jEe,vp)=>{"use strict";var$K=gx();functionyx(t,e,n){if(typeoft=="function"&&(n=e,e=t,t=null),!(n>=1))thrownewError("fastqueue concurrency must be equal to or greater than 1");varr=$K(jK),l=null,i=null,s=0,a=null,o={push:_,drain:m2,saturated:m2,pause:f,paused:!1,getconcurrency(){returnn},setconcurrency(w){if(!(w>=1))thrownewError("fastqueue concurrency must be equal to or greater than 1");if(n=w,!o.paused)for(;l&&s<n;)s++,T()},running:c,resume:h,idle:g,length:p,getQueue:m,unshift:S,empty:m2,kill:x,killAndDrain:v,error:b};returno;functionc(){returns}functionf(){o.paused=!0}functionp(){for(varw=l,N=0;w;)w=w.next,N++;returnN}functionm(){for(varw=l,N=[];w;)N.push(w.value),w=w.next;returnN}functionh(){if(o.paused)for(o.paused=!1;l&&s<n;)s++,T()}functiong(){returns===0&&o.length()===0}function_(w,N){varO=r.get();O.context=t,O.release=T,O.value=w,O.callback=N||m2,O.errorHandler=a,s>=n||o.paused?i?(i.next=O,i=O):(l=O,i=O,o.saturated()):(s++,e.call(t,O.value,O.worked))}functionS(w,N){varO=r.get();O.context=t,O.release=T,O.value=w,O.callback=N||m2,O.errorHandler=a,s>=n||o.paused?l?(O.next=l,l=O):(l=O,i=O,o.saturated()):(s++,e.call(t,O.value,O.worked))}functionT(w){w&&r.release(w);varN=l;N&&s<=n?o.paused?s--:(i===l&&(i=null),l=N.next,N.next=null,e.call(t,N.value,N.worked),i===null&&o.empty()):--s===0&&o.drain()}functionx(){l=null,i=null,o.drain=m2}functionv(){l=null,i=null,o.drain(),o.drain=m2}functionb(w){a=w}}functionm2(){}functionjK(){this.value=null,this.callback=m2,this.next=null,this.release=m2,this.context=null,this.errorHandler=null;vart=this;this.worked=function(n,r){varl=t.callback,i=t.errorHandler,s=t.value;t.value=null,t.callback=m2,t.errorHandler&&i(n,s),l.call(t.context,n,r),t.release(t)}}functionUK(t,e,n){typeoft=="function"&&(n=e,e=t,t=null);functionr(f,p){e.call(this,f).then(function(m){p(null,m)},p)}varl=yx(t,r,n),i=l.push,s=l.unshift;returnl.push=a,l.unshift=o,l.drained=c,l;functiona(f){varp=newPromise(function(m,h){i(f,function(g,_){if(g){h(g);return}m(_)})});returnp.catch(m2),p}functiono(f){varp=newPromise(function(m,h){s(f,function(g,_){if(g){h(g);return}m(_)})});returnp.catch(m2),p}functionc(){if(l.idle())returnnewPromise(function(m){m()});varf=l.drain,p=newPromise(function(m){l.drain=function(){f(),m()}});returnp}}vp.exports=yx;vp.exports.promise=UK});varbp=C((UEe,vx)=>{"use strict";var{inherits:BK,format:Ep}=require("util");functionoa(t,e,n=Error){if(!t)thrownewError("Avvio error code must not be empty");if(!e)thrownewError("Avvio base error message must not be empty");functionr(l,i,s){if(!new.target)returnnewr(l,i,s);Error.captureStackTrace(this,r),this.code=t,this.message=e,this.name="AvvioError",l&&i&&s?this.message=Ep(e,l,i,s):l&&i?this.message=Ep(e,l,i):l?this.message=Ep(e,l):this.message=e}returnr.prototype[Symbol.toStringTag]="Error",r.prototype.toString=function(){return`${this.name} [${this.code}]: ${this.message}`},BK(r,n),r}vx.exports={createError:oa,AVV_ERR_EXPOSE_ALREADY_DEFINED:oa("AVV_ERR_EXPOSE_ALREADY_DEFINED","'%s' () is already defined, specify an expose option"),AVV_ERR_CALLBACK_NOT_FN:oa("AVV_ERR_CALLBACK_NOT_FN","Callback for '%s' hook is not a function. Received: '%s'"),AVV_ERR_PLUGIN_NO
deps:${n}}`};var Uie={keyword:"dependencies",type:"object",schemaType:"object",error:vi.error,code(t){let[e,n]=Bie(t);wN(t,e),RN(t,n)}};function Bie({schema:t}){let e={},n={};for(let r in t){if(r==="__proto__")continue;let l=Array.isArray(t[r])?e:n;l[r]=t[r]}return[e,n]}function wN(t,e=t.schema){let{gen:n,data:r,it:l}=t;if(Object.keys(e).length===0)return;let i=n.let("missing");for(let s in e){let a=e[s];if(a.length===0)continue;let o=(0,k1.propertyInData)(n,r,s,l.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),l.allErrors?n.if(o,()=>{for(let c of a)(0,k1.checkReportMissingProp)(t,c)}):(n.if((0,am._)`${o}&&(${(0,k1.checkMissingProp)(t,a,i)})`),(0,k1.reportMissingProp)(t,i),n.else())}}vi.validatePropertyDeps=wN;function RN(t,e=t.schema){let{gen:n,data:r,keyword:l,it:i}=t,s=n.name("valid");for(let a in e)(0,jie.alwaysValidSchema)(i,e[a])||(n.if((0,k1.propertyInData)(n,r,a,i.opts.ownProperties),()=>{let o=t.subschema({keyword:l,schemaProp:a},s);t.mergeValidEvaluated(o,s)},()=>n.var(s,!0)),t.ok(s))}vi.validateSchemaDeps=RN;vi.default=Uie});var IN=C(om=>{"use strict";Object.defineProperty(om,"__esModule",{value:!0});var NN=Ze(),Hie=_t(),qie={message:"property name must be valid",params:({params:t})=>(0,NN._)`{propertyName:${t.propertyName}}`},Vie={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:qie,code(t){let{gen:e,schema:n,data:r,it:l}=t;if((0,Hie.alwaysValidSchema)(l,n))return;let i=e.name("valid");e.forIn("key",r,s=>{t.setParams({propertyName:s}),t.subschema({keyword:"propertyNames",data:s,dataTypes:["string"],propertyName:s,compositeRule:!0},i),e.if((0,NN.not)(i),()=>{t.error(!0),l.allErrors||e.break()})}),t.ok(i)}};om.default=Vie});var cm=C(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var M6=Xr(),V2=Ze(),zie=v2(),$6=_t(),Gie={message:"must NOT have additional properties",params:({params:t})=>(0,V2._)`{additionalProperty:${t.additionalProperty}}`},Xie={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Gie,code(t){let{gen:e,schema:n,parentSchema:r,data:l,errsCount:i,it:s}=t;if(!i)throw new Error("ajv implementation error");let{allErrors:a,opts:o}=s;if(s.props=!0,o.removeAdditional!=="all"&&(0,$6.alwaysValidSchema)(s,n))return;let c=(0,M6.allSchemaProperties)(r.properties),f=(0,M6.allSchemaProperties)(r.patternProperties);p(),t.ok((0,V2._)`${i}===${zie.default.errors}`);function p(){e.forIn("key",l,S=>{!c.length&&!f.length?g(S):e.if(m(S),()=>g(S))})}function m(S){let T;if(c.length>8){let x=(0,$6.schemaRefOrVal)(s,r.properties,"properties");T=(0,M6.isOwnProperty)(e,x,S)}else c.length?T=(0,V2.or)(...c.map(x=>(0,V2._)`${S}===${x}`)):T=V2.nil;return f.length&&(T=(0,V2.or)(T,...f.map(x=>(0,V2._)`${(0,M6.usePattern)(t,x)}.test(${S})`))),(0,V2.not)(T)}function h(S){e.code((0,V2._)`delete${l}[${S}]`)}function g(S){if(o.removeAdditional==="all"||o.removeAdditional&&n===!1){h(S);return}if(n===!1){t.setParams({additionalProperty:S}),t.error(),a||e.break();return}if(typeof n=="object"&&!(0,$6.alwaysValidSchema)(s,n)){let T=e.name("valid");o.removeAdditional==="failing"?(_(S,T,!1),e.if((0,V2.not)(T),()=>{t.reset(),h(S)})):(_(S,T),a||e.if((0,V2.not)(T),()=>e.break()))}}function _(S,T,x){let v={keyword:"additionalProperties",dataProp:S,dataPropType:$6.Type.Str};x===!1&&Object.assign(v,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(v,T)}}};um.default=Xie});var PN=C(pm=>{"use strict";Object.defineProperty(pm,"__esModule",{value:!0});var Wie=Qo(),CN=Xr(),fm=_t(),kN=cm(),Kie={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:n,parentSchema:r,data:l,it:i}=t;i.opts.removeAdditional==="all"&&r.additionalProperties===void 0&&kN.default.code(new Wie.KeywordCxt(i,kN.default,"additionalProperties"));let s=(0,CN.allSchemaProperties)(n);for(let p of s)i.definedProperties.add(p);i.opts.unevaluated&&s.length&&i.props!==!0&&(i.props=fm.mergeEvaluated.props(e,(0,fm.toHash)(s),i.props));let a=s.filter(p=>!(0,fm.alwaysValidSchema)(i,n[p]));if(a.le
`;let a=new h0e(e),o=new m0e(e.ajv);for(let f of n.validatorSchemasIds){let p=n.refResolver.getSchema(f);o.addSchema(p,f);let m=n.refResolver.getSchemaDependencies(f);for(let[h,g]of Object.entries(m))o.addSchema(g,h)}if(e.debugMode&&(e.mode="debug"),e.mode==="debug")return{validator:o,serializer:a,code:`validator
${s}`,ajv:o.ajv};let c=new Function("validator","serializer",s);return e.mode==="standalone"?Bm()(c,n,a,o):c(o,a)}var v0e=["properties","required","additionalProperties","patternProperties","maxProperties","minProperties","dependencies"],_0e=["items","additionalItems","maxItems","minItems","uniqueItems","contains"],E0e=["maxLength","minLength","pattern"],b0e=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum"];function tD(t){for(var e of v0e)if(e in t)return"object";for(var e of _0e)if(e in t)return"array";for(var e of E0e)if(e in t)return"string";for(var e of b0e)if(e in t)return"number";return t.type}function T0e(t,e){let n=e.schema,r=Object.keys(n.properties||{}),l=`
`,l}function S0e(t,e){let n="",r=e.schema,l=r.required||[],i=e.getPropertyLocation("properties"),s=[],a=[];if(r.properties)for(let c of Object.keys(r.properties)){if(l.indexOf(c)===-1)continue;let f=i.getPropertyLocation(c);f.schema.$ref&&(f=mu(t,e,f.schema.$ref));let p=JSON.stringify(c);f.schema.default===void 0&&(n+=`if(obj[${p}]===undefined)thrownewError('${p} is required!')
`,a.push(c)),s.push(c)}for(let c of l)s.indexOf(c)===-1&&(n+=`if(obj['${c}']===undefined)thrownewError('"${c}" is required!')
`;let o=t.wrapObjects;if(t.wrapObjects=!0,r.properties)for(let c of Object.keys(r.properties)){let f=i.getPropertyLocation(c);f.schema.$ref&&(f=mu(t,e,f.schema.$ref));let p=JSON.stringify(c);if(a.indexOf(c)!==-1)n+=`
${e}`)}function q8(t,e,n,r){if((t.isLeafNode||r.commonPrefix!==!1)&&(n=n||"(empty root node)",e=e[n]={},t.isLeafNode&&(e[lF]=w6e(t,n,r)),n=""),t.staticChildren)for(let l of Object.values(t.staticChildren))q8(l,e,n+l.prefix,r);if(t.parametricChildren)for(let l of Object.values(t.parametricChildren)){let i=Array.from(l.nodePaths).join("|");q8(l,e,n+i,r)}t.wildcardChild&&q8(t.wildcardChild,e,"*",r)}function R6e(t,e){let n={};return q8(t,n,t.prefix,e),iF(n)}aF.exports={prettyPrintTree:R6e}});var cF=C((fAe,uF)=>{"use strict";var O6e=H8(),By=class{constructor(){this.unconstrainedHandler=null,this.constraints=[],this.handlers=[],this.constrainedHandlerStores=null}getMatchingHandler(e){return e===void 0?this.unconstrainedHandler:this._getHandlerMatchingConstraints(e)}addHandler(e,n){let r=n.params,l=n.opts.constraints||{},i={params:r,constraints:l,handler:n.handler,store:n.store||null,_createParamsObject:this._compileCreateParamsObject(r)},s=Object.keys(l);s.length===0&&(this.unconstrainedHandler=i);for(let o of s)this.constraints.includes(o)||(o==="version"?this.constraints.unshift(o):this.constraints.push(o));let a=s.includes(O6e.name);if(!a&&this.handlers.length>=32)throw new Error("find-my-way supports a maximum of 32 route handlers per node when there are constraints, limit reached");this.handlers.push(i),this.handlers.sort((o,c)=>Object.keys(o.constraints).length-Object.keys(c.constraints).length),a||this._compileGetHandlerMatchingConstraints(e,l)}_compileCreateParamsObject(e){let n=[];for(let r=0;r<e.length;r++)n.push(`'${e[r]}':paramsArray[${r}]`);return new Function("paramsArray",`return{${n.join(",")}}`)}_getHandlerMatchingConstraints(){return null}_buildConstraintStore(e,n){for(let r=0;r<this.handlers.length;r++){let i=this.handlers[r].constraints[n];if(i!==void 0){let s=e.get(i)||0;s|=1<<r,e.set(i,s)}}}_constrainedIndexBitmask(e){let n=0;for(let r=0;r<this.handlers.length;r++)this.handlers[r].constraints[e]!==void 0&&(n|=1<<r);return~n}_compileGetHandlerMatchingConstraints(e){this.constrainedHandlerStores={};for(let r of this.constraints){let l=e.newStoreForConstraint(r);this.constrainedHandlerStores[r]=l,this._buildConstraintStore(l,r)}let n=[];n.push(`
`)}for(let r in e.strategies)e.strategies[r].mustMatchWhenDerived&&!this.constraints.includes(r)&&n.push(`if(derivedConstraints.${r}!==undefined)returnnull`);n.push("return this.handlers[Math.floor(Math.log2(candidates))]"),this._getHandlerMatchingConstraints=new Function("derivedConstraints",n.join(`
`))}};uF.exports=By});var pF=C((pAe,fF)=>{"use strict";var N6e=cF(),K8={STATIC:0,PARAMETRIC:1,WILDCARD:2},V8=class{constructor(){this.isLeafNode=!1,this.routes=null,this.handlerStorage=null}addRoute(e,n){this.routes===null&&(this.routes=[]),this.handlerStorage===null&&(this.handlerStorage=new N6e),this.isLeafNode=!0,this.routes.push(e),this.handlerStorage.addHandler(n,e)}},z8=class extends V8{constructor(){super(),this.staticChildren={}}findStaticMatchingChild(e,n){let r=this.staticChildren[e.charAt(n)];return r===void 0||!r.matchPrefix(e,n)?null:r}getStaticChild(e,n=0){if(e.length===n)return this;let r=this.findStaticMatchingChild(e,n);return r?r.getStaticChild(e,n+r.prefix.length):null}createStaticChild(e){if(e.length===0)return this;let n=this.staticChildren[e.charAt(0)];if(n){let l=1;for(;l<n.prefix.length;l++)if(e.charCodeAt(l)!==n.prefix.charCodeAt(l)){n=n.split(this,l);break}return n.createStaticChild(e.slice(l))}let r=e.charAt(0);return this.staticChildren[r]=new G8(e),this.staticChildren[r]}},G8=class t extends z8{constructor(e){super(),this.prefix=e,this.wildcardChild=null,this.parametricChildren=[],this.kind=K8.STATIC,this._compilePrefixMatch()}getParametricChild(e){let n=e&&e.source,r=this.parametricChildren.find(l=>(l.regex&&l.regex.source)===n);return r||null}createParametricChild(e,n,r){let l=this.getParametricChild(e);return l?(l.nodePaths.add(r),l):(l=new X8(e,n,r),this.parametricChildren.push(l),this.parametricChildren.sort((i,s)=>i.isRegex?s.isRegex?i.staticSuffix===null?1:s.staticSuffix===null?-1:s.staticSuffix.endsWith(i.staticSuffix)?1:i.staticSuffix.endsWith(s.staticSuffix)?-1:0:-1:1),l)}getWildcardChild(){return this.wildcardChild?this.wildcardChild:null}createWildcardChild(){return this.wildcardChild=this.getWildcardChild()||new W8,this.wildcardChild}split(e,n){let r=this.prefix.slice(0,n),l=this.prefix.slice(n);this.prefix=l,this._compilePrefixMatch();let i=new t(r);return i.staticChildren[l.charAt(0)]=this,e.staticChildren[r.charAt(0)]=i,i}getNextNode(e,n,r,l){let i=this.findStaticMatchingChild(e,n),s=0;if(i===null){if(this.parametricChildren.length===0)return this.wildcardChild;i=this.parametricChildren[0],s=1}this.wildcardChild!==null&&r.push({paramsCount:l,brotherPathIndex:n,brotherNode:this.wildcardChild});for(let a=this.parametricChildren.length-1;a>=s;a--)r.push({paramsCount:l,brotherPathIndex:n,brotherNode:this.parametricChildren[a]});return i}_compilePrefixMatch(){if(this.prefix.length===1){this.matchPrefix=()=>!0;return}let e=[];for(let n=1;n<this.prefix.length;n++){let r=this.prefix.charCodeAt(n);e.push(`path.charCodeAt(i+${n})===${r}`)}this.matchPrefix=new Function("path","i",`return${e.join(" && ")}`)}},X8=class extends z8{constructor(e,n,r){super(),this.isRegex=!!e,this.regex=e||null,this.staticSuffix=n||null,this.kind=K8.PARAMETRIC,this.nodePaths=new Set([r])}getNextNode(e,n){return this.findStaticMatchingChild(e,n)}},W8=class extends V8{constructor(){super(),this.kind=K8.WILDCARD}getNextNode(){return null}};fF.exports={StaticNode:G8,ParametricNode:X8,WildcardNode:W8,NODE_TYPES:K8}});var hF=C((dAe,dF)=>{"use strict";var I6e=require("assert");function h0(){if(!(this instanceof h0))return new h0;this.store={},this.maxMajor=0,this.maxMinors={},this.maxPatches={}}h0.prototype.set=function(t,e){if(typeof t!="string")throw new TypeError("Version should be a string");let[n,r,l]=t.split(".");return n=Number(n)||0,r=Number(r)||0,l=Number(l)||0,n>=this.maxMajor&&(this.maxMajor=n,this.store.x=e,this.store["*"]=e,this.store["x.x"]=e,this.store["x.x.x"]=e),r>=(this.maxMinors[n]||0)&&(this.maxMinors[n]=r,this.store[`${n}.x`]=e,this.store[`${n}.x.x`]=e),l>=(this.store[`${n}.${r}`]||0)&&(this.maxPatches[`${n}.${r}`]=l,this.store[`${n}.${r}.x`]=e),this.store[`${n}.${r}.${l}`]=e,this};h0.prototype.get=function(t){return this.store[t]};dF.exports={name:"version",mustMatchWhenDerived:!0,storage:h0,validate(t){I6e(typeof t=="string","Version should be a string")}}});var gF=C((hAe,mF)=>{"use strict";var C6e=require("assert");function k6e(){let t={},e=[];return{get:n=>{let r=t[n];if(r)return r;for
`)).bind(this)}};yF.exports=qy});var EF=C((gAe,_F)=>{"use strict";var L6e=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"];_F.exports=L6e});var SF=C((yAe,TF)=>{"use strict";function bF(t,e){return t===50?e===53?"%":e===51?"#":e===52?"$":e===54?"&":e===66||e===98?"+":e===67||e===99?",":e===70||e===102?"/":null:t===51?e===65||e===97?":":e===66||e===98?";":e===68||e===100?"=":e===70||e===102?"?":null:t===52&&e===48?"@":null}function F6e(t,e){let n=!1,r=!1,l="";for(let s=1;s<t.length;s++){let a=t.charCodeAt(s);if(a===37){let o=t.charCodeAt(s+1),c=t.charCodeAt(s+2);bF(o,c)===null?n=!0:(r=!0,o===50&&c===53&&(n=!0,t=t.slice(0,s+1)+"25"+t.slice(s+1),s+=2),s+=2)}else if(a===63||a===35||a===59&&e){l=t.slice(s+1),t=t.slice(0,s);break}}return{path:n?decodeURI(t):t,querystring:l,shouldDecodeParam:r}}function M6e(t){let e=t.indexOf("%");if(e===-1)return t;let n="",r=e;for(let l=e;l<t.length;l++)if(t.charCodeAt(l)===37){let i=t.charCodeAt(l+1),s=t.charCodeAt(l+2),a=bF(i,s);n+=t.slice(r,l)+a,r=l+3}return t.slice(0,e)+n+t.slice(r)}TF.exports={safeDecodeURI:F6e,safeDecodeURIComponent:M6e}});var Ky=C((vAe,IF)=>{"use strict";var ur=require("assert"),$6e=VL(),Y8=eF(),Gy=Yo(),{prettyPrintTree:j6e}=oF(),{StaticNode:xF,NODE_TYPES:Vy}=pF(),U6e=vF(),Ou=EF(),zy=H8(),{safeDecodeURI:B6e,safeDecodeURIComponent:AF}=SF(),wF=/^https?:\/\/.*?\//,La=/(\/:[^/()]*?)\?(\/?)/;if(!Y8(wF))throw new Error("the FULL_PATH_REGEXP is not safe, update this module");if(!Y8(La))throw new Error("the OPTIONAL_PARAM_REGEXP is not safe, update this module");function zn(t){if(!(this instanceof zn))return new zn(t);t=t||{},this._opts=t,t.defaultRoute?(ur(typeof t.defaultRoute=="function","The default route must be a function"),this.defaultRoute=t.defaultRoute):this.defaultRoute=null,t.onBadUrl?(ur(typeof t.onBadUrl=="function","The bad url handler must be a function"),this.onBadUrl=t.onBadUrl):this.onBadUrl=null,t.buildPrettyMeta?(ur(typeof t.buildPrettyMeta=="function","buildPrettyMeta must be a function"),this.buildPrettyMeta=t.buildPrettyMeta):this.buildPrettyMeta=H6e,t.querystringParser?(ur(typeof t.querystringParser=="function","querystringParser must be a function"),this.querystringParser=t.querystringParser):this.querystringParser=e=>e===""?{}:$6e.parse(e),this.caseSensitive=t.caseSensitive===void 0?!0:t.caseSensitive,this.ignoreTrailingSlash=t.ignoreTrailingSlash||!1,this.ignoreDuplicateSlashes=t.ignoreDuplicateSlashes||!1,this.maxParamLength=t.maxParamLength||100,this.allowUnsafeRegex=t.allowUnsafeRegex||!1,this.constrainer=new U6e(t.constraints),this.useSemicolonDelimiter=t.useSemicolonDelimiter||!1,this.routes=[],this.trees={}}zn.prototype.on=function(e,n,r,l,i){typeof r=="function"&&(l!==void 0&&(i=l),l=r,r={}),ur(typeof n=="string","Path should be a string"),ur(n.length>0,"The path could not be empty"),ur(n[0]==="/"||n[0]==="*","The first character of a path should be `/` or `*`"),ur(typeof l=="function","Handler should be a function");let s=n.match(La);if(s){ur(n.length===s.index+s[0].length,"Optional Parameter needs to be the last parameter of the path");let c=n.replace(La,"$1$2"),f=n.replace(La,"$2");this.on(e,c,r,l,i),this.on(e,f,r,l,i);return}let a=n;this.ignoreDuplicateSlashes&&(n=Xy(n)),this.ignoreTrailingSlash&&(n=Wy(n));let o=Array.isArray(e)?e:[e];for(let c of o)ur(typeof c=="string","Method should be a string"),ur(Ou.includes(c),`Method'${c}'isnotanhttpmethod.`),this._on(c,n,r,l,i,a)};zn.prototype._on=function(e,n,r,l,i){let s={};r.constraints!==void 0&&(ur(typeof r.constraints=="object"&&r.constraints!==null,"Constraints should be an object"),Object.keys(r.constraints).length!==0&&(s=r.constraints)),this.constrainer.validateConstraints(s),this.constrainer.noteUsage(s),this.trees[e]===void 0&&(this.trees[e]=new xF("/"));let a=n;if(a==="*"&&this.trees[e].prefix.length!==0){let m=this.trees[e]
`;Wt.DEFAULT_CONTENT_TYPE="application/octet-stream";Wt.prototype.append=function(t,e,n){n=n||{},typeof n=="string"&&(n={filename:n});var r=KE.prototype.append.bind(this);if(typeof e=="number"&&(e=""+e),WV.isArray(e)){this._error(new Error("Arrays are not supported."));return}var l=this._multiPartHeader(t,e,n),i=this._multiPartFooter();r(l),r(e),r(i),this._trackLength(l,e,n)};Wt.prototype._trackLength=function(t,e,n){var r=0;n.knownLength!=null?r+=+n.knownLength:Buffer.isBuffer(e)?r=e.length:typeof e=="string"&&(r=Buffer.byteLength(e)),this._valueLength+=r,this._overheadLength+=Buffer.byteLength(t)+Wt.LINE_BREAK.length,!(!e||!e.path&&!(e.readable&&e.hasOwnProperty("httpVersion"))&&!(e instanceof yve))&&(n.knownLength||this._valuesToMeasure.push(e))};Wt.prototype._lengthRetriever=function(t,e){t.hasOwnProperty("fd")?t.end!=null&&t.end!=1/0&&t.start!=null?e(null,t.end+1-(t.start?t.start:0)):gve.stat(t.path,function(n,r){var l;if(n){e(n);return}l=r.size-(t.start?t.start:0),e(null,l)}):t.hasOwnProperty("httpVersion")?e(null,+t.headers["content-length"]):t.hasOwnProperty("httpModule")?(t.on("response",function(n){t.pause(),e(null,+n.headers["content-length"])}),t.resume()):e("Unknown stream")};Wt.prototype._multiPartHeader=function(t,e,n){if(typeof n.header=="string")return n.header;var r=this._getContentDisposition(e,n),l=this._getContentType(e,n),i="",s={"Content-Disposition":["form-data",'name="'+t+'"'].concat(r||[]),"Content-Type":[].concat(l||[])};typeof n.header=="object"&&WE(s,n.header);var a;for(var o in s)s.hasOwnProperty(o)&&(a=s[o],a!=null&&(Array.isArray(a)||(a=[a]),a.length&&(i+=o+": "+a.join("; ")+Wt.LINE_BREAK)));return"--"+this.getBoundary()+Wt.LINE_BREAK+i+Wt.LINE_BREAK};Wt.prototype._getContentDisposition=function(t,e){var n,r;return typeof e.filepath=="string"?n=GE.normalize(e.filepath).replace(/\\/g,"/"):e.filename||t.name||t.path?n=GE.basename(e.filename||t.name||t.path):t.readable&&t.hasOwnProperty("httpVersion")&&(n=GE.basename(t.client._httpMessage.path||"")),n&&(r='filename="'+n+'"'),r};Wt.prototype._getContentType=function(t,e){var n=e.contentType;return!n&&t.name&&(n=XE.lookup(t.name)),!n&&t.path&&(n=XE.lookup(t.path)),!n&&t.readable&&t.hasOwnProperty("httpVersion")&&(n=t.headers["content-type"]),!n&&(e.filepath||e.filename)&&(n=XE.lookup(e.filepath||e.filename)),!n&&typeof t=="object"&&(n=Wt.DEFAULT_CONTENT_TYPE),n};Wt.prototype._multiPartFooter=function(){return function(t){var e=Wt.LINE_BREAK,n=this._streams.length===0;n&&(e+=this._lastBoundary()),t(e)}.bind(this)};Wt.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+Wt.LINE_BREAK};Wt.prototype.getHeaders=function(t){var e,n={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(e in t)t.hasOwnProperty(e)&&(n[e.toLowerCase()]=t[e]);return n};Wt.prototype.setBoundary=function(t){this._boundary=t};Wt.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};Wt.prototype.getBuffer=function(){for(var t=new Buffer.alloc(0),e=this.getBoundary(),n=0,r=this._streams.length;n<r;n++)typeof this._streams[n]!="function"&&(Buffer.isBuffer(this._streams[n])?t=Buffer.concat([t,this._streams[n]]):t=Buffer.concat([t,Buffer.from(this._streams[n])]),(typeof this._streams[n]!="string"||this._streams[n].substring(2,e.length+2)!==e)&&(t=Buffer.concat([t,Buffer.from(Wt.LINE_BREAK)])));return Buffer.concat([t,Buffer.from(this._lastBoundary())])};Wt.prototype._generateBoundary=function(){for(var t="--------------------------",e=0;e<24;e++)t+=Math.floor(Math.random()*10).toString(16);this._boundary=t};Wt.prototype.getLengthSync=function(){var t=this._overheadLength+this._valueLength;return this._streams.length&&(t+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),t};Wt.prototype.hasKnownLength=function(){var t=!0;return this._valuesToMeasure.length&&(t=!1),t};Wt.prototype.getLength=function(t){var e=this._overheadLength+this._valueLength;if(this._streams.length&&(e+=this._lastBoundary().length),!this._valuesToMeasure
`,p.message,p.stack);var m=new Error("tunneling socket could not be established, cause="+p.message);m.code="ECONNRESET",e.request.emit("error",m),r.removeSocket(l)}};I3.prototype.removeSocket=function(e){var n=this.sockets.indexOf(e);if(n!==-1){this.sockets.splice(n,1);var r=this.requests.shift();r&&this.createSocket(r,function(l){r.request.onSocket(l)})}};function Zz(t,e){var n=this;I3.prototype.createSocket.call(n,t,function(r){var l=t.request.getHeader("host"),i=Ib({},n.options,{socket:r,servername:l?l.replace(/:.*$/,""):t.host}),s=g_e.connect(0,i);n.sockets[n.sockets.indexOf(r)]=s,e(s)})}function eG(t,e,n){return typeof t=="string"?{host:t,port:e,localAddress:n}:t}function Ib(t){for(var e=1,n=arguments.length;e<n;++e){var r=arguments[e];if(typeof r=="object")for(var l=Object.keys(r),i=0,s=l.length;i<s;++i){var a=l[i];r[a]!==void 0&&(t[a]=r[a])}}return t}var Ns;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?Ns=function(){var t=Array.prototype.slice.call(arguments);typeof t[0]=="string"?t[0]="TUNNEL: "+t[0]:t.unshift("TUNNEL:"),console.error.apply(console,t)}:Ns=function(){};R4.debug=Ns});var rG=C((MCe,nG)=>{nG.exports=tG()});var MX=C(po=>{"use strict";Object.defineProperty(po,"__esModule",{value:!0});po.removeTrailingChar=po.merge=void 0;var _Ee=(...t)=>{let e={};return t.forEach(function(n){var r;for(r in n)r in e&&e[r]===null?e[r]=n[r]:r in e&&Array.isArray(e[r])?e[r]=e[r].concat(n[r]):r in e&&typeof e[r]=="object"?e[r]=(0,po.merge)(e[r],n[r]):e[r]=n[r]}),e};po.merge=_Ee;var EEe=(t,e)=>t.length>1&&t.endsWith(e)?t.substring(0,t.length-1):t;po.removeTrailingChar=EEe});var C4=C(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.DataError=zs.DatabaseError=zs.NestedError=void 0;var U5=class extends Error{inner;id;constructor(e,n,r){super(e),this.inner=r,this.id=n,this.name=this.constructor.name}toString(){let e=this.name+": "+this.message;return this.inner?e+`:
`+this.inner:e}};zs.NestedError=U5;var lT=class extends U5{};zs.DatabaseError=lT;var iT=class extends U5{};zs.DataError=iT});var cT=C(Nl=>{"use strict";Object.defineProperty(Nl,"__esModule",{value:!0});Nl.getArrayIndicies=Nl.validateArrayIndex=Nl.validateArrayIndicies=Nl.isInt=Nl.ArrayInfo=Nl.arrayRegex=void 0;var pf=C4(),bEe=()=>/^([\.0-9a-zA-Z_$\-][0-9a-zA-Z_\-$\.]*)\[((?!(\]|\[)).*|)\]$/gm;Nl.arrayRegex=bEe;var sT={},aT=class t{property;index=0;append=!1;indicies=[];constructor(e,n){this.property=e;let r=n[0]??0;if(this.append=r===""||n[n.length-1]==="",this.indicies=n,oT(r))this.index=parseInt(r);else if(!this.append)throw new pf.DataError("Only numerical values accepted for array index",200)}static processArray(e){if(typeof e>"u")return null;if(sT[e])return sT[e];let r=(0,Nl.arrayRegex)().exec(e.trim());if(r!=null){let l=r[1],i="["+r[2].toString()+"]",s=uT(i);return $X(s),sT[e]=new t(l,s)}return null}getIndex(e,n){if(this.append)return-1;let r=this.index;if(r==-1){let l=n?e:e[this.property];return l.length===0?0:l.length-1}return r}getData(e){if(this.append)throw new pf.DataError("Can't get data when appending",100);let{index:n,dataForProperty:r}=this.getArrayDataAndIndexFromProperty(e);return r[n]}setData(e,n){if(this.append){let r=e[this.property];this.indicies.forEach(l=>{l!==""&&(l=+l,l===-1&&(l=r.length-1),r=r[+l])}),r.push(n)}else{let{index:r,dataForProperty:l}=this.getArrayDataAndIndexFromProperty(e);r===-1?l.push(n):l[r]=n}}delete(e){if(this.append)throw new pf.DataError("Can't delete an appended data",10);let{index:n,dataForProperty:r}=this.getArrayDataAndIndexFromProperty(e);r.splice(n,1)}isValid(e){let{index:n,dataForProperty:r}=this.getArrayDataAndIndexFromProperty(e);return r.hasOwnProperty(n)}getArrayDataAndIndexFromProperty(e){let n=0,r=e instanceof Array?e:e[this.property]??e;if(this.indicies.length>0){n=+this.indicies[this.indicies.length-1];for(let l=0;l<this.indicies.length-1;l++){let i=+this.indicies[l];i===-1&&(i=r.length-1),r=r[i]}n===-1&&(n=r.length-1)}return{index:n,dataForProperty:r}}isMultiDimensional(){return this.indicies.length>1}};Nl.ArrayInfo=aT;function oT(t){return!isNaN(t)&&Number(t)==t&&!isNaN(parseInt(t,10))}Nl.isInt=oT;function $X(t){let e=t.filter(n=>n==="");if(e.length>1)throw Error("Only one append index is supported for nested arrays");if(e.length===1&&t[t.length-1]!=="")throw Error("Append index must be at the end of the nested array")}Nl.validateArrayIndicies=$X;function jX(t){if(t.length!==0&&!oT(t))throw new pf.DataError("Only numerical values accepted for array index",200)}Nl.validateArrayIndex=jX;function uT(t){if(t.length===0)return[];if(t.charAt(0)!=="[")throw new Error("Invalid array syntax detected");let e=t.substring(1,t.indexOf("]"));jX(e);let n=e.length+2;return[e,...uT(t.substring(n))]}Nl.getArrayIndicies=uT});var HX=C(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.DBParentData=void 0;var UX=cT(),BX=C4(),fT=class{parent;data;db;dataPath;constructor(e,n,r,l){this.parent=l,this.data=e,this.db=n,this.dataPath=r}checkArray(e=!1){let n=UX.ArrayInfo.processArray(this.parent);if(n&&(!n.append||e)&&!n.isValid(this.data))throw new BX.DataError("DataPath: /"+this.dataPath+". Can't find index "+n.index+" in array "+n.property,10);return n}getData(){if(this.parent===void 0)return this.data;let e=this.checkArray();return e?e.getData(this.data):this.data[this.parent]}setData(e){if(this.parent===void 0){this.db.resetData(e);return}let n=UX.ArrayInfo.processArray(this.parent);if(n){if(!this.data.hasOwnProperty(n.property))this.data[n.property]=[];else if(!Array.isArray(this.data[n.property]))throw new BX.DataError("DataPath: /"+this.dataPath+". "+n.property+" is not an array.",11);n.setData(this.data,e)}else this.data[this.parent]=e}delete(){if(this.parent===void 0){this.db.resetData({});return}let e=this.checkArray(!0);e?e.delete(this.data):delete this.data[this.parent]}};df.DBParentData=fT});var VX=C((GPe,qX)=>{qX.exports=function(){"use strict";function t(){this.readers=0,this.queue=[]}function e(i,s,a){var o;typeof i!="function"?(l.hasOwnProperty(i)
)`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"},Nj={};function Ij(t,e){var n=e.getSiblings(t);return n.length<=1||(t=n.indexOf(t))<0||t===n.length-1?[]:n.slice(t+1).filter(e.isTag)}function Zv(t){return{xmlMode:!!t.xmlMode,lowerCaseAttributeNames:!!t.lowerCaseAttributeNames,lowerCaseTags:!!t.lowerCaseTags,quirksMode:!!t.quirksMode,cacheResults:!!t.cacheResults,pseudos:t.pseudos,adapter:t.adapter,equals:t.equals}}var Iv=(t,e,n,r,l)=>{let i=l(e,Zv(n),r);return i===At.trueFunc?t:i===At.falseFunc?At.falseFunc:s=>i(s)&&t(s)},Cv={is:Iv,matches:Iv,where:Iv,not(t,e,n,r,l){let i=l(e,Zv(n),r);return i===At.falseFunc?t:i===At.trueFunc?At.falseFunc:s=>!i(s)&&t(s)},has(t,e,n,r,l){let i=n.adapter,s=Zv(n),a=(s.relativeSelector=!0,e.some(f=>f.some(Jv))?[Nj]:void 0),o=l(e,s,a);if(o===At.falseFunc)return At.falseFunc;let c=function(f,p){return f===At.falseFunc?At.falseFunc:m=>p.isTag(m)&&f(m)}(o,i);if(a&&o!==At.trueFunc){let{shouldTestNextSiblings:f=!1}=o;return h=>{if(!t(h))return!1;a[0]=h;var m=i.getChildren(h),h=f?[...m,...Ij(h,i)]:m;return i.existsOne(c,h)}}return f=>t(f)&&i.existsOne(c,i.getChildren(f))}};function kv(t,e){return(t=e.getParent(t))&&e.isTag(t)?t:null}function Z7e(t,e,n,r,l){let{adapter:i,equals:s}=n;switch(e.type){case et.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case et.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case et.Attribute:if(e.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return n.xmlMode&&!n.lowerCaseAttributeNames||(e.name=e.name.toLowerCase()),K7e[e.action](t,e,n);case et.Pseudo:return function(a,o,c,f,p){let{name:m,data:h}=o;if(Array.isArray(h)){if(m in Cv)return Cv[m](a,h,c,f,p);throw new Error(`Unknownpseudo-class:${m}(${h})`)}let g=(o=c.pseudos)==null?void 0:o[m],_=typeof g=="string"?g:Q7e[m];if(typeof _=="string"){if(h!=null)throw new Error(`Pseudo${m}doesn'thaveanyarguments`);let S=V9(_);return Cv.is(a,S,c,f,p)}if(typeof g=="function")return m$(g,m,h,1),S=>g(S,h)&&a(S);if(m in Qv)return Qv[m](a,h,c,f);if(m in h$){let S=h$[m];return m$(S,m,h,2),T=>S(T,c,h)&&a(T)}throw new Error("Unknown pseudo-class :"+m)}(t,e,n,r,l);case et.Tag:{if(e.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");let a=e.name;return n.xmlMode&&!n.lowerCaseTags||(a=a.toLowerCase()),function(o){return i.getName(o)===a&&t(o)}}case et.Descendant:{if(n.cacheResults===!1||typeof WeakSet>"u")return function(o){let c=o;for(;c=kv(c,i);)if(t(c))return!0;return!1};let a=new WeakSet;return function(o){let c=o;for(;c=kv(c,i);)if(!a.has(c)){if(i.isTag(c)&&t(c))return!0;a.add(c)}return!1}}case"_flexibleDescendant":return function(a){let o=a;do if(t(o))return!0;while(o=kv(o,i));return!1};case et.Parent:return function(a){return i.getChildren(a).some(o=>i.isTag(o)&&t(o))};case et.Child:return function(a){return(a=i.getParent(a))!=null&&i.isTag(a)&&t(a)};case et.Sibling:return function(a){var o=i.getSiblings(a);for(let f=0;f<o.length;f++){var c=o[f];if(s(a,c))break;if(i.isTag(c)&&t(c))return!0}return!1};case et.Adjacent:return i.prevElementSibling?function(a){return(a=i.prevElementSibling(a))!=null&&t(a)}:function(a){var o=i.getSiblings(a);let c;for(let p=0;p<o.length;p++){var f=o[p];if(s(a,f))break;i.isTag(f)&&(c=f)}return!!c&&t(c)};case et.Universal:if(e.namespace!=null&&e.namespace!=="*")throw new Error("Namespaced universal selectors are not ye
`)}}):{name:r,value:l.replace(y$,`\r
`)}}).toArray()}}),F0=function(t,e,n){if(this.length=0,this.options=n,this._root=e,t){for(var r=0;r<t.length;r++)this[r]=t[r];this.length=t.length}},C_=(F0.prototype.cheerio="[cheerio object]",F0.prototype.splice=Array.prototype.splice,F0.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator],Object.assign(F0.prototype,j7e,Efe,wfe,Rfe,Nfe),function(t,e){return(C_=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,r){n.__proto__=r}:function(n,r){for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(n[l]=r[l])}))(t,e)}),Ife=function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}C_(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)},M0=function(){return(M0=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var l in e=arguments[n])Object.prototype.hasOwnProperty.call(e,l)&&(t[l]=e[l]);return t}).apply(this,arguments)},Cfe=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),$n="\uFFFD",v$=(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.NUMBER_SIGN=35]="NUMBER_SIGN",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_F=70]="LATIN_CAPITAL_F",t[t.LATIN_CAPITAL_X=88]="LATIN_CAPITAL_X",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_F=102]="LATIN_SMALL_F",t[t.LATIN_SMALL_X=120]="LATIN_SMALL_X",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z",t[t.REPLACEMENT_CHARACTER=65533]="REPLACEMENT_CHARACTER"}(P=P||{}),"--"),_$="[CDATA[",E$="doctype",ku="script",kfe="public",Pfe="system";function zj(t){return 55296<=t&&t<=57343}function Gj(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&1<=t&&t<=31||127<=t&&t<=159}function Xj(t){return 64976<=t&&t<=65007||Cfe.has(t)}(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missin
`,this.firstUpdate&&(j+=" "),this.message=j+(this.message||""),this.firstUpdate=!1,this},b}function c(T){return n.toString.call(T)==="[object Function]"}function f(T){return n.toString.call(T)==="[object Array]"}function p(T){return n.toString.call(T)==="[object String]"}function m(T){return n.toString.call(T)==="[object Object]"}function h(T){var x=function(v){return v?typeof v=="string"?v.split("."):[v]:[]}(T);return function(v){for(var b=v,w=0;w<x.length;w++){var N=x[w];if(!s(b,N))return;b=b[N]}return b}}function g(T){return Array.prototype.slice.call(T)}function _(T,x,v){return Array.prototype.indexOf.call(T||[],x,v)}function S(T){var x,v=[];for(x in T)s(T,x)&&v.push(x);return v}i.hasOwnProp=s,i._prettifyError=function(T,x,v){return(v=v.Update?v:new i.TemplateError(v)).Update(T),x||(T=v,(v=new Error(T.message)).name=T.name),v},Object.setPrototypeOf?Object.setPrototypeOf(o.prototype,Error.prototype):o.prototype=Object.create(Error.prototype,{constructor:{value:o}}),i.TemplateError=o,i.escape=function(T){return T.replace(l,a)},i.isFunction=c,i.isArray=f,i.isString=p,i.isObject=m,i.getAttrGetter=h,i.groupBy=function(T,x,v){for(var b={},w=c(x)?x:h(x),N=0;N<T.length;N++){var O=T[N],k=w(O,N);if(k===void 0&&v===!0)throw new TypeError('groupby: attribute "'+x+'" resolved to undefined');(b[k]||(b[k]=[])).push(O)}return b},i.toArray=g,i.without=function(T){var x=[];if(T)for(var v=T.length,b=g(arguments).slice(1),w=-1;++w<v;)_(b,T[w])===-1&&x.push(T[w]);return x},i.repeat=function(T,x){for(var v="",b=0;b<x;b++)v+=T;return v},i.each=function(T,x,v){if(T!=null){if(e.forEach&&T.forEach===e.forEach)T.forEach(x,v);else if(T.length===+T.length)for(var b=0,w=T.length;b<w;b++)x.call(v,T[b],b,T)}},i.map=function(T,x){var v=[];if(T!=null){if(e.map&&T.map===e.map)return T.map(x);for(var b=0;b<T.length;b++)v[v.length]=x(T[b],b);T.length===+T.length&&(v.length=T.length)}return v},i.asyncIter=function(T,x,v){var b=-1;(function w(){++b<T.length?x(T[b],b,w,v):v()})()},i.asyncFor=function(T,x,v){var b=S(T||{}),w=b.length,N=-1;(function O(){var k=b[++N];N<w?x(k,T[k],N,w,O):v()})()},i.indexOf=_,i.keys=S,i._entries=function(T){return S(T).map(function(x){return[x,T[x]]})},i._values=function(T){return S(T).map(function(x){return T[x]})},i._assign=i.extend=function(T,x){return T=T||{},S(x).forEach(function(v){T[v]=x[v]}),T},i.inOperator=function(T,x){if(f(x)||p(x))return x.indexOf(T)!==-1;if(m(x))return T in x;throw new Error('Cannot use "in" operator to search for "'+T+'" in unexpected types.')}});function vU(){throw new Error("setTimeout has not been defined")}function _U(){throw new Error("clearTimeout has not been defined")}var fs=vU,ps=_U;function EU(t){if(fs===setTimeout)return setTimeout(t,0);if((fs===vU||!fs)&&setTimeout)return(fs=setTimeout)(t,0);try{return fs(t,0)}catch{try{return fs.call(null,t,0)}catch{return fs.call(this,t,0)}}}typeof S3.setTimeout=="function"&&(fs=setTimeout),typeof S3.clearTimeout=="function"&&(ps=clearTimeout);var Va,A3=[],Wu=!1,x9=-1;function Ipe(){Wu&&Va&&(Wu=!1,Va.length?A3=Va.concat(A3):x9=-1,A3.length)&&bU()}function bU(){if(!Wu){var t=EU(Ipe);Wu=!0;for(var e=A3.length;e;){for(Va=A3,A3=[];++x9<e;)Va&&Va[x9].run();x9=-1,e=A3.length}Va=null,Wu=!1,function(n){if(ps===clearTimeout)return clearTimeout(n);if((ps===_U||!ps)&&clearTimeout)return(ps=clearTimeout)(n);try{ps(n)}catch{try{return ps.call(null,n)}catch{return ps.call(this,n)}}}(t)}}function TU(t,e){this.fun=t,this.array=e}function Ya(){}TU.prototype.run=function(){this.fun.apply(null,this.array)};var Cpe=Ya,kpe=Ya,Ppe=Ya,Dpe=Ya,Lpe=Ya,Fpe=Ya,Mpe=Ya,$u=S3.performance||{},$pe=$u.now||$u.mozNow||$u.msNow||$u.oNow||$u.webkitNow||function(){return new Date().getTime()},jpe=new Date,vs={nextTick:function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];A3.push(new TU(t,e)),A3.length!==1||Wu||EU(bU)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:Cpe,addListener:kpe,once:Ppe,off:Dpe,removeListener:Lpe,removeAllListeners:Fpe,emit:Mpe,binding:function(t){throw new Error("process.
`?this.forward():this.back())),Rl(kU,h,n,r);if(h=(h=this._extractString(this.tags.VARIABLE_END))||this._extractString("-"+this.tags.VARIABLE_END))return this.in_code=!1,Rl(DU,h,n,r);if(l==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var i="";!this.isFinished();){if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}i+=this.current(),this.forward()}for(var s=["g","i","m","y"],a="";!this.isFinished()&&s.indexOf(this.current())!==-1;)a+=this.current(),this.forward();return Rl(YU,{body:i,flags:a},n,r)}if(nj.indexOf(l)!==-1){this.forward();var o,c=["==","===","!=","!==","<=",">=","//","**"],f=l+this.current();switch(ke.indexOf(c,f)!==-1&&(this.forward(),ke.indexOf(c,(l=f)+this.current())!==-1)&&(l=f+this.current(),this.forward()),l){case"(":o=FU;break;case")":o=MU;break;case"[":o=$U;break;case"]":o=jU;break;case"{":o=UU;break;case"}":o=BU;break;case",":o=qU;break;case":":o=VU;break;case"~":o=zU;break;case"|":o=GU;break;default:o=HU}return Rl(o,l,n,r)}if((h=this._extractUntil(tj+nj)).match(/^[-+]?[0-9]+$/))return this.current()==="."?(this.forward(),c=this._extract("0123456789"),Rl(XU,h+"."+c,n,r)):Rl("int",h,n,r);if(h.match(/^(true|false)$/))return Rl(WU,h,n,r);if(h==="none"||h==="null")return Rl(y_,h,n,r);if(h)return Rl(KU,h,n,r);throw new Error("Unexpected value while parsing: "+h)}var p,m=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if(h=(h=this._extractString(this.tags.BLOCK_START+"-"))||this._extractString(this.tags.BLOCK_START))return this.in_code=!0,Rl(CU,h,n,r);if(h=(h=this._extractString(this.tags.VARIABLE_START+"-"))||this._extractString(this.tags.VARIABLE_START))return this.in_code=!0,Rl(PU,h,n,r);var h="",g=!1;for(this._matches(this.tags.COMMENT_START)&&(g=!0,h=this._extractString(this.tags.COMMENT_START));(p=this._extractUntil(m))!==null;){if(h+=p,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!g){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&0<this.colno&&this.colno<=h.length){var _=h.slice(-this.colno);if(/^\s+$/.test(_)&&!(h=h.slice(0,-this.colno)).length)return this.nextToken()}break}if(this._matches(this.tags.COMMENT_END)){if(!g)throw new Error("unexpected end of comment");h+=this._extractString(this.tags.COMMENT_END);break}h+=this.current(),this.forward()}if(p===null&&g)throw new Error("expected end of comment, got end of file");return Rl(g?LU:IU,h,n,r)},e._parseString=function(n){this.forward();for(var r="";!this.isFinished()&&this.current()!==n;){var l=this.current();if(l==="\\")switch(this.forward(),this.current()){case"n":r+=`
`))})},r.compileRoot=function(l,i){var s=this,a=(i&&this.fail("compileRoot: root node can't have frame"),i=new jv,this._emitFuncBegin(l,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(l,i),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0,[]);(i=l.findAll(z.Block)).forEach(function(o,c){var f=o.name.value;if(a.indexOf(f)!==-1)throw new Error('Block "'+f+'" defined more than once.');a.push(f),s._emitFuncBegin(o,"b_"+f),f=new jv,s._emitLine("var frame = frame.push(true);"),s.compile(o.body,f),s._emitFuncEnd()}),this._emitLine("return {"),i.forEach(function(o,c){o="b_"+o.name.value,s._emitLine(o+": "+o+",")}),this._emitLine(`root:root
};`)},r.compile=function(l,i){var s=this["compile"+l.typename];s?s.call(this,l,i):this.fail("compile: Cannot compile node: "+l.typename,l.lineno,l.colno)},r.getCode=function(){return this.codebuf.join("")},n}(e4.Obj),zde={compile:function(s,e,n,r,l){var i=new oj(r,(l=l===void 0?{}:l).throwOnUndefined),s=(n||[]).map(function(a){return a.preprocess}).filter(function(a){return!!a}).reduce(function(a,o){return o(a)},s);return i.compile(Ude.transform(Mde.parse(s,n,l),e,r)),i.getCode()},Compiler:oj},Gde=st(function(t){function e(h,g){return h==null||h===!1?g:h}function n(h){return h!=h}function r(h){var g=(h=e(h,"")).toLowerCase();return at.copySafeness(h,g.charAt(0).toUpperCase()+g.slice(1))}function l(h){if(ke.isString(h))return h.split("");if(ke.isObject(h))return ke._entries(h||{}).map(function(g){return{key:g[0],value:g[1]}});if(ke.isArray(h))return h;throw new ke.TemplateError("list filter: type not iterable")}function i(h){return function(g,_,S){var T=this,x=T.env.getTest(_=_===void 0?"truthy":_);return ke.toArray(g).filter(function(v){return x.call(T,v,S)===h})}}function s(h){return at.copySafeness(h,h.replace(/^\s*|\s*$/g,""))}(t=t.exports={}).abs=Math.abs,t.batch=function(h,g,_){for(var S=[],T=[],x=0;x<h.length;x++)x%g==0&&T.length&&(S.push(T),T=[]),T.push(h[x]);if(T.length){if(_)for(x=T.length;x<g;x++)T.push(_);S.push(T)}return S},t.capitalize=r,t.center=function(h,g){var _;return(h=e(h,"")).length>=(g=g||80)?h:(g-=h.length,_=ke.repeat(" ",g/2-g%2),g=ke.repeat(" ",g/2),at.copySafeness(h,_+h+g))},t.default=function(h,g,_){return _?h||g:h!==void 0?h:g},t.dictsort=function(h,g,_){if(!ke.isObject(h))throw new ke.TemplateError("dictsort filter: val must be an object");var S,T,x=[];for(T in h)x.push([T,h[T]]);if(_===void 0||_==="key")S=0;else{if(_!=="value")throw new ke.TemplateError("dictsort filter: You can only sort by either key or value");S=1}return x.sort(function(v,b){return v=v[S],b=b[S],g||(ke.isString(v)&&(v=v.toUpperCase()),ke.isString(b)&&(b=b.toUpperCase())),b<v?1:v===b?0:-1}),x},t.dump=function(h,g){return JSON.stringify(h,null,g)},t.escape=function(h){return h instanceof at.SafeString?h:at.markSafe(ke.escape((h=h??"").toString()))},t.safe=function(h){return h instanceof at.SafeString?h:at.markSafe((h=h??"").toString())},t.first=function(h){return h[0]},t.forceescape=function(h){return at.markSafe(ke.escape((h=h??"").toString()))},t.groupby=function(h,g){return ke.groupBy(h,g,this.env.opts.throwOnUndefined)},t.indent=function(h,x,_){if((h=e(h,""))==="")return"";x=x||4;var S=h.split(`
`):_.replace(/\s+/gi," ");return at.copySafeness(h,S)},t.title=function(h){var g=(h=e(h,"")).split(" ").map(r);return at.copySafeness(h,g.join(" "))},t.trim=s,t.truncate=function(h,g,_,S){var T=h;return(h=e(h,"")).length<=(g=g||255)?h:(h=_?h.substring(0,g):((_=h.lastIndexOf(" ",g))===-1&&(_=g),h.substring(0,_)),at.copySafeness(T,h+=S??"..."))},t.upper=function(h){return(h=e(h,"")).toUpperCase()},t.urlencode=function(h){var g=encodeURIComponent;return ke.isString(h)?g(h):(ke.isArray(h)?h:ke._entries(h)).map(function(T){var S=T[0],T=T[1];return g(S)+"="+g(T)}).join("&")};var a=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,o=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,c=/^https?:\/\/.*$/,f=/^www\./,p=/\.(?:org|net|com)(?:\:|\/|$)/,m=(t.urlize=function(h,g,_){n(g)&&(g=1/0);varS=_===!0?' rel="nofollow"':"";returnh.split(/(\s+)/).filter(function(T){returnT&&T.length}).map(function(T){varx=T.match(a),v=(x=x?x[1]:T).substr(0,g);returnc.test(x)?'<a href="'+x+'"'+S+">"+v+"</a>":f.test(x)?'<a href="http://'+x+'"'+S+">"+v+"</a>":o.test(x)?'<a href="mailto:'+x+'">'+x+"</a>":p.test(x)?'<a href="http://'+x+'"'+S+">"+v+"</a>":T}).join("")},t.wordcount=function(h){return(h=(h=e(h,""))?h.match(/\w+/g):null)?h.length:null},t.float=function(h,g){returnn(h=parseFloat(h))?g:h},at.makeMacro(["value","default","base"],[],function(h,g,_){return_===void0&&(_=10),n(h=parseInt(h,_))?g:h}));t.int=m,t.d=t.default,t.e=t.escape}),U9={};functionpB(t,e){for(varn=0,r=t.length-1;0<=r;r--){varl=t[r];l==="."?t.splice(r,1):l===".."?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;)t.unshift("..");returnt}varXde=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,Uv=function(t){returnXde.exec(t).slice(1)};functionBv(){for(vart="",e=!1,n=arguments.length-1;-1<=n&&!e;n--){varr=0<=n?arguments[n]:"/";if(typeofr!="string")thrownewTypeError("Arguments to path.resolve must be strings");r&&(t=r+"/"+t,e=r.charAt(0)==="/")}return(e?"/":"")+pB(j_(t.split("/"),function(l){return!!l}),!e).join("/")||"."}functionuj(t){vare=dB(t),n=Wde(t,-1)==="/";return(t=(t=pB(j_(t.split("/"),function(r){return!!r}),!e).join("/"))||e?t:".")&&n&&(t+="/"),(e?"/":"")+t}functiondB(t){returnt.charAt(0)==="/"}varKu={extname:function(t){returnUv(t)[3]},basename:function(t,e){returnt=Uv(t)[2],e&&t.substr(-1*e.length)===e?t.substr(0,t.length-e.length):t},dirname:function(n){vare=(n=Uv(n))[0],n=n[1];returne||n?e+(n&&n.substr(0,n.length-1)):"."},sep:"/",delimiter:":",relative:function(t,e){functionn(c){for(varf=0;f<c.length&&c[f]==="";f++);for(varp=c.length-1;0<=p&&c[p]==="";p--);returnp<f?[]:c.slice(f,p-f+1)}t=Bv(t).substr(1),e=Bv(e).substr(1);for(varr=n(t.split("/")),l=n(e.split("/")),i=Math.min(r.length,l.length),s=i,a=0;a<i;a++)if(r[a]!==l[a]){s=a;break}for(varo=[],a=s;a<r.length;a++)o.push("..");return(o=o.concat(l.slice(s))).join("/")},join:function(){returnuj(j_(Array.prototype.slice.call(arguments,0),function(t,e){if(typeoft!="string")thrownewTypeError("Arguments to path.join must be strings");returnt}).join("/"))},isAbsolute:dB,normalize:uj,resolve:Bv};functionj_(t,e){if(t.filter)returnt.filter(e);for(varn=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);returnn}varWde="ab".substr(-1)==="b"?function(t,e,n){returnt.substr(e,n)}:function(t,e,n){returne<0&&(e=t.length+e),t.substr(e,n)};functionhB(t,e){return(hB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){returnn.__proto__=r,n})(t,e)}varU_=function(t){vare;functionn(){returnt.apply(this,arguments)||this}e=t,(r=n).prototype=Object.create(e.prototype),hB(r.prototype.constructor=r,e);varr=n.prototype;returnr.resolve=function(l,i){returnKu.resolve(Ku.dirname(l),i)},r.isRelative=function(l){returnl.indexOf("./")===0||l.indexOf("../")===0},n}(e4.EmitterObj);functionmB(t,e){return(mB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){returnn.__proto__=r,n})(t,e)}varKde=function(t){vare,n;functionr(l){vari;return(i=t.call(this)||this).precompiled=l||{},i}returnn=t,(e=r).prototype=Object.create(n.prototype),mB(e.prototype.co
`)){let o=a.trim();if(o)if(o.startsWith("#")){if(o.startsWith("#EXT")){let c=Rhe(o,i);c&&s.push(c)}}else s.push(o)}return s.length!==0&&s[0].name==="EXTM3U"||Le("The EXTM3U tag MUST be the first line."),s}(t,e),r=Ohe(n,e);return r.source=t,r}var Nhe=["#EXTINF","#EXT-X-BYTERANGE","#EXT-X-DISCONTINUITY","#EXT-X-STREAM-INF","#EXT-X-CUE-OUT","#EXT-X-CUE-IN","#EXT-X-KEY","#EXT-X-MAP"],Ihe=["#EXT-X-MEDIA"],eE=class extends Array{constructor(e){super(),this.baseUri=e}push(...e){for(let n of e)if(n.startsWith("#"))if(Nhe.some(r=>n.startsWith(r)))super.push(n);else{if(this.includes(n)){if(Ihe.some(r=>n.startsWith(r)))continue;Le(`Redundantitem(${n})`)}super.push(n)}else super.push(n);return this.length}};function lE(t,e){let n=1e3;e&&(n=Math.pow(10,e));let r=Math.round(t*n)/n;return e?r.toFixed(e):r}function Che(t){let e=[`DATA-ID="${t.id}"`];return t.language&&e.push(`LANGUAGE="${t.language}"`),t.value?e.push(`VALUE="${t.value}"`):t.uri&&e.push(`URI="${t.uri}"`),`#EXT-X-SESSION-DATA:${e.join(",")}`}function zB(t,e){let n=e?"#EXT-X-SESSION-KEY":"#EXT-X-KEY",r=[`METHOD=${t.method}`];return t.uri&&r.push(`URI="${t.uri}"`),t.iv&&(t.iv.length!==16&&Le("IV must be a 128-bit unsigned integer"),r.push(`IV=${HB(t.iv)}`)),t.format&&r.push(`KEYFORMAT="${t.format}"`),t.formatVersion&&r.push(`KEYFORMATVERSIONS="${t.formatVersion}"`),`${n}:${r.join(",")}`}function khe(t,e){let n=e.isIFrameOnly?"#EXT-X-I-FRAME-STREAM-INF":"#EXT-X-STREAM-INF",r=[`BANDWIDTH=${e.bandwidth}`];if(e.averageBandwidth&&r.push(`AVERAGE-BANDWIDTH=${e.averageBandwidth}`),e.isIFrameOnly&&r.push(`URI="${e.uri}"`),e.codecs&&r.push(`CODECS="${e.codecs}"`),e.resolution&&r.push(`RESOLUTION=${e.resolution.width}x${e.resolution.height}`),e.frameRate&&r.push(`FRAME-RATE=${lE(e.frameRate,3)}`),e.hdcpLevel&&r.push(`HDCP-LEVEL=${e.hdcpLevel}`),e.audio.length>0){r.push(`AUDIO="${e.audio[0].groupId}"`);for(let l of e.audio)t.push(f7(l))}if(e.video.length>0){r.push(`VIDEO="${e.video[0].groupId}"`);for(let l of e.video)t.push(f7(l))}if(e.subtitles.length>0){r.push(`SUBTITLES="${e.subtitles[0].groupId}"`);for(let l of e.subtitles)t.push(f7(l))}if(vhe().allowClosedCaptionsNone&&e.closedCaptions.length===0)r.push("CLOSED-CAPTIONS=NONE");else if(e.closedCaptions.length>0){r.push(`CLOSED-CAPTIONS="${e.closedCaptions[0].groupId}"`);for(let l of e.closedCaptions)t.push(f7(l))}if(e.score&&r.push(`SCORE=${e.score}`),e.allowedCpc){let l=[];for(let{format:i,cpcList:s}of e.allowedCpc)l.push(`${i}:${s.join("/")}`);r.push(`ALLOWED-CPC="${l.join(",")}"`)}e.videoRange&&r.push(`VIDEO-RANGE=${e.videoRange}`),e.stableVariantId&&r.push(`STABLE-VARIANT-ID="${e.stableVariantId}"`),e.programId&&r.push(`PROGRAM-ID=${e.programId}`),t.push(`${n}:${r.join(",")}`),e.isIFrameOnly||t.push(`${e.uri}`)}function f7(t){let e=[`TYPE=${t.type}`,`GROUP-ID="${t.groupId}"`,`NAME="${t.name}"`];return t.isDefault!==void 0&&e.push("DEFAULT="+(t.isDefault?"YES":"NO")),t.autoselect!==void 0&&e.push("AUTOSELECT="+(t.autoselect?"YES":"NO")),t.forced!==void 0&&e.push("FORCED="+(t.forced?"YES":"NO")),t.language&&e.push(`LANGUAGE="${t.language}"`),t.assocLanguage&&e.push(`ASSOC-LANGUAGE="${t.assocLanguage}"`),t.instreamId&&e.push(`INSTREAM-ID="${t.instreamId}"`),t.characteristics&&e.push(`CHARACTERISTICS="${t.characteristics}"`),t.channels&&e.push(`CHANNELS="${t.channels}"`),t.uri&&e.push(`URI="${t.uri}"`),`#EXT-X-MEDIA:${e.join(",")}`}function Phe(t,e,n,r,l=1,i=null){let s=!1,a="";if(e.discontinuity&&t.push("#EXT-X-DISCONTINUITY"),e.key){let c=zB(e.key);c!==n&&(t.push(c),n=c)}if(e.map){let c=function(f){let p=[`URI="${f.uri}"`];return f.byterange&&p.push(`BYTERANGE="${Y_(f.byterange)}"`),`#EXT-X-MAP:${p.join(",")}`}(e.map);c!==r&&(t.push(c),r=c)}if(e.programDateTime&&t.push(`#EXT-X-PROGRAM-DATE-TIME:${K_(e.programDateTime)}`),e.dateRange&&t.push(function(c){let f=[`ID="${c.id}"`];c.start&&f.push(`START-DATE="${K_(c.start)}"`),c.end&&f.push(`END-DATE="${K_(c.end)}"`),c.duration&&f.push(`DURATION=${c.duration}`),c.plannedDuration&&f.push(`PLANNED-DURATION=${c.plannedDuration}`),c.classId&&f.push(`CLASS="${c.classId}"`),c.endOnNext&&
`)}var XB="hls_cache",A7=[],Qa={},d5={},Ja={},x7="";function Dhe(t,e){if(A7.push(t),Qa[t]=e,A7.length>5){let n=A7.shift();Lhe(n)}}function Lhe(t){delete Qa[t],delete A7[t],new JSFile(XB+"/"+t).delete()}function Fhe(t,e){if(e.variants)for(let n of e.variants)n.uri.startsWith("http")||(n.uri=iE(t,n.uri));if(e.segments)for(let n of e.segments)n.uri.startsWith("http")||(n.uri=iE(t,n.uri)),n.key&&n.key.uri&&!n.key.uri.startsWith("http")&&(n.key.uri=iE(t,n.key.uri));return e}async function WB(t,e){let n=md5X(t);if(Qa[n])return Qa[n];let r={},l=t;for(;r=await req(l,{headers:e,redirect:0}),r.headers.location;)l=r.headers.location;if(r.code==200){var i=r.content;let s=Fhe(l,VB(i));return Dhe(n,{code:r.code,plist:s,key:n,headers:r.headers}),Qa[n]}return{}}async function KB(t,e,n){if(!Qa[t])return{};let l=Qa[t].plist.segments,i=!Ja[t];if(i){Ja[t]={};for(let f of l){let p=md5X(f.uri+f.mediaSequenceNumber.toString());Ja[t][p]={file:XB+"/"+t+"/"+p,uri:f.uri,key:p,index:f.mediaSequenceNumber,order:f.mediaSequenceNumber,state:-1,read:!1}}}for(let f in Ja[t]){let p=Ja[t][f];p.index>=e?p.order=p.index-e:p.order=l.length-e+p.index}i&&Mhe(t,5,n);let s=l[e],a=md5X(s.uri+s.mediaSequenceNumber.toString()),o=Ja[t][a];if(o.state==1||o.state==-1){let f=new JSFile(o.file);if(await f.exist())return o.state=1,{buffer:3,code:200,headers:{connection:"close","content-type":"video/mp2t"},content:f};o.state=-1}if(o.state==-1&&YB(t,o,n),o.state==0){var c=new JSProxyStream;c.head(200,{connection:"close","content-type":"video/mp2t"});let f=0;return o.read=!0,new Promise(async function(p,m){let h=new JSFile(o.file+".dl");await h.open("r"),async function g(){let _=await h.size();if(_>f){var S=await h.read(_-f,f);await c.write(S),f=_}if(o.state==1||o.state<0){c.done(),await h.close(),await h.delete(),o.read=!1,p();return}setTimeout(g,5)}()}),{buffer:3,content:c}}}async function YB(t,e,n){if(e.state>=0||!d5[t])return;if(e.state=0,await new JSFile(e.file).exist()){e.state=1;return}let r=new JSFile(e.file+".dl");await r.open("w");let l=await req(e.uri,{buffer:3,headers:n,stream:r,timeout:[5e3,1e4]});if(l.error||l.code>=300){await r.close(),e.read||await r.delete(),e.state=-1;return}await r.close(),e.read?await r.copy(e.file):await r.move(e.file),e.state=1}async function Mhe(t,e,n){x7&&x7!=t&&delete d5[x7],x7=t,d5[t]=!0;for(let r=0;r<e&&d5[t];r++)new Promise(function(l,i){(async function s(){if(!d5[t]){l();return}let a=be.pickBy(Ja[t],function(c){return c.state==-1}),o=be.minBy(Object.values(a),function(c){return c.order});if(!o){l();return}await YB(t,o,n),setTimeout(s,5)})()})}function iE(t,e){var n=t.split("/"),r=e.split("/");n.pop();for(var l=0;l<r.length;l++)r[l]!="."&&(r[l]==".."?n.pop():n.push(r[l]));return n.join("/")}function JB(t){let e=[];return Array.from(t.danmuku).forEach(n=>{let r=Number(n[0]),l=n[4];e.push(`<dp="${r},1,25,16777215,1659282294,0,8b53b65c,1108899274487246080"><![CDATA[${l}]]></d>`)}),String.raw`<?xmlversion="1.0"encoding="UTF-8"?><i><chatserver>chat.bilibili.com</chatserver><chatid>52175602</chatid><mission>0</mission><maxlimit>1000</maxlimit><state>0</state><real_name>0</real_name><source>k-v</source>`+e.join("")+"</i>"}varw7=class{constructor(){this.siteUrl="https://search.youku.com",this.reconnectTimes=0,this.maxReconnectTimes=5,this.jadeLog=newRi(this.getAppName(),"DEBUG")}getAppName(){return"\u5F39\u5E55"}getHeader(){return{"User-Agent":Li,Referer:this.siteUrl+"/"}}asyncreconnnect(e,n,r,l,i,s){returnawaitthis.jadeLog.error("\u8BF7\u6C42\u5931\u8D25,\u8BF7\u68C0\u67E5url:"+e+",\u4E24\u79D2\u540E\u91CD\u8BD5"),Es(2),this.reconnectTimes<this.maxReconnectTimes?(this.reconnectTimes=this.reconnectTimes+1,awaitthis.fetch(e,n,r,l,i,s)):(awaitthis.jadeLog.error("\u8BF7\u6C42\u5931\u8D25,\u91CD\u8FDE\u5931\u8D25"),null)}asyncgetResponse(e,n,r,l,i,s,a){returna.headers.location!==void0?l?(awaitthis.jadeLog.debug(`\u8FD4\u56DE\u91CD\u5B9A\u5411\u8FDE\u63A5:${a.headers.location}`),a.headers.location):this.fetch(a.headers.location,n,r,l,i,s):a.content.length>0?(this.reconnectTimes=0,i?{cookie:a.headers["set-cookie"],content:a.cont
`).forEach(function(s){l=s.indexOf(":"),n=s.substring(0,l).trim().toLowerCase(),r=s.substring(l+1).trim(),!(!n||e[n]&&Nve[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e};var uz=Symbol("internals");function R5(t){return t&&String(t).trim().toLowerCase()}function tf(t){return t===!1||t==null?t:X.isArray(t)?t.map(tf):String(t)}function Ive(t){let e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}var Cve=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());functionnb(t,e,n,r,l){if(X.isFunction(r))returnr.call(this,e,n);if(l&&(e=n),!!X.isString(e)){if(X.isString(r))returne.indexOf(r)!==-1;if(X.isRegExp(r))returnr.test(e)}}functionkve(t){returnt.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}functionPve(t,e){letn=X.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(l,i,s){returnthis[r].call(this,e,l,i,s)},configurable:!0})})}varS4=class{constructor(e){e&&this.set(e)}set(e,n,r){letl=this;functioni(a,o,c){letf=R5(o);if(!f)thrownewError("header name must be a non-empty string");letp=X.findKey(l,f);(!p||l[p]===void0||c===!0||c===void0&&l[p]!==!1)&&(l[p||o]=tf(a))}lets=(a,o)=>X.forEach(a,(c,f)=>i(c,f,o));returnX.isPlainObject(e)||einstanceofthis.constructor?s(e,n):X.isString(e)&&(e=e.trim())&&!Cve(e)?s(oz(e),n):e!=null&&i(n,e,r),this}get(e,n){if(e=R5(e),e){letr=X.findKey(this,e);if(r){letl=this[r];if(!n)returnl;if(n===!0)returnIve(l);if(X.isFunction(n))returnn.call(this,l,r);if(X.isRegExp(n))returnn.exec(l);thrownewTypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=R5(e),e){letr=X.findKey(this,e);return!!(r&&this[r]!==void0&&(!n||nb(this,this[r],r,n)))}return!1}delete(e,n){letr=this,l=!1;functioni(s){if(s=R5(s),s){leta=X.findKey(r,s);a&&(!n||nb(r,r[a],a,n))&&(deleter[a],l=!0)}}returnX.isArray(e)?e.forEach(i):i(e),l}clear(e){letn=Object.keys(this),r=n.length,l=!1;for(;r--;){leti=n[r];(!e||nb(this,this[i],i,e,!0))&&(deletethis[i],l=!0)}returnl}normalize(e){letn=this,r={};returnX.forEach(this,(l,i)=>{lets=X.findKey(r,i);if(s){n[s]=tf(l),deleten[i];return}leta=e?kve(i):String(i).trim();a!==i&&deleten[i],n[a]=tf(l),r[a]=!0}),this}concat(...e){returnthis.constructor.concat(this,...e)}toJSON(e){letn=Object.create(null);returnX.forEach(this,(r,l)=>{r!=null&&r!==!1&&(n[l]=e&&X.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){returnObject.entries(this.toJSON())[Symbol.iterator]()}toString(){returnObject.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
`,t_e=F5.encode(Rs),n_e=2,Eb=class{constructor(e,n){let{escapeName:r}=this.constructor,l=X.isString(n),i=`Content-Disposition:form-data;name="${r(e)}"${!l&&n.name?`; filename="${r(n.name)}"`:""}${Rs}`;l?n=F5.encode(String(n).replace(/\r?\n|\r\n?/g,Rs)):i+=`Content-Type:${n.type||"application/octet-stream"}${Rs}`,this.headers=F5.encode(i+Rs),this.contentLength=l?n.byteLength:n.size,this.size=this.headers.byteLength+this.contentLength+n_e,this.name=e,this.value=n}async*encode(){yield this.headers;let{value:e}=this;X.isTypedArray(e)?yield e:yield*lf(e),yield t_e}static escapeName(e){return String(e).replace(/[\r\n"]/g,n=>({"\r":"%0D","\n":"%0A",'"':"%22"})[n])}},r_e=(t,e,n)=>{let{tag:r="form-data-boundary",size:l=25,boundary:i=r+"-"+X.generateString(l,e_e)}=n||{};if(!X.isFormData(t))throw TypeError("FormData instance required");if(i.length<1||i.length>70)throw Error("boundary must be 10-70 characters long");let s=F5.encode("--"+i+Rs),a=F5.encode("--"+i+"--"+Rs+Rs),o=a.byteLength,c=Array.from(t.entries()).map(([p,m])=>{let h=new Eb(p,m);return o+=h.size,h});o+=s.byteLength*c.length,o=X.toFiniteNumber(o);let f={"Content-Type":`multipart/form-data;boundary=${i}`};return Number.isFinite(o)&&(f["Content-Length"]=o),e&&e(f),xz.Readable.from(async function*(){for(let p of c)yield s,yield*p.encode();yield a}())},Az=r_e;var wz=br(require("stream"),1),bb=class extends wz.default.Transform{__transform(e,n,r){this.push(e),r()}_transform(e,n,r){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let l=Buffer.alloc(2);l[0]=120,l[1]=156,this.push(l,n)}this.__transform(e,n,r)}},Rz=bb;var l_e=(t,e)=>X.isAsyncFn(t)?function(...n){let r=n.pop();t.apply(this,n).then(l=>{try{e?r(null,...e(l)):r(null,l)}catch(i){r(i)}},r)}:t,Oz=l_e;var Nz={flush:O3.default.constants.Z_SYNC_FLUSH,finishFlush:O3.default.constants.Z_SYNC_FLUSH},i_e={flush:O3.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:O3.default.constants.BROTLI_OPERATION_FLUSH},Iz=X.isFunction(O3.default.createBrotliDecompress),{http:s_e,https:a_e}=Mz.default,o_e=/https:?/,Cz=Or.protocols.map(t=>t+":");function u_e(t,e){t.beforeRedirects.proxy&&t.beforeRedirects.proxy(t),t.beforeRedirects.config&&t.beforeRedirects.config(t,e)}function jz(t,e,n){let r=e;if(!r&&r!==!1){let l=(0,Pz.getProxyForUrl)(n);l&&(r=new URL(l))}if(r){if(r.username&&(r.auth=(r.username||"")+":"+(r.password||"")),r.auth){(r.auth.username||r.auth.password)&&(r.auth=(r.auth.username||"")+":"+(r.auth.password||""));let i=Buffer.from(r.auth,"utf8").toString("base64");t.headers["Proxy-Authorization"]="Basic "+i}t.headers.host=t.hostname+(t.port?":"+t.port:"");let l=r.hostname||r.host;t.hostname=l,t.host=l,t.port=r.port,t.path=n,r.protocol&&(t.protocol=r.protocol.includes(":")?r.protocol:`${r.protocol}:`)}t.beforeRedirects.proxy=function(i){jz(i,e,i.href)}}var c_e=typeof process<"u"&&X.kindOf(process)==="process",f_e=t=>new Promise((e,n)=>{let r,l,i=(o,c)=>{l||(l=!0,r&&r(o,c))},s=o=>{i(o),e(o)},a=o=>{i(o,!0),n(o)};t(s,a,o=>r=o).catch(a)}),p_e=({address:t,family:e})=>{if(!X.isString(t))throw TypeError("address must be a string");return{address:t,family:e||(t.indexOf(".")<0?6:4)}},kz=(t,e)=>p_e(X.isObject(t)?t:{address:t,family:e}),Uz=c_e&&function(e){return f_e(async function(r,l,i){let{data:s,lookup:a,family:o}=e,{responseType:c,responseEncoding:f}=e,p=e.method.toUpperCase(),m,h=!1,g;if(a){let ae=Oz(a,ye=>X.isArray(ye)?ye:[ye]);a=(ye,q,le)=>{ae(ye,q,(re,te,Un)=>{if(re)return le(re);let wt=X.isArray(te)?te.map(Ge=>kz(Ge)):[kz(te,Un)];q.all?le(re,wt):le(re,wt[0].address,wt[0].family)})}}let _=new $z.default,S=()=>{e.cancelToken&&e.cancelToken.unsubscribe(T),e.signal&&e.signal.removeEventListener("abort",T),_.removeAllListeners()};i((ae,ye)=>{m=!0,ye&&(h=!0,S())});function T(ae){_.emit("abort",!ae||ae.type?new ei(null,e,g):ae)}_.once("abort",l),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(T),e.signal&&(e.signal.aborted?T():e.signal.addEventListener("abort",T)));let x=so(e.baseURL,e.url),v=new URL(x,"http://localhost"),b=v.protocol||Cz[0];if(b==="data:"){let ae;if(p!=="GET")return ws(r,l,{st
`+i.map(zz).join(`
`):" "+zz(i[0]):"as no adapter specified";throw new Fe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:Tb};function Sb(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ei(null,t)}function af(t){return Sb(t),t.headers=Nr.from(t.headers),t.data=O5.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),sf.getAdapter(t.adapter||T4.adapter)(t).then(function(r){return Sb(t),r.data=O5.call(t,t.transformResponse,r),r.headers=Nr.from(r.headers),r},function(r){return N5(r)||(Sb(t),r&&r.response&&(r.response.data=O5.call(t,t.transformResponse,r.response),r.response.headers=Nr.from(r.response.headers))),Promise.reject(r)})}var Gz=t=>t instanceof Nr?t.toJSON():t;function N3(t,e){e=e||{};let n={};function r(c,f,p){return X.isPlainObject(c)&&X.isPlainObject(f)?X.merge.call({caseless:p},c,f):X.isPlainObject(f)?X.merge({},f):X.isArray(f)?f.slice():f}function l(c,f,p){if(X.isUndefined(f)){if(!X.isUndefined(c))return r(void 0,c,p)}else return r(c,f,p)}function i(c,f){if(!X.isUndefined(f))return r(void 0,f)}function s(c,f){if(X.isUndefined(f)){if(!X.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function a(c,f,p){if(p in e)return r(c,f);if(p in t)return r(void 0,c)}let o={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,f)=>l(Gz(c),Gz(f),!0)};return X.forEach(Object.keys(Object.assign({},t,e)),function(f){let p=o[f]||l,m=p(t[f],e[f],f);X.isUndefined(m)&&p!==a||(n[f]=m)}),n}var xb={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{xb[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});var Xz={};xb.transitional=function(e,n,r){function l(i,s){return"[Axios v"+oo+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(e===!1)throw new Fe(l(s," has been removed"+(n?" in "+n:"")),Fe.ERR_DEPRECATED);return n&&!Xz[s]&&(Xz[s]=!0,console.warn(l(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,s,a):!0}};function m_e(t,e,n){if(typeof t!="object")throw new Fe("options must be an object",Fe.ERR_BAD_OPTION_VALUE);let r=Object.keys(t),l=r.length;for(;l-- >0;){let i=r[l],s=e[i];if(s){let a=t[i],o=a===void 0||s(a,i,t);if(o!==!0)throw new Fe("option "+i+" must be "+o,Fe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Fe("Unknown option "+i,Fe.ERR_BAD_OPTION)}}var of={assertOptions:m_e,validators:xb};var Os=of.validators,A4=class{constructor(e){this.defaults=e,this.interceptors={request:new QE,response:new QE}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let l;Error.captureStackTrace?Error.captureStackTrace(l={}):l=new Error;let i=l.stack?l.stack.replace(/^.+\n/,""):"";r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`