@glodon-aiot/agent-cli-sdk 3.0.7 → 3.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-cli-sdk.js +81 -81
- package/dist/agent-cli-sdk.umd.cjs +5 -5
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Mi,
|
|
1
|
+
(function(Mi,Ci){typeof exports=="object"&&typeof module<"u"?Ci(exports):typeof define=="function"&&define.amd?define(["exports"],Ci):(Mi=typeof globalThis<"u"?globalThis:Mi||self,Ci(Mi.AgentClientSDK={}))})(this,function(Mi){"use strict";class Ci{constructor(O,L=!1){Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:O}),Object.defineProperty(this,"open",{enumerable:!0,configurable:!0,writable:!0,value:L})}disable(){this.open=!1}enable(){this.open=!0}log(...O){!this.open&&!Ci.debug||console.log(this.prefix,...O)}info(...O){!this.open&&!Ci.debug||console.info(`%c ${this.prefix} %o`,"color:#0f0;",...O)}error(...O){!this.open&&!Ci.debug||console.error(this.prefix,...O)}warn(...O){!this.open&&!Ci.debug||console.warn(this.prefix,...O)}}Object.defineProperty(Ci,"debug",{enumerable:!0,configurable:!0,writable:!0,value:!1});const Zh=new Ci("[Config] ");var ro;(function(K){K.dev="https://aiot-dev.glodon.com/api/cvforcepd",K.test="https://aiot-dev.glodon.com/api/cvforce",K.prod="https://copilot.glodon.com/api/cvforce",K.local="http://localhost:3000/api/cvforcepd"})(ro||(ro={})),Mi.configuration={debug:!1,env:"prod",apiRoot:ro.prod,applicationId:"",plugins:{}};function yu(K){Ci.debug=(K==null?void 0:K.debug)||!1,Mi.configuration=Object.assign(Object.assign(Object.assign({},Mi.configuration),K),{apiRoot:(K==null?void 0:K.apiRoot)||Mi.configuration.apiRoot||(K!=null&&K.env?ro[K.env||"prod"]:Mi.configuration.apiRoot)}),Ci.debug&&Zh.log("updated",Mi.configuration)}/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -72,9 +72,9 @@ should equal
|
|
|
72
72
|
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""),this.options.supressEmptyNode?(this.buildTextNode=h,this.buildObjNode=f):(this.buildTextNode=g,this.buildObjNode=l),this.buildTextValNode=g,this.buildObjectNode=l}function a(E,I,M){const B=this.j2x(E,M+1);return E[this.options.textNodeName]!==void 0&&Object.keys(E).length===1?this.buildTextNode(B.val,I,B.attrStr,M):this.buildObjNode(B.val,I,B.attrStr,M)}function p(E,I){return E=this.options.tagValueProcessor(""+E),this.options.cdataPositionChar===""||E===""?E+"<![CDATA["+I+"]]"+this.tagEndChar:E.replace(this.options.cdataPositionChar,"<![CDATA["+I+"]]"+this.tagEndChar)}function c(E,I){if(E=this.options.tagValueProcessor(""+E),this.options.cdataPositionChar===""||E==="")return E+"<![CDATA["+I.join("]]><![CDATA[")+"]]"+this.tagEndChar;for(let M in I)E=E.replace(this.options.cdataPositionChar,"<![CDATA["+I[M]+"]]>");return E+this.newLine}function l(E,I,M,B){return M&&E.indexOf("<")===-1?this.indentate(B)+"<"+I+M+">"+E+"</"+I+this.tagEndChar:this.indentate(B)+"<"+I+M+this.tagEndChar+E+this.indentate(B)+"</"+I+this.tagEndChar}function f(E,I,M,B){return E!==""?this.buildObjectNode(E,I,M,B):this.indentate(B)+"<"+I+M+"/"+this.tagEndChar}function g(E,I,M,B){return this.indentate(B)+"<"+I+M+">"+this.options.tagValueProcessor(E)+"</"+I+this.tagEndChar}function h(E,I,M,B){return E!==""?this.buildTextValNode(E,I,M,B):this.indentate(B)+"<"+I+M+"/"+this.tagEndChar}function u(E){return this.options.indentBy.repeat(E)}function w(E){return!!E.startsWith(this.options.attributeNamePrefix)&&E.substr(this.attrPrefixLen)}function b(E){return E===this.options.cdataTagName}S.prototype.parse=function(E){return Array.isArray(E)&&this.options.rootNodeName&&this.options.rootNodeName.length>1&&(E={[this.options.rootNodeName]:E}),this.j2x(E,0).val},S.prototype.j2x=function(E,I){let M="",B="";for(let P in E)if(E[P]!==void 0)if(E[P]===null)B+=this.indentate(I)+"<"+P+"/"+this.tagEndChar;else if(E[P]instanceof Date)B+=this.buildTextNode(E[P],P,"",I);else if(typeof E[P]!="object"){const N=this.isAttribute(P);N?M+=" "+N+'="'+this.options.attrValueProcessor(""+E[P])+'"':this.isCDATA(P)?E[this.options.textNodeName]?B+=this.replaceCDATAstr(E[this.options.textNodeName],E[P]):B+=this.replaceCDATAstr("",E[P]):P===this.options.textNodeName?E[this.options.cdataTagName]||(B+=this.options.tagValueProcessor(""+E[P])):B+=this.buildTextNode(E[P],P,"",I)}else if(Array.isArray(E[P]))if(this.isCDATA(P))B+=this.indentate(I),E[this.options.textNodeName]?B+=this.replaceCDATAarr(E[this.options.textNodeName],E[P]):B+=this.replaceCDATAarr("",E[P]);else{const N=E[P].length;for(let $=0;$<N;$++){const et=E[P][$];et===void 0||(B+=et===null?this.indentate(I)+"<"+P+"/"+this.tagEndChar:typeof et=="object"?this.processTextOrObjNode(et,P,I):this.buildTextNode(et,P,"",I))}}else if(this.options.attrNodeName&&P===this.options.attrNodeName){const N=Object.keys(E[P]),$=N.length;for(let et=0;et<$;et++)M+=" "+N[et]+'="'+this.options.attrValueProcessor(""+E[P][N[et]])+'"'}else B+=this.processTextOrObjNode(E[P],P,I);return{attrStr:M,val:B}},W.exports=S},8398:(W,_,y)=>{const x=function(g){return String.fromCharCode(g)},v={nilChar:x(176),missingChar:x(201),nilPremitive:x(175),missingPremitive:x(200),emptyChar:x(178),emptyValue:x(177),boundryChar:x(179),objStart:x(198),arrStart:x(204),arrayEnd:x(185)},m=[v.nilChar,v.nilPremitive,v.missingChar,v.missingPremitive,v.boundryChar,v.emptyChar,v.emptyValue,v.arrayEnd,v.objStart,v.arrStart],S=function(g,h,u){if(typeof h=="string")return g&&g[0]&&g[0].val!==void 0?a(g[0].val):a(g);{const b=(w=g)===void 0?v.missingChar:w===null?v.nilChar:!(w.child&&Object.keys(w.child).length===0&&(!w.attrsMap||Object.keys(w.attrsMap).length===0))||v.emptyChar;if(b===!0){let E="";if(Array.isArray(h)){E+=v.arrStart;const I=h[0],M=g.length;if(typeof I=="string")for(let B=0;B<M;B++){const P=a(g[B].val);E=p(E,P)}else for(let B=0;B<M;B++){const P=S(g[B],I,u);E=p(E,P)}E+=v.arrayEnd}else{E+=v.objStart;const I=Object.keys(h);Array.isArray(g)&&(g=g[0]);for(let M in I){const B=I[M];let P;P=!u.ignoreAttributes&&g.attrsMap&&g.attrsMap[B]?S(g.attrsMap[B],h[B],u):B===u.textNodeName?S(g.val,h[B],u):S(g.child[B],h[B],u),E=p(E,P)}}return E}return b}var w},a=function(g){switch(g){case void 0:return v.missingPremitive;case null:return v.nilPremitive;case"":return v.emptyValue;default:return g}},p=function(g,h){return c(h[0])||c(g[g.length-1])||(g+=v.boundryChar),g+h},c=function(g){return m.indexOf(g)!==-1},l=y(3543),f=y(7849).buildOptions;_.convert2nimn=function(g,h,u){return u=f(u,l.defaultOptions,l.props),S(g,h,u)}},284:(W,_,y)=>{const x=y(7849),v=function(m,S,a){const p={};if(!S.alwaysCreateTextNode&&(!m.child||x.isEmptyObject(m.child))&&(!m.attrsMap||x.isEmptyObject(m.attrsMap)))return x.isExist(m.val)?m.val:"";if(x.isExist(m.val)&&(typeof m.val!="string"||m.val!==""&&m.val!==S.cdataPositionChar)){const l=x.isTagNameInArrayMode(m.tagname,S.arrayMode,a);p[S.textNodeName]=l?[m.val]:m.val}x.merge(p,m.attrsMap,S.arrayMode);const c=Object.keys(m.child);for(let l=0;l<c.length;l++){const f=c[l];if(m.child[f]&&m.child[f].length>1){p[f]=[];for(let g in m.child[f])m.child[f].hasOwnProperty(g)&&p[f].push(v(m.child[f][g],S,f))}else{const g=v(m.child[f][0],S,f),h=S.arrayMode===!0&&typeof g=="object"||x.isTagNameInArrayMode(f,S.arrayMode,a);p[f]=h?[g]:g}}return p};_.convertToJson=v},7702:(W,_,y)=>{const x=y(7849),v=y(7849).buildOptions,m=y(3543),S=function(a,p,c){let l="{";const f=Object.keys(a.child);for(let h=0;h<f.length;h++){const u=f[h];if(a.child[u]&&a.child[u].length>1){l+='"'+u+'" : [ ';for(let w in a.child[u])l+=S(a.child[u][w],p)+" , ";l=l.substr(0,l.length-1)+" ] "}else l+='"'+u+'" : '+S(a.child[u][0],p)+" ,"}return x.merge(l,a.attrsMap),x.isEmptyObject(l)?x.isExist(a.val)?a.val:"":(x.isExist(a.val)&&(typeof a.val!="string"||a.val!==""&&a.val!==p.cdataPositionChar)&&(l+='"'+p.textNodeName+'" : '+((g=a.val)!==!0&&g!==!1&&isNaN(g)?'"'+g+'"':g)),l[l.length-1]===","&&(l=l.substr(0,l.length-2)),l+"}");var g};_.convertToJsonString=function(a,p){return(p=v(p,m.defaultOptions,m.props)).indentBy=p.indentBy||"",S(a,p)}},6965:(W,_,y)=>{y(5108);const x=y(284),v=y(3543),m=y(3543),S=y(7849).buildOptions,a=y(8383);_.parse=function(p,c={},l){if(l){l===!0&&(l={});const h=a.validate(p,l);if(h!==!0)throw Error(h.err.msg)}c.parseTrueNumberOnly&&c.parseNodeValue!==!1&&!c.numParseOptions&&(c.numParseOptions={leadingZeros:!1});let f=S(c,m.defaultOptions,m.props);const g=v.getTraversalObj(p,f);return x.convertToJson(g,f)},_.convertTonimn=y(8398).convert2nimn,_.getTraversalObj=v.getTraversalObj,_.convertToJson=x.convertToJson,_.convertToJsonString=y(7702).convertToJsonString,_.validate=a.validate,_.j2xParser=y(259),_.parseToNimn=function(p,c,l){return _.convertTonimn(_.getTraversalObj(p,l),c,l)}},7849:(W,_)=>{const y=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",x="["+y+"]["+y+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",v=new RegExp("^"+x+"$");_.isExist=function(m){return m!==void 0},_.isEmptyObject=function(m){return Object.keys(m).length===0},_.merge=function(m,S,a){if(S){const p=Object.keys(S),c=p.length;for(let l=0;l<c;l++)m[p[l]]=a==="strict"?[S[p[l]]]:S[p[l]]}},_.getValue=function(m){return _.isExist(m)?m:""},_.buildOptions=function(m,S,a){let p={};if(!m)return S;for(let c=0;c<a.length;c++)m[a[c]]!==void 0?p[a[c]]=m[a[c]]:p[a[c]]=S[a[c]];return p},_.isTagNameInArrayMode=function(m,S,a){return S!==!1&&(S instanceof RegExp?S.test(m):typeof S=="function"?!!S(m,a):S==="strict")},_.isName=function(m){return v.exec(m)!=null},_.getAllMatches=function(m,S){const a=[];let p=S.exec(m);for(;p;){const c=[];c.startIndex=S.lastIndex-p[0].length;const l=p.length;for(let f=0;f<l;f++)c.push(p[f]);a.push(c),p=S.exec(m)}return a},_.nameRegexp=x},8383:(W,_,y)=>{const x=y(7849),v={allowBooleanAttributes:!1},m=["allowBooleanAttributes"];function S(I,M){const B=M;for(;M<I.length;M++)if(!(I[M]!="?"&&I[M]!=" ")){const P=I.substr(B,M-B);if(M>5&&P==="xml")return u("InvalidXml","XML declaration allowed only at the start of the document.",b(I,M));if(I[M]=="?"&&I[M+1]==">"){M++;break}}return M}function a(I,M){if(I.length>M+5&&I[M+1]==="-"&&I[M+2]==="-"){for(M+=3;M<I.length;M++)if(I[M]==="-"&&I[M+1]==="-"&&I[M+2]===">"){M+=2;break}}else if(I.length>M+8&&I[M+1]==="D"&&I[M+2]==="O"&&I[M+3]==="C"&&I[M+4]==="T"&&I[M+5]==="Y"&&I[M+6]==="P"&&I[M+7]==="E"){let B=1;for(M+=8;M<I.length;M++)if(I[M]==="<")B++;else if(I[M]===">"&&(B--,B===0))break}else if(I.length>M+9&&I[M+1]==="["&&I[M+2]==="C"&&I[M+3]==="D"&&I[M+4]==="A"&&I[M+5]==="T"&&I[M+6]==="A"&&I[M+7]==="["){for(M+=8;M<I.length;M++)if(I[M]==="]"&&I[M+1]==="]"&&I[M+2]===">"){M+=2;break}}return M}_.validate=function(I,M){M=x.buildOptions(M,v,m);const B=[];let P=!1,N=!1;I[0]==="\uFEFF"&&(I=I.substr(1));for(let et=0;et<I.length;et++)if(I[et]==="<"&&I[et+1]==="?"){if(et+=2,et=S(I,et),et.err)return et}else{if(I[et]!=="<"){if(I[et]===" "||I[et]===" "||I[et]===`
|
|
73
73
|
`||I[et]==="\r")continue;return u("InvalidChar","char '"+I[et]+"' is not expected.",b(I,et))}{let Q=et;if(et++,I[et]==="!"){et=a(I,et);continue}{let ot=!1;I[et]==="/"&&(ot=!0,et++);let t="";for(;et<I.length&&I[et]!==">"&&I[et]!==" "&&I[et]!==" "&&I[et]!==`
|
|
74
74
|
`&&I[et]!=="\r";et++)t+=I[et];if(t=t.trim(),t[t.length-1]==="/"&&(t=t.substring(0,t.length-1),et--),$=t,!x.isName($)){let i;return i=t.trim().length===0?"Invalid space after '<'.":"Tag '"+t+"' is an invalid name.",u("InvalidTag",i,b(I,et))}const n=l(I,et);if(n===!1)return u("InvalidAttr","Attributes for '"+t+"' have open quote.",b(I,et));let r=n.value;if(et=n.index,r[r.length-1]==="/"){const i=et-r.length;r=r.substring(0,r.length-1);const e=g(r,M);if(e!==!0)return u(e.err.code,e.err.msg,b(I,i+e.err.line));P=!0}else if(ot){if(!n.tagClosed)return u("InvalidTag","Closing tag '"+t+"' doesn't have proper closing.",b(I,et));if(r.trim().length>0)return u("InvalidTag","Closing tag '"+t+"' can't have attributes or invalid starting.",b(I,Q));{const i=B.pop();if(t!==i.tagName){let e=b(I,i.tagStartPos);return u("InvalidTag","Expected closing tag '"+i.tagName+"' (opened in line "+e.line+", col "+e.col+") instead of closing tag '"+t+"'.",b(I,Q))}B.length==0&&(N=!0)}}else{const i=g(r,M);if(i!==!0)return u(i.err.code,i.err.msg,b(I,et-r.length+i.err.line));if(N===!0)return u("InvalidXml","Multiple possible root nodes found.",b(I,et));B.push({tagName:t,tagStartPos:Q}),P=!0}for(et++;et<I.length;et++)if(I[et]==="<"){if(I[et+1]==="!"){et++,et=a(I,et);continue}if(I[et+1]!=="?")break;if(et=S(I,++et),et.err)return et}else if(I[et]==="&"){const i=h(I,et);if(i==-1)return u("InvalidChar","char '&' is not expected.",b(I,et));et=i}I[et]==="<"&&et--}}}var $;return P?B.length==1?u("InvalidTag","Unclosed tag '"+B[0].tagName+"'.",b(I,B[0].tagStartPos)):!(B.length>0)||u("InvalidXml","Invalid '"+JSON.stringify(B.map(et=>et.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):u("InvalidXml","Start tag expected.",1)};const p='"',c="'";function l(I,M){let B="",P="",N=!1;for(;M<I.length;M++){if(I[M]===p||I[M]===c)P===""?P=I[M]:P!==I[M]||(P="");else if(I[M]===">"&&P===""){N=!0;break}B+=I[M]}return P===""&&{value:B,index:M,tagClosed:N}}const f=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function g(I,M){const B=x.getAllMatches(I,f),P={};for(let N=0;N<B.length;N++){if(B[N][1].length===0)return u("InvalidAttr","Attribute '"+B[N][2]+"' has no space in starting.",E(B[N]));if(B[N][3]===void 0&&!M.allowBooleanAttributes)return u("InvalidAttr","boolean attribute '"+B[N][2]+"' is not allowed.",E(B[N]));const $=B[N][2];if(!w($))return u("InvalidAttr","Attribute '"+$+"' is an invalid name.",E(B[N]));if(P.hasOwnProperty($))return u("InvalidAttr","Attribute '"+$+"' is repeated.",E(B[N]));P[$]=1}return!0}function h(I,M){if(I[++M]===";")return-1;if(I[M]==="#")return function(P,N){let $=/\d/;for(P[N]==="x"&&(N++,$=/[\da-fA-F]/);N<P.length;N++){if(P[N]===";")return N;if(!P[N].match($))break}return-1}(I,++M);let B=0;for(;M<I.length;M++,B++)if(!(I[M].match(/\w/)&&B<20)){if(I[M]===";")break;return-1}return M}function u(I,M,B){return{err:{code:I,msg:M,line:B.line||B,col:B.col}}}function w(I){return x.isName(I)}function b(I,M){const B=I.substring(0,M).split(/\r?\n/);return{line:B.length,col:B[B.length-1].length+1}}function E(I){return I.startIndex+I[1].length}},6468:W=>{W.exports=function(_,y,x){this.tagname=_,this.parent=y,this.child={},this.attrsMap={},this.val=x,this.addChild=function(v){Array.isArray(this.child[v.tagname])?this.child[v.tagname].push(v):this.child[v.tagname]=[v]}}},3543:(W,_,y)=>{const x=y(7849),v=y(7849).buildOptions,m=y(6468),S=y(4153);"<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,x.nameRegexp),!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const a={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,cdataTagName:!1,cdataPositionChar:"\\c",numParseOptions:{hex:!0,leadingZeros:!0},tagValueProcessor:function(b,E){return b},attrValueProcessor:function(b,E){return b},stopNodes:[],alwaysCreateTextNode:!1};_.defaultOptions=a;const p=["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseNodeValue","parseAttributeValue","arrayMode","trimValues","cdataTagName","cdataPositionChar","tagValueProcessor","attrValueProcessor","parseTrueNumberOnly","numParseOptions","stopNodes","alwaysCreateTextNode"];function c(b,E,I){return E&&(I.trimValues&&(E=E.trim()),E=f(E=I.tagValueProcessor(E,b),I.parseNodeValue,I.numParseOptions)),E}function l(b,E){if(E.ignoreNameSpace){const I=b.split(":"),M=b.charAt(0)==="/"?"/":"";if(I[0]==="xmlns")return"";I.length===2&&(b=M+I[1])}return b}function f(b,E,I){if(E&&typeof b=="string"){const M=b.trim();return M==="true"||M!=="false"&&S(b,I)}return x.isExist(b)?b:""}_.props=p;const g=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])(.*?)\\3)?`,"g");function h(b,E){if(!E.ignoreAttributes&&typeof b=="string"){b=b.replace(/\r?\n/g," ");const I=x.getAllMatches(b,g),M=I.length,B={};for(let P=0;P<M;P++){const N=l(I[P][1],E);N.length&&(I[P][4]!==void 0?(E.trimValues&&(I[P][4]=I[P][4].trim()),I[P][4]=E.attrValueProcessor(I[P][4],N),B[E.attributeNamePrefix+N]=f(I[P][4],E.parseAttributeValue,E.numParseOptions)):E.allowBooleanAttributes&&(B[E.attributeNamePrefix+N]=!0))}if(!Object.keys(B).length)return;if(E.attrNodeName){const P={};return P[E.attrNodeName]=B,P}return B}}function u(b,E){let I,M="";for(let B=E;B<b.length;B++){let P=b[B];if(I)P===I&&(I="");else if(P==='"'||P==="'")I=P;else{if(P===">")return{data:M,index:B};P===" "&&(P=" ")}M+=P}}function w(b,E,I,M){const B=b.indexOf(E,I);if(B===-1)throw new Error(M);return B+E.length-1}_.getTraversalObj=function(b,E){b=b.replace(/\r\n?/g,`
|
|
75
|
-
`),E=v(E,a,p);const I=new m("!xml");let M=I,B="";for(let P=0;P<b.length;P++)if(b[P]==="<")if(b[P+1]==="/"){const N=w(b,">",P,"Closing Tag is not closed.");let $=b.substring(P+2,N).trim();if(E.ignoreNameSpace){const et=$.indexOf(":");et!==-1&&($=$.substr(et+1))}M&&(M.val?M.val=x.getValue(M.val)+""+c($,B,E):M.val=c($,B,E)),E.stopNodes.length&&E.stopNodes.includes(M.tagname)&&(M.child=[],M.attrsMap==null&&(M.attrsMap={}),M.val=b.substr(M.startIndex+1,P-M.startIndex-1)),M=M.parent,B="",P=N}else if(b[P+1]==="?")P=w(b,"?>",P,"Pi Tag is not closed.");else if(b.substr(P+1,3)==="!--")P=w(b,"-->",P,"Comment is not closed.");else if(b.substr(P+1,2)==="!D"){const N=w(b,">",P,"DOCTYPE is not closed.");P=b.substring(P,N).indexOf("[")>=0?b.indexOf("]>",P)+1:N}else if(b.substr(P+1,2)==="!["){const N=w(b,"]]>",P,"CDATA is not closed.")-2,$=b.substring(P+9,N);if(B&&(M.val=x.getValue(M.val)+""+c(M.tagname,B,E),B=""),E.cdataTagName){const et=new m(E.cdataTagName,M,$);M.addChild(et),M.val=x.getValue(M.val)+E.cdataPositionChar,$&&(et.val=$)}else M.val=(M.val||"")+($||"");P=N+2}else{const N=u(b,P+1);let $=N.data;const et=N.index,Q=$.indexOf(" ");let ot=$,t=!0;if(Q!==-1&&(ot=$.substr(0,Q).replace(/\s\s*$/,""),$=$.substr(Q+1)),E.ignoreNameSpace){const n=ot.indexOf(":");n!==-1&&(ot=ot.substr(n+1),t=ot!==N.data.substr(n+1))}if(M&&B&&M.tagname!=="!xml"&&(M.val=x.getValue(M.val)+""+c(M.tagname,B,E)),$.length>0&&$.lastIndexOf("/")===$.length-1){ot[ot.length-1]==="/"?(ot=ot.substr(0,ot.length-1),$=ot):$=$.substr(0,$.length-1);const n=new m(ot,M,"");ot!==$&&(n.attrsMap=h($,E)),M.addChild(n)}else{const n=new m(ot,M);E.stopNodes.length&&E.stopNodes.includes(n.tagname)&&(n.startIndex=et),ot!==$&&t&&(n.attrsMap=h($,E)),M.addChild(n),M=n}B="",P=et}else B+=b[P];return I}},2806:W=>{W.exports=function(_,y){for(var x={},v=Object.keys(_),m=Array.isArray(y),S=0;S<v.length;S++){var a=v[S],p=_[a];(m?y.indexOf(a)!==-1:y(a,p,_))&&(x[a]=p)}return x}},4029:(W,_,y)=>{var x=y(5320),v=Object.prototype.toString,m=Object.prototype.hasOwnProperty,S=function(c,l,f){for(var g=0,h=c.length;g<h;g++)m.call(c,g)&&(f==null?l(c[g],g,c):l.call(f,c[g],g,c))},a=function(c,l,f){for(var g=0,h=c.length;g<h;g++)f==null?l(c.charAt(g),g,c):l.call(f,c.charAt(g),g,c)},p=function(c,l,f){for(var g in c)m.call(c,g)&&(f==null?l(c[g],g,c):l.call(f,c[g],g,c))};W.exports=function(c,l,f){if(!x(l))throw new TypeError("iterator must be a function");var g;arguments.length>=3&&(g=f),v.call(c)==="[object Array]"?S(c,l,g):typeof c=="string"?a(c,l,g):p(c,l,g)}},7648:W=>{var _="Function.prototype.bind called on incompatible ",y=Array.prototype.slice,x=Object.prototype.toString,v="[object Function]";W.exports=function(m){var S=this;if(typeof S!="function"||x.call(S)!==v)throw new TypeError(_+S);for(var a,p=y.call(arguments,1),c=Math.max(0,S.length-p.length),l=[],f=0;f<c;f++)l.push("$"+f);if(a=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof a){var h=S.apply(this,p.concat(y.call(arguments)));return Object(h)===h?h:this}return S.apply(m,p.concat(y.call(arguments)))}),S.prototype){var g=function(){};g.prototype=S.prototype,a.prototype=new g,g.prototype=null}return a}},8612:(W,_,y)=>{var x=y(7648);W.exports=Function.prototype.bind||x},210:(W,_,y)=>{var x,v=SyntaxError,m=Function,S=TypeError,a=function(i){try{return m('"use strict"; return ('+i+").constructor;")()}catch{}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch{p=null}var c=function(){throw new S},l=p?function(){try{return c}catch{try{return p(arguments,"callee").get}catch{return c}}}():c,f=y(1405)(),g=Object.getPrototypeOf||function(i){return i.__proto__},h={},u=typeof Uint8Array>"u"?x:g(Uint8Array),w={"%AggregateError%":typeof AggregateError>"u"?x:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?x:ArrayBuffer,"%ArrayIteratorPrototype%":f?g([][Symbol.iterator]()):x,"%AsyncFromSyncIteratorPrototype%":x,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":typeof Atomics>"u"?x:Atomics,"%BigInt%":typeof BigInt>"u"?x:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?x:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?x:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?x:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?x:Float32Array,"%Float64Array%":typeof Float64Array>"u"?x:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?x:FinalizationRegistry,"%Function%":m,"%GeneratorFunction%":h,"%Int8Array%":typeof Int8Array>"u"?x:Int8Array,"%Int16Array%":typeof Int16Array>"u"?x:Int16Array,"%Int32Array%":typeof Int32Array>"u"?x:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?g(g([][Symbol.iterator]())):x,"%JSON%":typeof JSON=="object"?JSON:x,"%Map%":typeof Map>"u"?x:Map,"%MapIteratorPrototype%":typeof Map<"u"&&f?g(new Map()[Symbol.iterator]()):x,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?x:Promise,"%Proxy%":typeof Proxy>"u"?x:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?x:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?x:Set,"%SetIteratorPrototype%":typeof Set<"u"&&f?g(new Set()[Symbol.iterator]()):x,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?x:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?g(""[Symbol.iterator]()):x,"%Symbol%":f?Symbol:x,"%SyntaxError%":v,"%ThrowTypeError%":l,"%TypedArray%":u,"%TypeError%":S,"%Uint8Array%":typeof Uint8Array>"u"?x:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?x:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?x:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?x:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?x:WeakMap,"%WeakRef%":typeof WeakRef>"u"?x:WeakRef,"%WeakSet%":typeof WeakSet>"u"?x:WeakSet};try{null.error}catch(i){var b=g(g(i));w["%Error.prototype%"]=b}var E=function i(e){var o;if(e==="%AsyncFunction%")o=a("async function () {}");else if(e==="%GeneratorFunction%")o=a("function* () {}");else if(e==="%AsyncGeneratorFunction%")o=a("async function* () {}");else if(e==="%AsyncGenerator%"){var s=i("%AsyncGeneratorFunction%");s&&(o=s.prototype)}else if(e==="%AsyncIteratorPrototype%"){var A=i("%AsyncGenerator%");A&&(o=g(A.prototype))}return w[e]=o,o},I={"%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"]},M=y(8612),B=y(7642),P=M.call(Function.call,Array.prototype.concat),N=M.call(Function.apply,Array.prototype.splice),$=M.call(Function.call,String.prototype.replace),et=M.call(Function.call,String.prototype.slice),Q=M.call(Function.call,RegExp.prototype.exec),ot=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,t=/\\(\\)?/g,n=function(i){var e=et(i,0,1),o=et(i,-1);if(e==="%"&&o!=="%")throw new v("invalid intrinsic syntax, expected closing `%`");if(o==="%"&&e!=="%")throw new v("invalid intrinsic syntax, expected opening `%`");var s=[];return $(i,ot,function(A,C,j,T){s[s.length]=j?$(T,t,"$1"):C||A}),s},r=function(i,e){var o,s=i;if(B(I,s)&&(s="%"+(o=I[s])[0]+"%"),B(w,s)){var A=w[s];if(A===h&&(A=E(s)),A===void 0&&!e)throw new S("intrinsic "+i+" exists, but is not available. Please file an issue!");return{alias:o,name:s,value:A}}throw new v("intrinsic "+i+" does not exist!")};W.exports=function(i,e){if(typeof i!="string"||i.length===0)throw new S("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new S('"allowMissing" argument must be a boolean');if(Q(/^%?[^%]*%?$/,i)===null)throw new v("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var o=n(i),s=o.length>0?o[0]:"",A=r("%"+s+"%",e),C=A.name,j=A.value,T=!1,R=A.alias;R&&(s=R[0],N(o,P([0,1],R)));for(var q=1,Z=!0;q<o.length;q+=1){var rt=o[q],D=et(rt,0,1),G=et(rt,-1);if((D==='"'||D==="'"||D==="`"||G==='"'||G==="'"||G==="`")&&D!==G)throw new v("property names with quotes must have matching quotes");if(rt!=="constructor"&&Z||(T=!0),B(w,C="%"+(s+="."+rt)+"%"))j=w[C];else if(j!=null){if(!(rt in j)){if(!e)throw new S("base intrinsic for "+i+" exists, but the property is not available.");return}if(p&&q+1>=o.length){var z=p(j,rt);j=(Z=!!z)&&"get"in z&&!("originalValue"in z.get)?z.get:j[rt]}else Z=B(j,rt),j=j[rt];Z&&!T&&(w[C]=j)}}return j}},7296:(W,_,y)=>{var x=y(210)("%Object.getOwnPropertyDescriptor%",!0);if(x)try{x([],"length")}catch{x=null}W.exports=x},1044:(W,_,y)=>{var x=y(210)("%Object.defineProperty%",!0),v=function(){if(x)try{return x({},"a",{value:1}),!0}catch{return!1}return!1};v.hasArrayLengthDefineBug=function(){if(!v())return null;try{return x([],"length",{value:1}).length!==1}catch{return!0}},W.exports=v},1405:(W,_,y)=>{var x=typeof Symbol<"u"&&Symbol,v=y(5419);W.exports=function(){return typeof x=="function"&&typeof Symbol=="function"&&typeof x("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&v()}},5419:W=>{W.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var _={},y=Symbol("test"),x=Object(y);if(typeof y=="string"||Object.prototype.toString.call(y)!=="[object Symbol]"||Object.prototype.toString.call(x)!=="[object Symbol]")return!1;for(y in _[y]=42,_)return!1;if(typeof Object.keys=="function"&&Object.keys(_).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(_).length!==0)return!1;var v=Object.getOwnPropertySymbols(_);if(v.length!==1||v[0]!==y||!Object.prototype.propertyIsEnumerable.call(_,y))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var m=Object.getOwnPropertyDescriptor(_,y);if(m.value!==42||m.enumerable!==!0)return!1}return!0}},6410:(W,_,y)=>{var x=y(5419);W.exports=function(){return x()&&!!Symbol.toStringTag}},7642:(W,_,y)=>{var x=y(8612);W.exports=x.call(Function.call,Object.prototype.hasOwnProperty)},3349:(W,_,y)=>{var x=y(9509).Buffer,v=y(8473).Transform;function m(S){v.call(this),this._block=x.allocUnsafe(S),this._blockSize=S,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}y(5717)(m,v),m.prototype._transform=function(S,a,p){var c=null;try{this.update(S,a)}catch(l){c=l}p(c)},m.prototype._flush=function(S){var a=null;try{this.push(this.digest())}catch(p){a=p}S(a)},m.prototype.update=function(S,a){if(function(h,u){if(!x.isBuffer(h)&&typeof h!="string")throw new TypeError("Data must be a string or a buffer")}(S),this._finalized)throw new Error("Digest already called");x.isBuffer(S)||(S=x.from(S,a));for(var p=this._block,c=0;this._blockOffset+S.length-c>=this._blockSize;){for(var l=this._blockOffset;l<this._blockSize;)p[l++]=S[c++];this._update(),this._blockOffset=0}for(;c<S.length;)p[this._blockOffset++]=S[c++];for(var f=0,g=8*S.length;g>0;++f)this._length[f]+=g,(g=this._length[f]/4294967296|0)>0&&(this._length[f]-=4294967296*g);return this},m.prototype._update=function(){throw new Error("_update is not implemented")},m.prototype.digest=function(S){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var a=this._digest();S!==void 0&&(a=a.toString(S)),this._block.fill(0),this._blockOffset=0;for(var p=0;p<4;++p)this._length[p]=0;return a},m.prototype._digest=function(){throw new Error("_digest is not implemented")},W.exports=m},3715:(W,_,y)=>{var x=_;x.utils=y(6436),x.common=y(5772),x.sha=y(9041),x.ripemd=y(2949),x.hmac=y(2344),x.sha1=x.sha.sha1,x.sha256=x.sha.sha256,x.sha224=x.sha.sha224,x.sha384=x.sha.sha384,x.sha512=x.sha.sha512,x.ripemd160=x.ripemd.ripemd160},5772:(W,_,y)=>{var x=y(6436),v=y(9746);function m(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}_.BlockHash=m,m.prototype.update=function(S,a){if(S=x.toArray(S,a),this.pending?this.pending=this.pending.concat(S):this.pending=S,this.pendingTotal+=S.length,this.pending.length>=this._delta8){var p=(S=this.pending).length%this._delta8;this.pending=S.slice(S.length-p,S.length),this.pending.length===0&&(this.pending=null),S=x.join32(S,0,S.length-p,this.endian);for(var c=0;c<S.length;c+=this._delta32)this._update(S,c,c+this._delta32)}return this},m.prototype.digest=function(S){return this.update(this._pad()),v(this.pending===null),this._digest(S)},m.prototype._pad=function(){var S=this.pendingTotal,a=this._delta8,p=a-(S+this.padLength)%a,c=new Array(p+this.padLength);c[0]=128;for(var l=1;l<p;l++)c[l]=0;if(S<<=3,this.endian==="big"){for(var f=8;f<this.padLength;f++)c[l++]=0;c[l++]=0,c[l++]=0,c[l++]=0,c[l++]=0,c[l++]=S>>>24&255,c[l++]=S>>>16&255,c[l++]=S>>>8&255,c[l++]=255&S}else for(c[l++]=255&S,c[l++]=S>>>8&255,c[l++]=S>>>16&255,c[l++]=S>>>24&255,c[l++]=0,c[l++]=0,c[l++]=0,c[l++]=0,f=8;f<this.padLength;f++)c[l++]=0;return c}},2344:(W,_,y)=>{var x=y(6436),v=y(9746);function m(S,a,p){if(!(this instanceof m))return new m(S,a,p);this.Hash=S,this.blockSize=S.blockSize/8,this.outSize=S.outSize/8,this.inner=null,this.outer=null,this._init(x.toArray(a,p))}W.exports=m,m.prototype._init=function(S){S.length>this.blockSize&&(S=new this.Hash().update(S).digest()),v(S.length<=this.blockSize);for(var a=S.length;a<this.blockSize;a++)S.push(0);for(a=0;a<S.length;a++)S[a]^=54;for(this.inner=new this.Hash().update(S),a=0;a<S.length;a++)S[a]^=106;this.outer=new this.Hash().update(S)},m.prototype.update=function(S,a){return this.inner.update(S,a),this},m.prototype.digest=function(S){return this.outer.update(this.inner.digest()),this.outer.digest(S)}},2949:(W,_,y)=>{var x=y(6436),v=y(5772),m=x.rotl32,S=x.sum32,a=x.sum32_3,p=x.sum32_4,c=v.BlockHash;function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(I,M,B,P){return I<=15?M^B^P:I<=31?M&B|~M&P:I<=47?(M|~B)^P:I<=63?M&P|B&~P:M^(B|~P)}function g(I){return I<=15?0:I<=31?1518500249:I<=47?1859775393:I<=63?2400959708:2840853838}function h(I){return I<=15?1352829926:I<=31?1548603684:I<=47?1836072691:I<=63?2053994217:0}x.inherits(l,c),_.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(I,M){for(var B=this.h[0],P=this.h[1],N=this.h[2],$=this.h[3],et=this.h[4],Q=B,ot=P,t=N,n=$,r=et,i=0;i<80;i++){var e=S(m(p(B,f(i,P,N,$),I[u[i]+M],g(i)),b[i]),et);B=et,et=$,$=m(N,10),N=P,P=e,e=S(m(p(Q,f(79-i,ot,t,n),I[w[i]+M],h(i)),E[i]),r),Q=r,r=n,n=m(t,10),t=ot,ot=e}e=a(this.h[1],N,n),this.h[1]=a(this.h[2],$,r),this.h[2]=a(this.h[3],et,Q),this.h[3]=a(this.h[4],B,ot),this.h[4]=a(this.h[0],P,t),this.h[0]=e},l.prototype._digest=function(I){return I==="hex"?x.toHex32(this.h,"little"):x.split32(this.h,"little")};var u=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],w=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],b=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],E=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},9041:(W,_,y)=>{_.sha1=y(4761),_.sha224=y(799),_.sha256=y(9344),_.sha384=y(772),_.sha512=y(5900)},4761:(W,_,y)=>{var x=y(6436),v=y(5772),m=y(7038),S=x.rotl32,a=x.sum32,p=x.sum32_5,c=m.ft_1,l=v.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function g(){if(!(this instanceof g))return new g;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}x.inherits(g,l),W.exports=g,g.blockSize=512,g.outSize=160,g.hmacStrength=80,g.padLength=64,g.prototype._update=function(h,u){for(var w=this.W,b=0;b<16;b++)w[b]=h[u+b];for(;b<w.length;b++)w[b]=S(w[b-3]^w[b-8]^w[b-14]^w[b-16],1);var E=this.h[0],I=this.h[1],M=this.h[2],B=this.h[3],P=this.h[4];for(b=0;b<w.length;b++){var N=~~(b/20),$=p(S(E,5),c(N,I,M,B),P,w[b],f[N]);P=B,B=M,M=S(I,30),I=E,E=$}this.h[0]=a(this.h[0],E),this.h[1]=a(this.h[1],I),this.h[2]=a(this.h[2],M),this.h[3]=a(this.h[3],B),this.h[4]=a(this.h[4],P)},g.prototype._digest=function(h){return h==="hex"?x.toHex32(this.h,"big"):x.split32(this.h,"big")}},799:(W,_,y)=>{var x=y(6436),v=y(9344);function m(){if(!(this instanceof m))return new m;v.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}x.inherits(m,v),W.exports=m,m.blockSize=512,m.outSize=224,m.hmacStrength=192,m.padLength=64,m.prototype._digest=function(S){return S==="hex"?x.toHex32(this.h.slice(0,7),"big"):x.split32(this.h.slice(0,7),"big")}},9344:(W,_,y)=>{var x=y(6436),v=y(5772),m=y(7038),S=y(9746),a=x.sum32,p=x.sum32_4,c=x.sum32_5,l=m.ch32,f=m.maj32,g=m.s0_256,h=m.s1_256,u=m.g0_256,w=m.g1_256,b=v.BlockHash,E=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function I(){if(!(this instanceof I))return new I;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=E,this.W=new Array(64)}x.inherits(I,b),W.exports=I,I.blockSize=512,I.outSize=256,I.hmacStrength=192,I.padLength=64,I.prototype._update=function(M,B){for(var P=this.W,N=0;N<16;N++)P[N]=M[B+N];for(;N<P.length;N++)P[N]=p(w(P[N-2]),P[N-7],u(P[N-15]),P[N-16]);var $=this.h[0],et=this.h[1],Q=this.h[2],ot=this.h[3],t=this.h[4],n=this.h[5],r=this.h[6],i=this.h[7];for(S(this.k.length===P.length),N=0;N<P.length;N++){var e=c(i,h(t),l(t,n,r),this.k[N],P[N]),o=a(g($),f($,et,Q));i=r,r=n,n=t,t=a(ot,e),ot=Q,Q=et,et=$,$=a(e,o)}this.h[0]=a(this.h[0],$),this.h[1]=a(this.h[1],et),this.h[2]=a(this.h[2],Q),this.h[3]=a(this.h[3],ot),this.h[4]=a(this.h[4],t),this.h[5]=a(this.h[5],n),this.h[6]=a(this.h[6],r),this.h[7]=a(this.h[7],i)},I.prototype._digest=function(M){return M==="hex"?x.toHex32(this.h,"big"):x.split32(this.h,"big")}},772:(W,_,y)=>{var x=y(6436),v=y(5900);function m(){if(!(this instanceof m))return new m;v.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}x.inherits(m,v),W.exports=m,m.blockSize=1024,m.outSize=384,m.hmacStrength=192,m.padLength=128,m.prototype._digest=function(S){return S==="hex"?x.toHex32(this.h.slice(0,12),"big"):x.split32(this.h.slice(0,12),"big")}},5900:(W,_,y)=>{var x=y(6436),v=y(5772),m=y(9746),S=x.rotr64_hi,a=x.rotr64_lo,p=x.shr64_hi,c=x.shr64_lo,l=x.sum64,f=x.sum64_hi,g=x.sum64_lo,h=x.sum64_4_hi,u=x.sum64_4_lo,w=x.sum64_5_hi,b=x.sum64_5_lo,E=v.BlockHash,I=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function M(){if(!(this instanceof M))return new M;E.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=I,this.W=new Array(160)}function B(i,e,o,s,A){var C=i&o^~i&A;return C<0&&(C+=4294967296),C}function P(i,e,o,s,A,C){var j=e&s^~e&C;return j<0&&(j+=4294967296),j}function N(i,e,o,s,A){var C=i&o^i&A^o&A;return C<0&&(C+=4294967296),C}function $(i,e,o,s,A,C){var j=e&s^e&C^s&C;return j<0&&(j+=4294967296),j}function et(i,e){var o=S(i,e,28)^S(e,i,2)^S(e,i,7);return o<0&&(o+=4294967296),o}function Q(i,e){var o=a(i,e,28)^a(e,i,2)^a(e,i,7);return o<0&&(o+=4294967296),o}function ot(i,e){var o=a(i,e,14)^a(i,e,18)^a(e,i,9);return o<0&&(o+=4294967296),o}function t(i,e){var o=S(i,e,1)^S(i,e,8)^p(i,e,7);return o<0&&(o+=4294967296),o}function n(i,e){var o=a(i,e,1)^a(i,e,8)^c(i,e,7);return o<0&&(o+=4294967296),o}function r(i,e){var o=a(i,e,19)^a(e,i,29)^c(i,e,6);return o<0&&(o+=4294967296),o}x.inherits(M,E),W.exports=M,M.blockSize=1024,M.outSize=512,M.hmacStrength=192,M.padLength=128,M.prototype._prepareBlock=function(i,e){for(var o=this.W,s=0;s<32;s++)o[s]=i[e+s];for(;s<o.length;s+=2){var A=(D=o[s-4],G=o[s-3],z=void 0,(z=S(D,G,19)^S(G,D,29)^p(D,G,6))<0&&(z+=4294967296),z),C=r(o[s-4],o[s-3]),j=o[s-14],T=o[s-13],R=t(o[s-30],o[s-29]),q=n(o[s-30],o[s-29]),Z=o[s-32],rt=o[s-31];o[s]=h(A,C,j,T,R,q,Z,rt),o[s+1]=u(A,C,j,T,R,q,Z,rt)}var D,G,z},M.prototype._update=function(i,e){this._prepareBlock(i,e);var o,s,A,C=this.W,j=this.h[0],T=this.h[1],R=this.h[2],q=this.h[3],Z=this.h[4],rt=this.h[5],D=this.h[6],G=this.h[7],z=this.h[8],X=this.h[9],st=this.h[10],nt=this.h[11],lt=this.h[12],Et=this.h[13],gt=this.h[14],bt=this.h[15];m(this.k.length===C.length);for(var Bt=0;Bt<C.length;Bt+=2){var Mt=gt,It=bt,J=(A=void 0,(A=S(o=z,s=X,14)^S(o,s,18)^S(s,o,9))<0&&(A+=4294967296),A),tt=ot(z,X),F=B(z,0,st,0,lt),H=P(0,X,0,nt,0,Et),U=this.k[Bt],it=this.k[Bt+1],pt=C[Bt],ft=C[Bt+1],mt=w(Mt,It,J,tt,F,H,U,it,pt,ft),re=b(Mt,It,J,tt,F,H,U,it,pt,ft);Mt=et(j,T),It=Q(j,T),J=N(j,0,R,0,Z),tt=$(0,T,0,q,0,rt);var _t=f(Mt,It,J,tt),At=g(Mt,It,J,tt);gt=lt,bt=Et,lt=st,Et=nt,st=z,nt=X,z=f(D,G,mt,re),X=g(G,G,mt,re),D=Z,G=rt,Z=R,rt=q,R=j,q=T,j=f(mt,re,_t,At),T=g(mt,re,_t,At)}l(this.h,0,j,T),l(this.h,2,R,q),l(this.h,4,Z,rt),l(this.h,6,D,G),l(this.h,8,z,X),l(this.h,10,st,nt),l(this.h,12,lt,Et),l(this.h,14,gt,bt)},M.prototype._digest=function(i){return i==="hex"?x.toHex32(this.h,"big"):x.split32(this.h,"big")}},7038:(W,_,y)=>{var x=y(6436).rotr32;function v(a,p,c){return a&p^~a&c}function m(a,p,c){return a&p^a&c^p&c}function S(a,p,c){return a^p^c}_.ft_1=function(a,p,c,l){return a===0?v(p,c,l):a===1||a===3?S(p,c,l):a===2?m(p,c,l):void 0},_.ch32=v,_.maj32=m,_.p32=S,_.s0_256=function(a){return x(a,2)^x(a,13)^x(a,22)},_.s1_256=function(a){return x(a,6)^x(a,11)^x(a,25)},_.g0_256=function(a){return x(a,7)^x(a,18)^a>>>3},_.g1_256=function(a){return x(a,17)^x(a,19)^a>>>10}},6436:(W,_,y)=>{var x=y(9746),v=y(5717);function m(c,l){return(64512&c.charCodeAt(l))==55296&&!(l<0||l+1>=c.length)&&(64512&c.charCodeAt(l+1))==56320}function S(c){return(c>>>24|c>>>8&65280|c<<8&16711680|(255&c)<<24)>>>0}function a(c){return c.length===1?"0"+c:c}function p(c){return c.length===7?"0"+c:c.length===6?"00"+c:c.length===5?"000"+c:c.length===4?"0000"+c:c.length===3?"00000"+c:c.length===2?"000000"+c:c.length===1?"0000000"+c:c}_.inherits=v,_.toArray=function(c,l){if(Array.isArray(c))return c.slice();if(!c)return[];var f=[];if(typeof c=="string")if(l){if(l==="hex")for((c=c.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(c="0"+c),h=0;h<c.length;h+=2)f.push(parseInt(c[h]+c[h+1],16))}else for(var g=0,h=0;h<c.length;h++){var u=c.charCodeAt(h);u<128?f[g++]=u:u<2048?(f[g++]=u>>6|192,f[g++]=63&u|128):m(c,h)?(u=65536+((1023&u)<<10)+(1023&c.charCodeAt(++h)),f[g++]=u>>18|240,f[g++]=u>>12&63|128,f[g++]=u>>6&63|128,f[g++]=63&u|128):(f[g++]=u>>12|224,f[g++]=u>>6&63|128,f[g++]=63&u|128)}else for(h=0;h<c.length;h++)f[h]=0|c[h];return f},_.toHex=function(c){for(var l="",f=0;f<c.length;f++)l+=a(c[f].toString(16));return l},_.htonl=S,_.toHex32=function(c,l){for(var f="",g=0;g<c.length;g++){var h=c[g];l==="little"&&(h=S(h)),f+=p(h.toString(16))}return f},_.zero2=a,_.zero8=p,_.join32=function(c,l,f,g){var h=f-l;x(h%4==0);for(var u=new Array(h/4),w=0,b=l;w<u.length;w++,b+=4){var E;E=g==="big"?c[b]<<24|c[b+1]<<16|c[b+2]<<8|c[b+3]:c[b+3]<<24|c[b+2]<<16|c[b+1]<<8|c[b],u[w]=E>>>0}return u},_.split32=function(c,l){for(var f=new Array(4*c.length),g=0,h=0;g<c.length;g++,h+=4){var u=c[g];l==="big"?(f[h]=u>>>24,f[h+1]=u>>>16&255,f[h+2]=u>>>8&255,f[h+3]=255&u):(f[h+3]=u>>>24,f[h+2]=u>>>16&255,f[h+1]=u>>>8&255,f[h]=255&u)}return f},_.rotr32=function(c,l){return c>>>l|c<<32-l},_.rotl32=function(c,l){return c<<l|c>>>32-l},_.sum32=function(c,l){return c+l>>>0},_.sum32_3=function(c,l,f){return c+l+f>>>0},_.sum32_4=function(c,l,f,g){return c+l+f+g>>>0},_.sum32_5=function(c,l,f,g,h){return c+l+f+g+h>>>0},_.sum64=function(c,l,f,g){var h=c[l],u=g+c[l+1]>>>0,w=(u<g?1:0)+f+h;c[l]=w>>>0,c[l+1]=u},_.sum64_hi=function(c,l,f,g){return(l+g>>>0<l?1:0)+c+f>>>0},_.sum64_lo=function(c,l,f,g){return l+g>>>0},_.sum64_4_hi=function(c,l,f,g,h,u,w,b){var E=0,I=l;return E+=(I=I+g>>>0)<l?1:0,E+=(I=I+u>>>0)<u?1:0,c+f+h+w+(E+=(I=I+b>>>0)<b?1:0)>>>0},_.sum64_4_lo=function(c,l,f,g,h,u,w,b){return l+g+u+b>>>0},_.sum64_5_hi=function(c,l,f,g,h,u,w,b,E,I){var M=0,B=l;return M+=(B=B+g>>>0)<l?1:0,M+=(B=B+u>>>0)<u?1:0,M+=(B=B+b>>>0)<b?1:0,c+f+h+w+E+(M+=(B=B+I>>>0)<I?1:0)>>>0},_.sum64_5_lo=function(c,l,f,g,h,u,w,b,E,I){return l+g+u+b+I>>>0},_.rotr64_hi=function(c,l,f){return(l<<32-f|c>>>f)>>>0},_.rotr64_lo=function(c,l,f){return(c<<32-f|l>>>f)>>>0},_.shr64_hi=function(c,l,f){return c>>>f},_.shr64_lo=function(c,l,f){return(c<<32-f|l>>>f)>>>0}},2156:(W,_,y)=>{var x=y(3715),v=y(4504),m=y(9746);function S(a){if(!(this instanceof S))return new S(a);this.hash=a.hash,this.predResist=!!a.predResist,this.outLen=this.hash.outSize,this.minEntropy=a.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var p=v.toArray(a.entropy,a.entropyEnc||"hex"),c=v.toArray(a.nonce,a.nonceEnc||"hex"),l=v.toArray(a.pers,a.persEnc||"hex");m(p.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(p,c,l)}W.exports=S,S.prototype._init=function(a,p,c){var l=a.concat(p).concat(c);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(l),this._reseed=1,this.reseedInterval=281474976710656},S.prototype._hmac=function(){return new x.hmac(this.hash,this.K)},S.prototype._update=function(a){var p=this._hmac().update(this.V).update([0]);a&&(p=p.update(a)),this.K=p.digest(),this.V=this._hmac().update(this.V).digest(),a&&(this.K=this._hmac().update(this.V).update([1]).update(a).digest(),this.V=this._hmac().update(this.V).digest())},S.prototype.reseed=function(a,p,c,l){typeof p!="string"&&(l=c,c=p,p=null),a=v.toArray(a,p),c=v.toArray(c,l),m(a.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(a.concat(c||[])),this._reseed=1},S.prototype.generate=function(a,p,c,l){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof p!="string"&&(l=c,c=p,p=null),c&&(c=v.toArray(c,l||"hex"),this._update(c));for(var f=[];f.length<a;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var g=f.slice(0,a);return this._update(c),this._reseed++,v.encode(g,p)}},9267:(W,_,y)=>{var x=y(8501),v=y(8575),m=W.exports;for(var S in x)x.hasOwnProperty(S)&&(m[S]=x[S]);function a(p){if(typeof p=="string"&&(p=v.parse(p)),p.protocol||(p.protocol="https:"),p.protocol!=="https:")throw new Error('Protocol "'+p.protocol+'" not supported. Expected "https:"');return p}m.request=function(p,c){return p=a(p),x.request.call(this,p,c)},m.get=function(p,c){return p=a(p),x.get.call(this,p,c)}},645:(W,_)=>{_.read=function(y,x,v,m,S){var a,p,c=8*S-m-1,l=(1<<c)-1,f=l>>1,g=-7,h=v?S-1:0,u=v?-1:1,w=y[x+h];for(h+=u,a=w&(1<<-g)-1,w>>=-g,g+=c;g>0;a=256*a+y[x+h],h+=u,g-=8);for(p=a&(1<<-g)-1,a>>=-g,g+=m;g>0;p=256*p+y[x+h],h+=u,g-=8);if(a===0)a=1-f;else{if(a===l)return p?NaN:1/0*(w?-1:1);p+=Math.pow(2,m),a-=f}return(w?-1:1)*p*Math.pow(2,a-m)},_.write=function(y,x,v,m,S,a){var p,c,l,f=8*a-S-1,g=(1<<f)-1,h=g>>1,u=S===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=m?0:a-1,b=m?1:-1,E=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(c=isNaN(x)?1:0,p=g):(p=Math.floor(Math.log(x)/Math.LN2),x*(l=Math.pow(2,-p))<1&&(p--,l*=2),(x+=p+h>=1?u/l:u*Math.pow(2,1-h))*l>=2&&(p++,l/=2),p+h>=g?(c=0,p=g):p+h>=1?(c=(x*l-1)*Math.pow(2,S),p+=h):(c=x*Math.pow(2,h-1)*Math.pow(2,S),p=0));S>=8;y[v+w]=255&c,w+=b,c/=256,S-=8);for(p=p<<S|c,f+=S;f>0;y[v+w]=255&p,w+=b,p/=256,f-=8);y[v+w-b]|=128*E}},5717:W=>{typeof Object.create=="function"?W.exports=function(_,y){y&&(_.super_=y,_.prototype=Object.create(y.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}))}:W.exports=function(_,y){if(y){_.super_=y;var x=function(){};x.prototype=y.prototype,_.prototype=new x,_.prototype.constructor=_}}},6512:function(W){(function(_){const y="(0?\\d+|0x[a-f0-9]+)",x={fourOctet:new RegExp(`^${y}\\.${y}\\.${y}\\.${y}$`,"i"),threeOctet:new RegExp(`^${y}\\.${y}\\.${y}$`,"i"),twoOctet:new RegExp(`^${y}\\.${y}$`,"i"),longValue:new RegExp(`^${y}$`,"i")},v=new RegExp("^0[0-7]+$","i"),m=new RegExp("^0x[a-f0-9]+$","i"),S="%[0-9a-z]{1,}",a="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(S,"i"),native:new RegExp(`^(::)?(${a})?([0-9a-f]+)?(::)?(${S})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${y}\\.${y}\\.${y}\\.${y}(${S})?)$`,"i"),transitional:new RegExp(`^((?:${a})|(?:::)(?:${a})?)${y}\\.${y}\\.${y}\\.${y}(${S})?$`,"i")};function c(u,w){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let b,E,I=0,M=-1,B=(u.match(p.zoneIndex)||[])[0];for(B&&(B=B.substring(1),u=u.replace(/%.+$/,""));(M=u.indexOf(":",M+1))>=0;)I++;if(u.substr(0,2)==="::"&&I--,u.substr(-2,2)==="::"&&I--,I>w)return null;for(E=w-I,b=":";E--;)b+="0:";return(u=u.replace("::",b))[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),{parts:w=function(){const P=u.split(":"),N=[];for(let $=0;$<P.length;$++)N.push(parseInt(P[$],16));return N}(),zoneId:B}}function l(u,w,b,E){if(u.length!==w.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let I,M=0;for(;E>0;){if(I=b-E,I<0&&(I=0),u[M]>>I!=w[M]>>I)return!1;E-=b,M+=1}return!0}function f(u){if(m.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(v.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}function g(u,w){for(;u.length<w;)u=`0${u}`;return u}const h={};h.IPv4=function(){function u(w){if(w.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let b,E;for(b=0;b<w.length;b++)if(E=w[b],!(0<=E&&E<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=w}return u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(w,b){let E;if(b===void 0&&(E=w,w=E[0],b=E[1]),w.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return l(this.octets,w.octets,8,b)},u.prototype.prefixLengthFromSubnetMask=function(){let w=0,b=!1;const E={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let I,M,B;for(I=3;I>=0;I-=1){if(M=this.octets[I],!(M in E)||(B=E[M],b&&B!==0))return null;B!==8&&(b=!0),w+=B}return 32-w},u.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u}(),h.IPv4.broadcastAddressFromCIDR=function(u){try{const w=this.parseCIDR(u),b=w[0].toByteArray(),E=this.subnetMaskFromPrefixLength(w[1]).toByteArray(),I=[];let M=0;for(;M<4;)I.push(parseInt(b[M],10)|255^parseInt(E[M],10)),M++;return new this(I)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.isIPv4=function(u){return this.parser(u)!==null},h.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},h.IPv4.isValidFourPartDecimal=function(u){return!(!h.IPv4.isValid(u)||!u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},h.IPv4.networkAddressFromCIDR=function(u){let w,b,E,I,M;try{for(w=this.parseCIDR(u),E=w[0].toByteArray(),M=this.subnetMaskFromPrefixLength(w[1]).toByteArray(),I=[],b=0;b<4;)I.push(parseInt(E[b],10)&parseInt(M[b],10)),b++;return new this(I)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.parse=function(u){const w=this.parser(u);if(w===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(w)},h.IPv4.parseCIDR=function(u){let w;if(w=u.match(/^(.+)\/(\d+)$/)){const b=parseInt(w[2]);if(b>=0&&b<=32){const E=[this.parse(w[1]),b];return Object.defineProperty(E,"toString",{value:function(){return this.join("/")}}),E}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},h.IPv4.parser=function(u){let w,b,E;if(w=u.match(x.fourOctet))return function(){const I=w.slice(1,6),M=[];for(let B=0;B<I.length;B++)b=I[B],M.push(f(b));return M}();if(w=u.match(x.longValue)){if(E=f(w[1]),E>4294967295||E<0)throw new Error("ipaddr: address outside defined range");return function(){const I=[];let M;for(M=0;M<=24;M+=8)I.push(E>>M&255);return I}().reverse()}return(w=u.match(x.twoOctet))?function(){const I=w.slice(1,4),M=[];if(E=f(I[1]),E>16777215||E<0)throw new Error("ipaddr: address outside defined range");return M.push(f(I[0])),M.push(E>>16&255),M.push(E>>8&255),M.push(255&E),M}():(w=u.match(x.threeOctet))?function(){const I=w.slice(1,5),M=[];if(E=f(I[2]),E>65535||E<0)throw new Error("ipaddr: address outside defined range");return M.push(f(I[0])),M.push(f(I[1])),M.push(E>>8&255),M.push(255&E),M}():null},h.IPv4.subnetMaskFromPrefixLength=function(u){if((u=parseInt(u))<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");const w=[0,0,0,0];let b=0;const E=Math.floor(u/8);for(;b<E;)w[b]=255,b++;return E<4&&(w[E]=Math.pow(2,u%8)-1<<8-u%8),new this(w)},h.IPv6=function(){function u(w,b){let E,I;if(w.length===16)for(this.parts=[],E=0;E<=14;E+=2)this.parts.push(w[E]<<8|w[E+1]);else{if(w.length!==8)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=w}for(E=0;E<this.parts.length;E++)if(I=this.parts[E],!(0<=I&&I<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");b&&(this.zoneId=b)}return u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],reserved:[[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(w,b){let E;if(b===void 0&&(E=w,w=E[0],b=E[1]),w.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return l(this.parts,w.parts,16,b)},u.prototype.prefixLengthFromSubnetMask=function(){let w=0,b=!1;const E={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let I,M;for(let B=7;B>=0;B-=1){if(I=this.parts[B],!(I in E)||(M=E[I],b&&M!==0))return null;M!==16&&(b=!0),w+=M}return 128-w},u.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let w;const b=[],E=this.parts;for(let I=0;I<E.length;I++)w=E[I],b.push(w>>8),b.push(255&w);return b},u.prototype.toFixedLengthString=function(){const w=(function(){const E=[];for(let I=0;I<this.parts.length;I++)E.push(g(this.parts[I].toString(16),4));return E}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),w+b},u.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const w=this.parts.slice(-2),b=w[0],E=w[1];return new h.IPv4([b>>8,255&b,E>>8,255&E])},u.prototype.toNormalizedString=function(){const w=(function(){const E=[];for(let I=0;I<this.parts.length;I++)E.push(this.parts[I].toString(16));return E}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),w+b},u.prototype.toRFC5952String=function(){const w=/((^|:)(0(:|$)){2,})/g,b=this.toNormalizedString();let E,I=0,M=-1;for(;E=w.exec(b);)E[0].length>M&&(I=E.index,M=E[0].length);return M<0?b:`${b.substring(0,I)}::${b.substring(I+M)}`},u.prototype.toString=function(){return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/,"::")},u}(),h.IPv6.broadcastAddressFromCIDR=function(u){try{const w=this.parseCIDR(u),b=w[0].toByteArray(),E=this.subnetMaskFromPrefixLength(w[1]).toByteArray(),I=[];let M=0;for(;M<16;)I.push(parseInt(b[M],10)|255^parseInt(E[M],10)),M++;return new this(I)}catch(w){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${w})`)}},h.IPv6.isIPv6=function(u){return this.parser(u)!==null},h.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{const w=this.parser(u);return new this(w.parts,w.zoneId),!0}catch{return!1}},h.IPv6.networkAddressFromCIDR=function(u){let w,b,E,I,M;try{for(w=this.parseCIDR(u),E=w[0].toByteArray(),M=this.subnetMaskFromPrefixLength(w[1]).toByteArray(),I=[],b=0;b<16;)I.push(parseInt(E[b],10)&parseInt(M[b],10)),b++;return new this(I)}catch(B){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${B})`)}},h.IPv6.parse=function(u){const w=this.parser(u);if(w.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(w.parts,w.zoneId)},h.IPv6.parseCIDR=function(u){let w,b,E;if((b=u.match(/^(.+)\/(\d+)$/))&&(w=parseInt(b[2]),w>=0&&w<=128))return E=[this.parse(b[1]),w],Object.defineProperty(E,"toString",{value:function(){return this.join("/")}}),E;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},h.IPv6.parser=function(u){let w,b,E,I,M,B;if(E=u.match(p.deprecatedTransitional))return this.parser(`::ffff:${E[1]}`);if(p.native.test(u))return c(u,8);if((E=u.match(p.transitional))&&(B=E[6]||"",w=c(E[1].slice(0,-1)+B,6),w.parts)){for(M=[parseInt(E[2]),parseInt(E[3]),parseInt(E[4]),parseInt(E[5])],b=0;b<M.length;b++)if(I=M[b],!(0<=I&&I<=255))return null;return w.parts.push(M[0]<<8|M[1]),w.parts.push(M[2]<<8|M[3]),{parts:w.parts,zoneId:w.zoneId}}return null},h.IPv6.subnetMaskFromPrefixLength=function(u){if((u=parseInt(u))<0||u>128)throw new Error("ipaddr: invalid IPv6 prefix length");const w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let b=0;const E=Math.floor(u/8);for(;b<E;)w[b]=255,b++;return E<16&&(w[E]=Math.pow(2,u%8)-1<<8-u%8),new this(w)},h.fromByteArray=function(u){const w=u.length;if(w===4)return new h.IPv4(u);if(w===16)return new h.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},h.isValid=function(u){return h.IPv6.isValid(u)||h.IPv4.isValid(u)},h.parse=function(u){if(h.IPv6.isValid(u))return h.IPv6.parse(u);if(h.IPv4.isValid(u))return h.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},h.parseCIDR=function(u){try{return h.IPv6.parseCIDR(u)}catch{try{return h.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},h.process=function(u){const w=this.parse(u);return w.kind()==="ipv6"&&w.isIPv4MappedAddress()?w.toIPv4Address():w},h.subnetMatch=function(u,w,b){let E,I,M,B;for(I in b==null&&(b="unicast"),w)if(Object.prototype.hasOwnProperty.call(w,I)){for(M=w[I],!M[0]||M[0]instanceof Array||(M=[M]),E=0;E<M.length;E++)if(B=M[E],u.kind()===B[0].kind()&&u.match.apply(u,B))return I}return b},W.exports?W.exports=h:_.ipaddr=h})(this)},2584:(W,_,y)=>{var x=y(6410)(),v=y(1924)("Object.prototype.toString"),m=function(p){return!(x&&p&&typeof p=="object"&&Symbol.toStringTag in p)&&v(p)==="[object Arguments]"},S=function(p){return!!m(p)||p!==null&&typeof p=="object"&&typeof p.length=="number"&&p.length>=0&&v(p)!=="[object Array]"&&v(p.callee)==="[object Function]"},a=function(){return m(arguments)}();m.isLegacyArguments=S,W.exports=a?m:S},5320:W=>{var _,y,x=Function.prototype.toString,v=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply;if(typeof v=="function"&&typeof Object.defineProperty=="function")try{_=Object.defineProperty({},"length",{get:function(){throw y}}),y={},v(function(){throw 42},null,_)}catch(h){h!==y&&(v=null)}else v=null;var m=/^\s*class\b/,S=function(h){try{var u=x.call(h);return m.test(u)}catch{return!1}},a=function(h){try{return!S(h)&&(x.call(h),!0)}catch{return!1}},p=Object.prototype.toString,c=typeof Symbol=="function"&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if(typeof document=="object"){var g=document.all;p.call(g)===p.call(document.all)&&(f=function(h){if((l||!h)&&(h===void 0||typeof h=="object"))try{var u=p.call(h);return(u==="[object HTMLAllCollection]"||u==="[object HTML document.all class]"||u==="[object HTMLCollection]"||u==="[object Object]")&&h("")==null}catch{}return!1})}W.exports=v?function(h){if(f(h))return!0;if(!h||typeof h!="function"&&typeof h!="object")return!1;try{v(h,null,_)}catch(u){if(u!==y)return!1}return!S(h)&&a(h)}:function(h){if(f(h))return!0;if(!h||typeof h!="function"&&typeof h!="object")return!1;if(c)return a(h);if(S(h))return!1;var u=p.call(h);return!(u!=="[object Function]"&&u!=="[object GeneratorFunction]"&&!/^\[object HTML/.test(u))&&a(h)}},8662:(W,_,y)=>{var x,v=Object.prototype.toString,m=Function.prototype.toString,S=/^\s*(?:function)?\*/,a=y(6410)(),p=Object.getPrototypeOf;W.exports=function(c){if(typeof c!="function")return!1;if(S.test(m.call(c)))return!0;if(!a)return v.call(c)==="[object GeneratorFunction]";if(!p)return!1;if(x===void 0){var l=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch{}}();x=!!l&&p(l)}return p(c)===x}},8611:W=>{W.exports=function(_){return _!=_}},360:(W,_,y)=>{var x=y(5559),v=y(4289),m=y(8611),S=y(9415),a=y(3194),p=x(S(),Number);v(p,{getPolyfill:S,implementation:m,shim:a}),W.exports=p},9415:(W,_,y)=>{var x=y(8611);W.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:x}},3194:(W,_,y)=>{var x=y(4289),v=y(9415);W.exports=function(){var m=v();return x(Number,{isNaN:m},{isNaN:function(){return Number.isNaN!==m}}),m}},5692:(W,_,y)=>{var x=y(4029),v=y(3083),m=y(1924),S=m("Object.prototype.toString"),a=y(6410)(),p=y(7296),c=typeof globalThis>"u"?y.g:globalThis,l=v(),f=m("Array.prototype.indexOf",!0)||function(w,b){for(var E=0;E<w.length;E+=1)if(w[E]===b)return E;return-1},g=m("String.prototype.slice"),h={},u=Object.getPrototypeOf;a&&p&&u&&x(l,function(w){var b=new c[w];if(Symbol.toStringTag in b){var E=u(b),I=p(E,Symbol.toStringTag);if(!I){var M=u(E);I=p(M,Symbol.toStringTag)}h[w]=I.get}}),W.exports=function(w){if(!w||typeof w!="object")return!1;if(!a||!(Symbol.toStringTag in w)){var b=g(S(w),8,-1);return f(l,b)>-1}return!!p&&function(E){var I=!1;return x(h,function(M,B){if(!I)try{I=M.call(E)===B}catch{}}),I}(w)}},6650:(W,_,y)=>{var x=y(8764).Buffer,v=y(9539),m=y(2830).Transform;W.exports=function(a){return new S(a)};var S=W.exports.JSONStream=function(a){a=a||{},m.call(this,a),this._writableState.objectMode=!1,this._readableState.objectMode=!0,this._async=a.async||!1};v.inherits(S,m),S.prototype._transform=function(a,p,c){x.isBuffer(a)||(a=new x(a)),this._buffer&&(a=x.concat([this._buffer,a]));for(var l=0,f=0;++l<=a.length;)if(a[l]===10||l===a.length){var g;try{g=JSON.parse(a.slice(f,l))}catch{}g&&(this.push(g),g=null),a[l]===10&&(f=++l)}return this._buffer=a.slice(f),this._async?void setImmediate(c):void c()}},6486:function(W,_,y){var x;W=y.nmd(W),(function(){var v,m=200,S="Expected a function",a="__lodash_hash_undefined__",p="__lodash_placeholder__",c=1,l=2,f=4,g=1,h=2,u=1,w=2,b=4,E=8,I=16,M=32,B=64,P=128,N=256,$=512,et=800,Q=16,ot=1/0,t=9007199254740991,n=17976931348623157e292,r=NaN,i=4294967295,e=i-1,o=i>>>1,s=[["ary",P],["bind",u],["bindKey",w],["curry",E],["curryRight",I],["flip",$],["partial",M],["partialRight",B],["rearg",N]],A="[object Arguments]",C="[object Array]",j="[object AsyncFunction]",T="[object Boolean]",R="[object Date]",q="[object DOMException]",Z="[object Error]",rt="[object Function]",D="[object GeneratorFunction]",G="[object Map]",z="[object Number]",X="[object Null]",st="[object Object]",nt="[object Promise]",lt="[object Proxy]",Et="[object RegExp]",gt="[object Set]",bt="[object String]",Bt="[object Symbol]",Mt="[object Undefined]",It="[object WeakMap]",J="[object ArrayBuffer]",tt="[object DataView]",F="[object Float32Array]",H="[object Float64Array]",U="[object Int8Array]",it="[object Int16Array]",pt="[object Int32Array]",ft="[object Uint8Array]",mt="[object Uint8ClampedArray]",re="[object Uint16Array]",_t="[object Uint32Array]",At=/\b__p \+= '';/g,fe=/\b(__p \+=) '' \+/g,kt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Kt=/&(?:amp|lt|gt|quot|#39);/g,Ce=/[&<>"']/g,Pt=RegExp(Kt.source),Ht=RegExp(Ce.source),je=/<%-([\s\S]+?)%>/g,Rt=/<%([\s\S]+?)%>/g,Wt=/<%=([\s\S]+?)%>/g,ye=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Nt=/^\w*$/,Xt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ke=/[\\^$.*+?()[\]{}|]/g,jt=RegExp(ke.source),Zt=/^\s+/,Oe=/\s/,Dt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Jt=/\{\n\/\* \[wrapped with (.+)\] \*/,De=/,? & /,Lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Qt=/[()=,{}\[\]\/\s]/,ze=/\\(\\)?/g,Ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Yt=/\w*$/,$e=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,ee=/^\[object .+?Constructor\]$/,He=/^0o[0-7]+$/i,Ft=/^(?:0|[1-9]\d*)$/,te=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ae=/($^)/,Re=/['\n\r\u2028\u2029\\]/g,Ke="\\ud800-\\udfff",ai="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ri="\\u2700-\\u27bf",si="a-z\\xdf-\\xf6\\xf8-\\xff",ui="A-Z\\xc0-\\xd6\\xd8-\\xde",ci="\\ufe0e\\ufe0f",li="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",hi="["+Ke+"]",fi="["+li+"]",Je="["+ai+"]",pi="\\d+",gi="["+ri+"]",ei="["+si+"]",ii="[^"+Ke+li+pi+ri+si+ui+"]",Ye="\\ud83c[\\udffb-\\udfff]",di="[^"+Ke+"]",ni="(?:\\ud83c[\\udde6-\\uddff]){2}",cr="[\\ud800-\\udbff][\\udc00-\\udfff]",er="["+ui+"]",Ln="\\u200d",Dn="(?:"+ei+"|"+ii+")",So="(?:"+er+"|"+ii+")",Un="(?:['’](?:d|ll|m|re|s|t|ve))?",Hr="(?:['’](?:D|LL|M|RE|S|T|VE))?",qn="(?:"+Je+"|"+Ye+")?",Fn="["+ci+"]?",Eo=Fn+qn+"(?:"+Ln+"(?:"+[di,ni,cr].join("|")+")"+Fn+qn+")*",xt="(?:"+[gi,ni,cr].join("|")+")"+Eo,vt="(?:"+[di+Je+"?",Je,ni,cr,hi].join("|")+")",wt=RegExp("['’]","g"),Tt=RegExp(Je,"g"),Vt=RegExp(Ye+"(?="+Ye+")|"+vt+Eo,"g"),zt=RegExp([er+"?"+ei+"+"+Un+"(?="+[fi,er,"$"].join("|")+")",So+"+"+Hr+"(?="+[fi,er+Dn,"$"].join("|")+")",er+"?"+Dn+"+"+Un,er+"+"+Hr,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pi,xt].join("|"),"g"),Gt=RegExp("["+Ln+Ke+ai+ci+"]"),ie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ce=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],xe=-1,Se={};Se[F]=Se[H]=Se[U]=Se[it]=Se[pt]=Se[ft]=Se[mt]=Se[re]=Se[_t]=!0,Se[A]=Se[C]=Se[J]=Se[T]=Se[tt]=Se[R]=Se[Z]=Se[rt]=Se[G]=Se[z]=Se[st]=Se[Et]=Se[gt]=Se[bt]=Se[It]=!1;var ge={};ge[A]=ge[C]=ge[J]=ge[tt]=ge[T]=ge[R]=ge[F]=ge[H]=ge[U]=ge[it]=ge[pt]=ge[G]=ge[z]=ge[st]=ge[Et]=ge[gt]=ge[bt]=ge[Bt]=ge[ft]=ge[mt]=ge[re]=ge[_t]=!0,ge[Z]=ge[rt]=ge[It]=!1;var Ze={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ge=parseFloat,Hi=parseInt,be=typeof y.g=="object"&&y.g&&y.g.Object===Object&&y.g,we=typeof self=="object"&&self&&self.Object===Object&&self,de=be||we||Function("return this")(),Te=_&&!_.nodeType&&_,mi=Te&&W&&!W.nodeType&&W,ki=mi&&mi.exports===Te,Oi=ki&&be.process,wi=function(){try{return mi&&mi.require&&mi.require("util").types||Oi&&Oi.binding&&Oi.binding("util")}catch{}}(),wr=wi&&wi.isArrayBuffer,Wi=wi&&wi.isDate,Or=wi&&wi.isMap,Vc=wi&&wi.isRegExp,Xc=wi&&wi.isSet,Zc=wi&&wi.isTypedArray;function ir($t,ae,ue){switch(ue.length){case 0:return $t.call(ae);case 1:return $t.call(ae,ue[0]);case 2:return $t.call(ae,ue[0],ue[1]);case 3:return $t.call(ae,ue[0],ue[1],ue[2])}return $t.apply(ae,ue)}function Id($t,ae,ue,me){for(var qe=-1,oi=$t==null?0:$t.length;++qe<oi;){var ji=$t[qe];ae(me,ji,ue(ji),$t)}return me}function lr($t,ae){for(var ue=-1,me=$t==null?0:$t.length;++ue<me&&ae($t[ue],ue,$t)!==!1;);return $t}function Od($t,ae){for(var ue=$t==null?0:$t.length;ue--&&ae($t[ue],ue,$t)!==!1;);return $t}function Kc($t,ae){for(var ue=-1,me=$t==null?0:$t.length;++ue<me;)if(!ae($t[ue],ue,$t))return!1;return!0}function Wr($t,ae){for(var ue=-1,me=$t==null?0:$t.length,qe=0,oi=[];++ue<me;){var ji=$t[ue];ae(ji,ue,$t)&&(oi[qe++]=ji)}return oi}function ko($t,ae){return!($t==null||!$t.length)&&Mn($t,ae,0)>-1}function hs($t,ae,ue){for(var me=-1,qe=$t==null?0:$t.length;++me<qe;)if(ue(ae,$t[me]))return!0;return!1}function Si($t,ae){for(var ue=-1,me=$t==null?0:$t.length,qe=Array(me);++ue<me;)qe[ue]=ae($t[ue],ue,$t);return qe}function Vr($t,ae){for(var ue=-1,me=ae.length,qe=$t.length;++ue<me;)$t[qe+ue]=ae[ue];return $t}function fs($t,ae,ue,me){var qe=-1,oi=$t==null?0:$t.length;for(me&&oi&&(ue=$t[++qe]);++qe<oi;)ue=ae(ue,$t[qe],qe,$t);return ue}function Ad($t,ae,ue,me){var qe=$t==null?0:$t.length;for(me&&qe&&(ue=$t[--qe]);qe--;)ue=ae(ue,$t[qe],qe,$t);return ue}function ps($t,ae){for(var ue=-1,me=$t==null?0:$t.length;++ue<me;)if(ae($t[ue],ue,$t))return!0;return!1}var Td=ds("length");function Jc($t,ae,ue){var me;return ue($t,function(qe,oi,ji){if(ae(qe,oi,ji))return me=oi,!1}),me}function Io($t,ae,ue,me){for(var qe=$t.length,oi=ue+(me?1:-1);me?oi--:++oi<qe;)if(ae($t[oi],oi,$t))return oi;return-1}function Mn($t,ae,ue){return ae==ae?function(me,qe,oi){for(var ji=oi-1,Ar=me.length;++ji<Ar;)if(me[ji]===qe)return ji;return-1}($t,ae,ue):Io($t,Gc,ue)}function Bd($t,ae,ue,me){for(var qe=ue-1,oi=$t.length;++qe<oi;)if(me($t[qe],ae))return qe;return-1}function Gc($t){return $t!=$t}function Yc($t,ae){var ue=$t==null?0:$t.length;return ue?gs($t,ae)/ue:r}function ds($t){return function(ae){return ae==null?v:ae[$t]}}function ms($t){return function(ae){return $t==null?v:$t[ae]}}function Qc($t,ae,ue,me,qe){return qe($t,function(oi,ji,Ar){ue=me?(me=!1,oi):ae(ue,oi,ji,Ar)}),ue}function gs($t,ae){for(var ue,me=-1,qe=$t.length;++me<qe;){var oi=ae($t[me]);oi!==v&&(ue=ue===v?oi:ue+oi)}return ue}function vs($t,ae){for(var ue=-1,me=Array($t);++ue<$t;)me[ue]=ae(ue);return me}function tl($t){return $t&&$t.slice(0,nl($t)+1).replace(Zt,"")}function rr($t){return function(ae){return $t(ae)}}function ys($t,ae){return Si(ae,function(ue){return $t[ue]})}function zn($t,ae){return $t.has(ae)}function el($t,ae){for(var ue=-1,me=$t.length;++ue<me&&Mn(ae,$t[ue],0)>-1;);return ue}function il($t,ae){for(var ue=$t.length;ue--&&Mn(ae,$t[ue],0)>-1;);return ue}var jd=ms({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Rd=ms({"&":"&","<":"<",">":">",'"':""","'":"'"});function Nd($t){return"\\"+Ze[$t]}function xn($t){return Gt.test($t)}function bs($t){var ae=-1,ue=Array($t.size);return $t.forEach(function(me,qe){ue[++ae]=[qe,me]}),ue}function rl($t,ae){return function(ue){return $t(ae(ue))}}function Xr($t,ae){for(var ue=-1,me=$t.length,qe=0,oi=[];++ue<me;){var ji=$t[ue];ji!==ae&&ji!==p||($t[ue]=p,oi[qe++]=ue)}return oi}function Oo($t){var ae=-1,ue=Array($t.size);return $t.forEach(function(me){ue[++ae]=me}),ue}function Cd($t){var ae=-1,ue=Array($t.size);return $t.forEach(function(me){ue[++ae]=[me,me]}),ue}function _n($t){return xn($t)?function(ae){for(var ue=Vt.lastIndex=0;Vt.test(ae);)++ue;return ue}($t):Td($t)}function Mr($t){return xn($t)?function(ae){return ae.match(Vt)||[]}($t):function(ae){return ae.split("")}($t)}function nl($t){for(var ae=$t.length;ae--&&Oe.test($t.charAt(ae)););return ae}var Pd=ms({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Ao=function $t(ae){var ue,me=(ae=ae==null?de:Ao.defaults(de.Object(),ae,Ao.pick(de,ce))).Array,qe=ae.Date,oi=ae.Error,ji=ae.Function,Ar=ae.Math,xi=ae.Object,ws=ae.RegExp,Ld=ae.String,hr=ae.TypeError,To=me.prototype,Dd=ji.prototype,Sn=xi.prototype,Bo=ae["__core-js_shared__"],jo=Dd.toString,bi=Sn.hasOwnProperty,Ud=0,ol=(ue=/[^.]+$/.exec(Bo&&Bo.keys&&Bo.keys.IE_PROTO||""))?"Symbol(src)_1."+ue:"",Ro=Sn.toString,qd=jo.call(xi),Fd=de._,zd=ws("^"+jo.call(bi).replace(ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),No=ki?ae.Buffer:v,Zr=ae.Symbol,Co=ae.Uint8Array,al=No?No.allocUnsafe:v,Po=rl(xi.getPrototypeOf,xi),sl=xi.create,ul=Sn.propertyIsEnumerable,Lo=To.splice,cl=Zr?Zr.isConcatSpreadable:v,$n=Zr?Zr.iterator:v,an=Zr?Zr.toStringTag:v,Do=function(){try{var d=hn(xi,"defineProperty");return d({},"",{}),d}catch{}}(),$d=ae.clearTimeout!==de.clearTimeout&&ae.clearTimeout,Hd=qe&&qe.now!==de.Date.now&&qe.now,Wd=ae.setTimeout!==de.setTimeout&&ae.setTimeout,Uo=Ar.ceil,qo=Ar.floor,Ms=xi.getOwnPropertySymbols,Vd=No?No.isBuffer:v,ll=ae.isFinite,Xd=To.join,Zd=rl(xi.keys,xi),Ri=Ar.max,Ui=Ar.min,Kd=qe.now,Jd=ae.parseInt,hl=Ar.random,Gd=To.reverse,xs=hn(ae,"DataView"),Hn=hn(ae,"Map"),_s=hn(ae,"Promise"),En=hn(ae,"Set"),Wn=hn(ae,"WeakMap"),Vn=hn(xi,"create"),Fo=Wn&&new Wn,kn={},Yd=fn(xs),Qd=fn(Hn),t0=fn(_s),e0=fn(En),i0=fn(Wn),zo=Zr?Zr.prototype:v,Xn=zo?zo.valueOf:v,fl=zo?zo.toString:v;function dt(d){if(Ii(d)&&!We(d)&&!(d instanceof Qe)){if(d instanceof fr)return d;if(bi.call(d,"__wrapped__"))return ph(d)}return new fr(d)}var In=function(){function d(){}return function(k){if(!Ei(k))return{};if(sl)return sl(k);d.prototype=k;var V=new d;return d.prototype=v,V}}();function $o(){}function fr(d,k){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!k,this.__index__=0,this.__values__=v}function Qe(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=i,this.__views__=[]}function sn(d){var k=-1,V=d==null?0:d.length;for(this.clear();++k<V;){var at=d[k];this.set(at[0],at[1])}}function Nr(d){var k=-1,V=d==null?0:d.length;for(this.clear();++k<V;){var at=d[k];this.set(at[0],at[1])}}function Cr(d){var k=-1,V=d==null?0:d.length;for(this.clear();++k<V;){var at=d[k];this.set(at[0],at[1])}}function un(d){var k=-1,V=d==null?0:d.length;for(this.__data__=new Cr;++k<V;)this.add(d[k])}function xr(d){var k=this.__data__=new Nr(d);this.size=k.size}function pl(d,k){var V=We(d),at=!V&&pn(d),ct=!V&&!at&&Qr(d),yt=!V&&!at&&!ct&&Bn(d),St=V||at||ct||yt,Ot=St?vs(d.length,Ld):[],Ct=Ot.length;for(var oe in d)!k&&!bi.call(d,oe)||St&&(oe=="length"||ct&&(oe=="offset"||oe=="parent")||yt&&(oe=="buffer"||oe=="byteLength"||oe=="byteOffset")||Ur(oe,Ct))||Ot.push(oe);return Ot}function dl(d){var k=d.length;return k?d[Ns(0,k-1)]:v}function r0(d,k){return ra(Ki(d),cn(k,0,d.length))}function n0(d){return ra(Ki(d))}function Ss(d,k,V){(V!==v&&!_r(d[k],V)||V===v&&!(k in d))&&Pr(d,k,V)}function Zn(d,k,V){var at=d[k];bi.call(d,k)&&_r(at,V)&&(V!==v||k in d)||Pr(d,k,V)}function Ho(d,k){for(var V=d.length;V--;)if(_r(d[V][0],k))return V;return-1}function o0(d,k,V,at){return Kr(d,function(ct,yt,St){k(at,ct,V(ct),St)}),at}function ml(d,k){return d&&Br(k,Ci(k),d)}function Pr(d,k,V){k=="__proto__"&&Do?Do(d,k,{configurable:!0,enumerable:!0,value:V,writable:!0}):d[k]=V}function Es(d,k){for(var V=-1,at=k.length,ct=me(at),yt=d==null;++V<at;)ct[V]=yt?v:su(d,k[V]);return ct}function cn(d,k,V){return d==d&&(V!==v&&(d=d<=V?d:V),k!==v&&(d=d>=k?d:k)),d}function pr(d,k,V,at,ct,yt){var St,Ot=k&c,Ct=k&l,oe=k&f;if(V&&(St=ct?V(d,at,ct,yt):V(d)),St!==v)return St;if(!Ei(d))return d;var ne=We(d);if(ne){if(St=function(se){var he=se.length,Be=new se.constructor(he);return he&&typeof se[0]=="string"&&bi.call(se,"index")&&(Be.index=se.index,Be.input=se.input),Be}(d),!Ot)return Ki(d,St)}else{var le=qi(d),Me=le==rt||le==D;if(Qr(d))return Ul(d,Ot);if(le==st||le==A||Me&&!ct){if(St=Ct||Me?{}:nh(d),!Ot)return Ct?function(se,he){return Br(se,ih(se),he)}(d,function(se,he){return se&&Br(he,Gi(he),se)}(St,d)):function(se,he){return Br(se,Zs(se),he)}(d,ml(St,d))}else{if(!ge[le])return ct?d:{};St=function(se,he,Be){var pe,Fe=se.constructor;switch(he){case J:return Fs(se);case T:case R:return new Fe(+se);case tt:return function(Ue,vi){var Ee=vi?Fs(Ue.buffer):Ue.buffer;return new Ue.constructor(Ee,Ue.byteOffset,Ue.byteLength)}(se,Be);case F:case H:case U:case it:case pt:case ft:case mt:case re:case _t:return ql(se,Be);case G:return new Fe;case z:case bt:return new Fe(se);case Et:return function(Ue){var vi=new Ue.constructor(Ue.source,Yt.exec(Ue));return vi.lastIndex=Ue.lastIndex,vi}(se);case gt:return new Fe;case Bt:return pe=se,Xn?xi(Xn.call(pe)):{}}}(d,le,Ot)}}yt||(yt=new xr);var _e=yt.get(d);if(_e)return _e;yt.set(d,St),Bh(d)?d.forEach(function(se){St.add(pr(se,k,V,se,d,yt))}):Ah(d)&&d.forEach(function(se,he){St.set(he,pr(se,k,V,he,d,yt))});var Ie=ne?v:(oe?Ct?Ws:Hs:Ct?Gi:Ci)(d);return lr(Ie||d,function(se,he){Ie&&(se=d[he=se]),Zn(St,he,pr(se,k,V,he,d,yt))}),St}function gl(d,k,V){var at=V.length;if(d==null)return!at;for(d=xi(d);at--;){var ct=V[at],yt=k[ct],St=d[ct];if(St===v&&!(ct in d)||!yt(St))return!1}return!0}function vl(d,k,V){if(typeof d!="function")throw new hr(S);return eo(function(){d.apply(v,V)},k)}function Kn(d,k,V,at){var ct=-1,yt=ko,St=!0,Ot=d.length,Ct=[],oe=k.length;if(!Ot)return Ct;V&&(k=Si(k,rr(V))),at?(yt=hs,St=!1):k.length>=m&&(yt=zn,St=!1,k=new un(k));t:for(;++ct<Ot;){var ne=d[ct],le=V==null?ne:V(ne);if(ne=at||ne!==0?ne:0,St&&le==le){for(var Me=oe;Me--;)if(k[Me]===le)continue t;Ct.push(ne)}else yt(k,le,at)||Ct.push(ne)}return Ct}dt.templateSettings={escape:je,evaluate:Rt,interpolate:Wt,variable:"",imports:{_:dt}},dt.prototype=$o.prototype,dt.prototype.constructor=dt,fr.prototype=In($o.prototype),fr.prototype.constructor=fr,Qe.prototype=In($o.prototype),Qe.prototype.constructor=Qe,sn.prototype.clear=function(){this.__data__=Vn?Vn(null):{},this.size=0},sn.prototype.delete=function(d){var k=this.has(d)&&delete this.__data__[d];return this.size-=k?1:0,k},sn.prototype.get=function(d){var k=this.__data__;if(Vn){var V=k[d];return V===a?v:V}return bi.call(k,d)?k[d]:v},sn.prototype.has=function(d){var k=this.__data__;return Vn?k[d]!==v:bi.call(k,d)},sn.prototype.set=function(d,k){var V=this.__data__;return this.size+=this.has(d)?0:1,V[d]=Vn&&k===v?a:k,this},Nr.prototype.clear=function(){this.__data__=[],this.size=0},Nr.prototype.delete=function(d){var k=this.__data__,V=Ho(k,d);return!(V<0||(V==k.length-1?k.pop():Lo.call(k,V,1),--this.size,0))},Nr.prototype.get=function(d){var k=this.__data__,V=Ho(k,d);return V<0?v:k[V][1]},Nr.prototype.has=function(d){return Ho(this.__data__,d)>-1},Nr.prototype.set=function(d,k){var V=this.__data__,at=Ho(V,d);return at<0?(++this.size,V.push([d,k])):V[at][1]=k,this},Cr.prototype.clear=function(){this.size=0,this.__data__={hash:new sn,map:new(Hn||Nr),string:new sn}},Cr.prototype.delete=function(d){var k=ia(this,d).delete(d);return this.size-=k?1:0,k},Cr.prototype.get=function(d){return ia(this,d).get(d)},Cr.prototype.has=function(d){return ia(this,d).has(d)},Cr.prototype.set=function(d,k){var V=ia(this,d),at=V.size;return V.set(d,k),this.size+=V.size==at?0:1,this},un.prototype.add=un.prototype.push=function(d){return this.__data__.set(d,a),this},un.prototype.has=function(d){return this.__data__.has(d)},xr.prototype.clear=function(){this.__data__=new Nr,this.size=0},xr.prototype.delete=function(d){var k=this.__data__,V=k.delete(d);return this.size=k.size,V},xr.prototype.get=function(d){return this.__data__.get(d)},xr.prototype.has=function(d){return this.__data__.has(d)},xr.prototype.set=function(d,k){var V=this.__data__;if(V instanceof Nr){var at=V.__data__;if(!Hn||at.length<m-1)return at.push([d,k]),this.size=++V.size,this;V=this.__data__=new Cr(at)}return V.set(d,k),this.size=V.size,this};var Kr=Hl(Tr),yl=Hl(Is,!0);function a0(d,k){var V=!0;return Kr(d,function(at,ct,yt){return V=!!k(at,ct,yt)}),V}function Wo(d,k,V){for(var at=-1,ct=d.length;++at<ct;){var yt=d[at],St=k(yt);if(St!=null&&(Ot===v?St==St&&!or(St):V(St,Ot)))var Ot=St,Ct=yt}return Ct}function bl(d,k){var V=[];return Kr(d,function(at,ct,yt){k(at,ct,yt)&&V.push(at)}),V}function Di(d,k,V,at,ct){var yt=-1,St=d.length;for(V||(V=v0),ct||(ct=[]);++yt<St;){var Ot=d[yt];k>0&&V(Ot)?k>1?Di(Ot,k-1,V,at,ct):Vr(ct,Ot):at||(ct[ct.length]=Ot)}return ct}var ks=Wl(),wl=Wl(!0);function Tr(d,k){return d&&ks(d,k,Ci)}function Is(d,k){return d&&wl(d,k,Ci)}function Vo(d,k){return Wr(k,function(V){return qr(d[V])})}function ln(d,k){for(var V=0,at=(k=Gr(k,d)).length;d!=null&&V<at;)d=d[jr(k[V++])];return V&&V==at?d:v}function Ml(d,k,V){var at=k(d);return We(d)?at:Vr(at,V(d))}function Vi(d){return d==null?d===v?Mt:X:an&&an in xi(d)?function(k){var V=bi.call(k,an),at=k[an];try{k[an]=v;var ct=!0}catch{}var yt=Ro.call(k);return ct&&(V?k[an]=at:delete k[an]),yt}(d):function(k){return Ro.call(k)}(d)}function Os(d,k){return d>k}function s0(d,k){return d!=null&&bi.call(d,k)}function u0(d,k){return d!=null&&k in xi(d)}function As(d,k,V){for(var at=V?hs:ko,ct=d[0].length,yt=d.length,St=yt,Ot=me(yt),Ct=1/0,oe=[];St--;){var ne=d[St];St&&k&&(ne=Si(ne,rr(k))),Ct=Ui(ne.length,Ct),Ot[St]=!V&&(k||ct>=120&&ne.length>=120)?new un(St&&ne):v}ne=d[0];var le=-1,Me=Ot[0];t:for(;++le<ct&&oe.length<Ct;){var _e=ne[le],Ie=k?k(_e):_e;if(_e=V||_e!==0?_e:0,!(Me?zn(Me,Ie):at(oe,Ie,V))){for(St=yt;--St;){var se=Ot[St];if(!(se?zn(se,Ie):at(d[St],Ie,V)))continue t}Me&&Me.push(Ie),oe.push(_e)}}return oe}function Jn(d,k,V){var at=(d=uh(d,k=Gr(k,d)))==null?d:d[jr(mr(k))];return at==null?v:ir(at,d,V)}function xl(d){return Ii(d)&&Vi(d)==A}function Gn(d,k,V,at,ct){return d===k||(d==null||k==null||!Ii(d)&&!Ii(k)?d!=d&&k!=k:function(yt,St,Ot,Ct,oe,ne){var le=We(yt),Me=We(St),_e=le?C:qi(yt),Ie=Me?C:qi(St),se=(_e=_e==A?st:_e)==st,he=(Ie=Ie==A?st:Ie)==st,Be=_e==Ie;if(Be&&Qr(yt)){if(!Qr(St))return!1;le=!0,se=!1}if(Be&&!se)return ne||(ne=new xr),le||Bn(yt)?eh(yt,St,Ot,Ct,oe,ne):function(Ee,Pe,Ni,Ti,Zi,_i,Fi){switch(Ni){case tt:if(Ee.byteLength!=Pe.byteLength||Ee.byteOffset!=Pe.byteOffset)return!1;Ee=Ee.buffer,Pe=Pe.buffer;case J:return!(Ee.byteLength!=Pe.byteLength||!_i(new Co(Ee),new Co(Pe)));case T:case R:case z:return _r(+Ee,+Pe);case Z:return Ee.name==Pe.name&&Ee.message==Pe.message;case Et:case bt:return Ee==Pe+"";case G:var Rr=bs;case gt:var tn=Ti&g;if(Rr||(Rr=Oo),Ee.size!=Pe.size&&!tn)return!1;var dn=Fi.get(Ee);if(dn)return dn==Pe;Ti|=h,Fi.set(Ee,Pe);var zr=eh(Rr(Ee),Rr(Pe),Ti,Zi,_i,Fi);return Fi.delete(Ee),zr;case Bt:if(Xn)return Xn.call(Ee)==Xn.call(Pe)}return!1}(yt,St,_e,Ot,Ct,oe,ne);if(!(Ot&g)){var pe=se&&bi.call(yt,"__wrapped__"),Fe=he&&bi.call(St,"__wrapped__");if(pe||Fe){var Ue=pe?yt.value():yt,vi=Fe?St.value():St;return ne||(ne=new xr),oe(Ue,vi,Ot,Ct,ne)}}return!!Be&&(ne||(ne=new xr),function(Ee,Pe,Ni,Ti,Zi,_i){var Fi=Ni&g,Rr=Hs(Ee),tn=Rr.length;if(tn!=Hs(Pe).length&&!Fi)return!1;for(var dn=tn;dn--;){var zr=Rr[dn];if(!(Fi?zr in Pe:bi.call(Pe,zr)))return!1}var Wh=_i.get(Ee),Vh=_i.get(Pe);if(Wh&&Vh)return Wh==Pe&&Vh==Ee;var fa=!0;_i.set(Ee,Pe),_i.set(Pe,Ee);for(var vu=Fi;++dn<tn;){var pa=Ee[zr=Rr[dn]],da=Pe[zr];if(Ti)var Xh=Fi?Ti(da,pa,zr,Pe,Ee,_i):Ti(pa,da,zr,Ee,Pe,_i);if(!(Xh===v?pa===da||Zi(pa,da,Ni,Ti,_i):Xh)){fa=!1;break}vu||(vu=zr=="constructor")}if(fa&&!vu){var ma=Ee.constructor,ga=Pe.constructor;ma==ga||!("constructor"in Ee)||!("constructor"in Pe)||typeof ma=="function"&&ma instanceof ma&&typeof ga=="function"&&ga instanceof ga||(fa=!1)}return _i.delete(Ee),_i.delete(Pe),fa}(yt,St,Ot,Ct,oe,ne))}(d,k,V,at,Gn,ct))}function Ts(d,k,V,at){var ct=V.length,yt=ct,St=!at;if(d==null)return!yt;for(d=xi(d);ct--;){var Ot=V[ct];if(St&&Ot[2]?Ot[1]!==d[Ot[0]]:!(Ot[0]in d))return!1}for(;++ct<yt;){var Ct=(Ot=V[ct])[0],oe=d[Ct],ne=Ot[1];if(St&&Ot[2]){if(oe===v&&!(Ct in d))return!1}else{var le=new xr;if(at)var Me=at(oe,ne,Ct,d,k,le);if(!(Me===v?Gn(ne,oe,g|h,at,le):Me))return!1}}return!0}function _l(d){return!(!Ei(d)||(k=d,ol&&ol in k))&&(qr(d)?zd:ee).test(fn(d));var k}function Sl(d){return typeof d=="function"?d:d==null?Yi:typeof d=="object"?We(d)?Il(d[0],d[1]):kl(d):Hh(d)}function Bs(d){if(!to(d))return Zd(d);var k=[];for(var V in xi(d))bi.call(d,V)&&V!="constructor"&&k.push(V);return k}function js(d,k){return d<k}function El(d,k){var V=-1,at=Ji(d)?me(d.length):[];return Kr(d,function(ct,yt,St){at[++V]=k(ct,yt,St)}),at}function kl(d){var k=Xs(d);return k.length==1&&k[0][2]?ah(k[0][0],k[0][1]):function(V){return V===d||Ts(V,d,k)}}function Il(d,k){return Ks(d)&&oh(k)?ah(jr(d),k):function(V){var at=su(V,d);return at===v&&at===k?uu(V,d):Gn(k,at,g|h)}}function Xo(d,k,V,at,ct){d!==k&&ks(k,function(yt,St){if(ct||(ct=new xr),Ei(yt))(function(Ct,oe,ne,le,Me,_e,Ie){var se=Gs(Ct,ne),he=Gs(oe,ne),Be=Ie.get(he);if(Be)Ss(Ct,ne,Be);else{var pe=_e?_e(se,he,ne+"",Ct,oe,Ie):v,Fe=pe===v;if(Fe){var Ue=We(he),vi=!Ue&&Qr(he),Ee=!Ue&&!vi&&Bn(he);pe=he,Ue||vi||Ee?We(se)?pe=se:Ai(se)?pe=Ki(se):vi?(Fe=!1,pe=Ul(he,!0)):Ee?(Fe=!1,pe=ql(he,!0)):pe=[]:io(he)||pn(he)?(pe=se,pn(se)?pe=Nh(se):Ei(se)&&!qr(se)||(pe=nh(he))):Fe=!1}Fe&&(Ie.set(he,pe),Me(pe,he,le,_e,Ie),Ie.delete(he)),Ss(Ct,ne,pe)}})(d,k,St,V,Xo,at,ct);else{var Ot=at?at(Gs(d,St),yt,St+"",d,k,ct):v;Ot===v&&(Ot=yt),Ss(d,St,Ot)}},Gi)}function Ol(d,k){var V=d.length;if(V)return Ur(k+=k<0?V:0,V)?d[k]:v}function Al(d,k,V){k=k.length?Si(k,function(yt){return We(yt)?function(St){return ln(St,yt.length===1?yt[0]:yt)}:yt}):[Yi];var at=-1;k=Si(k,rr(Ne()));var ct=El(d,function(yt,St,Ot){var Ct=Si(k,function(oe){return oe(yt)});return{criteria:Ct,index:++at,value:yt}});return function(yt,St){var Ot=yt.length;for(yt.sort(function(Ct,oe){return function(ne,le,Me){for(var _e=-1,Ie=ne.criteria,se=le.criteria,he=Ie.length,Be=Me.length;++_e<he;){var pe=Fl(Ie[_e],se[_e]);if(pe)return _e>=Be?pe:pe*(Me[_e]=="desc"?-1:1)}return ne.index-le.index}(Ct,oe,V)});Ot--;)yt[Ot]=yt[Ot].value;return yt}(ct)}function Tl(d,k,V){for(var at=-1,ct=k.length,yt={};++at<ct;){var St=k[at],Ot=ln(d,St);V(Ot,St)&&Yn(yt,Gr(St,d),Ot)}return yt}function Rs(d,k,V,at){var ct=at?Bd:Mn,yt=-1,St=k.length,Ot=d;for(d===k&&(k=Ki(k)),V&&(Ot=Si(d,rr(V)));++yt<St;)for(var Ct=0,oe=k[yt],ne=V?V(oe):oe;(Ct=ct(Ot,ne,Ct,at))>-1;)Ot!==d&&Lo.call(Ot,Ct,1),Lo.call(d,Ct,1);return d}function Bl(d,k){for(var V=d?k.length:0,at=V-1;V--;){var ct=k[V];if(V==at||ct!==yt){var yt=ct;Ur(ct)?Lo.call(d,ct,1):Ls(d,ct)}}return d}function Ns(d,k){return d+qo(hl()*(k-d+1))}function Cs(d,k){var V="";if(!d||k<1||k>t)return V;do k%2&&(V+=d),(k=qo(k/2))&&(d+=d);while(k);return V}function Xe(d,k){return Ys(sh(d,k,Yi),d+"")}function c0(d){return dl(jn(d))}function l0(d,k){var V=jn(d);return ra(V,cn(k,0,V.length))}function Yn(d,k,V,at){if(!Ei(d))return d;for(var ct=-1,yt=(k=Gr(k,d)).length,St=yt-1,Ot=d;Ot!=null&&++ct<yt;){var Ct=jr(k[ct]),oe=V;if(Ct==="__proto__"||Ct==="constructor"||Ct==="prototype")return d;if(ct!=St){var ne=Ot[Ct];(oe=at?at(ne,Ct,Ot):v)===v&&(oe=Ei(ne)?ne:Ur(k[ct+1])?[]:{})}Zn(Ot,Ct,oe),Ot=Ot[Ct]}return d}var jl=Fo?function(d,k){return Fo.set(d,k),d}:Yi,h0=Do?function(d,k){return Do(d,"toString",{configurable:!0,enumerable:!1,value:lu(k),writable:!0})}:Yi;function f0(d){return ra(jn(d))}function dr(d,k,V){var at=-1,ct=d.length;k<0&&(k=-k>ct?0:ct+k),(V=V>ct?ct:V)<0&&(V+=ct),ct=k>V?0:V-k>>>0,k>>>=0;for(var yt=me(ct);++at<ct;)yt[at]=d[at+k];return yt}function p0(d,k){var V;return Kr(d,function(at,ct,yt){return!(V=k(at,ct,yt))}),!!V}function Zo(d,k,V){var at=0,ct=d==null?at:d.length;if(typeof k=="number"&&k==k&&ct<=o){for(;at<ct;){var yt=at+ct>>>1,St=d[yt];St!==null&&!or(St)&&(V?St<=k:St<k)?at=yt+1:ct=yt}return ct}return Ps(d,k,Yi,V)}function Ps(d,k,V,at){var ct=0,yt=d==null?0:d.length;if(yt===0)return 0;for(var St=(k=V(k))!=k,Ot=k===null,Ct=or(k),oe=k===v;ct<yt;){var ne=qo((ct+yt)/2),le=V(d[ne]),Me=le!==v,_e=le===null,Ie=le==le,se=or(le);if(St)var he=at||Ie;else he=oe?Ie&&(at||Me):Ot?Ie&&Me&&(at||!_e):Ct?Ie&&Me&&!_e&&(at||!se):!_e&&!se&&(at?le<=k:le<k);he?ct=ne+1:yt=ne}return Ui(yt,e)}function Rl(d,k){for(var V=-1,at=d.length,ct=0,yt=[];++V<at;){var St=d[V],Ot=k?k(St):St;if(!V||!_r(Ot,Ct)){var Ct=Ot;yt[ct++]=St===0?0:St}}return yt}function Nl(d){return typeof d=="number"?d:or(d)?r:+d}function nr(d){if(typeof d=="string")return d;if(We(d))return Si(d,nr)+"";if(or(d))return fl?fl.call(d):"";var k=d+"";return k=="0"&&1/d==-ot?"-0":k}function Jr(d,k,V){var at=-1,ct=ko,yt=d.length,St=!0,Ot=[],Ct=Ot;if(V)St=!1,ct=hs;else if(yt>=m){var oe=k?null:m0(d);if(oe)return Oo(oe);St=!1,ct=zn,Ct=new un}else Ct=k?[]:Ot;t:for(;++at<yt;){var ne=d[at],le=k?k(ne):ne;if(ne=V||ne!==0?ne:0,St&&le==le){for(var Me=Ct.length;Me--;)if(Ct[Me]===le)continue t;k&&Ct.push(le),Ot.push(ne)}else ct(Ct,le,V)||(Ct!==Ot&&Ct.push(le),Ot.push(ne))}return Ot}function Ls(d,k){return(d=uh(d,k=Gr(k,d)))==null||delete d[jr(mr(k))]}function Cl(d,k,V,at){return Yn(d,k,V(ln(d,k)),at)}function Ko(d,k,V,at){for(var ct=d.length,yt=at?ct:-1;(at?yt--:++yt<ct)&&k(d[yt],yt,d););return V?dr(d,at?0:yt,at?yt+1:ct):dr(d,at?yt+1:0,at?ct:yt)}function Pl(d,k){var V=d;return V instanceof Qe&&(V=V.value()),fs(k,function(at,ct){return ct.func.apply(ct.thisArg,Vr([at],ct.args))},V)}function Ds(d,k,V){var at=d.length;if(at<2)return at?Jr(d[0]):[];for(var ct=-1,yt=me(at);++ct<at;)for(var St=d[ct],Ot=-1;++Ot<at;)Ot!=ct&&(yt[ct]=Kn(yt[ct]||St,d[Ot],k,V));return Jr(Di(yt,1),k,V)}function Ll(d,k,V){for(var at=-1,ct=d.length,yt=k.length,St={};++at<ct;){var Ot=at<yt?k[at]:v;V(St,d[at],Ot)}return St}function Us(d){return Ai(d)?d:[]}function qs(d){return typeof d=="function"?d:Yi}function Gr(d,k){return We(d)?d:Ks(d,k)?[d]:fh(yi(d))}var d0=Xe;function Yr(d,k,V){var at=d.length;return V=V===v?at:V,!k&&V>=at?d:dr(d,k,V)}var Dl=$d||function(d){return de.clearTimeout(d)};function Ul(d,k){if(k)return d.slice();var V=d.length,at=al?al(V):new d.constructor(V);return d.copy(at),at}function Fs(d){var k=new d.constructor(d.byteLength);return new Co(k).set(new Co(d)),k}function ql(d,k){var V=k?Fs(d.buffer):d.buffer;return new d.constructor(V,d.byteOffset,d.length)}function Fl(d,k){if(d!==k){var V=d!==v,at=d===null,ct=d==d,yt=or(d),St=k!==v,Ot=k===null,Ct=k==k,oe=or(k);if(!Ot&&!oe&&!yt&&d>k||yt&&St&&Ct&&!Ot&&!oe||at&&St&&Ct||!V&&Ct||!ct)return 1;if(!at&&!yt&&!oe&&d<k||oe&&V&&ct&&!at&&!yt||Ot&&V&&ct||!St&&ct||!Ct)return-1}return 0}function zl(d,k,V,at){for(var ct=-1,yt=d.length,St=V.length,Ot=-1,Ct=k.length,oe=Ri(yt-St,0),ne=me(Ct+oe),le=!at;++Ot<Ct;)ne[Ot]=k[Ot];for(;++ct<St;)(le||ct<yt)&&(ne[V[ct]]=d[ct]);for(;oe--;)ne[Ot++]=d[ct++];return ne}function $l(d,k,V,at){for(var ct=-1,yt=d.length,St=-1,Ot=V.length,Ct=-1,oe=k.length,ne=Ri(yt-Ot,0),le=me(ne+oe),Me=!at;++ct<ne;)le[ct]=d[ct];for(var _e=ct;++Ct<oe;)le[_e+Ct]=k[Ct];for(;++St<Ot;)(Me||ct<yt)&&(le[_e+V[St]]=d[ct++]);return le}function Ki(d,k){var V=-1,at=d.length;for(k||(k=me(at));++V<at;)k[V]=d[V];return k}function Br(d,k,V,at){var ct=!V;V||(V={});for(var yt=-1,St=k.length;++yt<St;){var Ot=k[yt],Ct=at?at(V[Ot],d[Ot],Ot,V,d):v;Ct===v&&(Ct=d[Ot]),ct?Pr(V,Ot,Ct):Zn(V,Ot,Ct)}return V}function Jo(d,k){return function(V,at){var ct=We(V)?Id:o0,yt=k?k():{};return ct(V,d,Ne(at,2),yt)}}function On(d){return Xe(function(k,V){var at=-1,ct=V.length,yt=ct>1?V[ct-1]:v,St=ct>2?V[2]:v;for(yt=d.length>3&&typeof yt=="function"?(ct--,yt):v,St&&Xi(V[0],V[1],St)&&(yt=ct<3?v:yt,ct=1),k=xi(k);++at<ct;){var Ot=V[at];Ot&&d(k,Ot,at,yt)}return k})}function Hl(d,k){return function(V,at){if(V==null)return V;if(!Ji(V))return d(V,at);for(var ct=V.length,yt=k?ct:-1,St=xi(V);(k?yt--:++yt<ct)&&at(St[yt],yt,St)!==!1;);return V}}function Wl(d){return function(k,V,at){for(var ct=-1,yt=xi(k),St=at(k),Ot=St.length;Ot--;){var Ct=St[d?Ot:++ct];if(V(yt[Ct],Ct,yt)===!1)break}return k}}function Vl(d){return function(k){var V=xn(k=yi(k))?Mr(k):v,at=V?V[0]:k.charAt(0),ct=V?Yr(V,1).join(""):k.slice(1);return at[d]()+ct}}function An(d){return function(k){return fs(zh(Fh(k).replace(wt,"")),d,"")}}function Qn(d){return function(){var k=arguments;switch(k.length){case 0:return new d;case 1:return new d(k[0]);case 2:return new d(k[0],k[1]);case 3:return new d(k[0],k[1],k[2]);case 4:return new d(k[0],k[1],k[2],k[3]);case 5:return new d(k[0],k[1],k[2],k[3],k[4]);case 6:return new d(k[0],k[1],k[2],k[3],k[4],k[5]);case 7:return new d(k[0],k[1],k[2],k[3],k[4],k[5],k[6])}var V=In(d.prototype),at=d.apply(V,k);return Ei(at)?at:V}}function Xl(d){return function(k,V,at){var ct=xi(k);if(!Ji(k)){var yt=Ne(V,3);k=Ci(k),V=function(Ot){return yt(ct[Ot],Ot,ct)}}var St=d(k,V,at);return St>-1?ct[yt?k[St]:St]:v}}function Zl(d){return Dr(function(k){var V=k.length,at=V,ct=fr.prototype.thru;for(d&&k.reverse();at--;){var yt=k[at];if(typeof yt!="function")throw new hr(S);if(ct&&!St&&ea(yt)=="wrapper")var St=new fr([],!0)}for(at=St?at:V;++at<V;){var Ot=ea(yt=k[at]),Ct=Ot=="wrapper"?Vs(yt):v;St=Ct&&Js(Ct[0])&&Ct[1]==(P|E|M|N)&&!Ct[4].length&&Ct[9]==1?St[ea(Ct[0])].apply(St,Ct[3]):yt.length==1&&Js(yt)?St[Ot]():St.thru(yt)}return function(){var oe=arguments,ne=oe[0];if(St&&oe.length==1&&We(ne))return St.plant(ne).value();for(var le=0,Me=V?k[le].apply(this,oe):ne;++le<V;)Me=k[le].call(this,Me);return Me}})}function Go(d,k,V,at,ct,yt,St,Ot,Ct,oe){var ne=k&P,le=k&u,Me=k&w,_e=k&(E|I),Ie=k&$,se=Me?v:Qn(d);return function he(){for(var Be=arguments.length,pe=me(Be),Fe=Be;Fe--;)pe[Fe]=arguments[Fe];if(_e)var Ue=Tn(he),vi=function(Ti,Zi){for(var _i=Ti.length,Fi=0;_i--;)Ti[_i]===Zi&&++Fi;return Fi}(pe,Ue);if(at&&(pe=zl(pe,at,ct,_e)),yt&&(pe=$l(pe,yt,St,_e)),Be-=vi,_e&&Be<oe){var Ee=Xr(pe,Ue);return Gl(d,k,Go,he.placeholder,V,pe,Ee,Ot,Ct,oe-Be)}var Pe=le?V:this,Ni=Me?Pe[d]:d;return Be=pe.length,Ot?pe=function(Ti,Zi){for(var _i=Ti.length,Fi=Ui(Zi.length,_i),Rr=Ki(Ti);Fi--;){var tn=Zi[Fi];Ti[Fi]=Ur(tn,_i)?Rr[tn]:v}return Ti}(pe,Ot):Ie&&Be>1&&pe.reverse(),ne&&Ct<Be&&(pe.length=Ct),this&&this!==de&&this instanceof he&&(Ni=se||Qn(Ni)),Ni.apply(Pe,pe)}}function Kl(d,k){return function(V,at){return function(ct,yt,St,Ot){return Tr(ct,function(Ct,oe,ne){yt(Ot,St(Ct),oe,ne)}),Ot}(V,d,k(at),{})}}function Yo(d,k){return function(V,at){var ct;if(V===v&&at===v)return k;if(V!==v&&(ct=V),at!==v){if(ct===v)return at;typeof V=="string"||typeof at=="string"?(V=nr(V),at=nr(at)):(V=Nl(V),at=Nl(at)),ct=d(V,at)}return ct}}function zs(d){return Dr(function(k){return k=Si(k,rr(Ne())),Xe(function(V){var at=this;return d(k,function(ct){return ir(ct,at,V)})})})}function Qo(d,k){var V=(k=k===v?" ":nr(k)).length;if(V<2)return V?Cs(k,d):k;var at=Cs(k,Uo(d/_n(k)));return xn(k)?Yr(Mr(at),0,d).join(""):at.slice(0,d)}function Jl(d){return function(k,V,at){return at&&typeof at!="number"&&Xi(k,V,at)&&(V=at=v),k=Fr(k),V===v?(V=k,k=0):V=Fr(V),function(ct,yt,St,Ot){for(var Ct=-1,oe=Ri(Uo((yt-ct)/(St||1)),0),ne=me(oe);oe--;)ne[Ot?oe:++Ct]=ct,ct+=St;return ne}(k,V,at=at===v?k<V?1:-1:Fr(at),d)}}function ta(d){return function(k,V){return typeof k=="string"&&typeof V=="string"||(k=gr(k),V=gr(V)),d(k,V)}}function Gl(d,k,V,at,ct,yt,St,Ot,Ct,oe){var ne=k&E;k|=ne?M:B,(k&=~(ne?B:M))&b||(k&=~(u|w));var le=[d,k,ct,ne?yt:v,ne?St:v,ne?v:yt,ne?v:St,Ot,Ct,oe],Me=V.apply(v,le);return Js(d)&&ch(Me,le),Me.placeholder=at,lh(Me,d,k)}function $s(d){var k=Ar[d];return function(V,at){if(V=gr(V),(at=at==null?0:Ui(Ve(at),292))&&ll(V)){var ct=(yi(V)+"e").split("e");return+((ct=(yi(k(ct[0]+"e"+(+ct[1]+at)))+"e").split("e"))[0]+"e"+(+ct[1]-at))}return k(V)}}var m0=En&&1/Oo(new En([,-0]))[1]==ot?function(d){return new En(d)}:pu;function Yl(d){return function(k){var V=qi(k);return V==G?bs(k):V==gt?Cd(k):function(at,ct){return Si(ct,function(yt){return[yt,at[yt]]})}(k,d(k))}}function Lr(d,k,V,at,ct,yt,St,Ot){var Ct=k&w;if(!Ct&&typeof d!="function")throw new hr(S);var oe=at?at.length:0;if(oe||(k&=~(M|B),at=ct=v),St=St===v?St:Ri(Ve(St),0),Ot=Ot===v?Ot:Ve(Ot),oe-=ct?ct.length:0,k&B){var ne=at,le=ct;at=ct=v}var Me=Ct?v:Vs(d),_e=[d,k,V,at,ct,ne,le,yt,St,Ot];if(Me&&function(se,he){var Be=se[1],pe=he[1],Fe=Be|pe,Ue=Fe<(u|w|P),vi=pe==P&&Be==E||pe==P&&Be==N&&se[7].length<=he[8]||pe==(P|N)&&he[7].length<=he[8]&&Be==E;if(!Ue&&!vi)return se;pe&u&&(se[2]=he[2],Fe|=Be&u?0:b);var Ee=he[3];if(Ee){var Pe=se[3];se[3]=Pe?zl(Pe,Ee,he[4]):Ee,se[4]=Pe?Xr(se[3],p):he[4]}(Ee=he[5])&&(Pe=se[5],se[5]=Pe?$l(Pe,Ee,he[6]):Ee,se[6]=Pe?Xr(se[5],p):he[6]),(Ee=he[7])&&(se[7]=Ee),pe&P&&(se[8]=se[8]==null?he[8]:Ui(se[8],he[8])),se[9]==null&&(se[9]=he[9]),se[0]=he[0],se[1]=Fe}(_e,Me),d=_e[0],k=_e[1],V=_e[2],at=_e[3],ct=_e[4],!(Ot=_e[9]=_e[9]===v?Ct?0:d.length:Ri(_e[9]-oe,0))&&k&(E|I)&&(k&=~(E|I)),k&&k!=u)Ie=k==E||k==I?function(se,he,Be){var pe=Qn(se);return function Fe(){for(var Ue=arguments.length,vi=me(Ue),Ee=Ue,Pe=Tn(Fe);Ee--;)vi[Ee]=arguments[Ee];var Ni=Ue<3&&vi[0]!==Pe&&vi[Ue-1]!==Pe?[]:Xr(vi,Pe);return(Ue-=Ni.length)<Be?Gl(se,he,Go,Fe.placeholder,v,vi,Ni,v,v,Be-Ue):ir(this&&this!==de&&this instanceof Fe?pe:se,this,vi)}}(d,k,Ot):k!=M&&k!=(u|M)||ct.length?Go.apply(v,_e):function(se,he,Be,pe){var Fe=he&u,Ue=Qn(se);return function vi(){for(var Ee=-1,Pe=arguments.length,Ni=-1,Ti=pe.length,Zi=me(Ti+Pe),_i=this&&this!==de&&this instanceof vi?Ue:se;++Ni<Ti;)Zi[Ni]=pe[Ni];for(;Pe--;)Zi[Ni++]=arguments[++Ee];return ir(_i,Fe?Be:this,Zi)}}(d,k,V,at);else var Ie=function(se,he,Be){var pe=he&u,Fe=Qn(se);return function Ue(){return(this&&this!==de&&this instanceof Ue?Fe:se).apply(pe?Be:this,arguments)}}(d,k,V);return lh((Me?jl:ch)(Ie,_e),d,k)}function Ql(d,k,V,at){return d===v||_r(d,Sn[V])&&!bi.call(at,V)?k:d}function th(d,k,V,at,ct,yt){return Ei(d)&&Ei(k)&&(yt.set(k,d),Xo(d,k,v,th,yt),yt.delete(k)),d}function g0(d){return io(d)?v:d}function eh(d,k,V,at,ct,yt){var St=V&g,Ot=d.length,Ct=k.length;if(Ot!=Ct&&!(St&&Ct>Ot))return!1;var oe=yt.get(d),ne=yt.get(k);if(oe&&ne)return oe==k&&ne==d;var le=-1,Me=!0,_e=V&h?new un:v;for(yt.set(d,k),yt.set(k,d);++le<Ot;){var Ie=d[le],se=k[le];if(at)var he=St?at(se,Ie,le,k,d,yt):at(Ie,se,le,d,k,yt);if(he!==v){if(he)continue;Me=!1;break}if(_e){if(!ps(k,function(Be,pe){if(!zn(_e,pe)&&(Ie===Be||ct(Ie,Be,V,at,yt)))return _e.push(pe)})){Me=!1;break}}else if(Ie!==se&&!ct(Ie,se,V,at,yt)){Me=!1;break}}return yt.delete(d),yt.delete(k),Me}function Dr(d){return Ys(sh(d,v,gh),d+"")}function Hs(d){return Ml(d,Ci,Zs)}function Ws(d){return Ml(d,Gi,ih)}var Vs=Fo?function(d){return Fo.get(d)}:pu;function ea(d){for(var k=d.name+"",V=kn[k],at=bi.call(kn,k)?V.length:0;at--;){var ct=V[at],yt=ct.func;if(yt==null||yt==d)return ct.name}return k}function Tn(d){return(bi.call(dt,"placeholder")?dt:d).placeholder}function Ne(){var d=dt.iteratee||hu;return d=d===hu?Sl:d,arguments.length?d(arguments[0],arguments[1]):d}function ia(d,k){var V,at,ct=d.__data__;return((at=typeof(V=k))=="string"||at=="number"||at=="symbol"||at=="boolean"?V!=="__proto__":V===null)?ct[typeof k=="string"?"string":"hash"]:ct.map}function Xs(d){for(var k=Ci(d),V=k.length;V--;){var at=k[V],ct=d[at];k[V]=[at,ct,oh(ct)]}return k}function hn(d,k){var V=function(at,ct){return at==null?v:at[ct]}(d,k);return _l(V)?V:v}var Zs=Ms?function(d){return d==null?[]:(d=xi(d),Wr(Ms(d),function(k){return ul.call(d,k)}))}:du,ih=Ms?function(d){for(var k=[];d;)Vr(k,Zs(d)),d=Po(d);return k}:du,qi=Vi;function rh(d,k,V){for(var at=-1,ct=(k=Gr(k,d)).length,yt=!1;++at<ct;){var St=jr(k[at]);if(!(yt=d!=null&&V(d,St)))break;d=d[St]}return yt||++at!=ct?yt:!!(ct=d==null?0:d.length)&&ca(ct)&&Ur(St,ct)&&(We(d)||pn(d))}function nh(d){return typeof d.constructor!="function"||to(d)?{}:In(Po(d))}function v0(d){return We(d)||pn(d)||!!(cl&&d&&d[cl])}function Ur(d,k){var V=typeof d;return!!(k=k??t)&&(V=="number"||V!="symbol"&&Ft.test(d))&&d>-1&&d%1==0&&d<k}function Xi(d,k,V){if(!Ei(V))return!1;var at=typeof k;return!!(at=="number"?Ji(V)&&Ur(k,V.length):at=="string"&&k in V)&&_r(V[k],d)}function Ks(d,k){if(We(d))return!1;var V=typeof d;return!(V!="number"&&V!="symbol"&&V!="boolean"&&d!=null&&!or(d))||Nt.test(d)||!ye.test(d)||k!=null&&d in xi(k)}function Js(d){var k=ea(d),V=dt[k];if(typeof V!="function"||!(k in Qe.prototype))return!1;if(d===V)return!0;var at=Vs(V);return!!at&&d===at[0]}(xs&&qi(new xs(new ArrayBuffer(1)))!=tt||Hn&&qi(new Hn)!=G||_s&&qi(_s.resolve())!=nt||En&&qi(new En)!=gt||Wn&&qi(new Wn)!=It)&&(qi=function(d){var k=Vi(d),V=k==st?d.constructor:v,at=V?fn(V):"";if(at)switch(at){case Yd:return tt;case Qd:return G;case t0:return nt;case e0:return gt;case i0:return It}return k});var y0=Bo?qr:mu;function to(d){var k=d&&d.constructor;return d===(typeof k=="function"&&k.prototype||Sn)}function oh(d){return d==d&&!Ei(d)}function ah(d,k){return function(V){return V!=null&&V[d]===k&&(k!==v||d in xi(V))}}function sh(d,k,V){return k=Ri(k===v?d.length-1:k,0),function(){for(var at=arguments,ct=-1,yt=Ri(at.length-k,0),St=me(yt);++ct<yt;)St[ct]=at[k+ct];ct=-1;for(var Ot=me(k+1);++ct<k;)Ot[ct]=at[ct];return Ot[k]=V(St),ir(d,this,Ot)}}function uh(d,k){return k.length<2?d:ln(d,dr(k,0,-1))}function Gs(d,k){if((k!=="constructor"||typeof d[k]!="function")&&k!="__proto__")return d[k]}var ch=hh(jl),eo=Wd||function(d,k){return de.setTimeout(d,k)},Ys=hh(h0);function lh(d,k,V){var at=k+"";return Ys(d,function(ct,yt){var St=yt.length;if(!St)return ct;var Ot=St-1;return yt[Ot]=(St>1?"& ":"")+yt[Ot],yt=yt.join(St>2?", ":" "),ct.replace(Dt,`{
|
|
75
|
+
`),E=v(E,a,p);const I=new m("!xml");let M=I,B="";for(let P=0;P<b.length;P++)if(b[P]==="<")if(b[P+1]==="/"){const N=w(b,">",P,"Closing Tag is not closed.");let $=b.substring(P+2,N).trim();if(E.ignoreNameSpace){const et=$.indexOf(":");et!==-1&&($=$.substr(et+1))}M&&(M.val?M.val=x.getValue(M.val)+""+c($,B,E):M.val=c($,B,E)),E.stopNodes.length&&E.stopNodes.includes(M.tagname)&&(M.child=[],M.attrsMap==null&&(M.attrsMap={}),M.val=b.substr(M.startIndex+1,P-M.startIndex-1)),M=M.parent,B="",P=N}else if(b[P+1]==="?")P=w(b,"?>",P,"Pi Tag is not closed.");else if(b.substr(P+1,3)==="!--")P=w(b,"-->",P,"Comment is not closed.");else if(b.substr(P+1,2)==="!D"){const N=w(b,">",P,"DOCTYPE is not closed.");P=b.substring(P,N).indexOf("[")>=0?b.indexOf("]>",P)+1:N}else if(b.substr(P+1,2)==="!["){const N=w(b,"]]>",P,"CDATA is not closed.")-2,$=b.substring(P+9,N);if(B&&(M.val=x.getValue(M.val)+""+c(M.tagname,B,E),B=""),E.cdataTagName){const et=new m(E.cdataTagName,M,$);M.addChild(et),M.val=x.getValue(M.val)+E.cdataPositionChar,$&&(et.val=$)}else M.val=(M.val||"")+($||"");P=N+2}else{const N=u(b,P+1);let $=N.data;const et=N.index,Q=$.indexOf(" ");let ot=$,t=!0;if(Q!==-1&&(ot=$.substr(0,Q).replace(/\s\s*$/,""),$=$.substr(Q+1)),E.ignoreNameSpace){const n=ot.indexOf(":");n!==-1&&(ot=ot.substr(n+1),t=ot!==N.data.substr(n+1))}if(M&&B&&M.tagname!=="!xml"&&(M.val=x.getValue(M.val)+""+c(M.tagname,B,E)),$.length>0&&$.lastIndexOf("/")===$.length-1){ot[ot.length-1]==="/"?(ot=ot.substr(0,ot.length-1),$=ot):$=$.substr(0,$.length-1);const n=new m(ot,M,"");ot!==$&&(n.attrsMap=h($,E)),M.addChild(n)}else{const n=new m(ot,M);E.stopNodes.length&&E.stopNodes.includes(n.tagname)&&(n.startIndex=et),ot!==$&&t&&(n.attrsMap=h($,E)),M.addChild(n),M=n}B="",P=et}else B+=b[P];return I}},2806:W=>{W.exports=function(_,y){for(var x={},v=Object.keys(_),m=Array.isArray(y),S=0;S<v.length;S++){var a=v[S],p=_[a];(m?y.indexOf(a)!==-1:y(a,p,_))&&(x[a]=p)}return x}},4029:(W,_,y)=>{var x=y(5320),v=Object.prototype.toString,m=Object.prototype.hasOwnProperty,S=function(c,l,f){for(var g=0,h=c.length;g<h;g++)m.call(c,g)&&(f==null?l(c[g],g,c):l.call(f,c[g],g,c))},a=function(c,l,f){for(var g=0,h=c.length;g<h;g++)f==null?l(c.charAt(g),g,c):l.call(f,c.charAt(g),g,c)},p=function(c,l,f){for(var g in c)m.call(c,g)&&(f==null?l(c[g],g,c):l.call(f,c[g],g,c))};W.exports=function(c,l,f){if(!x(l))throw new TypeError("iterator must be a function");var g;arguments.length>=3&&(g=f),v.call(c)==="[object Array]"?S(c,l,g):typeof c=="string"?a(c,l,g):p(c,l,g)}},7648:W=>{var _="Function.prototype.bind called on incompatible ",y=Array.prototype.slice,x=Object.prototype.toString,v="[object Function]";W.exports=function(m){var S=this;if(typeof S!="function"||x.call(S)!==v)throw new TypeError(_+S);for(var a,p=y.call(arguments,1),c=Math.max(0,S.length-p.length),l=[],f=0;f<c;f++)l.push("$"+f);if(a=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof a){var h=S.apply(this,p.concat(y.call(arguments)));return Object(h)===h?h:this}return S.apply(m,p.concat(y.call(arguments)))}),S.prototype){var g=function(){};g.prototype=S.prototype,a.prototype=new g,g.prototype=null}return a}},8612:(W,_,y)=>{var x=y(7648);W.exports=Function.prototype.bind||x},210:(W,_,y)=>{var x,v=SyntaxError,m=Function,S=TypeError,a=function(i){try{return m('"use strict"; return ('+i+").constructor;")()}catch{}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch{p=null}var c=function(){throw new S},l=p?function(){try{return c}catch{try{return p(arguments,"callee").get}catch{return c}}}():c,f=y(1405)(),g=Object.getPrototypeOf||function(i){return i.__proto__},h={},u=typeof Uint8Array>"u"?x:g(Uint8Array),w={"%AggregateError%":typeof AggregateError>"u"?x:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?x:ArrayBuffer,"%ArrayIteratorPrototype%":f?g([][Symbol.iterator]()):x,"%AsyncFromSyncIteratorPrototype%":x,"%AsyncFunction%":h,"%AsyncGenerator%":h,"%AsyncGeneratorFunction%":h,"%AsyncIteratorPrototype%":h,"%Atomics%":typeof Atomics>"u"?x:Atomics,"%BigInt%":typeof BigInt>"u"?x:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?x:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?x:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?x:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?x:Float32Array,"%Float64Array%":typeof Float64Array>"u"?x:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?x:FinalizationRegistry,"%Function%":m,"%GeneratorFunction%":h,"%Int8Array%":typeof Int8Array>"u"?x:Int8Array,"%Int16Array%":typeof Int16Array>"u"?x:Int16Array,"%Int32Array%":typeof Int32Array>"u"?x:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?g(g([][Symbol.iterator]())):x,"%JSON%":typeof JSON=="object"?JSON:x,"%Map%":typeof Map>"u"?x:Map,"%MapIteratorPrototype%":typeof Map<"u"&&f?g(new Map()[Symbol.iterator]()):x,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?x:Promise,"%Proxy%":typeof Proxy>"u"?x:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?x:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?x:Set,"%SetIteratorPrototype%":typeof Set<"u"&&f?g(new Set()[Symbol.iterator]()):x,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?x:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?g(""[Symbol.iterator]()):x,"%Symbol%":f?Symbol:x,"%SyntaxError%":v,"%ThrowTypeError%":l,"%TypedArray%":u,"%TypeError%":S,"%Uint8Array%":typeof Uint8Array>"u"?x:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?x:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?x:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?x:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?x:WeakMap,"%WeakRef%":typeof WeakRef>"u"?x:WeakRef,"%WeakSet%":typeof WeakSet>"u"?x:WeakSet};try{null.error}catch(i){var b=g(g(i));w["%Error.prototype%"]=b}var E=function i(e){var o;if(e==="%AsyncFunction%")o=a("async function () {}");else if(e==="%GeneratorFunction%")o=a("function* () {}");else if(e==="%AsyncGeneratorFunction%")o=a("async function* () {}");else if(e==="%AsyncGenerator%"){var s=i("%AsyncGeneratorFunction%");s&&(o=s.prototype)}else if(e==="%AsyncIteratorPrototype%"){var A=i("%AsyncGenerator%");A&&(o=g(A.prototype))}return w[e]=o,o},I={"%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"]},M=y(8612),B=y(7642),P=M.call(Function.call,Array.prototype.concat),N=M.call(Function.apply,Array.prototype.splice),$=M.call(Function.call,String.prototype.replace),et=M.call(Function.call,String.prototype.slice),Q=M.call(Function.call,RegExp.prototype.exec),ot=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,t=/\\(\\)?/g,n=function(i){var e=et(i,0,1),o=et(i,-1);if(e==="%"&&o!=="%")throw new v("invalid intrinsic syntax, expected closing `%`");if(o==="%"&&e!=="%")throw new v("invalid intrinsic syntax, expected opening `%`");var s=[];return $(i,ot,function(A,C,j,T){s[s.length]=j?$(T,t,"$1"):C||A}),s},r=function(i,e){var o,s=i;if(B(I,s)&&(s="%"+(o=I[s])[0]+"%"),B(w,s)){var A=w[s];if(A===h&&(A=E(s)),A===void 0&&!e)throw new S("intrinsic "+i+" exists, but is not available. Please file an issue!");return{alias:o,name:s,value:A}}throw new v("intrinsic "+i+" does not exist!")};W.exports=function(i,e){if(typeof i!="string"||i.length===0)throw new S("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new S('"allowMissing" argument must be a boolean');if(Q(/^%?[^%]*%?$/,i)===null)throw new v("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var o=n(i),s=o.length>0?o[0]:"",A=r("%"+s+"%",e),C=A.name,j=A.value,T=!1,R=A.alias;R&&(s=R[0],N(o,P([0,1],R)));for(var q=1,Z=!0;q<o.length;q+=1){var rt=o[q],D=et(rt,0,1),G=et(rt,-1);if((D==='"'||D==="'"||D==="`"||G==='"'||G==="'"||G==="`")&&D!==G)throw new v("property names with quotes must have matching quotes");if(rt!=="constructor"&&Z||(T=!0),B(w,C="%"+(s+="."+rt)+"%"))j=w[C];else if(j!=null){if(!(rt in j)){if(!e)throw new S("base intrinsic for "+i+" exists, but the property is not available.");return}if(p&&q+1>=o.length){var z=p(j,rt);j=(Z=!!z)&&"get"in z&&!("originalValue"in z.get)?z.get:j[rt]}else Z=B(j,rt),j=j[rt];Z&&!T&&(w[C]=j)}}return j}},7296:(W,_,y)=>{var x=y(210)("%Object.getOwnPropertyDescriptor%",!0);if(x)try{x([],"length")}catch{x=null}W.exports=x},1044:(W,_,y)=>{var x=y(210)("%Object.defineProperty%",!0),v=function(){if(x)try{return x({},"a",{value:1}),!0}catch{return!1}return!1};v.hasArrayLengthDefineBug=function(){if(!v())return null;try{return x([],"length",{value:1}).length!==1}catch{return!0}},W.exports=v},1405:(W,_,y)=>{var x=typeof Symbol<"u"&&Symbol,v=y(5419);W.exports=function(){return typeof x=="function"&&typeof Symbol=="function"&&typeof x("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&v()}},5419:W=>{W.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var _={},y=Symbol("test"),x=Object(y);if(typeof y=="string"||Object.prototype.toString.call(y)!=="[object Symbol]"||Object.prototype.toString.call(x)!=="[object Symbol]")return!1;for(y in _[y]=42,_)return!1;if(typeof Object.keys=="function"&&Object.keys(_).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(_).length!==0)return!1;var v=Object.getOwnPropertySymbols(_);if(v.length!==1||v[0]!==y||!Object.prototype.propertyIsEnumerable.call(_,y))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var m=Object.getOwnPropertyDescriptor(_,y);if(m.value!==42||m.enumerable!==!0)return!1}return!0}},6410:(W,_,y)=>{var x=y(5419);W.exports=function(){return x()&&!!Symbol.toStringTag}},7642:(W,_,y)=>{var x=y(8612);W.exports=x.call(Function.call,Object.prototype.hasOwnProperty)},3349:(W,_,y)=>{var x=y(9509).Buffer,v=y(8473).Transform;function m(S){v.call(this),this._block=x.allocUnsafe(S),this._blockSize=S,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}y(5717)(m,v),m.prototype._transform=function(S,a,p){var c=null;try{this.update(S,a)}catch(l){c=l}p(c)},m.prototype._flush=function(S){var a=null;try{this.push(this.digest())}catch(p){a=p}S(a)},m.prototype.update=function(S,a){if(function(h,u){if(!x.isBuffer(h)&&typeof h!="string")throw new TypeError("Data must be a string or a buffer")}(S),this._finalized)throw new Error("Digest already called");x.isBuffer(S)||(S=x.from(S,a));for(var p=this._block,c=0;this._blockOffset+S.length-c>=this._blockSize;){for(var l=this._blockOffset;l<this._blockSize;)p[l++]=S[c++];this._update(),this._blockOffset=0}for(;c<S.length;)p[this._blockOffset++]=S[c++];for(var f=0,g=8*S.length;g>0;++f)this._length[f]+=g,(g=this._length[f]/4294967296|0)>0&&(this._length[f]-=4294967296*g);return this},m.prototype._update=function(){throw new Error("_update is not implemented")},m.prototype.digest=function(S){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var a=this._digest();S!==void 0&&(a=a.toString(S)),this._block.fill(0),this._blockOffset=0;for(var p=0;p<4;++p)this._length[p]=0;return a},m.prototype._digest=function(){throw new Error("_digest is not implemented")},W.exports=m},3715:(W,_,y)=>{var x=_;x.utils=y(6436),x.common=y(5772),x.sha=y(9041),x.ripemd=y(2949),x.hmac=y(2344),x.sha1=x.sha.sha1,x.sha256=x.sha.sha256,x.sha224=x.sha.sha224,x.sha384=x.sha.sha384,x.sha512=x.sha.sha512,x.ripemd160=x.ripemd.ripemd160},5772:(W,_,y)=>{var x=y(6436),v=y(9746);function m(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}_.BlockHash=m,m.prototype.update=function(S,a){if(S=x.toArray(S,a),this.pending?this.pending=this.pending.concat(S):this.pending=S,this.pendingTotal+=S.length,this.pending.length>=this._delta8){var p=(S=this.pending).length%this._delta8;this.pending=S.slice(S.length-p,S.length),this.pending.length===0&&(this.pending=null),S=x.join32(S,0,S.length-p,this.endian);for(var c=0;c<S.length;c+=this._delta32)this._update(S,c,c+this._delta32)}return this},m.prototype.digest=function(S){return this.update(this._pad()),v(this.pending===null),this._digest(S)},m.prototype._pad=function(){var S=this.pendingTotal,a=this._delta8,p=a-(S+this.padLength)%a,c=new Array(p+this.padLength);c[0]=128;for(var l=1;l<p;l++)c[l]=0;if(S<<=3,this.endian==="big"){for(var f=8;f<this.padLength;f++)c[l++]=0;c[l++]=0,c[l++]=0,c[l++]=0,c[l++]=0,c[l++]=S>>>24&255,c[l++]=S>>>16&255,c[l++]=S>>>8&255,c[l++]=255&S}else for(c[l++]=255&S,c[l++]=S>>>8&255,c[l++]=S>>>16&255,c[l++]=S>>>24&255,c[l++]=0,c[l++]=0,c[l++]=0,c[l++]=0,f=8;f<this.padLength;f++)c[l++]=0;return c}},2344:(W,_,y)=>{var x=y(6436),v=y(9746);function m(S,a,p){if(!(this instanceof m))return new m(S,a,p);this.Hash=S,this.blockSize=S.blockSize/8,this.outSize=S.outSize/8,this.inner=null,this.outer=null,this._init(x.toArray(a,p))}W.exports=m,m.prototype._init=function(S){S.length>this.blockSize&&(S=new this.Hash().update(S).digest()),v(S.length<=this.blockSize);for(var a=S.length;a<this.blockSize;a++)S.push(0);for(a=0;a<S.length;a++)S[a]^=54;for(this.inner=new this.Hash().update(S),a=0;a<S.length;a++)S[a]^=106;this.outer=new this.Hash().update(S)},m.prototype.update=function(S,a){return this.inner.update(S,a),this},m.prototype.digest=function(S){return this.outer.update(this.inner.digest()),this.outer.digest(S)}},2949:(W,_,y)=>{var x=y(6436),v=y(5772),m=x.rotl32,S=x.sum32,a=x.sum32_3,p=x.sum32_4,c=v.BlockHash;function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(I,M,B,P){return I<=15?M^B^P:I<=31?M&B|~M&P:I<=47?(M|~B)^P:I<=63?M&P|B&~P:M^(B|~P)}function g(I){return I<=15?0:I<=31?1518500249:I<=47?1859775393:I<=63?2400959708:2840853838}function h(I){return I<=15?1352829926:I<=31?1548603684:I<=47?1836072691:I<=63?2053994217:0}x.inherits(l,c),_.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(I,M){for(var B=this.h[0],P=this.h[1],N=this.h[2],$=this.h[3],et=this.h[4],Q=B,ot=P,t=N,n=$,r=et,i=0;i<80;i++){var e=S(m(p(B,f(i,P,N,$),I[u[i]+M],g(i)),b[i]),et);B=et,et=$,$=m(N,10),N=P,P=e,e=S(m(p(Q,f(79-i,ot,t,n),I[w[i]+M],h(i)),E[i]),r),Q=r,r=n,n=m(t,10),t=ot,ot=e}e=a(this.h[1],N,n),this.h[1]=a(this.h[2],$,r),this.h[2]=a(this.h[3],et,Q),this.h[3]=a(this.h[4],B,ot),this.h[4]=a(this.h[0],P,t),this.h[0]=e},l.prototype._digest=function(I){return I==="hex"?x.toHex32(this.h,"little"):x.split32(this.h,"little")};var u=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],w=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],b=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],E=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},9041:(W,_,y)=>{_.sha1=y(4761),_.sha224=y(799),_.sha256=y(9344),_.sha384=y(772),_.sha512=y(5900)},4761:(W,_,y)=>{var x=y(6436),v=y(5772),m=y(7038),S=x.rotl32,a=x.sum32,p=x.sum32_5,c=m.ft_1,l=v.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function g(){if(!(this instanceof g))return new g;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}x.inherits(g,l),W.exports=g,g.blockSize=512,g.outSize=160,g.hmacStrength=80,g.padLength=64,g.prototype._update=function(h,u){for(var w=this.W,b=0;b<16;b++)w[b]=h[u+b];for(;b<w.length;b++)w[b]=S(w[b-3]^w[b-8]^w[b-14]^w[b-16],1);var E=this.h[0],I=this.h[1],M=this.h[2],B=this.h[3],P=this.h[4];for(b=0;b<w.length;b++){var N=~~(b/20),$=p(S(E,5),c(N,I,M,B),P,w[b],f[N]);P=B,B=M,M=S(I,30),I=E,E=$}this.h[0]=a(this.h[0],E),this.h[1]=a(this.h[1],I),this.h[2]=a(this.h[2],M),this.h[3]=a(this.h[3],B),this.h[4]=a(this.h[4],P)},g.prototype._digest=function(h){return h==="hex"?x.toHex32(this.h,"big"):x.split32(this.h,"big")}},799:(W,_,y)=>{var x=y(6436),v=y(9344);function m(){if(!(this instanceof m))return new m;v.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}x.inherits(m,v),W.exports=m,m.blockSize=512,m.outSize=224,m.hmacStrength=192,m.padLength=64,m.prototype._digest=function(S){return S==="hex"?x.toHex32(this.h.slice(0,7),"big"):x.split32(this.h.slice(0,7),"big")}},9344:(W,_,y)=>{var x=y(6436),v=y(5772),m=y(7038),S=y(9746),a=x.sum32,p=x.sum32_4,c=x.sum32_5,l=m.ch32,f=m.maj32,g=m.s0_256,h=m.s1_256,u=m.g0_256,w=m.g1_256,b=v.BlockHash,E=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function I(){if(!(this instanceof I))return new I;b.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=E,this.W=new Array(64)}x.inherits(I,b),W.exports=I,I.blockSize=512,I.outSize=256,I.hmacStrength=192,I.padLength=64,I.prototype._update=function(M,B){for(var P=this.W,N=0;N<16;N++)P[N]=M[B+N];for(;N<P.length;N++)P[N]=p(w(P[N-2]),P[N-7],u(P[N-15]),P[N-16]);var $=this.h[0],et=this.h[1],Q=this.h[2],ot=this.h[3],t=this.h[4],n=this.h[5],r=this.h[6],i=this.h[7];for(S(this.k.length===P.length),N=0;N<P.length;N++){var e=c(i,h(t),l(t,n,r),this.k[N],P[N]),o=a(g($),f($,et,Q));i=r,r=n,n=t,t=a(ot,e),ot=Q,Q=et,et=$,$=a(e,o)}this.h[0]=a(this.h[0],$),this.h[1]=a(this.h[1],et),this.h[2]=a(this.h[2],Q),this.h[3]=a(this.h[3],ot),this.h[4]=a(this.h[4],t),this.h[5]=a(this.h[5],n),this.h[6]=a(this.h[6],r),this.h[7]=a(this.h[7],i)},I.prototype._digest=function(M){return M==="hex"?x.toHex32(this.h,"big"):x.split32(this.h,"big")}},772:(W,_,y)=>{var x=y(6436),v=y(5900);function m(){if(!(this instanceof m))return new m;v.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}x.inherits(m,v),W.exports=m,m.blockSize=1024,m.outSize=384,m.hmacStrength=192,m.padLength=128,m.prototype._digest=function(S){return S==="hex"?x.toHex32(this.h.slice(0,12),"big"):x.split32(this.h.slice(0,12),"big")}},5900:(W,_,y)=>{var x=y(6436),v=y(5772),m=y(9746),S=x.rotr64_hi,a=x.rotr64_lo,p=x.shr64_hi,c=x.shr64_lo,l=x.sum64,f=x.sum64_hi,g=x.sum64_lo,h=x.sum64_4_hi,u=x.sum64_4_lo,w=x.sum64_5_hi,b=x.sum64_5_lo,E=v.BlockHash,I=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function M(){if(!(this instanceof M))return new M;E.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=I,this.W=new Array(160)}function B(i,e,o,s,A){var C=i&o^~i&A;return C<0&&(C+=4294967296),C}function P(i,e,o,s,A,C){var j=e&s^~e&C;return j<0&&(j+=4294967296),j}function N(i,e,o,s,A){var C=i&o^i&A^o&A;return C<0&&(C+=4294967296),C}function $(i,e,o,s,A,C){var j=e&s^e&C^s&C;return j<0&&(j+=4294967296),j}function et(i,e){var o=S(i,e,28)^S(e,i,2)^S(e,i,7);return o<0&&(o+=4294967296),o}function Q(i,e){var o=a(i,e,28)^a(e,i,2)^a(e,i,7);return o<0&&(o+=4294967296),o}function ot(i,e){var o=a(i,e,14)^a(i,e,18)^a(e,i,9);return o<0&&(o+=4294967296),o}function t(i,e){var o=S(i,e,1)^S(i,e,8)^p(i,e,7);return o<0&&(o+=4294967296),o}function n(i,e){var o=a(i,e,1)^a(i,e,8)^c(i,e,7);return o<0&&(o+=4294967296),o}function r(i,e){var o=a(i,e,19)^a(e,i,29)^c(i,e,6);return o<0&&(o+=4294967296),o}x.inherits(M,E),W.exports=M,M.blockSize=1024,M.outSize=512,M.hmacStrength=192,M.padLength=128,M.prototype._prepareBlock=function(i,e){for(var o=this.W,s=0;s<32;s++)o[s]=i[e+s];for(;s<o.length;s+=2){var A=(D=o[s-4],G=o[s-3],z=void 0,(z=S(D,G,19)^S(G,D,29)^p(D,G,6))<0&&(z+=4294967296),z),C=r(o[s-4],o[s-3]),j=o[s-14],T=o[s-13],R=t(o[s-30],o[s-29]),q=n(o[s-30],o[s-29]),Z=o[s-32],rt=o[s-31];o[s]=h(A,C,j,T,R,q,Z,rt),o[s+1]=u(A,C,j,T,R,q,Z,rt)}var D,G,z},M.prototype._update=function(i,e){this._prepareBlock(i,e);var o,s,A,C=this.W,j=this.h[0],T=this.h[1],R=this.h[2],q=this.h[3],Z=this.h[4],rt=this.h[5],D=this.h[6],G=this.h[7],z=this.h[8],X=this.h[9],st=this.h[10],nt=this.h[11],lt=this.h[12],Et=this.h[13],gt=this.h[14],bt=this.h[15];m(this.k.length===C.length);for(var Bt=0;Bt<C.length;Bt+=2){var Mt=gt,It=bt,J=(A=void 0,(A=S(o=z,s=X,14)^S(o,s,18)^S(s,o,9))<0&&(A+=4294967296),A),tt=ot(z,X),F=B(z,0,st,0,lt),H=P(0,X,0,nt,0,Et),U=this.k[Bt],it=this.k[Bt+1],pt=C[Bt],ft=C[Bt+1],mt=w(Mt,It,J,tt,F,H,U,it,pt,ft),re=b(Mt,It,J,tt,F,H,U,it,pt,ft);Mt=et(j,T),It=Q(j,T),J=N(j,0,R,0,Z),tt=$(0,T,0,q,0,rt);var _t=f(Mt,It,J,tt),At=g(Mt,It,J,tt);gt=lt,bt=Et,lt=st,Et=nt,st=z,nt=X,z=f(D,G,mt,re),X=g(G,G,mt,re),D=Z,G=rt,Z=R,rt=q,R=j,q=T,j=f(mt,re,_t,At),T=g(mt,re,_t,At)}l(this.h,0,j,T),l(this.h,2,R,q),l(this.h,4,Z,rt),l(this.h,6,D,G),l(this.h,8,z,X),l(this.h,10,st,nt),l(this.h,12,lt,Et),l(this.h,14,gt,bt)},M.prototype._digest=function(i){return i==="hex"?x.toHex32(this.h,"big"):x.split32(this.h,"big")}},7038:(W,_,y)=>{var x=y(6436).rotr32;function v(a,p,c){return a&p^~a&c}function m(a,p,c){return a&p^a&c^p&c}function S(a,p,c){return a^p^c}_.ft_1=function(a,p,c,l){return a===0?v(p,c,l):a===1||a===3?S(p,c,l):a===2?m(p,c,l):void 0},_.ch32=v,_.maj32=m,_.p32=S,_.s0_256=function(a){return x(a,2)^x(a,13)^x(a,22)},_.s1_256=function(a){return x(a,6)^x(a,11)^x(a,25)},_.g0_256=function(a){return x(a,7)^x(a,18)^a>>>3},_.g1_256=function(a){return x(a,17)^x(a,19)^a>>>10}},6436:(W,_,y)=>{var x=y(9746),v=y(5717);function m(c,l){return(64512&c.charCodeAt(l))==55296&&!(l<0||l+1>=c.length)&&(64512&c.charCodeAt(l+1))==56320}function S(c){return(c>>>24|c>>>8&65280|c<<8&16711680|(255&c)<<24)>>>0}function a(c){return c.length===1?"0"+c:c}function p(c){return c.length===7?"0"+c:c.length===6?"00"+c:c.length===5?"000"+c:c.length===4?"0000"+c:c.length===3?"00000"+c:c.length===2?"000000"+c:c.length===1?"0000000"+c:c}_.inherits=v,_.toArray=function(c,l){if(Array.isArray(c))return c.slice();if(!c)return[];var f=[];if(typeof c=="string")if(l){if(l==="hex")for((c=c.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(c="0"+c),h=0;h<c.length;h+=2)f.push(parseInt(c[h]+c[h+1],16))}else for(var g=0,h=0;h<c.length;h++){var u=c.charCodeAt(h);u<128?f[g++]=u:u<2048?(f[g++]=u>>6|192,f[g++]=63&u|128):m(c,h)?(u=65536+((1023&u)<<10)+(1023&c.charCodeAt(++h)),f[g++]=u>>18|240,f[g++]=u>>12&63|128,f[g++]=u>>6&63|128,f[g++]=63&u|128):(f[g++]=u>>12|224,f[g++]=u>>6&63|128,f[g++]=63&u|128)}else for(h=0;h<c.length;h++)f[h]=0|c[h];return f},_.toHex=function(c){for(var l="",f=0;f<c.length;f++)l+=a(c[f].toString(16));return l},_.htonl=S,_.toHex32=function(c,l){for(var f="",g=0;g<c.length;g++){var h=c[g];l==="little"&&(h=S(h)),f+=p(h.toString(16))}return f},_.zero2=a,_.zero8=p,_.join32=function(c,l,f,g){var h=f-l;x(h%4==0);for(var u=new Array(h/4),w=0,b=l;w<u.length;w++,b+=4){var E;E=g==="big"?c[b]<<24|c[b+1]<<16|c[b+2]<<8|c[b+3]:c[b+3]<<24|c[b+2]<<16|c[b+1]<<8|c[b],u[w]=E>>>0}return u},_.split32=function(c,l){for(var f=new Array(4*c.length),g=0,h=0;g<c.length;g++,h+=4){var u=c[g];l==="big"?(f[h]=u>>>24,f[h+1]=u>>>16&255,f[h+2]=u>>>8&255,f[h+3]=255&u):(f[h+3]=u>>>24,f[h+2]=u>>>16&255,f[h+1]=u>>>8&255,f[h]=255&u)}return f},_.rotr32=function(c,l){return c>>>l|c<<32-l},_.rotl32=function(c,l){return c<<l|c>>>32-l},_.sum32=function(c,l){return c+l>>>0},_.sum32_3=function(c,l,f){return c+l+f>>>0},_.sum32_4=function(c,l,f,g){return c+l+f+g>>>0},_.sum32_5=function(c,l,f,g,h){return c+l+f+g+h>>>0},_.sum64=function(c,l,f,g){var h=c[l],u=g+c[l+1]>>>0,w=(u<g?1:0)+f+h;c[l]=w>>>0,c[l+1]=u},_.sum64_hi=function(c,l,f,g){return(l+g>>>0<l?1:0)+c+f>>>0},_.sum64_lo=function(c,l,f,g){return l+g>>>0},_.sum64_4_hi=function(c,l,f,g,h,u,w,b){var E=0,I=l;return E+=(I=I+g>>>0)<l?1:0,E+=(I=I+u>>>0)<u?1:0,c+f+h+w+(E+=(I=I+b>>>0)<b?1:0)>>>0},_.sum64_4_lo=function(c,l,f,g,h,u,w,b){return l+g+u+b>>>0},_.sum64_5_hi=function(c,l,f,g,h,u,w,b,E,I){var M=0,B=l;return M+=(B=B+g>>>0)<l?1:0,M+=(B=B+u>>>0)<u?1:0,M+=(B=B+b>>>0)<b?1:0,c+f+h+w+E+(M+=(B=B+I>>>0)<I?1:0)>>>0},_.sum64_5_lo=function(c,l,f,g,h,u,w,b,E,I){return l+g+u+b+I>>>0},_.rotr64_hi=function(c,l,f){return(l<<32-f|c>>>f)>>>0},_.rotr64_lo=function(c,l,f){return(c<<32-f|l>>>f)>>>0},_.shr64_hi=function(c,l,f){return c>>>f},_.shr64_lo=function(c,l,f){return(c<<32-f|l>>>f)>>>0}},2156:(W,_,y)=>{var x=y(3715),v=y(4504),m=y(9746);function S(a){if(!(this instanceof S))return new S(a);this.hash=a.hash,this.predResist=!!a.predResist,this.outLen=this.hash.outSize,this.minEntropy=a.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var p=v.toArray(a.entropy,a.entropyEnc||"hex"),c=v.toArray(a.nonce,a.nonceEnc||"hex"),l=v.toArray(a.pers,a.persEnc||"hex");m(p.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(p,c,l)}W.exports=S,S.prototype._init=function(a,p,c){var l=a.concat(p).concat(c);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(l),this._reseed=1,this.reseedInterval=281474976710656},S.prototype._hmac=function(){return new x.hmac(this.hash,this.K)},S.prototype._update=function(a){var p=this._hmac().update(this.V).update([0]);a&&(p=p.update(a)),this.K=p.digest(),this.V=this._hmac().update(this.V).digest(),a&&(this.K=this._hmac().update(this.V).update([1]).update(a).digest(),this.V=this._hmac().update(this.V).digest())},S.prototype.reseed=function(a,p,c,l){typeof p!="string"&&(l=c,c=p,p=null),a=v.toArray(a,p),c=v.toArray(c,l),m(a.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(a.concat(c||[])),this._reseed=1},S.prototype.generate=function(a,p,c,l){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof p!="string"&&(l=c,c=p,p=null),c&&(c=v.toArray(c,l||"hex"),this._update(c));for(var f=[];f.length<a;)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var g=f.slice(0,a);return this._update(c),this._reseed++,v.encode(g,p)}},9267:(W,_,y)=>{var x=y(8501),v=y(8575),m=W.exports;for(var S in x)x.hasOwnProperty(S)&&(m[S]=x[S]);function a(p){if(typeof p=="string"&&(p=v.parse(p)),p.protocol||(p.protocol="https:"),p.protocol!=="https:")throw new Error('Protocol "'+p.protocol+'" not supported. Expected "https:"');return p}m.request=function(p,c){return p=a(p),x.request.call(this,p,c)},m.get=function(p,c){return p=a(p),x.get.call(this,p,c)}},645:(W,_)=>{_.read=function(y,x,v,m,S){var a,p,c=8*S-m-1,l=(1<<c)-1,f=l>>1,g=-7,h=v?S-1:0,u=v?-1:1,w=y[x+h];for(h+=u,a=w&(1<<-g)-1,w>>=-g,g+=c;g>0;a=256*a+y[x+h],h+=u,g-=8);for(p=a&(1<<-g)-1,a>>=-g,g+=m;g>0;p=256*p+y[x+h],h+=u,g-=8);if(a===0)a=1-f;else{if(a===l)return p?NaN:1/0*(w?-1:1);p+=Math.pow(2,m),a-=f}return(w?-1:1)*p*Math.pow(2,a-m)},_.write=function(y,x,v,m,S,a){var p,c,l,f=8*a-S-1,g=(1<<f)-1,h=g>>1,u=S===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=m?0:a-1,b=m?1:-1,E=x<0||x===0&&1/x<0?1:0;for(x=Math.abs(x),isNaN(x)||x===1/0?(c=isNaN(x)?1:0,p=g):(p=Math.floor(Math.log(x)/Math.LN2),x*(l=Math.pow(2,-p))<1&&(p--,l*=2),(x+=p+h>=1?u/l:u*Math.pow(2,1-h))*l>=2&&(p++,l/=2),p+h>=g?(c=0,p=g):p+h>=1?(c=(x*l-1)*Math.pow(2,S),p+=h):(c=x*Math.pow(2,h-1)*Math.pow(2,S),p=0));S>=8;y[v+w]=255&c,w+=b,c/=256,S-=8);for(p=p<<S|c,f+=S;f>0;y[v+w]=255&p,w+=b,p/=256,f-=8);y[v+w-b]|=128*E}},5717:W=>{typeof Object.create=="function"?W.exports=function(_,y){y&&(_.super_=y,_.prototype=Object.create(y.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}))}:W.exports=function(_,y){if(y){_.super_=y;var x=function(){};x.prototype=y.prototype,_.prototype=new x,_.prototype.constructor=_}}},6512:function(W){(function(_){const y="(0?\\d+|0x[a-f0-9]+)",x={fourOctet:new RegExp(`^${y}\\.${y}\\.${y}\\.${y}$`,"i"),threeOctet:new RegExp(`^${y}\\.${y}\\.${y}$`,"i"),twoOctet:new RegExp(`^${y}\\.${y}$`,"i"),longValue:new RegExp(`^${y}$`,"i")},v=new RegExp("^0[0-7]+$","i"),m=new RegExp("^0x[a-f0-9]+$","i"),S="%[0-9a-z]{1,}",a="(?:[0-9a-f]+::?)+",p={zoneIndex:new RegExp(S,"i"),native:new RegExp(`^(::)?(${a})?([0-9a-f]+)?(::)?(${S})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${y}\\.${y}\\.${y}\\.${y}(${S})?)$`,"i"),transitional:new RegExp(`^((?:${a})|(?:::)(?:${a})?)${y}\\.${y}\\.${y}\\.${y}(${S})?$`,"i")};function c(u,w){if(u.indexOf("::")!==u.lastIndexOf("::"))return null;let b,E,I=0,M=-1,B=(u.match(p.zoneIndex)||[])[0];for(B&&(B=B.substring(1),u=u.replace(/%.+$/,""));(M=u.indexOf(":",M+1))>=0;)I++;if(u.substr(0,2)==="::"&&I--,u.substr(-2,2)==="::"&&I--,I>w)return null;for(E=w-I,b=":";E--;)b+="0:";return(u=u.replace("::",b))[0]===":"&&(u=u.slice(1)),u[u.length-1]===":"&&(u=u.slice(0,-1)),{parts:w=function(){const P=u.split(":"),N=[];for(let $=0;$<P.length;$++)N.push(parseInt(P[$],16));return N}(),zoneId:B}}function l(u,w,b,E){if(u.length!==w.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let I,M=0;for(;E>0;){if(I=b-E,I<0&&(I=0),u[M]>>I!=w[M]>>I)return!1;E-=b,M+=1}return!0}function f(u){if(m.test(u))return parseInt(u,16);if(u[0]==="0"&&!isNaN(parseInt(u[1],10))){if(v.test(u))return parseInt(u,8);throw new Error(`ipaddr: cannot parse ${u} as octal`)}return parseInt(u,10)}function g(u,w){for(;u.length<w;)u=`0${u}`;return u}const h={};h.IPv4=function(){function u(w){if(w.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let b,E;for(b=0;b<w.length;b++)if(E=w[b],!(0<=E&&E<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=w}return u.prototype.SpecialRanges={unspecified:[[new u([0,0,0,0]),8]],broadcast:[[new u([255,255,255,255]),32]],multicast:[[new u([224,0,0,0]),4]],linkLocal:[[new u([169,254,0,0]),16]],loopback:[[new u([127,0,0,0]),8]],carrierGradeNat:[[new u([100,64,0,0]),10]],private:[[new u([10,0,0,0]),8],[new u([172,16,0,0]),12],[new u([192,168,0,0]),16]],reserved:[[new u([192,0,0,0]),24],[new u([192,0,2,0]),24],[new u([192,88,99,0]),24],[new u([198,51,100,0]),24],[new u([203,0,113,0]),24],[new u([240,0,0,0]),4]]},u.prototype.kind=function(){return"ipv4"},u.prototype.match=function(w,b){let E;if(b===void 0&&(E=w,w=E[0],b=E[1]),w.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return l(this.octets,w.octets,8,b)},u.prototype.prefixLengthFromSubnetMask=function(){let w=0,b=!1;const E={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let I,M,B;for(I=3;I>=0;I-=1){if(M=this.octets[I],!(M in E)||(B=E[M],b&&B!==0))return null;B!==8&&(b=!0),w+=B}return 32-w},u.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){return this.octets.slice(0)},u.prototype.toIPv4MappedAddress=function(){return h.IPv6.parse(`::ffff:${this.toString()}`)},u.prototype.toNormalizedString=function(){return this.toString()},u.prototype.toString=function(){return this.octets.join(".")},u}(),h.IPv4.broadcastAddressFromCIDR=function(u){try{const w=this.parseCIDR(u),b=w[0].toByteArray(),E=this.subnetMaskFromPrefixLength(w[1]).toByteArray(),I=[];let M=0;for(;M<4;)I.push(parseInt(b[M],10)|255^parseInt(E[M],10)),M++;return new this(I)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.isIPv4=function(u){return this.parser(u)!==null},h.IPv4.isValid=function(u){try{return new this(this.parser(u)),!0}catch{return!1}},h.IPv4.isValidFourPartDecimal=function(u){return!(!h.IPv4.isValid(u)||!u.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},h.IPv4.networkAddressFromCIDR=function(u){let w,b,E,I,M;try{for(w=this.parseCIDR(u),E=w[0].toByteArray(),M=this.subnetMaskFromPrefixLength(w[1]).toByteArray(),I=[],b=0;b<4;)I.push(parseInt(E[b],10)&parseInt(M[b],10)),b++;return new this(I)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},h.IPv4.parse=function(u){const w=this.parser(u);if(w===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(w)},h.IPv4.parseCIDR=function(u){let w;if(w=u.match(/^(.+)\/(\d+)$/)){const b=parseInt(w[2]);if(b>=0&&b<=32){const E=[this.parse(w[1]),b];return Object.defineProperty(E,"toString",{value:function(){return this.join("/")}}),E}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},h.IPv4.parser=function(u){let w,b,E;if(w=u.match(x.fourOctet))return function(){const I=w.slice(1,6),M=[];for(let B=0;B<I.length;B++)b=I[B],M.push(f(b));return M}();if(w=u.match(x.longValue)){if(E=f(w[1]),E>4294967295||E<0)throw new Error("ipaddr: address outside defined range");return function(){const I=[];let M;for(M=0;M<=24;M+=8)I.push(E>>M&255);return I}().reverse()}return(w=u.match(x.twoOctet))?function(){const I=w.slice(1,4),M=[];if(E=f(I[1]),E>16777215||E<0)throw new Error("ipaddr: address outside defined range");return M.push(f(I[0])),M.push(E>>16&255),M.push(E>>8&255),M.push(255&E),M}():(w=u.match(x.threeOctet))?function(){const I=w.slice(1,5),M=[];if(E=f(I[2]),E>65535||E<0)throw new Error("ipaddr: address outside defined range");return M.push(f(I[0])),M.push(f(I[1])),M.push(E>>8&255),M.push(255&E),M}():null},h.IPv4.subnetMaskFromPrefixLength=function(u){if((u=parseInt(u))<0||u>32)throw new Error("ipaddr: invalid IPv4 prefix length");const w=[0,0,0,0];let b=0;const E=Math.floor(u/8);for(;b<E;)w[b]=255,b++;return E<4&&(w[E]=Math.pow(2,u%8)-1<<8-u%8),new this(w)},h.IPv6=function(){function u(w,b){let E,I;if(w.length===16)for(this.parts=[],E=0;E<=14;E+=2)this.parts.push(w[E]<<8|w[E+1]);else{if(w.length!==8)throw new Error("ipaddr: ipv6 part count should be 8 or 16");this.parts=w}for(E=0;E<this.parts.length;E++)if(I=this.parts[E],!(0<=I&&I<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");b&&(this.zoneId=b)}return u.prototype.SpecialRanges={unspecified:[new u([0,0,0,0,0,0,0,0]),128],linkLocal:[new u([65152,0,0,0,0,0,0,0]),10],multicast:[new u([65280,0,0,0,0,0,0,0]),8],loopback:[new u([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new u([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new u([0,0,0,0,0,65535,0,0]),96],rfc6145:[new u([0,0,0,0,65535,0,0,0]),96],rfc6052:[new u([100,65435,0,0,0,0,0,0]),96],"6to4":[new u([8194,0,0,0,0,0,0,0]),16],teredo:[new u([8193,0,0,0,0,0,0,0]),32],reserved:[[new u([8193,3512,0,0,0,0,0,0]),32]]},u.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},u.prototype.kind=function(){return"ipv6"},u.prototype.match=function(w,b){let E;if(b===void 0&&(E=w,w=E[0],b=E[1]),w.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return l(this.parts,w.parts,16,b)},u.prototype.prefixLengthFromSubnetMask=function(){let w=0,b=!1;const E={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let I,M;for(let B=7;B>=0;B-=1){if(I=this.parts[B],!(I in E)||(M=E[I],b&&M!==0))return null;M!==16&&(b=!0),w+=M}return 128-w},u.prototype.range=function(){return h.subnetMatch(this,this.SpecialRanges)},u.prototype.toByteArray=function(){let w;const b=[],E=this.parts;for(let I=0;I<E.length;I++)w=E[I],b.push(w>>8),b.push(255&w);return b},u.prototype.toFixedLengthString=function(){const w=(function(){const E=[];for(let I=0;I<this.parts.length;I++)E.push(g(this.parts[I].toString(16),4));return E}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),w+b},u.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const w=this.parts.slice(-2),b=w[0],E=w[1];return new h.IPv4([b>>8,255&b,E>>8,255&E])},u.prototype.toNormalizedString=function(){const w=(function(){const E=[];for(let I=0;I<this.parts.length;I++)E.push(this.parts[I].toString(16));return E}).call(this).join(":");let b="";return this.zoneId&&(b=`%${this.zoneId}`),w+b},u.prototype.toRFC5952String=function(){const w=/((^|:)(0(:|$)){2,})/g,b=this.toNormalizedString();let E,I=0,M=-1;for(;E=w.exec(b);)E[0].length>M&&(I=E.index,M=E[0].length);return M<0?b:`${b.substring(0,I)}::${b.substring(I+M)}`},u.prototype.toString=function(){return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/,"::")},u}(),h.IPv6.broadcastAddressFromCIDR=function(u){try{const w=this.parseCIDR(u),b=w[0].toByteArray(),E=this.subnetMaskFromPrefixLength(w[1]).toByteArray(),I=[];let M=0;for(;M<16;)I.push(parseInt(b[M],10)|255^parseInt(E[M],10)),M++;return new this(I)}catch(w){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${w})`)}},h.IPv6.isIPv6=function(u){return this.parser(u)!==null},h.IPv6.isValid=function(u){if(typeof u=="string"&&u.indexOf(":")===-1)return!1;try{const w=this.parser(u);return new this(w.parts,w.zoneId),!0}catch{return!1}},h.IPv6.networkAddressFromCIDR=function(u){let w,b,E,I,M;try{for(w=this.parseCIDR(u),E=w[0].toByteArray(),M=this.subnetMaskFromPrefixLength(w[1]).toByteArray(),I=[],b=0;b<16;)I.push(parseInt(E[b],10)&parseInt(M[b],10)),b++;return new this(I)}catch(B){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${B})`)}},h.IPv6.parse=function(u){const w=this.parser(u);if(w.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(w.parts,w.zoneId)},h.IPv6.parseCIDR=function(u){let w,b,E;if((b=u.match(/^(.+)\/(\d+)$/))&&(w=parseInt(b[2]),w>=0&&w<=128))return E=[this.parse(b[1]),w],Object.defineProperty(E,"toString",{value:function(){return this.join("/")}}),E;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},h.IPv6.parser=function(u){let w,b,E,I,M,B;if(E=u.match(p.deprecatedTransitional))return this.parser(`::ffff:${E[1]}`);if(p.native.test(u))return c(u,8);if((E=u.match(p.transitional))&&(B=E[6]||"",w=c(E[1].slice(0,-1)+B,6),w.parts)){for(M=[parseInt(E[2]),parseInt(E[3]),parseInt(E[4]),parseInt(E[5])],b=0;b<M.length;b++)if(I=M[b],!(0<=I&&I<=255))return null;return w.parts.push(M[0]<<8|M[1]),w.parts.push(M[2]<<8|M[3]),{parts:w.parts,zoneId:w.zoneId}}return null},h.IPv6.subnetMaskFromPrefixLength=function(u){if((u=parseInt(u))<0||u>128)throw new Error("ipaddr: invalid IPv6 prefix length");const w=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let b=0;const E=Math.floor(u/8);for(;b<E;)w[b]=255,b++;return E<16&&(w[E]=Math.pow(2,u%8)-1<<8-u%8),new this(w)},h.fromByteArray=function(u){const w=u.length;if(w===4)return new h.IPv4(u);if(w===16)return new h.IPv6(u);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},h.isValid=function(u){return h.IPv6.isValid(u)||h.IPv4.isValid(u)},h.parse=function(u){if(h.IPv6.isValid(u))return h.IPv6.parse(u);if(h.IPv4.isValid(u))return h.IPv4.parse(u);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},h.parseCIDR=function(u){try{return h.IPv6.parseCIDR(u)}catch{try{return h.IPv4.parseCIDR(u)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},h.process=function(u){const w=this.parse(u);return w.kind()==="ipv6"&&w.isIPv4MappedAddress()?w.toIPv4Address():w},h.subnetMatch=function(u,w,b){let E,I,M,B;for(I in b==null&&(b="unicast"),w)if(Object.prototype.hasOwnProperty.call(w,I)){for(M=w[I],!M[0]||M[0]instanceof Array||(M=[M]),E=0;E<M.length;E++)if(B=M[E],u.kind()===B[0].kind()&&u.match.apply(u,B))return I}return b},W.exports?W.exports=h:_.ipaddr=h})(this)},2584:(W,_,y)=>{var x=y(6410)(),v=y(1924)("Object.prototype.toString"),m=function(p){return!(x&&p&&typeof p=="object"&&Symbol.toStringTag in p)&&v(p)==="[object Arguments]"},S=function(p){return!!m(p)||p!==null&&typeof p=="object"&&typeof p.length=="number"&&p.length>=0&&v(p)!=="[object Array]"&&v(p.callee)==="[object Function]"},a=function(){return m(arguments)}();m.isLegacyArguments=S,W.exports=a?m:S},5320:W=>{var _,y,x=Function.prototype.toString,v=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply;if(typeof v=="function"&&typeof Object.defineProperty=="function")try{_=Object.defineProperty({},"length",{get:function(){throw y}}),y={},v(function(){throw 42},null,_)}catch(h){h!==y&&(v=null)}else v=null;var m=/^\s*class\b/,S=function(h){try{var u=x.call(h);return m.test(u)}catch{return!1}},a=function(h){try{return!S(h)&&(x.call(h),!0)}catch{return!1}},p=Object.prototype.toString,c=typeof Symbol=="function"&&!!Symbol.toStringTag,l=!(0 in[,]),f=function(){return!1};if(typeof document=="object"){var g=document.all;p.call(g)===p.call(document.all)&&(f=function(h){if((l||!h)&&(h===void 0||typeof h=="object"))try{var u=p.call(h);return(u==="[object HTMLAllCollection]"||u==="[object HTML document.all class]"||u==="[object HTMLCollection]"||u==="[object Object]")&&h("")==null}catch{}return!1})}W.exports=v?function(h){if(f(h))return!0;if(!h||typeof h!="function"&&typeof h!="object")return!1;try{v(h,null,_)}catch(u){if(u!==y)return!1}return!S(h)&&a(h)}:function(h){if(f(h))return!0;if(!h||typeof h!="function"&&typeof h!="object")return!1;if(c)return a(h);if(S(h))return!1;var u=p.call(h);return!(u!=="[object Function]"&&u!=="[object GeneratorFunction]"&&!/^\[object HTML/.test(u))&&a(h)}},8662:(W,_,y)=>{var x,v=Object.prototype.toString,m=Function.prototype.toString,S=/^\s*(?:function)?\*/,a=y(6410)(),p=Object.getPrototypeOf;W.exports=function(c){if(typeof c!="function")return!1;if(S.test(m.call(c)))return!0;if(!a)return v.call(c)==="[object GeneratorFunction]";if(!p)return!1;if(x===void 0){var l=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch{}}();x=!!l&&p(l)}return p(c)===x}},8611:W=>{W.exports=function(_){return _!=_}},360:(W,_,y)=>{var x=y(5559),v=y(4289),m=y(8611),S=y(9415),a=y(3194),p=x(S(),Number);v(p,{getPolyfill:S,implementation:m,shim:a}),W.exports=p},9415:(W,_,y)=>{var x=y(8611);W.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:x}},3194:(W,_,y)=>{var x=y(4289),v=y(9415);W.exports=function(){var m=v();return x(Number,{isNaN:m},{isNaN:function(){return Number.isNaN!==m}}),m}},5692:(W,_,y)=>{var x=y(4029),v=y(3083),m=y(1924),S=m("Object.prototype.toString"),a=y(6410)(),p=y(7296),c=typeof globalThis>"u"?y.g:globalThis,l=v(),f=m("Array.prototype.indexOf",!0)||function(w,b){for(var E=0;E<w.length;E+=1)if(w[E]===b)return E;return-1},g=m("String.prototype.slice"),h={},u=Object.getPrototypeOf;a&&p&&u&&x(l,function(w){var b=new c[w];if(Symbol.toStringTag in b){var E=u(b),I=p(E,Symbol.toStringTag);if(!I){var M=u(E);I=p(M,Symbol.toStringTag)}h[w]=I.get}}),W.exports=function(w){if(!w||typeof w!="object")return!1;if(!a||!(Symbol.toStringTag in w)){var b=g(S(w),8,-1);return f(l,b)>-1}return!!p&&function(E){var I=!1;return x(h,function(M,B){if(!I)try{I=M.call(E)===B}catch{}}),I}(w)}},6650:(W,_,y)=>{var x=y(8764).Buffer,v=y(9539),m=y(2830).Transform;W.exports=function(a){return new S(a)};var S=W.exports.JSONStream=function(a){a=a||{},m.call(this,a),this._writableState.objectMode=!1,this._readableState.objectMode=!0,this._async=a.async||!1};v.inherits(S,m),S.prototype._transform=function(a,p,c){x.isBuffer(a)||(a=new x(a)),this._buffer&&(a=x.concat([this._buffer,a]));for(var l=0,f=0;++l<=a.length;)if(a[l]===10||l===a.length){var g;try{g=JSON.parse(a.slice(f,l))}catch{}g&&(this.push(g),g=null),a[l]===10&&(f=++l)}return this._buffer=a.slice(f),this._async?void setImmediate(c):void c()}},6486:function(W,_,y){var x;W=y.nmd(W),(function(){var v,m=200,S="Expected a function",a="__lodash_hash_undefined__",p="__lodash_placeholder__",c=1,l=2,f=4,g=1,h=2,u=1,w=2,b=4,E=8,I=16,M=32,B=64,P=128,N=256,$=512,et=800,Q=16,ot=1/0,t=9007199254740991,n=17976931348623157e292,r=NaN,i=4294967295,e=i-1,o=i>>>1,s=[["ary",P],["bind",u],["bindKey",w],["curry",E],["curryRight",I],["flip",$],["partial",M],["partialRight",B],["rearg",N]],A="[object Arguments]",C="[object Array]",j="[object AsyncFunction]",T="[object Boolean]",R="[object Date]",q="[object DOMException]",Z="[object Error]",rt="[object Function]",D="[object GeneratorFunction]",G="[object Map]",z="[object Number]",X="[object Null]",st="[object Object]",nt="[object Promise]",lt="[object Proxy]",Et="[object RegExp]",gt="[object Set]",bt="[object String]",Bt="[object Symbol]",Mt="[object Undefined]",It="[object WeakMap]",J="[object ArrayBuffer]",tt="[object DataView]",F="[object Float32Array]",H="[object Float64Array]",U="[object Int8Array]",it="[object Int16Array]",pt="[object Int32Array]",ft="[object Uint8Array]",mt="[object Uint8ClampedArray]",re="[object Uint16Array]",_t="[object Uint32Array]",At=/\b__p \+= '';/g,fe=/\b(__p \+=) '' \+/g,kt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Kt=/&(?:amp|lt|gt|quot|#39);/g,Ce=/[&<>"']/g,Pt=RegExp(Kt.source),Ht=RegExp(Ce.source),je=/<%-([\s\S]+?)%>/g,Rt=/<%([\s\S]+?)%>/g,Wt=/<%=([\s\S]+?)%>/g,ye=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Nt=/^\w*$/,Xt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ke=/[\\^$.*+?()[\]{}|]/g,jt=RegExp(ke.source),Zt=/^\s+/,Oe=/\s/,Dt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Jt=/\{\n\/\* \[wrapped with (.+)\] \*/,De=/,? & /,Lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Qt=/[()=,{}\[\]\/\s]/,ze=/\\(\\)?/g,Ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Yt=/\w*$/,$e=/^[-+]0x[0-9a-f]+$/i,qt=/^0b[01]+$/i,ee=/^\[object .+?Constructor\]$/,He=/^0o[0-7]+$/i,Ft=/^(?:0|[1-9]\d*)$/,te=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ae=/($^)/,Re=/['\n\r\u2028\u2029\\]/g,Ke="\\ud800-\\udfff",ai="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ri="\\u2700-\\u27bf",si="a-z\\xdf-\\xf6\\xf8-\\xff",ui="A-Z\\xc0-\\xd6\\xd8-\\xde",ci="\\ufe0e\\ufe0f",li="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",hi="["+Ke+"]",fi="["+li+"]",Je="["+ai+"]",pi="\\d+",gi="["+ri+"]",ei="["+si+"]",ii="[^"+Ke+li+pi+ri+si+ui+"]",Ye="\\ud83c[\\udffb-\\udfff]",di="[^"+Ke+"]",ni="(?:\\ud83c[\\udde6-\\uddff]){2}",cr="[\\ud800-\\udbff][\\udc00-\\udfff]",er="["+ui+"]",Ln="\\u200d",Dn="(?:"+ei+"|"+ii+")",So="(?:"+er+"|"+ii+")",Un="(?:['’](?:d|ll|m|re|s|t|ve))?",Hr="(?:['’](?:D|LL|M|RE|S|T|VE))?",qn="(?:"+Je+"|"+Ye+")?",Fn="["+ci+"]?",Eo=Fn+qn+"(?:"+Ln+"(?:"+[di,ni,cr].join("|")+")"+Fn+qn+")*",xt="(?:"+[gi,ni,cr].join("|")+")"+Eo,vt="(?:"+[di+Je+"?",Je,ni,cr,hi].join("|")+")",wt=RegExp("['’]","g"),Tt=RegExp(Je,"g"),Vt=RegExp(Ye+"(?="+Ye+")|"+vt+Eo,"g"),zt=RegExp([er+"?"+ei+"+"+Un+"(?="+[fi,er,"$"].join("|")+")",So+"+"+Hr+"(?="+[fi,er+Dn,"$"].join("|")+")",er+"?"+Dn+"+"+Un,er+"+"+Hr,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",pi,xt].join("|"),"g"),Gt=RegExp("["+Ln+Ke+ai+ci+"]"),ie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ce=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],xe=-1,Se={};Se[F]=Se[H]=Se[U]=Se[it]=Se[pt]=Se[ft]=Se[mt]=Se[re]=Se[_t]=!0,Se[A]=Se[C]=Se[J]=Se[T]=Se[tt]=Se[R]=Se[Z]=Se[rt]=Se[G]=Se[z]=Se[st]=Se[Et]=Se[gt]=Se[bt]=Se[It]=!1;var ge={};ge[A]=ge[C]=ge[J]=ge[tt]=ge[T]=ge[R]=ge[F]=ge[H]=ge[U]=ge[it]=ge[pt]=ge[G]=ge[z]=ge[st]=ge[Et]=ge[gt]=ge[bt]=ge[Bt]=ge[ft]=ge[mt]=ge[re]=ge[_t]=!0,ge[Z]=ge[rt]=ge[It]=!1;var Ze={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ge=parseFloat,Hi=parseInt,be=typeof y.g=="object"&&y.g&&y.g.Object===Object&&y.g,we=typeof self=="object"&&self&&self.Object===Object&&self,de=be||we||Function("return this")(),Te=_&&!_.nodeType&&_,mi=Te&&W&&!W.nodeType&&W,ki=mi&&mi.exports===Te,Oi=ki&&be.process,wi=function(){try{return mi&&mi.require&&mi.require("util").types||Oi&&Oi.binding&&Oi.binding("util")}catch{}}(),wr=wi&&wi.isArrayBuffer,Wi=wi&&wi.isDate,Or=wi&&wi.isMap,Vc=wi&&wi.isRegExp,Xc=wi&&wi.isSet,Zc=wi&&wi.isTypedArray;function ir($t,ae,ue){switch(ue.length){case 0:return $t.call(ae);case 1:return $t.call(ae,ue[0]);case 2:return $t.call(ae,ue[0],ue[1]);case 3:return $t.call(ae,ue[0],ue[1],ue[2])}return $t.apply(ae,ue)}function Id($t,ae,ue,me){for(var qe=-1,oi=$t==null?0:$t.length;++qe<oi;){var ji=$t[qe];ae(me,ji,ue(ji),$t)}return me}function lr($t,ae){for(var ue=-1,me=$t==null?0:$t.length;++ue<me&&ae($t[ue],ue,$t)!==!1;);return $t}function Od($t,ae){for(var ue=$t==null?0:$t.length;ue--&&ae($t[ue],ue,$t)!==!1;);return $t}function Kc($t,ae){for(var ue=-1,me=$t==null?0:$t.length;++ue<me;)if(!ae($t[ue],ue,$t))return!1;return!0}function Wr($t,ae){for(var ue=-1,me=$t==null?0:$t.length,qe=0,oi=[];++ue<me;){var ji=$t[ue];ae(ji,ue,$t)&&(oi[qe++]=ji)}return oi}function ko($t,ae){return!($t==null||!$t.length)&&Mn($t,ae,0)>-1}function hs($t,ae,ue){for(var me=-1,qe=$t==null?0:$t.length;++me<qe;)if(ue(ae,$t[me]))return!0;return!1}function Si($t,ae){for(var ue=-1,me=$t==null?0:$t.length,qe=Array(me);++ue<me;)qe[ue]=ae($t[ue],ue,$t);return qe}function Vr($t,ae){for(var ue=-1,me=ae.length,qe=$t.length;++ue<me;)$t[qe+ue]=ae[ue];return $t}function fs($t,ae,ue,me){var qe=-1,oi=$t==null?0:$t.length;for(me&&oi&&(ue=$t[++qe]);++qe<oi;)ue=ae(ue,$t[qe],qe,$t);return ue}function Ad($t,ae,ue,me){var qe=$t==null?0:$t.length;for(me&&qe&&(ue=$t[--qe]);qe--;)ue=ae(ue,$t[qe],qe,$t);return ue}function ps($t,ae){for(var ue=-1,me=$t==null?0:$t.length;++ue<me;)if(ae($t[ue],ue,$t))return!0;return!1}var Td=ds("length");function Jc($t,ae,ue){var me;return ue($t,function(qe,oi,ji){if(ae(qe,oi,ji))return me=oi,!1}),me}function Io($t,ae,ue,me){for(var qe=$t.length,oi=ue+(me?1:-1);me?oi--:++oi<qe;)if(ae($t[oi],oi,$t))return oi;return-1}function Mn($t,ae,ue){return ae==ae?function(me,qe,oi){for(var ji=oi-1,Ar=me.length;++ji<Ar;)if(me[ji]===qe)return ji;return-1}($t,ae,ue):Io($t,Gc,ue)}function Bd($t,ae,ue,me){for(var qe=ue-1,oi=$t.length;++qe<oi;)if(me($t[qe],ae))return qe;return-1}function Gc($t){return $t!=$t}function Yc($t,ae){var ue=$t==null?0:$t.length;return ue?gs($t,ae)/ue:r}function ds($t){return function(ae){return ae==null?v:ae[$t]}}function ms($t){return function(ae){return $t==null?v:$t[ae]}}function Qc($t,ae,ue,me,qe){return qe($t,function(oi,ji,Ar){ue=me?(me=!1,oi):ae(ue,oi,ji,Ar)}),ue}function gs($t,ae){for(var ue,me=-1,qe=$t.length;++me<qe;){var oi=ae($t[me]);oi!==v&&(ue=ue===v?oi:ue+oi)}return ue}function vs($t,ae){for(var ue=-1,me=Array($t);++ue<$t;)me[ue]=ae(ue);return me}function tl($t){return $t&&$t.slice(0,nl($t)+1).replace(Zt,"")}function rr($t){return function(ae){return $t(ae)}}function ys($t,ae){return Si(ae,function(ue){return $t[ue]})}function zn($t,ae){return $t.has(ae)}function el($t,ae){for(var ue=-1,me=$t.length;++ue<me&&Mn(ae,$t[ue],0)>-1;);return ue}function il($t,ae){for(var ue=$t.length;ue--&&Mn(ae,$t[ue],0)>-1;);return ue}var jd=ms({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Rd=ms({"&":"&","<":"<",">":">",'"':""","'":"'"});function Nd($t){return"\\"+Ze[$t]}function xn($t){return Gt.test($t)}function bs($t){var ae=-1,ue=Array($t.size);return $t.forEach(function(me,qe){ue[++ae]=[qe,me]}),ue}function rl($t,ae){return function(ue){return $t(ae(ue))}}function Xr($t,ae){for(var ue=-1,me=$t.length,qe=0,oi=[];++ue<me;){var ji=$t[ue];ji!==ae&&ji!==p||($t[ue]=p,oi[qe++]=ue)}return oi}function Oo($t){var ae=-1,ue=Array($t.size);return $t.forEach(function(me){ue[++ae]=me}),ue}function Cd($t){var ae=-1,ue=Array($t.size);return $t.forEach(function(me){ue[++ae]=[me,me]}),ue}function _n($t){return xn($t)?function(ae){for(var ue=Vt.lastIndex=0;Vt.test(ae);)++ue;return ue}($t):Td($t)}function Mr($t){return xn($t)?function(ae){return ae.match(Vt)||[]}($t):function(ae){return ae.split("")}($t)}function nl($t){for(var ae=$t.length;ae--&&Oe.test($t.charAt(ae)););return ae}var Pd=ms({"&":"&","<":"<",">":">",""":'"',"'":"'"}),Ao=function $t(ae){var ue,me=(ae=ae==null?de:Ao.defaults(de.Object(),ae,Ao.pick(de,ce))).Array,qe=ae.Date,oi=ae.Error,ji=ae.Function,Ar=ae.Math,xi=ae.Object,ws=ae.RegExp,Ld=ae.String,hr=ae.TypeError,To=me.prototype,Dd=ji.prototype,Sn=xi.prototype,Bo=ae["__core-js_shared__"],jo=Dd.toString,bi=Sn.hasOwnProperty,Ud=0,ol=(ue=/[^.]+$/.exec(Bo&&Bo.keys&&Bo.keys.IE_PROTO||""))?"Symbol(src)_1."+ue:"",Ro=Sn.toString,qd=jo.call(xi),Fd=de._,zd=ws("^"+jo.call(bi).replace(ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),No=ki?ae.Buffer:v,Zr=ae.Symbol,Co=ae.Uint8Array,al=No?No.allocUnsafe:v,Po=rl(xi.getPrototypeOf,xi),sl=xi.create,ul=Sn.propertyIsEnumerable,Lo=To.splice,cl=Zr?Zr.isConcatSpreadable:v,$n=Zr?Zr.iterator:v,an=Zr?Zr.toStringTag:v,Do=function(){try{var d=hn(xi,"defineProperty");return d({},"",{}),d}catch{}}(),$d=ae.clearTimeout!==de.clearTimeout&&ae.clearTimeout,Hd=qe&&qe.now!==de.Date.now&&qe.now,Wd=ae.setTimeout!==de.setTimeout&&ae.setTimeout,Uo=Ar.ceil,qo=Ar.floor,Ms=xi.getOwnPropertySymbols,Vd=No?No.isBuffer:v,ll=ae.isFinite,Xd=To.join,Zd=rl(xi.keys,xi),Ri=Ar.max,Ui=Ar.min,Kd=qe.now,Jd=ae.parseInt,hl=Ar.random,Gd=To.reverse,xs=hn(ae,"DataView"),Hn=hn(ae,"Map"),_s=hn(ae,"Promise"),En=hn(ae,"Set"),Wn=hn(ae,"WeakMap"),Vn=hn(xi,"create"),Fo=Wn&&new Wn,kn={},Yd=fn(xs),Qd=fn(Hn),t0=fn(_s),e0=fn(En),i0=fn(Wn),zo=Zr?Zr.prototype:v,Xn=zo?zo.valueOf:v,fl=zo?zo.toString:v;function dt(d){if(Ii(d)&&!We(d)&&!(d instanceof Qe)){if(d instanceof fr)return d;if(bi.call(d,"__wrapped__"))return ph(d)}return new fr(d)}var In=function(){function d(){}return function(k){if(!Ei(k))return{};if(sl)return sl(k);d.prototype=k;var V=new d;return d.prototype=v,V}}();function $o(){}function fr(d,k){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!k,this.__index__=0,this.__values__=v}function Qe(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=i,this.__views__=[]}function sn(d){var k=-1,V=d==null?0:d.length;for(this.clear();++k<V;){var at=d[k];this.set(at[0],at[1])}}function Nr(d){var k=-1,V=d==null?0:d.length;for(this.clear();++k<V;){var at=d[k];this.set(at[0],at[1])}}function Cr(d){var k=-1,V=d==null?0:d.length;for(this.clear();++k<V;){var at=d[k];this.set(at[0],at[1])}}function un(d){var k=-1,V=d==null?0:d.length;for(this.__data__=new Cr;++k<V;)this.add(d[k])}function xr(d){var k=this.__data__=new Nr(d);this.size=k.size}function pl(d,k){var V=We(d),at=!V&&pn(d),ct=!V&&!at&&Qr(d),yt=!V&&!at&&!ct&&Bn(d),St=V||at||ct||yt,Ot=St?vs(d.length,Ld):[],Ct=Ot.length;for(var oe in d)!k&&!bi.call(d,oe)||St&&(oe=="length"||ct&&(oe=="offset"||oe=="parent")||yt&&(oe=="buffer"||oe=="byteLength"||oe=="byteOffset")||Ur(oe,Ct))||Ot.push(oe);return Ot}function dl(d){var k=d.length;return k?d[Ns(0,k-1)]:v}function r0(d,k){return ra(Ki(d),cn(k,0,d.length))}function n0(d){return ra(Ki(d))}function Ss(d,k,V){(V!==v&&!_r(d[k],V)||V===v&&!(k in d))&&Pr(d,k,V)}function Zn(d,k,V){var at=d[k];bi.call(d,k)&&_r(at,V)&&(V!==v||k in d)||Pr(d,k,V)}function Ho(d,k){for(var V=d.length;V--;)if(_r(d[V][0],k))return V;return-1}function o0(d,k,V,at){return Kr(d,function(ct,yt,St){k(at,ct,V(ct),St)}),at}function ml(d,k){return d&&Br(k,Pi(k),d)}function Pr(d,k,V){k=="__proto__"&&Do?Do(d,k,{configurable:!0,enumerable:!0,value:V,writable:!0}):d[k]=V}function Es(d,k){for(var V=-1,at=k.length,ct=me(at),yt=d==null;++V<at;)ct[V]=yt?v:su(d,k[V]);return ct}function cn(d,k,V){return d==d&&(V!==v&&(d=d<=V?d:V),k!==v&&(d=d>=k?d:k)),d}function pr(d,k,V,at,ct,yt){var St,Ot=k&c,Ct=k&l,oe=k&f;if(V&&(St=ct?V(d,at,ct,yt):V(d)),St!==v)return St;if(!Ei(d))return d;var ne=We(d);if(ne){if(St=function(se){var he=se.length,Be=new se.constructor(he);return he&&typeof se[0]=="string"&&bi.call(se,"index")&&(Be.index=se.index,Be.input=se.input),Be}(d),!Ot)return Ki(d,St)}else{var le=qi(d),Me=le==rt||le==D;if(Qr(d))return Ul(d,Ot);if(le==st||le==A||Me&&!ct){if(St=Ct||Me?{}:nh(d),!Ot)return Ct?function(se,he){return Br(se,ih(se),he)}(d,function(se,he){return se&&Br(he,Gi(he),se)}(St,d)):function(se,he){return Br(se,Zs(se),he)}(d,ml(St,d))}else{if(!ge[le])return ct?d:{};St=function(se,he,Be){var pe,Fe=se.constructor;switch(he){case J:return Fs(se);case T:case R:return new Fe(+se);case tt:return function(Ue,vi){var Ee=vi?Fs(Ue.buffer):Ue.buffer;return new Ue.constructor(Ee,Ue.byteOffset,Ue.byteLength)}(se,Be);case F:case H:case U:case it:case pt:case ft:case mt:case re:case _t:return ql(se,Be);case G:return new Fe;case z:case bt:return new Fe(se);case Et:return function(Ue){var vi=new Ue.constructor(Ue.source,Yt.exec(Ue));return vi.lastIndex=Ue.lastIndex,vi}(se);case gt:return new Fe;case Bt:return pe=se,Xn?xi(Xn.call(pe)):{}}}(d,le,Ot)}}yt||(yt=new xr);var _e=yt.get(d);if(_e)return _e;yt.set(d,St),Bh(d)?d.forEach(function(se){St.add(pr(se,k,V,se,d,yt))}):Ah(d)&&d.forEach(function(se,he){St.set(he,pr(se,k,V,he,d,yt))});var Ie=ne?v:(oe?Ct?Ws:Hs:Ct?Gi:Pi)(d);return lr(Ie||d,function(se,he){Ie&&(se=d[he=se]),Zn(St,he,pr(se,k,V,he,d,yt))}),St}function gl(d,k,V){var at=V.length;if(d==null)return!at;for(d=xi(d);at--;){var ct=V[at],yt=k[ct],St=d[ct];if(St===v&&!(ct in d)||!yt(St))return!1}return!0}function vl(d,k,V){if(typeof d!="function")throw new hr(S);return eo(function(){d.apply(v,V)},k)}function Kn(d,k,V,at){var ct=-1,yt=ko,St=!0,Ot=d.length,Ct=[],oe=k.length;if(!Ot)return Ct;V&&(k=Si(k,rr(V))),at?(yt=hs,St=!1):k.length>=m&&(yt=zn,St=!1,k=new un(k));t:for(;++ct<Ot;){var ne=d[ct],le=V==null?ne:V(ne);if(ne=at||ne!==0?ne:0,St&&le==le){for(var Me=oe;Me--;)if(k[Me]===le)continue t;Ct.push(ne)}else yt(k,le,at)||Ct.push(ne)}return Ct}dt.templateSettings={escape:je,evaluate:Rt,interpolate:Wt,variable:"",imports:{_:dt}},dt.prototype=$o.prototype,dt.prototype.constructor=dt,fr.prototype=In($o.prototype),fr.prototype.constructor=fr,Qe.prototype=In($o.prototype),Qe.prototype.constructor=Qe,sn.prototype.clear=function(){this.__data__=Vn?Vn(null):{},this.size=0},sn.prototype.delete=function(d){var k=this.has(d)&&delete this.__data__[d];return this.size-=k?1:0,k},sn.prototype.get=function(d){var k=this.__data__;if(Vn){var V=k[d];return V===a?v:V}return bi.call(k,d)?k[d]:v},sn.prototype.has=function(d){var k=this.__data__;return Vn?k[d]!==v:bi.call(k,d)},sn.prototype.set=function(d,k){var V=this.__data__;return this.size+=this.has(d)?0:1,V[d]=Vn&&k===v?a:k,this},Nr.prototype.clear=function(){this.__data__=[],this.size=0},Nr.prototype.delete=function(d){var k=this.__data__,V=Ho(k,d);return!(V<0||(V==k.length-1?k.pop():Lo.call(k,V,1),--this.size,0))},Nr.prototype.get=function(d){var k=this.__data__,V=Ho(k,d);return V<0?v:k[V][1]},Nr.prototype.has=function(d){return Ho(this.__data__,d)>-1},Nr.prototype.set=function(d,k){var V=this.__data__,at=Ho(V,d);return at<0?(++this.size,V.push([d,k])):V[at][1]=k,this},Cr.prototype.clear=function(){this.size=0,this.__data__={hash:new sn,map:new(Hn||Nr),string:new sn}},Cr.prototype.delete=function(d){var k=ia(this,d).delete(d);return this.size-=k?1:0,k},Cr.prototype.get=function(d){return ia(this,d).get(d)},Cr.prototype.has=function(d){return ia(this,d).has(d)},Cr.prototype.set=function(d,k){var V=ia(this,d),at=V.size;return V.set(d,k),this.size+=V.size==at?0:1,this},un.prototype.add=un.prototype.push=function(d){return this.__data__.set(d,a),this},un.prototype.has=function(d){return this.__data__.has(d)},xr.prototype.clear=function(){this.__data__=new Nr,this.size=0},xr.prototype.delete=function(d){var k=this.__data__,V=k.delete(d);return this.size=k.size,V},xr.prototype.get=function(d){return this.__data__.get(d)},xr.prototype.has=function(d){return this.__data__.has(d)},xr.prototype.set=function(d,k){var V=this.__data__;if(V instanceof Nr){var at=V.__data__;if(!Hn||at.length<m-1)return at.push([d,k]),this.size=++V.size,this;V=this.__data__=new Cr(at)}return V.set(d,k),this.size=V.size,this};var Kr=Hl(Tr),yl=Hl(Is,!0);function a0(d,k){var V=!0;return Kr(d,function(at,ct,yt){return V=!!k(at,ct,yt)}),V}function Wo(d,k,V){for(var at=-1,ct=d.length;++at<ct;){var yt=d[at],St=k(yt);if(St!=null&&(Ot===v?St==St&&!or(St):V(St,Ot)))var Ot=St,Ct=yt}return Ct}function bl(d,k){var V=[];return Kr(d,function(at,ct,yt){k(at,ct,yt)&&V.push(at)}),V}function Di(d,k,V,at,ct){var yt=-1,St=d.length;for(V||(V=v0),ct||(ct=[]);++yt<St;){var Ot=d[yt];k>0&&V(Ot)?k>1?Di(Ot,k-1,V,at,ct):Vr(ct,Ot):at||(ct[ct.length]=Ot)}return ct}var ks=Wl(),wl=Wl(!0);function Tr(d,k){return d&&ks(d,k,Pi)}function Is(d,k){return d&&wl(d,k,Pi)}function Vo(d,k){return Wr(k,function(V){return qr(d[V])})}function ln(d,k){for(var V=0,at=(k=Gr(k,d)).length;d!=null&&V<at;)d=d[jr(k[V++])];return V&&V==at?d:v}function Ml(d,k,V){var at=k(d);return We(d)?at:Vr(at,V(d))}function Vi(d){return d==null?d===v?Mt:X:an&&an in xi(d)?function(k){var V=bi.call(k,an),at=k[an];try{k[an]=v;var ct=!0}catch{}var yt=Ro.call(k);return ct&&(V?k[an]=at:delete k[an]),yt}(d):function(k){return Ro.call(k)}(d)}function Os(d,k){return d>k}function s0(d,k){return d!=null&&bi.call(d,k)}function u0(d,k){return d!=null&&k in xi(d)}function As(d,k,V){for(var at=V?hs:ko,ct=d[0].length,yt=d.length,St=yt,Ot=me(yt),Ct=1/0,oe=[];St--;){var ne=d[St];St&&k&&(ne=Si(ne,rr(k))),Ct=Ui(ne.length,Ct),Ot[St]=!V&&(k||ct>=120&&ne.length>=120)?new un(St&&ne):v}ne=d[0];var le=-1,Me=Ot[0];t:for(;++le<ct&&oe.length<Ct;){var _e=ne[le],Ie=k?k(_e):_e;if(_e=V||_e!==0?_e:0,!(Me?zn(Me,Ie):at(oe,Ie,V))){for(St=yt;--St;){var se=Ot[St];if(!(se?zn(se,Ie):at(d[St],Ie,V)))continue t}Me&&Me.push(Ie),oe.push(_e)}}return oe}function Jn(d,k,V){var at=(d=uh(d,k=Gr(k,d)))==null?d:d[jr(mr(k))];return at==null?v:ir(at,d,V)}function xl(d){return Ii(d)&&Vi(d)==A}function Gn(d,k,V,at,ct){return d===k||(d==null||k==null||!Ii(d)&&!Ii(k)?d!=d&&k!=k:function(yt,St,Ot,Ct,oe,ne){var le=We(yt),Me=We(St),_e=le?C:qi(yt),Ie=Me?C:qi(St),se=(_e=_e==A?st:_e)==st,he=(Ie=Ie==A?st:Ie)==st,Be=_e==Ie;if(Be&&Qr(yt)){if(!Qr(St))return!1;le=!0,se=!1}if(Be&&!se)return ne||(ne=new xr),le||Bn(yt)?eh(yt,St,Ot,Ct,oe,ne):function(Ee,Pe,Ni,Ti,Zi,_i,Fi){switch(Ni){case tt:if(Ee.byteLength!=Pe.byteLength||Ee.byteOffset!=Pe.byteOffset)return!1;Ee=Ee.buffer,Pe=Pe.buffer;case J:return!(Ee.byteLength!=Pe.byteLength||!_i(new Co(Ee),new Co(Pe)));case T:case R:case z:return _r(+Ee,+Pe);case Z:return Ee.name==Pe.name&&Ee.message==Pe.message;case Et:case bt:return Ee==Pe+"";case G:var Rr=bs;case gt:var tn=Ti&g;if(Rr||(Rr=Oo),Ee.size!=Pe.size&&!tn)return!1;var dn=Fi.get(Ee);if(dn)return dn==Pe;Ti|=h,Fi.set(Ee,Pe);var zr=eh(Rr(Ee),Rr(Pe),Ti,Zi,_i,Fi);return Fi.delete(Ee),zr;case Bt:if(Xn)return Xn.call(Ee)==Xn.call(Pe)}return!1}(yt,St,_e,Ot,Ct,oe,ne);if(!(Ot&g)){var pe=se&&bi.call(yt,"__wrapped__"),Fe=he&&bi.call(St,"__wrapped__");if(pe||Fe){var Ue=pe?yt.value():yt,vi=Fe?St.value():St;return ne||(ne=new xr),oe(Ue,vi,Ot,Ct,ne)}}return!!Be&&(ne||(ne=new xr),function(Ee,Pe,Ni,Ti,Zi,_i){var Fi=Ni&g,Rr=Hs(Ee),tn=Rr.length;if(tn!=Hs(Pe).length&&!Fi)return!1;for(var dn=tn;dn--;){var zr=Rr[dn];if(!(Fi?zr in Pe:bi.call(Pe,zr)))return!1}var Wh=_i.get(Ee),Vh=_i.get(Pe);if(Wh&&Vh)return Wh==Pe&&Vh==Ee;var fa=!0;_i.set(Ee,Pe),_i.set(Pe,Ee);for(var vu=Fi;++dn<tn;){var pa=Ee[zr=Rr[dn]],da=Pe[zr];if(Ti)var Xh=Fi?Ti(da,pa,zr,Pe,Ee,_i):Ti(pa,da,zr,Ee,Pe,_i);if(!(Xh===v?pa===da||Zi(pa,da,Ni,Ti,_i):Xh)){fa=!1;break}vu||(vu=zr=="constructor")}if(fa&&!vu){var ma=Ee.constructor,ga=Pe.constructor;ma==ga||!("constructor"in Ee)||!("constructor"in Pe)||typeof ma=="function"&&ma instanceof ma&&typeof ga=="function"&&ga instanceof ga||(fa=!1)}return _i.delete(Ee),_i.delete(Pe),fa}(yt,St,Ot,Ct,oe,ne))}(d,k,V,at,Gn,ct))}function Ts(d,k,V,at){var ct=V.length,yt=ct,St=!at;if(d==null)return!yt;for(d=xi(d);ct--;){var Ot=V[ct];if(St&&Ot[2]?Ot[1]!==d[Ot[0]]:!(Ot[0]in d))return!1}for(;++ct<yt;){var Ct=(Ot=V[ct])[0],oe=d[Ct],ne=Ot[1];if(St&&Ot[2]){if(oe===v&&!(Ct in d))return!1}else{var le=new xr;if(at)var Me=at(oe,ne,Ct,d,k,le);if(!(Me===v?Gn(ne,oe,g|h,at,le):Me))return!1}}return!0}function _l(d){return!(!Ei(d)||(k=d,ol&&ol in k))&&(qr(d)?zd:ee).test(fn(d));var k}function Sl(d){return typeof d=="function"?d:d==null?Yi:typeof d=="object"?We(d)?Il(d[0],d[1]):kl(d):Hh(d)}function Bs(d){if(!to(d))return Zd(d);var k=[];for(var V in xi(d))bi.call(d,V)&&V!="constructor"&&k.push(V);return k}function js(d,k){return d<k}function El(d,k){var V=-1,at=Ji(d)?me(d.length):[];return Kr(d,function(ct,yt,St){at[++V]=k(ct,yt,St)}),at}function kl(d){var k=Xs(d);return k.length==1&&k[0][2]?ah(k[0][0],k[0][1]):function(V){return V===d||Ts(V,d,k)}}function Il(d,k){return Ks(d)&&oh(k)?ah(jr(d),k):function(V){var at=su(V,d);return at===v&&at===k?uu(V,d):Gn(k,at,g|h)}}function Xo(d,k,V,at,ct){d!==k&&ks(k,function(yt,St){if(ct||(ct=new xr),Ei(yt))(function(Ct,oe,ne,le,Me,_e,Ie){var se=Gs(Ct,ne),he=Gs(oe,ne),Be=Ie.get(he);if(Be)Ss(Ct,ne,Be);else{var pe=_e?_e(se,he,ne+"",Ct,oe,Ie):v,Fe=pe===v;if(Fe){var Ue=We(he),vi=!Ue&&Qr(he),Ee=!Ue&&!vi&&Bn(he);pe=he,Ue||vi||Ee?We(se)?pe=se:Ai(se)?pe=Ki(se):vi?(Fe=!1,pe=Ul(he,!0)):Ee?(Fe=!1,pe=ql(he,!0)):pe=[]:io(he)||pn(he)?(pe=se,pn(se)?pe=Nh(se):Ei(se)&&!qr(se)||(pe=nh(he))):Fe=!1}Fe&&(Ie.set(he,pe),Me(pe,he,le,_e,Ie),Ie.delete(he)),Ss(Ct,ne,pe)}})(d,k,St,V,Xo,at,ct);else{var Ot=at?at(Gs(d,St),yt,St+"",d,k,ct):v;Ot===v&&(Ot=yt),Ss(d,St,Ot)}},Gi)}function Ol(d,k){var V=d.length;if(V)return Ur(k+=k<0?V:0,V)?d[k]:v}function Al(d,k,V){k=k.length?Si(k,function(yt){return We(yt)?function(St){return ln(St,yt.length===1?yt[0]:yt)}:yt}):[Yi];var at=-1;k=Si(k,rr(Ne()));var ct=El(d,function(yt,St,Ot){var Ct=Si(k,function(oe){return oe(yt)});return{criteria:Ct,index:++at,value:yt}});return function(yt,St){var Ot=yt.length;for(yt.sort(function(Ct,oe){return function(ne,le,Me){for(var _e=-1,Ie=ne.criteria,se=le.criteria,he=Ie.length,Be=Me.length;++_e<he;){var pe=Fl(Ie[_e],se[_e]);if(pe)return _e>=Be?pe:pe*(Me[_e]=="desc"?-1:1)}return ne.index-le.index}(Ct,oe,V)});Ot--;)yt[Ot]=yt[Ot].value;return yt}(ct)}function Tl(d,k,V){for(var at=-1,ct=k.length,yt={};++at<ct;){var St=k[at],Ot=ln(d,St);V(Ot,St)&&Yn(yt,Gr(St,d),Ot)}return yt}function Rs(d,k,V,at){var ct=at?Bd:Mn,yt=-1,St=k.length,Ot=d;for(d===k&&(k=Ki(k)),V&&(Ot=Si(d,rr(V)));++yt<St;)for(var Ct=0,oe=k[yt],ne=V?V(oe):oe;(Ct=ct(Ot,ne,Ct,at))>-1;)Ot!==d&&Lo.call(Ot,Ct,1),Lo.call(d,Ct,1);return d}function Bl(d,k){for(var V=d?k.length:0,at=V-1;V--;){var ct=k[V];if(V==at||ct!==yt){var yt=ct;Ur(ct)?Lo.call(d,ct,1):Ls(d,ct)}}return d}function Ns(d,k){return d+qo(hl()*(k-d+1))}function Cs(d,k){var V="";if(!d||k<1||k>t)return V;do k%2&&(V+=d),(k=qo(k/2))&&(d+=d);while(k);return V}function Xe(d,k){return Ys(sh(d,k,Yi),d+"")}function c0(d){return dl(jn(d))}function l0(d,k){var V=jn(d);return ra(V,cn(k,0,V.length))}function Yn(d,k,V,at){if(!Ei(d))return d;for(var ct=-1,yt=(k=Gr(k,d)).length,St=yt-1,Ot=d;Ot!=null&&++ct<yt;){var Ct=jr(k[ct]),oe=V;if(Ct==="__proto__"||Ct==="constructor"||Ct==="prototype")return d;if(ct!=St){var ne=Ot[Ct];(oe=at?at(ne,Ct,Ot):v)===v&&(oe=Ei(ne)?ne:Ur(k[ct+1])?[]:{})}Zn(Ot,Ct,oe),Ot=Ot[Ct]}return d}var jl=Fo?function(d,k){return Fo.set(d,k),d}:Yi,h0=Do?function(d,k){return Do(d,"toString",{configurable:!0,enumerable:!1,value:lu(k),writable:!0})}:Yi;function f0(d){return ra(jn(d))}function dr(d,k,V){var at=-1,ct=d.length;k<0&&(k=-k>ct?0:ct+k),(V=V>ct?ct:V)<0&&(V+=ct),ct=k>V?0:V-k>>>0,k>>>=0;for(var yt=me(ct);++at<ct;)yt[at]=d[at+k];return yt}function p0(d,k){var V;return Kr(d,function(at,ct,yt){return!(V=k(at,ct,yt))}),!!V}function Zo(d,k,V){var at=0,ct=d==null?at:d.length;if(typeof k=="number"&&k==k&&ct<=o){for(;at<ct;){var yt=at+ct>>>1,St=d[yt];St!==null&&!or(St)&&(V?St<=k:St<k)?at=yt+1:ct=yt}return ct}return Ps(d,k,Yi,V)}function Ps(d,k,V,at){var ct=0,yt=d==null?0:d.length;if(yt===0)return 0;for(var St=(k=V(k))!=k,Ot=k===null,Ct=or(k),oe=k===v;ct<yt;){var ne=qo((ct+yt)/2),le=V(d[ne]),Me=le!==v,_e=le===null,Ie=le==le,se=or(le);if(St)var he=at||Ie;else he=oe?Ie&&(at||Me):Ot?Ie&&Me&&(at||!_e):Ct?Ie&&Me&&!_e&&(at||!se):!_e&&!se&&(at?le<=k:le<k);he?ct=ne+1:yt=ne}return Ui(yt,e)}function Rl(d,k){for(var V=-1,at=d.length,ct=0,yt=[];++V<at;){var St=d[V],Ot=k?k(St):St;if(!V||!_r(Ot,Ct)){var Ct=Ot;yt[ct++]=St===0?0:St}}return yt}function Nl(d){return typeof d=="number"?d:or(d)?r:+d}function nr(d){if(typeof d=="string")return d;if(We(d))return Si(d,nr)+"";if(or(d))return fl?fl.call(d):"";var k=d+"";return k=="0"&&1/d==-ot?"-0":k}function Jr(d,k,V){var at=-1,ct=ko,yt=d.length,St=!0,Ot=[],Ct=Ot;if(V)St=!1,ct=hs;else if(yt>=m){var oe=k?null:m0(d);if(oe)return Oo(oe);St=!1,ct=zn,Ct=new un}else Ct=k?[]:Ot;t:for(;++at<yt;){var ne=d[at],le=k?k(ne):ne;if(ne=V||ne!==0?ne:0,St&&le==le){for(var Me=Ct.length;Me--;)if(Ct[Me]===le)continue t;k&&Ct.push(le),Ot.push(ne)}else ct(Ct,le,V)||(Ct!==Ot&&Ct.push(le),Ot.push(ne))}return Ot}function Ls(d,k){return(d=uh(d,k=Gr(k,d)))==null||delete d[jr(mr(k))]}function Cl(d,k,V,at){return Yn(d,k,V(ln(d,k)),at)}function Ko(d,k,V,at){for(var ct=d.length,yt=at?ct:-1;(at?yt--:++yt<ct)&&k(d[yt],yt,d););return V?dr(d,at?0:yt,at?yt+1:ct):dr(d,at?yt+1:0,at?ct:yt)}function Pl(d,k){var V=d;return V instanceof Qe&&(V=V.value()),fs(k,function(at,ct){return ct.func.apply(ct.thisArg,Vr([at],ct.args))},V)}function Ds(d,k,V){var at=d.length;if(at<2)return at?Jr(d[0]):[];for(var ct=-1,yt=me(at);++ct<at;)for(var St=d[ct],Ot=-1;++Ot<at;)Ot!=ct&&(yt[ct]=Kn(yt[ct]||St,d[Ot],k,V));return Jr(Di(yt,1),k,V)}function Ll(d,k,V){for(var at=-1,ct=d.length,yt=k.length,St={};++at<ct;){var Ot=at<yt?k[at]:v;V(St,d[at],Ot)}return St}function Us(d){return Ai(d)?d:[]}function qs(d){return typeof d=="function"?d:Yi}function Gr(d,k){return We(d)?d:Ks(d,k)?[d]:fh(yi(d))}var d0=Xe;function Yr(d,k,V){var at=d.length;return V=V===v?at:V,!k&&V>=at?d:dr(d,k,V)}var Dl=$d||function(d){return de.clearTimeout(d)};function Ul(d,k){if(k)return d.slice();var V=d.length,at=al?al(V):new d.constructor(V);return d.copy(at),at}function Fs(d){var k=new d.constructor(d.byteLength);return new Co(k).set(new Co(d)),k}function ql(d,k){var V=k?Fs(d.buffer):d.buffer;return new d.constructor(V,d.byteOffset,d.length)}function Fl(d,k){if(d!==k){var V=d!==v,at=d===null,ct=d==d,yt=or(d),St=k!==v,Ot=k===null,Ct=k==k,oe=or(k);if(!Ot&&!oe&&!yt&&d>k||yt&&St&&Ct&&!Ot&&!oe||at&&St&&Ct||!V&&Ct||!ct)return 1;if(!at&&!yt&&!oe&&d<k||oe&&V&&ct&&!at&&!yt||Ot&&V&&ct||!St&&ct||!Ct)return-1}return 0}function zl(d,k,V,at){for(var ct=-1,yt=d.length,St=V.length,Ot=-1,Ct=k.length,oe=Ri(yt-St,0),ne=me(Ct+oe),le=!at;++Ot<Ct;)ne[Ot]=k[Ot];for(;++ct<St;)(le||ct<yt)&&(ne[V[ct]]=d[ct]);for(;oe--;)ne[Ot++]=d[ct++];return ne}function $l(d,k,V,at){for(var ct=-1,yt=d.length,St=-1,Ot=V.length,Ct=-1,oe=k.length,ne=Ri(yt-Ot,0),le=me(ne+oe),Me=!at;++ct<ne;)le[ct]=d[ct];for(var _e=ct;++Ct<oe;)le[_e+Ct]=k[Ct];for(;++St<Ot;)(Me||ct<yt)&&(le[_e+V[St]]=d[ct++]);return le}function Ki(d,k){var V=-1,at=d.length;for(k||(k=me(at));++V<at;)k[V]=d[V];return k}function Br(d,k,V,at){var ct=!V;V||(V={});for(var yt=-1,St=k.length;++yt<St;){var Ot=k[yt],Ct=at?at(V[Ot],d[Ot],Ot,V,d):v;Ct===v&&(Ct=d[Ot]),ct?Pr(V,Ot,Ct):Zn(V,Ot,Ct)}return V}function Jo(d,k){return function(V,at){var ct=We(V)?Id:o0,yt=k?k():{};return ct(V,d,Ne(at,2),yt)}}function On(d){return Xe(function(k,V){var at=-1,ct=V.length,yt=ct>1?V[ct-1]:v,St=ct>2?V[2]:v;for(yt=d.length>3&&typeof yt=="function"?(ct--,yt):v,St&&Xi(V[0],V[1],St)&&(yt=ct<3?v:yt,ct=1),k=xi(k);++at<ct;){var Ot=V[at];Ot&&d(k,Ot,at,yt)}return k})}function Hl(d,k){return function(V,at){if(V==null)return V;if(!Ji(V))return d(V,at);for(var ct=V.length,yt=k?ct:-1,St=xi(V);(k?yt--:++yt<ct)&&at(St[yt],yt,St)!==!1;);return V}}function Wl(d){return function(k,V,at){for(var ct=-1,yt=xi(k),St=at(k),Ot=St.length;Ot--;){var Ct=St[d?Ot:++ct];if(V(yt[Ct],Ct,yt)===!1)break}return k}}function Vl(d){return function(k){var V=xn(k=yi(k))?Mr(k):v,at=V?V[0]:k.charAt(0),ct=V?Yr(V,1).join(""):k.slice(1);return at[d]()+ct}}function An(d){return function(k){return fs(zh(Fh(k).replace(wt,"")),d,"")}}function Qn(d){return function(){var k=arguments;switch(k.length){case 0:return new d;case 1:return new d(k[0]);case 2:return new d(k[0],k[1]);case 3:return new d(k[0],k[1],k[2]);case 4:return new d(k[0],k[1],k[2],k[3]);case 5:return new d(k[0],k[1],k[2],k[3],k[4]);case 6:return new d(k[0],k[1],k[2],k[3],k[4],k[5]);case 7:return new d(k[0],k[1],k[2],k[3],k[4],k[5],k[6])}var V=In(d.prototype),at=d.apply(V,k);return Ei(at)?at:V}}function Xl(d){return function(k,V,at){var ct=xi(k);if(!Ji(k)){var yt=Ne(V,3);k=Pi(k),V=function(Ot){return yt(ct[Ot],Ot,ct)}}var St=d(k,V,at);return St>-1?ct[yt?k[St]:St]:v}}function Zl(d){return Dr(function(k){var V=k.length,at=V,ct=fr.prototype.thru;for(d&&k.reverse();at--;){var yt=k[at];if(typeof yt!="function")throw new hr(S);if(ct&&!St&&ea(yt)=="wrapper")var St=new fr([],!0)}for(at=St?at:V;++at<V;){var Ot=ea(yt=k[at]),Ct=Ot=="wrapper"?Vs(yt):v;St=Ct&&Js(Ct[0])&&Ct[1]==(P|E|M|N)&&!Ct[4].length&&Ct[9]==1?St[ea(Ct[0])].apply(St,Ct[3]):yt.length==1&&Js(yt)?St[Ot]():St.thru(yt)}return function(){var oe=arguments,ne=oe[0];if(St&&oe.length==1&&We(ne))return St.plant(ne).value();for(var le=0,Me=V?k[le].apply(this,oe):ne;++le<V;)Me=k[le].call(this,Me);return Me}})}function Go(d,k,V,at,ct,yt,St,Ot,Ct,oe){var ne=k&P,le=k&u,Me=k&w,_e=k&(E|I),Ie=k&$,se=Me?v:Qn(d);return function he(){for(var Be=arguments.length,pe=me(Be),Fe=Be;Fe--;)pe[Fe]=arguments[Fe];if(_e)var Ue=Tn(he),vi=function(Ti,Zi){for(var _i=Ti.length,Fi=0;_i--;)Ti[_i]===Zi&&++Fi;return Fi}(pe,Ue);if(at&&(pe=zl(pe,at,ct,_e)),yt&&(pe=$l(pe,yt,St,_e)),Be-=vi,_e&&Be<oe){var Ee=Xr(pe,Ue);return Gl(d,k,Go,he.placeholder,V,pe,Ee,Ot,Ct,oe-Be)}var Pe=le?V:this,Ni=Me?Pe[d]:d;return Be=pe.length,Ot?pe=function(Ti,Zi){for(var _i=Ti.length,Fi=Ui(Zi.length,_i),Rr=Ki(Ti);Fi--;){var tn=Zi[Fi];Ti[Fi]=Ur(tn,_i)?Rr[tn]:v}return Ti}(pe,Ot):Ie&&Be>1&&pe.reverse(),ne&&Ct<Be&&(pe.length=Ct),this&&this!==de&&this instanceof he&&(Ni=se||Qn(Ni)),Ni.apply(Pe,pe)}}function Kl(d,k){return function(V,at){return function(ct,yt,St,Ot){return Tr(ct,function(Ct,oe,ne){yt(Ot,St(Ct),oe,ne)}),Ot}(V,d,k(at),{})}}function Yo(d,k){return function(V,at){var ct;if(V===v&&at===v)return k;if(V!==v&&(ct=V),at!==v){if(ct===v)return at;typeof V=="string"||typeof at=="string"?(V=nr(V),at=nr(at)):(V=Nl(V),at=Nl(at)),ct=d(V,at)}return ct}}function zs(d){return Dr(function(k){return k=Si(k,rr(Ne())),Xe(function(V){var at=this;return d(k,function(ct){return ir(ct,at,V)})})})}function Qo(d,k){var V=(k=k===v?" ":nr(k)).length;if(V<2)return V?Cs(k,d):k;var at=Cs(k,Uo(d/_n(k)));return xn(k)?Yr(Mr(at),0,d).join(""):at.slice(0,d)}function Jl(d){return function(k,V,at){return at&&typeof at!="number"&&Xi(k,V,at)&&(V=at=v),k=Fr(k),V===v?(V=k,k=0):V=Fr(V),function(ct,yt,St,Ot){for(var Ct=-1,oe=Ri(Uo((yt-ct)/(St||1)),0),ne=me(oe);oe--;)ne[Ot?oe:++Ct]=ct,ct+=St;return ne}(k,V,at=at===v?k<V?1:-1:Fr(at),d)}}function ta(d){return function(k,V){return typeof k=="string"&&typeof V=="string"||(k=gr(k),V=gr(V)),d(k,V)}}function Gl(d,k,V,at,ct,yt,St,Ot,Ct,oe){var ne=k&E;k|=ne?M:B,(k&=~(ne?B:M))&b||(k&=~(u|w));var le=[d,k,ct,ne?yt:v,ne?St:v,ne?v:yt,ne?v:St,Ot,Ct,oe],Me=V.apply(v,le);return Js(d)&&ch(Me,le),Me.placeholder=at,lh(Me,d,k)}function $s(d){var k=Ar[d];return function(V,at){if(V=gr(V),(at=at==null?0:Ui(Ve(at),292))&&ll(V)){var ct=(yi(V)+"e").split("e");return+((ct=(yi(k(ct[0]+"e"+(+ct[1]+at)))+"e").split("e"))[0]+"e"+(+ct[1]-at))}return k(V)}}var m0=En&&1/Oo(new En([,-0]))[1]==ot?function(d){return new En(d)}:pu;function Yl(d){return function(k){var V=qi(k);return V==G?bs(k):V==gt?Cd(k):function(at,ct){return Si(ct,function(yt){return[yt,at[yt]]})}(k,d(k))}}function Lr(d,k,V,at,ct,yt,St,Ot){var Ct=k&w;if(!Ct&&typeof d!="function")throw new hr(S);var oe=at?at.length:0;if(oe||(k&=~(M|B),at=ct=v),St=St===v?St:Ri(Ve(St),0),Ot=Ot===v?Ot:Ve(Ot),oe-=ct?ct.length:0,k&B){var ne=at,le=ct;at=ct=v}var Me=Ct?v:Vs(d),_e=[d,k,V,at,ct,ne,le,yt,St,Ot];if(Me&&function(se,he){var Be=se[1],pe=he[1],Fe=Be|pe,Ue=Fe<(u|w|P),vi=pe==P&&Be==E||pe==P&&Be==N&&se[7].length<=he[8]||pe==(P|N)&&he[7].length<=he[8]&&Be==E;if(!Ue&&!vi)return se;pe&u&&(se[2]=he[2],Fe|=Be&u?0:b);var Ee=he[3];if(Ee){var Pe=se[3];se[3]=Pe?zl(Pe,Ee,he[4]):Ee,se[4]=Pe?Xr(se[3],p):he[4]}(Ee=he[5])&&(Pe=se[5],se[5]=Pe?$l(Pe,Ee,he[6]):Ee,se[6]=Pe?Xr(se[5],p):he[6]),(Ee=he[7])&&(se[7]=Ee),pe&P&&(se[8]=se[8]==null?he[8]:Ui(se[8],he[8])),se[9]==null&&(se[9]=he[9]),se[0]=he[0],se[1]=Fe}(_e,Me),d=_e[0],k=_e[1],V=_e[2],at=_e[3],ct=_e[4],!(Ot=_e[9]=_e[9]===v?Ct?0:d.length:Ri(_e[9]-oe,0))&&k&(E|I)&&(k&=~(E|I)),k&&k!=u)Ie=k==E||k==I?function(se,he,Be){var pe=Qn(se);return function Fe(){for(var Ue=arguments.length,vi=me(Ue),Ee=Ue,Pe=Tn(Fe);Ee--;)vi[Ee]=arguments[Ee];var Ni=Ue<3&&vi[0]!==Pe&&vi[Ue-1]!==Pe?[]:Xr(vi,Pe);return(Ue-=Ni.length)<Be?Gl(se,he,Go,Fe.placeholder,v,vi,Ni,v,v,Be-Ue):ir(this&&this!==de&&this instanceof Fe?pe:se,this,vi)}}(d,k,Ot):k!=M&&k!=(u|M)||ct.length?Go.apply(v,_e):function(se,he,Be,pe){var Fe=he&u,Ue=Qn(se);return function vi(){for(var Ee=-1,Pe=arguments.length,Ni=-1,Ti=pe.length,Zi=me(Ti+Pe),_i=this&&this!==de&&this instanceof vi?Ue:se;++Ni<Ti;)Zi[Ni]=pe[Ni];for(;Pe--;)Zi[Ni++]=arguments[++Ee];return ir(_i,Fe?Be:this,Zi)}}(d,k,V,at);else var Ie=function(se,he,Be){var pe=he&u,Fe=Qn(se);return function Ue(){return(this&&this!==de&&this instanceof Ue?Fe:se).apply(pe?Be:this,arguments)}}(d,k,V);return lh((Me?jl:ch)(Ie,_e),d,k)}function Ql(d,k,V,at){return d===v||_r(d,Sn[V])&&!bi.call(at,V)?k:d}function th(d,k,V,at,ct,yt){return Ei(d)&&Ei(k)&&(yt.set(k,d),Xo(d,k,v,th,yt),yt.delete(k)),d}function g0(d){return io(d)?v:d}function eh(d,k,V,at,ct,yt){var St=V&g,Ot=d.length,Ct=k.length;if(Ot!=Ct&&!(St&&Ct>Ot))return!1;var oe=yt.get(d),ne=yt.get(k);if(oe&&ne)return oe==k&&ne==d;var le=-1,Me=!0,_e=V&h?new un:v;for(yt.set(d,k),yt.set(k,d);++le<Ot;){var Ie=d[le],se=k[le];if(at)var he=St?at(se,Ie,le,k,d,yt):at(Ie,se,le,d,k,yt);if(he!==v){if(he)continue;Me=!1;break}if(_e){if(!ps(k,function(Be,pe){if(!zn(_e,pe)&&(Ie===Be||ct(Ie,Be,V,at,yt)))return _e.push(pe)})){Me=!1;break}}else if(Ie!==se&&!ct(Ie,se,V,at,yt)){Me=!1;break}}return yt.delete(d),yt.delete(k),Me}function Dr(d){return Ys(sh(d,v,gh),d+"")}function Hs(d){return Ml(d,Pi,Zs)}function Ws(d){return Ml(d,Gi,ih)}var Vs=Fo?function(d){return Fo.get(d)}:pu;function ea(d){for(var k=d.name+"",V=kn[k],at=bi.call(kn,k)?V.length:0;at--;){var ct=V[at],yt=ct.func;if(yt==null||yt==d)return ct.name}return k}function Tn(d){return(bi.call(dt,"placeholder")?dt:d).placeholder}function Ne(){var d=dt.iteratee||hu;return d=d===hu?Sl:d,arguments.length?d(arguments[0],arguments[1]):d}function ia(d,k){var V,at,ct=d.__data__;return((at=typeof(V=k))=="string"||at=="number"||at=="symbol"||at=="boolean"?V!=="__proto__":V===null)?ct[typeof k=="string"?"string":"hash"]:ct.map}function Xs(d){for(var k=Pi(d),V=k.length;V--;){var at=k[V],ct=d[at];k[V]=[at,ct,oh(ct)]}return k}function hn(d,k){var V=function(at,ct){return at==null?v:at[ct]}(d,k);return _l(V)?V:v}var Zs=Ms?function(d){return d==null?[]:(d=xi(d),Wr(Ms(d),function(k){return ul.call(d,k)}))}:du,ih=Ms?function(d){for(var k=[];d;)Vr(k,Zs(d)),d=Po(d);return k}:du,qi=Vi;function rh(d,k,V){for(var at=-1,ct=(k=Gr(k,d)).length,yt=!1;++at<ct;){var St=jr(k[at]);if(!(yt=d!=null&&V(d,St)))break;d=d[St]}return yt||++at!=ct?yt:!!(ct=d==null?0:d.length)&&ca(ct)&&Ur(St,ct)&&(We(d)||pn(d))}function nh(d){return typeof d.constructor!="function"||to(d)?{}:In(Po(d))}function v0(d){return We(d)||pn(d)||!!(cl&&d&&d[cl])}function Ur(d,k){var V=typeof d;return!!(k=k??t)&&(V=="number"||V!="symbol"&&Ft.test(d))&&d>-1&&d%1==0&&d<k}function Xi(d,k,V){if(!Ei(V))return!1;var at=typeof k;return!!(at=="number"?Ji(V)&&Ur(k,V.length):at=="string"&&k in V)&&_r(V[k],d)}function Ks(d,k){if(We(d))return!1;var V=typeof d;return!(V!="number"&&V!="symbol"&&V!="boolean"&&d!=null&&!or(d))||Nt.test(d)||!ye.test(d)||k!=null&&d in xi(k)}function Js(d){var k=ea(d),V=dt[k];if(typeof V!="function"||!(k in Qe.prototype))return!1;if(d===V)return!0;var at=Vs(V);return!!at&&d===at[0]}(xs&&qi(new xs(new ArrayBuffer(1)))!=tt||Hn&&qi(new Hn)!=G||_s&&qi(_s.resolve())!=nt||En&&qi(new En)!=gt||Wn&&qi(new Wn)!=It)&&(qi=function(d){var k=Vi(d),V=k==st?d.constructor:v,at=V?fn(V):"";if(at)switch(at){case Yd:return tt;case Qd:return G;case t0:return nt;case e0:return gt;case i0:return It}return k});var y0=Bo?qr:mu;function to(d){var k=d&&d.constructor;return d===(typeof k=="function"&&k.prototype||Sn)}function oh(d){return d==d&&!Ei(d)}function ah(d,k){return function(V){return V!=null&&V[d]===k&&(k!==v||d in xi(V))}}function sh(d,k,V){return k=Ri(k===v?d.length-1:k,0),function(){for(var at=arguments,ct=-1,yt=Ri(at.length-k,0),St=me(yt);++ct<yt;)St[ct]=at[k+ct];ct=-1;for(var Ot=me(k+1);++ct<k;)Ot[ct]=at[ct];return Ot[k]=V(St),ir(d,this,Ot)}}function uh(d,k){return k.length<2?d:ln(d,dr(k,0,-1))}function Gs(d,k){if((k!=="constructor"||typeof d[k]!="function")&&k!="__proto__")return d[k]}var ch=hh(jl),eo=Wd||function(d,k){return de.setTimeout(d,k)},Ys=hh(h0);function lh(d,k,V){var at=k+"";return Ys(d,function(ct,yt){var St=yt.length;if(!St)return ct;var Ot=St-1;return yt[Ot]=(St>1?"& ":"")+yt[Ot],yt=yt.join(St>2?", ":" "),ct.replace(Dt,`{
|
|
76
76
|
/* [wrapped with `+yt+`] */
|
|
77
|
-
`)}(at,function(ct,yt){return lr(s,function(St){var Ot="_."+St[0];yt&St[1]&&!ko(ct,Ot)&&ct.push(Ot)}),ct.sort()}(function(ct){var yt=ct.match(Jt);return yt?yt[1].split(De):[]}(at),V)))}function hh(d){var k=0,V=0;return function(){var at=Kd(),ct=Q-(at-V);if(V=at,ct>0){if(++k>=et)return arguments[0]}else k=0;return d.apply(v,arguments)}}function ra(d,k){var V=-1,at=d.length,ct=at-1;for(k=k===v?at:k;++V<k;){var yt=Ns(V,ct),St=d[yt];d[yt]=d[V],d[V]=St}return d.length=k,d}var Qs,tu,fh=(Qs=sa(function(d){var k=[];return d.charCodeAt(0)===46&&k.push(""),d.replace(Xt,function(V,at,ct,yt){k.push(ct?yt.replace(ze,"$1"):at||V)}),k},function(d){return tu.size===500&&tu.clear(),d}),tu=Qs.cache,Qs);function jr(d){if(typeof d=="string"||or(d))return d;var k=d+"";return k=="0"&&1/d==-ot?"-0":k}function fn(d){if(d!=null){try{return jo.call(d)}catch{}try{return d+""}catch{}}return""}function ph(d){if(d instanceof Qe)return d.clone();var k=new fr(d.__wrapped__,d.__chain__);return k.__actions__=Ki(d.__actions__),k.__index__=d.__index__,k.__values__=d.__values__,k}var b0=Xe(function(d,k){return Ai(d)?Kn(d,Di(k,1,Ai,!0)):[]}),w0=Xe(function(d,k){var V=mr(k);return Ai(V)&&(V=v),Ai(d)?Kn(d,Di(k,1,Ai,!0),Ne(V,2)):[]}),M0=Xe(function(d,k){var V=mr(k);return Ai(V)&&(V=v),Ai(d)?Kn(d,Di(k,1,Ai,!0),v,V):[]});function dh(d,k,V){var at=d==null?0:d.length;if(!at)return-1;var ct=V==null?0:Ve(V);return ct<0&&(ct=Ri(at+ct,0)),Io(d,Ne(k,3),ct)}function mh(d,k,V){var at=d==null?0:d.length;if(!at)return-1;var ct=at-1;return V!==v&&(ct=Ve(V),ct=V<0?Ri(at+ct,0):Ui(ct,at-1)),Io(d,Ne(k,3),ct,!0)}function gh(d){return d!=null&&d.length?Di(d,1):[]}function vh(d){return d&&d.length?d[0]:v}var x0=Xe(function(d){var k=Si(d,Us);return k.length&&k[0]===d[0]?As(k):[]}),_0=Xe(function(d){var k=mr(d),V=Si(d,Us);return k===mr(V)?k=v:V.pop(),V.length&&V[0]===d[0]?As(V,Ne(k,2)):[]}),S0=Xe(function(d){var k=mr(d),V=Si(d,Us);return(k=typeof k=="function"?k:v)&&V.pop(),V.length&&V[0]===d[0]?As(V,v,k):[]});function mr(d){var k=d==null?0:d.length;return k?d[k-1]:v}var E0=Xe(yh);function yh(d,k){return d&&d.length&&k&&k.length?Rs(d,k):d}var k0=Dr(function(d,k){var V=d==null?0:d.length,at=Es(d,k);return Bl(d,Si(k,function(ct){return Ur(ct,V)?+ct:ct}).sort(Fl)),at});function eu(d){return d==null?d:Gd.call(d)}var I0=Xe(function(d){return Jr(Di(d,1,Ai,!0))}),O0=Xe(function(d){var k=mr(d);return Ai(k)&&(k=v),Jr(Di(d,1,Ai,!0),Ne(k,2))}),A0=Xe(function(d){var k=mr(d);return k=typeof k=="function"?k:v,Jr(Di(d,1,Ai,!0),v,k)});function iu(d){if(!d||!d.length)return[];var k=0;return d=Wr(d,function(V){if(Ai(V))return k=Ri(V.length,k),!0}),vs(k,function(V){return Si(d,ds(V))})}function bh(d,k){if(!d||!d.length)return[];var V=iu(d);return k==null?V:Si(V,function(at){return ir(k,v,at)})}var T0=Xe(function(d,k){return Ai(d)?Kn(d,k):[]}),B0=Xe(function(d){return Ds(Wr(d,Ai))}),j0=Xe(function(d){var k=mr(d);return Ai(k)&&(k=v),Ds(Wr(d,Ai),Ne(k,2))}),R0=Xe(function(d){var k=mr(d);return k=typeof k=="function"?k:v,Ds(Wr(d,Ai),v,k)}),N0=Xe(iu),C0=Xe(function(d){var k=d.length,V=k>1?d[k-1]:v;return V=typeof V=="function"?(d.pop(),V):v,bh(d,V)});function wh(d){var k=dt(d);return k.__chain__=!0,k}function na(d,k){return k(d)}var P0=Dr(function(d){var k=d.length,V=k?d[0]:0,at=this.__wrapped__,ct=function(yt){return Es(yt,d)};return!(k>1||this.__actions__.length)&&at instanceof Qe&&Ur(V)?((at=at.slice(V,+V+(k?1:0))).__actions__.push({func:na,args:[ct],thisArg:v}),new fr(at,this.__chain__).thru(function(yt){return k&&!yt.length&&yt.push(v),yt})):this.thru(ct)}),L0=Jo(function(d,k,V){bi.call(d,V)?++d[V]:Pr(d,V,1)}),D0=Xl(dh),U0=Xl(mh);function Mh(d,k){return(We(d)?lr:Kr)(d,Ne(k,3))}function xh(d,k){return(We(d)?Od:yl)(d,Ne(k,3))}var q0=Jo(function(d,k,V){bi.call(d,V)?d[V].push(k):Pr(d,V,[k])}),F0=Xe(function(d,k,V){var at=-1,ct=typeof k=="function",yt=Ji(d)?me(d.length):[];return Kr(d,function(St){yt[++at]=ct?ir(k,St,V):Jn(St,k,V)}),yt}),z0=Jo(function(d,k,V){Pr(d,V,k)});function oa(d,k){return(We(d)?Si:El)(d,Ne(k,3))}var $0=Jo(function(d,k,V){d[V?0:1].push(k)},function(){return[[],[]]}),H0=Xe(function(d,k){if(d==null)return[];var V=k.length;return V>1&&Xi(d,k[0],k[1])?k=[]:V>2&&Xi(k[0],k[1],k[2])&&(k=[k[0]]),Al(d,Di(k,1),[])}),aa=Hd||function(){return de.Date.now()};function _h(d,k,V){return k=V?v:k,k=d&&k==null?d.length:k,Lr(d,P,v,v,v,v,k)}function Sh(d,k){var V;if(typeof k!="function")throw new hr(S);return d=Ve(d),function(){return--d>0&&(V=k.apply(this,arguments)),d<=1&&(k=v),V}}var ru=Xe(function(d,k,V){var at=u;if(V.length){var ct=Xr(V,Tn(ru));at|=M}return Lr(d,at,k,V,ct)}),Eh=Xe(function(d,k,V){var at=u|w;if(V.length){var ct=Xr(V,Tn(Eh));at|=M}return Lr(k,at,d,V,ct)});function kh(d,k,V){var at,ct,yt,St,Ot,Ct,oe=0,ne=!1,le=!1,Me=!0;if(typeof d!="function")throw new hr(S);function _e(pe){var Fe=at,Ue=ct;return at=ct=v,oe=pe,St=d.apply(Ue,Fe)}function Ie(pe){var Fe=pe-Ct;return Ct===v||Fe>=k||Fe<0||le&&pe-oe>=yt}function se(){var pe=aa();if(Ie(pe))return he(pe);Ot=eo(se,function(Fe){var Ue=k-(Fe-Ct);return le?Ui(Ue,yt-(Fe-oe)):Ue}(pe))}function he(pe){return Ot=v,Me&&at?_e(pe):(at=ct=v,St)}function Be(){var pe=aa(),Fe=Ie(pe);if(at=arguments,ct=this,Ct=pe,Fe){if(Ot===v)return function(Ue){return oe=Ue,Ot=eo(se,k),ne?_e(Ue):St}(Ct);if(le)return Dl(Ot),Ot=eo(se,k),_e(Ct)}return Ot===v&&(Ot=eo(se,k)),St}return k=gr(k)||0,Ei(V)&&(ne=!!V.leading,yt=(le="maxWait"in V)?Ri(gr(V.maxWait)||0,k):yt,Me="trailing"in V?!!V.trailing:Me),Be.cancel=function(){Ot!==v&&Dl(Ot),oe=0,at=Ct=ct=Ot=v},Be.flush=function(){return Ot===v?St:he(aa())},Be}var W0=Xe(function(d,k){return vl(d,1,k)}),V0=Xe(function(d,k,V){return vl(d,gr(k)||0,V)});function sa(d,k){if(typeof d!="function"||k!=null&&typeof k!="function")throw new hr(S);var V=function(){var at=arguments,ct=k?k.apply(this,at):at[0],yt=V.cache;if(yt.has(ct))return yt.get(ct);var St=d.apply(this,at);return V.cache=yt.set(ct,St)||yt,St};return V.cache=new(sa.Cache||Cr),V}function ua(d){if(typeof d!="function")throw new hr(S);return function(){var k=arguments;switch(k.length){case 0:return!d.call(this);case 1:return!d.call(this,k[0]);case 2:return!d.call(this,k[0],k[1]);case 3:return!d.call(this,k[0],k[1],k[2])}return!d.apply(this,k)}}sa.Cache=Cr;var X0=d0(function(d,k){var V=(k=k.length==1&&We(k[0])?Si(k[0],rr(Ne())):Si(Di(k,1),rr(Ne()))).length;return Xe(function(at){for(var ct=-1,yt=Ui(at.length,V);++ct<yt;)at[ct]=k[ct].call(this,at[ct]);return ir(d,this,at)})}),nu=Xe(function(d,k){var V=Xr(k,Tn(nu));return Lr(d,M,v,k,V)}),Ih=Xe(function(d,k){var V=Xr(k,Tn(Ih));return Lr(d,B,v,k,V)}),Z0=Dr(function(d,k){return Lr(d,N,v,v,v,k)});function _r(d,k){return d===k||d!=d&&k!=k}var K0=ta(Os),J0=ta(function(d,k){return d>=k}),pn=xl(function(){return arguments}())?xl:function(d){return Ii(d)&&bi.call(d,"callee")&&!ul.call(d,"callee")},We=me.isArray,G0=wr?rr(wr):function(d){return Ii(d)&&Vi(d)==J};function Ji(d){return d!=null&&ca(d.length)&&!qr(d)}function Ai(d){return Ii(d)&&Ji(d)}var Qr=Vd||mu,Y0=Wi?rr(Wi):function(d){return Ii(d)&&Vi(d)==R};function ou(d){if(!Ii(d))return!1;var k=Vi(d);return k==Z||k==q||typeof d.message=="string"&&typeof d.name=="string"&&!io(d)}function qr(d){if(!Ei(d))return!1;var k=Vi(d);return k==rt||k==D||k==j||k==lt}function Oh(d){return typeof d=="number"&&d==Ve(d)}function ca(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=t}function Ei(d){var k=typeof d;return d!=null&&(k=="object"||k=="function")}function Ii(d){return d!=null&&typeof d=="object"}var Ah=Or?rr(Or):function(d){return Ii(d)&&qi(d)==G};function Th(d){return typeof d=="number"||Ii(d)&&Vi(d)==z}function io(d){if(!Ii(d)||Vi(d)!=st)return!1;var k=Po(d);if(k===null)return!0;var V=bi.call(k,"constructor")&&k.constructor;return typeof V=="function"&&V instanceof V&&jo.call(V)==qd}var au=Vc?rr(Vc):function(d){return Ii(d)&&Vi(d)==Et},Bh=Xc?rr(Xc):function(d){return Ii(d)&&qi(d)==gt};function la(d){return typeof d=="string"||!We(d)&&Ii(d)&&Vi(d)==bt}function or(d){return typeof d=="symbol"||Ii(d)&&Vi(d)==Bt}var Bn=Zc?rr(Zc):function(d){return Ii(d)&&ca(d.length)&&!!Se[Vi(d)]},Q0=ta(js),tm=ta(function(d,k){return d<=k});function jh(d){if(!d)return[];if(Ji(d))return la(d)?Mr(d):Ki(d);if($n&&d[$n])return function(V){for(var at,ct=[];!(at=V.next()).done;)ct.push(at.value);return ct}(d[$n]());var k=qi(d);return(k==G?bs:k==gt?Oo:jn)(d)}function Fr(d){return d?(d=gr(d))===ot||d===-ot?(d<0?-1:1)*n:d==d?d:0:d===0?d:0}function Ve(d){var k=Fr(d),V=k%1;return k==k?V?k-V:k:0}function Rh(d){return d?cn(Ve(d),0,i):0}function gr(d){if(typeof d=="number")return d;if(or(d))return r;if(Ei(d)){var k=typeof d.valueOf=="function"?d.valueOf():d;d=Ei(k)?k+"":k}if(typeof d!="string")return d===0?d:+d;d=tl(d);var V=qt.test(d);return V||He.test(d)?Hi(d.slice(2),V?2:8):$e.test(d)?r:+d}function Nh(d){return Br(d,Gi(d))}function yi(d){return d==null?"":nr(d)}var em=On(function(d,k){if(to(k)||Ji(k))Br(k,Ci(k),d);else for(var V in k)bi.call(k,V)&&Zn(d,V,k[V])}),Ch=On(function(d,k){Br(k,Gi(k),d)}),ha=On(function(d,k,V,at){Br(k,Gi(k),d,at)}),im=On(function(d,k,V,at){Br(k,Ci(k),d,at)}),rm=Dr(Es),nm=Xe(function(d,k){d=xi(d);var V=-1,at=k.length,ct=at>2?k[2]:v;for(ct&&Xi(k[0],k[1],ct)&&(at=1);++V<at;)for(var yt=k[V],St=Gi(yt),Ot=-1,Ct=St.length;++Ot<Ct;){var oe=St[Ot],ne=d[oe];(ne===v||_r(ne,Sn[oe])&&!bi.call(d,oe))&&(d[oe]=yt[oe])}return d}),om=Xe(function(d){return d.push(v,th),ir(Ph,v,d)});function su(d,k,V){var at=d==null?v:ln(d,k);return at===v?V:at}function uu(d,k){return d!=null&&rh(d,k,u0)}var am=Kl(function(d,k,V){k!=null&&typeof k.toString!="function"&&(k=Ro.call(k)),d[k]=V},lu(Yi)),sm=Kl(function(d,k,V){k!=null&&typeof k.toString!="function"&&(k=Ro.call(k)),bi.call(d,k)?d[k].push(V):d[k]=[V]},Ne),um=Xe(Jn);function Ci(d){return Ji(d)?pl(d):Bs(d)}function Gi(d){return Ji(d)?pl(d,!0):function(k){if(!Ei(k))return function(yt){var St=[];if(yt!=null)for(var Ot in xi(yt))St.push(Ot);return St}(k);var V=to(k),at=[];for(var ct in k)(ct!="constructor"||!V&&bi.call(k,ct))&&at.push(ct);return at}(d)}var cm=On(function(d,k,V){Xo(d,k,V)}),Ph=On(function(d,k,V,at){Xo(d,k,V,at)}),lm=Dr(function(d,k){var V={};if(d==null)return V;var at=!1;k=Si(k,function(yt){return yt=Gr(yt,d),at||(at=yt.length>1),yt}),Br(d,Ws(d),V),at&&(V=pr(V,c|l|f,g0));for(var ct=k.length;ct--;)Ls(V,k[ct]);return V}),hm=Dr(function(d,k){return d==null?{}:function(V,at){return Tl(V,at,function(ct,yt){return uu(V,yt)})}(d,k)});function Lh(d,k){if(d==null)return{};var V=Si(Ws(d),function(at){return[at]});return k=Ne(k),Tl(d,V,function(at,ct){return k(at,ct[0])})}var Dh=Yl(Ci),Uh=Yl(Gi);function jn(d){return d==null?[]:ys(d,Ci(d))}var fm=An(function(d,k,V){return k=k.toLowerCase(),d+(V?qh(k):k)});function qh(d){return cu(yi(d).toLowerCase())}function Fh(d){return(d=yi(d))&&d.replace(te,jd).replace(Tt,"")}var pm=An(function(d,k,V){return d+(V?"-":"")+k.toLowerCase()}),dm=An(function(d,k,V){return d+(V?" ":"")+k.toLowerCase()}),mm=Vl("toLowerCase"),gm=An(function(d,k,V){return d+(V?"_":"")+k.toLowerCase()}),vm=An(function(d,k,V){return d+(V?" ":"")+cu(k)}),ym=An(function(d,k,V){return d+(V?" ":"")+k.toUpperCase()}),cu=Vl("toUpperCase");function zh(d,k,V){return d=yi(d),(k=V?v:k)===v?function(at){return ie.test(at)}(d)?function(at){return at.match(zt)||[]}(d):function(at){return at.match(Lt)||[]}(d):d.match(k)||[]}var $h=Xe(function(d,k){try{return ir(d,v,k)}catch(V){return ou(V)?V:new oi(V)}}),bm=Dr(function(d,k){return lr(k,function(V){V=jr(V),Pr(d,V,ru(d[V],d))}),d});function lu(d){return function(){return d}}var wm=Zl(),Mm=Zl(!0);function Yi(d){return d}function hu(d){return Sl(typeof d=="function"?d:pr(d,c))}var xm=Xe(function(d,k){return function(V){return Jn(V,d,k)}}),_m=Xe(function(d,k){return function(V){return Jn(d,V,k)}});function fu(d,k,V){var at=Ci(k),ct=Vo(k,at);V!=null||Ei(k)&&(ct.length||!at.length)||(V=k,k=d,d=this,ct=Vo(k,Ci(k)));var yt=!(Ei(V)&&"chain"in V&&!V.chain),St=qr(d);return lr(ct,function(Ot){var Ct=k[Ot];d[Ot]=Ct,St&&(d.prototype[Ot]=function(){var oe=this.__chain__;if(yt||oe){var ne=d(this.__wrapped__);return(ne.__actions__=Ki(this.__actions__)).push({func:Ct,args:arguments,thisArg:d}),ne.__chain__=oe,ne}return Ct.apply(d,Vr([this.value()],arguments))})}),d}function pu(){}var Sm=zs(Si),Em=zs(Kc),km=zs(ps);function Hh(d){return Ks(d)?ds(jr(d)):function(k){return function(V){return ln(V,k)}}(d)}var Im=Jl(),Om=Jl(!0);function du(){return[]}function mu(){return!1}var gu,Am=Yo(function(d,k){return d+k},0),Tm=$s("ceil"),Bm=Yo(function(d,k){return d/k},1),jm=$s("floor"),Rm=Yo(function(d,k){return d*k},1),Nm=$s("round"),Cm=Yo(function(d,k){return d-k},0);return dt.after=function(d,k){if(typeof k!="function")throw new hr(S);return d=Ve(d),function(){if(--d<1)return k.apply(this,arguments)}},dt.ary=_h,dt.assign=em,dt.assignIn=Ch,dt.assignInWith=ha,dt.assignWith=im,dt.at=rm,dt.before=Sh,dt.bind=ru,dt.bindAll=bm,dt.bindKey=Eh,dt.castArray=function(){if(!arguments.length)return[];var d=arguments[0];return We(d)?d:[d]},dt.chain=wh,dt.chunk=function(d,k,V){k=(V?Xi(d,k,V):k===v)?1:Ri(Ve(k),0);var at=d==null?0:d.length;if(!at||k<1)return[];for(var ct=0,yt=0,St=me(Uo(at/k));ct<at;)St[yt++]=dr(d,ct,ct+=k);return St},dt.compact=function(d){for(var k=-1,V=d==null?0:d.length,at=0,ct=[];++k<V;){var yt=d[k];yt&&(ct[at++]=yt)}return ct},dt.concat=function(){var d=arguments.length;if(!d)return[];for(var k=me(d-1),V=arguments[0],at=d;at--;)k[at-1]=arguments[at];return Vr(We(V)?Ki(V):[V],Di(k,1))},dt.cond=function(d){var k=d==null?0:d.length,V=Ne();return d=k?Si(d,function(at){if(typeof at[1]!="function")throw new hr(S);return[V(at[0]),at[1]]}):[],Xe(function(at){for(var ct=-1;++ct<k;){var yt=d[ct];if(ir(yt[0],this,at))return ir(yt[1],this,at)}})},dt.conforms=function(d){return function(k){var V=Ci(k);return function(at){return gl(at,k,V)}}(pr(d,c))},dt.constant=lu,dt.countBy=L0,dt.create=function(d,k){var V=In(d);return k==null?V:ml(V,k)},dt.curry=function d(k,V,at){var ct=Lr(k,E,v,v,v,v,v,V=at?v:V);return ct.placeholder=d.placeholder,ct},dt.curryRight=function d(k,V,at){var ct=Lr(k,I,v,v,v,v,v,V=at?v:V);return ct.placeholder=d.placeholder,ct},dt.debounce=kh,dt.defaults=nm,dt.defaultsDeep=om,dt.defer=W0,dt.delay=V0,dt.difference=b0,dt.differenceBy=w0,dt.differenceWith=M0,dt.drop=function(d,k,V){var at=d==null?0:d.length;return at?dr(d,(k=V||k===v?1:Ve(k))<0?0:k,at):[]},dt.dropRight=function(d,k,V){var at=d==null?0:d.length;return at?dr(d,0,(k=at-(k=V||k===v?1:Ve(k)))<0?0:k):[]},dt.dropRightWhile=function(d,k){return d&&d.length?Ko(d,Ne(k,3),!0,!0):[]},dt.dropWhile=function(d,k){return d&&d.length?Ko(d,Ne(k,3),!0):[]},dt.fill=function(d,k,V,at){var ct=d==null?0:d.length;return ct?(V&&typeof V!="number"&&Xi(d,k,V)&&(V=0,at=ct),function(yt,St,Ot,Ct){var oe=yt.length;for((Ot=Ve(Ot))<0&&(Ot=-Ot>oe?0:oe+Ot),(Ct=Ct===v||Ct>oe?oe:Ve(Ct))<0&&(Ct+=oe),Ct=Ot>Ct?0:Rh(Ct);Ot<Ct;)yt[Ot++]=St;return yt}(d,k,V,at)):[]},dt.filter=function(d,k){return(We(d)?Wr:bl)(d,Ne(k,3))},dt.flatMap=function(d,k){return Di(oa(d,k),1)},dt.flatMapDeep=function(d,k){return Di(oa(d,k),ot)},dt.flatMapDepth=function(d,k,V){return V=V===v?1:Ve(V),Di(oa(d,k),V)},dt.flatten=gh,dt.flattenDeep=function(d){return d!=null&&d.length?Di(d,ot):[]},dt.flattenDepth=function(d,k){return d!=null&&d.length?Di(d,k=k===v?1:Ve(k)):[]},dt.flip=function(d){return Lr(d,$)},dt.flow=wm,dt.flowRight=Mm,dt.fromPairs=function(d){for(var k=-1,V=d==null?0:d.length,at={};++k<V;){var ct=d[k];at[ct[0]]=ct[1]}return at},dt.functions=function(d){return d==null?[]:Vo(d,Ci(d))},dt.functionsIn=function(d){return d==null?[]:Vo(d,Gi(d))},dt.groupBy=q0,dt.initial=function(d){return d!=null&&d.length?dr(d,0,-1):[]},dt.intersection=x0,dt.intersectionBy=_0,dt.intersectionWith=S0,dt.invert=am,dt.invertBy=sm,dt.invokeMap=F0,dt.iteratee=hu,dt.keyBy=z0,dt.keys=Ci,dt.keysIn=Gi,dt.map=oa,dt.mapKeys=function(d,k){var V={};return k=Ne(k,3),Tr(d,function(at,ct,yt){Pr(V,k(at,ct,yt),at)}),V},dt.mapValues=function(d,k){var V={};return k=Ne(k,3),Tr(d,function(at,ct,yt){Pr(V,ct,k(at,ct,yt))}),V},dt.matches=function(d){return kl(pr(d,c))},dt.matchesProperty=function(d,k){return Il(d,pr(k,c))},dt.memoize=sa,dt.merge=cm,dt.mergeWith=Ph,dt.method=xm,dt.methodOf=_m,dt.mixin=fu,dt.negate=ua,dt.nthArg=function(d){return d=Ve(d),Xe(function(k){return Ol(k,d)})},dt.omit=lm,dt.omitBy=function(d,k){return Lh(d,ua(Ne(k)))},dt.once=function(d){return Sh(2,d)},dt.orderBy=function(d,k,V,at){return d==null?[]:(We(k)||(k=k==null?[]:[k]),We(V=at?v:V)||(V=V==null?[]:[V]),Al(d,k,V))},dt.over=Sm,dt.overArgs=X0,dt.overEvery=Em,dt.overSome=km,dt.partial=nu,dt.partialRight=Ih,dt.partition=$0,dt.pick=hm,dt.pickBy=Lh,dt.property=Hh,dt.propertyOf=function(d){return function(k){return d==null?v:ln(d,k)}},dt.pull=E0,dt.pullAll=yh,dt.pullAllBy=function(d,k,V){return d&&d.length&&k&&k.length?Rs(d,k,Ne(V,2)):d},dt.pullAllWith=function(d,k,V){return d&&d.length&&k&&k.length?Rs(d,k,v,V):d},dt.pullAt=k0,dt.range=Im,dt.rangeRight=Om,dt.rearg=Z0,dt.reject=function(d,k){return(We(d)?Wr:bl)(d,ua(Ne(k,3)))},dt.remove=function(d,k){var V=[];if(!d||!d.length)return V;var at=-1,ct=[],yt=d.length;for(k=Ne(k,3);++at<yt;){var St=d[at];k(St,at,d)&&(V.push(St),ct.push(at))}return Bl(d,ct),V},dt.rest=function(d,k){if(typeof d!="function")throw new hr(S);return Xe(d,k=k===v?k:Ve(k))},dt.reverse=eu,dt.sampleSize=function(d,k,V){return k=(V?Xi(d,k,V):k===v)?1:Ve(k),(We(d)?r0:l0)(d,k)},dt.set=function(d,k,V){return d==null?d:Yn(d,k,V)},dt.setWith=function(d,k,V,at){return at=typeof at=="function"?at:v,d==null?d:Yn(d,k,V,at)},dt.shuffle=function(d){return(We(d)?n0:f0)(d)},dt.slice=function(d,k,V){var at=d==null?0:d.length;return at?(V&&typeof V!="number"&&Xi(d,k,V)?(k=0,V=at):(k=k==null?0:Ve(k),V=V===v?at:Ve(V)),dr(d,k,V)):[]},dt.sortBy=H0,dt.sortedUniq=function(d){return d&&d.length?Rl(d):[]},dt.sortedUniqBy=function(d,k){return d&&d.length?Rl(d,Ne(k,2)):[]},dt.split=function(d,k,V){return V&&typeof V!="number"&&Xi(d,k,V)&&(k=V=v),(V=V===v?i:V>>>0)?(d=yi(d))&&(typeof k=="string"||k!=null&&!au(k))&&!(k=nr(k))&&xn(d)?Yr(Mr(d),0,V):d.split(k,V):[]},dt.spread=function(d,k){if(typeof d!="function")throw new hr(S);return k=k==null?0:Ri(Ve(k),0),Xe(function(V){var at=V[k],ct=Yr(V,0,k);return at&&Vr(ct,at),ir(d,this,ct)})},dt.tail=function(d){var k=d==null?0:d.length;return k?dr(d,1,k):[]},dt.take=function(d,k,V){return d&&d.length?dr(d,0,(k=V||k===v?1:Ve(k))<0?0:k):[]},dt.takeRight=function(d,k,V){var at=d==null?0:d.length;return at?dr(d,(k=at-(k=V||k===v?1:Ve(k)))<0?0:k,at):[]},dt.takeRightWhile=function(d,k){return d&&d.length?Ko(d,Ne(k,3),!1,!0):[]},dt.takeWhile=function(d,k){return d&&d.length?Ko(d,Ne(k,3)):[]},dt.tap=function(d,k){return k(d),d},dt.throttle=function(d,k,V){var at=!0,ct=!0;if(typeof d!="function")throw new hr(S);return Ei(V)&&(at="leading"in V?!!V.leading:at,ct="trailing"in V?!!V.trailing:ct),kh(d,k,{leading:at,maxWait:k,trailing:ct})},dt.thru=na,dt.toArray=jh,dt.toPairs=Dh,dt.toPairsIn=Uh,dt.toPath=function(d){return We(d)?Si(d,jr):or(d)?[d]:Ki(fh(yi(d)))},dt.toPlainObject=Nh,dt.transform=function(d,k,V){var at=We(d),ct=at||Qr(d)||Bn(d);if(k=Ne(k,4),V==null){var yt=d&&d.constructor;V=ct?at?new yt:[]:Ei(d)&&qr(yt)?In(Po(d)):{}}return(ct?lr:Tr)(d,function(St,Ot,Ct){return k(V,St,Ot,Ct)}),V},dt.unary=function(d){return _h(d,1)},dt.union=I0,dt.unionBy=O0,dt.unionWith=A0,dt.uniq=function(d){return d&&d.length?Jr(d):[]},dt.uniqBy=function(d,k){return d&&d.length?Jr(d,Ne(k,2)):[]},dt.uniqWith=function(d,k){return k=typeof k=="function"?k:v,d&&d.length?Jr(d,v,k):[]},dt.unset=function(d,k){return d==null||Ls(d,k)},dt.unzip=iu,dt.unzipWith=bh,dt.update=function(d,k,V){return d==null?d:Cl(d,k,qs(V))},dt.updateWith=function(d,k,V,at){return at=typeof at=="function"?at:v,d==null?d:Cl(d,k,qs(V),at)},dt.values=jn,dt.valuesIn=function(d){return d==null?[]:ys(d,Gi(d))},dt.without=T0,dt.words=zh,dt.wrap=function(d,k){return nu(qs(k),d)},dt.xor=B0,dt.xorBy=j0,dt.xorWith=R0,dt.zip=N0,dt.zipObject=function(d,k){return Ll(d||[],k||[],Zn)},dt.zipObjectDeep=function(d,k){return Ll(d||[],k||[],Yn)},dt.zipWith=C0,dt.entries=Dh,dt.entriesIn=Uh,dt.extend=Ch,dt.extendWith=ha,fu(dt,dt),dt.add=Am,dt.attempt=$h,dt.camelCase=fm,dt.capitalize=qh,dt.ceil=Tm,dt.clamp=function(d,k,V){return V===v&&(V=k,k=v),V!==v&&(V=(V=gr(V))==V?V:0),k!==v&&(k=(k=gr(k))==k?k:0),cn(gr(d),k,V)},dt.clone=function(d){return pr(d,f)},dt.cloneDeep=function(d){return pr(d,c|f)},dt.cloneDeepWith=function(d,k){return pr(d,c|f,k=typeof k=="function"?k:v)},dt.cloneWith=function(d,k){return pr(d,f,k=typeof k=="function"?k:v)},dt.conformsTo=function(d,k){return k==null||gl(d,k,Ci(k))},dt.deburr=Fh,dt.defaultTo=function(d,k){return d==null||d!=d?k:d},dt.divide=Bm,dt.endsWith=function(d,k,V){d=yi(d),k=nr(k);var at=d.length,ct=V=V===v?at:cn(Ve(V),0,at);return(V-=k.length)>=0&&d.slice(V,ct)==k},dt.eq=_r,dt.escape=function(d){return(d=yi(d))&&Ht.test(d)?d.replace(Ce,Rd):d},dt.escapeRegExp=function(d){return(d=yi(d))&&jt.test(d)?d.replace(ke,"\\$&"):d},dt.every=function(d,k,V){var at=We(d)?Kc:a0;return V&&Xi(d,k,V)&&(k=v),at(d,Ne(k,3))},dt.find=D0,dt.findIndex=dh,dt.findKey=function(d,k){return Jc(d,Ne(k,3),Tr)},dt.findLast=U0,dt.findLastIndex=mh,dt.findLastKey=function(d,k){return Jc(d,Ne(k,3),Is)},dt.floor=jm,dt.forEach=Mh,dt.forEachRight=xh,dt.forIn=function(d,k){return d==null?d:ks(d,Ne(k,3),Gi)},dt.forInRight=function(d,k){return d==null?d:wl(d,Ne(k,3),Gi)},dt.forOwn=function(d,k){return d&&Tr(d,Ne(k,3))},dt.forOwnRight=function(d,k){return d&&Is(d,Ne(k,3))},dt.get=su,dt.gt=K0,dt.gte=J0,dt.has=function(d,k){return d!=null&&rh(d,k,s0)},dt.hasIn=uu,dt.head=vh,dt.identity=Yi,dt.includes=function(d,k,V,at){d=Ji(d)?d:jn(d),V=V&&!at?Ve(V):0;var ct=d.length;return V<0&&(V=Ri(ct+V,0)),la(d)?V<=ct&&d.indexOf(k,V)>-1:!!ct&&Mn(d,k,V)>-1},dt.indexOf=function(d,k,V){var at=d==null?0:d.length;if(!at)return-1;var ct=V==null?0:Ve(V);return ct<0&&(ct=Ri(at+ct,0)),Mn(d,k,ct)},dt.inRange=function(d,k,V){return k=Fr(k),V===v?(V=k,k=0):V=Fr(V),function(at,ct,yt){return at>=Ui(ct,yt)&&at<Ri(ct,yt)}(d=gr(d),k,V)},dt.invoke=um,dt.isArguments=pn,dt.isArray=We,dt.isArrayBuffer=G0,dt.isArrayLike=Ji,dt.isArrayLikeObject=Ai,dt.isBoolean=function(d){return d===!0||d===!1||Ii(d)&&Vi(d)==T},dt.isBuffer=Qr,dt.isDate=Y0,dt.isElement=function(d){return Ii(d)&&d.nodeType===1&&!io(d)},dt.isEmpty=function(d){if(d==null)return!0;if(Ji(d)&&(We(d)||typeof d=="string"||typeof d.splice=="function"||Qr(d)||Bn(d)||pn(d)))return!d.length;var k=qi(d);if(k==G||k==gt)return!d.size;if(to(d))return!Bs(d).length;for(var V in d)if(bi.call(d,V))return!1;return!0},dt.isEqual=function(d,k){return Gn(d,k)},dt.isEqualWith=function(d,k,V){var at=(V=typeof V=="function"?V:v)?V(d,k):v;return at===v?Gn(d,k,v,V):!!at},dt.isError=ou,dt.isFinite=function(d){return typeof d=="number"&&ll(d)},dt.isFunction=qr,dt.isInteger=Oh,dt.isLength=ca,dt.isMap=Ah,dt.isMatch=function(d,k){return d===k||Ts(d,k,Xs(k))},dt.isMatchWith=function(d,k,V){return V=typeof V=="function"?V:v,Ts(d,k,Xs(k),V)},dt.isNaN=function(d){return Th(d)&&d!=+d},dt.isNative=function(d){if(y0(d))throw new oi("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return _l(d)},dt.isNil=function(d){return d==null},dt.isNull=function(d){return d===null},dt.isNumber=Th,dt.isObject=Ei,dt.isObjectLike=Ii,dt.isPlainObject=io,dt.isRegExp=au,dt.isSafeInteger=function(d){return Oh(d)&&d>=-t&&d<=t},dt.isSet=Bh,dt.isString=la,dt.isSymbol=or,dt.isTypedArray=Bn,dt.isUndefined=function(d){return d===v},dt.isWeakMap=function(d){return Ii(d)&&qi(d)==It},dt.isWeakSet=function(d){return Ii(d)&&Vi(d)=="[object WeakSet]"},dt.join=function(d,k){return d==null?"":Xd.call(d,k)},dt.kebabCase=pm,dt.last=mr,dt.lastIndexOf=function(d,k,V){var at=d==null?0:d.length;if(!at)return-1;var ct=at;return V!==v&&(ct=(ct=Ve(V))<0?Ri(at+ct,0):Ui(ct,at-1)),k==k?function(yt,St,Ot){for(var Ct=Ot+1;Ct--;)if(yt[Ct]===St)return Ct;return Ct}(d,k,ct):Io(d,Gc,ct,!0)},dt.lowerCase=dm,dt.lowerFirst=mm,dt.lt=Q0,dt.lte=tm,dt.max=function(d){return d&&d.length?Wo(d,Yi,Os):v},dt.maxBy=function(d,k){return d&&d.length?Wo(d,Ne(k,2),Os):v},dt.mean=function(d){return Yc(d,Yi)},dt.meanBy=function(d,k){return Yc(d,Ne(k,2))},dt.min=function(d){return d&&d.length?Wo(d,Yi,js):v},dt.minBy=function(d,k){return d&&d.length?Wo(d,Ne(k,2),js):v},dt.stubArray=du,dt.stubFalse=mu,dt.stubObject=function(){return{}},dt.stubString=function(){return""},dt.stubTrue=function(){return!0},dt.multiply=Rm,dt.nth=function(d,k){return d&&d.length?Ol(d,Ve(k)):v},dt.noConflict=function(){return de._===this&&(de._=Fd),this},dt.noop=pu,dt.now=aa,dt.pad=function(d,k,V){d=yi(d);var at=(k=Ve(k))?_n(d):0;if(!k||at>=k)return d;var ct=(k-at)/2;return Qo(qo(ct),V)+d+Qo(Uo(ct),V)},dt.padEnd=function(d,k,V){d=yi(d);var at=(k=Ve(k))?_n(d):0;return k&&at<k?d+Qo(k-at,V):d},dt.padStart=function(d,k,V){d=yi(d);var at=(k=Ve(k))?_n(d):0;return k&&at<k?Qo(k-at,V)+d:d},dt.parseInt=function(d,k,V){return V||k==null?k=0:k&&(k=+k),Jd(yi(d).replace(Zt,""),k||0)},dt.random=function(d,k,V){if(V&&typeof V!="boolean"&&Xi(d,k,V)&&(k=V=v),V===v&&(typeof k=="boolean"?(V=k,k=v):typeof d=="boolean"&&(V=d,d=v)),d===v&&k===v?(d=0,k=1):(d=Fr(d),k===v?(k=d,d=0):k=Fr(k)),d>k){var at=d;d=k,k=at}if(V||d%1||k%1){var ct=hl();return Ui(d+ct*(k-d+Ge("1e-"+((ct+"").length-1))),k)}return Ns(d,k)},dt.reduce=function(d,k,V){var at=We(d)?fs:Qc,ct=arguments.length<3;return at(d,Ne(k,4),V,ct,Kr)},dt.reduceRight=function(d,k,V){var at=We(d)?Ad:Qc,ct=arguments.length<3;return at(d,Ne(k,4),V,ct,yl)},dt.repeat=function(d,k,V){return k=(V?Xi(d,k,V):k===v)?1:Ve(k),Cs(yi(d),k)},dt.replace=function(){var d=arguments,k=yi(d[0]);return d.length<3?k:k.replace(d[1],d[2])},dt.result=function(d,k,V){var at=-1,ct=(k=Gr(k,d)).length;for(ct||(ct=1,d=v);++at<ct;){var yt=d==null?v:d[jr(k[at])];yt===v&&(at=ct,yt=V),d=qr(yt)?yt.call(d):yt}return d},dt.round=Nm,dt.runInContext=$t,dt.sample=function(d){return(We(d)?dl:c0)(d)},dt.size=function(d){if(d==null)return 0;if(Ji(d))return la(d)?_n(d):d.length;var k=qi(d);return k==G||k==gt?d.size:Bs(d).length},dt.snakeCase=gm,dt.some=function(d,k,V){var at=We(d)?ps:p0;return V&&Xi(d,k,V)&&(k=v),at(d,Ne(k,3))},dt.sortedIndex=function(d,k){return Zo(d,k)},dt.sortedIndexBy=function(d,k,V){return Ps(d,k,Ne(V,2))},dt.sortedIndexOf=function(d,k){var V=d==null?0:d.length;if(V){var at=Zo(d,k);if(at<V&&_r(d[at],k))return at}return-1},dt.sortedLastIndex=function(d,k){return Zo(d,k,!0)},dt.sortedLastIndexBy=function(d,k,V){return Ps(d,k,Ne(V,2),!0)},dt.sortedLastIndexOf=function(d,k){if(d!=null&&d.length){var V=Zo(d,k,!0)-1;if(_r(d[V],k))return V}return-1},dt.startCase=vm,dt.startsWith=function(d,k,V){return d=yi(d),V=V==null?0:cn(Ve(V),0,d.length),k=nr(k),d.slice(V,V+k.length)==k},dt.subtract=Cm,dt.sum=function(d){return d&&d.length?gs(d,Yi):0},dt.sumBy=function(d,k){return d&&d.length?gs(d,Ne(k,2)):0},dt.template=function(d,k,V){var at=dt.templateSettings;V&&Xi(d,k,V)&&(k=v),d=yi(d),k=ha({},k,at,Ql);var ct,yt,St=ha({},k.imports,at.imports,Ql),Ot=Ci(St),Ct=ys(St,Ot),oe=0,ne=k.interpolate||Ae,le="__p += '",Me=ws((k.escape||Ae).source+"|"+ne.source+"|"+(ne===Wt?Ut:Ae).source+"|"+(k.evaluate||Ae).source+"|$","g"),_e="//# sourceURL="+(bi.call(k,"sourceURL")?(k.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++xe+"]")+`
|
|
77
|
+
`)}(at,function(ct,yt){return lr(s,function(St){var Ot="_."+St[0];yt&St[1]&&!ko(ct,Ot)&&ct.push(Ot)}),ct.sort()}(function(ct){var yt=ct.match(Jt);return yt?yt[1].split(De):[]}(at),V)))}function hh(d){var k=0,V=0;return function(){var at=Kd(),ct=Q-(at-V);if(V=at,ct>0){if(++k>=et)return arguments[0]}else k=0;return d.apply(v,arguments)}}function ra(d,k){var V=-1,at=d.length,ct=at-1;for(k=k===v?at:k;++V<k;){var yt=Ns(V,ct),St=d[yt];d[yt]=d[V],d[V]=St}return d.length=k,d}var Qs,tu,fh=(Qs=sa(function(d){var k=[];return d.charCodeAt(0)===46&&k.push(""),d.replace(Xt,function(V,at,ct,yt){k.push(ct?yt.replace(ze,"$1"):at||V)}),k},function(d){return tu.size===500&&tu.clear(),d}),tu=Qs.cache,Qs);function jr(d){if(typeof d=="string"||or(d))return d;var k=d+"";return k=="0"&&1/d==-ot?"-0":k}function fn(d){if(d!=null){try{return jo.call(d)}catch{}try{return d+""}catch{}}return""}function ph(d){if(d instanceof Qe)return d.clone();var k=new fr(d.__wrapped__,d.__chain__);return k.__actions__=Ki(d.__actions__),k.__index__=d.__index__,k.__values__=d.__values__,k}var b0=Xe(function(d,k){return Ai(d)?Kn(d,Di(k,1,Ai,!0)):[]}),w0=Xe(function(d,k){var V=mr(k);return Ai(V)&&(V=v),Ai(d)?Kn(d,Di(k,1,Ai,!0),Ne(V,2)):[]}),M0=Xe(function(d,k){var V=mr(k);return Ai(V)&&(V=v),Ai(d)?Kn(d,Di(k,1,Ai,!0),v,V):[]});function dh(d,k,V){var at=d==null?0:d.length;if(!at)return-1;var ct=V==null?0:Ve(V);return ct<0&&(ct=Ri(at+ct,0)),Io(d,Ne(k,3),ct)}function mh(d,k,V){var at=d==null?0:d.length;if(!at)return-1;var ct=at-1;return V!==v&&(ct=Ve(V),ct=V<0?Ri(at+ct,0):Ui(ct,at-1)),Io(d,Ne(k,3),ct,!0)}function gh(d){return d!=null&&d.length?Di(d,1):[]}function vh(d){return d&&d.length?d[0]:v}var x0=Xe(function(d){var k=Si(d,Us);return k.length&&k[0]===d[0]?As(k):[]}),_0=Xe(function(d){var k=mr(d),V=Si(d,Us);return k===mr(V)?k=v:V.pop(),V.length&&V[0]===d[0]?As(V,Ne(k,2)):[]}),S0=Xe(function(d){var k=mr(d),V=Si(d,Us);return(k=typeof k=="function"?k:v)&&V.pop(),V.length&&V[0]===d[0]?As(V,v,k):[]});function mr(d){var k=d==null?0:d.length;return k?d[k-1]:v}var E0=Xe(yh);function yh(d,k){return d&&d.length&&k&&k.length?Rs(d,k):d}var k0=Dr(function(d,k){var V=d==null?0:d.length,at=Es(d,k);return Bl(d,Si(k,function(ct){return Ur(ct,V)?+ct:ct}).sort(Fl)),at});function eu(d){return d==null?d:Gd.call(d)}var I0=Xe(function(d){return Jr(Di(d,1,Ai,!0))}),O0=Xe(function(d){var k=mr(d);return Ai(k)&&(k=v),Jr(Di(d,1,Ai,!0),Ne(k,2))}),A0=Xe(function(d){var k=mr(d);return k=typeof k=="function"?k:v,Jr(Di(d,1,Ai,!0),v,k)});function iu(d){if(!d||!d.length)return[];var k=0;return d=Wr(d,function(V){if(Ai(V))return k=Ri(V.length,k),!0}),vs(k,function(V){return Si(d,ds(V))})}function bh(d,k){if(!d||!d.length)return[];var V=iu(d);return k==null?V:Si(V,function(at){return ir(k,v,at)})}var T0=Xe(function(d,k){return Ai(d)?Kn(d,k):[]}),B0=Xe(function(d){return Ds(Wr(d,Ai))}),j0=Xe(function(d){var k=mr(d);return Ai(k)&&(k=v),Ds(Wr(d,Ai),Ne(k,2))}),R0=Xe(function(d){var k=mr(d);return k=typeof k=="function"?k:v,Ds(Wr(d,Ai),v,k)}),N0=Xe(iu),C0=Xe(function(d){var k=d.length,V=k>1?d[k-1]:v;return V=typeof V=="function"?(d.pop(),V):v,bh(d,V)});function wh(d){var k=dt(d);return k.__chain__=!0,k}function na(d,k){return k(d)}var P0=Dr(function(d){var k=d.length,V=k?d[0]:0,at=this.__wrapped__,ct=function(yt){return Es(yt,d)};return!(k>1||this.__actions__.length)&&at instanceof Qe&&Ur(V)?((at=at.slice(V,+V+(k?1:0))).__actions__.push({func:na,args:[ct],thisArg:v}),new fr(at,this.__chain__).thru(function(yt){return k&&!yt.length&&yt.push(v),yt})):this.thru(ct)}),L0=Jo(function(d,k,V){bi.call(d,V)?++d[V]:Pr(d,V,1)}),D0=Xl(dh),U0=Xl(mh);function Mh(d,k){return(We(d)?lr:Kr)(d,Ne(k,3))}function xh(d,k){return(We(d)?Od:yl)(d,Ne(k,3))}var q0=Jo(function(d,k,V){bi.call(d,V)?d[V].push(k):Pr(d,V,[k])}),F0=Xe(function(d,k,V){var at=-1,ct=typeof k=="function",yt=Ji(d)?me(d.length):[];return Kr(d,function(St){yt[++at]=ct?ir(k,St,V):Jn(St,k,V)}),yt}),z0=Jo(function(d,k,V){Pr(d,V,k)});function oa(d,k){return(We(d)?Si:El)(d,Ne(k,3))}var $0=Jo(function(d,k,V){d[V?0:1].push(k)},function(){return[[],[]]}),H0=Xe(function(d,k){if(d==null)return[];var V=k.length;return V>1&&Xi(d,k[0],k[1])?k=[]:V>2&&Xi(k[0],k[1],k[2])&&(k=[k[0]]),Al(d,Di(k,1),[])}),aa=Hd||function(){return de.Date.now()};function _h(d,k,V){return k=V?v:k,k=d&&k==null?d.length:k,Lr(d,P,v,v,v,v,k)}function Sh(d,k){var V;if(typeof k!="function")throw new hr(S);return d=Ve(d),function(){return--d>0&&(V=k.apply(this,arguments)),d<=1&&(k=v),V}}var ru=Xe(function(d,k,V){var at=u;if(V.length){var ct=Xr(V,Tn(ru));at|=M}return Lr(d,at,k,V,ct)}),Eh=Xe(function(d,k,V){var at=u|w;if(V.length){var ct=Xr(V,Tn(Eh));at|=M}return Lr(k,at,d,V,ct)});function kh(d,k,V){var at,ct,yt,St,Ot,Ct,oe=0,ne=!1,le=!1,Me=!0;if(typeof d!="function")throw new hr(S);function _e(pe){var Fe=at,Ue=ct;return at=ct=v,oe=pe,St=d.apply(Ue,Fe)}function Ie(pe){var Fe=pe-Ct;return Ct===v||Fe>=k||Fe<0||le&&pe-oe>=yt}function se(){var pe=aa();if(Ie(pe))return he(pe);Ot=eo(se,function(Fe){var Ue=k-(Fe-Ct);return le?Ui(Ue,yt-(Fe-oe)):Ue}(pe))}function he(pe){return Ot=v,Me&&at?_e(pe):(at=ct=v,St)}function Be(){var pe=aa(),Fe=Ie(pe);if(at=arguments,ct=this,Ct=pe,Fe){if(Ot===v)return function(Ue){return oe=Ue,Ot=eo(se,k),ne?_e(Ue):St}(Ct);if(le)return Dl(Ot),Ot=eo(se,k),_e(Ct)}return Ot===v&&(Ot=eo(se,k)),St}return k=gr(k)||0,Ei(V)&&(ne=!!V.leading,yt=(le="maxWait"in V)?Ri(gr(V.maxWait)||0,k):yt,Me="trailing"in V?!!V.trailing:Me),Be.cancel=function(){Ot!==v&&Dl(Ot),oe=0,at=Ct=ct=Ot=v},Be.flush=function(){return Ot===v?St:he(aa())},Be}var W0=Xe(function(d,k){return vl(d,1,k)}),V0=Xe(function(d,k,V){return vl(d,gr(k)||0,V)});function sa(d,k){if(typeof d!="function"||k!=null&&typeof k!="function")throw new hr(S);var V=function(){var at=arguments,ct=k?k.apply(this,at):at[0],yt=V.cache;if(yt.has(ct))return yt.get(ct);var St=d.apply(this,at);return V.cache=yt.set(ct,St)||yt,St};return V.cache=new(sa.Cache||Cr),V}function ua(d){if(typeof d!="function")throw new hr(S);return function(){var k=arguments;switch(k.length){case 0:return!d.call(this);case 1:return!d.call(this,k[0]);case 2:return!d.call(this,k[0],k[1]);case 3:return!d.call(this,k[0],k[1],k[2])}return!d.apply(this,k)}}sa.Cache=Cr;var X0=d0(function(d,k){var V=(k=k.length==1&&We(k[0])?Si(k[0],rr(Ne())):Si(Di(k,1),rr(Ne()))).length;return Xe(function(at){for(var ct=-1,yt=Ui(at.length,V);++ct<yt;)at[ct]=k[ct].call(this,at[ct]);return ir(d,this,at)})}),nu=Xe(function(d,k){var V=Xr(k,Tn(nu));return Lr(d,M,v,k,V)}),Ih=Xe(function(d,k){var V=Xr(k,Tn(Ih));return Lr(d,B,v,k,V)}),Z0=Dr(function(d,k){return Lr(d,N,v,v,v,k)});function _r(d,k){return d===k||d!=d&&k!=k}var K0=ta(Os),J0=ta(function(d,k){return d>=k}),pn=xl(function(){return arguments}())?xl:function(d){return Ii(d)&&bi.call(d,"callee")&&!ul.call(d,"callee")},We=me.isArray,G0=wr?rr(wr):function(d){return Ii(d)&&Vi(d)==J};function Ji(d){return d!=null&&ca(d.length)&&!qr(d)}function Ai(d){return Ii(d)&&Ji(d)}var Qr=Vd||mu,Y0=Wi?rr(Wi):function(d){return Ii(d)&&Vi(d)==R};function ou(d){if(!Ii(d))return!1;var k=Vi(d);return k==Z||k==q||typeof d.message=="string"&&typeof d.name=="string"&&!io(d)}function qr(d){if(!Ei(d))return!1;var k=Vi(d);return k==rt||k==D||k==j||k==lt}function Oh(d){return typeof d=="number"&&d==Ve(d)}function ca(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=t}function Ei(d){var k=typeof d;return d!=null&&(k=="object"||k=="function")}function Ii(d){return d!=null&&typeof d=="object"}var Ah=Or?rr(Or):function(d){return Ii(d)&&qi(d)==G};function Th(d){return typeof d=="number"||Ii(d)&&Vi(d)==z}function io(d){if(!Ii(d)||Vi(d)!=st)return!1;var k=Po(d);if(k===null)return!0;var V=bi.call(k,"constructor")&&k.constructor;return typeof V=="function"&&V instanceof V&&jo.call(V)==qd}var au=Vc?rr(Vc):function(d){return Ii(d)&&Vi(d)==Et},Bh=Xc?rr(Xc):function(d){return Ii(d)&&qi(d)==gt};function la(d){return typeof d=="string"||!We(d)&&Ii(d)&&Vi(d)==bt}function or(d){return typeof d=="symbol"||Ii(d)&&Vi(d)==Bt}var Bn=Zc?rr(Zc):function(d){return Ii(d)&&ca(d.length)&&!!Se[Vi(d)]},Q0=ta(js),tm=ta(function(d,k){return d<=k});function jh(d){if(!d)return[];if(Ji(d))return la(d)?Mr(d):Ki(d);if($n&&d[$n])return function(V){for(var at,ct=[];!(at=V.next()).done;)ct.push(at.value);return ct}(d[$n]());var k=qi(d);return(k==G?bs:k==gt?Oo:jn)(d)}function Fr(d){return d?(d=gr(d))===ot||d===-ot?(d<0?-1:1)*n:d==d?d:0:d===0?d:0}function Ve(d){var k=Fr(d),V=k%1;return k==k?V?k-V:k:0}function Rh(d){return d?cn(Ve(d),0,i):0}function gr(d){if(typeof d=="number")return d;if(or(d))return r;if(Ei(d)){var k=typeof d.valueOf=="function"?d.valueOf():d;d=Ei(k)?k+"":k}if(typeof d!="string")return d===0?d:+d;d=tl(d);var V=qt.test(d);return V||He.test(d)?Hi(d.slice(2),V?2:8):$e.test(d)?r:+d}function Nh(d){return Br(d,Gi(d))}function yi(d){return d==null?"":nr(d)}var em=On(function(d,k){if(to(k)||Ji(k))Br(k,Pi(k),d);else for(var V in k)bi.call(k,V)&&Zn(d,V,k[V])}),Ch=On(function(d,k){Br(k,Gi(k),d)}),ha=On(function(d,k,V,at){Br(k,Gi(k),d,at)}),im=On(function(d,k,V,at){Br(k,Pi(k),d,at)}),rm=Dr(Es),nm=Xe(function(d,k){d=xi(d);var V=-1,at=k.length,ct=at>2?k[2]:v;for(ct&&Xi(k[0],k[1],ct)&&(at=1);++V<at;)for(var yt=k[V],St=Gi(yt),Ot=-1,Ct=St.length;++Ot<Ct;){var oe=St[Ot],ne=d[oe];(ne===v||_r(ne,Sn[oe])&&!bi.call(d,oe))&&(d[oe]=yt[oe])}return d}),om=Xe(function(d){return d.push(v,th),ir(Ph,v,d)});function su(d,k,V){var at=d==null?v:ln(d,k);return at===v?V:at}function uu(d,k){return d!=null&&rh(d,k,u0)}var am=Kl(function(d,k,V){k!=null&&typeof k.toString!="function"&&(k=Ro.call(k)),d[k]=V},lu(Yi)),sm=Kl(function(d,k,V){k!=null&&typeof k.toString!="function"&&(k=Ro.call(k)),bi.call(d,k)?d[k].push(V):d[k]=[V]},Ne),um=Xe(Jn);function Pi(d){return Ji(d)?pl(d):Bs(d)}function Gi(d){return Ji(d)?pl(d,!0):function(k){if(!Ei(k))return function(yt){var St=[];if(yt!=null)for(var Ot in xi(yt))St.push(Ot);return St}(k);var V=to(k),at=[];for(var ct in k)(ct!="constructor"||!V&&bi.call(k,ct))&&at.push(ct);return at}(d)}var cm=On(function(d,k,V){Xo(d,k,V)}),Ph=On(function(d,k,V,at){Xo(d,k,V,at)}),lm=Dr(function(d,k){var V={};if(d==null)return V;var at=!1;k=Si(k,function(yt){return yt=Gr(yt,d),at||(at=yt.length>1),yt}),Br(d,Ws(d),V),at&&(V=pr(V,c|l|f,g0));for(var ct=k.length;ct--;)Ls(V,k[ct]);return V}),hm=Dr(function(d,k){return d==null?{}:function(V,at){return Tl(V,at,function(ct,yt){return uu(V,yt)})}(d,k)});function Lh(d,k){if(d==null)return{};var V=Si(Ws(d),function(at){return[at]});return k=Ne(k),Tl(d,V,function(at,ct){return k(at,ct[0])})}var Dh=Yl(Pi),Uh=Yl(Gi);function jn(d){return d==null?[]:ys(d,Pi(d))}var fm=An(function(d,k,V){return k=k.toLowerCase(),d+(V?qh(k):k)});function qh(d){return cu(yi(d).toLowerCase())}function Fh(d){return(d=yi(d))&&d.replace(te,jd).replace(Tt,"")}var pm=An(function(d,k,V){return d+(V?"-":"")+k.toLowerCase()}),dm=An(function(d,k,V){return d+(V?" ":"")+k.toLowerCase()}),mm=Vl("toLowerCase"),gm=An(function(d,k,V){return d+(V?"_":"")+k.toLowerCase()}),vm=An(function(d,k,V){return d+(V?" ":"")+cu(k)}),ym=An(function(d,k,V){return d+(V?" ":"")+k.toUpperCase()}),cu=Vl("toUpperCase");function zh(d,k,V){return d=yi(d),(k=V?v:k)===v?function(at){return ie.test(at)}(d)?function(at){return at.match(zt)||[]}(d):function(at){return at.match(Lt)||[]}(d):d.match(k)||[]}var $h=Xe(function(d,k){try{return ir(d,v,k)}catch(V){return ou(V)?V:new oi(V)}}),bm=Dr(function(d,k){return lr(k,function(V){V=jr(V),Pr(d,V,ru(d[V],d))}),d});function lu(d){return function(){return d}}var wm=Zl(),Mm=Zl(!0);function Yi(d){return d}function hu(d){return Sl(typeof d=="function"?d:pr(d,c))}var xm=Xe(function(d,k){return function(V){return Jn(V,d,k)}}),_m=Xe(function(d,k){return function(V){return Jn(d,V,k)}});function fu(d,k,V){var at=Pi(k),ct=Vo(k,at);V!=null||Ei(k)&&(ct.length||!at.length)||(V=k,k=d,d=this,ct=Vo(k,Pi(k)));var yt=!(Ei(V)&&"chain"in V&&!V.chain),St=qr(d);return lr(ct,function(Ot){var Ct=k[Ot];d[Ot]=Ct,St&&(d.prototype[Ot]=function(){var oe=this.__chain__;if(yt||oe){var ne=d(this.__wrapped__);return(ne.__actions__=Ki(this.__actions__)).push({func:Ct,args:arguments,thisArg:d}),ne.__chain__=oe,ne}return Ct.apply(d,Vr([this.value()],arguments))})}),d}function pu(){}var Sm=zs(Si),Em=zs(Kc),km=zs(ps);function Hh(d){return Ks(d)?ds(jr(d)):function(k){return function(V){return ln(V,k)}}(d)}var Im=Jl(),Om=Jl(!0);function du(){return[]}function mu(){return!1}var gu,Am=Yo(function(d,k){return d+k},0),Tm=$s("ceil"),Bm=Yo(function(d,k){return d/k},1),jm=$s("floor"),Rm=Yo(function(d,k){return d*k},1),Nm=$s("round"),Cm=Yo(function(d,k){return d-k},0);return dt.after=function(d,k){if(typeof k!="function")throw new hr(S);return d=Ve(d),function(){if(--d<1)return k.apply(this,arguments)}},dt.ary=_h,dt.assign=em,dt.assignIn=Ch,dt.assignInWith=ha,dt.assignWith=im,dt.at=rm,dt.before=Sh,dt.bind=ru,dt.bindAll=bm,dt.bindKey=Eh,dt.castArray=function(){if(!arguments.length)return[];var d=arguments[0];return We(d)?d:[d]},dt.chain=wh,dt.chunk=function(d,k,V){k=(V?Xi(d,k,V):k===v)?1:Ri(Ve(k),0);var at=d==null?0:d.length;if(!at||k<1)return[];for(var ct=0,yt=0,St=me(Uo(at/k));ct<at;)St[yt++]=dr(d,ct,ct+=k);return St},dt.compact=function(d){for(var k=-1,V=d==null?0:d.length,at=0,ct=[];++k<V;){var yt=d[k];yt&&(ct[at++]=yt)}return ct},dt.concat=function(){var d=arguments.length;if(!d)return[];for(var k=me(d-1),V=arguments[0],at=d;at--;)k[at-1]=arguments[at];return Vr(We(V)?Ki(V):[V],Di(k,1))},dt.cond=function(d){var k=d==null?0:d.length,V=Ne();return d=k?Si(d,function(at){if(typeof at[1]!="function")throw new hr(S);return[V(at[0]),at[1]]}):[],Xe(function(at){for(var ct=-1;++ct<k;){var yt=d[ct];if(ir(yt[0],this,at))return ir(yt[1],this,at)}})},dt.conforms=function(d){return function(k){var V=Pi(k);return function(at){return gl(at,k,V)}}(pr(d,c))},dt.constant=lu,dt.countBy=L0,dt.create=function(d,k){var V=In(d);return k==null?V:ml(V,k)},dt.curry=function d(k,V,at){var ct=Lr(k,E,v,v,v,v,v,V=at?v:V);return ct.placeholder=d.placeholder,ct},dt.curryRight=function d(k,V,at){var ct=Lr(k,I,v,v,v,v,v,V=at?v:V);return ct.placeholder=d.placeholder,ct},dt.debounce=kh,dt.defaults=nm,dt.defaultsDeep=om,dt.defer=W0,dt.delay=V0,dt.difference=b0,dt.differenceBy=w0,dt.differenceWith=M0,dt.drop=function(d,k,V){var at=d==null?0:d.length;return at?dr(d,(k=V||k===v?1:Ve(k))<0?0:k,at):[]},dt.dropRight=function(d,k,V){var at=d==null?0:d.length;return at?dr(d,0,(k=at-(k=V||k===v?1:Ve(k)))<0?0:k):[]},dt.dropRightWhile=function(d,k){return d&&d.length?Ko(d,Ne(k,3),!0,!0):[]},dt.dropWhile=function(d,k){return d&&d.length?Ko(d,Ne(k,3),!0):[]},dt.fill=function(d,k,V,at){var ct=d==null?0:d.length;return ct?(V&&typeof V!="number"&&Xi(d,k,V)&&(V=0,at=ct),function(yt,St,Ot,Ct){var oe=yt.length;for((Ot=Ve(Ot))<0&&(Ot=-Ot>oe?0:oe+Ot),(Ct=Ct===v||Ct>oe?oe:Ve(Ct))<0&&(Ct+=oe),Ct=Ot>Ct?0:Rh(Ct);Ot<Ct;)yt[Ot++]=St;return yt}(d,k,V,at)):[]},dt.filter=function(d,k){return(We(d)?Wr:bl)(d,Ne(k,3))},dt.flatMap=function(d,k){return Di(oa(d,k),1)},dt.flatMapDeep=function(d,k){return Di(oa(d,k),ot)},dt.flatMapDepth=function(d,k,V){return V=V===v?1:Ve(V),Di(oa(d,k),V)},dt.flatten=gh,dt.flattenDeep=function(d){return d!=null&&d.length?Di(d,ot):[]},dt.flattenDepth=function(d,k){return d!=null&&d.length?Di(d,k=k===v?1:Ve(k)):[]},dt.flip=function(d){return Lr(d,$)},dt.flow=wm,dt.flowRight=Mm,dt.fromPairs=function(d){for(var k=-1,V=d==null?0:d.length,at={};++k<V;){var ct=d[k];at[ct[0]]=ct[1]}return at},dt.functions=function(d){return d==null?[]:Vo(d,Pi(d))},dt.functionsIn=function(d){return d==null?[]:Vo(d,Gi(d))},dt.groupBy=q0,dt.initial=function(d){return d!=null&&d.length?dr(d,0,-1):[]},dt.intersection=x0,dt.intersectionBy=_0,dt.intersectionWith=S0,dt.invert=am,dt.invertBy=sm,dt.invokeMap=F0,dt.iteratee=hu,dt.keyBy=z0,dt.keys=Pi,dt.keysIn=Gi,dt.map=oa,dt.mapKeys=function(d,k){var V={};return k=Ne(k,3),Tr(d,function(at,ct,yt){Pr(V,k(at,ct,yt),at)}),V},dt.mapValues=function(d,k){var V={};return k=Ne(k,3),Tr(d,function(at,ct,yt){Pr(V,ct,k(at,ct,yt))}),V},dt.matches=function(d){return kl(pr(d,c))},dt.matchesProperty=function(d,k){return Il(d,pr(k,c))},dt.memoize=sa,dt.merge=cm,dt.mergeWith=Ph,dt.method=xm,dt.methodOf=_m,dt.mixin=fu,dt.negate=ua,dt.nthArg=function(d){return d=Ve(d),Xe(function(k){return Ol(k,d)})},dt.omit=lm,dt.omitBy=function(d,k){return Lh(d,ua(Ne(k)))},dt.once=function(d){return Sh(2,d)},dt.orderBy=function(d,k,V,at){return d==null?[]:(We(k)||(k=k==null?[]:[k]),We(V=at?v:V)||(V=V==null?[]:[V]),Al(d,k,V))},dt.over=Sm,dt.overArgs=X0,dt.overEvery=Em,dt.overSome=km,dt.partial=nu,dt.partialRight=Ih,dt.partition=$0,dt.pick=hm,dt.pickBy=Lh,dt.property=Hh,dt.propertyOf=function(d){return function(k){return d==null?v:ln(d,k)}},dt.pull=E0,dt.pullAll=yh,dt.pullAllBy=function(d,k,V){return d&&d.length&&k&&k.length?Rs(d,k,Ne(V,2)):d},dt.pullAllWith=function(d,k,V){return d&&d.length&&k&&k.length?Rs(d,k,v,V):d},dt.pullAt=k0,dt.range=Im,dt.rangeRight=Om,dt.rearg=Z0,dt.reject=function(d,k){return(We(d)?Wr:bl)(d,ua(Ne(k,3)))},dt.remove=function(d,k){var V=[];if(!d||!d.length)return V;var at=-1,ct=[],yt=d.length;for(k=Ne(k,3);++at<yt;){var St=d[at];k(St,at,d)&&(V.push(St),ct.push(at))}return Bl(d,ct),V},dt.rest=function(d,k){if(typeof d!="function")throw new hr(S);return Xe(d,k=k===v?k:Ve(k))},dt.reverse=eu,dt.sampleSize=function(d,k,V){return k=(V?Xi(d,k,V):k===v)?1:Ve(k),(We(d)?r0:l0)(d,k)},dt.set=function(d,k,V){return d==null?d:Yn(d,k,V)},dt.setWith=function(d,k,V,at){return at=typeof at=="function"?at:v,d==null?d:Yn(d,k,V,at)},dt.shuffle=function(d){return(We(d)?n0:f0)(d)},dt.slice=function(d,k,V){var at=d==null?0:d.length;return at?(V&&typeof V!="number"&&Xi(d,k,V)?(k=0,V=at):(k=k==null?0:Ve(k),V=V===v?at:Ve(V)),dr(d,k,V)):[]},dt.sortBy=H0,dt.sortedUniq=function(d){return d&&d.length?Rl(d):[]},dt.sortedUniqBy=function(d,k){return d&&d.length?Rl(d,Ne(k,2)):[]},dt.split=function(d,k,V){return V&&typeof V!="number"&&Xi(d,k,V)&&(k=V=v),(V=V===v?i:V>>>0)?(d=yi(d))&&(typeof k=="string"||k!=null&&!au(k))&&!(k=nr(k))&&xn(d)?Yr(Mr(d),0,V):d.split(k,V):[]},dt.spread=function(d,k){if(typeof d!="function")throw new hr(S);return k=k==null?0:Ri(Ve(k),0),Xe(function(V){var at=V[k],ct=Yr(V,0,k);return at&&Vr(ct,at),ir(d,this,ct)})},dt.tail=function(d){var k=d==null?0:d.length;return k?dr(d,1,k):[]},dt.take=function(d,k,V){return d&&d.length?dr(d,0,(k=V||k===v?1:Ve(k))<0?0:k):[]},dt.takeRight=function(d,k,V){var at=d==null?0:d.length;return at?dr(d,(k=at-(k=V||k===v?1:Ve(k)))<0?0:k,at):[]},dt.takeRightWhile=function(d,k){return d&&d.length?Ko(d,Ne(k,3),!1,!0):[]},dt.takeWhile=function(d,k){return d&&d.length?Ko(d,Ne(k,3)):[]},dt.tap=function(d,k){return k(d),d},dt.throttle=function(d,k,V){var at=!0,ct=!0;if(typeof d!="function")throw new hr(S);return Ei(V)&&(at="leading"in V?!!V.leading:at,ct="trailing"in V?!!V.trailing:ct),kh(d,k,{leading:at,maxWait:k,trailing:ct})},dt.thru=na,dt.toArray=jh,dt.toPairs=Dh,dt.toPairsIn=Uh,dt.toPath=function(d){return We(d)?Si(d,jr):or(d)?[d]:Ki(fh(yi(d)))},dt.toPlainObject=Nh,dt.transform=function(d,k,V){var at=We(d),ct=at||Qr(d)||Bn(d);if(k=Ne(k,4),V==null){var yt=d&&d.constructor;V=ct?at?new yt:[]:Ei(d)&&qr(yt)?In(Po(d)):{}}return(ct?lr:Tr)(d,function(St,Ot,Ct){return k(V,St,Ot,Ct)}),V},dt.unary=function(d){return _h(d,1)},dt.union=I0,dt.unionBy=O0,dt.unionWith=A0,dt.uniq=function(d){return d&&d.length?Jr(d):[]},dt.uniqBy=function(d,k){return d&&d.length?Jr(d,Ne(k,2)):[]},dt.uniqWith=function(d,k){return k=typeof k=="function"?k:v,d&&d.length?Jr(d,v,k):[]},dt.unset=function(d,k){return d==null||Ls(d,k)},dt.unzip=iu,dt.unzipWith=bh,dt.update=function(d,k,V){return d==null?d:Cl(d,k,qs(V))},dt.updateWith=function(d,k,V,at){return at=typeof at=="function"?at:v,d==null?d:Cl(d,k,qs(V),at)},dt.values=jn,dt.valuesIn=function(d){return d==null?[]:ys(d,Gi(d))},dt.without=T0,dt.words=zh,dt.wrap=function(d,k){return nu(qs(k),d)},dt.xor=B0,dt.xorBy=j0,dt.xorWith=R0,dt.zip=N0,dt.zipObject=function(d,k){return Ll(d||[],k||[],Zn)},dt.zipObjectDeep=function(d,k){return Ll(d||[],k||[],Yn)},dt.zipWith=C0,dt.entries=Dh,dt.entriesIn=Uh,dt.extend=Ch,dt.extendWith=ha,fu(dt,dt),dt.add=Am,dt.attempt=$h,dt.camelCase=fm,dt.capitalize=qh,dt.ceil=Tm,dt.clamp=function(d,k,V){return V===v&&(V=k,k=v),V!==v&&(V=(V=gr(V))==V?V:0),k!==v&&(k=(k=gr(k))==k?k:0),cn(gr(d),k,V)},dt.clone=function(d){return pr(d,f)},dt.cloneDeep=function(d){return pr(d,c|f)},dt.cloneDeepWith=function(d,k){return pr(d,c|f,k=typeof k=="function"?k:v)},dt.cloneWith=function(d,k){return pr(d,f,k=typeof k=="function"?k:v)},dt.conformsTo=function(d,k){return k==null||gl(d,k,Pi(k))},dt.deburr=Fh,dt.defaultTo=function(d,k){return d==null||d!=d?k:d},dt.divide=Bm,dt.endsWith=function(d,k,V){d=yi(d),k=nr(k);var at=d.length,ct=V=V===v?at:cn(Ve(V),0,at);return(V-=k.length)>=0&&d.slice(V,ct)==k},dt.eq=_r,dt.escape=function(d){return(d=yi(d))&&Ht.test(d)?d.replace(Ce,Rd):d},dt.escapeRegExp=function(d){return(d=yi(d))&&jt.test(d)?d.replace(ke,"\\$&"):d},dt.every=function(d,k,V){var at=We(d)?Kc:a0;return V&&Xi(d,k,V)&&(k=v),at(d,Ne(k,3))},dt.find=D0,dt.findIndex=dh,dt.findKey=function(d,k){return Jc(d,Ne(k,3),Tr)},dt.findLast=U0,dt.findLastIndex=mh,dt.findLastKey=function(d,k){return Jc(d,Ne(k,3),Is)},dt.floor=jm,dt.forEach=Mh,dt.forEachRight=xh,dt.forIn=function(d,k){return d==null?d:ks(d,Ne(k,3),Gi)},dt.forInRight=function(d,k){return d==null?d:wl(d,Ne(k,3),Gi)},dt.forOwn=function(d,k){return d&&Tr(d,Ne(k,3))},dt.forOwnRight=function(d,k){return d&&Is(d,Ne(k,3))},dt.get=su,dt.gt=K0,dt.gte=J0,dt.has=function(d,k){return d!=null&&rh(d,k,s0)},dt.hasIn=uu,dt.head=vh,dt.identity=Yi,dt.includes=function(d,k,V,at){d=Ji(d)?d:jn(d),V=V&&!at?Ve(V):0;var ct=d.length;return V<0&&(V=Ri(ct+V,0)),la(d)?V<=ct&&d.indexOf(k,V)>-1:!!ct&&Mn(d,k,V)>-1},dt.indexOf=function(d,k,V){var at=d==null?0:d.length;if(!at)return-1;var ct=V==null?0:Ve(V);return ct<0&&(ct=Ri(at+ct,0)),Mn(d,k,ct)},dt.inRange=function(d,k,V){return k=Fr(k),V===v?(V=k,k=0):V=Fr(V),function(at,ct,yt){return at>=Ui(ct,yt)&&at<Ri(ct,yt)}(d=gr(d),k,V)},dt.invoke=um,dt.isArguments=pn,dt.isArray=We,dt.isArrayBuffer=G0,dt.isArrayLike=Ji,dt.isArrayLikeObject=Ai,dt.isBoolean=function(d){return d===!0||d===!1||Ii(d)&&Vi(d)==T},dt.isBuffer=Qr,dt.isDate=Y0,dt.isElement=function(d){return Ii(d)&&d.nodeType===1&&!io(d)},dt.isEmpty=function(d){if(d==null)return!0;if(Ji(d)&&(We(d)||typeof d=="string"||typeof d.splice=="function"||Qr(d)||Bn(d)||pn(d)))return!d.length;var k=qi(d);if(k==G||k==gt)return!d.size;if(to(d))return!Bs(d).length;for(var V in d)if(bi.call(d,V))return!1;return!0},dt.isEqual=function(d,k){return Gn(d,k)},dt.isEqualWith=function(d,k,V){var at=(V=typeof V=="function"?V:v)?V(d,k):v;return at===v?Gn(d,k,v,V):!!at},dt.isError=ou,dt.isFinite=function(d){return typeof d=="number"&&ll(d)},dt.isFunction=qr,dt.isInteger=Oh,dt.isLength=ca,dt.isMap=Ah,dt.isMatch=function(d,k){return d===k||Ts(d,k,Xs(k))},dt.isMatchWith=function(d,k,V){return V=typeof V=="function"?V:v,Ts(d,k,Xs(k),V)},dt.isNaN=function(d){return Th(d)&&d!=+d},dt.isNative=function(d){if(y0(d))throw new oi("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return _l(d)},dt.isNil=function(d){return d==null},dt.isNull=function(d){return d===null},dt.isNumber=Th,dt.isObject=Ei,dt.isObjectLike=Ii,dt.isPlainObject=io,dt.isRegExp=au,dt.isSafeInteger=function(d){return Oh(d)&&d>=-t&&d<=t},dt.isSet=Bh,dt.isString=la,dt.isSymbol=or,dt.isTypedArray=Bn,dt.isUndefined=function(d){return d===v},dt.isWeakMap=function(d){return Ii(d)&&qi(d)==It},dt.isWeakSet=function(d){return Ii(d)&&Vi(d)=="[object WeakSet]"},dt.join=function(d,k){return d==null?"":Xd.call(d,k)},dt.kebabCase=pm,dt.last=mr,dt.lastIndexOf=function(d,k,V){var at=d==null?0:d.length;if(!at)return-1;var ct=at;return V!==v&&(ct=(ct=Ve(V))<0?Ri(at+ct,0):Ui(ct,at-1)),k==k?function(yt,St,Ot){for(var Ct=Ot+1;Ct--;)if(yt[Ct]===St)return Ct;return Ct}(d,k,ct):Io(d,Gc,ct,!0)},dt.lowerCase=dm,dt.lowerFirst=mm,dt.lt=Q0,dt.lte=tm,dt.max=function(d){return d&&d.length?Wo(d,Yi,Os):v},dt.maxBy=function(d,k){return d&&d.length?Wo(d,Ne(k,2),Os):v},dt.mean=function(d){return Yc(d,Yi)},dt.meanBy=function(d,k){return Yc(d,Ne(k,2))},dt.min=function(d){return d&&d.length?Wo(d,Yi,js):v},dt.minBy=function(d,k){return d&&d.length?Wo(d,Ne(k,2),js):v},dt.stubArray=du,dt.stubFalse=mu,dt.stubObject=function(){return{}},dt.stubString=function(){return""},dt.stubTrue=function(){return!0},dt.multiply=Rm,dt.nth=function(d,k){return d&&d.length?Ol(d,Ve(k)):v},dt.noConflict=function(){return de._===this&&(de._=Fd),this},dt.noop=pu,dt.now=aa,dt.pad=function(d,k,V){d=yi(d);var at=(k=Ve(k))?_n(d):0;if(!k||at>=k)return d;var ct=(k-at)/2;return Qo(qo(ct),V)+d+Qo(Uo(ct),V)},dt.padEnd=function(d,k,V){d=yi(d);var at=(k=Ve(k))?_n(d):0;return k&&at<k?d+Qo(k-at,V):d},dt.padStart=function(d,k,V){d=yi(d);var at=(k=Ve(k))?_n(d):0;return k&&at<k?Qo(k-at,V)+d:d},dt.parseInt=function(d,k,V){return V||k==null?k=0:k&&(k=+k),Jd(yi(d).replace(Zt,""),k||0)},dt.random=function(d,k,V){if(V&&typeof V!="boolean"&&Xi(d,k,V)&&(k=V=v),V===v&&(typeof k=="boolean"?(V=k,k=v):typeof d=="boolean"&&(V=d,d=v)),d===v&&k===v?(d=0,k=1):(d=Fr(d),k===v?(k=d,d=0):k=Fr(k)),d>k){var at=d;d=k,k=at}if(V||d%1||k%1){var ct=hl();return Ui(d+ct*(k-d+Ge("1e-"+((ct+"").length-1))),k)}return Ns(d,k)},dt.reduce=function(d,k,V){var at=We(d)?fs:Qc,ct=arguments.length<3;return at(d,Ne(k,4),V,ct,Kr)},dt.reduceRight=function(d,k,V){var at=We(d)?Ad:Qc,ct=arguments.length<3;return at(d,Ne(k,4),V,ct,yl)},dt.repeat=function(d,k,V){return k=(V?Xi(d,k,V):k===v)?1:Ve(k),Cs(yi(d),k)},dt.replace=function(){var d=arguments,k=yi(d[0]);return d.length<3?k:k.replace(d[1],d[2])},dt.result=function(d,k,V){var at=-1,ct=(k=Gr(k,d)).length;for(ct||(ct=1,d=v);++at<ct;){var yt=d==null?v:d[jr(k[at])];yt===v&&(at=ct,yt=V),d=qr(yt)?yt.call(d):yt}return d},dt.round=Nm,dt.runInContext=$t,dt.sample=function(d){return(We(d)?dl:c0)(d)},dt.size=function(d){if(d==null)return 0;if(Ji(d))return la(d)?_n(d):d.length;var k=qi(d);return k==G||k==gt?d.size:Bs(d).length},dt.snakeCase=gm,dt.some=function(d,k,V){var at=We(d)?ps:p0;return V&&Xi(d,k,V)&&(k=v),at(d,Ne(k,3))},dt.sortedIndex=function(d,k){return Zo(d,k)},dt.sortedIndexBy=function(d,k,V){return Ps(d,k,Ne(V,2))},dt.sortedIndexOf=function(d,k){var V=d==null?0:d.length;if(V){var at=Zo(d,k);if(at<V&&_r(d[at],k))return at}return-1},dt.sortedLastIndex=function(d,k){return Zo(d,k,!0)},dt.sortedLastIndexBy=function(d,k,V){return Ps(d,k,Ne(V,2),!0)},dt.sortedLastIndexOf=function(d,k){if(d!=null&&d.length){var V=Zo(d,k,!0)-1;if(_r(d[V],k))return V}return-1},dt.startCase=vm,dt.startsWith=function(d,k,V){return d=yi(d),V=V==null?0:cn(Ve(V),0,d.length),k=nr(k),d.slice(V,V+k.length)==k},dt.subtract=Cm,dt.sum=function(d){return d&&d.length?gs(d,Yi):0},dt.sumBy=function(d,k){return d&&d.length?gs(d,Ne(k,2)):0},dt.template=function(d,k,V){var at=dt.templateSettings;V&&Xi(d,k,V)&&(k=v),d=yi(d),k=ha({},k,at,Ql);var ct,yt,St=ha({},k.imports,at.imports,Ql),Ot=Pi(St),Ct=ys(St,Ot),oe=0,ne=k.interpolate||Ae,le="__p += '",Me=ws((k.escape||Ae).source+"|"+ne.source+"|"+(ne===Wt?Ut:Ae).source+"|"+(k.evaluate||Ae).source+"|$","g"),_e="//# sourceURL="+(bi.call(k,"sourceURL")?(k.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++xe+"]")+`
|
|
78
78
|
`;d.replace(Me,function(he,Be,pe,Fe,Ue,vi){return pe||(pe=Fe),le+=d.slice(oe,vi).replace(Re,Nd),Be&&(ct=!0,le+=`' +
|
|
79
79
|
__e(`+Be+`) +
|
|
80
80
|
'`),Ue&&(yt=!0,le+=`';
|
|
@@ -134,7 +134,7 @@ Source:
|
|
|
134
134
|
*
|
|
135
135
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
136
136
|
* @license MIT
|
|
137
|
-
*/(function(K){const O=fo,L=Za,Y=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;K.Buffer=_,K.SlowBuffer=g,K.INSPECT_MAX_BYTES=50;const ut=2147483647;K.kMaxLength=ut,_.TYPED_ARRAY_SUPPORT=ht(),!_.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ht(){try{const F=new Uint8Array(1),H={foo:function(){return 42}};return Object.setPrototypeOf(H,Uint8Array.prototype),Object.setPrototypeOf(F,H),F.foo()===42}catch{return!1}}Object.defineProperty(_.prototype,"parent",{enumerable:!0,get:function(){if(_.isBuffer(this))return this.buffer}}),Object.defineProperty(_.prototype,"offset",{enumerable:!0,get:function(){if(_.isBuffer(this))return this.byteOffset}});function W(F){if(F>ut)throw new RangeError('The value "'+F+'" is invalid for option "size"');const H=new Uint8Array(F);return Object.setPrototypeOf(H,_.prototype),H}function _(F,H,U){if(typeof F=="number"){if(typeof H=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(F)}return y(F,H,U)}_.poolSize=8192;function y(F,H,U){if(typeof F=="string")return S(F,H);if(ArrayBuffer.isView(F))return p(F);if(F==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof F);if(Bt(F,ArrayBuffer)||F&&Bt(F.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Bt(F,SharedArrayBuffer)||F&&Bt(F.buffer,SharedArrayBuffer)))return c(F,H,U);if(typeof F=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const it=F.valueOf&&F.valueOf();if(it!=null&&it!==F)return _.from(it,H,U);const pt=l(F);if(pt)return pt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof F[Symbol.toPrimitive]=="function")return _.from(F[Symbol.toPrimitive]("string"),H,U);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof F)}_.from=function(F,H,U){return y(F,H,U)},Object.setPrototypeOf(_.prototype,Uint8Array.prototype),Object.setPrototypeOf(_,Uint8Array);function x(F){if(typeof F!="number")throw new TypeError('"size" argument must be of type number');if(F<0)throw new RangeError('The value "'+F+'" is invalid for option "size"')}function v(F,H,U){return x(F),F<=0?W(F):H!==void 0?typeof U=="string"?W(F).fill(H,U):W(F).fill(H):W(F)}_.alloc=function(F,H,U){return v(F,H,U)};function m(F){return x(F),W(F<0?0:f(F)|0)}_.allocUnsafe=function(F){return m(F)},_.allocUnsafeSlow=function(F){return m(F)};function S(F,H){if((typeof H!="string"||H==="")&&(H="utf8"),!_.isEncoding(H))throw new TypeError("Unknown encoding: "+H);const U=h(F,H)|0;let it=W(U);const pt=it.write(F,H);return pt!==U&&(it=it.slice(0,pt)),it}function a(F){const H=F.length<0?0:f(F.length)|0,U=W(H);for(let it=0;it<H;it+=1)U[it]=F[it]&255;return U}function p(F){if(Bt(F,Uint8Array)){const H=new Uint8Array(F);return c(H.buffer,H.byteOffset,H.byteLength)}return a(F)}function c(F,H,U){if(H<0||F.byteLength<H)throw new RangeError('"offset" is outside of buffer bounds');if(F.byteLength<H+(U||0))throw new RangeError('"length" is outside of buffer bounds');let it;return H===void 0&&U===void 0?it=new Uint8Array(F):U===void 0?it=new Uint8Array(F,H):it=new Uint8Array(F,H,U),Object.setPrototypeOf(it,_.prototype),it}function l(F){if(_.isBuffer(F)){const H=f(F.length)|0,U=W(H);return U.length===0||F.copy(U,0,0,H),U}if(F.length!==void 0)return typeof F.length!="number"||Mt(F.length)?W(0):a(F);if(F.type==="Buffer"&&Array.isArray(F.data))return a(F.data)}function f(F){if(F>=ut)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ut.toString(16)+" bytes");return F|0}function g(F){return+F!=F&&(F=0),_.alloc(+F)}_.isBuffer=function(H){return H!=null&&H._isBuffer===!0&&H!==_.prototype},_.compare=function(H,U){if(Bt(H,Uint8Array)&&(H=_.from(H,H.offset,H.byteLength)),Bt(U,Uint8Array)&&(U=_.from(U,U.offset,U.byteLength)),!_.isBuffer(H)||!_.isBuffer(U))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(H===U)return 0;let it=H.length,pt=U.length;for(let ft=0,mt=Math.min(it,pt);ft<mt;++ft)if(H[ft]!==U[ft]){it=H[ft],pt=U[ft];break}return it<pt?-1:pt<it?1:0},_.isEncoding=function(H){switch(String(H).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},_.concat=function(H,U){if(!Array.isArray(H))throw new TypeError('"list" argument must be an Array of Buffers');if(H.length===0)return _.alloc(0);let it;if(U===void 0)for(U=0,it=0;it<H.length;++it)U+=H[it].length;const pt=_.allocUnsafe(U);let ft=0;for(it=0;it<H.length;++it){let mt=H[it];if(Bt(mt,Uint8Array))ft+mt.length>pt.length?(_.isBuffer(mt)||(mt=_.from(mt)),mt.copy(pt,ft)):Uint8Array.prototype.set.call(pt,mt,ft);else if(_.isBuffer(mt))mt.copy(pt,ft);else throw new TypeError('"list" argument must be an Array of Buffers');ft+=mt.length}return pt};function h(F,H){if(_.isBuffer(F))return F.length;if(ArrayBuffer.isView(F)||Bt(F,ArrayBuffer))return F.byteLength;if(typeof F!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof F);const U=F.length,it=arguments.length>2&&arguments[2]===!0;if(!it&&U===0)return 0;let pt=!1;for(;;)switch(H){case"ascii":case"latin1":case"binary":return U;case"utf8":case"utf-8":return nt(F).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U*2;case"hex":return U>>>1;case"base64":return gt(F).length;default:if(pt)return it?-1:nt(F).length;H=(""+H).toLowerCase(),pt=!0}}_.byteLength=h;function u(F,H,U){let it=!1;if((H===void 0||H<0)&&(H=0),H>this.length||((U===void 0||U>this.length)&&(U=this.length),U<=0)||(U>>>=0,H>>>=0,U<=H))return"";for(F||(F="utf8");;)switch(F){case"hex":return r(this,H,U);case"utf8":case"utf-8":return et(this,H,U);case"ascii":return t(this,H,U);case"latin1":case"binary":return n(this,H,U);case"base64":return $(this,H,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i(this,H,U);default:if(it)throw new TypeError("Unknown encoding: "+F);F=(F+"").toLowerCase(),it=!0}}_.prototype._isBuffer=!0;function w(F,H,U){const it=F[H];F[H]=F[U],F[U]=it}_.prototype.swap16=function(){const H=this.length;if(H%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let U=0;U<H;U+=2)w(this,U,U+1);return this},_.prototype.swap32=function(){const H=this.length;if(H%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let U=0;U<H;U+=4)w(this,U,U+3),w(this,U+1,U+2);return this},_.prototype.swap64=function(){const H=this.length;if(H%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let U=0;U<H;U+=8)w(this,U,U+7),w(this,U+1,U+6),w(this,U+2,U+5),w(this,U+3,U+4);return this},_.prototype.toString=function(){const H=this.length;return H===0?"":arguments.length===0?et(this,0,H):u.apply(this,arguments)},_.prototype.toLocaleString=_.prototype.toString,_.prototype.equals=function(H){if(!_.isBuffer(H))throw new TypeError("Argument must be a Buffer");return this===H?!0:_.compare(this,H)===0},_.prototype.inspect=function(){let H="";const U=K.INSPECT_MAX_BYTES;return H=this.toString("hex",0,U).replace(/(.{2})/g,"$1 ").trim(),this.length>U&&(H+=" ... "),"<Buffer "+H+">"},Y&&(_.prototype[Y]=_.prototype.inspect),_.prototype.compare=function(H,U,it,pt,ft){if(Bt(H,Uint8Array)&&(H=_.from(H,H.offset,H.byteLength)),!_.isBuffer(H))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof H);if(U===void 0&&(U=0),it===void 0&&(it=H?H.length:0),pt===void 0&&(pt=0),ft===void 0&&(ft=this.length),U<0||it>H.length||pt<0||ft>this.length)throw new RangeError("out of range index");if(pt>=ft&&U>=it)return 0;if(pt>=ft)return-1;if(U>=it)return 1;if(U>>>=0,it>>>=0,pt>>>=0,ft>>>=0,this===H)return 0;let mt=ft-pt,re=it-U;const _t=Math.min(mt,re),At=this.slice(pt,ft),fe=H.slice(U,it);for(let kt=0;kt<_t;++kt)if(At[kt]!==fe[kt]){mt=At[kt],re=fe[kt];break}return mt<re?-1:re<mt?1:0};function b(F,H,U,it,pt){if(F.length===0)return-1;if(typeof U=="string"?(it=U,U=0):U>2147483647?U=2147483647:U<-2147483648&&(U=-2147483648),U=+U,Mt(U)&&(U=pt?0:F.length-1),U<0&&(U=F.length+U),U>=F.length){if(pt)return-1;U=F.length-1}else if(U<0)if(pt)U=0;else return-1;if(typeof H=="string"&&(H=_.from(H,it)),_.isBuffer(H))return H.length===0?-1:E(F,H,U,it,pt);if(typeof H=="number")return H=H&255,typeof Uint8Array.prototype.indexOf=="function"?pt?Uint8Array.prototype.indexOf.call(F,H,U):Uint8Array.prototype.lastIndexOf.call(F,H,U):E(F,[H],U,it,pt);throw new TypeError("val must be string, number or Buffer")}function E(F,H,U,it,pt){let ft=1,mt=F.length,re=H.length;if(it!==void 0&&(it=String(it).toLowerCase(),it==="ucs2"||it==="ucs-2"||it==="utf16le"||it==="utf-16le")){if(F.length<2||H.length<2)return-1;ft=2,mt/=2,re/=2,U/=2}function _t(fe,kt){return ft===1?fe[kt]:fe.readUInt16BE(kt*ft)}let At;if(pt){let fe=-1;for(At=U;At<mt;At++)if(_t(F,At)===_t(H,fe===-1?0:At-fe)){if(fe===-1&&(fe=At),At-fe+1===re)return fe*ft}else fe!==-1&&(At-=At-fe),fe=-1}else for(U+re>mt&&(U=mt-re),At=U;At>=0;At--){let fe=!0;for(let kt=0;kt<re;kt++)if(_t(F,At+kt)!==_t(H,kt)){fe=!1;break}if(fe)return At}return-1}_.prototype.includes=function(H,U,it){return this.indexOf(H,U,it)!==-1},_.prototype.indexOf=function(H,U,it){return b(this,H,U,it,!0)},_.prototype.lastIndexOf=function(H,U,it){return b(this,H,U,it,!1)};function I(F,H,U,it){U=Number(U)||0;const pt=F.length-U;it?(it=Number(it),it>pt&&(it=pt)):it=pt;const ft=H.length;it>ft/2&&(it=ft/2);let mt;for(mt=0;mt<it;++mt){const re=parseInt(H.substr(mt*2,2),16);if(Mt(re))return mt;F[U+mt]=re}return mt}function M(F,H,U,it){return bt(nt(H,F.length-U),F,U,it)}function B(F,H,U,it){return bt(lt(H),F,U,it)}function P(F,H,U,it){return bt(gt(H),F,U,it)}function N(F,H,U,it){return bt(Et(H,F.length-U),F,U,it)}_.prototype.write=function(H,U,it,pt){if(U===void 0)pt="utf8",it=this.length,U=0;else if(it===void 0&&typeof U=="string")pt=U,it=this.length,U=0;else if(isFinite(U))U=U>>>0,isFinite(it)?(it=it>>>0,pt===void 0&&(pt="utf8")):(pt=it,it=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ft=this.length-U;if((it===void 0||it>ft)&&(it=ft),H.length>0&&(it<0||U<0)||U>this.length)throw new RangeError("Attempt to write outside buffer bounds");pt||(pt="utf8");let mt=!1;for(;;)switch(pt){case"hex":return I(this,H,U,it);case"utf8":case"utf-8":return M(this,H,U,it);case"ascii":case"latin1":case"binary":return B(this,H,U,it);case"base64":return P(this,H,U,it);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,H,U,it);default:if(mt)throw new TypeError("Unknown encoding: "+pt);pt=(""+pt).toLowerCase(),mt=!0}},_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(F,H,U){return H===0&&U===F.length?O.fromByteArray(F):O.fromByteArray(F.slice(H,U))}function et(F,H,U){U=Math.min(F.length,U);const it=[];let pt=H;for(;pt<U;){const ft=F[pt];let mt=null,re=ft>239?4:ft>223?3:ft>191?2:1;if(pt+re<=U){let _t,At,fe,kt;switch(re){case 1:ft<128&&(mt=ft);break;case 2:_t=F[pt+1],(_t&192)===128&&(kt=(ft&31)<<6|_t&63,kt>127&&(mt=kt));break;case 3:_t=F[pt+1],At=F[pt+2],(_t&192)===128&&(At&192)===128&&(kt=(ft&15)<<12|(_t&63)<<6|At&63,kt>2047&&(kt<55296||kt>57343)&&(mt=kt));break;case 4:_t=F[pt+1],At=F[pt+2],fe=F[pt+3],(_t&192)===128&&(At&192)===128&&(fe&192)===128&&(kt=(ft&15)<<18|(_t&63)<<12|(At&63)<<6|fe&63,kt>65535&&kt<1114112&&(mt=kt))}}mt===null?(mt=65533,re=1):mt>65535&&(mt-=65536,it.push(mt>>>10&1023|55296),mt=56320|mt&1023),it.push(mt),pt+=re}return ot(it)}const Q=4096;function ot(F){const H=F.length;if(H<=Q)return String.fromCharCode.apply(String,F);let U="",it=0;for(;it<H;)U+=String.fromCharCode.apply(String,F.slice(it,it+=Q));return U}function t(F,H,U){let it="";U=Math.min(F.length,U);for(let pt=H;pt<U;++pt)it+=String.fromCharCode(F[pt]&127);return it}function n(F,H,U){let it="";U=Math.min(F.length,U);for(let pt=H;pt<U;++pt)it+=String.fromCharCode(F[pt]);return it}function r(F,H,U){const it=F.length;(!H||H<0)&&(H=0),(!U||U<0||U>it)&&(U=it);let pt="";for(let ft=H;ft<U;++ft)pt+=It[F[ft]];return pt}function i(F,H,U){const it=F.slice(H,U);let pt="";for(let ft=0;ft<it.length-1;ft+=2)pt+=String.fromCharCode(it[ft]+it[ft+1]*256);return pt}_.prototype.slice=function(H,U){const it=this.length;H=~~H,U=U===void 0?it:~~U,H<0?(H+=it,H<0&&(H=0)):H>it&&(H=it),U<0?(U+=it,U<0&&(U=0)):U>it&&(U=it),U<H&&(U=H);const pt=this.subarray(H,U);return Object.setPrototypeOf(pt,_.prototype),pt};function e(F,H,U){if(F%1!==0||F<0)throw new RangeError("offset is not uint");if(F+H>U)throw new RangeError("Trying to access beyond buffer length")}_.prototype.readUintLE=_.prototype.readUIntLE=function(H,U,it){H=H>>>0,U=U>>>0,it||e(H,U,this.length);let pt=this[H],ft=1,mt=0;for(;++mt<U&&(ft*=256);)pt+=this[H+mt]*ft;return pt},_.prototype.readUintBE=_.prototype.readUIntBE=function(H,U,it){H=H>>>0,U=U>>>0,it||e(H,U,this.length);let pt=this[H+--U],ft=1;for(;U>0&&(ft*=256);)pt+=this[H+--U]*ft;return pt},_.prototype.readUint8=_.prototype.readUInt8=function(H,U){return H=H>>>0,U||e(H,1,this.length),this[H]},_.prototype.readUint16LE=_.prototype.readUInt16LE=function(H,U){return H=H>>>0,U||e(H,2,this.length),this[H]|this[H+1]<<8},_.prototype.readUint16BE=_.prototype.readUInt16BE=function(H,U){return H=H>>>0,U||e(H,2,this.length),this[H]<<8|this[H+1]},_.prototype.readUint32LE=_.prototype.readUInt32LE=function(H,U){return H=H>>>0,U||e(H,4,this.length),(this[H]|this[H+1]<<8|this[H+2]<<16)+this[H+3]*16777216},_.prototype.readUint32BE=_.prototype.readUInt32BE=function(H,U){return H=H>>>0,U||e(H,4,this.length),this[H]*16777216+(this[H+1]<<16|this[H+2]<<8|this[H+3])},_.prototype.readBigUInt64LE=J(function(H){H=H>>>0,G(H,"offset");const U=this[H],it=this[H+7];(U===void 0||it===void 0)&&z(H,this.length-8);const pt=U+this[++H]*2**8+this[++H]*2**16+this[++H]*2**24,ft=this[++H]+this[++H]*2**8+this[++H]*2**16+it*2**24;return BigInt(pt)+(BigInt(ft)<<BigInt(32))}),_.prototype.readBigUInt64BE=J(function(H){H=H>>>0,G(H,"offset");const U=this[H],it=this[H+7];(U===void 0||it===void 0)&&z(H,this.length-8);const pt=U*2**24+this[++H]*2**16+this[++H]*2**8+this[++H],ft=this[++H]*2**24+this[++H]*2**16+this[++H]*2**8+it;return(BigInt(pt)<<BigInt(32))+BigInt(ft)}),_.prototype.readIntLE=function(H,U,it){H=H>>>0,U=U>>>0,it||e(H,U,this.length);let pt=this[H],ft=1,mt=0;for(;++mt<U&&(ft*=256);)pt+=this[H+mt]*ft;return ft*=128,pt>=ft&&(pt-=Math.pow(2,8*U)),pt},_.prototype.readIntBE=function(H,U,it){H=H>>>0,U=U>>>0,it||e(H,U,this.length);let pt=U,ft=1,mt=this[H+--pt];for(;pt>0&&(ft*=256);)mt+=this[H+--pt]*ft;return ft*=128,mt>=ft&&(mt-=Math.pow(2,8*U)),mt},_.prototype.readInt8=function(H,U){return H=H>>>0,U||e(H,1,this.length),this[H]&128?(255-this[H]+1)*-1:this[H]},_.prototype.readInt16LE=function(H,U){H=H>>>0,U||e(H,2,this.length);const it=this[H]|this[H+1]<<8;return it&32768?it|4294901760:it},_.prototype.readInt16BE=function(H,U){H=H>>>0,U||e(H,2,this.length);const it=this[H+1]|this[H]<<8;return it&32768?it|4294901760:it},_.prototype.readInt32LE=function(H,U){return H=H>>>0,U||e(H,4,this.length),this[H]|this[H+1]<<8|this[H+2]<<16|this[H+3]<<24},_.prototype.readInt32BE=function(H,U){return H=H>>>0,U||e(H,4,this.length),this[H]<<24|this[H+1]<<16|this[H+2]<<8|this[H+3]},_.prototype.readBigInt64LE=J(function(H){H=H>>>0,G(H,"offset");const U=this[H],it=this[H+7];(U===void 0||it===void 0)&&z(H,this.length-8);const pt=this[H+4]+this[H+5]*2**8+this[H+6]*2**16+(it<<24);return(BigInt(pt)<<BigInt(32))+BigInt(U+this[++H]*2**8+this[++H]*2**16+this[++H]*2**24)}),_.prototype.readBigInt64BE=J(function(H){H=H>>>0,G(H,"offset");const U=this[H],it=this[H+7];(U===void 0||it===void 0)&&z(H,this.length-8);const pt=(U<<24)+this[++H]*2**16+this[++H]*2**8+this[++H];return(BigInt(pt)<<BigInt(32))+BigInt(this[++H]*2**24+this[++H]*2**16+this[++H]*2**8+it)}),_.prototype.readFloatLE=function(H,U){return H=H>>>0,U||e(H,4,this.length),L.read(this,H,!0,23,4)},_.prototype.readFloatBE=function(H,U){return H=H>>>0,U||e(H,4,this.length),L.read(this,H,!1,23,4)},_.prototype.readDoubleLE=function(H,U){return H=H>>>0,U||e(H,8,this.length),L.read(this,H,!0,52,8)},_.prototype.readDoubleBE=function(H,U){return H=H>>>0,U||e(H,8,this.length),L.read(this,H,!1,52,8)};function o(F,H,U,it,pt,ft){if(!_.isBuffer(F))throw new TypeError('"buffer" argument must be a Buffer instance');if(H>pt||H<ft)throw new RangeError('"value" argument is out of bounds');if(U+it>F.length)throw new RangeError("Index out of range")}_.prototype.writeUintLE=_.prototype.writeUIntLE=function(H,U,it,pt){if(H=+H,U=U>>>0,it=it>>>0,!pt){const re=Math.pow(2,8*it)-1;o(this,H,U,it,re,0)}let ft=1,mt=0;for(this[U]=H&255;++mt<it&&(ft*=256);)this[U+mt]=H/ft&255;return U+it},_.prototype.writeUintBE=_.prototype.writeUIntBE=function(H,U,it,pt){if(H=+H,U=U>>>0,it=it>>>0,!pt){const re=Math.pow(2,8*it)-1;o(this,H,U,it,re,0)}let ft=it-1,mt=1;for(this[U+ft]=H&255;--ft>=0&&(mt*=256);)this[U+ft]=H/mt&255;return U+it},_.prototype.writeUint8=_.prototype.writeUInt8=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,1,255,0),this[U]=H&255,U+1},_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,2,65535,0),this[U]=H&255,this[U+1]=H>>>8,U+2},_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,2,65535,0),this[U]=H>>>8,this[U+1]=H&255,U+2},_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,4,4294967295,0),this[U+3]=H>>>24,this[U+2]=H>>>16,this[U+1]=H>>>8,this[U]=H&255,U+4},_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,4,4294967295,0),this[U]=H>>>24,this[U+1]=H>>>16,this[U+2]=H>>>8,this[U+3]=H&255,U+4};function s(F,H,U,it,pt){D(H,it,pt,F,U,7);let ft=Number(H&BigInt(4294967295));F[U++]=ft,ft=ft>>8,F[U++]=ft,ft=ft>>8,F[U++]=ft,ft=ft>>8,F[U++]=ft;let mt=Number(H>>BigInt(32)&BigInt(4294967295));return F[U++]=mt,mt=mt>>8,F[U++]=mt,mt=mt>>8,F[U++]=mt,mt=mt>>8,F[U++]=mt,U}function A(F,H,U,it,pt){D(H,it,pt,F,U,7);let ft=Number(H&BigInt(4294967295));F[U+7]=ft,ft=ft>>8,F[U+6]=ft,ft=ft>>8,F[U+5]=ft,ft=ft>>8,F[U+4]=ft;let mt=Number(H>>BigInt(32)&BigInt(4294967295));return F[U+3]=mt,mt=mt>>8,F[U+2]=mt,mt=mt>>8,F[U+1]=mt,mt=mt>>8,F[U]=mt,U+8}_.prototype.writeBigUInt64LE=J(function(H,U=0){return s(this,H,U,BigInt(0),BigInt("0xffffffffffffffff"))}),_.prototype.writeBigUInt64BE=J(function(H,U=0){return A(this,H,U,BigInt(0),BigInt("0xffffffffffffffff"))}),_.prototype.writeIntLE=function(H,U,it,pt){if(H=+H,U=U>>>0,!pt){const _t=Math.pow(2,8*it-1);o(this,H,U,it,_t-1,-_t)}let ft=0,mt=1,re=0;for(this[U]=H&255;++ft<it&&(mt*=256);)H<0&&re===0&&this[U+ft-1]!==0&&(re=1),this[U+ft]=(H/mt>>0)-re&255;return U+it},_.prototype.writeIntBE=function(H,U,it,pt){if(H=+H,U=U>>>0,!pt){const _t=Math.pow(2,8*it-1);o(this,H,U,it,_t-1,-_t)}let ft=it-1,mt=1,re=0;for(this[U+ft]=H&255;--ft>=0&&(mt*=256);)H<0&&re===0&&this[U+ft+1]!==0&&(re=1),this[U+ft]=(H/mt>>0)-re&255;return U+it},_.prototype.writeInt8=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,1,127,-128),H<0&&(H=255+H+1),this[U]=H&255,U+1},_.prototype.writeInt16LE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,2,32767,-32768),this[U]=H&255,this[U+1]=H>>>8,U+2},_.prototype.writeInt16BE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,2,32767,-32768),this[U]=H>>>8,this[U+1]=H&255,U+2},_.prototype.writeInt32LE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,4,2147483647,-2147483648),this[U]=H&255,this[U+1]=H>>>8,this[U+2]=H>>>16,this[U+3]=H>>>24,U+4},_.prototype.writeInt32BE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,4,2147483647,-2147483648),H<0&&(H=4294967295+H+1),this[U]=H>>>24,this[U+1]=H>>>16,this[U+2]=H>>>8,this[U+3]=H&255,U+4},_.prototype.writeBigInt64LE=J(function(H,U=0){return s(this,H,U,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),_.prototype.writeBigInt64BE=J(function(H,U=0){return A(this,H,U,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function C(F,H,U,it,pt,ft){if(U+it>F.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("Index out of range")}function j(F,H,U,it,pt){return H=+H,U=U>>>0,pt||C(F,H,U,4),L.write(F,H,U,it,23,4),U+4}_.prototype.writeFloatLE=function(H,U,it){return j(this,H,U,!0,it)},_.prototype.writeFloatBE=function(H,U,it){return j(this,H,U,!1,it)};function T(F,H,U,it,pt){return H=+H,U=U>>>0,pt||C(F,H,U,8),L.write(F,H,U,it,52,8),U+8}_.prototype.writeDoubleLE=function(H,U,it){return T(this,H,U,!0,it)},_.prototype.writeDoubleBE=function(H,U,it){return T(this,H,U,!1,it)},_.prototype.copy=function(H,U,it,pt){if(!_.isBuffer(H))throw new TypeError("argument should be a Buffer");if(it||(it=0),!pt&&pt!==0&&(pt=this.length),U>=H.length&&(U=H.length),U||(U=0),pt>0&&pt<it&&(pt=it),pt===it||H.length===0||this.length===0)return 0;if(U<0)throw new RangeError("targetStart out of bounds");if(it<0||it>=this.length)throw new RangeError("Index out of range");if(pt<0)throw new RangeError("sourceEnd out of bounds");pt>this.length&&(pt=this.length),H.length-U<pt-it&&(pt=H.length-U+it);const ft=pt-it;return this===H&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(U,it,pt):Uint8Array.prototype.set.call(H,this.subarray(it,pt),U),ft},_.prototype.fill=function(H,U,it,pt){if(typeof H=="string"){if(typeof U=="string"?(pt=U,U=0,it=this.length):typeof it=="string"&&(pt=it,it=this.length),pt!==void 0&&typeof pt!="string")throw new TypeError("encoding must be a string");if(typeof pt=="string"&&!_.isEncoding(pt))throw new TypeError("Unknown encoding: "+pt);if(H.length===1){const mt=H.charCodeAt(0);(pt==="utf8"&&mt<128||pt==="latin1")&&(H=mt)}}else typeof H=="number"?H=H&255:typeof H=="boolean"&&(H=Number(H));if(U<0||this.length<U||this.length<it)throw new RangeError("Out of range index");if(it<=U)return this;U=U>>>0,it=it===void 0?this.length:it>>>0,H||(H=0);let ft;if(typeof H=="number")for(ft=U;ft<it;++ft)this[ft]=H;else{const mt=_.isBuffer(H)?H:_.from(H,pt),re=mt.length;if(re===0)throw new TypeError('The value "'+H+'" is invalid for argument "value"');for(ft=0;ft<it-U;++ft)this[ft+U]=mt[ft%re]}return this};const R={};function q(F,H,U){R[F]=class extends U{constructor(){super(),Object.defineProperty(this,"message",{value:H.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${F}]`,this.stack,delete this.name}get code(){return F}set code(pt){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:pt,writable:!0})}toString(){return`${this.name} [${F}]: ${this.message}`}}}q("ERR_BUFFER_OUT_OF_BOUNDS",function(F){return F?`${F} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),q("ERR_INVALID_ARG_TYPE",function(F,H){return`The "${F}" argument must be of type number. Received type ${typeof H}`},TypeError),q("ERR_OUT_OF_RANGE",function(F,H,U){let it=`The value of "${F}" is out of range.`,pt=U;return Number.isInteger(U)&&Math.abs(U)>2**32?pt=Z(String(U)):typeof U=="bigint"&&(pt=String(U),(U>BigInt(2)**BigInt(32)||U<-(BigInt(2)**BigInt(32)))&&(pt=Z(pt)),pt+="n"),it+=` It must be ${H}. Received ${pt}`,it},RangeError);function Z(F){let H="",U=F.length;const it=F[0]==="-"?1:0;for(;U>=it+4;U-=3)H=`_${F.slice(U-3,U)}${H}`;return`${F.slice(0,U)}${H}`}function rt(F,H,U){G(H,"offset"),(F[H]===void 0||F[H+U]===void 0)&&z(H,F.length-(U+1))}function D(F,H,U,it,pt,ft){if(F>U||F<H){const mt=typeof H=="bigint"?"n":"";let re;throw ft>3?H===0||H===BigInt(0)?re=`>= 0${mt} and < 2${mt} ** ${(ft+1)*8}${mt}`:re=`>= -(2${mt} ** ${(ft+1)*8-1}${mt}) and < 2 ** ${(ft+1)*8-1}${mt}`:re=`>= ${H}${mt} and <= ${U}${mt}`,new R.ERR_OUT_OF_RANGE("value",re,F)}rt(it,pt,ft)}function G(F,H){if(typeof F!="number")throw new R.ERR_INVALID_ARG_TYPE(H,"number",F)}function z(F,H,U){throw Math.floor(F)!==F?(G(F,U),new R.ERR_OUT_OF_RANGE(U||"offset","an integer",F)):H<0?new R.ERR_BUFFER_OUT_OF_BOUNDS:new R.ERR_OUT_OF_RANGE(U||"offset",`>= ${U?1:0} and <= ${H}`,F)}const X=/[^+/0-9A-Za-z-_]/g;function st(F){if(F=F.split("=")[0],F=F.trim().replace(X,""),F.length<2)return"";for(;F.length%4!==0;)F=F+"=";return F}function nt(F,H){H=H||1/0;let U;const it=F.length;let pt=null;const ft=[];for(let mt=0;mt<it;++mt){if(U=F.charCodeAt(mt),U>55295&&U<57344){if(!pt){if(U>56319){(H-=3)>-1&&ft.push(239,191,189);continue}else if(mt+1===it){(H-=3)>-1&&ft.push(239,191,189);continue}pt=U;continue}if(U<56320){(H-=3)>-1&&ft.push(239,191,189),pt=U;continue}U=(pt-55296<<10|U-56320)+65536}else pt&&(H-=3)>-1&&ft.push(239,191,189);if(pt=null,U<128){if((H-=1)<0)break;ft.push(U)}else if(U<2048){if((H-=2)<0)break;ft.push(U>>6|192,U&63|128)}else if(U<65536){if((H-=3)<0)break;ft.push(U>>12|224,U>>6&63|128,U&63|128)}else if(U<1114112){if((H-=4)<0)break;ft.push(U>>18|240,U>>12&63|128,U>>6&63|128,U&63|128)}else throw new Error("Invalid code point")}return ft}function lt(F){const H=[];for(let U=0;U<F.length;++U)H.push(F.charCodeAt(U)&255);return H}function Et(F,H){let U,it,pt;const ft=[];for(let mt=0;mt<F.length&&!((H-=2)<0);++mt)U=F.charCodeAt(mt),it=U>>8,pt=U%256,ft.push(pt),ft.push(it);return ft}function gt(F){return O.toByteArray(st(F))}function bt(F,H,U,it){let pt;for(pt=0;pt<it&&!(pt+U>=H.length||pt>=F.length);++pt)H[pt+U]=F[pt];return pt}function Bt(F,H){return F instanceof H||F!=null&&F.constructor!=null&&F.constructor.name!=null&&F.constructor.name===H.name}function Mt(F){return F!==F}const It=function(){const F="0123456789abcdef",H=new Array(256);for(let U=0;U<16;++U){const it=U*16;for(let pt=0;pt<16;++pt)H[it+pt]=F[U]+F[pt]}return H}();function J(F){return typeof BigInt>"u"?tt:F}function tt(){throw new Error("BigInt not supported")}})(Va),window.Buffer=Va.Buffer,globalThis.Buffer=Va.Buffer;var ve=(K,O,L)=>new Promise((Y,ut)=>{var ht=y=>{try{_(L.next(y))}catch(x){ut(x)}},W=y=>{try{_(L.throw(y))}catch(x){ut(x)}},_=y=>y.done?Y(y.value):Promise.resolve(y.value).then(ht,W);_((L=L.apply(K,O)).next())});class _p extends sp{constructor(O,L){super(O??oc.create(),L)}getKnowledge(O,L){return ve(this,null,function*(){return this.get("/knowledge",{docId:O,name:L})})}postKnowledge(O){return ve(this,null,function*(){return this.post("/knowledge",O)})}getKnowledgeId(O){return ve(this,null,function*(){return this.get(`/knowledge/${O}`)})}patchKnowledgeId(O,L){return ve(this,null,function*(){return this.patch(`/knowledge/${O}`,L)})}delKnowledgeId(O){return ve(this,null,function*(){return this.delete(`/knowledge/${O}`)})}getKnowledgeIdFile(O){return ve(this,null,function*(){return this.get(`/knowledge/${O}/file`)})}getKnowledgeIdFileList(O,L){return ve(this,null,function*(){return this.listPaged(`/knowledge/${O}/file`,L)})}postKnowledgeIdFile(O,L){return ve(this,null,function*(){return this.post(`/knowledge/${O}/file`,L)})}getUploadTicket(O){return ve(this,null,function*(){return this.get("/upload/ticket",O)})}delKnowledgeIdFileFid(O,L){return ve(this,null,function*(){return this.delete(`/knowledge/${O}/file/${L}`)})}patchKnowledgeIdFileFid(O,L,Y){return ve(this,null,function*(){return this.patch(`/knowledge/${O}/file/${L}`,Y)})}listSessions(O,L){return ve(this,null,function*(){return this.get(`/application/${O}/sessionsa`,L)})}postSession(O,L){return ve(this,null,function*(){return this.post(`/application/${O}/sessions`,L)})}getSession(O,L){return ve(this,null,function*(){return this.get(`/application/${O}/sessions/${L}`)})}patchSessionsId(O,L,Y){return ve(this,null,function*(){return this.patch(`/application/${O}/sessions/${L}`,Y)})}delSessionsId(O,L){return ve(this,null,function*(){return this.delete(`/application/${O}/sessions/${L}`)})}getSessionKnowledgeFile(O,L,Y){return ve(this,null,function*(){return this.get(`/application/${O}session/${L}/file/${Y}`)})}postSessionKnowledgeFile(O,L,Y){return ve(this,null,function*(){return this.post(`/application/${O}session/${L}/file`,Y)})}postComments(O,L,Y){return ve(this,null,function*(){return this.post(`/application/${O}/sessions/${L}/comments`,Y)})}getChatHistorySessionId(O,L,Y){return ve(this,null,function*(){return this.get(`application/${O}/chatHistory/${L}`,Y)})}postChatHistorySessionId(O,L){return ve(this,null,function*(){return this.post(`/chatHistory/${O}`,L)})}getApplications(O){return ve(this,null,function*(){return this.get("/applications",O)})}postApplication(O){return ve(this,null,function*(){return this.post("/applications",O)})}getApplicationId(O){return ve(this,null,function*(){return this.get(`/applications/${O}`)})}patchApplicationId(O,L){return ve(this,null,function*(){return this.patch(`/applications/${O}`,L)})}delApplicationId(O){return ve(this,null,function*(){return this.delete(`/applications/${O}`)})}getApplicationIdSessions(O){return ve(this,null,function*(){return this.get(`/applications/${O}/session`)})}patchFileId(O,L){return ve(this,null,function*(){return this.patch(`/file/${O}`,L)})}getCvforceResource(O){return ve(this,null,function*(){return this.get("/cvforce/resource",O)})}postKnowledgeIdComposedFiles(O,L){return ve(this,null,function*(){return this.post(`/knowledge/${O}/composedFiles`,L)})}getTokensApplicationId(O,L){return ve(this,null,function*(){return this.get(`/tokens/${O}`,L)})}getTokens(O){return ve(this,null,function*(){return this.get("/tokens",O)})}uploadMinioFile(O,L){return ve(this,null,function*(){return new Promise((Y,ut)=>{const ht=new FileReader;ht.readAsArrayBuffer(L),ht.onload=W=>{cc.initMinio({endPoint:O.endpoints[0],useSSL:O.useSSL,accessKey:O.accessKey,secretKey:O.secretKey});const _=Buffer.from(W.target.result),y={"Content-Type":"application/octet-stream"};cc.putObjectBuffer(O.bucket,O.fileKeys[0],_,y,x=>{if(x)throw console.error(x),Error(x);Y(O.fileKeys[0])})}})})}uploadFile(O,L){return ve(this,null,function*(){const Y={files:[L.name],isv:"minio",knowledgeId:O};return this.getUploadTicket(Y).then(ut=>this.uploadMinioFile(ut.minio,L)).catch(ut=>{throw Error(ut)})})}uploadFiles(O,L){return ve(this,null,function*(){const Y={files:L.map(ut=>ut.name),isv:"minio",knowledgeId:O};return this.getUploadTicket(Y).then(ut=>Promise.all(L.map(ht=>this.uploadMinioFile(ut.minio,ht)))).catch(ut=>{throw Error(ut)})})}getAecModels(){return ve(this,null,function*(){return this.get("/aecModels")})}postTextFilter(O){return ve(this,null,function*(){return this.post("/textFilter",O)})}getTenantModel(){return ve(this,null,function*(){return this.get("/tenantModel")})}getPrompts(O,L){return ve(this,null,function*(){return this.get(`application/${O}/promptVariables`,L)})}postPrompt(O,L){return ve(this,null,function*(){return this.post(`application/${O}/promptVariables`,L)})}patchPromptId(O,L,Y){return ve(this,null,function*(){return this.patch(`application/${O}/promptVariables/${L}`,Y)})}delPromptId(O,L){return ve(this,null,function*(){return this.delete(`application/${O}/promptVariables/${L}`)})}getSessionPrompts(O){return ve(this,null,function*(){return this.get(`session/${O}/promptVariables`)})}patchSessionPromptId(O,L,Y){return ve(this,null,function*(){return this.patch(`session/${L}/promptVariables/${O}`,Y)})}getApplicationIdSessionIdPromptVariables(O,L){return ve(this,null,function*(){return this.get(`/application/${O}/session/${L}/promptVariables`)})}patchApplicationIdSessionpromptVariablesId(O,L,Y,ut){return ve(this,null,function*(){return this.patch(`/application/${O}/session/${L}/promptVariables/${Y}`,ut)})}getPresetApplication(O){return ve(this,null,function*(){return this.get("presetApplication",O)})}postKnowledgeConfig(O){return ve(this,null,function*(){return this.post("/knowledgeConfig",O)})}getKnowledgeConfig(O){return ve(this,null,function*(){return this.get(`/knowledgeConfig/${O}`)})}patchKnowledgeConfig(O,L){return ve(this,null,function*(){return this.patch(`/knowledgeConfig/${O}`,L)})}getKnowledgeIdFileId(O,L){return ve(this,null,function*(){return this.get(`/knowledge/${O}/file/${L}`)})}getKnowledgeIdFileIdData(O,L,Y){return ve(this,null,function*(){return this.listPaged(`/knowledge/${O}/file/${L}/data`,Y)})}postKnowledgeIdFileIdData(O,L,Y){return ve(this,null,function*(){return this.post(`/knowledge/${O}/file/${L}/data`,{data:Y})})}patchKnowledgeIdFileIdData(O,L,Y,ut){return ve(this,null,function*(){return this.patch(`/knowledge/${O}/file/${L}/data/${Y}`,{data:ut})})}delKnowledgeIdFileIdDataDid(O,L,Y){return ve(this,null,function*(){return this.delete(`/knowledge/${O}/file/${L}/data/${Y}`)})}getPresetKnowledge(O){return ve(this,null,function*(){return this.get("/presetKnowledge",O)})}patchSessionsIdContext(O){return ve(this,null,function*(){return this.patch(`/sessions/${O}/context`,{})})}postResourceToken(O){return ve(this,null,function*(){return this.post("/resourceToken",O)})}getApplicationIdSession(O){return ve(this,null,function*(){return this.get(`/application/${O}/session`)})}patchApplicationIdSessionsIdContext(O,L){return ve(this,null,function*(){return this.patch(`/application/${O}/sessions/${L}/context`,{})})}postApplicationIdSessions(O,L){return ve(this,null,function*(){return this.post(`/application/${O}/sessions`,L)})}getApplicationIdChatHistorySessionId(O,L){return ve(this,null,function*(){return this.get(`/application/${O}/chatHistory/${L}`)})}postApplicationIdChatHistorySessionIdComments(O,L,Y){return ve(this,null,function*(){return this.post(`/application/${O}/sessions/${L}/comments`,Y)})}getApplicationIdPrompts(O,L){return ve(this,null,function*(){return this.get(`/application/${O}/promptVariables`,L)})}postKnowledgeSourceFile(O,L,Y){return ve(this,null,function*(){return this.post(`/knowledge/${O}/sourceFile/${L}`,Y)})}getMetadata(O){return ve(this,null,function*(){return this.get("/metadata",O)})}postGeneques(O){return ve(this,null,function*(){return this.post("/geneques",O)})}getBaseModel(O){return ve(this,null,function*(){return this.get("/baseModelInfo",{serviceId:O})})}}var vr=(K=>(K[K.Robot=1]="Robot",K[K.User=2]="User",K[K.System=3]="System",K))(vr||{}),pc=(K=>(K[K.Idle=0]="Idle",K[K.Quoted=1]="Quoted",K))(pc||{}),bn=(K=>(K[K.Dialog=0]="Dialog",K[K.Text=1]="Text",K[K.Agent=2]="Agent",K[K.All=3]="All",K))(bn||{});function dc(K,O,L){const Y=x=>{var v;return O&&(sf(O)&&L(403,"aiotToken is timeout"),x.headers=(v=x.headers)!==null&&v!==void 0?v:{},x.headers=Object.assign(Object.assign({},x.headers),{Authorization:O?`Bearer ${O}`:""})),x};function ut(x,v=!0){const m=`${K}${x}`,S=oc.create({baseURL:m});return v&&S.interceptors.request.use(Y),S}const ht=(x,v)=>{x===401&&L(x,"aiotToken is invalid")},W=(x,v)=>{x!==10001&&x!==10215&&L(x,v)},_=ut("/data/v1");return new _p(_,{onHttpStatusError:ht,onAppStatusError:W})}const kr=Object.create(null);kr.open="0",kr.close="1",kr.ping="2",kr.pong="3",kr.message="4",kr.upgrade="5",kr.noop="6";const po=Object.create(null);Object.keys(kr).forEach(K=>{po[kr[K]]=K});const Ka={type:"error",data:"parser error"},mc=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",gc=typeof ArrayBuffer=="function",vc=K=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(K):K&&K.buffer instanceof ArrayBuffer,Ja=({type:K,data:O},L,Y)=>mc&&O instanceof Blob?L?Y(O):yc(O,Y):gc&&(O instanceof ArrayBuffer||vc(O))?L?Y(O):yc(new Blob([O]),Y):Y(kr[K]+(O||"")),yc=(K,O)=>{const L=new FileReader;return L.onload=function(){const Y=L.result.split(",")[1];O("b"+(Y||""))},L.readAsDataURL(K)};function bc(K){return K instanceof Uint8Array?K:K instanceof ArrayBuffer?new Uint8Array(K):new Uint8Array(K.buffer,K.byteOffset,K.byteLength)}let Ga;function Sp(K,O){if(mc&&K.data instanceof Blob)return K.data.arrayBuffer().then(bc).then(O);if(gc&&(K.data instanceof ArrayBuffer||vc(K.data)))return O(bc(K.data));Ja(K,!1,L=>{Ga||(Ga=new TextEncoder),O(Ga.encode(L))})}const wc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cn=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let K=0;K<wc.length;K++)Cn[wc.charCodeAt(K)]=K;const Ep=K=>{let O=K.length*.75,L=K.length,Y,ut=0,ht,W,_,y;K[K.length-1]==="="&&(O--,K[K.length-2]==="="&&O--);const x=new ArrayBuffer(O),v=new Uint8Array(x);for(Y=0;Y<L;Y+=4)ht=Cn[K.charCodeAt(Y)],W=Cn[K.charCodeAt(Y+1)],_=Cn[K.charCodeAt(Y+2)],y=Cn[K.charCodeAt(Y+3)],v[ut++]=ht<<2|W>>4,v[ut++]=(W&15)<<4|_>>2,v[ut++]=(_&3)<<6|y&63;return x},kp=typeof ArrayBuffer=="function",Ya=(K,O)=>{if(typeof K!="string")return{type:"message",data:Mc(K,O)};const L=K.charAt(0);return L==="b"?{type:"message",data:Ip(K.substring(1),O)}:po[L]?K.length>1?{type:po[L],data:K.substring(1)}:{type:po[L]}:Ka},Ip=(K,O)=>{if(kp){const L=Ep(K);return Mc(L,O)}else return{base64:!0,data:K}},Mc=(K,O)=>{switch(O){case"blob":return K instanceof Blob?K:new Blob([K]);case"arraybuffer":default:return K instanceof ArrayBuffer?K:K.buffer}},xc=String.fromCharCode(30),Op=(K,O)=>{const L=K.length,Y=new Array(L);let ut=0;K.forEach((ht,W)=>{Ja(ht,!1,_=>{Y[W]=_,++ut===L&&O(Y.join(xc))})})},Ap=(K,O)=>{const L=K.split(xc),Y=[];for(let ut=0;ut<L.length;ut++){const ht=Ya(L[ut],O);if(Y.push(ht),ht.type==="error")break}return Y};function Tp(){return new TransformStream({transform(K,O){Sp(K,L=>{const Y=L.length;let ut;if(Y<126)ut=new Uint8Array(1),new DataView(ut.buffer).setUint8(0,Y);else if(Y<65536){ut=new Uint8Array(3);const ht=new DataView(ut.buffer);ht.setUint8(0,126),ht.setUint16(1,Y)}else{ut=new Uint8Array(9);const ht=new DataView(ut.buffer);ht.setUint8(0,127),ht.setBigUint64(1,BigInt(Y))}K.data&&typeof K.data!="string"&&(ut[0]|=128),O.enqueue(ut),O.enqueue(L)})}})}let Qa;function mo(K){return K.reduce((O,L)=>O+L.length,0)}function go(K,O){if(K[0].length===O)return K.shift();const L=new Uint8Array(O);let Y=0;for(let ut=0;ut<O;ut++)L[ut]=K[0][Y++],Y===K[0].length&&(K.shift(),Y=0);return K.length&&Y<K[0].length&&(K[0]=K[0].slice(Y)),L}function Bp(K,O){Qa||(Qa=new TextDecoder);const L=[];let Y=0,ut=-1,ht=!1;return new TransformStream({transform(W,_){for(L.push(W);;){if(Y===0){if(mo(L)<1)break;const y=go(L,1);ht=(y[0]&128)===128,ut=y[0]&127,ut<126?Y=3:ut===126?Y=1:Y=2}else if(Y===1){if(mo(L)<2)break;const y=go(L,2);ut=new DataView(y.buffer,y.byteOffset,y.length).getUint16(0),Y=3}else if(Y===2){if(mo(L)<8)break;const y=go(L,8),x=new DataView(y.buffer,y.byteOffset,y.length),v=x.getUint32(0);if(v>Math.pow(2,53-32)-1){_.enqueue(Ka);break}ut=v*Math.pow(2,32)+x.getUint32(4),Y=3}else{if(mo(L)<ut)break;const y=go(L,ut);_.enqueue(Ya(ht?y:Qa.decode(y),O)),Y=0}if(ut===0||ut>K){_.enqueue(Ka);break}}}})}const _c=4;function Bi(K){if(K)return jp(K)}function jp(K){for(var O in Bi.prototype)K[O]=Bi.prototype[O];return K}Bi.prototype.on=Bi.prototype.addEventListener=function(K,O){return this._callbacks=this._callbacks||{},(this._callbacks["$"+K]=this._callbacks["$"+K]||[]).push(O),this},Bi.prototype.once=function(K,O){function L(){this.off(K,L),O.apply(this,arguments)}return L.fn=O,this.on(K,L),this},Bi.prototype.off=Bi.prototype.removeListener=Bi.prototype.removeAllListeners=Bi.prototype.removeEventListener=function(K,O){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var L=this._callbacks["$"+K];if(!L)return this;if(arguments.length==1)return delete this._callbacks["$"+K],this;for(var Y,ut=0;ut<L.length;ut++)if(Y=L[ut],Y===O||Y.fn===O){L.splice(ut,1);break}return L.length===0&&delete this._callbacks["$"+K],this},Bi.prototype.emit=function(K){this._callbacks=this._callbacks||{};for(var O=new Array(arguments.length-1),L=this._callbacks["$"+K],Y=1;Y<arguments.length;Y++)O[Y-1]=arguments[Y];if(L){L=L.slice(0);for(var Y=0,ut=L.length;Y<ut;++Y)L[Y].apply(this,O)}return this},Bi.prototype.emitReserved=Bi.prototype.emit,Bi.prototype.listeners=function(K){return this._callbacks=this._callbacks||{},this._callbacks["$"+K]||[]},Bi.prototype.hasListeners=function(K){return!!this.listeners(K).length};const ur=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function Sc(K,...O){return O.reduce((L,Y)=>(K.hasOwnProperty(Y)&&(L[Y]=K[Y]),L),{})}const Rp=ur.setTimeout,Np=ur.clearTimeout;function vo(K,O){O.useNativeTimers?(K.setTimeoutFn=Rp.bind(ur),K.clearTimeoutFn=Np.bind(ur)):(K.setTimeoutFn=ur.setTimeout.bind(ur),K.clearTimeoutFn=ur.clearTimeout.bind(ur))}const Cp=1.33;function Pp(K){return typeof K=="string"?Lp(K):Math.ceil((K.byteLength||K.size)*Cp)}function Lp(K){let O=0,L=0;for(let Y=0,ut=K.length;Y<ut;Y++)O=K.charCodeAt(Y),O<128?L+=1:O<2048?L+=2:O<55296||O>=57344?L+=3:(Y++,L+=4);return L}function Dp(K){let O="";for(let L in K)K.hasOwnProperty(L)&&(O.length&&(O+="&"),O+=encodeURIComponent(L)+"="+encodeURIComponent(K[L]));return O}function Up(K){let O={},L=K.split("&");for(let Y=0,ut=L.length;Y<ut;Y++){let ht=L[Y].split("=");O[decodeURIComponent(ht[0])]=decodeURIComponent(ht[1])}return O}class qp extends Error{constructor(O,L,Y){super(O),this.description=L,this.context=Y,this.type="TransportError"}}class ts extends Bi{constructor(O){super(),this.writable=!1,vo(this,O),this.opts=O,this.query=O.query,this.socket=O.socket}onError(O,L,Y){return super.emitReserved("error",new qp(O,L,Y)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(O){this.readyState==="open"&&this.write(O)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(O){const L=Ya(O,this.socket.binaryType);this.onPacket(L)}onPacket(O){super.emitReserved("packet",O)}onClose(O){this.readyState="closed",super.emitReserved("close",O)}pause(O){}createUri(O,L={}){return O+"://"+this._hostname()+this._port()+this.opts.path+this._query(L)}_hostname(){const O=this.opts.hostname;return O.indexOf(":")===-1?O:"["+O+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(O){const L=Dp(O);return L.length?"?"+L:""}}const Ec="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),es=64,Fp={};let kc=0,yo=0,Ic;function Oc(K){let O="";do O=Ec[K%es]+O,K=Math.floor(K/es);while(K>0);return O}function Ac(){const K=Oc(+new Date);return K!==Ic?(kc=0,Ic=K):K+"."+Oc(kc++)}for(;yo<es;yo++)Fp[Ec[yo]]=yo;let Tc=!1;try{Tc=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const zp=Tc;function Bc(K){const O=K.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!O||zp))return new XMLHttpRequest}catch{}if(!O)try{return new ur[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function Lm(){}function $p(){}const Hp=function(){return new Bc({xdomain:!1}).responseType!=null}();class Wp extends ts{constructor(O){if(super(O),this.polling=!1,typeof location<"u"){const Y=location.protocol==="https:";let ut=location.port;ut||(ut=Y?"443":"80"),this.xd=typeof location<"u"&&O.hostname!==location.hostname||ut!==O.port}const L=O&&O.forceBase64;this.supportsBinary=Hp&&!L,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(O){this.readyState="pausing";const L=()=>{this.readyState="paused",O()};if(this.polling||!this.writable){let Y=0;this.polling&&(Y++,this.once("pollComplete",function(){--Y||L()})),this.writable||(Y++,this.once("drain",function(){--Y||L()}))}else L()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(O){const L=Y=>{if(this.readyState==="opening"&&Y.type==="open"&&this.onOpen(),Y.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(Y)};Ap(O,this.socket.binaryType).forEach(L),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const O=()=>{this.write([{type:"close"}])};this.readyState==="open"?O():this.once("open",O)}write(O){this.writable=!1,Op(O,L=>{this.doWrite(L,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const O=this.opts.secure?"https":"http",L=this.query||{};return this.opts.timestampRequests!==!1&&(L[this.opts.timestampParam]=Ac()),!this.supportsBinary&&!L.sid&&(L.b64=1),this.createUri(O,L)}request(O={}){return Object.assign(O,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Ir(this.uri(),O)}doWrite(O,L){const Y=this.request({method:"POST",data:O});Y.on("success",L),Y.on("error",(ut,ht)=>{this.onError("xhr post error",ut,ht)})}doPoll(){const O=this.request();O.on("data",this.onData.bind(this)),O.on("error",(L,Y)=>{this.onError("xhr poll error",L,Y)}),this.pollXhr=O}}class Ir extends Bi{constructor(O,L){super(),vo(this,L),this.opts=L,this.method=L.method||"GET",this.uri=O,this.data=L.data!==void 0?L.data:null,this.create()}create(){var O;const L=Sc(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");L.xdomain=!!this.opts.xd;const Y=this.xhr=new Bc(L);try{Y.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){Y.setDisableHeaderCheck&&Y.setDisableHeaderCheck(!0);for(let ut in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(ut)&&Y.setRequestHeader(ut,this.opts.extraHeaders[ut])}}catch{}if(this.method==="POST")try{Y.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{Y.setRequestHeader("Accept","*/*")}catch{}(O=this.opts.cookieJar)===null||O===void 0||O.addCookies(Y),"withCredentials"in Y&&(Y.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(Y.timeout=this.opts.requestTimeout),Y.onreadystatechange=()=>{var ut;Y.readyState===3&&((ut=this.opts.cookieJar)===null||ut===void 0||ut.parseCookies(Y)),Y.readyState===4&&(Y.status===200||Y.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof Y.status=="number"?Y.status:0)},0))},Y.send(this.data)}catch(ut){this.setTimeoutFn(()=>{this.onError(ut)},0);return}typeof document<"u"&&(this.index=Ir.requestsCount++,Ir.requests[this.index]=this)}onError(O){this.emitReserved("error",O,this.xhr),this.cleanup(!0)}cleanup(O){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=$p,O)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Ir.requests[this.index],this.xhr=null}}onLoad(){const O=this.xhr.responseText;O!==null&&(this.emitReserved("data",O),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(Ir.requestsCount=0,Ir.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",jc);else if(typeof addEventListener=="function"){const K="onpagehide"in ur?"pagehide":"unload";addEventListener(K,jc,!1)}}function jc(){for(let K in Ir.requests)Ir.requests.hasOwnProperty(K)&&Ir.requests[K].abort()}const is=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?O=>Promise.resolve().then(O):(O,L)=>L(O,0))(),bo=ur.WebSocket||ur.MozWebSocket,Rc=!0,Vp="arraybuffer",Nc=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Xp extends ts{constructor(O){super(O),this.supportsBinary=!O.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const O=this.uri(),L=this.opts.protocols,Y=Nc?{}:Sc(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(Y.headers=this.opts.extraHeaders);try{this.ws=Rc&&!Nc?L?new bo(O,L):new bo(O):new bo(O,L,Y)}catch(ut){return this.emitReserved("error",ut)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=O=>this.onClose({description:"websocket connection closed",context:O}),this.ws.onmessage=O=>this.onData(O.data),this.ws.onerror=O=>this.onError("websocket error",O)}write(O){this.writable=!1;for(let L=0;L<O.length;L++){const Y=O[L],ut=L===O.length-1;Ja(Y,this.supportsBinary,ht=>{const W={};try{Rc&&this.ws.send(ht)}catch{}ut&&is(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const O=this.opts.secure?"wss":"ws",L=this.query||{};return this.opts.timestampRequests&&(L[this.opts.timestampParam]=Ac()),this.supportsBinary||(L.b64=1),this.createUri(O,L)}check(){return!!bo}}class Zp extends ts{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(O=>{this.onError("webtransport error",O)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(O=>{const L=Bp(Number.MAX_SAFE_INTEGER,this.socket.binaryType),Y=O.readable.pipeThrough(L).getReader(),ut=Tp();ut.readable.pipeTo(O.writable),this.writer=ut.writable.getWriter();const ht=()=>{Y.read().then(({done:_,value:y})=>{_||(this.onPacket(y),ht())}).catch(_=>{})};ht();const W={type:"open"};this.query.sid&&(W.data=`{"sid":"${this.query.sid}"}`),this.writer.write(W).then(()=>this.onOpen())})}))}write(O){this.writable=!1;for(let L=0;L<O.length;L++){const Y=O[L],ut=L===O.length-1;this.writer.write(Y).then(()=>{ut&&is(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var O;(O=this.transport)===null||O===void 0||O.close()}}const Kp={websocket:Xp,webtransport:Zp,polling:Wp},Jp=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Gp=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function rs(K){if(K.length>2e3)throw"URI too long";const O=K,L=K.indexOf("["),Y=K.indexOf("]");L!=-1&&Y!=-1&&(K=K.substring(0,L)+K.substring(L,Y).replace(/:/g,";")+K.substring(Y,K.length));let ut=Jp.exec(K||""),ht={},W=14;for(;W--;)ht[Gp[W]]=ut[W]||"";return L!=-1&&Y!=-1&&(ht.source=O,ht.host=ht.host.substring(1,ht.host.length-1).replace(/;/g,":"),ht.authority=ht.authority.replace("[","").replace("]","").replace(/;/g,":"),ht.ipv6uri=!0),ht.pathNames=Yp(ht,ht.path),ht.queryKey=Qp(ht,ht.query),ht}function Yp(K,O){const L=/\/{2,9}/g,Y=O.replace(L,"/").split("/");return(O.slice(0,1)=="/"||O.length===0)&&Y.splice(0,1),O.slice(-1)=="/"&&Y.splice(Y.length-1,1),Y}function Qp(K,O){const L={};return O.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(Y,ut,ht){ut&&(L[ut]=ht)}),L}let Cc=class Rn extends Bi{constructor(O,L={}){super(),this.binaryType=Vp,this.writeBuffer=[],O&&typeof O=="object"&&(L=O,O=null),O?(O=rs(O),L.hostname=O.host,L.secure=O.protocol==="https"||O.protocol==="wss",L.port=O.port,O.query&&(L.query=O.query)):L.host&&(L.hostname=rs(L.host).host),vo(this,L),this.secure=L.secure!=null?L.secure:typeof location<"u"&&location.protocol==="https:",L.hostname&&!L.port&&(L.port=this.secure?"443":"80"),this.hostname=L.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=L.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=L.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},L),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Up(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(O){const L=Object.assign({},this.opts.query);L.EIO=_c,L.transport=O,this.id&&(L.sid=this.id);const Y=Object.assign({},this.opts,{query:L,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[O]);return new Kp[O](Y)}open(){let O;if(this.opts.rememberUpgrade&&Rn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)O="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else O=this.transports[0];this.readyState="opening";try{O=this.createTransport(O)}catch{this.transports.shift(),this.open();return}O.open(),this.setTransport(O)}setTransport(O){this.transport&&this.transport.removeAllListeners(),this.transport=O,O.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",L=>this.onClose("transport close",L))}probe(O){let L=this.createTransport(O),Y=!1;Rn.priorWebsocketSuccess=!1;const ut=()=>{Y||(L.send([{type:"ping",data:"probe"}]),L.once("packet",m=>{if(!Y)if(m.type==="pong"&&m.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",L),!L)return;Rn.priorWebsocketSuccess=L.name==="websocket",this.transport.pause(()=>{Y||this.readyState!=="closed"&&(v(),this.setTransport(L),L.send([{type:"upgrade"}]),this.emitReserved("upgrade",L),L=null,this.upgrading=!1,this.flush())})}else{const S=new Error("probe error");S.transport=L.name,this.emitReserved("upgradeError",S)}}))};function ht(){Y||(Y=!0,v(),L.close(),L=null)}const W=m=>{const S=new Error("probe error: "+m);S.transport=L.name,ht(),this.emitReserved("upgradeError",S)};function _(){W("transport closed")}function y(){W("socket closed")}function x(m){L&&m.name!==L.name&&ht()}const v=()=>{L.removeListener("open",ut),L.removeListener("error",W),L.removeListener("close",_),this.off("close",y),this.off("upgrading",x)};L.once("open",ut),L.once("error",W),L.once("close",_),this.once("close",y),this.once("upgrading",x),this.upgrades.indexOf("webtransport")!==-1&&O!=="webtransport"?this.setTimeoutFn(()=>{Y||L.open()},200):L.open()}onOpen(){if(this.readyState="open",Rn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let O=0;const L=this.upgrades.length;for(;O<L;O++)this.probe(this.upgrades[O])}}onPacket(O){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",O),this.emitReserved("heartbeat"),this.resetPingTimeout(),O.type){case"open":this.onHandshake(JSON.parse(O.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const L=new Error("server error");L.code=O.data,this.onError(L);break;case"message":this.emitReserved("data",O.data),this.emitReserved("message",O.data);break}}onHandshake(O){this.emitReserved("handshake",O),this.id=O.sid,this.transport.query.sid=O.sid,this.upgrades=this.filterUpgrades(O.upgrades),this.pingInterval=O.pingInterval,this.pingTimeout=O.pingTimeout,this.maxPayload=O.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const O=this.getWritablePackets();this.transport.send(O),this.prevBufferLen=O.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let L=1;for(let Y=0;Y<this.writeBuffer.length;Y++){const ut=this.writeBuffer[Y].data;if(ut&&(L+=Pp(ut)),Y>0&&L>this.maxPayload)return this.writeBuffer.slice(0,Y);L+=2}return this.writeBuffer}write(O,L,Y){return this.sendPacket("message",O,L,Y),this}send(O,L,Y){return this.sendPacket("message",O,L,Y),this}sendPacket(O,L,Y,ut){if(typeof L=="function"&&(ut=L,L=void 0),typeof Y=="function"&&(ut=Y,Y=null),this.readyState==="closing"||this.readyState==="closed")return;Y=Y||{},Y.compress=Y.compress!==!1;const ht={type:O,data:L,options:Y};this.emitReserved("packetCreate",ht),this.writeBuffer.push(ht),ut&&this.once("flush",ut),this.flush()}close(){const O=()=>{this.onClose("forced close"),this.transport.close()},L=()=>{this.off("upgrade",L),this.off("upgradeError",L),O()},Y=()=>{this.once("upgrade",L),this.once("upgradeError",L)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?Y():O()}):this.upgrading?Y():O()),this}onError(O){Rn.priorWebsocketSuccess=!1,this.emitReserved("error",O),this.onClose("transport error",O)}onClose(O,L){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",O,L),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(O){const L=[];let Y=0;const ut=O.length;for(;Y<ut;Y++)~this.transports.indexOf(O[Y])&&L.push(O[Y]);return L}};Cc.protocol=_c;function td(K,O="",L){let Y=K;L=L||typeof location<"u"&&location,K==null&&(K=L.protocol+"//"+L.host),typeof K=="string"&&(K.charAt(0)==="/"&&(K.charAt(1)==="/"?K=L.protocol+K:K=L.host+K),/^(https?|wss?):\/\//.test(K)||(typeof L<"u"?K=L.protocol+"//"+K:K="https://"+K),Y=rs(K)),Y.port||(/^(http|ws)$/.test(Y.protocol)?Y.port="80":/^(http|ws)s$/.test(Y.protocol)&&(Y.port="443")),Y.path=Y.path||"/";const ht=Y.host.indexOf(":")!==-1?"["+Y.host+"]":Y.host;return Y.id=Y.protocol+"://"+ht+":"+Y.port+O,Y.href=Y.protocol+"://"+ht+(L&&L.port===Y.port?"":":"+Y.port),Y}const ed=typeof ArrayBuffer=="function",id=K=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(K):K.buffer instanceof ArrayBuffer,Pc=Object.prototype.toString,rd=typeof Blob=="function"||typeof Blob<"u"&&Pc.call(Blob)==="[object BlobConstructor]",nd=typeof File=="function"||typeof File<"u"&&Pc.call(File)==="[object FileConstructor]";function ns(K){return ed&&(K instanceof ArrayBuffer||id(K))||rd&&K instanceof Blob||nd&&K instanceof File}function wo(K,O){if(!K||typeof K!="object")return!1;if(Array.isArray(K)){for(let L=0,Y=K.length;L<Y;L++)if(wo(K[L]))return!0;return!1}if(ns(K))return!0;if(K.toJSON&&typeof K.toJSON=="function"&&arguments.length===1)return wo(K.toJSON(),!0);for(const L in K)if(Object.prototype.hasOwnProperty.call(K,L)&&wo(K[L]))return!0;return!1}function od(K){const O=[],L=K.data,Y=K;return Y.data=os(L,O),Y.attachments=O.length,{packet:Y,buffers:O}}function os(K,O){if(!K)return K;if(ns(K)){const L={_placeholder:!0,num:O.length};return O.push(K),L}else if(Array.isArray(K)){const L=new Array(K.length);for(let Y=0;Y<K.length;Y++)L[Y]=os(K[Y],O);return L}else if(typeof K=="object"&&!(K instanceof Date)){const L={};for(const Y in K)Object.prototype.hasOwnProperty.call(K,Y)&&(L[Y]=os(K[Y],O));return L}return K}function ad(K,O){return K.data=as(K.data,O),delete K.attachments,K}function as(K,O){if(!K)return K;if(K&&K._placeholder===!0){if(typeof K.num=="number"&&K.num>=0&&K.num<O.length)return O[K.num];throw new Error("illegal attachments")}else if(Array.isArray(K))for(let L=0;L<K.length;L++)K[L]=as(K[L],O);else if(typeof K=="object")for(const L in K)Object.prototype.hasOwnProperty.call(K,L)&&(K[L]=as(K[L],O));return K}const sd=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ud=5;var ti;(function(K){K[K.CONNECT=0]="CONNECT",K[K.DISCONNECT=1]="DISCONNECT",K[K.EVENT=2]="EVENT",K[K.ACK=3]="ACK",K[K.CONNECT_ERROR=4]="CONNECT_ERROR",K[K.BINARY_EVENT=5]="BINARY_EVENT",K[K.BINARY_ACK=6]="BINARY_ACK"})(ti||(ti={}));class cd{constructor(O){this.replacer=O}encode(O){return(O.type===ti.EVENT||O.type===ti.ACK)&&wo(O)?this.encodeAsBinary({type:O.type===ti.EVENT?ti.BINARY_EVENT:ti.BINARY_ACK,nsp:O.nsp,data:O.data,id:O.id}):[this.encodeAsString(O)]}encodeAsString(O){let L=""+O.type;return(O.type===ti.BINARY_EVENT||O.type===ti.BINARY_ACK)&&(L+=O.attachments+"-"),O.nsp&&O.nsp!=="/"&&(L+=O.nsp+","),O.id!=null&&(L+=O.id),O.data!=null&&(L+=JSON.stringify(O.data,this.replacer)),L}encodeAsBinary(O){const L=od(O),Y=this.encodeAsString(L.packet),ut=L.buffers;return ut.unshift(Y),ut}}function Lc(K){return Object.prototype.toString.call(K)==="[object Object]"}class ss extends Bi{constructor(O){super(),this.reviver=O}add(O){let L;if(typeof O=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");L=this.decodeString(O);const Y=L.type===ti.BINARY_EVENT;Y||L.type===ti.BINARY_ACK?(L.type=Y?ti.EVENT:ti.ACK,this.reconstructor=new ld(L),L.attachments===0&&super.emitReserved("decoded",L)):super.emitReserved("decoded",L)}else if(ns(O)||O.base64)if(this.reconstructor)L=this.reconstructor.takeBinaryData(O),L&&(this.reconstructor=null,super.emitReserved("decoded",L));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+O)}decodeString(O){let L=0;const Y={type:Number(O.charAt(0))};if(ti[Y.type]===void 0)throw new Error("unknown packet type "+Y.type);if(Y.type===ti.BINARY_EVENT||Y.type===ti.BINARY_ACK){const ht=L+1;for(;O.charAt(++L)!=="-"&&L!=O.length;);const W=O.substring(ht,L);if(W!=Number(W)||O.charAt(L)!=="-")throw new Error("Illegal attachments");Y.attachments=Number(W)}if(O.charAt(L+1)==="/"){const ht=L+1;for(;++L&&!(O.charAt(L)===","||L===O.length););Y.nsp=O.substring(ht,L)}else Y.nsp="/";const ut=O.charAt(L+1);if(ut!==""&&Number(ut)==ut){const ht=L+1;for(;++L;){const W=O.charAt(L);if(W==null||Number(W)!=W){--L;break}if(L===O.length)break}Y.id=Number(O.substring(ht,L+1))}if(O.charAt(++L)){const ht=this.tryParse(O.substr(L));if(ss.isPayloadValid(Y.type,ht))Y.data=ht;else throw new Error("invalid payload")}return Y}tryParse(O){try{return JSON.parse(O,this.reviver)}catch{return!1}}static isPayloadValid(O,L){switch(O){case ti.CONNECT:return Lc(L);case ti.DISCONNECT:return L===void 0;case ti.CONNECT_ERROR:return typeof L=="string"||Lc(L);case ti.EVENT:case ti.BINARY_EVENT:return Array.isArray(L)&&(typeof L[0]=="number"||typeof L[0]=="string"&&sd.indexOf(L[0])===-1);case ti.ACK:case ti.BINARY_ACK:return Array.isArray(L)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ld{constructor(O){this.packet=O,this.buffers=[],this.reconPack=O}takeBinaryData(O){if(this.buffers.push(O),this.buffers.length===this.reconPack.attachments){const L=ad(this.reconPack,this.buffers);return this.finishedReconstruction(),L}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const hd=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ss,Encoder:cd,get PacketType(){return ti},protocol:ud},Symbol.toStringTag,{value:"Module"}));function yr(K,O,L){return K.on(O,L),function(){K.off(O,L)}}const fd=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Dc extends Bi{constructor(O,L,Y){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=O,this.nsp=L,Y&&Y.auth&&(this.auth=Y.auth),this._opts=Object.assign({},Y),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const O=this.io;this.subs=[yr(O,"open",this.onopen.bind(this)),yr(O,"packet",this.onpacket.bind(this)),yr(O,"error",this.onerror.bind(this)),yr(O,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...O){return O.unshift("message"),this.emit.apply(this,O),this}emit(O,...L){if(fd.hasOwnProperty(O))throw new Error('"'+O.toString()+'" is a reserved event name');if(L.unshift(O),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(L),this;const Y={type:ti.EVENT,data:L};if(Y.options={},Y.options.compress=this.flags.compress!==!1,typeof L[L.length-1]=="function"){const W=this.ids++,_=L.pop();this._registerAckCallback(W,_),Y.id=W}const ut=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!ut||!this.connected)||(this.connected?(this.notifyOutgoingListeners(Y),this.packet(Y)):this.sendBuffer.push(Y)),this.flags={},this}_registerAckCallback(O,L){var Y;const ut=(Y=this.flags.timeout)!==null&&Y!==void 0?Y:this._opts.ackTimeout;if(ut===void 0){this.acks[O]=L;return}const ht=this.io.setTimeoutFn(()=>{delete this.acks[O];for(let _=0;_<this.sendBuffer.length;_++)this.sendBuffer[_].id===O&&this.sendBuffer.splice(_,1);L.call(this,new Error("operation has timed out"))},ut),W=(..._)=>{this.io.clearTimeoutFn(ht),L.apply(this,_)};W.withError=!0,this.acks[O]=W}emitWithAck(O,...L){return new Promise((Y,ut)=>{const ht=(W,_)=>W?ut(W):Y(_);ht.withError=!0,L.push(ht),this.emit(O,...L)})}_addToQueue(O){let L;typeof O[O.length-1]=="function"&&(L=O.pop());const Y={id:this._queueSeq++,tryCount:0,pending:!1,args:O,flags:Object.assign({fromQueue:!0},this.flags)};O.push((ut,...ht)=>Y!==this._queue[0]?void 0:(ut!==null?Y.tryCount>this._opts.retries&&(this._queue.shift(),L&&L(ut)):(this._queue.shift(),L&&L(null,...ht)),Y.pending=!1,this._drainQueue())),this._queue.push(Y),this._drainQueue()}_drainQueue(O=!1){if(!this.connected||this._queue.length===0)return;const L=this._queue[0];L.pending&&!O||(L.pending=!0,L.tryCount++,this.flags=L.flags,this.emit.apply(this,L.args))}packet(O){O.nsp=this.nsp,this.io._packet(O)}onopen(){typeof this.auth=="function"?this.auth(O=>{this._sendConnectPacket(O)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(O){this.packet({type:ti.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},O):O})}onerror(O){this.connected||this.emitReserved("connect_error",O)}onclose(O,L){this.connected=!1,delete this.id,this.emitReserved("disconnect",O,L),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(O=>{if(!this.sendBuffer.some(Y=>String(Y.id)===O)){const Y=this.acks[O];delete this.acks[O],Y.withError&&Y.call(this,new Error("socket has been disconnected"))}})}onpacket(O){if(O.nsp===this.nsp)switch(O.type){case ti.CONNECT:O.data&&O.data.sid?this.onconnect(O.data.sid,O.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ti.EVENT:case ti.BINARY_EVENT:this.onevent(O);break;case ti.ACK:case ti.BINARY_ACK:this.onack(O);break;case ti.DISCONNECT:this.ondisconnect();break;case ti.CONNECT_ERROR:this.destroy();const Y=new Error(O.data.message);Y.data=O.data.data,this.emitReserved("connect_error",Y);break}}onevent(O){const L=O.data||[];O.id!=null&&L.push(this.ack(O.id)),this.connected?this.emitEvent(L):this.receiveBuffer.push(Object.freeze(L))}emitEvent(O){if(this._anyListeners&&this._anyListeners.length){const L=this._anyListeners.slice();for(const Y of L)Y.apply(this,O)}super.emit.apply(this,O),this._pid&&O.length&&typeof O[O.length-1]=="string"&&(this._lastOffset=O[O.length-1])}ack(O){const L=this;let Y=!1;return function(...ut){Y||(Y=!0,L.packet({type:ti.ACK,id:O,data:ut}))}}onack(O){const L=this.acks[O.id];typeof L=="function"&&(delete this.acks[O.id],L.withError&&O.data.unshift(null),L.apply(this,O.data))}onconnect(O,L){this.id=O,this.recovered=L&&this._pid===L,this._pid=L,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(O=>this.emitEvent(O)),this.receiveBuffer=[],this.sendBuffer.forEach(O=>{this.notifyOutgoingListeners(O),this.packet(O)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(O=>O()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ti.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(O){return this.flags.compress=O,this}get volatile(){return this.flags.volatile=!0,this}timeout(O){return this.flags.timeout=O,this}onAny(O){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(O),this}prependAny(O){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(O),this}offAny(O){if(!this._anyListeners)return this;if(O){const L=this._anyListeners;for(let Y=0;Y<L.length;Y++)if(O===L[Y])return L.splice(Y,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(O){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(O),this}prependAnyOutgoing(O){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(O),this}offAnyOutgoing(O){if(!this._anyOutgoingListeners)return this;if(O){const L=this._anyOutgoingListeners;for(let Y=0;Y<L.length;Y++)if(O===L[Y])return L.splice(Y,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(O){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const L=this._anyOutgoingListeners.slice();for(const Y of L)Y.apply(this,O.data)}}}function wn(K){K=K||{},this.ms=K.min||100,this.max=K.max||1e4,this.factor=K.factor||2,this.jitter=K.jitter>0&&K.jitter<=1?K.jitter:0,this.attempts=0}wn.prototype.duration=function(){var K=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var O=Math.random(),L=Math.floor(O*this.jitter*K);K=Math.floor(O*10)&1?K+L:K-L}return Math.min(K,this.max)|0},wn.prototype.reset=function(){this.attempts=0},wn.prototype.setMin=function(K){this.ms=K},wn.prototype.setMax=function(K){this.max=K},wn.prototype.setJitter=function(K){this.jitter=K};class us extends Bi{constructor(O,L){var Y;super(),this.nsps={},this.subs=[],O&&typeof O=="object"&&(L=O,O=void 0),L=L||{},L.path=L.path||"/socket.io",this.opts=L,vo(this,L),this.reconnection(L.reconnection!==!1),this.reconnectionAttempts(L.reconnectionAttempts||1/0),this.reconnectionDelay(L.reconnectionDelay||1e3),this.reconnectionDelayMax(L.reconnectionDelayMax||5e3),this.randomizationFactor((Y=L.randomizationFactor)!==null&&Y!==void 0?Y:.5),this.backoff=new wn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(L.timeout==null?2e4:L.timeout),this._readyState="closed",this.uri=O;const ut=L.parser||hd;this.encoder=new ut.Encoder,this.decoder=new ut.Decoder,this._autoConnect=L.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(O){return arguments.length?(this._reconnection=!!O,this):this._reconnection}reconnectionAttempts(O){return O===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=O,this)}reconnectionDelay(O){var L;return O===void 0?this._reconnectionDelay:(this._reconnectionDelay=O,(L=this.backoff)===null||L===void 0||L.setMin(O),this)}randomizationFactor(O){var L;return O===void 0?this._randomizationFactor:(this._randomizationFactor=O,(L=this.backoff)===null||L===void 0||L.setJitter(O),this)}reconnectionDelayMax(O){var L;return O===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=O,(L=this.backoff)===null||L===void 0||L.setMax(O),this)}timeout(O){return arguments.length?(this._timeout=O,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(O){if(~this._readyState.indexOf("open"))return this;this.engine=new Cc(this.uri,this.opts);const L=this.engine,Y=this;this._readyState="opening",this.skipReconnect=!1;const ut=yr(L,"open",function(){Y.onopen(),O&&O()}),ht=_=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",_),O?O(_):this.maybeReconnectOnOpen()},W=yr(L,"error",ht);if(this._timeout!==!1){const _=this._timeout,y=this.setTimeoutFn(()=>{ut(),ht(new Error("timeout")),L.close()},_);this.opts.autoUnref&&y.unref(),this.subs.push(()=>{this.clearTimeoutFn(y)})}return this.subs.push(ut),this.subs.push(W),this}connect(O){return this.open(O)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const O=this.engine;this.subs.push(yr(O,"ping",this.onping.bind(this)),yr(O,"data",this.ondata.bind(this)),yr(O,"error",this.onerror.bind(this)),yr(O,"close",this.onclose.bind(this)),yr(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(O){try{this.decoder.add(O)}catch(L){this.onclose("parse error",L)}}ondecoded(O){is(()=>{this.emitReserved("packet",O)},this.setTimeoutFn)}onerror(O){this.emitReserved("error",O)}socket(O,L){let Y=this.nsps[O];return Y?this._autoConnect&&!Y.active&&Y.connect():(Y=new Dc(this,O,L),this.nsps[O]=Y),Y}_destroy(O){const L=Object.keys(this.nsps);for(const Y of L)if(this.nsps[Y].active)return;this._close()}_packet(O){const L=this.encoder.encode(O);for(let Y=0;Y<L.length;Y++)this.engine.write(L[Y],O.options)}cleanup(){this.subs.forEach(O=>O()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(O,L){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",O,L),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const O=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const L=this.backoff.duration();this._reconnecting=!0;const Y=this.setTimeoutFn(()=>{O.skipReconnect||(this.emitReserved("reconnect_attempt",O.backoff.attempts),!O.skipReconnect&&O.open(ut=>{ut?(O._reconnecting=!1,O.reconnect(),this.emitReserved("reconnect_error",ut)):O.onreconnect()}))},L);this.opts.autoUnref&&Y.unref(),this.subs.push(()=>{this.clearTimeoutFn(Y)})}}onreconnect(){const O=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",O)}}const Pn={};function Mo(K,O){typeof K=="object"&&(O=K,K=void 0),O=O||{};const L=td(K,O.path||"/socket.io"),Y=L.source,ut=L.id,ht=L.path,W=Pn[ut]&&ht in Pn[ut].nsps,_=O.forceNew||O["force new connection"]||O.multiplex===!1||W;let y;return _?y=new us(Y,O):(Pn[ut]||(Pn[ut]=new us(Y,O)),y=Pn[ut]),L.query&&!O.query&&(O.query=L.queryKey),y.socket(L.path,O)}Object.assign(Mo,{Manager:us,Socket:Dc,io:Mo,connect:Mo});var nn;(function(K){K[K.Normal=0]="Normal",K[K.Debug=1]="Debug"})(nn||(nn={}));let xo;const pd=new Uint8Array(16);function dd(){if(!xo&&(xo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xo(pd)}const Li=[];for(let K=0;K<256;++K)Li.push((K+256).toString(16).slice(1));function md(K,O=0){return Li[K[O+0]]+Li[K[O+1]]+Li[K[O+2]]+Li[K[O+3]]+"-"+Li[K[O+4]]+Li[K[O+5]]+"-"+Li[K[O+6]]+Li[K[O+7]]+"-"+Li[K[O+8]]+Li[K[O+9]]+"-"+Li[K[O+10]]+Li[K[O+11]]+Li[K[O+12]]+Li[K[O+13]]+Li[K[O+14]]+Li[K[O+15]]}const Uc={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function qc(K,O,L){if(Uc.randomUUID&&!O&&!K)return Uc.randomUUID();K=K||{};const Y=K.random||(K.rng||dd)();if(Y[6]=Y[6]&15|64,Y[8]=Y[8]&63|128,O){L=L||0;for(let ut=0;ut<16;++ut)O[L+ut]=Y[ut];return O}return md(Y)}const on=new Pi("[EventBus] ");class Fc{constructor(O=!1){Object.defineProperty(this,"eventListenerMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),O&&on.disable()}getEventListenerMap(){return Object.assign({},this.eventListenerMap)}on(O,L,Y=!1){this.eventListenerMap[O]||(this.eventListenerMap[O]=[]),Y?this.eventListenerMap[O].push({fn:L,once:!0}):this.eventListenerMap[O].push(L),on.log(`add event ${O} listener ${Y?", call once":""}`)}once(O,L){this.on(O,L,!0)}off(O,L){if(this.eventListenerMap[O]){const Y=this.eventListenerMap[O].findIndex(ut=>{if(typeof ut=="function"&&L===ut)return!0;if(ut=ut,ut.fn===L)return!0});Y<0?on.log(`event ${O} listener ${L.name} is not found`):(this.eventListenerMap[O].splice(Y,1),on.log(`remove event ${O} listener`))}else on.log(`event ${O} listeners is empty`)}emit(O,L){if(!this.eventListenerMap[O]){on.log(`event ${O} listeners is empty`);return}const Y=[];for(let ut=0;ut<this.eventListenerMap[O].length;ut++){const ht=this.eventListenerMap[O][ut];typeof ht=="function"?ht(L):Y.push(ht)}Y.forEach(ut=>{ut&&(ut.fn(L),this.off(O,ut.fn))}),on.log(`event ${O} is fired, has ${this.eventListenerMap[O].length} listeners`)}removeAllListeners(){this.eventListenerMap={}}}var _o;(function(K){K[K.enable=1]="enable",K[K.disable=2]="disable"})(_o||(_o={}));const zi=new Pi("[Session] ");var $i;(function(K){K.DataRequestFailed="data request error",K.SocketConnectionFailed="socket error",K.IdUndefined="session id is not defined",K.SendingEmptyContent="failed at sending empty content",K.Frozen="session is frozen",K.UserModeError="failed at setting socket user mode",K.Inactive="session is inactive"})($i||($i={})),$i.IdUndefined+"",$i.SendingEmptyContent+"",$i.Frozen+"";class cs{constructor(O,L="",Y,ut,ht,W){Object.defineProperty(this,"token",{enumerable:!0,configurable:!0,writable:!0,value:O}),Object.defineProperty(this,"lazyload",{enumerable:!0,configurable:!0,writable:!0,value:ut}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_frozen",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inactivating",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_ready",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:new Fc}),Object.defineProperty(this,"_applicationId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_application",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"messages",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_loadingMessages",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_loadingMessagesSize",{enumerable:!0,configurable:!0,writable:!0,value:10}),Object.defineProperty(this,"cvforceApi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"socket",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_promptVariables",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"active",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"activing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_stopAnswer",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataLoading",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataLoaded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.client=W||null,this._applicationId=oo(O).rid||Mi.configuration.applicationId,this.cvforceApi=this.getService(),ht&&(this._application=ht),this.event.emit("init",{applicationId:this._applicationId,sessionId:L}),this.loadApplicationInfo().then(()=>{var _;if(L)this._id=L,this.event.emit("data:loading"),Y?(this.data=Y,ut||(this._dataLoading=!0,this.cvforceApi.getSession(this.applicationId,L).then(y=>Le(this,void 0,void 0,function*(){this.data=y,this._promptVariables=yield this.cvforceApi.getApplicationIdSessionIdPromptVariables(this.applicationId,L)})).then(()=>Le(this,void 0,void 0,function*(){this.messages=[],yield this.fetchMessages(),this.event.emit("data:loaded",this.data),this.event.emit("data:updated",this.data)})))):(this._dataLoading=!0,this.cvforceApi.getSession(this.applicationId,L).then(y=>Le(this,void 0,void 0,function*(){this.data=y,this._promptVariables=yield this.cvforceApi.getApplicationIdSessionIdPromptVariables(this.applicationId,L)})).then(()=>Le(this,void 0,void 0,function*(){this.messages=[],yield this.fetchMessages(),this.event.emit("data:loaded",this.data),this.event.emit("data:updated",this.data),this._dataLoading=!1,this._dataLoaded=!0})));else{const y=(Y==null?void 0:Y.name)||"新建会话";this.event.emit("data:creating",{applicationId:this._applicationId,name:y}),this.event.emit("data:loading"),this.cvforceApi.postSession(this.applicationId,{name:y,netOpen:Y==null?void 0:Y.netOpen,knowledgeList:(_=Y==null?void 0:Y.knowledges)===null||_===void 0?void 0:_.map(x=>x.id),applicationId:this._applicationId}).then(x=>Le(this,void 0,void 0,function*(){this._id=x.id,this.data=x,this._promptVariables=yield this.cvforceApi.getApplicationIdSessionIdPromptVariables(this.applicationId,this._id),yield(()=>{if(Y!=null&&Y.knowledges)return this.setKnowledges((Y==null?void 0:Y.knowledges)||void 0)})(),yield(()=>{if(Y!=null&&Y.promptVariables){const v=this._promptVariables.map(m=>{var S,a;const p=((a=(S=Y.promptVariables)===null||S===void 0?void 0:S.find(c=>c.key===m.key))===null||a===void 0?void 0:a.value)||"";return Object.assign(Object.assign({},m),{value:p})}).sort((m,S)=>m.key.localeCompare(S.key));return this.setPromptVariables(v||[])}else return})(),this.event.emit("data:created",this.data),this.event.emit("data:loaded",this.data),this.event.emit("data:updated",this.data),this._ready=!0,this.event.emit("ready")}))}})}fetchData(){return Le(this,void 0,void 0,function*(){if(!this.data)throw Error("session data is not loaded");return yield this.cvforceApi.getSession(this.applicationId,this.data.id).then(O=>Le(this,void 0,void 0,function*(){return this.data=O,this.event.emit("data:updated",this.data),O}))})}get id(){var O;return this._id||((O=this.data)===null||O===void 0?void 0:O.id)||""}get applicationId(){return this._applicationId}get application(){return this._application}loadApplicationInfo(){if(this._application)return Promise.resolve(this._application);if(this._applicationId&&!this._application)return this.event.emit("application:data:loading"),this.cvforceApi.getApplicationId(this._applicationId).then(O=>(this._application=O,this.event.emit("application:data:loaded",O),O));throw Error("application id is not defined")}get ready(){return this._ready}get frozen(){return this._frozen}set frozen(O){O===!1&&this.inactivating&&this.socket&&(this.socket.disconnect(),this.socket=null,this.event.emit("inactivated")),this._frozen=O,this.event.emit("frozen",O)}get knowledges(){if(!this.data)throw Error("session data is not loaded");return this.data.knowledges||void 0}setKnowledges(O){return Le(this,void 0,void 0,function*(){var L;if(((L=this._application)===null||L===void 0?void 0:L.type)===bn.Agent){console.warn("Agent Application Sessions are disabled to setKnowledges.");return}if(!this.data)throw Error("session data is not loaded");return yield this.cvforceApi.patchSessionsId(this._applicationId,this.data.id,{knowledges:O}),this.data.knowledges=O,this.event.emit("data:updated",this.data),this.event.emit("data:updated:knowledges",{knowledges:O}),O})}validateConfigs(){if(!this._id)throw Error("session id is not defined");if(!this.data)throw Error("session data is not loaded");const O=this.promptVariables.filter(L=>L.status===pc.Quoted).filter(L=>!L.value);if(O.length)throw Error(`在提示词中被引用的变量值不能为空, 请检查以下变量: ${O.map(L=>L.key).join(", ")}`)}get promptVariables(){return this._promptVariables.filter(O=>O.key!=="query")}setPromptVariables(O){return Le(this,void 0,void 0,function*(){var L;if(((L=this._application)===null||L===void 0?void 0:L.type)===bn.Agent){console.warn("Agent Application Sessions are disabled to setPromptVariables.");return}const Y=this._promptVariables.map(ut=>{var ht;const W=((ht=O==null?void 0:O.find(_=>_.key===ut.key))===null||ht===void 0?void 0:ht.value)||ut.value;return Object.assign(Object.assign({},ut),{value:W})}).sort((ut,ht)=>ut.key.localeCompare(ht.key));if(yield Promise.all(Y.filter(ut=>ut.key!=="query").map(ut=>{if(!this.data)throw Error("session data is not loaded");if(!(!ut.id||!ut.key))return this.cvforceApi.patchApplicationIdSessionpromptVariablesId(this._applicationId,this.data.id,ut.id,{value:ut.value}).catch(console.error)})),!this.data)throw Error("session data is not loaded");return this._promptVariables=yield this.cvforceApi.getApplicationIdSessionIdPromptVariables(this.applicationId,this.data.id),this.event.emit("data:updated",this.data),this.event.emit("data:updated:promptVariables",{promptVariables:this._promptVariables}),this._promptVariables})}get netOpen(){if(!this.data)throw Error("session data is not loaded");return this.data.netOpen||!1}setNetOpen(O){return Le(this,void 0,void 0,function*(){var L,Y,ut;if(zi.log("setNetOpen:",O),zi.log("application arrange setting value: ",(L=this._application)===null||L===void 0?void 0:L.arrange[0].enableNetOpen),((Y=this._application)===null||Y===void 0?void 0:Y.type)===bn.Agent){console.warn("Agent Application Sessions are disabled to setNetOpen.");return}if(((ut=this._application)===null||ut===void 0?void 0:ut.arrange[0].enableNetOpen)===!1){console.warn("This Application is disabled to change netOpen.");return}if(!this.data)throw Error("session data is not loaded");return yield this.cvforceApi.patchSessionsId(this._applicationId,this.data.id,{netOpen:O?_o.enable:_o.disable}),this.data.netOpen=O,zi.log("data:updated",this.data),this.event.emit("data:updated",this.data),this.event.emit("data:updated:netOpen",{netOpen:O}),O})}getService(){return dc(Mi.configuration.apiRoot,this.token,(O,L)=>{const Y=new Error($i.DataRequestFailed);zi.error(Y),this.event.emit("error",Y)})}addEventListener(O,L,Y=!1){if(typeof L!="function")throw Error("event listener is not a function");if(Y){this.event.once(O,L);return}this.event.on(O,L)}removeEventListener(O,L){this.event.off(O,L)}fetchMessages(){return Le(this,arguments,void 0,function*(O={}){var L,Y;const ut={pageSize:this._loadingMessagesSize};if(this._id){O=Object.assign(Object.assign({},ut),O),this.event.emit("history:loading"),zi.log("history:loading"),(O.endTime||O.startTime)&&(this.event.emit("history:moreloading",O),zi.log("history:moreloading",O)),this._loadingMessages=!0;const ht=yield this.cvforceApi.getChatHistorySessionId(this._applicationId,this._id,O),W=ht.map((y,x)=>{var v,m;let S=[],a;return typeof((v=y.agentHistoryList)===null||v===void 0?void 0:v.agentList)=="string"&&(S=JSON.parse(y.agentHistoryList.agentList).reduce((c,l)=>(c[l.data.step-1]||(c[l.data.step-1]=[]),c[l.data.step-1].push(l),c),[])),x===ht.length-1&&(a=(m=this.data)===null||m===void 0?void 0:m.lastRelatedQuestion),Object.assign(Object.assign({},y),{actions:S,relatedQuesion:a})});if(!O.endTime&&!O.startTime){const y=this.messages[this.messages.length-1];y&&!y.relatedQuesion&&(y.relatedQuesion=(L=this.data)===null||L===void 0?void 0:L.lastRelatedQuestion),this.messages=[...W,...this.messages]}else if(O.endTime&&!O.startTime){const y=this.messages.findIndex(x=>x.ts===O.endTime);this.messages.splice(0,y+1),this.messages=[...W,...this.messages]}else if(!O.endTime&&O.startTime){const y=this.messages.findLastIndex(x=>x.ts===O.endTime);this.messages.splice(y,this.messages.length-y-1),this.messages=[...this.messages,...W]}else{const y=this.messages.findIndex(v=>v.ts===O.endTime),x=this.messages.findLastIndex(v=>v.ts===O.endTime);this.messages.splice(y,x-y+1,...W)}const _=this.messages[this.messages.length-1];return _&&!_.relatedQuesion&&(_.relatedQuesion=(Y=this.data)===null||Y===void 0?void 0:Y.lastRelatedQuestion),this.event.emit("history:moreloaded",W),zi.log("history:loaded",this.messages),this.event.emit("history:loaded",this.messages),this._loadingMessages=!1,W}else{const ht=new Error($i.IdUndefined);return zi.error(ht),this.event.emit("error",ht),!1}})}rename(O){return Le(this,void 0,void 0,function*(){if(!this._id)throw Error("session is not created yet");if(O.trim()==="")throw Error("name is empty");return this.data=yield this.cvforceApi.patchSessionsId(this.applicationId,this._id,{name:O}),zi.log("data:updated",this.messages),this.event.emit("data:updated",this.data),this.event.emit("data:updated:name",{name:O}),!0})}pushMessage(O){return Le(this,void 0,void 0,function*(){this.messages.push(O),zi.log("history:add",O),this.event.emit("history:add",O),this.event.emit("message:new",O),this.event.emit("message:updated",O)})}reloadSessionInfo(){if(!this._id)throw Error("session is not created yet");return this._dataLoading=!0,this.cvforceApi.getSession(this.applicationId,this._id).then(O=>Le(this,void 0,void 0,function*(){if(this.data=O,!this._id)throw Error("session is not created yet");return this._promptVariables=yield this.cvforceApi.getApplicationIdSessionIdPromptVariables(this.applicationId,this._id),zi.log("data:updated",this.data),this.event.emit("data:updated",this.data),this.data})).then(()=>Le(this,void 0,void 0,function*(){return this.messages=[],yield this.fetchMessages(),this._dataLoading=!1,this._dataLoaded=!0,this.event.emit("data:loaded",this.data),this}))}reload(){return Le(this,void 0,void 0,function*(){return yield this.reloadSessionInfo(),this.socket?(this.inactivate(!0),this.activate()):(this.inactivate(!0),this.activate())})}delete(){return Le(this,void 0,void 0,function*(){if(!this.id){const O=new Error($i.IdUndefined);return zi.error(O),this.event.emit("error",O),!1}return this.event.emit("data:deleting"),yield this.cvforceApi.delSessionsId(this.applicationId,this.id),this.event.emit("data:deleted"),this.destroy()})}activate(){return Le(this,void 0,void 0,function*(){if(this.activing)return new Promise(L=>{this.addEventListener("activated",()=>{L(!0)},!0)});if(!this._id)throw Error("session is not avalible. id is undefined");this.activing=!0;const O=this._id;return this._dataLoading=!0,this._dataLoaded=!1,this.data=yield this.cvforceApi.getSession(this.applicationId,O).then(L=>Le(this,void 0,void 0,function*(){return this._promptVariables=yield this.cvforceApi.getApplicationIdSessionIdPromptVariables(this.applicationId,O),L})),this.messages.length||(this.messages=[],yield this.fetchMessages()),this.event.emit("data:loaded",this.data),this.event.emit("data:updated",this.data),this._dataLoaded=!0,this._dataLoading=!1,this.inactivating=!1,this.frozen=!0,yield this.prepareConnection(),this.event.emit("activated",this.socket),this.active=!0,this.activing=!1,this})}inactivate(O=!1){return this.socket?this._frozen?(O||(this.inactivating=!0),this.activing=!1,!0):(this.socket.close(),this.socket=null,this.event.emit("inactivated"),this.active=!1,this.activing=!1,!0):(this.activing=!1,!0)}get dataLoaded(){return this._dataLoaded}get messagesLoading(){return this._loadingMessages}send(O){return Le(this,arguments,void 0,function*(L,Y={stream:!1}){var ut;try{this.validateConfigs()}catch(a){console.error(a)}const{stream:ht=!1,referenceFirst:W=!1}=Y,_=L.uuid||qc(),y=((ut=L.text)===null||ut===void 0?void 0:ut.trim())||"",x=L.fileIds;if(!y&&!(x!=null&&x.length)){const a=new Error($i.SendingEmptyContent);return zi.error(a),this.event.emit("error",a),!1}if(!this._id){const a=new Error($i.IdUndefined);return zi.error(a),this.event.emit("error",a),!1}if(this.frozen){const a=new Error($i.Frozen);return zi.error(a),this.event.emit("error",a),!1}this.frozen=!0,this._stopAnswer=!1;const v={sessionId:this.id,role:2,content:y,messageId:_,reference:[],searchReference:[],messageTime:""},m={content:y,stream:ht,requestId:_,fileIds:x,referenceFirst:W};this.pushMessage(v),this.event.emit("question:content",y);const S=a=>Le(this,void 0,void 0,function*(){if(a.role!==vr.Robot)return;switch(this.removeEventListener("answer:finish",S),this._id&&a.content&&a.index&&a.index<0&&(this.data=yield this.cvforceApi.patchSessionsId(this.applicationId,this._id,{finialMessage:a.content}),this.event.emit("data:updated",this.data),this.event.emit("data:updated:finialMessage",{finialMessage:a.content})),yield this.fillMessageReference(a),a.code){case 11915:a.content="请您换个问题问我吧~",a.index=-1,a.isSensitive=!0,a.isLoading=!1,a.sessionId=this._id||"",this.event.emit("message:error",a);break;case 200:a.index=-1,a.isLoading=!1;break;default:a.content=a.message||"未知错误",a.isLoading=!1,a.index=-1,this.event.emit("message:error",a)}const p=yield this.getRelatedQuesion(a);a=Object.assign(Object.assign({},a),p),a.isLoading=!1;let c=this.messages[this.messages.length-1];if(c&&c.role===vr.Robot){const l=Object.assign(Object.assign({},c),a);this.messages[this.messages.length-1]=l,this.event.emit("message:updated",l)}else this.pushMessage(a);this.frozen=!1});return this.addEventListener("answer:finish",S),this.sendQuestion(m,Object.assign(Object.assign({},Y),{stream:ht,referenceFirst:W})),v})}getRelatedQuesion(O){return Le(this,void 0,void 0,function*(){var L;if(!O.content||O.isSensitive||O.code!==200)return O;this.event.emit("message:relatedQuesion:loading",O);const Y=yield this.cvforceApi.postGeneques({content:O.content}).catch(W=>null);if(!Y){const W=[],_=Object.assign(Object.assign({},O),{relatedQuesion:W,index:-3,isLoading:!1});return this.event.emit("message:relatedQuesion:loaded",{relatedQuesion:W}),_}const ut=(L=Y.content)===null||L===void 0?void 0:L.split("*").map(uf).map(cf).filter(W=>!!W);O.relatedQuesion=ut,O.index=-3,O.isLoading=!1;const ht=Object.assign(Object.assign({},O),{relatedQuesion:ut,index:-3,isLoading:!1});return this.event.emit("message:relatedQuesion:loaded",ht),this._id&&this.cvforceApi.patchSessionsId(this._applicationId,this._id,{lastRelatedQuestion:ut}),ht})}fillMessageReference(O){return Le(this,void 0,void 0,function*(){var L;return(L=O.reference)===null||L===void 0||L.forEach((Y,ut)=>Le(this,void 0,void 0,function*(){const ht=yield this.cvforceApi.getKnowledgeIdFileId(Y.knowledgeId,Y.docId);O.reference[ut]=Object.assign(Object.assign({},Y),ht)})),O})}answerAgain(){return Le(this,arguments,void 0,function*(O={stream:!1}){const L=this.messages[this.messages.length-1];if(!L)throw Error("message list is empty");this.frozen=!0,this._stopAnswer=!1;const{stream:Y=!1}=O;let ut;L.role!==vr.User&&(ut=O.oldMessageId||L.messageId,this.messages.splice(this.messages.length-1,1),this.event.emit("message:remove",L),this.event.emit("history:remove",L));const ht=this.messages[this.messages.length-1],W={content:ht.content,fileIds:ht.fileIds,requestId:ht.messageId,stream:Y,oldMessageId:ut},_=y=>Le(this,void 0,void 0,function*(){if(y.role===vr.Robot&&y.index===-1){switch(this._id&&y.content&&y.index&&y.index<0&&(this.data=yield this.cvforceApi.patchSessionsId(this.applicationId,this._id,{finialMessage:y.content}),this.event.emit("data:updated",this.data),this.event.emit("data:updated:finialMessage",{finialMessage:y.content})),yield this.fillMessageReference(y),y.code){case 11915:y.content="请您换个问题问我吧~",y.index=-1,y.isSensitive=!0,y.isLoading=!1,y.sessionId=this._id||"",this.event.emit("message:error",y);break;case 200:y.index=-1,y.isLoading=!1;break;default:y.content=y.message||"未知错误",y.isLoading=!1,y.index=-1,this.event.emit("message:error",y)}const x=yield this.getRelatedQuesion(y);this.event.emit("message:updated",x),this.removeEventListener("message:content",_),this.frozen=!1}});this.addEventListener("message:content",_),this.sendQuestion(W,Object.assign(Object.assign({},O),{stream:Y}))})}setTop(O){return Le(this,void 0,void 0,function*(){if(!this._id)throw Error("session is not avalible. id is undefined");this.data=yield this.cvforceApi.patchSessionsId(this._applicationId,this._id,{top:O}),this.event.emit("data:updated",this.data),this.event.emit("data:updated:top",{top:O})})}suspend(){var O;this.stopAnswer(),this.frozen=!1,this._stopAnswer=!0;let L=this.messages[this.messages.length-1];const Y={messageId:qc(),isLoading:!1,index:-2,messageTime:hc(new Date).format("YYYY-MM-DD HH:ss:mm"),content:"",role:vr.System,sessionId:this.id||"",reference:[],searchReference:[]};if(L&&!L.messageId){if(L.index===-2)return;if(L.actions){const ut=L.actions[((O=L.actions)===null||O===void 0?void 0:O.length)-1];if(ut){const ht=ut[ut.length-1];if(ht&&(ht.type==="BEFORE_CALL"||ht.type==="FUNCTION_CALL")){const{pluginName:W,pluginCode:_,funcCode:y,funcName:x}=ht.data;ut.push({data:{pluginName:W,pluginCode:_,funcCode:y,funcName:x,step:ht.data.step+1},type:"ABORT"}),this.event.emit("message:action",{messageId:L.messageId,action:ut})}}}L=Object.assign(Object.assign({},L),Y),this.event.emit("message:content",L),this.event.emit("message:updated",L)}else this.pushMessage(Y),this.event.emit("message:content",Y);return this}postMessageComment(O){return Le(this,void 0,void 0,function*(){if(!this._applicationId||!this._id)throw Error("session is not avalible. id is undefined");return this.cvforceApi.postComments(this._applicationId,this._id,O).then(L=>{const Y=this.messages.find(ut=>ut.messageId===O.messageId);return Y&&(Y.comment=O,this.event.emit("message:comment",Y)),L})})}clear(){if(!this._id)throw Error("session is not avalible. id is undefined");return this.cvforceApi.patchApplicationIdSessionsIdContext(this._applicationId,this._id).then(()=>(this.event.emit("context:clear"),!0))}destroy(){var O;return this._ready=!1,this.event.removeAllListeners(),(O=this.socket)===null||O===void 0||O.disconnect(),this.socket=null,this.event.emit("destroy",{applicationId:this._applicationId,sessionId:this._id}),this._id||""}}const $r=new Pi("[AgentSession] ");class gd extends cs{constructor(O,L="",Y,ut,ht,W){super(O,L,Y,ut,ht,W)}prepareConnection(){return new Promise(O=>Le(this,void 0,void 0,function*(){this.socket&&O(!0);const L={version:"1.0",stream:"false",appId:this._applicationId,sessionId:this.id,Authorization:`${this.token}`,userMode:Mi.configuration.debug?nn.Debug:nn.Normal},Y=new URL(Mi.configuration.apiRoot),ut=yield Mo(Y.origin,{path:Y.pathname.replace("api","socketio")+"/copilot",query:L,transports:["websocket"]});ut.on("connect",()=>{$r.log("socket:connect"),this.event.emit("socket:connect"),ut.emit("init")}),ut.on("disconnect",()=>{$r.log("socket:disconnect"),this.event.emit("socket:disconnect")}),ut.on("ready",ht=>{if(ht.code===200){$r.log("ready");const W=Mi.configuration.debug?nn.Debug:nn.Normal;W===nn.Debug&&ht.userMode,this._ready||(this._ready=!0,this.event.emit("ready")),this.frozen=!1,O(!0)}else{this._ready&&(this._ready=!1);const W=new Error($i.SocketConnectionFailed);$r.error("error",W),this.event.emit("error",W),O(!1)}}),ut.on("action",(ht,W)=>Le(this,void 0,void 0,function*(){if(this._stopAnswer||!this.id)return;const{type:_,data:{runnerIsClient:y,pluginCode:x,funcCode:v,parameters:m,requestBody:S}}=ht,a=this.messages[this.messages.length-1];if(!a.messageId)a.actions||(a.actions=[]),a.actions[ht.data.step-1]||(a.actions[ht.data.step-1]=[]),a.actions[ht.data.step-1].push(ht),this.event.emit("message:action",{messageId:a.messageId,action:ht}),this.event.emit("message:updated",a);else{const p={messageId:"",content:"",role:vr.Robot,sessionId:this.id,reference:[],searchReference:[],isLoading:!0,messageTime:"",actions:[[ht]],comment:{isAgree:0}};this.pushMessage(p),this.event.emit("message:action",{messageId:p.messageId,action:ht})}if(this.inactivating){const p=new Error($i.Inactive);$r.warn("error",p),this.event.emit("error",p)}else if(_==="FUNCTION_CALL"&&y){if($r.log(`calling function ${v} of plugin ${x} with argument:
|
|
137
|
+
*/(function(K){const O=fo,L=Za,Y=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;K.Buffer=_,K.SlowBuffer=g,K.INSPECT_MAX_BYTES=50;const ut=2147483647;K.kMaxLength=ut,_.TYPED_ARRAY_SUPPORT=ht(),!_.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ht(){try{const F=new Uint8Array(1),H={foo:function(){return 42}};return Object.setPrototypeOf(H,Uint8Array.prototype),Object.setPrototypeOf(F,H),F.foo()===42}catch{return!1}}Object.defineProperty(_.prototype,"parent",{enumerable:!0,get:function(){if(_.isBuffer(this))return this.buffer}}),Object.defineProperty(_.prototype,"offset",{enumerable:!0,get:function(){if(_.isBuffer(this))return this.byteOffset}});function W(F){if(F>ut)throw new RangeError('The value "'+F+'" is invalid for option "size"');const H=new Uint8Array(F);return Object.setPrototypeOf(H,_.prototype),H}function _(F,H,U){if(typeof F=="number"){if(typeof H=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(F)}return y(F,H,U)}_.poolSize=8192;function y(F,H,U){if(typeof F=="string")return S(F,H);if(ArrayBuffer.isView(F))return p(F);if(F==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof F);if(Bt(F,ArrayBuffer)||F&&Bt(F.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Bt(F,SharedArrayBuffer)||F&&Bt(F.buffer,SharedArrayBuffer)))return c(F,H,U);if(typeof F=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const it=F.valueOf&&F.valueOf();if(it!=null&&it!==F)return _.from(it,H,U);const pt=l(F);if(pt)return pt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof F[Symbol.toPrimitive]=="function")return _.from(F[Symbol.toPrimitive]("string"),H,U);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof F)}_.from=function(F,H,U){return y(F,H,U)},Object.setPrototypeOf(_.prototype,Uint8Array.prototype),Object.setPrototypeOf(_,Uint8Array);function x(F){if(typeof F!="number")throw new TypeError('"size" argument must be of type number');if(F<0)throw new RangeError('The value "'+F+'" is invalid for option "size"')}function v(F,H,U){return x(F),F<=0?W(F):H!==void 0?typeof U=="string"?W(F).fill(H,U):W(F).fill(H):W(F)}_.alloc=function(F,H,U){return v(F,H,U)};function m(F){return x(F),W(F<0?0:f(F)|0)}_.allocUnsafe=function(F){return m(F)},_.allocUnsafeSlow=function(F){return m(F)};function S(F,H){if((typeof H!="string"||H==="")&&(H="utf8"),!_.isEncoding(H))throw new TypeError("Unknown encoding: "+H);const U=h(F,H)|0;let it=W(U);const pt=it.write(F,H);return pt!==U&&(it=it.slice(0,pt)),it}function a(F){const H=F.length<0?0:f(F.length)|0,U=W(H);for(let it=0;it<H;it+=1)U[it]=F[it]&255;return U}function p(F){if(Bt(F,Uint8Array)){const H=new Uint8Array(F);return c(H.buffer,H.byteOffset,H.byteLength)}return a(F)}function c(F,H,U){if(H<0||F.byteLength<H)throw new RangeError('"offset" is outside of buffer bounds');if(F.byteLength<H+(U||0))throw new RangeError('"length" is outside of buffer bounds');let it;return H===void 0&&U===void 0?it=new Uint8Array(F):U===void 0?it=new Uint8Array(F,H):it=new Uint8Array(F,H,U),Object.setPrototypeOf(it,_.prototype),it}function l(F){if(_.isBuffer(F)){const H=f(F.length)|0,U=W(H);return U.length===0||F.copy(U,0,0,H),U}if(F.length!==void 0)return typeof F.length!="number"||Mt(F.length)?W(0):a(F);if(F.type==="Buffer"&&Array.isArray(F.data))return a(F.data)}function f(F){if(F>=ut)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ut.toString(16)+" bytes");return F|0}function g(F){return+F!=F&&(F=0),_.alloc(+F)}_.isBuffer=function(H){return H!=null&&H._isBuffer===!0&&H!==_.prototype},_.compare=function(H,U){if(Bt(H,Uint8Array)&&(H=_.from(H,H.offset,H.byteLength)),Bt(U,Uint8Array)&&(U=_.from(U,U.offset,U.byteLength)),!_.isBuffer(H)||!_.isBuffer(U))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(H===U)return 0;let it=H.length,pt=U.length;for(let ft=0,mt=Math.min(it,pt);ft<mt;++ft)if(H[ft]!==U[ft]){it=H[ft],pt=U[ft];break}return it<pt?-1:pt<it?1:0},_.isEncoding=function(H){switch(String(H).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},_.concat=function(H,U){if(!Array.isArray(H))throw new TypeError('"list" argument must be an Array of Buffers');if(H.length===0)return _.alloc(0);let it;if(U===void 0)for(U=0,it=0;it<H.length;++it)U+=H[it].length;const pt=_.allocUnsafe(U);let ft=0;for(it=0;it<H.length;++it){let mt=H[it];if(Bt(mt,Uint8Array))ft+mt.length>pt.length?(_.isBuffer(mt)||(mt=_.from(mt)),mt.copy(pt,ft)):Uint8Array.prototype.set.call(pt,mt,ft);else if(_.isBuffer(mt))mt.copy(pt,ft);else throw new TypeError('"list" argument must be an Array of Buffers');ft+=mt.length}return pt};function h(F,H){if(_.isBuffer(F))return F.length;if(ArrayBuffer.isView(F)||Bt(F,ArrayBuffer))return F.byteLength;if(typeof F!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof F);const U=F.length,it=arguments.length>2&&arguments[2]===!0;if(!it&&U===0)return 0;let pt=!1;for(;;)switch(H){case"ascii":case"latin1":case"binary":return U;case"utf8":case"utf-8":return nt(F).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U*2;case"hex":return U>>>1;case"base64":return gt(F).length;default:if(pt)return it?-1:nt(F).length;H=(""+H).toLowerCase(),pt=!0}}_.byteLength=h;function u(F,H,U){let it=!1;if((H===void 0||H<0)&&(H=0),H>this.length||((U===void 0||U>this.length)&&(U=this.length),U<=0)||(U>>>=0,H>>>=0,U<=H))return"";for(F||(F="utf8");;)switch(F){case"hex":return r(this,H,U);case"utf8":case"utf-8":return et(this,H,U);case"ascii":return t(this,H,U);case"latin1":case"binary":return n(this,H,U);case"base64":return $(this,H,U);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i(this,H,U);default:if(it)throw new TypeError("Unknown encoding: "+F);F=(F+"").toLowerCase(),it=!0}}_.prototype._isBuffer=!0;function w(F,H,U){const it=F[H];F[H]=F[U],F[U]=it}_.prototype.swap16=function(){const H=this.length;if(H%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let U=0;U<H;U+=2)w(this,U,U+1);return this},_.prototype.swap32=function(){const H=this.length;if(H%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let U=0;U<H;U+=4)w(this,U,U+3),w(this,U+1,U+2);return this},_.prototype.swap64=function(){const H=this.length;if(H%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let U=0;U<H;U+=8)w(this,U,U+7),w(this,U+1,U+6),w(this,U+2,U+5),w(this,U+3,U+4);return this},_.prototype.toString=function(){const H=this.length;return H===0?"":arguments.length===0?et(this,0,H):u.apply(this,arguments)},_.prototype.toLocaleString=_.prototype.toString,_.prototype.equals=function(H){if(!_.isBuffer(H))throw new TypeError("Argument must be a Buffer");return this===H?!0:_.compare(this,H)===0},_.prototype.inspect=function(){let H="";const U=K.INSPECT_MAX_BYTES;return H=this.toString("hex",0,U).replace(/(.{2})/g,"$1 ").trim(),this.length>U&&(H+=" ... "),"<Buffer "+H+">"},Y&&(_.prototype[Y]=_.prototype.inspect),_.prototype.compare=function(H,U,it,pt,ft){if(Bt(H,Uint8Array)&&(H=_.from(H,H.offset,H.byteLength)),!_.isBuffer(H))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof H);if(U===void 0&&(U=0),it===void 0&&(it=H?H.length:0),pt===void 0&&(pt=0),ft===void 0&&(ft=this.length),U<0||it>H.length||pt<0||ft>this.length)throw new RangeError("out of range index");if(pt>=ft&&U>=it)return 0;if(pt>=ft)return-1;if(U>=it)return 1;if(U>>>=0,it>>>=0,pt>>>=0,ft>>>=0,this===H)return 0;let mt=ft-pt,re=it-U;const _t=Math.min(mt,re),At=this.slice(pt,ft),fe=H.slice(U,it);for(let kt=0;kt<_t;++kt)if(At[kt]!==fe[kt]){mt=At[kt],re=fe[kt];break}return mt<re?-1:re<mt?1:0};function b(F,H,U,it,pt){if(F.length===0)return-1;if(typeof U=="string"?(it=U,U=0):U>2147483647?U=2147483647:U<-2147483648&&(U=-2147483648),U=+U,Mt(U)&&(U=pt?0:F.length-1),U<0&&(U=F.length+U),U>=F.length){if(pt)return-1;U=F.length-1}else if(U<0)if(pt)U=0;else return-1;if(typeof H=="string"&&(H=_.from(H,it)),_.isBuffer(H))return H.length===0?-1:E(F,H,U,it,pt);if(typeof H=="number")return H=H&255,typeof Uint8Array.prototype.indexOf=="function"?pt?Uint8Array.prototype.indexOf.call(F,H,U):Uint8Array.prototype.lastIndexOf.call(F,H,U):E(F,[H],U,it,pt);throw new TypeError("val must be string, number or Buffer")}function E(F,H,U,it,pt){let ft=1,mt=F.length,re=H.length;if(it!==void 0&&(it=String(it).toLowerCase(),it==="ucs2"||it==="ucs-2"||it==="utf16le"||it==="utf-16le")){if(F.length<2||H.length<2)return-1;ft=2,mt/=2,re/=2,U/=2}function _t(fe,kt){return ft===1?fe[kt]:fe.readUInt16BE(kt*ft)}let At;if(pt){let fe=-1;for(At=U;At<mt;At++)if(_t(F,At)===_t(H,fe===-1?0:At-fe)){if(fe===-1&&(fe=At),At-fe+1===re)return fe*ft}else fe!==-1&&(At-=At-fe),fe=-1}else for(U+re>mt&&(U=mt-re),At=U;At>=0;At--){let fe=!0;for(let kt=0;kt<re;kt++)if(_t(F,At+kt)!==_t(H,kt)){fe=!1;break}if(fe)return At}return-1}_.prototype.includes=function(H,U,it){return this.indexOf(H,U,it)!==-1},_.prototype.indexOf=function(H,U,it){return b(this,H,U,it,!0)},_.prototype.lastIndexOf=function(H,U,it){return b(this,H,U,it,!1)};function I(F,H,U,it){U=Number(U)||0;const pt=F.length-U;it?(it=Number(it),it>pt&&(it=pt)):it=pt;const ft=H.length;it>ft/2&&(it=ft/2);let mt;for(mt=0;mt<it;++mt){const re=parseInt(H.substr(mt*2,2),16);if(Mt(re))return mt;F[U+mt]=re}return mt}function M(F,H,U,it){return bt(nt(H,F.length-U),F,U,it)}function B(F,H,U,it){return bt(lt(H),F,U,it)}function P(F,H,U,it){return bt(gt(H),F,U,it)}function N(F,H,U,it){return bt(Et(H,F.length-U),F,U,it)}_.prototype.write=function(H,U,it,pt){if(U===void 0)pt="utf8",it=this.length,U=0;else if(it===void 0&&typeof U=="string")pt=U,it=this.length,U=0;else if(isFinite(U))U=U>>>0,isFinite(it)?(it=it>>>0,pt===void 0&&(pt="utf8")):(pt=it,it=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ft=this.length-U;if((it===void 0||it>ft)&&(it=ft),H.length>0&&(it<0||U<0)||U>this.length)throw new RangeError("Attempt to write outside buffer bounds");pt||(pt="utf8");let mt=!1;for(;;)switch(pt){case"hex":return I(this,H,U,it);case"utf8":case"utf-8":return M(this,H,U,it);case"ascii":case"latin1":case"binary":return B(this,H,U,it);case"base64":return P(this,H,U,it);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,H,U,it);default:if(mt)throw new TypeError("Unknown encoding: "+pt);pt=(""+pt).toLowerCase(),mt=!0}},_.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(F,H,U){return H===0&&U===F.length?O.fromByteArray(F):O.fromByteArray(F.slice(H,U))}function et(F,H,U){U=Math.min(F.length,U);const it=[];let pt=H;for(;pt<U;){const ft=F[pt];let mt=null,re=ft>239?4:ft>223?3:ft>191?2:1;if(pt+re<=U){let _t,At,fe,kt;switch(re){case 1:ft<128&&(mt=ft);break;case 2:_t=F[pt+1],(_t&192)===128&&(kt=(ft&31)<<6|_t&63,kt>127&&(mt=kt));break;case 3:_t=F[pt+1],At=F[pt+2],(_t&192)===128&&(At&192)===128&&(kt=(ft&15)<<12|(_t&63)<<6|At&63,kt>2047&&(kt<55296||kt>57343)&&(mt=kt));break;case 4:_t=F[pt+1],At=F[pt+2],fe=F[pt+3],(_t&192)===128&&(At&192)===128&&(fe&192)===128&&(kt=(ft&15)<<18|(_t&63)<<12|(At&63)<<6|fe&63,kt>65535&&kt<1114112&&(mt=kt))}}mt===null?(mt=65533,re=1):mt>65535&&(mt-=65536,it.push(mt>>>10&1023|55296),mt=56320|mt&1023),it.push(mt),pt+=re}return ot(it)}const Q=4096;function ot(F){const H=F.length;if(H<=Q)return String.fromCharCode.apply(String,F);let U="",it=0;for(;it<H;)U+=String.fromCharCode.apply(String,F.slice(it,it+=Q));return U}function t(F,H,U){let it="";U=Math.min(F.length,U);for(let pt=H;pt<U;++pt)it+=String.fromCharCode(F[pt]&127);return it}function n(F,H,U){let it="";U=Math.min(F.length,U);for(let pt=H;pt<U;++pt)it+=String.fromCharCode(F[pt]);return it}function r(F,H,U){const it=F.length;(!H||H<0)&&(H=0),(!U||U<0||U>it)&&(U=it);let pt="";for(let ft=H;ft<U;++ft)pt+=It[F[ft]];return pt}function i(F,H,U){const it=F.slice(H,U);let pt="";for(let ft=0;ft<it.length-1;ft+=2)pt+=String.fromCharCode(it[ft]+it[ft+1]*256);return pt}_.prototype.slice=function(H,U){const it=this.length;H=~~H,U=U===void 0?it:~~U,H<0?(H+=it,H<0&&(H=0)):H>it&&(H=it),U<0?(U+=it,U<0&&(U=0)):U>it&&(U=it),U<H&&(U=H);const pt=this.subarray(H,U);return Object.setPrototypeOf(pt,_.prototype),pt};function e(F,H,U){if(F%1!==0||F<0)throw new RangeError("offset is not uint");if(F+H>U)throw new RangeError("Trying to access beyond buffer length")}_.prototype.readUintLE=_.prototype.readUIntLE=function(H,U,it){H=H>>>0,U=U>>>0,it||e(H,U,this.length);let pt=this[H],ft=1,mt=0;for(;++mt<U&&(ft*=256);)pt+=this[H+mt]*ft;return pt},_.prototype.readUintBE=_.prototype.readUIntBE=function(H,U,it){H=H>>>0,U=U>>>0,it||e(H,U,this.length);let pt=this[H+--U],ft=1;for(;U>0&&(ft*=256);)pt+=this[H+--U]*ft;return pt},_.prototype.readUint8=_.prototype.readUInt8=function(H,U){return H=H>>>0,U||e(H,1,this.length),this[H]},_.prototype.readUint16LE=_.prototype.readUInt16LE=function(H,U){return H=H>>>0,U||e(H,2,this.length),this[H]|this[H+1]<<8},_.prototype.readUint16BE=_.prototype.readUInt16BE=function(H,U){return H=H>>>0,U||e(H,2,this.length),this[H]<<8|this[H+1]},_.prototype.readUint32LE=_.prototype.readUInt32LE=function(H,U){return H=H>>>0,U||e(H,4,this.length),(this[H]|this[H+1]<<8|this[H+2]<<16)+this[H+3]*16777216},_.prototype.readUint32BE=_.prototype.readUInt32BE=function(H,U){return H=H>>>0,U||e(H,4,this.length),this[H]*16777216+(this[H+1]<<16|this[H+2]<<8|this[H+3])},_.prototype.readBigUInt64LE=J(function(H){H=H>>>0,G(H,"offset");const U=this[H],it=this[H+7];(U===void 0||it===void 0)&&z(H,this.length-8);const pt=U+this[++H]*2**8+this[++H]*2**16+this[++H]*2**24,ft=this[++H]+this[++H]*2**8+this[++H]*2**16+it*2**24;return BigInt(pt)+(BigInt(ft)<<BigInt(32))}),_.prototype.readBigUInt64BE=J(function(H){H=H>>>0,G(H,"offset");const U=this[H],it=this[H+7];(U===void 0||it===void 0)&&z(H,this.length-8);const pt=U*2**24+this[++H]*2**16+this[++H]*2**8+this[++H],ft=this[++H]*2**24+this[++H]*2**16+this[++H]*2**8+it;return(BigInt(pt)<<BigInt(32))+BigInt(ft)}),_.prototype.readIntLE=function(H,U,it){H=H>>>0,U=U>>>0,it||e(H,U,this.length);let pt=this[H],ft=1,mt=0;for(;++mt<U&&(ft*=256);)pt+=this[H+mt]*ft;return ft*=128,pt>=ft&&(pt-=Math.pow(2,8*U)),pt},_.prototype.readIntBE=function(H,U,it){H=H>>>0,U=U>>>0,it||e(H,U,this.length);let pt=U,ft=1,mt=this[H+--pt];for(;pt>0&&(ft*=256);)mt+=this[H+--pt]*ft;return ft*=128,mt>=ft&&(mt-=Math.pow(2,8*U)),mt},_.prototype.readInt8=function(H,U){return H=H>>>0,U||e(H,1,this.length),this[H]&128?(255-this[H]+1)*-1:this[H]},_.prototype.readInt16LE=function(H,U){H=H>>>0,U||e(H,2,this.length);const it=this[H]|this[H+1]<<8;return it&32768?it|4294901760:it},_.prototype.readInt16BE=function(H,U){H=H>>>0,U||e(H,2,this.length);const it=this[H+1]|this[H]<<8;return it&32768?it|4294901760:it},_.prototype.readInt32LE=function(H,U){return H=H>>>0,U||e(H,4,this.length),this[H]|this[H+1]<<8|this[H+2]<<16|this[H+3]<<24},_.prototype.readInt32BE=function(H,U){return H=H>>>0,U||e(H,4,this.length),this[H]<<24|this[H+1]<<16|this[H+2]<<8|this[H+3]},_.prototype.readBigInt64LE=J(function(H){H=H>>>0,G(H,"offset");const U=this[H],it=this[H+7];(U===void 0||it===void 0)&&z(H,this.length-8);const pt=this[H+4]+this[H+5]*2**8+this[H+6]*2**16+(it<<24);return(BigInt(pt)<<BigInt(32))+BigInt(U+this[++H]*2**8+this[++H]*2**16+this[++H]*2**24)}),_.prototype.readBigInt64BE=J(function(H){H=H>>>0,G(H,"offset");const U=this[H],it=this[H+7];(U===void 0||it===void 0)&&z(H,this.length-8);const pt=(U<<24)+this[++H]*2**16+this[++H]*2**8+this[++H];return(BigInt(pt)<<BigInt(32))+BigInt(this[++H]*2**24+this[++H]*2**16+this[++H]*2**8+it)}),_.prototype.readFloatLE=function(H,U){return H=H>>>0,U||e(H,4,this.length),L.read(this,H,!0,23,4)},_.prototype.readFloatBE=function(H,U){return H=H>>>0,U||e(H,4,this.length),L.read(this,H,!1,23,4)},_.prototype.readDoubleLE=function(H,U){return H=H>>>0,U||e(H,8,this.length),L.read(this,H,!0,52,8)},_.prototype.readDoubleBE=function(H,U){return H=H>>>0,U||e(H,8,this.length),L.read(this,H,!1,52,8)};function o(F,H,U,it,pt,ft){if(!_.isBuffer(F))throw new TypeError('"buffer" argument must be a Buffer instance');if(H>pt||H<ft)throw new RangeError('"value" argument is out of bounds');if(U+it>F.length)throw new RangeError("Index out of range")}_.prototype.writeUintLE=_.prototype.writeUIntLE=function(H,U,it,pt){if(H=+H,U=U>>>0,it=it>>>0,!pt){const re=Math.pow(2,8*it)-1;o(this,H,U,it,re,0)}let ft=1,mt=0;for(this[U]=H&255;++mt<it&&(ft*=256);)this[U+mt]=H/ft&255;return U+it},_.prototype.writeUintBE=_.prototype.writeUIntBE=function(H,U,it,pt){if(H=+H,U=U>>>0,it=it>>>0,!pt){const re=Math.pow(2,8*it)-1;o(this,H,U,it,re,0)}let ft=it-1,mt=1;for(this[U+ft]=H&255;--ft>=0&&(mt*=256);)this[U+ft]=H/mt&255;return U+it},_.prototype.writeUint8=_.prototype.writeUInt8=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,1,255,0),this[U]=H&255,U+1},_.prototype.writeUint16LE=_.prototype.writeUInt16LE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,2,65535,0),this[U]=H&255,this[U+1]=H>>>8,U+2},_.prototype.writeUint16BE=_.prototype.writeUInt16BE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,2,65535,0),this[U]=H>>>8,this[U+1]=H&255,U+2},_.prototype.writeUint32LE=_.prototype.writeUInt32LE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,4,4294967295,0),this[U+3]=H>>>24,this[U+2]=H>>>16,this[U+1]=H>>>8,this[U]=H&255,U+4},_.prototype.writeUint32BE=_.prototype.writeUInt32BE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,4,4294967295,0),this[U]=H>>>24,this[U+1]=H>>>16,this[U+2]=H>>>8,this[U+3]=H&255,U+4};function s(F,H,U,it,pt){D(H,it,pt,F,U,7);let ft=Number(H&BigInt(4294967295));F[U++]=ft,ft=ft>>8,F[U++]=ft,ft=ft>>8,F[U++]=ft,ft=ft>>8,F[U++]=ft;let mt=Number(H>>BigInt(32)&BigInt(4294967295));return F[U++]=mt,mt=mt>>8,F[U++]=mt,mt=mt>>8,F[U++]=mt,mt=mt>>8,F[U++]=mt,U}function A(F,H,U,it,pt){D(H,it,pt,F,U,7);let ft=Number(H&BigInt(4294967295));F[U+7]=ft,ft=ft>>8,F[U+6]=ft,ft=ft>>8,F[U+5]=ft,ft=ft>>8,F[U+4]=ft;let mt=Number(H>>BigInt(32)&BigInt(4294967295));return F[U+3]=mt,mt=mt>>8,F[U+2]=mt,mt=mt>>8,F[U+1]=mt,mt=mt>>8,F[U]=mt,U+8}_.prototype.writeBigUInt64LE=J(function(H,U=0){return s(this,H,U,BigInt(0),BigInt("0xffffffffffffffff"))}),_.prototype.writeBigUInt64BE=J(function(H,U=0){return A(this,H,U,BigInt(0),BigInt("0xffffffffffffffff"))}),_.prototype.writeIntLE=function(H,U,it,pt){if(H=+H,U=U>>>0,!pt){const _t=Math.pow(2,8*it-1);o(this,H,U,it,_t-1,-_t)}let ft=0,mt=1,re=0;for(this[U]=H&255;++ft<it&&(mt*=256);)H<0&&re===0&&this[U+ft-1]!==0&&(re=1),this[U+ft]=(H/mt>>0)-re&255;return U+it},_.prototype.writeIntBE=function(H,U,it,pt){if(H=+H,U=U>>>0,!pt){const _t=Math.pow(2,8*it-1);o(this,H,U,it,_t-1,-_t)}let ft=it-1,mt=1,re=0;for(this[U+ft]=H&255;--ft>=0&&(mt*=256);)H<0&&re===0&&this[U+ft+1]!==0&&(re=1),this[U+ft]=(H/mt>>0)-re&255;return U+it},_.prototype.writeInt8=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,1,127,-128),H<0&&(H=255+H+1),this[U]=H&255,U+1},_.prototype.writeInt16LE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,2,32767,-32768),this[U]=H&255,this[U+1]=H>>>8,U+2},_.prototype.writeInt16BE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,2,32767,-32768),this[U]=H>>>8,this[U+1]=H&255,U+2},_.prototype.writeInt32LE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,4,2147483647,-2147483648),this[U]=H&255,this[U+1]=H>>>8,this[U+2]=H>>>16,this[U+3]=H>>>24,U+4},_.prototype.writeInt32BE=function(H,U,it){return H=+H,U=U>>>0,it||o(this,H,U,4,2147483647,-2147483648),H<0&&(H=4294967295+H+1),this[U]=H>>>24,this[U+1]=H>>>16,this[U+2]=H>>>8,this[U+3]=H&255,U+4},_.prototype.writeBigInt64LE=J(function(H,U=0){return s(this,H,U,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),_.prototype.writeBigInt64BE=J(function(H,U=0){return A(this,H,U,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function C(F,H,U,it,pt,ft){if(U+it>F.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("Index out of range")}function j(F,H,U,it,pt){return H=+H,U=U>>>0,pt||C(F,H,U,4),L.write(F,H,U,it,23,4),U+4}_.prototype.writeFloatLE=function(H,U,it){return j(this,H,U,!0,it)},_.prototype.writeFloatBE=function(H,U,it){return j(this,H,U,!1,it)};function T(F,H,U,it,pt){return H=+H,U=U>>>0,pt||C(F,H,U,8),L.write(F,H,U,it,52,8),U+8}_.prototype.writeDoubleLE=function(H,U,it){return T(this,H,U,!0,it)},_.prototype.writeDoubleBE=function(H,U,it){return T(this,H,U,!1,it)},_.prototype.copy=function(H,U,it,pt){if(!_.isBuffer(H))throw new TypeError("argument should be a Buffer");if(it||(it=0),!pt&&pt!==0&&(pt=this.length),U>=H.length&&(U=H.length),U||(U=0),pt>0&&pt<it&&(pt=it),pt===it||H.length===0||this.length===0)return 0;if(U<0)throw new RangeError("targetStart out of bounds");if(it<0||it>=this.length)throw new RangeError("Index out of range");if(pt<0)throw new RangeError("sourceEnd out of bounds");pt>this.length&&(pt=this.length),H.length-U<pt-it&&(pt=H.length-U+it);const ft=pt-it;return this===H&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(U,it,pt):Uint8Array.prototype.set.call(H,this.subarray(it,pt),U),ft},_.prototype.fill=function(H,U,it,pt){if(typeof H=="string"){if(typeof U=="string"?(pt=U,U=0,it=this.length):typeof it=="string"&&(pt=it,it=this.length),pt!==void 0&&typeof pt!="string")throw new TypeError("encoding must be a string");if(typeof pt=="string"&&!_.isEncoding(pt))throw new TypeError("Unknown encoding: "+pt);if(H.length===1){const mt=H.charCodeAt(0);(pt==="utf8"&&mt<128||pt==="latin1")&&(H=mt)}}else typeof H=="number"?H=H&255:typeof H=="boolean"&&(H=Number(H));if(U<0||this.length<U||this.length<it)throw new RangeError("Out of range index");if(it<=U)return this;U=U>>>0,it=it===void 0?this.length:it>>>0,H||(H=0);let ft;if(typeof H=="number")for(ft=U;ft<it;++ft)this[ft]=H;else{const mt=_.isBuffer(H)?H:_.from(H,pt),re=mt.length;if(re===0)throw new TypeError('The value "'+H+'" is invalid for argument "value"');for(ft=0;ft<it-U;++ft)this[ft+U]=mt[ft%re]}return this};const R={};function q(F,H,U){R[F]=class extends U{constructor(){super(),Object.defineProperty(this,"message",{value:H.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${F}]`,this.stack,delete this.name}get code(){return F}set code(pt){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:pt,writable:!0})}toString(){return`${this.name} [${F}]: ${this.message}`}}}q("ERR_BUFFER_OUT_OF_BOUNDS",function(F){return F?`${F} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),q("ERR_INVALID_ARG_TYPE",function(F,H){return`The "${F}" argument must be of type number. Received type ${typeof H}`},TypeError),q("ERR_OUT_OF_RANGE",function(F,H,U){let it=`The value of "${F}" is out of range.`,pt=U;return Number.isInteger(U)&&Math.abs(U)>2**32?pt=Z(String(U)):typeof U=="bigint"&&(pt=String(U),(U>BigInt(2)**BigInt(32)||U<-(BigInt(2)**BigInt(32)))&&(pt=Z(pt)),pt+="n"),it+=` It must be ${H}. Received ${pt}`,it},RangeError);function Z(F){let H="",U=F.length;const it=F[0]==="-"?1:0;for(;U>=it+4;U-=3)H=`_${F.slice(U-3,U)}${H}`;return`${F.slice(0,U)}${H}`}function rt(F,H,U){G(H,"offset"),(F[H]===void 0||F[H+U]===void 0)&&z(H,F.length-(U+1))}function D(F,H,U,it,pt,ft){if(F>U||F<H){const mt=typeof H=="bigint"?"n":"";let re;throw ft>3?H===0||H===BigInt(0)?re=`>= 0${mt} and < 2${mt} ** ${(ft+1)*8}${mt}`:re=`>= -(2${mt} ** ${(ft+1)*8-1}${mt}) and < 2 ** ${(ft+1)*8-1}${mt}`:re=`>= ${H}${mt} and <= ${U}${mt}`,new R.ERR_OUT_OF_RANGE("value",re,F)}rt(it,pt,ft)}function G(F,H){if(typeof F!="number")throw new R.ERR_INVALID_ARG_TYPE(H,"number",F)}function z(F,H,U){throw Math.floor(F)!==F?(G(F,U),new R.ERR_OUT_OF_RANGE(U||"offset","an integer",F)):H<0?new R.ERR_BUFFER_OUT_OF_BOUNDS:new R.ERR_OUT_OF_RANGE(U||"offset",`>= ${U?1:0} and <= ${H}`,F)}const X=/[^+/0-9A-Za-z-_]/g;function st(F){if(F=F.split("=")[0],F=F.trim().replace(X,""),F.length<2)return"";for(;F.length%4!==0;)F=F+"=";return F}function nt(F,H){H=H||1/0;let U;const it=F.length;let pt=null;const ft=[];for(let mt=0;mt<it;++mt){if(U=F.charCodeAt(mt),U>55295&&U<57344){if(!pt){if(U>56319){(H-=3)>-1&&ft.push(239,191,189);continue}else if(mt+1===it){(H-=3)>-1&&ft.push(239,191,189);continue}pt=U;continue}if(U<56320){(H-=3)>-1&&ft.push(239,191,189),pt=U;continue}U=(pt-55296<<10|U-56320)+65536}else pt&&(H-=3)>-1&&ft.push(239,191,189);if(pt=null,U<128){if((H-=1)<0)break;ft.push(U)}else if(U<2048){if((H-=2)<0)break;ft.push(U>>6|192,U&63|128)}else if(U<65536){if((H-=3)<0)break;ft.push(U>>12|224,U>>6&63|128,U&63|128)}else if(U<1114112){if((H-=4)<0)break;ft.push(U>>18|240,U>>12&63|128,U>>6&63|128,U&63|128)}else throw new Error("Invalid code point")}return ft}function lt(F){const H=[];for(let U=0;U<F.length;++U)H.push(F.charCodeAt(U)&255);return H}function Et(F,H){let U,it,pt;const ft=[];for(let mt=0;mt<F.length&&!((H-=2)<0);++mt)U=F.charCodeAt(mt),it=U>>8,pt=U%256,ft.push(pt),ft.push(it);return ft}function gt(F){return O.toByteArray(st(F))}function bt(F,H,U,it){let pt;for(pt=0;pt<it&&!(pt+U>=H.length||pt>=F.length);++pt)H[pt+U]=F[pt];return pt}function Bt(F,H){return F instanceof H||F!=null&&F.constructor!=null&&F.constructor.name!=null&&F.constructor.name===H.name}function Mt(F){return F!==F}const It=function(){const F="0123456789abcdef",H=new Array(256);for(let U=0;U<16;++U){const it=U*16;for(let pt=0;pt<16;++pt)H[it+pt]=F[U]+F[pt]}return H}();function J(F){return typeof BigInt>"u"?tt:F}function tt(){throw new Error("BigInt not supported")}})(Va),window.Buffer=Va.Buffer,globalThis.Buffer=Va.Buffer;var ve=(K,O,L)=>new Promise((Y,ut)=>{var ht=y=>{try{_(L.next(y))}catch(x){ut(x)}},W=y=>{try{_(L.throw(y))}catch(x){ut(x)}},_=y=>y.done?Y(y.value):Promise.resolve(y.value).then(ht,W);_((L=L.apply(K,O)).next())});class _p extends sp{constructor(O,L){super(O??oc.create(),L)}getKnowledge(O,L){return ve(this,null,function*(){return this.get("/knowledge",{docId:O,name:L})})}postKnowledge(O){return ve(this,null,function*(){return this.post("/knowledge",O)})}getKnowledgeId(O){return ve(this,null,function*(){return this.get(`/knowledge/${O}`)})}patchKnowledgeId(O,L){return ve(this,null,function*(){return this.patch(`/knowledge/${O}`,L)})}delKnowledgeId(O){return ve(this,null,function*(){return this.delete(`/knowledge/${O}`)})}getKnowledgeIdFile(O){return ve(this,null,function*(){return this.get(`/knowledge/${O}/file`)})}getKnowledgeIdFileList(O,L){return ve(this,null,function*(){return this.listPaged(`/knowledge/${O}/file`,L)})}postKnowledgeIdFile(O,L){return ve(this,null,function*(){return this.post(`/knowledge/${O}/file`,L)})}getUploadTicket(O){return ve(this,null,function*(){return this.get("/upload/ticket",O)})}delKnowledgeIdFileFid(O,L){return ve(this,null,function*(){return this.delete(`/knowledge/${O}/file/${L}`)})}patchKnowledgeIdFileFid(O,L,Y){return ve(this,null,function*(){return this.patch(`/knowledge/${O}/file/${L}`,Y)})}listSessions(O,L){return ve(this,null,function*(){return this.get(`/application/${O}/sessionsa`,L)})}postSession(O,L){return ve(this,null,function*(){return this.post(`/application/${O}/sessions`,L)})}getSession(O,L){return ve(this,null,function*(){return this.get(`/application/${O}/sessions/${L}`)})}patchSessionsId(O,L,Y){return ve(this,null,function*(){return this.patch(`/application/${O}/sessions/${L}`,Y)})}delSessionsId(O,L){return ve(this,null,function*(){return this.delete(`/application/${O}/sessions/${L}`)})}getSessionKnowledgeFile(O,L,Y){return ve(this,null,function*(){return this.get(`/application/${O}session/${L}/file/${Y}`)})}postSessionKnowledgeFile(O,L,Y){return ve(this,null,function*(){return this.post(`/application/${O}session/${L}/file`,Y)})}postComments(O,L,Y){return ve(this,null,function*(){return this.post(`/application/${O}/sessions/${L}/comments`,Y)})}getChatHistorySessionId(O,L,Y){return ve(this,null,function*(){return this.get(`application/${O}/chatHistory/${L}`,Y)})}postChatHistorySessionId(O,L){return ve(this,null,function*(){return this.post(`/chatHistory/${O}`,L)})}getApplications(O){return ve(this,null,function*(){return this.get("/applications",O)})}postApplication(O){return ve(this,null,function*(){return this.post("/applications",O)})}getApplicationId(O){return ve(this,null,function*(){return this.get(`/applications/${O}`)})}patchApplicationId(O,L){return ve(this,null,function*(){return this.patch(`/applications/${O}`,L)})}delApplicationId(O){return ve(this,null,function*(){return this.delete(`/applications/${O}`)})}getApplicationIdSessions(O){return ve(this,null,function*(){return this.get(`/applications/${O}/session`)})}patchFileId(O,L){return ve(this,null,function*(){return this.patch(`/file/${O}`,L)})}getCvforceResource(O){return ve(this,null,function*(){return this.get("/cvforce/resource",O)})}postKnowledgeIdComposedFiles(O,L){return ve(this,null,function*(){return this.post(`/knowledge/${O}/composedFiles`,L)})}getTokensApplicationId(O,L){return ve(this,null,function*(){return this.get(`/tokens/${O}`,L)})}getTokens(O){return ve(this,null,function*(){return this.get("/tokens",O)})}uploadMinioFile(O,L){return ve(this,null,function*(){return new Promise((Y,ut)=>{const ht=new FileReader;ht.readAsArrayBuffer(L),ht.onload=W=>{cc.initMinio({endPoint:O.endpoints[0],useSSL:O.useSSL,accessKey:O.accessKey,secretKey:O.secretKey});const _=Buffer.from(W.target.result),y={"Content-Type":"application/octet-stream"};cc.putObjectBuffer(O.bucket,O.fileKeys[0],_,y,x=>{if(x)throw console.error(x),Error(x);Y(O.fileKeys[0])})}})})}uploadFile(O,L){return ve(this,null,function*(){const Y={files:[L.name],isv:"minio",knowledgeId:O};return this.getUploadTicket(Y).then(ut=>this.uploadMinioFile(ut.minio,L)).catch(ut=>{throw Error(ut)})})}uploadFiles(O,L){return ve(this,null,function*(){const Y={files:L.map(ut=>ut.name),isv:"minio",knowledgeId:O};return this.getUploadTicket(Y).then(ut=>Promise.all(L.map(ht=>this.uploadMinioFile(ut.minio,ht)))).catch(ut=>{throw Error(ut)})})}getAecModels(){return ve(this,null,function*(){return this.get("/aecModels")})}postTextFilter(O){return ve(this,null,function*(){return this.post("/textFilter",O)})}getTenantModel(){return ve(this,null,function*(){return this.get("/tenantModel")})}getPrompts(O,L){return ve(this,null,function*(){return this.get(`application/${O}/promptVariables`,L)})}postPrompt(O,L){return ve(this,null,function*(){return this.post(`application/${O}/promptVariables`,L)})}patchPromptId(O,L,Y){return ve(this,null,function*(){return this.patch(`application/${O}/promptVariables/${L}`,Y)})}delPromptId(O,L){return ve(this,null,function*(){return this.delete(`application/${O}/promptVariables/${L}`)})}getSessionPrompts(O){return ve(this,null,function*(){return this.get(`session/${O}/promptVariables`)})}patchSessionPromptId(O,L,Y){return ve(this,null,function*(){return this.patch(`session/${L}/promptVariables/${O}`,Y)})}getApplicationIdSessionIdPromptVariables(O,L){return ve(this,null,function*(){return this.get(`/application/${O}/session/${L}/promptVariables`)})}patchApplicationIdSessionpromptVariablesId(O,L,Y,ut){return ve(this,null,function*(){return this.patch(`/application/${O}/session/${L}/promptVariables/${Y}`,ut)})}getPresetApplication(O){return ve(this,null,function*(){return this.get("presetApplication",O)})}postKnowledgeConfig(O){return ve(this,null,function*(){return this.post("/knowledgeConfig",O)})}getKnowledgeConfig(O){return ve(this,null,function*(){return this.get(`/knowledgeConfig/${O}`)})}patchKnowledgeConfig(O,L){return ve(this,null,function*(){return this.patch(`/knowledgeConfig/${O}`,L)})}getKnowledgeIdFileId(O,L){return ve(this,null,function*(){return this.get(`/knowledge/${O}/file/${L}`)})}getKnowledgeIdFileIdData(O,L,Y){return ve(this,null,function*(){return this.listPaged(`/knowledge/${O}/file/${L}/data`,Y)})}postKnowledgeIdFileIdData(O,L,Y){return ve(this,null,function*(){return this.post(`/knowledge/${O}/file/${L}/data`,{data:Y})})}patchKnowledgeIdFileIdData(O,L,Y,ut){return ve(this,null,function*(){return this.patch(`/knowledge/${O}/file/${L}/data/${Y}`,{data:ut})})}delKnowledgeIdFileIdDataDid(O,L,Y){return ve(this,null,function*(){return this.delete(`/knowledge/${O}/file/${L}/data/${Y}`)})}getPresetKnowledge(O){return ve(this,null,function*(){return this.get("/presetKnowledge",O)})}patchSessionsIdContext(O){return ve(this,null,function*(){return this.patch(`/sessions/${O}/context`,{})})}postResourceToken(O){return ve(this,null,function*(){return this.post("/resourceToken",O)})}getApplicationIdSession(O){return ve(this,null,function*(){return this.get(`/application/${O}/session`)})}patchApplicationIdSessionsIdContext(O,L){return ve(this,null,function*(){return this.patch(`/application/${O}/sessions/${L}/context`,{})})}postApplicationIdSessions(O,L){return ve(this,null,function*(){return this.post(`/application/${O}/sessions`,L)})}getApplicationIdChatHistorySessionId(O,L){return ve(this,null,function*(){return this.get(`/application/${O}/chatHistory/${L}`)})}postApplicationIdChatHistorySessionIdComments(O,L,Y){return ve(this,null,function*(){return this.post(`/application/${O}/sessions/${L}/comments`,Y)})}getApplicationIdPrompts(O,L){return ve(this,null,function*(){return this.get(`/application/${O}/promptVariables`,L)})}postKnowledgeSourceFile(O,L,Y){return ve(this,null,function*(){return this.post(`/knowledge/${O}/sourceFile/${L}`,Y)})}getMetadata(O){return ve(this,null,function*(){return this.get("/metadata",O)})}postGeneques(O){return ve(this,null,function*(){return this.post("/geneques",O)})}getBaseModel(O){return ve(this,null,function*(){return this.get("/baseModelInfo",{serviceId:O})})}}var vr=(K=>(K[K.Robot=1]="Robot",K[K.User=2]="User",K[K.System=3]="System",K))(vr||{}),pc=(K=>(K[K.Idle=0]="Idle",K[K.Quoted=1]="Quoted",K))(pc||{}),bn=(K=>(K[K.Dialog=0]="Dialog",K[K.Text=1]="Text",K[K.Agent=2]="Agent",K[K.All=3]="All",K))(bn||{});function dc(K,O,L){const Y=x=>{var v;return O&&(sf(O)&&L(403,"aiotToken is timeout"),x.headers=(v=x.headers)!==null&&v!==void 0?v:{},x.headers=Object.assign(Object.assign({},x.headers),{Authorization:O?`Bearer ${O}`:""})),x};function ut(x,v=!0){const m=`${K}${x}`,S=oc.create({baseURL:m});return v&&S.interceptors.request.use(Y),S}const ht=(x,v)=>{x===401&&L(x,"aiotToken is invalid")},W=(x,v)=>{x!==10001&&x!==10215&&L(x,v)},_=ut("/data/v1");return new _p(_,{onHttpStatusError:ht,onAppStatusError:W})}const kr=Object.create(null);kr.open="0",kr.close="1",kr.ping="2",kr.pong="3",kr.message="4",kr.upgrade="5",kr.noop="6";const po=Object.create(null);Object.keys(kr).forEach(K=>{po[kr[K]]=K});const Ka={type:"error",data:"parser error"},mc=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",gc=typeof ArrayBuffer=="function",vc=K=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(K):K&&K.buffer instanceof ArrayBuffer,Ja=({type:K,data:O},L,Y)=>mc&&O instanceof Blob?L?Y(O):yc(O,Y):gc&&(O instanceof ArrayBuffer||vc(O))?L?Y(O):yc(new Blob([O]),Y):Y(kr[K]+(O||"")),yc=(K,O)=>{const L=new FileReader;return L.onload=function(){const Y=L.result.split(",")[1];O("b"+(Y||""))},L.readAsDataURL(K)};function bc(K){return K instanceof Uint8Array?K:K instanceof ArrayBuffer?new Uint8Array(K):new Uint8Array(K.buffer,K.byteOffset,K.byteLength)}let Ga;function Sp(K,O){if(mc&&K.data instanceof Blob)return K.data.arrayBuffer().then(bc).then(O);if(gc&&(K.data instanceof ArrayBuffer||vc(K.data)))return O(bc(K.data));Ja(K,!1,L=>{Ga||(Ga=new TextEncoder),O(Ga.encode(L))})}const wc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cn=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let K=0;K<wc.length;K++)Cn[wc.charCodeAt(K)]=K;const Ep=K=>{let O=K.length*.75,L=K.length,Y,ut=0,ht,W,_,y;K[K.length-1]==="="&&(O--,K[K.length-2]==="="&&O--);const x=new ArrayBuffer(O),v=new Uint8Array(x);for(Y=0;Y<L;Y+=4)ht=Cn[K.charCodeAt(Y)],W=Cn[K.charCodeAt(Y+1)],_=Cn[K.charCodeAt(Y+2)],y=Cn[K.charCodeAt(Y+3)],v[ut++]=ht<<2|W>>4,v[ut++]=(W&15)<<4|_>>2,v[ut++]=(_&3)<<6|y&63;return x},kp=typeof ArrayBuffer=="function",Ya=(K,O)=>{if(typeof K!="string")return{type:"message",data:Mc(K,O)};const L=K.charAt(0);return L==="b"?{type:"message",data:Ip(K.substring(1),O)}:po[L]?K.length>1?{type:po[L],data:K.substring(1)}:{type:po[L]}:Ka},Ip=(K,O)=>{if(kp){const L=Ep(K);return Mc(L,O)}else return{base64:!0,data:K}},Mc=(K,O)=>{switch(O){case"blob":return K instanceof Blob?K:new Blob([K]);case"arraybuffer":default:return K instanceof ArrayBuffer?K:K.buffer}},xc=String.fromCharCode(30),Op=(K,O)=>{const L=K.length,Y=new Array(L);let ut=0;K.forEach((ht,W)=>{Ja(ht,!1,_=>{Y[W]=_,++ut===L&&O(Y.join(xc))})})},Ap=(K,O)=>{const L=K.split(xc),Y=[];for(let ut=0;ut<L.length;ut++){const ht=Ya(L[ut],O);if(Y.push(ht),ht.type==="error")break}return Y};function Tp(){return new TransformStream({transform(K,O){Sp(K,L=>{const Y=L.length;let ut;if(Y<126)ut=new Uint8Array(1),new DataView(ut.buffer).setUint8(0,Y);else if(Y<65536){ut=new Uint8Array(3);const ht=new DataView(ut.buffer);ht.setUint8(0,126),ht.setUint16(1,Y)}else{ut=new Uint8Array(9);const ht=new DataView(ut.buffer);ht.setUint8(0,127),ht.setBigUint64(1,BigInt(Y))}K.data&&typeof K.data!="string"&&(ut[0]|=128),O.enqueue(ut),O.enqueue(L)})}})}let Qa;function mo(K){return K.reduce((O,L)=>O+L.length,0)}function go(K,O){if(K[0].length===O)return K.shift();const L=new Uint8Array(O);let Y=0;for(let ut=0;ut<O;ut++)L[ut]=K[0][Y++],Y===K[0].length&&(K.shift(),Y=0);return K.length&&Y<K[0].length&&(K[0]=K[0].slice(Y)),L}function Bp(K,O){Qa||(Qa=new TextDecoder);const L=[];let Y=0,ut=-1,ht=!1;return new TransformStream({transform(W,_){for(L.push(W);;){if(Y===0){if(mo(L)<1)break;const y=go(L,1);ht=(y[0]&128)===128,ut=y[0]&127,ut<126?Y=3:ut===126?Y=1:Y=2}else if(Y===1){if(mo(L)<2)break;const y=go(L,2);ut=new DataView(y.buffer,y.byteOffset,y.length).getUint16(0),Y=3}else if(Y===2){if(mo(L)<8)break;const y=go(L,8),x=new DataView(y.buffer,y.byteOffset,y.length),v=x.getUint32(0);if(v>Math.pow(2,53-32)-1){_.enqueue(Ka);break}ut=v*Math.pow(2,32)+x.getUint32(4),Y=3}else{if(mo(L)<ut)break;const y=go(L,ut);_.enqueue(Ya(ht?y:Qa.decode(y),O)),Y=0}if(ut===0||ut>K){_.enqueue(Ka);break}}}})}const _c=4;function Bi(K){if(K)return jp(K)}function jp(K){for(var O in Bi.prototype)K[O]=Bi.prototype[O];return K}Bi.prototype.on=Bi.prototype.addEventListener=function(K,O){return this._callbacks=this._callbacks||{},(this._callbacks["$"+K]=this._callbacks["$"+K]||[]).push(O),this},Bi.prototype.once=function(K,O){function L(){this.off(K,L),O.apply(this,arguments)}return L.fn=O,this.on(K,L),this},Bi.prototype.off=Bi.prototype.removeListener=Bi.prototype.removeAllListeners=Bi.prototype.removeEventListener=function(K,O){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var L=this._callbacks["$"+K];if(!L)return this;if(arguments.length==1)return delete this._callbacks["$"+K],this;for(var Y,ut=0;ut<L.length;ut++)if(Y=L[ut],Y===O||Y.fn===O){L.splice(ut,1);break}return L.length===0&&delete this._callbacks["$"+K],this},Bi.prototype.emit=function(K){this._callbacks=this._callbacks||{};for(var O=new Array(arguments.length-1),L=this._callbacks["$"+K],Y=1;Y<arguments.length;Y++)O[Y-1]=arguments[Y];if(L){L=L.slice(0);for(var Y=0,ut=L.length;Y<ut;++Y)L[Y].apply(this,O)}return this},Bi.prototype.emitReserved=Bi.prototype.emit,Bi.prototype.listeners=function(K){return this._callbacks=this._callbacks||{},this._callbacks["$"+K]||[]},Bi.prototype.hasListeners=function(K){return!!this.listeners(K).length};const ur=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function Sc(K,...O){return O.reduce((L,Y)=>(K.hasOwnProperty(Y)&&(L[Y]=K[Y]),L),{})}const Rp=ur.setTimeout,Np=ur.clearTimeout;function vo(K,O){O.useNativeTimers?(K.setTimeoutFn=Rp.bind(ur),K.clearTimeoutFn=Np.bind(ur)):(K.setTimeoutFn=ur.setTimeout.bind(ur),K.clearTimeoutFn=ur.clearTimeout.bind(ur))}const Cp=1.33;function Pp(K){return typeof K=="string"?Lp(K):Math.ceil((K.byteLength||K.size)*Cp)}function Lp(K){let O=0,L=0;for(let Y=0,ut=K.length;Y<ut;Y++)O=K.charCodeAt(Y),O<128?L+=1:O<2048?L+=2:O<55296||O>=57344?L+=3:(Y++,L+=4);return L}function Dp(K){let O="";for(let L in K)K.hasOwnProperty(L)&&(O.length&&(O+="&"),O+=encodeURIComponent(L)+"="+encodeURIComponent(K[L]));return O}function Up(K){let O={},L=K.split("&");for(let Y=0,ut=L.length;Y<ut;Y++){let ht=L[Y].split("=");O[decodeURIComponent(ht[0])]=decodeURIComponent(ht[1])}return O}class qp extends Error{constructor(O,L,Y){super(O),this.description=L,this.context=Y,this.type="TransportError"}}class ts extends Bi{constructor(O){super(),this.writable=!1,vo(this,O),this.opts=O,this.query=O.query,this.socket=O.socket}onError(O,L,Y){return super.emitReserved("error",new qp(O,L,Y)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(O){this.readyState==="open"&&this.write(O)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(O){const L=Ya(O,this.socket.binaryType);this.onPacket(L)}onPacket(O){super.emitReserved("packet",O)}onClose(O){this.readyState="closed",super.emitReserved("close",O)}pause(O){}createUri(O,L={}){return O+"://"+this._hostname()+this._port()+this.opts.path+this._query(L)}_hostname(){const O=this.opts.hostname;return O.indexOf(":")===-1?O:"["+O+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(O){const L=Dp(O);return L.length?"?"+L:""}}const Ec="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),es=64,Fp={};let kc=0,yo=0,Ic;function Oc(K){let O="";do O=Ec[K%es]+O,K=Math.floor(K/es);while(K>0);return O}function Ac(){const K=Oc(+new Date);return K!==Ic?(kc=0,Ic=K):K+"."+Oc(kc++)}for(;yo<es;yo++)Fp[Ec[yo]]=yo;let Tc=!1;try{Tc=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const zp=Tc;function Bc(K){const O=K.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!O||zp))return new XMLHttpRequest}catch{}if(!O)try{return new ur[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function Lm(){}function $p(){}const Hp=function(){return new Bc({xdomain:!1}).responseType!=null}();class Wp extends ts{constructor(O){if(super(O),this.polling=!1,typeof location<"u"){const Y=location.protocol==="https:";let ut=location.port;ut||(ut=Y?"443":"80"),this.xd=typeof location<"u"&&O.hostname!==location.hostname||ut!==O.port}const L=O&&O.forceBase64;this.supportsBinary=Hp&&!L,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(O){this.readyState="pausing";const L=()=>{this.readyState="paused",O()};if(this.polling||!this.writable){let Y=0;this.polling&&(Y++,this.once("pollComplete",function(){--Y||L()})),this.writable||(Y++,this.once("drain",function(){--Y||L()}))}else L()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(O){const L=Y=>{if(this.readyState==="opening"&&Y.type==="open"&&this.onOpen(),Y.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(Y)};Ap(O,this.socket.binaryType).forEach(L),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const O=()=>{this.write([{type:"close"}])};this.readyState==="open"?O():this.once("open",O)}write(O){this.writable=!1,Op(O,L=>{this.doWrite(L,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const O=this.opts.secure?"https":"http",L=this.query||{};return this.opts.timestampRequests!==!1&&(L[this.opts.timestampParam]=Ac()),!this.supportsBinary&&!L.sid&&(L.b64=1),this.createUri(O,L)}request(O={}){return Object.assign(O,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Ir(this.uri(),O)}doWrite(O,L){const Y=this.request({method:"POST",data:O});Y.on("success",L),Y.on("error",(ut,ht)=>{this.onError("xhr post error",ut,ht)})}doPoll(){const O=this.request();O.on("data",this.onData.bind(this)),O.on("error",(L,Y)=>{this.onError("xhr poll error",L,Y)}),this.pollXhr=O}}class Ir extends Bi{constructor(O,L){super(),vo(this,L),this.opts=L,this.method=L.method||"GET",this.uri=O,this.data=L.data!==void 0?L.data:null,this.create()}create(){var O;const L=Sc(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");L.xdomain=!!this.opts.xd;const Y=this.xhr=new Bc(L);try{Y.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){Y.setDisableHeaderCheck&&Y.setDisableHeaderCheck(!0);for(let ut in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(ut)&&Y.setRequestHeader(ut,this.opts.extraHeaders[ut])}}catch{}if(this.method==="POST")try{Y.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{Y.setRequestHeader("Accept","*/*")}catch{}(O=this.opts.cookieJar)===null||O===void 0||O.addCookies(Y),"withCredentials"in Y&&(Y.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(Y.timeout=this.opts.requestTimeout),Y.onreadystatechange=()=>{var ut;Y.readyState===3&&((ut=this.opts.cookieJar)===null||ut===void 0||ut.parseCookies(Y)),Y.readyState===4&&(Y.status===200||Y.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof Y.status=="number"?Y.status:0)},0))},Y.send(this.data)}catch(ut){this.setTimeoutFn(()=>{this.onError(ut)},0);return}typeof document<"u"&&(this.index=Ir.requestsCount++,Ir.requests[this.index]=this)}onError(O){this.emitReserved("error",O,this.xhr),this.cleanup(!0)}cleanup(O){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=$p,O)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Ir.requests[this.index],this.xhr=null}}onLoad(){const O=this.xhr.responseText;O!==null&&(this.emitReserved("data",O),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(Ir.requestsCount=0,Ir.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",jc);else if(typeof addEventListener=="function"){const K="onpagehide"in ur?"pagehide":"unload";addEventListener(K,jc,!1)}}function jc(){for(let K in Ir.requests)Ir.requests.hasOwnProperty(K)&&Ir.requests[K].abort()}const is=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?O=>Promise.resolve().then(O):(O,L)=>L(O,0))(),bo=ur.WebSocket||ur.MozWebSocket,Rc=!0,Vp="arraybuffer",Nc=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Xp extends ts{constructor(O){super(O),this.supportsBinary=!O.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const O=this.uri(),L=this.opts.protocols,Y=Nc?{}:Sc(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(Y.headers=this.opts.extraHeaders);try{this.ws=Rc&&!Nc?L?new bo(O,L):new bo(O):new bo(O,L,Y)}catch(ut){return this.emitReserved("error",ut)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=O=>this.onClose({description:"websocket connection closed",context:O}),this.ws.onmessage=O=>this.onData(O.data),this.ws.onerror=O=>this.onError("websocket error",O)}write(O){this.writable=!1;for(let L=0;L<O.length;L++){const Y=O[L],ut=L===O.length-1;Ja(Y,this.supportsBinary,ht=>{const W={};try{Rc&&this.ws.send(ht)}catch{}ut&&is(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const O=this.opts.secure?"wss":"ws",L=this.query||{};return this.opts.timestampRequests&&(L[this.opts.timestampParam]=Ac()),this.supportsBinary||(L.b64=1),this.createUri(O,L)}check(){return!!bo}}class Zp extends ts{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(O=>{this.onError("webtransport error",O)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(O=>{const L=Bp(Number.MAX_SAFE_INTEGER,this.socket.binaryType),Y=O.readable.pipeThrough(L).getReader(),ut=Tp();ut.readable.pipeTo(O.writable),this.writer=ut.writable.getWriter();const ht=()=>{Y.read().then(({done:_,value:y})=>{_||(this.onPacket(y),ht())}).catch(_=>{})};ht();const W={type:"open"};this.query.sid&&(W.data=`{"sid":"${this.query.sid}"}`),this.writer.write(W).then(()=>this.onOpen())})}))}write(O){this.writable=!1;for(let L=0;L<O.length;L++){const Y=O[L],ut=L===O.length-1;this.writer.write(Y).then(()=>{ut&&is(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var O;(O=this.transport)===null||O===void 0||O.close()}}const Kp={websocket:Xp,webtransport:Zp,polling:Wp},Jp=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Gp=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function rs(K){if(K.length>2e3)throw"URI too long";const O=K,L=K.indexOf("["),Y=K.indexOf("]");L!=-1&&Y!=-1&&(K=K.substring(0,L)+K.substring(L,Y).replace(/:/g,";")+K.substring(Y,K.length));let ut=Jp.exec(K||""),ht={},W=14;for(;W--;)ht[Gp[W]]=ut[W]||"";return L!=-1&&Y!=-1&&(ht.source=O,ht.host=ht.host.substring(1,ht.host.length-1).replace(/;/g,":"),ht.authority=ht.authority.replace("[","").replace("]","").replace(/;/g,":"),ht.ipv6uri=!0),ht.pathNames=Yp(ht,ht.path),ht.queryKey=Qp(ht,ht.query),ht}function Yp(K,O){const L=/\/{2,9}/g,Y=O.replace(L,"/").split("/");return(O.slice(0,1)=="/"||O.length===0)&&Y.splice(0,1),O.slice(-1)=="/"&&Y.splice(Y.length-1,1),Y}function Qp(K,O){const L={};return O.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(Y,ut,ht){ut&&(L[ut]=ht)}),L}let Cc=class Rn extends Bi{constructor(O,L={}){super(),this.binaryType=Vp,this.writeBuffer=[],O&&typeof O=="object"&&(L=O,O=null),O?(O=rs(O),L.hostname=O.host,L.secure=O.protocol==="https"||O.protocol==="wss",L.port=O.port,O.query&&(L.query=O.query)):L.host&&(L.hostname=rs(L.host).host),vo(this,L),this.secure=L.secure!=null?L.secure:typeof location<"u"&&location.protocol==="https:",L.hostname&&!L.port&&(L.port=this.secure?"443":"80"),this.hostname=L.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=L.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=L.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},L),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Up(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(O){const L=Object.assign({},this.opts.query);L.EIO=_c,L.transport=O,this.id&&(L.sid=this.id);const Y=Object.assign({},this.opts,{query:L,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[O]);return new Kp[O](Y)}open(){let O;if(this.opts.rememberUpgrade&&Rn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)O="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else O=this.transports[0];this.readyState="opening";try{O=this.createTransport(O)}catch{this.transports.shift(),this.open();return}O.open(),this.setTransport(O)}setTransport(O){this.transport&&this.transport.removeAllListeners(),this.transport=O,O.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",L=>this.onClose("transport close",L))}probe(O){let L=this.createTransport(O),Y=!1;Rn.priorWebsocketSuccess=!1;const ut=()=>{Y||(L.send([{type:"ping",data:"probe"}]),L.once("packet",m=>{if(!Y)if(m.type==="pong"&&m.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",L),!L)return;Rn.priorWebsocketSuccess=L.name==="websocket",this.transport.pause(()=>{Y||this.readyState!=="closed"&&(v(),this.setTransport(L),L.send([{type:"upgrade"}]),this.emitReserved("upgrade",L),L=null,this.upgrading=!1,this.flush())})}else{const S=new Error("probe error");S.transport=L.name,this.emitReserved("upgradeError",S)}}))};function ht(){Y||(Y=!0,v(),L.close(),L=null)}const W=m=>{const S=new Error("probe error: "+m);S.transport=L.name,ht(),this.emitReserved("upgradeError",S)};function _(){W("transport closed")}function y(){W("socket closed")}function x(m){L&&m.name!==L.name&&ht()}const v=()=>{L.removeListener("open",ut),L.removeListener("error",W),L.removeListener("close",_),this.off("close",y),this.off("upgrading",x)};L.once("open",ut),L.once("error",W),L.once("close",_),this.once("close",y),this.once("upgrading",x),this.upgrades.indexOf("webtransport")!==-1&&O!=="webtransport"?this.setTimeoutFn(()=>{Y||L.open()},200):L.open()}onOpen(){if(this.readyState="open",Rn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let O=0;const L=this.upgrades.length;for(;O<L;O++)this.probe(this.upgrades[O])}}onPacket(O){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",O),this.emitReserved("heartbeat"),this.resetPingTimeout(),O.type){case"open":this.onHandshake(JSON.parse(O.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const L=new Error("server error");L.code=O.data,this.onError(L);break;case"message":this.emitReserved("data",O.data),this.emitReserved("message",O.data);break}}onHandshake(O){this.emitReserved("handshake",O),this.id=O.sid,this.transport.query.sid=O.sid,this.upgrades=this.filterUpgrades(O.upgrades),this.pingInterval=O.pingInterval,this.pingTimeout=O.pingTimeout,this.maxPayload=O.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const O=this.getWritablePackets();this.transport.send(O),this.prevBufferLen=O.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let L=1;for(let Y=0;Y<this.writeBuffer.length;Y++){const ut=this.writeBuffer[Y].data;if(ut&&(L+=Pp(ut)),Y>0&&L>this.maxPayload)return this.writeBuffer.slice(0,Y);L+=2}return this.writeBuffer}write(O,L,Y){return this.sendPacket("message",O,L,Y),this}send(O,L,Y){return this.sendPacket("message",O,L,Y),this}sendPacket(O,L,Y,ut){if(typeof L=="function"&&(ut=L,L=void 0),typeof Y=="function"&&(ut=Y,Y=null),this.readyState==="closing"||this.readyState==="closed")return;Y=Y||{},Y.compress=Y.compress!==!1;const ht={type:O,data:L,options:Y};this.emitReserved("packetCreate",ht),this.writeBuffer.push(ht),ut&&this.once("flush",ut),this.flush()}close(){const O=()=>{this.onClose("forced close"),this.transport.close()},L=()=>{this.off("upgrade",L),this.off("upgradeError",L),O()},Y=()=>{this.once("upgrade",L),this.once("upgradeError",L)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?Y():O()}):this.upgrading?Y():O()),this}onError(O){Rn.priorWebsocketSuccess=!1,this.emitReserved("error",O),this.onClose("transport error",O)}onClose(O,L){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",O,L),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(O){const L=[];let Y=0;const ut=O.length;for(;Y<ut;Y++)~this.transports.indexOf(O[Y])&&L.push(O[Y]);return L}};Cc.protocol=_c;function td(K,O="",L){let Y=K;L=L||typeof location<"u"&&location,K==null&&(K=L.protocol+"//"+L.host),typeof K=="string"&&(K.charAt(0)==="/"&&(K.charAt(1)==="/"?K=L.protocol+K:K=L.host+K),/^(https?|wss?):\/\//.test(K)||(typeof L<"u"?K=L.protocol+"//"+K:K="https://"+K),Y=rs(K)),Y.port||(/^(http|ws)$/.test(Y.protocol)?Y.port="80":/^(http|ws)s$/.test(Y.protocol)&&(Y.port="443")),Y.path=Y.path||"/";const ht=Y.host.indexOf(":")!==-1?"["+Y.host+"]":Y.host;return Y.id=Y.protocol+"://"+ht+":"+Y.port+O,Y.href=Y.protocol+"://"+ht+(L&&L.port===Y.port?"":":"+Y.port),Y}const ed=typeof ArrayBuffer=="function",id=K=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(K):K.buffer instanceof ArrayBuffer,Pc=Object.prototype.toString,rd=typeof Blob=="function"||typeof Blob<"u"&&Pc.call(Blob)==="[object BlobConstructor]",nd=typeof File=="function"||typeof File<"u"&&Pc.call(File)==="[object FileConstructor]";function ns(K){return ed&&(K instanceof ArrayBuffer||id(K))||rd&&K instanceof Blob||nd&&K instanceof File}function wo(K,O){if(!K||typeof K!="object")return!1;if(Array.isArray(K)){for(let L=0,Y=K.length;L<Y;L++)if(wo(K[L]))return!0;return!1}if(ns(K))return!0;if(K.toJSON&&typeof K.toJSON=="function"&&arguments.length===1)return wo(K.toJSON(),!0);for(const L in K)if(Object.prototype.hasOwnProperty.call(K,L)&&wo(K[L]))return!0;return!1}function od(K){const O=[],L=K.data,Y=K;return Y.data=os(L,O),Y.attachments=O.length,{packet:Y,buffers:O}}function os(K,O){if(!K)return K;if(ns(K)){const L={_placeholder:!0,num:O.length};return O.push(K),L}else if(Array.isArray(K)){const L=new Array(K.length);for(let Y=0;Y<K.length;Y++)L[Y]=os(K[Y],O);return L}else if(typeof K=="object"&&!(K instanceof Date)){const L={};for(const Y in K)Object.prototype.hasOwnProperty.call(K,Y)&&(L[Y]=os(K[Y],O));return L}return K}function ad(K,O){return K.data=as(K.data,O),delete K.attachments,K}function as(K,O){if(!K)return K;if(K&&K._placeholder===!0){if(typeof K.num=="number"&&K.num>=0&&K.num<O.length)return O[K.num];throw new Error("illegal attachments")}else if(Array.isArray(K))for(let L=0;L<K.length;L++)K[L]=as(K[L],O);else if(typeof K=="object")for(const L in K)Object.prototype.hasOwnProperty.call(K,L)&&(K[L]=as(K[L],O));return K}const sd=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],ud=5;var ti;(function(K){K[K.CONNECT=0]="CONNECT",K[K.DISCONNECT=1]="DISCONNECT",K[K.EVENT=2]="EVENT",K[K.ACK=3]="ACK",K[K.CONNECT_ERROR=4]="CONNECT_ERROR",K[K.BINARY_EVENT=5]="BINARY_EVENT",K[K.BINARY_ACK=6]="BINARY_ACK"})(ti||(ti={}));class cd{constructor(O){this.replacer=O}encode(O){return(O.type===ti.EVENT||O.type===ti.ACK)&&wo(O)?this.encodeAsBinary({type:O.type===ti.EVENT?ti.BINARY_EVENT:ti.BINARY_ACK,nsp:O.nsp,data:O.data,id:O.id}):[this.encodeAsString(O)]}encodeAsString(O){let L=""+O.type;return(O.type===ti.BINARY_EVENT||O.type===ti.BINARY_ACK)&&(L+=O.attachments+"-"),O.nsp&&O.nsp!=="/"&&(L+=O.nsp+","),O.id!=null&&(L+=O.id),O.data!=null&&(L+=JSON.stringify(O.data,this.replacer)),L}encodeAsBinary(O){const L=od(O),Y=this.encodeAsString(L.packet),ut=L.buffers;return ut.unshift(Y),ut}}function Lc(K){return Object.prototype.toString.call(K)==="[object Object]"}class ss extends Bi{constructor(O){super(),this.reviver=O}add(O){let L;if(typeof O=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");L=this.decodeString(O);const Y=L.type===ti.BINARY_EVENT;Y||L.type===ti.BINARY_ACK?(L.type=Y?ti.EVENT:ti.ACK,this.reconstructor=new ld(L),L.attachments===0&&super.emitReserved("decoded",L)):super.emitReserved("decoded",L)}else if(ns(O)||O.base64)if(this.reconstructor)L=this.reconstructor.takeBinaryData(O),L&&(this.reconstructor=null,super.emitReserved("decoded",L));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+O)}decodeString(O){let L=0;const Y={type:Number(O.charAt(0))};if(ti[Y.type]===void 0)throw new Error("unknown packet type "+Y.type);if(Y.type===ti.BINARY_EVENT||Y.type===ti.BINARY_ACK){const ht=L+1;for(;O.charAt(++L)!=="-"&&L!=O.length;);const W=O.substring(ht,L);if(W!=Number(W)||O.charAt(L)!=="-")throw new Error("Illegal attachments");Y.attachments=Number(W)}if(O.charAt(L+1)==="/"){const ht=L+1;for(;++L&&!(O.charAt(L)===","||L===O.length););Y.nsp=O.substring(ht,L)}else Y.nsp="/";const ut=O.charAt(L+1);if(ut!==""&&Number(ut)==ut){const ht=L+1;for(;++L;){const W=O.charAt(L);if(W==null||Number(W)!=W){--L;break}if(L===O.length)break}Y.id=Number(O.substring(ht,L+1))}if(O.charAt(++L)){const ht=this.tryParse(O.substr(L));if(ss.isPayloadValid(Y.type,ht))Y.data=ht;else throw new Error("invalid payload")}return Y}tryParse(O){try{return JSON.parse(O,this.reviver)}catch{return!1}}static isPayloadValid(O,L){switch(O){case ti.CONNECT:return Lc(L);case ti.DISCONNECT:return L===void 0;case ti.CONNECT_ERROR:return typeof L=="string"||Lc(L);case ti.EVENT:case ti.BINARY_EVENT:return Array.isArray(L)&&(typeof L[0]=="number"||typeof L[0]=="string"&&sd.indexOf(L[0])===-1);case ti.ACK:case ti.BINARY_ACK:return Array.isArray(L)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class ld{constructor(O){this.packet=O,this.buffers=[],this.reconPack=O}takeBinaryData(O){if(this.buffers.push(O),this.buffers.length===this.reconPack.attachments){const L=ad(this.reconPack,this.buffers);return this.finishedReconstruction(),L}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const hd=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ss,Encoder:cd,get PacketType(){return ti},protocol:ud},Symbol.toStringTag,{value:"Module"}));function yr(K,O,L){return K.on(O,L),function(){K.off(O,L)}}const fd=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Dc extends Bi{constructor(O,L,Y){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=O,this.nsp=L,Y&&Y.auth&&(this.auth=Y.auth),this._opts=Object.assign({},Y),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const O=this.io;this.subs=[yr(O,"open",this.onopen.bind(this)),yr(O,"packet",this.onpacket.bind(this)),yr(O,"error",this.onerror.bind(this)),yr(O,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...O){return O.unshift("message"),this.emit.apply(this,O),this}emit(O,...L){if(fd.hasOwnProperty(O))throw new Error('"'+O.toString()+'" is a reserved event name');if(L.unshift(O),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(L),this;const Y={type:ti.EVENT,data:L};if(Y.options={},Y.options.compress=this.flags.compress!==!1,typeof L[L.length-1]=="function"){const W=this.ids++,_=L.pop();this._registerAckCallback(W,_),Y.id=W}const ut=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!ut||!this.connected)||(this.connected?(this.notifyOutgoingListeners(Y),this.packet(Y)):this.sendBuffer.push(Y)),this.flags={},this}_registerAckCallback(O,L){var Y;const ut=(Y=this.flags.timeout)!==null&&Y!==void 0?Y:this._opts.ackTimeout;if(ut===void 0){this.acks[O]=L;return}const ht=this.io.setTimeoutFn(()=>{delete this.acks[O];for(let _=0;_<this.sendBuffer.length;_++)this.sendBuffer[_].id===O&&this.sendBuffer.splice(_,1);L.call(this,new Error("operation has timed out"))},ut),W=(..._)=>{this.io.clearTimeoutFn(ht),L.apply(this,_)};W.withError=!0,this.acks[O]=W}emitWithAck(O,...L){return new Promise((Y,ut)=>{const ht=(W,_)=>W?ut(W):Y(_);ht.withError=!0,L.push(ht),this.emit(O,...L)})}_addToQueue(O){let L;typeof O[O.length-1]=="function"&&(L=O.pop());const Y={id:this._queueSeq++,tryCount:0,pending:!1,args:O,flags:Object.assign({fromQueue:!0},this.flags)};O.push((ut,...ht)=>Y!==this._queue[0]?void 0:(ut!==null?Y.tryCount>this._opts.retries&&(this._queue.shift(),L&&L(ut)):(this._queue.shift(),L&&L(null,...ht)),Y.pending=!1,this._drainQueue())),this._queue.push(Y),this._drainQueue()}_drainQueue(O=!1){if(!this.connected||this._queue.length===0)return;const L=this._queue[0];L.pending&&!O||(L.pending=!0,L.tryCount++,this.flags=L.flags,this.emit.apply(this,L.args))}packet(O){O.nsp=this.nsp,this.io._packet(O)}onopen(){typeof this.auth=="function"?this.auth(O=>{this._sendConnectPacket(O)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(O){this.packet({type:ti.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},O):O})}onerror(O){this.connected||this.emitReserved("connect_error",O)}onclose(O,L){this.connected=!1,delete this.id,this.emitReserved("disconnect",O,L),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(O=>{if(!this.sendBuffer.some(Y=>String(Y.id)===O)){const Y=this.acks[O];delete this.acks[O],Y.withError&&Y.call(this,new Error("socket has been disconnected"))}})}onpacket(O){if(O.nsp===this.nsp)switch(O.type){case ti.CONNECT:O.data&&O.data.sid?this.onconnect(O.data.sid,O.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ti.EVENT:case ti.BINARY_EVENT:this.onevent(O);break;case ti.ACK:case ti.BINARY_ACK:this.onack(O);break;case ti.DISCONNECT:this.ondisconnect();break;case ti.CONNECT_ERROR:this.destroy();const Y=new Error(O.data.message);Y.data=O.data.data,this.emitReserved("connect_error",Y);break}}onevent(O){const L=O.data||[];O.id!=null&&L.push(this.ack(O.id)),this.connected?this.emitEvent(L):this.receiveBuffer.push(Object.freeze(L))}emitEvent(O){if(this._anyListeners&&this._anyListeners.length){const L=this._anyListeners.slice();for(const Y of L)Y.apply(this,O)}super.emit.apply(this,O),this._pid&&O.length&&typeof O[O.length-1]=="string"&&(this._lastOffset=O[O.length-1])}ack(O){const L=this;let Y=!1;return function(...ut){Y||(Y=!0,L.packet({type:ti.ACK,id:O,data:ut}))}}onack(O){const L=this.acks[O.id];typeof L=="function"&&(delete this.acks[O.id],L.withError&&O.data.unshift(null),L.apply(this,O.data))}onconnect(O,L){this.id=O,this.recovered=L&&this._pid===L,this._pid=L,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(O=>this.emitEvent(O)),this.receiveBuffer=[],this.sendBuffer.forEach(O=>{this.notifyOutgoingListeners(O),this.packet(O)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(O=>O()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ti.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(O){return this.flags.compress=O,this}get volatile(){return this.flags.volatile=!0,this}timeout(O){return this.flags.timeout=O,this}onAny(O){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(O),this}prependAny(O){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(O),this}offAny(O){if(!this._anyListeners)return this;if(O){const L=this._anyListeners;for(let Y=0;Y<L.length;Y++)if(O===L[Y])return L.splice(Y,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(O){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(O),this}prependAnyOutgoing(O){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(O),this}offAnyOutgoing(O){if(!this._anyOutgoingListeners)return this;if(O){const L=this._anyOutgoingListeners;for(let Y=0;Y<L.length;Y++)if(O===L[Y])return L.splice(Y,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(O){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const L=this._anyOutgoingListeners.slice();for(const Y of L)Y.apply(this,O.data)}}}function wn(K){K=K||{},this.ms=K.min||100,this.max=K.max||1e4,this.factor=K.factor||2,this.jitter=K.jitter>0&&K.jitter<=1?K.jitter:0,this.attempts=0}wn.prototype.duration=function(){var K=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var O=Math.random(),L=Math.floor(O*this.jitter*K);K=Math.floor(O*10)&1?K+L:K-L}return Math.min(K,this.max)|0},wn.prototype.reset=function(){this.attempts=0},wn.prototype.setMin=function(K){this.ms=K},wn.prototype.setMax=function(K){this.max=K},wn.prototype.setJitter=function(K){this.jitter=K};class us extends Bi{constructor(O,L){var Y;super(),this.nsps={},this.subs=[],O&&typeof O=="object"&&(L=O,O=void 0),L=L||{},L.path=L.path||"/socket.io",this.opts=L,vo(this,L),this.reconnection(L.reconnection!==!1),this.reconnectionAttempts(L.reconnectionAttempts||1/0),this.reconnectionDelay(L.reconnectionDelay||1e3),this.reconnectionDelayMax(L.reconnectionDelayMax||5e3),this.randomizationFactor((Y=L.randomizationFactor)!==null&&Y!==void 0?Y:.5),this.backoff=new wn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(L.timeout==null?2e4:L.timeout),this._readyState="closed",this.uri=O;const ut=L.parser||hd;this.encoder=new ut.Encoder,this.decoder=new ut.Decoder,this._autoConnect=L.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(O){return arguments.length?(this._reconnection=!!O,this):this._reconnection}reconnectionAttempts(O){return O===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=O,this)}reconnectionDelay(O){var L;return O===void 0?this._reconnectionDelay:(this._reconnectionDelay=O,(L=this.backoff)===null||L===void 0||L.setMin(O),this)}randomizationFactor(O){var L;return O===void 0?this._randomizationFactor:(this._randomizationFactor=O,(L=this.backoff)===null||L===void 0||L.setJitter(O),this)}reconnectionDelayMax(O){var L;return O===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=O,(L=this.backoff)===null||L===void 0||L.setMax(O),this)}timeout(O){return arguments.length?(this._timeout=O,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(O){if(~this._readyState.indexOf("open"))return this;this.engine=new Cc(this.uri,this.opts);const L=this.engine,Y=this;this._readyState="opening",this.skipReconnect=!1;const ut=yr(L,"open",function(){Y.onopen(),O&&O()}),ht=_=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",_),O?O(_):this.maybeReconnectOnOpen()},W=yr(L,"error",ht);if(this._timeout!==!1){const _=this._timeout,y=this.setTimeoutFn(()=>{ut(),ht(new Error("timeout")),L.close()},_);this.opts.autoUnref&&y.unref(),this.subs.push(()=>{this.clearTimeoutFn(y)})}return this.subs.push(ut),this.subs.push(W),this}connect(O){return this.open(O)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const O=this.engine;this.subs.push(yr(O,"ping",this.onping.bind(this)),yr(O,"data",this.ondata.bind(this)),yr(O,"error",this.onerror.bind(this)),yr(O,"close",this.onclose.bind(this)),yr(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(O){try{this.decoder.add(O)}catch(L){this.onclose("parse error",L)}}ondecoded(O){is(()=>{this.emitReserved("packet",O)},this.setTimeoutFn)}onerror(O){this.emitReserved("error",O)}socket(O,L){let Y=this.nsps[O];return Y?this._autoConnect&&!Y.active&&Y.connect():(Y=new Dc(this,O,L),this.nsps[O]=Y),Y}_destroy(O){const L=Object.keys(this.nsps);for(const Y of L)if(this.nsps[Y].active)return;this._close()}_packet(O){const L=this.encoder.encode(O);for(let Y=0;Y<L.length;Y++)this.engine.write(L[Y],O.options)}cleanup(){this.subs.forEach(O=>O()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(O,L){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",O,L),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const O=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const L=this.backoff.duration();this._reconnecting=!0;const Y=this.setTimeoutFn(()=>{O.skipReconnect||(this.emitReserved("reconnect_attempt",O.backoff.attempts),!O.skipReconnect&&O.open(ut=>{ut?(O._reconnecting=!1,O.reconnect(),this.emitReserved("reconnect_error",ut)):O.onreconnect()}))},L);this.opts.autoUnref&&Y.unref(),this.subs.push(()=>{this.clearTimeoutFn(Y)})}}onreconnect(){const O=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",O)}}const Pn={};function Mo(K,O){typeof K=="object"&&(O=K,K=void 0),O=O||{};const L=td(K,O.path||"/socket.io"),Y=L.source,ut=L.id,ht=L.path,W=Pn[ut]&&ht in Pn[ut].nsps,_=O.forceNew||O["force new connection"]||O.multiplex===!1||W;let y;return _?y=new us(Y,O):(Pn[ut]||(Pn[ut]=new us(Y,O)),y=Pn[ut]),L.query&&!O.query&&(O.query=L.queryKey),y.socket(L.path,O)}Object.assign(Mo,{Manager:us,Socket:Dc,io:Mo,connect:Mo});var nn;(function(K){K[K.Normal=0]="Normal",K[K.Debug=1]="Debug"})(nn||(nn={}));let xo;const pd=new Uint8Array(16);function dd(){if(!xo&&(xo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!xo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return xo(pd)}const Li=[];for(let K=0;K<256;++K)Li.push((K+256).toString(16).slice(1));function md(K,O=0){return Li[K[O+0]]+Li[K[O+1]]+Li[K[O+2]]+Li[K[O+3]]+"-"+Li[K[O+4]]+Li[K[O+5]]+"-"+Li[K[O+6]]+Li[K[O+7]]+"-"+Li[K[O+8]]+Li[K[O+9]]+"-"+Li[K[O+10]]+Li[K[O+11]]+Li[K[O+12]]+Li[K[O+13]]+Li[K[O+14]]+Li[K[O+15]]}const Uc={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function qc(K,O,L){if(Uc.randomUUID&&!O&&!K)return Uc.randomUUID();K=K||{};const Y=K.random||(K.rng||dd)();if(Y[6]=Y[6]&15|64,Y[8]=Y[8]&63|128,O){L=L||0;for(let ut=0;ut<16;++ut)O[L+ut]=Y[ut];return O}return md(Y)}const on=new Ci("[EventBus] ");class Fc{constructor(O=!1){Object.defineProperty(this,"eventListenerMap",{enumerable:!0,configurable:!0,writable:!0,value:{}}),O&&on.disable()}getEventListenerMap(){return Object.assign({},this.eventListenerMap)}on(O,L,Y=!1){this.eventListenerMap[O]||(this.eventListenerMap[O]=[]),Y?this.eventListenerMap[O].push({fn:L,once:!0}):this.eventListenerMap[O].push(L),on.log(`add event ${O} listener ${Y?", call once":""}`)}once(O,L){this.on(O,L,!0)}off(O,L){if(this.eventListenerMap[O]){const Y=this.eventListenerMap[O].findIndex(ut=>{if(typeof ut=="function"&&L===ut)return!0;if(ut=ut,ut.fn===L)return!0});Y<0?on.log(`event ${O} listener ${L.name} is not found`):(this.eventListenerMap[O].splice(Y,1),on.log(`remove event ${O} listener`))}else on.log(`event ${O} listeners is empty`)}emit(O,L){if(!this.eventListenerMap[O]){on.log(`event ${O} listeners is empty`);return}const Y=[];for(let ut=0;ut<this.eventListenerMap[O].length;ut++){const ht=this.eventListenerMap[O][ut];typeof ht=="function"?ht(L):Y.push(ht)}Y.forEach(ut=>{ut&&(ut.fn(L),this.off(O,ut.fn))}),on.log(`event ${O} is fired, has ${this.eventListenerMap[O].length} listeners`)}removeAllListeners(){this.eventListenerMap={}}}var _o;(function(K){K[K.enable=1]="enable",K[K.disable=2]="disable"})(_o||(_o={}));const zi=new Ci("[Session] ");var $i;(function(K){K.DataRequestFailed="data request error",K.SocketConnectionFailed="socket error",K.IdUndefined="session id is not defined",K.SendingEmptyContent="failed at sending empty content",K.Frozen="session is frozen",K.UserModeError="failed at setting socket user mode",K.Inactive="session is inactive"})($i||($i={})),$i.IdUndefined+"",$i.SendingEmptyContent+"",$i.Frozen+"";class cs{constructor(O,L="",Y,ut,ht,W){Object.defineProperty(this,"token",{enumerable:!0,configurable:!0,writable:!0,value:O}),Object.defineProperty(this,"lazyload",{enumerable:!0,configurable:!0,writable:!0,value:ut}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_frozen",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"inactivating",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_ready",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:new Fc}),Object.defineProperty(this,"_applicationId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_application",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"messages",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_loadingMessages",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_loadingMessagesSize",{enumerable:!0,configurable:!0,writable:!0,value:10}),Object.defineProperty(this,"cvforceApi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"socket",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_promptVariables",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"active",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"activing",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_stopAnswer",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataLoading",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_dataLoaded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),this.client=W||null,this._applicationId=oo(O).rid||Mi.configuration.applicationId,this.cvforceApi=this.getService(),ht&&(this._application=ht),this.event.emit("init",{applicationId:this._applicationId,sessionId:L}),this.loadApplicationInfo().then(()=>{var _;if(L)this._id=L,this.event.emit("data:loading"),Y?(this.data=Y,ut||(this._dataLoading=!0,this.cvforceApi.getSession(this.applicationId,L).then(y=>Le(this,void 0,void 0,function*(){this.data=y,this._promptVariables=yield this.cvforceApi.getApplicationIdSessionIdPromptVariables(this.applicationId,L)})).then(()=>Le(this,void 0,void 0,function*(){this.messages=[],yield this.fetchMessages(),this.event.emit("data:loaded",this.data),this.event.emit("data:updated",this.data)})))):(this._dataLoading=!0,this.cvforceApi.getSession(this.applicationId,L).then(y=>Le(this,void 0,void 0,function*(){this.data=y,this._promptVariables=yield this.cvforceApi.getApplicationIdSessionIdPromptVariables(this.applicationId,L)})).then(()=>Le(this,void 0,void 0,function*(){this.messages=[],yield this.fetchMessages(),this.event.emit("data:loaded",this.data),this.event.emit("data:updated",this.data),this._dataLoading=!1,this._dataLoaded=!0})));else{const y=(Y==null?void 0:Y.name)||"新建会话";this.event.emit("data:creating",{applicationId:this._applicationId,name:y}),this.event.emit("data:loading"),this.cvforceApi.postSession(this.applicationId,{name:y,netOpen:Y==null?void 0:Y.netOpen,knowledgeList:(_=Y==null?void 0:Y.knowledges)===null||_===void 0?void 0:_.map(x=>x.id),applicationId:this._applicationId}).then(x=>Le(this,void 0,void 0,function*(){this._id=x.id,this.data=x,this._promptVariables=yield this.cvforceApi.getApplicationIdSessionIdPromptVariables(this.applicationId,this._id),yield(()=>{if(Y!=null&&Y.knowledges)return this.setKnowledges((Y==null?void 0:Y.knowledges)||void 0)})(),yield(()=>{if(Y!=null&&Y.promptVariables){const v=this._promptVariables.map(m=>{var S,a;const p=((a=(S=Y.promptVariables)===null||S===void 0?void 0:S.find(c=>c.key===m.key))===null||a===void 0?void 0:a.value)||"";return Object.assign(Object.assign({},m),{value:p})}).sort((m,S)=>m.key.localeCompare(S.key));return this.setPromptVariables(v||[])}else return})(),this.event.emit("data:created",this.data),this.event.emit("data:loaded",this.data),this.event.emit("data:updated",this.data),this._ready=!0,this.event.emit("ready")}))}})}fetchData(){return Le(this,void 0,void 0,function*(){if(!this.data)throw Error("session data is not loaded");return yield this.cvforceApi.getSession(this.applicationId,this.data.id).then(O=>Le(this,void 0,void 0,function*(){return this.data=O,this.event.emit("data:updated",this.data),O}))})}get id(){var O;return this._id||((O=this.data)===null||O===void 0?void 0:O.id)||""}get applicationId(){return this._applicationId}get application(){return this._application}loadApplicationInfo(){if(this._application)return Promise.resolve(this._application);if(this._applicationId&&!this._application)return this.event.emit("application:data:loading"),this.cvforceApi.getApplicationId(this._applicationId).then(O=>(this._application=O,this.event.emit("application:data:loaded",O),O));throw Error("application id is not defined")}get ready(){return this._ready}get frozen(){return this._frozen}set frozen(O){O===!1&&this.inactivating&&this.socket&&(this.socket.disconnect(),this.socket=null,this.event.emit("inactivated")),this._frozen=O,this.event.emit("frozen",O)}get knowledges(){if(!this.data)throw Error("session data is not loaded");return this.data.knowledges||void 0}setKnowledges(O){return Le(this,void 0,void 0,function*(){var L;if(((L=this._application)===null||L===void 0?void 0:L.type)===bn.Agent){console.warn("Agent Application Sessions are disabled to setKnowledges.");return}if(!this.data)throw Error("session data is not loaded");return yield this.cvforceApi.patchSessionsId(this._applicationId,this.data.id,{knowledges:O}),this.data.knowledges=O,this.event.emit("data:updated",this.data),this.event.emit("data:updated:knowledges",{knowledges:O}),O})}validateConfigs(){if(!this._id)throw Error("session id is not defined");if(!this.data)throw Error("session data is not loaded");const O=this.promptVariables.filter(L=>L.status===pc.Quoted).filter(L=>!L.value);if(O.length)throw Error(`在提示词中被引用的变量值不能为空, 请检查以下变量: ${O.map(L=>L.key).join(", ")}`)}get promptVariables(){return this._promptVariables.filter(O=>O.key!=="query")}setPromptVariables(O){return Le(this,void 0,void 0,function*(){var L;if(((L=this._application)===null||L===void 0?void 0:L.type)===bn.Agent){console.warn("Agent Application Sessions are disabled to setPromptVariables.");return}const Y=this._promptVariables.map(ut=>{var ht;const W=((ht=O==null?void 0:O.find(_=>_.key===ut.key))===null||ht===void 0?void 0:ht.value)||ut.value;return Object.assign(Object.assign({},ut),{value:W})}).sort((ut,ht)=>ut.key.localeCompare(ht.key));if(yield Promise.all(Y.filter(ut=>ut.key!=="query").map(ut=>{if(!this.data)throw Error("session data is not loaded");if(!(!ut.id||!ut.key))return this.cvforceApi.patchApplicationIdSessionpromptVariablesId(this._applicationId,this.data.id,ut.id,{value:ut.value}).catch(console.error)})),!this.data)throw Error("session data is not loaded");return this._promptVariables=yield this.cvforceApi.getApplicationIdSessionIdPromptVariables(this.applicationId,this.data.id),this.event.emit("data:updated",this.data),this.event.emit("data:updated:promptVariables",{promptVariables:this._promptVariables}),this._promptVariables})}get netOpen(){if(!this.data)throw Error("session data is not loaded");return this.data.netOpen||!1}setNetOpen(O){return Le(this,void 0,void 0,function*(){var L,Y,ut;if(zi.log("setNetOpen:",O),zi.log("application arrange setting value: ",(L=this._application)===null||L===void 0?void 0:L.arrange[0].enableNetOpen),((Y=this._application)===null||Y===void 0?void 0:Y.type)===bn.Agent){console.warn("Agent Application Sessions are disabled to setNetOpen.");return}if(((ut=this._application)===null||ut===void 0?void 0:ut.arrange[0].enableNetOpen)===!1){console.warn("This Application is disabled to change netOpen.");return}if(!this.data)throw Error("session data is not loaded");return yield this.cvforceApi.patchSessionsId(this._applicationId,this.data.id,{netOpen:O?_o.enable:_o.disable}),this.data.netOpen=O,zi.log("data:updated",this.data),this.event.emit("data:updated",this.data),this.event.emit("data:updated:netOpen",{netOpen:O}),O})}getService(){return dc(Mi.configuration.apiRoot,this.token,(O,L)=>{const Y=new Error($i.DataRequestFailed);zi.error(Y),this.event.emit("error",Y)})}addEventListener(O,L,Y=!1){if(typeof L!="function")throw Error("event listener is not a function");if(Y){this.event.once(O,L);return}this.event.on(O,L)}removeEventListener(O,L){this.event.off(O,L)}fetchMessages(){return Le(this,arguments,void 0,function*(O={}){var L,Y;const ut={pageSize:this._loadingMessagesSize};if(this._id){O=Object.assign(Object.assign({},ut),O),this.event.emit("history:loading"),zi.log("history:loading"),(O.endTime||O.startTime)&&(this.event.emit("history:moreloading",O),zi.log("history:moreloading",O)),this._loadingMessages=!0;const ht=yield this.cvforceApi.getChatHistorySessionId(this._applicationId,this._id,O),W=ht.map((y,x)=>{var v,m;let S=[],a;return typeof((v=y.agentHistoryList)===null||v===void 0?void 0:v.agentList)=="string"&&(S=JSON.parse(y.agentHistoryList.agentList).reduce((c,l)=>(c[l.data.step-1]||(c[l.data.step-1]=[]),c[l.data.step-1].push(l),c),[])),x===ht.length-1&&(a=(m=this.data)===null||m===void 0?void 0:m.lastRelatedQuestion),Object.assign(Object.assign({},y),{actions:S,relatedQuesion:a})});if(!O.endTime&&!O.startTime){const y=this.messages[this.messages.length-1];y&&!y.relatedQuesion&&(y.relatedQuesion=(L=this.data)===null||L===void 0?void 0:L.lastRelatedQuestion),this.messages=[...W,...this.messages]}else if(O.endTime&&!O.startTime){const y=this.messages.findIndex(x=>x.ts===O.endTime);this.messages.splice(0,y+1),this.messages=[...W,...this.messages]}else if(!O.endTime&&O.startTime){const y=this.messages.findLastIndex(x=>x.ts===O.endTime);this.messages.splice(y,this.messages.length-y-1),this.messages=[...this.messages,...W]}else{const y=this.messages.findIndex(v=>v.ts===O.endTime),x=this.messages.findLastIndex(v=>v.ts===O.endTime);this.messages.splice(y,x-y+1,...W)}const _=this.messages[this.messages.length-1];return _&&!_.relatedQuesion&&(_.relatedQuesion=(Y=this.data)===null||Y===void 0?void 0:Y.lastRelatedQuestion),this.event.emit("history:moreloaded",W),zi.log("history:loaded",this.messages),this.event.emit("history:loaded",this.messages),this._loadingMessages=!1,W}else{const ht=new Error($i.IdUndefined);return zi.error(ht),this.event.emit("error",ht),!1}})}rename(O){return Le(this,void 0,void 0,function*(){if(!this._id)throw Error("session is not created yet");if(O.trim()==="")throw Error("name is empty");return this.data=yield this.cvforceApi.patchSessionsId(this.applicationId,this._id,{name:O}),zi.log("data:updated",this.messages),this.event.emit("data:updated",this.data),this.event.emit("data:updated:name",{name:O}),!0})}pushMessage(O){return Le(this,void 0,void 0,function*(){this.messages.push(O),zi.log("history:add",O),this.event.emit("history:add",O),this.event.emit("message:new",O),this.event.emit("message:updated",O)})}reloadSessionInfo(){if(!this._id)throw Error("session is not created yet");return this._dataLoading=!0,this.cvforceApi.getSession(this.applicationId,this._id).then(O=>Le(this,void 0,void 0,function*(){if(this.data=O,!this._id)throw Error("session is not created yet");return this._promptVariables=yield this.cvforceApi.getApplicationIdSessionIdPromptVariables(this.applicationId,this._id),zi.log("data:updated",this.data),this.event.emit("data:updated",this.data),this.data})).then(()=>Le(this,void 0,void 0,function*(){return this.messages=[],yield this.fetchMessages(),this._dataLoading=!1,this._dataLoaded=!0,this.event.emit("data:loaded",this.data),this}))}reload(){return Le(this,void 0,void 0,function*(){return yield this.reloadSessionInfo(),this.socket?(this.inactivate(!0),this.activate()):(this.inactivate(!0),this.activate())})}delete(){return Le(this,void 0,void 0,function*(){if(!this.id){const O=new Error($i.IdUndefined);return zi.error(O),this.event.emit("error",O),!1}return this.event.emit("data:deleting"),yield this.cvforceApi.delSessionsId(this.applicationId,this.id),this.event.emit("data:deleted"),this.destroy()})}activate(){return Le(this,void 0,void 0,function*(){if(this.activing)return new Promise(L=>{this.addEventListener("activated",()=>{L(!0)},!0)});if(!this._id)throw Error("session is not avalible. id is undefined");this.activing=!0;const O=this._id;return this._dataLoading=!0,this._dataLoaded=!1,this.data=yield this.cvforceApi.getSession(this.applicationId,O).then(L=>Le(this,void 0,void 0,function*(){return this._promptVariables=yield this.cvforceApi.getApplicationIdSessionIdPromptVariables(this.applicationId,O),L})),this.messages.length||(this.messages=[],yield this.fetchMessages()),this.event.emit("data:loaded",this.data),this.event.emit("data:updated",this.data),this._dataLoaded=!0,this._dataLoading=!1,this.inactivating=!1,this.frozen=!0,yield this.prepareConnection(),this.event.emit("activated",this.socket),this.active=!0,this.activing=!1,this})}inactivate(O=!1){return this.socket?this._frozen?(O||(this.inactivating=!0),this.activing=!1,!0):(this.socket.close(),this.socket=null,this.event.emit("inactivated"),this.active=!1,this.activing=!1,!0):(this.activing=!1,!0)}get dataLoaded(){return this._dataLoaded}get messagesLoading(){return this._loadingMessages}send(O){return Le(this,arguments,void 0,function*(L,Y={stream:!1}){var ut;try{this.validateConfigs()}catch(a){console.error(a)}const{stream:ht=!1,referenceFirst:W=!1}=Y,_=L.uuid||qc(),y=((ut=L.text)===null||ut===void 0?void 0:ut.trim())||"",x=L.fileIds;if(!y&&!(x!=null&&x.length)){const a=new Error($i.SendingEmptyContent);return zi.error(a),this.event.emit("error",a),!1}if(!this._id){const a=new Error($i.IdUndefined);return zi.error(a),this.event.emit("error",a),!1}if(this.frozen){const a=new Error($i.Frozen);return zi.error(a),this.event.emit("error",a),!1}this.frozen=!0,this._stopAnswer=!1;const v={sessionId:this.id,role:2,content:y,messageId:_,reference:[],searchReference:[],messageTime:""},m={content:y,stream:ht,requestId:_,fileIds:x,referenceFirst:W};this.pushMessage(v),this.event.emit("question:content",y);const S=a=>Le(this,void 0,void 0,function*(){if(a.role!==vr.Robot)return;switch(this.removeEventListener("answer:finish",S),this._id&&a.content&&a.index&&a.index<0&&(this.data=yield this.cvforceApi.patchSessionsId(this.applicationId,this._id,{finialMessage:a.content}),this.event.emit("data:updated",this.data),this.event.emit("data:updated:finialMessage",{finialMessage:a.content})),yield this.fillMessageReference(a),a.code){case 11915:a.content="请您换个问题问我吧~",a.index=-1,a.isSensitive=!0,a.isLoading=!1,a.sessionId=this._id||"",this.event.emit("message:error",a);break;case 200:a.index=-1,a.isLoading=!1;break;default:a.content=a.message||"未知错误",a.isLoading=!1,a.index=-1,this.event.emit("message:error",a)}const p=yield this.getRelatedQuesion(a);a=Object.assign(Object.assign({},a),p),a.isLoading=!1;let c=this.messages[this.messages.length-1];if(c&&c.role===vr.Robot){const l=Object.assign(Object.assign({},c),a);this.messages[this.messages.length-1]=l,this.event.emit("message:updated",l)}else this.pushMessage(a);this.frozen=!1});return this.addEventListener("answer:finish",S),this.sendQuestion(m,Object.assign(Object.assign({},Y),{stream:ht,referenceFirst:W})),v})}getRelatedQuesion(O){return Le(this,void 0,void 0,function*(){var L;if(!O.content||O.isSensitive||O.code!==200)return O;this.event.emit("message:relatedQuesion:loading",O);const Y=yield this.cvforceApi.postGeneques({content:O.content}).catch(W=>null);if(!Y){const W=[],_=Object.assign(Object.assign({},O),{relatedQuesion:W,index:-3,isLoading:!1});return this.event.emit("message:relatedQuesion:loaded",{relatedQuesion:W}),_}const ut=(L=Y.content)===null||L===void 0?void 0:L.split("*").map(uf).map(cf).filter(W=>!!W);O.relatedQuesion=ut,O.index=-3,O.isLoading=!1;const ht=Object.assign(Object.assign({},O),{relatedQuesion:ut,index:-3,isLoading:!1});return this.event.emit("message:relatedQuesion:loaded",ht),this._id&&this.cvforceApi.patchSessionsId(this._applicationId,this._id,{lastRelatedQuestion:ut}),ht})}fillMessageReference(O){return Le(this,void 0,void 0,function*(){var L;return(L=O.reference)===null||L===void 0||L.forEach((Y,ut)=>Le(this,void 0,void 0,function*(){const ht=yield this.cvforceApi.getKnowledgeIdFileId(Y.knowledgeId,Y.docId);O.reference[ut]=Object.assign(Object.assign({},Y),ht)})),O})}answerAgain(){return Le(this,arguments,void 0,function*(O={stream:!1}){const L=this.messages[this.messages.length-1];if(!L)throw Error("message list is empty");this.frozen=!0,this._stopAnswer=!1;const{stream:Y=!1}=O;let ut;L.role!==vr.User&&(ut=O.oldMessageId||L.messageId,this.messages.splice(this.messages.length-1,1),this.event.emit("message:remove",L),this.event.emit("history:remove",L));const ht=this.messages[this.messages.length-1],W={content:ht.content,fileIds:ht.fileIds,requestId:ht.messageId,stream:Y,oldMessageId:ut},_=y=>Le(this,void 0,void 0,function*(){if(y.role===vr.Robot&&y.index===-1){switch(this._id&&y.content&&y.index&&y.index<0&&(this.data=yield this.cvforceApi.patchSessionsId(this.applicationId,this._id,{finialMessage:y.content}),this.event.emit("data:updated",this.data),this.event.emit("data:updated:finialMessage",{finialMessage:y.content})),yield this.fillMessageReference(y),y.code){case 11915:y.content="请您换个问题问我吧~",y.index=-1,y.isSensitive=!0,y.isLoading=!1,y.sessionId=this._id||"",this.event.emit("message:error",y);break;case 200:y.index=-1,y.isLoading=!1;break;default:y.content=y.message||"未知错误",y.isLoading=!1,y.index=-1,this.event.emit("message:error",y)}const x=yield this.getRelatedQuesion(y);this.event.emit("message:updated",x),this.removeEventListener("message:content",_),this.frozen=!1}});this.addEventListener("message:content",_),this.sendQuestion(W,Object.assign(Object.assign({},O),{stream:Y}))})}setTop(O){return Le(this,void 0,void 0,function*(){if(!this._id)throw Error("session is not avalible. id is undefined");this.data=yield this.cvforceApi.patchSessionsId(this._applicationId,this._id,{top:O}),this.event.emit("data:updated",this.data),this.event.emit("data:updated:top",{top:O})})}suspend(){var O;this.stopAnswer(),this.frozen=!1,this._stopAnswer=!0;let L=this.messages[this.messages.length-1];const Y={messageId:qc(),isLoading:!1,index:-2,messageTime:hc(new Date).format("YYYY-MM-DD HH:ss:mm"),content:"",role:vr.System,sessionId:this.id||"",reference:[],searchReference:[]};if(L&&!L.messageId){if(L.index===-2)return;if(L.actions){const ut=L.actions[((O=L.actions)===null||O===void 0?void 0:O.length)-1];if(ut){const ht=ut[ut.length-1];if(ht&&(ht.type==="BEFORE_CALL"||ht.type==="FUNCTION_CALL")){const{pluginName:W,pluginCode:_,funcCode:y,funcName:x}=ht.data;ut.push({data:{pluginName:W,pluginCode:_,funcCode:y,funcName:x,step:ht.data.step+1},type:"ABORT"}),this.event.emit("message:action",{messageId:L.messageId,action:ut})}}}L=Object.assign(Object.assign({},L),Y),this.event.emit("message:content",L),this.event.emit("message:updated",L)}else this.pushMessage(Y),this.event.emit("message:content",Y);return this}postMessageComment(O){return Le(this,void 0,void 0,function*(){if(!this._applicationId||!this._id)throw Error("session is not avalible. id is undefined");return this.cvforceApi.postComments(this._applicationId,this._id,O).then(L=>{const Y=this.messages.find(ut=>ut.messageId===O.messageId);return Y&&(Y.comment=O,this.event.emit("message:comment",Y)),L})})}clear(){if(!this._id)throw Error("session is not avalible. id is undefined");return this.cvforceApi.patchApplicationIdSessionsIdContext(this._applicationId,this._id).then(()=>(this.event.emit("context:clear"),!0))}destroy(){var O;return this._ready=!1,this.event.removeAllListeners(),(O=this.socket)===null||O===void 0||O.disconnect(),this.socket=null,this.event.emit("destroy",{applicationId:this._applicationId,sessionId:this._id}),this._id||""}}const $r=new Ci("[AgentSession] ");class gd extends cs{constructor(O,L="",Y,ut,ht,W){super(O,L,Y,ut,ht,W)}prepareConnection(){return new Promise(O=>Le(this,void 0,void 0,function*(){this.socket&&O(!0);const L={version:"1.0",stream:"false",appId:this._applicationId,sessionId:this.id,Authorization:`${this.token}`,userMode:Mi.configuration.debug?nn.Debug:nn.Normal},Y=new URL(Mi.configuration.apiRoot),ut=yield Mo(Y.origin,{path:Y.pathname.replace("api","socketio")+"/copilot",query:L,transports:["websocket"]});ut.on("connect",()=>{$r.log("socket:connect"),this.event.emit("socket:connect"),ut.emit("init")}),ut.on("disconnect",()=>{$r.log("socket:disconnect"),this.event.emit("socket:disconnect")}),ut.on("ready",ht=>{if(ht.code===200){$r.log("ready");const W=Mi.configuration.debug?nn.Debug:nn.Normal;W===nn.Debug&&ht.userMode,this._ready||(this._ready=!0,this.event.emit("ready")),this.frozen=!1,O(!0)}else{this._ready&&(this._ready=!1);const W=new Error($i.SocketConnectionFailed);$r.error("error",W),this.event.emit("error",W),O(!1)}}),ut.on("action",(ht,W)=>Le(this,void 0,void 0,function*(){if(this._stopAnswer||!this.id)return;const{type:_,data:{runnerIsClient:y,pluginCode:x,funcCode:v,parameters:m,requestBody:S}}=ht,a=this.messages[this.messages.length-1];if(!a.messageId)a.actions||(a.actions=[]),a.actions[ht.data.step-1]||(a.actions[ht.data.step-1]=[]),a.actions[ht.data.step-1].push(ht),this.event.emit("message:action",{messageId:a.messageId,action:ht}),this.event.emit("message:updated",a);else{const p={messageId:"",content:"",role:vr.Robot,sessionId:this.id,reference:[],searchReference:[],isLoading:!0,messageTime:"",actions:[[ht]],comment:{isAgree:0}};this.pushMessage(p),this.event.emit("message:action",{messageId:p.messageId,action:ht})}if(this.inactivating){const p=new Error($i.Inactive);$r.warn("error",p),this.event.emit("error",p)}else if(_==="FUNCTION_CALL"&&y){if($r.log(`calling function ${v} of plugin ${x} with argument:
|
|
138
138
|
${JSON.stringify(m)}`),!Mi.configuration.plugins[x]){W({code:404,message:"对不起,没有找到插件。"});return}const p=Mi.configuration.plugins[x][v];typeof p!="function"&&W({code:404,message:"对不起,没有找到插件方法。"});let c=m==null?void 0:m.query;try{c=JSON.parse(m==null?void 0:m.query)}catch{}p(c,(...l)=>{this._stopAnswer||W(...l)})}})),ut.on("answer",ht=>{if(!this._stopAnswer)if(ht.data.code!==200&&(ht.data.index=-1,this.event.emit("error",ht.data)),ht.data.index===-1){let W=this.messages[this.messages.length-1];if(W&&!W.messageId)W=Object.assign(Object.assign({},W),ht.data),this.event.emit("message:content",W),this.event.emit("message:updated",W),this.event.emit("answer:finish",W);else{const _=Object.assign({messageId:"",content:"",role:vr.Robot,sessionId:this.id,reference:[],searchReference:[],isLoading:!1,messageTime:"",actions:[],comment:{isAgree:0}},ht.data);this.event.emit("message:content",_),this.pushMessage(_),this.event.emit("answer:finish",_)}}else{let W=this.messages[this.messages.length-1];W&&!W.messageId?(W=Object.assign(Object.assign({},W),ht.data),this.messages[this.messages.length-1]=W,this.event.emit("message:content",W),this.event.emit("message:updated",W)):(this.pushMessage(ht.data),this.event.emit("message:content",ht.data))}}),ut.on("reference",ht=>Le(this,void 0,void 0,function*(){if(this._stopAnswer)return;if(!this.id){const m=new Error($i.IdUndefined);$r.error(m),this.event.emit("error",m),this.frozen=!1;return}const{type:W,data:_,requestId:y}=ht,x=this.messages.findIndex(m=>m.messageId===y&&m.role===vr.User);if(x<0)return;const v=x+1;if(v>=this.messages.length){const m={messageId:"",content:"",role:vr.Robot,sessionId:this.id,reference:[],searchReference:[],isLoading:!0,messageTime:"",actions:[],comment:{isAgree:0}};this.pushMessage(m)}W==="KG"?(this.messages[v]=Object.assign(Object.assign({},this.messages[v]),{reference:_.knowledgeReference}),yield this.fillMessageReference(this.messages[v]),this.event.emit("message:reference",_.knowledgeReference),this.event.emit("message:updated",this.messages[v])):W==="WEB_SEARCH"&&(this.messages[v]=Object.assign(Object.assign({},this.messages[v]),{searchReference:_.knowledgeReference}),this.event.emit("message:searchreference",_.searchReference),this.event.emit("message:updated",this.messages[v]))})),this.socket=ut,ut.open()}))}sendQuestion(O,L){return Le(this,void 0,void 0,function*(){var Y,ut;if(!this.active){if(yield this.activate(),!this.socket){const ht=new Error($i.SocketConnectionFailed);return $r.warn("error",ht),this.event.emit("error",ht),!1}(Y=this.socket)===null||Y===void 0||Y.emit("question",O);return}(ut=this.socket)===null||ut===void 0||ut.emit("question",O)})}stopAnswer(){var O;(O=this.socket)===null||O===void 0||O.emit("stop_answer")}}function vd(K,O){return Le(this,void 0,void 0,function*(){const L=K.getReader();let Y;for(;!(Y=yield L.read()).done;)O(Y.value)})}var br;(function(K){K[K.NewLine=10]="NewLine",K[K.CarriageReturn=13]="CarriageReturn",K[K.Space=32]="Space",K[K.Colon=58]="Colon"})(br||(br={}));function yd(K){let O,L,Y,ut=!1,ht;return function(_){O===void 0?(O=_,L=0,Y=-1,ht=!1):O=wd(O,_);const y=O.length;let x=0;for(;L<y;){ut&&(O[L]===br.NewLine&&(x=++L),ut=!1);let v=-1;for(;L<y&&v===-1;++L)switch(O[L]){case br.Colon:Y===-1&&(Y=L-x);break;case br.CarriageReturn:ut=!1,L+4<y&&O[L+1]===br.NewLine&&O[L+2]!==br.CarriageReturn&&O[L-1]!==br.NewLine&&O[L-2]!==br.CarriageReturn&&(ht=!0);case br.NewLine:v=L;break}if(v===-1)break;K(O.subarray(x,v),Y,ht),x=L,Y=-1,ht=!1}x===y?O=void 0:x!==0&&(O=O.subarray(x),L-=x)}}function bd(K,O,L){let Y=zc();const ut=new TextDecoder;return function(W,_,y){if(W.length===0)L==null||L(Y),Y=zc();else if(_>0){const x=ut.decode(W.subarray(0,_)),v=_+(W[_+1]===br.Space?2:1);let m=ut.decode(W.subarray(v));switch(y&&(m+=`
|
|
139
139
|
`),x){case"data":Y.data=Y.data?Y.data+`
|
|
140
|
-
`+m:m;break;case"event":Y.event=m;break;case"id":K(Y.id=m);break;case"retry":const S=parseInt(m,10);isNaN(S)||O(Y.retry=S);break}}}}function wd(K,O){const L=new Uint8Array(K.length+O.length);return L.set(K),L.set(O,K.length),L}function zc(){return{data:"",event:"",id:"",retry:void 0}}const ls="text/event-stream",Md=1e3,$c="last-event-id";function Hc(K,O){var{signal:L,headers:Y,onopen:ut,onmessage:ht,onclose:W,onerror:_,openWhenHidden:y,fetch:x}=O,v=Kh(O,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((m,S)=>{const a=Object.assign({},Y);a.accept||(a.accept=ls);let p;function c(){p.abort(),document.hidden||w()}y||document.addEventListener("visibilitychange",c);let l=Md,f=0;function g(){document.removeEventListener("visibilitychange",c),window.clearTimeout(f),p.abort()}L==null||L.addEventListener("abort",()=>{g(),m()});const h=x??window.fetch,u=ut??xd;function w(){return Le(this,void 0,void 0,function*(){var b;p=new AbortController;try{const E=yield h(K,Object.assign(Object.assign({},v),{headers:a,signal:p.signal}));yield u(E),yield vd(E.body,yd(bd(I=>{I?a[$c]=I:delete a[$c]},I=>{l=I},ht))),W==null||W(),g(),m()}catch(E){if(!p.signal.aborted)try{const I=(b=_==null?void 0:_(E))!==null&&b!==void 0?b:l;window.clearTimeout(f),f=window.setTimeout(w,I)}catch(I){g(),S(I)}}})}w()})}function xd(K){const O=K.headers.get("content-type");if(!(O!=null&&O.startsWith(ls)))throw new Error(`Expected content-type to be ${ls}, Actual: ${O}`)}const Wc=new Pi("[DialogSession] ");class _d extends cs{constructor(O,L="",Y,ut,ht,W){super(O,L,Y,ut,ht,W),Object.defineProperty(this,"ctrl",{enumerable:!0,configurable:!0,writable:!0,value:new AbortController})}prepareConnection(){return new Promise(O=>Le(this,void 0,void 0,function*(){this._ready=!0,this.event.emit("ready"),this.frozen=!1,O(!0)}))}postChatV2EventSource(O,L,Y,ut,ht,W){return Le(this,void 0,void 0,function*(){const _={code:0,content:"",role:Wa.Robot,sessionId:L,reference:[],searchReference:[],messageTime:"",llmModel:"",comment:{isAgree:0},isReplying:!1},y=Object.assign(Object.assign({},Y),{stream:!0});Hc(`${Mi.configuration.apiRoot}/chat/v2/chat?applicationId=${O}&sessionId=${L}`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"},body:JSON.stringify(y),openWhenHidden:!0,signal:ut,onopen(x){return x.ok&&ht!=null&&ht.onopen&&ht.onopen(),Promise.resolve()},onmessage(x){if(!x.data.includes('{"code": ')){let m={};try{m=JSON.parse(x.data)}catch{}(m==null?void 0:m.mtype)==="search"?_.searchReference.push(m):_.content=_.content+x.data;const S={content:_.content,role:1,reference:_.reference,searchReference:_.searchReference,messageId:_.messageId,sessionId:L,messageTime:hc(new Date).format("YYYY-MM-DD HH:mm:ss"),comment:{isAgree:0},isReplying:!0};return(ht==null?void 0:ht.onmessage)&&ht.onmessage(S)}const v=JSON.parse(x.data);if(_.reference=v.data.reference,_.searchReference=v.data.searchReference,_.messageTime=v.data.messageTime,_.messageId=v.data.messageId,_.llmModel=v.data.llmModel,_.content=v.data.content,_.code=v.code,v.code===200){const m={code:_.code,content:_.content,role:1,reference:_.reference,searchReference:_.searchReference,messageId:_.messageId,sessionId:L,messageTime:_.messageTime,isReplying:!0};ht!=null&&ht.onmessage&&ht.onmessage(m)}else return ht!=null&&ht.onclose&&ht.onclose(_),W&&W({code:_.code,message:_.message})},onerror(){ht!=null&&ht.onerror&&ht.onerror()},onclose(){const x={code:_.code,content:_.content,role:1,reference:_.reference,searchReference:_.searchReference,messageId:_.messageId,sessionId:L,messageTime:_.messageTime,comment:{isAgree:0},isReplying:!1,index:-1};ht!=null&&ht.onclose&&ht.onclose(x)}})})}postChatV3EventSource(O,L,Y,ut,ht,W){return Le(this,void 0,void 0,function*(){const _={code:0,content:"",role:Wa.Robot,sessionId:L,reference:[],searchReference:[],messageTime:"",llmModel:"",comment:{isAgree:0},isReplying:!1,reasoningContent:"",thinkingSecs:"",thinkingStatus:""},y=Object.assign(Object.assign({},Y),{stream:!0});Hc(`${Mi.configuration.apiRoot}/chat/v3/chat?applicationId=${O}&sessionId=${L}`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"},body:JSON.stringify(y),openWhenHidden:!0,signal:ut,onopen(x){return x.ok&&ht!=null&&ht.onopen&&ht.onopen(),Promise.resolve()},onmessage(x){if(!x.data&&!x.event&&!x.id&&!x.retry)return;let v={};try{v=JSON.parse(x.data)}catch{console.error("parse eventData to JSON failed. ",x.data)}if(v.code!==200)return _.index=-1,_.code=v.code,_.message=v.message,ht!=null&&ht.onmessage&&ht.onmessage(_),W&&W({code:v.code,message:v.message});const m=v.data.type,S=v.data.payload;if(_.isReplying=!0,m==="search"&&_.searchReference.push(S),m==="thinking"){_.thinkingStatus="start";const p=S.choices[0];_.reasoningContent=_.reasoningContent+p.delta.reasoningContent}if(m==="thinkingOver"){_.thinkingStatus="end";const a=S.thinkingSecs;_.thinkingSecs=a}if(m==="text"){const p=S.choices[0];_.content=_.content+p.delta.content}if(m==="reference"&&(_.reference=S),m==="result"){const a=S.messageId,p=S.llmModel,c=S.messageTime;_.messageId=a,_.llmModel=p,_.messageTime=c,_.sessionId=L}m==="over"?_.index=-1:(_.code=v.code,_.message=v.message),ht!=null&&ht.onmessage&&ht.onmessage(_)},onerror(){ht!=null&&ht.onerror&&ht.onerror()},onclose(){const x=Object.assign(Object.assign({},_),{isReplying:!1});ht!=null&&ht.onclose&&ht.onclose(x)}})})}sendQuestion(O,L){return Le(this,void 0,void 0,function*(){var Y;const{content:ut,fileIds:ht,oldMessageId:W}=O,{stream:_,referenceFirst:y}=L;if(this.active||(yield this.activate()),this._id){let x={content:ut,fileIds:ht,referenceFirst:y,oldMessageId:W,promptVariables:this.promptVariables.reduce((v,m)=>Object.assign(Object.assign({},v),{[m.key]:m.value}),{}),knowledges:(Y=this.knowledges)===null||Y===void 0?void 0:Y.map(v=>v.id)};this.ctrl=new AbortController,this.postChatV3EventSource(this._applicationId,this._id,x,this.ctrl.signal,{onopen:()=>{Wc.log("open",this.ctrl)},onmessage:v=>{if(this._stopAnswer)return;let m=this.messages[this.messages.length-1];m&&m.role===vr.Robot?(m=Object.assign(Object.assign({},m),v),this.messages[this.messages.length-1]=m,this.event.emit("message:content",m),this.event.emit("message:updated",m)):(this.pushMessage(v),this.event.emit("message:content",v))},onclose:v=>Le(this,void 0,void 0,function*(){this._stopAnswer||(Wc.log(v,"onclose"),this.event.emit("answer:finish",v))}),onerror:()=>{this._stopAnswer||(this.event.emit("message:error",""),this.frozen=!1)}})}})}stopAnswer(){this.ctrl.abort()}}const Sd=new Pi("[BotClient] ");class Ed{constructor(O,L,Y=!0){if(Object.defineProperty(this,"_token",{enumerable:!0,configurable:!0,writable:!0,value:O}),Object.defineProperty(this,"lazyload",{enumerable:!0,configurable:!0,writable:!0,value:Y}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:new Fc}),Object.defineProperty(this,"cvforceApi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_applicationId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_application",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_sessions",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_activeSession",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_ready",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_questionContextMaxLength",{enumerable:!0,configurable:!0,writable:!0,value:4e3}),Object.defineProperty(this,"_promptVariables",{enumerable:!0,configurable:!0,writable:!0,value:[]}),yu(L),this._applicationId=oo(O).rid||Mi.configuration.applicationId,!this._applicationId)throw"token is not vaild";this.cvforceApi=this.getService(),this.loadApplication().then(()=>{this.event.emit("ready")})}checkReady(){if(!this.ready)throw Error("client is not ready.")}get ready(){return this._ready}set ready(O){this._ready=O}get questionContextMaxLength(){return this.checkReady(),this._questionContextMaxLength}get promptVariables(){return this.checkReady(),this._promptVariables}get knowledges(){var O;return this.checkReady(),(O=this._application)===null||O===void 0?void 0:O.arrange[0].knowledges}get sessions(){return this.checkReady(),this._sessions}set sessions(O){this.checkReady(),this._sessions=O,this.event.emit("sessions:updated",O)}loadApplication(){return Le(this,void 0,void 0,function*(){var O,L;this._application=yield this.cvforceApi.getApplicationId(this._applicationId);const Y=(L=(O=this._application.arrange)===null||O===void 0?void 0:O[0])===null||L===void 0?void 0:L.llmModel;return Y&&(this._questionContextMaxLength=yield this.cvforceApi.getBaseModel(Y).then(ut=>ut.maxModelLength)),this._promptVariables=yield this.cvforceApi.getPrompts(this._applicationId),this._ready=!0,this.event.emit("application:loaded"),this._application})}getService(){return this.cvforceApi?this.cvforceApi:dc(Mi.configuration.apiRoot,this.token,(O,L)=>Sd.error(L))}get token(){return this._token}set token(O){this.checkReady(),this._token=O,this.ready=!1;const L=oo(O).rid;this._applicationId!==L&&(this._applicationId=L,this._application=null,this.loadApplication().then(()=>{this.event.emit("ready")}),this.clean())}get applicationId(){return this._applicationId}get application(){return this.checkReady(),this._application}get activeSession(){var O;return this.checkReady(),((O=this._activeSession)===null||O===void 0?void 0:O.id)||""}set activeSession(O){this.checkReady(),this.loadSession(O).then(L=>{this._activeSession&&this._activeSession.id!==O&&this._activeSession.inactivate(),this._activeSession=L})}createSession(O,L,Y,ut,ht){return Le(this,void 0,void 0,function*(){const W=this;return new Promise((_,y)=>{const x=v=>Le(this,void 0,void 0,function*(){if(v===bn.Agent)_(new gd(O,L,Y,ut,ht,W));else if(v===bn.Dialog)_(new _d(O,L,Y,ut,ht,W));else throw Error(`不支持的应用类型:${v}`)});if(this.ready){if(!this._application)throw Error("client is not ready");x(this._application.type)}else this.event.on("ready",()=>{if(!this._application)throw Error("_application is null");x(this._application.type)},!0)})})}getSessions(O){return Le(this,void 0,void 0,function*(){return new Promise((L,Y)=>{const ut=()=>this.cvforceApi.listSessions(this._applicationId,O).then(ht=>{const W=[];return ht.forEach(_=>Le(this,void 0,void 0,function*(){const y=this._sessions.find(x=>_.id===x.id);if(y)y.data=_,W.push(y);else{const x=yield this.createSession(this.token,_.id,_,this.lazyload,this._application||void 0);W.push(x)}})),this.sessions=W,W});if(this.ready){if(!this._application)throw Error("_application is null");L(ut())}else this.event.on("ready",()=>{if(!this._application)throw Error("_application is null");L(ut())},!0)})})}loadSession(){return Le(this,arguments,void 0,function*(O="",L){this.checkReady();let Y=this.sessions.find(ut=>ut.id===O);if(Y||(Y=yield this.createSession(this.token,O,L),this._sessions.push(Y)),this._activeSession){if(this._activeSession===Y)return Y;this._activeSession.inactivate()}return Y.id?(yield Y.activate(),this._activeSession=Y):Y.addEventListener("data:loaded",()=>{this._activeSession!==Y&&(Y==null||Y.activate(),this._activeSession=Y)},!0),Y})}reload(){return this.loadApplication().then(()=>Le(this,void 0,void 0,function*(){return yield this.getSessions(),this.event.emit("ready"),this}))}reloadSession(O){return Le(this,void 0,void 0,function*(){yield this.reload();let L=this._sessions.find(Y=>Y.id===O)||this._activeSession;if(!L){console.warn("reloadSession session failed.");return}return yield L.reload(),L})}setTop(O,L){return Le(this,arguments,void 0,function*(Y,ut,ht="top_time desc, sort_status desc, updated_at desc"){let W=Y?this._sessions.find(_=>_.id===Y):this._activeSession;if(!W){console.warn("setTop session failed.");return}return yield W.setTop(ut),this.getSessions({order:ht})})}addEventListener(O,L,Y=!1){if(typeof L!="function")throw Error("event listener is not a function");if(Y){this.event.once(O,L);return}this.event.on(O,L)}removeEventListener(O,L){this.event.off(O,L)}removeSession(O,L){return Le(this,void 0,void 0,function*(){this.checkReady();let Y=-1;if(typeof O=="string"?Y=this._sessions.findIndex(ut=>ut.id===O):Y=this._sessions.findIndex(ut=>ut.id===O.id),Y>-1){const ut=this._sessions[Y];L&&(yield ut.delete()),this._sessions.splice(Y,1)}else console.warn("session delete failed, session is not exist.")})}clean(){this._sessions.forEach(O=>O.destroy()),this.sessions=[]}}class kd{constructor(O,L={},Y){Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"loaded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"functions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this.code=O,L&&(this.functions=L)}fetchData(){this.description="描述",this.loaded=!0}checkFunctions(){}}Mi.AgentPlugin=kd,Mi.BotClient=Ed,Mi.Session=cs,Mi.configure=yu,Object.defineProperty(Mi,Symbol.toStringTag,{value:"Module"})});
|
|
140
|
+
`+m:m;break;case"event":Y.event=m;break;case"id":K(Y.id=m);break;case"retry":const S=parseInt(m,10);isNaN(S)||O(Y.retry=S);break}}}}function wd(K,O){const L=new Uint8Array(K.length+O.length);return L.set(K),L.set(O,K.length),L}function zc(){return{data:"",event:"",id:"",retry:void 0}}const ls="text/event-stream",Md=1e3,$c="last-event-id";function Hc(K,O){var{signal:L,headers:Y,onopen:ut,onmessage:ht,onclose:W,onerror:_,openWhenHidden:y,fetch:x}=O,v=Kh(O,["signal","headers","onopen","onmessage","onclose","onerror","openWhenHidden","fetch"]);return new Promise((m,S)=>{const a=Object.assign({},Y);a.accept||(a.accept=ls);let p;function c(){p.abort(),document.hidden||w()}y||document.addEventListener("visibilitychange",c);let l=Md,f=0;function g(){document.removeEventListener("visibilitychange",c),window.clearTimeout(f),p.abort()}L==null||L.addEventListener("abort",()=>{g(),m()});const h=x??window.fetch,u=ut??xd;function w(){return Le(this,void 0,void 0,function*(){var b;p=new AbortController;try{const E=yield h(K,Object.assign(Object.assign({},v),{headers:a,signal:p.signal}));yield u(E),yield vd(E.body,yd(bd(I=>{I?a[$c]=I:delete a[$c]},I=>{l=I},ht))),W==null||W(),g(),m()}catch(E){if(!p.signal.aborted)try{const I=(b=_==null?void 0:_(E))!==null&&b!==void 0?b:l;window.clearTimeout(f),f=window.setTimeout(w,I)}catch(I){g(),S(I)}}})}w()})}function xd(K){const O=K.headers.get("content-type");if(!(O!=null&&O.startsWith(ls)))throw new Error(`Expected content-type to be ${ls}, Actual: ${O}`)}const Wc=new Ci("[DialogSession] ");class _d extends cs{constructor(O,L="",Y,ut,ht,W){super(O,L,Y,ut,ht,W),Object.defineProperty(this,"ctrl",{enumerable:!0,configurable:!0,writable:!0,value:new AbortController})}prepareConnection(){return new Promise(O=>Le(this,void 0,void 0,function*(){this._ready=!0,this.event.emit("ready"),this.frozen=!1,O(!0)}))}postChatV2EventSource(O,L,Y,ut,ht,W){return Le(this,void 0,void 0,function*(){const _={code:0,content:"",role:Wa.Robot,sessionId:L,reference:[],searchReference:[],messageTime:"",llmModel:"",comment:{isAgree:0},isReplying:!1},y=Object.assign(Object.assign({},Y),{stream:!0});Hc(`${Mi.configuration.apiRoot}/chat/v2/chat?applicationId=${O}&sessionId=${L}`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"},body:JSON.stringify(y),openWhenHidden:!0,signal:ut,onopen(x){return x.ok&&ht!=null&&ht.onopen&&ht.onopen(),Promise.resolve()},onmessage(x){if(!x.data.includes('{"code": ')){let m={};try{m=JSON.parse(x.data)}catch{}(m==null?void 0:m.mtype)==="search"?_.searchReference.push(m):_.content=_.content+x.data;const S={content:_.content,role:1,reference:_.reference,searchReference:_.searchReference,messageId:_.messageId,sessionId:L,messageTime:hc(new Date).format("YYYY-MM-DD HH:mm:ss"),comment:{isAgree:0},isReplying:!0};return(ht==null?void 0:ht.onmessage)&&ht.onmessage(S)}const v=JSON.parse(x.data);if(_.reference=v.data.reference,_.searchReference=v.data.searchReference,_.messageTime=v.data.messageTime,_.messageId=v.data.messageId,_.llmModel=v.data.llmModel,_.content=v.data.content,_.code=v.code,v.code===200){const m={code:_.code,content:_.content,role:1,reference:_.reference,searchReference:_.searchReference,messageId:_.messageId,sessionId:L,messageTime:_.messageTime,isReplying:!0};ht!=null&&ht.onmessage&&ht.onmessage(m)}else return ht!=null&&ht.onclose&&ht.onclose(_),W&&W({code:_.code,message:_.message})},onerror(){ht!=null&&ht.onerror&&ht.onerror()},onclose(){const x={code:_.code,content:_.content,role:1,reference:_.reference,searchReference:_.searchReference,messageId:_.messageId,sessionId:L,messageTime:_.messageTime,comment:{isAgree:0},isReplying:!1,index:-1};ht!=null&&ht.onclose&&ht.onclose(x)}})})}postChatV3EventSource(O,L,Y,ut,ht,W){return Le(this,void 0,void 0,function*(){const _={code:0,content:"",role:Wa.Robot,sessionId:L,reference:[],searchReference:[],messageTime:"",llmModel:"",comment:{isAgree:0},isReplying:!1,reasoningContent:"",thinkingSecs:"",thinkingStatus:""},y=Object.assign(Object.assign({},Y),{stream:!0});Hc(`${Mi.configuration.apiRoot}/chat/v3/chat?applicationId=${O}&sessionId=${L}`,{method:"POST",headers:{Authorization:`Bearer ${this.token}`,"Content-Type":"application/json"},body:JSON.stringify(y),openWhenHidden:!0,signal:ut,onopen(x){return x.ok&&ht!=null&&ht.onopen&&ht.onopen(),Promise.resolve()},onmessage(x){if(!x.data&&!x.event&&!x.id&&!x.retry)return;let v={};try{v=JSON.parse(x.data)}catch{console.error("parse eventData to JSON failed. ",x.data)}if(v.code!==200)return _.index=-1,_.code=v.code,_.message=v.message,ht!=null&&ht.onmessage&&ht.onmessage(_),W&&W({code:v.code,message:v.message});const m=v.data.type,S=v.data.payload;if(_.isReplying=!0,m==="search"&&_.searchReference.push(S),m==="thinking"){_.thinkingStatus="start";const p=S.choices[0];_.reasoningContent=_.reasoningContent+p.delta.reasoningContent}if(m==="thinkingOver"){_.thinkingStatus="end";const a=S.thinkingSecs;_.thinkingSecs=a}if(m==="text"){const p=S.choices[0];_.content=_.content+p.delta.content}if(m==="reference"&&(_.reference=S),m==="result"){const a=S.messageId,p=S.llmModel,c=S.messageTime;_.messageId=a,_.llmModel=p,_.messageTime=c,_.sessionId=L}m==="over"?_.index=-1:(_.code=v.code,_.message=v.message),ht!=null&&ht.onmessage&&ht.onmessage(_)},onerror(){ht!=null&&ht.onerror&&ht.onerror()},onclose(){const x=Object.assign(Object.assign({},_),{isReplying:!1});ht!=null&&ht.onclose&&ht.onclose(x)}})})}sendQuestion(O,L){return Le(this,void 0,void 0,function*(){var Y;const{content:ut,fileIds:ht,oldMessageId:W}=O,{stream:_,referenceFirst:y}=L;if(this.active||(yield this.activate()),this._id){let x={content:ut,fileIds:ht,referenceFirst:y,oldMessageId:W,promptVariables:this.promptVariables.reduce((v,m)=>Object.assign(Object.assign({},v),{[m.key]:m.value}),{}),knowledges:(Y=this.knowledges)===null||Y===void 0?void 0:Y.map(v=>v.id)};this.ctrl=new AbortController,this.postChatV3EventSource(this._applicationId,this._id,x,this.ctrl.signal,{onopen:()=>{Wc.log("open",this.ctrl)},onmessage:v=>{if(this._stopAnswer)return;let m=this.messages[this.messages.length-1];m&&m.role===vr.Robot?(m=Object.assign(Object.assign({},m),v),this.messages[this.messages.length-1]=m,this.event.emit("message:content",m),this.event.emit("message:updated",m)):(this.pushMessage(v),this.event.emit("message:content",v))},onclose:v=>Le(this,void 0,void 0,function*(){this._stopAnswer||(Wc.log(v,"onclose"),this.event.emit("answer:finish",v))}),onerror:()=>{this._stopAnswer||(this.event.emit("message:error",""),this.frozen=!1)}})}})}stopAnswer(){this.ctrl.abort()}}const Sd=new Ci("[BotClient] ");class Ed{constructor(O,L,Y=!0){if(Object.defineProperty(this,"_token",{enumerable:!0,configurable:!0,writable:!0,value:O}),Object.defineProperty(this,"lazyload",{enumerable:!0,configurable:!0,writable:!0,value:Y}),Object.defineProperty(this,"event",{enumerable:!0,configurable:!0,writable:!0,value:new Fc}),Object.defineProperty(this,"cvforceApi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_applicationId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_application",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_sessions",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_activeSession",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_ready",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_questionContextMaxLength",{enumerable:!0,configurable:!0,writable:!0,value:4e3}),Object.defineProperty(this,"_promptVariables",{enumerable:!0,configurable:!0,writable:!0,value:[]}),yu(L),this._applicationId=oo(O).rid||Mi.configuration.applicationId,!this._applicationId)throw"token is not vaild";this.cvforceApi=this.getService(),this.loadApplication().then(()=>{this.event.emit("ready")})}checkReady(){if(!this.ready)throw Error("client is not ready.")}get ready(){return this._ready}set ready(O){this._ready=O}get questionContextMaxLength(){return this.checkReady(),this._questionContextMaxLength}get promptVariables(){return this.checkReady(),this._promptVariables}get knowledges(){var O;return this.checkReady(),(O=this._application)===null||O===void 0?void 0:O.arrange[0].knowledges}get sessions(){return this.checkReady(),this._sessions}set sessions(O){this.checkReady(),this._sessions=O,this.event.emit("sessions:updated",O)}loadApplication(){return Le(this,void 0,void 0,function*(){var O,L;this._application=yield this.cvforceApi.getApplicationId(this._applicationId);const Y=(L=(O=this._application.arrange)===null||O===void 0?void 0:O[0])===null||L===void 0?void 0:L.llmModel;return Y&&(this._questionContextMaxLength=yield this.cvforceApi.getBaseModel(Y).then(ut=>ut.maxModelLength)),this._promptVariables=yield this.cvforceApi.getPrompts(this._applicationId),this._ready=!0,this.event.emit("application:loaded"),this._application})}getService(){return this.cvforceApi?this.cvforceApi:dc(Mi.configuration.apiRoot,this.token,(O,L)=>Sd.error(L))}get token(){return this._token}set token(O){this.checkReady(),this._token=O,this.ready=!1;const L=oo(O).rid;this._applicationId!==L&&(this._applicationId=L,this._application=null,this.loadApplication().then(()=>{this.event.emit("ready")}),this.clean())}get applicationId(){return this._applicationId}get application(){return this.checkReady(),this._application}get activeSession(){var O;return this.checkReady(),((O=this._activeSession)===null||O===void 0?void 0:O.id)||""}set activeSession(O){this.checkReady(),this.loadSession(O).then(L=>{this._activeSession&&this._activeSession.id!==O&&this._activeSession.inactivate(),this._activeSession=L})}createSession(O,L,Y,ut,ht){return Le(this,void 0,void 0,function*(){const W=this;return new Promise((_,y)=>{const x=v=>Le(this,void 0,void 0,function*(){if(v===bn.Agent)_(new gd(O,L,Y,ut,ht,W));else if(v===bn.Dialog)_(new _d(O,L,Y,ut,ht,W));else throw Error(`不支持的应用类型:${v}`)});if(this.ready){if(!this._application)throw Error("client is not ready");x(this._application.type)}else this.event.on("ready",()=>{if(!this._application)throw Error("_application is null");x(this._application.type)},!0)})})}getSessions(O){return Le(this,void 0,void 0,function*(){return new Promise((L,Y)=>{const ut=()=>this.cvforceApi.listSessions(this._applicationId,O).then(ht=>{const W=[];return ht.forEach(_=>Le(this,void 0,void 0,function*(){const y=this._sessions.find(x=>_.id===x.id);if(y)y.data=_,W.push(y);else{const x=yield this.createSession(this.token,_.id,_,this.lazyload,this._application||void 0);W.push(x)}})),this.sessions=W,W});if(this.ready){if(!this._application)throw Error("_application is null");L(ut())}else this.event.on("ready",()=>{if(!this._application)throw Error("_application is null");L(ut())},!0)})})}loadSession(){return Le(this,arguments,void 0,function*(O="",L){this.checkReady();let Y=this.sessions.find(ut=>ut.id===O);if(Y||(Y=yield this.createSession(this.token,O,L),this._sessions.push(Y)),this._activeSession){if(this._activeSession===Y)return Y;this._activeSession.inactivate()}return Y.id?(yield Y.activate(),this._activeSession=Y):Y.addEventListener("data:loaded",()=>{this._activeSession!==Y&&(Y==null||Y.activate(),this._activeSession=Y)},!0),Y})}reload(){return this.loadApplication().then(()=>Le(this,void 0,void 0,function*(){return yield this.getSessions(),this.event.emit("ready"),this}))}reloadSession(O){return Le(this,void 0,void 0,function*(){yield this.reload();let L=this._sessions.find(Y=>Y.id===O)||this._activeSession;if(!L){console.warn("reloadSession session failed.");return}return yield L.reload(),L})}setTop(O,L){return Le(this,arguments,void 0,function*(Y,ut,ht="top_time desc, sort_status desc, updated_at desc"){let W=Y?this._sessions.find(_=>_.id===Y):this._activeSession;if(!W){console.warn("setTop session failed.");return}return yield W.setTop(ut),this.getSessions({order:ht})})}addEventListener(O,L,Y=!1){if(typeof L!="function")throw Error("event listener is not a function");if(Y){this.event.once(O,L);return}this.event.on(O,L)}removeEventListener(O,L){this.event.off(O,L)}removeSession(O,L){return Le(this,void 0,void 0,function*(){this.checkReady();let Y=-1;if(typeof O=="string"?Y=this._sessions.findIndex(ut=>ut.id===O):Y=this._sessions.findIndex(ut=>ut.id===O.id),Y>-1){const ut=this._sessions[Y];L&&(yield ut.delete()),this._sessions.splice(Y,1)}else console.warn("session delete failed, session is not exist.")})}clean(){this._sessions.forEach(O=>O.destroy()),this.sessions=[]}}class kd{constructor(O,L={},Y){Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"loaded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"functions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this.code=O,L&&(this.functions=L)}fetchData(){this.description="描述",this.loaded=!0}checkFunctions(){}}Mi.AgentPlugin=kd,Mi.BotClient=Ed,Mi.Session=cs,Mi.configure=yu,Object.defineProperty(Mi,Symbol.toStringTag,{value:"Module"})});
|