@http-forge/core 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -8
- package/dist/index.mjs +8 -8
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var dN=Object.create;var DE=Object.defineProperty;var hN=Object.getOwnPropertyDescriptor;var pN=Object.getOwnPropertyNames;var mN=Object.getPrototypeOf,gN=Object.prototype.hasOwnProperty;var qt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var F=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var yN=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pN(e))!gN.call(t,i)&&i!==r&&DE(t,i,{get:()=>e[i],enumerable:!(n=hN(e,i))||n.enumerable});return t};var tv=(t,e,r)=>(r=t!=null?dN(mN(t)):{},yN(e||!t||!t.__esModule?DE(r,"default",{value:t,enumerable:!0}):r,t));var ZE=F((el,zu)=>{(function(){var t,e="4.17.21",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",h=1,g=2,m=4,S=1,_=2,C=1,x=2,A=4,T=8,j=16,Y=32,V=64,K=128,ee=256,k=512,E=30,P="...",N=800,D=16,L=1,z=2,Z=3,ie=1/0,fe=9007199254740991,bt=17976931348623157e292,we=NaN,he=4294967295,Ze=he-1,_t=he>>>1,Mt=[["ary",K],["bind",C],["bindKey",x],["curry",T],["curryRight",j],["flip",k],["partial",Y],["partialRight",V],["rearg",ee]],le="[object Arguments]",ei="[object Array]",su="[object AsyncFunction]",ct="[object Boolean]",_n="[object Date]",as="[object DOMException]",jt="[object Error]",ft="[object Function]",ti="[object GeneratorFunction]",rr="[object Map]",Qr="[object Number]",Lm="[object Null]",wn="[object Object]",Lf="[object Promise]",jm="[object Proxy]",ls="[object RegExp]",gt="[object Set]",Ri="[object String]",ma="[object Symbol]",Um="[object Undefined]",us="[object WeakMap]",dr="[object WeakSet]",cs="[object ArrayBuffer]",ri="[object DataView]",fs="[object Float32Array]",Xe="[object Float64Array]",ga="[object Int8Array]",ya="[object Int16Array]",ds="[object Int32Array]",uo="[object Uint8Array]",hs="[object Uint8ClampedArray]",ni="[object Uint16Array]",ps="[object Uint32Array]",Bm=/\b__p \+= '';/g,va=/\b(__p \+=) '' \+/g,Hm=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ms=/&(?:amp|lt|gt|quot|#39);/g,Ii=/[&<>"']/g,ou=RegExp(ms.source),Sa=RegExp(Ii.source),oe=/<%-([\s\S]+?)%>/g,Vm=/<%([\s\S]+?)%>/g,jf=/<%=([\s\S]+?)%>/g,En=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_r=/^\w*$/,$e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,co=/[\\^$.*+?()[\]{}|]/g,Ke=RegExp(co.source),Oi=/^\s+/,Wm=/\s/,ba=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vt=/\{\n\/\* \[wrapped with (.+)\] \*/,Cn=/,? & /,Zr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Pt=/[()=,{}\[\]\/\s]/,jr=/\\(\\)?/g,xn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ii=/\w*$/,Ym=/^[-+]0x[0-9a-f]+$/i,Jm=/^0b[01]+$/i,fo=/^\[object .+?Constructor\]$/,Uf=/^0o[0-7]+$/i,zm=/^(?:0|[1-9]\d*)$/,gs=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,si=/($^)/,Bf=/['\n\r\u2028\u2029\\]/g,_a="\\ud800-\\udfff",Km="\\u0300-\\u036f",Gm="\\ufe20-\\ufe2f",yt="\\u20d0-\\u20ff",wa=Km+Gm+yt,Hf="\\u2700-\\u27bf",au="a-z\\xdf-\\xf6\\xf8-\\xff",Vf="\\xac\\xb1\\xd7\\xf7",Qm="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Zm="\\u2000-\\u206f",Xm=" \\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",Wf="A-Z\\xc0-\\xd6\\xd8-\\xde",Yf="\\ufe0e\\ufe0f",Jf=Vf+Qm+Zm+Xm,Ea="['\u2019]",zf="["+_a+"]",Kf="["+Jf+"]",Ca="["+wa+"]",Gf="\\d+",Qf="["+Hf+"]",Zf="["+au+"]",ys="[^"+_a+Jf+Gf+Hf+au+Wf+"]",vs="\\ud83c[\\udffb-\\udfff]",Xf="(?:"+Ca+"|"+vs+")",Ss="[^"+_a+"]",Ur="(?:\\ud83c[\\udde6-\\uddff]){2}",lu="[\\ud800-\\udbff][\\udc00-\\udfff]",bs="["+Wf+"]",ed="\\u200d",td="(?:"+Zf+"|"+ys+")",eg="(?:"+bs+"|"+ys+")",rd="(?:"+Ea+"(?:d|ll|m|re|s|t|ve))?",nd="(?:"+Ea+"(?:D|LL|M|RE|S|T|VE))?",id=Xf+"?",xa="["+Yf+"]?",tg="(?:"+ed+"(?:"+[Ss,Ur,lu].join("|")+")"+xa+id+")*",sd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rg="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",od=xa+id+tg,ng="(?:"+[Qf,Ur,lu].join("|")+")"+od,ig="(?:"+[Ss+Ca+"?",Ca,Ur,lu,zf].join("|")+")",sg=RegExp(Ea,"g"),og=RegExp(Ca,"g"),uu=RegExp(vs+"(?="+vs+")|"+ig+od,"g"),ag=RegExp([bs+"?"+Zf+"+"+rd+"(?="+[Kf,bs,"$"].join("|")+")",eg+"+"+nd+"(?="+[Kf,bs+td,"$"].join("|")+")",bs+"?"+td+"+"+rd,bs+"+"+nd,rg,sd,Gf,ng].join("|"),"g"),lg=RegExp("["+ed+_a+wa+Yf+"]"),ug=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,cg=["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"],fg=-1,ot={};ot[fs]=ot[Xe]=ot[ga]=ot[ya]=ot[ds]=ot[uo]=ot[hs]=ot[ni]=ot[ps]=!0,ot[le]=ot[ei]=ot[cs]=ot[ct]=ot[ri]=ot[_n]=ot[jt]=ot[ft]=ot[rr]=ot[Qr]=ot[wn]=ot[ls]=ot[gt]=ot[Ri]=ot[us]=!1;var rt={};rt[le]=rt[ei]=rt[cs]=rt[ri]=rt[ct]=rt[_n]=rt[fs]=rt[Xe]=rt[ga]=rt[ya]=rt[ds]=rt[rr]=rt[Qr]=rt[wn]=rt[ls]=rt[gt]=rt[Ri]=rt[ma]=rt[uo]=rt[hs]=rt[ni]=rt[ps]=!0,rt[jt]=rt[ft]=rt[us]=!1;var dg={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},cu={"&":"&","<":"<",">":">",'"':""","'":"'"},fu={"&":"&","<":"<",">":">",""":'"',"'":"'"},hg={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ad=parseFloat,ld=parseInt,ud=typeof global=="object"&&global&&global.Object===Object&&global,pg=typeof self=="object"&&self&&self.Object===Object&&self,Nt=ud||pg||Function("return this")(),du=typeof el=="object"&&el&&!el.nodeType&&el,oi=du&&typeof zu=="object"&&zu&&!zu.nodeType&&zu,at=oi&&oi.exports===du,Pi=at&&ud.process,Wt=function(){try{var U=oi&&oi.require&&oi.require("util").types;return U||Pi&&Pi.binding&&Pi.binding("util")}catch{}}(),cd=Wt&&Wt.isArrayBuffer,hu=Wt&&Wt.isDate,fd=Wt&&Wt.isMap,dd=Wt&&Wt.isRegExp,ho=Wt&&Wt.isSet,Rn=Wt&&Wt.isTypedArray;function Jt(U,J,H){switch(H.length){case 0:return U.call(J);case 1:return U.call(J,H[0]);case 2:return U.call(J,H[0],H[1]);case 3:return U.call(J,H[0],H[1],H[2])}return U.apply(J,H)}function mg(U,J,H,ae){for(var ve=-1,We=U==null?0:U.length;++ve<We;){var kt=U[ve];J(ae,kt,H(kt),U)}return ae}function wt(U,J){for(var H=-1,ae=U==null?0:U.length;++H<ae&&J(U[H],H,U)!==!1;);return U}function gg(U,J){for(var H=U==null?0:U.length;H--&&J(U[H],H,U)!==!1;);return U}function Ra(U,J){for(var H=-1,ae=U==null?0:U.length;++H<ae;)if(!J(U[H],H,U))return!1;return!0}function ai(U,J){for(var H=-1,ae=U==null?0:U.length,ve=0,We=[];++H<ae;){var kt=U[H];J(kt,H,U)&&(We[ve++]=kt)}return We}function Ia(U,J){var H=U==null?0:U.length;return!!H&&_s(U,J,0)>-1}function pu(U,J,H){for(var ae=-1,ve=U==null?0:U.length;++ae<ve;)if(H(J,U[ae]))return!0;return!1}function et(U,J){for(var H=-1,ae=U==null?0:U.length,ve=Array(ae);++H<ae;)ve[H]=J(U[H],H,U);return ve}function Xr(U,J){for(var H=-1,ae=J.length,ve=U.length;++H<ae;)U[ve+H]=J[H];return U}function mu(U,J,H,ae){var ve=-1,We=U==null?0:U.length;for(ae&&We&&(H=U[++ve]);++ve<We;)H=J(H,U[ve],ve,U);return H}function yg(U,J,H,ae){var ve=U==null?0:U.length;for(ae&&ve&&(H=U[--ve]);ve--;)H=J(H,U[ve],ve,U);return H}function gu(U,J){for(var H=-1,ae=U==null?0:U.length;++H<ae;)if(J(U[H],H,U))return!0;return!1}var hd=yu("length");function vg(U){return U.split("")}function Sg(U){return U.match(Zr)||[]}function pd(U,J,H){var ae;return H(U,function(ve,We,kt){if(J(ve,We,kt))return ae=We,!1}),ae}function Oa(U,J,H,ae){for(var ve=U.length,We=H+(ae?1:-1);ae?We--:++We<ve;)if(J(U[We],We,U))return We;return-1}function _s(U,J,H){return J===J?_d(U,J,H):Oa(U,gd,H)}function md(U,J,H,ae){for(var ve=H-1,We=U.length;++ve<We;)if(ae(U[ve],J))return ve;return-1}function gd(U){return U!==U}function ki(U,J){var H=U==null?0:U.length;return H?Su(U,J)/H:we}function yu(U){return function(J){return J==null?t:J[U]}}function po(U){return function(J){return U==null?t:U[J]}}function yd(U,J,H,ae,ve){return ve(U,function(We,kt,Ae){H=ae?(ae=!1,We):J(H,We,kt,Ae)}),H}function vu(U,J){var H=U.length;for(U.sort(J);H--;)U[H]=U[H].value;return U}function Su(U,J){for(var H,ae=-1,ve=U.length;++ae<ve;){var We=J(U[ae]);We!==t&&(H=H===t?We:H+We)}return H}function bu(U,J){for(var H=-1,ae=Array(U);++H<U;)ae[H]=J(H);return ae}function bg(U,J){return et(J,function(H){return[H,U[H]]})}function vd(U){return U&&U.slice(0,Pa(U)+1).replace(Oi,"")}function nr(U){return function(J){return U(J)}}function _u(U,J){return et(J,function(H){return U[H]})}function ws(U,J){return U.has(J)}function nt(U,J){for(var H=-1,ae=U.length;++H<ae&&_s(J,U[H],0)>-1;);return H}function Sd(U,J){for(var H=U.length;H--&&_s(J,U[H],0)>-1;);return H}function _g(U,J){for(var H=U.length,ae=0;H--;)U[H]===J&&++ae;return ae}var bd=po(dg),wg=po(cu);function Eg(U){return"\\"+hg[U]}function Cg(U,J){return U==null?t:U[J]}function en(U){return lg.test(U)}function xg(U){return ug.test(U)}function Rg(U){for(var J,H=[];!(J=U.next()).done;)H.push(J.value);return H}function wu(U){var J=-1,H=Array(U.size);return U.forEach(function(ae,ve){H[++J]=[ve,ae]}),H}function mo(U,J){return function(H){return U(J(H))}}function Br(U,J){for(var H=-1,ae=U.length,ve=0,We=[];++H<ae;){var kt=U[H];(kt===J||kt===f)&&(U[H]=f,We[ve++]=H)}return We}function Es(U){var J=-1,H=Array(U.size);return U.forEach(function(ae){H[++J]=ae}),H}function Ig(U){var J=-1,H=Array(U.size);return U.forEach(function(ae){H[++J]=[ae,ae]}),H}function _d(U,J,H){for(var ae=H-1,ve=U.length;++ae<ve;)if(U[ae]===J)return ae;return-1}function Og(U,J,H){for(var ae=H+1;ae--;)if(U[ae]===J)return ae;return ae}function li(U){return en(U)?kg(U):hd(U)}function hr(U){return en(U)?Ag(U):vg(U)}function Pa(U){for(var J=U.length;J--&&Wm.test(U.charAt(J)););return J}var Pg=po(fu);function kg(U){for(var J=uu.lastIndex=0;uu.test(U);)++J;return J}function Ag(U){return U.match(uu)||[]}function Tg(U){return U.match(ag)||[]}var qg=function U(J){J=J==null?Nt:ui.defaults(Nt.Object(),J,ui.pick(Nt,cg));var H=J.Array,ae=J.Date,ve=J.Error,We=J.Function,kt=J.Math,Ae=J.Object,In=J.RegExp,wd=J.String,wr=J.TypeError,go=H.prototype,Ed=We.prototype,Cs=Ae.prototype,ka=J["__core-js_shared__"],yo=Ed.toString,ze=Cs.hasOwnProperty,$g=0,Cd=function(){var o=/[^.]+$/.exec(ka&&ka.keys&&ka.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Aa=Cs.toString,Mg=yo.call(Ae),Ng=Nt._,Dg=In("^"+yo.call(ze).replace(co,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ta=at?J.Buffer:t,ci=J.Symbol,qa=J.Uint8Array,xd=Ta?Ta.allocUnsafe:t,$a=mo(Ae.getPrototypeOf,Ae),Rd=Ae.create,Id=Cs.propertyIsEnumerable,Ai=go.splice,Od=ci?ci.isConcatSpreadable:t,vo=ci?ci.iterator:t,Ti=ci?ci.toStringTag:t,Ma=function(){try{var o=Oo(Ae,"defineProperty");return o({},"",{}),o}catch{}}(),Fg=J.clearTimeout!==Nt.clearTimeout&&J.clearTimeout,Lg=ae&&ae.now!==Nt.Date.now&&ae.now,jg=J.setTimeout!==Nt.setTimeout&&J.setTimeout,Na=kt.ceil,So=kt.floor,Da=Ae.getOwnPropertySymbols,Pd=Ta?Ta.isBuffer:t,bo=J.isFinite,xs=go.join,Fa=mo(Ae.keys,Ae),Et=kt.max,vt=kt.min,kd=ae.now,Ad=J.parseInt,Td=kt.random,Ug=go.reverse,Eu=Oo(J,"DataView"),_o=Oo(J,"Map"),Cu=Oo(J,"Promise"),Rs=Oo(J,"Set"),wo=Oo(J,"WeakMap"),Eo=Oo(Ae,"create"),La=wo&&new wo,Is={},Bg=Po(Eu),Hg=Po(_o),Vg=Po(Cu),Wg=Po(Rs),Yg=Po(wo),ja=ci?ci.prototype:t,Co=ja?ja.valueOf:t,qd=ja?ja.toString:t;function I(o){if(Ct(o)&&!Ee(o)&&!(o instanceof Ie)){if(o instanceof Er)return o;if(ze.call(o,"__wrapped__"))return rE(o)}return new Er(o)}var Os=function(){function o(){}return function(l){if(!St(l))return{};if(Rd)return Rd(l);o.prototype=l;var d=new o;return o.prototype=t,d}}();function Ua(){}function Er(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}I.templateSettings={escape:oe,evaluate:Vm,interpolate:jf,variable:"",imports:{_:I}},I.prototype=Ua.prototype,I.prototype.constructor=I,Er.prototype=Os(Ua.prototype),Er.prototype.constructor=Er;function Ie(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=he,this.__views__=[]}function Jg(){var o=new Ie(this.__wrapped__);return o.__actions__=xr(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=xr(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=xr(this.__views__),o}function zg(){if(this.__filtered__){var o=new Ie(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function Kg(){var o=this.__wrapped__.value(),l=this.__dir__,d=Ee(o),v=l<0,w=d?o.length:0,O=LA(0,w,this.__views__),q=O.start,M=O.end,B=M-q,G=v?M:q-1,Q=this.__iteratees__,X=Q.length,re=0,ue=vt(B,this.__takeCount__);if(!d||!v&&w==B&&ue==B)return xw(o,this.__actions__);var me=[];e:for(;B--&&re<ue;){G+=l;for(var Pe=-1,ge=o[G];++Pe<X;){var De=Q[Pe],je=De.iteratee,Yr=De.type,gr=je(ge);if(Yr==z)ge=gr;else if(!gr){if(Yr==L)continue e;break e}}me[re++]=ge}return me}Ie.prototype=Os(Ua.prototype),Ie.prototype.constructor=Ie;function On(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var v=o[l];this.set(v[0],v[1])}}function Ba(){this.__data__=Eo?Eo(null):{},this.size=0}function Gg(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function Qg(o){var l=this.__data__;if(Eo){var d=l[o];return d===a?t:d}return ze.call(l,o)?l[o]:t}function Zg(o){var l=this.__data__;return Eo?l[o]!==t:ze.call(l,o)}function Xg(o,l){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=Eo&&l===t?a:l,this}On.prototype.clear=Ba,On.prototype.delete=Gg,On.prototype.get=Qg,On.prototype.has=Zg,On.prototype.set=Xg;function Pn(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var v=o[l];this.set(v[0],v[1])}}function ey(){this.__data__=[],this.size=0}function $d(o){var l=this.__data__,d=Cr(l,o);if(d<0)return!1;var v=l.length-1;return d==v?l.pop():Ai.call(l,d,1),--this.size,!0}function ty(o){var l=this.__data__,d=Cr(l,o);return d<0?t:l[d][1]}function ry(o){return Cr(this.__data__,o)>-1}function Md(o,l){var d=this.__data__,v=Cr(d,o);return v<0?(++this.size,d.push([o,l])):d[v][1]=l,this}Pn.prototype.clear=ey,Pn.prototype.delete=$d,Pn.prototype.get=ty,Pn.prototype.has=ry,Pn.prototype.set=Md;function kn(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var v=o[l];this.set(v[0],v[1])}}function ny(){this.size=0,this.__data__={hash:new On,map:new(_o||Pn),string:new On}}function iy(o){var l=eh(this,o).delete(o);return this.size-=l?1:0,l}function fi(o){return eh(this,o).get(o)}function Nd(o){return eh(this,o).has(o)}function sy(o,l){var d=eh(this,o),v=d.size;return d.set(o,l),this.size+=d.size==v?0:1,this}kn.prototype.clear=ny,kn.prototype.delete=iy,kn.prototype.get=fi,kn.prototype.has=Nd,kn.prototype.set=sy;function qi(o){var l=-1,d=o==null?0:o.length;for(this.__data__=new kn;++l<d;)this.add(o[l])}function oy(o){return this.__data__.set(o,a),this}function te(o){return this.__data__.has(o)}qi.prototype.add=qi.prototype.push=oy,qi.prototype.has=te;function Hr(o){var l=this.__data__=new Pn(o);this.size=l.size}function ay(){this.__data__=new Pn,this.size=0}function Dd(o){var l=this.__data__,d=l.delete(o);return this.size=l.size,d}function Be(o){return this.__data__.get(o)}function Ha(o){return this.__data__.has(o)}function Fd(o,l){var d=this.__data__;if(d instanceof Pn){var v=d.__data__;if(!_o||v.length<r-1)return v.push([o,l]),this.size=++d.size,this;d=this.__data__=new kn(v)}return d.set(o,l),this.size=d.size,this}Hr.prototype.clear=ay,Hr.prototype.delete=Dd,Hr.prototype.get=Be,Hr.prototype.has=Ha,Hr.prototype.set=Fd;function Va(o,l){var d=Ee(o),v=!d&&ko(o),w=!d&&!v&&qs(o),O=!d&&!v&&!w&&Ga(o),q=d||v||w||O,M=q?bu(o.length,wd):[],B=M.length;for(var G in o)(l||ze.call(o,G))&&!(q&&(G=="length"||w&&(G=="offset"||G=="parent")||O&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||Fi(G,B)))&&M.push(G);return M}function Ld(o){var l=o.length;return l?o[_y(0,l-1)]:t}function ly(o,l){return th(xr(o),$i(l,0,o.length))}function uy(o){return th(xr(o))}function xu(o,l,d){(d!==t&&!$n(o[l],d)||d===t&&!(l in o))&&An(o,l,d)}function xo(o,l,d){var v=o[l];(!(ze.call(o,l)&&$n(v,d))||d===t&&!(l in o))&&An(o,l,d)}function Cr(o,l){for(var d=o.length;d--;)if($n(o[d][0],l))return d;return-1}function cy(o,l,d,v){return di(o,function(w,O,q){l(v,w,d(w),q)}),v}function Ru(o,l){return o&&pi(l,Yt(l),o)}function fy(o,l){return o&&pi(l,Ir(l),o)}function An(o,l,d){l=="__proto__"&&Ma?Ma(o,l,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[l]=d}function Wa(o,l){for(var d=-1,v=l.length,w=H(v),O=o==null;++d<v;)w[d]=O?t:Yy(o,l[d]);return w}function $i(o,l,d){return o===o&&(d!==t&&(o=o<=d?o:d),l!==t&&(o=o>=l?o:l)),o}function pr(o,l,d,v,w,O){var q,M=l&h,B=l&g,G=l&m;if(d&&(q=w?d(o,v,w,O):d(o)),q!==t)return q;if(!St(o))return o;var Q=Ee(o);if(Q){if(q=UA(o),!M)return xr(o,q)}else{var X=ir(o),re=X==ft||X==ti;if(qs(o))return Ow(o,M);if(X==wn||X==le||re&&!w){if(q=B||re?{}:Jw(o),!M)return B?kA(o,fy(q,o)):PA(o,Ru(q,o))}else{if(!rt[X])return w?o:{};q=BA(o,X,M)}}O||(O=new Hr);var ue=O.get(o);if(ue)return ue;O.set(o,q),wE(o)?o.forEach(function(ge){q.add(pr(ge,l,d,ge,o,O))}):bE(o)&&o.forEach(function(ge,De){q.set(De,pr(ge,l,d,De,o,O))});var me=G?B?Ty:Ay:B?Ir:Yt,Pe=Q?t:me(o);return wt(Pe||o,function(ge,De){Pe&&(De=ge,ge=o[De]),xo(q,De,pr(ge,l,d,De,o,O))}),q}function Iu(o){var l=Yt(o);return function(d){return jd(d,o,l)}}function jd(o,l,d){var v=d.length;if(o==null)return!v;for(o=Ae(o);v--;){var w=d[v],O=l[w],q=o[w];if(q===t&&!(w in o)||!O(q))return!1}return!0}function tn(o,l,d){if(typeof o!="function")throw new wr(i);return Nu(function(){o.apply(t,d)},l)}function Ps(o,l,d,v){var w=-1,O=Ia,q=!0,M=o.length,B=[],G=l.length;if(!M)return B;d&&(l=et(l,nr(d))),v?(O=pu,q=!1):l.length>=r&&(O=ws,q=!1,l=new qi(l));e:for(;++w<M;){var Q=o[w],X=d==null?Q:d(Q);if(Q=v||Q!==0?Q:0,q&&X===X){for(var re=G;re--;)if(l[re]===X)continue e;B.push(Q)}else O(l,X,v)||B.push(Q)}return B}var di=qw(rn),Ud=qw(Pu,!0);function dy(o,l){var d=!0;return di(o,function(v,w,O){return d=!!l(v,w,O),d}),d}function Ya(o,l,d){for(var v=-1,w=o.length;++v<w;){var O=o[v],q=l(O);if(q!=null&&(M===t?q===q&&!Wr(q):d(q,M)))var M=q,B=O}return B}function hy(o,l,d,v){var w=o.length;for(d=Ce(d),d<0&&(d=-d>w?0:w+d),v=v===t||v>w?w:Ce(v),v<0&&(v+=w),v=d>v?0:CE(v);d<v;)o[d++]=l;return o}function Bd(o,l){var d=[];return di(o,function(v,w,O){l(v,w,O)&&d.push(v)}),d}function Ut(o,l,d,v,w){var O=-1,q=o.length;for(d||(d=VA),w||(w=[]);++O<q;){var M=o[O];l>0&&d(M)?l>1?Ut(M,l-1,d,v,w):Xr(w,M):v||(w[w.length]=M)}return w}var Ou=$w(),Hd=$w(!0);function rn(o,l){return o&&Ou(o,l,Yt)}function Pu(o,l){return o&&Hd(o,l,Yt)}function nn(o,l){return ai(l,function(d){return Li(o[d])})}function Mi(o,l){l=As(l,o);for(var d=0,v=l.length;o!=null&&d<v;)o=o[mi(l[d++])];return d&&d==v?o:t}function Vd(o,l,d){var v=l(o);return Ee(o)?v:Xr(v,d(o))}function zt(o){return o==null?o===t?Um:Lm:Ti&&Ti in Ae(o)?FA(o):QA(o)}function ku(o,l){return o>l}function py(o,l){return o!=null&&ze.call(o,l)}function my(o,l){return o!=null&&l in Ae(o)}function gy(o,l,d){return o>=vt(l,d)&&o<Et(l,d)}function Au(o,l,d){for(var v=d?pu:Ia,w=o[0].length,O=o.length,q=O,M=H(O),B=1/0,G=[];q--;){var Q=o[q];q&&l&&(Q=et(Q,nr(l))),B=vt(Q.length,B),M[q]=!d&&(l||w>=120&&Q.length>=120)?new qi(q&&Q):t}Q=o[0];var X=-1,re=M[0];e:for(;++X<w&&G.length<B;){var ue=Q[X],me=l?l(ue):ue;if(ue=d||ue!==0?ue:0,!(re?ws(re,me):v(G,me,d))){for(q=O;--q;){var Pe=M[q];if(!(Pe?ws(Pe,me):v(o[q],me,d)))continue e}re&&re.push(me),G.push(ue)}}return G}function Tn(o,l,d,v){return rn(o,function(w,O,q){l(v,d(w),O,q)}),v}function sn(o,l,d){l=As(l,o),o=Qw(o,l);var v=o==null?o:o[mi(ln(l))];return v==null?t:Jt(v,o,d)}function Wd(o){return Ct(o)&&zt(o)==le}function yy(o){return Ct(o)&&zt(o)==cs}function vy(o){return Ct(o)&&zt(o)==_n}function Ro(o,l,d,v,w){return o===l?!0:o==null||l==null||!Ct(o)&&!Ct(l)?o!==o&&l!==l:Sy(o,l,d,v,Ro,w)}function Sy(o,l,d,v,w,O){var q=Ee(o),M=Ee(l),B=q?ei:ir(o),G=M?ei:ir(l);B=B==le?wn:B,G=G==le?wn:G;var Q=B==wn,X=G==wn,re=B==G;if(re&&qs(o)){if(!qs(l))return!1;q=!0,Q=!1}if(re&&!Q)return O||(O=new Hr),q||Ga(o)?Vw(o,l,d,v,w,O):NA(o,l,B,d,v,w,O);if(!(d&S)){var ue=Q&&ze.call(o,"__wrapped__"),me=X&&ze.call(l,"__wrapped__");if(ue||me){var Pe=ue?o.value():o,ge=me?l.value():l;return O||(O=new Hr),w(Pe,ge,d,v,O)}}return re?(O||(O=new Hr),DA(o,l,d,v,w,O)):!1}function Tu(o){return Ct(o)&&ir(o)==rr}function hi(o,l,d,v){var w=d.length,O=w,q=!v;if(o==null)return!O;for(o=Ae(o);w--;){var M=d[w];if(q&&M[2]?M[1]!==o[M[0]]:!(M[0]in o))return!1}for(;++w<O;){M=d[w];var B=M[0],G=o[B],Q=M[1];if(q&&M[2]){if(G===t&&!(B in o))return!1}else{var X=new Hr;if(v)var re=v(G,Q,B,o,l,X);if(!(re===t?Ro(Q,G,S|_,v,X):re))return!1}}return!0}function Io(o){if(!St(o)||YA(o))return!1;var l=Li(o)?Dg:fo;return l.test(Po(o))}function Le(o){return Ct(o)&&zt(o)==ls}function c(o){return Ct(o)&&ir(o)==gt}function p(o){return Ct(o)&&ah(o.length)&&!!ot[zt(o)]}function y(o){return typeof o=="function"?o:o==null?Or:typeof o=="object"?Ee(o)?ye(o[0],o[1]):se(o):ME(o)}function b(o){if(!Mu(o))return Fa(o);var l=[];for(var d in Ae(o))ze.call(o,d)&&d!="constructor"&&l.push(d);return l}function R(o){if(!St(o))return GA(o);var l=Mu(o),d=[];for(var v in o)v=="constructor"&&(l||!ze.call(o,v))||d.push(v);return d}function $(o,l){return o<l}function W(o,l){var d=-1,v=Rr(o)?H(o.length):[];return di(o,function(w,O,q){v[++d]=l(w,O,q)}),v}function se(o){var l=$y(o);return l.length==1&&l[0][2]?Kw(l[0][0],l[0][1]):function(d){return d===o||hi(d,o,l)}}function ye(o,l){return Ny(o)&&zw(l)?Kw(mi(o),l):function(d){var v=Yy(d,o);return v===t&&v===l?Jy(d,o):Ro(l,v,S|_)}}function Oe(o,l,d,v,w){o!==l&&Ou(l,function(O,q){if(w||(w=new Hr),St(O))Kt(o,l,q,d,Oe,v,w);else{var M=v?v(Fy(o,q),O,q+"",o,l,w):t;M===t&&(M=O),xu(o,q,M)}},Ir)}function Kt(o,l,d,v,w,O,q){var M=Fy(o,d),B=Fy(l,d),G=q.get(B);if(G){xu(o,d,G);return}var Q=O?O(M,B,d+"",o,l,q):t,X=Q===t;if(X){var re=Ee(B),ue=!re&&qs(B),me=!re&&!ue&&Ga(B);Q=B,re||ue||me?Ee(M)?Q=M:At(M)?Q=xr(M):ue?(X=!1,Q=Ow(B,!0)):me?(X=!1,Q=Pw(B,!0)):Q=[]:Du(B)||ko(B)?(Q=M,ko(M)?Q=xE(M):(!St(M)||Li(M))&&(Q=Jw(B))):X=!1}X&&(q.set(B,Q),w(Q,B,v,O,q),q.delete(B)),xu(o,d,Q)}function on(o,l){var d=o.length;if(d)return l+=l<0?d:0,Fi(l,d)?o[l]:t}function qn(o,l,d){l.length?l=et(l,function(O){return Ee(O)?function(q){return Mi(q,O.length===1?O[0]:O)}:O}):l=[Or];var v=-1;l=et(l,nr(pe()));var w=W(o,function(O,q,M){var B=et(l,function(G){return G(O)});return{criteria:B,index:++v,value:O}});return vu(w,function(O,q){return OA(O,q,d)})}function gA(o,l){return Sw(o,l,function(d,v){return Jy(o,v)})}function Sw(o,l,d){for(var v=-1,w=l.length,O={};++v<w;){var q=l[v],M=Mi(o,q);d(M,q)&&qu(O,As(q,o),M)}return O}function yA(o){return function(l){return Mi(l,o)}}function by(o,l,d,v){var w=v?md:_s,O=-1,q=l.length,M=o;for(o===l&&(l=xr(l)),d&&(M=et(o,nr(d)));++O<q;)for(var B=0,G=l[O],Q=d?d(G):G;(B=w(M,Q,B,v))>-1;)M!==o&&Ai.call(M,B,1),Ai.call(o,B,1);return o}function bw(o,l){for(var d=o?l.length:0,v=d-1;d--;){var w=l[d];if(d==v||w!==O){var O=w;Fi(w)?Ai.call(o,w,1):Cy(o,w)}}return o}function _y(o,l){return o+So(Td()*(l-o+1))}function vA(o,l,d,v){for(var w=-1,O=Et(Na((l-o)/(d||1)),0),q=H(O);O--;)q[v?O:++w]=o,o+=d;return q}function wy(o,l){var d="";if(!o||l<1||l>fe)return d;do l%2&&(d+=o),l=So(l/2),l&&(o+=o);while(l);return d}function Te(o,l){return Ly(Gw(o,l,Or),o+"")}function SA(o){return Ld(Qa(o))}function bA(o,l){var d=Qa(o);return th(d,$i(l,0,d.length))}function qu(o,l,d,v){if(!St(o))return o;l=As(l,o);for(var w=-1,O=l.length,q=O-1,M=o;M!=null&&++w<O;){var B=mi(l[w]),G=d;if(B==="__proto__"||B==="constructor"||B==="prototype")return o;if(w!=q){var Q=M[B];G=v?v(Q,B,M):t,G===t&&(G=St(Q)?Q:Fi(l[w+1])?[]:{})}xo(M,B,G),M=M[B]}return o}var _w=La?function(o,l){return La.set(o,l),o}:Or,_A=Ma?function(o,l){return Ma(o,"toString",{configurable:!0,enumerable:!1,value:Ky(l),writable:!0})}:Or;function wA(o){return th(Qa(o))}function an(o,l,d){var v=-1,w=o.length;l<0&&(l=-l>w?0:w+l),d=d>w?w:d,d<0&&(d+=w),w=l>d?0:d-l>>>0,l>>>=0;for(var O=H(w);++v<w;)O[v]=o[v+l];return O}function EA(o,l){var d;return di(o,function(v,w,O){return d=l(v,w,O),!d}),!!d}function Yd(o,l,d){var v=0,w=o==null?v:o.length;if(typeof l=="number"&&l===l&&w<=_t){for(;v<w;){var O=v+w>>>1,q=o[O];q!==null&&!Wr(q)&&(d?q<=l:q<l)?v=O+1:w=O}return w}return Ey(o,l,Or,d)}function Ey(o,l,d,v){var w=0,O=o==null?0:o.length;if(O===0)return 0;l=d(l);for(var q=l!==l,M=l===null,B=Wr(l),G=l===t;w<O;){var Q=So((w+O)/2),X=d(o[Q]),re=X!==t,ue=X===null,me=X===X,Pe=Wr(X);if(q)var ge=v||me;else G?ge=me&&(v||re):M?ge=me&&re&&(v||!ue):B?ge=me&&re&&!ue&&(v||!Pe):ue||Pe?ge=!1:ge=v?X<=l:X<l;ge?w=Q+1:O=Q}return vt(O,Ze)}function ww(o,l){for(var d=-1,v=o.length,w=0,O=[];++d<v;){var q=o[d],M=l?l(q):q;if(!d||!$n(M,B)){var B=M;O[w++]=q===0?0:q}}return O}function Ew(o){return typeof o=="number"?o:Wr(o)?we:+o}function Vr(o){if(typeof o=="string")return o;if(Ee(o))return et(o,Vr)+"";if(Wr(o))return qd?qd.call(o):"";var l=o+"";return l=="0"&&1/o==-ie?"-0":l}function ks(o,l,d){var v=-1,w=Ia,O=o.length,q=!0,M=[],B=M;if(d)q=!1,w=pu;else if(O>=r){var G=l?null:$A(o);if(G)return Es(G);q=!1,w=ws,B=new qi}else B=l?[]:M;e:for(;++v<O;){var Q=o[v],X=l?l(Q):Q;if(Q=d||Q!==0?Q:0,q&&X===X){for(var re=B.length;re--;)if(B[re]===X)continue e;l&&B.push(X),M.push(Q)}else w(B,X,d)||(B!==M&&B.push(X),M.push(Q))}return M}function Cy(o,l){return l=As(l,o),o=Qw(o,l),o==null||delete o[mi(ln(l))]}function Cw(o,l,d,v){return qu(o,l,d(Mi(o,l)),v)}function Jd(o,l,d,v){for(var w=o.length,O=v?w:-1;(v?O--:++O<w)&&l(o[O],O,o););return d?an(o,v?0:O,v?O+1:w):an(o,v?O+1:0,v?w:O)}function xw(o,l){var d=o;return d instanceof Ie&&(d=d.value()),mu(l,function(v,w){return w.func.apply(w.thisArg,Xr([v],w.args))},d)}function xy(o,l,d){var v=o.length;if(v<2)return v?ks(o[0]):[];for(var w=-1,O=H(v);++w<v;)for(var q=o[w],M=-1;++M<v;)M!=w&&(O[w]=Ps(O[w]||q,o[M],l,d));return ks(Ut(O,1),l,d)}function Rw(o,l,d){for(var v=-1,w=o.length,O=l.length,q={};++v<w;){var M=v<O?l[v]:t;d(q,o[v],M)}return q}function Ry(o){return At(o)?o:[]}function Iy(o){return typeof o=="function"?o:Or}function As(o,l){return Ee(o)?o:Ny(o,l)?[o]:tE(Ge(o))}var CA=Te;function Ts(o,l,d){var v=o.length;return d=d===t?v:d,!l&&d>=v?o:an(o,l,d)}var Iw=Fg||function(o){return Nt.clearTimeout(o)};function Ow(o,l){if(l)return o.slice();var d=o.length,v=xd?xd(d):new o.constructor(d);return o.copy(v),v}function Oy(o){var l=new o.constructor(o.byteLength);return new qa(l).set(new qa(o)),l}function xA(o,l){var d=l?Oy(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function RA(o){var l=new o.constructor(o.source,ii.exec(o));return l.lastIndex=o.lastIndex,l}function IA(o){return Co?Ae(Co.call(o)):{}}function Pw(o,l){var d=l?Oy(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function kw(o,l){if(o!==l){var d=o!==t,v=o===null,w=o===o,O=Wr(o),q=l!==t,M=l===null,B=l===l,G=Wr(l);if(!M&&!G&&!O&&o>l||O&&q&&B&&!M&&!G||v&&q&&B||!d&&B||!w)return 1;if(!v&&!O&&!G&&o<l||G&&d&&w&&!v&&!O||M&&d&&w||!q&&w||!B)return-1}return 0}function OA(o,l,d){for(var v=-1,w=o.criteria,O=l.criteria,q=w.length,M=d.length;++v<q;){var B=kw(w[v],O[v]);if(B){if(v>=M)return B;var G=d[v];return B*(G=="desc"?-1:1)}}return o.index-l.index}function Aw(o,l,d,v){for(var w=-1,O=o.length,q=d.length,M=-1,B=l.length,G=Et(O-q,0),Q=H(B+G),X=!v;++M<B;)Q[M]=l[M];for(;++w<q;)(X||w<O)&&(Q[d[w]]=o[w]);for(;G--;)Q[M++]=o[w++];return Q}function Tw(o,l,d,v){for(var w=-1,O=o.length,q=-1,M=d.length,B=-1,G=l.length,Q=Et(O-M,0),X=H(Q+G),re=!v;++w<Q;)X[w]=o[w];for(var ue=w;++B<G;)X[ue+B]=l[B];for(;++q<M;)(re||w<O)&&(X[ue+d[q]]=o[w++]);return X}function xr(o,l){var d=-1,v=o.length;for(l||(l=H(v));++d<v;)l[d]=o[d];return l}function pi(o,l,d,v){var w=!d;d||(d={});for(var O=-1,q=l.length;++O<q;){var M=l[O],B=v?v(d[M],o[M],M,d,o):t;B===t&&(B=o[M]),w?An(d,M,B):xo(d,M,B)}return d}function PA(o,l){return pi(o,My(o),l)}function kA(o,l){return pi(o,Ww(o),l)}function zd(o,l){return function(d,v){var w=Ee(d)?mg:cy,O=l?l():{};return w(d,o,pe(v,2),O)}}function Ja(o){return Te(function(l,d){var v=-1,w=d.length,O=w>1?d[w-1]:t,q=w>2?d[2]:t;for(O=o.length>3&&typeof O=="function"?(w--,O):t,q&&mr(d[0],d[1],q)&&(O=w<3?t:O,w=1),l=Ae(l);++v<w;){var M=d[v];M&&o(l,M,v,O)}return l})}function qw(o,l){return function(d,v){if(d==null)return d;if(!Rr(d))return o(d,v);for(var w=d.length,O=l?w:-1,q=Ae(d);(l?O--:++O<w)&&v(q[O],O,q)!==!1;);return d}}function $w(o){return function(l,d,v){for(var w=-1,O=Ae(l),q=v(l),M=q.length;M--;){var B=q[o?M:++w];if(d(O[B],B,O)===!1)break}return l}}function AA(o,l,d){var v=l&C,w=$u(o);function O(){var q=this&&this!==Nt&&this instanceof O?w:o;return q.apply(v?d:this,arguments)}return O}function Mw(o){return function(l){l=Ge(l);var d=en(l)?hr(l):t,v=d?d[0]:l.charAt(0),w=d?Ts(d,1).join(""):l.slice(1);return v[o]()+w}}function za(o){return function(l){return mu(qE(TE(l).replace(sg,"")),o,"")}}function $u(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var d=Os(o.prototype),v=o.apply(d,l);return St(v)?v:d}}function TA(o,l,d){var v=$u(o);function w(){for(var O=arguments.length,q=H(O),M=O,B=Ka(w);M--;)q[M]=arguments[M];var G=O<3&&q[0]!==B&&q[O-1]!==B?[]:Br(q,B);if(O-=G.length,O<d)return jw(o,l,Kd,w.placeholder,t,q,G,t,t,d-O);var Q=this&&this!==Nt&&this instanceof w?v:o;return Jt(Q,this,q)}return w}function Nw(o){return function(l,d,v){var w=Ae(l);if(!Rr(l)){var O=pe(d,3);l=Yt(l),d=function(M){return O(w[M],M,w)}}var q=o(l,d,v);return q>-1?w[O?l[q]:q]:t}}function Dw(o){return Di(function(l){var d=l.length,v=d,w=Er.prototype.thru;for(o&&l.reverse();v--;){var O=l[v];if(typeof O!="function")throw new wr(i);if(w&&!q&&Xd(O)=="wrapper")var q=new Er([],!0)}for(v=q?v:d;++v<d;){O=l[v];var M=Xd(O),B=M=="wrapper"?qy(O):t;B&&Dy(B[0])&&B[1]==(K|T|Y|ee)&&!B[4].length&&B[9]==1?q=q[Xd(B[0])].apply(q,B[3]):q=O.length==1&&Dy(O)?q[M]():q.thru(O)}return function(){var G=arguments,Q=G[0];if(q&&G.length==1&&Ee(Q))return q.plant(Q).value();for(var X=0,re=d?l[X].apply(this,G):Q;++X<d;)re=l[X].call(this,re);return re}})}function Kd(o,l,d,v,w,O,q,M,B,G){var Q=l&K,X=l&C,re=l&x,ue=l&(T|j),me=l&k,Pe=re?t:$u(o);function ge(){for(var De=arguments.length,je=H(De),Yr=De;Yr--;)je[Yr]=arguments[Yr];if(ue)var gr=Ka(ge),Jr=_g(je,gr);if(v&&(je=Aw(je,v,w,ue)),O&&(je=Tw(je,O,q,ue)),De-=Jr,ue&&De<G){var Tt=Br(je,gr);return jw(o,l,Kd,ge.placeholder,d,je,Tt,M,B,G-De)}var Mn=X?d:this,Ui=re?Mn[o]:o;return De=je.length,M?je=ZA(je,M):me&&De>1&&je.reverse(),Q&&B<De&&(je.length=B),this&&this!==Nt&&this instanceof ge&&(Ui=Pe||$u(Ui)),Ui.apply(Mn,je)}return ge}function Fw(o,l){return function(d,v){return Tn(d,o,l(v),{})}}function Gd(o,l){return function(d,v){var w;if(d===t&&v===t)return l;if(d!==t&&(w=d),v!==t){if(w===t)return v;typeof d=="string"||typeof v=="string"?(d=Vr(d),v=Vr(v)):(d=Ew(d),v=Ew(v)),w=o(d,v)}return w}}function Py(o){return Di(function(l){return l=et(l,nr(pe())),Te(function(d){var v=this;return o(l,function(w){return Jt(w,v,d)})})})}function Qd(o,l){l=l===t?" ":Vr(l);var d=l.length;if(d<2)return d?wy(l,o):l;var v=wy(l,Na(o/li(l)));return en(l)?Ts(hr(v),0,o).join(""):v.slice(0,o)}function qA(o,l,d,v){var w=l&C,O=$u(o);function q(){for(var M=-1,B=arguments.length,G=-1,Q=v.length,X=H(Q+B),re=this&&this!==Nt&&this instanceof q?O:o;++G<Q;)X[G]=v[G];for(;B--;)X[G++]=arguments[++M];return Jt(re,w?d:this,X)}return q}function Lw(o){return function(l,d,v){return v&&typeof v!="number"&&mr(l,d,v)&&(d=v=t),l=ji(l),d===t?(d=l,l=0):d=ji(d),v=v===t?l<d?1:-1:ji(v),vA(l,d,v,o)}}function Zd(o){return function(l,d){return typeof l=="string"&&typeof d=="string"||(l=un(l),d=un(d)),o(l,d)}}function jw(o,l,d,v,w,O,q,M,B,G){var Q=l&T,X=Q?q:t,re=Q?t:q,ue=Q?O:t,me=Q?t:O;l|=Q?Y:V,l&=~(Q?V:Y),l&A||(l&=~(C|x));var Pe=[o,l,w,ue,X,me,re,M,B,G],ge=d.apply(t,Pe);return Dy(o)&&Zw(ge,Pe),ge.placeholder=v,Xw(ge,o,l)}function ky(o){var l=kt[o];return function(d,v){if(d=un(d),v=v==null?0:vt(Ce(v),292),v&&bo(d)){var w=(Ge(d)+"e").split("e"),O=l(w[0]+"e"+(+w[1]+v));return w=(Ge(O)+"e").split("e"),+(w[0]+"e"+(+w[1]-v))}return l(d)}}var $A=Rs&&1/Es(new Rs([,-0]))[1]==ie?function(o){return new Rs(o)}:Zy;function Uw(o){return function(l){var d=ir(l);return d==rr?wu(l):d==gt?Ig(l):bg(l,o(l))}}function Ni(o,l,d,v,w,O,q,M){var B=l&x;if(!B&&typeof o!="function")throw new wr(i);var G=v?v.length:0;if(G||(l&=~(Y|V),v=w=t),q=q===t?q:Et(Ce(q),0),M=M===t?M:Ce(M),G-=w?w.length:0,l&V){var Q=v,X=w;v=w=t}var re=B?t:qy(o),ue=[o,l,d,v,w,Q,X,O,q,M];if(re&&KA(ue,re),o=ue[0],l=ue[1],d=ue[2],v=ue[3],w=ue[4],M=ue[9]=ue[9]===t?B?0:o.length:Et(ue[9]-G,0),!M&&l&(T|j)&&(l&=~(T|j)),!l||l==C)var me=AA(o,l,d);else l==T||l==j?me=TA(o,l,M):(l==Y||l==(C|Y))&&!w.length?me=qA(o,l,d,v):me=Kd.apply(t,ue);var Pe=re?_w:Zw;return Xw(Pe(me,ue),o,l)}function Bw(o,l,d,v){return o===t||$n(o,Cs[d])&&!ze.call(v,d)?l:o}function Hw(o,l,d,v,w,O){return St(o)&&St(l)&&(O.set(l,o),Oe(o,l,t,Hw,O),O.delete(l)),o}function MA(o){return Du(o)?t:o}function Vw(o,l,d,v,w,O){var q=d&S,M=o.length,B=l.length;if(M!=B&&!(q&&B>M))return!1;var G=O.get(o),Q=O.get(l);if(G&&Q)return G==l&&Q==o;var X=-1,re=!0,ue=d&_?new qi:t;for(O.set(o,l),O.set(l,o);++X<M;){var me=o[X],Pe=l[X];if(v)var ge=q?v(Pe,me,X,l,o,O):v(me,Pe,X,o,l,O);if(ge!==t){if(ge)continue;re=!1;break}if(ue){if(!gu(l,function(De,je){if(!ws(ue,je)&&(me===De||w(me,De,d,v,O)))return ue.push(je)})){re=!1;break}}else if(!(me===Pe||w(me,Pe,d,v,O))){re=!1;break}}return O.delete(o),O.delete(l),re}function NA(o,l,d,v,w,O,q){switch(d){case ri:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case cs:return!(o.byteLength!=l.byteLength||!O(new qa(o),new qa(l)));case ct:case _n:case Qr:return $n(+o,+l);case jt:return o.name==l.name&&o.message==l.message;case ls:case Ri:return o==l+"";case rr:var M=wu;case gt:var B=v&S;if(M||(M=Es),o.size!=l.size&&!B)return!1;var G=q.get(o);if(G)return G==l;v|=_,q.set(o,l);var Q=Vw(M(o),M(l),v,w,O,q);return q.delete(o),Q;case ma:if(Co)return Co.call(o)==Co.call(l)}return!1}function DA(o,l,d,v,w,O){var q=d&S,M=Ay(o),B=M.length,G=Ay(l),Q=G.length;if(B!=Q&&!q)return!1;for(var X=B;X--;){var re=M[X];if(!(q?re in l:ze.call(l,re)))return!1}var ue=O.get(o),me=O.get(l);if(ue&&me)return ue==l&&me==o;var Pe=!0;O.set(o,l),O.set(l,o);for(var ge=q;++X<B;){re=M[X];var De=o[re],je=l[re];if(v)var Yr=q?v(je,De,re,l,o,O):v(De,je,re,o,l,O);if(!(Yr===t?De===je||w(De,je,d,v,O):Yr)){Pe=!1;break}ge||(ge=re=="constructor")}if(Pe&&!ge){var gr=o.constructor,Jr=l.constructor;gr!=Jr&&"constructor"in o&&"constructor"in l&&!(typeof gr=="function"&&gr instanceof gr&&typeof Jr=="function"&&Jr instanceof Jr)&&(Pe=!1)}return O.delete(o),O.delete(l),Pe}function Di(o){return Ly(Gw(o,t,sE),o+"")}function Ay(o){return Vd(o,Yt,My)}function Ty(o){return Vd(o,Ir,Ww)}var qy=La?function(o){return La.get(o)}:Zy;function Xd(o){for(var l=o.name+"",d=Is[l],v=ze.call(Is,l)?d.length:0;v--;){var w=d[v],O=w.func;if(O==null||O==o)return w.name}return l}function Ka(o){var l=ze.call(I,"placeholder")?I:o;return l.placeholder}function pe(){var o=I.iteratee||Gy;return o=o===Gy?y:o,arguments.length?o(arguments[0],arguments[1]):o}function eh(o,l){var d=o.__data__;return WA(l)?d[typeof l=="string"?"string":"hash"]:d.map}function $y(o){for(var l=Yt(o),d=l.length;d--;){var v=l[d],w=o[v];l[d]=[v,w,zw(w)]}return l}function Oo(o,l){var d=Cg(o,l);return Io(d)?d:t}function FA(o){var l=ze.call(o,Ti),d=o[Ti];try{o[Ti]=t;var v=!0}catch{}var w=Aa.call(o);return v&&(l?o[Ti]=d:delete o[Ti]),w}var My=Da?function(o){return o==null?[]:(o=Ae(o),ai(Da(o),function(l){return Id.call(o,l)}))}:Xy,Ww=Da?function(o){for(var l=[];o;)Xr(l,My(o)),o=$a(o);return l}:Xy,ir=zt;(Eu&&ir(new Eu(new ArrayBuffer(1)))!=ri||_o&&ir(new _o)!=rr||Cu&&ir(Cu.resolve())!=Lf||Rs&&ir(new Rs)!=gt||wo&&ir(new wo)!=us)&&(ir=function(o){var l=zt(o),d=l==wn?o.constructor:t,v=d?Po(d):"";if(v)switch(v){case Bg:return ri;case Hg:return rr;case Vg:return Lf;case Wg:return gt;case Yg:return us}return l});function LA(o,l,d){for(var v=-1,w=d.length;++v<w;){var O=d[v],q=O.size;switch(O.type){case"drop":o+=q;break;case"dropRight":l-=q;break;case"take":l=vt(l,o+q);break;case"takeRight":o=Et(o,l-q);break}}return{start:o,end:l}}function jA(o){var l=o.match(Vt);return l?l[1].split(Cn):[]}function Yw(o,l,d){l=As(l,o);for(var v=-1,w=l.length,O=!1;++v<w;){var q=mi(l[v]);if(!(O=o!=null&&d(o,q)))break;o=o[q]}return O||++v!=w?O:(w=o==null?0:o.length,!!w&&ah(w)&&Fi(q,w)&&(Ee(o)||ko(o)))}function UA(o){var l=o.length,d=new o.constructor(l);return l&&typeof o[0]=="string"&&ze.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function Jw(o){return typeof o.constructor=="function"&&!Mu(o)?Os($a(o)):{}}function BA(o,l,d){var v=o.constructor;switch(l){case cs:return Oy(o);case ct:case _n:return new v(+o);case ri:return xA(o,d);case fs:case Xe:case ga:case ya:case ds:case uo:case hs:case ni:case ps:return Pw(o,d);case rr:return new v;case Qr:case Ri:return new v(o);case ls:return RA(o);case gt:return new v;case ma:return IA(o)}}function HA(o,l){var d=l.length;if(!d)return o;var v=d-1;return l[v]=(d>1?"& ":"")+l[v],l=l.join(d>2?", ":" "),o.replace(ba,`{
|
|
1
|
+
var dN=Object.create;var DE=Object.defineProperty;var hN=Object.getOwnPropertyDescriptor;var pN=Object.getOwnPropertyNames;var mN=Object.getPrototypeOf,gN=Object.prototype.hasOwnProperty;var qt=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var F=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var yN=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pN(e))!gN.call(t,i)&&i!==r&&DE(t,i,{get:()=>e[i],enumerable:!(n=hN(e,i))||n.enumerable});return t};var tv=(t,e,r)=>(r=t!=null?dN(mN(t)):{},yN(e||!t||!t.__esModule?DE(r,"default",{value:t,enumerable:!0}):r,t));var ZE=F((el,zu)=>{(function(){var t,e="4.17.21",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",s="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",h=1,g=2,m=4,S=1,_=2,C=1,x=2,A=4,T=8,j=16,Y=32,V=64,K=128,ee=256,k=512,E=30,P="...",N=800,D=16,L=1,z=2,Z=3,ie=1/0,fe=9007199254740991,bt=17976931348623157e292,we=NaN,he=4294967295,Ze=he-1,_t=he>>>1,Mt=[["ary",K],["bind",C],["bindKey",x],["curry",T],["curryRight",j],["flip",k],["partial",Y],["partialRight",V],["rearg",ee]],le="[object Arguments]",ei="[object Array]",su="[object AsyncFunction]",ct="[object Boolean]",_n="[object Date]",as="[object DOMException]",jt="[object Error]",ft="[object Function]",ti="[object GeneratorFunction]",rr="[object Map]",Qr="[object Number]",Lm="[object Null]",wn="[object Object]",Lf="[object Promise]",jm="[object Proxy]",ls="[object RegExp]",gt="[object Set]",Ri="[object String]",ma="[object Symbol]",Um="[object Undefined]",us="[object WeakMap]",dr="[object WeakSet]",cs="[object ArrayBuffer]",ri="[object DataView]",fs="[object Float32Array]",Xe="[object Float64Array]",ga="[object Int8Array]",ya="[object Int16Array]",ds="[object Int32Array]",uo="[object Uint8Array]",hs="[object Uint8ClampedArray]",ni="[object Uint16Array]",ps="[object Uint32Array]",Bm=/\b__p \+= '';/g,va=/\b(__p \+=) '' \+/g,Hm=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ms=/&(?:amp|lt|gt|quot|#39);/g,Ii=/[&<>"']/g,ou=RegExp(ms.source),Sa=RegExp(Ii.source),oe=/<%-([\s\S]+?)%>/g,Vm=/<%([\s\S]+?)%>/g,jf=/<%=([\s\S]+?)%>/g,En=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_r=/^\w*$/,$e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,co=/[\\^$.*+?()[\]{}|]/g,Ke=RegExp(co.source),Oi=/^\s+/,Wm=/\s/,ba=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vt=/\{\n\/\* \[wrapped with (.+)\] \*/,Cn=/,? & /,Zr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Pt=/[()=,{}\[\]\/\s]/,jr=/\\(\\)?/g,xn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ii=/\w*$/,Ym=/^[-+]0x[0-9a-f]+$/i,Jm=/^0b[01]+$/i,fo=/^\[object .+?Constructor\]$/,Uf=/^0o[0-7]+$/i,zm=/^(?:0|[1-9]\d*)$/,gs=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,si=/($^)/,Bf=/['\n\r\u2028\u2029\\]/g,_a="\\ud800-\\udfff",Km="\\u0300-\\u036f",Gm="\\ufe20-\\ufe2f",yt="\\u20d0-\\u20ff",wa=Km+Gm+yt,Hf="\\u2700-\\u27bf",au="a-z\\xdf-\\xf6\\xf8-\\xff",Vf="\\xac\\xb1\\xd7\\xf7",Qm="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Zm="\\u2000-\\u206f",Xm=" \\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",Wf="A-Z\\xc0-\\xd6\\xd8-\\xde",Yf="\\ufe0e\\ufe0f",Jf=Vf+Qm+Zm+Xm,Ea="['\u2019]",zf="["+_a+"]",Kf="["+Jf+"]",Ca="["+wa+"]",Gf="\\d+",Qf="["+Hf+"]",Zf="["+au+"]",ys="[^"+_a+Jf+Gf+Hf+au+Wf+"]",vs="\\ud83c[\\udffb-\\udfff]",Xf="(?:"+Ca+"|"+vs+")",Ss="[^"+_a+"]",Ur="(?:\\ud83c[\\udde6-\\uddff]){2}",lu="[\\ud800-\\udbff][\\udc00-\\udfff]",bs="["+Wf+"]",ed="\\u200d",td="(?:"+Zf+"|"+ys+")",eg="(?:"+bs+"|"+ys+")",rd="(?:"+Ea+"(?:d|ll|m|re|s|t|ve))?",nd="(?:"+Ea+"(?:D|LL|M|RE|S|T|VE))?",id=Xf+"?",xa="["+Yf+"]?",tg="(?:"+ed+"(?:"+[Ss,Ur,lu].join("|")+")"+xa+id+")*",sd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",rg="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",od=xa+id+tg,ng="(?:"+[Qf,Ur,lu].join("|")+")"+od,ig="(?:"+[Ss+Ca+"?",Ca,Ur,lu,zf].join("|")+")",sg=RegExp(Ea,"g"),og=RegExp(Ca,"g"),uu=RegExp(vs+"(?="+vs+")|"+ig+od,"g"),ag=RegExp([bs+"?"+Zf+"+"+rd+"(?="+[Kf,bs,"$"].join("|")+")",eg+"+"+nd+"(?="+[Kf,bs+td,"$"].join("|")+")",bs+"?"+td+"+"+rd,bs+"+"+nd,rg,sd,Gf,ng].join("|"),"g"),lg=RegExp("["+ed+_a+wa+Yf+"]"),ug=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,cg=["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"],fg=-1,st={};st[fs]=st[Xe]=st[ga]=st[ya]=st[ds]=st[uo]=st[hs]=st[ni]=st[ps]=!0,st[le]=st[ei]=st[cs]=st[ct]=st[ri]=st[_n]=st[jt]=st[ft]=st[rr]=st[Qr]=st[wn]=st[ls]=st[gt]=st[Ri]=st[us]=!1;var rt={};rt[le]=rt[ei]=rt[cs]=rt[ri]=rt[ct]=rt[_n]=rt[fs]=rt[Xe]=rt[ga]=rt[ya]=rt[ds]=rt[rr]=rt[Qr]=rt[wn]=rt[ls]=rt[gt]=rt[Ri]=rt[ma]=rt[uo]=rt[hs]=rt[ni]=rt[ps]=!0,rt[jt]=rt[ft]=rt[us]=!1;var dg={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},cu={"&":"&","<":"<",">":">",'"':""","'":"'"},fu={"&":"&","<":"<",">":">",""":'"',"'":"'"},hg={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ad=parseFloat,ld=parseInt,ud=typeof global=="object"&&global&&global.Object===Object&&global,pg=typeof self=="object"&&self&&self.Object===Object&&self,Nt=ud||pg||Function("return this")(),du=typeof el=="object"&&el&&!el.nodeType&&el,oi=du&&typeof zu=="object"&&zu&&!zu.nodeType&&zu,ot=oi&&oi.exports===du,Pi=ot&&ud.process,Wt=function(){try{var U=oi&&oi.require&&oi.require("util").types;return U||Pi&&Pi.binding&&Pi.binding("util")}catch{}}(),cd=Wt&&Wt.isArrayBuffer,hu=Wt&&Wt.isDate,fd=Wt&&Wt.isMap,dd=Wt&&Wt.isRegExp,ho=Wt&&Wt.isSet,Rn=Wt&&Wt.isTypedArray;function Jt(U,J,H){switch(H.length){case 0:return U.call(J);case 1:return U.call(J,H[0]);case 2:return U.call(J,H[0],H[1]);case 3:return U.call(J,H[0],H[1],H[2])}return U.apply(J,H)}function mg(U,J,H,ae){for(var ve=-1,We=U==null?0:U.length;++ve<We;){var kt=U[ve];J(ae,kt,H(kt),U)}return ae}function wt(U,J){for(var H=-1,ae=U==null?0:U.length;++H<ae&&J(U[H],H,U)!==!1;);return U}function gg(U,J){for(var H=U==null?0:U.length;H--&&J(U[H],H,U)!==!1;);return U}function Ra(U,J){for(var H=-1,ae=U==null?0:U.length;++H<ae;)if(!J(U[H],H,U))return!1;return!0}function ai(U,J){for(var H=-1,ae=U==null?0:U.length,ve=0,We=[];++H<ae;){var kt=U[H];J(kt,H,U)&&(We[ve++]=kt)}return We}function Ia(U,J){var H=U==null?0:U.length;return!!H&&_s(U,J,0)>-1}function pu(U,J,H){for(var ae=-1,ve=U==null?0:U.length;++ae<ve;)if(H(J,U[ae]))return!0;return!1}function et(U,J){for(var H=-1,ae=U==null?0:U.length,ve=Array(ae);++H<ae;)ve[H]=J(U[H],H,U);return ve}function Xr(U,J){for(var H=-1,ae=J.length,ve=U.length;++H<ae;)U[ve+H]=J[H];return U}function mu(U,J,H,ae){var ve=-1,We=U==null?0:U.length;for(ae&&We&&(H=U[++ve]);++ve<We;)H=J(H,U[ve],ve,U);return H}function yg(U,J,H,ae){var ve=U==null?0:U.length;for(ae&&ve&&(H=U[--ve]);ve--;)H=J(H,U[ve],ve,U);return H}function gu(U,J){for(var H=-1,ae=U==null?0:U.length;++H<ae;)if(J(U[H],H,U))return!0;return!1}var hd=yu("length");function vg(U){return U.split("")}function Sg(U){return U.match(Zr)||[]}function pd(U,J,H){var ae;return H(U,function(ve,We,kt){if(J(ve,We,kt))return ae=We,!1}),ae}function Oa(U,J,H,ae){for(var ve=U.length,We=H+(ae?1:-1);ae?We--:++We<ve;)if(J(U[We],We,U))return We;return-1}function _s(U,J,H){return J===J?_d(U,J,H):Oa(U,gd,H)}function md(U,J,H,ae){for(var ve=H-1,We=U.length;++ve<We;)if(ae(U[ve],J))return ve;return-1}function gd(U){return U!==U}function ki(U,J){var H=U==null?0:U.length;return H?Su(U,J)/H:we}function yu(U){return function(J){return J==null?t:J[U]}}function po(U){return function(J){return U==null?t:U[J]}}function yd(U,J,H,ae,ve){return ve(U,function(We,kt,Ae){H=ae?(ae=!1,We):J(H,We,kt,Ae)}),H}function vu(U,J){var H=U.length;for(U.sort(J);H--;)U[H]=U[H].value;return U}function Su(U,J){for(var H,ae=-1,ve=U.length;++ae<ve;){var We=J(U[ae]);We!==t&&(H=H===t?We:H+We)}return H}function bu(U,J){for(var H=-1,ae=Array(U);++H<U;)ae[H]=J(H);return ae}function bg(U,J){return et(J,function(H){return[H,U[H]]})}function vd(U){return U&&U.slice(0,Pa(U)+1).replace(Oi,"")}function nr(U){return function(J){return U(J)}}function _u(U,J){return et(J,function(H){return U[H]})}function ws(U,J){return U.has(J)}function nt(U,J){for(var H=-1,ae=U.length;++H<ae&&_s(J,U[H],0)>-1;);return H}function Sd(U,J){for(var H=U.length;H--&&_s(J,U[H],0)>-1;);return H}function _g(U,J){for(var H=U.length,ae=0;H--;)U[H]===J&&++ae;return ae}var bd=po(dg),wg=po(cu);function Eg(U){return"\\"+hg[U]}function Cg(U,J){return U==null?t:U[J]}function en(U){return lg.test(U)}function xg(U){return ug.test(U)}function Rg(U){for(var J,H=[];!(J=U.next()).done;)H.push(J.value);return H}function wu(U){var J=-1,H=Array(U.size);return U.forEach(function(ae,ve){H[++J]=[ve,ae]}),H}function mo(U,J){return function(H){return U(J(H))}}function Br(U,J){for(var H=-1,ae=U.length,ve=0,We=[];++H<ae;){var kt=U[H];(kt===J||kt===f)&&(U[H]=f,We[ve++]=H)}return We}function Es(U){var J=-1,H=Array(U.size);return U.forEach(function(ae){H[++J]=ae}),H}function Ig(U){var J=-1,H=Array(U.size);return U.forEach(function(ae){H[++J]=[ae,ae]}),H}function _d(U,J,H){for(var ae=H-1,ve=U.length;++ae<ve;)if(U[ae]===J)return ae;return-1}function Og(U,J,H){for(var ae=H+1;ae--;)if(U[ae]===J)return ae;return ae}function li(U){return en(U)?kg(U):hd(U)}function hr(U){return en(U)?Ag(U):vg(U)}function Pa(U){for(var J=U.length;J--&&Wm.test(U.charAt(J)););return J}var Pg=po(fu);function kg(U){for(var J=uu.lastIndex=0;uu.test(U);)++J;return J}function Ag(U){return U.match(uu)||[]}function Tg(U){return U.match(ag)||[]}var qg=function U(J){J=J==null?Nt:ui.defaults(Nt.Object(),J,ui.pick(Nt,cg));var H=J.Array,ae=J.Date,ve=J.Error,We=J.Function,kt=J.Math,Ae=J.Object,In=J.RegExp,wd=J.String,wr=J.TypeError,go=H.prototype,Ed=We.prototype,Cs=Ae.prototype,ka=J["__core-js_shared__"],yo=Ed.toString,ze=Cs.hasOwnProperty,$g=0,Cd=function(){var o=/[^.]+$/.exec(ka&&ka.keys&&ka.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Aa=Cs.toString,Mg=yo.call(Ae),Ng=Nt._,Dg=In("^"+yo.call(ze).replace(co,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ta=ot?J.Buffer:t,ci=J.Symbol,qa=J.Uint8Array,xd=Ta?Ta.allocUnsafe:t,$a=mo(Ae.getPrototypeOf,Ae),Rd=Ae.create,Id=Cs.propertyIsEnumerable,Ai=go.splice,Od=ci?ci.isConcatSpreadable:t,vo=ci?ci.iterator:t,Ti=ci?ci.toStringTag:t,Ma=function(){try{var o=Oo(Ae,"defineProperty");return o({},"",{}),o}catch{}}(),Fg=J.clearTimeout!==Nt.clearTimeout&&J.clearTimeout,Lg=ae&&ae.now!==Nt.Date.now&&ae.now,jg=J.setTimeout!==Nt.setTimeout&&J.setTimeout,Na=kt.ceil,So=kt.floor,Da=Ae.getOwnPropertySymbols,Pd=Ta?Ta.isBuffer:t,bo=J.isFinite,xs=go.join,Fa=mo(Ae.keys,Ae),Et=kt.max,vt=kt.min,kd=ae.now,Ad=J.parseInt,Td=kt.random,Ug=go.reverse,Eu=Oo(J,"DataView"),_o=Oo(J,"Map"),Cu=Oo(J,"Promise"),Rs=Oo(J,"Set"),wo=Oo(J,"WeakMap"),Eo=Oo(Ae,"create"),La=wo&&new wo,Is={},Bg=Po(Eu),Hg=Po(_o),Vg=Po(Cu),Wg=Po(Rs),Yg=Po(wo),ja=ci?ci.prototype:t,Co=ja?ja.valueOf:t,qd=ja?ja.toString:t;function I(o){if(Ct(o)&&!Ee(o)&&!(o instanceof Ie)){if(o instanceof Er)return o;if(ze.call(o,"__wrapped__"))return rE(o)}return new Er(o)}var Os=function(){function o(){}return function(l){if(!St(l))return{};if(Rd)return Rd(l);o.prototype=l;var d=new o;return o.prototype=t,d}}();function Ua(){}function Er(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}I.templateSettings={escape:oe,evaluate:Vm,interpolate:jf,variable:"",imports:{_:I}},I.prototype=Ua.prototype,I.prototype.constructor=I,Er.prototype=Os(Ua.prototype),Er.prototype.constructor=Er;function Ie(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=he,this.__views__=[]}function Jg(){var o=new Ie(this.__wrapped__);return o.__actions__=xr(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=xr(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=xr(this.__views__),o}function zg(){if(this.__filtered__){var o=new Ie(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function Kg(){var o=this.__wrapped__.value(),l=this.__dir__,d=Ee(o),v=l<0,w=d?o.length:0,O=LA(0,w,this.__views__),q=O.start,M=O.end,B=M-q,G=v?M:q-1,Q=this.__iteratees__,X=Q.length,re=0,ue=vt(B,this.__takeCount__);if(!d||!v&&w==B&&ue==B)return xw(o,this.__actions__);var me=[];e:for(;B--&&re<ue;){G+=l;for(var Pe=-1,ge=o[G];++Pe<X;){var De=Q[Pe],je=De.iteratee,Yr=De.type,gr=je(ge);if(Yr==z)ge=gr;else if(!gr){if(Yr==L)continue e;break e}}me[re++]=ge}return me}Ie.prototype=Os(Ua.prototype),Ie.prototype.constructor=Ie;function On(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var v=o[l];this.set(v[0],v[1])}}function Ba(){this.__data__=Eo?Eo(null):{},this.size=0}function Gg(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function Qg(o){var l=this.__data__;if(Eo){var d=l[o];return d===a?t:d}return ze.call(l,o)?l[o]:t}function Zg(o){var l=this.__data__;return Eo?l[o]!==t:ze.call(l,o)}function Xg(o,l){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=Eo&&l===t?a:l,this}On.prototype.clear=Ba,On.prototype.delete=Gg,On.prototype.get=Qg,On.prototype.has=Zg,On.prototype.set=Xg;function Pn(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var v=o[l];this.set(v[0],v[1])}}function ey(){this.__data__=[],this.size=0}function $d(o){var l=this.__data__,d=Cr(l,o);if(d<0)return!1;var v=l.length-1;return d==v?l.pop():Ai.call(l,d,1),--this.size,!0}function ty(o){var l=this.__data__,d=Cr(l,o);return d<0?t:l[d][1]}function ry(o){return Cr(this.__data__,o)>-1}function Md(o,l){var d=this.__data__,v=Cr(d,o);return v<0?(++this.size,d.push([o,l])):d[v][1]=l,this}Pn.prototype.clear=ey,Pn.prototype.delete=$d,Pn.prototype.get=ty,Pn.prototype.has=ry,Pn.prototype.set=Md;function kn(o){var l=-1,d=o==null?0:o.length;for(this.clear();++l<d;){var v=o[l];this.set(v[0],v[1])}}function ny(){this.size=0,this.__data__={hash:new On,map:new(_o||Pn),string:new On}}function iy(o){var l=eh(this,o).delete(o);return this.size-=l?1:0,l}function fi(o){return eh(this,o).get(o)}function Nd(o){return eh(this,o).has(o)}function sy(o,l){var d=eh(this,o),v=d.size;return d.set(o,l),this.size+=d.size==v?0:1,this}kn.prototype.clear=ny,kn.prototype.delete=iy,kn.prototype.get=fi,kn.prototype.has=Nd,kn.prototype.set=sy;function qi(o){var l=-1,d=o==null?0:o.length;for(this.__data__=new kn;++l<d;)this.add(o[l])}function oy(o){return this.__data__.set(o,a),this}function te(o){return this.__data__.has(o)}qi.prototype.add=qi.prototype.push=oy,qi.prototype.has=te;function Hr(o){var l=this.__data__=new Pn(o);this.size=l.size}function ay(){this.__data__=new Pn,this.size=0}function Dd(o){var l=this.__data__,d=l.delete(o);return this.size=l.size,d}function Be(o){return this.__data__.get(o)}function Ha(o){return this.__data__.has(o)}function Fd(o,l){var d=this.__data__;if(d instanceof Pn){var v=d.__data__;if(!_o||v.length<r-1)return v.push([o,l]),this.size=++d.size,this;d=this.__data__=new kn(v)}return d.set(o,l),this.size=d.size,this}Hr.prototype.clear=ay,Hr.prototype.delete=Dd,Hr.prototype.get=Be,Hr.prototype.has=Ha,Hr.prototype.set=Fd;function Va(o,l){var d=Ee(o),v=!d&&ko(o),w=!d&&!v&&qs(o),O=!d&&!v&&!w&&Ga(o),q=d||v||w||O,M=q?bu(o.length,wd):[],B=M.length;for(var G in o)(l||ze.call(o,G))&&!(q&&(G=="length"||w&&(G=="offset"||G=="parent")||O&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||Fi(G,B)))&&M.push(G);return M}function Ld(o){var l=o.length;return l?o[_y(0,l-1)]:t}function ly(o,l){return th(xr(o),$i(l,0,o.length))}function uy(o){return th(xr(o))}function xu(o,l,d){(d!==t&&!$n(o[l],d)||d===t&&!(l in o))&&An(o,l,d)}function xo(o,l,d){var v=o[l];(!(ze.call(o,l)&&$n(v,d))||d===t&&!(l in o))&&An(o,l,d)}function Cr(o,l){for(var d=o.length;d--;)if($n(o[d][0],l))return d;return-1}function cy(o,l,d,v){return di(o,function(w,O,q){l(v,w,d(w),q)}),v}function Ru(o,l){return o&&pi(l,Yt(l),o)}function fy(o,l){return o&&pi(l,Ir(l),o)}function An(o,l,d){l=="__proto__"&&Ma?Ma(o,l,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[l]=d}function Wa(o,l){for(var d=-1,v=l.length,w=H(v),O=o==null;++d<v;)w[d]=O?t:Yy(o,l[d]);return w}function $i(o,l,d){return o===o&&(d!==t&&(o=o<=d?o:d),l!==t&&(o=o>=l?o:l)),o}function pr(o,l,d,v,w,O){var q,M=l&h,B=l&g,G=l&m;if(d&&(q=w?d(o,v,w,O):d(o)),q!==t)return q;if(!St(o))return o;var Q=Ee(o);if(Q){if(q=UA(o),!M)return xr(o,q)}else{var X=ir(o),re=X==ft||X==ti;if(qs(o))return Ow(o,M);if(X==wn||X==le||re&&!w){if(q=B||re?{}:Jw(o),!M)return B?kA(o,fy(q,o)):PA(o,Ru(q,o))}else{if(!rt[X])return w?o:{};q=BA(o,X,M)}}O||(O=new Hr);var ue=O.get(o);if(ue)return ue;O.set(o,q),wE(o)?o.forEach(function(ge){q.add(pr(ge,l,d,ge,o,O))}):bE(o)&&o.forEach(function(ge,De){q.set(De,pr(ge,l,d,De,o,O))});var me=G?B?Ty:Ay:B?Ir:Yt,Pe=Q?t:me(o);return wt(Pe||o,function(ge,De){Pe&&(De=ge,ge=o[De]),xo(q,De,pr(ge,l,d,De,o,O))}),q}function Iu(o){var l=Yt(o);return function(d){return jd(d,o,l)}}function jd(o,l,d){var v=d.length;if(o==null)return!v;for(o=Ae(o);v--;){var w=d[v],O=l[w],q=o[w];if(q===t&&!(w in o)||!O(q))return!1}return!0}function tn(o,l,d){if(typeof o!="function")throw new wr(i);return Nu(function(){o.apply(t,d)},l)}function Ps(o,l,d,v){var w=-1,O=Ia,q=!0,M=o.length,B=[],G=l.length;if(!M)return B;d&&(l=et(l,nr(d))),v?(O=pu,q=!1):l.length>=r&&(O=ws,q=!1,l=new qi(l));e:for(;++w<M;){var Q=o[w],X=d==null?Q:d(Q);if(Q=v||Q!==0?Q:0,q&&X===X){for(var re=G;re--;)if(l[re]===X)continue e;B.push(Q)}else O(l,X,v)||B.push(Q)}return B}var di=qw(rn),Ud=qw(Pu,!0);function dy(o,l){var d=!0;return di(o,function(v,w,O){return d=!!l(v,w,O),d}),d}function Ya(o,l,d){for(var v=-1,w=o.length;++v<w;){var O=o[v],q=l(O);if(q!=null&&(M===t?q===q&&!Wr(q):d(q,M)))var M=q,B=O}return B}function hy(o,l,d,v){var w=o.length;for(d=Ce(d),d<0&&(d=-d>w?0:w+d),v=v===t||v>w?w:Ce(v),v<0&&(v+=w),v=d>v?0:CE(v);d<v;)o[d++]=l;return o}function Bd(o,l){var d=[];return di(o,function(v,w,O){l(v,w,O)&&d.push(v)}),d}function Ut(o,l,d,v,w){var O=-1,q=o.length;for(d||(d=VA),w||(w=[]);++O<q;){var M=o[O];l>0&&d(M)?l>1?Ut(M,l-1,d,v,w):Xr(w,M):v||(w[w.length]=M)}return w}var Ou=$w(),Hd=$w(!0);function rn(o,l){return o&&Ou(o,l,Yt)}function Pu(o,l){return o&&Hd(o,l,Yt)}function nn(o,l){return ai(l,function(d){return Li(o[d])})}function Mi(o,l){l=As(l,o);for(var d=0,v=l.length;o!=null&&d<v;)o=o[mi(l[d++])];return d&&d==v?o:t}function Vd(o,l,d){var v=l(o);return Ee(o)?v:Xr(v,d(o))}function zt(o){return o==null?o===t?Um:Lm:Ti&&Ti in Ae(o)?FA(o):QA(o)}function ku(o,l){return o>l}function py(o,l){return o!=null&&ze.call(o,l)}function my(o,l){return o!=null&&l in Ae(o)}function gy(o,l,d){return o>=vt(l,d)&&o<Et(l,d)}function Au(o,l,d){for(var v=d?pu:Ia,w=o[0].length,O=o.length,q=O,M=H(O),B=1/0,G=[];q--;){var Q=o[q];q&&l&&(Q=et(Q,nr(l))),B=vt(Q.length,B),M[q]=!d&&(l||w>=120&&Q.length>=120)?new qi(q&&Q):t}Q=o[0];var X=-1,re=M[0];e:for(;++X<w&&G.length<B;){var ue=Q[X],me=l?l(ue):ue;if(ue=d||ue!==0?ue:0,!(re?ws(re,me):v(G,me,d))){for(q=O;--q;){var Pe=M[q];if(!(Pe?ws(Pe,me):v(o[q],me,d)))continue e}re&&re.push(me),G.push(ue)}}return G}function Tn(o,l,d,v){return rn(o,function(w,O,q){l(v,d(w),O,q)}),v}function sn(o,l,d){l=As(l,o),o=Qw(o,l);var v=o==null?o:o[mi(ln(l))];return v==null?t:Jt(v,o,d)}function Wd(o){return Ct(o)&&zt(o)==le}function yy(o){return Ct(o)&&zt(o)==cs}function vy(o){return Ct(o)&&zt(o)==_n}function Ro(o,l,d,v,w){return o===l?!0:o==null||l==null||!Ct(o)&&!Ct(l)?o!==o&&l!==l:Sy(o,l,d,v,Ro,w)}function Sy(o,l,d,v,w,O){var q=Ee(o),M=Ee(l),B=q?ei:ir(o),G=M?ei:ir(l);B=B==le?wn:B,G=G==le?wn:G;var Q=B==wn,X=G==wn,re=B==G;if(re&&qs(o)){if(!qs(l))return!1;q=!0,Q=!1}if(re&&!Q)return O||(O=new Hr),q||Ga(o)?Vw(o,l,d,v,w,O):NA(o,l,B,d,v,w,O);if(!(d&S)){var ue=Q&&ze.call(o,"__wrapped__"),me=X&&ze.call(l,"__wrapped__");if(ue||me){var Pe=ue?o.value():o,ge=me?l.value():l;return O||(O=new Hr),w(Pe,ge,d,v,O)}}return re?(O||(O=new Hr),DA(o,l,d,v,w,O)):!1}function Tu(o){return Ct(o)&&ir(o)==rr}function hi(o,l,d,v){var w=d.length,O=w,q=!v;if(o==null)return!O;for(o=Ae(o);w--;){var M=d[w];if(q&&M[2]?M[1]!==o[M[0]]:!(M[0]in o))return!1}for(;++w<O;){M=d[w];var B=M[0],G=o[B],Q=M[1];if(q&&M[2]){if(G===t&&!(B in o))return!1}else{var X=new Hr;if(v)var re=v(G,Q,B,o,l,X);if(!(re===t?Ro(Q,G,S|_,v,X):re))return!1}}return!0}function Io(o){if(!St(o)||YA(o))return!1;var l=Li(o)?Dg:fo;return l.test(Po(o))}function Le(o){return Ct(o)&&zt(o)==ls}function c(o){return Ct(o)&&ir(o)==gt}function p(o){return Ct(o)&&ah(o.length)&&!!st[zt(o)]}function y(o){return typeof o=="function"?o:o==null?Or:typeof o=="object"?Ee(o)?ye(o[0],o[1]):se(o):ME(o)}function b(o){if(!Mu(o))return Fa(o);var l=[];for(var d in Ae(o))ze.call(o,d)&&d!="constructor"&&l.push(d);return l}function R(o){if(!St(o))return GA(o);var l=Mu(o),d=[];for(var v in o)v=="constructor"&&(l||!ze.call(o,v))||d.push(v);return d}function $(o,l){return o<l}function W(o,l){var d=-1,v=Rr(o)?H(o.length):[];return di(o,function(w,O,q){v[++d]=l(w,O,q)}),v}function se(o){var l=$y(o);return l.length==1&&l[0][2]?Kw(l[0][0],l[0][1]):function(d){return d===o||hi(d,o,l)}}function ye(o,l){return Ny(o)&&zw(l)?Kw(mi(o),l):function(d){var v=Yy(d,o);return v===t&&v===l?Jy(d,o):Ro(l,v,S|_)}}function Oe(o,l,d,v,w){o!==l&&Ou(l,function(O,q){if(w||(w=new Hr),St(O))Kt(o,l,q,d,Oe,v,w);else{var M=v?v(Fy(o,q),O,q+"",o,l,w):t;M===t&&(M=O),xu(o,q,M)}},Ir)}function Kt(o,l,d,v,w,O,q){var M=Fy(o,d),B=Fy(l,d),G=q.get(B);if(G){xu(o,d,G);return}var Q=O?O(M,B,d+"",o,l,q):t,X=Q===t;if(X){var re=Ee(B),ue=!re&&qs(B),me=!re&&!ue&&Ga(B);Q=B,re||ue||me?Ee(M)?Q=M:At(M)?Q=xr(M):ue?(X=!1,Q=Ow(B,!0)):me?(X=!1,Q=Pw(B,!0)):Q=[]:Du(B)||ko(B)?(Q=M,ko(M)?Q=xE(M):(!St(M)||Li(M))&&(Q=Jw(B))):X=!1}X&&(q.set(B,Q),w(Q,B,v,O,q),q.delete(B)),xu(o,d,Q)}function on(o,l){var d=o.length;if(d)return l+=l<0?d:0,Fi(l,d)?o[l]:t}function qn(o,l,d){l.length?l=et(l,function(O){return Ee(O)?function(q){return Mi(q,O.length===1?O[0]:O)}:O}):l=[Or];var v=-1;l=et(l,nr(pe()));var w=W(o,function(O,q,M){var B=et(l,function(G){return G(O)});return{criteria:B,index:++v,value:O}});return vu(w,function(O,q){return OA(O,q,d)})}function gA(o,l){return Sw(o,l,function(d,v){return Jy(o,v)})}function Sw(o,l,d){for(var v=-1,w=l.length,O={};++v<w;){var q=l[v],M=Mi(o,q);d(M,q)&&qu(O,As(q,o),M)}return O}function yA(o){return function(l){return Mi(l,o)}}function by(o,l,d,v){var w=v?md:_s,O=-1,q=l.length,M=o;for(o===l&&(l=xr(l)),d&&(M=et(o,nr(d)));++O<q;)for(var B=0,G=l[O],Q=d?d(G):G;(B=w(M,Q,B,v))>-1;)M!==o&&Ai.call(M,B,1),Ai.call(o,B,1);return o}function bw(o,l){for(var d=o?l.length:0,v=d-1;d--;){var w=l[d];if(d==v||w!==O){var O=w;Fi(w)?Ai.call(o,w,1):Cy(o,w)}}return o}function _y(o,l){return o+So(Td()*(l-o+1))}function vA(o,l,d,v){for(var w=-1,O=Et(Na((l-o)/(d||1)),0),q=H(O);O--;)q[v?O:++w]=o,o+=d;return q}function wy(o,l){var d="";if(!o||l<1||l>fe)return d;do l%2&&(d+=o),l=So(l/2),l&&(o+=o);while(l);return d}function Te(o,l){return Ly(Gw(o,l,Or),o+"")}function SA(o){return Ld(Qa(o))}function bA(o,l){var d=Qa(o);return th(d,$i(l,0,d.length))}function qu(o,l,d,v){if(!St(o))return o;l=As(l,o);for(var w=-1,O=l.length,q=O-1,M=o;M!=null&&++w<O;){var B=mi(l[w]),G=d;if(B==="__proto__"||B==="constructor"||B==="prototype")return o;if(w!=q){var Q=M[B];G=v?v(Q,B,M):t,G===t&&(G=St(Q)?Q:Fi(l[w+1])?[]:{})}xo(M,B,G),M=M[B]}return o}var _w=La?function(o,l){return La.set(o,l),o}:Or,_A=Ma?function(o,l){return Ma(o,"toString",{configurable:!0,enumerable:!1,value:Ky(l),writable:!0})}:Or;function wA(o){return th(Qa(o))}function an(o,l,d){var v=-1,w=o.length;l<0&&(l=-l>w?0:w+l),d=d>w?w:d,d<0&&(d+=w),w=l>d?0:d-l>>>0,l>>>=0;for(var O=H(w);++v<w;)O[v]=o[v+l];return O}function EA(o,l){var d;return di(o,function(v,w,O){return d=l(v,w,O),!d}),!!d}function Yd(o,l,d){var v=0,w=o==null?v:o.length;if(typeof l=="number"&&l===l&&w<=_t){for(;v<w;){var O=v+w>>>1,q=o[O];q!==null&&!Wr(q)&&(d?q<=l:q<l)?v=O+1:w=O}return w}return Ey(o,l,Or,d)}function Ey(o,l,d,v){var w=0,O=o==null?0:o.length;if(O===0)return 0;l=d(l);for(var q=l!==l,M=l===null,B=Wr(l),G=l===t;w<O;){var Q=So((w+O)/2),X=d(o[Q]),re=X!==t,ue=X===null,me=X===X,Pe=Wr(X);if(q)var ge=v||me;else G?ge=me&&(v||re):M?ge=me&&re&&(v||!ue):B?ge=me&&re&&!ue&&(v||!Pe):ue||Pe?ge=!1:ge=v?X<=l:X<l;ge?w=Q+1:O=Q}return vt(O,Ze)}function ww(o,l){for(var d=-1,v=o.length,w=0,O=[];++d<v;){var q=o[d],M=l?l(q):q;if(!d||!$n(M,B)){var B=M;O[w++]=q===0?0:q}}return O}function Ew(o){return typeof o=="number"?o:Wr(o)?we:+o}function Vr(o){if(typeof o=="string")return o;if(Ee(o))return et(o,Vr)+"";if(Wr(o))return qd?qd.call(o):"";var l=o+"";return l=="0"&&1/o==-ie?"-0":l}function ks(o,l,d){var v=-1,w=Ia,O=o.length,q=!0,M=[],B=M;if(d)q=!1,w=pu;else if(O>=r){var G=l?null:$A(o);if(G)return Es(G);q=!1,w=ws,B=new qi}else B=l?[]:M;e:for(;++v<O;){var Q=o[v],X=l?l(Q):Q;if(Q=d||Q!==0?Q:0,q&&X===X){for(var re=B.length;re--;)if(B[re]===X)continue e;l&&B.push(X),M.push(Q)}else w(B,X,d)||(B!==M&&B.push(X),M.push(Q))}return M}function Cy(o,l){return l=As(l,o),o=Qw(o,l),o==null||delete o[mi(ln(l))]}function Cw(o,l,d,v){return qu(o,l,d(Mi(o,l)),v)}function Jd(o,l,d,v){for(var w=o.length,O=v?w:-1;(v?O--:++O<w)&&l(o[O],O,o););return d?an(o,v?0:O,v?O+1:w):an(o,v?O+1:0,v?w:O)}function xw(o,l){var d=o;return d instanceof Ie&&(d=d.value()),mu(l,function(v,w){return w.func.apply(w.thisArg,Xr([v],w.args))},d)}function xy(o,l,d){var v=o.length;if(v<2)return v?ks(o[0]):[];for(var w=-1,O=H(v);++w<v;)for(var q=o[w],M=-1;++M<v;)M!=w&&(O[w]=Ps(O[w]||q,o[M],l,d));return ks(Ut(O,1),l,d)}function Rw(o,l,d){for(var v=-1,w=o.length,O=l.length,q={};++v<w;){var M=v<O?l[v]:t;d(q,o[v],M)}return q}function Ry(o){return At(o)?o:[]}function Iy(o){return typeof o=="function"?o:Or}function As(o,l){return Ee(o)?o:Ny(o,l)?[o]:tE(Ge(o))}var CA=Te;function Ts(o,l,d){var v=o.length;return d=d===t?v:d,!l&&d>=v?o:an(o,l,d)}var Iw=Fg||function(o){return Nt.clearTimeout(o)};function Ow(o,l){if(l)return o.slice();var d=o.length,v=xd?xd(d):new o.constructor(d);return o.copy(v),v}function Oy(o){var l=new o.constructor(o.byteLength);return new qa(l).set(new qa(o)),l}function xA(o,l){var d=l?Oy(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function RA(o){var l=new o.constructor(o.source,ii.exec(o));return l.lastIndex=o.lastIndex,l}function IA(o){return Co?Ae(Co.call(o)):{}}function Pw(o,l){var d=l?Oy(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function kw(o,l){if(o!==l){var d=o!==t,v=o===null,w=o===o,O=Wr(o),q=l!==t,M=l===null,B=l===l,G=Wr(l);if(!M&&!G&&!O&&o>l||O&&q&&B&&!M&&!G||v&&q&&B||!d&&B||!w)return 1;if(!v&&!O&&!G&&o<l||G&&d&&w&&!v&&!O||M&&d&&w||!q&&w||!B)return-1}return 0}function OA(o,l,d){for(var v=-1,w=o.criteria,O=l.criteria,q=w.length,M=d.length;++v<q;){var B=kw(w[v],O[v]);if(B){if(v>=M)return B;var G=d[v];return B*(G=="desc"?-1:1)}}return o.index-l.index}function Aw(o,l,d,v){for(var w=-1,O=o.length,q=d.length,M=-1,B=l.length,G=Et(O-q,0),Q=H(B+G),X=!v;++M<B;)Q[M]=l[M];for(;++w<q;)(X||w<O)&&(Q[d[w]]=o[w]);for(;G--;)Q[M++]=o[w++];return Q}function Tw(o,l,d,v){for(var w=-1,O=o.length,q=-1,M=d.length,B=-1,G=l.length,Q=Et(O-M,0),X=H(Q+G),re=!v;++w<Q;)X[w]=o[w];for(var ue=w;++B<G;)X[ue+B]=l[B];for(;++q<M;)(re||w<O)&&(X[ue+d[q]]=o[w++]);return X}function xr(o,l){var d=-1,v=o.length;for(l||(l=H(v));++d<v;)l[d]=o[d];return l}function pi(o,l,d,v){var w=!d;d||(d={});for(var O=-1,q=l.length;++O<q;){var M=l[O],B=v?v(d[M],o[M],M,d,o):t;B===t&&(B=o[M]),w?An(d,M,B):xo(d,M,B)}return d}function PA(o,l){return pi(o,My(o),l)}function kA(o,l){return pi(o,Ww(o),l)}function zd(o,l){return function(d,v){var w=Ee(d)?mg:cy,O=l?l():{};return w(d,o,pe(v,2),O)}}function Ja(o){return Te(function(l,d){var v=-1,w=d.length,O=w>1?d[w-1]:t,q=w>2?d[2]:t;for(O=o.length>3&&typeof O=="function"?(w--,O):t,q&&mr(d[0],d[1],q)&&(O=w<3?t:O,w=1),l=Ae(l);++v<w;){var M=d[v];M&&o(l,M,v,O)}return l})}function qw(o,l){return function(d,v){if(d==null)return d;if(!Rr(d))return o(d,v);for(var w=d.length,O=l?w:-1,q=Ae(d);(l?O--:++O<w)&&v(q[O],O,q)!==!1;);return d}}function $w(o){return function(l,d,v){for(var w=-1,O=Ae(l),q=v(l),M=q.length;M--;){var B=q[o?M:++w];if(d(O[B],B,O)===!1)break}return l}}function AA(o,l,d){var v=l&C,w=$u(o);function O(){var q=this&&this!==Nt&&this instanceof O?w:o;return q.apply(v?d:this,arguments)}return O}function Mw(o){return function(l){l=Ge(l);var d=en(l)?hr(l):t,v=d?d[0]:l.charAt(0),w=d?Ts(d,1).join(""):l.slice(1);return v[o]()+w}}function za(o){return function(l){return mu(qE(TE(l).replace(sg,"")),o,"")}}function $u(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var d=Os(o.prototype),v=o.apply(d,l);return St(v)?v:d}}function TA(o,l,d){var v=$u(o);function w(){for(var O=arguments.length,q=H(O),M=O,B=Ka(w);M--;)q[M]=arguments[M];var G=O<3&&q[0]!==B&&q[O-1]!==B?[]:Br(q,B);if(O-=G.length,O<d)return jw(o,l,Kd,w.placeholder,t,q,G,t,t,d-O);var Q=this&&this!==Nt&&this instanceof w?v:o;return Jt(Q,this,q)}return w}function Nw(o){return function(l,d,v){var w=Ae(l);if(!Rr(l)){var O=pe(d,3);l=Yt(l),d=function(M){return O(w[M],M,w)}}var q=o(l,d,v);return q>-1?w[O?l[q]:q]:t}}function Dw(o){return Di(function(l){var d=l.length,v=d,w=Er.prototype.thru;for(o&&l.reverse();v--;){var O=l[v];if(typeof O!="function")throw new wr(i);if(w&&!q&&Xd(O)=="wrapper")var q=new Er([],!0)}for(v=q?v:d;++v<d;){O=l[v];var M=Xd(O),B=M=="wrapper"?qy(O):t;B&&Dy(B[0])&&B[1]==(K|T|Y|ee)&&!B[4].length&&B[9]==1?q=q[Xd(B[0])].apply(q,B[3]):q=O.length==1&&Dy(O)?q[M]():q.thru(O)}return function(){var G=arguments,Q=G[0];if(q&&G.length==1&&Ee(Q))return q.plant(Q).value();for(var X=0,re=d?l[X].apply(this,G):Q;++X<d;)re=l[X].call(this,re);return re}})}function Kd(o,l,d,v,w,O,q,M,B,G){var Q=l&K,X=l&C,re=l&x,ue=l&(T|j),me=l&k,Pe=re?t:$u(o);function ge(){for(var De=arguments.length,je=H(De),Yr=De;Yr--;)je[Yr]=arguments[Yr];if(ue)var gr=Ka(ge),Jr=_g(je,gr);if(v&&(je=Aw(je,v,w,ue)),O&&(je=Tw(je,O,q,ue)),De-=Jr,ue&&De<G){var Tt=Br(je,gr);return jw(o,l,Kd,ge.placeholder,d,je,Tt,M,B,G-De)}var Mn=X?d:this,Ui=re?Mn[o]:o;return De=je.length,M?je=ZA(je,M):me&&De>1&&je.reverse(),Q&&B<De&&(je.length=B),this&&this!==Nt&&this instanceof ge&&(Ui=Pe||$u(Ui)),Ui.apply(Mn,je)}return ge}function Fw(o,l){return function(d,v){return Tn(d,o,l(v),{})}}function Gd(o,l){return function(d,v){var w;if(d===t&&v===t)return l;if(d!==t&&(w=d),v!==t){if(w===t)return v;typeof d=="string"||typeof v=="string"?(d=Vr(d),v=Vr(v)):(d=Ew(d),v=Ew(v)),w=o(d,v)}return w}}function Py(o){return Di(function(l){return l=et(l,nr(pe())),Te(function(d){var v=this;return o(l,function(w){return Jt(w,v,d)})})})}function Qd(o,l){l=l===t?" ":Vr(l);var d=l.length;if(d<2)return d?wy(l,o):l;var v=wy(l,Na(o/li(l)));return en(l)?Ts(hr(v),0,o).join(""):v.slice(0,o)}function qA(o,l,d,v){var w=l&C,O=$u(o);function q(){for(var M=-1,B=arguments.length,G=-1,Q=v.length,X=H(Q+B),re=this&&this!==Nt&&this instanceof q?O:o;++G<Q;)X[G]=v[G];for(;B--;)X[G++]=arguments[++M];return Jt(re,w?d:this,X)}return q}function Lw(o){return function(l,d,v){return v&&typeof v!="number"&&mr(l,d,v)&&(d=v=t),l=ji(l),d===t?(d=l,l=0):d=ji(d),v=v===t?l<d?1:-1:ji(v),vA(l,d,v,o)}}function Zd(o){return function(l,d){return typeof l=="string"&&typeof d=="string"||(l=un(l),d=un(d)),o(l,d)}}function jw(o,l,d,v,w,O,q,M,B,G){var Q=l&T,X=Q?q:t,re=Q?t:q,ue=Q?O:t,me=Q?t:O;l|=Q?Y:V,l&=~(Q?V:Y),l&A||(l&=~(C|x));var Pe=[o,l,w,ue,X,me,re,M,B,G],ge=d.apply(t,Pe);return Dy(o)&&Zw(ge,Pe),ge.placeholder=v,Xw(ge,o,l)}function ky(o){var l=kt[o];return function(d,v){if(d=un(d),v=v==null?0:vt(Ce(v),292),v&&bo(d)){var w=(Ge(d)+"e").split("e"),O=l(w[0]+"e"+(+w[1]+v));return w=(Ge(O)+"e").split("e"),+(w[0]+"e"+(+w[1]-v))}return l(d)}}var $A=Rs&&1/Es(new Rs([,-0]))[1]==ie?function(o){return new Rs(o)}:Zy;function Uw(o){return function(l){var d=ir(l);return d==rr?wu(l):d==gt?Ig(l):bg(l,o(l))}}function Ni(o,l,d,v,w,O,q,M){var B=l&x;if(!B&&typeof o!="function")throw new wr(i);var G=v?v.length:0;if(G||(l&=~(Y|V),v=w=t),q=q===t?q:Et(Ce(q),0),M=M===t?M:Ce(M),G-=w?w.length:0,l&V){var Q=v,X=w;v=w=t}var re=B?t:qy(o),ue=[o,l,d,v,w,Q,X,O,q,M];if(re&&KA(ue,re),o=ue[0],l=ue[1],d=ue[2],v=ue[3],w=ue[4],M=ue[9]=ue[9]===t?B?0:o.length:Et(ue[9]-G,0),!M&&l&(T|j)&&(l&=~(T|j)),!l||l==C)var me=AA(o,l,d);else l==T||l==j?me=TA(o,l,M):(l==Y||l==(C|Y))&&!w.length?me=qA(o,l,d,v):me=Kd.apply(t,ue);var Pe=re?_w:Zw;return Xw(Pe(me,ue),o,l)}function Bw(o,l,d,v){return o===t||$n(o,Cs[d])&&!ze.call(v,d)?l:o}function Hw(o,l,d,v,w,O){return St(o)&&St(l)&&(O.set(l,o),Oe(o,l,t,Hw,O),O.delete(l)),o}function MA(o){return Du(o)?t:o}function Vw(o,l,d,v,w,O){var q=d&S,M=o.length,B=l.length;if(M!=B&&!(q&&B>M))return!1;var G=O.get(o),Q=O.get(l);if(G&&Q)return G==l&&Q==o;var X=-1,re=!0,ue=d&_?new qi:t;for(O.set(o,l),O.set(l,o);++X<M;){var me=o[X],Pe=l[X];if(v)var ge=q?v(Pe,me,X,l,o,O):v(me,Pe,X,o,l,O);if(ge!==t){if(ge)continue;re=!1;break}if(ue){if(!gu(l,function(De,je){if(!ws(ue,je)&&(me===De||w(me,De,d,v,O)))return ue.push(je)})){re=!1;break}}else if(!(me===Pe||w(me,Pe,d,v,O))){re=!1;break}}return O.delete(o),O.delete(l),re}function NA(o,l,d,v,w,O,q){switch(d){case ri:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case cs:return!(o.byteLength!=l.byteLength||!O(new qa(o),new qa(l)));case ct:case _n:case Qr:return $n(+o,+l);case jt:return o.name==l.name&&o.message==l.message;case ls:case Ri:return o==l+"";case rr:var M=wu;case gt:var B=v&S;if(M||(M=Es),o.size!=l.size&&!B)return!1;var G=q.get(o);if(G)return G==l;v|=_,q.set(o,l);var Q=Vw(M(o),M(l),v,w,O,q);return q.delete(o),Q;case ma:if(Co)return Co.call(o)==Co.call(l)}return!1}function DA(o,l,d,v,w,O){var q=d&S,M=Ay(o),B=M.length,G=Ay(l),Q=G.length;if(B!=Q&&!q)return!1;for(var X=B;X--;){var re=M[X];if(!(q?re in l:ze.call(l,re)))return!1}var ue=O.get(o),me=O.get(l);if(ue&&me)return ue==l&&me==o;var Pe=!0;O.set(o,l),O.set(l,o);for(var ge=q;++X<B;){re=M[X];var De=o[re],je=l[re];if(v)var Yr=q?v(je,De,re,l,o,O):v(De,je,re,o,l,O);if(!(Yr===t?De===je||w(De,je,d,v,O):Yr)){Pe=!1;break}ge||(ge=re=="constructor")}if(Pe&&!ge){var gr=o.constructor,Jr=l.constructor;gr!=Jr&&"constructor"in o&&"constructor"in l&&!(typeof gr=="function"&&gr instanceof gr&&typeof Jr=="function"&&Jr instanceof Jr)&&(Pe=!1)}return O.delete(o),O.delete(l),Pe}function Di(o){return Ly(Gw(o,t,sE),o+"")}function Ay(o){return Vd(o,Yt,My)}function Ty(o){return Vd(o,Ir,Ww)}var qy=La?function(o){return La.get(o)}:Zy;function Xd(o){for(var l=o.name+"",d=Is[l],v=ze.call(Is,l)?d.length:0;v--;){var w=d[v],O=w.func;if(O==null||O==o)return w.name}return l}function Ka(o){var l=ze.call(I,"placeholder")?I:o;return l.placeholder}function pe(){var o=I.iteratee||Gy;return o=o===Gy?y:o,arguments.length?o(arguments[0],arguments[1]):o}function eh(o,l){var d=o.__data__;return WA(l)?d[typeof l=="string"?"string":"hash"]:d.map}function $y(o){for(var l=Yt(o),d=l.length;d--;){var v=l[d],w=o[v];l[d]=[v,w,zw(w)]}return l}function Oo(o,l){var d=Cg(o,l);return Io(d)?d:t}function FA(o){var l=ze.call(o,Ti),d=o[Ti];try{o[Ti]=t;var v=!0}catch{}var w=Aa.call(o);return v&&(l?o[Ti]=d:delete o[Ti]),w}var My=Da?function(o){return o==null?[]:(o=Ae(o),ai(Da(o),function(l){return Id.call(o,l)}))}:Xy,Ww=Da?function(o){for(var l=[];o;)Xr(l,My(o)),o=$a(o);return l}:Xy,ir=zt;(Eu&&ir(new Eu(new ArrayBuffer(1)))!=ri||_o&&ir(new _o)!=rr||Cu&&ir(Cu.resolve())!=Lf||Rs&&ir(new Rs)!=gt||wo&&ir(new wo)!=us)&&(ir=function(o){var l=zt(o),d=l==wn?o.constructor:t,v=d?Po(d):"";if(v)switch(v){case Bg:return ri;case Hg:return rr;case Vg:return Lf;case Wg:return gt;case Yg:return us}return l});function LA(o,l,d){for(var v=-1,w=d.length;++v<w;){var O=d[v],q=O.size;switch(O.type){case"drop":o+=q;break;case"dropRight":l-=q;break;case"take":l=vt(l,o+q);break;case"takeRight":o=Et(o,l-q);break}}return{start:o,end:l}}function jA(o){var l=o.match(Vt);return l?l[1].split(Cn):[]}function Yw(o,l,d){l=As(l,o);for(var v=-1,w=l.length,O=!1;++v<w;){var q=mi(l[v]);if(!(O=o!=null&&d(o,q)))break;o=o[q]}return O||++v!=w?O:(w=o==null?0:o.length,!!w&&ah(w)&&Fi(q,w)&&(Ee(o)||ko(o)))}function UA(o){var l=o.length,d=new o.constructor(l);return l&&typeof o[0]=="string"&&ze.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function Jw(o){return typeof o.constructor=="function"&&!Mu(o)?Os($a(o)):{}}function BA(o,l,d){var v=o.constructor;switch(l){case cs:return Oy(o);case ct:case _n:return new v(+o);case ri:return xA(o,d);case fs:case Xe:case ga:case ya:case ds:case uo:case hs:case ni:case ps:return Pw(o,d);case rr:return new v;case Qr:case Ri:return new v(o);case ls:return RA(o);case gt:return new v;case ma:return IA(o)}}function HA(o,l){var d=l.length;if(!d)return o;var v=d-1;return l[v]=(d>1?"& ":"")+l[v],l=l.join(d>2?", ":" "),o.replace(ba,`{
|
|
2
2
|
/* [wrapped with `+l+`] */
|
|
3
3
|
`)}function VA(o){return Ee(o)||ko(o)||!!(Od&&o&&o[Od])}function Fi(o,l){var d=typeof o;return l=l??fe,!!l&&(d=="number"||d!="symbol"&&zm.test(o))&&o>-1&&o%1==0&&o<l}function mr(o,l,d){if(!St(d))return!1;var v=typeof l;return(v=="number"?Rr(d)&&Fi(l,d.length):v=="string"&&l in d)?$n(d[l],o):!1}function Ny(o,l){if(Ee(o))return!1;var d=typeof o;return d=="number"||d=="symbol"||d=="boolean"||o==null||Wr(o)?!0:_r.test(o)||!En.test(o)||l!=null&&o in Ae(l)}function WA(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function Dy(o){var l=Xd(o),d=I[l];if(typeof d!="function"||!(l in Ie.prototype))return!1;if(o===d)return!0;var v=qy(d);return!!v&&o===v[0]}function YA(o){return!!Cd&&Cd in o}var JA=ka?Li:ev;function Mu(o){var l=o&&o.constructor,d=typeof l=="function"&&l.prototype||Cs;return o===d}function zw(o){return o===o&&!St(o)}function Kw(o,l){return function(d){return d==null?!1:d[o]===l&&(l!==t||o in Ae(d))}}function zA(o){var l=sh(o,function(v){return d.size===u&&d.clear(),v}),d=l.cache;return l}function KA(o,l){var d=o[1],v=l[1],w=d|v,O=w<(C|x|K),q=v==K&&d==T||v==K&&d==ee&&o[7].length<=l[8]||v==(K|ee)&&l[7].length<=l[8]&&d==T;if(!(O||q))return o;v&C&&(o[2]=l[2],w|=d&C?0:A);var M=l[3];if(M){var B=o[3];o[3]=B?Aw(B,M,l[4]):M,o[4]=B?Br(o[3],f):l[4]}return M=l[5],M&&(B=o[5],o[5]=B?Tw(B,M,l[6]):M,o[6]=B?Br(o[5],f):l[6]),M=l[7],M&&(o[7]=M),v&K&&(o[8]=o[8]==null?l[8]:vt(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=w,o}function GA(o){var l=[];if(o!=null)for(var d in Ae(o))l.push(d);return l}function QA(o){return Aa.call(o)}function Gw(o,l,d){return l=Et(l===t?o.length-1:l,0),function(){for(var v=arguments,w=-1,O=Et(v.length-l,0),q=H(O);++w<O;)q[w]=v[l+w];w=-1;for(var M=H(l+1);++w<l;)M[w]=v[w];return M[l]=d(q),Jt(o,this,M)}}function Qw(o,l){return l.length<2?o:Mi(o,an(l,0,-1))}function ZA(o,l){for(var d=o.length,v=vt(l.length,d),w=xr(o);v--;){var O=l[v];o[v]=Fi(O,d)?w[O]:t}return o}function Fy(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var Zw=eE(_w),Nu=jg||function(o,l){return Nt.setTimeout(o,l)},Ly=eE(_A);function Xw(o,l,d){var v=l+"";return Ly(o,HA(v,XA(jA(v),d)))}function eE(o){var l=0,d=0;return function(){var v=kd(),w=D-(v-d);if(d=v,w>0){if(++l>=N)return arguments[0]}else l=0;return o.apply(t,arguments)}}function th(o,l){var d=-1,v=o.length,w=v-1;for(l=l===t?v:l;++d<l;){var O=_y(d,w),q=o[O];o[O]=o[d],o[d]=q}return o.length=l,o}var tE=zA(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace($e,function(d,v,w,O){l.push(w?O.replace(jr,"$1"):v||d)}),l});function mi(o){if(typeof o=="string"||Wr(o))return o;var l=o+"";return l=="0"&&1/o==-ie?"-0":l}function Po(o){if(o!=null){try{return yo.call(o)}catch{}try{return o+""}catch{}}return""}function XA(o,l){return wt(Mt,function(d){var v="_."+d[0];l&d[1]&&!Ia(o,v)&&o.push(v)}),o.sort()}function rE(o){if(o instanceof Ie)return o.clone();var l=new Er(o.__wrapped__,o.__chain__);return l.__actions__=xr(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function eT(o,l,d){(d?mr(o,l,d):l===t)?l=1:l=Et(Ce(l),0);var v=o==null?0:o.length;if(!v||l<1)return[];for(var w=0,O=0,q=H(Na(v/l));w<v;)q[O++]=an(o,w,w+=l);return q}function tT(o){for(var l=-1,d=o==null?0:o.length,v=0,w=[];++l<d;){var O=o[l];O&&(w[v++]=O)}return w}function rT(){var o=arguments.length;if(!o)return[];for(var l=H(o-1),d=arguments[0],v=o;v--;)l[v-1]=arguments[v];return Xr(Ee(d)?xr(d):[d],Ut(l,1))}var nT=Te(function(o,l){return At(o)?Ps(o,Ut(l,1,At,!0)):[]}),iT=Te(function(o,l){var d=ln(l);return At(d)&&(d=t),At(o)?Ps(o,Ut(l,1,At,!0),pe(d,2)):[]}),sT=Te(function(o,l){var d=ln(l);return At(d)&&(d=t),At(o)?Ps(o,Ut(l,1,At,!0),t,d):[]});function oT(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===t?1:Ce(l),an(o,l<0?0:l,v)):[]}function aT(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===t?1:Ce(l),l=v-l,an(o,0,l<0?0:l)):[]}function lT(o,l){return o&&o.length?Jd(o,pe(l,3),!0,!0):[]}function uT(o,l){return o&&o.length?Jd(o,pe(l,3),!0):[]}function cT(o,l,d,v){var w=o==null?0:o.length;return w?(d&&typeof d!="number"&&mr(o,l,d)&&(d=0,v=w),hy(o,l,d,v)):[]}function nE(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var w=d==null?0:Ce(d);return w<0&&(w=Et(v+w,0)),Oa(o,pe(l,3),w)}function iE(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var w=v-1;return d!==t&&(w=Ce(d),w=d<0?Et(v+w,0):vt(w,v-1)),Oa(o,pe(l,3),w,!0)}function sE(o){var l=o==null?0:o.length;return l?Ut(o,1):[]}function fT(o){var l=o==null?0:o.length;return l?Ut(o,ie):[]}function dT(o,l){var d=o==null?0:o.length;return d?(l=l===t?1:Ce(l),Ut(o,l)):[]}function hT(o){for(var l=-1,d=o==null?0:o.length,v={};++l<d;){var w=o[l];v[w[0]]=w[1]}return v}function oE(o){return o&&o.length?o[0]:t}function pT(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var w=d==null?0:Ce(d);return w<0&&(w=Et(v+w,0)),_s(o,l,w)}function mT(o){var l=o==null?0:o.length;return l?an(o,0,-1):[]}var gT=Te(function(o){var l=et(o,Ry);return l.length&&l[0]===o[0]?Au(l):[]}),yT=Te(function(o){var l=ln(o),d=et(o,Ry);return l===ln(d)?l=t:d.pop(),d.length&&d[0]===o[0]?Au(d,pe(l,2)):[]}),vT=Te(function(o){var l=ln(o),d=et(o,Ry);return l=typeof l=="function"?l:t,l&&d.pop(),d.length&&d[0]===o[0]?Au(d,t,l):[]});function ST(o,l){return o==null?"":xs.call(o,l)}function ln(o){var l=o==null?0:o.length;return l?o[l-1]:t}function bT(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var w=v;return d!==t&&(w=Ce(d),w=w<0?Et(v+w,0):vt(w,v-1)),l===l?Og(o,l,w):Oa(o,gd,w,!0)}function _T(o,l){return o&&o.length?on(o,Ce(l)):t}var wT=Te(aE);function aE(o,l){return o&&o.length&&l&&l.length?by(o,l):o}function ET(o,l,d){return o&&o.length&&l&&l.length?by(o,l,pe(d,2)):o}function CT(o,l,d){return o&&o.length&&l&&l.length?by(o,l,t,d):o}var xT=Di(function(o,l){var d=o==null?0:o.length,v=Wa(o,l);return bw(o,et(l,function(w){return Fi(w,d)?+w:w}).sort(kw)),v});function RT(o,l){var d=[];if(!(o&&o.length))return d;var v=-1,w=[],O=o.length;for(l=pe(l,3);++v<O;){var q=o[v];l(q,v,o)&&(d.push(q),w.push(v))}return bw(o,w),d}function jy(o){return o==null?o:Ug.call(o)}function IT(o,l,d){var v=o==null?0:o.length;return v?(d&&typeof d!="number"&&mr(o,l,d)?(l=0,d=v):(l=l==null?0:Ce(l),d=d===t?v:Ce(d)),an(o,l,d)):[]}function OT(o,l){return Yd(o,l)}function PT(o,l,d){return Ey(o,l,pe(d,2))}function kT(o,l){var d=o==null?0:o.length;if(d){var v=Yd(o,l);if(v<d&&$n(o[v],l))return v}return-1}function AT(o,l){return Yd(o,l,!0)}function TT(o,l,d){return Ey(o,l,pe(d,2),!0)}function qT(o,l){var d=o==null?0:o.length;if(d){var v=Yd(o,l,!0)-1;if($n(o[v],l))return v}return-1}function $T(o){return o&&o.length?ww(o):[]}function MT(o,l){return o&&o.length?ww(o,pe(l,2)):[]}function NT(o){var l=o==null?0:o.length;return l?an(o,1,l):[]}function DT(o,l,d){return o&&o.length?(l=d||l===t?1:Ce(l),an(o,0,l<0?0:l)):[]}function FT(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===t?1:Ce(l),l=v-l,an(o,l<0?0:l,v)):[]}function LT(o,l){return o&&o.length?Jd(o,pe(l,3),!1,!0):[]}function jT(o,l){return o&&o.length?Jd(o,pe(l,3)):[]}var UT=Te(function(o){return ks(Ut(o,1,At,!0))}),BT=Te(function(o){var l=ln(o);return At(l)&&(l=t),ks(Ut(o,1,At,!0),pe(l,2))}),HT=Te(function(o){var l=ln(o);return l=typeof l=="function"?l:t,ks(Ut(o,1,At,!0),t,l)});function VT(o){return o&&o.length?ks(o):[]}function WT(o,l){return o&&o.length?ks(o,pe(l,2)):[]}function YT(o,l){return l=typeof l=="function"?l:t,o&&o.length?ks(o,t,l):[]}function Uy(o){if(!(o&&o.length))return[];var l=0;return o=ai(o,function(d){if(At(d))return l=Et(d.length,l),!0}),bu(l,function(d){return et(o,yu(d))})}function lE(o,l){if(!(o&&o.length))return[];var d=Uy(o);return l==null?d:et(d,function(v){return Jt(l,t,v)})}var JT=Te(function(o,l){return At(o)?Ps(o,l):[]}),zT=Te(function(o){return xy(ai(o,At))}),KT=Te(function(o){var l=ln(o);return At(l)&&(l=t),xy(ai(o,At),pe(l,2))}),GT=Te(function(o){var l=ln(o);return l=typeof l=="function"?l:t,xy(ai(o,At),t,l)}),QT=Te(Uy);function ZT(o,l){return Rw(o||[],l||[],xo)}function XT(o,l){return Rw(o||[],l||[],qu)}var eq=Te(function(o){var l=o.length,d=l>1?o[l-1]:t;return d=typeof d=="function"?(o.pop(),d):t,lE(o,d)});function uE(o){var l=I(o);return l.__chain__=!0,l}function tq(o,l){return l(o),o}function rh(o,l){return l(o)}var rq=Di(function(o){var l=o.length,d=l?o[0]:0,v=this.__wrapped__,w=function(O){return Wa(O,o)};return l>1||this.__actions__.length||!(v instanceof Ie)||!Fi(d)?this.thru(w):(v=v.slice(d,+d+(l?1:0)),v.__actions__.push({func:rh,args:[w],thisArg:t}),new Er(v,this.__chain__).thru(function(O){return l&&!O.length&&O.push(t),O}))});function nq(){return uE(this)}function iq(){return new Er(this.value(),this.__chain__)}function sq(){this.__values__===t&&(this.__values__=EE(this.value()));var o=this.__index__>=this.__values__.length,l=o?t:this.__values__[this.__index__++];return{done:o,value:l}}function oq(){return this}function aq(o){for(var l,d=this;d instanceof Ua;){var v=rE(d);v.__index__=0,v.__values__=t,l?w.__wrapped__=v:l=v;var w=v;d=d.__wrapped__}return w.__wrapped__=o,l}function lq(){var o=this.__wrapped__;if(o instanceof Ie){var l=o;return this.__actions__.length&&(l=new Ie(this)),l=l.reverse(),l.__actions__.push({func:rh,args:[jy],thisArg:t}),new Er(l,this.__chain__)}return this.thru(jy)}function uq(){return xw(this.__wrapped__,this.__actions__)}var cq=zd(function(o,l,d){ze.call(o,d)?++o[d]:An(o,d,1)});function fq(o,l,d){var v=Ee(o)?Ra:dy;return d&&mr(o,l,d)&&(l=t),v(o,pe(l,3))}function dq(o,l){var d=Ee(o)?ai:Bd;return d(o,pe(l,3))}var hq=Nw(nE),pq=Nw(iE);function mq(o,l){return Ut(nh(o,l),1)}function gq(o,l){return Ut(nh(o,l),ie)}function yq(o,l,d){return d=d===t?1:Ce(d),Ut(nh(o,l),d)}function cE(o,l){var d=Ee(o)?wt:di;return d(o,pe(l,3))}function fE(o,l){var d=Ee(o)?gg:Ud;return d(o,pe(l,3))}var vq=zd(function(o,l,d){ze.call(o,d)?o[d].push(l):An(o,d,[l])});function Sq(o,l,d,v){o=Rr(o)?o:Qa(o),d=d&&!v?Ce(d):0;var w=o.length;return d<0&&(d=Et(w+d,0)),lh(o)?d<=w&&o.indexOf(l,d)>-1:!!w&&_s(o,l,d)>-1}var bq=Te(function(o,l,d){var v=-1,w=typeof l=="function",O=Rr(o)?H(o.length):[];return di(o,function(q){O[++v]=w?Jt(l,q,d):sn(q,l,d)}),O}),_q=zd(function(o,l,d){An(o,d,l)});function nh(o,l){var d=Ee(o)?et:W;return d(o,pe(l,3))}function wq(o,l,d,v){return o==null?[]:(Ee(l)||(l=l==null?[]:[l]),d=v?t:d,Ee(d)||(d=d==null?[]:[d]),qn(o,l,d))}var Eq=zd(function(o,l,d){o[d?0:1].push(l)},function(){return[[],[]]});function Cq(o,l,d){var v=Ee(o)?mu:yd,w=arguments.length<3;return v(o,pe(l,4),d,w,di)}function xq(o,l,d){var v=Ee(o)?yg:yd,w=arguments.length<3;return v(o,pe(l,4),d,w,Ud)}function Rq(o,l){var d=Ee(o)?ai:Bd;return d(o,oh(pe(l,3)))}function Iq(o){var l=Ee(o)?Ld:SA;return l(o)}function Oq(o,l,d){(d?mr(o,l,d):l===t)?l=1:l=Ce(l);var v=Ee(o)?ly:bA;return v(o,l)}function Pq(o){var l=Ee(o)?uy:wA;return l(o)}function kq(o){if(o==null)return 0;if(Rr(o))return lh(o)?li(o):o.length;var l=ir(o);return l==rr||l==gt?o.size:b(o).length}function Aq(o,l,d){var v=Ee(o)?gu:EA;return d&&mr(o,l,d)&&(l=t),v(o,pe(l,3))}var Tq=Te(function(o,l){if(o==null)return[];var d=l.length;return d>1&&mr(o,l[0],l[1])?l=[]:d>2&&mr(l[0],l[1],l[2])&&(l=[l[0]]),qn(o,Ut(l,1),[])}),ih=Lg||function(){return Nt.Date.now()};function qq(o,l){if(typeof l!="function")throw new wr(i);return o=Ce(o),function(){if(--o<1)return l.apply(this,arguments)}}function dE(o,l,d){return l=d?t:l,l=o&&l==null?o.length:l,Ni(o,K,t,t,t,t,l)}function hE(o,l){var d;if(typeof l!="function")throw new wr(i);return o=Ce(o),function(){return--o>0&&(d=l.apply(this,arguments)),o<=1&&(l=t),d}}var By=Te(function(o,l,d){var v=C;if(d.length){var w=Br(d,Ka(By));v|=Y}return Ni(o,v,l,d,w)}),pE=Te(function(o,l,d){var v=C|x;if(d.length){var w=Br(d,Ka(pE));v|=Y}return Ni(l,v,o,d,w)});function mE(o,l,d){l=d?t:l;var v=Ni(o,T,t,t,t,t,t,l);return v.placeholder=mE.placeholder,v}function gE(o,l,d){l=d?t:l;var v=Ni(o,j,t,t,t,t,t,l);return v.placeholder=gE.placeholder,v}function yE(o,l,d){var v,w,O,q,M,B,G=0,Q=!1,X=!1,re=!0;if(typeof o!="function")throw new wr(i);l=un(l)||0,St(d)&&(Q=!!d.leading,X="maxWait"in d,O=X?Et(un(d.maxWait)||0,l):O,re="trailing"in d?!!d.trailing:re);function ue(Tt){var Mn=v,Ui=w;return v=w=t,G=Tt,q=o.apply(Ui,Mn),q}function me(Tt){return G=Tt,M=Nu(De,l),Q?ue(Tt):q}function Pe(Tt){var Mn=Tt-B,Ui=Tt-G,NE=l-Mn;return X?vt(NE,O-Ui):NE}function ge(Tt){var Mn=Tt-B,Ui=Tt-G;return B===t||Mn>=l||Mn<0||X&&Ui>=O}function De(){var Tt=ih();if(ge(Tt))return je(Tt);M=Nu(De,Pe(Tt))}function je(Tt){return M=t,re&&v?ue(Tt):(v=w=t,q)}function Yr(){M!==t&&Iw(M),G=0,v=B=w=M=t}function gr(){return M===t?q:je(ih())}function Jr(){var Tt=ih(),Mn=ge(Tt);if(v=arguments,w=this,B=Tt,Mn){if(M===t)return me(B);if(X)return Iw(M),M=Nu(De,l),ue(B)}return M===t&&(M=Nu(De,l)),q}return Jr.cancel=Yr,Jr.flush=gr,Jr}var $q=Te(function(o,l){return tn(o,1,l)}),Mq=Te(function(o,l,d){return tn(o,un(l)||0,d)});function Nq(o){return Ni(o,k)}function sh(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new wr(i);var d=function(){var v=arguments,w=l?l.apply(this,v):v[0],O=d.cache;if(O.has(w))return O.get(w);var q=o.apply(this,v);return d.cache=O.set(w,q)||O,q};return d.cache=new(sh.Cache||kn),d}sh.Cache=kn;function oh(o){if(typeof o!="function")throw new wr(i);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function Dq(o){return hE(2,o)}var Fq=CA(function(o,l){l=l.length==1&&Ee(l[0])?et(l[0],nr(pe())):et(Ut(l,1),nr(pe()));var d=l.length;return Te(function(v){for(var w=-1,O=vt(v.length,d);++w<O;)v[w]=l[w].call(this,v[w]);return Jt(o,this,v)})}),Hy=Te(function(o,l){var d=Br(l,Ka(Hy));return Ni(o,Y,t,l,d)}),vE=Te(function(o,l){var d=Br(l,Ka(vE));return Ni(o,V,t,l,d)}),Lq=Di(function(o,l){return Ni(o,ee,t,t,t,l)});function jq(o,l){if(typeof o!="function")throw new wr(i);return l=l===t?l:Ce(l),Te(o,l)}function Uq(o,l){if(typeof o!="function")throw new wr(i);return l=l==null?0:Et(Ce(l),0),Te(function(d){var v=d[l],w=Ts(d,0,l);return v&&Xr(w,v),Jt(o,this,w)})}function Bq(o,l,d){var v=!0,w=!0;if(typeof o!="function")throw new wr(i);return St(d)&&(v="leading"in d?!!d.leading:v,w="trailing"in d?!!d.trailing:w),yE(o,l,{leading:v,maxWait:l,trailing:w})}function Hq(o){return dE(o,1)}function Vq(o,l){return Hy(Iy(l),o)}function Wq(){if(!arguments.length)return[];var o=arguments[0];return Ee(o)?o:[o]}function Yq(o){return pr(o,m)}function Jq(o,l){return l=typeof l=="function"?l:t,pr(o,m,l)}function zq(o){return pr(o,h|m)}function Kq(o,l){return l=typeof l=="function"?l:t,pr(o,h|m,l)}function Gq(o,l){return l==null||jd(o,l,Yt(l))}function $n(o,l){return o===l||o!==o&&l!==l}var Qq=Zd(ku),Zq=Zd(function(o,l){return o>=l}),ko=Wd(function(){return arguments}())?Wd:function(o){return Ct(o)&&ze.call(o,"callee")&&!Id.call(o,"callee")},Ee=H.isArray,Xq=cd?nr(cd):yy;function Rr(o){return o!=null&&ah(o.length)&&!Li(o)}function At(o){return Ct(o)&&Rr(o)}function e$(o){return o===!0||o===!1||Ct(o)&&zt(o)==ct}var qs=Pd||ev,t$=hu?nr(hu):vy;function r$(o){return Ct(o)&&o.nodeType===1&&!Du(o)}function n$(o){if(o==null)return!0;if(Rr(o)&&(Ee(o)||typeof o=="string"||typeof o.splice=="function"||qs(o)||Ga(o)||ko(o)))return!o.length;var l=ir(o);if(l==rr||l==gt)return!o.size;if(Mu(o))return!b(o).length;for(var d in o)if(ze.call(o,d))return!1;return!0}function i$(o,l){return Ro(o,l)}function s$(o,l,d){d=typeof d=="function"?d:t;var v=d?d(o,l):t;return v===t?Ro(o,l,t,d):!!v}function Vy(o){if(!Ct(o))return!1;var l=zt(o);return l==jt||l==as||typeof o.message=="string"&&typeof o.name=="string"&&!Du(o)}function o$(o){return typeof o=="number"&&bo(o)}function Li(o){if(!St(o))return!1;var l=zt(o);return l==ft||l==ti||l==su||l==jm}function SE(o){return typeof o=="number"&&o==Ce(o)}function ah(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=fe}function St(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function Ct(o){return o!=null&&typeof o=="object"}var bE=fd?nr(fd):Tu;function a$(o,l){return o===l||hi(o,l,$y(l))}function l$(o,l,d){return d=typeof d=="function"?d:t,hi(o,l,$y(l),d)}function u$(o){return _E(o)&&o!=+o}function c$(o){if(JA(o))throw new ve(n);return Io(o)}function f$(o){return o===null}function d$(o){return o==null}function _E(o){return typeof o=="number"||Ct(o)&&zt(o)==Qr}function Du(o){if(!Ct(o)||zt(o)!=wn)return!1;var l=$a(o);if(l===null)return!0;var d=ze.call(l,"constructor")&&l.constructor;return typeof d=="function"&&d instanceof d&&yo.call(d)==Mg}var Wy=dd?nr(dd):Le;function h$(o){return SE(o)&&o>=-fe&&o<=fe}var wE=ho?nr(ho):c;function lh(o){return typeof o=="string"||!Ee(o)&&Ct(o)&&zt(o)==Ri}function Wr(o){return typeof o=="symbol"||Ct(o)&&zt(o)==ma}var Ga=Rn?nr(Rn):p;function p$(o){return o===t}function m$(o){return Ct(o)&&ir(o)==us}function g$(o){return Ct(o)&&zt(o)==dr}var y$=Zd($),v$=Zd(function(o,l){return o<=l});function EE(o){if(!o)return[];if(Rr(o))return lh(o)?hr(o):xr(o);if(vo&&o[vo])return Rg(o[vo]());var l=ir(o),d=l==rr?wu:l==gt?Es:Qa;return d(o)}function ji(o){if(!o)return o===0?o:0;if(o=un(o),o===ie||o===-ie){var l=o<0?-1:1;return l*bt}return o===o?o:0}function Ce(o){var l=ji(o),d=l%1;return l===l?d?l-d:l:0}function CE(o){return o?$i(Ce(o),0,he):0}function un(o){if(typeof o=="number")return o;if(Wr(o))return we;if(St(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=St(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=vd(o);var d=Jm.test(o);return d||Uf.test(o)?ld(o.slice(2),d?2:8):Ym.test(o)?we:+o}function xE(o){return pi(o,Ir(o))}function S$(o){return o?$i(Ce(o),-fe,fe):o===0?o:0}function Ge(o){return o==null?"":Vr(o)}var b$=Ja(function(o,l){if(Mu(l)||Rr(l)){pi(l,Yt(l),o);return}for(var d in l)ze.call(l,d)&&xo(o,d,l[d])}),RE=Ja(function(o,l){pi(l,Ir(l),o)}),uh=Ja(function(o,l,d,v){pi(l,Ir(l),o,v)}),_$=Ja(function(o,l,d,v){pi(l,Yt(l),o,v)}),w$=Di(Wa);function E$(o,l){var d=Os(o);return l==null?d:Ru(d,l)}var C$=Te(function(o,l){o=Ae(o);var d=-1,v=l.length,w=v>2?l[2]:t;for(w&&mr(l[0],l[1],w)&&(v=1);++d<v;)for(var O=l[d],q=Ir(O),M=-1,B=q.length;++M<B;){var G=q[M],Q=o[G];(Q===t||$n(Q,Cs[G])&&!ze.call(o,G))&&(o[G]=O[G])}return o}),x$=Te(function(o){return o.push(t,Hw),Jt(IE,t,o)});function R$(o,l){return pd(o,pe(l,3),rn)}function I$(o,l){return pd(o,pe(l,3),Pu)}function O$(o,l){return o==null?o:Ou(o,pe(l,3),Ir)}function P$(o,l){return o==null?o:Hd(o,pe(l,3),Ir)}function k$(o,l){return o&&rn(o,pe(l,3))}function A$(o,l){return o&&Pu(o,pe(l,3))}function T$(o){return o==null?[]:nn(o,Yt(o))}function q$(o){return o==null?[]:nn(o,Ir(o))}function Yy(o,l,d){var v=o==null?t:Mi(o,l);return v===t?d:v}function $$(o,l){return o!=null&&Yw(o,l,py)}function Jy(o,l){return o!=null&&Yw(o,l,my)}var M$=Fw(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Aa.call(l)),o[l]=d},Ky(Or)),N$=Fw(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Aa.call(l)),ze.call(o,l)?o[l].push(d):o[l]=[d]},pe),D$=Te(sn);function Yt(o){return Rr(o)?Va(o):b(o)}function Ir(o){return Rr(o)?Va(o,!0):R(o)}function F$(o,l){var d={};return l=pe(l,3),rn(o,function(v,w,O){An(d,l(v,w,O),v)}),d}function L$(o,l){var d={};return l=pe(l,3),rn(o,function(v,w,O){An(d,w,l(v,w,O))}),d}var j$=Ja(function(o,l,d){Oe(o,l,d)}),IE=Ja(function(o,l,d,v){Oe(o,l,d,v)}),U$=Di(function(o,l){var d={};if(o==null)return d;var v=!1;l=et(l,function(O){return O=As(O,o),v||(v=O.length>1),O}),pi(o,Ty(o),d),v&&(d=pr(d,h|g|m,MA));for(var w=l.length;w--;)Cy(d,l[w]);return d});function B$(o,l){return OE(o,oh(pe(l)))}var H$=Di(function(o,l){return o==null?{}:gA(o,l)});function OE(o,l){if(o==null)return{};var d=et(Ty(o),function(v){return[v]});return l=pe(l),Sw(o,d,function(v,w){return l(v,w[0])})}function V$(o,l,d){l=As(l,o);var v=-1,w=l.length;for(w||(w=1,o=t);++v<w;){var O=o==null?t:o[mi(l[v])];O===t&&(v=w,O=d),o=Li(O)?O.call(o):O}return o}function W$(o,l,d){return o==null?o:qu(o,l,d)}function Y$(o,l,d,v){return v=typeof v=="function"?v:t,o==null?o:qu(o,l,d,v)}var PE=Uw(Yt),kE=Uw(Ir);function J$(o,l,d){var v=Ee(o),w=v||qs(o)||Ga(o);if(l=pe(l,4),d==null){var O=o&&o.constructor;w?d=v?new O:[]:St(o)?d=Li(O)?Os($a(o)):{}:d={}}return(w?wt:rn)(o,function(q,M,B){return l(d,q,M,B)}),d}function z$(o,l){return o==null?!0:Cy(o,l)}function K$(o,l,d){return o==null?o:Cw(o,l,Iy(d))}function G$(o,l,d,v){return v=typeof v=="function"?v:t,o==null?o:Cw(o,l,Iy(d),v)}function Qa(o){return o==null?[]:_u(o,Yt(o))}function Q$(o){return o==null?[]:_u(o,Ir(o))}function Z$(o,l,d){return d===t&&(d=l,l=t),d!==t&&(d=un(d),d=d===d?d:0),l!==t&&(l=un(l),l=l===l?l:0),$i(un(o),l,d)}function X$(o,l,d){return l=ji(l),d===t?(d=l,l=0):d=ji(d),o=un(o),gy(o,l,d)}function eM(o,l,d){if(d&&typeof d!="boolean"&&mr(o,l,d)&&(l=d=t),d===t&&(typeof l=="boolean"?(d=l,l=t):typeof o=="boolean"&&(d=o,o=t)),o===t&&l===t?(o=0,l=1):(o=ji(o),l===t?(l=o,o=0):l=ji(l)),o>l){var v=o;o=l,l=v}if(d||o%1||l%1){var w=Td();return vt(o+w*(l-o+ad("1e-"+((w+"").length-1))),l)}return _y(o,l)}var tM=za(function(o,l,d){return l=l.toLowerCase(),o+(d?AE(l):l)});function AE(o){return zy(Ge(o).toLowerCase())}function TE(o){return o=Ge(o),o&&o.replace(gs,bd).replace(og,"")}function rM(o,l,d){o=Ge(o),l=Vr(l);var v=o.length;d=d===t?v:$i(Ce(d),0,v);var w=d;return d-=l.length,d>=0&&o.slice(d,w)==l}function nM(o){return o=Ge(o),o&&Sa.test(o)?o.replace(Ii,wg):o}function iM(o){return o=Ge(o),o&&Ke.test(o)?o.replace(co,"\\$&"):o}var sM=za(function(o,l,d){return o+(d?"-":"")+l.toLowerCase()}),oM=za(function(o,l,d){return o+(d?" ":"")+l.toLowerCase()}),aM=Mw("toLowerCase");function lM(o,l,d){o=Ge(o),l=Ce(l);var v=l?li(o):0;if(!l||v>=l)return o;var w=(l-v)/2;return Qd(So(w),d)+o+Qd(Na(w),d)}function uM(o,l,d){o=Ge(o),l=Ce(l);var v=l?li(o):0;return l&&v<l?o+Qd(l-v,d):o}function cM(o,l,d){o=Ge(o),l=Ce(l);var v=l?li(o):0;return l&&v<l?Qd(l-v,d)+o:o}function fM(o,l,d){return d||l==null?l=0:l&&(l=+l),Ad(Ge(o).replace(Oi,""),l||0)}function dM(o,l,d){return(d?mr(o,l,d):l===t)?l=1:l=Ce(l),wy(Ge(o),l)}function hM(){var o=arguments,l=Ge(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var pM=za(function(o,l,d){return o+(d?"_":"")+l.toLowerCase()});function mM(o,l,d){return d&&typeof d!="number"&&mr(o,l,d)&&(l=d=t),d=d===t?he:d>>>0,d?(o=Ge(o),o&&(typeof l=="string"||l!=null&&!Wy(l))&&(l=Vr(l),!l&&en(o))?Ts(hr(o),0,d):o.split(l,d)):[]}var gM=za(function(o,l,d){return o+(d?" ":"")+zy(l)});function yM(o,l,d){return o=Ge(o),d=d==null?0:$i(Ce(d),0,o.length),l=Vr(l),o.slice(d,d+l.length)==l}function vM(o,l,d){var v=I.templateSettings;d&&mr(o,l,d)&&(l=t),o=Ge(o),l=uh({},l,v,Bw);var w=uh({},l.imports,v.imports,Bw),O=Yt(w),q=_u(w,O),M,B,G=0,Q=l.interpolate||si,X="__p += '",re=In((l.escape||si).source+"|"+Q.source+"|"+(Q===jf?xn:si).source+"|"+(l.evaluate||si).source+"|$","g"),ue="//# sourceURL="+(ze.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++fg+"]")+`
|
|
4
4
|
`;o.replace(re,function(ge,De,je,Yr,gr,Jr){return je||(je=Yr),X+=o.slice(G,Jr).replace(Bf,Eg),De&&(M=!0,X+=`' +
|
|
@@ -20,11 +20,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
20
20
|
}`;var Pe=$E(function(){return We(O,ue+"return "+X).apply(t,q)});if(Pe.source=X,Vy(Pe))throw Pe;return Pe}function SM(o){return Ge(o).toLowerCase()}function bM(o){return Ge(o).toUpperCase()}function _M(o,l,d){if(o=Ge(o),o&&(d||l===t))return vd(o);if(!o||!(l=Vr(l)))return o;var v=hr(o),w=hr(l),O=nt(v,w),q=Sd(v,w)+1;return Ts(v,O,q).join("")}function wM(o,l,d){if(o=Ge(o),o&&(d||l===t))return o.slice(0,Pa(o)+1);if(!o||!(l=Vr(l)))return o;var v=hr(o),w=Sd(v,hr(l))+1;return Ts(v,0,w).join("")}function EM(o,l,d){if(o=Ge(o),o&&(d||l===t))return o.replace(Oi,"");if(!o||!(l=Vr(l)))return o;var v=hr(o),w=nt(v,hr(l));return Ts(v,w).join("")}function CM(o,l){var d=E,v=P;if(St(l)){var w="separator"in l?l.separator:w;d="length"in l?Ce(l.length):d,v="omission"in l?Vr(l.omission):v}o=Ge(o);var O=o.length;if(en(o)){var q=hr(o);O=q.length}if(d>=O)return o;var M=d-li(v);if(M<1)return v;var B=q?Ts(q,0,M).join(""):o.slice(0,M);if(w===t)return B+v;if(q&&(M+=B.length-M),Wy(w)){if(o.slice(M).search(w)){var G,Q=B;for(w.global||(w=In(w.source,Ge(ii.exec(w))+"g")),w.lastIndex=0;G=w.exec(Q);)var X=G.index;B=B.slice(0,X===t?M:X)}}else if(o.indexOf(Vr(w),M)!=M){var re=B.lastIndexOf(w);re>-1&&(B=B.slice(0,re))}return B+v}function xM(o){return o=Ge(o),o&&ou.test(o)?o.replace(ms,Pg):o}var RM=za(function(o,l,d){return o+(d?" ":"")+l.toUpperCase()}),zy=Mw("toUpperCase");function qE(o,l,d){return o=Ge(o),l=d?t:l,l===t?xg(o)?Tg(o):Sg(o):o.match(l)||[]}var $E=Te(function(o,l){try{return Jt(o,t,l)}catch(d){return Vy(d)?d:new ve(d)}}),IM=Di(function(o,l){return wt(l,function(d){d=mi(d),An(o,d,By(o[d],o))}),o});function OM(o){var l=o==null?0:o.length,d=pe();return o=l?et(o,function(v){if(typeof v[1]!="function")throw new wr(i);return[d(v[0]),v[1]]}):[],Te(function(v){for(var w=-1;++w<l;){var O=o[w];if(Jt(O[0],this,v))return Jt(O[1],this,v)}})}function PM(o){return Iu(pr(o,h))}function Ky(o){return function(){return o}}function kM(o,l){return o==null||o!==o?l:o}var AM=Dw(),TM=Dw(!0);function Or(o){return o}function Gy(o){return y(typeof o=="function"?o:pr(o,h))}function qM(o){return se(pr(o,h))}function $M(o,l){return ye(o,pr(l,h))}var MM=Te(function(o,l){return function(d){return sn(d,o,l)}}),NM=Te(function(o,l){return function(d){return sn(o,d,l)}});function Qy(o,l,d){var v=Yt(l),w=nn(l,v);d==null&&!(St(l)&&(w.length||!v.length))&&(d=l,l=o,o=this,w=nn(l,Yt(l)));var O=!(St(d)&&"chain"in d)||!!d.chain,q=Li(o);return wt(w,function(M){var B=l[M];o[M]=B,q&&(o.prototype[M]=function(){var G=this.__chain__;if(O||G){var Q=o(this.__wrapped__),X=Q.__actions__=xr(this.__actions__);return X.push({func:B,args:arguments,thisArg:o}),Q.__chain__=G,Q}return B.apply(o,Xr([this.value()],arguments))})}),o}function DM(){return Nt._===this&&(Nt._=Ng),this}function Zy(){}function FM(o){return o=Ce(o),Te(function(l){return on(l,o)})}var LM=Py(et),jM=Py(Ra),UM=Py(gu);function ME(o){return Ny(o)?yu(mi(o)):yA(o)}function BM(o){return function(l){return o==null?t:Mi(o,l)}}var HM=Lw(),VM=Lw(!0);function Xy(){return[]}function ev(){return!1}function WM(){return{}}function YM(){return""}function JM(){return!0}function zM(o,l){if(o=Ce(o),o<1||o>fe)return[];var d=he,v=vt(o,he);l=pe(l),o-=he;for(var w=bu(v,l);++d<o;)l(d);return w}function KM(o){return Ee(o)?et(o,mi):Wr(o)?[o]:xr(tE(Ge(o)))}function GM(o){var l=++$g;return Ge(o)+l}var QM=Gd(function(o,l){return o+l},0),ZM=ky("ceil"),XM=Gd(function(o,l){return o/l},1),eN=ky("floor");function tN(o){return o&&o.length?Ya(o,Or,ku):t}function rN(o,l){return o&&o.length?Ya(o,pe(l,2),ku):t}function nN(o){return ki(o,Or)}function iN(o,l){return ki(o,pe(l,2))}function sN(o){return o&&o.length?Ya(o,Or,$):t}function oN(o,l){return o&&o.length?Ya(o,pe(l,2),$):t}var aN=Gd(function(o,l){return o*l},1),lN=ky("round"),uN=Gd(function(o,l){return o-l},0);function cN(o){return o&&o.length?Su(o,Or):0}function fN(o,l){return o&&o.length?Su(o,pe(l,2)):0}return I.after=qq,I.ary=dE,I.assign=b$,I.assignIn=RE,I.assignInWith=uh,I.assignWith=_$,I.at=w$,I.before=hE,I.bind=By,I.bindAll=IM,I.bindKey=pE,I.castArray=Wq,I.chain=uE,I.chunk=eT,I.compact=tT,I.concat=rT,I.cond=OM,I.conforms=PM,I.constant=Ky,I.countBy=cq,I.create=E$,I.curry=mE,I.curryRight=gE,I.debounce=yE,I.defaults=C$,I.defaultsDeep=x$,I.defer=$q,I.delay=Mq,I.difference=nT,I.differenceBy=iT,I.differenceWith=sT,I.drop=oT,I.dropRight=aT,I.dropRightWhile=lT,I.dropWhile=uT,I.fill=cT,I.filter=dq,I.flatMap=mq,I.flatMapDeep=gq,I.flatMapDepth=yq,I.flatten=sE,I.flattenDeep=fT,I.flattenDepth=dT,I.flip=Nq,I.flow=AM,I.flowRight=TM,I.fromPairs=hT,I.functions=T$,I.functionsIn=q$,I.groupBy=vq,I.initial=mT,I.intersection=gT,I.intersectionBy=yT,I.intersectionWith=vT,I.invert=M$,I.invertBy=N$,I.invokeMap=bq,I.iteratee=Gy,I.keyBy=_q,I.keys=Yt,I.keysIn=Ir,I.map=nh,I.mapKeys=F$,I.mapValues=L$,I.matches=qM,I.matchesProperty=$M,I.memoize=sh,I.merge=j$,I.mergeWith=IE,I.method=MM,I.methodOf=NM,I.mixin=Qy,I.negate=oh,I.nthArg=FM,I.omit=U$,I.omitBy=B$,I.once=Dq,I.orderBy=wq,I.over=LM,I.overArgs=Fq,I.overEvery=jM,I.overSome=UM,I.partial=Hy,I.partialRight=vE,I.partition=Eq,I.pick=H$,I.pickBy=OE,I.property=ME,I.propertyOf=BM,I.pull=wT,I.pullAll=aE,I.pullAllBy=ET,I.pullAllWith=CT,I.pullAt=xT,I.range=HM,I.rangeRight=VM,I.rearg=Lq,I.reject=Rq,I.remove=RT,I.rest=jq,I.reverse=jy,I.sampleSize=Oq,I.set=W$,I.setWith=Y$,I.shuffle=Pq,I.slice=IT,I.sortBy=Tq,I.sortedUniq=$T,I.sortedUniqBy=MT,I.split=mM,I.spread=Uq,I.tail=NT,I.take=DT,I.takeRight=FT,I.takeRightWhile=LT,I.takeWhile=jT,I.tap=tq,I.throttle=Bq,I.thru=rh,I.toArray=EE,I.toPairs=PE,I.toPairsIn=kE,I.toPath=KM,I.toPlainObject=xE,I.transform=J$,I.unary=Hq,I.union=UT,I.unionBy=BT,I.unionWith=HT,I.uniq=VT,I.uniqBy=WT,I.uniqWith=YT,I.unset=z$,I.unzip=Uy,I.unzipWith=lE,I.update=K$,I.updateWith=G$,I.values=Qa,I.valuesIn=Q$,I.without=JT,I.words=qE,I.wrap=Vq,I.xor=zT,I.xorBy=KT,I.xorWith=GT,I.zip=QT,I.zipObject=ZT,I.zipObjectDeep=XT,I.zipWith=eq,I.entries=PE,I.entriesIn=kE,I.extend=RE,I.extendWith=uh,Qy(I,I),I.add=QM,I.attempt=$E,I.camelCase=tM,I.capitalize=AE,I.ceil=ZM,I.clamp=Z$,I.clone=Yq,I.cloneDeep=zq,I.cloneDeepWith=Kq,I.cloneWith=Jq,I.conformsTo=Gq,I.deburr=TE,I.defaultTo=kM,I.divide=XM,I.endsWith=rM,I.eq=$n,I.escape=nM,I.escapeRegExp=iM,I.every=fq,I.find=hq,I.findIndex=nE,I.findKey=R$,I.findLast=pq,I.findLastIndex=iE,I.findLastKey=I$,I.floor=eN,I.forEach=cE,I.forEachRight=fE,I.forIn=O$,I.forInRight=P$,I.forOwn=k$,I.forOwnRight=A$,I.get=Yy,I.gt=Qq,I.gte=Zq,I.has=$$,I.hasIn=Jy,I.head=oE,I.identity=Or,I.includes=Sq,I.indexOf=pT,I.inRange=X$,I.invoke=D$,I.isArguments=ko,I.isArray=Ee,I.isArrayBuffer=Xq,I.isArrayLike=Rr,I.isArrayLikeObject=At,I.isBoolean=e$,I.isBuffer=qs,I.isDate=t$,I.isElement=r$,I.isEmpty=n$,I.isEqual=i$,I.isEqualWith=s$,I.isError=Vy,I.isFinite=o$,I.isFunction=Li,I.isInteger=SE,I.isLength=ah,I.isMap=bE,I.isMatch=a$,I.isMatchWith=l$,I.isNaN=u$,I.isNative=c$,I.isNil=d$,I.isNull=f$,I.isNumber=_E,I.isObject=St,I.isObjectLike=Ct,I.isPlainObject=Du,I.isRegExp=Wy,I.isSafeInteger=h$,I.isSet=wE,I.isString=lh,I.isSymbol=Wr,I.isTypedArray=Ga,I.isUndefined=p$,I.isWeakMap=m$,I.isWeakSet=g$,I.join=ST,I.kebabCase=sM,I.last=ln,I.lastIndexOf=bT,I.lowerCase=oM,I.lowerFirst=aM,I.lt=y$,I.lte=v$,I.max=tN,I.maxBy=rN,I.mean=nN,I.meanBy=iN,I.min=sN,I.minBy=oN,I.stubArray=Xy,I.stubFalse=ev,I.stubObject=WM,I.stubString=YM,I.stubTrue=JM,I.multiply=aN,I.nth=_T,I.noConflict=DM,I.noop=Zy,I.now=ih,I.pad=lM,I.padEnd=uM,I.padStart=cM,I.parseInt=fM,I.random=eM,I.reduce=Cq,I.reduceRight=xq,I.repeat=dM,I.replace=hM,I.result=V$,I.round=lN,I.runInContext=U,I.sample=Iq,I.size=kq,I.snakeCase=pM,I.some=Aq,I.sortedIndex=OT,I.sortedIndexBy=PT,I.sortedIndexOf=kT,I.sortedLastIndex=AT,I.sortedLastIndexBy=TT,I.sortedLastIndexOf=qT,I.startCase=gM,I.startsWith=yM,I.subtract=uN,I.sum=cN,I.sumBy=fN,I.template=vM,I.times=zM,I.toFinite=ji,I.toInteger=Ce,I.toLength=CE,I.toLower=SM,I.toNumber=un,I.toSafeInteger=S$,I.toString=Ge,I.toUpper=bM,I.trim=_M,I.trimEnd=wM,I.trimStart=EM,I.truncate=CM,I.unescape=xM,I.uniqueId=GM,I.upperCase=RM,I.upperFirst=zy,I.each=cE,I.eachRight=fE,I.first=oE,Qy(I,function(){var o={};return rn(I,function(l,d){ze.call(I.prototype,d)||(o[d]=l)}),o}(),{chain:!1}),I.VERSION=e,wt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){I[o].placeholder=I}),wt(["drop","take"],function(o,l){Ie.prototype[o]=function(d){d=d===t?1:Et(Ce(d),0);var v=this.__filtered__&&!l?new Ie(this):this.clone();return v.__filtered__?v.__takeCount__=vt(d,v.__takeCount__):v.__views__.push({size:vt(d,he),type:o+(v.__dir__<0?"Right":"")}),v},Ie.prototype[o+"Right"]=function(d){return this.reverse()[o](d).reverse()}}),wt(["filter","map","takeWhile"],function(o,l){var d=l+1,v=d==L||d==Z;Ie.prototype[o]=function(w){var O=this.clone();return O.__iteratees__.push({iteratee:pe(w,3),type:d}),O.__filtered__=O.__filtered__||v,O}}),wt(["head","last"],function(o,l){var d="take"+(l?"Right":"");Ie.prototype[o]=function(){return this[d](1).value()[0]}}),wt(["initial","tail"],function(o,l){var d="drop"+(l?"":"Right");Ie.prototype[o]=function(){return this.__filtered__?new Ie(this):this[d](1)}}),Ie.prototype.compact=function(){return this.filter(Or)},Ie.prototype.find=function(o){return this.filter(o).head()},Ie.prototype.findLast=function(o){return this.reverse().find(o)},Ie.prototype.invokeMap=Te(function(o,l){return typeof o=="function"?new Ie(this):this.map(function(d){return sn(d,o,l)})}),Ie.prototype.reject=function(o){return this.filter(oh(pe(o)))},Ie.prototype.slice=function(o,l){o=Ce(o);var d=this;return d.__filtered__&&(o>0||l<0)?new Ie(d):(o<0?d=d.takeRight(-o):o&&(d=d.drop(o)),l!==t&&(l=Ce(l),d=l<0?d.dropRight(-l):d.take(l-o)),d)},Ie.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Ie.prototype.toArray=function(){return this.take(he)},rn(Ie.prototype,function(o,l){var d=/^(?:filter|find|map|reject)|While$/.test(l),v=/^(?:head|last)$/.test(l),w=I[v?"take"+(l=="last"?"Right":""):l],O=v||/^find/.test(l);w&&(I.prototype[l]=function(){var q=this.__wrapped__,M=v?[1]:arguments,B=q instanceof Ie,G=M[0],Q=B||Ee(q),X=function(De){var je=w.apply(I,Xr([De],M));return v&&re?je[0]:je};Q&&d&&typeof G=="function"&&G.length!=1&&(B=Q=!1);var re=this.__chain__,ue=!!this.__actions__.length,me=O&&!re,Pe=B&&!ue;if(!O&&Q){q=Pe?q:new Ie(this);var ge=o.apply(q,M);return ge.__actions__.push({func:rh,args:[X],thisArg:t}),new Er(ge,re)}return me&&Pe?o.apply(this,M):(ge=this.thru(X),me?v?ge.value()[0]:ge.value():ge)})}),wt(["pop","push","shift","sort","splice","unshift"],function(o){var l=go[o],d=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",v=/^(?:pop|shift)$/.test(o);I.prototype[o]=function(){var w=arguments;if(v&&!this.__chain__){var O=this.value();return l.apply(Ee(O)?O:[],w)}return this[d](function(q){return l.apply(Ee(q)?q:[],w)})}}),rn(Ie.prototype,function(o,l){var d=I[l];if(d){var v=d.name+"";ze.call(Is,v)||(Is[v]=[]),Is[v].push({name:l,func:d})}}),Is[Kd(t,x).name]=[{name:"wrapper",func:t}],Ie.prototype.clone=Jg,Ie.prototype.reverse=zg,Ie.prototype.value=Kg,I.prototype.at=rq,I.prototype.chain=nq,I.prototype.commit=iq,I.prototype.next=sq,I.prototype.plant=aq,I.prototype.reverse=lq,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=uq,I.prototype.first=I.prototype.head,vo&&(I.prototype[vo]=oq),I},ui=qg();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Nt._=ui,define(function(){return ui})):oi?((oi.exports=ui)._=ui,du._=ui):Nt._=ui}).call(el)});var XE=F((pv,tl)=>{(function(t,e){typeof pv=="object"&&typeof tl<"u"?tl.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(pv,function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(c){t=c}function n(c){return c instanceof Array||Object.prototype.toString.call(c)==="[object Array]"}function i(c){return c!=null&&Object.prototype.toString.call(c)==="[object Object]"}function s(c,p){return Object.prototype.hasOwnProperty.call(c,p)}function a(c){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(c).length===0;var p;for(p in c)if(s(c,p))return!1;return!0}function u(c){return c===void 0}function f(c){return typeof c=="number"||Object.prototype.toString.call(c)==="[object Number]"}function h(c){return c instanceof Date||Object.prototype.toString.call(c)==="[object Date]"}function g(c,p){var y=[],b,R=c.length;for(b=0;b<R;++b)y.push(p(c[b],b));return y}function m(c,p){for(var y in p)s(p,y)&&(c[y]=p[y]);return s(p,"toString")&&(c.toString=p.toString),s(p,"valueOf")&&(c.valueOf=p.valueOf),c}function S(c,p,y,b){return ws(c,p,y,b,!0).utc()}function _(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function C(c){return c._pf==null&&(c._pf=_()),c._pf}var x;Array.prototype.some?x=Array.prototype.some:x=function(c){var p=Object(this),y=p.length>>>0,b;for(b=0;b<y;b++)if(b in p&&c.call(this,p[b],b,p))return!0;return!1};function A(c){var p=null,y=!1,b=c._d&&!isNaN(c._d.getTime());if(b&&(p=C(c),y=x.call(p.parsedDateParts,function(R){return R!=null}),b=p.overflow<0&&!p.empty&&!p.invalidEra&&!p.invalidMonth&&!p.invalidWeekday&&!p.weekdayMismatch&&!p.nullInput&&!p.invalidFormat&&!p.userInvalidated&&(!p.meridiem||p.meridiem&&y),c._strict&&(b=b&&p.charsLeftOver===0&&p.unusedTokens.length===0&&p.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(c))c._isValid=b;else return b;return c._isValid}function T(c){var p=S(NaN);return c!=null?m(C(p),c):C(p).userInvalidated=!0,p}var j=e.momentProperties=[],Y=!1;function V(c,p){var y,b,R,$=j.length;if(u(p._isAMomentObject)||(c._isAMomentObject=p._isAMomentObject),u(p._i)||(c._i=p._i),u(p._f)||(c._f=p._f),u(p._l)||(c._l=p._l),u(p._strict)||(c._strict=p._strict),u(p._tzm)||(c._tzm=p._tzm),u(p._isUTC)||(c._isUTC=p._isUTC),u(p._offset)||(c._offset=p._offset),u(p._pf)||(c._pf=C(p)),u(p._locale)||(c._locale=p._locale),$>0)for(y=0;y<$;y++)b=j[y],R=p[b],u(R)||(c[b]=R);return c}function K(c){V(this,c),this._d=new Date(c._d!=null?c._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Y===!1&&(Y=!0,e.updateOffset(this),Y=!1)}function ee(c){return c instanceof K||c!=null&&c._isAMomentObject!=null}function k(c){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+c)}function E(c,p){var y=!0;return m(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,c),y){var b=[],R,$,W,se=arguments.length;for($=0;$<se;$++){if(R="",typeof arguments[$]=="object"){R+=`
|
|
21
21
|
[`+$+"] ";for(W in arguments[0])s(arguments[0],W)&&(R+=W+": "+arguments[0][W]+", ");R=R.slice(0,-2)}else R=arguments[$];b.push(R)}k(c+`
|
|
22
22
|
Arguments: `+Array.prototype.slice.call(b).join("")+`
|
|
23
|
-
`+new Error().stack),y=!1}return p.apply(this,arguments)},p)}var P={};function N(c,p){e.deprecationHandler!=null&&e.deprecationHandler(c,p),P[c]||(k(p),P[c]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function D(c){return typeof Function<"u"&&c instanceof Function||Object.prototype.toString.call(c)==="[object Function]"}function L(c){var p,y;for(y in c)s(c,y)&&(p=c[y],D(p)?this[y]=p:this["_"+y]=p);this._config=c,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function z(c,p){var y=m({},c),b;for(b in p)s(p,b)&&(i(c[b])&&i(p[b])?(y[b]={},m(y[b],c[b]),m(y[b],p[b])):p[b]!=null?y[b]=p[b]:delete y[b]);for(b in c)s(c,b)&&!s(p,b)&&i(c[b])&&(y[b]=m({},y[b]));return y}function Z(c){c!=null&&this.set(c)}var ie;Object.keys?ie=Object.keys:ie=function(c){var p,y=[];for(p in c)s(c,p)&&y.push(p);return y};var fe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function bt(c,p,y){var b=this._calendar[c]||this._calendar.sameElse;return D(b)?b.call(p,y):b}function we(c,p,y){var b=""+Math.abs(c),R=p-b.length,$=c>=0;return($?y?"+":"":"-")+Math.pow(10,Math.max(0,R)).toString().substr(1)+b}var he=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ze=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,_t={},Mt={};function le(c,p,y,b){var R=b;typeof b=="string"&&(R=function(){return this[b]()}),c&&(Mt[c]=R),p&&(Mt[p[0]]=function(){return we(R.apply(this,arguments),p[1],p[2])}),y&&(Mt[y]=function(){return this.localeData().ordinal(R.apply(this,arguments),c)})}function ei(c){return c.match(/\[[\s\S]/)?c.replace(/^\[|\]$/g,""):c.replace(/\\/g,"")}function su(c){var p=c.match(he),y,b;for(y=0,b=p.length;y<b;y++)Mt[p[y]]?p[y]=Mt[p[y]]:p[y]=ei(p[y]);return function(R){var $="",W;for(W=0;W<b;W++)$+=D(p[W])?p[W].call(R,c):p[W];return $}}function ct(c,p){return c.isValid()?(p=_n(p,c.localeData()),_t[p]=_t[p]||su(p),_t[p](c)):c.localeData().invalidDate()}function _n(c,p){var y=5;function b(R){return p.longDateFormat(R)||R}for(Ze.lastIndex=0;y>=0&&Ze.test(c);)c=c.replace(Ze,b),Ze.lastIndex=0,y-=1;return c}var as={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function jt(c){var p=this._longDateFormat[c],y=this._longDateFormat[c.toUpperCase()];return p||!y?p:(this._longDateFormat[c]=y.match(he).map(function(b){return b==="MMMM"||b==="MM"||b==="DD"||b==="dddd"?b.slice(1):b}).join(""),this._longDateFormat[c])}var ft="Invalid date";function ti(){return this._invalidDate}var rr="%d",Qr=/\d{1,2}/;function Lm(c){return this._ordinal.replace("%d",c)}var wn={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Lf(c,p,y,b){var R=this._relativeTime[y];return D(R)?R(c,p,y,b):R.replace(/%d/i,c)}function jm(c,p){var y=this._relativeTime[c>0?"future":"past"];return D(y)?y(p):y.replace(/%s/i,p)}var ls={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function gt(c){return typeof c=="string"?ls[c]||ls[c.toLowerCase()]:void 0}function Ri(c){var p={},y,b;for(b in c)s(c,b)&&(y=gt(b),y&&(p[y]=c[b]));return p}var ma={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Um(c){var p=[],y;for(y in c)s(c,y)&&p.push({unit:y,priority:ma[y]});return p.sort(function(b,R){return b.priority-R.priority}),p}var us=/\d/,dr=/\d\d/,cs=/\d{3}/,ri=/\d{4}/,fs=/[+-]?\d{6}/,Xe=/\d\d?/,ga=/\d\d\d\d?/,ya=/\d\d\d\d\d\d?/,ds=/\d{1,3}/,uo=/\d{1,4}/,hs=/[+-]?\d{1,6}/,ni=/\d+/,ps=/[+-]?\d+/,Bm=/Z|[+-]\d\d:?\d\d/gi,va=/Z|[+-]\d\d(?::?\d\d)?/gi,Hm=/[+-]?\d+(\.\d{1,3})?/,ms=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ii=/^[1-9]\d?/,ou=/^([1-9]\d|\d)/,Sa;Sa={};function oe(c,p,y){Sa[c]=D(p)?p:function(b,R){return b&&y?y:p}}function Vm(c,p){return s(Sa,c)?Sa[c](p._strict,p._locale):new RegExp(jf(c))}function jf(c){return En(c.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(p,y,b,R,$){return y||b||R||$}))}function En(c){return c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function _r(c){return c<0?Math.ceil(c)||0:Math.floor(c)}function $e(c){var p=+c,y=0;return p!==0&&isFinite(p)&&(y=_r(p)),y}var co={};function Ke(c,p){var y,b=p,R;for(typeof c=="string"&&(c=[c]),f(p)&&(b=function($,W){W[p]=$e($)}),R=c.length,y=0;y<R;y++)co[c[y]]=b}function Oi(c,p){Ke(c,function(y,b,R,$){R._w=R._w||{},p(y,R._w,R,$)})}function Wm(c,p,y){p!=null&&s(co,c)&&co[c](p,y._a,y,c)}function ba(c){return c%4===0&&c%100!==0||c%400===0}var Vt=0,Cn=1,Zr=2,Pt=3,jr=4,xn=5,ii=6,Ym=7,Jm=8;le("Y",0,0,function(){var c=this.year();return c<=9999?we(c,4):"+"+c}),le(0,["YY",2],0,function(){return this.year()%100}),le(0,["YYYY",4],0,"year"),le(0,["YYYYY",5],0,"year"),le(0,["YYYYYY",6,!0],0,"year"),oe("Y",ps),oe("YY",Xe,dr),oe("YYYY",uo,ri),oe("YYYYY",hs,fs),oe("YYYYYY",hs,fs),Ke(["YYYYY","YYYYYY"],Vt),Ke("YYYY",function(c,p){p[Vt]=c.length===2?e.parseTwoDigitYear(c):$e(c)}),Ke("YY",function(c,p){p[Vt]=e.parseTwoDigitYear(c)}),Ke("Y",function(c,p){p[Vt]=parseInt(c,10)});function fo(c){return ba(c)?366:365}e.parseTwoDigitYear=function(c){return $e(c)+($e(c)>68?1900:2e3)};var Uf=gs("FullYear",!0);function zm(){return ba(this.year())}function gs(c,p){return function(y){return y!=null?(Bf(this,c,y),e.updateOffset(this,p),this):si(this,c)}}function si(c,p){if(!c.isValid())return NaN;var y=c._d,b=c._isUTC;switch(p){case"Milliseconds":return b?y.getUTCMilliseconds():y.getMilliseconds();case"Seconds":return b?y.getUTCSeconds():y.getSeconds();case"Minutes":return b?y.getUTCMinutes():y.getMinutes();case"Hours":return b?y.getUTCHours():y.getHours();case"Date":return b?y.getUTCDate():y.getDate();case"Day":return b?y.getUTCDay():y.getDay();case"Month":return b?y.getUTCMonth():y.getMonth();case"FullYear":return b?y.getUTCFullYear():y.getFullYear();default:return NaN}}function Bf(c,p,y){var b,R,$,W,se;if(!(!c.isValid()||isNaN(y))){switch(b=c._d,R=c._isUTC,p){case"Milliseconds":return void(R?b.setUTCMilliseconds(y):b.setMilliseconds(y));case"Seconds":return void(R?b.setUTCSeconds(y):b.setSeconds(y));case"Minutes":return void(R?b.setUTCMinutes(y):b.setMinutes(y));case"Hours":return void(R?b.setUTCHours(y):b.setHours(y));case"Date":return void(R?b.setUTCDate(y):b.setDate(y));case"FullYear":break;default:return}$=y,W=c.month(),se=c.date(),se=se===29&&W===1&&!ba($)?28:se,R?b.setUTCFullYear($,W,se):b.setFullYear($,W,se)}}function _a(c){return c=gt(c),D(this[c])?this[c]():this}function Km(c,p){if(typeof c=="object"){c=Ri(c);var y=Um(c),b,R=y.length;for(b=0;b<R;b++)this[y[b].unit](c[y[b].unit])}else if(c=gt(c),D(this[c]))return this[c](p);return this}function Gm(c,p){return(c%p+p)%p}var yt;Array.prototype.indexOf?yt=Array.prototype.indexOf:yt=function(c){var p;for(p=0;p<this.length;++p)if(this[p]===c)return p;return-1};function wa(c,p){if(isNaN(c)||isNaN(p))return NaN;var y=Gm(p,12);return c+=(p-y)/12,y===1?ba(c)?29:28:31-y%7%2}le("M",["MM",2],"Mo",function(){return this.month()+1}),le("MMM",0,0,function(c){return this.localeData().monthsShort(this,c)}),le("MMMM",0,0,function(c){return this.localeData().months(this,c)}),oe("M",Xe,Ii),oe("MM",Xe,dr),oe("MMM",function(c,p){return p.monthsShortRegex(c)}),oe("MMMM",function(c,p){return p.monthsRegex(c)}),Ke(["M","MM"],function(c,p){p[Cn]=$e(c)-1}),Ke(["MMM","MMMM"],function(c,p,y,b){var R=y._locale.monthsParse(c,b,y._strict);R!=null?p[Cn]=R:C(y).invalidMonth=c});var Hf="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),au="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Vf=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Qm=ms,Zm=ms;function Xm(c,p){return c?n(this._months)?this._months[c.month()]:this._months[(this._months.isFormat||Vf).test(p)?"format":"standalone"][c.month()]:n(this._months)?this._months:this._months.standalone}function Wf(c,p){return c?n(this._monthsShort)?this._monthsShort[c.month()]:this._monthsShort[Vf.test(p)?"format":"standalone"][c.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Yf(c,p,y){var b,R,$,W=c.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],b=0;b<12;++b)$=S([2e3,b]),this._shortMonthsParse[b]=this.monthsShort($,"").toLocaleLowerCase(),this._longMonthsParse[b]=this.months($,"").toLocaleLowerCase();return y?p==="MMM"?(R=yt.call(this._shortMonthsParse,W),R!==-1?R:null):(R=yt.call(this._longMonthsParse,W),R!==-1?R:null):p==="MMM"?(R=yt.call(this._shortMonthsParse,W),R!==-1?R:(R=yt.call(this._longMonthsParse,W),R!==-1?R:null)):(R=yt.call(this._longMonthsParse,W),R!==-1?R:(R=yt.call(this._shortMonthsParse,W),R!==-1?R:null))}function Jf(c,p,y){var b,R,$;if(this._monthsParseExact)return Yf.call(this,c,p,y);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),b=0;b<12;b++){if(R=S([2e3,b]),y&&!this._longMonthsParse[b]&&(this._longMonthsParse[b]=new RegExp("^"+this.months(R,"").replace(".","")+"$","i"),this._shortMonthsParse[b]=new RegExp("^"+this.monthsShort(R,"").replace(".","")+"$","i")),!y&&!this._monthsParse[b]&&($="^"+this.months(R,"")+"|^"+this.monthsShort(R,""),this._monthsParse[b]=new RegExp($.replace(".",""),"i")),y&&p==="MMMM"&&this._longMonthsParse[b].test(c))return b;if(y&&p==="MMM"&&this._shortMonthsParse[b].test(c))return b;if(!y&&this._monthsParse[b].test(c))return b}}function Ea(c,p){if(!c.isValid())return c;if(typeof p=="string"){if(/^\d+$/.test(p))p=$e(p);else if(p=c.localeData().monthsParse(p),!f(p))return c}var y=p,b=c.date();return b=b<29?b:Math.min(b,wa(c.year(),y)),c._isUTC?c._d.setUTCMonth(y,b):c._d.setMonth(y,b),c}function zf(c){return c!=null?(Ea(this,c),e.updateOffset(this,!0),this):si(this,"Month")}function Kf(){return wa(this.year(),this.month())}function Ca(c){return this._monthsParseExact?(s(this,"_monthsRegex")||Qf.call(this),c?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Qm),this._monthsShortStrictRegex&&c?this._monthsShortStrictRegex:this._monthsShortRegex)}function Gf(c){return this._monthsParseExact?(s(this,"_monthsRegex")||Qf.call(this),c?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Zm),this._monthsStrictRegex&&c?this._monthsStrictRegex:this._monthsRegex)}function Qf(){function c(ye,Oe){return Oe.length-ye.length}var p=[],y=[],b=[],R,$,W,se;for(R=0;R<12;R++)$=S([2e3,R]),W=En(this.monthsShort($,"")),se=En(this.months($,"")),p.push(W),y.push(se),b.push(se),b.push(W);p.sort(c),y.sort(c),b.sort(c),this._monthsRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+y.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+p.join("|")+")","i")}function Zf(c,p,y,b,R,$,W){var se;return c<100&&c>=0?(se=new Date(c+400,p,y,b,R,$,W),isFinite(se.getFullYear())&&se.setFullYear(c)):se=new Date(c,p,y,b,R,$,W),se}function ys(c){var p,y;return c<100&&c>=0?(y=Array.prototype.slice.call(arguments),y[0]=c+400,p=new Date(Date.UTC.apply(null,y)),isFinite(p.getUTCFullYear())&&p.setUTCFullYear(c)):p=new Date(Date.UTC.apply(null,arguments)),p}function vs(c,p,y){var b=7+p-y,R=(7+ys(c,0,b).getUTCDay()-p)%7;return-R+b-1}function Xf(c,p,y,b,R){var $=(7+y-b)%7,W=vs(c,b,R),se=1+7*(p-1)+$+W,ye,Oe;return se<=0?(ye=c-1,Oe=fo(ye)+se):se>fo(c)?(ye=c+1,Oe=se-fo(c)):(ye=c,Oe=se),{year:ye,dayOfYear:Oe}}function Ss(c,p,y){var b=vs(c.year(),p,y),R=Math.floor((c.dayOfYear()-b-1)/7)+1,$,W;return R<1?(W=c.year()-1,$=R+Ur(W,p,y)):R>Ur(c.year(),p,y)?($=R-Ur(c.year(),p,y),W=c.year()+1):(W=c.year(),$=R),{week:$,year:W}}function Ur(c,p,y){var b=vs(c,p,y),R=vs(c+1,p,y);return(fo(c)-b+R)/7}le("w",["ww",2],"wo","week"),le("W",["WW",2],"Wo","isoWeek"),oe("w",Xe,Ii),oe("ww",Xe,dr),oe("W",Xe,Ii),oe("WW",Xe,dr),Oi(["w","ww","W","WW"],function(c,p,y,b){p[b.substr(0,1)]=$e(c)});function lu(c){return Ss(c,this._week.dow,this._week.doy).week}var bs={dow:0,doy:6};function ed(){return this._week.dow}function td(){return this._week.doy}function eg(c){var p=this.localeData().week(this);return c==null?p:this.add((c-p)*7,"d")}function rd(c){var p=Ss(this,1,4).week;return c==null?p:this.add((c-p)*7,"d")}le("d",0,"do","day"),le("dd",0,0,function(c){return this.localeData().weekdaysMin(this,c)}),le("ddd",0,0,function(c){return this.localeData().weekdaysShort(this,c)}),le("dddd",0,0,function(c){return this.localeData().weekdays(this,c)}),le("e",0,0,"weekday"),le("E",0,0,"isoWeekday"),oe("d",Xe),oe("e",Xe),oe("E",Xe),oe("dd",function(c,p){return p.weekdaysMinRegex(c)}),oe("ddd",function(c,p){return p.weekdaysShortRegex(c)}),oe("dddd",function(c,p){return p.weekdaysRegex(c)}),Oi(["dd","ddd","dddd"],function(c,p,y,b){var R=y._locale.weekdaysParse(c,b,y._strict);R!=null?p.d=R:C(y).invalidWeekday=c}),Oi(["d","e","E"],function(c,p,y,b){p[b]=$e(c)});function nd(c,p){return typeof c!="string"?c:isNaN(c)?(c=p.weekdaysParse(c),typeof c=="number"?c:null):parseInt(c,10)}function id(c,p){return typeof c=="string"?p.weekdaysParse(c)%7||7:isNaN(c)?null:c}function xa(c,p){return c.slice(p,7).concat(c.slice(0,p))}var tg="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),sd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),rg="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),od=ms,ng=ms,ig=ms;function sg(c,p){var y=n(this._weekdays)?this._weekdays:this._weekdays[c&&c!==!0&&this._weekdays.isFormat.test(p)?"format":"standalone"];return c===!0?xa(y,this._week.dow):c?y[c.day()]:y}function og(c){return c===!0?xa(this._weekdaysShort,this._week.dow):c?this._weekdaysShort[c.day()]:this._weekdaysShort}function uu(c){return c===!0?xa(this._weekdaysMin,this._week.dow):c?this._weekdaysMin[c.day()]:this._weekdaysMin}function ag(c,p,y){var b,R,$,W=c.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],b=0;b<7;++b)$=S([2e3,1]).day(b),this._minWeekdaysParse[b]=this.weekdaysMin($,"").toLocaleLowerCase(),this._shortWeekdaysParse[b]=this.weekdaysShort($,"").toLocaleLowerCase(),this._weekdaysParse[b]=this.weekdays($,"").toLocaleLowerCase();return y?p==="dddd"?(R=yt.call(this._weekdaysParse,W),R!==-1?R:null):p==="ddd"?(R=yt.call(this._shortWeekdaysParse,W),R!==-1?R:null):(R=yt.call(this._minWeekdaysParse,W),R!==-1?R:null):p==="dddd"?(R=yt.call(this._weekdaysParse,W),R!==-1||(R=yt.call(this._shortWeekdaysParse,W),R!==-1)?R:(R=yt.call(this._minWeekdaysParse,W),R!==-1?R:null)):p==="ddd"?(R=yt.call(this._shortWeekdaysParse,W),R!==-1||(R=yt.call(this._weekdaysParse,W),R!==-1)?R:(R=yt.call(this._minWeekdaysParse,W),R!==-1?R:null)):(R=yt.call(this._minWeekdaysParse,W),R!==-1||(R=yt.call(this._weekdaysParse,W),R!==-1)?R:(R=yt.call(this._shortWeekdaysParse,W),R!==-1?R:null))}function lg(c,p,y){var b,R,$;if(this._weekdaysParseExact)return ag.call(this,c,p,y);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),b=0;b<7;b++){if(R=S([2e3,1]).day(b),y&&!this._fullWeekdaysParse[b]&&(this._fullWeekdaysParse[b]=new RegExp("^"+this.weekdays(R,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[b]=new RegExp("^"+this.weekdaysShort(R,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[b]=new RegExp("^"+this.weekdaysMin(R,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[b]||($="^"+this.weekdays(R,"")+"|^"+this.weekdaysShort(R,"")+"|^"+this.weekdaysMin(R,""),this._weekdaysParse[b]=new RegExp($.replace(".",""),"i")),y&&p==="dddd"&&this._fullWeekdaysParse[b].test(c))return b;if(y&&p==="ddd"&&this._shortWeekdaysParse[b].test(c))return b;if(y&&p==="dd"&&this._minWeekdaysParse[b].test(c))return b;if(!y&&this._weekdaysParse[b].test(c))return b}}function ug(c){if(!this.isValid())return c!=null?this:NaN;var p=si(this,"Day");return c!=null?(c=nd(c,this.localeData()),this.add(c-p,"d")):p}function cg(c){if(!this.isValid())return c!=null?this:NaN;var p=(this.day()+7-this.localeData()._week.dow)%7;return c==null?p:this.add(c-p,"d")}function fg(c){if(!this.isValid())return c!=null?this:NaN;if(c!=null){var p=id(c,this.localeData());return this.day(this.day()%7?p:p-7)}else return this.day()||7}function ot(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||cu.call(this),c?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=od),this._weekdaysStrictRegex&&c?this._weekdaysStrictRegex:this._weekdaysRegex)}function rt(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||cu.call(this),c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ng),this._weekdaysShortStrictRegex&&c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function dg(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||cu.call(this),c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ig),this._weekdaysMinStrictRegex&&c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function cu(){function c(Kt,on){return on.length-Kt.length}var p=[],y=[],b=[],R=[],$,W,se,ye,Oe;for($=0;$<7;$++)W=S([2e3,1]).day($),se=En(this.weekdaysMin(W,"")),ye=En(this.weekdaysShort(W,"")),Oe=En(this.weekdays(W,"")),p.push(se),y.push(ye),b.push(Oe),R.push(se),R.push(ye),R.push(Oe);p.sort(c),y.sort(c),b.sort(c),R.sort(c),this._weekdaysRegex=new RegExp("^("+R.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+y.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+p.join("|")+")","i")}function fu(){return this.hours()%12||12}function hg(){return this.hours()||24}le("H",["HH",2],0,"hour"),le("h",["hh",2],0,fu),le("k",["kk",2],0,hg),le("hmm",0,0,function(){return""+fu.apply(this)+we(this.minutes(),2)}),le("hmmss",0,0,function(){return""+fu.apply(this)+we(this.minutes(),2)+we(this.seconds(),2)}),le("Hmm",0,0,function(){return""+this.hours()+we(this.minutes(),2)}),le("Hmmss",0,0,function(){return""+this.hours()+we(this.minutes(),2)+we(this.seconds(),2)});function ad(c,p){le(c,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),p)})}ad("a",!0),ad("A",!1);function ld(c,p){return p._meridiemParse}oe("a",ld),oe("A",ld),oe("H",Xe,ou),oe("h",Xe,Ii),oe("k",Xe,Ii),oe("HH",Xe,dr),oe("hh",Xe,dr),oe("kk",Xe,dr),oe("hmm",ga),oe("hmmss",ya),oe("Hmm",ga),oe("Hmmss",ya),Ke(["H","HH"],Pt),Ke(["k","kk"],function(c,p,y){var b=$e(c);p[Pt]=b===24?0:b}),Ke(["a","A"],function(c,p,y){y._isPm=y._locale.isPM(c),y._meridiem=c}),Ke(["h","hh"],function(c,p,y){p[Pt]=$e(c),C(y).bigHour=!0}),Ke("hmm",function(c,p,y){var b=c.length-2;p[Pt]=$e(c.substr(0,b)),p[jr]=$e(c.substr(b)),C(y).bigHour=!0}),Ke("hmmss",function(c,p,y){var b=c.length-4,R=c.length-2;p[Pt]=$e(c.substr(0,b)),p[jr]=$e(c.substr(b,2)),p[xn]=$e(c.substr(R)),C(y).bigHour=!0}),Ke("Hmm",function(c,p,y){var b=c.length-2;p[Pt]=$e(c.substr(0,b)),p[jr]=$e(c.substr(b))}),Ke("Hmmss",function(c,p,y){var b=c.length-4,R=c.length-2;p[Pt]=$e(c.substr(0,b)),p[jr]=$e(c.substr(b,2)),p[xn]=$e(c.substr(R))});function ud(c){return(c+"").toLowerCase().charAt(0)==="p"}var pg=/[ap]\.?m?\.?/i,Nt=gs("Hours",!0);function du(c,p,y){return c>11?y?"pm":"PM":y?"am":"AM"}var oi={calendar:fe,longDateFormat:as,invalidDate:ft,ordinal:rr,dayOfMonthOrdinalParse:Qr,relativeTime:wn,months:Hf,monthsShort:au,week:bs,weekdays:tg,weekdaysMin:rg,weekdaysShort:sd,meridiemParse:pg},at={},Pi={},Wt;function cd(c,p){var y,b=Math.min(c.length,p.length);for(y=0;y<b;y+=1)if(c[y]!==p[y])return y;return b}function hu(c){return c&&c.toLowerCase().replace("_","-")}function fd(c){for(var p=0,y,b,R,$;p<c.length;){for($=hu(c[p]).split("-"),y=$.length,b=hu(c[p+1]),b=b?b.split("-"):null;y>0;){if(R=ho($.slice(0,y).join("-")),R)return R;if(b&&b.length>=y&&cd($,b)>=y-1)break;y--}p++}return Wt}function dd(c){return!!(c&&c.match("^[^/\\\\]*$"))}function ho(c){var p=null,y;if(at[c]===void 0&&typeof tl<"u"&&tl&&tl.exports&&dd(c))try{p=Wt._abbr,y=qt,y("./locale/"+c),Rn(p)}catch{at[c]=null}return at[c]}function Rn(c,p){var y;return c&&(u(p)?y=wt(c):y=Jt(c,p),y?Wt=y:typeof console<"u"&&console.warn&&console.warn("Locale "+c+" not found. Did you forget to load it?")),Wt._abbr}function Jt(c,p){if(p!==null){var y,b=oi;if(p.abbr=c,at[c]!=null)N("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),b=at[c]._config;else if(p.parentLocale!=null)if(at[p.parentLocale]!=null)b=at[p.parentLocale]._config;else if(y=ho(p.parentLocale),y!=null)b=y._config;else return Pi[p.parentLocale]||(Pi[p.parentLocale]=[]),Pi[p.parentLocale].push({name:c,config:p}),null;return at[c]=new Z(z(b,p)),Pi[c]&&Pi[c].forEach(function(R){Jt(R.name,R.config)}),Rn(c),at[c]}else return delete at[c],null}function mg(c,p){if(p!=null){var y,b,R=oi;at[c]!=null&&at[c].parentLocale!=null?at[c].set(z(at[c]._config,p)):(b=ho(c),b!=null&&(R=b._config),p=z(R,p),b==null&&(p.abbr=c),y=new Z(p),y.parentLocale=at[c],at[c]=y),Rn(c)}else at[c]!=null&&(at[c].parentLocale!=null?(at[c]=at[c].parentLocale,c===Rn()&&Rn(c)):at[c]!=null&&delete at[c]);return at[c]}function wt(c){var p;if(c&&c._locale&&c._locale._abbr&&(c=c._locale._abbr),!c)return Wt;if(!n(c)){if(p=ho(c),p)return p;c=[c]}return fd(c)}function gg(){return ie(at)}function Ra(c){var p,y=c._a;return y&&C(c).overflow===-2&&(p=y[Cn]<0||y[Cn]>11?Cn:y[Zr]<1||y[Zr]>wa(y[Vt],y[Cn])?Zr:y[Pt]<0||y[Pt]>24||y[Pt]===24&&(y[jr]!==0||y[xn]!==0||y[ii]!==0)?Pt:y[jr]<0||y[jr]>59?jr:y[xn]<0||y[xn]>59?xn:y[ii]<0||y[ii]>999?ii:-1,C(c)._overflowDayOfYear&&(p<Vt||p>Zr)&&(p=Zr),C(c)._overflowWeeks&&p===-1&&(p=Ym),C(c)._overflowWeekday&&p===-1&&(p=Jm),C(c).overflow=p),c}var ai=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ia=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,pu=/Z|[+-]\d\d(?::?\d\d)?/,et=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Xr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],mu=/^\/?Date\((-?\d+)/i,yg=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,gu={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function hd(c){var p,y,b=c._i,R=ai.exec(b)||Ia.exec(b),$,W,se,ye,Oe=et.length,Kt=Xr.length;if(R){for(C(c).iso=!0,p=0,y=Oe;p<y;p++)if(et[p][1].exec(R[1])){W=et[p][0],$=et[p][2]!==!1;break}if(W==null){c._isValid=!1;return}if(R[3]){for(p=0,y=Kt;p<y;p++)if(Xr[p][1].exec(R[3])){se=(R[2]||" ")+Xr[p][0];break}if(se==null){c._isValid=!1;return}}if(!$&&se!=null){c._isValid=!1;return}if(R[4])if(pu.exec(R[4]))ye="Z";else{c._isValid=!1;return}c._f=W+(se||"")+(ye||""),vu(c)}else c._isValid=!1}function vg(c,p,y,b,R,$){var W=[Sg(c),au.indexOf(p),parseInt(y,10),parseInt(b,10),parseInt(R,10)];return $&&W.push(parseInt($,10)),W}function Sg(c){var p=parseInt(c,10);return p<=49?2e3+p:p<=999?1900+p:p}function pd(c){return c.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Oa(c,p,y){if(c){var b=sd.indexOf(c),R=new Date(p[0],p[1],p[2]).getDay();if(b!==R)return C(y).weekdayMismatch=!0,y._isValid=!1,!1}return!0}function _s(c,p,y){if(c)return gu[c];if(p)return 0;var b=parseInt(y,10),R=b%100,$=(b-R)/100;return $*60+R}function md(c){var p=yg.exec(pd(c._i)),y;if(p){if(y=vg(p[4],p[3],p[2],p[5],p[6],p[7]),!Oa(p[1],y,c))return;c._a=y,c._tzm=_s(p[8],p[9],p[10]),c._d=ys.apply(null,c._a),c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),C(c).rfc2822=!0}else c._isValid=!1}function gd(c){var p=mu.exec(c._i);if(p!==null){c._d=new Date(+p[1]);return}if(hd(c),c._isValid===!1)delete c._isValid;else return;if(md(c),c._isValid===!1)delete c._isValid;else return;c._strict?c._isValid=!1:e.createFromInputFallback(c)}e.createFromInputFallback=E("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(c){c._d=new Date(c._i+(c._useUTC?" UTC":""))});function ki(c,p,y){return c??p??y}function yu(c){var p=new Date(e.now());return c._useUTC?[p.getUTCFullYear(),p.getUTCMonth(),p.getUTCDate()]:[p.getFullYear(),p.getMonth(),p.getDate()]}function po(c){var p,y,b=[],R,$,W;if(!c._d){for(R=yu(c),c._w&&c._a[Zr]==null&&c._a[Cn]==null&&yd(c),c._dayOfYear!=null&&(W=ki(c._a[Vt],R[Vt]),(c._dayOfYear>fo(W)||c._dayOfYear===0)&&(C(c)._overflowDayOfYear=!0),y=ys(W,0,c._dayOfYear),c._a[Cn]=y.getUTCMonth(),c._a[Zr]=y.getUTCDate()),p=0;p<3&&c._a[p]==null;++p)c._a[p]=b[p]=R[p];for(;p<7;p++)c._a[p]=b[p]=c._a[p]==null?p===2?1:0:c._a[p];c._a[Pt]===24&&c._a[jr]===0&&c._a[xn]===0&&c._a[ii]===0&&(c._nextDay=!0,c._a[Pt]=0),c._d=(c._useUTC?ys:Zf).apply(null,b),$=c._useUTC?c._d.getUTCDay():c._d.getDay(),c._tzm!=null&&c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),c._nextDay&&(c._a[Pt]=24),c._w&&typeof c._w.d<"u"&&c._w.d!==$&&(C(c).weekdayMismatch=!0)}}function yd(c){var p,y,b,R,$,W,se,ye,Oe;p=c._w,p.GG!=null||p.W!=null||p.E!=null?($=1,W=4,y=ki(p.GG,c._a[Vt],Ss(nt(),1,4).year),b=ki(p.W,1),R=ki(p.E,1),(R<1||R>7)&&(ye=!0)):($=c._locale._week.dow,W=c._locale._week.doy,Oe=Ss(nt(),$,W),y=ki(p.gg,c._a[Vt],Oe.year),b=ki(p.w,Oe.week),p.d!=null?(R=p.d,(R<0||R>6)&&(ye=!0)):p.e!=null?(R=p.e+$,(p.e<0||p.e>6)&&(ye=!0)):R=$),b<1||b>Ur(y,$,W)?C(c)._overflowWeeks=!0:ye!=null?C(c)._overflowWeekday=!0:(se=Xf(y,b,R,$,W),c._a[Vt]=se.year,c._dayOfYear=se.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function vu(c){if(c._f===e.ISO_8601){hd(c);return}if(c._f===e.RFC_2822){md(c);return}c._a=[],C(c).empty=!0;var p=""+c._i,y,b,R,$,W,se=p.length,ye=0,Oe,Kt;for(R=_n(c._f,c._locale).match(he)||[],Kt=R.length,y=0;y<Kt;y++)$=R[y],b=(p.match(Vm($,c))||[])[0],b&&(W=p.substr(0,p.indexOf(b)),W.length>0&&C(c).unusedInput.push(W),p=p.slice(p.indexOf(b)+b.length),ye+=b.length),Mt[$]?(b?C(c).empty=!1:C(c).unusedTokens.push($),Wm($,b,c)):c._strict&&!b&&C(c).unusedTokens.push($);C(c).charsLeftOver=se-ye,p.length>0&&C(c).unusedInput.push(p),c._a[Pt]<=12&&C(c).bigHour===!0&&c._a[Pt]>0&&(C(c).bigHour=void 0),C(c).parsedDateParts=c._a.slice(0),C(c).meridiem=c._meridiem,c._a[Pt]=Su(c._locale,c._a[Pt],c._meridiem),Oe=C(c).era,Oe!==null&&(c._a[Vt]=c._locale.erasConvertYear(Oe,c._a[Vt])),po(c),Ra(c)}function Su(c,p,y){var b;return y==null?p:c.meridiemHour!=null?c.meridiemHour(p,y):(c.isPM!=null&&(b=c.isPM(y),b&&p<12&&(p+=12),!b&&p===12&&(p=0)),p)}function bu(c){var p,y,b,R,$,W,se=!1,ye=c._f.length;if(ye===0){C(c).invalidFormat=!0,c._d=new Date(NaN);return}for(R=0;R<ye;R++)$=0,W=!1,p=V({},c),c._useUTC!=null&&(p._useUTC=c._useUTC),p._f=c._f[R],vu(p),A(p)&&(W=!0),$+=C(p).charsLeftOver,$+=C(p).unusedTokens.length*10,C(p).score=$,se?$<b&&(b=$,y=p):(b==null||$<b||W)&&(b=$,y=p,W&&(se=!0));m(c,y||p)}function bg(c){if(!c._d){var p=Ri(c._i),y=p.day===void 0?p.date:p.day;c._a=g([p.year,p.month,y,p.hour,p.minute,p.second,p.millisecond],function(b){return b&&parseInt(b,10)}),po(c)}}function vd(c){var p=new K(Ra(nr(c)));return p._nextDay&&(p.add(1,"d"),p._nextDay=void 0),p}function nr(c){var p=c._i,y=c._f;return c._locale=c._locale||wt(c._l),p===null||y===void 0&&p===""?T({nullInput:!0}):(typeof p=="string"&&(c._i=p=c._locale.preparse(p)),ee(p)?new K(Ra(p)):(h(p)?c._d=p:n(y)?bu(c):y?vu(c):_u(c),A(c)||(c._d=null),c))}function _u(c){var p=c._i;u(p)?c._d=new Date(e.now()):h(p)?c._d=new Date(p.valueOf()):typeof p=="string"?gd(c):n(p)?(c._a=g(p.slice(0),function(y){return parseInt(y,10)}),po(c)):i(p)?bg(c):f(p)?c._d=new Date(p):e.createFromInputFallback(c)}function ws(c,p,y,b,R){var $={};return(p===!0||p===!1)&&(b=p,p=void 0),(y===!0||y===!1)&&(b=y,y=void 0),(i(c)&&a(c)||n(c)&&c.length===0)&&(c=void 0),$._isAMomentObject=!0,$._useUTC=$._isUTC=R,$._l=y,$._i=c,$._f=p,$._strict=b,vd($)}function nt(c,p,y,b){return ws(c,p,y,b,!1)}var Sd=E("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=nt.apply(null,arguments);return this.isValid()&&c.isValid()?c<this?this:c:T()}),_g=E("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=nt.apply(null,arguments);return this.isValid()&&c.isValid()?c>this?this:c:T()});function bd(c,p){var y,b;if(p.length===1&&n(p[0])&&(p=p[0]),!p.length)return nt();for(y=p[0],b=1;b<p.length;++b)(!p[b].isValid()||p[b][c](y))&&(y=p[b]);return y}function wg(){var c=[].slice.call(arguments,0);return bd("isBefore",c)}function Eg(){var c=[].slice.call(arguments,0);return bd("isAfter",c)}var Cg=function(){return Date.now?Date.now():+new Date},en=["year","quarter","month","week","day","hour","minute","second","millisecond"];function xg(c){var p,y=!1,b,R=en.length;for(p in c)if(s(c,p)&&!(yt.call(en,p)!==-1&&(c[p]==null||!isNaN(c[p]))))return!1;for(b=0;b<R;++b)if(c[en[b]]){if(y)return!1;parseFloat(c[en[b]])!==$e(c[en[b]])&&(y=!0)}return!0}function Rg(){return this._isValid}function wu(){return Ae(NaN)}function mo(c){var p=Ri(c),y=p.year||0,b=p.quarter||0,R=p.month||0,$=p.week||p.isoWeek||0,W=p.day||0,se=p.hour||0,ye=p.minute||0,Oe=p.second||0,Kt=p.millisecond||0;this._isValid=xg(p),this._milliseconds=+Kt+Oe*1e3+ye*6e4+se*1e3*60*60,this._days=+W+$*7,this._months=+R+b*3+y*12,this._data={},this._locale=wt(),this._bubble()}function Br(c){return c instanceof mo}function Es(c){return c<0?Math.round(-1*c)*-1:Math.round(c)}function Ig(c,p,y){var b=Math.min(c.length,p.length),R=Math.abs(c.length-p.length),$=0,W;for(W=0;W<b;W++)(y&&c[W]!==p[W]||!y&&$e(c[W])!==$e(p[W]))&&$++;return $+R}function _d(c,p){le(c,0,0,function(){var y=this.utcOffset(),b="+";return y<0&&(y=-y,b="-"),b+we(~~(y/60),2)+p+we(~~y%60,2)})}_d("Z",":"),_d("ZZ",""),oe("Z",va),oe("ZZ",va),Ke(["Z","ZZ"],function(c,p,y){y._useUTC=!0,y._tzm=li(va,c)});var Og=/([\+\-]|\d\d)/gi;function li(c,p){var y=(p||"").match(c),b,R,$;return y===null?null:(b=y[y.length-1]||[],R=(b+"").match(Og)||["-",0,0],$=+(R[1]*60)+$e(R[2]),$===0?0:R[0]==="+"?$:-$)}function hr(c,p){var y,b;return p._isUTC?(y=p.clone(),b=(ee(c)||h(c)?c.valueOf():nt(c).valueOf())-y.valueOf(),y._d.setTime(y._d.valueOf()+b),e.updateOffset(y,!1),y):nt(c).local()}function Pa(c){return-Math.round(c._d.getTimezoneOffset())}e.updateOffset=function(){};function Pg(c,p,y){var b=this._offset||0,R;if(!this.isValid())return c!=null?this:NaN;if(c!=null){if(typeof c=="string"){if(c=li(va,c),c===null)return this}else Math.abs(c)<16&&!y&&(c=c*60);return!this._isUTC&&p&&(R=Pa(this)),this._offset=c,this._isUTC=!0,R!=null&&this.add(R,"m"),b!==c&&(!p||this._changeInProgress?Ed(this,Ae(c-b,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?b:Pa(this)}function kg(c,p){return c!=null?(typeof c!="string"&&(c=-c),this.utcOffset(c,p),this):-this.utcOffset()}function Ag(c){return this.utcOffset(0,c)}function Tg(c){return this._isUTC&&(this.utcOffset(0,c),this._isUTC=!1,c&&this.subtract(Pa(this),"m")),this}function qg(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var c=li(Bm,this._i);c!=null?this.utcOffset(c):this.utcOffset(0,!0)}return this}function ui(c){return this.isValid()?(c=c?nt(c).utcOffset():0,(this.utcOffset()-c)%60===0):!1}function U(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function J(){if(!u(this._isDSTShifted))return this._isDSTShifted;var c={},p;return V(c,this),c=nr(c),c._a?(p=c._isUTC?S(c._a):nt(c._a),this._isDSTShifted=this.isValid()&&Ig(c._a,p.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function H(){return this.isValid()?!this._isUTC:!1}function ae(){return this.isValid()?this._isUTC:!1}function ve(){return this.isValid()?this._isUTC&&this._offset===0:!1}var We=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,kt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ae(c,p){var y=c,b=null,R,$,W;return Br(c)?y={ms:c._milliseconds,d:c._days,M:c._months}:f(c)||!isNaN(+c)?(y={},p?y[p]=+c:y.milliseconds=+c):(b=We.exec(c))?(R=b[1]==="-"?-1:1,y={y:0,d:$e(b[Zr])*R,h:$e(b[Pt])*R,m:$e(b[jr])*R,s:$e(b[xn])*R,ms:$e(Es(b[ii]*1e3))*R}):(b=kt.exec(c))?(R=b[1]==="-"?-1:1,y={y:In(b[2],R),M:In(b[3],R),w:In(b[4],R),d:In(b[5],R),h:In(b[6],R),m:In(b[7],R),s:In(b[8],R)}):y==null?y={}:typeof y=="object"&&("from"in y||"to"in y)&&(W=wr(nt(y.from),nt(y.to)),y={},y.ms=W.milliseconds,y.M=W.months),$=new mo(y),Br(c)&&s(c,"_locale")&&($._locale=c._locale),Br(c)&&s(c,"_isValid")&&($._isValid=c._isValid),$}Ae.fn=mo.prototype,Ae.invalid=wu;function In(c,p){var y=c&&parseFloat(c.replace(",","."));return(isNaN(y)?0:y)*p}function wd(c,p){var y={};return y.months=p.month()-c.month()+(p.year()-c.year())*12,c.clone().add(y.months,"M").isAfter(p)&&--y.months,y.milliseconds=+p-+c.clone().add(y.months,"M"),y}function wr(c,p){var y;return c.isValid()&&p.isValid()?(p=hr(p,c),c.isBefore(p)?y=wd(c,p):(y=wd(p,c),y.milliseconds=-y.milliseconds,y.months=-y.months),y):{milliseconds:0,months:0}}function go(c,p){return function(y,b){var R,$;return b!==null&&!isNaN(+b)&&(N(p,"moment()."+p+"(period, number) is deprecated. Please use moment()."+p+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),$=y,y=b,b=$),R=Ae(y,b),Ed(this,R,c),this}}function Ed(c,p,y,b){var R=p._milliseconds,$=Es(p._days),W=Es(p._months);c.isValid()&&(b=b??!0,W&&Ea(c,si(c,"Month")+W*y),$&&Bf(c,"Date",si(c,"Date")+$*y),R&&c._d.setTime(c._d.valueOf()+R*y),b&&e.updateOffset(c,$||W))}var Cs=go(1,"add"),ka=go(-1,"subtract");function yo(c){return typeof c=="string"||c instanceof String}function ze(c){return ee(c)||h(c)||yo(c)||f(c)||Cd(c)||$g(c)||c===null||c===void 0}function $g(c){var p=i(c)&&!a(c),y=!1,b=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],R,$,W=b.length;for(R=0;R<W;R+=1)$=b[R],y=y||s(c,$);return p&&y}function Cd(c){var p=n(c),y=!1;return p&&(y=c.filter(function(b){return!f(b)&&yo(c)}).length===0),p&&y}function Aa(c){var p=i(c)&&!a(c),y=!1,b=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],R,$;for(R=0;R<b.length;R+=1)$=b[R],y=y||s(c,$);return p&&y}function Mg(c,p){var y=c.diff(p,"days",!0);return y<-6?"sameElse":y<-1?"lastWeek":y<0?"lastDay":y<1?"sameDay":y<2?"nextDay":y<7?"nextWeek":"sameElse"}function Ng(c,p){arguments.length===1&&(arguments[0]?ze(arguments[0])?(c=arguments[0],p=void 0):Aa(arguments[0])&&(p=arguments[0],c=void 0):(c=void 0,p=void 0));var y=c||nt(),b=hr(y,this).startOf("day"),R=e.calendarFormat(this,b)||"sameElse",$=p&&(D(p[R])?p[R].call(this,y):p[R]);return this.format($||this.localeData().calendar(R,this,nt(y)))}function Dg(){return new K(this)}function Ta(c,p){var y=ee(c)?c:nt(c);return this.isValid()&&y.isValid()?(p=gt(p)||"millisecond",p==="millisecond"?this.valueOf()>y.valueOf():y.valueOf()<this.clone().startOf(p).valueOf()):!1}function ci(c,p){var y=ee(c)?c:nt(c);return this.isValid()&&y.isValid()?(p=gt(p)||"millisecond",p==="millisecond"?this.valueOf()<y.valueOf():this.clone().endOf(p).valueOf()<y.valueOf()):!1}function qa(c,p,y,b){var R=ee(c)?c:nt(c),$=ee(p)?p:nt(p);return this.isValid()&&R.isValid()&&$.isValid()?(b=b||"()",(b[0]==="("?this.isAfter(R,y):!this.isBefore(R,y))&&(b[1]===")"?this.isBefore($,y):!this.isAfter($,y))):!1}function xd(c,p){var y=ee(c)?c:nt(c),b;return this.isValid()&&y.isValid()?(p=gt(p)||"millisecond",p==="millisecond"?this.valueOf()===y.valueOf():(b=y.valueOf(),this.clone().startOf(p).valueOf()<=b&&b<=this.clone().endOf(p).valueOf())):!1}function $a(c,p){return this.isSame(c,p)||this.isAfter(c,p)}function Rd(c,p){return this.isSame(c,p)||this.isBefore(c,p)}function Id(c,p,y){var b,R,$;if(!this.isValid())return NaN;if(b=hr(c,this),!b.isValid())return NaN;switch(R=(b.utcOffset()-this.utcOffset())*6e4,p=gt(p),p){case"year":$=Ai(this,b)/12;break;case"month":$=Ai(this,b);break;case"quarter":$=Ai(this,b)/3;break;case"second":$=(this-b)/1e3;break;case"minute":$=(this-b)/6e4;break;case"hour":$=(this-b)/36e5;break;case"day":$=(this-b-R)/864e5;break;case"week":$=(this-b-R)/6048e5;break;default:$=this-b}return y?$:_r($)}function Ai(c,p){if(c.date()<p.date())return-Ai(p,c);var y=(p.year()-c.year())*12+(p.month()-c.month()),b=c.clone().add(y,"months"),R,$;return p-b<0?(R=c.clone().add(y-1,"months"),$=(p-b)/(b-R)):(R=c.clone().add(y+1,"months"),$=(p-b)/(R-b)),-(y+$)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Od(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function vo(c){if(!this.isValid())return null;var p=c!==!0,y=p?this.clone().utc():this;return y.year()<0||y.year()>9999?ct(y,p?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):D(Date.prototype.toISOString)?p?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ct(y,"Z")):ct(y,p?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Ti(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var c="moment",p="",y,b,R,$;return this.isLocal()||(c=this.utcOffset()===0?"moment.utc":"moment.parseZone",p="Z"),y="["+c+'("]',b=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",R="-MM-DD[T]HH:mm:ss.SSS",$=p+'[")]',this.format(y+b+R+$)}function Ma(c){c||(c=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var p=ct(this,c);return this.localeData().postformat(p)}function Fg(c,p){return this.isValid()&&(ee(c)&&c.isValid()||nt(c).isValid())?Ae({to:this,from:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function Lg(c){return this.from(nt(),c)}function jg(c,p){return this.isValid()&&(ee(c)&&c.isValid()||nt(c).isValid())?Ae({from:this,to:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function Na(c){return this.to(nt(),c)}function So(c){var p;return c===void 0?this._locale._abbr:(p=wt(c),p!=null&&(this._locale=p),this)}var Da=E("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(c){return c===void 0?this.localeData():this.locale(c)});function Pd(){return this._locale}var bo=1e3,xs=60*bo,Fa=60*xs,Et=(365*400+97)*24*Fa;function vt(c,p){return(c%p+p)%p}function kd(c,p,y){return c<100&&c>=0?new Date(c+400,p,y)-Et:new Date(c,p,y).valueOf()}function Ad(c,p,y){return c<100&&c>=0?Date.UTC(c+400,p,y)-Et:Date.UTC(c,p,y)}function Td(c){var p,y;if(c=gt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(y=this._isUTC?Ad:kd,c){case"year":p=y(this.year(),0,1);break;case"quarter":p=y(this.year(),this.month()-this.month()%3,1);break;case"month":p=y(this.year(),this.month(),1);break;case"week":p=y(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":p=y(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":p=y(this.year(),this.month(),this.date());break;case"hour":p=this._d.valueOf(),p-=vt(p+(this._isUTC?0:this.utcOffset()*xs),Fa);break;case"minute":p=this._d.valueOf(),p-=vt(p,xs);break;case"second":p=this._d.valueOf(),p-=vt(p,bo);break}return this._d.setTime(p),e.updateOffset(this,!0),this}function Ug(c){var p,y;if(c=gt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(y=this._isUTC?Ad:kd,c){case"year":p=y(this.year()+1,0,1)-1;break;case"quarter":p=y(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":p=y(this.year(),this.month()+1,1)-1;break;case"week":p=y(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":p=y(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":p=y(this.year(),this.month(),this.date()+1)-1;break;case"hour":p=this._d.valueOf(),p+=Fa-vt(p+(this._isUTC?0:this.utcOffset()*xs),Fa)-1;break;case"minute":p=this._d.valueOf(),p+=xs-vt(p,xs)-1;break;case"second":p=this._d.valueOf(),p+=bo-vt(p,bo)-1;break}return this._d.setTime(p),e.updateOffset(this,!0),this}function Eu(){return this._d.valueOf()-(this._offset||0)*6e4}function _o(){return Math.floor(this.valueOf()/1e3)}function Cu(){return new Date(this.valueOf())}function Rs(){var c=this;return[c.year(),c.month(),c.date(),c.hour(),c.minute(),c.second(),c.millisecond()]}function wo(){var c=this;return{years:c.year(),months:c.month(),date:c.date(),hours:c.hours(),minutes:c.minutes(),seconds:c.seconds(),milliseconds:c.milliseconds()}}function Eo(){return this.isValid()?this.toISOString():null}function La(){return A(this)}function Is(){return m({},C(this))}function Bg(){return C(this).overflow}function Hg(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}le("N",0,0,"eraAbbr"),le("NN",0,0,"eraAbbr"),le("NNN",0,0,"eraAbbr"),le("NNNN",0,0,"eraName"),le("NNNNN",0,0,"eraNarrow"),le("y",["y",1],"yo","eraYear"),le("y",["yy",2],0,"eraYear"),le("y",["yyy",3],0,"eraYear"),le("y",["yyyy",4],0,"eraYear"),oe("N",Ie),oe("NN",Ie),oe("NNN",Ie),oe("NNNN",Jg),oe("NNNNN",zg),Ke(["N","NN","NNN","NNNN","NNNNN"],function(c,p,y,b){var R=y._locale.erasParse(c,b,y._strict);R?C(y).era=R:C(y).invalidEra=c}),oe("y",ni),oe("yy",ni),oe("yyy",ni),oe("yyyy",ni),oe("yo",Kg),Ke(["y","yy","yyy","yyyy"],Vt),Ke(["yo"],function(c,p,y,b){var R;y._locale._eraYearOrdinalRegex&&(R=c.match(y._locale._eraYearOrdinalRegex)),y._locale.eraYearOrdinalParse?p[Vt]=y._locale.eraYearOrdinalParse(c,R):p[Vt]=parseInt(c,10)});function Vg(c,p){var y,b,R,$=this._eras||wt("en")._eras;for(y=0,b=$.length;y<b;++y){switch(typeof $[y].since){case"string":R=e($[y].since).startOf("day"),$[y].since=R.valueOf();break}switch(typeof $[y].until){case"undefined":$[y].until=1/0;break;case"string":R=e($[y].until).startOf("day").valueOf(),$[y].until=R.valueOf();break}}return $}function Wg(c,p,y){var b,R,$=this.eras(),W,se,ye;for(c=c.toUpperCase(),b=0,R=$.length;b<R;++b)if(W=$[b].name.toUpperCase(),se=$[b].abbr.toUpperCase(),ye=$[b].narrow.toUpperCase(),y)switch(p){case"N":case"NN":case"NNN":if(se===c)return $[b];break;case"NNNN":if(W===c)return $[b];break;case"NNNNN":if(ye===c)return $[b];break}else if([W,se,ye].indexOf(c)>=0)return $[b]}function Yg(c,p){var y=c.since<=c.until?1:-1;return p===void 0?e(c.since).year():e(c.since).year()+(p-c.offset)*y}function ja(){var c,p,y,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(y=this.clone().startOf("day").valueOf(),b[c].since<=y&&y<=b[c].until||b[c].until<=y&&y<=b[c].since)return b[c].name;return""}function Co(){var c,p,y,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(y=this.clone().startOf("day").valueOf(),b[c].since<=y&&y<=b[c].until||b[c].until<=y&&y<=b[c].since)return b[c].narrow;return""}function qd(){var c,p,y,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(y=this.clone().startOf("day").valueOf(),b[c].since<=y&&y<=b[c].until||b[c].until<=y&&y<=b[c].since)return b[c].abbr;return""}function I(){var c,p,y,b,R=this.localeData().eras();for(c=0,p=R.length;c<p;++c)if(y=R[c].since<=R[c].until?1:-1,b=this.clone().startOf("day").valueOf(),R[c].since<=b&&b<=R[c].until||R[c].until<=b&&b<=R[c].since)return(this.year()-e(R[c].since).year())*y+R[c].offset;return this.year()}function Os(c){return s(this,"_erasNameRegex")||On.call(this),c?this._erasNameRegex:this._erasRegex}function Ua(c){return s(this,"_erasAbbrRegex")||On.call(this),c?this._erasAbbrRegex:this._erasRegex}function Er(c){return s(this,"_erasNarrowRegex")||On.call(this),c?this._erasNarrowRegex:this._erasRegex}function Ie(c,p){return p.erasAbbrRegex(c)}function Jg(c,p){return p.erasNameRegex(c)}function zg(c,p){return p.erasNarrowRegex(c)}function Kg(c,p){return p._eraYearOrdinalRegex||ni}function On(){var c=[],p=[],y=[],b=[],R,$,W,se,ye,Oe=this.eras();for(R=0,$=Oe.length;R<$;++R)W=En(Oe[R].name),se=En(Oe[R].abbr),ye=En(Oe[R].narrow),p.push(W),c.push(se),y.push(ye),b.push(W),b.push(se),b.push(ye);this._erasRegex=new RegExp("^("+b.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+p.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+c.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+y.join("|")+")","i")}le(0,["gg",2],0,function(){return this.weekYear()%100}),le(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Ba(c,p){le(0,[c,c.length],0,p)}Ba("gggg","weekYear"),Ba("ggggg","weekYear"),Ba("GGGG","isoWeekYear"),Ba("GGGGG","isoWeekYear"),oe("G",ps),oe("g",ps),oe("GG",Xe,dr),oe("gg",Xe,dr),oe("GGGG",uo,ri),oe("gggg",uo,ri),oe("GGGGG",hs,fs),oe("ggggg",hs,fs),Oi(["gggg","ggggg","GGGG","GGGGG"],function(c,p,y,b){p[b.substr(0,2)]=$e(c)}),Oi(["gg","GG"],function(c,p,y,b){p[b]=e.parseTwoDigitYear(c)});function Gg(c){return $d.call(this,c,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Qg(c){return $d.call(this,c,this.isoWeek(),this.isoWeekday(),1,4)}function Zg(){return Ur(this.year(),1,4)}function Xg(){return Ur(this.isoWeekYear(),1,4)}function Pn(){var c=this.localeData()._week;return Ur(this.year(),c.dow,c.doy)}function ey(){var c=this.localeData()._week;return Ur(this.weekYear(),c.dow,c.doy)}function $d(c,p,y,b,R){var $;return c==null?Ss(this,b,R).year:($=Ur(c,b,R),p>$&&(p=$),ty.call(this,c,p,y,b,R))}function ty(c,p,y,b,R){var $=Xf(c,p,y,b,R),W=ys($.year,0,$.dayOfYear);return this.year(W.getUTCFullYear()),this.month(W.getUTCMonth()),this.date(W.getUTCDate()),this}le("Q",0,"Qo","quarter"),oe("Q",us),Ke("Q",function(c,p){p[Cn]=($e(c)-1)*3});function ry(c){return c==null?Math.ceil((this.month()+1)/3):this.month((c-1)*3+this.month()%3)}le("D",["DD",2],"Do","date"),oe("D",Xe,Ii),oe("DD",Xe,dr),oe("Do",function(c,p){return c?p._dayOfMonthOrdinalParse||p._ordinalParse:p._dayOfMonthOrdinalParseLenient}),Ke(["D","DD"],Zr),Ke("Do",function(c,p){p[Zr]=$e(c.match(Xe)[0])});var Md=gs("Date",!0);le("DDD",["DDDD",3],"DDDo","dayOfYear"),oe("DDD",ds),oe("DDDD",cs),Ke(["DDD","DDDD"],function(c,p,y){y._dayOfYear=$e(c)});function kn(c){var p=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return c==null?p:this.add(c-p,"d")}le("m",["mm",2],0,"minute"),oe("m",Xe,ou),oe("mm",Xe,dr),Ke(["m","mm"],jr);var ny=gs("Minutes",!1);le("s",["ss",2],0,"second"),oe("s",Xe,ou),oe("ss",Xe,dr),Ke(["s","ss"],xn);var iy=gs("Seconds",!1);le("S",0,0,function(){return~~(this.millisecond()/100)}),le(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),le(0,["SSS",3],0,"millisecond"),le(0,["SSSS",4],0,function(){return this.millisecond()*10}),le(0,["SSSSS",5],0,function(){return this.millisecond()*100}),le(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),le(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),le(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),le(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),oe("S",ds,us),oe("SS",ds,dr),oe("SSS",ds,cs);var fi,Nd;for(fi="SSSS";fi.length<=9;fi+="S")oe(fi,ni);function sy(c,p){p[ii]=$e(("0."+c)*1e3)}for(fi="S";fi.length<=9;fi+="S")Ke(fi,sy);Nd=gs("Milliseconds",!1),le("z",0,0,"zoneAbbr"),le("zz",0,0,"zoneName");function qi(){return this._isUTC?"UTC":""}function oy(){return this._isUTC?"Coordinated Universal Time":""}var te=K.prototype;te.add=Cs,te.calendar=Ng,te.clone=Dg,te.diff=Id,te.endOf=Ug,te.format=Ma,te.from=Fg,te.fromNow=Lg,te.to=jg,te.toNow=Na,te.get=_a,te.invalidAt=Bg,te.isAfter=Ta,te.isBefore=ci,te.isBetween=qa,te.isSame=xd,te.isSameOrAfter=$a,te.isSameOrBefore=Rd,te.isValid=La,te.lang=Da,te.locale=So,te.localeData=Pd,te.max=_g,te.min=Sd,te.parsingFlags=Is,te.set=Km,te.startOf=Td,te.subtract=ka,te.toArray=Rs,te.toObject=wo,te.toDate=Cu,te.toISOString=vo,te.inspect=Ti,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=Eo,te.toString=Od,te.unix=_o,te.valueOf=Eu,te.creationData=Hg,te.eraName=ja,te.eraNarrow=Co,te.eraAbbr=qd,te.eraYear=I,te.year=Uf,te.isLeapYear=zm,te.weekYear=Gg,te.isoWeekYear=Qg,te.quarter=te.quarters=ry,te.month=zf,te.daysInMonth=Kf,te.week=te.weeks=eg,te.isoWeek=te.isoWeeks=rd,te.weeksInYear=Pn,te.weeksInWeekYear=ey,te.isoWeeksInYear=Zg,te.isoWeeksInISOWeekYear=Xg,te.date=Md,te.day=te.days=ug,te.weekday=cg,te.isoWeekday=fg,te.dayOfYear=kn,te.hour=te.hours=Nt,te.minute=te.minutes=ny,te.second=te.seconds=iy,te.millisecond=te.milliseconds=Nd,te.utcOffset=Pg,te.utc=Ag,te.local=Tg,te.parseZone=qg,te.hasAlignedHourOffset=ui,te.isDST=U,te.isLocal=H,te.isUtcOffset=ae,te.isUtc=ve,te.isUTC=ve,te.zoneAbbr=qi,te.zoneName=oy,te.dates=E("dates accessor is deprecated. Use date instead.",Md),te.months=E("months accessor is deprecated. Use month instead",zf),te.years=E("years accessor is deprecated. Use year instead",Uf),te.zone=E("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",kg),te.isDSTShifted=E("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",J);function Hr(c){return nt(c*1e3)}function ay(){return nt.apply(null,arguments).parseZone()}function Dd(c){return c}var Be=Z.prototype;Be.calendar=bt,Be.longDateFormat=jt,Be.invalidDate=ti,Be.ordinal=Lm,Be.preparse=Dd,Be.postformat=Dd,Be.relativeTime=Lf,Be.pastFuture=jm,Be.set=L,Be.eras=Vg,Be.erasParse=Wg,Be.erasConvertYear=Yg,Be.erasAbbrRegex=Ua,Be.erasNameRegex=Os,Be.erasNarrowRegex=Er,Be.months=Xm,Be.monthsShort=Wf,Be.monthsParse=Jf,Be.monthsRegex=Gf,Be.monthsShortRegex=Ca,Be.week=lu,Be.firstDayOfYear=td,Be.firstDayOfWeek=ed,Be.weekdays=sg,Be.weekdaysMin=uu,Be.weekdaysShort=og,Be.weekdaysParse=lg,Be.weekdaysRegex=ot,Be.weekdaysShortRegex=rt,Be.weekdaysMinRegex=dg,Be.isPM=ud,Be.meridiem=du;function Ha(c,p,y,b){var R=wt(),$=S().set(b,p);return R[y]($,c)}function Fd(c,p,y){if(f(c)&&(p=c,c=void 0),c=c||"",p!=null)return Ha(c,p,y,"month");var b,R=[];for(b=0;b<12;b++)R[b]=Ha(c,b,y,"month");return R}function Va(c,p,y,b){typeof c=="boolean"?(f(p)&&(y=p,p=void 0),p=p||""):(p=c,y=p,c=!1,f(p)&&(y=p,p=void 0),p=p||"");var R=wt(),$=c?R._week.dow:0,W,se=[];if(y!=null)return Ha(p,(y+$)%7,b,"day");for(W=0;W<7;W++)se[W]=Ha(p,(W+$)%7,b,"day");return se}function Ld(c,p){return Fd(c,p,"months")}function ly(c,p){return Fd(c,p,"monthsShort")}function uy(c,p,y){return Va(c,p,y,"weekdays")}function xu(c,p,y){return Va(c,p,y,"weekdaysShort")}function xo(c,p,y){return Va(c,p,y,"weekdaysMin")}Rn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(c){var p=c%10,y=$e(c%100/10)===1?"th":p===1?"st":p===2?"nd":p===3?"rd":"th";return c+y}}),e.lang=E("moment.lang is deprecated. Use moment.locale instead.",Rn),e.langData=E("moment.langData is deprecated. Use moment.localeData instead.",wt);var Cr=Math.abs;function cy(){var c=this._data;return this._milliseconds=Cr(this._milliseconds),this._days=Cr(this._days),this._months=Cr(this._months),c.milliseconds=Cr(c.milliseconds),c.seconds=Cr(c.seconds),c.minutes=Cr(c.minutes),c.hours=Cr(c.hours),c.months=Cr(c.months),c.years=Cr(c.years),this}function Ru(c,p,y,b){var R=Ae(p,y);return c._milliseconds+=b*R._milliseconds,c._days+=b*R._days,c._months+=b*R._months,c._bubble()}function fy(c,p){return Ru(this,c,p,1)}function An(c,p){return Ru(this,c,p,-1)}function Wa(c){return c<0?Math.floor(c):Math.ceil(c)}function $i(){var c=this._milliseconds,p=this._days,y=this._months,b=this._data,R,$,W,se,ye;return c>=0&&p>=0&&y>=0||c<=0&&p<=0&&y<=0||(c+=Wa(Iu(y)+p)*864e5,p=0,y=0),b.milliseconds=c%1e3,R=_r(c/1e3),b.seconds=R%60,$=_r(R/60),b.minutes=$%60,W=_r($/60),b.hours=W%24,p+=_r(W/24),ye=_r(pr(p)),y+=ye,p-=Wa(Iu(ye)),se=_r(y/12),y%=12,b.days=p,b.months=y,b.years=se,this}function pr(c){return c*4800/146097}function Iu(c){return c*146097/4800}function jd(c){if(!this.isValid())return NaN;var p,y,b=this._milliseconds;if(c=gt(c),c==="month"||c==="quarter"||c==="year")switch(p=this._days+b/864e5,y=this._months+pr(p),c){case"month":return y;case"quarter":return y/3;case"year":return y/12}else switch(p=this._days+Math.round(Iu(this._months)),c){case"week":return p/7+b/6048e5;case"day":return p+b/864e5;case"hour":return p*24+b/36e5;case"minute":return p*1440+b/6e4;case"second":return p*86400+b/1e3;case"millisecond":return Math.floor(p*864e5)+b;default:throw new Error("Unknown unit "+c)}}function tn(c){return function(){return this.as(c)}}var Ps=tn("ms"),di=tn("s"),Ud=tn("m"),dy=tn("h"),Ya=tn("d"),hy=tn("w"),Bd=tn("M"),Ut=tn("Q"),Ou=tn("y"),Hd=Ps;function rn(){return Ae(this)}function Pu(c){return c=gt(c),this.isValid()?this[c+"s"]():NaN}function nn(c){return function(){return this.isValid()?this._data[c]:NaN}}var Mi=nn("milliseconds"),Vd=nn("seconds"),zt=nn("minutes"),ku=nn("hours"),py=nn("days"),my=nn("months"),gy=nn("years");function Au(){return _r(this.days()/7)}var Tn=Math.round,sn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Wd(c,p,y,b,R){return R.relativeTime(p||1,!!y,c,b)}function yy(c,p,y,b){var R=Ae(c).abs(),$=Tn(R.as("s")),W=Tn(R.as("m")),se=Tn(R.as("h")),ye=Tn(R.as("d")),Oe=Tn(R.as("M")),Kt=Tn(R.as("w")),on=Tn(R.as("y")),qn=$<=y.ss&&["s",$]||$<y.s&&["ss",$]||W<=1&&["m"]||W<y.m&&["mm",W]||se<=1&&["h"]||se<y.h&&["hh",se]||ye<=1&&["d"]||ye<y.d&&["dd",ye];return y.w!=null&&(qn=qn||Kt<=1&&["w"]||Kt<y.w&&["ww",Kt]),qn=qn||Oe<=1&&["M"]||Oe<y.M&&["MM",Oe]||on<=1&&["y"]||["yy",on],qn[2]=p,qn[3]=+c>0,qn[4]=b,Wd.apply(null,qn)}function vy(c){return c===void 0?Tn:typeof c=="function"?(Tn=c,!0):!1}function Ro(c,p){return sn[c]===void 0?!1:p===void 0?sn[c]:(sn[c]=p,c==="s"&&(sn.ss=p-1),!0)}function Sy(c,p){if(!this.isValid())return this.localeData().invalidDate();var y=!1,b=sn,R,$;return typeof c=="object"&&(p=c,c=!1),typeof c=="boolean"&&(y=c),typeof p=="object"&&(b=Object.assign({},sn,p),p.s!=null&&p.ss==null&&(b.ss=p.s-1)),R=this.localeData(),$=yy(this,!y,b,R),y&&($=R.pastFuture(+this,$)),R.postformat($)}var Tu=Math.abs;function hi(c){return(c>0)-(c<0)||+c}function Io(){if(!this.isValid())return this.localeData().invalidDate();var c=Tu(this._milliseconds)/1e3,p=Tu(this._days),y=Tu(this._months),b,R,$,W,se=this.asSeconds(),ye,Oe,Kt,on;return se?(b=_r(c/60),R=_r(b/60),c%=60,b%=60,$=_r(y/12),y%=12,W=c?c.toFixed(3).replace(/\.?0+$/,""):"",ye=se<0?"-":"",Oe=hi(this._months)!==hi(se)?"-":"",Kt=hi(this._days)!==hi(se)?"-":"",on=hi(this._milliseconds)!==hi(se)?"-":"",ye+"P"+($?Oe+$+"Y":"")+(y?Oe+y+"M":"")+(p?Kt+p+"D":"")+(R||b||c?"T":"")+(R?on+R+"H":"")+(b?on+b+"M":"")+(c?on+W+"S":"")):"P0D"}var Le=mo.prototype;Le.isValid=Rg,Le.abs=cy,Le.add=fy,Le.subtract=An,Le.as=jd,Le.asMilliseconds=Ps,Le.asSeconds=di,Le.asMinutes=Ud,Le.asHours=dy,Le.asDays=Ya,Le.asWeeks=hy,Le.asMonths=Bd,Le.asQuarters=Ut,Le.asYears=Ou,Le.valueOf=Hd,Le._bubble=$i,Le.clone=rn,Le.get=Pu,Le.milliseconds=Mi,Le.seconds=Vd,Le.minutes=zt,Le.hours=ku,Le.days=py,Le.weeks=Au,Le.months=my,Le.years=gy,Le.humanize=Sy,Le.toISOString=Io,Le.toString=Io,Le.toJSON=Io,Le.locale=So,Le.localeData=Pd,Le.toIsoString=E("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Io),Le.lang=Da,le("X",0,0,"unix"),le("x",0,0,"valueOf"),oe("x",ps),oe("X",Hm),Ke("X",function(c,p,y){y._d=new Date(parseFloat(c)*1e3)}),Ke("x",function(c,p,y){y._d=new Date($e(c))});return e.version="2.30.1",r(nt),e.fn=te,e.min=wg,e.max=Eg,e.now=Cg,e.utc=S,e.unix=Hr,e.months=Ld,e.isDate=h,e.locale=Rn,e.invalid=T,e.duration=Ae,e.isMoment=ee,e.weekdays=uy,e.parseZone=ay,e.localeData=wt,e.isDuration=Br,e.monthsShort=ly,e.weekdaysMin=xo,e.defineLocale=Jt,e.updateLocale=mg,e.locales=gg,e.weekdaysShort=xu,e.normalizeUnits=gt,e.relativeTimeRounding=vy,e.relativeTimeThreshold=Ro,e.calendarFormat=Mg,e.prototype=te,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var tC=F((eC,bh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof bh<"u"&&bh.exports?bh.exports=e():t.tv4=e()})(eC,function(){Object.keys||(Object.keys=function(){var k=Object.prototype.hasOwnProperty,E=!{toString:null}.propertyIsEnumerable("toString"),P=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],N=P.length;return function(D){if(typeof D!="object"&&typeof D!="function"||D===null)throw new TypeError("Object.keys called on non-object");var L=[];for(var z in D)k.call(D,z)&&L.push(z);if(E)for(var Z=0;Z<N;Z++)k.call(D,P[Z])&&L.push(P[Z]);return L}}()),Object.create||(Object.create=function(){function k(){}return function(E){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return k.prototype=E,new k}}()),Array.isArray||(Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(k){if(this===null)throw new TypeError;var E=Object(this),P=E.length>>>0;if(P===0)return-1;var N=0;if(arguments.length>1&&(N=Number(arguments[1]),N!==N?N=0:N!==0&&N!==1/0&&N!==-1/0&&(N=(N>0||-1)*Math.floor(Math.abs(N)))),N>=P)return-1;for(var D=N>=0?N:Math.max(P-Math.abs(N),0);D<P;D++)if(D in E&&E[D]===k)return D;return-1}),Object.isFrozen||(Object.isFrozen=function(k){for(var E="tv4_test_frozen_key";k.hasOwnProperty(E);)E+=Math.random();try{return k[E]=!0,delete k[E],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(k){return encodeURI(k).replace(/%25[0-9][0-9]/g,function(E){return"%"+E.substring(3)})}function n(k){var E="";t[k.charAt(0)]&&(E=k.charAt(0),k=k.substring(1));var P="",N="",D=!0,L=!1,z=!1;E==="+"?D=!1:E==="."?(N=".",P="."):E==="/"?(N="/",P="/"):E==="#"?(N="#",D=!1):E===";"?(N=";",P=";",L=!0,z=!0):E==="?"?(N="?",P="&",L=!0):E==="&"&&(N="&",P="&",L=!0);for(var Z=[],ie=k.split(","),fe=[],bt={},we=0;we<ie.length;we++){var he=ie[we],Ze=null;if(he.indexOf(":")!==-1){var _t=he.split(":");he=_t[0],Ze=parseInt(_t[1],10)}for(var Mt={};e[he.charAt(he.length-1)];)Mt[he.charAt(he.length-1)]=!0,he=he.substring(0,he.length-1);var le={truncate:Ze,name:he,suffices:Mt};fe.push(le),bt[he]=le,Z.push(he)}var ei=function(su){for(var ct="",_n=0,as=0;as<fe.length;as++){var jt=fe[as],ft=su(jt.name);if(ft==null||Array.isArray(ft)&&ft.length===0||typeof ft=="object"&&Object.keys(ft).length===0){_n++;continue}if(as===_n?ct+=N:ct+=P||",",Array.isArray(ft)){L&&(ct+=jt.name+"=");for(var ti=0;ti<ft.length;ti++)ti>0&&(ct+=jt.suffices["*"]&&P||",",jt.suffices["*"]&&L&&(ct+=jt.name+"=")),ct+=D?encodeURIComponent(ft[ti]).replace(/!/g,"%21"):r(ft[ti])}else if(typeof ft=="object"){L&&!jt.suffices["*"]&&(ct+=jt.name+"=");var rr=!0;for(var Qr in ft)rr||(ct+=jt.suffices["*"]&&P||","),rr=!1,ct+=D?encodeURIComponent(Qr).replace(/!/g,"%21"):r(Qr),ct+=jt.suffices["*"]?"=":",",ct+=D?encodeURIComponent(ft[Qr]).replace(/!/g,"%21"):r(ft[Qr])}else L&&(ct+=jt.name,(!z||ft!=="")&&(ct+="=")),jt.truncate!=null&&(ft=ft.substring(0,jt.truncate)),ct+=D?encodeURIComponent(ft).replace(/!/g,"%21"):r(ft)}return ct};return ei.varNames=Z,{prefix:N,substitution:ei}}function i(k){if(!(this instanceof i))return new i(k);for(var E=k.split("{"),P=[E.shift()],N=[],D=[],L=[];E.length>0;){var z=E.shift(),Z=z.split("}")[0],ie=z.substring(Z.length+1),fe=n(Z);D.push(fe.substitution),N.push(fe.prefix),P.push(ie),L=L.concat(fe.substitution.varNames)}this.fill=function(bt){for(var we=P[0],he=0;he<D.length;he++){var Ze=D[he];we+=Ze(bt),we+=P[he+1]}return we},this.varNames=L,this.template=k}i.prototype={toString:function(){return this.template},fillFromObject:function(k){return this.fill(function(E){return k[E]})}};var s=function(E,P,N,D,L){if(this.missing=[],this.missingMap={},this.formatValidators=E?Object.create(E.formatValidators):{},this.schemas=E?Object.create(E.schemas):{},this.collectMultiple=P,this.errors=[],this.handleError=P?this.collectError:this.returnError,D&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),L&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=N||_("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},E)for(var z in E.definedKeywords)this.definedKeywords[z]=E.definedKeywords[z].slice(0)};s.prototype.defineKeyword=function(k,E){this.definedKeywords[k]=this.definedKeywords[k]||[],this.definedKeywords[k].push(E)},s.prototype.createError=function(k,E,P,N,D,L,z){var Z=new j(k,E,P,N,D);return Z.message=this.errorReporter(Z,L,z),Z},s.prototype.returnError=function(k){return k},s.prototype.collectError=function(k){return k&&this.errors.push(k),null},s.prototype.prefixErrors=function(k,E,P){for(var N=k;N<this.errors.length;N++)this.errors[N]=this.errors[N].prefixWith(E,P);return this},s.prototype.banUnknownProperties=function(k,E){for(var P in this.unknownPropertyPaths){var N=this.createError(C.UNKNOWN_PROPERTY,{path:P},P,"",null,k,E),D=this.handleError(N);if(D)return D}return null},s.prototype.addFormat=function(k,E){if(typeof k=="object"){for(var P in k)this.addFormat(P,k[P]);return this}this.formatValidators[k]=E},s.prototype.resolveRefs=function(k,E){if(k.$ref!==void 0){if(E=E||{},E[k.$ref])return this.createError(C.CIRCULAR_REFERENCE,{urls:Object.keys(E).join(", ")},"","",null,void 0,k);E[k.$ref]=!0,k=this.getSchema(k.$ref,E)}return k},s.prototype.getSchema=function(k,E){var P;if(this.schemas[k]!==void 0)return P=this.schemas[k],this.resolveRefs(P,E);var N=k,D="";if(k.indexOf("#")!==-1&&(D=k.substring(k.indexOf("#")+1),N=k.substring(0,k.indexOf("#"))),typeof this.schemas[N]=="object"){P=this.schemas[N];var L=decodeURIComponent(D);if(L==="")return this.resolveRefs(P,E);if(L.charAt(0)!=="/")return;for(var z=L.split("/").slice(1),Z=0;Z<z.length;Z++){var ie=z[Z].replace(/~1/g,"/").replace(/~0/g,"~");if(P[ie]===void 0){P=void 0;break}P=P[ie]}if(P!==void 0)return this.resolveRefs(P,E)}this.missing[N]===void 0&&(this.missing.push(N),this.missing[N]=N,this.missingMap[N]=N)},s.prototype.searchSchemas=function(k,E){if(Array.isArray(k))for(var P=0;P<k.length;P++)this.searchSchemas(k[P],E);else if(k&&typeof k=="object"){typeof k.id=="string"&&Y(E,k.id)&&this.schemas[k.id]===void 0&&(this.schemas[k.id]=k);for(var N in k)if(N!=="enum"){if(typeof k[N]=="object")this.searchSchemas(k[N],E);else if(N==="$ref"){var D=m(k[N]);D&&this.schemas[D]===void 0&&this.missingMap[D]===void 0&&(this.missingMap[D]=D)}}}},s.prototype.addSchema=function(k,E){if(typeof k!="string"||typeof E>"u")if(typeof k=="object"&&typeof k.id=="string")E=k,k=E.id;else return;k===m(k)+"#"&&(k=m(k)),this.schemas[k]=E,delete this.missingMap[k],S(E,k),this.searchSchemas(E,k)},s.prototype.getSchemaMap=function(){var k={};for(var E in this.schemas)k[E]=this.schemas[E];return k},s.prototype.getSchemaUris=function(k){var E=[];for(var P in this.schemas)(!k||k.test(P))&&E.push(P);return E},s.prototype.getMissingUris=function(k){var E=[];for(var P in this.missingMap)(!k||k.test(P))&&E.push(P);return E},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(k,E,P,N,D){var L;if(E=this.resolveRefs(E),E){if(E instanceof j)return this.errors.push(E),E}else return null;var z=this.errors.length,Z,ie=null,fe=null;if(this.checkRecursive&&k&&typeof k=="object"){if(L=!this.scanned.length,k[this.validatedSchemasKey]){var bt=k[this.validatedSchemasKey].indexOf(E);if(bt!==-1)return this.errors=this.errors.concat(k[this.validationErrorsKey][bt]),null}if(Object.isFrozen(k)&&(Z=this.scannedFrozen.indexOf(k),Z!==-1)){var we=this.scannedFrozenSchemas[Z].indexOf(E);if(we!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[Z][we]),null}if(this.scanned.push(k),Object.isFrozen(k))Z===-1&&(Z=this.scannedFrozen.length,this.scannedFrozen.push(k),this.scannedFrozenSchemas.push([])),ie=this.scannedFrozenSchemas[Z].length,this.scannedFrozenSchemas[Z][ie]=E,this.scannedFrozenValidationErrors[Z][ie]=[];else{if(!k[this.validatedSchemasKey])try{Object.defineProperty(k,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(k,this.validationErrorsKey,{value:[],configurable:!0})}catch{k[this.validatedSchemasKey]=[],k[this.validationErrorsKey]=[]}fe=k[this.validatedSchemasKey].length,k[this.validatedSchemasKey][fe]=E,k[this.validationErrorsKey][fe]=[]}}var he=this.errors.length,Ze=this.validateBasic(k,E,D)||this.validateNumeric(k,E,D)||this.validateString(k,E,D)||this.validateArray(k,E,D)||this.validateObject(k,E,D)||this.validateCombinations(k,E,D)||this.validateHypermedia(k,E,D)||this.validateFormat(k,E,D)||this.validateDefinedKeywords(k,E,D)||null;if(L){for(;this.scanned.length;){var _t=this.scanned.pop();delete _t[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Ze||he!==this.errors.length)for(;P&&P.length||N&&N.length;){var Mt=P&&P.length?""+P.pop():null,le=N&&N.length?""+N.pop():null;Ze&&(Ze=Ze.prefixWith(Mt,le)),this.prefixErrors(he,Mt,le)}return ie!==null?this.scannedFrozenValidationErrors[Z][ie]=this.errors.slice(z):fe!==null&&(k[this.validationErrorsKey][fe]=this.errors.slice(z)),this.handleError(Ze)},s.prototype.validateFormat=function(k,E){if(typeof E.format!="string"||!this.formatValidators[E.format])return null;var P=this.formatValidators[E.format].call(null,k,E);return typeof P=="string"||typeof P=="number"?this.createError(C.FORMAT_CUSTOM,{message:P},"","/format",null,k,E):P&&typeof P=="object"?this.createError(C.FORMAT_CUSTOM,{message:P.message||"?"},P.dataPath||"",P.schemaPath||"/format",null,k,E):null},s.prototype.validateDefinedKeywords=function(k,E,P){for(var N in this.definedKeywords)if(!(typeof E[N]>"u"))for(var D=this.definedKeywords[N],L=0;L<D.length;L++){var z=D[L],Z=z(k,E[N],E,P);if(typeof Z=="string"||typeof Z=="number")return this.createError(C.KEYWORD_CUSTOM,{key:N,message:Z},"","",null,k,E).prefixWith(null,N);if(Z&&typeof Z=="object"){var ie=Z.code;if(typeof ie=="string"){if(!C[ie])throw new Error("Undefined error code (use defineError): "+ie);ie=C[ie]}else typeof ie!="number"&&(ie=C.KEYWORD_CUSTOM);var fe=typeof Z.message=="object"?Z.message:{key:N,message:Z.message||"?"},bt=Z.schemaPath||"/"+N.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ie,fe,Z.dataPath||null,bt,null,k,E)}}return null};function a(k,E){if(k===E)return!0;if(k&&E&&typeof k=="object"&&typeof E=="object"){if(Array.isArray(k)!==Array.isArray(E))return!1;if(Array.isArray(k)){if(k.length!==E.length)return!1;for(var P=0;P<k.length;P++)if(!a(k[P],E[P]))return!1}else{var N;for(N in k)if(E[N]===void 0&&k[N]!==void 0)return!1;for(N in E)if(k[N]===void 0&&E[N]!==void 0)return!1;for(N in k)if(!a(k[N],E[N]))return!1}return!0}return!1}s.prototype.validateBasic=function(E,P,N){var D;return(D=this.validateType(E,P,N))||(D=this.validateEnum(E,P,N))?D.prefixWith(null,"type"):null},s.prototype.validateType=function(E,P){if(P.type===void 0)return null;var N=typeof E;E===null?N="null":Array.isArray(E)&&(N="array");var D=P.type;Array.isArray(D)||(D=[D]);for(var L=0;L<D.length;L++){var z=D[L];if(z===N||z==="integer"&&N==="number"&&E%1===0)return null}return this.createError(C.INVALID_TYPE,{type:N,expected:D.join("/")},"","",null,E,P)},s.prototype.validateEnum=function(E,P){if(P.enum===void 0)return null;for(var N=0;N<P.enum.length;N++){var D=P.enum[N];if(a(E,D))return null}return this.createError(C.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(E):E},"","",null,E,P)},s.prototype.validateNumeric=function(E,P,N){return this.validateMultipleOf(E,P,N)||this.validateMinMax(E,P,N)||this.validateNaN(E,P,N)||null};var u=Math.pow(2,-51),f=1-u;s.prototype.validateMultipleOf=function(E,P){var N=P.multipleOf||P.divisibleBy;if(N===void 0)return null;if(typeof E=="number"){var D=E/N%1;if(D>=u&&D<f)return this.createError(C.NUMBER_MULTIPLE_OF,{value:E,multipleOf:N},"","",null,E,P)}return null},s.prototype.validateMinMax=function(E,P){if(typeof E!="number")return null;if(P.minimum!==void 0){if(E<P.minimum)return this.createError(C.NUMBER_MINIMUM,{value:E,minimum:P.minimum},"","/minimum",null,E,P);if(P.exclusiveMinimum&&E===P.minimum)return this.createError(C.NUMBER_MINIMUM_EXCLUSIVE,{value:E,minimum:P.minimum},"","/exclusiveMinimum",null,E,P)}if(P.maximum!==void 0){if(E>P.maximum)return this.createError(C.NUMBER_MAXIMUM,{value:E,maximum:P.maximum},"","/maximum",null,E,P);if(P.exclusiveMaximum&&E===P.maximum)return this.createError(C.NUMBER_MAXIMUM_EXCLUSIVE,{value:E,maximum:P.maximum},"","/exclusiveMaximum",null,E,P)}return null},s.prototype.validateNaN=function(E,P){return typeof E!="number"?null:isNaN(E)===!0||E===1/0||E===-1/0?this.createError(C.NUMBER_NOT_A_NUMBER,{value:E},"","/type",null,E,P):null},s.prototype.validateString=function(E,P,N){return this.validateStringLength(E,P,N)||this.validateStringPattern(E,P,N)||null},s.prototype.validateStringLength=function(E,P){return typeof E!="string"?null:P.minLength!==void 0&&E.length<P.minLength?this.createError(C.STRING_LENGTH_SHORT,{length:E.length,minimum:P.minLength},"","/minLength",null,E,P):P.maxLength!==void 0&&E.length>P.maxLength?this.createError(C.STRING_LENGTH_LONG,{length:E.length,maximum:P.maxLength},"","/maxLength",null,E,P):null},s.prototype.validateStringPattern=function(E,P){if(typeof E!="string"||typeof P.pattern!="string"&&!(P.pattern instanceof RegExp))return null;var N;if(P.pattern instanceof RegExp)N=P.pattern;else{var D,L="",z=P.pattern.match(/^\/(.+)\/([img]*)$/);z?(D=z[1],L=z[2]):D=P.pattern,N=new RegExp(D,L)}return N.test(E)?null:this.createError(C.STRING_PATTERN,{pattern:P.pattern},"","/pattern",null,E,P)},s.prototype.validateArray=function(E,P,N){return Array.isArray(E)&&(this.validateArrayLength(E,P,N)||this.validateArrayUniqueItems(E,P,N)||this.validateArrayItems(E,P,N))||null},s.prototype.validateArrayLength=function(E,P){var N;return P.minItems!==void 0&&E.length<P.minItems&&(N=this.createError(C.ARRAY_LENGTH_SHORT,{length:E.length,minimum:P.minItems},"","/minItems",null,E,P),this.handleError(N))||P.maxItems!==void 0&&E.length>P.maxItems&&(N=this.createError(C.ARRAY_LENGTH_LONG,{length:E.length,maximum:P.maxItems},"","/maxItems",null,E,P),this.handleError(N))?N:null},s.prototype.validateArrayUniqueItems=function(E,P){if(P.uniqueItems){for(var N=0;N<E.length;N++)for(var D=N+1;D<E.length;D++)if(a(E[N],E[D])){var L=this.createError(C.ARRAY_UNIQUE,{match1:N,match2:D},"","/uniqueItems",null,E,P);if(this.handleError(L))return L}}return null},s.prototype.validateArrayItems=function(E,P,N){if(P.items===void 0)return null;var D,L;if(Array.isArray(P.items)){for(L=0;L<E.length;L++)if(L<P.items.length){if(D=this.validateAll(E[L],P.items[L],[L],["items",L],N+"/"+L))return D}else if(P.additionalItems!==void 0){if(typeof P.additionalItems=="boolean"){if(!P.additionalItems&&(D=this.createError(C.ARRAY_ADDITIONAL_ITEMS,{},"/"+L,"/additionalItems",null,E,P),this.handleError(D)))return D}else if(D=this.validateAll(E[L],P.additionalItems,[L],["additionalItems"],N+"/"+L))return D}}else for(L=0;L<E.length;L++)if(D=this.validateAll(E[L],P.items,[L],["items"],N+"/"+L))return D;return null},s.prototype.validateObject=function(E,P,N){return typeof E!="object"||E===null||Array.isArray(E)?null:this.validateObjectMinMaxProperties(E,P,N)||this.validateObjectRequiredProperties(E,P,N)||this.validateObjectProperties(E,P,N)||this.validateObjectDependencies(E,P,N)||null},s.prototype.validateObjectMinMaxProperties=function(E,P){var N=Object.keys(E),D;return P.minProperties!==void 0&&N.length<P.minProperties&&(D=this.createError(C.OBJECT_PROPERTIES_MINIMUM,{propertyCount:N.length,minimum:P.minProperties},"","/minProperties",null,E,P),this.handleError(D))||P.maxProperties!==void 0&&N.length>P.maxProperties&&(D=this.createError(C.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:N.length,maximum:P.maxProperties},"","/maxProperties",null,E,P),this.handleError(D))?D:null},s.prototype.validateObjectRequiredProperties=function(E,P){if(P.required!==void 0)for(var N=0;N<P.required.length;N++){var D=P.required[N];if(E[D]===void 0){var L=this.createError(C.OBJECT_REQUIRED,{key:D},"","/required/"+N,null,E,P);if(this.handleError(L))return L}}return null},s.prototype.validateObjectProperties=function(E,P,N){var D;for(var L in E){var z=N+"/"+L.replace(/~/g,"~0").replace(/\//g,"~1"),Z=!1;if(P.properties!==void 0&&P.properties[L]!==void 0&&(Z=!0,D=this.validateAll(E[L],P.properties[L],[L],["properties",L],z)))return D;if(P.patternProperties!==void 0)for(var ie in P.patternProperties){var fe=new RegExp(ie);if(fe.test(L)&&(Z=!0,D=this.validateAll(E[L],P.patternProperties[ie],[L],["patternProperties",ie],z)))return D}if(Z)this.trackUnknownProperties&&(this.knownPropertyPaths[z]=!0,delete this.unknownPropertyPaths[z]);else if(P.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[z]=!0,delete this.unknownPropertyPaths[z]),typeof P.additionalProperties=="boolean"){if(!P.additionalProperties&&(D=this.createError(C.OBJECT_ADDITIONAL_PROPERTIES,{key:L},"","/additionalProperties",null,E,P).prefixWith(L,null),this.handleError(D)))return D}else if(D=this.validateAll(E[L],P.additionalProperties,[L],["additionalProperties"],z))return D}else this.trackUnknownProperties&&!this.knownPropertyPaths[z]&&(this.unknownPropertyPaths[z]=!0)}return null},s.prototype.validateObjectDependencies=function(E,P,N){var D;if(P.dependencies!==void 0){for(var L in P.dependencies)if(E[L]!==void 0){var z=P.dependencies[L];if(typeof z=="string"){if(E[z]===void 0&&(D=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:L,missing:z},"","",null,E,P).prefixWith(null,L).prefixWith(null,"dependencies"),this.handleError(D)))return D}else if(Array.isArray(z))for(var Z=0;Z<z.length;Z++){var ie=z[Z];if(E[ie]===void 0&&(D=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:L,missing:ie},"","/"+Z,null,E,P).prefixWith(null,L).prefixWith(null,"dependencies"),this.handleError(D)))return D}else if(D=this.validateAll(E,z,[],["dependencies",L],N))return D}}return null},s.prototype.validateCombinations=function(E,P,N){return this.validateAllOf(E,P,N)||this.validateAnyOf(E,P,N)||this.validateOneOf(E,P,N)||this.validateNot(E,P,N)||null},s.prototype.validateAllOf=function(E,P,N){if(P.allOf===void 0)return null;for(var D,L=0;L<P.allOf.length;L++){var z=P.allOf[L];if(D=this.validateAll(E,z,[],["allOf",L],N))return D}return null},s.prototype.validateAnyOf=function(E,P,N){if(P.anyOf===void 0)return null;var D=[],L=this.errors.length,z,Z;this.trackUnknownProperties&&(z=this.unknownPropertyPaths,Z=this.knownPropertyPaths);for(var ie=!0,fe=0;fe<P.anyOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var bt=P.anyOf[fe],we=this.errors.length,he=this.validateAll(E,bt,[],["anyOf",fe],N);if(he===null&&we===this.errors.length){if(this.errors=this.errors.slice(0,L),this.trackUnknownProperties){for(var Ze in this.knownPropertyPaths)Z[Ze]=!0,delete z[Ze];for(var _t in this.unknownPropertyPaths)Z[_t]||(z[_t]=!0);ie=!1;continue}return null}he&&D.push(he.prefixWith(null,""+fe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=z,this.knownPropertyPaths=Z),ie)return D=D.concat(this.errors.slice(L)),this.errors=this.errors.slice(0,L),this.createError(C.ANY_OF_MISSING,{},"","/anyOf",D,E,P)},s.prototype.validateOneOf=function(E,P,N){if(P.oneOf===void 0)return null;var D=null,L=[],z=this.errors.length,Z,ie;this.trackUnknownProperties&&(Z=this.unknownPropertyPaths,ie=this.knownPropertyPaths);for(var fe=0;fe<P.oneOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var bt=P.oneOf[fe],we=this.errors.length,he=this.validateAll(E,bt,[],["oneOf",fe],N);if(he===null&&we===this.errors.length){if(D===null)D=fe;else return this.errors=this.errors.slice(0,z),this.createError(C.ONE_OF_MULTIPLE,{index1:D,index2:fe},"","/oneOf",null,E,P);if(this.trackUnknownProperties){for(var Ze in this.knownPropertyPaths)ie[Ze]=!0,delete Z[Ze];for(var _t in this.unknownPropertyPaths)ie[_t]||(Z[_t]=!0)}}else he&&L.push(he)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=Z,this.knownPropertyPaths=ie),D===null?(L=L.concat(this.errors.slice(z)),this.errors=this.errors.slice(0,z),this.createError(C.ONE_OF_MISSING,{},"","/oneOf",L,E,P)):(this.errors=this.errors.slice(0,z),null)},s.prototype.validateNot=function(E,P,N){if(P.not===void 0)return null;var D=this.errors.length,L,z;this.trackUnknownProperties&&(L=this.unknownPropertyPaths,z=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var Z=this.validateAll(E,P.not,null,null,N),ie=this.errors.slice(D);return this.errors=this.errors.slice(0,D),this.trackUnknownProperties&&(this.unknownPropertyPaths=L,this.knownPropertyPaths=z),Z===null&&ie.length===0?this.createError(C.NOT_PASSED,{},"","/not",null,E,P):null},s.prototype.validateHypermedia=function(E,P,N){if(!P.links)return null;for(var D,L=0;L<P.links.length;L++){var z=P.links[L];if(z.rel==="describedby"){for(var Z=new i(z.href),ie=!0,fe=0;fe<Z.varNames.length;fe++)if(!(Z.varNames[fe]in E)){ie=!1;break}if(ie){var bt=Z.fillFromObject(E),we={$ref:bt};if(D=this.validateAll(E,we,[],["links",L],N))return D}}}};function h(k){var E=String(k).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return E?{href:E[0]||"",protocol:E[1]||"",authority:E[2]||"",host:E[3]||"",hostname:E[4]||"",port:E[5]||"",pathname:E[6]||"",search:E[7]||"",hash:E[8]||""}:null}function g(k,E){function P(N){var D=[];return N.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(L){L==="/.."?D.pop():D.push(L)}),D.join("").replace(/^\//,N.charAt(0)==="/"?"/":"")}return E=h(E||""),k=h(k||""),!E||!k?null:(E.protocol||k.protocol)+(E.protocol||E.authority?E.authority:k.authority)+P(E.protocol||E.authority||E.pathname.charAt(0)==="/"?E.pathname:E.pathname?(k.authority&&!k.pathname?"/":"")+k.pathname.slice(0,k.pathname.lastIndexOf("/")+1)+E.pathname:k.pathname)+(E.protocol||E.authority||E.pathname?E.search:E.search||k.search)+E.hash}function m(k){return k.split("#")[0]}function S(k,E){if(k&&typeof k=="object")if(E===void 0?E=k.id:typeof k.id=="string"&&(E=g(E,k.id),k.id=E),Array.isArray(k))for(var P=0;P<k.length;P++)S(k[P],E);else{typeof k.$ref=="string"&&(k.$ref=g(E,k.$ref));for(var N in k)N!=="enum"&&S(k[N],E)}}function _(k){k=k||"en";var E=V[k];return function(P){var N=E[P.code]||T[P.code];if(typeof N!="string")return"Unknown error code "+P.code+": "+JSON.stringify(P.messageParams);var D=P.params;return N.replace(/\{([^{}]*)\}/g,function(L,z){var Z=D[z];return typeof Z=="string"||typeof Z=="number"?Z:L})}}var C={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},x={};for(var A in C)x[C[A]]=A;var T={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function j(k,E,P,N,D){if(Error.call(this),k===void 0)throw new Error("No error code supplied: "+N);this.message="",this.params=E,this.code=k,this.dataPath=P||"",this.schemaPath=N||"",this.subErrors=D||null;var L=new Error(this.message);if(this.stack=L.stack||L.stacktrace,!this.stack)try{throw L}catch(z){this.stack=z.stack||z.stacktrace}}j.prototype=Object.create(Error.prototype),j.prototype.constructor=j,j.prototype.name="ValidationError",j.prototype.prefixWith=function(k,E){if(k!==null&&(k=k.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+k+this.dataPath),E!==null&&(E=E.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+E+this.schemaPath),this.subErrors!==null)for(var P=0;P<this.subErrors.length;P++)this.subErrors[P].prefixWith(k,E);return this};function Y(k,E){if(E.substring(0,k.length)===k){var P=E.substring(k.length);if(E.length>0&&E.charAt(k.length-1)==="/"||P.charAt(0)==="#"||P.charAt(0)==="?")return!0}return!1}var V={};function K(k){var E=new s,P,N,D={setErrorReporter:function(L){return typeof L=="string"?this.language(L):(N=L,!0)},addFormat:function(){E.addFormat.apply(E,arguments)},language:function(L){return L?(V[L]||(L=L.split("-")[0]),V[L]?(P=L,L):!1):P},addLanguage:function(L,z){var Z;for(Z in C)z[Z]&&!z[C[Z]]&&(z[C[Z]]=z[Z]);var ie=L.split("-")[0];if(!V[ie])V[L]=z,V[ie]=z;else{V[L]=Object.create(V[ie]);for(Z in z)typeof V[ie][Z]>"u"&&(V[ie][Z]=z[Z]),V[L][Z]=z[Z]}return this},freshApi:function(L){var z=K();return L&&z.language(L),z},validate:function(L,z,Z,ie){var fe=_(P),bt=N?function(Ze,_t,Mt){return N(Ze,_t,Mt)||fe(Ze,_t,Mt)}:fe,we=new s(E,!1,bt,Z,ie);typeof z=="string"&&(z={$ref:z}),we.addSchema("",z);var he=we.validateAll(L,z,null,null,"");return!he&&ie&&(he=we.banUnknownProperties(L,z)),this.error=he,this.missing=we.missing,this.valid=he===null,this.valid},validateResult:function(){var L={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(L,arguments),L},validateMultiple:function(L,z,Z,ie){var fe=_(P),bt=N?function(Ze,_t,Mt){return N(Ze,_t,Mt)||fe(Ze,_t,Mt)}:fe,we=new s(E,!0,bt,Z,ie);typeof z=="string"&&(z={$ref:z}),we.addSchema("",z),we.validateAll(L,z,null,null,""),ie&&we.banUnknownProperties(L,z);var he={toString:function(){return this.valid?"valid":this.error.message}};return he.errors=we.errors,he.missing=we.missing,he.valid=he.errors.length===0,he},addSchema:function(){return E.addSchema.apply(E,arguments)},getSchema:function(){return E.getSchema.apply(E,arguments)},getSchemaMap:function(){return E.getSchemaMap.apply(E,arguments)},getSchemaUris:function(){return E.getSchemaUris.apply(E,arguments)},getMissingUris:function(){return E.getMissingUris.apply(E,arguments)},dropSchemas:function(){E.dropSchemas.apply(E,arguments)},defineKeyword:function(){E.defineKeyword.apply(E,arguments)},defineError:function(L,z,Z){if(typeof L!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(L))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof z!="number"||z%1!==0||z<1e4)throw new Error("Code number must be an integer > 10000");if(typeof C[L]<"u")throw new Error("Error already defined: "+L+" as "+C[L]);if(typeof x[z]<"u")throw new Error("Error code already used: "+x[z]+" as "+z);C[L]=z,x[z]=L,T[L]=T[z]=Z;for(var ie in V){var fe=V[ie];fe[L]&&(fe[z]=fe[z]||fe[L])}},reset:function(){E.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:S,resolveUrl:g,getDocumentUri:m,errorCodes:C};return D.language(k||"en"),D}var ee=K();return ee.addLanguage("en-gb",T),ee.tv4=ee,ee})});var Qu=F(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.regexpCode=Ye.getEsmExportName=Ye.getProperty=Ye.safeStringify=Ye.stringify=Ye.strConcat=Ye.addCodeArg=Ye.str=Ye._=Ye.nil=Ye._Code=Ye.Name=Ye.IDENTIFIER=Ye._CodeOrName=void 0;var Ku=class{};Ye._CodeOrName=Ku;Ye.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Fo=class extends Ku{constructor(e){if(super(),!Ye.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Ye.Name=Fo;var fn=class extends Ku{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Fo&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Ye._Code=fn;Ye.nil=new fn("");function rC(t,...e){let r=[t[0]],n=0;for(;n<e.length;)gv(r,e[n]),r.push(t[++n]);return new fn(r)}Ye._=rC;var mv=new fn("+");function nC(t,...e){let r=[Gu(t[0])],n=0;for(;n<e.length;)r.push(mv),gv(r,e[n]),r.push(mv,Gu(t[++n]));return eD(r),new fn(r)}Ye.str=nC;function gv(t,e){e instanceof fn?t.push(...e._items):e instanceof Fo?t.push(e):t.push(nD(e))}Ye.addCodeArg=gv;function eD(t){let e=1;for(;e<t.length-1;){if(t[e]===mv){let r=tD(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function tD(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Fo||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Fo))return`"${t}${e.slice(1)}`}function rD(t,e){return e.emptyStr()?t:t.emptyStr()?e:nC`${t}${e}`}Ye.strConcat=rD;function nD(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Gu(Array.isArray(t)?t.join(","):t)}function iD(t){return new fn(Gu(t))}Ye.stringify=iD;function Gu(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ye.safeStringify=Gu;function sD(t){return typeof t=="string"&&Ye.IDENTIFIER.test(t)?new fn(`.${t}`):rC`[${t}]`}Ye.getProperty=sD;function oD(t){if(typeof t=="string"&&Ye.IDENTIFIER.test(t))return new fn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Ye.getEsmExportName=oD;function aD(t){return new fn(t.toString())}Ye.regexpCode=aD});var Sv=F(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.ValueScope=kr.ValueScopeName=kr.Scope=kr.varKinds=kr.UsedValueState=void 0;var Pr=Qu(),yv=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},_h;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(_h||(kr.UsedValueState=_h={}));kr.varKinds={const:new Pr.Name("const"),let:new Pr.Name("let"),var:new Pr.Name("var")};var wh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Pr.Name?e:this.name(e)}name(e){return new Pr.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};kr.Scope=wh;var Eh=class extends Pr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Pr._)`.${new Pr.Name(r)}[${n}]`}};kr.ValueScopeName=Eh;var lD=(0,Pr._)`\n`,vv=class extends wh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?lD:Pr.nil}}get(){return this._scope}name(e){return new Eh(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,a=(n=r.key)!==null&&n!==void 0?n:r.ref,u=this._values[s];if(u){let g=u.get(a);if(g)return g}else u=this._values[s]=new Map;u.set(a,i);let f=this._scope[s]||(this._scope[s]=[]),h=f.length;return f[h]=r.ref,i.setValue(r,{property:s,itemIndex:h}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Pr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=Pr.nil;for(let a in e){let u=e[a];if(!u)continue;let f=n[a]=n[a]||new Map;u.forEach(h=>{if(f.has(h))return;f.set(h,_h.Started);let g=r(h);if(g){let m=this.opts.es5?kr.varKinds.var:kr.varKinds.const;s=(0,Pr._)`${s}${m} ${h} = ${g};${this.opts._n}`}else if(g=i?.(h))s=(0,Pr._)`${s}${g}${this.opts._n}`;else throw new yv(h);f.set(h,_h.Completed)})}return s}};kr.ValueScope=vv});var Me=F(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.or=qe.and=qe.not=qe.CodeGen=qe.operators=qe.varKinds=qe.ValueScopeName=qe.ValueScope=qe.Scope=qe.Name=qe.regexpCode=qe.stringify=qe.getProperty=qe.nil=qe.strConcat=qe.str=qe._=void 0;var Ue=Qu(),Ln=Sv(),Ds=Qu();Object.defineProperty(qe,"_",{enumerable:!0,get:function(){return Ds._}});Object.defineProperty(qe,"str",{enumerable:!0,get:function(){return Ds.str}});Object.defineProperty(qe,"strConcat",{enumerable:!0,get:function(){return Ds.strConcat}});Object.defineProperty(qe,"nil",{enumerable:!0,get:function(){return Ds.nil}});Object.defineProperty(qe,"getProperty",{enumerable:!0,get:function(){return Ds.getProperty}});Object.defineProperty(qe,"stringify",{enumerable:!0,get:function(){return Ds.stringify}});Object.defineProperty(qe,"regexpCode",{enumerable:!0,get:function(){return Ds.regexpCode}});Object.defineProperty(qe,"Name",{enumerable:!0,get:function(){return Ds.Name}});var Ih=Sv();Object.defineProperty(qe,"Scope",{enumerable:!0,get:function(){return Ih.Scope}});Object.defineProperty(qe,"ValueScope",{enumerable:!0,get:function(){return Ih.ValueScope}});Object.defineProperty(qe,"ValueScopeName",{enumerable:!0,get:function(){return Ih.ValueScopeName}});Object.defineProperty(qe,"varKinds",{enumerable:!0,get:function(){return Ih.varKinds}});qe.operators={GT:new Ue._Code(">"),GTE:new Ue._Code(">="),LT:new Ue._Code("<"),LTE:new Ue._Code("<="),EQ:new Ue._Code("==="),NEQ:new Ue._Code("!=="),NOT:new Ue._Code("!"),OR:new Ue._Code("||"),AND:new Ue._Code("&&"),ADD:new Ue._Code("+")};var Ji=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},bv=class extends Ji{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Ln.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=nl(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ue._CodeOrName?this.rhs.names:{}}},Ch=class extends Ji{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Ue.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=nl(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ue.Name?{}:{...this.lhs.names};return Rh(e,this.rhs)}},_v=class extends Ch{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},wv=class extends Ji{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Ev=class extends Ji{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Cv=class extends Ji{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},xv=class extends Ji{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=nl(this.code,e,r),this}get names(){return this.code instanceof Ue._CodeOrName?this.code.names:{}}},Zu=class extends Ji{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(uD(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Uo(e,r.names),{})}},zi=class extends Zu{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Rv=class extends Zu{},rl=class extends zi{};rl.kind="else";var Lo=class t extends zi{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new rl(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(iC(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=nl(this.condition,e,r),this}get names(){let e=super.names;return Rh(e,this.condition),this.else&&Uo(e,this.else.names),e}};Lo.kind="if";var jo=class extends zi{};jo.kind="for";var Iv=class extends jo{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=nl(this.iteration,e,r),this}get names(){return Uo(super.names,this.iteration.names)}},Ov=class extends jo{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Ln.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Rh(super.names,this.from);return Rh(e,this.to)}},xh=class extends jo{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=nl(this.iterable,e,r),this}get names(){return Uo(super.names,this.iterable.names)}},Xu=class extends zi{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Xu.kind="func";var ec=class extends Zu{render(e){return"return "+super.render(e)}};ec.kind="return";var Pv=class extends zi{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Uo(e,this.catch.names),this.finally&&Uo(e,this.finally.names),e}},tc=class extends zi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};tc.kind="catch";var rc=class extends zi{render(e){return"finally"+super.render(e)}};rc.kind="finally";var kv=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
23
|
+
`+new Error().stack),y=!1}return p.apply(this,arguments)},p)}var P={};function N(c,p){e.deprecationHandler!=null&&e.deprecationHandler(c,p),P[c]||(k(p),P[c]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function D(c){return typeof Function<"u"&&c instanceof Function||Object.prototype.toString.call(c)==="[object Function]"}function L(c){var p,y;for(y in c)s(c,y)&&(p=c[y],D(p)?this[y]=p:this["_"+y]=p);this._config=c,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function z(c,p){var y=m({},c),b;for(b in p)s(p,b)&&(i(c[b])&&i(p[b])?(y[b]={},m(y[b],c[b]),m(y[b],p[b])):p[b]!=null?y[b]=p[b]:delete y[b]);for(b in c)s(c,b)&&!s(p,b)&&i(c[b])&&(y[b]=m({},y[b]));return y}function Z(c){c!=null&&this.set(c)}var ie;Object.keys?ie=Object.keys:ie=function(c){var p,y=[];for(p in c)s(c,p)&&y.push(p);return y};var fe={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function bt(c,p,y){var b=this._calendar[c]||this._calendar.sameElse;return D(b)?b.call(p,y):b}function we(c,p,y){var b=""+Math.abs(c),R=p-b.length,$=c>=0;return($?y?"+":"":"-")+Math.pow(10,Math.max(0,R)).toString().substr(1)+b}var he=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ze=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,_t={},Mt={};function le(c,p,y,b){var R=b;typeof b=="string"&&(R=function(){return this[b]()}),c&&(Mt[c]=R),p&&(Mt[p[0]]=function(){return we(R.apply(this,arguments),p[1],p[2])}),y&&(Mt[y]=function(){return this.localeData().ordinal(R.apply(this,arguments),c)})}function ei(c){return c.match(/\[[\s\S]/)?c.replace(/^\[|\]$/g,""):c.replace(/\\/g,"")}function su(c){var p=c.match(he),y,b;for(y=0,b=p.length;y<b;y++)Mt[p[y]]?p[y]=Mt[p[y]]:p[y]=ei(p[y]);return function(R){var $="",W;for(W=0;W<b;W++)$+=D(p[W])?p[W].call(R,c):p[W];return $}}function ct(c,p){return c.isValid()?(p=_n(p,c.localeData()),_t[p]=_t[p]||su(p),_t[p](c)):c.localeData().invalidDate()}function _n(c,p){var y=5;function b(R){return p.longDateFormat(R)||R}for(Ze.lastIndex=0;y>=0&&Ze.test(c);)c=c.replace(Ze,b),Ze.lastIndex=0,y-=1;return c}var as={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function jt(c){var p=this._longDateFormat[c],y=this._longDateFormat[c.toUpperCase()];return p||!y?p:(this._longDateFormat[c]=y.match(he).map(function(b){return b==="MMMM"||b==="MM"||b==="DD"||b==="dddd"?b.slice(1):b}).join(""),this._longDateFormat[c])}var ft="Invalid date";function ti(){return this._invalidDate}var rr="%d",Qr=/\d{1,2}/;function Lm(c){return this._ordinal.replace("%d",c)}var wn={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Lf(c,p,y,b){var R=this._relativeTime[y];return D(R)?R(c,p,y,b):R.replace(/%d/i,c)}function jm(c,p){var y=this._relativeTime[c>0?"future":"past"];return D(y)?y(p):y.replace(/%s/i,p)}var ls={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function gt(c){return typeof c=="string"?ls[c]||ls[c.toLowerCase()]:void 0}function Ri(c){var p={},y,b;for(b in c)s(c,b)&&(y=gt(b),y&&(p[y]=c[b]));return p}var ma={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Um(c){var p=[],y;for(y in c)s(c,y)&&p.push({unit:y,priority:ma[y]});return p.sort(function(b,R){return b.priority-R.priority}),p}var us=/\d/,dr=/\d\d/,cs=/\d{3}/,ri=/\d{4}/,fs=/[+-]?\d{6}/,Xe=/\d\d?/,ga=/\d\d\d\d?/,ya=/\d\d\d\d\d\d?/,ds=/\d{1,3}/,uo=/\d{1,4}/,hs=/[+-]?\d{1,6}/,ni=/\d+/,ps=/[+-]?\d+/,Bm=/Z|[+-]\d\d:?\d\d/gi,va=/Z|[+-]\d\d(?::?\d\d)?/gi,Hm=/[+-]?\d+(\.\d{1,3})?/,ms=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Ii=/^[1-9]\d?/,ou=/^([1-9]\d|\d)/,Sa;Sa={};function oe(c,p,y){Sa[c]=D(p)?p:function(b,R){return b&&y?y:p}}function Vm(c,p){return s(Sa,c)?Sa[c](p._strict,p._locale):new RegExp(jf(c))}function jf(c){return En(c.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(p,y,b,R,$){return y||b||R||$}))}function En(c){return c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function _r(c){return c<0?Math.ceil(c)||0:Math.floor(c)}function $e(c){var p=+c,y=0;return p!==0&&isFinite(p)&&(y=_r(p)),y}var co={};function Ke(c,p){var y,b=p,R;for(typeof c=="string"&&(c=[c]),f(p)&&(b=function($,W){W[p]=$e($)}),R=c.length,y=0;y<R;y++)co[c[y]]=b}function Oi(c,p){Ke(c,function(y,b,R,$){R._w=R._w||{},p(y,R._w,R,$)})}function Wm(c,p,y){p!=null&&s(co,c)&&co[c](p,y._a,y,c)}function ba(c){return c%4===0&&c%100!==0||c%400===0}var Vt=0,Cn=1,Zr=2,Pt=3,jr=4,xn=5,ii=6,Ym=7,Jm=8;le("Y",0,0,function(){var c=this.year();return c<=9999?we(c,4):"+"+c}),le(0,["YY",2],0,function(){return this.year()%100}),le(0,["YYYY",4],0,"year"),le(0,["YYYYY",5],0,"year"),le(0,["YYYYYY",6,!0],0,"year"),oe("Y",ps),oe("YY",Xe,dr),oe("YYYY",uo,ri),oe("YYYYY",hs,fs),oe("YYYYYY",hs,fs),Ke(["YYYYY","YYYYYY"],Vt),Ke("YYYY",function(c,p){p[Vt]=c.length===2?e.parseTwoDigitYear(c):$e(c)}),Ke("YY",function(c,p){p[Vt]=e.parseTwoDigitYear(c)}),Ke("Y",function(c,p){p[Vt]=parseInt(c,10)});function fo(c){return ba(c)?366:365}e.parseTwoDigitYear=function(c){return $e(c)+($e(c)>68?1900:2e3)};var Uf=gs("FullYear",!0);function zm(){return ba(this.year())}function gs(c,p){return function(y){return y!=null?(Bf(this,c,y),e.updateOffset(this,p),this):si(this,c)}}function si(c,p){if(!c.isValid())return NaN;var y=c._d,b=c._isUTC;switch(p){case"Milliseconds":return b?y.getUTCMilliseconds():y.getMilliseconds();case"Seconds":return b?y.getUTCSeconds():y.getSeconds();case"Minutes":return b?y.getUTCMinutes():y.getMinutes();case"Hours":return b?y.getUTCHours():y.getHours();case"Date":return b?y.getUTCDate():y.getDate();case"Day":return b?y.getUTCDay():y.getDay();case"Month":return b?y.getUTCMonth():y.getMonth();case"FullYear":return b?y.getUTCFullYear():y.getFullYear();default:return NaN}}function Bf(c,p,y){var b,R,$,W,se;if(!(!c.isValid()||isNaN(y))){switch(b=c._d,R=c._isUTC,p){case"Milliseconds":return void(R?b.setUTCMilliseconds(y):b.setMilliseconds(y));case"Seconds":return void(R?b.setUTCSeconds(y):b.setSeconds(y));case"Minutes":return void(R?b.setUTCMinutes(y):b.setMinutes(y));case"Hours":return void(R?b.setUTCHours(y):b.setHours(y));case"Date":return void(R?b.setUTCDate(y):b.setDate(y));case"FullYear":break;default:return}$=y,W=c.month(),se=c.date(),se=se===29&&W===1&&!ba($)?28:se,R?b.setUTCFullYear($,W,se):b.setFullYear($,W,se)}}function _a(c){return c=gt(c),D(this[c])?this[c]():this}function Km(c,p){if(typeof c=="object"){c=Ri(c);var y=Um(c),b,R=y.length;for(b=0;b<R;b++)this[y[b].unit](c[y[b].unit])}else if(c=gt(c),D(this[c]))return this[c](p);return this}function Gm(c,p){return(c%p+p)%p}var yt;Array.prototype.indexOf?yt=Array.prototype.indexOf:yt=function(c){var p;for(p=0;p<this.length;++p)if(this[p]===c)return p;return-1};function wa(c,p){if(isNaN(c)||isNaN(p))return NaN;var y=Gm(p,12);return c+=(p-y)/12,y===1?ba(c)?29:28:31-y%7%2}le("M",["MM",2],"Mo",function(){return this.month()+1}),le("MMM",0,0,function(c){return this.localeData().monthsShort(this,c)}),le("MMMM",0,0,function(c){return this.localeData().months(this,c)}),oe("M",Xe,Ii),oe("MM",Xe,dr),oe("MMM",function(c,p){return p.monthsShortRegex(c)}),oe("MMMM",function(c,p){return p.monthsRegex(c)}),Ke(["M","MM"],function(c,p){p[Cn]=$e(c)-1}),Ke(["MMM","MMMM"],function(c,p,y,b){var R=y._locale.monthsParse(c,b,y._strict);R!=null?p[Cn]=R:C(y).invalidMonth=c});var Hf="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),au="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Vf=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Qm=ms,Zm=ms;function Xm(c,p){return c?n(this._months)?this._months[c.month()]:this._months[(this._months.isFormat||Vf).test(p)?"format":"standalone"][c.month()]:n(this._months)?this._months:this._months.standalone}function Wf(c,p){return c?n(this._monthsShort)?this._monthsShort[c.month()]:this._monthsShort[Vf.test(p)?"format":"standalone"][c.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Yf(c,p,y){var b,R,$,W=c.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],b=0;b<12;++b)$=S([2e3,b]),this._shortMonthsParse[b]=this.monthsShort($,"").toLocaleLowerCase(),this._longMonthsParse[b]=this.months($,"").toLocaleLowerCase();return y?p==="MMM"?(R=yt.call(this._shortMonthsParse,W),R!==-1?R:null):(R=yt.call(this._longMonthsParse,W),R!==-1?R:null):p==="MMM"?(R=yt.call(this._shortMonthsParse,W),R!==-1?R:(R=yt.call(this._longMonthsParse,W),R!==-1?R:null)):(R=yt.call(this._longMonthsParse,W),R!==-1?R:(R=yt.call(this._shortMonthsParse,W),R!==-1?R:null))}function Jf(c,p,y){var b,R,$;if(this._monthsParseExact)return Yf.call(this,c,p,y);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),b=0;b<12;b++){if(R=S([2e3,b]),y&&!this._longMonthsParse[b]&&(this._longMonthsParse[b]=new RegExp("^"+this.months(R,"").replace(".","")+"$","i"),this._shortMonthsParse[b]=new RegExp("^"+this.monthsShort(R,"").replace(".","")+"$","i")),!y&&!this._monthsParse[b]&&($="^"+this.months(R,"")+"|^"+this.monthsShort(R,""),this._monthsParse[b]=new RegExp($.replace(".",""),"i")),y&&p==="MMMM"&&this._longMonthsParse[b].test(c))return b;if(y&&p==="MMM"&&this._shortMonthsParse[b].test(c))return b;if(!y&&this._monthsParse[b].test(c))return b}}function Ea(c,p){if(!c.isValid())return c;if(typeof p=="string"){if(/^\d+$/.test(p))p=$e(p);else if(p=c.localeData().monthsParse(p),!f(p))return c}var y=p,b=c.date();return b=b<29?b:Math.min(b,wa(c.year(),y)),c._isUTC?c._d.setUTCMonth(y,b):c._d.setMonth(y,b),c}function zf(c){return c!=null?(Ea(this,c),e.updateOffset(this,!0),this):si(this,"Month")}function Kf(){return wa(this.year(),this.month())}function Ca(c){return this._monthsParseExact?(s(this,"_monthsRegex")||Qf.call(this),c?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Qm),this._monthsShortStrictRegex&&c?this._monthsShortStrictRegex:this._monthsShortRegex)}function Gf(c){return this._monthsParseExact?(s(this,"_monthsRegex")||Qf.call(this),c?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Zm),this._monthsStrictRegex&&c?this._monthsStrictRegex:this._monthsRegex)}function Qf(){function c(ye,Oe){return Oe.length-ye.length}var p=[],y=[],b=[],R,$,W,se;for(R=0;R<12;R++)$=S([2e3,R]),W=En(this.monthsShort($,"")),se=En(this.months($,"")),p.push(W),y.push(se),b.push(se),b.push(W);p.sort(c),y.sort(c),b.sort(c),this._monthsRegex=new RegExp("^("+b.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+y.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+p.join("|")+")","i")}function Zf(c,p,y,b,R,$,W){var se;return c<100&&c>=0?(se=new Date(c+400,p,y,b,R,$,W),isFinite(se.getFullYear())&&se.setFullYear(c)):se=new Date(c,p,y,b,R,$,W),se}function ys(c){var p,y;return c<100&&c>=0?(y=Array.prototype.slice.call(arguments),y[0]=c+400,p=new Date(Date.UTC.apply(null,y)),isFinite(p.getUTCFullYear())&&p.setUTCFullYear(c)):p=new Date(Date.UTC.apply(null,arguments)),p}function vs(c,p,y){var b=7+p-y,R=(7+ys(c,0,b).getUTCDay()-p)%7;return-R+b-1}function Xf(c,p,y,b,R){var $=(7+y-b)%7,W=vs(c,b,R),se=1+7*(p-1)+$+W,ye,Oe;return se<=0?(ye=c-1,Oe=fo(ye)+se):se>fo(c)?(ye=c+1,Oe=se-fo(c)):(ye=c,Oe=se),{year:ye,dayOfYear:Oe}}function Ss(c,p,y){var b=vs(c.year(),p,y),R=Math.floor((c.dayOfYear()-b-1)/7)+1,$,W;return R<1?(W=c.year()-1,$=R+Ur(W,p,y)):R>Ur(c.year(),p,y)?($=R-Ur(c.year(),p,y),W=c.year()+1):(W=c.year(),$=R),{week:$,year:W}}function Ur(c,p,y){var b=vs(c,p,y),R=vs(c+1,p,y);return(fo(c)-b+R)/7}le("w",["ww",2],"wo","week"),le("W",["WW",2],"Wo","isoWeek"),oe("w",Xe,Ii),oe("ww",Xe,dr),oe("W",Xe,Ii),oe("WW",Xe,dr),Oi(["w","ww","W","WW"],function(c,p,y,b){p[b.substr(0,1)]=$e(c)});function lu(c){return Ss(c,this._week.dow,this._week.doy).week}var bs={dow:0,doy:6};function ed(){return this._week.dow}function td(){return this._week.doy}function eg(c){var p=this.localeData().week(this);return c==null?p:this.add((c-p)*7,"d")}function rd(c){var p=Ss(this,1,4).week;return c==null?p:this.add((c-p)*7,"d")}le("d",0,"do","day"),le("dd",0,0,function(c){return this.localeData().weekdaysMin(this,c)}),le("ddd",0,0,function(c){return this.localeData().weekdaysShort(this,c)}),le("dddd",0,0,function(c){return this.localeData().weekdays(this,c)}),le("e",0,0,"weekday"),le("E",0,0,"isoWeekday"),oe("d",Xe),oe("e",Xe),oe("E",Xe),oe("dd",function(c,p){return p.weekdaysMinRegex(c)}),oe("ddd",function(c,p){return p.weekdaysShortRegex(c)}),oe("dddd",function(c,p){return p.weekdaysRegex(c)}),Oi(["dd","ddd","dddd"],function(c,p,y,b){var R=y._locale.weekdaysParse(c,b,y._strict);R!=null?p.d=R:C(y).invalidWeekday=c}),Oi(["d","e","E"],function(c,p,y,b){p[b]=$e(c)});function nd(c,p){return typeof c!="string"?c:isNaN(c)?(c=p.weekdaysParse(c),typeof c=="number"?c:null):parseInt(c,10)}function id(c,p){return typeof c=="string"?p.weekdaysParse(c)%7||7:isNaN(c)?null:c}function xa(c,p){return c.slice(p,7).concat(c.slice(0,p))}var tg="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),sd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),rg="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),od=ms,ng=ms,ig=ms;function sg(c,p){var y=n(this._weekdays)?this._weekdays:this._weekdays[c&&c!==!0&&this._weekdays.isFormat.test(p)?"format":"standalone"];return c===!0?xa(y,this._week.dow):c?y[c.day()]:y}function og(c){return c===!0?xa(this._weekdaysShort,this._week.dow):c?this._weekdaysShort[c.day()]:this._weekdaysShort}function uu(c){return c===!0?xa(this._weekdaysMin,this._week.dow):c?this._weekdaysMin[c.day()]:this._weekdaysMin}function ag(c,p,y){var b,R,$,W=c.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],b=0;b<7;++b)$=S([2e3,1]).day(b),this._minWeekdaysParse[b]=this.weekdaysMin($,"").toLocaleLowerCase(),this._shortWeekdaysParse[b]=this.weekdaysShort($,"").toLocaleLowerCase(),this._weekdaysParse[b]=this.weekdays($,"").toLocaleLowerCase();return y?p==="dddd"?(R=yt.call(this._weekdaysParse,W),R!==-1?R:null):p==="ddd"?(R=yt.call(this._shortWeekdaysParse,W),R!==-1?R:null):(R=yt.call(this._minWeekdaysParse,W),R!==-1?R:null):p==="dddd"?(R=yt.call(this._weekdaysParse,W),R!==-1||(R=yt.call(this._shortWeekdaysParse,W),R!==-1)?R:(R=yt.call(this._minWeekdaysParse,W),R!==-1?R:null)):p==="ddd"?(R=yt.call(this._shortWeekdaysParse,W),R!==-1||(R=yt.call(this._weekdaysParse,W),R!==-1)?R:(R=yt.call(this._minWeekdaysParse,W),R!==-1?R:null)):(R=yt.call(this._minWeekdaysParse,W),R!==-1||(R=yt.call(this._weekdaysParse,W),R!==-1)?R:(R=yt.call(this._shortWeekdaysParse,W),R!==-1?R:null))}function lg(c,p,y){var b,R,$;if(this._weekdaysParseExact)return ag.call(this,c,p,y);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),b=0;b<7;b++){if(R=S([2e3,1]).day(b),y&&!this._fullWeekdaysParse[b]&&(this._fullWeekdaysParse[b]=new RegExp("^"+this.weekdays(R,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[b]=new RegExp("^"+this.weekdaysShort(R,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[b]=new RegExp("^"+this.weekdaysMin(R,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[b]||($="^"+this.weekdays(R,"")+"|^"+this.weekdaysShort(R,"")+"|^"+this.weekdaysMin(R,""),this._weekdaysParse[b]=new RegExp($.replace(".",""),"i")),y&&p==="dddd"&&this._fullWeekdaysParse[b].test(c))return b;if(y&&p==="ddd"&&this._shortWeekdaysParse[b].test(c))return b;if(y&&p==="dd"&&this._minWeekdaysParse[b].test(c))return b;if(!y&&this._weekdaysParse[b].test(c))return b}}function ug(c){if(!this.isValid())return c!=null?this:NaN;var p=si(this,"Day");return c!=null?(c=nd(c,this.localeData()),this.add(c-p,"d")):p}function cg(c){if(!this.isValid())return c!=null?this:NaN;var p=(this.day()+7-this.localeData()._week.dow)%7;return c==null?p:this.add(c-p,"d")}function fg(c){if(!this.isValid())return c!=null?this:NaN;if(c!=null){var p=id(c,this.localeData());return this.day(this.day()%7?p:p-7)}else return this.day()||7}function st(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||cu.call(this),c?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=od),this._weekdaysStrictRegex&&c?this._weekdaysStrictRegex:this._weekdaysRegex)}function rt(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||cu.call(this),c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=ng),this._weekdaysShortStrictRegex&&c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function dg(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||cu.call(this),c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ig),this._weekdaysMinStrictRegex&&c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function cu(){function c(Kt,on){return on.length-Kt.length}var p=[],y=[],b=[],R=[],$,W,se,ye,Oe;for($=0;$<7;$++)W=S([2e3,1]).day($),se=En(this.weekdaysMin(W,"")),ye=En(this.weekdaysShort(W,"")),Oe=En(this.weekdays(W,"")),p.push(se),y.push(ye),b.push(Oe),R.push(se),R.push(ye),R.push(Oe);p.sort(c),y.sort(c),b.sort(c),R.sort(c),this._weekdaysRegex=new RegExp("^("+R.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+y.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+p.join("|")+")","i")}function fu(){return this.hours()%12||12}function hg(){return this.hours()||24}le("H",["HH",2],0,"hour"),le("h",["hh",2],0,fu),le("k",["kk",2],0,hg),le("hmm",0,0,function(){return""+fu.apply(this)+we(this.minutes(),2)}),le("hmmss",0,0,function(){return""+fu.apply(this)+we(this.minutes(),2)+we(this.seconds(),2)}),le("Hmm",0,0,function(){return""+this.hours()+we(this.minutes(),2)}),le("Hmmss",0,0,function(){return""+this.hours()+we(this.minutes(),2)+we(this.seconds(),2)});function ad(c,p){le(c,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),p)})}ad("a",!0),ad("A",!1);function ld(c,p){return p._meridiemParse}oe("a",ld),oe("A",ld),oe("H",Xe,ou),oe("h",Xe,Ii),oe("k",Xe,Ii),oe("HH",Xe,dr),oe("hh",Xe,dr),oe("kk",Xe,dr),oe("hmm",ga),oe("hmmss",ya),oe("Hmm",ga),oe("Hmmss",ya),Ke(["H","HH"],Pt),Ke(["k","kk"],function(c,p,y){var b=$e(c);p[Pt]=b===24?0:b}),Ke(["a","A"],function(c,p,y){y._isPm=y._locale.isPM(c),y._meridiem=c}),Ke(["h","hh"],function(c,p,y){p[Pt]=$e(c),C(y).bigHour=!0}),Ke("hmm",function(c,p,y){var b=c.length-2;p[Pt]=$e(c.substr(0,b)),p[jr]=$e(c.substr(b)),C(y).bigHour=!0}),Ke("hmmss",function(c,p,y){var b=c.length-4,R=c.length-2;p[Pt]=$e(c.substr(0,b)),p[jr]=$e(c.substr(b,2)),p[xn]=$e(c.substr(R)),C(y).bigHour=!0}),Ke("Hmm",function(c,p,y){var b=c.length-2;p[Pt]=$e(c.substr(0,b)),p[jr]=$e(c.substr(b))}),Ke("Hmmss",function(c,p,y){var b=c.length-4,R=c.length-2;p[Pt]=$e(c.substr(0,b)),p[jr]=$e(c.substr(b,2)),p[xn]=$e(c.substr(R))});function ud(c){return(c+"").toLowerCase().charAt(0)==="p"}var pg=/[ap]\.?m?\.?/i,Nt=gs("Hours",!0);function du(c,p,y){return c>11?y?"pm":"PM":y?"am":"AM"}var oi={calendar:fe,longDateFormat:as,invalidDate:ft,ordinal:rr,dayOfMonthOrdinalParse:Qr,relativeTime:wn,months:Hf,monthsShort:au,week:bs,weekdays:tg,weekdaysMin:rg,weekdaysShort:sd,meridiemParse:pg},ot={},Pi={},Wt;function cd(c,p){var y,b=Math.min(c.length,p.length);for(y=0;y<b;y+=1)if(c[y]!==p[y])return y;return b}function hu(c){return c&&c.toLowerCase().replace("_","-")}function fd(c){for(var p=0,y,b,R,$;p<c.length;){for($=hu(c[p]).split("-"),y=$.length,b=hu(c[p+1]),b=b?b.split("-"):null;y>0;){if(R=ho($.slice(0,y).join("-")),R)return R;if(b&&b.length>=y&&cd($,b)>=y-1)break;y--}p++}return Wt}function dd(c){return!!(c&&c.match("^[^/\\\\]*$"))}function ho(c){var p=null,y;if(ot[c]===void 0&&typeof tl<"u"&&tl&&tl.exports&&dd(c))try{p=Wt._abbr,y=qt,y("./locale/"+c),Rn(p)}catch{ot[c]=null}return ot[c]}function Rn(c,p){var y;return c&&(u(p)?y=wt(c):y=Jt(c,p),y?Wt=y:typeof console<"u"&&console.warn&&console.warn("Locale "+c+" not found. Did you forget to load it?")),Wt._abbr}function Jt(c,p){if(p!==null){var y,b=oi;if(p.abbr=c,ot[c]!=null)N("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),b=ot[c]._config;else if(p.parentLocale!=null)if(ot[p.parentLocale]!=null)b=ot[p.parentLocale]._config;else if(y=ho(p.parentLocale),y!=null)b=y._config;else return Pi[p.parentLocale]||(Pi[p.parentLocale]=[]),Pi[p.parentLocale].push({name:c,config:p}),null;return ot[c]=new Z(z(b,p)),Pi[c]&&Pi[c].forEach(function(R){Jt(R.name,R.config)}),Rn(c),ot[c]}else return delete ot[c],null}function mg(c,p){if(p!=null){var y,b,R=oi;ot[c]!=null&&ot[c].parentLocale!=null?ot[c].set(z(ot[c]._config,p)):(b=ho(c),b!=null&&(R=b._config),p=z(R,p),b==null&&(p.abbr=c),y=new Z(p),y.parentLocale=ot[c],ot[c]=y),Rn(c)}else ot[c]!=null&&(ot[c].parentLocale!=null?(ot[c]=ot[c].parentLocale,c===Rn()&&Rn(c)):ot[c]!=null&&delete ot[c]);return ot[c]}function wt(c){var p;if(c&&c._locale&&c._locale._abbr&&(c=c._locale._abbr),!c)return Wt;if(!n(c)){if(p=ho(c),p)return p;c=[c]}return fd(c)}function gg(){return ie(ot)}function Ra(c){var p,y=c._a;return y&&C(c).overflow===-2&&(p=y[Cn]<0||y[Cn]>11?Cn:y[Zr]<1||y[Zr]>wa(y[Vt],y[Cn])?Zr:y[Pt]<0||y[Pt]>24||y[Pt]===24&&(y[jr]!==0||y[xn]!==0||y[ii]!==0)?Pt:y[jr]<0||y[jr]>59?jr:y[xn]<0||y[xn]>59?xn:y[ii]<0||y[ii]>999?ii:-1,C(c)._overflowDayOfYear&&(p<Vt||p>Zr)&&(p=Zr),C(c)._overflowWeeks&&p===-1&&(p=Ym),C(c)._overflowWeekday&&p===-1&&(p=Jm),C(c).overflow=p),c}var ai=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ia=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,pu=/Z|[+-]\d\d(?::?\d\d)?/,et=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Xr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],mu=/^\/?Date\((-?\d+)/i,yg=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,gu={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function hd(c){var p,y,b=c._i,R=ai.exec(b)||Ia.exec(b),$,W,se,ye,Oe=et.length,Kt=Xr.length;if(R){for(C(c).iso=!0,p=0,y=Oe;p<y;p++)if(et[p][1].exec(R[1])){W=et[p][0],$=et[p][2]!==!1;break}if(W==null){c._isValid=!1;return}if(R[3]){for(p=0,y=Kt;p<y;p++)if(Xr[p][1].exec(R[3])){se=(R[2]||" ")+Xr[p][0];break}if(se==null){c._isValid=!1;return}}if(!$&&se!=null){c._isValid=!1;return}if(R[4])if(pu.exec(R[4]))ye="Z";else{c._isValid=!1;return}c._f=W+(se||"")+(ye||""),vu(c)}else c._isValid=!1}function vg(c,p,y,b,R,$){var W=[Sg(c),au.indexOf(p),parseInt(y,10),parseInt(b,10),parseInt(R,10)];return $&&W.push(parseInt($,10)),W}function Sg(c){var p=parseInt(c,10);return p<=49?2e3+p:p<=999?1900+p:p}function pd(c){return c.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Oa(c,p,y){if(c){var b=sd.indexOf(c),R=new Date(p[0],p[1],p[2]).getDay();if(b!==R)return C(y).weekdayMismatch=!0,y._isValid=!1,!1}return!0}function _s(c,p,y){if(c)return gu[c];if(p)return 0;var b=parseInt(y,10),R=b%100,$=(b-R)/100;return $*60+R}function md(c){var p=yg.exec(pd(c._i)),y;if(p){if(y=vg(p[4],p[3],p[2],p[5],p[6],p[7]),!Oa(p[1],y,c))return;c._a=y,c._tzm=_s(p[8],p[9],p[10]),c._d=ys.apply(null,c._a),c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),C(c).rfc2822=!0}else c._isValid=!1}function gd(c){var p=mu.exec(c._i);if(p!==null){c._d=new Date(+p[1]);return}if(hd(c),c._isValid===!1)delete c._isValid;else return;if(md(c),c._isValid===!1)delete c._isValid;else return;c._strict?c._isValid=!1:e.createFromInputFallback(c)}e.createFromInputFallback=E("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(c){c._d=new Date(c._i+(c._useUTC?" UTC":""))});function ki(c,p,y){return c??p??y}function yu(c){var p=new Date(e.now());return c._useUTC?[p.getUTCFullYear(),p.getUTCMonth(),p.getUTCDate()]:[p.getFullYear(),p.getMonth(),p.getDate()]}function po(c){var p,y,b=[],R,$,W;if(!c._d){for(R=yu(c),c._w&&c._a[Zr]==null&&c._a[Cn]==null&&yd(c),c._dayOfYear!=null&&(W=ki(c._a[Vt],R[Vt]),(c._dayOfYear>fo(W)||c._dayOfYear===0)&&(C(c)._overflowDayOfYear=!0),y=ys(W,0,c._dayOfYear),c._a[Cn]=y.getUTCMonth(),c._a[Zr]=y.getUTCDate()),p=0;p<3&&c._a[p]==null;++p)c._a[p]=b[p]=R[p];for(;p<7;p++)c._a[p]=b[p]=c._a[p]==null?p===2?1:0:c._a[p];c._a[Pt]===24&&c._a[jr]===0&&c._a[xn]===0&&c._a[ii]===0&&(c._nextDay=!0,c._a[Pt]=0),c._d=(c._useUTC?ys:Zf).apply(null,b),$=c._useUTC?c._d.getUTCDay():c._d.getDay(),c._tzm!=null&&c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),c._nextDay&&(c._a[Pt]=24),c._w&&typeof c._w.d<"u"&&c._w.d!==$&&(C(c).weekdayMismatch=!0)}}function yd(c){var p,y,b,R,$,W,se,ye,Oe;p=c._w,p.GG!=null||p.W!=null||p.E!=null?($=1,W=4,y=ki(p.GG,c._a[Vt],Ss(nt(),1,4).year),b=ki(p.W,1),R=ki(p.E,1),(R<1||R>7)&&(ye=!0)):($=c._locale._week.dow,W=c._locale._week.doy,Oe=Ss(nt(),$,W),y=ki(p.gg,c._a[Vt],Oe.year),b=ki(p.w,Oe.week),p.d!=null?(R=p.d,(R<0||R>6)&&(ye=!0)):p.e!=null?(R=p.e+$,(p.e<0||p.e>6)&&(ye=!0)):R=$),b<1||b>Ur(y,$,W)?C(c)._overflowWeeks=!0:ye!=null?C(c)._overflowWeekday=!0:(se=Xf(y,b,R,$,W),c._a[Vt]=se.year,c._dayOfYear=se.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function vu(c){if(c._f===e.ISO_8601){hd(c);return}if(c._f===e.RFC_2822){md(c);return}c._a=[],C(c).empty=!0;var p=""+c._i,y,b,R,$,W,se=p.length,ye=0,Oe,Kt;for(R=_n(c._f,c._locale).match(he)||[],Kt=R.length,y=0;y<Kt;y++)$=R[y],b=(p.match(Vm($,c))||[])[0],b&&(W=p.substr(0,p.indexOf(b)),W.length>0&&C(c).unusedInput.push(W),p=p.slice(p.indexOf(b)+b.length),ye+=b.length),Mt[$]?(b?C(c).empty=!1:C(c).unusedTokens.push($),Wm($,b,c)):c._strict&&!b&&C(c).unusedTokens.push($);C(c).charsLeftOver=se-ye,p.length>0&&C(c).unusedInput.push(p),c._a[Pt]<=12&&C(c).bigHour===!0&&c._a[Pt]>0&&(C(c).bigHour=void 0),C(c).parsedDateParts=c._a.slice(0),C(c).meridiem=c._meridiem,c._a[Pt]=Su(c._locale,c._a[Pt],c._meridiem),Oe=C(c).era,Oe!==null&&(c._a[Vt]=c._locale.erasConvertYear(Oe,c._a[Vt])),po(c),Ra(c)}function Su(c,p,y){var b;return y==null?p:c.meridiemHour!=null?c.meridiemHour(p,y):(c.isPM!=null&&(b=c.isPM(y),b&&p<12&&(p+=12),!b&&p===12&&(p=0)),p)}function bu(c){var p,y,b,R,$,W,se=!1,ye=c._f.length;if(ye===0){C(c).invalidFormat=!0,c._d=new Date(NaN);return}for(R=0;R<ye;R++)$=0,W=!1,p=V({},c),c._useUTC!=null&&(p._useUTC=c._useUTC),p._f=c._f[R],vu(p),A(p)&&(W=!0),$+=C(p).charsLeftOver,$+=C(p).unusedTokens.length*10,C(p).score=$,se?$<b&&(b=$,y=p):(b==null||$<b||W)&&(b=$,y=p,W&&(se=!0));m(c,y||p)}function bg(c){if(!c._d){var p=Ri(c._i),y=p.day===void 0?p.date:p.day;c._a=g([p.year,p.month,y,p.hour,p.minute,p.second,p.millisecond],function(b){return b&&parseInt(b,10)}),po(c)}}function vd(c){var p=new K(Ra(nr(c)));return p._nextDay&&(p.add(1,"d"),p._nextDay=void 0),p}function nr(c){var p=c._i,y=c._f;return c._locale=c._locale||wt(c._l),p===null||y===void 0&&p===""?T({nullInput:!0}):(typeof p=="string"&&(c._i=p=c._locale.preparse(p)),ee(p)?new K(Ra(p)):(h(p)?c._d=p:n(y)?bu(c):y?vu(c):_u(c),A(c)||(c._d=null),c))}function _u(c){var p=c._i;u(p)?c._d=new Date(e.now()):h(p)?c._d=new Date(p.valueOf()):typeof p=="string"?gd(c):n(p)?(c._a=g(p.slice(0),function(y){return parseInt(y,10)}),po(c)):i(p)?bg(c):f(p)?c._d=new Date(p):e.createFromInputFallback(c)}function ws(c,p,y,b,R){var $={};return(p===!0||p===!1)&&(b=p,p=void 0),(y===!0||y===!1)&&(b=y,y=void 0),(i(c)&&a(c)||n(c)&&c.length===0)&&(c=void 0),$._isAMomentObject=!0,$._useUTC=$._isUTC=R,$._l=y,$._i=c,$._f=p,$._strict=b,vd($)}function nt(c,p,y,b){return ws(c,p,y,b,!1)}var Sd=E("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=nt.apply(null,arguments);return this.isValid()&&c.isValid()?c<this?this:c:T()}),_g=E("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=nt.apply(null,arguments);return this.isValid()&&c.isValid()?c>this?this:c:T()});function bd(c,p){var y,b;if(p.length===1&&n(p[0])&&(p=p[0]),!p.length)return nt();for(y=p[0],b=1;b<p.length;++b)(!p[b].isValid()||p[b][c](y))&&(y=p[b]);return y}function wg(){var c=[].slice.call(arguments,0);return bd("isBefore",c)}function Eg(){var c=[].slice.call(arguments,0);return bd("isAfter",c)}var Cg=function(){return Date.now?Date.now():+new Date},en=["year","quarter","month","week","day","hour","minute","second","millisecond"];function xg(c){var p,y=!1,b,R=en.length;for(p in c)if(s(c,p)&&!(yt.call(en,p)!==-1&&(c[p]==null||!isNaN(c[p]))))return!1;for(b=0;b<R;++b)if(c[en[b]]){if(y)return!1;parseFloat(c[en[b]])!==$e(c[en[b]])&&(y=!0)}return!0}function Rg(){return this._isValid}function wu(){return Ae(NaN)}function mo(c){var p=Ri(c),y=p.year||0,b=p.quarter||0,R=p.month||0,$=p.week||p.isoWeek||0,W=p.day||0,se=p.hour||0,ye=p.minute||0,Oe=p.second||0,Kt=p.millisecond||0;this._isValid=xg(p),this._milliseconds=+Kt+Oe*1e3+ye*6e4+se*1e3*60*60,this._days=+W+$*7,this._months=+R+b*3+y*12,this._data={},this._locale=wt(),this._bubble()}function Br(c){return c instanceof mo}function Es(c){return c<0?Math.round(-1*c)*-1:Math.round(c)}function Ig(c,p,y){var b=Math.min(c.length,p.length),R=Math.abs(c.length-p.length),$=0,W;for(W=0;W<b;W++)(y&&c[W]!==p[W]||!y&&$e(c[W])!==$e(p[W]))&&$++;return $+R}function _d(c,p){le(c,0,0,function(){var y=this.utcOffset(),b="+";return y<0&&(y=-y,b="-"),b+we(~~(y/60),2)+p+we(~~y%60,2)})}_d("Z",":"),_d("ZZ",""),oe("Z",va),oe("ZZ",va),Ke(["Z","ZZ"],function(c,p,y){y._useUTC=!0,y._tzm=li(va,c)});var Og=/([\+\-]|\d\d)/gi;function li(c,p){var y=(p||"").match(c),b,R,$;return y===null?null:(b=y[y.length-1]||[],R=(b+"").match(Og)||["-",0,0],$=+(R[1]*60)+$e(R[2]),$===0?0:R[0]==="+"?$:-$)}function hr(c,p){var y,b;return p._isUTC?(y=p.clone(),b=(ee(c)||h(c)?c.valueOf():nt(c).valueOf())-y.valueOf(),y._d.setTime(y._d.valueOf()+b),e.updateOffset(y,!1),y):nt(c).local()}function Pa(c){return-Math.round(c._d.getTimezoneOffset())}e.updateOffset=function(){};function Pg(c,p,y){var b=this._offset||0,R;if(!this.isValid())return c!=null?this:NaN;if(c!=null){if(typeof c=="string"){if(c=li(va,c),c===null)return this}else Math.abs(c)<16&&!y&&(c=c*60);return!this._isUTC&&p&&(R=Pa(this)),this._offset=c,this._isUTC=!0,R!=null&&this.add(R,"m"),b!==c&&(!p||this._changeInProgress?Ed(this,Ae(c-b,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?b:Pa(this)}function kg(c,p){return c!=null?(typeof c!="string"&&(c=-c),this.utcOffset(c,p),this):-this.utcOffset()}function Ag(c){return this.utcOffset(0,c)}function Tg(c){return this._isUTC&&(this.utcOffset(0,c),this._isUTC=!1,c&&this.subtract(Pa(this),"m")),this}function qg(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var c=li(Bm,this._i);c!=null?this.utcOffset(c):this.utcOffset(0,!0)}return this}function ui(c){return this.isValid()?(c=c?nt(c).utcOffset():0,(this.utcOffset()-c)%60===0):!1}function U(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function J(){if(!u(this._isDSTShifted))return this._isDSTShifted;var c={},p;return V(c,this),c=nr(c),c._a?(p=c._isUTC?S(c._a):nt(c._a),this._isDSTShifted=this.isValid()&&Ig(c._a,p.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function H(){return this.isValid()?!this._isUTC:!1}function ae(){return this.isValid()?this._isUTC:!1}function ve(){return this.isValid()?this._isUTC&&this._offset===0:!1}var We=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,kt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ae(c,p){var y=c,b=null,R,$,W;return Br(c)?y={ms:c._milliseconds,d:c._days,M:c._months}:f(c)||!isNaN(+c)?(y={},p?y[p]=+c:y.milliseconds=+c):(b=We.exec(c))?(R=b[1]==="-"?-1:1,y={y:0,d:$e(b[Zr])*R,h:$e(b[Pt])*R,m:$e(b[jr])*R,s:$e(b[xn])*R,ms:$e(Es(b[ii]*1e3))*R}):(b=kt.exec(c))?(R=b[1]==="-"?-1:1,y={y:In(b[2],R),M:In(b[3],R),w:In(b[4],R),d:In(b[5],R),h:In(b[6],R),m:In(b[7],R),s:In(b[8],R)}):y==null?y={}:typeof y=="object"&&("from"in y||"to"in y)&&(W=wr(nt(y.from),nt(y.to)),y={},y.ms=W.milliseconds,y.M=W.months),$=new mo(y),Br(c)&&s(c,"_locale")&&($._locale=c._locale),Br(c)&&s(c,"_isValid")&&($._isValid=c._isValid),$}Ae.fn=mo.prototype,Ae.invalid=wu;function In(c,p){var y=c&&parseFloat(c.replace(",","."));return(isNaN(y)?0:y)*p}function wd(c,p){var y={};return y.months=p.month()-c.month()+(p.year()-c.year())*12,c.clone().add(y.months,"M").isAfter(p)&&--y.months,y.milliseconds=+p-+c.clone().add(y.months,"M"),y}function wr(c,p){var y;return c.isValid()&&p.isValid()?(p=hr(p,c),c.isBefore(p)?y=wd(c,p):(y=wd(p,c),y.milliseconds=-y.milliseconds,y.months=-y.months),y):{milliseconds:0,months:0}}function go(c,p){return function(y,b){var R,$;return b!==null&&!isNaN(+b)&&(N(p,"moment()."+p+"(period, number) is deprecated. Please use moment()."+p+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),$=y,y=b,b=$),R=Ae(y,b),Ed(this,R,c),this}}function Ed(c,p,y,b){var R=p._milliseconds,$=Es(p._days),W=Es(p._months);c.isValid()&&(b=b??!0,W&&Ea(c,si(c,"Month")+W*y),$&&Bf(c,"Date",si(c,"Date")+$*y),R&&c._d.setTime(c._d.valueOf()+R*y),b&&e.updateOffset(c,$||W))}var Cs=go(1,"add"),ka=go(-1,"subtract");function yo(c){return typeof c=="string"||c instanceof String}function ze(c){return ee(c)||h(c)||yo(c)||f(c)||Cd(c)||$g(c)||c===null||c===void 0}function $g(c){var p=i(c)&&!a(c),y=!1,b=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],R,$,W=b.length;for(R=0;R<W;R+=1)$=b[R],y=y||s(c,$);return p&&y}function Cd(c){var p=n(c),y=!1;return p&&(y=c.filter(function(b){return!f(b)&&yo(c)}).length===0),p&&y}function Aa(c){var p=i(c)&&!a(c),y=!1,b=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],R,$;for(R=0;R<b.length;R+=1)$=b[R],y=y||s(c,$);return p&&y}function Mg(c,p){var y=c.diff(p,"days",!0);return y<-6?"sameElse":y<-1?"lastWeek":y<0?"lastDay":y<1?"sameDay":y<2?"nextDay":y<7?"nextWeek":"sameElse"}function Ng(c,p){arguments.length===1&&(arguments[0]?ze(arguments[0])?(c=arguments[0],p=void 0):Aa(arguments[0])&&(p=arguments[0],c=void 0):(c=void 0,p=void 0));var y=c||nt(),b=hr(y,this).startOf("day"),R=e.calendarFormat(this,b)||"sameElse",$=p&&(D(p[R])?p[R].call(this,y):p[R]);return this.format($||this.localeData().calendar(R,this,nt(y)))}function Dg(){return new K(this)}function Ta(c,p){var y=ee(c)?c:nt(c);return this.isValid()&&y.isValid()?(p=gt(p)||"millisecond",p==="millisecond"?this.valueOf()>y.valueOf():y.valueOf()<this.clone().startOf(p).valueOf()):!1}function ci(c,p){var y=ee(c)?c:nt(c);return this.isValid()&&y.isValid()?(p=gt(p)||"millisecond",p==="millisecond"?this.valueOf()<y.valueOf():this.clone().endOf(p).valueOf()<y.valueOf()):!1}function qa(c,p,y,b){var R=ee(c)?c:nt(c),$=ee(p)?p:nt(p);return this.isValid()&&R.isValid()&&$.isValid()?(b=b||"()",(b[0]==="("?this.isAfter(R,y):!this.isBefore(R,y))&&(b[1]===")"?this.isBefore($,y):!this.isAfter($,y))):!1}function xd(c,p){var y=ee(c)?c:nt(c),b;return this.isValid()&&y.isValid()?(p=gt(p)||"millisecond",p==="millisecond"?this.valueOf()===y.valueOf():(b=y.valueOf(),this.clone().startOf(p).valueOf()<=b&&b<=this.clone().endOf(p).valueOf())):!1}function $a(c,p){return this.isSame(c,p)||this.isAfter(c,p)}function Rd(c,p){return this.isSame(c,p)||this.isBefore(c,p)}function Id(c,p,y){var b,R,$;if(!this.isValid())return NaN;if(b=hr(c,this),!b.isValid())return NaN;switch(R=(b.utcOffset()-this.utcOffset())*6e4,p=gt(p),p){case"year":$=Ai(this,b)/12;break;case"month":$=Ai(this,b);break;case"quarter":$=Ai(this,b)/3;break;case"second":$=(this-b)/1e3;break;case"minute":$=(this-b)/6e4;break;case"hour":$=(this-b)/36e5;break;case"day":$=(this-b-R)/864e5;break;case"week":$=(this-b-R)/6048e5;break;default:$=this-b}return y?$:_r($)}function Ai(c,p){if(c.date()<p.date())return-Ai(p,c);var y=(p.year()-c.year())*12+(p.month()-c.month()),b=c.clone().add(y,"months"),R,$;return p-b<0?(R=c.clone().add(y-1,"months"),$=(p-b)/(b-R)):(R=c.clone().add(y+1,"months"),$=(p-b)/(R-b)),-(y+$)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Od(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function vo(c){if(!this.isValid())return null;var p=c!==!0,y=p?this.clone().utc():this;return y.year()<0||y.year()>9999?ct(y,p?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):D(Date.prototype.toISOString)?p?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ct(y,"Z")):ct(y,p?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Ti(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var c="moment",p="",y,b,R,$;return this.isLocal()||(c=this.utcOffset()===0?"moment.utc":"moment.parseZone",p="Z"),y="["+c+'("]',b=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",R="-MM-DD[T]HH:mm:ss.SSS",$=p+'[")]',this.format(y+b+R+$)}function Ma(c){c||(c=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var p=ct(this,c);return this.localeData().postformat(p)}function Fg(c,p){return this.isValid()&&(ee(c)&&c.isValid()||nt(c).isValid())?Ae({to:this,from:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function Lg(c){return this.from(nt(),c)}function jg(c,p){return this.isValid()&&(ee(c)&&c.isValid()||nt(c).isValid())?Ae({from:this,to:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function Na(c){return this.to(nt(),c)}function So(c){var p;return c===void 0?this._locale._abbr:(p=wt(c),p!=null&&(this._locale=p),this)}var Da=E("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(c){return c===void 0?this.localeData():this.locale(c)});function Pd(){return this._locale}var bo=1e3,xs=60*bo,Fa=60*xs,Et=(365*400+97)*24*Fa;function vt(c,p){return(c%p+p)%p}function kd(c,p,y){return c<100&&c>=0?new Date(c+400,p,y)-Et:new Date(c,p,y).valueOf()}function Ad(c,p,y){return c<100&&c>=0?Date.UTC(c+400,p,y)-Et:Date.UTC(c,p,y)}function Td(c){var p,y;if(c=gt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(y=this._isUTC?Ad:kd,c){case"year":p=y(this.year(),0,1);break;case"quarter":p=y(this.year(),this.month()-this.month()%3,1);break;case"month":p=y(this.year(),this.month(),1);break;case"week":p=y(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":p=y(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":p=y(this.year(),this.month(),this.date());break;case"hour":p=this._d.valueOf(),p-=vt(p+(this._isUTC?0:this.utcOffset()*xs),Fa);break;case"minute":p=this._d.valueOf(),p-=vt(p,xs);break;case"second":p=this._d.valueOf(),p-=vt(p,bo);break}return this._d.setTime(p),e.updateOffset(this,!0),this}function Ug(c){var p,y;if(c=gt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(y=this._isUTC?Ad:kd,c){case"year":p=y(this.year()+1,0,1)-1;break;case"quarter":p=y(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":p=y(this.year(),this.month()+1,1)-1;break;case"week":p=y(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":p=y(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":p=y(this.year(),this.month(),this.date()+1)-1;break;case"hour":p=this._d.valueOf(),p+=Fa-vt(p+(this._isUTC?0:this.utcOffset()*xs),Fa)-1;break;case"minute":p=this._d.valueOf(),p+=xs-vt(p,xs)-1;break;case"second":p=this._d.valueOf(),p+=bo-vt(p,bo)-1;break}return this._d.setTime(p),e.updateOffset(this,!0),this}function Eu(){return this._d.valueOf()-(this._offset||0)*6e4}function _o(){return Math.floor(this.valueOf()/1e3)}function Cu(){return new Date(this.valueOf())}function Rs(){var c=this;return[c.year(),c.month(),c.date(),c.hour(),c.minute(),c.second(),c.millisecond()]}function wo(){var c=this;return{years:c.year(),months:c.month(),date:c.date(),hours:c.hours(),minutes:c.minutes(),seconds:c.seconds(),milliseconds:c.milliseconds()}}function Eo(){return this.isValid()?this.toISOString():null}function La(){return A(this)}function Is(){return m({},C(this))}function Bg(){return C(this).overflow}function Hg(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}le("N",0,0,"eraAbbr"),le("NN",0,0,"eraAbbr"),le("NNN",0,0,"eraAbbr"),le("NNNN",0,0,"eraName"),le("NNNNN",0,0,"eraNarrow"),le("y",["y",1],"yo","eraYear"),le("y",["yy",2],0,"eraYear"),le("y",["yyy",3],0,"eraYear"),le("y",["yyyy",4],0,"eraYear"),oe("N",Ie),oe("NN",Ie),oe("NNN",Ie),oe("NNNN",Jg),oe("NNNNN",zg),Ke(["N","NN","NNN","NNNN","NNNNN"],function(c,p,y,b){var R=y._locale.erasParse(c,b,y._strict);R?C(y).era=R:C(y).invalidEra=c}),oe("y",ni),oe("yy",ni),oe("yyy",ni),oe("yyyy",ni),oe("yo",Kg),Ke(["y","yy","yyy","yyyy"],Vt),Ke(["yo"],function(c,p,y,b){var R;y._locale._eraYearOrdinalRegex&&(R=c.match(y._locale._eraYearOrdinalRegex)),y._locale.eraYearOrdinalParse?p[Vt]=y._locale.eraYearOrdinalParse(c,R):p[Vt]=parseInt(c,10)});function Vg(c,p){var y,b,R,$=this._eras||wt("en")._eras;for(y=0,b=$.length;y<b;++y){switch(typeof $[y].since){case"string":R=e($[y].since).startOf("day"),$[y].since=R.valueOf();break}switch(typeof $[y].until){case"undefined":$[y].until=1/0;break;case"string":R=e($[y].until).startOf("day").valueOf(),$[y].until=R.valueOf();break}}return $}function Wg(c,p,y){var b,R,$=this.eras(),W,se,ye;for(c=c.toUpperCase(),b=0,R=$.length;b<R;++b)if(W=$[b].name.toUpperCase(),se=$[b].abbr.toUpperCase(),ye=$[b].narrow.toUpperCase(),y)switch(p){case"N":case"NN":case"NNN":if(se===c)return $[b];break;case"NNNN":if(W===c)return $[b];break;case"NNNNN":if(ye===c)return $[b];break}else if([W,se,ye].indexOf(c)>=0)return $[b]}function Yg(c,p){var y=c.since<=c.until?1:-1;return p===void 0?e(c.since).year():e(c.since).year()+(p-c.offset)*y}function ja(){var c,p,y,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(y=this.clone().startOf("day").valueOf(),b[c].since<=y&&y<=b[c].until||b[c].until<=y&&y<=b[c].since)return b[c].name;return""}function Co(){var c,p,y,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(y=this.clone().startOf("day").valueOf(),b[c].since<=y&&y<=b[c].until||b[c].until<=y&&y<=b[c].since)return b[c].narrow;return""}function qd(){var c,p,y,b=this.localeData().eras();for(c=0,p=b.length;c<p;++c)if(y=this.clone().startOf("day").valueOf(),b[c].since<=y&&y<=b[c].until||b[c].until<=y&&y<=b[c].since)return b[c].abbr;return""}function I(){var c,p,y,b,R=this.localeData().eras();for(c=0,p=R.length;c<p;++c)if(y=R[c].since<=R[c].until?1:-1,b=this.clone().startOf("day").valueOf(),R[c].since<=b&&b<=R[c].until||R[c].until<=b&&b<=R[c].since)return(this.year()-e(R[c].since).year())*y+R[c].offset;return this.year()}function Os(c){return s(this,"_erasNameRegex")||On.call(this),c?this._erasNameRegex:this._erasRegex}function Ua(c){return s(this,"_erasAbbrRegex")||On.call(this),c?this._erasAbbrRegex:this._erasRegex}function Er(c){return s(this,"_erasNarrowRegex")||On.call(this),c?this._erasNarrowRegex:this._erasRegex}function Ie(c,p){return p.erasAbbrRegex(c)}function Jg(c,p){return p.erasNameRegex(c)}function zg(c,p){return p.erasNarrowRegex(c)}function Kg(c,p){return p._eraYearOrdinalRegex||ni}function On(){var c=[],p=[],y=[],b=[],R,$,W,se,ye,Oe=this.eras();for(R=0,$=Oe.length;R<$;++R)W=En(Oe[R].name),se=En(Oe[R].abbr),ye=En(Oe[R].narrow),p.push(W),c.push(se),y.push(ye),b.push(W),b.push(se),b.push(ye);this._erasRegex=new RegExp("^("+b.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+p.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+c.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+y.join("|")+")","i")}le(0,["gg",2],0,function(){return this.weekYear()%100}),le(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Ba(c,p){le(0,[c,c.length],0,p)}Ba("gggg","weekYear"),Ba("ggggg","weekYear"),Ba("GGGG","isoWeekYear"),Ba("GGGGG","isoWeekYear"),oe("G",ps),oe("g",ps),oe("GG",Xe,dr),oe("gg",Xe,dr),oe("GGGG",uo,ri),oe("gggg",uo,ri),oe("GGGGG",hs,fs),oe("ggggg",hs,fs),Oi(["gggg","ggggg","GGGG","GGGGG"],function(c,p,y,b){p[b.substr(0,2)]=$e(c)}),Oi(["gg","GG"],function(c,p,y,b){p[b]=e.parseTwoDigitYear(c)});function Gg(c){return $d.call(this,c,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Qg(c){return $d.call(this,c,this.isoWeek(),this.isoWeekday(),1,4)}function Zg(){return Ur(this.year(),1,4)}function Xg(){return Ur(this.isoWeekYear(),1,4)}function Pn(){var c=this.localeData()._week;return Ur(this.year(),c.dow,c.doy)}function ey(){var c=this.localeData()._week;return Ur(this.weekYear(),c.dow,c.doy)}function $d(c,p,y,b,R){var $;return c==null?Ss(this,b,R).year:($=Ur(c,b,R),p>$&&(p=$),ty.call(this,c,p,y,b,R))}function ty(c,p,y,b,R){var $=Xf(c,p,y,b,R),W=ys($.year,0,$.dayOfYear);return this.year(W.getUTCFullYear()),this.month(W.getUTCMonth()),this.date(W.getUTCDate()),this}le("Q",0,"Qo","quarter"),oe("Q",us),Ke("Q",function(c,p){p[Cn]=($e(c)-1)*3});function ry(c){return c==null?Math.ceil((this.month()+1)/3):this.month((c-1)*3+this.month()%3)}le("D",["DD",2],"Do","date"),oe("D",Xe,Ii),oe("DD",Xe,dr),oe("Do",function(c,p){return c?p._dayOfMonthOrdinalParse||p._ordinalParse:p._dayOfMonthOrdinalParseLenient}),Ke(["D","DD"],Zr),Ke("Do",function(c,p){p[Zr]=$e(c.match(Xe)[0])});var Md=gs("Date",!0);le("DDD",["DDDD",3],"DDDo","dayOfYear"),oe("DDD",ds),oe("DDDD",cs),Ke(["DDD","DDDD"],function(c,p,y){y._dayOfYear=$e(c)});function kn(c){var p=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return c==null?p:this.add(c-p,"d")}le("m",["mm",2],0,"minute"),oe("m",Xe,ou),oe("mm",Xe,dr),Ke(["m","mm"],jr);var ny=gs("Minutes",!1);le("s",["ss",2],0,"second"),oe("s",Xe,ou),oe("ss",Xe,dr),Ke(["s","ss"],xn);var iy=gs("Seconds",!1);le("S",0,0,function(){return~~(this.millisecond()/100)}),le(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),le(0,["SSS",3],0,"millisecond"),le(0,["SSSS",4],0,function(){return this.millisecond()*10}),le(0,["SSSSS",5],0,function(){return this.millisecond()*100}),le(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),le(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),le(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),le(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),oe("S",ds,us),oe("SS",ds,dr),oe("SSS",ds,cs);var fi,Nd;for(fi="SSSS";fi.length<=9;fi+="S")oe(fi,ni);function sy(c,p){p[ii]=$e(("0."+c)*1e3)}for(fi="S";fi.length<=9;fi+="S")Ke(fi,sy);Nd=gs("Milliseconds",!1),le("z",0,0,"zoneAbbr"),le("zz",0,0,"zoneName");function qi(){return this._isUTC?"UTC":""}function oy(){return this._isUTC?"Coordinated Universal Time":""}var te=K.prototype;te.add=Cs,te.calendar=Ng,te.clone=Dg,te.diff=Id,te.endOf=Ug,te.format=Ma,te.from=Fg,te.fromNow=Lg,te.to=jg,te.toNow=Na,te.get=_a,te.invalidAt=Bg,te.isAfter=Ta,te.isBefore=ci,te.isBetween=qa,te.isSame=xd,te.isSameOrAfter=$a,te.isSameOrBefore=Rd,te.isValid=La,te.lang=Da,te.locale=So,te.localeData=Pd,te.max=_g,te.min=Sd,te.parsingFlags=Is,te.set=Km,te.startOf=Td,te.subtract=ka,te.toArray=Rs,te.toObject=wo,te.toDate=Cu,te.toISOString=vo,te.inspect=Ti,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=Eo,te.toString=Od,te.unix=_o,te.valueOf=Eu,te.creationData=Hg,te.eraName=ja,te.eraNarrow=Co,te.eraAbbr=qd,te.eraYear=I,te.year=Uf,te.isLeapYear=zm,te.weekYear=Gg,te.isoWeekYear=Qg,te.quarter=te.quarters=ry,te.month=zf,te.daysInMonth=Kf,te.week=te.weeks=eg,te.isoWeek=te.isoWeeks=rd,te.weeksInYear=Pn,te.weeksInWeekYear=ey,te.isoWeeksInYear=Zg,te.isoWeeksInISOWeekYear=Xg,te.date=Md,te.day=te.days=ug,te.weekday=cg,te.isoWeekday=fg,te.dayOfYear=kn,te.hour=te.hours=Nt,te.minute=te.minutes=ny,te.second=te.seconds=iy,te.millisecond=te.milliseconds=Nd,te.utcOffset=Pg,te.utc=Ag,te.local=Tg,te.parseZone=qg,te.hasAlignedHourOffset=ui,te.isDST=U,te.isLocal=H,te.isUtcOffset=ae,te.isUtc=ve,te.isUTC=ve,te.zoneAbbr=qi,te.zoneName=oy,te.dates=E("dates accessor is deprecated. Use date instead.",Md),te.months=E("months accessor is deprecated. Use month instead",zf),te.years=E("years accessor is deprecated. Use year instead",Uf),te.zone=E("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",kg),te.isDSTShifted=E("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",J);function Hr(c){return nt(c*1e3)}function ay(){return nt.apply(null,arguments).parseZone()}function Dd(c){return c}var Be=Z.prototype;Be.calendar=bt,Be.longDateFormat=jt,Be.invalidDate=ti,Be.ordinal=Lm,Be.preparse=Dd,Be.postformat=Dd,Be.relativeTime=Lf,Be.pastFuture=jm,Be.set=L,Be.eras=Vg,Be.erasParse=Wg,Be.erasConvertYear=Yg,Be.erasAbbrRegex=Ua,Be.erasNameRegex=Os,Be.erasNarrowRegex=Er,Be.months=Xm,Be.monthsShort=Wf,Be.monthsParse=Jf,Be.monthsRegex=Gf,Be.monthsShortRegex=Ca,Be.week=lu,Be.firstDayOfYear=td,Be.firstDayOfWeek=ed,Be.weekdays=sg,Be.weekdaysMin=uu,Be.weekdaysShort=og,Be.weekdaysParse=lg,Be.weekdaysRegex=st,Be.weekdaysShortRegex=rt,Be.weekdaysMinRegex=dg,Be.isPM=ud,Be.meridiem=du;function Ha(c,p,y,b){var R=wt(),$=S().set(b,p);return R[y]($,c)}function Fd(c,p,y){if(f(c)&&(p=c,c=void 0),c=c||"",p!=null)return Ha(c,p,y,"month");var b,R=[];for(b=0;b<12;b++)R[b]=Ha(c,b,y,"month");return R}function Va(c,p,y,b){typeof c=="boolean"?(f(p)&&(y=p,p=void 0),p=p||""):(p=c,y=p,c=!1,f(p)&&(y=p,p=void 0),p=p||"");var R=wt(),$=c?R._week.dow:0,W,se=[];if(y!=null)return Ha(p,(y+$)%7,b,"day");for(W=0;W<7;W++)se[W]=Ha(p,(W+$)%7,b,"day");return se}function Ld(c,p){return Fd(c,p,"months")}function ly(c,p){return Fd(c,p,"monthsShort")}function uy(c,p,y){return Va(c,p,y,"weekdays")}function xu(c,p,y){return Va(c,p,y,"weekdaysShort")}function xo(c,p,y){return Va(c,p,y,"weekdaysMin")}Rn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(c){var p=c%10,y=$e(c%100/10)===1?"th":p===1?"st":p===2?"nd":p===3?"rd":"th";return c+y}}),e.lang=E("moment.lang is deprecated. Use moment.locale instead.",Rn),e.langData=E("moment.langData is deprecated. Use moment.localeData instead.",wt);var Cr=Math.abs;function cy(){var c=this._data;return this._milliseconds=Cr(this._milliseconds),this._days=Cr(this._days),this._months=Cr(this._months),c.milliseconds=Cr(c.milliseconds),c.seconds=Cr(c.seconds),c.minutes=Cr(c.minutes),c.hours=Cr(c.hours),c.months=Cr(c.months),c.years=Cr(c.years),this}function Ru(c,p,y,b){var R=Ae(p,y);return c._milliseconds+=b*R._milliseconds,c._days+=b*R._days,c._months+=b*R._months,c._bubble()}function fy(c,p){return Ru(this,c,p,1)}function An(c,p){return Ru(this,c,p,-1)}function Wa(c){return c<0?Math.floor(c):Math.ceil(c)}function $i(){var c=this._milliseconds,p=this._days,y=this._months,b=this._data,R,$,W,se,ye;return c>=0&&p>=0&&y>=0||c<=0&&p<=0&&y<=0||(c+=Wa(Iu(y)+p)*864e5,p=0,y=0),b.milliseconds=c%1e3,R=_r(c/1e3),b.seconds=R%60,$=_r(R/60),b.minutes=$%60,W=_r($/60),b.hours=W%24,p+=_r(W/24),ye=_r(pr(p)),y+=ye,p-=Wa(Iu(ye)),se=_r(y/12),y%=12,b.days=p,b.months=y,b.years=se,this}function pr(c){return c*4800/146097}function Iu(c){return c*146097/4800}function jd(c){if(!this.isValid())return NaN;var p,y,b=this._milliseconds;if(c=gt(c),c==="month"||c==="quarter"||c==="year")switch(p=this._days+b/864e5,y=this._months+pr(p),c){case"month":return y;case"quarter":return y/3;case"year":return y/12}else switch(p=this._days+Math.round(Iu(this._months)),c){case"week":return p/7+b/6048e5;case"day":return p+b/864e5;case"hour":return p*24+b/36e5;case"minute":return p*1440+b/6e4;case"second":return p*86400+b/1e3;case"millisecond":return Math.floor(p*864e5)+b;default:throw new Error("Unknown unit "+c)}}function tn(c){return function(){return this.as(c)}}var Ps=tn("ms"),di=tn("s"),Ud=tn("m"),dy=tn("h"),Ya=tn("d"),hy=tn("w"),Bd=tn("M"),Ut=tn("Q"),Ou=tn("y"),Hd=Ps;function rn(){return Ae(this)}function Pu(c){return c=gt(c),this.isValid()?this[c+"s"]():NaN}function nn(c){return function(){return this.isValid()?this._data[c]:NaN}}var Mi=nn("milliseconds"),Vd=nn("seconds"),zt=nn("minutes"),ku=nn("hours"),py=nn("days"),my=nn("months"),gy=nn("years");function Au(){return _r(this.days()/7)}var Tn=Math.round,sn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Wd(c,p,y,b,R){return R.relativeTime(p||1,!!y,c,b)}function yy(c,p,y,b){var R=Ae(c).abs(),$=Tn(R.as("s")),W=Tn(R.as("m")),se=Tn(R.as("h")),ye=Tn(R.as("d")),Oe=Tn(R.as("M")),Kt=Tn(R.as("w")),on=Tn(R.as("y")),qn=$<=y.ss&&["s",$]||$<y.s&&["ss",$]||W<=1&&["m"]||W<y.m&&["mm",W]||se<=1&&["h"]||se<y.h&&["hh",se]||ye<=1&&["d"]||ye<y.d&&["dd",ye];return y.w!=null&&(qn=qn||Kt<=1&&["w"]||Kt<y.w&&["ww",Kt]),qn=qn||Oe<=1&&["M"]||Oe<y.M&&["MM",Oe]||on<=1&&["y"]||["yy",on],qn[2]=p,qn[3]=+c>0,qn[4]=b,Wd.apply(null,qn)}function vy(c){return c===void 0?Tn:typeof c=="function"?(Tn=c,!0):!1}function Ro(c,p){return sn[c]===void 0?!1:p===void 0?sn[c]:(sn[c]=p,c==="s"&&(sn.ss=p-1),!0)}function Sy(c,p){if(!this.isValid())return this.localeData().invalidDate();var y=!1,b=sn,R,$;return typeof c=="object"&&(p=c,c=!1),typeof c=="boolean"&&(y=c),typeof p=="object"&&(b=Object.assign({},sn,p),p.s!=null&&p.ss==null&&(b.ss=p.s-1)),R=this.localeData(),$=yy(this,!y,b,R),y&&($=R.pastFuture(+this,$)),R.postformat($)}var Tu=Math.abs;function hi(c){return(c>0)-(c<0)||+c}function Io(){if(!this.isValid())return this.localeData().invalidDate();var c=Tu(this._milliseconds)/1e3,p=Tu(this._days),y=Tu(this._months),b,R,$,W,se=this.asSeconds(),ye,Oe,Kt,on;return se?(b=_r(c/60),R=_r(b/60),c%=60,b%=60,$=_r(y/12),y%=12,W=c?c.toFixed(3).replace(/\.?0+$/,""):"",ye=se<0?"-":"",Oe=hi(this._months)!==hi(se)?"-":"",Kt=hi(this._days)!==hi(se)?"-":"",on=hi(this._milliseconds)!==hi(se)?"-":"",ye+"P"+($?Oe+$+"Y":"")+(y?Oe+y+"M":"")+(p?Kt+p+"D":"")+(R||b||c?"T":"")+(R?on+R+"H":"")+(b?on+b+"M":"")+(c?on+W+"S":"")):"P0D"}var Le=mo.prototype;Le.isValid=Rg,Le.abs=cy,Le.add=fy,Le.subtract=An,Le.as=jd,Le.asMilliseconds=Ps,Le.asSeconds=di,Le.asMinutes=Ud,Le.asHours=dy,Le.asDays=Ya,Le.asWeeks=hy,Le.asMonths=Bd,Le.asQuarters=Ut,Le.asYears=Ou,Le.valueOf=Hd,Le._bubble=$i,Le.clone=rn,Le.get=Pu,Le.milliseconds=Mi,Le.seconds=Vd,Le.minutes=zt,Le.hours=ku,Le.days=py,Le.weeks=Au,Le.months=my,Le.years=gy,Le.humanize=Sy,Le.toISOString=Io,Le.toString=Io,Le.toJSON=Io,Le.locale=So,Le.localeData=Pd,Le.toIsoString=E("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Io),Le.lang=Da,le("X",0,0,"unix"),le("x",0,0,"valueOf"),oe("x",ps),oe("X",Hm),Ke("X",function(c,p,y){y._d=new Date(parseFloat(c)*1e3)}),Ke("x",function(c,p,y){y._d=new Date($e(c))});return e.version="2.30.1",r(nt),e.fn=te,e.min=wg,e.max=Eg,e.now=Cg,e.utc=S,e.unix=Hr,e.months=Ld,e.isDate=h,e.locale=Rn,e.invalid=T,e.duration=Ae,e.isMoment=ee,e.weekdays=uy,e.parseZone=ay,e.localeData=wt,e.isDuration=Br,e.monthsShort=ly,e.weekdaysMin=xo,e.defineLocale=Jt,e.updateLocale=mg,e.locales=gg,e.weekdaysShort=xu,e.normalizeUnits=gt,e.relativeTimeRounding=vy,e.relativeTimeThreshold=Ro,e.calendarFormat=Mg,e.prototype=te,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var tC=F((eC,bh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof bh<"u"&&bh.exports?bh.exports=e():t.tv4=e()})(eC,function(){Object.keys||(Object.keys=function(){var k=Object.prototype.hasOwnProperty,E=!{toString:null}.propertyIsEnumerable("toString"),P=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],N=P.length;return function(D){if(typeof D!="object"&&typeof D!="function"||D===null)throw new TypeError("Object.keys called on non-object");var L=[];for(var z in D)k.call(D,z)&&L.push(z);if(E)for(var Z=0;Z<N;Z++)k.call(D,P[Z])&&L.push(P[Z]);return L}}()),Object.create||(Object.create=function(){function k(){}return function(E){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return k.prototype=E,new k}}()),Array.isArray||(Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"}),Array.prototype.indexOf||(Array.prototype.indexOf=function(k){if(this===null)throw new TypeError;var E=Object(this),P=E.length>>>0;if(P===0)return-1;var N=0;if(arguments.length>1&&(N=Number(arguments[1]),N!==N?N=0:N!==0&&N!==1/0&&N!==-1/0&&(N=(N>0||-1)*Math.floor(Math.abs(N)))),N>=P)return-1;for(var D=N>=0?N:Math.max(P-Math.abs(N),0);D<P;D++)if(D in E&&E[D]===k)return D;return-1}),Object.isFrozen||(Object.isFrozen=function(k){for(var E="tv4_test_frozen_key";k.hasOwnProperty(E);)E+=Math.random();try{return k[E]=!0,delete k[E],!1}catch{return!0}});var t={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function r(k){return encodeURI(k).replace(/%25[0-9][0-9]/g,function(E){return"%"+E.substring(3)})}function n(k){var E="";t[k.charAt(0)]&&(E=k.charAt(0),k=k.substring(1));var P="",N="",D=!0,L=!1,z=!1;E==="+"?D=!1:E==="."?(N=".",P="."):E==="/"?(N="/",P="/"):E==="#"?(N="#",D=!1):E===";"?(N=";",P=";",L=!0,z=!0):E==="?"?(N="?",P="&",L=!0):E==="&"&&(N="&",P="&",L=!0);for(var Z=[],ie=k.split(","),fe=[],bt={},we=0;we<ie.length;we++){var he=ie[we],Ze=null;if(he.indexOf(":")!==-1){var _t=he.split(":");he=_t[0],Ze=parseInt(_t[1],10)}for(var Mt={};e[he.charAt(he.length-1)];)Mt[he.charAt(he.length-1)]=!0,he=he.substring(0,he.length-1);var le={truncate:Ze,name:he,suffices:Mt};fe.push(le),bt[he]=le,Z.push(he)}var ei=function(su){for(var ct="",_n=0,as=0;as<fe.length;as++){var jt=fe[as],ft=su(jt.name);if(ft==null||Array.isArray(ft)&&ft.length===0||typeof ft=="object"&&Object.keys(ft).length===0){_n++;continue}if(as===_n?ct+=N:ct+=P||",",Array.isArray(ft)){L&&(ct+=jt.name+"=");for(var ti=0;ti<ft.length;ti++)ti>0&&(ct+=jt.suffices["*"]&&P||",",jt.suffices["*"]&&L&&(ct+=jt.name+"=")),ct+=D?encodeURIComponent(ft[ti]).replace(/!/g,"%21"):r(ft[ti])}else if(typeof ft=="object"){L&&!jt.suffices["*"]&&(ct+=jt.name+"=");var rr=!0;for(var Qr in ft)rr||(ct+=jt.suffices["*"]&&P||","),rr=!1,ct+=D?encodeURIComponent(Qr).replace(/!/g,"%21"):r(Qr),ct+=jt.suffices["*"]?"=":",",ct+=D?encodeURIComponent(ft[Qr]).replace(/!/g,"%21"):r(ft[Qr])}else L&&(ct+=jt.name,(!z||ft!=="")&&(ct+="=")),jt.truncate!=null&&(ft=ft.substring(0,jt.truncate)),ct+=D?encodeURIComponent(ft).replace(/!/g,"%21"):r(ft)}return ct};return ei.varNames=Z,{prefix:N,substitution:ei}}function i(k){if(!(this instanceof i))return new i(k);for(var E=k.split("{"),P=[E.shift()],N=[],D=[],L=[];E.length>0;){var z=E.shift(),Z=z.split("}")[0],ie=z.substring(Z.length+1),fe=n(Z);D.push(fe.substitution),N.push(fe.prefix),P.push(ie),L=L.concat(fe.substitution.varNames)}this.fill=function(bt){for(var we=P[0],he=0;he<D.length;he++){var Ze=D[he];we+=Ze(bt),we+=P[he+1]}return we},this.varNames=L,this.template=k}i.prototype={toString:function(){return this.template},fillFromObject:function(k){return this.fill(function(E){return k[E]})}};var s=function(E,P,N,D,L){if(this.missing=[],this.missingMap={},this.formatValidators=E?Object.create(E.formatValidators):{},this.schemas=E?Object.create(E.schemas):{},this.collectMultiple=P,this.errors=[],this.handleError=P?this.collectError:this.returnError,D&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),L&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=N||_("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},E)for(var z in E.definedKeywords)this.definedKeywords[z]=E.definedKeywords[z].slice(0)};s.prototype.defineKeyword=function(k,E){this.definedKeywords[k]=this.definedKeywords[k]||[],this.definedKeywords[k].push(E)},s.prototype.createError=function(k,E,P,N,D,L,z){var Z=new j(k,E,P,N,D);return Z.message=this.errorReporter(Z,L,z),Z},s.prototype.returnError=function(k){return k},s.prototype.collectError=function(k){return k&&this.errors.push(k),null},s.prototype.prefixErrors=function(k,E,P){for(var N=k;N<this.errors.length;N++)this.errors[N]=this.errors[N].prefixWith(E,P);return this},s.prototype.banUnknownProperties=function(k,E){for(var P in this.unknownPropertyPaths){var N=this.createError(C.UNKNOWN_PROPERTY,{path:P},P,"",null,k,E),D=this.handleError(N);if(D)return D}return null},s.prototype.addFormat=function(k,E){if(typeof k=="object"){for(var P in k)this.addFormat(P,k[P]);return this}this.formatValidators[k]=E},s.prototype.resolveRefs=function(k,E){if(k.$ref!==void 0){if(E=E||{},E[k.$ref])return this.createError(C.CIRCULAR_REFERENCE,{urls:Object.keys(E).join(", ")},"","",null,void 0,k);E[k.$ref]=!0,k=this.getSchema(k.$ref,E)}return k},s.prototype.getSchema=function(k,E){var P;if(this.schemas[k]!==void 0)return P=this.schemas[k],this.resolveRefs(P,E);var N=k,D="";if(k.indexOf("#")!==-1&&(D=k.substring(k.indexOf("#")+1),N=k.substring(0,k.indexOf("#"))),typeof this.schemas[N]=="object"){P=this.schemas[N];var L=decodeURIComponent(D);if(L==="")return this.resolveRefs(P,E);if(L.charAt(0)!=="/")return;for(var z=L.split("/").slice(1),Z=0;Z<z.length;Z++){var ie=z[Z].replace(/~1/g,"/").replace(/~0/g,"~");if(P[ie]===void 0){P=void 0;break}P=P[ie]}if(P!==void 0)return this.resolveRefs(P,E)}this.missing[N]===void 0&&(this.missing.push(N),this.missing[N]=N,this.missingMap[N]=N)},s.prototype.searchSchemas=function(k,E){if(Array.isArray(k))for(var P=0;P<k.length;P++)this.searchSchemas(k[P],E);else if(k&&typeof k=="object"){typeof k.id=="string"&&Y(E,k.id)&&this.schemas[k.id]===void 0&&(this.schemas[k.id]=k);for(var N in k)if(N!=="enum"){if(typeof k[N]=="object")this.searchSchemas(k[N],E);else if(N==="$ref"){var D=m(k[N]);D&&this.schemas[D]===void 0&&this.missingMap[D]===void 0&&(this.missingMap[D]=D)}}}},s.prototype.addSchema=function(k,E){if(typeof k!="string"||typeof E>"u")if(typeof k=="object"&&typeof k.id=="string")E=k,k=E.id;else return;k===m(k)+"#"&&(k=m(k)),this.schemas[k]=E,delete this.missingMap[k],S(E,k),this.searchSchemas(E,k)},s.prototype.getSchemaMap=function(){var k={};for(var E in this.schemas)k[E]=this.schemas[E];return k},s.prototype.getSchemaUris=function(k){var E=[];for(var P in this.schemas)(!k||k.test(P))&&E.push(P);return E},s.prototype.getMissingUris=function(k){var E=[];for(var P in this.missingMap)(!k||k.test(P))&&E.push(P);return E},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(k,E,P,N,D){var L;if(E=this.resolveRefs(E),E){if(E instanceof j)return this.errors.push(E),E}else return null;var z=this.errors.length,Z,ie=null,fe=null;if(this.checkRecursive&&k&&typeof k=="object"){if(L=!this.scanned.length,k[this.validatedSchemasKey]){var bt=k[this.validatedSchemasKey].indexOf(E);if(bt!==-1)return this.errors=this.errors.concat(k[this.validationErrorsKey][bt]),null}if(Object.isFrozen(k)&&(Z=this.scannedFrozen.indexOf(k),Z!==-1)){var we=this.scannedFrozenSchemas[Z].indexOf(E);if(we!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[Z][we]),null}if(this.scanned.push(k),Object.isFrozen(k))Z===-1&&(Z=this.scannedFrozen.length,this.scannedFrozen.push(k),this.scannedFrozenSchemas.push([])),ie=this.scannedFrozenSchemas[Z].length,this.scannedFrozenSchemas[Z][ie]=E,this.scannedFrozenValidationErrors[Z][ie]=[];else{if(!k[this.validatedSchemasKey])try{Object.defineProperty(k,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(k,this.validationErrorsKey,{value:[],configurable:!0})}catch{k[this.validatedSchemasKey]=[],k[this.validationErrorsKey]=[]}fe=k[this.validatedSchemasKey].length,k[this.validatedSchemasKey][fe]=E,k[this.validationErrorsKey][fe]=[]}}var he=this.errors.length,Ze=this.validateBasic(k,E,D)||this.validateNumeric(k,E,D)||this.validateString(k,E,D)||this.validateArray(k,E,D)||this.validateObject(k,E,D)||this.validateCombinations(k,E,D)||this.validateHypermedia(k,E,D)||this.validateFormat(k,E,D)||this.validateDefinedKeywords(k,E,D)||null;if(L){for(;this.scanned.length;){var _t=this.scanned.pop();delete _t[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Ze||he!==this.errors.length)for(;P&&P.length||N&&N.length;){var Mt=P&&P.length?""+P.pop():null,le=N&&N.length?""+N.pop():null;Ze&&(Ze=Ze.prefixWith(Mt,le)),this.prefixErrors(he,Mt,le)}return ie!==null?this.scannedFrozenValidationErrors[Z][ie]=this.errors.slice(z):fe!==null&&(k[this.validationErrorsKey][fe]=this.errors.slice(z)),this.handleError(Ze)},s.prototype.validateFormat=function(k,E){if(typeof E.format!="string"||!this.formatValidators[E.format])return null;var P=this.formatValidators[E.format].call(null,k,E);return typeof P=="string"||typeof P=="number"?this.createError(C.FORMAT_CUSTOM,{message:P},"","/format",null,k,E):P&&typeof P=="object"?this.createError(C.FORMAT_CUSTOM,{message:P.message||"?"},P.dataPath||"",P.schemaPath||"/format",null,k,E):null},s.prototype.validateDefinedKeywords=function(k,E,P){for(var N in this.definedKeywords)if(!(typeof E[N]>"u"))for(var D=this.definedKeywords[N],L=0;L<D.length;L++){var z=D[L],Z=z(k,E[N],E,P);if(typeof Z=="string"||typeof Z=="number")return this.createError(C.KEYWORD_CUSTOM,{key:N,message:Z},"","",null,k,E).prefixWith(null,N);if(Z&&typeof Z=="object"){var ie=Z.code;if(typeof ie=="string"){if(!C[ie])throw new Error("Undefined error code (use defineError): "+ie);ie=C[ie]}else typeof ie!="number"&&(ie=C.KEYWORD_CUSTOM);var fe=typeof Z.message=="object"?Z.message:{key:N,message:Z.message||"?"},bt=Z.schemaPath||"/"+N.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ie,fe,Z.dataPath||null,bt,null,k,E)}}return null};function a(k,E){if(k===E)return!0;if(k&&E&&typeof k=="object"&&typeof E=="object"){if(Array.isArray(k)!==Array.isArray(E))return!1;if(Array.isArray(k)){if(k.length!==E.length)return!1;for(var P=0;P<k.length;P++)if(!a(k[P],E[P]))return!1}else{var N;for(N in k)if(E[N]===void 0&&k[N]!==void 0)return!1;for(N in E)if(k[N]===void 0&&E[N]!==void 0)return!1;for(N in k)if(!a(k[N],E[N]))return!1}return!0}return!1}s.prototype.validateBasic=function(E,P,N){var D;return(D=this.validateType(E,P,N))||(D=this.validateEnum(E,P,N))?D.prefixWith(null,"type"):null},s.prototype.validateType=function(E,P){if(P.type===void 0)return null;var N=typeof E;E===null?N="null":Array.isArray(E)&&(N="array");var D=P.type;Array.isArray(D)||(D=[D]);for(var L=0;L<D.length;L++){var z=D[L];if(z===N||z==="integer"&&N==="number"&&E%1===0)return null}return this.createError(C.INVALID_TYPE,{type:N,expected:D.join("/")},"","",null,E,P)},s.prototype.validateEnum=function(E,P){if(P.enum===void 0)return null;for(var N=0;N<P.enum.length;N++){var D=P.enum[N];if(a(E,D))return null}return this.createError(C.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(E):E},"","",null,E,P)},s.prototype.validateNumeric=function(E,P,N){return this.validateMultipleOf(E,P,N)||this.validateMinMax(E,P,N)||this.validateNaN(E,P,N)||null};var u=Math.pow(2,-51),f=1-u;s.prototype.validateMultipleOf=function(E,P){var N=P.multipleOf||P.divisibleBy;if(N===void 0)return null;if(typeof E=="number"){var D=E/N%1;if(D>=u&&D<f)return this.createError(C.NUMBER_MULTIPLE_OF,{value:E,multipleOf:N},"","",null,E,P)}return null},s.prototype.validateMinMax=function(E,P){if(typeof E!="number")return null;if(P.minimum!==void 0){if(E<P.minimum)return this.createError(C.NUMBER_MINIMUM,{value:E,minimum:P.minimum},"","/minimum",null,E,P);if(P.exclusiveMinimum&&E===P.minimum)return this.createError(C.NUMBER_MINIMUM_EXCLUSIVE,{value:E,minimum:P.minimum},"","/exclusiveMinimum",null,E,P)}if(P.maximum!==void 0){if(E>P.maximum)return this.createError(C.NUMBER_MAXIMUM,{value:E,maximum:P.maximum},"","/maximum",null,E,P);if(P.exclusiveMaximum&&E===P.maximum)return this.createError(C.NUMBER_MAXIMUM_EXCLUSIVE,{value:E,maximum:P.maximum},"","/exclusiveMaximum",null,E,P)}return null},s.prototype.validateNaN=function(E,P){return typeof E!="number"?null:isNaN(E)===!0||E===1/0||E===-1/0?this.createError(C.NUMBER_NOT_A_NUMBER,{value:E},"","/type",null,E,P):null},s.prototype.validateString=function(E,P,N){return this.validateStringLength(E,P,N)||this.validateStringPattern(E,P,N)||null},s.prototype.validateStringLength=function(E,P){return typeof E!="string"?null:P.minLength!==void 0&&E.length<P.minLength?this.createError(C.STRING_LENGTH_SHORT,{length:E.length,minimum:P.minLength},"","/minLength",null,E,P):P.maxLength!==void 0&&E.length>P.maxLength?this.createError(C.STRING_LENGTH_LONG,{length:E.length,maximum:P.maxLength},"","/maxLength",null,E,P):null},s.prototype.validateStringPattern=function(E,P){if(typeof E!="string"||typeof P.pattern!="string"&&!(P.pattern instanceof RegExp))return null;var N;if(P.pattern instanceof RegExp)N=P.pattern;else{var D,L="",z=P.pattern.match(/^\/(.+)\/([img]*)$/);z?(D=z[1],L=z[2]):D=P.pattern,N=new RegExp(D,L)}return N.test(E)?null:this.createError(C.STRING_PATTERN,{pattern:P.pattern},"","/pattern",null,E,P)},s.prototype.validateArray=function(E,P,N){return Array.isArray(E)&&(this.validateArrayLength(E,P,N)||this.validateArrayUniqueItems(E,P,N)||this.validateArrayItems(E,P,N))||null},s.prototype.validateArrayLength=function(E,P){var N;return P.minItems!==void 0&&E.length<P.minItems&&(N=this.createError(C.ARRAY_LENGTH_SHORT,{length:E.length,minimum:P.minItems},"","/minItems",null,E,P),this.handleError(N))||P.maxItems!==void 0&&E.length>P.maxItems&&(N=this.createError(C.ARRAY_LENGTH_LONG,{length:E.length,maximum:P.maxItems},"","/maxItems",null,E,P),this.handleError(N))?N:null},s.prototype.validateArrayUniqueItems=function(E,P){if(P.uniqueItems){for(var N=0;N<E.length;N++)for(var D=N+1;D<E.length;D++)if(a(E[N],E[D])){var L=this.createError(C.ARRAY_UNIQUE,{match1:N,match2:D},"","/uniqueItems",null,E,P);if(this.handleError(L))return L}}return null},s.prototype.validateArrayItems=function(E,P,N){if(P.items===void 0)return null;var D,L;if(Array.isArray(P.items)){for(L=0;L<E.length;L++)if(L<P.items.length){if(D=this.validateAll(E[L],P.items[L],[L],["items",L],N+"/"+L))return D}else if(P.additionalItems!==void 0){if(typeof P.additionalItems=="boolean"){if(!P.additionalItems&&(D=this.createError(C.ARRAY_ADDITIONAL_ITEMS,{},"/"+L,"/additionalItems",null,E,P),this.handleError(D)))return D}else if(D=this.validateAll(E[L],P.additionalItems,[L],["additionalItems"],N+"/"+L))return D}}else for(L=0;L<E.length;L++)if(D=this.validateAll(E[L],P.items,[L],["items"],N+"/"+L))return D;return null},s.prototype.validateObject=function(E,P,N){return typeof E!="object"||E===null||Array.isArray(E)?null:this.validateObjectMinMaxProperties(E,P,N)||this.validateObjectRequiredProperties(E,P,N)||this.validateObjectProperties(E,P,N)||this.validateObjectDependencies(E,P,N)||null},s.prototype.validateObjectMinMaxProperties=function(E,P){var N=Object.keys(E),D;return P.minProperties!==void 0&&N.length<P.minProperties&&(D=this.createError(C.OBJECT_PROPERTIES_MINIMUM,{propertyCount:N.length,minimum:P.minProperties},"","/minProperties",null,E,P),this.handleError(D))||P.maxProperties!==void 0&&N.length>P.maxProperties&&(D=this.createError(C.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:N.length,maximum:P.maxProperties},"","/maxProperties",null,E,P),this.handleError(D))?D:null},s.prototype.validateObjectRequiredProperties=function(E,P){if(P.required!==void 0)for(var N=0;N<P.required.length;N++){var D=P.required[N];if(E[D]===void 0){var L=this.createError(C.OBJECT_REQUIRED,{key:D},"","/required/"+N,null,E,P);if(this.handleError(L))return L}}return null},s.prototype.validateObjectProperties=function(E,P,N){var D;for(var L in E){var z=N+"/"+L.replace(/~/g,"~0").replace(/\//g,"~1"),Z=!1;if(P.properties!==void 0&&P.properties[L]!==void 0&&(Z=!0,D=this.validateAll(E[L],P.properties[L],[L],["properties",L],z)))return D;if(P.patternProperties!==void 0)for(var ie in P.patternProperties){var fe=new RegExp(ie);if(fe.test(L)&&(Z=!0,D=this.validateAll(E[L],P.patternProperties[ie],[L],["patternProperties",ie],z)))return D}if(Z)this.trackUnknownProperties&&(this.knownPropertyPaths[z]=!0,delete this.unknownPropertyPaths[z]);else if(P.additionalProperties!==void 0){if(this.trackUnknownProperties&&(this.knownPropertyPaths[z]=!0,delete this.unknownPropertyPaths[z]),typeof P.additionalProperties=="boolean"){if(!P.additionalProperties&&(D=this.createError(C.OBJECT_ADDITIONAL_PROPERTIES,{key:L},"","/additionalProperties",null,E,P).prefixWith(L,null),this.handleError(D)))return D}else if(D=this.validateAll(E[L],P.additionalProperties,[L],["additionalProperties"],z))return D}else this.trackUnknownProperties&&!this.knownPropertyPaths[z]&&(this.unknownPropertyPaths[z]=!0)}return null},s.prototype.validateObjectDependencies=function(E,P,N){var D;if(P.dependencies!==void 0){for(var L in P.dependencies)if(E[L]!==void 0){var z=P.dependencies[L];if(typeof z=="string"){if(E[z]===void 0&&(D=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:L,missing:z},"","",null,E,P).prefixWith(null,L).prefixWith(null,"dependencies"),this.handleError(D)))return D}else if(Array.isArray(z))for(var Z=0;Z<z.length;Z++){var ie=z[Z];if(E[ie]===void 0&&(D=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:L,missing:ie},"","/"+Z,null,E,P).prefixWith(null,L).prefixWith(null,"dependencies"),this.handleError(D)))return D}else if(D=this.validateAll(E,z,[],["dependencies",L],N))return D}}return null},s.prototype.validateCombinations=function(E,P,N){return this.validateAllOf(E,P,N)||this.validateAnyOf(E,P,N)||this.validateOneOf(E,P,N)||this.validateNot(E,P,N)||null},s.prototype.validateAllOf=function(E,P,N){if(P.allOf===void 0)return null;for(var D,L=0;L<P.allOf.length;L++){var z=P.allOf[L];if(D=this.validateAll(E,z,[],["allOf",L],N))return D}return null},s.prototype.validateAnyOf=function(E,P,N){if(P.anyOf===void 0)return null;var D=[],L=this.errors.length,z,Z;this.trackUnknownProperties&&(z=this.unknownPropertyPaths,Z=this.knownPropertyPaths);for(var ie=!0,fe=0;fe<P.anyOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var bt=P.anyOf[fe],we=this.errors.length,he=this.validateAll(E,bt,[],["anyOf",fe],N);if(he===null&&we===this.errors.length){if(this.errors=this.errors.slice(0,L),this.trackUnknownProperties){for(var Ze in this.knownPropertyPaths)Z[Ze]=!0,delete z[Ze];for(var _t in this.unknownPropertyPaths)Z[_t]||(z[_t]=!0);ie=!1;continue}return null}he&&D.push(he.prefixWith(null,""+fe).prefixWith(null,"anyOf"))}if(this.trackUnknownProperties&&(this.unknownPropertyPaths=z,this.knownPropertyPaths=Z),ie)return D=D.concat(this.errors.slice(L)),this.errors=this.errors.slice(0,L),this.createError(C.ANY_OF_MISSING,{},"","/anyOf",D,E,P)},s.prototype.validateOneOf=function(E,P,N){if(P.oneOf===void 0)return null;var D=null,L=[],z=this.errors.length,Z,ie;this.trackUnknownProperties&&(Z=this.unknownPropertyPaths,ie=this.knownPropertyPaths);for(var fe=0;fe<P.oneOf.length;fe++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var bt=P.oneOf[fe],we=this.errors.length,he=this.validateAll(E,bt,[],["oneOf",fe],N);if(he===null&&we===this.errors.length){if(D===null)D=fe;else return this.errors=this.errors.slice(0,z),this.createError(C.ONE_OF_MULTIPLE,{index1:D,index2:fe},"","/oneOf",null,E,P);if(this.trackUnknownProperties){for(var Ze in this.knownPropertyPaths)ie[Ze]=!0,delete Z[Ze];for(var _t in this.unknownPropertyPaths)ie[_t]||(Z[_t]=!0)}}else he&&L.push(he)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=Z,this.knownPropertyPaths=ie),D===null?(L=L.concat(this.errors.slice(z)),this.errors=this.errors.slice(0,z),this.createError(C.ONE_OF_MISSING,{},"","/oneOf",L,E,P)):(this.errors=this.errors.slice(0,z),null)},s.prototype.validateNot=function(E,P,N){if(P.not===void 0)return null;var D=this.errors.length,L,z;this.trackUnknownProperties&&(L=this.unknownPropertyPaths,z=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var Z=this.validateAll(E,P.not,null,null,N),ie=this.errors.slice(D);return this.errors=this.errors.slice(0,D),this.trackUnknownProperties&&(this.unknownPropertyPaths=L,this.knownPropertyPaths=z),Z===null&&ie.length===0?this.createError(C.NOT_PASSED,{},"","/not",null,E,P):null},s.prototype.validateHypermedia=function(E,P,N){if(!P.links)return null;for(var D,L=0;L<P.links.length;L++){var z=P.links[L];if(z.rel==="describedby"){for(var Z=new i(z.href),ie=!0,fe=0;fe<Z.varNames.length;fe++)if(!(Z.varNames[fe]in E)){ie=!1;break}if(ie){var bt=Z.fillFromObject(E),we={$ref:bt};if(D=this.validateAll(E,we,[],["links",L],N))return D}}}};function h(k){var E=String(k).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return E?{href:E[0]||"",protocol:E[1]||"",authority:E[2]||"",host:E[3]||"",hostname:E[4]||"",port:E[5]||"",pathname:E[6]||"",search:E[7]||"",hash:E[8]||""}:null}function g(k,E){function P(N){var D=[];return N.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(L){L==="/.."?D.pop():D.push(L)}),D.join("").replace(/^\//,N.charAt(0)==="/"?"/":"")}return E=h(E||""),k=h(k||""),!E||!k?null:(E.protocol||k.protocol)+(E.protocol||E.authority?E.authority:k.authority)+P(E.protocol||E.authority||E.pathname.charAt(0)==="/"?E.pathname:E.pathname?(k.authority&&!k.pathname?"/":"")+k.pathname.slice(0,k.pathname.lastIndexOf("/")+1)+E.pathname:k.pathname)+(E.protocol||E.authority||E.pathname?E.search:E.search||k.search)+E.hash}function m(k){return k.split("#")[0]}function S(k,E){if(k&&typeof k=="object")if(E===void 0?E=k.id:typeof k.id=="string"&&(E=g(E,k.id),k.id=E),Array.isArray(k))for(var P=0;P<k.length;P++)S(k[P],E);else{typeof k.$ref=="string"&&(k.$ref=g(E,k.$ref));for(var N in k)N!=="enum"&&S(k[N],E)}}function _(k){k=k||"en";var E=V[k];return function(P){var N=E[P.code]||T[P.code];if(typeof N!="string")return"Unknown error code "+P.code+": "+JSON.stringify(P.messageParams);var D=P.params;return N.replace(/\{([^{}]*)\}/g,function(L,z){var Z=D[z];return typeof Z=="string"||typeof Z=="number"?Z:L})}}var C={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},x={};for(var A in C)x[C[A]]=A;var T={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function j(k,E,P,N,D){if(Error.call(this),k===void 0)throw new Error("No error code supplied: "+N);this.message="",this.params=E,this.code=k,this.dataPath=P||"",this.schemaPath=N||"",this.subErrors=D||null;var L=new Error(this.message);if(this.stack=L.stack||L.stacktrace,!this.stack)try{throw L}catch(z){this.stack=z.stack||z.stacktrace}}j.prototype=Object.create(Error.prototype),j.prototype.constructor=j,j.prototype.name="ValidationError",j.prototype.prefixWith=function(k,E){if(k!==null&&(k=k.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+k+this.dataPath),E!==null&&(E=E.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+E+this.schemaPath),this.subErrors!==null)for(var P=0;P<this.subErrors.length;P++)this.subErrors[P].prefixWith(k,E);return this};function Y(k,E){if(E.substring(0,k.length)===k){var P=E.substring(k.length);if(E.length>0&&E.charAt(k.length-1)==="/"||P.charAt(0)==="#"||P.charAt(0)==="?")return!0}return!1}var V={};function K(k){var E=new s,P,N,D={setErrorReporter:function(L){return typeof L=="string"?this.language(L):(N=L,!0)},addFormat:function(){E.addFormat.apply(E,arguments)},language:function(L){return L?(V[L]||(L=L.split("-")[0]),V[L]?(P=L,L):!1):P},addLanguage:function(L,z){var Z;for(Z in C)z[Z]&&!z[C[Z]]&&(z[C[Z]]=z[Z]);var ie=L.split("-")[0];if(!V[ie])V[L]=z,V[ie]=z;else{V[L]=Object.create(V[ie]);for(Z in z)typeof V[ie][Z]>"u"&&(V[ie][Z]=z[Z]),V[L][Z]=z[Z]}return this},freshApi:function(L){var z=K();return L&&z.language(L),z},validate:function(L,z,Z,ie){var fe=_(P),bt=N?function(Ze,_t,Mt){return N(Ze,_t,Mt)||fe(Ze,_t,Mt)}:fe,we=new s(E,!1,bt,Z,ie);typeof z=="string"&&(z={$ref:z}),we.addSchema("",z);var he=we.validateAll(L,z,null,null,"");return!he&&ie&&(he=we.banUnknownProperties(L,z)),this.error=he,this.missing=we.missing,this.valid=he===null,this.valid},validateResult:function(){var L={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(L,arguments),L},validateMultiple:function(L,z,Z,ie){var fe=_(P),bt=N?function(Ze,_t,Mt){return N(Ze,_t,Mt)||fe(Ze,_t,Mt)}:fe,we=new s(E,!0,bt,Z,ie);typeof z=="string"&&(z={$ref:z}),we.addSchema("",z),we.validateAll(L,z,null,null,""),ie&&we.banUnknownProperties(L,z);var he={toString:function(){return this.valid?"valid":this.error.message}};return he.errors=we.errors,he.missing=we.missing,he.valid=he.errors.length===0,he},addSchema:function(){return E.addSchema.apply(E,arguments)},getSchema:function(){return E.getSchema.apply(E,arguments)},getSchemaMap:function(){return E.getSchemaMap.apply(E,arguments)},getSchemaUris:function(){return E.getSchemaUris.apply(E,arguments)},getMissingUris:function(){return E.getMissingUris.apply(E,arguments)},dropSchemas:function(){E.dropSchemas.apply(E,arguments)},defineKeyword:function(){E.defineKeyword.apply(E,arguments)},defineError:function(L,z,Z){if(typeof L!="string"||!/^[A-Z]+(_[A-Z]+)*$/.test(L))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if(typeof z!="number"||z%1!==0||z<1e4)throw new Error("Code number must be an integer > 10000");if(typeof C[L]<"u")throw new Error("Error already defined: "+L+" as "+C[L]);if(typeof x[z]<"u")throw new Error("Error code already used: "+x[z]+" as "+z);C[L]=z,x[z]=L,T[L]=T[z]=Z;for(var ie in V){var fe=V[ie];fe[L]&&(fe[z]=fe[z]||fe[L])}},reset:function(){E.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:S,resolveUrl:g,getDocumentUri:m,errorCodes:C};return D.language(k||"en"),D}var ee=K();return ee.addLanguage("en-gb",T),ee.tv4=ee,ee})});var Qu=F(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.regexpCode=Ye.getEsmExportName=Ye.getProperty=Ye.safeStringify=Ye.stringify=Ye.strConcat=Ye.addCodeArg=Ye.str=Ye._=Ye.nil=Ye._Code=Ye.Name=Ye.IDENTIFIER=Ye._CodeOrName=void 0;var Ku=class{};Ye._CodeOrName=Ku;Ye.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Fo=class extends Ku{constructor(e){if(super(),!Ye.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Ye.Name=Fo;var fn=class extends Ku{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Fo&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Ye._Code=fn;Ye.nil=new fn("");function rC(t,...e){let r=[t[0]],n=0;for(;n<e.length;)gv(r,e[n]),r.push(t[++n]);return new fn(r)}Ye._=rC;var mv=new fn("+");function nC(t,...e){let r=[Gu(t[0])],n=0;for(;n<e.length;)r.push(mv),gv(r,e[n]),r.push(mv,Gu(t[++n]));return eD(r),new fn(r)}Ye.str=nC;function gv(t,e){e instanceof fn?t.push(...e._items):e instanceof Fo?t.push(e):t.push(nD(e))}Ye.addCodeArg=gv;function eD(t){let e=1;for(;e<t.length-1;){if(t[e]===mv){let r=tD(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function tD(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Fo||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Fo))return`"${t}${e.slice(1)}`}function rD(t,e){return e.emptyStr()?t:t.emptyStr()?e:nC`${t}${e}`}Ye.strConcat=rD;function nD(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Gu(Array.isArray(t)?t.join(","):t)}function iD(t){return new fn(Gu(t))}Ye.stringify=iD;function Gu(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Ye.safeStringify=Gu;function sD(t){return typeof t=="string"&&Ye.IDENTIFIER.test(t)?new fn(`.${t}`):rC`[${t}]`}Ye.getProperty=sD;function oD(t){if(typeof t=="string"&&Ye.IDENTIFIER.test(t))return new fn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Ye.getEsmExportName=oD;function aD(t){return new fn(t.toString())}Ye.regexpCode=aD});var Sv=F(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.ValueScope=kr.ValueScopeName=kr.Scope=kr.varKinds=kr.UsedValueState=void 0;var Pr=Qu(),yv=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},_h;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(_h||(kr.UsedValueState=_h={}));kr.varKinds={const:new Pr.Name("const"),let:new Pr.Name("let"),var:new Pr.Name("var")};var wh=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Pr.Name?e:this.name(e)}name(e){return new Pr.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};kr.Scope=wh;var Eh=class extends Pr.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Pr._)`.${new Pr.Name(r)}[${n}]`}};kr.ValueScopeName=Eh;var lD=(0,Pr._)`\n`,vv=class extends wh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?lD:Pr.nil}}get(){return this._scope}name(e){return new Eh(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,a=(n=r.key)!==null&&n!==void 0?n:r.ref,u=this._values[s];if(u){let g=u.get(a);if(g)return g}else u=this._values[s]=new Map;u.set(a,i);let f=this._scope[s]||(this._scope[s]=[]),h=f.length;return f[h]=r.ref,i.setValue(r,{property:s,itemIndex:h}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Pr._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let s=Pr.nil;for(let a in e){let u=e[a];if(!u)continue;let f=n[a]=n[a]||new Map;u.forEach(h=>{if(f.has(h))return;f.set(h,_h.Started);let g=r(h);if(g){let m=this.opts.es5?kr.varKinds.var:kr.varKinds.const;s=(0,Pr._)`${s}${m} ${h} = ${g};${this.opts._n}`}else if(g=i?.(h))s=(0,Pr._)`${s}${g}${this.opts._n}`;else throw new yv(h);f.set(h,_h.Completed)})}return s}};kr.ValueScope=vv});var Me=F(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.or=qe.and=qe.not=qe.CodeGen=qe.operators=qe.varKinds=qe.ValueScopeName=qe.ValueScope=qe.Scope=qe.Name=qe.regexpCode=qe.stringify=qe.getProperty=qe.nil=qe.strConcat=qe.str=qe._=void 0;var Ue=Qu(),Ln=Sv(),Ds=Qu();Object.defineProperty(qe,"_",{enumerable:!0,get:function(){return Ds._}});Object.defineProperty(qe,"str",{enumerable:!0,get:function(){return Ds.str}});Object.defineProperty(qe,"strConcat",{enumerable:!0,get:function(){return Ds.strConcat}});Object.defineProperty(qe,"nil",{enumerable:!0,get:function(){return Ds.nil}});Object.defineProperty(qe,"getProperty",{enumerable:!0,get:function(){return Ds.getProperty}});Object.defineProperty(qe,"stringify",{enumerable:!0,get:function(){return Ds.stringify}});Object.defineProperty(qe,"regexpCode",{enumerable:!0,get:function(){return Ds.regexpCode}});Object.defineProperty(qe,"Name",{enumerable:!0,get:function(){return Ds.Name}});var Ih=Sv();Object.defineProperty(qe,"Scope",{enumerable:!0,get:function(){return Ih.Scope}});Object.defineProperty(qe,"ValueScope",{enumerable:!0,get:function(){return Ih.ValueScope}});Object.defineProperty(qe,"ValueScopeName",{enumerable:!0,get:function(){return Ih.ValueScopeName}});Object.defineProperty(qe,"varKinds",{enumerable:!0,get:function(){return Ih.varKinds}});qe.operators={GT:new Ue._Code(">"),GTE:new Ue._Code(">="),LT:new Ue._Code("<"),LTE:new Ue._Code("<="),EQ:new Ue._Code("==="),NEQ:new Ue._Code("!=="),NOT:new Ue._Code("!"),OR:new Ue._Code("||"),AND:new Ue._Code("&&"),ADD:new Ue._Code("+")};var Ji=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},bv=class extends Ji{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Ln.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=nl(this.rhs,e,r)),this}get names(){return this.rhs instanceof Ue._CodeOrName?this.rhs.names:{}}},Ch=class extends Ji{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof Ue.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=nl(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Ue.Name?{}:{...this.lhs.names};return Rh(e,this.rhs)}},_v=class extends Ch{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},wv=class extends Ji{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Ev=class extends Ji{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Cv=class extends Ji{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},xv=class extends Ji{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=nl(this.code,e,r),this}get names(){return this.code instanceof Ue._CodeOrName?this.code.names:{}}},Zu=class extends Ji{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,r)||(uD(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Uo(e,r.names),{})}},zi=class extends Zu{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Rv=class extends Zu{},rl=class extends zi{};rl.kind="else";var Lo=class t extends zi{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new rl(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(iC(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=nl(this.condition,e,r),this}get names(){let e=super.names;return Rh(e,this.condition),this.else&&Uo(e,this.else.names),e}};Lo.kind="if";var jo=class extends zi{};jo.kind="for";var Iv=class extends jo{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=nl(this.iteration,e,r),this}get names(){return Uo(super.names,this.iteration.names)}},Ov=class extends jo{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Ln.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${r} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Rh(super.names,this.from);return Rh(e,this.to)}},xh=class extends jo{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=nl(this.iterable,e,r),this}get names(){return Uo(super.names,this.iterable.names)}},Xu=class extends zi{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Xu.kind="func";var ec=class extends Zu{render(e){return"return "+super.render(e)}};ec.kind="return";var Pv=class extends zi{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Uo(e,this.catch.names),this.finally&&Uo(e,this.finally.names),e}},tc=class extends zi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};tc.kind="catch";var rc=class extends zi{render(e){return"finally"+super.render(e)}};rc.kind="finally";var kv=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
24
|
`:""},this._extScope=e,this._scope=new Ln.Scope({parent:e}),this._nodes=[new Rv]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let s=this._scope.toName(r);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new bv(e,s,n)),s}const(e,r,n){return this._def(Ln.varKinds.const,e,r,n)}let(e,r,n){return this._def(Ln.varKinds.let,e,r,n)}var(e,r,n){return this._def(Ln.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Ch(e,r,n))}add(e,r){return this._leafNode(new _v(e,qe.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Ue.nil&&this._leafNode(new xv(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,Ue.addCodeArg)(r,i));return r.push("}"),new Ue._Code(r)}if(e,r,n){if(this._blockNode(new Lo(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Lo(e))}else(){return this._elseNode(new rl)}endIf(){return this._endBlockNode(Lo,rl)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Iv(e),r)}forRange(e,r,n,i,s=this.opts.es5?Ln.varKinds.var:Ln.varKinds.let){let a=this._scope.toName(e);return this._for(new Ov(s,a,r,n),()=>i(a))}forOf(e,r,n,i=Ln.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let a=r instanceof Ue.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Ue._)`${a}.length`,u=>{this.var(s,(0,Ue._)`${a}[${u}]`),n(s)})}return this._for(new xh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Ln.varKinds.var:Ln.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ue._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new xh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(jo)}label(e){return this._leafNode(new wv(e))}break(e){return this._leafNode(new Ev(e))}return(e){let r=new ec;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(ec)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Pv;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new tc(s),r(s)}return n&&(this._currNode=i.finally=new rc,this.code(n)),this._endBlockNode(tc,rc)}throw(e){return this._leafNode(new Cv(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=Ue.nil,n,i){return this._blockNode(new Xu(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(Xu)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Lo))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};qe.CodeGen=kv;function Uo(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Rh(t,e){return e instanceof Ue._CodeOrName?Uo(t,e.names):t}function nl(t,e,r){if(t instanceof Ue.Name)return n(t);if(!i(t))return t;return new Ue._Code(t._items.reduce((s,a)=>(a instanceof Ue.Name&&(a=n(a)),a instanceof Ue._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=r[s.str];return a===void 0||e[s.str]!==1?s:(delete e[s.str],a)}function i(s){return s instanceof Ue._Code&&s._items.some(a=>a instanceof Ue.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function uD(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function iC(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ue._)`!${Av(t)}`}qe.not=iC;var cD=sC(qe.operators.AND);function fD(...t){return t.reduce(cD)}qe.and=fD;var dD=sC(qe.operators.OR);function hD(...t){return t.reduce(dD)}qe.or=hD;function sC(t){return(e,r)=>e===Ue.nil?r:r===Ue.nil?e:(0,Ue._)`${Av(e)} ${t} ${Av(r)}`}function Av(t){return t instanceof Ue.Name?t:(0,Ue._)`(${t})`}});var Je=F(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.checkStrictMode=Ne.getErrorPath=Ne.Type=Ne.useFunc=Ne.setEvaluated=Ne.evaluatedPropsToName=Ne.mergeEvaluated=Ne.eachItem=Ne.unescapeJsonPointer=Ne.escapeJsonPointer=Ne.escapeFragment=Ne.unescapeFragment=Ne.schemaRefOrVal=Ne.schemaHasRulesButRef=Ne.schemaHasRules=Ne.checkUnknownRules=Ne.alwaysValidSchema=Ne.toHash=void 0;var ut=Me(),pD=Qu();function mD(t){let e={};for(let r of t)e[r]=!0;return e}Ne.toHash=mD;function gD(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(lC(t,e),!uC(e,t.self.RULES.all))}Ne.alwaysValidSchema=gD;function lC(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||dC(t,`unknown keyword: "${s}"`)}Ne.checkUnknownRules=lC;function uC(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}Ne.schemaHasRules=uC;function yD(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}Ne.schemaHasRulesButRef=yD;function vD({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ut._)`${r}`}return(0,ut._)`${t}${e}${(0,ut.getProperty)(n)}`}Ne.schemaRefOrVal=vD;function SD(t){return cC(decodeURIComponent(t))}Ne.unescapeFragment=SD;function bD(t){return encodeURIComponent(qv(t))}Ne.escapeFragment=bD;function qv(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}Ne.escapeJsonPointer=qv;function cC(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Ne.unescapeJsonPointer=cC;function _D(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}Ne.eachItem=_D;function oC({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,a,u)=>{let f=a===void 0?s:a instanceof ut.Name?(s instanceof ut.Name?t(i,s,a):e(i,s,a),a):s instanceof ut.Name?(e(i,a,s),s):r(s,a);return u===ut.Name&&!(f instanceof ut.Name)?n(i,f):f}}Ne.mergeEvaluated={props:oC({mergeNames:(t,e,r)=>t.if((0,ut._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ut._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ut._)`${r} || {}`).code((0,ut._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ut._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ut._)`${r} || {}`),$v(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:fC}),items:oC({mergeNames:(t,e,r)=>t.if((0,ut._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ut._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ut._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ut._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function fC(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ut._)`{}`);return e!==void 0&&$v(t,r,e),r}Ne.evaluatedPropsToName=fC;function $v(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ut._)`${e}${(0,ut.getProperty)(n)}`,!0))}Ne.setEvaluated=$v;var aC={};function wD(t,e){return t.scopeValue("func",{ref:e,code:aC[e.code]||(aC[e.code]=new pD._Code(e.code))})}Ne.useFunc=wD;var Tv;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Tv||(Ne.Type=Tv={}));function ED(t,e,r){if(t instanceof ut.Name){let n=e===Tv.Num;return r?n?(0,ut._)`"[" + ${t} + "]"`:(0,ut._)`"['" + ${t} + "']"`:n?(0,ut._)`"/" + ${t}`:(0,ut._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ut.getProperty)(t).toString():"/"+qv(t)}Ne.getErrorPath=ED;function dC(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}Ne.checkStrictMode=dC});var Ki=F(Mv=>{"use strict";Object.defineProperty(Mv,"__esModule",{value:!0});var sr=Me(),CD={data:new sr.Name("data"),valCxt:new sr.Name("valCxt"),instancePath:new sr.Name("instancePath"),parentData:new sr.Name("parentData"),parentDataProperty:new sr.Name("parentDataProperty"),rootData:new sr.Name("rootData"),dynamicAnchors:new sr.Name("dynamicAnchors"),vErrors:new sr.Name("vErrors"),errors:new sr.Name("errors"),this:new sr.Name("this"),self:new sr.Name("self"),scope:new sr.Name("scope"),json:new sr.Name("json"),jsonPos:new sr.Name("jsonPos"),jsonLen:new sr.Name("jsonLen"),jsonPart:new sr.Name("jsonPart")};Mv.default=CD});var nc=F(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.extendErrors=or.resetErrorsCount=or.reportExtraError=or.reportError=or.keyword$DataError=or.keywordError=void 0;var He=Me(),Oh=Je(),vr=Ki();or.keywordError={message:({keyword:t})=>(0,He.str)`must pass "${t}" keyword validation`};or.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,He.str)`"${t}" keyword must be ${e} ($data)`:(0,He.str)`"${t}" keyword is invalid ($data)`};function xD(t,e=or.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:a,allErrors:u}=i,f=mC(t,e,r);n??(a||u)?hC(s,f):pC(i,(0,He._)`[${f}]`)}or.reportError=xD;function RD(t,e=or.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:a}=n,u=mC(t,e,r);hC(i,u),s||a||pC(n,vr.default.vErrors)}or.reportExtraError=RD;function ID(t,e){t.assign(vr.default.errors,e),t.if((0,He._)`${vr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,He._)`${vr.default.vErrors}.length`,e),()=>t.assign(vr.default.vErrors,null)))}or.resetErrorsCount=ID;function OD({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=t.name("err");t.forRange("i",i,vr.default.errors,u=>{t.const(a,(0,He._)`${vr.default.vErrors}[${u}]`),t.if((0,He._)`${a}.instancePath === undefined`,()=>t.assign((0,He._)`${a}.instancePath`,(0,He.strConcat)(vr.default.instancePath,s.errorPath))),t.assign((0,He._)`${a}.schemaPath`,(0,He.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,He._)`${a}.schema`,r),t.assign((0,He._)`${a}.data`,n))})}or.extendErrors=OD;function hC(t,e){let r=t.const("err",e);t.if((0,He._)`${vr.default.vErrors} === null`,()=>t.assign(vr.default.vErrors,(0,He._)`[${r}]`),(0,He._)`${vr.default.vErrors}.push(${r})`),t.code((0,He._)`${vr.default.errors}++`)}function pC(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,He._)`new ${t.ValidationError}(${e})`):(r.assign((0,He._)`${n}.errors`,e),r.return(!1))}var Bo={keyword:new He.Name("keyword"),schemaPath:new He.Name("schemaPath"),params:new He.Name("params"),propertyName:new He.Name("propertyName"),message:new He.Name("message"),schema:new He.Name("schema"),parentSchema:new He.Name("parentSchema")};function mC(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,He._)`{}`:PD(t,e,r)}function PD(t,e,r={}){let{gen:n,it:i}=t,s=[kD(i,r),AD(t,r)];return TD(t,e,s),n.object(...s)}function kD({errorPath:t},{instancePath:e}){let r=e?(0,He.str)`${t}${(0,Oh.getErrorPath)(e,Oh.Type.Str)}`:t;return[vr.default.instancePath,(0,He.strConcat)(vr.default.instancePath,r)]}function AD({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,He.str)`${e}/${t}`;return r&&(i=(0,He.str)`${i}${(0,Oh.getErrorPath)(r,Oh.Type.Str)}`),[Bo.schemaPath,i]}function TD(t,{params:e,message:r},n){let{keyword:i,data:s,schemaValue:a,it:u}=t,{opts:f,propertyName:h,topSchemaRef:g,schemaPath:m}=u;n.push([Bo.keyword,i],[Bo.params,typeof e=="function"?e(t):e||(0,He._)`{}`]),f.messages&&n.push([Bo.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([Bo.schema,a],[Bo.parentSchema,(0,He._)`${g}${m}`],[vr.default.data,s]),h&&n.push([Bo.propertyName,h])}});var yC=F(il=>{"use strict";Object.defineProperty(il,"__esModule",{value:!0});il.boolOrEmptySchema=il.topBoolOrEmptySchema=void 0;var qD=nc(),$D=Me(),MD=Ki(),ND={message:"boolean schema is false"};function DD(t){let{gen:e,schema:r,validateName:n}=t;r===!1?gC(t,!1):typeof r=="object"&&r.$async===!0?e.return(MD.default.data):(e.assign((0,$D._)`${n}.errors`,null),e.return(!0))}il.topBoolOrEmptySchema=DD;function FD(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),gC(t)):r.var(e,!0)}il.boolOrEmptySchema=FD;function gC(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,qD.reportError)(i,ND,void 0,e)}});var Nv=F(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.getRules=sl.isJSONType=void 0;var LD=["string","number","integer","boolean","null","object","array"],jD=new Set(LD);function UD(t){return typeof t=="string"&&jD.has(t)}sl.isJSONType=UD;function BD(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}sl.getRules=BD});var Dv=F(Fs=>{"use strict";Object.defineProperty(Fs,"__esModule",{value:!0});Fs.shouldUseRule=Fs.shouldUseGroup=Fs.schemaHasRulesForType=void 0;function HD({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&vC(t,n)}Fs.schemaHasRulesForType=HD;function vC(t,e){return e.rules.some(r=>SC(t,r))}Fs.shouldUseGroup=vC;function SC(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Fs.shouldUseRule=SC});var ic=F(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.reportTypeError=ar.checkDataTypes=ar.checkDataType=ar.coerceAndCheckDataType=ar.getJSONTypes=ar.getSchemaTypes=ar.DataType=void 0;var VD=Nv(),WD=Dv(),YD=nc(),Re=Me(),bC=Je(),ol;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(ol||(ar.DataType=ol={}));function JD(t){let e=_C(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}ar.getSchemaTypes=JD;function _C(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(VD.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}ar.getJSONTypes=_C;function zD(t,e){let{gen:r,data:n,opts:i}=t,s=KD(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,WD.schemaHasRulesForType)(t,e[0]));if(a){let u=Lv(e,n,i.strictNumbers,ol.Wrong);r.if(u,()=>{s.length?GD(t,e,s):jv(t)})}return a}ar.coerceAndCheckDataType=zD;var wC=new Set(["string","number","integer","boolean","null"]);function KD(t,e){return e?t.filter(r=>wC.has(r)||e==="array"&&r==="array"):[]}function GD(t,e,r){let{gen:n,data:i,opts:s}=t,a=n.let("dataType",(0,Re._)`typeof ${i}`),u=n.let("coerced",(0,Re._)`undefined`);s.coerceTypes==="array"&&n.if((0,Re._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Re._)`${i}[0]`).assign(a,(0,Re._)`typeof ${i}`).if(Lv(e,i,s.strictNumbers),()=>n.assign(u,i))),n.if((0,Re._)`${u} !== undefined`);for(let h of r)(wC.has(h)||h==="array"&&s.coerceTypes==="array")&&f(h);n.else(),jv(t),n.endIf(),n.if((0,Re._)`${u} !== undefined`,()=>{n.assign(i,u),QD(t,u)});function f(h){switch(h){case"string":n.elseIf((0,Re._)`${a} == "number" || ${a} == "boolean"`).assign(u,(0,Re._)`"" + ${i}`).elseIf((0,Re._)`${i} === null`).assign(u,(0,Re._)`""`);return;case"number":n.elseIf((0,Re._)`${a} == "boolean" || ${i} === null
|
|
25
25
|
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(u,(0,Re._)`+${i}`);return;case"integer":n.elseIf((0,Re._)`${a} === "boolean" || ${i} === null
|
|
26
26
|
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(u,(0,Re._)`+${i}`);return;case"boolean":n.elseIf((0,Re._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(u,!1).elseIf((0,Re._)`${i} === "true" || ${i} === 1`).assign(u,!0);return;case"null":n.elseIf((0,Re._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(u,null);return;case"array":n.elseIf((0,Re._)`${a} === "string" || ${a} === "number"
|
|
27
|
-
|| ${a} === "boolean" || ${i} === null`).assign(u,(0,Re._)`[${i}]`)}}}function QD({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Re._)`${e} !== undefined`,()=>t.assign((0,Re._)`${e}[${r}]`,n))}function Fv(t,e,r,n=ol.Correct){let i=n===ol.Correct?Re.operators.EQ:Re.operators.NEQ,s;switch(t){case"null":return(0,Re._)`${e} ${i} null`;case"array":s=(0,Re._)`Array.isArray(${e})`;break;case"object":s=(0,Re._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Re._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Re._)`typeof ${e} ${i} ${t}`}return n===ol.Correct?s:(0,Re.not)(s);function a(u=Re.nil){return(0,Re.and)((0,Re._)`typeof ${e} == "number"`,u,r?(0,Re._)`isFinite(${e})`:Re.nil)}}ar.checkDataType=Fv;function Lv(t,e,r,n){if(t.length===1)return Fv(t[0],e,r,n);let i,s=(0,bC.toHash)(t);if(s.array&&s.object){let a=(0,Re._)`typeof ${e} != "object"`;i=s.null?a:(0,Re._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=Re.nil;s.number&&delete s.integer;for(let a in s)i=(0,Re.and)(i,Fv(a,e,r,n));return i}ar.checkDataTypes=Lv;var ZD={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Re._)`{type: ${t}}`:(0,Re._)`{type: ${e}}`};function jv(t){let e=XD(t);(0,YD.reportError)(e,ZD)}ar.reportTypeError=jv;function XD(t){let{gen:e,data:r,schema:n}=t,i=(0,bC.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var CC=F(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.assignDefaults=void 0;var al=Me(),eF=Je();function tF(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)EC(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>EC(t,s,i.default))}Ph.assignDefaults=tF;function EC(t,e,r){let{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;let u=(0,al._)`${s}${(0,al.getProperty)(e)}`;if(i){(0,eF.checkStrictMode)(t,`default is ignored for: ${u}`);return}let f=(0,al._)`${u} === undefined`;a.useDefaults==="empty"&&(f=(0,al._)`${f} || ${u} === null || ${u} === ""`),n.if(f,(0,al._)`${u} = ${(0,al.stringify)(r)}`)}});var dn=F(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.validateUnion=st.validateArray=st.usePattern=st.callValidateCode=st.schemaProperties=st.allSchemaProperties=st.noPropertyInData=st.propertyInData=st.isOwnProperty=st.hasPropFunc=st.reportMissingProp=st.checkMissingProp=st.checkReportMissingProp=void 0;var dt=Me(),Uv=Je(),Ls=Ki(),rF=Je();function nF(t,e){let{gen:r,data:n,it:i}=t;r.if(Hv(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,dt._)`${e}`},!0),t.error()})}st.checkReportMissingProp=nF;function iF({gen:t,data:e,it:{opts:r}},n,i){return(0,dt.or)(...n.map(s=>(0,dt.and)(Hv(t,e,s,r.ownProperties),(0,dt._)`${i} = ${s}`)))}st.checkMissingProp=iF;function sF(t,e){t.setParams({missingProperty:e},!0),t.error()}st.reportMissingProp=sF;function xC(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,dt._)`Object.prototype.hasOwnProperty`})}st.hasPropFunc=xC;function Bv(t,e,r){return(0,dt._)`${xC(t)}.call(${e}, ${r})`}st.isOwnProperty=Bv;function oF(t,e,r,n){let i=(0,dt._)`${e}${(0,dt.getProperty)(r)} !== undefined`;return n?(0,dt._)`${i} && ${Bv(t,e,r)}`:i}st.propertyInData=oF;function Hv(t,e,r,n){let i=(0,dt._)`${e}${(0,dt.getProperty)(r)} === undefined`;return n?(0,dt.or)(i,(0,dt.not)(Bv(t,e,r))):i}st.noPropertyInData=Hv;function RC(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}st.allSchemaProperties=RC;function aF(t,e){return RC(e).filter(r=>!(0,Uv.alwaysValidSchema)(t,e[r]))}st.schemaProperties=aF;function lF({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},u,f,h){let g=h?(0,dt._)`${t}, ${e}, ${n}${i}`:e,m=[[Ls.default.instancePath,(0,dt.strConcat)(Ls.default.instancePath,s)],[Ls.default.parentData,a.parentData],[Ls.default.parentDataProperty,a.parentDataProperty],[Ls.default.rootData,Ls.default.rootData]];a.opts.dynamicRef&&m.push([Ls.default.dynamicAnchors,Ls.default.dynamicAnchors]);let S=(0,dt._)`${g}, ${r.object(...m)}`;return f!==dt.nil?(0,dt._)`${u}.call(${f}, ${S})`:(0,dt._)`${u}(${S})`}st.callValidateCode=lF;var uF=(0,dt._)`new RegExp`;function cF({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,dt._)`${i.code==="new RegExp"?uF:(0,rF.useFunc)(t,i)}(${r}, ${n})`})}st.usePattern=cF;function fF(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let u=e.let("valid",!0);return a(()=>e.assign(u,!1)),u}return e.var(s,!0),a(()=>e.break()),s;function a(u){let f=e.const("len",(0,dt._)`${r}.length`);e.forRange("i",0,f,h=>{t.subschema({keyword:n,dataProp:h,dataPropType:Uv.Type.Num},s),e.if((0,dt.not)(s),u)})}}st.validateArray=fF;function dF(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,Uv.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let a=e.let("valid",!1),u=e.name("_valid");e.block(()=>r.forEach((f,h)=>{let g=t.subschema({keyword:n,schemaProp:h,compositeRule:!0},u);e.assign(a,(0,dt._)`${a} || ${u}`),t.mergeValidEvaluated(g,u)||e.if((0,dt.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}st.validateUnion=dF});var PC=F(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.validateKeywordUsage=gi.validSchemaType=gi.funcKeywordCode=gi.macroKeywordCode=void 0;var Sr=Me(),Ho=Ki(),hF=dn(),pF=nc();function mF(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,u=e.macro.call(a.self,i,s,a),f=OC(r,n,u);a.opts.validateSchema!==!1&&a.self.validateSchema(u,!0);let h=r.name("valid");t.subschema({schema:u,schemaPath:Sr.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},h),t.pass(h,()=>t.error(!0))}gi.macroKeywordCode=mF;function gF(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:u,it:f}=t;vF(f,e);let h=!u&&e.compile?e.compile.call(f.self,s,a,f):e.validate,g=OC(n,i,h),m=n.let("valid");t.block$data(m,S),t.ok((r=e.valid)!==null&&r!==void 0?r:m);function S(){if(e.errors===!1)x(),e.modifying&&IC(t),A(()=>t.error());else{let T=e.async?_():C();e.modifying&&IC(t),A(()=>yF(t,T))}}function _(){let T=n.let("ruleErrs",null);return n.try(()=>x((0,Sr._)`await `),j=>n.assign(m,!1).if((0,Sr._)`${j} instanceof ${f.ValidationError}`,()=>n.assign(T,(0,Sr._)`${j}.errors`),()=>n.throw(j))),T}function C(){let T=(0,Sr._)`${g}.errors`;return n.assign(T,null),x(Sr.nil),T}function x(T=e.async?(0,Sr._)`await `:Sr.nil){let j=f.opts.passContext?Ho.default.this:Ho.default.self,Y=!("compile"in e&&!u||e.schema===!1);n.assign(m,(0,Sr._)`${T}${(0,hF.callValidateCode)(t,g,j,Y)}`,e.modifying)}function A(T){var j;n.if((0,Sr.not)((j=e.valid)!==null&&j!==void 0?j:m),T)}}gi.funcKeywordCode=gF;function IC(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Sr._)`${n.parentData}[${n.parentDataProperty}]`))}function yF(t,e){let{gen:r}=t;r.if((0,Sr._)`Array.isArray(${e})`,()=>{r.assign(Ho.default.vErrors,(0,Sr._)`${Ho.default.vErrors} === null ? ${e} : ${Ho.default.vErrors}.concat(${e})`).assign(Ho.default.errors,(0,Sr._)`${Ho.default.vErrors}.length`),(0,pF.extendErrors)(t)},()=>t.error())}function vF({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function OC(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Sr.stringify)(r)})}function SF(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}gi.validSchemaType=SF;function bF({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a?.some(u=>!Object.prototype.hasOwnProperty.call(t,u)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}gi.validateKeywordUsage=bF});var AC=F(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.extendSubschemaMode=js.extendSubschemaData=js.getSubschema=void 0;var yi=Me(),kC=Je();function _F(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let u=t.schema[e];return r===void 0?{schema:u,schemaPath:(0,yi._)`${t.schemaPath}${(0,yi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:u[r],schemaPath:(0,yi._)`${t.schemaPath}${(0,yi.getProperty)(e)}${(0,yi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,kC.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}js.getSubschema=_F;function wF(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:u}=e;if(r!==void 0){let{errorPath:h,dataPathArr:g,opts:m}=e,S=u.let("data",(0,yi._)`${e.data}${(0,yi.getProperty)(r)}`,!0);f(S),t.errorPath=(0,yi.str)`${h}${(0,kC.getErrorPath)(r,n,m.jsPropertySyntax)}`,t.parentDataProperty=(0,yi._)`${r}`,t.dataPathArr=[...g,t.parentDataProperty]}if(i!==void 0){let h=i instanceof yi.Name?i:u.let("data",i,!0);f(h),a!==void 0&&(t.propertyName=a)}s&&(t.dataTypes=s);function f(h){t.data=h,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,h]}}js.extendSubschemaData=wF;function EF(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}js.extendSubschemaMode=EF});var Vv=F((W3,TC)=>{"use strict";TC.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var $C=F((Y3,qC)=>{"use strict";var Us=qC.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};kh(e,n,i,t,"",t)};Us.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Us.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Us.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Us.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function kh(t,e,r,n,i,s,a,u,f,h){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,a,u,f,h);for(var g in n){var m=n[g];if(Array.isArray(m)){if(g in Us.arrayKeywords)for(var S=0;S<m.length;S++)kh(t,e,r,m[S],i+"/"+g+"/"+S,s,i,g,n,S)}else if(g in Us.propsKeywords){if(m&&typeof m=="object")for(var _ in m)kh(t,e,r,m[_],i+"/"+g+"/"+CF(_),s,i,g,n,_)}else(g in Us.keywords||t.allKeys&&!(g in Us.skipKeywords))&&kh(t,e,r,m,i+"/"+g,s,i,g,n)}r(n,i,s,a,u,f,h)}}function CF(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var sc=F(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.getSchemaRefs=Ar.resolveUrl=Ar.normalizeId=Ar._getFullPath=Ar.getFullPath=Ar.inlineRef=void 0;var xF=Je(),RF=Vv(),IF=$C(),OF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function PF(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Wv(t):e?MC(t)<=e:!1}Ar.inlineRef=PF;var kF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Wv(t){for(let e in t){if(kF.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Wv)||typeof r=="object"&&Wv(r))return!0}return!1}function MC(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!OF.has(r)&&(typeof t[r]=="object"&&(0,xF.eachItem)(t[r],n=>e+=MC(n)),e===1/0))return 1/0}return e}function NC(t,e="",r){r!==!1&&(e=ll(e));let n=t.parse(e);return DC(t,n)}Ar.getFullPath=NC;function DC(t,e){return t.serialize(e).split("#")[0]+"#"}Ar._getFullPath=DC;var AF=/#\/?$/;function ll(t){return t?t.replace(AF,""):""}Ar.normalizeId=ll;function TF(t,e,r){return r=ll(r),t.resolve(e,r)}Ar.resolveUrl=TF;var qF=/^[a-z_][-a-z0-9._]*$/i;function $F(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=ll(t[r]||e),s={"":i},a=NC(n,i,!1),u={},f=new Set;return IF(t,{allKeys:!0},(m,S,_,C)=>{if(C===void 0)return;let x=a+S,A=s[C];typeof m[r]=="string"&&(A=T.call(this,m[r])),j.call(this,m.$anchor),j.call(this,m.$dynamicAnchor),s[S]=A;function T(Y){let V=this.opts.uriResolver.resolve;if(Y=ll(A?V(A,Y):Y),f.has(Y))throw g(Y);f.add(Y);let K=this.refs[Y];return typeof K=="string"&&(K=this.refs[K]),typeof K=="object"?h(m,K.schema,Y):Y!==ll(x)&&(Y[0]==="#"?(h(m,u[Y],Y),u[Y]=m):this.refs[Y]=x),Y}function j(Y){if(typeof Y=="string"){if(!qF.test(Y))throw new Error(`invalid anchor "${Y}"`);T.call(this,`#${Y}`)}}}),u;function h(m,S,_){if(S!==void 0&&!RF(m,S))throw g(_)}function g(m){return new Error(`reference "${m}" resolves to more than one schema`)}}Ar.getSchemaRefs=$F});var lc=F(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.getData=Bs.KeywordCxt=Bs.validateFunctionCode=void 0;var BC=yC(),FC=ic(),Jv=Dv(),Ah=ic(),MF=CC(),ac=PC(),Yv=AC(),ce=Me(),be=Ki(),NF=sc(),Gi=Je(),oc=nc();function DF(t){if(WC(t)&&(YC(t),VC(t))){jF(t);return}HC(t,()=>(0,BC.topBoolOrEmptySchema)(t))}Bs.validateFunctionCode=DF;function HC({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,ce._)`${be.default.data}, ${be.default.valCxt}`,n.$async,()=>{t.code((0,ce._)`"use strict"; ${LC(r,i)}`),LF(t,i),t.code(s)}):t.func(e,(0,ce._)`${be.default.data}, ${FF(i)}`,n.$async,()=>t.code(LC(r,i)).code(s))}function FF(t){return(0,ce._)`{${be.default.instancePath}="", ${be.default.parentData}, ${be.default.parentDataProperty}, ${be.default.rootData}=${be.default.data}${t.dynamicRef?(0,ce._)`, ${be.default.dynamicAnchors}={}`:ce.nil}}={}`}function LF(t,e){t.if(be.default.valCxt,()=>{t.var(be.default.instancePath,(0,ce._)`${be.default.valCxt}.${be.default.instancePath}`),t.var(be.default.parentData,(0,ce._)`${be.default.valCxt}.${be.default.parentData}`),t.var(be.default.parentDataProperty,(0,ce._)`${be.default.valCxt}.${be.default.parentDataProperty}`),t.var(be.default.rootData,(0,ce._)`${be.default.valCxt}.${be.default.rootData}`),e.dynamicRef&&t.var(be.default.dynamicAnchors,(0,ce._)`${be.default.valCxt}.${be.default.dynamicAnchors}`)},()=>{t.var(be.default.instancePath,(0,ce._)`""`),t.var(be.default.parentData,(0,ce._)`undefined`),t.var(be.default.parentDataProperty,(0,ce._)`undefined`),t.var(be.default.rootData,be.default.data),e.dynamicRef&&t.var(be.default.dynamicAnchors,(0,ce._)`{}`)})}function jF(t){let{schema:e,opts:r,gen:n}=t;HC(t,()=>{r.$comment&&e.$comment&&zC(t),WF(t),n.let(be.default.vErrors,null),n.let(be.default.errors,0),r.unevaluated&&UF(t),JC(t),zF(t)})}function UF(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ce._)`${r}.evaluated`),e.if((0,ce._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ce._)`${t.evaluated}.props`,(0,ce._)`undefined`)),e.if((0,ce._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ce._)`${t.evaluated}.items`,(0,ce._)`undefined`))}function LC(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ce._)`/*# sourceURL=${r} */`:ce.nil}function BF(t,e){if(WC(t)&&(YC(t),VC(t))){HF(t,e);return}(0,BC.boolOrEmptySchema)(t,e)}function VC({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function WC(t){return typeof t.schema!="boolean"}function HF(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&zC(t),YF(t),JF(t);let s=n.const("_errs",be.default.errors);JC(t,s),n.var(e,(0,ce._)`${s} === ${be.default.errors}`)}function YC(t){(0,Gi.checkUnknownRules)(t),VF(t)}function JC(t,e){if(t.opts.jtd)return jC(t,[],!1,e);let r=(0,FC.getSchemaTypes)(t.schema),n=(0,FC.coerceAndCheckDataType)(t,r);jC(t,r,!n,e)}function VF(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Gi.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function WF(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Gi.checkStrictMode)(t,"default is ignored in the schema root")}function YF(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,NF.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function JF(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function zC({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,ce._)`${be.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,ce.str)`${n}/$comment`,u=t.scopeValue("root",{ref:e.root});t.code((0,ce._)`${be.default.self}.opts.$comment(${s}, ${a}, ${u}.schema)`)}}function zF(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,ce._)`${be.default.errors} === 0`,()=>e.return(be.default.data),()=>e.throw((0,ce._)`new ${i}(${be.default.vErrors})`)):(e.assign((0,ce._)`${n}.errors`,be.default.vErrors),s.unevaluated&&KF(t),e.return((0,ce._)`${be.default.errors} === 0`))}function KF({gen:t,evaluated:e,props:r,items:n}){r instanceof ce.Name&&t.assign((0,ce._)`${e}.props`,r),n instanceof ce.Name&&t.assign((0,ce._)`${e}.items`,n)}function jC(t,e,r,n){let{gen:i,schema:s,data:a,allErrors:u,opts:f,self:h}=t,{RULES:g}=h;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,Gi.schemaHasRulesButRef)(s,g))){i.block(()=>GC(t,"$ref",g.all.$ref.definition));return}f.jtd||GF(t,e),i.block(()=>{for(let S of g.rules)m(S);m(g.post)});function m(S){(0,Jv.shouldUseGroup)(s,S)&&(S.type?(i.if((0,Ah.checkDataType)(S.type,a,f.strictNumbers)),UC(t,S),e.length===1&&e[0]===S.type&&r&&(i.else(),(0,Ah.reportTypeError)(t)),i.endIf()):UC(t,S),u||i.if((0,ce._)`${be.default.errors} === ${n||0}`))}}function UC(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,MF.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Jv.shouldUseRule)(n,s)&&GC(t,s.keyword,s.definition,e.type)})}function GF(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(QF(t,e),t.opts.allowUnionTypes||ZF(t,e),XF(t,t.dataTypes))}function QF(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{KC(t.dataTypes,r)||zv(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),tL(t,e)}}function ZF(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&zv(t,"use allowUnionTypes to allow union type keyword")}function XF(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Jv.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>eL(e,a))&&zv(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function eL(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function KC(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function tL(t,e){let r=[];for(let n of t.dataTypes)KC(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function zv(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Gi.checkStrictMode)(t,e,t.opts.strictTypes)}var Th=class{constructor(e,r,n){if((0,ac.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Gi.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",QC(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ac.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",be.default.errors))}result(e,r,n){this.failResult((0,ce.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,ce.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,ce._)`${r} !== undefined && (${(0,ce.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?oc.reportExtraError:oc.reportError)(this,this.def.error,r)}$dataError(){(0,oc.reportError)(this,this.def.$dataError||oc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,oc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=ce.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ce.nil,r=ce.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,ce.or)((0,ce._)`${i} === undefined`,r)),e!==ce.nil&&n.assign(e,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ce.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,ce.or)(a(),u());function a(){if(n.length){if(!(r instanceof ce.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,ce._)`${(0,Ah.checkDataTypes)(f,r,s.opts.strictNumbers,Ah.DataType.Wrong)}`}return ce.nil}function u(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,ce._)`!${f}(${r})`}return ce.nil}}subschema(e,r){let n=(0,Yv.getSubschema)(this.it,e);(0,Yv.extendSubschemaData)(n,this.it,e),(0,Yv.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return BF(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Gi.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Gi.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,ce.Name)),!0}};Bs.KeywordCxt=Th;function GC(t,e,r,n){let i=new Th(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,ac.funcKeywordCode)(i,r):"macro"in r?(0,ac.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,ac.funcKeywordCode)(i,r)}var rL=/^\/(?:[^~]|~0|~1)*$/,nL=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function QC(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return be.default.rootData;if(t[0]==="/"){if(!rL.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=be.default.rootData}else{let h=nL.exec(t);if(!h)throw new Error(`Invalid JSON-pointer: ${t}`);let g=+h[1];if(i=h[2],i==="#"){if(g>=e)throw new Error(f("property/index",g));return n[e-g]}if(g>e)throw new Error(f("data",g));if(s=r[e-g],!i)return s}let a=s,u=i.split("/");for(let h of u)h&&(s=(0,ce._)`${s}${(0,ce.getProperty)((0,Gi.unescapeJsonPointer)(h))}`,a=(0,ce._)`${a} && ${s}`);return a;function f(h,g){return`Cannot access ${h} ${g} levels up, current level is ${e}`}}Bs.getData=QC});var qh=F(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});var Kv=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Gv.default=Kv});var uc=F(Xv=>{"use strict";Object.defineProperty(Xv,"__esModule",{value:!0});var Qv=sc(),Zv=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Qv.resolveUrl)(e,r,n),this.missingSchema=(0,Qv.normalizeId)((0,Qv.getFullPath)(e,this.missingRef))}};Xv.default=Zv});var Mh=F(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.resolveSchema=hn.getCompilingSchema=hn.resolveRef=hn.compileSchema=hn.SchemaEnv=void 0;var jn=Me(),iL=qh(),Vo=Ki(),Un=sc(),ZC=Je(),sL=lc(),ul=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Un.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};hn.SchemaEnv=ul;function tS(t){let e=XC.call(this,t);if(e)return e;let r=(0,Un.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new jn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),u;t.$async&&(u=a.scopeValue("Error",{ref:iL.default,code:(0,jn._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");t.validateName=f;let h={gen:a,allErrors:this.opts.allErrors,data:Vo.default.data,parentData:Vo.default.parentData,parentDataProperty:Vo.default.parentDataProperty,dataNames:[Vo.default.data],dataPathArr:[jn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,jn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:u,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:jn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,jn._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(t),(0,sL.validateFunctionCode)(h),a.optimize(this.opts.code.optimize);let m=a.toString();g=`${a.scopeRefs(Vo.default.scope)}return ${m}`,this.opts.code.process&&(g=this.opts.code.process(g,t));let _=new Function(`${Vo.default.self}`,`${Vo.default.scope}`,g)(this,this.scope.get());if(this.scope.value(f,{ref:_}),_.errors=null,_.schema=t.schema,_.schemaEnv=t,t.$async&&(_.$async=!0),this.opts.code.source===!0&&(_.source={validateName:f,validateCode:m,scopeValues:a._values}),this.opts.unevaluated){let{props:C,items:x}=h;_.evaluated={props:C instanceof jn.Name?void 0:C,items:x instanceof jn.Name?void 0:x,dynamicProps:C instanceof jn.Name,dynamicItems:x instanceof jn.Name},_.source&&(_.source.evaluated=(0,jn.stringify)(_.evaluated))}return t.validate=_,t}catch(m){throw delete t.validate,delete t.validateName,g&&this.logger.error("Error compiling schema, function code:",g),m}finally{this._compilations.delete(t)}}hn.compileSchema=tS;function oL(t,e,r){var n;r=(0,Un.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=uL.call(this,t,r);if(s===void 0){let a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:u}=this.opts;a&&(s=new ul({schema:a,schemaId:u,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=aL.call(this,s)}hn.resolveRef=oL;function aL(t){return(0,Un.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:tS.call(this,t)}function XC(t){for(let e of this._compilations)if(lL(e,t))return e}hn.getCompilingSchema=XC;function lL(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function uL(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||$h.call(this,t,e)}function $h(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Un._getFullPath)(this.opts.uriResolver,r),i=(0,Un.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return eS.call(this,r,t);let s=(0,Un.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let u=$h.call(this,t,a);return typeof u?.schema!="object"?void 0:eS.call(this,r,u)}if(typeof a?.schema=="object"){if(a.validate||tS.call(this,a),s===(0,Un.normalizeId)(e)){let{schema:u}=a,{schemaId:f}=this.opts,h=u[f];return h&&(i=(0,Un.resolveUrl)(this.opts.uriResolver,i,h)),new ul({schema:u,schemaId:f,root:t,baseId:i})}return eS.call(this,r,a)}}hn.resolveSchema=$h;var cL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function eS(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let u of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let f=r[(0,ZC.unescapeFragment)(u)];if(f===void 0)return;r=f;let h=typeof r=="object"&&r[this.opts.schemaId];!cL.has(u)&&h&&(e=(0,Un.resolveUrl)(this.opts.uriResolver,e,h))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,ZC.schemaHasRulesButRef)(r,this.RULES)){let u=(0,Un.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=$h.call(this,n,u)}let{schemaId:a}=this.opts;if(s=s||new ul({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var ex=F((Z3,fL)=>{fL.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var nS=F((X3,ix)=>{"use strict";var dL=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),rx=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function rS(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var hL=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function tx(t){return t.length=0,!0}function pL(t,e,r){if(t.length){let n=rS(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function mL(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,u=pL;for(let f=0;f<t.length;f++){let h=t[f];if(!(h==="["||h==="]"))if(h===":"){if(s===!0&&(a=!0),!u(i,n,r))break;if(++e>7){r.error=!0;break}f>0&&t[f-1]===":"&&(s=!0),n.push(":");continue}else if(h==="%"){if(!u(i,n,r))break;u=tx}else{i.push(h);continue}}return i.length&&(u===tx?r.zone=i.join(""):a?n.push(i.join("")):n.push(rS(i))),r.address=n.join(""),r}function nx(t){if(gL(t,":")<2)return{host:t,isIPV6:!1};let e=mL(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function gL(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function yL(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function vL(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function SL(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!rx(r)){let n=nx(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}ix.exports={nonSimpleDomain:hL,recomposeAuthority:SL,normalizeComponentEncoding:vL,removeDotSegments:yL,isIPv4:rx,isUUID:dL,normalizeIPv6:nx,stringArrayToHexStripped:rS}});var ux=F((e6,lx)=>{"use strict";var{isUUID:bL}=nS(),_L=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,wL=["http","https","ws","wss","urn","urn:uuid"];function EL(t){return wL.indexOf(t)!==-1}function iS(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function sx(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function ox(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function CL(t){return t.secure=iS(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function xL(t){if((t.port===(iS(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function RL(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(_L);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=sS(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function IL(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=sS(i);s&&(t=s.serialize(t,e));let a=t,u=t.nss;return a.path=`${n||e.nid}:${u}`,e.skipEscape=!0,a}function OL(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!bL(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function PL(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var ax={scheme:"http",domainHost:!0,parse:sx,serialize:ox},kL={scheme:"https",domainHost:ax.domainHost,parse:sx,serialize:ox},Nh={scheme:"ws",domainHost:!0,parse:CL,serialize:xL},AL={scheme:"wss",domainHost:Nh.domainHost,parse:Nh.parse,serialize:Nh.serialize},TL={scheme:"urn",parse:RL,serialize:IL,skipNormalize:!0},qL={scheme:"urn:uuid",parse:OL,serialize:PL,skipNormalize:!0},Dh={http:ax,https:kL,ws:Nh,wss:AL,urn:TL,"urn:uuid":qL};Object.setPrototypeOf(Dh,null);function sS(t){return t&&(Dh[t]||Dh[t.toLowerCase()])||void 0}lx.exports={wsIsSecure:iS,SCHEMES:Dh,isValidSchemeName:EL,getSchemeHandler:sS}});var dx=F((t6,Lh)=>{"use strict";var{normalizeIPv6:$L,removeDotSegments:cc,recomposeAuthority:ML,normalizeComponentEncoding:Fh,isIPv4:NL,nonSimpleDomain:DL}=nS(),{SCHEMES:FL,getSchemeHandler:cx}=ux();function LL(t,e){return typeof t=="string"?t=vi(Qi(t,e),e):typeof t=="object"&&(t=Qi(vi(t,e),e)),t}function jL(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=fx(Qi(t,n),Qi(e,n),n,!0);return n.skipEscape=!0,vi(i,n)}function fx(t,e,r,n){let i={};return n||(t=Qi(vi(t,r),r),e=Qi(vi(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=cc(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=cc(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=cc(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=cc(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function UL(t,e,r){return typeof t=="string"?(t=unescape(t),t=vi(Fh(Qi(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=vi(Fh(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=vi(Fh(Qi(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=vi(Fh(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function vi(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=cx(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=ML(r);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let u=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(u=cc(u)),a===void 0&&u[0]==="/"&&u[1]==="/"&&(u="/%2F"+u.slice(2)),i.push(u)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var BL=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Qi(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(BL);if(s){if(n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]),n.host)if(NL(n.host)===!1){let f=$L(n.host);n.host=f.host.toLowerCase(),i=f.isIPV6}else i=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let a=cx(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&i===!1&&DL(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}(!a||a&&!a.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var oS={SCHEMES:FL,normalize:LL,resolve:jL,resolveComponent:fx,equal:UL,serialize:vi,parse:Qi};Lh.exports=oS;Lh.exports.default=oS;Lh.exports.fastUri=oS});var px=F(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});var hx=dx();hx.code='require("ajv/dist/runtime/uri").default';aS.default=hx});var wx=F(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.CodeGen=Qt.Name=Qt.nil=Qt.stringify=Qt.str=Qt._=Qt.KeywordCxt=void 0;var HL=lc();Object.defineProperty(Qt,"KeywordCxt",{enumerable:!0,get:function(){return HL.KeywordCxt}});var cl=Me();Object.defineProperty(Qt,"_",{enumerable:!0,get:function(){return cl._}});Object.defineProperty(Qt,"str",{enumerable:!0,get:function(){return cl.str}});Object.defineProperty(Qt,"stringify",{enumerable:!0,get:function(){return cl.stringify}});Object.defineProperty(Qt,"nil",{enumerable:!0,get:function(){return cl.nil}});Object.defineProperty(Qt,"Name",{enumerable:!0,get:function(){return cl.Name}});Object.defineProperty(Qt,"CodeGen",{enumerable:!0,get:function(){return cl.CodeGen}});var VL=qh(),Sx=uc(),WL=Nv(),fc=Mh(),YL=Me(),dc=sc(),jh=ic(),uS=Je(),mx=ex(),JL=px(),bx=(t,e)=>new RegExp(t,e);bx.code="new RegExp";var zL=["removeAdditional","useDefaults","coerceTypes"],KL=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),GL={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},QL={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},gx=200;function ZL(t){var e,r,n,i,s,a,u,f,h,g,m,S,_,C,x,A,T,j,Y,V,K,ee,k,E,P;let N=t.strict,D=(e=t.code)===null||e===void 0?void 0:e.optimize,L=D===!0||D===void 0?1:D||0,z=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:bx,Z=(i=t.uriResolver)!==null&&i!==void 0?i:JL.default;return{strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&a!==void 0?a:!0,strictNumbers:(f=(u=t.strictNumbers)!==null&&u!==void 0?u:N)!==null&&f!==void 0?f:!0,strictTypes:(g=(h=t.strictTypes)!==null&&h!==void 0?h:N)!==null&&g!==void 0?g:"log",strictTuples:(S=(m=t.strictTuples)!==null&&m!==void 0?m:N)!==null&&S!==void 0?S:"log",strictRequired:(C=(_=t.strictRequired)!==null&&_!==void 0?_:N)!==null&&C!==void 0?C:!1,code:t.code?{...t.code,optimize:L,regExp:z}:{optimize:L,regExp:z},loopRequired:(x=t.loopRequired)!==null&&x!==void 0?x:gx,loopEnum:(A=t.loopEnum)!==null&&A!==void 0?A:gx,meta:(T=t.meta)!==null&&T!==void 0?T:!0,messages:(j=t.messages)!==null&&j!==void 0?j:!0,inlineRefs:(Y=t.inlineRefs)!==null&&Y!==void 0?Y:!0,schemaId:(V=t.schemaId)!==null&&V!==void 0?V:"$id",addUsedSchema:(K=t.addUsedSchema)!==null&&K!==void 0?K:!0,validateSchema:(ee=t.validateSchema)!==null&&ee!==void 0?ee:!0,validateFormats:(k=t.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:(E=t.unicodeRegExp)!==null&&E!==void 0?E:!0,int32range:(P=t.int32range)!==null&&P!==void 0?P:!0,uriResolver:Z}}var hc=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...ZL(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new YL.ValueScope({scope:{},prefixes:KL,es5:r,lines:n}),this.logger=ij(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,WL.getRules)(),yx.call(this,GL,e,"NOT SUPPORTED"),yx.call(this,QL,e,"DEPRECATED","warn"),this._metaOpts=rj.call(this),e.formats&&ej.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&tj.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),XL.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=mx;n==="id"&&(i={...mx},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(g,m){await s.call(this,g.$schema);let S=this._addSchema(g,m);return S.validate||a.call(this,S)}async function s(g){g&&!this.getSchema(g)&&await i.call(this,{$ref:g},!0)}async function a(g){try{return this._compileSchemaEnv(g)}catch(m){if(!(m instanceof Sx.default))throw m;return u.call(this,m),await f.call(this,m.missingSchema),a.call(this,g)}}function u({missingSchema:g,missingRef:m}){if(this.refs[g])throw new Error(`AnySchema ${g} is loaded but ${m} cannot be resolved`)}async function f(g){let m=await h.call(this,g);this.refs[g]||await s.call(this,m.$schema),this.refs[g]||this.addSchema(m,g,r)}async function h(g){let m=this._loading[g];if(m)return m;try{return await(this._loading[g]=n(g))}finally{delete this._loading[g]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:a}=this.opts;if(s=e[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0,dc.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=vx.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new fc.SchemaEnv({schema:{},schemaId:n});if(r=fc.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=vx.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,dc.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(oj.call(this,n,r),!r)return(0,uS.eachItem)(n,s=>lS.call(this,s)),this;lj.call(this,r);let i={...r,type:(0,jh.getJSONTypes)(r.type),schemaType:(0,jh.getJSONTypes)(r.schemaType)};return(0,uS.eachItem)(n,i.type.length===0?s=>lS.call(this,s,i):s=>i.type.forEach(a=>lS.call(this,s,i,a))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),a=e;for(let u of s)a=a[u];for(let u in n){let f=n[u];if(typeof f!="object")continue;let{$data:h}=f.definition,g=a[u];h&&g&&(a[u]=_x(g))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:u}=this.opts;if(typeof e=="object")a=e[u];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let f=this._cache.get(e);if(f!==void 0)return f;n=(0,dc.normalizeId)(a||n);let h=dc.getSchemaRefs.call(this,e,n);return f=new fc.SchemaEnv({schema:e,schemaId:u,meta:r,baseId:n,localRefs:h}),this._cache.set(f.schema,f),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=f),i&&this.validateSchema(e,!0),f}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):fc.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{fc.compileSchema.call(this,e)}finally{this.opts=r}}};hc.ValidationError=VL.default;hc.MissingRefError=Sx.default;Qt.default=hc;function yx(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function vx(t){return t=(0,dc.normalizeId)(t),this.schemas[t]||this.refs[t]}function XL(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function ej(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function tj(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function rj(){let t={...this.opts};for(let e of zL)delete t[e];return t}var nj={log(){},warn(){},error(){}};function ij(t){if(t===!1)return nj;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var sj=/^[a-z_$][a-z0-9_$:-]*$/i;function oj(t,e){let{RULES:r}=this;if((0,uS.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!sj.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function lS(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:f})=>f===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[t]=!0,!e)return;let u={keyword:t,definition:{...e,type:(0,jh.getJSONTypes)(e.type),schemaType:(0,jh.getJSONTypes)(e.schemaType)}};e.before?aj.call(this,a,u,e.before):a.rules.push(u),s.all[t]=u,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function aj(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function lj(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=_x(e)),t.validateSchema=this.compile(e,!0))}var uj={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function _x(t){return{anyOf:[t,uj]}}});var Ex=F(cS=>{"use strict";Object.defineProperty(cS,"__esModule",{value:!0});var cj={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};cS.default=cj});var Ix=F(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.callRef=Wo.getValidate=void 0;var fj=uc(),Cx=dn(),Tr=Me(),fl=Ki(),xx=Mh(),Uh=Je(),dj={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:a,opts:u,self:f}=n,{root:h}=s;if((r==="#"||r==="#/")&&i===h.baseId)return m();let g=xx.resolveRef.call(f,h,i,r);if(g===void 0)throw new fj.default(n.opts.uriResolver,i,r);if(g instanceof xx.SchemaEnv)return S(g);return _(g);function m(){if(s===h)return Bh(t,a,s,s.$async);let C=e.scopeValue("root",{ref:h});return Bh(t,(0,Tr._)`${C}.validate`,h,h.$async)}function S(C){let x=Rx(t,C);Bh(t,x,C,C.$async)}function _(C){let x=e.scopeValue("schema",u.code.source===!0?{ref:C,code:(0,Tr.stringify)(C)}:{ref:C}),A=e.name("valid"),T=t.subschema({schema:C,dataTypes:[],schemaPath:Tr.nil,topSchemaRef:x,errSchemaPath:r},A);t.mergeEvaluated(T),t.ok(A)}}};function Rx(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Tr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Wo.getValidate=Rx;function Bh(t,e,r,n){let{gen:i,it:s}=t,{allErrors:a,schemaEnv:u,opts:f}=s,h=f.passContext?fl.default.this:Tr.nil;n?g():m();function g(){if(!u.$async)throw new Error("async schema referenced by sync schema");let C=i.let("valid");i.try(()=>{i.code((0,Tr._)`await ${(0,Cx.callValidateCode)(t,e,h)}`),_(e),a||i.assign(C,!0)},x=>{i.if((0,Tr._)`!(${x} instanceof ${s.ValidationError})`,()=>i.throw(x)),S(x),a||i.assign(C,!1)}),t.ok(C)}function m(){t.result((0,Cx.callValidateCode)(t,e,h),()=>_(e),()=>S(e))}function S(C){let x=(0,Tr._)`${C}.errors`;i.assign(fl.default.vErrors,(0,Tr._)`${fl.default.vErrors} === null ? ${x} : ${fl.default.vErrors}.concat(${x})`),i.assign(fl.default.errors,(0,Tr._)`${fl.default.vErrors}.length`)}function _(C){var x;if(!s.opts.unevaluated)return;let A=(x=r?.validate)===null||x===void 0?void 0:x.evaluated;if(s.props!==!0)if(A&&!A.dynamicProps)A.props!==void 0&&(s.props=Uh.mergeEvaluated.props(i,A.props,s.props));else{let T=i.var("props",(0,Tr._)`${C}.evaluated.props`);s.props=Uh.mergeEvaluated.props(i,T,s.props,Tr.Name)}if(s.items!==!0)if(A&&!A.dynamicItems)A.items!==void 0&&(s.items=Uh.mergeEvaluated.items(i,A.items,s.items));else{let T=i.var("items",(0,Tr._)`${C}.evaluated.items`);s.items=Uh.mergeEvaluated.items(i,T,s.items,Tr.Name)}}}Wo.callRef=Bh;Wo.default=dj});var Ox=F(fS=>{"use strict";Object.defineProperty(fS,"__esModule",{value:!0});var hj=Ex(),pj=Ix(),mj=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",hj.default,pj.default];fS.default=mj});var Px=F(dS=>{"use strict";Object.defineProperty(dS,"__esModule",{value:!0});var Hh=Me(),Hs=Hh.operators,Vh={maximum:{okStr:"<=",ok:Hs.LTE,fail:Hs.GT},minimum:{okStr:">=",ok:Hs.GTE,fail:Hs.LT},exclusiveMaximum:{okStr:"<",ok:Hs.LT,fail:Hs.GTE},exclusiveMinimum:{okStr:">",ok:Hs.GT,fail:Hs.LTE}},gj={message:({keyword:t,schemaCode:e})=>(0,Hh.str)`must be ${Vh[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Hh._)`{comparison: ${Vh[t].okStr}, limit: ${e}}`},yj={keyword:Object.keys(Vh),type:"number",schemaType:"number",$data:!0,error:gj,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Hh._)`${r} ${Vh[e].fail} ${n} || isNaN(${r})`)}};dS.default=yj});var kx=F(hS=>{"use strict";Object.defineProperty(hS,"__esModule",{value:!0});var pc=Me(),vj={message:({schemaCode:t})=>(0,pc.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,pc._)`{multipleOf: ${t}}`},Sj={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:vj,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,a=e.let("res"),u=s?(0,pc._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,pc._)`${a} !== parseInt(${a})`;t.fail$data((0,pc._)`(${n} === 0 || (${a} = ${r}/${n}, ${u}))`)}};hS.default=Sj});var Tx=F(pS=>{"use strict";Object.defineProperty(pS,"__esModule",{value:!0});function Ax(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}pS.default=Ax;Ax.code='require("ajv/dist/runtime/ucs2length").default'});var qx=F(mS=>{"use strict";Object.defineProperty(mS,"__esModule",{value:!0});var Yo=Me(),bj=Je(),_j=Tx(),wj={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Yo.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Yo._)`{limit: ${t}}`},Ej={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:wj,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?Yo.operators.GT:Yo.operators.LT,a=i.opts.unicode===!1?(0,Yo._)`${r}.length`:(0,Yo._)`${(0,bj.useFunc)(t.gen,_j.default)}(${r})`;t.fail$data((0,Yo._)`${a} ${s} ${n}`)}};mS.default=Ej});var $x=F(gS=>{"use strict";Object.defineProperty(gS,"__esModule",{value:!0});var Cj=dn(),Wh=Me(),xj={message:({schemaCode:t})=>(0,Wh.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Wh._)`{pattern: ${t}}`},Rj={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:xj,code(t){let{data:e,$data:r,schema:n,schemaCode:i,it:s}=t,a=s.opts.unicodeRegExp?"u":"",u=r?(0,Wh._)`(new RegExp(${i}, ${a}))`:(0,Cj.usePattern)(t,n);t.fail$data((0,Wh._)`!${u}.test(${e})`)}};gS.default=Rj});var Mx=F(yS=>{"use strict";Object.defineProperty(yS,"__esModule",{value:!0});var mc=Me(),Ij={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,mc.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,mc._)`{limit: ${t}}`},Oj={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Ij,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?mc.operators.GT:mc.operators.LT;t.fail$data((0,mc._)`Object.keys(${r}).length ${i} ${n}`)}};yS.default=Oj});var Nx=F(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});var gc=dn(),yc=Me(),Pj=Je(),kj={message:({params:{missingProperty:t}})=>(0,yc.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,yc._)`{missingProperty: ${t}}`},Aj={keyword:"required",type:"object",schemaType:"array",$data:!0,error:kj,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:a}=t,{opts:u}=a;if(!s&&r.length===0)return;let f=r.length>=u.loopRequired;if(a.allErrors?h():g(),u.strictRequired){let _=t.parentSchema.properties,{definedProperties:C}=t.it;for(let x of r)if(_?.[x]===void 0&&!C.has(x)){let A=a.schemaEnv.baseId+a.errSchemaPath,T=`required property "${x}" is not defined at "${A}" (strictRequired)`;(0,Pj.checkStrictMode)(a,T,a.opts.strictRequired)}}function h(){if(f||s)t.block$data(yc.nil,m);else for(let _ of r)(0,gc.checkReportMissingProp)(t,_)}function g(){let _=e.let("missing");if(f||s){let C=e.let("valid",!0);t.block$data(C,()=>S(_,C)),t.ok(C)}else e.if((0,gc.checkMissingProp)(t,r,_)),(0,gc.reportMissingProp)(t,_),e.else()}function m(){e.forOf("prop",n,_=>{t.setParams({missingProperty:_}),e.if((0,gc.noPropertyInData)(e,i,_,u.ownProperties),()=>t.error())})}function S(_,C){t.setParams({missingProperty:_}),e.forOf(_,n,()=>{e.assign(C,(0,gc.propertyInData)(e,i,_,u.ownProperties)),e.if((0,yc.not)(C),()=>{t.error(),e.break()})},yc.nil)}}};vS.default=Aj});var Dx=F(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});var vc=Me(),Tj={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,vc.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,vc._)`{limit: ${t}}`},qj={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Tj,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?vc.operators.GT:vc.operators.LT;t.fail$data((0,vc._)`${r}.length ${i} ${n}`)}};SS.default=qj});var Yh=F(bS=>{"use strict";Object.defineProperty(bS,"__esModule",{value:!0});var Fx=Vv();Fx.code='require("ajv/dist/runtime/equal").default';bS.default=Fx});var Lx=F(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});var _S=ic(),Zt=Me(),$j=Je(),Mj=Yh(),Nj={message:({params:{i:t,j:e}})=>(0,Zt.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Zt._)`{i: ${t}, j: ${e}}`},Dj={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Nj,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:u}=t;if(!n&&!i)return;let f=e.let("valid"),h=s.items?(0,_S.getSchemaTypes)(s.items):[];t.block$data(f,g,(0,Zt._)`${a} === false`),t.ok(f);function g(){let C=e.let("i",(0,Zt._)`${r}.length`),x=e.let("j");t.setParams({i:C,j:x}),e.assign(f,!0),e.if((0,Zt._)`${C} > 1`,()=>(m()?S:_)(C,x))}function m(){return h.length>0&&!h.some(C=>C==="object"||C==="array")}function S(C,x){let A=e.name("item"),T=(0,_S.checkDataTypes)(h,A,u.opts.strictNumbers,_S.DataType.Wrong),j=e.const("indices",(0,Zt._)`{}`);e.for((0,Zt._)`;${C}--;`,()=>{e.let(A,(0,Zt._)`${r}[${C}]`),e.if(T,(0,Zt._)`continue`),h.length>1&&e.if((0,Zt._)`typeof ${A} == "string"`,(0,Zt._)`${A} += "_"`),e.if((0,Zt._)`typeof ${j}[${A}] == "number"`,()=>{e.assign(x,(0,Zt._)`${j}[${A}]`),t.error(),e.assign(f,!1).break()}).code((0,Zt._)`${j}[${A}] = ${C}`)})}function _(C,x){let A=(0,$j.useFunc)(e,Mj.default),T=e.name("outer");e.label(T).for((0,Zt._)`;${C}--;`,()=>e.for((0,Zt._)`${x} = ${C}; ${x}--;`,()=>e.if((0,Zt._)`${A}(${r}[${C}], ${r}[${x}])`,()=>{t.error(),e.assign(f,!1).break(T)})))}}};wS.default=Dj});var jx=F(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});var ES=Me(),Fj=Je(),Lj=Yh(),jj={message:"must be equal to constant",params:({schemaCode:t})=>(0,ES._)`{allowedValue: ${t}}`},Uj={keyword:"const",$data:!0,error:jj,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,ES._)`!${(0,Fj.useFunc)(e,Lj.default)}(${r}, ${i})`):t.fail((0,ES._)`${s} !== ${r}`)}};CS.default=Uj});var Ux=F(xS=>{"use strict";Object.defineProperty(xS,"__esModule",{value:!0});var Sc=Me(),Bj=Je(),Hj=Yh(),Vj={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Sc._)`{allowedValues: ${t}}`},Wj={keyword:"enum",schemaType:"array",$data:!0,error:Vj,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let u=i.length>=a.opts.loopEnum,f,h=()=>f??(f=(0,Bj.useFunc)(e,Hj.default)),g;if(u||n)g=e.let("valid"),t.block$data(g,m);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let _=e.const("vSchema",s);g=(0,Sc.or)(...i.map((C,x)=>S(_,x)))}t.pass(g);function m(){e.assign(g,!1),e.forOf("v",s,_=>e.if((0,Sc._)`${h()}(${r}, ${_})`,()=>e.assign(g,!0).break()))}function S(_,C){let x=i[C];return typeof x=="object"&&x!==null?(0,Sc._)`${h()}(${r}, ${_}[${C}])`:(0,Sc._)`${r} === ${x}`}}};xS.default=Wj});var Bx=F(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});var Yj=Px(),Jj=kx(),zj=qx(),Kj=$x(),Gj=Mx(),Qj=Nx(),Zj=Dx(),Xj=Lx(),e2=jx(),t2=Ux(),r2=[Yj.default,Jj.default,zj.default,Kj.default,Gj.default,Qj.default,Zj.default,Xj.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},e2.default,t2.default];RS.default=r2});var OS=F(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.validateAdditionalItems=void 0;var Jo=Me(),IS=Je(),n2={message:({params:{len:t}})=>(0,Jo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Jo._)`{limit: ${t}}`},i2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:n2,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,IS.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Hx(t,n)}};function Hx(t,e){let{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;let u=r.const("len",(0,Jo._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Jo._)`${u} <= ${e.length}`);else if(typeof n=="object"&&!(0,IS.alwaysValidSchema)(a,n)){let h=r.var("valid",(0,Jo._)`${u} <= ${e.length}`);r.if((0,Jo.not)(h),()=>f(h)),t.ok(h)}function f(h){r.forRange("i",e.length,u,g=>{t.subschema({keyword:s,dataProp:g,dataPropType:IS.Type.Num},h),a.allErrors||r.if((0,Jo.not)(h),()=>r.break())})}}bc.validateAdditionalItems=Hx;bc.default=i2});var PS=F(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.validateTuple=void 0;var Vx=Me(),Jh=Je(),s2=dn(),o2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Wx(t,"additionalItems",e);r.items=!0,!(0,Jh.alwaysValidSchema)(r,e)&&t.ok((0,s2.validateArray)(t))}};function Wx(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:u}=t;g(i),u.opts.unevaluated&&r.length&&u.items!==!0&&(u.items=Jh.mergeEvaluated.items(n,r.length,u.items));let f=n.name("valid"),h=n.const("len",(0,Vx._)`${s}.length`);r.forEach((m,S)=>{(0,Jh.alwaysValidSchema)(u,m)||(n.if((0,Vx._)`${h} > ${S}`,()=>t.subschema({keyword:a,schemaProp:S,dataProp:S},f)),t.ok(f))});function g(m){let{opts:S,errSchemaPath:_}=u,C=r.length,x=C===m.minItems&&(C===m.maxItems||m[e]===!1);if(S.strictTuples&&!x){let A=`"${a}" is ${C}-tuple, but minItems or maxItems/${e} are not specified or different at path "${_}"`;(0,Jh.checkStrictMode)(u,A,S.strictTuples)}}}_c.validateTuple=Wx;_c.default=o2});var Yx=F(kS=>{"use strict";Object.defineProperty(kS,"__esModule",{value:!0});var a2=PS(),l2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,a2.validateTuple)(t,"items")};kS.default=l2});var zx=F(AS=>{"use strict";Object.defineProperty(AS,"__esModule",{value:!0});var Jx=Me(),u2=Je(),c2=dn(),f2=OS(),d2={message:({params:{len:t}})=>(0,Jx.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Jx._)`{limit: ${t}}`},h2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:d2,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,u2.alwaysValidSchema)(n,e)&&(i?(0,f2.validateAdditionalItems)(t,i):t.ok((0,c2.validateArray)(t)))}};AS.default=h2});var Kx=F(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});var pn=Me(),zh=Je(),p2={message:({params:{min:t,max:e}})=>e===void 0?(0,pn.str)`must contain at least ${t} valid item(s)`:(0,pn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,pn._)`{minContains: ${t}}`:(0,pn._)`{minContains: ${t}, maxContains: ${e}}`},m2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:p2,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,a,u,{minContains:f,maxContains:h}=n;s.opts.next?(a=f===void 0?1:f,u=h):a=1;let g=e.const("len",(0,pn._)`${i}.length`);if(t.setParams({min:a,max:u}),u===void 0&&a===0){(0,zh.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(u!==void 0&&a>u){(0,zh.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,zh.alwaysValidSchema)(s,r)){let x=(0,pn._)`${g} >= ${a}`;u!==void 0&&(x=(0,pn._)`${x} && ${g} <= ${u}`),t.pass(x);return}s.items=!0;let m=e.name("valid");u===void 0&&a===1?_(m,()=>e.if(m,()=>e.break())):a===0?(e.let(m,!0),u!==void 0&&e.if((0,pn._)`${i}.length > 0`,S)):(e.let(m,!1),S()),t.result(m,()=>t.reset());function S(){let x=e.name("_valid"),A=e.let("count",0);_(x,()=>e.if(x,()=>C(A)))}function _(x,A){e.forRange("i",0,g,T=>{t.subschema({keyword:"contains",dataProp:T,dataPropType:zh.Type.Num,compositeRule:!0},x),A()})}function C(x){e.code((0,pn._)`${x}++`),u===void 0?e.if((0,pn._)`${x} >= ${a}`,()=>e.assign(m,!0).break()):(e.if((0,pn._)`${x} > ${u}`,()=>e.assign(m,!1).break()),a===1?e.assign(m,!0):e.if((0,pn._)`${x} >= ${a}`,()=>e.assign(m,!0)))}}};TS.default=m2});var Zx=F(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.validateSchemaDeps=Si.validatePropertyDeps=Si.error=void 0;var qS=Me(),g2=Je(),wc=dn();Si.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,qS.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,qS._)`{property: ${t},
|
|
27
|
+
|| ${a} === "boolean" || ${i} === null`).assign(u,(0,Re._)`[${i}]`)}}}function QD({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Re._)`${e} !== undefined`,()=>t.assign((0,Re._)`${e}[${r}]`,n))}function Fv(t,e,r,n=ol.Correct){let i=n===ol.Correct?Re.operators.EQ:Re.operators.NEQ,s;switch(t){case"null":return(0,Re._)`${e} ${i} null`;case"array":s=(0,Re._)`Array.isArray(${e})`;break;case"object":s=(0,Re._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Re._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Re._)`typeof ${e} ${i} ${t}`}return n===ol.Correct?s:(0,Re.not)(s);function a(u=Re.nil){return(0,Re.and)((0,Re._)`typeof ${e} == "number"`,u,r?(0,Re._)`isFinite(${e})`:Re.nil)}}ar.checkDataType=Fv;function Lv(t,e,r,n){if(t.length===1)return Fv(t[0],e,r,n);let i,s=(0,bC.toHash)(t);if(s.array&&s.object){let a=(0,Re._)`typeof ${e} != "object"`;i=s.null?a:(0,Re._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=Re.nil;s.number&&delete s.integer;for(let a in s)i=(0,Re.and)(i,Fv(a,e,r,n));return i}ar.checkDataTypes=Lv;var ZD={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Re._)`{type: ${t}}`:(0,Re._)`{type: ${e}}`};function jv(t){let e=XD(t);(0,YD.reportError)(e,ZD)}ar.reportTypeError=jv;function XD(t){let{gen:e,data:r,schema:n}=t,i=(0,bC.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var CC=F(Ph=>{"use strict";Object.defineProperty(Ph,"__esModule",{value:!0});Ph.assignDefaults=void 0;var al=Me(),eF=Je();function tF(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)EC(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>EC(t,s,i.default))}Ph.assignDefaults=tF;function EC(t,e,r){let{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;let u=(0,al._)`${s}${(0,al.getProperty)(e)}`;if(i){(0,eF.checkStrictMode)(t,`default is ignored for: ${u}`);return}let f=(0,al._)`${u} === undefined`;a.useDefaults==="empty"&&(f=(0,al._)`${f} || ${u} === null || ${u} === ""`),n.if(f,(0,al._)`${u} = ${(0,al.stringify)(r)}`)}});var dn=F(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.validateUnion=it.validateArray=it.usePattern=it.callValidateCode=it.schemaProperties=it.allSchemaProperties=it.noPropertyInData=it.propertyInData=it.isOwnProperty=it.hasPropFunc=it.reportMissingProp=it.checkMissingProp=it.checkReportMissingProp=void 0;var dt=Me(),Uv=Je(),Ls=Ki(),rF=Je();function nF(t,e){let{gen:r,data:n,it:i}=t;r.if(Hv(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,dt._)`${e}`},!0),t.error()})}it.checkReportMissingProp=nF;function iF({gen:t,data:e,it:{opts:r}},n,i){return(0,dt.or)(...n.map(s=>(0,dt.and)(Hv(t,e,s,r.ownProperties),(0,dt._)`${i} = ${s}`)))}it.checkMissingProp=iF;function sF(t,e){t.setParams({missingProperty:e},!0),t.error()}it.reportMissingProp=sF;function xC(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,dt._)`Object.prototype.hasOwnProperty`})}it.hasPropFunc=xC;function Bv(t,e,r){return(0,dt._)`${xC(t)}.call(${e}, ${r})`}it.isOwnProperty=Bv;function oF(t,e,r,n){let i=(0,dt._)`${e}${(0,dt.getProperty)(r)} !== undefined`;return n?(0,dt._)`${i} && ${Bv(t,e,r)}`:i}it.propertyInData=oF;function Hv(t,e,r,n){let i=(0,dt._)`${e}${(0,dt.getProperty)(r)} === undefined`;return n?(0,dt.or)(i,(0,dt.not)(Bv(t,e,r))):i}it.noPropertyInData=Hv;function RC(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}it.allSchemaProperties=RC;function aF(t,e){return RC(e).filter(r=>!(0,Uv.alwaysValidSchema)(t,e[r]))}it.schemaProperties=aF;function lF({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},u,f,h){let g=h?(0,dt._)`${t}, ${e}, ${n}${i}`:e,m=[[Ls.default.instancePath,(0,dt.strConcat)(Ls.default.instancePath,s)],[Ls.default.parentData,a.parentData],[Ls.default.parentDataProperty,a.parentDataProperty],[Ls.default.rootData,Ls.default.rootData]];a.opts.dynamicRef&&m.push([Ls.default.dynamicAnchors,Ls.default.dynamicAnchors]);let S=(0,dt._)`${g}, ${r.object(...m)}`;return f!==dt.nil?(0,dt._)`${u}.call(${f}, ${S})`:(0,dt._)`${u}(${S})`}it.callValidateCode=lF;var uF=(0,dt._)`new RegExp`;function cF({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,dt._)`${i.code==="new RegExp"?uF:(0,rF.useFunc)(t,i)}(${r}, ${n})`})}it.usePattern=cF;function fF(t){let{gen:e,data:r,keyword:n,it:i}=t,s=e.name("valid");if(i.allErrors){let u=e.let("valid",!0);return a(()=>e.assign(u,!1)),u}return e.var(s,!0),a(()=>e.break()),s;function a(u){let f=e.const("len",(0,dt._)`${r}.length`);e.forRange("i",0,f,h=>{t.subschema({keyword:n,dataProp:h,dataPropType:Uv.Type.Num},s),e.if((0,dt.not)(s),u)})}}it.validateArray=fF;function dF(t){let{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(f=>(0,Uv.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let a=e.let("valid",!1),u=e.name("_valid");e.block(()=>r.forEach((f,h)=>{let g=t.subschema({keyword:n,schemaProp:h,compositeRule:!0},u);e.assign(a,(0,dt._)`${a} || ${u}`),t.mergeValidEvaluated(g,u)||e.if((0,dt.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}it.validateUnion=dF});var PC=F(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.validateKeywordUsage=gi.validSchemaType=gi.funcKeywordCode=gi.macroKeywordCode=void 0;var Sr=Me(),Ho=Ki(),hF=dn(),pF=nc();function mF(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,u=e.macro.call(a.self,i,s,a),f=OC(r,n,u);a.opts.validateSchema!==!1&&a.self.validateSchema(u,!0);let h=r.name("valid");t.subschema({schema:u,schemaPath:Sr.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},h),t.pass(h,()=>t.error(!0))}gi.macroKeywordCode=mF;function gF(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:u,it:f}=t;vF(f,e);let h=!u&&e.compile?e.compile.call(f.self,s,a,f):e.validate,g=OC(n,i,h),m=n.let("valid");t.block$data(m,S),t.ok((r=e.valid)!==null&&r!==void 0?r:m);function S(){if(e.errors===!1)x(),e.modifying&&IC(t),A(()=>t.error());else{let T=e.async?_():C();e.modifying&&IC(t),A(()=>yF(t,T))}}function _(){let T=n.let("ruleErrs",null);return n.try(()=>x((0,Sr._)`await `),j=>n.assign(m,!1).if((0,Sr._)`${j} instanceof ${f.ValidationError}`,()=>n.assign(T,(0,Sr._)`${j}.errors`),()=>n.throw(j))),T}function C(){let T=(0,Sr._)`${g}.errors`;return n.assign(T,null),x(Sr.nil),T}function x(T=e.async?(0,Sr._)`await `:Sr.nil){let j=f.opts.passContext?Ho.default.this:Ho.default.self,Y=!("compile"in e&&!u||e.schema===!1);n.assign(m,(0,Sr._)`${T}${(0,hF.callValidateCode)(t,g,j,Y)}`,e.modifying)}function A(T){var j;n.if((0,Sr.not)((j=e.valid)!==null&&j!==void 0?j:m),T)}}gi.funcKeywordCode=gF;function IC(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Sr._)`${n.parentData}[${n.parentDataProperty}]`))}function yF(t,e){let{gen:r}=t;r.if((0,Sr._)`Array.isArray(${e})`,()=>{r.assign(Ho.default.vErrors,(0,Sr._)`${Ho.default.vErrors} === null ? ${e} : ${Ho.default.vErrors}.concat(${e})`).assign(Ho.default.errors,(0,Sr._)`${Ho.default.vErrors}.length`),(0,pF.extendErrors)(t)},()=>t.error())}function vF({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function OC(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Sr.stringify)(r)})}function SF(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}gi.validSchemaType=SF;function bF({schema:t,opts:e,self:r,errSchemaPath:n},i,s){if(Array.isArray(i.keyword)?!i.keyword.includes(s):i.keyword!==s)throw new Error("ajv implementation error");let a=i.dependencies;if(a?.some(u=>!Object.prototype.hasOwnProperty.call(t,u)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(t[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(f);else throw new Error(f)}}gi.validateKeywordUsage=bF});var AC=F(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.extendSubschemaMode=js.extendSubschemaData=js.getSubschema=void 0;var yi=Me(),kC=Je();function _F(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:s,topSchemaRef:a}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let u=t.schema[e];return r===void 0?{schema:u,schemaPath:(0,yi._)`${t.schemaPath}${(0,yi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:u[r],schemaPath:(0,yi._)`${t.schemaPath}${(0,yi.getProperty)(e)}${(0,yi.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,kC.escapeFragment)(r)}`}}if(n!==void 0){if(i===void 0||s===void 0||a===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:a,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}js.getSubschema=_F;function wF(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:u}=e;if(r!==void 0){let{errorPath:h,dataPathArr:g,opts:m}=e,S=u.let("data",(0,yi._)`${e.data}${(0,yi.getProperty)(r)}`,!0);f(S),t.errorPath=(0,yi.str)`${h}${(0,kC.getErrorPath)(r,n,m.jsPropertySyntax)}`,t.parentDataProperty=(0,yi._)`${r}`,t.dataPathArr=[...g,t.parentDataProperty]}if(i!==void 0){let h=i instanceof yi.Name?i:u.let("data",i,!0);f(h),a!==void 0&&(t.propertyName=a)}s&&(t.dataTypes=s);function f(h){t.data=h,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,h]}}js.extendSubschemaData=wF;function EF(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(t.compositeRule=n),i!==void 0&&(t.createErrors=i),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}js.extendSubschemaMode=EF});var Vv=F((W3,TC)=>{"use strict";TC.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}});var $C=F((Y3,qC)=>{"use strict";var Us=qC.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};kh(e,n,i,t,"",t)};Us.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Us.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Us.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Us.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function kh(t,e,r,n,i,s,a,u,f,h){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,s,a,u,f,h);for(var g in n){var m=n[g];if(Array.isArray(m)){if(g in Us.arrayKeywords)for(var S=0;S<m.length;S++)kh(t,e,r,m[S],i+"/"+g+"/"+S,s,i,g,n,S)}else if(g in Us.propsKeywords){if(m&&typeof m=="object")for(var _ in m)kh(t,e,r,m[_],i+"/"+g+"/"+CF(_),s,i,g,n,_)}else(g in Us.keywords||t.allKeys&&!(g in Us.skipKeywords))&&kh(t,e,r,m,i+"/"+g,s,i,g,n)}r(n,i,s,a,u,f,h)}}function CF(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var sc=F(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.getSchemaRefs=Ar.resolveUrl=Ar.normalizeId=Ar._getFullPath=Ar.getFullPath=Ar.inlineRef=void 0;var xF=Je(),RF=Vv(),IF=$C(),OF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function PF(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Wv(t):e?MC(t)<=e:!1}Ar.inlineRef=PF;var kF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Wv(t){for(let e in t){if(kF.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Wv)||typeof r=="object"&&Wv(r))return!0}return!1}function MC(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!OF.has(r)&&(typeof t[r]=="object"&&(0,xF.eachItem)(t[r],n=>e+=MC(n)),e===1/0))return 1/0}return e}function NC(t,e="",r){r!==!1&&(e=ll(e));let n=t.parse(e);return DC(t,n)}Ar.getFullPath=NC;function DC(t,e){return t.serialize(e).split("#")[0]+"#"}Ar._getFullPath=DC;var AF=/#\/?$/;function ll(t){return t?t.replace(AF,""):""}Ar.normalizeId=ll;function TF(t,e,r){return r=ll(r),t.resolve(e,r)}Ar.resolveUrl=TF;var qF=/^[a-z_][-a-z0-9._]*$/i;function $F(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=ll(t[r]||e),s={"":i},a=NC(n,i,!1),u={},f=new Set;return IF(t,{allKeys:!0},(m,S,_,C)=>{if(C===void 0)return;let x=a+S,A=s[C];typeof m[r]=="string"&&(A=T.call(this,m[r])),j.call(this,m.$anchor),j.call(this,m.$dynamicAnchor),s[S]=A;function T(Y){let V=this.opts.uriResolver.resolve;if(Y=ll(A?V(A,Y):Y),f.has(Y))throw g(Y);f.add(Y);let K=this.refs[Y];return typeof K=="string"&&(K=this.refs[K]),typeof K=="object"?h(m,K.schema,Y):Y!==ll(x)&&(Y[0]==="#"?(h(m,u[Y],Y),u[Y]=m):this.refs[Y]=x),Y}function j(Y){if(typeof Y=="string"){if(!qF.test(Y))throw new Error(`invalid anchor "${Y}"`);T.call(this,`#${Y}`)}}}),u;function h(m,S,_){if(S!==void 0&&!RF(m,S))throw g(_)}function g(m){return new Error(`reference "${m}" resolves to more than one schema`)}}Ar.getSchemaRefs=$F});var lc=F(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.getData=Bs.KeywordCxt=Bs.validateFunctionCode=void 0;var BC=yC(),FC=ic(),Jv=Dv(),Ah=ic(),MF=CC(),ac=PC(),Yv=AC(),ce=Me(),be=Ki(),NF=sc(),Gi=Je(),oc=nc();function DF(t){if(WC(t)&&(YC(t),VC(t))){jF(t);return}HC(t,()=>(0,BC.topBoolOrEmptySchema)(t))}Bs.validateFunctionCode=DF;function HC({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,ce._)`${be.default.data}, ${be.default.valCxt}`,n.$async,()=>{t.code((0,ce._)`"use strict"; ${LC(r,i)}`),LF(t,i),t.code(s)}):t.func(e,(0,ce._)`${be.default.data}, ${FF(i)}`,n.$async,()=>t.code(LC(r,i)).code(s))}function FF(t){return(0,ce._)`{${be.default.instancePath}="", ${be.default.parentData}, ${be.default.parentDataProperty}, ${be.default.rootData}=${be.default.data}${t.dynamicRef?(0,ce._)`, ${be.default.dynamicAnchors}={}`:ce.nil}}={}`}function LF(t,e){t.if(be.default.valCxt,()=>{t.var(be.default.instancePath,(0,ce._)`${be.default.valCxt}.${be.default.instancePath}`),t.var(be.default.parentData,(0,ce._)`${be.default.valCxt}.${be.default.parentData}`),t.var(be.default.parentDataProperty,(0,ce._)`${be.default.valCxt}.${be.default.parentDataProperty}`),t.var(be.default.rootData,(0,ce._)`${be.default.valCxt}.${be.default.rootData}`),e.dynamicRef&&t.var(be.default.dynamicAnchors,(0,ce._)`${be.default.valCxt}.${be.default.dynamicAnchors}`)},()=>{t.var(be.default.instancePath,(0,ce._)`""`),t.var(be.default.parentData,(0,ce._)`undefined`),t.var(be.default.parentDataProperty,(0,ce._)`undefined`),t.var(be.default.rootData,be.default.data),e.dynamicRef&&t.var(be.default.dynamicAnchors,(0,ce._)`{}`)})}function jF(t){let{schema:e,opts:r,gen:n}=t;HC(t,()=>{r.$comment&&e.$comment&&zC(t),WF(t),n.let(be.default.vErrors,null),n.let(be.default.errors,0),r.unevaluated&&UF(t),JC(t),zF(t)})}function UF(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,ce._)`${r}.evaluated`),e.if((0,ce._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,ce._)`${t.evaluated}.props`,(0,ce._)`undefined`)),e.if((0,ce._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,ce._)`${t.evaluated}.items`,(0,ce._)`undefined`))}function LC(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,ce._)`/*# sourceURL=${r} */`:ce.nil}function BF(t,e){if(WC(t)&&(YC(t),VC(t))){HF(t,e);return}(0,BC.boolOrEmptySchema)(t,e)}function VC({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function WC(t){return typeof t.schema!="boolean"}function HF(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&zC(t),YF(t),JF(t);let s=n.const("_errs",be.default.errors);JC(t,s),n.var(e,(0,ce._)`${s} === ${be.default.errors}`)}function YC(t){(0,Gi.checkUnknownRules)(t),VF(t)}function JC(t,e){if(t.opts.jtd)return jC(t,[],!1,e);let r=(0,FC.getSchemaTypes)(t.schema),n=(0,FC.coerceAndCheckDataType)(t,r);jC(t,r,!n,e)}function VF(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Gi.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function WF(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Gi.checkStrictMode)(t,"default is ignored in the schema root")}function YF(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,NF.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function JF(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function zC({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,ce._)`${be.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,ce.str)`${n}/$comment`,u=t.scopeValue("root",{ref:e.root});t.code((0,ce._)`${be.default.self}.opts.$comment(${s}, ${a}, ${u}.schema)`)}}function zF(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,ce._)`${be.default.errors} === 0`,()=>e.return(be.default.data),()=>e.throw((0,ce._)`new ${i}(${be.default.vErrors})`)):(e.assign((0,ce._)`${n}.errors`,be.default.vErrors),s.unevaluated&&KF(t),e.return((0,ce._)`${be.default.errors} === 0`))}function KF({gen:t,evaluated:e,props:r,items:n}){r instanceof ce.Name&&t.assign((0,ce._)`${e}.props`,r),n instanceof ce.Name&&t.assign((0,ce._)`${e}.items`,n)}function jC(t,e,r,n){let{gen:i,schema:s,data:a,allErrors:u,opts:f,self:h}=t,{RULES:g}=h;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,Gi.schemaHasRulesButRef)(s,g))){i.block(()=>GC(t,"$ref",g.all.$ref.definition));return}f.jtd||GF(t,e),i.block(()=>{for(let S of g.rules)m(S);m(g.post)});function m(S){(0,Jv.shouldUseGroup)(s,S)&&(S.type?(i.if((0,Ah.checkDataType)(S.type,a,f.strictNumbers)),UC(t,S),e.length===1&&e[0]===S.type&&r&&(i.else(),(0,Ah.reportTypeError)(t)),i.endIf()):UC(t,S),u||i.if((0,ce._)`${be.default.errors} === ${n||0}`))}}function UC(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,MF.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Jv.shouldUseRule)(n,s)&&GC(t,s.keyword,s.definition,e.type)})}function GF(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(QF(t,e),t.opts.allowUnionTypes||ZF(t,e),XF(t,t.dataTypes))}function QF(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{KC(t.dataTypes,r)||zv(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),tL(t,e)}}function ZF(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&zv(t,"use allowUnionTypes to allow union type keyword")}function XF(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,Jv.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>eL(e,a))&&zv(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function eL(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function KC(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function tL(t,e){let r=[];for(let n of t.dataTypes)KC(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function zv(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Gi.checkStrictMode)(t,e,t.opts.strictTypes)}var Th=class{constructor(e,r,n){if((0,ac.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Gi.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",QC(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ac.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",be.default.errors))}result(e,r,n){this.failResult((0,ce.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,ce.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,ce._)`${r} !== undefined && (${(0,ce.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?oc.reportExtraError:oc.reportError)(this,this.def.error,r)}$dataError(){(0,oc.reportError)(this,this.def.$dataError||oc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,oc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=ce.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=ce.nil,r=ce.nil){if(!this.$data)return;let{gen:n,schemaCode:i,schemaType:s,def:a}=this;n.if((0,ce.or)((0,ce._)`${i} === undefined`,r)),e!==ce.nil&&n.assign(e,!0),(s.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==ce.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:i,it:s}=this;return(0,ce.or)(a(),u());function a(){if(n.length){if(!(r instanceof ce.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,ce._)`${(0,Ah.checkDataTypes)(f,r,s.opts.strictNumbers,Ah.DataType.Wrong)}`}return ce.nil}function u(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,ce._)`!${f}(${r})`}return ce.nil}}subschema(e,r){let n=(0,Yv.getSubschema)(this.it,e);(0,Yv.extendSubschemaData)(n,this.it,e),(0,Yv.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return BF(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Gi.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Gi.mergeEvaluated.items(i,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(r,()=>this.mergeEvaluated(e,ce.Name)),!0}};Bs.KeywordCxt=Th;function GC(t,e,r,n){let i=new Th(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,ac.funcKeywordCode)(i,r):"macro"in r?(0,ac.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,ac.funcKeywordCode)(i,r)}var rL=/^\/(?:[^~]|~0|~1)*$/,nL=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function QC(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return be.default.rootData;if(t[0]==="/"){if(!rL.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=be.default.rootData}else{let h=nL.exec(t);if(!h)throw new Error(`Invalid JSON-pointer: ${t}`);let g=+h[1];if(i=h[2],i==="#"){if(g>=e)throw new Error(f("property/index",g));return n[e-g]}if(g>e)throw new Error(f("data",g));if(s=r[e-g],!i)return s}let a=s,u=i.split("/");for(let h of u)h&&(s=(0,ce._)`${s}${(0,ce.getProperty)((0,Gi.unescapeJsonPointer)(h))}`,a=(0,ce._)`${a} && ${s}`);return a;function f(h,g){return`Cannot access ${h} ${g} levels up, current level is ${e}`}}Bs.getData=QC});var qh=F(Gv=>{"use strict";Object.defineProperty(Gv,"__esModule",{value:!0});var Kv=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Gv.default=Kv});var uc=F(Xv=>{"use strict";Object.defineProperty(Xv,"__esModule",{value:!0});var Qv=sc(),Zv=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Qv.resolveUrl)(e,r,n),this.missingSchema=(0,Qv.normalizeId)((0,Qv.getFullPath)(e,this.missingRef))}};Xv.default=Zv});var Mh=F(hn=>{"use strict";Object.defineProperty(hn,"__esModule",{value:!0});hn.resolveSchema=hn.getCompilingSchema=hn.resolveRef=hn.compileSchema=hn.SchemaEnv=void 0;var jn=Me(),iL=qh(),Vo=Ki(),Un=sc(),ZC=Je(),sL=lc(),ul=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Un.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};hn.SchemaEnv=ul;function tS(t){let e=XC.call(this,t);if(e)return e;let r=(0,Un.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new jn.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),u;t.$async&&(u=a.scopeValue("Error",{ref:iL.default,code:(0,jn._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");t.validateName=f;let h={gen:a,allErrors:this.opts.allErrors,data:Vo.default.data,parentData:Vo.default.parentData,parentDataProperty:Vo.default.parentDataProperty,dataNames:[Vo.default.data],dataPathArr:[jn.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,jn.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:u,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:jn.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,jn._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(t),(0,sL.validateFunctionCode)(h),a.optimize(this.opts.code.optimize);let m=a.toString();g=`${a.scopeRefs(Vo.default.scope)}return ${m}`,this.opts.code.process&&(g=this.opts.code.process(g,t));let _=new Function(`${Vo.default.self}`,`${Vo.default.scope}`,g)(this,this.scope.get());if(this.scope.value(f,{ref:_}),_.errors=null,_.schema=t.schema,_.schemaEnv=t,t.$async&&(_.$async=!0),this.opts.code.source===!0&&(_.source={validateName:f,validateCode:m,scopeValues:a._values}),this.opts.unevaluated){let{props:C,items:x}=h;_.evaluated={props:C instanceof jn.Name?void 0:C,items:x instanceof jn.Name?void 0:x,dynamicProps:C instanceof jn.Name,dynamicItems:x instanceof jn.Name},_.source&&(_.source.evaluated=(0,jn.stringify)(_.evaluated))}return t.validate=_,t}catch(m){throw delete t.validate,delete t.validateName,g&&this.logger.error("Error compiling schema, function code:",g),m}finally{this._compilations.delete(t)}}hn.compileSchema=tS;function oL(t,e,r){var n;r=(0,Un.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=uL.call(this,t,r);if(s===void 0){let a=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:u}=this.opts;a&&(s=new ul({schema:a,schemaId:u,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=aL.call(this,s)}hn.resolveRef=oL;function aL(t){return(0,Un.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:tS.call(this,t)}function XC(t){for(let e of this._compilations)if(lL(e,t))return e}hn.getCompilingSchema=XC;function lL(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function uL(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||$h.call(this,t,e)}function $h(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Un._getFullPath)(this.opts.uriResolver,r),i=(0,Un.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return eS.call(this,r,t);let s=(0,Un.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let u=$h.call(this,t,a);return typeof u?.schema!="object"?void 0:eS.call(this,r,u)}if(typeof a?.schema=="object"){if(a.validate||tS.call(this,a),s===(0,Un.normalizeId)(e)){let{schema:u}=a,{schemaId:f}=this.opts,h=u[f];return h&&(i=(0,Un.resolveUrl)(this.opts.uriResolver,i,h)),new ul({schema:u,schemaId:f,root:t,baseId:i})}return eS.call(this,r,a)}}hn.resolveSchema=$h;var cL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function eS(t,{baseId:e,schema:r,root:n}){var i;if(((i=t.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let u of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let f=r[(0,ZC.unescapeFragment)(u)];if(f===void 0)return;r=f;let h=typeof r=="object"&&r[this.opts.schemaId];!cL.has(u)&&h&&(e=(0,Un.resolveUrl)(this.opts.uriResolver,e,h))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,ZC.schemaHasRulesButRef)(r,this.RULES)){let u=(0,Un.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=$h.call(this,n,u)}let{schemaId:a}=this.opts;if(s=s||new ul({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var ex=F((Z3,fL)=>{fL.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var nS=F((X3,ix)=>{"use strict";var dL=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),rx=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function rS(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var hL=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function tx(t){return t.length=0,!0}function pL(t,e,r){if(t.length){let n=rS(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function mL(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,u=pL;for(let f=0;f<t.length;f++){let h=t[f];if(!(h==="["||h==="]"))if(h===":"){if(s===!0&&(a=!0),!u(i,n,r))break;if(++e>7){r.error=!0;break}f>0&&t[f-1]===":"&&(s=!0),n.push(":");continue}else if(h==="%"){if(!u(i,n,r))break;u=tx}else{i.push(h);continue}}return i.length&&(u===tx?r.zone=i.join(""):a?n.push(i.join("")):n.push(rS(i))),r.address=n.join(""),r}function nx(t){if(gL(t,":")<2)return{host:t,isIPV6:!1};let e=mL(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function gL(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function yL(t){let e=t,r=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(i===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(i===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}function vL(t,e){let r=e!==!0?escape:unescape;return t.scheme!==void 0&&(t.scheme=r(t.scheme)),t.userinfo!==void 0&&(t.userinfo=r(t.userinfo)),t.host!==void 0&&(t.host=r(t.host)),t.path!==void 0&&(t.path=r(t.path)),t.query!==void 0&&(t.query=r(t.query)),t.fragment!==void 0&&(t.fragment=r(t.fragment)),t}function SL(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!rx(r)){let n=nx(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=t.host}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}ix.exports={nonSimpleDomain:hL,recomposeAuthority:SL,normalizeComponentEncoding:vL,removeDotSegments:yL,isIPv4:rx,isUUID:dL,normalizeIPv6:nx,stringArrayToHexStripped:rS}});var ux=F((e6,lx)=>{"use strict";var{isUUID:bL}=nS(),_L=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,wL=["http","https","ws","wss","urn","urn:uuid"];function EL(t){return wL.indexOf(t)!==-1}function iS(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function sx(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function ox(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function CL(t){return t.secure=iS(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function xL(t){if((t.port===(iS(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function RL(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(_L);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let i=`${n}:${e.nid||t.nid}`,s=sS(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function IL(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),i=`${r}:${e.nid||n}`,s=sS(i);s&&(t=s.serialize(t,e));let a=t,u=t.nss;return a.path=`${n||e.nid}:${u}`,e.skipEscape=!0,a}function OL(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!bL(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function PL(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var ax={scheme:"http",domainHost:!0,parse:sx,serialize:ox},kL={scheme:"https",domainHost:ax.domainHost,parse:sx,serialize:ox},Nh={scheme:"ws",domainHost:!0,parse:CL,serialize:xL},AL={scheme:"wss",domainHost:Nh.domainHost,parse:Nh.parse,serialize:Nh.serialize},TL={scheme:"urn",parse:RL,serialize:IL,skipNormalize:!0},qL={scheme:"urn:uuid",parse:OL,serialize:PL,skipNormalize:!0},Dh={http:ax,https:kL,ws:Nh,wss:AL,urn:TL,"urn:uuid":qL};Object.setPrototypeOf(Dh,null);function sS(t){return t&&(Dh[t]||Dh[t.toLowerCase()])||void 0}lx.exports={wsIsSecure:iS,SCHEMES:Dh,isValidSchemeName:EL,getSchemeHandler:sS}});var dx=F((t6,Lh)=>{"use strict";var{normalizeIPv6:$L,removeDotSegments:cc,recomposeAuthority:ML,normalizeComponentEncoding:Fh,isIPv4:NL,nonSimpleDomain:DL}=nS(),{SCHEMES:FL,getSchemeHandler:cx}=ux();function LL(t,e){return typeof t=="string"?t=vi(Qi(t,e),e):typeof t=="object"&&(t=Qi(vi(t,e),e)),t}function jL(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=fx(Qi(t,n),Qi(e,n),n,!0);return n.skipEscape=!0,vi(i,n)}function fx(t,e,r,n){let i={};return n||(t=Qi(vi(t,r),r),e=Qi(vi(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=cc(e.path||""),i.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=cc(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=cc(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?i.path="/"+e.path:t.path?i.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=cc(i.path)),i.query=e.query):(i.path=t.path,e.query!==void 0?i.query=e.query:i.query=t.query),i.userinfo=t.userinfo,i.host=t.host,i.port=t.port),i.scheme=t.scheme),i.fragment=e.fragment,i}function UL(t,e,r){return typeof t=="string"?(t=unescape(t),t=vi(Fh(Qi(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=vi(Fh(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=vi(Fh(Qi(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=vi(Fh(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function vi(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),i=[],s=cx(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&i.push(r.scheme,":");let a=ML(r);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),r.path&&r.path[0]!=="/"&&i.push("/")),r.path!==void 0){let u=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(u=cc(u)),a===void 0&&u[0]==="/"&&u[1]==="/"&&(u="/%2F"+u.slice(2)),i.push(u)}return r.query!==void 0&&i.push("?",r.query),r.fragment!==void 0&&i.push("#",r.fragment),i.join("")}var BL=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Qi(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let s=t.match(BL);if(s){if(n.scheme=s[1],n.userinfo=s[3],n.host=s[4],n.port=parseInt(s[5],10),n.path=s[6]||"",n.query=s[7],n.fragment=s[8],isNaN(n.port)&&(n.port=s[5]),n.host)if(NL(n.host)===!1){let f=$L(n.host);n.host=f.host.toLowerCase(),i=f.isIPV6}else i=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let a=cx(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&i===!1&&DL(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}(!a||a&&!a.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=unescape(n.host))),n.path&&(n.path=escape(unescape(n.path))),n.fragment&&(n.fragment=encodeURI(decodeURIComponent(n.fragment)))),a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var oS={SCHEMES:FL,normalize:LL,resolve:jL,resolveComponent:fx,equal:UL,serialize:vi,parse:Qi};Lh.exports=oS;Lh.exports.default=oS;Lh.exports.fastUri=oS});var px=F(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});var hx=dx();hx.code='require("ajv/dist/runtime/uri").default';aS.default=hx});var wx=F(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.CodeGen=Qt.Name=Qt.nil=Qt.stringify=Qt.str=Qt._=Qt.KeywordCxt=void 0;var HL=lc();Object.defineProperty(Qt,"KeywordCxt",{enumerable:!0,get:function(){return HL.KeywordCxt}});var cl=Me();Object.defineProperty(Qt,"_",{enumerable:!0,get:function(){return cl._}});Object.defineProperty(Qt,"str",{enumerable:!0,get:function(){return cl.str}});Object.defineProperty(Qt,"stringify",{enumerable:!0,get:function(){return cl.stringify}});Object.defineProperty(Qt,"nil",{enumerable:!0,get:function(){return cl.nil}});Object.defineProperty(Qt,"Name",{enumerable:!0,get:function(){return cl.Name}});Object.defineProperty(Qt,"CodeGen",{enumerable:!0,get:function(){return cl.CodeGen}});var VL=qh(),Sx=uc(),WL=Nv(),fc=Mh(),YL=Me(),dc=sc(),jh=ic(),uS=Je(),mx=ex(),JL=px(),bx=(t,e)=>new RegExp(t,e);bx.code="new RegExp";var zL=["removeAdditional","useDefaults","coerceTypes"],KL=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),GL={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},QL={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},gx=200;function ZL(t){var e,r,n,i,s,a,u,f,h,g,m,S,_,C,x,A,T,j,Y,V,K,ee,k,E,P;let N=t.strict,D=(e=t.code)===null||e===void 0?void 0:e.optimize,L=D===!0||D===void 0?1:D||0,z=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:bx,Z=(i=t.uriResolver)!==null&&i!==void 0?i:JL.default;return{strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:N)!==null&&a!==void 0?a:!0,strictNumbers:(f=(u=t.strictNumbers)!==null&&u!==void 0?u:N)!==null&&f!==void 0?f:!0,strictTypes:(g=(h=t.strictTypes)!==null&&h!==void 0?h:N)!==null&&g!==void 0?g:"log",strictTuples:(S=(m=t.strictTuples)!==null&&m!==void 0?m:N)!==null&&S!==void 0?S:"log",strictRequired:(C=(_=t.strictRequired)!==null&&_!==void 0?_:N)!==null&&C!==void 0?C:!1,code:t.code?{...t.code,optimize:L,regExp:z}:{optimize:L,regExp:z},loopRequired:(x=t.loopRequired)!==null&&x!==void 0?x:gx,loopEnum:(A=t.loopEnum)!==null&&A!==void 0?A:gx,meta:(T=t.meta)!==null&&T!==void 0?T:!0,messages:(j=t.messages)!==null&&j!==void 0?j:!0,inlineRefs:(Y=t.inlineRefs)!==null&&Y!==void 0?Y:!0,schemaId:(V=t.schemaId)!==null&&V!==void 0?V:"$id",addUsedSchema:(K=t.addUsedSchema)!==null&&K!==void 0?K:!0,validateSchema:(ee=t.validateSchema)!==null&&ee!==void 0?ee:!0,validateFormats:(k=t.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:(E=t.unicodeRegExp)!==null&&E!==void 0?E:!0,int32range:(P=t.int32range)!==null&&P!==void 0?P:!0,uriResolver:Z}}var hc=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...ZL(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new YL.ValueScope({scope:{},prefixes:KL,es5:r,lines:n}),this.logger=ij(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,WL.getRules)(),yx.call(this,GL,e,"NOT SUPPORTED"),yx.call(this,QL,e,"DEPRECATED","warn"),this._metaOpts=rj.call(this),e.formats&&ej.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&tj.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),XL.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=mx;n==="id"&&(i={...mx},i.id=i.$id,delete i.$id),r&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let i=n(r);return"$async"in n||(this.errors=n.errors),i}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return i.call(this,e,r);async function i(g,m){await s.call(this,g.$schema);let S=this._addSchema(g,m);return S.validate||a.call(this,S)}async function s(g){g&&!this.getSchema(g)&&await i.call(this,{$ref:g},!0)}async function a(g){try{return this._compileSchemaEnv(g)}catch(m){if(!(m instanceof Sx.default))throw m;return u.call(this,m),await f.call(this,m.missingSchema),a.call(this,g)}}function u({missingSchema:g,missingRef:m}){if(this.refs[g])throw new Error(`AnySchema ${g} is loaded but ${m} cannot be resolved`)}async function f(g){let m=await h.call(this,g);this.refs[g]||await s.call(this,m.$schema),this.refs[g]||this.addSchema(m,g,r)}async function h(g){let m=this._loading[g];if(m)return m;try{return await(this._loading[g]=n(g))}finally{delete this._loading[g]}}}addSchema(e,r,n,i=this.opts.validateSchema){if(Array.isArray(e)){for(let a of e)this.addSchema(a,void 0,n,i);return this}let s;if(typeof e=="object"){let{schemaId:a}=this.opts;if(s=e[a],s!==void 0&&typeof s!="string")throw new Error(`schema ${a} must be string`)}return r=(0,dc.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,i,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let i=this.validate(n,e);if(!i&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return i}getSchema(e){let r;for(;typeof(r=vx.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new fc.SchemaEnv({schema:{},schemaId:n});if(r=fc.resolveSchema.call(this,i,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=vx.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,dc.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(oj.call(this,n,r),!r)return(0,uS.eachItem)(n,s=>lS.call(this,s)),this;lj.call(this,r);let i={...r,type:(0,jh.getJSONTypes)(r.type),schemaType:(0,jh.getJSONTypes)(r.schemaType)};return(0,uS.eachItem)(n,i.type.length===0?s=>lS.call(this,s,i):s=>i.type.forEach(a=>lS.call(this,s,i,a))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of r){let s=i.split("/").slice(1),a=e;for(let u of s)a=a[u];for(let u in n){let f=n[u];if(typeof f!="object")continue;let{$data:h}=f.definition,g=a[u];h&&g&&(a[u]=_x(g))}}return e}_removeAllSchemas(e,r){for(let n in e){let i=e[n];(!r||r.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,r,n,i=this.opts.validateSchema,s=this.opts.addUsedSchema){let a,{schemaId:u}=this.opts;if(typeof e=="object")a=e[u];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let f=this._cache.get(e);if(f!==void 0)return f;n=(0,dc.normalizeId)(a||n);let h=dc.getSchemaRefs.call(this,e,n);return f=new fc.SchemaEnv({schema:e,schemaId:u,meta:r,baseId:n,localRefs:h}),this._cache.set(f.schema,f),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=f),i&&this.validateSchema(e,!0),f}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):fc.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{fc.compileSchema.call(this,e)}finally{this.opts=r}}};hc.ValidationError=VL.default;hc.MissingRefError=Sx.default;Qt.default=hc;function yx(t,e,r,n="error"){for(let i in t){let s=i;s in e&&this.logger[n](`${r}: option ${i}. ${t[s]}`)}}function vx(t){return t=(0,dc.normalizeId)(t),this.schemas[t]||this.refs[t]}function XL(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function ej(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function tj(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function rj(){let t={...this.opts};for(let e of zL)delete t[e];return t}var nj={log(){},warn(){},error(){}};function ij(t){if(t===!1)return nj;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var sj=/^[a-z_$][a-z0-9_$:-]*$/i;function oj(t,e){let{RULES:r}=this;if((0,uS.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!sj.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function lS(t,e,r){var n;let i=e?.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,a=i?s.post:s.rules.find(({type:f})=>f===r);if(a||(a={type:r,rules:[]},s.rules.push(a)),s.keywords[t]=!0,!e)return;let u={keyword:t,definition:{...e,type:(0,jh.getJSONTypes)(e.type),schemaType:(0,jh.getJSONTypes)(e.schemaType)}};e.before?aj.call(this,a,u,e.before):a.rules.push(u),s.all[t]=u,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function aj(t,e,r){let n=t.rules.findIndex(i=>i.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function lj(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=_x(e)),t.validateSchema=this.compile(e,!0))}var uj={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function _x(t){return{anyOf:[t,uj]}}});var Ex=F(cS=>{"use strict";Object.defineProperty(cS,"__esModule",{value:!0});var cj={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};cS.default=cj});var Ix=F(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.callRef=Wo.getValidate=void 0;var fj=uc(),Cx=dn(),Tr=Me(),fl=Ki(),xx=Mh(),Uh=Je(),dj={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:i,schemaEnv:s,validateName:a,opts:u,self:f}=n,{root:h}=s;if((r==="#"||r==="#/")&&i===h.baseId)return m();let g=xx.resolveRef.call(f,h,i,r);if(g===void 0)throw new fj.default(n.opts.uriResolver,i,r);if(g instanceof xx.SchemaEnv)return S(g);return _(g);function m(){if(s===h)return Bh(t,a,s,s.$async);let C=e.scopeValue("root",{ref:h});return Bh(t,(0,Tr._)`${C}.validate`,h,h.$async)}function S(C){let x=Rx(t,C);Bh(t,x,C,C.$async)}function _(C){let x=e.scopeValue("schema",u.code.source===!0?{ref:C,code:(0,Tr.stringify)(C)}:{ref:C}),A=e.name("valid"),T=t.subschema({schema:C,dataTypes:[],schemaPath:Tr.nil,topSchemaRef:x,errSchemaPath:r},A);t.mergeEvaluated(T),t.ok(A)}}};function Rx(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Tr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Wo.getValidate=Rx;function Bh(t,e,r,n){let{gen:i,it:s}=t,{allErrors:a,schemaEnv:u,opts:f}=s,h=f.passContext?fl.default.this:Tr.nil;n?g():m();function g(){if(!u.$async)throw new Error("async schema referenced by sync schema");let C=i.let("valid");i.try(()=>{i.code((0,Tr._)`await ${(0,Cx.callValidateCode)(t,e,h)}`),_(e),a||i.assign(C,!0)},x=>{i.if((0,Tr._)`!(${x} instanceof ${s.ValidationError})`,()=>i.throw(x)),S(x),a||i.assign(C,!1)}),t.ok(C)}function m(){t.result((0,Cx.callValidateCode)(t,e,h),()=>_(e),()=>S(e))}function S(C){let x=(0,Tr._)`${C}.errors`;i.assign(fl.default.vErrors,(0,Tr._)`${fl.default.vErrors} === null ? ${x} : ${fl.default.vErrors}.concat(${x})`),i.assign(fl.default.errors,(0,Tr._)`${fl.default.vErrors}.length`)}function _(C){var x;if(!s.opts.unevaluated)return;let A=(x=r?.validate)===null||x===void 0?void 0:x.evaluated;if(s.props!==!0)if(A&&!A.dynamicProps)A.props!==void 0&&(s.props=Uh.mergeEvaluated.props(i,A.props,s.props));else{let T=i.var("props",(0,Tr._)`${C}.evaluated.props`);s.props=Uh.mergeEvaluated.props(i,T,s.props,Tr.Name)}if(s.items!==!0)if(A&&!A.dynamicItems)A.items!==void 0&&(s.items=Uh.mergeEvaluated.items(i,A.items,s.items));else{let T=i.var("items",(0,Tr._)`${C}.evaluated.items`);s.items=Uh.mergeEvaluated.items(i,T,s.items,Tr.Name)}}}Wo.callRef=Bh;Wo.default=dj});var Ox=F(fS=>{"use strict";Object.defineProperty(fS,"__esModule",{value:!0});var hj=Ex(),pj=Ix(),mj=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",hj.default,pj.default];fS.default=mj});var Px=F(dS=>{"use strict";Object.defineProperty(dS,"__esModule",{value:!0});var Hh=Me(),Hs=Hh.operators,Vh={maximum:{okStr:"<=",ok:Hs.LTE,fail:Hs.GT},minimum:{okStr:">=",ok:Hs.GTE,fail:Hs.LT},exclusiveMaximum:{okStr:"<",ok:Hs.LT,fail:Hs.GTE},exclusiveMinimum:{okStr:">",ok:Hs.GT,fail:Hs.LTE}},gj={message:({keyword:t,schemaCode:e})=>(0,Hh.str)`must be ${Vh[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Hh._)`{comparison: ${Vh[t].okStr}, limit: ${e}}`},yj={keyword:Object.keys(Vh),type:"number",schemaType:"number",$data:!0,error:gj,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Hh._)`${r} ${Vh[e].fail} ${n} || isNaN(${r})`)}};dS.default=yj});var kx=F(hS=>{"use strict";Object.defineProperty(hS,"__esModule",{value:!0});var pc=Me(),vj={message:({schemaCode:t})=>(0,pc.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,pc._)`{multipleOf: ${t}}`},Sj={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:vj,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,a=e.let("res"),u=s?(0,pc._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,pc._)`${a} !== parseInt(${a})`;t.fail$data((0,pc._)`(${n} === 0 || (${a} = ${r}/${n}, ${u}))`)}};hS.default=Sj});var Tx=F(pS=>{"use strict";Object.defineProperty(pS,"__esModule",{value:!0});function Ax(t){let e=t.length,r=0,n=0,i;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),(i&64512)===56320&&n++);return r}pS.default=Ax;Ax.code='require("ajv/dist/runtime/ucs2length").default'});var qx=F(mS=>{"use strict";Object.defineProperty(mS,"__esModule",{value:!0});var Yo=Me(),bj=Je(),_j=Tx(),wj={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Yo.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Yo._)`{limit: ${t}}`},Ej={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:wj,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?Yo.operators.GT:Yo.operators.LT,a=i.opts.unicode===!1?(0,Yo._)`${r}.length`:(0,Yo._)`${(0,bj.useFunc)(t.gen,_j.default)}(${r})`;t.fail$data((0,Yo._)`${a} ${s} ${n}`)}};mS.default=Ej});var $x=F(gS=>{"use strict";Object.defineProperty(gS,"__esModule",{value:!0});var Cj=dn(),Wh=Me(),xj={message:({schemaCode:t})=>(0,Wh.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Wh._)`{pattern: ${t}}`},Rj={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:xj,code(t){let{data:e,$data:r,schema:n,schemaCode:i,it:s}=t,a=s.opts.unicodeRegExp?"u":"",u=r?(0,Wh._)`(new RegExp(${i}, ${a}))`:(0,Cj.usePattern)(t,n);t.fail$data((0,Wh._)`!${u}.test(${e})`)}};gS.default=Rj});var Mx=F(yS=>{"use strict";Object.defineProperty(yS,"__esModule",{value:!0});var mc=Me(),Ij={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,mc.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,mc._)`{limit: ${t}}`},Oj={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Ij,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?mc.operators.GT:mc.operators.LT;t.fail$data((0,mc._)`Object.keys(${r}).length ${i} ${n}`)}};yS.default=Oj});var Nx=F(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});var gc=dn(),yc=Me(),Pj=Je(),kj={message:({params:{missingProperty:t}})=>(0,yc.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,yc._)`{missingProperty: ${t}}`},Aj={keyword:"required",type:"object",schemaType:"array",$data:!0,error:kj,code(t){let{gen:e,schema:r,schemaCode:n,data:i,$data:s,it:a}=t,{opts:u}=a;if(!s&&r.length===0)return;let f=r.length>=u.loopRequired;if(a.allErrors?h():g(),u.strictRequired){let _=t.parentSchema.properties,{definedProperties:C}=t.it;for(let x of r)if(_?.[x]===void 0&&!C.has(x)){let A=a.schemaEnv.baseId+a.errSchemaPath,T=`required property "${x}" is not defined at "${A}" (strictRequired)`;(0,Pj.checkStrictMode)(a,T,a.opts.strictRequired)}}function h(){if(f||s)t.block$data(yc.nil,m);else for(let _ of r)(0,gc.checkReportMissingProp)(t,_)}function g(){let _=e.let("missing");if(f||s){let C=e.let("valid",!0);t.block$data(C,()=>S(_,C)),t.ok(C)}else e.if((0,gc.checkMissingProp)(t,r,_)),(0,gc.reportMissingProp)(t,_),e.else()}function m(){e.forOf("prop",n,_=>{t.setParams({missingProperty:_}),e.if((0,gc.noPropertyInData)(e,i,_,u.ownProperties),()=>t.error())})}function S(_,C){t.setParams({missingProperty:_}),e.forOf(_,n,()=>{e.assign(C,(0,gc.propertyInData)(e,i,_,u.ownProperties)),e.if((0,yc.not)(C),()=>{t.error(),e.break()})},yc.nil)}}};vS.default=Aj});var Dx=F(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});var vc=Me(),Tj={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,vc.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,vc._)`{limit: ${t}}`},qj={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Tj,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?vc.operators.GT:vc.operators.LT;t.fail$data((0,vc._)`${r}.length ${i} ${n}`)}};SS.default=qj});var Yh=F(bS=>{"use strict";Object.defineProperty(bS,"__esModule",{value:!0});var Fx=Vv();Fx.code='require("ajv/dist/runtime/equal").default';bS.default=Fx});var Lx=F(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});var _S=ic(),Zt=Me(),$j=Je(),Mj=Yh(),Nj={message:({params:{i:t,j:e}})=>(0,Zt.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Zt._)`{i: ${t}, j: ${e}}`},Dj={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Nj,code(t){let{gen:e,data:r,$data:n,schema:i,parentSchema:s,schemaCode:a,it:u}=t;if(!n&&!i)return;let f=e.let("valid"),h=s.items?(0,_S.getSchemaTypes)(s.items):[];t.block$data(f,g,(0,Zt._)`${a} === false`),t.ok(f);function g(){let C=e.let("i",(0,Zt._)`${r}.length`),x=e.let("j");t.setParams({i:C,j:x}),e.assign(f,!0),e.if((0,Zt._)`${C} > 1`,()=>(m()?S:_)(C,x))}function m(){return h.length>0&&!h.some(C=>C==="object"||C==="array")}function S(C,x){let A=e.name("item"),T=(0,_S.checkDataTypes)(h,A,u.opts.strictNumbers,_S.DataType.Wrong),j=e.const("indices",(0,Zt._)`{}`);e.for((0,Zt._)`;${C}--;`,()=>{e.let(A,(0,Zt._)`${r}[${C}]`),e.if(T,(0,Zt._)`continue`),h.length>1&&e.if((0,Zt._)`typeof ${A} == "string"`,(0,Zt._)`${A} += "_"`),e.if((0,Zt._)`typeof ${j}[${A}] == "number"`,()=>{e.assign(x,(0,Zt._)`${j}[${A}]`),t.error(),e.assign(f,!1).break()}).code((0,Zt._)`${j}[${A}] = ${C}`)})}function _(C,x){let A=(0,$j.useFunc)(e,Mj.default),T=e.name("outer");e.label(T).for((0,Zt._)`;${C}--;`,()=>e.for((0,Zt._)`${x} = ${C}; ${x}--;`,()=>e.if((0,Zt._)`${A}(${r}[${C}], ${r}[${x}])`,()=>{t.error(),e.assign(f,!1).break(T)})))}}};wS.default=Dj});var jx=F(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});var ES=Me(),Fj=Je(),Lj=Yh(),jj={message:"must be equal to constant",params:({schemaCode:t})=>(0,ES._)`{allowedValue: ${t}}`},Uj={keyword:"const",$data:!0,error:jj,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,ES._)`!${(0,Fj.useFunc)(e,Lj.default)}(${r}, ${i})`):t.fail((0,ES._)`${s} !== ${r}`)}};CS.default=Uj});var Ux=F(xS=>{"use strict";Object.defineProperty(xS,"__esModule",{value:!0});var Sc=Me(),Bj=Je(),Hj=Yh(),Vj={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Sc._)`{allowedValues: ${t}}`},Wj={keyword:"enum",schemaType:"array",$data:!0,error:Vj,code(t){let{gen:e,data:r,$data:n,schema:i,schemaCode:s,it:a}=t;if(!n&&i.length===0)throw new Error("enum must have non-empty array");let u=i.length>=a.opts.loopEnum,f,h=()=>f??(f=(0,Bj.useFunc)(e,Hj.default)),g;if(u||n)g=e.let("valid"),t.block$data(g,m);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let _=e.const("vSchema",s);g=(0,Sc.or)(...i.map((C,x)=>S(_,x)))}t.pass(g);function m(){e.assign(g,!1),e.forOf("v",s,_=>e.if((0,Sc._)`${h()}(${r}, ${_})`,()=>e.assign(g,!0).break()))}function S(_,C){let x=i[C];return typeof x=="object"&&x!==null?(0,Sc._)`${h()}(${r}, ${_}[${C}])`:(0,Sc._)`${r} === ${x}`}}};xS.default=Wj});var Bx=F(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});var Yj=Px(),Jj=kx(),zj=qx(),Kj=$x(),Gj=Mx(),Qj=Nx(),Zj=Dx(),Xj=Lx(),e2=jx(),t2=Ux(),r2=[Yj.default,Jj.default,zj.default,Kj.default,Gj.default,Qj.default,Zj.default,Xj.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},e2.default,t2.default];RS.default=r2});var OS=F(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.validateAdditionalItems=void 0;var Jo=Me(),IS=Je(),n2={message:({params:{len:t}})=>(0,Jo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Jo._)`{limit: ${t}}`},i2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:n2,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,IS.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Hx(t,n)}};function Hx(t,e){let{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;let u=r.const("len",(0,Jo._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Jo._)`${u} <= ${e.length}`);else if(typeof n=="object"&&!(0,IS.alwaysValidSchema)(a,n)){let h=r.var("valid",(0,Jo._)`${u} <= ${e.length}`);r.if((0,Jo.not)(h),()=>f(h)),t.ok(h)}function f(h){r.forRange("i",e.length,u,g=>{t.subschema({keyword:s,dataProp:g,dataPropType:IS.Type.Num},h),a.allErrors||r.if((0,Jo.not)(h),()=>r.break())})}}bc.validateAdditionalItems=Hx;bc.default=i2});var PS=F(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.validateTuple=void 0;var Vx=Me(),Jh=Je(),s2=dn(),o2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Wx(t,"additionalItems",e);r.items=!0,!(0,Jh.alwaysValidSchema)(r,e)&&t.ok((0,s2.validateArray)(t))}};function Wx(t,e,r=t.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:u}=t;g(i),u.opts.unevaluated&&r.length&&u.items!==!0&&(u.items=Jh.mergeEvaluated.items(n,r.length,u.items));let f=n.name("valid"),h=n.const("len",(0,Vx._)`${s}.length`);r.forEach((m,S)=>{(0,Jh.alwaysValidSchema)(u,m)||(n.if((0,Vx._)`${h} > ${S}`,()=>t.subschema({keyword:a,schemaProp:S,dataProp:S},f)),t.ok(f))});function g(m){let{opts:S,errSchemaPath:_}=u,C=r.length,x=C===m.minItems&&(C===m.maxItems||m[e]===!1);if(S.strictTuples&&!x){let A=`"${a}" is ${C}-tuple, but minItems or maxItems/${e} are not specified or different at path "${_}"`;(0,Jh.checkStrictMode)(u,A,S.strictTuples)}}}_c.validateTuple=Wx;_c.default=o2});var Yx=F(kS=>{"use strict";Object.defineProperty(kS,"__esModule",{value:!0});var a2=PS(),l2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,a2.validateTuple)(t,"items")};kS.default=l2});var zx=F(AS=>{"use strict";Object.defineProperty(AS,"__esModule",{value:!0});var Jx=Me(),u2=Je(),c2=dn(),f2=OS(),d2={message:({params:{len:t}})=>(0,Jx.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Jx._)`{limit: ${t}}`},h2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:d2,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,u2.alwaysValidSchema)(n,e)&&(i?(0,f2.validateAdditionalItems)(t,i):t.ok((0,c2.validateArray)(t)))}};AS.default=h2});var Kx=F(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});var pn=Me(),zh=Je(),p2={message:({params:{min:t,max:e}})=>e===void 0?(0,pn.str)`must contain at least ${t} valid item(s)`:(0,pn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,pn._)`{minContains: ${t}}`:(0,pn._)`{minContains: ${t}, maxContains: ${e}}`},m2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:p2,code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t,a,u,{minContains:f,maxContains:h}=n;s.opts.next?(a=f===void 0?1:f,u=h):a=1;let g=e.const("len",(0,pn._)`${i}.length`);if(t.setParams({min:a,max:u}),u===void 0&&a===0){(0,zh.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(u!==void 0&&a>u){(0,zh.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,zh.alwaysValidSchema)(s,r)){let x=(0,pn._)`${g} >= ${a}`;u!==void 0&&(x=(0,pn._)`${x} && ${g} <= ${u}`),t.pass(x);return}s.items=!0;let m=e.name("valid");u===void 0&&a===1?_(m,()=>e.if(m,()=>e.break())):a===0?(e.let(m,!0),u!==void 0&&e.if((0,pn._)`${i}.length > 0`,S)):(e.let(m,!1),S()),t.result(m,()=>t.reset());function S(){let x=e.name("_valid"),A=e.let("count",0);_(x,()=>e.if(x,()=>C(A)))}function _(x,A){e.forRange("i",0,g,T=>{t.subschema({keyword:"contains",dataProp:T,dataPropType:zh.Type.Num,compositeRule:!0},x),A()})}function C(x){e.code((0,pn._)`${x}++`),u===void 0?e.if((0,pn._)`${x} >= ${a}`,()=>e.assign(m,!0).break()):(e.if((0,pn._)`${x} > ${u}`,()=>e.assign(m,!1).break()),a===1?e.assign(m,!0):e.if((0,pn._)`${x} >= ${a}`,()=>e.assign(m,!0)))}}};TS.default=m2});var Zx=F(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.validateSchemaDeps=Si.validatePropertyDeps=Si.error=void 0;var qS=Me(),g2=Je(),wc=dn();Si.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,qS.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,qS._)`{property: ${t},
|
|
28
28
|
missingProperty: ${n},
|
|
29
29
|
depsCount: ${e},
|
|
30
30
|
deps: ${r}}`};var y2={keyword:"dependencies",type:"object",schemaType:"object",error:Si.error,code(t){let[e,r]=v2(t);Gx(t,e),Qx(t,r)}};function v2({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let i=Array.isArray(t[n])?e:r;i[n]=t[n]}return[e,r]}function Gx(t,e=t.schema){let{gen:r,data:n,it:i}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let a in e){let u=e[a];if(u.length===0)continue;let f=(0,wc.propertyInData)(r,n,a,i.opts.ownProperties);t.setParams({property:a,depsCount:u.length,deps:u.join(", ")}),i.allErrors?r.if(f,()=>{for(let h of u)(0,wc.checkReportMissingProp)(t,h)}):(r.if((0,qS._)`${f} && (${(0,wc.checkMissingProp)(t,u,s)})`),(0,wc.reportMissingProp)(t,s),r.else())}}Si.validatePropertyDeps=Gx;function Qx(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,a=r.name("valid");for(let u in e)(0,g2.alwaysValidSchema)(s,e[u])||(r.if((0,wc.propertyInData)(r,n,u,s.opts.ownProperties),()=>{let f=t.subschema({keyword:i,schemaProp:u},a);t.mergeValidEvaluated(f,a)},()=>r.var(a,!0)),t.ok(a))}Si.validateSchemaDeps=Qx;Si.default=y2});var eR=F($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});var Xx=Me(),S2=Je(),b2={message:"property name must be valid",params:({params:t})=>(0,Xx._)`{propertyName: ${t.propertyName}}`},_2={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:b2,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,S2.alwaysValidSchema)(i,r))return;let s=e.name("valid");e.forIn("key",n,a=>{t.setParams({propertyName:a}),t.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),e.if((0,Xx.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};$S.default=_2});var NS=F(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});var Kh=dn(),Bn=Me(),w2=Ki(),Gh=Je(),E2={message:"must NOT have additional properties",params:({params:t})=>(0,Bn._)`{additionalProperty: ${t.additionalProperty}}`},C2={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:E2,code(t){let{gen:e,schema:r,parentSchema:n,data:i,errsCount:s,it:a}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:u,opts:f}=a;if(a.props=!0,f.removeAdditional!=="all"&&(0,Gh.alwaysValidSchema)(a,r))return;let h=(0,Kh.allSchemaProperties)(n.properties),g=(0,Kh.allSchemaProperties)(n.patternProperties);m(),t.ok((0,Bn._)`${s} === ${w2.default.errors}`);function m(){e.forIn("key",i,A=>{!h.length&&!g.length?C(A):e.if(S(A),()=>C(A))})}function S(A){let T;if(h.length>8){let j=(0,Gh.schemaRefOrVal)(a,n.properties,"properties");T=(0,Kh.isOwnProperty)(e,j,A)}else h.length?T=(0,Bn.or)(...h.map(j=>(0,Bn._)`${A} === ${j}`)):T=Bn.nil;return g.length&&(T=(0,Bn.or)(T,...g.map(j=>(0,Bn._)`${(0,Kh.usePattern)(t,j)}.test(${A})`))),(0,Bn.not)(T)}function _(A){e.code((0,Bn._)`delete ${i}[${A}]`)}function C(A){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){_(A);return}if(r===!1){t.setParams({additionalProperty:A}),t.error(),u||e.break();return}if(typeof r=="object"&&!(0,Gh.alwaysValidSchema)(a,r)){let T=e.name("valid");f.removeAdditional==="failing"?(x(A,T,!1),e.if((0,Bn.not)(T),()=>{t.reset(),_(A)})):(x(A,T),u||e.if((0,Bn.not)(T),()=>e.break()))}}function x(A,T,j){let Y={keyword:"additionalProperties",dataProp:A,dataPropType:Gh.Type.Str};j===!1&&Object.assign(Y,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(Y,T)}}};MS.default=C2});var nR=F(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});var x2=lc(),tR=dn(),DS=Je(),rR=NS(),R2={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:i,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&rR.default.code(new x2.KeywordCxt(s,rR.default,"additionalProperties"));let a=(0,tR.allSchemaProperties)(r);for(let m of a)s.definedProperties.add(m);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=DS.mergeEvaluated.props(e,(0,DS.toHash)(a),s.props));let u=a.filter(m=>!(0,DS.alwaysValidSchema)(s,r[m]));if(u.length===0)return;let f=e.name("valid");for(let m of u)h(m)?g(m):(e.if((0,tR.propertyInData)(e,i,m,s.opts.ownProperties)),g(m),s.allErrors||e.else().var(f,!0),e.endIf()),t.it.definedProperties.add(m),t.ok(f);function h(m){return s.opts.useDefaults&&!s.compositeRule&&r[m].default!==void 0}function g(m){t.subschema({keyword:"properties",schemaProp:m,dataProp:m},f)}}};FS.default=R2});var aR=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var iR=dn(),Qh=Me(),sR=Je(),oR=Je(),I2={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:i,it:s}=t,{opts:a}=s,u=(0,iR.allSchemaProperties)(r),f=u.filter(x=>(0,sR.alwaysValidSchema)(s,r[x]));if(u.length===0||f.length===u.length&&(!s.opts.unevaluated||s.props===!0))return;let h=a.strictSchema&&!a.allowMatchingProperties&&i.properties,g=e.name("valid");s.props!==!0&&!(s.props instanceof Qh.Name)&&(s.props=(0,oR.evaluatedPropsToName)(e,s.props));let{props:m}=s;S();function S(){for(let x of u)h&&_(x),s.allErrors?C(x):(e.var(g,!0),C(x),e.if(g))}function _(x){for(let A in h)new RegExp(x).test(A)&&(0,sR.checkStrictMode)(s,`property ${A} matches pattern ${x} (use allowMatchingProperties)`)}function C(x){e.forIn("key",n,A=>{e.if((0,Qh._)`${(0,iR.usePattern)(t,x)}.test(${A})`,()=>{let T=f.includes(x);T||t.subschema({keyword:"patternProperties",schemaProp:x,dataProp:A,dataPropType:oR.Type.Str},g),s.opts.unevaluated&&m!==!0?e.assign((0,Qh._)`${m}[${A}]`,!0):!T&&!s.allErrors&&e.if((0,Qh.not)(g),()=>e.break())})})}}};LS.default=I2});var lR=F(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var O2=Je(),P2={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,O2.alwaysValidSchema)(n,r)){t.fail();return}let i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};jS.default=P2});var uR=F(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var k2=dn(),A2={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:k2.validateUnion,error:{message:"must match a schema in anyOf"}};US.default=A2});var cR=F(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});var Zh=Me(),T2=Je(),q2={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,Zh._)`{passingSchemas: ${t.passing}}`},$2={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:q2,code(t){let{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=r,a=e.let("valid",!1),u=e.let("passing",null),f=e.name("_valid");t.setParams({passing:u}),e.block(h),t.result(a,()=>t.reset(),()=>t.error(!0));function h(){s.forEach((g,m)=>{let S;(0,T2.alwaysValidSchema)(i,g)?e.var(f,!0):S=t.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},f),m>0&&e.if((0,Zh._)`${f} && ${a}`).assign(a,!1).assign(u,(0,Zh._)`[${u}, ${m}]`).else(),e.if(f,()=>{e.assign(a,!0),e.assign(u,m),S&&t.mergeEvaluated(S,Zh.Name)})})}}};BS.default=$2});var fR=F(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});var M2=Je(),N2={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let i=e.name("valid");r.forEach((s,a)=>{if((0,M2.alwaysValidSchema)(n,s))return;let u=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(u)})}};HS.default=N2});var pR=F(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var Xh=Me(),hR=Je(),D2={message:({params:t})=>(0,Xh.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Xh._)`{failingKeyword: ${t.ifClause}}`},F2={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:D2,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,hR.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=dR(n,"then"),s=dR(n,"else");if(!i&&!s)return;let a=e.let("valid",!0),u=e.name("_valid");if(f(),t.reset(),i&&s){let g=e.let("ifClause");t.setParams({ifClause:g}),e.if(u,h("then",g),h("else",g))}else i?e.if(u,h("then")):e.if((0,Xh.not)(u),h("else"));t.pass(a,()=>t.error(!0));function f(){let g=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);t.mergeEvaluated(g)}function h(g,m){return()=>{let S=t.subschema({keyword:g},u);e.assign(a,u),t.mergeValidEvaluated(S,a),m?e.assign(m,(0,Xh._)`${g}`):t.setParams({ifClause:g})}}}};function dR(t,e){let r=t.schema[e];return r!==void 0&&!(0,hR.alwaysValidSchema)(t,r)}VS.default=F2});var mR=F(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});var L2=Je(),j2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,L2.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};WS.default=j2});var gR=F(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});var U2=OS(),B2=Yx(),H2=PS(),V2=zx(),W2=Kx(),Y2=Zx(),J2=eR(),z2=NS(),K2=nR(),G2=aR(),Q2=lR(),Z2=uR(),X2=cR(),eU=fR(),tU=pR(),rU=mR();function nU(t=!1){let e=[Q2.default,Z2.default,X2.default,eU.default,tU.default,rU.default,J2.default,z2.default,Y2.default,K2.default,G2.default];return t?e.push(B2.default,V2.default):e.push(U2.default,H2.default),e.push(W2.default),e}YS.default=nU});var yR=F(JS=>{"use strict";Object.defineProperty(JS,"__esModule",{value:!0});var $t=Me(),iU={message:({schemaCode:t})=>(0,$t.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,$t._)`{format: ${t}}`},sU={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:iU,code(t,e){let{gen:r,data:n,$data:i,schema:s,schemaCode:a,it:u}=t,{opts:f,errSchemaPath:h,schemaEnv:g,self:m}=u;if(!f.validateFormats)return;i?S():_();function S(){let C=r.scopeValue("formats",{ref:m.formats,code:f.code.formats}),x=r.const("fDef",(0,$t._)`${C}[${a}]`),A=r.let("fType"),T=r.let("format");r.if((0,$t._)`typeof ${x} == "object" && !(${x} instanceof RegExp)`,()=>r.assign(A,(0,$t._)`${x}.type || "string"`).assign(T,(0,$t._)`${x}.validate`),()=>r.assign(A,(0,$t._)`"string"`).assign(T,x)),t.fail$data((0,$t.or)(j(),Y()));function j(){return f.strictSchema===!1?$t.nil:(0,$t._)`${a} && !${T}`}function Y(){let V=g.$async?(0,$t._)`(${x}.async ? await ${T}(${n}) : ${T}(${n}))`:(0,$t._)`${T}(${n})`,K=(0,$t._)`(typeof ${T} == "function" ? ${V} : ${T}.test(${n}))`;return(0,$t._)`${T} && ${T} !== true && ${A} === ${e} && !${K}`}}function _(){let C=m.formats[s];if(!C){j();return}if(C===!0)return;let[x,A,T]=Y(C);x===e&&t.pass(V());function j(){if(f.strictSchema===!1){m.logger.warn(K());return}throw new Error(K());function K(){return`unknown format "${s}" ignored in schema at path "${h}"`}}function Y(K){let ee=K instanceof RegExp?(0,$t.regexpCode)(K):f.code.formats?(0,$t._)`${f.code.formats}${(0,$t.getProperty)(s)}`:void 0,k=r.scopeValue("formats",{key:s,ref:K,code:ee});return typeof K=="object"&&!(K instanceof RegExp)?[K.type||"string",K.validate,(0,$t._)`${k}.validate`]:["string",K,k]}function V(){if(typeof C=="object"&&!(C instanceof RegExp)&&C.async){if(!g.$async)throw new Error("async format in sync schema");return(0,$t._)`await ${T}(${n})`}return typeof A=="function"?(0,$t._)`${T}(${n})`:(0,$t._)`${T}.test(${n})`}}}};JS.default=sU});var vR=F(zS=>{"use strict";Object.defineProperty(zS,"__esModule",{value:!0});var oU=yR(),aU=[oU.default];zS.default=aU});var SR=F(dl=>{"use strict";Object.defineProperty(dl,"__esModule",{value:!0});dl.contentVocabulary=dl.metadataVocabulary=void 0;dl.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];dl.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var _R=F(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var lU=Ox(),uU=Bx(),cU=gR(),fU=vR(),bR=SR(),dU=[lU.default,uU.default,(0,cU.default)(),fU.default,bR.metadataVocabulary,bR.contentVocabulary];KS.default=dU});var ER=F(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.DiscrError=void 0;var wR;(function(t){t.Tag="tag",t.Mapping="mapping"})(wR||(ep.DiscrError=wR={}))});var xR=F(QS=>{"use strict";Object.defineProperty(QS,"__esModule",{value:!0});var hl=Me(),GS=ER(),CR=Mh(),hU=uc(),pU=Je(),mU={message:({params:{discrError:t,tagName:e}})=>t===GS.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,hl._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},gU={keyword:"discriminator",type:"object",schemaType:"object",error:mU,code(t){let{gen:e,data:r,schema:n,parentSchema:i,it:s}=t,{oneOf:a}=i;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let u=n.propertyName;if(typeof u!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!a)throw new Error("discriminator: requires oneOf keyword");let f=e.let("valid",!1),h=e.const("tag",(0,hl._)`${r}${(0,hl.getProperty)(u)}`);e.if((0,hl._)`typeof ${h} == "string"`,()=>g(),()=>t.error(!1,{discrError:GS.DiscrError.Tag,tag:h,tagName:u})),t.ok(f);function g(){let _=S();e.if(!1);for(let C in _)e.elseIf((0,hl._)`${h} === ${C}`),e.assign(f,m(_[C]));e.else(),t.error(!1,{discrError:GS.DiscrError.Mapping,tag:h,tagName:u}),e.endIf()}function m(_){let C=e.name("valid"),x=t.subschema({keyword:"oneOf",schemaProp:_},C);return t.mergeEvaluated(x,hl.Name),C}function S(){var _;let C={},x=T(i),A=!0;for(let V=0;V<a.length;V++){let K=a[V];if(K?.$ref&&!(0,pU.schemaHasRulesButRef)(K,s.self.RULES)){let k=K.$ref;if(K=CR.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,k),K instanceof CR.SchemaEnv&&(K=K.schema),K===void 0)throw new hU.default(s.opts.uriResolver,s.baseId,k)}let ee=(_=K?.properties)===null||_===void 0?void 0:_[u];if(typeof ee!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${u}"`);A=A&&(x||T(K)),j(ee,V)}if(!A)throw new Error(`discriminator: "${u}" must be required`);return C;function T({required:V}){return Array.isArray(V)&&V.includes(u)}function j(V,K){if(V.const)Y(V.const,K);else if(V.enum)for(let ee of V.enum)Y(ee,K);else throw new Error(`discriminator: "properties/${u}" must have "const" or "enum"`)}function Y(V,K){if(typeof V!="string"||V in C)throw new Error(`discriminator: "${u}" values must be unique strings`);C[V]=K}}}};QS.default=gU});var RR=F((H6,yU)=>{yU.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var OR=F((ht,ZS)=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.MissingRefError=ht.ValidationError=ht.CodeGen=ht.Name=ht.nil=ht.stringify=ht.str=ht._=ht.KeywordCxt=ht.Ajv=void 0;var vU=wx(),SU=_R(),bU=xR(),IR=RR(),_U=["/properties"],tp="http://json-schema.org/draft-07/schema",pl=class extends vU.default{_addVocabularies(){super._addVocabularies(),SU.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(bU.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(IR,_U):IR;this.addMetaSchema(e,tp,!1),this.refs["http://json-schema.org/schema"]=tp}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(tp)?tp:void 0)}};ht.Ajv=pl;ZS.exports=ht=pl;ZS.exports.Ajv=pl;Object.defineProperty(ht,"__esModule",{value:!0});ht.default=pl;var wU=lc();Object.defineProperty(ht,"KeywordCxt",{enumerable:!0,get:function(){return wU.KeywordCxt}});var ml=Me();Object.defineProperty(ht,"_",{enumerable:!0,get:function(){return ml._}});Object.defineProperty(ht,"str",{enumerable:!0,get:function(){return ml.str}});Object.defineProperty(ht,"stringify",{enumerable:!0,get:function(){return ml.stringify}});Object.defineProperty(ht,"nil",{enumerable:!0,get:function(){return ml.nil}});Object.defineProperty(ht,"Name",{enumerable:!0,get:function(){return ml.Name}});Object.defineProperty(ht,"CodeGen",{enumerable:!0,get:function(){return ml.CodeGen}});var EU=qh();Object.defineProperty(ht,"ValidationError",{enumerable:!0,get:function(){return EU.default}});var CU=uc();Object.defineProperty(ht,"MissingRefError",{enumerable:!0,get:function(){return CU.default}})});var Ve=F(tr=>{"use strict";var mb=Symbol.for("yaml.alias"),DR=Symbol.for("yaml.document"),fp=Symbol.for("yaml.map"),FR=Symbol.for("yaml.pair"),gb=Symbol.for("yaml.scalar"),dp=Symbol.for("yaml.seq"),Xi=Symbol.for("yaml.node.type"),tB=t=>!!t&&typeof t=="object"&&t[Xi]===mb,rB=t=>!!t&&typeof t=="object"&&t[Xi]===DR,nB=t=>!!t&&typeof t=="object"&&t[Xi]===fp,iB=t=>!!t&&typeof t=="object"&&t[Xi]===FR,LR=t=>!!t&&typeof t=="object"&&t[Xi]===gb,sB=t=>!!t&&typeof t=="object"&&t[Xi]===dp;function jR(t){if(t&&typeof t=="object")switch(t[Xi]){case fp:case dp:return!0}return!1}function oB(t){if(t&&typeof t=="object")switch(t[Xi]){case mb:case fp:case gb:case dp:return!0}return!1}var aB=t=>(LR(t)||jR(t))&&!!t.anchor;tr.ALIAS=mb;tr.DOC=DR;tr.MAP=fp;tr.NODE_TYPE=Xi;tr.PAIR=FR;tr.SCALAR=gb;tr.SEQ=dp;tr.hasAnchor=aB;tr.isAlias=tB;tr.isCollection=jR;tr.isDocument=rB;tr.isMap=nB;tr.isNode=oB;tr.isPair=iB;tr.isScalar=LR;tr.isSeq=sB});var Hc=F(yb=>{"use strict";var Ht=Ve(),Mr=Symbol("break visit"),UR=Symbol("skip children"),_i=Symbol("remove node");function hp(t,e){let r=BR(e);Ht.isDocument(t)?xl(null,t.contents,r,Object.freeze([t]))===_i&&(t.contents=null):xl(null,t,r,Object.freeze([]))}hp.BREAK=Mr;hp.SKIP=UR;hp.REMOVE=_i;function xl(t,e,r,n){let i=HR(t,e,r,n);if(Ht.isNode(i)||Ht.isPair(i))return VR(t,n,i),xl(t,i,r,n);if(typeof i!="symbol"){if(Ht.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=xl(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Mr)return Mr;a===_i&&(e.items.splice(s,1),s-=1)}}}else if(Ht.isPair(e)){n=Object.freeze(n.concat(e));let s=xl("key",e.key,r,n);if(s===Mr)return Mr;s===_i&&(e.key=null);let a=xl("value",e.value,r,n);if(a===Mr)return Mr;a===_i&&(e.value=null)}}return i}async function pp(t,e){let r=BR(e);Ht.isDocument(t)?await Rl(null,t.contents,r,Object.freeze([t]))===_i&&(t.contents=null):await Rl(null,t,r,Object.freeze([]))}pp.BREAK=Mr;pp.SKIP=UR;pp.REMOVE=_i;async function Rl(t,e,r,n){let i=await HR(t,e,r,n);if(Ht.isNode(i)||Ht.isPair(i))return VR(t,n,i),Rl(t,i,r,n);if(typeof i!="symbol"){if(Ht.isCollection(e)){n=Object.freeze(n.concat(e));for(let s=0;s<e.items.length;++s){let a=await Rl(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Mr)return Mr;a===_i&&(e.items.splice(s,1),s-=1)}}}else if(Ht.isPair(e)){n=Object.freeze(n.concat(e));let s=await Rl("key",e.key,r,n);if(s===Mr)return Mr;s===_i&&(e.key=null);let a=await Rl("value",e.value,r,n);if(a===Mr)return Mr;a===_i&&(e.value=null)}}return i}function BR(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function HR(t,e,r,n){if(typeof r=="function")return r(t,e,n);if(Ht.isMap(e))return r.Map?.(t,e,n);if(Ht.isSeq(e))return r.Seq?.(t,e,n);if(Ht.isPair(e))return r.Pair?.(t,e,n);if(Ht.isScalar(e))return r.Scalar?.(t,e,n);if(Ht.isAlias(e))return r.Alias?.(t,e,n)}function VR(t,e,r){let n=e[e.length-1];if(Ht.isCollection(n))n.items[t]=r;else if(Ht.isPair(n))t==="key"?n.key=r:n.value=r;else if(Ht.isDocument(n))n.contents=r;else{let i=Ht.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}yb.visit=hp;yb.visitAsync=pp});var vb=F(YR=>{"use strict";var WR=Ve(),lB=Hc(),uB={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},cB=t=>t.replace(/[!,[\]{}]/g,e=>uB[e]),Vc=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[s,a]=n;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[s]=n;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{let a=/^\d+\.\d+$/.test(s);return r(6,`Unsupported YAML version ${s}`,a),!1}}default:return r(0,`Unknown directive ${i}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),a)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||r(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(a){return r(String(a)),null}return n==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,n]of Object.entries(this.tags))if(e.startsWith(n))return r+cB(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&WR.isNode(e.contents)){let s={};lB.visit(e.contents,(a,u)=>{WR.isNode(u)&&u.tag&&(s[u.tag]=!0)}),i=Object.keys(s)}else i=[];for(let[s,a]of n)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||i.some(u=>u.startsWith(a)))&&r.push(`%TAG ${s} ${a}`);return r.join(`
|
|
@@ -207,7 +207,7 @@ Parsed value is empty`);return a}catch(a){throw!a&&e.continueOnError?new aa.Unma
|
|
|
207
207
|
`:""}yk.exports.dump=gG});var Z_=F((U7,br)=>{"use strict";var Sk=Q1(),yG=vk();function Q_(t,e){return function(){throw new Error("Function yaml."+t+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}br.exports.Type=cr();br.exports.Schema=C_();br.exports.FAILSAFE_SCHEMA=O_();br.exports.JSON_SCHEMA=q_();br.exports.CORE_SCHEMA=$_();br.exports.DEFAULT_SCHEMA=Em();br.exports.load=Sk.load;br.exports.loadAll=Sk.loadAll;br.exports.dump=yG.dump;br.exports.YAMLException=Wl();br.exports.types={binary:F_(),float:T_(),map:I_(),null:P_(),pairs:j_(),set:U_(),timestamp:M_(),bool:k_(),int:A_(),merge:N_(),omap:L_(),seq:R_(),str:x_()};br.exports.safeLoad=Q_("safeLoad","load");br.exports.safeLoadAll=Q_("safeLoadAll","loadAll");br.exports.safeDump=Q_("safeDump","dump")});var bk=F(Af=>{"use strict";var vG=Af&&Af.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Af,"__esModule",{value:!0});var SG=Sn(),bG=vG(Z_()),_G=Z_();Af.default={order:200,allowEmpty:!0,canParse:[".yaml",".yml",".json"],async parse(t){let e=t.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string")try{return bG.default.load(e,{schema:_G.JSON_SCHEMA})}catch(r){throw new SG.ParserError(r?.message||"Parser Error",t.url)}else return e}}});var _k=F(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});var wG=Sn(),EG=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;X_.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(t){return(typeof t.data=="string"||Buffer.isBuffer(t.data))&&EG.test(t.url)},parse(t){if(typeof t.data=="string")return t.data;if(Buffer.isBuffer(t.data))return t.data.toString(this.encoding);throw new wG.ParserError("data is not text",t.url)}}});var wk=F(ew=>{"use strict";Object.defineProperty(ew,"__esModule",{value:!0});var CG=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;ew.default={order:400,allowEmpty:!0,canParse(t){return Buffer.isBuffer(t.data)&&CG.test(t.url)},parse(t){return Buffer.isBuffer(t.data)?t.data:Buffer.from(t.data)}}});var Rk=F(Kn=>{"use strict";var xG=Kn&&Kn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),RG=Kn&&Kn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),IG=Kn&&Kn.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&xG(r,e,n[i]);return RG(r,e),r}}(),OG=Kn&&Kn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kn,"__esModule",{value:!0});var PG=OG(qt("fs")),Ek=ro(),Ck=IG(vn()),xk=Sn();Kn.default={order:100,canRead(t){return Ck.isFileSystemPath(t.url)},async read(t){let e;try{e=Ck.toFileSystemPath(t.url)}catch(r){throw new xk.ResolverError(Ek.ono.uri(r,`Malformed URI: ${t.url}`),t.url)}try{return await PG.default.promises.readFile(e)}catch(r){throw new xk.ResolverError((0,Ek.ono)(r,`Error opening file "${e}"`),e)}}}});var Pk=F(is=>{"use strict";var kG=is&&is.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),AG=is&&is.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),TG=is&&is.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&kG(r,e,n[i]);return AG(r,e),r}}();Object.defineProperty(is,"__esModule",{value:!0});var Am=ro(),Tf=TG(vn()),Ik=Sn();is.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(t){return Tf.isHttp(t.url)},read(t){let e=Tf.parse(t.url);return typeof window<"u"&&!e.protocol&&(e.protocol=Tf.parse(location.href).protocol),Ok(e,this)}};async function Ok(t,e,r){t=Tf.parse(t);let n=r||[];n.push(t.href);try{let i=await qG(t,e);if(i.status>=400)throw(0,Am.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new Ik.ResolverError((0,Am.ono)({status:i.status},`Error downloading ${n[0]}.
|
|
208
208
|
Too many redirects:
|
|
209
209
|
${n.join(`
|
|
210
|
-
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,Am.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Tf.resolve(t.href,i.headers.location);return Ok(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new Ik.ResolverError((0,Am.ono)(i,`Error downloading ${t.href}`),t.href)}}async function qG(t,e){let r,n;e.timeout&&(r=new AbortController,n=setTimeout(()=>r.abort(),e.timeout));let i=await fetch(t,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:r?r.signal:null});return n&&clearTimeout(n),i}});var tw=F(ss=>{"use strict";var Gl=ss&&ss.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ss,"__esModule",{value:!0});ss.getNewOptions=ss.getJsonSchemaRefParserDefaultOptions=void 0;var $G=Gl(s1()),MG=Gl(bk()),NG=Gl(_k()),DG=Gl(wk()),FG=Gl(Rk()),LG=Gl(Pk()),jG=()=>({parse:{json:{...$G.default},yaml:{...MG.default},text:{...NG.default},binary:{...DG.default}},resolve:{file:{...FG.default},http:{...LG.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});ss.getJsonSchemaRefParserDefaultOptions=jG;var UG=t=>{let e=(0,ss.getJsonSchemaRefParserDefaultOptions)();return t&&Ak(e,t),e};ss.getNewOptions=UG;function Ak(t,e){if(kk(e)){let r=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=e[i],a=t[i];kk(s)?t[i]=Ak(a||{},s):s!==void 0&&(t[i]=s)}}return t}function kk(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var qk=F(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.normalizeArgs=Tk;var BG=tw();function Tk(t){let e,r,n,i,s=Array.prototype.slice.call(t);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(r=s[1],n=s[2]):(r=void 0,n=s[1])):(e="",r=s[0],n=s[1]);try{n=(0,BG.getNewOptions)(n)}catch(a){console.error(`JSON Schema Ref Parser: Error normalizing options: ${a}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}Tm.default=Tk});var $k=F(Gn=>{"use strict";var HG=Gn&&Gn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),VG=Gn&&Gn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),WG=Gn&&Gn.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&HG(r,e,n[i]);return VG(r,e),r}}(),rw=Gn&&Gn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gn,"__esModule",{value:!0});var YG=rw(Bl()),JG=rw(wf()),zG=rw(v_()),Ql=WG(vn()),KG=Sn();function GG(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=nw(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function nw(t,e,r,n,i,s){i||(i=new Set);let a=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),YG.default.isExternal$Ref(t)&&a.push(QG(t,e,r,n));let u=Object.keys(t);for(let f of u){let h=JG.default.join(e,f),g=t[f];a=a.concat(nw(g,h,r,n,i,s))}}return a}async function QG(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Ql.resolve(i?Ql.cwd():e,t.$ref),a=Ql.stripHash(s),u=r._$refs[a];if(u)return Promise.resolve(u.value);try{let f=await(0,zG.default)(s,r,n),h=nw(f,a+"#",r,n,new Set,!0);return Promise.all(h)}catch(f){if(!n?.continueOnError||!(0,KG.isHandledError)(f))throw f;return r._$refs[a]&&(f.source=decodeURI(Ql.stripHash(e)),f.path=Ql.safePointerToPath(Ql.getHash(e))),[]}}Gn.default=GG});var Dk=F(Qn=>{"use strict";var ZG=Qn&&Qn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),XG=Qn&&Qn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),e4=Qn&&Qn.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&ZG(r,e,n[i]);return XG(r,e),r}}(),Nk=Qn&&Qn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qn,"__esModule",{value:!0});var qm=Nk(Bl()),qf=Nk(wf()),iw=e4(vn());function t4(t,e){let r=[];sw(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),r4(r)}function sw(t,e,r,n,i,s,a,u){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(qm.default.isAllowed$Ref(f))Mk(t,e,r,n,i,s,a,u);else{let h=Object.keys(f).sort((g,m)=>g==="definitions"?-1:m==="definitions"?1:g.length-m.length);for(let g of h){let m=qf.default.join(r,g),S=qf.default.join(n,g),_=f[g];qm.default.isAllowed$Ref(_)?Mk(f,g,r,S,i,s,a,u):sw(f,g,m,S,i,s,a,u)}}}function Mk(t,e,r,n,i,s,a,u){let f=e===null?t:t[e],h=iw.resolve(r,f.$ref),g=a._resolve(h,n,u);if(g===null)return;let S=qf.default.parse(n).length,_=iw.stripHash(g.path),C=iw.getHash(g.path),x=_!==a._root$Ref.path,A=qm.default.isExtended$Ref(f);i+=g.indirections;let T=n4(s,t,e);if(T)if(S<T.depth||i<T.indirections)i4(s,T);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:S,file:_,hash:C,value:g.value,circular:g.circular,extended:A,external:x,indirections:i}),(!T||x)&&sw(g.value,null,g.path,n,i+1,s,a,u)}function r4(t){t.sort((i,s)=>{if(i.file!==s.file)return i.file<s.file?-1:1;if(i.hash!==s.hash)return i.hash<s.hash?-1:1;if(i.circular!==s.circular)return i.circular?-1:1;if(i.extended!==s.extended)return i.extended?1:-1;if(i.indirections!==s.indirections)return i.indirections-s.indirections;if(i.depth!==s.depth)return i.depth-s.depth;{let a=i.pathFromRoot.lastIndexOf("/definitions"),u=s.pathFromRoot.lastIndexOf("/definitions");return a!==u?u-a:i.pathFromRoot.length-s.pathFromRoot.length}});let e,r,n;for(let i of t)i.external?i.file===e&&i.hash===r?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(r+"/")===0?i.$ref.$ref=qf.default.join(n,qf.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=qm.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function n4(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function i4(t,e){let r=t.indexOf(e);t.splice(r,1)}Qn.default=t4});var Hk=F(Zn=>{"use strict";var s4=Zn&&Zn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),o4=Zn&&Zn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a4=Zn&&Zn.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&s4(r,e,n[i]);return o4(r,e),r}}(),Uk=Zn&&Zn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zn,"__esModule",{value:!0});var $m=Uk(Bl()),Fk=Uk(wf()),l4=ro(),Lk=a4(vn()),u4=Sn();Zn.default=c4;function c4(t,e){let r=Date.now(),n=ow(t.schema,t.$refs._root$Ref.path,"#",new Set,new Set,new Map,t.$refs,e,r);t.$refs.circular=n.circular,t.schema=n.value}function ow(t,e,r,n,i,s,a,u,f){let h,g={value:t,circular:!1};if(u&&u.timeoutMs&&Date.now()-f>u.timeoutMs)throw new u4.TimeoutError(u.timeoutMs);let m=u.dereference||{},S=m.excludedPathMatcher||(()=>!1);if((m?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!S(r)){if(n.add(t),i.add(t),$m.default.isAllowed$Ref(t,u))h=jk(t,e,r,n,i,s,a,u,f),g.circular=h.circular,g.value=h.value;else for(let _ of Object.keys(t)){let C=Fk.default.join(e,_),x=Fk.default.join(r,_);if(S(x))continue;let A=t[_],T=!1;if($m.default.isAllowed$Ref(A,u)){if(h=jk(A,C,x,n,i,s,a,u,f),T=h.circular,t[_]!==h.value){let j=new Map;m?.preservedProperties&&typeof t[_]=="object"&&!Array.isArray(t[_])&&m?.preservedProperties.forEach(Y=>{Y in t[_]&&j.set(Y,t[_][Y])}),t[_]=h.value,m?.preservedProperties&&j.size&&typeof t[_]=="object"&&!Array.isArray(t[_])&&j.forEach((Y,V)=>{t[_][V]=Y}),m?.onDereference?.(A.$ref,t[_],t,_)}}else n.has(A)?T=Bk(C,a,u):(h=ow(A,C,x,n,i,s,a,u,f),T=h.circular,t[_]!==h.value&&(t[_]=h.value));g.circular=g.circular||T}n.delete(t)}return g}function jk(t,e,r,n,i,s,a,u,f){let g=$m.default.isExternal$Ref(t)&&u?.dereference?.externalReferenceResolution==="root",m=Lk.resolve(g?Lk.cwd():e,t.$ref),S=s.get(m);if(S&&!S.circular){let j=Object.keys(t);if(j.length>1){let Y={};for(let V of j)V!=="$ref"&&!(V in S.value)&&(Y[V]=t[V]);return{circular:S.circular,value:Object.assign({},S.value,Y)}}return S}let _=a._resolve(m,e,u);if(_===null)return{circular:!1,value:null};let C=_.circular,x=C||n.has(_.value);x&&Bk(e,a,u);let A=$m.default.dereference(t,_.value);if(!x){let j=ow(A,_.path,r,n,i,s,a,u,f);x=j.circular,A=j.value}x&&!C&&u.dereference?.circular==="ignore"&&(A=t),C&&(A.$ref=r);let T={circular:x,value:A};return Object.keys(t).length===1&&s.set(m,T),T}function Bk(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw l4.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var Vk=F(aw=>{"use strict";Object.defineProperty(aw,"__esModule",{value:!0});function f4(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}aw.default=f4()});var Yk=F($f=>{"use strict";var d4=$f&&$f.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($f,"__esModule",{value:!0});$f.default=h4;var Wk=d4(Vk());function h4(t,e){if(t){e.then(function(r){(0,Wk.default)(function(){t(null,r)})},function(r){(0,Wk.default)(function(){t(r)})});return}else return e}});var Gk=F(_e=>{"use strict";var p4=_e&&_e.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),m4=_e&&_e.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),g4=_e&&_e.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&p4(r,e,n[i]);return m4(r,e),r}}(),ha=_e&&_e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_e,"__esModule",{value:!0});_e.getJsonSchemaRefParserDefaultOptions=_e.jsonSchemaParserNormalizeArgs=_e.dereferenceInternal=_e.JSONParserErrorGroup=_e.isHandledError=_e.UnmatchedParserError=_e.ParserError=_e.ResolverError=_e.MissingPointerError=_e.InvalidPointerError=_e.JSONParserError=_e.UnmatchedResolverError=_e.dereference=_e.bundle=_e.resolve=_e.parse=_e.$RefParser=void 0;var Jk=ha(e1()),y4=ha(v_()),Mf=ha(qk());_e.jsonSchemaParserNormalizeArgs=Mf.default;var v4=ha($k()),S4=ha(Dk()),Kk=ha(Hk());_e.dereferenceInternal=Kk.default;var da=g4(vn()),bn=Sn();Object.defineProperty(_e,"JSONParserError",{enumerable:!0,get:function(){return bn.JSONParserError}});Object.defineProperty(_e,"InvalidPointerError",{enumerable:!0,get:function(){return bn.InvalidPointerError}});Object.defineProperty(_e,"MissingPointerError",{enumerable:!0,get:function(){return bn.MissingPointerError}});Object.defineProperty(_e,"ResolverError",{enumerable:!0,get:function(){return bn.ResolverError}});Object.defineProperty(_e,"ParserError",{enumerable:!0,get:function(){return bn.ParserError}});Object.defineProperty(_e,"UnmatchedParserError",{enumerable:!0,get:function(){return bn.UnmatchedParserError}});Object.defineProperty(_e,"UnmatchedResolverError",{enumerable:!0,get:function(){return bn.UnmatchedResolverError}});Object.defineProperty(_e,"isHandledError",{enumerable:!0,get:function(){return bn.isHandledError}});Object.defineProperty(_e,"JSONParserErrorGroup",{enumerable:!0,get:function(){return bn.JSONParserErrorGroup}});var zk=ro(),Xn=ha(Yk()),b4=tw();Object.defineProperty(_e,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return b4.getJsonSchemaRefParserDefaultOptions}});var ao=class t{constructor(){this.schema=null,this.$refs=new Jk.default}async parse(){let e=(0,Mf.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,zk.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,Xn.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new Jk.default;let n="http";if(da.isFileSystemPath(e.path))e.path=da.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=da.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=da.resolve(da.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,r=Promise.resolve(e.schema)}else r=(0,y4.default)(e.path,this.$refs,e.options);try{let i=await r;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,Xn.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,Xn.default)(e.callback,Promise.resolve(this.schema));throw zk.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,bn.isHandledError)(i)?(0,Xn.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[da.stripHash(e.path)]&&this.$refs._$refs[da.stripHash(e.path)].addError(i),(0,Xn.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,Mf.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,v4.default)(this,e.options),lw(this),(0,Xn.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,Xn.default)(e.callback,Promise.reject(r))}}static resolve(){let e=new t;return e.resolve.apply(e,arguments)}static bundle(){let e=new t;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,Mf.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,S4.default)(this,e.options),lw(this),(0,Xn.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,Xn.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,Mf.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,Kk.default)(this,e.options),lw(this),(0,Xn.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,Xn.default)(e.callback,Promise.reject(r))}}};_e.$RefParser=ao;_e.default=ao;function lw(t){if(bn.JSONParserErrorGroup.getParserErrors(t).length>0)throw new bn.JSONParserErrorGroup(t)}_e.parse=ao.parse;_e.resolve=ao.resolve;_e.bundle=ao.bundle;_e.dereference=ao.dereference});var Za=class{constructor(e,r){this.fileSystem=e;this.parserRegistry=r}directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,r={}){let n=await this.fileSystem.readFile(e);if(r.format){let s=this.parserRegistry.get(r.format);if(!s)throw new Error(`No parser registered for format: ${r.format}`);return s.parse(n,e)}let i=this.parserRegistry.detect(n);if(!i)throw new Error(`Could not detect collection format for: ${e}. Supported formats: ${this.parserRegistry.getFormats().join(", ")}`);return i.parser.parse(n,e)}async loadDirectory(e,r=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(r,e);for(let s of i)try{let a=await this.load(s);n.push(a)}catch{}return n}async canLoad(e){try{if(!await this.fileSystem.exists(e))return!1;let r=await this.fileSystem.readFile(e);return this.parserRegistry.detect(r)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};import*as Se from"fs";import*as xe from"path";function xt(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function it(t){let e=Date.now().toString(36)+Math.random().toString(36).substr(2,9);return t?`${xt(t)}_${e}`:e}function rv(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Fu(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let a=i.toLowerCase();n[a]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let a=i.toLowerCase(),u=n[a];u&&delete r[u],n[a]=i,r[i]=s}return r}function vN(t){return JSON.parse(JSON.stringify(t))}function SN(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function bN(t,e){try{return JSON.parse(t)}catch{return e}}function _N(t){if(t===0)return"0 B";let e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,n)).toFixed(1))} ${r[n]}`}function wN(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}import*as tt from"fs";import*as Nn from"path";var ch={preRequest:"pre-request.js",postResponse:"post-response.js"},yr={collection:"collection.json",folder:"folder.json",request:"request.json"},FE={"body.json":{type:"raw",format:"json"},"body.xml":{type:"raw",format:"xml"},"body.txt":{type:"raw",format:"text"},"body.html":{type:"raw",format:"html"},"body.js":{type:"raw",format:"javascript"},"body.graphql":{type:"graphql"}},Lu={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},cn="scripts";function fh(t){if(!tt.existsSync(t))return;let e={},r=Nn.join(t,ch.preRequest);tt.existsSync(r)&&(e.preRequest=tt.readFileSync(r,"utf-8"));let n=Nn.join(t,ch.postResponse);return tt.existsSync(n)&&(e.postResponse=tt.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function dh(t,e){await tt.promises.mkdir(t,{recursive:!0});let r=Nn.join(t,ch.preRequest);e.preRequest?await tt.promises.writeFile(r,e.preRequest,"utf-8"):tt.existsSync(r)&&await tt.promises.unlink(r);let n=Nn.join(t,ch.postResponse);e.postResponse?await tt.promises.writeFile(n,e.postResponse,"utf-8"):tt.existsSync(n)&&await tt.promises.unlink(n)}function LE(t){for(let[e,r]of Object.entries(FE)){let n=Nn.join(t,e);if(tt.existsSync(n))try{let i=tt.readFileSync(n,"utf-8"),s;if(r.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:r.type,format:r.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function jE(t){if(!t||t.type==="none")return{bodyForMetadata:t};if(t.type==="raw"){let e=t.format||"json",n={json:"body.json",xml:"body.xml",text:"body.txt",html:"body.html",javascript:"body.js"}[e];if(n){let i=e==="json"?typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2):String(t.content||"");return{bodyForMetadata:{type:t.type,format:t.format},externalBodyFile:{filename:n,content:i}}}}if(t.type==="graphql"){let e=typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2);return{bodyForMetadata:{type:t.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:t}}async function UE(t,e){for(let r of Object.keys(FE))if(r!==e){let n=Nn.join(t,r);if(tt.existsSync(n))try{await tt.promises.unlink(n)}catch{}}}function BE(t){if(tt.existsSync(t))try{let e=tt.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function HE(t,e,r){let n=Nn.join(t,Lu.responseSchema),i=Nn.join(t,Lu.bodySchema);e?await tt.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):tt.existsSync(n)&&await tt.promises.unlink(n),r?await tt.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):tt.existsSync(i)&&await tt.promises.unlink(i)}function nv(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=nv(r.items,e);if(n)return n}}}function iv(t,e){for(let r=0;r<t.length;r++){let n=t[r];if(n.id===e)return t.splice(r,1),!0;if(n.type==="folder"&&n.items&&iv(n.items,e))return!0}return!1}function VE(t,e){let r=new Map(t.map(i=>[i.id,i])),n=[];for(let i of e){let s=r.get(i);s&&(n.push(s),r.delete(i))}for(let i of r.values())n.push(i);return n}function sv(t,e){let r;try{r=tt.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===cn)continue;if(n.name===e)return Nn.join(t,n.name);let i=sv(Nn.join(t,n.name),e);if(i)return i}}function Bi(t,e=[]){let r=t.toLowerCase().trim(),n=r.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=r.match(/t(\d+)/gi)||[],a=0;for(let S of s){let _=parseInt(S.substring(1));_>a&&(a=_)}let u="";if(a>0)u=`t${a}`;else{let S=r.match(/[_\s-](\d+\.\d+)[_\s-]/);S&&(u=`v${S[1].replace(".","_")}`)}let f=r;n&&(f=f.substring(n[0].length)),f=f.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),f=f.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),f=f.replace(/\([^)]+\)/g,""),f=f.replace(/:[a-z_][a-z0-9_]*/gi,""),f=f.replace(/\{[^}]+\}/g,""),f=f.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let h=f.split("-").filter(S=>S.length>0),g=[];i&&g.push(i),g.push(...h),u&&g.push(u);let m=g.join("-");if(m||(m="item"),e.includes(m)){let S=2;for(;e.includes(`${m}-${S}`);)S++;m=`${m}-${S}`}return m}var $s=class{collectionsDir;cache=new Map;slugToIdMap=new Map;idToSlugMap=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}getSlugById(e){return this.idToSlugMap.get(e)}getIdBySlug(e){return this.slugToIdMap.get(e)}ensureDirectory(){Se.existsSync(this.collectionsDir)||Se.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!Se.existsSync(this.collectionsDir))return[];let e=Se.readdirSync(this.collectionsDir,{withFileTypes:!0}),r=[];for(let n of e)if(n.isDirectory())try{let i=this.loadCollectionFromFolder(n.name);i&&(this.cache.set(i.id,i),this.slugToIdMap.set(n.name,i.id),this.idToSlugMap.set(i.id,n.name),r.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return r}loadCollectionFromFolder(e){let r=xe.join(this.collectionsDir,e),n=xe.join(r,yr.collection);if(Se.existsSync(n))try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(xe.join(r,cn)),u=this.loadItemsFromDir(r,s.id,s.order);return{id:s.id,name:s.name,description:s.description,version:s.version,variables:s.variables,auth:s.auth,scripts:a,items:u}}catch(i){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,i);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,a=Se.readdirSync(e,{withFileTypes:!0});for(let u of a){if(!u.isDirectory()||u.name===cn)continue;let f=xe.join(e,u.name);if(Se.existsSync(xe.join(f,yr.folder))){let h=this.loadFolderFromDir(f,u.name);h&&s.set(u.name,h)}else if(Se.existsSync(xe.join(f,yr.request))){let h=this.loadRequestFromDir(f,u.name);h&&s.set(u.name,h)}}if(n&&n.length>0){for(let u of n){let f=s.get(u);f&&(i.push(f),s.delete(u))}for(let u of s.values())i.push(u)}else for(let u of s.values())i.push(u);return i}loadFolderFromDir(e,r){let n=xe.join(e,yr.folder);try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(xe.join(e,cn)),u=this.loadItemsFromDir(e,s.id,s.order);return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"folder",name:s.name,description:s.description,auth:s.auth,scripts:a,items:u}}catch(i){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,i);return}}loadRequestFromDir(e,r){let n=xe.join(e,yr.request);try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(xe.join(e,cn)),u=s.body,f=this.loadBodyFromDir(e);f&&(u=f);let h=this.loadSchemaFile(xe.join(e,Lu.responseSchema)),g=this.loadSchemaFile(xe.join(e,Lu.bodySchema)),m=xe.join(e,"doc.md"),S=Se.existsSync(m)?Se.readFileSync(m,"utf-8"):void 0;return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"request",name:s.name,description:s.description,method:s.method,url:s.url,params:s.params,query:s.query,headers:s.headers,body:u,auth:s.auth,settings:s.settings,scripts:a,deprecated:s.deprecated,...S&&{doc:S},...h&&{responseSchema:h},...g&&{bodySchema:g}}}catch(i){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,i);return}}loadScriptsFromDir(e){return fh(e)}loadBodyFromDir(e){return LE(e)}loadSchemaFile(e){return BE(e)}async saveSchemaFiles(e,r){return HE(e,r.responseSchema,r.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.idToSlugMap.get(e);if(r){let n=this.loadCollectionFromFolder(r);return n&&this.cache.set(e,n),n}return this.loadAll(),this.cache.get(e)}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=it(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let a=Se.readdirSync(this.collectionsDir);r=Bi(e.name,a),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=xe.join(this.collectionsDir,r);await Se.promises.mkdir(n,{recursive:!0});let i={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth};await Se.promises.writeFile(xe.join(n,yr.collection),JSON.stringify(i,null,2),"utf-8"),e.scripts&&await this.saveScriptsToDir(xe.join(n,cn),e.scripts);let s=await this.saveItemsToDir(n,e.items);s.length>0&&(i.order=s,await Se.promises.writeFile(xe.join(n,yr.collection),JSON.stringify(i,null,2),"utf-8")),this.cache.set(e.id,e)}async saveItemsToDir(e,r){let n=[];for(let i of r){let s=this.idToSlugMap.get(i.id);s||(s=Bi(i.name,n),this.idToSlugMap.set(i.id,s),this.slugToIdMap.set(s,i.id)),n.push(s);let a=xe.join(e,s);await Se.promises.mkdir(a,{recursive:!0}),i.type==="folder"?await this.saveFolderToDir(a,i):await this.saveRequestToDir(a,i)}return n}async saveFolderToDir(e,r){let n={id:r.id,name:r.name,description:r.description,auth:r.auth};if(await Se.promises.writeFile(xe.join(e,yr.folder),JSON.stringify(n,null,2),"utf-8"),r.scripts&&await this.saveScriptsToDir(xe.join(e,cn),r.scripts),r.items){let i=await this.saveItemsToDir(e,r.items);i.length>0&&(n.order=i,await Se.promises.writeFile(xe.join(e,yr.folder),JSON.stringify(n,null,2),"utf-8"))}}async saveRequestToDir(e,r){let{bodyForMetadata:n,externalBodyFile:i}=this.prepareBodyForSave(r.body),s={id:r.id,name:r.name,method:r.method||"GET",url:r.url||"",description:r.description,params:r.params,query:r.query,headers:r.headers,body:n,auth:r.auth,settings:r.settings,...r.deprecated&&{deprecated:r.deprecated}};await Se.promises.writeFile(xe.join(e,yr.request),JSON.stringify(s,null,2),"utf-8"),i&&await Se.promises.writeFile(xe.join(e,i.filename),i.content,"utf-8"),await this.cleanupOldBodyFiles(e,i?.filename),await this.saveSchemaFiles(e,r),r.doc&&await Se.promises.writeFile(xe.join(e,"doc.md"),r.doc,"utf-8"),r.scripts&&await this.saveScriptsToDir(xe.join(e,cn),r.scripts)}prepareBodyForSave(e){return jE(e)}async cleanupOldBodyFiles(e,r){return UE(e,r)}async saveScriptsToDir(e,r){return dh(e,r)}async delete(e){let r=this.idToSlugMap.get(e);if(!r&&(this.loadAll(),r=this.idToSlugMap.get(e),!r))return!1;let n=xe.join(this.collectionsDir,r);if(!Se.existsSync(n))return!1;try{return await Se.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(r),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let r=this.idToSlugMap.get(e);return r?Se.existsSync(xe.join(this.collectionsDir,r,yr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return xe.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||it(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,r);if(!s)throw new Error(`Item ${r} not found in collection ${e}`);await this.saveScriptsToDir(xe.join(s,cn),n);let a=this.findItemById(i.items,r);a&&(a.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(xe.join(n,cn))}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);let i=this.idToSlugMap.get(e);if(!i)throw new Error(`Collection slug not found for ${e}`);let s=xe.join(this.collectionsDir,i),a=xe.join(s,yr.collection),u=Se.readFileSync(a,"utf-8"),h={...JSON.parse(u),...r,id:e};await Se.promises.writeFile(a,JSON.stringify(h,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let a;if(n){let g=this.findItemPath(e,n);if(!g)throw new Error(`Parent folder ${n} not found`);a=g}else a=xe.join(this.collectionsDir,s);let u=this.idToSlugMap.get(r.id);if(!u){let g=Se.readdirSync(a).filter(m=>Se.statSync(xe.join(a,m)).isDirectory()&&m!==cn);u=Bi(r.name,g),this.idToSlugMap.set(r.id,u),this.slugToIdMap.set(u,r.id)}let f=xe.join(a,u);await Se.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let h=this.findItemById(i.items,r.id);if(h)Object.assign(h,r);else if(n){let g=this.findItemById(i.items,n);g&&g.type==="folder"&&(g.items=g.items||[],g.items.push(r))}else i.items.push(r)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,r);if(!i||!Se.existsSync(i))return!1;try{await Se.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,r);let s=this.idToSlugMap.get(r);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(r)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${r}:`,s),!1}}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,r);if(!s)return!1;let a=this.findItemById(i.items,r);if(!a)return!1;let{id:u,type:f,items:h,...g}=n;return Object.assign(a,g),a.type==="folder"?await this.saveFolderToDir(s,a):await this.saveRequestToDir(s,a),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=this.findItemPath(e,r);if(!a||!Se.existsSync(a))return!1;let u;if(n){let g=this.findItemPath(e,n);if(!g)return!1;u=g}else u=xe.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let h=xe.join(u,f);if(Se.existsSync(h))return!1;try{await Se.promises.rename(a,h);let g=this.findItemById(i.items,r);if(g){let m=g.type==="folder"?{...g,items:g.items?[...g.items]:[]}:{...g};if(this.deleteItemFromTree(i.items,r),n){let S=this.findItemById(i.items,n);S&&S.type==="folder"&&(S.items=S.items||[],S.items.push(m))}else i.items.push(m)}return!0}catch(g){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,g),!1}}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=[];for(let u of n){let f=this.idToSlugMap.get(u);f&&a.push(f)}try{if(r){let u=this.findItemPath(e,r);if(!u)return!1;let f=xe.join(u,yr.folder),h=Se.readFileSync(f,"utf-8"),g=JSON.parse(h);g.order=a,await Se.promises.writeFile(f,JSON.stringify(g,null,2),"utf-8");let m=this.findItemById(i.items,r);m&&m.type==="folder"&&m.items&&(m.items=this.sortItemsByOrder(m.items,n))}else{let u=xe.join(this.collectionsDir,s,yr.collection),f=Se.readFileSync(u,"utf-8"),h=JSON.parse(f);h.order=a,await Se.promises.writeFile(u,JSON.stringify(h,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(u){return console.error("[FolderCollectionStore] Failed to reorder items:",u),!1}}sortItemsByOrder(e,r){return VE(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=this.idToSlugMap.get(r);if(i)return sv(xe.join(this.collectionsDir,n),i)}findItemById(e,r){return nv(e,r)}deleteItemFromTree(e,r){return iv(e,r)}};function ov(t,e){return{id:t.id,name:t.name,description:t.description,variables:t.variables||{},auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(WE),source:{format:"folder",filePath:e,version:t.version}}}function WE(t){if(t.type==="folder")return{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(WE)};let e=t;return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:e.headers||[],query:e.query||[],params:e.params,body:e.body??void 0,auth:e.auth,settings:e.settings,scripts:e.scripts,...e.deprecated&&{deprecated:e.deprecated},...e.doc&&{doc:e.doc},...e.responseSchema&&{responseSchema:e.responseSchema},...e.bodySchema&&{bodySchema:e.bodySchema}}}function EN(t){return{id:t.id,name:t.name,description:t.description,version:t.source?.version,variables:t.variables,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(av)}}function av(t){return t.type==="folder"?{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(av)}:{type:"request",id:t.id,name:t.name,description:t.description,method:t.method,url:t.url,headers:t.headers,query:t.query,params:t.params,body:t.body,auth:t.auth,settings:t.settings,scripts:t.scripts,...t.deprecated&&{deprecated:t.deprecated},...t.doc&&{doc:t.doc}}}var ju=class{store;constructor(e){this.store=new $s(e)}loadAll(){return this.store.loadAll().map(r=>ov(r,this.store.getCollectionPath(r.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let r=this.store.load(e);if(r)return ov(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return ov(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(EN(e))}async delete(e){return this.store.delete(e)}exists(e){return this.store.exists(e)}getCollectionPath(e){return this.store.getCollectionPath(e)}async updateCollectionMetadata(e,r){return this.store.updateCollectionMetadata(e,r)}async saveItem(e,r,n){return this.store.saveItem(e,av(r),n)}async updateItem(e,r,n){let i={...n};return this.store.updateItem(e,r,i)}async deleteItem(e,r){return this.store.deleteItem(e,r)}async moveItem(e,r,n){return this.store.moveItem(e,r,n)}async reorderItems(e,r,n){return this.store.reorderItems(e,r,n)}async saveScripts(e,r,n){return this.store.saveScripts(e,r,n)}loadScripts(e,r){return this.store.loadScripts(e,r)}};var Uu=class{parsers=new Map;register(e,r){this.parsers.set(e.toLowerCase(),r)}get(e){return this.parsers.get(e.toLowerCase())}has(e){return this.parsers.has(e.toLowerCase())}getFormats(){return Array.from(this.parsers.keys())}detect(e){for(let[r,n]of this.parsers)if(n.canParse(e))return{parser:n,format:r};return null}clear(){this.parsers.clear()}};var lt=class{static parseSetCookie(e,r){let n=e.split(";").map(g=>g.trim());if(n.length===0)return null;let[i,...s]=n,a=i.indexOf("=");if(a===-1)return null;let u=i.substring(0,a).trim(),f=i.substring(a+1).trim(),h={name:u,value:f,domain:r};for(let g of s){let m=g.indexOf("="),S=(m===-1?g:g.substring(0,m)).toLowerCase(),_=m===-1?"":g.substring(m+1);switch(S){case"domain":h.domain=_.startsWith(".")?_.substring(1):_;break;case"path":h.path=_;break;case"expires":h.expires=_;break;case"max-age":h.maxAge=parseInt(_,10);break;case"httponly":h.httpOnly=!0;break;case"secure":h.secure=!0;break;case"samesite":h.sameSite=_;break}}return h}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let a of s){let u=this.parseSetCookie(a,r);u&&n.push(u)}return n}static formatCookieHeader(e){return e.map(r=>`${r.name}=${r.value}`).join("; ")}static isExpired(e){return!!(e.expires&&new Date(e.expires).getTime()<Date.now()||e.maxAge!==void 0&&e.maxAge<=0)}static domainMatches(e,r){if(r==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=r.toLowerCase().split(".").reverse();if(i.length>n.length)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static extractDomain(e){try{return new URL(e).hostname}catch{return""}}static extractPath(e){try{return new URL(e).pathname}catch{return"/"}}};var Bu=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}}has(e,r){return this.get(e,r)!==void 0}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return lt.formatCookieHeader(r)}clear(){this.cookies.clear()}clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n)}parseCookieHeaders(e,r){return lt.parseCookieHeaders(e,r)}isExpired(e){return lt.isExpired(e)}domainMatches(e,r){return lt.domainMatches(e,r)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r)}};import*as Ms from"fs";import*as Ao from"path";function ph(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function Hu(t){if(!Ms.existsSync(t))return CN();let e=hh(Ao.join(t,"_global.json"))||{},r=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=Ms.readdirSync(t).filter(h=>h.endsWith(".json")).filter(h=>!h.endsWith(".local.json")).filter(h=>!ph(h)),s={};for(let h of i){let g=hh(Ao.join(t,h))||{},m=Ao.basename(h,".json");s[m]={description:g.description,requiresConfirmation:g.requiresConfirmation,variables:g.variables||{}}}let u=(hh(Ao.join(t,"_global.local.json"))||{}).variables||{},f={};for(let h of Object.keys(s)){let g=Ao.join(t,`${h}.local.json`);if(Ms.existsSync(g)){let m=hh(g)||{};f[h]={variables:m.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:u,localCredentials:f}}function CN(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function hh(t){try{if(!Ms.existsSync(t))return null;let e=Ms.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${t}:`,e),null}}var Hi=class t{config;selectedEnvironment;sessionGlobals={};sessionEnvironmentValues=new Map;constructor(e){this.config=e,this.selectedEnvironment=e.selectedEnvironment||Object.keys(e.environments)[0]||"default"}get(e){return this.getVariables()[e]}set(e,r){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=r}getAll(){return this.getVariables()}getEnvironments(){return Object.keys(this.config.environments)}getActive(){return this.selectedEnvironment}setActive(e){if(!this.config.environments[e])throw new Error(`Environment not found: ${e}`);this.selectedEnvironment=e}getVariables(e){let r=e||this.selectedEnvironment,n=this.config.environments[r],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let a=this.getEnvironmentVariables(n.inherits);i={...i,...a}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};var Dn=class{buildUrl(e,r={},n={}){let i=e;return i=this.replacePathParams(i,r),i=this.appendQueryParams(i,n),i}replacePathParams(e,r){let n="",i="",s=e,a="",u=e.indexOf("?");u!==-1&&(a=e.substring(u),s=e.substring(0,u));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let h=/:(\w+)(?:\([^)]*\))?(\?)?/g,g=s.replace(h,(m,S,_)=>{let C=r[S];return C!==void 0&&C!==""?encodeURIComponent(C):_?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${S}`),m)});return g=g.replace(/([^:])\/+/g,"$1/"),g.length>1&&g.endsWith("/")&&(g=g.slice(0,-1)),`${n}${i}${g}${a}`}extractPathParams(e){let r=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=r.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,r){let n=e,i={};if(e.includes("?")){let[f,h]=e.split("?");n=f,h&&new URLSearchParams(h).forEach((m,S)=>{i[S]=m})}let s={...i,...r},a=new URLSearchParams;for(let[f,h]of Object.entries(s))h!=null&&a.append(f,h);let u=a.toString();return u?`${n}?${u}`:n}};import xN from"crypto";var gh=new Uint8Array(256),mh=gh.length;function lv(){return mh>gh.length-16&&(xN.randomFillSync(gh),mh=0),gh.slice(mh,mh+=16)}var Gt=[];for(let t=0;t<256;++t)Gt.push((t+256).toString(16).slice(1));function YE(t,e=0){return Gt[t[e+0]]+Gt[t[e+1]]+Gt[t[e+2]]+Gt[t[e+3]]+"-"+Gt[t[e+4]]+Gt[t[e+5]]+"-"+Gt[t[e+6]]+Gt[t[e+7]]+"-"+Gt[t[e+8]]+Gt[t[e+9]]+"-"+Gt[t[e+10]]+Gt[t[e+11]]+Gt[t[e+12]]+Gt[t[e+13]]+Gt[t[e+14]]+Gt[t[e+15]]}import RN from"crypto";var uv={randomUUID:RN.randomUUID};function IN(t,e,r){if(uv.randomUUID&&!e&&!t)return uv.randomUUID();t=t||{};let n=t.random||(t.rng||lv)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let i=0;i<16;++i)e[r+i]=n[i];return e}return YE(n)}var Xa=IN;function ON(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function PN(){return Date.now()}function JE(){return Xa()}function kN(){return Xa()}function zE(t=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function AN(){let t=zE(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function TN(){return Math.random()<.5}function qN(t=10){let e="0123456789abcdef",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function $N(){return Math.floor(Date.now()/1e3)}function MN(){return new Date().toISOString()}function NN(){return new Date().toISOString().split("T")[0]}function DN(){return new Date().toISOString().split("T")[1].split(".")[0]}function FN(){return new Date().toISOString()}function LN(t=""){return Buffer.from(String(t)).toString("base64")}function jN(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function UN(t=""){return encodeURIComponent(String(t))}function BN(t=""){return decodeURIComponent(String(t))}var KE={randomInt:ON,timestamp:PN,guid:kN,uuid:JE,randomUUID:JE,randomString:zE,randomHexadecimal:qN,randomEmail:AN,randomBoolean:TN,isoTimestamp:FN,timestamp_s:$N,datetime:MN,date:NN,time:DN,base64Encode:LN,base64Decode:jN,urlEncode:UN,urlDecode:BN};function HN(t){return t?t.split(",").map(e=>{let r=e.trim(),n=Number(r);return!isNaN(n)&&r!==""?n:r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}):[]}function Vi(t,e){let r=KE[t];return r?e&&e.length>0?r(...e):r():null}function VN(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?HN(n):void 0,s=Vi(r,i);return s===null?e:String(s)}catch{return e}})}function To(t,e){let r=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=r.exec(t))!==null;){let s=i[0],a=i[1];if(!(s in e)){let u=Vi(a);u!==null&&(n||(n={...e}),n[s]=u)}}return n??e}import*as yh from"vm";var WN=100;function qo(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function $o(t,e={}){try{let r={...e,Math,Date,JSON,Number,String,Boolean,Array,Object,parseInt,parseFloat,isNaN,isFinite,encodeURIComponent,decodeURIComponent,encodeURI,decodeURI,undefined:void 0,null:null,true:!0,false:!1,NaN:NaN,Infinity:1/0},n=yh.createContext(r);return yh.runInContext(t,n,{timeout:WN,displayErrors:!1})}catch{return}}import*as vh from"crypto";function Wu(t){if(!t||!t.includes("|"))return null;let e=YN(t);if(e.length<2)return null;let r=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let a=JN(s);a&&n.push(a)}return n.length===0?null:{input:r,filters:n}}function YN(t){let e=[],r="",n=0,i=!1,s=!1;for(let a=0;a<t.length;a++){let u=t[a],f=a>0?t[a-1]:"",h=a<t.length-1?t[a+1]:"";if(f==="\\"){r+=u;continue}if(u==="'"&&!s)i=!i;else if(u==='"'&&!i)s=!s;else if(u==="("&&!i&&!s)n++;else if(u===")"&&!i&&!s)n--;else if(u==="|"&&n===0&&!i&&!s){if(h==="|"){r+="||",a++;continue}e.push(r),r="";continue}r+=u}return r&&e.push(r),e}function JN(t){let e=t.indexOf("(");if(e===-1)return{name:t.trim(),args:[]};let r=t.substring(0,e).trim(),n=t.substring(e+1,t.lastIndexOf(")"));return{name:r,args:zN(n)}}function zN(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let a=t[s];if((s>0?t[s-1]:"")==="\\"){r+=a;continue}if(a==="'"&&!i){n=!n,r+=a;continue}else if(a==='"'&&!n){i=!i,r+=a;continue}else if(a===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=a}return r.trim()&&e.push(r.trim()),e}function Rt(t,e){if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=Number(t);if(!isNaN(r)&&t!=="")return r;if(t==="true")return!0;if(t==="false")return!1;if(e&&t in e){let n=e[t],i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Yu(t,e,r={}){let n=t;for(let i of e)n=KN(n,i.name,i.args,r);return n}function KN(t,e,r,n){switch(e){case"upper":return String(t).toUpperCase();case"lower":return String(t).toLowerCase();case"trim":return String(t).trim();case"length":return Array.isArray(t)?t.length:String(t).length;case"substring":{let i=Rt(r[0],n),s=r[1]!==void 0?Rt(r[1],n):void 0;return String(t).substring(i<0?String(t).length+i:i,s!==void 0?s<0?String(t).length+s:s:void 0)}case"replace":{let i=r[0]!==void 0?String(Rt(r[0],n)):"",s=r[1]!==void 0?String(Rt(r[1],n)):"";return String(t).replace(new RegExp(QN(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(Rt(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(Rt(r[0],n)):",";return Array.isArray(t)?t.join(i):String(t)}case"removeQuotes":return String(t).replace(/["']/g,"");case"removeSpaces":return String(t).replace(/\s/g,"");case"format":{let i=r[0]!==void 0?String(Rt(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let a=Rt(r[s],n);i=i.replace(`{${s}}`,String(a))}return i}case"add":{let i=Rt(r[0],n);return Number(t)+i}case"subtract":{let i=Rt(r[0],n);return Number(t)-i}case"multiply":{let i=Rt(r[0],n);return Number(t)*i}case"abs":return Math.abs(Number(t));case"btoa":return Buffer.from(String(t)).toString("base64");case"atob":return Buffer.from(String(t),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(t));case"urlDecode":return decodeURIComponent(String(t));case"hash":{let i=String(r[0]!==void 0?Rt(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?Rt(r[1],n):"base64"),u={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return vh.createHash(u).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(Rt(r[0],n)):"",s=String(r[1]!==void 0?Rt(r[1],n):"sha256").toLowerCase(),a=String(r[2]!==void 0?Rt(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return vh.createHmac(f,i).update(String(t)).digest(a)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=Rt(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=Rt(r[0],n),s=r[1]!==void 0?Rt(r[1],n):void 0;return Array.isArray(t)?t.slice(i,s):String(t).slice(i,s)}case"unique":return Array.isArray(t)?[...new Set(t)]:t;case"filter":return!Array.isArray(t)||!r[0]?t:GN(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(Rt(s,n)));return i.length===1?t.map(s=>Vu(s,i[0])):t.map(s=>{let a={};for(let u of i){let f=Vu(s,u);f!==void 0&&(a[u]=f)}return a})}case"prop":{let i=r[0]!==void 0?String(Rt(r[0],n)):"";if(Array.isArray(t)){let s=t.map(a=>Vu(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?Vu(t,i):t}case"parseJSON":try{return JSON.parse(String(t))}catch{return t}case"stringify":try{return JSON.stringify(t)}catch{return String(t)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t));case"isUrl":try{return new URL(String(t)),!0}catch{return!1}case"setIfValue":return t||void 0;case"setNull":return t===null?null:t;default:return t}}function GN(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,a]=n,u=Rt(a,r);return t.filter(f=>{let h=Vu(f,i);if(h===void 0)return!1;switch(s){case">":return Number(h)>Number(u);case">=":return Number(h)>=Number(u);case"<":return Number(h)<Number(u);case"<=":return Number(h)<=Number(u);case"=":return String(h)===String(u);case"!=":return String(h)!==String(u);case"*=":return String(h).includes(String(u));case"^=":return String(h).startsWith(String(u));case"$=":return String(h).endsWith(String(u));default:return!0}})}function Vu(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function QN(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function GE(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}var Mo=class{allVariables;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.sessionVariables,...e.variables}}resolveString(e,r=!1){if(typeof e!="string")return e;if(!r)return e.replace(/\{\{([^}]+)\}\}/g,(u,f)=>this.resolveTemplateContent(f.trim(),this.allVariables,u));let n="",i=0,s=/\{\{([^}]+)\}\}/g,a;for(;(a=s.exec(e))!==null;){let u=a[1].trim(),f=this.resolveTemplateContent(u,this.allVariables,a[0]);if(f!==a[0]){n+=e.slice(i,a.index);let h=this.getStringContext(e,a.index);n+=h?this.escapeForString(String(f),h):String(f)}else n+=e.slice(i,a.index+a[0].length);i=a.index+a[0].length}return n+=e.slice(i),n}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};if(!n)return e.replace(/\{\{([^}]+)\}\}/g,(h,g)=>this.resolveTemplateContent(g.trim(),i,h));let s="",a=0,u=/\{\{([^}]+)\}\}/g,f;for(;(f=u.exec(e))!==null;){let h=f[1].trim(),g=this.resolveTemplateContent(h,i,f[0]);if(g!==f[0]){s+=e.slice(a,f.index);let m=this.getStringContext(e,f.index);s+=m?this.escapeForString(String(g),m):String(g)}else s+=e.slice(a,f.index+f[0].length);a=f.index+f[0].length}return s+=e.slice(a),s}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,a]of Object.entries(e))i[s]=this.resolveObjectWithExtra(a,r,n);return i}return e}resolveTemplateContent(e,r,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let u=GE(i[2],r),f=Vi(i[1],u);return f!==null?String(f):n}let s=Wu(e);if(s){let u=this.resolveFilterInput(s.input,r);if(u!==void 0){let f=Yu(u,s.filters,r);return f!==void 0?String(f):n}return n}let a=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(a){let u=a[1];if(r[u]!==void 0){let f=this.deserializeValue(r[u]),h=a[2],g=this.resolvePropertyAccess(f,h);if(g!==void 0)return typeof g=="object"?JSON.stringify(g):String(g)}}if(r[e]!==void 0){let u=r[e];return typeof u=="string"&&u.charCodeAt(0)===30?u.slice(1):String(u)}if(qo(e)){let u=this.deserializeVariables(r),f=To(e,u),h=$o(e,f);if(h!==void 0)return String(h)}return n}resolveFilterInput(e,r){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=GE(n[2],r),a=Vi(n[1],s);return a!==null?a:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(r[s]!==void 0){let a=this.deserializeValue(r[s]),u=this.resolvePropertyAccess(a,i[2]);if(u!==void 0)return u}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(qo(e)){let s=this.deserializeVariables(r),a=To(e,s),u=$o(e,a);if(u!==void 0)return u}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{return e}return e}deserializeVariables(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.deserializeValue(i);return r}resolvePropertyAccess(e,r){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(r))!==null;){if(n==null)return;if(s[1]!==void 0){let a=s[1];/^\d+$/.test(a)?n=n[Number(a)]:n=n[a.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,r){let n=e.replace(/\\/g,"\\\\");return r==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,r){let n=null;for(let i=0;i<r;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},No=class{interpolate(e,r){return!e||typeof e!="string"?e:new Mo({globals:{},collectionVariables:{},environmentVariables:{},sessionVariables:{},variables:r}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let r=[],n,i=/\{\{([^}]+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(r.includes(s)||r.push(s))}return r}interpolateObject(e,r){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,r);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,r));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,r);return n}return e}};function ZN(t){return new Mo(t)}var Ns=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new No,this.urlBuilder=new Dn}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let r=Hi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};import*as XN from"http";import*as Ju from"https";import{URL as QE}from"url";import*as Sh from"zlib";var Fn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Do=class{settings;version;constructor(e){this.settings={...Fn,...e};try{this.version=qt("../../package.json").version||"0.0.0"}catch{this.version="0.0.0"}this.settings.strictSSL===!1&&console.log("[NodeHttpClient] SSL verification disabled (strictSSL: false)")}async send(e){let r=this.mergeSettings(e.settings);return await this.executeInternal(e,r,0)}mergeSettings(e){return{timeout:e?.timeout??this.settings.timeout,followRedirects:e?.followRedirects??this.settings.followRedirects,followOriginalMethod:e?.followOriginalMethod??this.settings.followOriginalMethod,followAuthHeader:e?.followAuthHeader??this.settings.followAuthHeader,maxRedirects:e?.maxRedirects??this.settings.maxRedirects,strictSSL:e?.strictSSL??this.settings.strictSSL,decompress:e?.decompress??this.settings.decompress,includeCookies:e?.includeCookies??this.settings.includeCookies}}async executeInternal(e,r,n,i){let s=Date.now(),a=new QE(e.url),u=a.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(m=>m.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let g={hostname:a.hostname,port:a.port||(u?443:80),path:a.pathname+a.search,method:e.method,headers:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(g.headers["Accept-Encoding"]="gzip, deflate"),u&&(g.rejectUnauthorized=r.strictSSL,r.strictSSL?g.agent=Ju.globalAgent:g.agent=new Ju.Agent({rejectUnauthorized:!1})),new Promise((m,S)=>{if(i?.aborted){let x=new Error("Request cancelled");x.name="AbortError",S(x);return}let C=(u?Ju:XN).request(g,async x=>{let A=x.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(A)){if(n>=r.maxRedirects){S(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let j=x.headers.location;if(!j){S(new Error("Redirect response missing Location header"));return}let Y=new QE(j,e.url).toString(),V=e.method;!r.followOriginalMethod&&[301,302,303].includes(A)&&(V="GET");let K={...e.headers};r.followAuthHeader||(delete K.authorization,delete K.Authorization);try{let ee=await this.executeInternal({...e,url:Y,method:V,headers:K,body:V==="GET"?void 0:e.body},r,n+1,i),k=Date.now();ee.time=k-s,m(ee)}catch(ee){S(ee)}return}let T=[];x.on("data",j=>T.push(j)),x.on("end",()=>{let j=Date.now(),Y=Buffer.concat(T),V=x.headers["content-encoding"];if(r.decompress&&V)try{V==="gzip"?Y=Sh.gunzipSync(Y):V==="deflate"&&(Y=Sh.inflateSync(Y))}catch(P){console.warn("[NodeHttpClient] Decompression failed:",P)}let K=Y.toString("utf-8"),ee;try{ee=JSON.parse(K)}catch{ee=K}let k={};for(let[P,N]of Object.entries(x.headers))(typeof N=="string"||Array.isArray(N))&&(k[P]=N);let E=this.parseCookies(x.headers["set-cookie"],a.hostname);m({status:x.statusCode||0,statusText:x.statusMessage||"",headers:k,cookies:E,body:ee,time:j-s,size:Y.length})})});if(i&&i.addEventListener("abort",()=>{C.destroy();let x=new Error("Request cancelled");x.name="AbortError",S(x)}),C.on("error",x=>{S(x)}),C.on("timeout",()=>{C.destroy(),S(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let x=typeof e.body=="string"?e.body:JSON.stringify(e.body);C.write(x)}C.end()})}sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}parseCookies(e,r){return e?e.map(n=>{let i=n.split(";").map(g=>g.trim()),[s,...a]=i,[u,f]=s.split("="),h={name:u.trim(),value:f?.trim()||"",domain:r};for(let g of a){let[m,S]=g.split("=");switch(m.toLowerCase().trim()){case"domain":h.domain=S?.trim();break;case"path":h.path=S?.trim();break;case"expires":h.expires=S?.trim();break;case"httponly":h.httpOnly=!0;break;case"secure":h.secure=!0;break}}return h}):[]}};function cv(t){return{timeout:t?.timeout??Fn.timeout,followRedirects:t?.followRedirects??Fn.followRedirects,followOriginalMethod:t?.followOriginalMethod??Fn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??Fn.followAuthHeader,maxRedirects:t?.maxRedirects??Fn.maxRedirects,strictSSL:t?.strictSSL??Fn.strictSSL,decompress:t?.decompress??Fn.decompress,includeCookies:t?.includeCookies??Fn.includeCookies}}var Wi=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}async execute(e){let r=cv(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,e,n);if(a)return a;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,i,n);if(a)return a;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}};var Yi=class{requestInterceptors=[];responseInterceptors=[];errorInterceptors=[];addRequestInterceptor(e){return this.requestInterceptors.push(e),this.sortByPriority(this.requestInterceptors),this}addResponseInterceptor(e){return this.responseInterceptors.push(e),this.sortByPriority(this.responseInterceptors),this}addErrorInterceptor(e){return this.errorInterceptors.push(e),this.sortByPriority(this.errorInterceptors),this}removeRequestInterceptor(e){let r=this.requestInterceptors.findIndex(n=>n.name===e);return r>=0?(this.requestInterceptors.splice(r,1),!0):!1}removeResponseInterceptor(e){let r=this.responseInterceptors.findIndex(n=>n.name===e);return r>=0?(this.responseInterceptors.splice(r,1),!0):!1}removeErrorInterceptor(e){let r=this.errorInterceptors.findIndex(n=>n.name===e);return r>=0?(this.errorInterceptors.splice(r,1),!0):!1}async executeRequestInterceptors(e,r){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,r)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,r,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,r,n)}catch(a){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,a),a}return i}async executeErrorInterceptors(e,r,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,r,n);if(s)return s}catch(s){console.error(`[InterceptorChain] Error interceptor '${i.name}' failed:`,s)}}clear(){this.requestInterceptors=[],this.responseInterceptors=[],this.errorInterceptors=[]}getRegisteredInterceptors(){return{request:this.requestInterceptors.map(e=>e.name),response:this.responseInterceptors.map(e=>e.name),error:this.errorInterceptors.map(e=>e.name)}}sortByPriority(e){e.sort((r,n)=>(r.priority??100)-(n.priority??100))}},fv=class{name="logging";priority=1e3;intercept(e,r){return e}},dv=class{name="timing";priority=1;intercept(e,r,n){return e}},hv=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,r=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=r}handle(e,r,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}};import*as Xt from"crypto";import*as kU from"querystring";import*as AR from"vm";import*as xU from"crypto";import*as Ec from"fs";import{createRequire as RU}from"module";import*as bi from"path";function np(){return{format:(t,e)=>{let r=t?new Date(t):new Date;return e==="YYYY-MM-DD"?r.toISOString().split("T")[0]:r.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let t=new Date;return{format:()=>t.toISOString(),toISOString:()=>t.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function PR(){return{get:(t,e,r)=>{let n=e.split("."),i=t;for(let s of n)if(i=i?.[s],i===void 0)return r;return i},set:(t,e,r)=>{let n=e.split("."),i=t;for(let s=0;s<n.length-1;s++)i[n[s]]||(i[n[s]]={}),i=i[n[s]];return i[n[n.length-1]]=r,t},cloneDeep:t=>JSON.parse(JSON.stringify(t)),keys:t=>Object.keys(t??{}),values:t=>Object.values(t??{}),entries:t=>Object.entries(t??{}),each(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},forEach(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},map:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).map(r=>e(r)),filter:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).filter(r=>e(r)),find:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).find(r=>e(r)),reduce:(t,e,r)=>(Array.isArray(t)?t:Object.values(t??{})).reduce((n,i)=>e(n,i),r),includes:(t,e)=>Array.isArray(t)?t.includes(e):Object.values(t??{}).includes(e),isObject:t=>t!==null&&typeof t=="object"&&!Array.isArray(t),isArray:t=>Array.isArray(t),isString:t=>typeof t=="string",isNumber:t=>typeof t=="number",isFunction:t=>typeof t=="function",isNil:t=>t==null,isEmpty:t=>t==null?!0:Array.isArray(t)||typeof t=="string"?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1,assign:(t,...e)=>Object.assign(t,...e),merge:(t,...e)=>{let r={...t};for(let n of e)for(let[i,s]of Object.entries(n??{}))r[i]=s&&typeof s=="object"&&!Array.isArray(s)?{...r[i]??{},...s}:s;return r},omit:(t,e)=>{let r={...t};for(let n of e)delete r[n];return r},pick:(t,e)=>{let r={};for(let n of e)n in(t??{})&&(r[n]=t[n]);return r}}}var rp=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:Xa}),crypto:()=>xU,path:()=>bi,querystring:()=>qt("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>ZE(),PR),moment:()=>this.loadOptionalModule("moment",()=>XE(),np),tv4:()=>this.loadOptionalModule("tv4",()=>tC()),ajv:()=>this.loadOptionalModule("ajv",()=>OR()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>qt("crypto-js"),()=>{throw new Error('crypto-js npm module is not installed. The built-in CryptoJS global is already available in scripts with AES/DES/TripleDES/hash/HMAC/PBKDF2 support. If you need the exact npm package, add "crypto-js" to your modules/package.json and run npm install.')})};constructor(e=[],r={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...r,outputChannel:r.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e)if(this.initializeModules(n)){this.modulesPath=n;break}}loadOptionalModule(e,r,n){try{return r()}catch{if(this.customModulesRequire)try{return console.debug(`[ModuleLoader] ${e} not in core, trying user modules`),this.customModulesRequire(e)}catch{this.logModuleWarning(e,"user")}else this.logModuleWarning(e,"core");if(n)return console.warn(`[ModuleLoader] Using shim for ${e}. Some features may be limited.`),n();throw new Error(this.getModuleInstallInstructions(e))}}logModuleWarning(e,r){let i={moment:"Date/time manipulation",lodash:"Utility functions",tv4:"JSON Schema validation (v4)",ajv:"JSON Schema validation"}[e]||e;console.warn(`[ModuleLoader] ${i} functionality (${e}) is not available.
|
|
210
|
+
`)}`));if(!("location"in i.headers)||!i.headers.location)throw(0,Am.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Tf.resolve(t.href,i.headers.location);return Ok(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new Ik.ResolverError((0,Am.ono)(i,`Error downloading ${t.href}`),t.href)}}async function qG(t,e){let r,n;e.timeout&&(r=new AbortController,n=setTimeout(()=>r.abort(),e.timeout));let i=await fetch(t,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:r?r.signal:null});return n&&clearTimeout(n),i}});var tw=F(ss=>{"use strict";var Gl=ss&&ss.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ss,"__esModule",{value:!0});ss.getNewOptions=ss.getJsonSchemaRefParserDefaultOptions=void 0;var $G=Gl(s1()),MG=Gl(bk()),NG=Gl(_k()),DG=Gl(wk()),FG=Gl(Rk()),LG=Gl(Pk()),jG=()=>({parse:{json:{...$G.default},yaml:{...MG.default},text:{...NG.default},binary:{...DG.default}},resolve:{file:{...FG.default},http:{...LG.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});ss.getJsonSchemaRefParserDefaultOptions=jG;var UG=t=>{let e=(0,ss.getJsonSchemaRefParserDefaultOptions)();return t&&Ak(e,t),e};ss.getNewOptions=UG;function Ak(t,e){if(kk(e)){let r=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<r.length;n++){let i=r[n],s=e[i],a=t[i];kk(s)?t[i]=Ak(a||{},s):s!==void 0&&(t[i]=s)}}return t}function kk(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var qk=F(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.normalizeArgs=Tk;var BG=tw();function Tk(t){let e,r,n,i,s=Array.prototype.slice.call(t);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(r=s[1],n=s[2]):(r=void 0,n=s[1])):(e="",r=s[0],n=s[1]);try{n=(0,BG.getNewOptions)(n)}catch(a){console.error(`JSON Schema Ref Parser: Error normalizing options: ${a}`)}return!n.mutateInputSchema&&typeof r=="object"&&(r=JSON.parse(JSON.stringify(r))),{path:e,schema:r,options:n,callback:i}}Tm.default=Tk});var $k=F(Gn=>{"use strict";var HG=Gn&&Gn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),VG=Gn&&Gn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),WG=Gn&&Gn.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&HG(r,e,n[i]);return VG(r,e),r}}(),rw=Gn&&Gn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gn,"__esModule",{value:!0});var YG=rw(Bl()),JG=rw(wf()),zG=rw(v_()),Ql=WG(vn()),KG=Sn();function GG(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=nw(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function nw(t,e,r,n,i,s){i||(i=new Set);let a=[];if(t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!i.has(t)){i.add(t),YG.default.isExternal$Ref(t)&&a.push(QG(t,e,r,n));let u=Object.keys(t);for(let f of u){let h=JG.default.join(e,f),g=t[f];a=a.concat(nw(g,h,r,n,i,s))}}return a}async function QG(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Ql.resolve(i?Ql.cwd():e,t.$ref),a=Ql.stripHash(s),u=r._$refs[a];if(u)return Promise.resolve(u.value);try{let f=await(0,zG.default)(s,r,n),h=nw(f,a+"#",r,n,new Set,!0);return Promise.all(h)}catch(f){if(!n?.continueOnError||!(0,KG.isHandledError)(f))throw f;return r._$refs[a]&&(f.source=decodeURI(Ql.stripHash(e)),f.path=Ql.safePointerToPath(Ql.getHash(e))),[]}}Gn.default=GG});var Dk=F(Qn=>{"use strict";var ZG=Qn&&Qn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),XG=Qn&&Qn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),e4=Qn&&Qn.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&ZG(r,e,n[i]);return XG(r,e),r}}(),Nk=Qn&&Qn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qn,"__esModule",{value:!0});var qm=Nk(Bl()),qf=Nk(wf()),iw=e4(vn());function t4(t,e){let r=[];sw(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),r4(r)}function sw(t,e,r,n,i,s,a,u){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(qm.default.isAllowed$Ref(f))Mk(t,e,r,n,i,s,a,u);else{let h=Object.keys(f).sort((g,m)=>g==="definitions"?-1:m==="definitions"?1:g.length-m.length);for(let g of h){let m=qf.default.join(r,g),S=qf.default.join(n,g),_=f[g];qm.default.isAllowed$Ref(_)?Mk(f,g,r,S,i,s,a,u):sw(f,g,m,S,i,s,a,u)}}}function Mk(t,e,r,n,i,s,a,u){let f=e===null?t:t[e],h=iw.resolve(r,f.$ref),g=a._resolve(h,n,u);if(g===null)return;let S=qf.default.parse(n).length,_=iw.stripHash(g.path),C=iw.getHash(g.path),x=_!==a._root$Ref.path,A=qm.default.isExtended$Ref(f);i+=g.indirections;let T=n4(s,t,e);if(T)if(S<T.depth||i<T.indirections)i4(s,T);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:S,file:_,hash:C,value:g.value,circular:g.circular,extended:A,external:x,indirections:i}),(!T||x)&&sw(g.value,null,g.path,n,i+1,s,a,u)}function r4(t){t.sort((i,s)=>{if(i.file!==s.file)return i.file<s.file?-1:1;if(i.hash!==s.hash)return i.hash<s.hash?-1:1;if(i.circular!==s.circular)return i.circular?-1:1;if(i.extended!==s.extended)return i.extended?1:-1;if(i.indirections!==s.indirections)return i.indirections-s.indirections;if(i.depth!==s.depth)return i.depth-s.depth;{let a=i.pathFromRoot.lastIndexOf("/definitions"),u=s.pathFromRoot.lastIndexOf("/definitions");return a!==u?u-a:i.pathFromRoot.length-s.pathFromRoot.length}});let e,r,n;for(let i of t)i.external?i.file===e&&i.hash===r?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(r+"/")===0?i.$ref.$ref=qf.default.join(n,qf.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=qm.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function n4(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function i4(t,e){let r=t.indexOf(e);t.splice(r,1)}Qn.default=t4});var Hk=F(Zn=>{"use strict";var s4=Zn&&Zn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),o4=Zn&&Zn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a4=Zn&&Zn.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&s4(r,e,n[i]);return o4(r,e),r}}(),Uk=Zn&&Zn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zn,"__esModule",{value:!0});var $m=Uk(Bl()),Fk=Uk(wf()),l4=ro(),Lk=a4(vn()),u4=Sn();Zn.default=c4;function c4(t,e){let r=Date.now(),n=ow(t.schema,t.$refs._root$Ref.path,"#",new Set,new Set,new Map,t.$refs,e,r);t.$refs.circular=n.circular,t.schema=n.value}function ow(t,e,r,n,i,s,a,u,f){let h,g={value:t,circular:!1};if(u&&u.timeoutMs&&Date.now()-f>u.timeoutMs)throw new u4.TimeoutError(u.timeoutMs);let m=u.dereference||{},S=m.excludedPathMatcher||(()=>!1);if((m?.circular==="ignore"||!i.has(t))&&t&&typeof t=="object"&&!ArrayBuffer.isView(t)&&!S(r)){if(n.add(t),i.add(t),$m.default.isAllowed$Ref(t,u))h=jk(t,e,r,n,i,s,a,u,f),g.circular=h.circular,g.value=h.value;else for(let _ of Object.keys(t)){let C=Fk.default.join(e,_),x=Fk.default.join(r,_);if(S(x))continue;let A=t[_],T=!1;if($m.default.isAllowed$Ref(A,u)){if(h=jk(A,C,x,n,i,s,a,u,f),T=h.circular,t[_]!==h.value){let j=new Map;m?.preservedProperties&&typeof t[_]=="object"&&!Array.isArray(t[_])&&m?.preservedProperties.forEach(Y=>{Y in t[_]&&j.set(Y,t[_][Y])}),t[_]=h.value,m?.preservedProperties&&j.size&&typeof t[_]=="object"&&!Array.isArray(t[_])&&j.forEach((Y,V)=>{t[_][V]=Y}),m?.onDereference?.(A.$ref,t[_],t,_)}}else n.has(A)?T=Bk(C,a,u):(h=ow(A,C,x,n,i,s,a,u,f),T=h.circular,t[_]!==h.value&&(t[_]=h.value));g.circular=g.circular||T}n.delete(t)}return g}function jk(t,e,r,n,i,s,a,u,f){let g=$m.default.isExternal$Ref(t)&&u?.dereference?.externalReferenceResolution==="root",m=Lk.resolve(g?Lk.cwd():e,t.$ref),S=s.get(m);if(S&&!S.circular){let j=Object.keys(t);if(j.length>1){let Y={};for(let V of j)V!=="$ref"&&!(V in S.value)&&(Y[V]=t[V]);return{circular:S.circular,value:Object.assign({},S.value,Y)}}return S}let _=a._resolve(m,e,u);if(_===null)return{circular:!1,value:null};let C=_.circular,x=C||n.has(_.value);x&&Bk(e,a,u);let A=$m.default.dereference(t,_.value);if(!x){let j=ow(A,_.path,r,n,i,s,a,u,f);x=j.circular,A=j.value}x&&!C&&u.dereference?.circular==="ignore"&&(A=t),C&&(A.$ref=r);let T={circular:x,value:A};return Object.keys(t).length===1&&s.set(m,T),T}function Bk(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw l4.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var Vk=F(aw=>{"use strict";Object.defineProperty(aw,"__esModule",{value:!0});function f4(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}aw.default=f4()});var Yk=F($f=>{"use strict";var d4=$f&&$f.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($f,"__esModule",{value:!0});$f.default=h4;var Wk=d4(Vk());function h4(t,e){if(t){e.then(function(r){(0,Wk.default)(function(){t(null,r)})},function(r){(0,Wk.default)(function(){t(r)})});return}else return e}});var Gk=F(_e=>{"use strict";var p4=_e&&_e.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),m4=_e&&_e.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),g4=_e&&_e.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),i=0;i<n.length;i++)n[i]!=="default"&&p4(r,e,n[i]);return m4(r,e),r}}(),ha=_e&&_e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_e,"__esModule",{value:!0});_e.getJsonSchemaRefParserDefaultOptions=_e.jsonSchemaParserNormalizeArgs=_e.dereferenceInternal=_e.JSONParserErrorGroup=_e.isHandledError=_e.UnmatchedParserError=_e.ParserError=_e.ResolverError=_e.MissingPointerError=_e.InvalidPointerError=_e.JSONParserError=_e.UnmatchedResolverError=_e.dereference=_e.bundle=_e.resolve=_e.parse=_e.$RefParser=void 0;var Jk=ha(e1()),y4=ha(v_()),Mf=ha(qk());_e.jsonSchemaParserNormalizeArgs=Mf.default;var v4=ha($k()),S4=ha(Dk()),Kk=ha(Hk());_e.dereferenceInternal=Kk.default;var da=g4(vn()),bn=Sn();Object.defineProperty(_e,"JSONParserError",{enumerable:!0,get:function(){return bn.JSONParserError}});Object.defineProperty(_e,"InvalidPointerError",{enumerable:!0,get:function(){return bn.InvalidPointerError}});Object.defineProperty(_e,"MissingPointerError",{enumerable:!0,get:function(){return bn.MissingPointerError}});Object.defineProperty(_e,"ResolverError",{enumerable:!0,get:function(){return bn.ResolverError}});Object.defineProperty(_e,"ParserError",{enumerable:!0,get:function(){return bn.ParserError}});Object.defineProperty(_e,"UnmatchedParserError",{enumerable:!0,get:function(){return bn.UnmatchedParserError}});Object.defineProperty(_e,"UnmatchedResolverError",{enumerable:!0,get:function(){return bn.UnmatchedResolverError}});Object.defineProperty(_e,"isHandledError",{enumerable:!0,get:function(){return bn.isHandledError}});Object.defineProperty(_e,"JSONParserErrorGroup",{enumerable:!0,get:function(){return bn.JSONParserErrorGroup}});var zk=ro(),Xn=ha(Yk()),b4=tw();Object.defineProperty(_e,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return b4.getJsonSchemaRefParserDefaultOptions}});var ao=class t{constructor(){this.schema=null,this.$refs=new Jk.default}async parse(){let e=(0,Mf.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,zk.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,Xn.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new Jk.default;let n="http";if(da.isFileSystemPath(e.path))e.path=da.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=da.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=da.resolve(da.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,r=Promise.resolve(e.schema)}else r=(0,y4.default)(e.path,this.$refs,e.options);try{let i=await r;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,Xn.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,Xn.default)(e.callback,Promise.resolve(this.schema));throw zk.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,bn.isHandledError)(i)?(0,Xn.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[da.stripHash(e.path)]&&this.$refs._$refs[da.stripHash(e.path)].addError(i),(0,Xn.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,Mf.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,v4.default)(this,e.options),lw(this),(0,Xn.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,Xn.default)(e.callback,Promise.reject(r))}}static resolve(){let e=new t;return e.resolve.apply(e,arguments)}static bundle(){let e=new t;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,Mf.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,S4.default)(this,e.options),lw(this),(0,Xn.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,Xn.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,Mf.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,Kk.default)(this,e.options),lw(this),(0,Xn.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,Xn.default)(e.callback,Promise.reject(r))}}};_e.$RefParser=ao;_e.default=ao;function lw(t){if(bn.JSONParserErrorGroup.getParserErrors(t).length>0)throw new bn.JSONParserErrorGroup(t)}_e.parse=ao.parse;_e.resolve=ao.resolve;_e.bundle=ao.bundle;_e.dereference=ao.dereference});var Za=class{constructor(e,r){this.fileSystem=e;this.parserRegistry=r}directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,r={}){let n=await this.fileSystem.readFile(e);if(r.format){let s=this.parserRegistry.get(r.format);if(!s)throw new Error(`No parser registered for format: ${r.format}`);return s.parse(n,e)}let i=this.parserRegistry.detect(n);if(!i)throw new Error(`Could not detect collection format for: ${e}. Supported formats: ${this.parserRegistry.getFormats().join(", ")}`);return i.parser.parse(n,e)}async loadDirectory(e,r=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(r,e);for(let s of i)try{let a=await this.load(s);n.push(a)}catch{}return n}async canLoad(e){try{if(!await this.fileSystem.exists(e))return!1;let r=await this.fileSystem.readFile(e);return this.parserRegistry.detect(r)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};import*as Se from"fs";import*as xe from"path";function xt(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function at(t){let e=Date.now().toString(36)+Math.random().toString(36).substr(2,9);return t?`${xt(t)}_${e}`:e}function rv(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function Fu(t,e){let r={},n={};for(let[i,s]of Object.entries(t)){let a=i.toLowerCase();n[a]=i,r[i]=s}for(let[i,s]of Object.entries(e)){let a=i.toLowerCase(),u=n[a];u&&delete r[u],n[a]=i,r[i]=s}return r}function vN(t){return JSON.parse(JSON.stringify(t))}function SN(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function bN(t,e){try{return JSON.parse(t)}catch{return e}}function _N(t){if(t===0)return"0 B";let e=1024,r=["B","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,n)).toFixed(1))} ${r[n]}`}function wN(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}import*as tt from"fs";import*as Nn from"path";var ch={preRequest:"pre-request.js",postResponse:"post-response.js"},yr={collection:"collection.json",folder:"folder.json",request:"request.json"},FE={"body.json":{type:"raw",format:"json"},"body.xml":{type:"raw",format:"xml"},"body.txt":{type:"raw",format:"text"},"body.html":{type:"raw",format:"html"},"body.js":{type:"raw",format:"javascript"},"body.graphql":{type:"graphql"}},Lu={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},cn="scripts";function fh(t){if(!tt.existsSync(t))return;let e={},r=Nn.join(t,ch.preRequest);tt.existsSync(r)&&(e.preRequest=tt.readFileSync(r,"utf-8"));let n=Nn.join(t,ch.postResponse);return tt.existsSync(n)&&(e.postResponse=tt.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function dh(t,e){await tt.promises.mkdir(t,{recursive:!0});let r=Nn.join(t,ch.preRequest);e.preRequest?await tt.promises.writeFile(r,e.preRequest,"utf-8"):tt.existsSync(r)&&await tt.promises.unlink(r);let n=Nn.join(t,ch.postResponse);e.postResponse?await tt.promises.writeFile(n,e.postResponse,"utf-8"):tt.existsSync(n)&&await tt.promises.unlink(n)}function LE(t){for(let[e,r]of Object.entries(FE)){let n=Nn.join(t,e);if(tt.existsSync(n))try{let i=tt.readFileSync(n,"utf-8"),s;if(r.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:r.type,format:r.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function jE(t){if(!t||t.type==="none")return{bodyForMetadata:t};if(t.type==="raw"){let e=t.format||"json",n={json:"body.json",xml:"body.xml",text:"body.txt",html:"body.html",javascript:"body.js"}[e];if(n){let i=e==="json"?typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2):String(t.content||"");return{bodyForMetadata:{type:t.type,format:t.format},externalBodyFile:{filename:n,content:i}}}}if(t.type==="graphql"){let e=typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2);return{bodyForMetadata:{type:t.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:t}}async function UE(t,e){for(let r of Object.keys(FE))if(r!==e){let n=Nn.join(t,r);if(tt.existsSync(n))try{await tt.promises.unlink(n)}catch{}}}function BE(t){if(tt.existsSync(t))try{let e=tt.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function HE(t,e,r){let n=Nn.join(t,Lu.responseSchema),i=Nn.join(t,Lu.bodySchema);e?await tt.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):tt.existsSync(n)&&await tt.promises.unlink(n),r?await tt.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):tt.existsSync(i)&&await tt.promises.unlink(i)}function nv(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=nv(r.items,e);if(n)return n}}}function iv(t,e){for(let r=0;r<t.length;r++){let n=t[r];if(n.id===e)return t.splice(r,1),!0;if(n.type==="folder"&&n.items&&iv(n.items,e))return!0}return!1}function VE(t,e){let r=new Map(t.map(i=>[i.id,i])),n=[];for(let i of e){let s=r.get(i);s&&(n.push(s),r.delete(i))}for(let i of r.values())n.push(i);return n}function sv(t,e){let r;try{r=tt.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===cn)continue;if(n.name===e)return Nn.join(t,n.name);let i=sv(Nn.join(t,n.name),e);if(i)return i}}function Bi(t,e=[]){let r=t.toLowerCase().trim(),n=r.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=r.match(/t(\d+)/gi)||[],a=0;for(let S of s){let _=parseInt(S.substring(1));_>a&&(a=_)}let u="";if(a>0)u=`t${a}`;else{let S=r.match(/[_\s-](\d+\.\d+)[_\s-]/);S&&(u=`v${S[1].replace(".","_")}`)}let f=r;n&&(f=f.substring(n[0].length)),f=f.replace(/[_\s-]?t\d+(?:\.\d+)?[_\s-]?/gi,"-"),f=f.replace(/[_\s-]?\d+\.\d+[_\s-]?/g,"-"),f=f.replace(/\([^)]+\)/g,""),f=f.replace(/:[a-z_][a-z0-9_]*/gi,""),f=f.replace(/\{[^}]+\}/g,""),f=f.replace(/\?$/g,"").replace(/[_/\\ ]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"");let h=f.split("-").filter(S=>S.length>0),g=[];i&&g.push(i),g.push(...h),u&&g.push(u);let m=g.join("-");if(m||(m="item"),e.includes(m)){let S=2;for(;e.includes(`${m}-${S}`);)S++;m=`${m}-${S}`}return m}var $s=class{collectionsDir;cache=new Map;slugToIdMap=new Map;idToSlugMap=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}getSlugById(e){return this.idToSlugMap.get(e)}getIdBySlug(e){return this.slugToIdMap.get(e)}ensureDirectory(){Se.existsSync(this.collectionsDir)||Se.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!Se.existsSync(this.collectionsDir))return[];let e=Se.readdirSync(this.collectionsDir,{withFileTypes:!0}),r=[];for(let n of e)if(n.isDirectory())try{let i=this.loadCollectionFromFolder(n.name);i&&(this.cache.set(i.id,i),this.slugToIdMap.set(n.name,i.id),this.idToSlugMap.set(i.id,n.name),r.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return r}loadCollectionFromFolder(e){let r=xe.join(this.collectionsDir,e),n=xe.join(r,yr.collection);if(Se.existsSync(n))try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(xe.join(r,cn)),u=this.loadItemsFromDir(r,s.id,s.order);return{id:s.id,name:s.name,description:s.description,version:s.version,variables:s.variables,auth:s.auth,scripts:a,items:u}}catch(i){console.error(`[FolderCollectionStore] Failed to parse ${n}:`,i);return}}loadItemsFromDir(e,r,n){let i=[],s=new Map,a=Se.readdirSync(e,{withFileTypes:!0});for(let u of a){if(!u.isDirectory()||u.name===cn)continue;let f=xe.join(e,u.name);if(Se.existsSync(xe.join(f,yr.folder))){let h=this.loadFolderFromDir(f,u.name);h&&s.set(u.name,h)}else if(Se.existsSync(xe.join(f,yr.request))){let h=this.loadRequestFromDir(f,u.name);h&&s.set(u.name,h)}}if(n&&n.length>0){for(let u of n){let f=s.get(u);f&&(i.push(f),s.delete(u))}for(let u of s.values())i.push(u)}else for(let u of s.values())i.push(u);return i}loadFolderFromDir(e,r){let n=xe.join(e,yr.folder);try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(xe.join(e,cn)),u=this.loadItemsFromDir(e,s.id,s.order);return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"folder",name:s.name,description:s.description,auth:s.auth,scripts:a,items:u}}catch(i){console.error(`[FolderCollectionStore] Failed to load folder ${e}:`,i);return}}loadRequestFromDir(e,r){let n=xe.join(e,yr.request);try{let i=Se.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(xe.join(e,cn)),u=s.body,f=this.loadBodyFromDir(e);f&&(u=f);let h=this.loadSchemaFile(xe.join(e,Lu.responseSchema)),g=this.loadSchemaFile(xe.join(e,Lu.bodySchema)),m=xe.join(e,"doc.md"),S=Se.existsSync(m)?Se.readFileSync(m,"utf-8"):void 0;return this.slugToIdMap.set(r,s.id),this.idToSlugMap.set(s.id,r),{id:s.id,type:"request",name:s.name,description:s.description,method:s.method,url:s.url,params:s.params,query:s.query,headers:s.headers,body:u,auth:s.auth,settings:s.settings,scripts:a,deprecated:s.deprecated,...S&&{doc:S},...h&&{responseSchema:h},...g&&{bodySchema:g}}}catch(i){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,i);return}}loadScriptsFromDir(e){return fh(e)}loadBodyFromDir(e){return LE(e)}loadSchemaFile(e){return BE(e)}async saveSchemaFiles(e,r){return HE(e,r.responseSchema,r.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.idToSlugMap.get(e);if(r){let n=this.loadCollectionFromFolder(r);return n&&this.cache.set(e,n),n}return this.loadAll(),this.cache.get(e)}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=at(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let a=Se.readdirSync(this.collectionsDir);r=Bi(e.name,a),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=xe.join(this.collectionsDir,r);await Se.promises.mkdir(n,{recursive:!0});let i={id:e.id,name:e.name,description:e.description,version:e.version,variables:e.variables,auth:e.auth};await Se.promises.writeFile(xe.join(n,yr.collection),JSON.stringify(i,null,2),"utf-8"),e.scripts&&await this.saveScriptsToDir(xe.join(n,cn),e.scripts);let s=await this.saveItemsToDir(n,e.items);s.length>0&&(i.order=s,await Se.promises.writeFile(xe.join(n,yr.collection),JSON.stringify(i,null,2),"utf-8")),this.cache.set(e.id,e)}async saveItemsToDir(e,r){let n=[];for(let i of r){let s=this.idToSlugMap.get(i.id);s||(s=Bi(i.name,n),this.idToSlugMap.set(i.id,s),this.slugToIdMap.set(s,i.id)),n.push(s);let a=xe.join(e,s);await Se.promises.mkdir(a,{recursive:!0}),i.type==="folder"?await this.saveFolderToDir(a,i):await this.saveRequestToDir(a,i)}return n}async saveFolderToDir(e,r){let n={id:r.id,name:r.name,description:r.description,auth:r.auth};if(await Se.promises.writeFile(xe.join(e,yr.folder),JSON.stringify(n,null,2),"utf-8"),r.scripts&&await this.saveScriptsToDir(xe.join(e,cn),r.scripts),r.items){let i=await this.saveItemsToDir(e,r.items);i.length>0&&(n.order=i,await Se.promises.writeFile(xe.join(e,yr.folder),JSON.stringify(n,null,2),"utf-8"))}}async saveRequestToDir(e,r){let{bodyForMetadata:n,externalBodyFile:i}=this.prepareBodyForSave(r.body),s={id:r.id,name:r.name,method:r.method||"GET",url:r.url||"",description:r.description,params:r.params,query:r.query,headers:r.headers,body:n,auth:r.auth,settings:r.settings,...r.deprecated&&{deprecated:r.deprecated}};await Se.promises.writeFile(xe.join(e,yr.request),JSON.stringify(s,null,2),"utf-8"),i&&await Se.promises.writeFile(xe.join(e,i.filename),i.content,"utf-8"),await this.cleanupOldBodyFiles(e,i?.filename),await this.saveSchemaFiles(e,r),r.doc&&await Se.promises.writeFile(xe.join(e,"doc.md"),r.doc,"utf-8"),r.scripts&&await this.saveScriptsToDir(xe.join(e,cn),r.scripts)}prepareBodyForSave(e){return jE(e)}async cleanupOldBodyFiles(e,r){return UE(e,r)}async saveScriptsToDir(e,r){return dh(e,r)}async delete(e){let r=this.idToSlugMap.get(e);if(!r&&(this.loadAll(),r=this.idToSlugMap.get(e),!r))return!1;let n=xe.join(this.collectionsDir,r);if(!Se.existsSync(n))return!1;try{return await Se.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(r),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let r=this.idToSlugMap.get(e);return r?Se.existsSync(xe.join(this.collectionsDir,r,yr.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return xe.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||at(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,r);if(!s)throw new Error(`Item ${r} not found in collection ${e}`);await this.saveScriptsToDir(xe.join(s,cn),n);let a=this.findItemById(i.items,r);a&&(a.scripts=n)}loadScripts(e,r){let n=this.findItemPath(e,r);if(n)return this.loadScriptsFromDir(xe.join(n,cn))}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);let i=this.idToSlugMap.get(e);if(!i)throw new Error(`Collection slug not found for ${e}`);let s=xe.join(this.collectionsDir,i),a=xe.join(s,yr.collection),u=Se.readFileSync(a,"utf-8"),h={...JSON.parse(u),...r,id:e};await Se.promises.writeFile(a,JSON.stringify(h,null,2),"utf-8"),r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.idToSlugMap.get(e);if(!s)throw new Error(`Collection slug not found for ${e}`);let a;if(n){let g=this.findItemPath(e,n);if(!g)throw new Error(`Parent folder ${n} not found`);a=g}else a=xe.join(this.collectionsDir,s);let u=this.idToSlugMap.get(r.id);if(!u){let g=Se.readdirSync(a).filter(m=>Se.statSync(xe.join(a,m)).isDirectory()&&m!==cn);u=Bi(r.name,g),this.idToSlugMap.set(r.id,u),this.slugToIdMap.set(u,r.id)}let f=xe.join(a,u);await Se.promises.mkdir(f,{recursive:!0}),r.type==="folder"?await this.saveFolderToDir(f,r):await this.saveRequestToDir(f,r);let h=this.findItemById(i.items,r.id);if(h)Object.assign(h,r);else if(n){let g=this.findItemById(i.items,n);g&&g.type==="folder"&&(g.items=g.items||[],g.items.push(r))}else i.items.push(r)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,r);if(!i||!Se.existsSync(i))return!1;try{await Se.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,r);let s=this.idToSlugMap.get(r);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(r)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${r}:`,s),!1}}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,r);if(!s)return!1;let a=this.findItemById(i.items,r);if(!a)return!1;let{id:u,type:f,items:h,...g}=n;return Object.assign(a,g),a.type==="folder"?await this.saveFolderToDir(s,a):await this.saveRequestToDir(s,a),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=this.findItemPath(e,r);if(!a||!Se.existsSync(a))return!1;let u;if(n){let g=this.findItemPath(e,n);if(!g)return!1;u=g}else u=xe.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let h=xe.join(u,f);if(Se.existsSync(h))return!1;try{await Se.promises.rename(a,h);let g=this.findItemById(i.items,r);if(g){let m=g.type==="folder"?{...g,items:g.items?[...g.items]:[]}:{...g};if(this.deleteItemFromTree(i.items,r),n){let S=this.findItemById(i.items,n);S&&S.type==="folder"&&(S.items=S.items||[],S.items.push(m))}else i.items.push(m)}return!0}catch(g){return console.error(`[FolderCollectionStore] Failed to move item ${r}:`,g),!1}}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.idToSlugMap.get(e);if(!s)return!1;let a=[];for(let u of n){let f=this.idToSlugMap.get(u);f&&a.push(f)}try{if(r){let u=this.findItemPath(e,r);if(!u)return!1;let f=xe.join(u,yr.folder),h=Se.readFileSync(f,"utf-8"),g=JSON.parse(h);g.order=a,await Se.promises.writeFile(f,JSON.stringify(g,null,2),"utf-8");let m=this.findItemById(i.items,r);m&&m.type==="folder"&&m.items&&(m.items=this.sortItemsByOrder(m.items,n))}else{let u=xe.join(this.collectionsDir,s,yr.collection),f=Se.readFileSync(u,"utf-8"),h=JSON.parse(f);h.order=a,await Se.promises.writeFile(u,JSON.stringify(h,null,2),"utf-8"),i.items=this.sortItemsByOrder(i.items,n)}return!0}catch(u){return console.error("[FolderCollectionStore] Failed to reorder items:",u),!1}}sortItemsByOrder(e,r){return VE(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=this.idToSlugMap.get(r);if(i)return sv(xe.join(this.collectionsDir,n),i)}findItemById(e,r){return nv(e,r)}deleteItemFromTree(e,r){return iv(e,r)}};function ov(t,e){return{id:t.id,name:t.name,description:t.description,variables:t.variables||{},auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(WE),source:{format:"folder",filePath:e,version:t.version}}}function WE(t){if(t.type==="folder")return{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(WE)};let e=t;return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:e.headers||[],query:e.query||[],params:e.params,body:e.body??void 0,auth:e.auth,settings:e.settings,scripts:e.scripts,...e.deprecated&&{deprecated:e.deprecated},...e.doc&&{doc:e.doc},...e.responseSchema&&{responseSchema:e.responseSchema},...e.bodySchema&&{bodySchema:e.bodySchema}}}function EN(t){return{id:t.id,name:t.name,description:t.description,version:t.source?.version,variables:t.variables,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(av)}}function av(t){return t.type==="folder"?{type:"folder",id:t.id,name:t.name,description:t.description,auth:t.auth,scripts:t.scripts,items:(t.items||[]).map(av)}:{type:"request",id:t.id,name:t.name,description:t.description,method:t.method,url:t.url,headers:t.headers,query:t.query,params:t.params,body:t.body,auth:t.auth,settings:t.settings,scripts:t.scripts,...t.deprecated&&{deprecated:t.deprecated},...t.doc&&{doc:t.doc}}}var ju=class{store;constructor(e){this.store=new $s(e)}loadAll(){return this.store.loadAll().map(r=>ov(r,this.store.getCollectionPath(r.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let r=this.store.load(e);if(r)return ov(r,this.store.getCollectionPath(r.id))}async create(e,r){let n=await this.store.create(e,r);return ov(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(EN(e))}async delete(e){return this.store.delete(e)}exists(e){return this.store.exists(e)}getCollectionPath(e){return this.store.getCollectionPath(e)}async updateCollectionMetadata(e,r){return this.store.updateCollectionMetadata(e,r)}async saveItem(e,r,n){return this.store.saveItem(e,av(r),n)}async updateItem(e,r,n){let i={...n};return this.store.updateItem(e,r,i)}async deleteItem(e,r){return this.store.deleteItem(e,r)}async moveItem(e,r,n){return this.store.moveItem(e,r,n)}async reorderItems(e,r,n){return this.store.reorderItems(e,r,n)}async saveScripts(e,r,n){return this.store.saveScripts(e,r,n)}loadScripts(e,r){return this.store.loadScripts(e,r)}};var Uu=class{parsers=new Map;register(e,r){this.parsers.set(e.toLowerCase(),r)}get(e){return this.parsers.get(e.toLowerCase())}has(e){return this.parsers.has(e.toLowerCase())}getFormats(){return Array.from(this.parsers.keys())}detect(e){for(let[r,n]of this.parsers)if(n.canParse(e))return{parser:n,format:r};return null}clear(){this.parsers.clear()}};var lt=class{static parseSetCookie(e,r){let n=e.split(";").map(g=>g.trim());if(n.length===0)return null;let[i,...s]=n,a=i.indexOf("=");if(a===-1)return null;let u=i.substring(0,a).trim(),f=i.substring(a+1).trim(),h={name:u,value:f,domain:r};for(let g of s){let m=g.indexOf("="),S=(m===-1?g:g.substring(0,m)).toLowerCase(),_=m===-1?"":g.substring(m+1);switch(S){case"domain":h.domain=_.startsWith(".")?_.substring(1):_;break;case"path":h.path=_;break;case"expires":h.expires=_;break;case"max-age":h.maxAge=parseInt(_,10);break;case"httponly":h.httpOnly=!0;break;case"secure":h.secure=!0;break;case"samesite":h.sameSite=_;break}}return h}static parseCookieHeaders(e,r){let n=[],i=e["set-cookie"]||e["Set-Cookie"];if(!i)return n;let s=Array.isArray(i)?i:[i];for(let a of s){let u=this.parseSetCookie(a,r);u&&n.push(u)}return n}static formatCookieHeader(e){return e.map(r=>`${r.name}=${r.value}`).join("; ")}static isExpired(e){return!!(e.expires&&new Date(e.expires).getTime()<Date.now()||e.maxAge!==void 0&&e.maxAge<=0)}static domainMatches(e,r){if(r==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=r.toLowerCase().split(".").reverse();if(i.length>n.length)return!1;for(let s=0;s<i.length;s++)if(i[s]!==n[s])return!1;return!0}static extractDomain(e){try{return new URL(e).hostname}catch{return""}}static extractPath(e){try{return new URL(e).pathname}catch{return"/"}}};var Bu=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}}has(e,r){return this.get(e,r)!==void 0}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return lt.formatCookieHeader(r)}clear(){this.cookies.clear()}clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n)}parseCookieHeaders(e,r){return lt.parseCookieHeaders(e,r)}isExpired(e){return lt.isExpired(e)}domainMatches(e,r){return lt.domainMatches(e,r)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r)}};import*as Ms from"fs";import*as Ao from"path";function ph(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function Hu(t){if(!Ms.existsSync(t))return CN();let e=hh(Ao.join(t,"_global.json"))||{},r=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=Ms.readdirSync(t).filter(h=>h.endsWith(".json")).filter(h=>!h.endsWith(".local.json")).filter(h=>!ph(h)),s={};for(let h of i){let g=hh(Ao.join(t,h))||{},m=Ao.basename(h,".json");s[m]={description:g.description,requiresConfirmation:g.requiresConfirmation,variables:g.variables||{}}}let u=(hh(Ao.join(t,"_global.local.json"))||{}).variables||{},f={};for(let h of Object.keys(s)){let g=Ao.join(t,`${h}.local.json`);if(Ms.existsSync(g)){let m=hh(g)||{};f[h]={variables:m.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:u,localCredentials:f}}function CN(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function hh(t){try{if(!Ms.existsSync(t))return null;let e=Ms.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${t}:`,e),null}}var Hi=class t{config;selectedEnvironment;sessionGlobals={};sessionEnvironmentValues=new Map;constructor(e){this.config=e,this.selectedEnvironment=e.selectedEnvironment||Object.keys(e.environments)[0]||"default"}get(e){return this.getVariables()[e]}set(e,r){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=r}getAll(){return this.getVariables()}getEnvironments(){return Object.keys(this.config.environments)}getActive(){return this.selectedEnvironment}setActive(e){if(!this.config.environments[e])throw new Error(`Environment not found: ${e}`);this.selectedEnvironment=e}getVariables(e){let r=e||this.selectedEnvironment,n=this.config.environments[r],i={...this.config.globalVariables||{},...this.sessionGlobals};if(n){if(n.inherits&&this.config.environments[n.inherits]){let a=this.getEnvironmentVariables(n.inherits);i={...i,...a}}i={...i,...n.variables};let s=this.sessionEnvironmentValues.get(r);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let r=this.config.environments[e];if(!r)return{};let n={};return r.inherits&&this.config.environments[r.inherits]&&(n={...this.getEnvironmentVariables(r.inherits)}),{...n,...r.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,r){this.sessionGlobals[e]=r}resolve(e){let r=e||this.selectedEnvironment;return{name:r,merged:this.getVariables(r),globals:this.getGlobals()}}static fromVariables(e,r="default"){return new t({environments:{[r]:{name:r,variables:e}},selectedEnvironment:r})}};var Dn=class{buildUrl(e,r={},n={}){let i=e;return i=this.replacePathParams(i,r),i=this.appendQueryParams(i,n),i}replacePathParams(e,r){let n="",i="",s=e,a="",u=e.indexOf("?");u!==-1&&(a=e.substring(u),s=e.substring(0,u));let f=s.match(/^(https?:\/\/)([^\/]*)(\/.*)?$/);f&&(n=f[1],i=f[2],s=f[3]||"/");let h=/:(\w+)(?:\([^)]*\))?(\?)?/g,g=s.replace(h,(m,S,_)=>{let C=r[S];return C!==void 0&&C!==""?encodeURIComponent(C):_?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${S}`),m)});return g=g.replace(/([^:])\/+/g,"$1/"),g.length>1&&g.endsWith("/")&&(g=g.slice(0,-1)),`${n}${i}${g}${a}`}extractPathParams(e){let r=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=r.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,r){let n=e,i={};if(e.includes("?")){let[f,h]=e.split("?");n=f,h&&new URLSearchParams(h).forEach((m,S)=>{i[S]=m})}let s={...i,...r},a=new URLSearchParams;for(let[f,h]of Object.entries(s))h!=null&&a.append(f,h);let u=a.toString();return u?`${n}?${u}`:n}};import xN from"crypto";var gh=new Uint8Array(256),mh=gh.length;function lv(){return mh>gh.length-16&&(xN.randomFillSync(gh),mh=0),gh.slice(mh,mh+=16)}var Gt=[];for(let t=0;t<256;++t)Gt.push((t+256).toString(16).slice(1));function YE(t,e=0){return Gt[t[e+0]]+Gt[t[e+1]]+Gt[t[e+2]]+Gt[t[e+3]]+"-"+Gt[t[e+4]]+Gt[t[e+5]]+"-"+Gt[t[e+6]]+Gt[t[e+7]]+"-"+Gt[t[e+8]]+Gt[t[e+9]]+"-"+Gt[t[e+10]]+Gt[t[e+11]]+Gt[t[e+12]]+Gt[t[e+13]]+Gt[t[e+14]]+Gt[t[e+15]]}import RN from"crypto";var uv={randomUUID:RN.randomUUID};function IN(t,e,r){if(uv.randomUUID&&!e&&!t)return uv.randomUUID();t=t||{};let n=t.random||(t.rng||lv)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let i=0;i<16;++i)e[r+i]=n[i];return e}return YE(n)}var Xa=IN;function ON(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function PN(){return Date.now()}function JE(){return Xa()}function kN(){return Xa()}function zE(t=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function AN(){let t=zE(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function TN(){return Math.random()<.5}function qN(t=10){let e="0123456789abcdef",r="";for(let n=0;n<t;n++)r+=e.charAt(Math.floor(Math.random()*e.length));return r}function $N(){return Math.floor(Date.now()/1e3)}function MN(){return new Date().toISOString()}function NN(){return new Date().toISOString().split("T")[0]}function DN(){return new Date().toISOString().split("T")[1].split(".")[0]}function FN(){return new Date().toISOString()}function LN(t=""){return Buffer.from(String(t)).toString("base64")}function jN(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function UN(t=""){return encodeURIComponent(String(t))}function BN(t=""){return decodeURIComponent(String(t))}var KE={randomInt:ON,timestamp:PN,guid:kN,uuid:JE,randomUUID:JE,randomString:zE,randomHexadecimal:qN,randomEmail:AN,randomBoolean:TN,isoTimestamp:FN,timestamp_s:$N,datetime:MN,date:NN,time:DN,base64Encode:LN,base64Decode:jN,urlEncode:UN,urlDecode:BN};function HN(t){return t?t.split(",").map(e=>{let r=e.trim(),n=Number(r);return!isNaN(n)&&r!==""?n:r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}):[]}function Vi(t,e){let r=KE[t];return r?e&&e.length>0?r(...e):r():null}function VN(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?HN(n):void 0,s=Vi(r,i);return s===null?e:String(s)}catch{return e}})}function To(t,e){let r=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=r.exec(t))!==null;){let s=i[0],a=i[1];if(!(s in e)){let u=Vi(a);u!==null&&(n||(n={...e}),n[s]=u)}}return n??e}import*as yh from"vm";var WN=100;function qo(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function $o(t,e={}){try{let r={...e,Math,Date,JSON,Number,String,Boolean,Array,Object,parseInt,parseFloat,isNaN,isFinite,encodeURIComponent,decodeURIComponent,encodeURI,decodeURI,undefined:void 0,null:null,true:!0,false:!1,NaN:NaN,Infinity:1/0},n=yh.createContext(r);return yh.runInContext(t,n,{timeout:WN,displayErrors:!1})}catch{return}}import*as vh from"crypto";function Wu(t){if(!t||!t.includes("|"))return null;let e=YN(t);if(e.length<2)return null;let r=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let a=JN(s);a&&n.push(a)}return n.length===0?null:{input:r,filters:n}}function YN(t){let e=[],r="",n=0,i=!1,s=!1;for(let a=0;a<t.length;a++){let u=t[a],f=a>0?t[a-1]:"",h=a<t.length-1?t[a+1]:"";if(f==="\\"){r+=u;continue}if(u==="'"&&!s)i=!i;else if(u==='"'&&!i)s=!s;else if(u==="("&&!i&&!s)n++;else if(u===")"&&!i&&!s)n--;else if(u==="|"&&n===0&&!i&&!s){if(h==="|"){r+="||",a++;continue}e.push(r),r="";continue}r+=u}return r&&e.push(r),e}function JN(t){let e=t.indexOf("(");if(e===-1)return{name:t.trim(),args:[]};let r=t.substring(0,e).trim(),n=t.substring(e+1,t.lastIndexOf(")"));return{name:r,args:zN(n)}}function zN(t){if(!t||!t.trim())return[];let e=[],r="",n=!1,i=!1;for(let s=0;s<t.length;s++){let a=t[s];if((s>0?t[s-1]:"")==="\\"){r+=a;continue}if(a==="'"&&!i){n=!n,r+=a;continue}else if(a==='"'&&!n){i=!i,r+=a;continue}else if(a===","&&!n&&!i){e.push(r.trim()),r="";continue}r+=a}return r.trim()&&e.push(r.trim()),e}function Rt(t,e){if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=Number(t);if(!isNaN(r)&&t!=="")return r;if(t==="true")return!0;if(t==="false")return!1;if(e&&t in e){let n=e[t],i=Number(n);return!isNaN(i)&&n!==""?i:n}return t}function Yu(t,e,r={}){let n=t;for(let i of e)n=KN(n,i.name,i.args,r);return n}function KN(t,e,r,n){switch(e){case"upper":return String(t).toUpperCase();case"lower":return String(t).toLowerCase();case"trim":return String(t).trim();case"length":return Array.isArray(t)?t.length:String(t).length;case"substring":{let i=Rt(r[0],n),s=r[1]!==void 0?Rt(r[1],n):void 0;return String(t).substring(i<0?String(t).length+i:i,s!==void 0?s<0?String(t).length+s:s:void 0)}case"replace":{let i=r[0]!==void 0?String(Rt(r[0],n)):"",s=r[1]!==void 0?String(Rt(r[1],n)):"";return String(t).replace(new RegExp(QN(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(Rt(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(Rt(r[0],n)):",";return Array.isArray(t)?t.join(i):String(t)}case"removeQuotes":return String(t).replace(/["']/g,"");case"removeSpaces":return String(t).replace(/\s/g,"");case"format":{let i=r[0]!==void 0?String(Rt(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let a=Rt(r[s],n);i=i.replace(`{${s}}`,String(a))}return i}case"add":{let i=Rt(r[0],n);return Number(t)+i}case"subtract":{let i=Rt(r[0],n);return Number(t)-i}case"multiply":{let i=Rt(r[0],n);return Number(t)*i}case"abs":return Math.abs(Number(t));case"btoa":return Buffer.from(String(t)).toString("base64");case"atob":return Buffer.from(String(t),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(t));case"urlDecode":return decodeURIComponent(String(t));case"hash":{let i=String(r[0]!==void 0?Rt(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?Rt(r[1],n):"base64"),u={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return vh.createHash(u).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(Rt(r[0],n)):"",s=String(r[1]!==void 0?Rt(r[1],n):"sha256").toLowerCase(),a=String(r[2]!==void 0?Rt(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return vh.createHmac(f,i).update(String(t)).digest(a)}case"first":return Array.isArray(t)?t[0]:t;case"last":return Array.isArray(t)?t[t.length-1]:t;case"at":{let i=Rt(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=Rt(r[0],n),s=r[1]!==void 0?Rt(r[1],n):void 0;return Array.isArray(t)?t.slice(i,s):String(t).slice(i,s)}case"unique":return Array.isArray(t)?[...new Set(t)]:t;case"filter":return!Array.isArray(t)||!r[0]?t:GN(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(Rt(s,n)));return i.length===1?t.map(s=>Vu(s,i[0])):t.map(s=>{let a={};for(let u of i){let f=Vu(s,u);f!==void 0&&(a[u]=f)}return a})}case"prop":{let i=r[0]!==void 0?String(Rt(r[0],n)):"";if(Array.isArray(t)){let s=t.map(a=>Vu(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?Vu(t,i):t}case"parseJSON":try{return JSON.parse(String(t))}catch{return t}case"stringify":try{return JSON.stringify(t)}catch{return String(t)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(t));case"isUrl":try{return new URL(String(t)),!0}catch{return!1}case"setIfValue":return t||void 0;case"setNull":return t===null?null:t;default:return t}}function GN(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,a]=n,u=Rt(a,r);return t.filter(f=>{let h=Vu(f,i);if(h===void 0)return!1;switch(s){case">":return Number(h)>Number(u);case">=":return Number(h)>=Number(u);case"<":return Number(h)<Number(u);case"<=":return Number(h)<=Number(u);case"=":return String(h)===String(u);case"!=":return String(h)!==String(u);case"*=":return String(h).includes(String(u));case"^=":return String(h).startsWith(String(u));case"$=":return String(h).endsWith(String(u));default:return!0}})}function Vu(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function QN(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function GE(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}var Mo=class{allVariables;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.sessionVariables,...e.variables}}resolveString(e,r=!1){if(typeof e!="string")return e;if(!r)return e.replace(/\{\{([^}]+)\}\}/g,(u,f)=>this.resolveTemplateContent(f.trim(),this.allVariables,u));let n="",i=0,s=/\{\{([^}]+)\}\}/g,a;for(;(a=s.exec(e))!==null;){let u=a[1].trim(),f=this.resolveTemplateContent(u,this.allVariables,a[0]);if(f!==a[0]){n+=e.slice(i,a.index);let h=this.getStringContext(e,a.index);n+=h?this.escapeForString(String(f),h):String(f)}else n+=e.slice(i,a.index+a[0].length);i=a.index+a[0].length}return n+=e.slice(i),n}resolveStringWithExtra(e,r,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...r};if(!n)return e.replace(/\{\{([^}]+)\}\}/g,(h,g)=>this.resolveTemplateContent(g.trim(),i,h));let s="",a=0,u=/\{\{([^}]+)\}\}/g,f;for(;(f=u.exec(e))!==null;){let h=f[1].trim(),g=this.resolveTemplateContent(h,i,f[0]);if(g!==f[0]){s+=e.slice(a,f.index);let m=this.getStringContext(e,f.index);s+=m?this.escapeForString(String(g),m):String(g)}else s+=e.slice(a,f.index+f[0].length);a=f.index+f[0].length}return s+=e.slice(a),s}resolveObject(e,r=!1){if(typeof e=="string")return this.resolveString(e,r);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,r));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,r);return n}return e}resolveObjectWithExtra(e,r,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,r,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,r,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,a]of Object.entries(e))i[s]=this.resolveObjectWithExtra(a,r,n);return i}return e}resolveTemplateContent(e,r,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let u=GE(i[2],r),f=Vi(i[1],u);return f!==null?String(f):n}let s=Wu(e);if(s){let u=this.resolveFilterInput(s.input,r);if(u!==void 0){let f=Yu(u,s.filters,r);return f!==void 0?String(f):n}return n}let a=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(a){let u=a[1];if(r[u]!==void 0){let f=this.deserializeValue(r[u]),h=a[2],g=this.resolvePropertyAccess(f,h);if(g!==void 0)return typeof g=="object"?JSON.stringify(g):String(g)}}if(r[e]!==void 0){let u=r[e];return typeof u=="string"&&u.charCodeAt(0)===30?u.slice(1):String(u)}if(qo(e)){let u=this.deserializeVariables(r),f=To(e,u),h=$o(e,f);if(h!==void 0)return String(h)}return n}resolveFilterInput(e,r){if(e==="@")return"";if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);let n=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(n){let s=GE(n[2],r),a=Vi(n[1],s);return a!==null?a:void 0}let i=e.match(/^([a-zA-Z_][a-zA-Z0-9_]*)(\[.+\]|\..+)$/);if(i){let s=i[1];if(r[s]!==void 0){let a=this.deserializeValue(r[s]),u=this.resolvePropertyAccess(a,i[2]);if(u!==void 0)return u}}if(r[e]!==void 0)return this.deserializeValue(r[e]);if(qo(e)){let s=this.deserializeVariables(r),a=To(e,s),u=$o(e,a);if(u!==void 0)return u}}deserializeValue(e){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{return e}return e}deserializeVariables(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.deserializeValue(i);return r}resolvePropertyAccess(e,r){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(r))!==null;){if(n==null)return;if(s[1]!==void 0){let a=s[1];/^\d+$/.test(a)?n=n[Number(a)]:n=n[a.slice(1,-1)]}else s[2]!==void 0&&(n=n[s[2]])}return n}escapeForString(e,r){let n=e.replace(/\\/g,"\\\\");return r==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,r){let n=null;for(let i=0;i<r;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},No=class{interpolate(e,r){return!e||typeof e!="string"?e:new Mo({globals:{},collectionVariables:{},environmentVariables:{},sessionVariables:{},variables:r}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let r=[],n,i=/\{\{([^}]+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(r.includes(s)||r.push(s))}return r}interpolateObject(e,r){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,r);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,r));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,r);return n}return e}};function ZN(t){return new Mo(t)}var Ns=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new No,this.urlBuilder=new Dn}get(e){return this.envStore.get(e)}set(e,r){this.envStore.set(e,r)}has(e){return this.envStore.get(e)!==void 0}delete(e){this.envStore.set(e,"")}getAll(){return this.envStore.getAll()}getActiveEnvironment(){return this.envStore.getActive()}setActiveEnvironment(e){this.envStore.setActive(e)}getEnvironments(){let e=this.envStore;return typeof e.getEnvironments=="function"?e.getEnvironments():[]}resolve(e){return this.interpolator.interpolate(e,this.getAll())}resolvePath(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r)}buildUrl(e,r={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,r.params||{},r.query||{})}resolveObject(e){return this.interpolator.interpolateObject(e,this.getAll())}extractVariables(e){return this.interpolator.extractVariables(e)}extractPathParams(e){return this.urlBuilder.extractPathParams(e)}static create(e={}){let r=Hi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};import*as XN from"http";import*as Ju from"https";import{URL as QE}from"url";import*as Sh from"zlib";var Fn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Do=class{settings;version;constructor(e){this.settings={...Fn,...e};try{this.version=qt("../../package.json").version||"0.0.0"}catch{this.version="0.0.0"}this.settings.strictSSL===!1&&console.log("[NodeHttpClient] SSL verification disabled (strictSSL: false)")}async send(e){let r=this.mergeSettings(e.settings);return await this.executeInternal(e,r,0)}mergeSettings(e){return{timeout:e?.timeout??this.settings.timeout,followRedirects:e?.followRedirects??this.settings.followRedirects,followOriginalMethod:e?.followOriginalMethod??this.settings.followOriginalMethod,followAuthHeader:e?.followAuthHeader??this.settings.followAuthHeader,maxRedirects:e?.maxRedirects??this.settings.maxRedirects,strictSSL:e?.strictSSL??this.settings.strictSSL,decompress:e?.decompress??this.settings.decompress,includeCookies:e?.includeCookies??this.settings.includeCookies}}async executeInternal(e,r,n,i){let s=Date.now(),a=new QE(e.url),u=a.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(m=>m.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let g={hostname:a.hostname,port:a.port||(u?443:80),path:a.pathname+a.search,method:e.method,headers:{...f},timeout:r.timeout||void 0};return r.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(g.headers["Accept-Encoding"]="gzip, deflate"),u&&(g.rejectUnauthorized=r.strictSSL,r.strictSSL?g.agent=Ju.globalAgent:g.agent=new Ju.Agent({rejectUnauthorized:!1})),new Promise((m,S)=>{if(i?.aborted){let x=new Error("Request cancelled");x.name="AbortError",S(x);return}let C=(u?Ju:XN).request(g,async x=>{let A=x.statusCode||0;if(r.followRedirects&&[301,302,303,307,308].includes(A)){if(n>=r.maxRedirects){S(new Error(`Maximum redirects (${r.maxRedirects}) exceeded`));return}let j=x.headers.location;if(!j){S(new Error("Redirect response missing Location header"));return}let Y=new QE(j,e.url).toString(),V=e.method;!r.followOriginalMethod&&[301,302,303].includes(A)&&(V="GET");let K={...e.headers};r.followAuthHeader||(delete K.authorization,delete K.Authorization);try{let ee=await this.executeInternal({...e,url:Y,method:V,headers:K,body:V==="GET"?void 0:e.body},r,n+1,i),k=Date.now();ee.time=k-s,m(ee)}catch(ee){S(ee)}return}let T=[];x.on("data",j=>T.push(j)),x.on("end",()=>{let j=Date.now(),Y=Buffer.concat(T),V=x.headers["content-encoding"];if(r.decompress&&V)try{V==="gzip"?Y=Sh.gunzipSync(Y):V==="deflate"&&(Y=Sh.inflateSync(Y))}catch(P){console.warn("[NodeHttpClient] Decompression failed:",P)}let K=Y.toString("utf-8"),ee;try{ee=JSON.parse(K)}catch{ee=K}let k={};for(let[P,N]of Object.entries(x.headers))(typeof N=="string"||Array.isArray(N))&&(k[P]=N);let E=this.parseCookies(x.headers["set-cookie"],a.hostname);m({status:x.statusCode||0,statusText:x.statusMessage||"",headers:k,cookies:E,body:ee,time:j-s,size:Y.length})})});if(i&&i.addEventListener("abort",()=>{C.destroy();let x=new Error("Request cancelled");x.name="AbortError",S(x)}),C.on("error",x=>{S(x)}),C.on("timeout",()=>{C.destroy(),S(new Error("Request timeout"))}),e.body!==void 0&&e.body!==null){let x=typeof e.body=="string"?e.body:JSON.stringify(e.body);C.write(x)}C.end()})}sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}parseCookies(e,r){return e?e.map(n=>{let i=n.split(";").map(g=>g.trim()),[s,...a]=i,[u,f]=s.split("="),h={name:u.trim(),value:f?.trim()||"",domain:r};for(let g of a){let[m,S]=g.split("=");switch(m.toLowerCase().trim()){case"domain":h.domain=S?.trim();break;case"path":h.path=S?.trim();break;case"expires":h.expires=S?.trim();break;case"httponly":h.httpOnly=!0;break;case"secure":h.secure=!0;break}}return h}):[]}};function cv(t){return{timeout:t?.timeout??Fn.timeout,followRedirects:t?.followRedirects??Fn.followRedirects,followOriginalMethod:t?.followOriginalMethod??Fn.followOriginalMethod,followAuthHeader:t?.followAuthHeader??Fn.followAuthHeader,maxRedirects:t?.maxRedirects??Fn.maxRedirects,strictSSL:t?.strictSSL??Fn.strictSSL,decompress:t?.decompress??Fn.decompress,includeCookies:t?.includeCookies??Fn.includeCookies}}var Wi=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}async execute(e){let r=cv(e.settings),n={},i;try{i=await this.interceptors.executeRequestInterceptors(e,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,e,n);if(a)return a;throw s}try{let s=await this.httpClient.send({...i,settings:r});return await this.interceptors.executeResponseInterceptors(s,i,n)}catch(s){let a=await this.interceptors.executeErrorInterceptors(s,i,n);if(a)return a;throw s}}buildUrl(e,r={},n={}){return this.urlBuilder.buildUrl(e,r,n)}};var Yi=class{requestInterceptors=[];responseInterceptors=[];errorInterceptors=[];addRequestInterceptor(e){return this.requestInterceptors.push(e),this.sortByPriority(this.requestInterceptors),this}addResponseInterceptor(e){return this.responseInterceptors.push(e),this.sortByPriority(this.responseInterceptors),this}addErrorInterceptor(e){return this.errorInterceptors.push(e),this.sortByPriority(this.errorInterceptors),this}removeRequestInterceptor(e){let r=this.requestInterceptors.findIndex(n=>n.name===e);return r>=0?(this.requestInterceptors.splice(r,1),!0):!1}removeResponseInterceptor(e){let r=this.responseInterceptors.findIndex(n=>n.name===e);return r>=0?(this.responseInterceptors.splice(r,1),!0):!1}removeErrorInterceptor(e){let r=this.errorInterceptors.findIndex(n=>n.name===e);return r>=0?(this.errorInterceptors.splice(r,1),!0):!1}async executeRequestInterceptors(e,r){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,r)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,r,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,r,n)}catch(a){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,a),a}return i}async executeErrorInterceptors(e,r,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,r,n);if(s)return s}catch(s){console.error(`[InterceptorChain] Error interceptor '${i.name}' failed:`,s)}}clear(){this.requestInterceptors=[],this.responseInterceptors=[],this.errorInterceptors=[]}getRegisteredInterceptors(){return{request:this.requestInterceptors.map(e=>e.name),response:this.responseInterceptors.map(e=>e.name),error:this.errorInterceptors.map(e=>e.name)}}sortByPriority(e){e.sort((r,n)=>(r.priority??100)-(n.priority??100))}},fv=class{name="logging";priority=1e3;intercept(e,r){return e}},dv=class{name="timing";priority=1;intercept(e,r,n){return e}},hv=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,r=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=r}handle(e,r,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}};import*as Xt from"crypto";import*as kU from"querystring";import*as AR from"vm";import*as xU from"crypto";import*as Ec from"fs";import{createRequire as RU}from"module";import*as bi from"path";function np(){return{format:(t,e)=>{let r=t?new Date(t):new Date;return e==="YYYY-MM-DD"?r.toISOString().split("T")[0]:r.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let t=new Date;return{format:()=>t.toISOString(),toISOString:()=>t.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function PR(){return{get:(t,e,r)=>{let n=e.split("."),i=t;for(let s of n)if(i=i?.[s],i===void 0)return r;return i},set:(t,e,r)=>{let n=e.split("."),i=t;for(let s=0;s<n.length-1;s++)i[n[s]]||(i[n[s]]={}),i=i[n[s]];return i[n[n.length-1]]=r,t},cloneDeep:t=>JSON.parse(JSON.stringify(t)),keys:t=>Object.keys(t??{}),values:t=>Object.values(t??{}),entries:t=>Object.entries(t??{}),each(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},forEach(t,e){Array.isArray(t)?t.forEach((r,n)=>e(r,n,t)):t&&typeof t=="object"&&Object.entries(t).forEach(([r,n])=>e(n,r,t))},map:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).map(r=>e(r)),filter:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).filter(r=>e(r)),find:(t,e)=>(Array.isArray(t)?t:Object.values(t??{})).find(r=>e(r)),reduce:(t,e,r)=>(Array.isArray(t)?t:Object.values(t??{})).reduce((n,i)=>e(n,i),r),includes:(t,e)=>Array.isArray(t)?t.includes(e):Object.values(t??{}).includes(e),isObject:t=>t!==null&&typeof t=="object"&&!Array.isArray(t),isArray:t=>Array.isArray(t),isString:t=>typeof t=="string",isNumber:t=>typeof t=="number",isFunction:t=>typeof t=="function",isNil:t=>t==null,isEmpty:t=>t==null?!0:Array.isArray(t)||typeof t=="string"?t.length===0:typeof t=="object"?Object.keys(t).length===0:!1,assign:(t,...e)=>Object.assign(t,...e),merge:(t,...e)=>{let r={...t};for(let n of e)for(let[i,s]of Object.entries(n??{}))r[i]=s&&typeof s=="object"&&!Array.isArray(s)?{...r[i]??{},...s}:s;return r},omit:(t,e)=>{let r={...t};for(let n of e)delete r[n];return r},pick:(t,e)=>{let r={};for(let n of e)n in(t??{})&&(r[n]=t[n]);return r}}}var rp=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:Xa}),crypto:()=>xU,path:()=>bi,querystring:()=>qt("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>ZE(),PR),moment:()=>this.loadOptionalModule("moment",()=>XE(),np),tv4:()=>this.loadOptionalModule("tv4",()=>tC()),ajv:()=>this.loadOptionalModule("ajv",()=>OR()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>qt("crypto-js"),()=>{throw new Error('crypto-js npm module is not installed. The built-in CryptoJS global is already available in scripts with AES/DES/TripleDES/hash/HMAC/PBKDF2 support. If you need the exact npm package, add "crypto-js" to your modules/package.json and run npm install.')})};constructor(e=[],r={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...r,outputChannel:r.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e)if(this.initializeModules(n)){this.modulesPath=n;break}}loadOptionalModule(e,r,n){try{return r()}catch{if(this.customModulesRequire)try{return console.debug(`[ModuleLoader] ${e} not in core, trying user modules`),this.customModulesRequire(e)}catch{this.logModuleWarning(e,"user")}else this.logModuleWarning(e,"core");if(n)return console.warn(`[ModuleLoader] Using shim for ${e}. Some features may be limited.`),n();throw new Error(this.getModuleInstallInstructions(e))}}logModuleWarning(e,r){let i={moment:"Date/time manipulation",lodash:"Utility functions",tv4:"JSON Schema validation (v4)",ajv:"JSON Schema validation"}[e]||e;console.warn(`[ModuleLoader] ${i} functionality (${e}) is not available.
|
|
211
211
|
${this.getModuleInstallInstructions(e)}`)}getModuleInstallInstructions(e){let n={moment:"^2.30.1",lodash:"^4.17.21",tv4:"^1.3.0",ajv:"^8.17.1"}[e]||"latest";return`To use ${e}, add it to http-forge/modules/package.json:
|
|
212
212
|
{
|
|
213
213
|
"dependencies": {
|
|
@@ -221,8 +221,8 @@ Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}fin
|
|
|
221
221
|
|
|
222
222
|
`)}function xc(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function sp(t){return t.map(e=>{let r=e.args.map(n=>{if(typeof n=="object")try{return JSON.stringify(n,null,2)}catch{return String(n)}return String(n)}).join(" ");return`[${e.level}] ${r}`})}function OU(t){return{log:(...e)=>t.push({level:"log",args:e}),info:(...e)=>t.push({level:"info",args:e}),warn:(...e)=>t.push({level:"warn",args:e}),error:(...e)=>t.push({level:"error",args:e})}}function tb(t){let e=[],r=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let a=s.then(()=>{t.push({name:n,passed:!0})},u=>{t.push({name:n,passed:!1,message:u.message||String(u)})});e.push(a)}else t.push({name:n,passed:!0})}catch(s){t.push({name:n,passed:!1,message:s.message})}};return r._pendingTests=e,r}function rb(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function PU(t){let e=null;try{e=new URL(t)}catch{}return{toString(){return t},valueOf(){return t},[Symbol.toPrimitive](n){return n==="number"?NaN:t},getHost(){return e?e.hostname:""},getPath(){return e?e.pathname:t},getPathWithQuery(){return e?e.pathname+e.search:t},getQueryString(){return e?e.search.startsWith("?")?e.search.slice(1):e.search:""},getRemote(){if(!e)return"";let n=e.port||(e.protocol==="https:"?"443":"80");return`${e.hostname}:${n}`},getOAuth1BaseUrl(){return e?`${e.protocol}//${e.host}${e.pathname}`:t},get protocol(){return e?.protocol?.replace(":","")||""},get host(){return e?e.hostname.split("."):[]},get port(){return e?.port||""},get path(){return e?e.pathname.split("/").filter(Boolean):[]},get hash(){return e?.hash?.replace("#","")||""},query:{toObject(){if(!e)return{};let n={};return e.searchParams.forEach((i,s)=>{n[s]=i}),n},has(n){return e?e.searchParams.has(n):!1},get(n){return e?e.searchParams.get(n):void 0},each(n){e&&e.searchParams.forEach((i,s)=>n({key:s,value:i}))}}}}var Rc=class{constructor(e,r){this.deps=e;this.initialContext=r;this.initializeSession()}vmContext=null;ctx=null;modifiedRequest=null;assertions=[];consoleMessages=[];_variables={};_collectionVariables={};_globals={};_environmentVariables={};_liveEnvironmentScope=null;_liveGlobalsScope=null;_liveCollectionScope=null;_nextRequest=void 0;_skipRequest=!1;_visualizerData=void 0;initializeSession(){this.modifiedRequest={url:this.initialContext.request.url,method:this.initialContext.request.method,headers:{...this.initialContext.request.headers},body:this.initialContext.request.body?{...this.initialContext.request.body}:null,params:this.initialContext.request.params?{...this.initialContext.request.params}:{},query:this.initialContext.request.query?{...this.initialContext.request.query}:{}},this.assertions=[],this.ctx=this.createSharedContext(),this.consoleMessages=[];let e=this,r={log:(...n)=>{e.consoleMessages.push({level:"log",args:n})},info:(...n)=>{e.consoleMessages.push({level:"info",args:n})},warn:(...n)=>{e.consoleMessages.push({level:"warn",args:n})},error:(...n)=>{e.consoleMessages.push({level:"error",args:n})}};this.vmContext=this.deps.createVM(this.ctx,r)}createSharedContext(){let e=this.initialContext,r=this.modifiedRequest,n=this.deps.createCommonContext(e,"prerequest");this._variables={...e.variables},this._collectionVariables={...e.collectionVariables||{}},this._globals={...e.globals||{}},this._environmentVariables={...e.environmentVariables||{}},this._liveEnvironmentScope=n.environment,this._liveGlobalsScope=n.globals,this._liveCollectionScope=n.collectionVariables;let i;try{i=new URL(e.request.url).hostname}catch{}let s={get:u=>e.cookieJar?e.cookieJar.get(u,i)?.value:void 0,set:(u,f)=>{e.cookieJar&&e.cookieJar.set({name:u,value:f,domain:i})},has:u=>e.cookieJar?e.cookieJar.has(u,i):!1,list:()=>e.cookieJar?e.cookieJar.getAll(i).map(u=>({name:u.name,value:u.value})):[],toObject:()=>{if(!e.cookieJar)return{};let u=e.cookieJar.getAll(i),f={};for(let h of u)f[h.name]=h.value;return f},jar:()=>{let u=e.cookieJar;return{getAll(f,h){try{if(!u){h(null,[]);return}let g=u.getAll(f).map(m=>({name:m.name,value:m.value,domain:m.domain,path:m.path,httpOnly:m.httpOnly,secure:m.secure}));h(null,g)}catch(g){h(g,[])}},get(f,h,g){try{if(!u){g(null,void 0);return}let m=u.get(h,f);g(null,m?{name:m.name,value:m.value,domain:m.domain}:void 0)}catch(m){g(m,void 0)}},set(f,h,g,m){try{if(!u){(m||g)?.(null);return}typeof h=="string"&&typeof g=="string"?(u.set({name:h,value:g,domain:f}),m?.(null)):typeof h=="object"&&(u.set({...h,domain:f}),g?.(null))}catch(S){(m||g)?.(S)}},unset(f,h,g){try{if(!u){g?.(null);return}u.delete(h,f),g?.(null)}catch(m){g?.(m)}},clear(f){try{if(!u){f?.(null);return}u.clear(),f?.(null)}catch(h){f?.(h)}}}},remove:u=>{e.cookieJar&&e.cookieJar.delete(u,i)},unset:u=>{e.cookieJar&&e.cookieJar.delete(u,i)},clear:()=>{e.cookieJar&&e.cookieJar.clear()}},a=this;return{request:this.createRequestObject(r,e),response:null,test:tb(this.assertions),expect:Cc,cookies:s,execution:{setNextRequest(u){a._nextRequest=u},skipRequest(){a._skipRequest=!0},location:n.info?.requestName||""},setNextRequest(u){a._nextRequest=u},visualizer:{set(u,f){a._visualizerData={template:u,data:f}},clear(){a._visualizerData=void 0}},...n,info:{...n.info||{},eventName:"prerequest",requestName:n.info?.requestName||void 0,requestId:n.info?.requestId||void 0,iteration:e.iteration||0,iterationCount:e.iterationCount||1}}}createRequestObject(e,r){let n=u=>{if(!u)return"none";switch(u){case"raw":return"raw";case"form-data":return"formdata";case"x-www-form-urlencoded":return"urlencoded";case"binary":return"file";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},i=u=>{if(!u)return"none";switch(u){case"raw":return"raw";case"formdata":return"form-data";case"urlencoded":return"x-www-form-urlencoded";case"file":return"binary";case"graphql":return"graphql";case"none":return"none";default:return"raw"}},s={...e.headers,add:u=>{u&&u.key&&(e.headers[u.key]=u.value||"")},get:u=>{for(let[f,h]of Object.entries(e.headers))if(f.toLowerCase()===u.toLowerCase())return h},has:u=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.toLowerCase())return!0;return!1},remove:u=>{for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.toLowerCase()){delete e.headers[f];break}},update:u=>{if(u&&u.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.key.toLowerCase()){e.headers[f]=u.value||"";return}}},upsert:u=>{if(u&&u.key){for(let f of Object.keys(e.headers))if(f.toLowerCase()===u.key.toLowerCase()){e.headers[f]=u.value||"";return}e.headers[u.key]=u.value||""}},toObject:()=>{let u={};for(let[f,h]of Object.entries(e.headers))typeof h=="string"&&(u[f]=h);return u},each:u=>{for(let[f,h]of Object.entries(e.headers))typeof h=="string"&&u({key:f,value:h})}},a={get mode(){return n(e.body?.type)},set mode(u){let f=i(u);e.body?e.body.type=f:e.body={type:f,content:null}},get raw(){let u=e.body?.content;return typeof u=="string"?u:u&&typeof u=="object"?JSON.stringify(u):""},set raw(u){e.body?(e.body.type="raw",e.body.content=u):e.body={type:"raw",content:u}},get formdata(){return e.body?.type==="form-data"&&Array.isArray(e.body.content)?e.body.content:[]},get urlencoded(){return e.body?.type==="x-www-form-urlencoded"&&Array.isArray(e.body.content)?e.body.content:[]},get graphql(){return e.body?.type==="graphql"?e.body.content:null},get file(){return e.body?.type==="binary"?e.body.content:null}};return{get url(){return PU(e.url)},set url(u){e.url=typeof u=="string"?u:String(u)},get method(){return e.method},set method(u){e.method=u},headers:s,get body(){return a},set body(u){if(u==null)e.body=null;else if(typeof u=="string")e.body={type:"raw",content:u};else if(typeof u=="object")if(u.type||u.mode||u.content!==void 0){let f=u.mode?i(u.mode):u.type||"raw";e.body={type:f,format:u.format,content:u.content}}else e.body={type:"raw",content:u}},get params(){return e.params||{}},set params(u){e.params=u||{}},get query(){return e.query||{}},set query(u){e.query=u||{}},get auth(){return r.request?.auth||null},set auth(u){r.request&&(r.request.auth=u)},get certificate(){return r.request?.certificate||null},set certificate(u){r.request&&(r.request.certificate=u)},get description(){return r.request?.description||null},set description(u){r.request&&(r.request.description=u)},get name(){return r.request?.name||null},set name(u){r.request&&(r.request.name=u)},get id(){return r.request?.id||null},get disabled(){return r.request?.disabled||!1},set disabled(u){r.request&&(r.request.disabled=u)},get messages(){return r.request?.messages||[]},get methodPath(){return r.request?.methodPath||null},get metadata(){return r.request?.metadata||[]},getHeaders(u){let f={};for(let[h,g]of Object.entries(e.headers))typeof g=="string"&&(f[h]=g);return f},addQueryParams(u){if(typeof u=="string"){let f=new URLSearchParams(u);for(let[h,g]of f)e.query||(e.query={}),e.query[h]=g}else Array.isArray(u)&&(e.query||(e.query={}),u.forEach(f=>{f.key&&(e.query[f.key]=f.value||"")}))},removeQueryParams(u){e.query&&(typeof u=="string"?delete e.query[u]:Array.isArray(u)&&u.forEach(f=>{let h=typeof f=="string"?f:f.key;h&&delete e.query[h]}))},authorizeUsing(u,f){r.request&&(typeof u=="string"?(r.request.auth||(r.request.auth={}),r.request.auth.type=u,f&&(r.request.auth.parameters=f)):typeof u=="object"&&(r.request.auth=u))},clone(){return{url:e.url,method:e.method,headers:{...e.headers},body:e.body?{...e.body}:null,params:e.params?{...e.params}:{},query:e.query?{...e.query}:{},auth:r.request?.auth,certificate:r.request?.certificate,description:r.request?.description,name:r.request?.name,id:r.request?.id,disabled:r.request?.disabled,metadata:r.request?.metadata,messages:r.request?.messages,methodPath:r.request?.methodPath}},describe(u,f){r.request&&(r.request.description={content:u,type:f||"text/plain"})},setHeader(u,f){e.headers[u]=f},removeHeader(u){delete e.headers[u]},setBody(u,f,h){e.body={type:f||e.body?.type||"raw",format:h||e.body?.format,content:u}}}}async executePreRequest(e){let r=ip(e);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0;let n=this.ctx.variables.replaceIn(r);nb.runInContext(n,this.vmContext,{timeout:5e3});let i=sp(this.consoleMessages),s=this.initialContext.request.body,a=!this.bodiesEqual(this.modifiedRequest.body,s);return{success:!0,modifiedRequest:{url:this.modifiedRequest.url!==this.initialContext.request.url?this.modifiedRequest.url:void 0,headers:xc(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:a?this.modifiedRequest.body:void 0,params:xc(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:xc(this.modifiedRequest.query,this.initialContext.request.query||{})?this.modifiedRequest.query:void 0},modifiedVariables:this.ctx.variables.toObject(),modifiedCollectionVariables:this._liveCollectionScope?.toObject()||this._collectionVariables,modifiedGlobals:this._liveGlobalsScope?.toObject()||this._globals,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,consoleOutput:i.length>0?i:void 0,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}catch(n){return{success:!1,error:n.message||"Pre-request script execution failed",consoleOutput:[`[error] Script execution failed: ${n.message}`],modifiedVariables:this.ctx?.variables?.toObject(),modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,skipRequest:this._skipRequest||void 0}}}async executePostResponse(e,r){let n=ip(e);if(!n||!n.trim())return{testResults:[],consoleOutput:[]};try{this.consoleMessages.length=0,this.assertions.length=0,this.ctx.info.eventName="test",this.ctx.response=eb(r),this.ctx.request=this.createRequestObject(r.executedRequest,this.initialContext),this.vmContext.responseBody=r.body??"";let i=this;this.vmContext.tests=new Proxy({},{set(u,f,h){return i.assertions.push({name:String(f),passed:!!h,message:h?void 0:`"${String(f)}" was false`}),!0}});let s=this.ctx.variables.replaceIn(n);nb.runInContext(s,this.vmContext,{timeout:5e3}),this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0);let a=sp(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:a.length>0?a:void 0,modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}catch(i){return this.assertions.push({name:"Script Execution",passed:!1,message:i.message||"Script execution failed"}),{testResults:[...this.assertions],consoleOutput:[`[error] Script execution failed: ${i.message}`],modifiedEnvironmentVariables:this._liveEnvironmentScope?.toObject()||this._environmentVariables,nextRequest:this._nextRequest,visualizerData:this._visualizerData}}}bodiesEqual(e,r){return e===r||!e&&!r?!0:!e||!r?!1:e.type===r.type&&e.format===r.format&&JSON.stringify(e.content)===JSON.stringify(r.content)}dispose(){this.vmContext=null,this.ctx=null,this.assertions=[]}};function TR(t,e){if(t)return t.split(",").map(r=>{let n=r.trim();if(n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'"))return n.slice(1,-1);let i=Number(n);if(!isNaN(i)&&n!=="")return i;if(e&&n in e){let s=e[n],a=Number(s);return!isNaN(a)&&s!==""?a:s}return n})}function qR(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function AU(t,e){if(t==="@")return"";if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1);let r=t.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(r){let n=TR(r[2],e),i=Vi(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return qR(e[t]);if(qo(t)){let n=To(t,e),i=$o(t,n);if(i!==void 0)return i}}var Fe=class t{_buffer;constructor(e){this._buffer=typeof e=="string"?Buffer.from(e,"utf8"):e}toString(e){return e?e.stringify(this):this._buffer.toString("hex")}toBuffer(){return this._buffer}static fromHex(e){return new t(Buffer.from(e,"hex"))}static fromBase64(e){return new t(Buffer.from(e,"base64"))}static fromUtf8(e){return new t(Buffer.from(e,"utf8"))}};function kR(t,e,r,n){let i=Buffer.concat([Buffer.from(t,"utf8"),n||Buffer.alloc(0)]),s=[],a=Buffer.alloc(0);for(;Buffer.concat(s).length<e+r;)a=Xt.createHash("md5").update(Buffer.concat([a,i])).digest(),s.push(a);let u=Buffer.concat(s);return{key:u.subarray(0,e),iv:u.subarray(e,e+r)}}function ib(t,e,r){let n=i=>t==="aes"?`aes-${i*8}-cbc`:t==="des"?"des-cbc":t==="des-ede3"?"des-ede3-cbc":t;return{encrypt(i,s,a){let u=i instanceof Fe?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=Xt.randomBytes(8),{key:h,iv:g}=kR(s,e,r,f),m=Xt.createCipheriv(n(e),h,g),S=Buffer.concat([m.update(u),m.final()]),_=Buffer.concat([Buffer.from("Salted__"),f,S]);return{ciphertext:new Fe(S),salt:new Fe(f),toString:C=>C?C.stringify(new Fe(_)):_.toString("base64")}}else{let f=s.toBuffer(),h=a?.iv&&a.iv instanceof Fe?a.iv.toBuffer():Buffer.alloc(r),g=Xt.createCipheriv(n(f.length),f,h);a?.padding===!1&&g.setAutoPadding(!1);let m=Buffer.concat([g.update(u),g.final()]);return{ciphertext:new Fe(m),toString:S=>S?S.stringify(new Fe(m)):m.toString("base64")}}},decrypt(i,s,a){if(typeof s=="string"){let u=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext.toBuffer(),f,h;u.subarray(0,8).toString()==="Salted__"?(h=u.subarray(8,16),f=u.subarray(16)):(h=Buffer.alloc(0),f=u);let{key:g,iv:m}=kR(s,e,r,h),S=Xt.createDecipheriv(n(e),g,m);return new Fe(Buffer.concat([S.update(f),S.final()]))}else{let u=s.toBuffer(),f=a?.iv&&a.iv instanceof Fe?a.iv.toBuffer():Buffer.alloc(r),h=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),g=Xt.createDecipheriv(n(u.length),u,f);return a?.padding===!1&&g.setAutoPadding(!1),new Fe(Buffer.concat([g.update(h),g.final()]))}}}}function TU(){let t=r=>n=>{let i=n instanceof Fe?n.toBuffer():Buffer.from(String(n),"utf8");return new Fe(Xt.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof Fe?n.toBuffer():Buffer.from(String(n),"utf8"),a=i instanceof Fe?i.toBuffer():Buffer.from(String(i),"utf8");return new Fe(Xt.createHmac(r,a).update(s).digest())};return{MD5:t("md5"),SHA1:t("sha1"),SHA224:t("sha224"),SHA256:t("sha256"),SHA384:t("sha384"),SHA512:t("sha512"),SHA3:t("sha3-256"),RIPEMD160:t("ripemd160"),HmacMD5:e("md5"),HmacSHA1:e("sha1"),HmacSHA256:e("sha256"),HmacSHA512:e("sha512"),AES:ib("aes",32,16),DES:ib("des",8,8),TripleDES:ib("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof Fe?r.toBuffer():Buffer.from(String(r),"utf8"),a=n instanceof Fe?n.toBuffer():Buffer.from(String(n),"utf8"),u=(i?.keySize||4)*4,f=i?.iterations||1;return new Fe(Xt.pbkdf2Sync(s,a,f,u,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof Fe?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>Fe.fromBase64(r)},Utf8:{stringify:r=>(r instanceof Fe?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>Fe.fromUtf8(r)},Hex:{stringify:r=>(r instanceof Fe?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>Fe.fromHex(r)},Latin1:{stringify:r=>(r instanceof Fe?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new Fe(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof Fe?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new Fe(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof Fe?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new Fe(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new Fe(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new Fe(r):new Fe(Buffer.from(String(r))):new Fe(Buffer.alloc(0)),random:r=>new Fe(Xt.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var Zi=class t{constructor(e,r=[]){this.httpService=e;this.moduleLoader=XS(r)}moduleLoader;createRequestSession(e){return new Rc({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this)},e)}createVM(e,r){let n=this.moduleLoader.getGlobalSetupExports(),i=this.moduleLoader.createRequireFunction(),s={ctx:e,hf:e,pm:e,console:r,...n||{},global:n,setTimeout,setInterval,clearTimeout,clearInterval,URL,URLSearchParams,Buffer,atob:a=>Buffer.from(a,"base64").toString("binary"),btoa:a=>Buffer.from(a,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:Xt,_:i("lodash"),require:i,moment:np(),querystring:kU,CryptoJS:TU(),postman:{setNextRequest:a=>e.setNextRequest?.(a),setGlobalVariable:(a,u)=>e.globals?.set(a,u),getGlobalVariable:a=>e.globals?.get(a),clearGlobalVariable:a=>e.globals?.unset(a),setEnvironmentVariable:(a,u)=>e.environment?.set(a,u),getEnvironmentVariable:a=>e.environment?.get(a),clearEnvironmentVariable:a=>e.environment?.unset(a)},jsonStringify:(a,u,f)=>JSON.stringify(a,u,f),jsonParse:a=>JSON.parse(a),xml2Json:a=>{try{let u=this.moduleLoader.createRequireFunction()("xml2js"),f;return u.parseString(a,{explicitArray:!1},(h,g)=>{if(h)throw h;f=g}),f}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return AR.createContext(s)}createCommonContext(e,r){let n={...e.variables},i={...e.collectionVariables||{}},s={...e.globals||{}},a={...e.environmentVariables||{}},u=e.iterationData||{},f=this.createMergedVariableScope(n,a,i,s,u),h=this.createVariableScope(s),g=this.createVariableScope(i),m=this.createEnvironmentScope(a,e.environmentName,e.onEnvironmentChange,!0),S={...m,set:(C,x)=>{let A=this.serializeValue(x);m.set(C,A),n[C]=A},unset(C){m.unset(C),delete n[C]},clear(){m.clear();for(let C of Object.keys(a))delete n[C]}};return h.replaceIn=f.replaceIn,g.replaceIn=f.replaceIn,S.replaceIn=f.replaceIn,{globals:h,collectionVariables:g,variables:f,environment:S,session:S,iterationData:{get:C=>u[C],has:C=>C in u,toObject:()=>({...u}),toJSON:()=>JSON.stringify(u)},sendRequest:this.createSendRequest(),expect:Cc,info:e.info||{eventName:r,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:t.JSON_TYPE_MARKER+JSON.stringify(e)}deserializeValue(e){if(e!==void 0){if(typeof e=="string"&&e.charCodeAt(0)===30)try{return JSON.parse(e.slice(1))}catch{}return e}}createVariableScope(e){return{get:r=>this.deserializeValue(e[r]),set:(r,n)=>{e[r]=this.serializeValue(n)},has(r){return r in e},unset(r){delete e[r]},clear(){Object.keys(e).forEach(r=>delete e[r])},toObject(){return{...e}}}}createMergedVariableScope(e,r,n,i,s={}){let a={get:u=>u in e?this.deserializeValue(e[u]):u in s?s[u]:u in r?this.deserializeValue(r[u]):u in n?this.deserializeValue(n[u]):this.deserializeValue(i[u]),set:(u,f)=>{e[u]=this.serializeValue(f)},has(u){return u in e||u in s||u in r||u in r||u in n||u in i},unset(u){delete e[u]},clear(){Object.keys(e).forEach(u=>delete e[u])},toObject(){return{...i,...n,...r,...s,...e}},replaceIn(u){if(!u||typeof u!="string")return u;let f=a.toObject();return u.replace(/\{\{([^}]+)\}\}/g,(h,g)=>{let m=g.trim(),S=m.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(S)try{let x=TR(S[2],f),A=Vi(S[1],x);return A!==null?String(A):h}catch{return h}let _=Wu(m);if(_){let x=AU(_.input,f);if(x!==void 0){let A=Yu(x,_.filters,f);return A!==void 0?String(A):h}return h}let C=a.get(m);if(C!==void 0)return String(C);if(qo(m)){let x={};for(let[j,Y]of Object.entries(f))x[j]=qR(Y);let A=To(m,x),T=$o(m,A);if(T!==void 0)return String(T)}return h})}};return a}createEnvironmentScope(e,r,n,i){let s=(a,u,f)=>{n&&(i?n(a,u,f):n(u||"",a==="set"?f:void 0))};return{name:r||"",get:a=>this.deserializeValue(e[a]),set:(a,u)=>{let f=this.serializeValue(u);e[a]=f,s("set",a,f)},has(a){return a in e},unset(a){delete e[a],s("unset",a)},clear(){Object.keys(e).forEach(a=>delete e[a]),s("clear")},toObject(){return{...e}}}}createSendRequest(){return this.httpService?(e,r)=>{let n=typeof e=="string"?{url:e,method:"GET"}:e,i=this.httpService.execute({url:n.url,method:n.method||"GET",headers:n.headers||{},body:n.body,...n});if(r){i.then(s=>r(null,s)).catch(s=>r(s,null));return}return i}:(e,r)=>{let n=new Error("sendRequest not available - HTTP service not configured");if(r){r(n,null);return}return Promise.reject(n)}}};var gl=class{constructor(e,r,n,i,s){this.httpClient=e;this.forgeEnv=r;this.cookieJar=n;this.preprocessor=i;if(s?.scriptExecutor)this.scriptExecutor=s.scriptExecutor;else{let a=s?.forgeRoot?[qt("path").join(s.forgeRoot,"modules")]:[],u=new Wi(new Dn,new Yi,e);this.scriptExecutor=new Zi(u,a)}}scriptExecutor;async execute(e,r,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},a={...n.additionalVariables||{}},u={...s},f=this.buildHttpRequest(e,n.overrides),h=this.findFolderPath(r,e.id),g=this.buildScriptChain(e,r,h),m={request:{url:f.url,method:f.method,headers:{...f.headers},body:f.body?typeof f.body=="string"?{type:"raw",content:f.body}:f.body:void 0},variables:a,collectionVariables:r.variables||{},globals:{},sessionVariables:{},environmentVariables:u,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:r?.name},onSessionChange:n.onSessionChange,onEnvironmentChange:n.onEnvironmentChange},S=this.scriptExecutor.createRequestSession(m),_,C;try{if(!n.skipPreRequest&&g.preRequest.length>0){let T=await S.executePreRequest(g.preRequest);if(_={success:T.success,error:T.error,modifiedVariables:T.modifiedVariables,modifiedEnvironment:T.modifiedEnvironmentVariables,modifiedGlobals:T.modifiedGlobals,modifiedCollectionVariables:T.modifiedCollectionVariables,consoleOutput:T.consoleOutput,modifiedRequest:T.modifiedRequest?{url:T.modifiedRequest.url,method:T.modifiedRequest.method,headers:T.modifiedRequest.headers,body:T.modifiedRequest.body?.content}:void 0},T.modifiedVariables&&(a={...a,...T.modifiedVariables}),T.modifiedEnvironmentVariables&&(u={...u,...T.modifiedEnvironmentVariables}),T.modifiedRequest){let j=T.modifiedRequest;j.url&&(f.url=j.url),j.method&&(f.method=j.method),j.headers&&(f.headers={...f.headers,...j.headers}),j.body!==void 0&&(f.body=j.body?.content||j.body)}if(!T.success)throw new Error(`Pre-request script failed: ${T.error}`)}let x={...u,...a};f=this.interpolateRequest(f,x);let A=await this.httpClient.send(f);if(!n.skipPostResponse&&g.postResponse.length>0){let T=await S.executePostResponse(g.postResponse,{status:A.status,statusText:A.statusText,headers:A.headers,body:A.body,cookies:Object.fromEntries(A.cookies.map(j=>[j.name,j.value])),responseTime:A.time,responseSize:A.size,executedRequest:{url:f.url,method:f.method,headers:f.headers||{},body:f.body?typeof f.body=="string"?{type:"raw",content:f.body}:f.body:{type:"none",content:""},params:{},query:{}}});C={success:!0,assertions:T.testResults,consoleOutput:T.consoleOutput,modifiedEnvironment:T.modifiedEnvironmentVariables},T.modifiedEnvironmentVariables&&(u={...u,...T.modifiedEnvironmentVariables})}return{response:A,preRequestResult:_,postResponseResult:C,totalTime:Date.now()-i,finalRequest:f,variables:{environment:u,local:a}}}finally{S.dispose?.()}}async executeSimple(e,r={}){let n=e,i={...this.forgeEnv.getAll(),...r.variables||{}};return n=this.interpolateRequest(e,i),r.timeout&&(n={...n,timeout:r.timeout}),this.httpClient.send(n)}buildHttpRequest(e,r){let n=e.url;if(e.query&&e.query.length>0){let g=new URLSearchParams;for(let m of e.query)m.enabled!==!1&&g.append(m.key,m.value);n+=(n.includes("?")?"&":"?")+g.toString()}let i=r?.url||n,s=r?.method||e.method,a={};if(e.headers&&Array.isArray(e.headers))for(let g of e.headers)g.enabled!==!1&&(a[g.key]=g.value);let u={...a,...r?.headers||{}},f,h=r?.body||e.body;return h&&(typeof h=="string"?f=h:h.content&&(f=typeof h.content=="string"?h.content:JSON.stringify(h.content))),this.preprocessor&&h&&this.preprocessor.setContentTypeHeader(u,h),{url:i,method:s,headers:u,body:f,timeout:r?.timeout||e.settings?.timeout,settings:{...e.settings,...r?.settings}}}interpolateRequest(e,r){let n=Ns.create(r);return{...e,url:n.resolvePath(e.url),headers:n.resolveObject(e.headers),body:e.body?n.resolve(typeof e.body=="string"?e.body:JSON.stringify(e.body)):void 0}}buildScriptChain(e,r,n=[]){let i=[],s=[];r.scripts?.preRequest&&i.push(r.scripts.preRequest),r.scripts?.postResponse&&s.push(r.scripts.postResponse);for(let a of n)a.scripts?.preRequest&&i.push(a.scripts.preRequest),a.scripts?.postResponse&&s.push(a.scripts.postResponse);return e.scripts?.preRequest&&i.push(e.scripts.preRequest),e.scripts?.postResponse&&s.push(e.scripts.postResponse),{preRequest:i,postResponse:s}}findFolderPath(e,r){let n=[],i=(s,a)=>{for(let u of s){if(u.type==="request"&&u.id===r)return n.push(...a),!0;if(u.type==="folder"){let f=[...a,u];if(i(u.items,f))return!0}}return!1};return i(e.items,[]),n}};function qU(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var Ic=class{entries=new Map;requestIndex=new Map;fullResponses=new Map;maxEntriesPerRequest;storeFullResponses;constructor(e={}){this.maxEntriesPerRequest=e.maxEntriesPerRequest??100,this.storeFullResponses=e.storeFullResponses??!0}getEntries(e,r){let n=this.requestIndex.get(e)||[],i=[];for(let s of n){let a=this.entries.get(s);a&&(!r||a.environment===r)&&i.push(a)}return i}getEntry(e){return this.entries.get(e)}getFullResponse(e){return this.fullResponses.get(e)}get count(){return this.entries.size}addEntry(e,r,n,i,s){let a=qU(),u=Date.now(),f={id:a,timestamp:u,environment:i,method:r.method,ticket:s?.ticket,branch:s?.branch,note:s?.note,sentRequest:{url:r.url,method:r.method,headers:{...r.headers},body:r.body},response:{status:n.status,statusText:n.statusText,time:n.time}};this.entries.set(a,f);let h=this.requestIndex.get(e)||[];for(h.unshift(a);h.length>this.maxEntriesPerRequest;){let g=h.pop();g&&(this.entries.delete(g),this.fullResponses.delete(g))}if(this.requestIndex.set(e,h),this.storeFullResponses){let g={timestamp:u,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(a,g)}return f}deleteEntry(e){if(!this.entries.get(e))return!1;this.entries.delete(e),this.fullResponses.delete(e);for(let[n,i]of this.requestIndex.entries()){let s=i.indexOf(e);if(s!==-1){i.splice(s,1),i.length===0&&this.requestIndex.delete(n);break}}return!0}clearHistory(e){let r=this.requestIndex.get(e);if(r){for(let n of r)this.entries.delete(n),this.fullResponses.delete(n);this.requestIndex.delete(e)}}clearAll(){this.entries.clear(),this.requestIndex.clear(),this.fullResponses.clear()}};var Oc=class{async send(e){let r=Date.now(),n=new AbortController,i=e.timeout??3e4,s=setTimeout(()=>n.abort(),i);try{let a={method:e.method,headers:e.headers,signal:n.signal};e.body!==void 0&&!["GET","HEAD"].includes(e.method.toUpperCase())&&(typeof e.body=="string"||e.body instanceof FormData||e.body instanceof URLSearchParams?a.body=e.body:typeof e.body=="object"&&(a.body=JSON.stringify(e.body),!e.headers?.["Content-Type"]&&!e.headers?.["content-type"]&&(a.headers["Content-Type"]="application/json"))),e.settings?.followRedirects===!1&&(a.redirect="manual");let u=await fetch(e.url,a),f=Date.now(),h=u.headers.get("content-type")||"",g;try{h.includes("application/json")?g=await u.json():h.includes("text/")?g=await u.text():g=await u.text()}catch{g=null}let m={};return u.headers.forEach((S,_)=>{let C=m[_];C!==void 0?m[_]=Array.isArray(C)?[...C,S]:[C,S]:m[_]=S}),{status:u.status,statusText:u.statusText,headers:m,cookies:[],body:g,time:f-r}}catch(a){throw a.name==="AbortError"?new Error(`Request timeout after ${i}ms`):a}finally{clearTimeout(s)}}};var sb={json:"application/json",xml:"application/xml",html:"text/html",text:"text/plain",javascript:"application/javascript",css:"text/css","x-www-form-urlencoded":"application/x-www-form-urlencoded","form-data":"multipart/form-data",graphql:"application/json"},zo=class{sanitizeHeaderValue(e){return e?String(e).replace(/[\u201C\u201D\u201E\u201F\u2033\u2036]/g,'"').replace(/[\u2018\u2019\u201A\u201B\u2032\u2035]/g,"'").replace(/[\x00-\x08\x0A-\x1F\x7F]/g,""):""}sanitizeHeaders(e){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeHeaderValue(String(i));return r}encodeBody(e){if(!e||e.type==="none")return null;let{type:r,content:n}=e;switch(r){case"x-www-form-urlencoded":return this.encodeUrlEncodedBody(n);case"form-data":return n;case"graphql":return this.encodeGraphQLBody(n);case"raw":return n;case"binary":default:return n}}encodeUrlEncodedBody(e){if(Array.isArray(e)){let r=new URLSearchParams;for(let n of e)n.enabled!==!1&&n.key&&r.append(n.key,n.value||"");return r.toString()}return typeof e=="string"?e:String(e)}encodeGraphQLBody(e){return typeof e=="object"&&e.query?JSON.stringify({query:e.query,variables:e.variables||void 0,operationName:e.operationName||void 0}):typeof e=="string"?e:JSON.stringify(e)}setContentTypeHeader(e,r,n){if(Object.keys(e).some(a=>a.toLowerCase()==="content-type"))return;if(n){e["Content-Type"]=n;return}if(!r||r.type==="none")return;let s;switch(r.type){case"x-www-form-urlencoded":s=sb["x-www-form-urlencoded"];break;case"raw":s=r.format?sb[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=sb.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}};var Ko=class{format="http-forge";canParse(e){try{let r=JSON.parse(e);return typeof r=="object"&&r!==null&&"id"in r&&"name"in r&&"items"in r&&Array.isArray(r.items)&&!r.info?.schema?.includes("postman")&&!r._type}catch{return!1}}parse(e,r){let n=JSON.parse(e);return{id:n.id,name:n.name,description:n.description,variables:n.variables||{},auth:n.auth,scripts:n.scripts?{preRequest:n.scripts.preRequest,postResponse:n.scripts.postResponse}:void 0,items:this.convertItems(n.items),source:{format:"http-forge",filePath:r,version:n.version}}}convertItems(e){return e.map(r=>r.type==="folder"?this.convertFolder(r):this.convertRequest(r))}convertFolder(e){return{type:"folder",id:e.id,name:e.name,description:e.description,auth:e.auth,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0,items:e.items?this.convertItems(e.items):[]}}convertRequest(e){let r={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(r[i.key]=i.value);let n={};if(e.query)for(let i of e.query)i.enabled!==!1&&(n[i.key]=i.value);return{type:"request",id:e.id,name:e.name,description:e.description,method:e.method||"GET",url:e.url||"",headers:Object.entries(r).map(([i,s])=>({key:i,value:s,enabled:!0})),query:Object.entries(n).map(([i,s])=>({key:i,value:s,enabled:!0})),params:e.params,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts?{preRequest:e.scripts.preRequest,postResponse:e.scripts.postResponse}:void 0}}};var Go=class{parse(e,r){return r.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let r=JSON.parse(e);return Array.isArray(r)?r:[r]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let r=e.split(/\r?\n/).filter(s=>s.trim());if(r.length<2)return[{}];let n=this.parseCsvLine(r[0]),i=[];for(let s=1;s<r.length;s++){let a=this.parseCsvLine(r[s]),u={};n.forEach((f,h)=>{u[f]=a[h]||""}),i.push(u)}return i}parseCsvLine(e){let r=[],n="",i=!1;for(let s=0;s<e.length;s++){let a=e[s],u=e[s+1];a==='"'?i&&u==='"'?(n+='"',s++):i=!i:a===","&&!i?(r.push(n.trim()),n=""):n+=a}return r.push(n.trim()),r}};import*as zr from"fs/promises";import*as yl from"path";var Pc=class{async readFile(e){return zr.readFile(e,"utf-8")}async writeFile(e,r){let n=yl.dirname(e);await this.mkdir(n),await zr.writeFile(e,r,"utf-8")}async exists(e){try{return await zr.access(e),!0}catch{return!1}}async mkdir(e){await zr.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let a=yl.basename(s);for(let u of e)if(this.matchPattern(a,u)){i.push(s);break}})}catch{}return i}async readDir(e){return zr.readdir(e)}async isDirectory(e){try{return(await zr.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await zr.readdir(e,{withFileTypes:!0});for(let i of n){let s=yl.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,r):i.isFile()&&r(s)}}matchPattern(e,r){let n=r.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};var ob=class t{httpClient;fileSystem;scriptExecutor;interpolator;cookieJar;interceptorChain;preprocessor;dataFileParser;requestHistory;parserRegistry;collectionLoader;environmentStore;forgeEnv;requestExecutor;options;constructor(e={}){if(this.options=e,this.interpolator=e.interpolator||new No,this.fileSystem=e.fileSystem||new Pc,this.preprocessor=e.preprocessor||new zo,this.dataFileParser=e.dataFileParser||new Go,this.cookieJar=e.cookieJar||new Bu,e.enableHistory?this.requestHistory=e.requestHistory||new Ic({maxEntriesPerRequest:e.maxHistoryEntries??100}):this.requestHistory=null,this.interceptorChain=e.interceptorChain||this.createInterceptorChain(e),e.httpClient)this.httpClient=e.httpClient;else if(e.useNativeHttp!==!1){let s={...e.httpSettings,timeout:e.requestTimeout??e.httpSettings?.timeout};this.httpClient=new Do(s)}else this.httpClient=new Oc;let r=e.forgeRoot?[qt("path").join(e.forgeRoot,"modules")]:[],n=new Wi(new Dn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new Zi(n,r),this.parserRegistry=new Uu,this.parserRegistry.register("http-forge",new Ko),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=qt("path").join(e.forgeRoot,"collections");this.collectionLoader=new ju(s)}else this.collectionLoader=new Za(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new Hi(e.environmentConfig):Hi.fromVariables({}),this.forgeEnv=Ns.fromResolver(this.environmentStore),this.requestExecutor=new gl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new Yi;if(e.requestInterceptors)for(let n of e.requestInterceptors)r.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)r.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)r.addErrorInterceptor(n);return r}async loadCollection(e){if(this.collectionLoader instanceof Za)return this.collectionLoader.load(e);throw new Error("loadCollection(filePath) is not supported with folder storage format. Use loadAllCollections() instead.")}async loadAllCollections(){return this.collectionLoader.loadAll()}async execute(e,r,n){return this.requestExecutor.execute(e,r,n)}async executeSimple(e,r){return this.requestExecutor.executeSimple(e,r)}registerParser(e,r){this.parserRegistry.register(e,r)}setEnvironmentConfig(e){this.environmentStore=new Hi(e),this.forgeEnv=Ns.fromResolver(this.environmentStore),this.requestExecutor=new gl(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:this.options.forgeRoot,scriptExecutor:this.scriptExecutor})}static create(e){return new t(e)}static fromForgeRoot(e="./http-forge",r={}){let n=qt("path"),i=n.join(e,"environments"),s,a=Hu(i);if(Object.keys(a.environments).length>0||Object.keys(a.globalVariables).length>0){s={globalVariables:{...a.globalVariables,...a.localVariables},environments:{},selectedEnvironment:void 0};for(let[f,h]of Object.entries(a.environments)){let g=a.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...h.variables,...g}}}}else{let f=qt("fs"),h=n.join(i,"environments.json");if(f.existsSync(h))try{let g=f.readFileSync(h,"utf-8"),m=JSON.parse(g);if(s={globalVariables:m.globalVariables||{},environments:{},selectedEnvironment:m.selectedEnvironment},m.environments)for(let[S,_]of Object.entries(m.environments)){let C=_;s.environments[S]={name:C.name||S,variables:C.variables||{}}}}catch(g){console.warn(`[ForgeContainer] Failed to load environments from ${h}:`,g)}}return new t({...r,forgeRoot:e,storageFormat:r.storageFormat??"folder",environmentConfig:s})}};import*as sA from"path";import*as vl from"crypto";var $U=3e4,kc=class{constructor(e,r,n,i,s="henry-huang.http-forge/oauth2/callback"){this.secretStore=e;this.browserService=r;this.envConfigService=n;this.httpService=i;this.callbackPath=s}tokenCache=new Map;pendingAuthCallback=null;pendingImplicitCallback=null;async getToken(e,r){if(e.accessToken)return{accessToken:this.resolve(e.accessToken,r),tokenType:e.tokenPrefix||"Bearer",raw:{}};let n=this.buildCacheKeyString(e),i=this.tokenCache.get(n);if(i&&!this.isExpired(i))return i;if(i?.refreshToken)try{return await this.refreshToken(e,i.refreshToken,r)}catch{this.tokenCache.delete(n)}if(!i){let a=await this.secretStore.get(`oauth2_refresh_${n}`);if(a)try{return await this.refreshToken(e,a,r)}catch{await this.secretStore.delete(`oauth2_refresh_${n}`)}}let s;switch(e.grantType){case"client_credentials":s=await this.fetchToken(e,r,"client_credentials");break;case"password":s=await this.fetchToken(e,r,"password");break;case"authorization_code":s=await this.authorizationCodeFlow(e,r);break;case"implicit":s=await this.implicitFlow(e,r);break;default:throw new Error(`Unknown OAuth2 grant type: ${e.grantType}`)}return this.tokenCache.set(n,s),s.refreshToken&&await this.storeRefreshToken(n,s.refreshToken),s}async refreshToken(e,r,n){let i=this.resolve(e.tokenUrl||"",n);if(!i)throw new Error("OAuth2 tokenUrl is required for token refresh");let s=this.resolve(e.clientId||"",n),a=this.resolve(e.clientSecret||"",n),u=new URLSearchParams;u.append("grant_type","refresh_token"),u.append("refresh_token",r);let f={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,f,u,s,a,n);let h=await this.httpService.execute({method:"POST",url:i,headers:f,body:u.toString()}),g=this.parseTokenResponse(h.body,e);g.refreshToken||(g.refreshToken=r);let m=this.buildCacheKeyString(e);return this.tokenCache.set(m,g),g.refreshToken&&await this.storeRefreshToken(m,g.refreshToken),g}async authorizationCodeFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.tokenUrl||"",r),s=this.resolve(e.clientId||"",r),a=this.resolve(e.clientSecret||"",r),u=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for authorization code flow");if(!i)throw new Error("OAuth2 tokenUrl is required for authorization code flow");if(!s)throw new Error("OAuth2 clientId is required for authorization code flow");let f=e.usePkce!==!1,h,g,m;if(f){h=this.generateCodeVerifier();let ee=e.pkceMethod||"S256";g=ee==="S256"?this.generateCodeChallengeS256(h):h,m=ee}let S=e.state||vl.randomBytes(16).toString("hex"),_=await this.getCallbackUri(),C=new URL(n);if(C.searchParams.set("response_type","code"),C.searchParams.set("client_id",s),C.searchParams.set("redirect_uri",_),u&&C.searchParams.set("scope",u),C.searchParams.set("state",S),g&&(C.searchParams.set("code_challenge",g),C.searchParams.set("code_challenge_method",m)),e.audience&&C.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&C.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[ee,k]of Object.entries(e.extraParams))C.searchParams.set(ee,this.resolve(k,r));this.pendingAuthCallback&&(this.pendingAuthCallback.reject(new Error("OAuth2 authorization superseded by a new request")),this.pendingAuthCallback=null);let x=new Promise((ee,k)=>{this.pendingAuthCallback={resolve:ee,reject:k,state:S}});await this.browserService.openExternal(C.toString());let A;try{A=await Promise.race([x,new Promise((ee,k)=>setTimeout(()=>{this.pendingAuthCallback=null,k(new Error("OAuth2 authorization timed out after 2 minutes"))},12e4))])}finally{this.pendingAuthCallback=null}if(A.state&&A.state!==S)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let T=new URLSearchParams;T.append("grant_type","authorization_code"),T.append("code",A.code),T.append("redirect_uri",_),h&&T.append("code_verifier",h);let j={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,j,T,s,a,r);let Y=await this.httpService.execute({method:"POST",url:i,headers:j,body:T.toString()}),V=this.parseTokenResponse(Y.body,e),K=this.buildCacheKeyString(e);return this.tokenCache.set(K,V),V.refreshToken&&await this.storeRefreshToken(K,V.refreshToken),V}async implicitFlow(e,r){let n=this.resolve(e.authUrl||"",r),i=this.resolve(e.clientId||"",r),s=e.scope?this.resolve(e.scope,r):void 0;if(!n)throw new Error("OAuth2 authUrl is required for implicit flow");if(!i)throw new Error("OAuth2 clientId is required for implicit flow");let a=e.state||vl.randomBytes(16).toString("hex"),u=await this.getCallbackUri(),f=new URL(n);if(f.searchParams.set("response_type","token"),f.searchParams.set("client_id",i),f.searchParams.set("redirect_uri",u),s&&f.searchParams.set("scope",s),f.searchParams.set("state",a),e.audience&&f.searchParams.set("audience",this.resolve(e.audience,r)),e.resource&&f.searchParams.set("resource",this.resolve(e.resource,r)),e.extraParams)for(let[_,C]of Object.entries(e.extraParams))f.searchParams.set(_,this.resolve(C,r));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let h=new Promise((_,C)=>{this.pendingImplicitCallback={resolve:_,reject:C,state:a}});await this.browserService.openExternal(f.toString());let g;try{g=await Promise.race([h,new Promise((_,C)=>setTimeout(()=>{this.pendingImplicitCallback=null,C(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(g.state&&g.state!==a)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let m={accessToken:g.accessToken,tokenType:g.tokenType||e.tokenPrefix||"Bearer",expiresAt:g.expiresIn?Date.now()+g.expiresIn*1e3:void 0,raw:{access_token:g.accessToken,token_type:g.tokenType,expires_in:g.expiresIn}},S=this.buildCacheKeyString(e);return this.tokenCache.set(S,m),m}handleAuthorizationCallback(e,r,n){if(n){let i=new Error(`OAuth2 authorization error: ${n}`);this.pendingAuthCallback?.reject(i),this.pendingImplicitCallback?.reject(i),this.pendingAuthCallback=null,this.pendingImplicitCallback=null;return}if(e&&this.pendingAuthCallback){this.pendingAuthCallback.resolve({code:e,state:r}),this.pendingAuthCallback=null;return}!e&&!this.pendingAuthCallback&&this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow did not receive access_token")),this.pendingImplicitCallback=null)}handleImplicitCallback(e,r,n,i){this.pendingImplicitCallback&&(this.pendingImplicitCallback.resolve({accessToken:e,tokenType:r,expiresIn:n,state:i}),this.pendingImplicitCallback=null)}clearToken(e){let r=`${e.tokenUrl}|${e.clientId}|${e.scope||""}|${e.grantType}`;this.tokenCache.delete(r),this.secretStore.delete(`oauth2_refresh_${r}`)}clearAllTokens(){for(let e of this.tokenCache.keys())this.secretStore.delete(`oauth2_refresh_${e}`);this.tokenCache.clear()}async fetchToken(e,r,n){let i=this.resolve(e.tokenUrl||"",r);if(!i)throw new Error("OAuth2 tokenUrl is required");let s=this.resolve(e.clientId||"",r),a=this.resolve(e.clientSecret||"",r),u=e.scope?this.resolve(e.scope,r):void 0,f=new URLSearchParams;if(f.append("grant_type",n),u&&f.append("scope",u),n==="password"){let m=this.resolve(e.username||"",r),S=this.resolve(e.password||"",r);if(!m)throw new Error("OAuth2 password grant requires username");f.append("username",m),f.append("password",S)}if(e.audience&&f.append("audience",this.resolve(e.audience,r)),e.resource&&f.append("resource",this.resolve(e.resource,r)),e.extraParams)for(let[m,S]of Object.entries(e.extraParams))f.append(m,this.resolve(S,r));let h={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,h,f,s,a,r);let g=await this.httpService.execute({method:"POST",url:i,headers:h,body:f.toString()});return this.parseTokenResponse(g.body,e)}applyClientAuth(e,r,n,i,s,a){if(e.clientAuthentication==="header"){let u=Buffer.from(`${i}:${s}`).toString("base64");r.Authorization=`Basic ${u}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,r){if(!e||typeof e!="object")throw new Error("OAuth2 token response is not a valid JSON object");let n=e,i=r.tokenField||"access_token",s=n[i];if(!s)throw new Error(`OAuth2 token fetch failed: '${i}' not present in response`);let a=typeof n.expires_in=="number"?n.expires_in:void 0;return{accessToken:s,tokenType:n.token_type||r.tokenPrefix||"Bearer",expiresAt:a?Date.now()+a*1e3:void 0,refreshToken:n.refresh_token,scope:n.scope,raw:n}}isExpired(e){return e.expiresAt?Date.now()>=e.expiresAt-$U:!1}buildCacheKeyString(e){return`${e.tokenUrl||""}|${e.clientId||""}|${e.scope||""}|${e.grantType}`}async getCallbackUri(){let e=`${this.browserService.uriScheme}://${this.callbackPath}`;return this.browserService.asExternalUri(e)}resolve(e,r){return this.envConfigService.resolveVariables(e,r)}generateCodeVerifier(){return vl.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return vl.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}};import*as Qo from"fs";import*as Vs from"path";function Sl(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&Qo.writeFileSync(t,r.join(`
|
|
223
223
|
`),"utf-8")}function Ac(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&Qo.writeFileSync(Vs.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&Qo.writeFileSync(Vs.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function MU(t,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return Vs.isAbsolute(n)?n:Vs.join(t,n)}async function NU(t,e,r,n,i){await t.exportCollectionAsRestClientFolder(r,n),e.exportEnvironmentsToFolder(n,i)}function op(t,e,r){t.forEach(n=>{if(n.type==="folder"){let i=Vs.join(e,xt(n.name));Qo.mkdirSync(i,{recursive:!0}),Ac(i,xt(n.name),n.scripts),op(n.items||[],i,r)}else if(n.type==="request"){let i=n,s=xt(i.name)+".http",a=Vs.join(e,s),u=DU(i,r);Qo.writeFileSync(a,u,"utf-8"),Ac(e,xt(i.name),i.scripts)}})}function DU(t,e){let r=[];r.push(`### ${e.name} / ${t.name}`),r.push(`# collection env: ${xt(e.name)}.env`),r.push(`# request scripts: ${xt(t.name)}.pre.js and .post.js`);let n=FU(t);return r.push(`${t.method} ${n}`),(t.headers||[]).filter(i=>i.enabled!==!1).forEach(i=>{r.push(`${i.key}: ${i.value}`)}),t.body&&t.body.content&&r.push("",t.body.content),r.join(`
|
|
224
|
-
`)}function FU(t){let e=t.url;if(t.query&&t.query.length){let r=t.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");r&&(e+=(e.includes("?")?"&":"?")+r)}return e}import*as lr from"fs";import*as ab from"path";var bl=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){lr.existsSync(this.collectionsDir)||lr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!lr.existsSync(this.collectionsDir))return[];let e=lr.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=ab.join(this.collectionsDir,n),s=lr.readFileSync(i,"utf-8"),a=JSON.parse(s);a.id&&a.name&&(this.cache.set(a.id,a),r.push(a))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return r}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.getCollectionPath(e);if(lr.existsSync(r))try{let n=lr.readFileSync(r,"utf-8"),i=JSON.parse(n);return this.cache.set(e,i),i}catch(n){console.error(`[JsonCollectionLoader] Failed to load collection ${e}:`,n);return}}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=it(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await lr.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!lr.existsSync(r))return!1;try{return await lr.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return lr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return ab.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||it(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r);s&&(s.scripts=n,await this.save(i))}loadScripts(e,r){let n=this.load(e);return n?this.findItemById(n.items,r)?.scripts:void 0}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth),await this.save(n)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r.id);if(s)Object.assign(s,r);else if(n){let a=this.findItemById(i.items,n);if(a&&a.type==="folder")a.items=a.items||[],a.items.push(r);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(r);await this.save(i)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,r);return i&&await this.save(n),i}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let{id:a,type:u,...f}=n;return Object.assign(s,f),await this.save(i),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let a={...s};if(!this.deleteItemById(i.items,r))return!1;if(n){let u=this.findItemById(i.items,n);if(u&&u.type==="folder")u.items=u.items||[],u.items.push(a);else return i.items.push(a),!1}else i.items.push(a);return await this.save(i),!0}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;try{let s;if(r){let f=this.findItemById(i.items,r);if(!f||!f.items)return!1;s=f.items}else s=i.items;let a=new Map(s.map(f=>[f.id,f])),u=[];for(let f of n){let h=a.get(f);h&&(u.push(h),a.delete(f))}for(let f of a.values())u.push(f);if(r){let f=this.findItemById(i.items,r);f&&(f.items=u)}else i.items=u;return await this.save(i),!0}catch(s){return console.error("[JsonCollectionLoader] Failed to reorder items:",s),!1}}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}deleteItemById(e,r){for(let n=0;n<e.length;n++){if(e[n].id===r)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}};var Tc=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new $s(n):new bl(n)}static createForFormat(e,r){return e==="folder"?new $s(r):new bl(r)}};import*as pt from"fs";import*as Hn from"path";function $R(t){if(typeof t!="string")return"text";let e=t.trim();try{let r=JSON.parse(e);if(typeof r=="object"&&r!==null)return"json"}catch{}return/^<\?xml/.test(e)||/^<([a-zA-Z_][\w\-\.]*)[\s>]/.test(e)?/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":"xml":/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":/^(function\s*\(|\(\)\s*=>|const |let |var |export |import )/.test(e)?"javascript":"text"}function LU(t){return{info:{name:t.name,_postman_id:t.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:t.items.map(e=>MR(e)),event:lb(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function MR(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(MR):[],event:lb(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).filter(r=>r.enabled!==!1).map(jU),url:UU(e),body:BU(e),auth:HU(e.auth),description:e.description},event:lb(e.scripts),protocolProfileBehavior:VU(e.settings)}}}function jU(t){return{key:t.key,value:t.value,disabled:t.enabled===!1}}function UU(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let h=i[1];/^{{.*}}$/.test(h)?n=[h]:n=h.split(".")}let s=[],a=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(a&&a[1]!==void 0){let h=a[1].replace(/^\//,"");h.endsWith("/")?(s=h.slice(0,-1).split("/"),s.push("")):s=h.length>0?h.split("/"):[]}let u;if(Array.isArray(t.query)&&t.query.length>0)u=t.query.map(h=>{let g={key:h.key,value:h.value};return h.enabled===!1&&(g.disabled=!0),g});else{let h=r.indexOf("?");h!==-1&&(u=r.substring(h+1).split("&").map(m=>{let[S,..._]=m.split("=");return{key:S,value:_.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([h,g])=>({key:h,value:String(g)}))),{raw:e,host:n.length>0?n:void 0,path:s.length>0?s:void 0,query:u&&u.length>0?u:void 0,variable:f&&f.length>0?f:void 0}}function BU(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=$R(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||$R(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:s}}}}let r=e.type==="form-data"&&Array.isArray(e.content)?e.content:e.type==="formdata"&&Array.isArray(e.fields)?e.fields:null;if(r)return{mode:"formdata",formdata:r.map(s=>({key:s.key,value:s.value,type:s.type||"text",disabled:s.enabled===!1}))};let n=e.type==="x-www-form-urlencoded"&&Array.isArray(e.content)?e.content:e.type==="urlencoded"&&Array.isArray(e.fields)?e.fields:null;if(n)return{mode:"urlencoded",urlencoded:n.map(s=>({key:s.key,value:s.value,disabled:s.enabled===!1}))};if(e.type==="file"&&e.fileName)return{mode:"file",file:{src:e.fileName}};if(e.type==="binary")return{mode:"binary",file:{}};let i=e.type==="graphql"?e.content??(e.query?e:null):null;if(i){let s=i.query??"",a=i.variables;return{mode:"graphql",graphql:{query:s,variables:a?typeof a=="string"?a:JSON.stringify(a):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function HU(t){if(!(!t||!t.type||t.type==="none")){if(t.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:t.bearerToken,type:"string"}]};if(t.type==="basic"&&t.basicAuth)return{type:"basic",basic:[{key:"username",value:t.basicAuth.username,type:"string"},{key:"password",value:t.basicAuth.password,type:"string"}]}}}function VU(t){if(!t)return;let e={};return t.followRedirects===!1&&(e.followRedirects=!1),t.followOriginalMethod===!0&&(e.followOriginalHttpMethod=!0),t.followAuthHeader===!1&&(e.followAuthorizationHeader=!1),t.maxRedirects!==void 0&&(e.maxRedirects=t.maxRedirects),t.strictSSL===!1&&(e.disableUrlEncoding=!1),t.timeout!==void 0&&(e.requestTimeout=t.timeout),Object.keys(e).length>0?e:void 0}function lb(t){if(!t)return[];let e=[];return t.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[t.preRequest]}}),t.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[t.postResponse]}}),e}var qc=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Tc.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}collectionsDir;collections=new Map;fileWatcher;loader;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){pt.existsSync(this.collectionsDir)||pt.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let r of e)this.collections.set(r.id,r)}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.collectionsDir,"**/*");let e=()=>{this.loadCollections(),this.onCollectionsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getAllCollections(){return Array.from(this.collections.values())}getCollection(e){return this.collections.get(e)}getCollectionById(e){for(let r of this.collections.values())if(r.id===e)return r}getCollectionByName(e){let r=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===r)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=it(e.name)),await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let r=this.collections.get(e);return r?.variables?{...r.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,r,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[r]=String(n)}deleteCollectionVariable(e,r){let n=this.localCollectionValues.get(e);n&&delete n[r]}clearCollectionVariables(e){this.localCollectionValues.set(e,{})}async deleteCollection(e){if(!this.collections.get(e))return!1;let n=await this.loader.delete(e);return n&&this.collections.delete(e),n}findRequest(e,r){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,r)}findRequestByPath(e,r){let n=this.collections.get(e);if(!n)return;let i=r.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,n);if(s){let a=this.findItemRecursive(i.items,r);if(a){let{id:u,type:f,...h}=n;Object.assign(a,h)}}return s}async addRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;r.id||(r.id=it(r.name));try{if(await this.loader.saveItem(e,r,n),n){let s=this.findItemRecursive(i.items,n);s&&s.type==="folder"&&(s.items=s.items||[],s.items.push(r))}else i.items.push(r);return!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,r){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemRecursive(n.items,r),i}getAllRequests(e){let r=this.collections.get(e);if(!r)return[];let n=[];return this.collectRequestsRecursive(r.items,n),n}findItemRecursive(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,r);if(i)return i}}}findItemByPath(e,r){if(r.length===0)return;let[n,...i]=r,s=e.find(a=>a.name===n);if(s){if(i.length===0)return s;if(s.type==="folder"&&s.items)return this.findItemByPath(s.items,i)}}updateItemRecursive(e,r,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===r)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,r,n))return!0}return!1}deleteItemRecursive(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,r))return!0}return!1}collectRequestsRecursive(e,r){for(let n of e)n.type==="request"?r.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,r)}async createCollection(e){let r={id:it(e),name:e,items:[]};return await this.saveCollection(r),r}async renameCollection(e,r){let n=this.collections.get(e);return n?(n.name=r,await this.saveCollection(n),!0):!1}async duplicateCollection(e,r){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);let i=it(r),s=this.loader.getCollectionPath(e),a=Hn.join(this.collectionsDir,i);if(!pt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let u=Hn.join(a,"collection.json");if(pt.existsSync(u)){let h=JSON.parse(pt.readFileSync(u,"utf-8"));h.id=i,h.name=r,pt.writeFileSync(u,JSON.stringify(h,null,2))}else pt.writeFileSync(u,JSON.stringify({id:i,name:r},null,2));this.loadCollections();let f=this.collections.get(i);if(!f)throw new Error("Failed to load duplicated collection");return f}async createFolder(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:it(e.name),type:"folder",name:e.name,items:[]};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async deleteFolder(e,r){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemById(n.items,r),i}async renameFolder(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async duplicateFolder(e,r,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,r);if(!s||!pt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let a=Hn.dirname(s),u=it(n),f=Hn.join(a,u);this.copyDirRecursive(s,f);let h=Hn.join(f,"folder.json");if(pt.existsSync(h)){let S=JSON.parse(pt.readFileSync(h,"utf-8"));S.id=u,S.name=n,pt.writeFileSync(h,JSON.stringify(S,null,2))}else pt.writeFileSync(h,JSON.stringify({id:u,name:n,type:"folder"},null,2));let g=this.loader.load(e);g&&this.collections.set(e,g);let m=this.findItemById(g?.items||[],u);return m||{id:u,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:e.id||it(e.name),type:"request",name:e.name,method:e.method||"GET",url:e.url,params:e.params,query:e.query,headers:e.headers,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts,deprecated:e.deprecated,description:e.description,doc:e.doc,responseSchema:e.responseSchema,bodySchema:e.bodySchema};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async renameRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;let s=await this.loader.moveItem(e,r,n);return s&&this.loadCollections(),s}async reorderItems(e,r,n){if(!this.collections.get(e))return!1;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}copyDirRecursive(e,r){pt.existsSync(r)||pt.mkdirSync(r,{recursive:!0});for(let n of pt.readdirSync(e,{withFileTypes:!0})){let i=Hn.join(e,n.name),s=Hn.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):pt.copyFileSync(i,s)}}deleteItemById(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}async importCollection(e){let r=pt.readFileSync(e,"utf-8"),n;try{n=JSON.parse(r)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||it(n.name||"Imported Collection"),name:n.name||"Imported Collection",description:n.description,items:n.items||[]};return await this.saveCollection(i),i}async importPostmanCollection(e){let r=h=>{if(!h)return;switch(h.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:h.bearer?.find(T=>T.key==="token")?.value||""};case"basic":let S=h.basic?.find(T=>T.key==="username"),_=h.basic?.find(T=>T.key==="password");return{type:"basic",basicAuth:{username:S?.value||"",password:_?.value||""}};case"apikey":let C=h.apikey?.find(T=>T.key==="key"),x=h.apikey?.find(T=>T.key==="value"),A=h.apikey?.find(T=>T.key==="in");return{type:"apikey",apikey:{key:C?.value||"",value:x?.value||"",in:A?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=h=>{if(!Array.isArray(h)||h.length===0)return;let g={};for(let m of h){let S=m.script?.exec;if(!S)continue;let _=Array.isArray(S)?S.join(`
|
|
225
|
-
`):S;m.listen==="prerequest"?g.preRequest=_:m.listen==="test"&&(g.postResponse=_)}return g.preRequest||g.postResponse?g:void 0},i=h=>{if(!h||typeof h!="object")return;let g={};return h.followRedirects===!1&&(g.followRedirects=!1),h.followOriginalHttpMethod===!0&&(g.followOriginalMethod=!0),h.followAuthorizationHeader===!1&&(g.followAuthHeader=!1),h.maxRedirects!==void 0&&(g.maxRedirects=h.maxRedirects),h.requestTimeout!==void 0&&(g.timeout=h.requestTimeout),Object.keys(g).length>0?g:void 0},s=h=>{if(!h||typeof h=="string")return;let g=h.query;if(!(!Array.isArray(g)||g.length===0))return g.map(m=>({key:m.key||"",value:m.value||"",enabled:m.disabled!==!0}))},a=h=>{if(typeof h=="string")return h;if(!h)return"";let g=new Set;if(Array.isArray(h.variable))for(let S of h.variable)S.key&&g.add(S.key);if(g.size===0&&h.raw)return h.raw;let m="";if(h.protocol&&(m+=h.protocol+"://"),h.host&&(m+=Array.isArray(h.host)?h.host.join("."):h.host),h.port&&(m+=":"+h.port),h.path){let _=(Array.isArray(h.path)?h.path:[h.path]).map(C=>{let x=C.startsWith(":")?C.substring(1):C;return g.has(x)?":"+x:(C.startsWith(":"),C)});m+="/"+_.join("/")}return!m&&h.raw?h.raw:m},u=h=>h.map(g=>{if(g.item)return{id:it(g.name),type:"folder",name:g.name,description:g.description,auth:r(g.auth),scripts:n(g.event),items:u(g.item)};{let m=g.request||{};return{id:it(g.name),type:"request",name:g.name,description:g.description||m.description,method:typeof m.method=="string"?m.method:"GET",url:a(m.url),query:s(m.url),headers:Array.isArray(m.header)?m.header.map(S=>({key:S.key||S.name||"",value:S.value||S.value||"",enabled:S.disabled!==!0})):[],body:(()=>{let S=m.body;if(S){if(S.mode==="raw"&&S.raw){let _=S.options?.raw?.language;return{type:"raw",format:_==="xml"?"xml":_==="html"?"html":_==="javascript"?"javascript":_==="text"?"text":"json",content:S.raw}}if(S.mode==="urlencoded"&&Array.isArray(S.urlencoded))return{type:"x-www-form-urlencoded",content:S.urlencoded.map(_=>({key:_.key||"",value:_.value||"",enabled:_.disabled!==!0}))};if(S.mode==="formdata"&&Array.isArray(S.formdata))return{type:"form-data",content:S.formdata.map(_=>({key:_.key||"",value:_.value||"",type:_.type||"text",enabled:_.disabled!==!0}))};if(S.mode==="graphql"&&S.graphql){let _;if(S.graphql.variables)try{_=JSON.parse(S.graphql.variables)}catch{_=void 0}return{type:"graphql",content:{query:S.graphql.query||"",variables:_}}}if(S.mode==="binary")return{type:"binary",content:""}}})(),auth:r(m.auth),scripts:n(g.event),settings:i(g.protocolProfileBehavior)}}}),f={id:it(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:r(e.auth),scripts:n(e.event),items:u(e.item||[])};return await this.saveCollection(f),f}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=LU(n),s=JSON.stringify(i,null,2);pt.writeFileSync(r,s,"utf-8")}async exportCollectionAsRestClientFolder(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Hn.join(r,xt(n.name));pt.mkdirSync(i,{recursive:!0});let s=n.variables||{};Sl(Hn.join(i,`${xt(n.name)}.env`),s),Ac(i,xt(n.name),n.scripts),op(n.items,i,n)}dispose(){this.fileWatcher?.dispose()}};import*as qr from"fs";import*as mn from"path";var er={version:"1.0",storage:{format:"folder",root:"./http-forge-assets",history:"./.http-forge-cache/histories",results:"./.http-forge-cache/results"},request:{timeout:3e4,followRedirects:!0,maxRedirects:10,strictSSL:!0},scripts:{modulePaths:["./http-forge-assets/src","./http-forge-assets/lib"]},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:50,cors:{allowedOrigins:["http://localhost","http://127.0.0.1"]}},proxy:null},_l={config:"http-forge.config.json"},Zo={collections:"collections",environments:"environments",flows:"flows",suites:"suites"};var wl=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=mn.join(e,_l.config),this.config=this.loadConfig(),this.setupFileWatcher()}config;configPath;fileWatcher;loadConfig(){if(!qr.existsSync(this.configPath))return{...er};try{let e=qr.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return this.mergeWithDefaults(r)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${_l.config}. Using default configuration.`),{...er}}}mergeWithDefaults(e){return{version:e.version??er.version,storage:{...er.storage,...e.storage},request:{...er.request,...e.request},scripts:{...er.scripts,...e.scripts},runner:{...er.runner,...e.runner},environments:{...er.environments,...e.environments},restClientExport:{...er.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:er.proxy,mcp:{...er.mcp,...e.mcp,cors:{...er.mcp.cors,...e.mcp?.cors}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,_l.config);let e=()=>{this.reload()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getConfig(){return this.config}getStorageConfig(){return this.config.storage}getRequestConfig(){return this.config.request}getScriptsConfig(){return this.config.scripts}getRunnerConfig(){return this.config.runner}getEnvironmentsConfig(){return this.config.environments}getRestClientExportPath(){let e=this.config.restClientExport?.path||"collections-rest-client";return mn.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){return this.config.mcp??er.mcp}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return mn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return mn.join(this.getRootPath(),Zo.collections)}getEnvironmentsPath(){return mn.join(this.getRootPath(),Zo.environments)}getFlowsPath(){return mn.join(this.getRootPath(),Zo.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return mn.join(this.getRootPath(),Zo.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return qr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(er,null,2);await qr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)qr.existsSync(i)||await qr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)qr.existsSync(i)||await qr.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),r={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await qr.promises.writeFile(mn.join(e,"globals.json"),JSON.stringify(r,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await qr.promises.writeFile(mn.join(e,"dev.json"),JSON.stringify(n,null,2),"utf-8");let i={id:"default_headers",name:"Default Headers",headers:{"Content-Type":"application/json",Accept:"application/json"}};await qr.promises.writeFile(mn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}};var WU="httpForge.cookies",$c=class{constructor(e,r=WU){this.store=e;this.storeKey=r;this.loadCookies()}cookies=new Map;loadCookies(){try{let e=this.store.get(this.storeKey);e&&(this.cookies=new Map(Object.entries(e)),this.cleanExpiredCookies())}catch(e){console.error("[CookieService] Failed to load cookies:",e)}}async saveCookies(){try{let e={};this.cookies.forEach((r,n)=>{e[n]=r}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}async set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e),await this.saveCookies()}async setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}await this.saveCookies()}has(e,r){return this.get(e,r)!==void 0}async delete(e,r,n){let i=this.getCookieKey(e,r,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return lt.formatCookieHeader(r)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,r){return lt.parseCookieHeaders(e,r)}isExpired(e){return lt.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r);e.length>0&&this.saveCookies()}domainMatches(e,r){return lt.domainMatches(e,r)}get count(){return this.cookies.size}};var Mc=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}localCache=[];pendingOperations=[];get(e,r){return r?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===r||r.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,r){return this.get(e,r)!==void 0}set(e){let r=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));r>=0?this.localCache[r]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,r,n){let i=this.localCache.findIndex(s=>s.name===e&&(!r||s.domain===r||s.domain&&r.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:r,path:n}),!0}getAll(e){return e?this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,r){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(r,n);i.length>0&&(i.forEach(s=>{let a=this.localCache.findIndex(u=>u.name===s.name&&u.domain===(s.domain||n));a>=0?this.localCache[a]=s:this.localCache.push(s)}),await this.cookieService.setFromResponse(i))}getCookieHeader(e){let r=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(lt.isExpired(s)||s.domain&&!lt.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return lt.formatCookieHeader(i)}clear(){this.localCache=[],this.pendingOperations.push({type:"clear"})}async flush(){for(let e of this.pendingOperations)switch(e.type){case"set":e.cookie&&await this.cookieService.set(e.cookie);break;case"delete":e.name&&await this.cookieService.delete(e.name,e.domain,e.path);break;case"clear":await this.cookieService.clear();break}this.pendingOperations=[]}};import*as Bt from"fs";import*as Kr from"path";function ap(t){try{let e=JSON.parse(typeof t=="string"?t:t.toString("utf-8"));if(!e)return null;let r=e.environment||e,n=r.name||e.name||"imported-environment",i=r.values||r.variables||e.values||e.variables||[],s={};if(Array.isArray(i))for(let u of i){if(!u)continue;let f=u.key??u.name,h=typeof u.enabled=="boolean"?u.enabled:!0;f&&h!==!1&&(s[f]=u.value??u.initial??"")}else if(typeof i=="object"&&i!==null)for(let[u,f]of Object.entries(i))s[u]=String(f??"");let a=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:a}}catch{return null}}async function YU(t,e){try{let r=await e.readFile(t);return ap(r)}catch{return null}}var Nc={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Dc=class{constructor(e,r,n,i){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;let s=n.getEnvironmentsPath();this.environmentsPath=s,this.sharedConfigPath=Kr.join(s,"_global.json"),this.localConfigPath=Kr.join(s,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r.get(Nc.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.loadPersistedEnvironmentOverrides(),this.setupFileWatcher()}environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Bt.existsSync(this.environmentsPath))return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.environmentsPath,"**/*.json");let e=()=>{this.reload(),this.onEnvironmentsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}dispose(){this.fileWatcher?.dispose()}getWorkspaceFolder(){return this.workspaceFolder}getRootPath(){return this.configService.getRootPath()}loadConfigs(){if(!Bt.existsSync(this.environmentsPath)){this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}},this.localConfig={credentials:{},variables:{}};return}this.loadFolderConfigs()}getSharedConfig(){return this.sharedConfig||this.loadConfigs(),this.sharedConfig}getLocalConfig(){return this.localConfig||this.loadConfigs(),this.localConfig}getEnvironmentNames(){let e=this.getSharedConfig();return e?.environments?Object.keys(e.environments):[]}getSelectedEnvironment(){return this.selectedEnvironment}async setSelectedEnvironment(e){if(this.selectedEnvironment=e,await this.workspaceStore.update(Nc.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let r=this.getEnvOverridesStateKey(e),n=this.workspaceStore.get(r,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}}getEnvOverridesStateKey(e){return`${Nc.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),r=this.workspaceStore.get(e,{});r&&Object.keys(r).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...r})}persistEnvironmentOverrides(e){let r=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore.update(r,n)}setEnvironmentVariable(e,r){let n=this.selectedEnvironment;this.localEnvironmentValues.has(n)||this.localEnvironmentValues.set(n,{}),this.localEnvironmentValues.get(n)[e]=String(r),this.persistEnvironmentOverrides(n)}deleteEnvironmentVariable(e){let r=this.selectedEnvironment,n=this.localEnvironmentValues.get(r);n&&(delete n[e],this.persistEnvironmentOverrides(r))}clearEnvironmentVariables(){let e=this.selectedEnvironment;this.localEnvironmentValues.set(e,{}),this.persistEnvironmentOverrides(e)}async resetEnvironmentOverrides(e){let r=e||this.selectedEnvironment;this.localEnvironmentValues.delete(r),await this.workspaceStore.update(this.getEnvOverridesStateKey(r),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,r){this.localGlobalValues[e]=String(r)}getGlobalVariable(e){return this.getSharedConfig()?.globalVariables?.[e]}getGlobalVariableLocal(e){return this.localGlobalValues[e]}getGlobalVariables(){return{...this.getSharedConfig()?.globalVariables||{},...this.localGlobalValues}}getGlobalVariableLocals(){return{...this.localGlobalValues}}deleteGlobalVariable(e){delete this.localGlobalValues[e]}clearGlobalVariables(){this.localGlobalValues={}}async setSessionVariable(e,r){this.setEnvironmentVariable(e,r)}getSessionVariable(e){return this.getEnvironmentVariableLocal(e)}getSessionVariables(){return this.getEnvironmentVariableLocals()}async deleteSessionVariable(e){this.deleteEnvironmentVariable(e)}async clearSessionVariables(){this.clearEnvironmentVariables()}hasSessionVariable(e){return this.getEnvironmentVariableLocal(e)!==void 0}getResolvedEnvironment(e){let r=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[r])return null;let s=n.environments[r],a=i?.credentials?.[r],u=i?.variables||{},f=a?.variables||{},h=a&&a.headers||{},g=Fu(n.defaultHeaders||{},h),m=this.localEnvironmentValues.get(r)||{},S={...n.globalVariables||{},...s.variables||{},...u,...f,...m};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:g,variables:S}}resolveVariables(e,r){return this.createResolver(r).resolveString(e,!0)}exportEnvironmentsToFolder(e,r=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!r&&Object.keys(s).length){let a=Kr.join(e,"globals.env");Sl(a,s)}n.forEach(a=>{let u=i?.environments?.[a];if(!u)return;let f={...u.variables||{}};r&&(f={...s,...f});let h=Kr.join(e,`${xt(a)}.env`);Sl(h,f)})}resolveVariablesWithExtra(e,r,n){return this.createResolver(n,r).resolveString(e,!0)}resolveVariablesInObject(e,r){return this.createResolver(r).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,r,n){return this.createResolver(n,r).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return Kr.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Bt.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let r={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,r);for(let[n,i]of Object.entries(e.credentials||{})){let s=this.getEnvLocalConfigPath(n),a={variables:i.variables||{}};this.saveJsonFile(s,a)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=Bt.readFileSync(e,"utf-8"),n=ap(r);if(!n)throw new Error("Failed to parse Postman environment file");this.sharedConfig||this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}});let i=n.name||`imported-${Date.now()}`;return this.sharedConfig.environments=this.sharedConfig.environments||{},this.sharedConfig.environments[i]=this.sharedConfig.environments[i]||{},this.sharedConfig.environments[i].variables=n.variables,n.description&&(this.sharedConfig.environments[i].description=n.description),this.saveSharedConfig(this.sharedConfig),n}catch(r){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",r),r}}saveEnvLocalConfig(e,r){let n=this.getEnvLocalConfigPath(e),i={variables:r};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:r}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return Kr.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=Hu(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,r){let s={...this.getResolvedEnvironment(e)?.variables||{},...this.getSessionVariables(),...r||{}};return new Mo({globals:{},collectionVariables:{},environmentVariables:s,sessionVariables:{},variables:{}})}saveFolderSharedConfig(e){Bt.existsSync(this.environmentsPath)||Bt.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Bt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!ph(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=Kr.basename(s,".json");if(!i.has(a))try{Bt.unlinkSync(Kr.join(this.environmentsPath,s))}catch{}}for(let[s,a]of Object.entries(e.environments||{})){let u={name:s,description:a.description,requiresConfirmation:a.requiresConfirmation,variables:a.variables||{}};this.saveJsonFile(Kr.join(this.environmentsPath,`${s}.json`),u)}}reload(){this.sharedConfig=null,this.localConfig=null,this.loadConfigs()}getAllEnvironments(){return this.loadConfigs(),this.sharedConfig?Object.entries(this.sharedConfig.environments).map(([e,r])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:r.variables||{}})):[]}async setActiveEnvironment(e){await this.setSelectedEnvironment(e)}async createEnvironment(e){if(this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{}}),this.sharedConfig.environments[e])throw new Error(`Environment "${e}" already exists`);this.sharedConfig.environments[e]={description:`Created ${new Date().toISOString()}`,variables:{}},this.saveSharedConfig(this.sharedConfig)}async deleteEnvironment(e){if(this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentExists(e),delete this.sharedConfig.environments[e],this.selectedEnvironment===e){let r=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=r.length>0?r[0]:"dev",await this.workspaceStore.update(Nc.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(r);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[r]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[r].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),r!==e&&(this.validateEnvironmentNameNotTaken(r),this.sharedConfig.environments[r]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=r,await this.workspaceStore.update(Nc.SELECTED_ENVIRONMENT,r)),this.saveSharedConfig(this.sharedConfig))}validateEnvironmentName(e){if(!e||e.trim().length===0)throw new Error("Environment name cannot be empty");if(e.length>128)throw new Error("Environment name cannot exceed 128 characters");if(!/^[a-zA-Z0-9_\-\.]+$/.test(e))throw new Error("Environment name can only contain letters, numbers, hyphens, underscores, and dots")}validateEnvironmentExists(e){if(!this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" not found`)}validateEnvironmentNameNotTaken(e){if(this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" already exists`)}validateConfigLoaded(){if(!this.sharedConfig)throw new Error("No environment configuration loaded")}async updateEnvironmentVariables(e,r){if(this.loadConfigs(),!this.sharedConfig)throw new Error("No configuration loaded");let n=this.sharedConfig.environments[e];if(!n)throw new Error(`Environment "${e}" not found`);n.variables=r,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!Bt.existsSync(e))return null;let r=Bt.readFileSync(e,"utf-8");return JSON.parse(r)}catch(r){return console.error(`Failed to load JSON from ${e}:`,r),null}}saveJsonFile(e,r){try{let n=Kr.dirname(e);Bt.existsSync(n)||Bt.mkdirSync(n,{recursive:!0}),Bt.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}};var Fc=class t{constructor(e,r,n,i,s,a,u,f,h,g,m,S){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=a;this.collectionScripts=u;this.folderScriptsChain=f;this.onConsoleOutput=h;this.collectionName=g;this.iteration=m;this.iterationCount=S}async execute(e,r,n){let i=Date.now();return this.executeWithSession(e,r,n,i)}async executeWithSession(e,r,n,i){let s=this.collectPreRequestScripts(e),a=this.collectPostResponseScripts(e),u=this.envConfigService.getResolvedEnvironment(this.environment);if(!u)throw new Error(`Environment "${this.environment}" not found or not configured`);let f={request:e,variables:{...r},environmentVariables:u.variables||{},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(m,S,_)=>{m==="set"&&S&&_!==void 0?this.envConfigService.setEnvironmentVariable(S,_):m==="unset"&&S?this.envConfigService.deleteEnvironmentVariable(S):m==="clear"&&this.envConfigService.clearEnvironmentVariables()}},h=this.scriptExecutor.createRequestSession(f),g=null;try{let m={...r},S={...e},_;if(s.length>0){let D=await h.executePreRequest(s);if(D.consoleOutput&&D.consoleOutput.length>0&&this.onConsoleOutput?.(D.consoleOutput),D.nextRequest!==void 0&&(_=D.nextRequest),D.skipRequest){let L={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:L,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:m,nextRequest:_}}D.success&&(D.modifiedRequest&&(D.modifiedRequest.url&&(S.url=D.modifiedRequest.url),D.modifiedRequest.headers&&(S.headers=D.modifiedRequest.headers),D.modifiedRequest.params&&(S.params=D.modifiedRequest.params),D.modifiedRequest.query&&(S.query=D.modifiedRequest.query),D.modifiedRequest.body!==void 0&&(S.body=D.modifiedRequest.body)),D.modifiedVariables&&(m=D.modifiedVariables))}g=await this.requestPreparer.prepareRequest(S,this.environment,u,m);let{url:C,headers:x,body:A,method:T}=g,j={};for(let D in x)Object.prototype.hasOwnProperty.call(x,D)&&(j[D.toUpperCase()]=x[D]);if(!j.COOKIE&&S.settings?.includeCookies!==!1&&this.cookieJar){let L=this.cookieJar.getCookieHeader(C);L&&(j.COOKIE=L)}let Y={method:T,url:C,headers:j,body:A.content,signal:n,settings:S.settings?{timeout:S.settings.timeout,followRedirects:S.settings.followRedirects,maxRedirects:S.settings.maxRedirects,strictSSL:S.settings.strictSSL}:void 0},V=await this.httpService.execute(Y);this.cookieJar&&V.headers&&await this.cookieJar.setCookiesFromResponse(C,V.headers);let K=Date.now()-i,ee=[],k={},E;if(a.length>0){let D=0;if(V.body)if(typeof V.body=="string")D=Buffer.byteLength(V.body,"utf8");else if(Buffer.isBuffer(V.body))D=V.body.length;else try{D=Buffer.byteLength(JSON.stringify(V.body),"utf8")}catch{D=0}let L={};V.cookies&&Array.isArray(V.cookies)&&V.cookies.forEach(ie=>{ie.name&&(L[ie.name]=ie.value)});let z={executedRequest:g,status:V.status,statusText:V.statusText,headers:rb(V.headers||{}),body:V.body,cookies:L,responseTime:V.time,responseSize:D},Z=await h.executePostResponse(a,z);ee=Z.testResults,k=Z.modifiedEnvironmentVariables||{},E=Z.visualizerData,Z.nextRequest!==void 0&&(_=Z.nextRequest),Z.consoleOutput&&Z.consoleOutput.length>0&&this.onConsoleOutput?.(Z.consoleOutput)}let P=ee.length===0||ee.every(D=>D.passed),N=ee.length>0?P:V.status>=200&&V.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...g,headers:j},response:{status:V.status,statusText:V.statusText,headers:V.headers||{},body:V.body,time:V.time||K,cookies:V.cookies||[]},duration:K,timestamp:Date.now(),passed:N,assertions:ee,modifiedVariables:m,modifiedEnvironmentVariables:k,nextRequest:_,visualizerData:E}}catch(m){return this.handleError(e,g,m,i)}finally{h.dispose?.()}}collectPreRequestScripts(e){let r=[];if(this.collectionScripts?.preRequest&&r.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&r.push(n.preRequest);else this.folderScriptsChain.preRequest&&r.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&r.push(e.scripts.preRequest),r}collectPostResponseScripts(e){let r=[];if(e.scripts?.postResponse&&r.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&r.push(i.postResponse)}else this.folderScriptsChain.postResponse&&r.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&r.push(this.collectionScripts.postResponse),r}handleError(e,r,n,i){let s=Date.now()-i,a=r?.method||e.method,u=r?.url||e.url;this.onConsoleOutput?.([`[error] ${e.name}: ${n.message||n}`]);let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),h=n?.stack?String(n.stack):"",g=this.errorBodyFormat,m,S;g==="html"||g==="both"?(m=t.formatErrorAsHtml(f,h),S={"content-type":"text/html; charset=utf-8"}):(m=f,S={});let _={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:u||"",method:a||"GET",headers:r?.headers||{},body:r?.body||_,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:S,cookies:[],body:m,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return`<!doctype html>
|
|
224
|
+
`)}function FU(t){let e=t.url;if(t.query&&t.query.length){let r=t.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");r&&(e+=(e.includes("?")?"&":"?")+r)}return e}import*as lr from"fs";import*as ab from"path";var bl=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){lr.existsSync(this.collectionsDir)||lr.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!lr.existsSync(this.collectionsDir))return[];let e=lr.readdirSync(this.collectionsDir),r=[];for(let n of e)if(n.endsWith(".json"))try{let i=ab.join(this.collectionsDir,n),s=lr.readFileSync(i,"utf-8"),a=JSON.parse(s);a.id&&a.name&&(this.cache.set(a.id,a),r.push(a))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return r}load(e){if(this.cache.has(e))return this.cache.get(e);let r=this.getCollectionPath(e);if(lr.existsSync(r))try{let n=lr.readFileSync(r,"utf-8"),i=JSON.parse(n);return this.cache.set(e,i),i}catch(n){console.error(`[JsonCollectionLoader] Failed to load collection ${e}:`,n);return}}async save(e){if(this.ensureDirectory(),!e.name)throw new Error("Collection name is required");e.id||(e.id=at(e.name));let r=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await lr.promises.writeFile(r,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let r=this.getCollectionPath(e);if(!lr.existsSync(r))return!1;try{return await lr.promises.unlink(r),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return lr.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return ab.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||at(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r);s&&(s.scripts=n,await this.save(i))}loadScripts(e,r){let n=this.load(e);return n?this.findItemById(n.items,r)?.scripts:void 0}async updateCollectionMetadata(e,r){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);r.name!==void 0&&(n.name=r.name),r.description!==void 0&&(n.description=r.description),r.version!==void 0&&(n.version=r.version),r.variables!==void 0&&(n.variables=r.variables),r.auth!==void 0&&(n.auth=r.auth),await this.save(n)}async saveItem(e,r,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,r.id);if(s)Object.assign(s,r);else if(n){let a=this.findItemById(i.items,n);if(a&&a.type==="folder")a.items=a.items||[],a.items.push(r);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(r);await this.save(i)}async deleteItem(e,r){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,r);return i&&await this.save(n),i}async updateItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let{id:a,type:u,...f}=n;return Object.assign(s,f),await this.save(i),!0}async moveItem(e,r,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,r);if(!s)return!1;let a={...s};if(!this.deleteItemById(i.items,r))return!1;if(n){let u=this.findItemById(i.items,n);if(u&&u.type==="folder")u.items=u.items||[],u.items.push(a);else return i.items.push(a),!1}else i.items.push(a);return await this.save(i),!0}async reorderItems(e,r,n){let i=this.load(e);if(!i)return!1;try{let s;if(r){let f=this.findItemById(i.items,r);if(!f||!f.items)return!1;s=f.items}else s=i.items;let a=new Map(s.map(f=>[f.id,f])),u=[];for(let f of n){let h=a.get(f);h&&(u.push(h),a.delete(f))}for(let f of a.values())u.push(f);if(r){let f=this.findItemById(i.items,r);f&&(f.items=u)}else i.items=u;return await this.save(i),!0}catch(s){return console.error("[JsonCollectionLoader] Failed to reorder items:",s),!1}}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}deleteItemById(e,r){for(let n=0;n<e.length;n++){if(e[n].id===r)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}};var Tc=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new $s(n):new bl(n)}static createForFormat(e,r){return e==="folder"?new $s(r):new bl(r)}};import*as pt from"fs";import*as Hn from"path";function $R(t){if(typeof t!="string")return"text";let e=t.trim();try{let r=JSON.parse(e);if(typeof r=="object"&&r!==null)return"json"}catch{}return/^<\?xml/.test(e)||/^<([a-zA-Z_][\w\-\.]*)[\s>]/.test(e)?/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":"xml":/^<\!DOCTYPE html>/i.test(e)||/^<html[\s>]/i.test(e)?"html":/^(function\s*\(|\(\)\s*=>|const |let |var |export |import )/.test(e)?"javascript":"text"}function LU(t){return{info:{name:t.name,_postman_id:t.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:t.items.map(e=>MR(e)),event:lb(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function MR(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(MR):[],event:lb(t.scripts)};if(t.type==="request"){let e=t;return{name:e.name,request:{method:e.method,header:(e.headers||[]).filter(r=>r.enabled!==!1).map(jU),url:UU(e),body:BU(e),auth:HU(e.auth),description:e.description},event:lb(e.scripts),protocolProfileBehavior:VU(e.settings)}}}function jU(t){return{key:t.key,value:t.value,disabled:t.enabled===!1}}function UU(t){let e=t.url,r=t.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=r.match(/^([^\/\?]+)/);if(i){let h=i[1];/^{{.*}}$/.test(h)?n=[h]:n=h.split(".")}let s=[],a=r.match(/^[^\/\?]+(\/[^\?]*)?/);if(a&&a[1]!==void 0){let h=a[1].replace(/^\//,"");h.endsWith("/")?(s=h.slice(0,-1).split("/"),s.push("")):s=h.length>0?h.split("/"):[]}let u;if(Array.isArray(t.query)&&t.query.length>0)u=t.query.map(h=>{let g={key:h.key,value:h.value};return h.enabled===!1&&(g.disabled=!0),g});else{let h=r.indexOf("?");h!==-1&&(u=r.substring(h+1).split("&").map(m=>{let[S,..._]=m.split("=");return{key:S,value:_.join("=")}}))}let f;return t.params&&typeof t.params=="object"&&(f=Object.entries(t.params).map(([h,g])=>({key:h,value:String(g)}))),{raw:e,host:n.length>0?n:void 0,path:s.length>0?s:void 0,query:u&&u.length>0?u:void 0,variable:f&&f.length>0?f:void 0}}function BU(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=$R(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||$R(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:s}}}}let r=e.type==="form-data"&&Array.isArray(e.content)?e.content:e.type==="formdata"&&Array.isArray(e.fields)?e.fields:null;if(r)return{mode:"formdata",formdata:r.map(s=>({key:s.key,value:s.value,type:s.type||"text",disabled:s.enabled===!1}))};let n=e.type==="x-www-form-urlencoded"&&Array.isArray(e.content)?e.content:e.type==="urlencoded"&&Array.isArray(e.fields)?e.fields:null;if(n)return{mode:"urlencoded",urlencoded:n.map(s=>({key:s.key,value:s.value,disabled:s.enabled===!1}))};if(e.type==="file"&&e.fileName)return{mode:"file",file:{src:e.fileName}};if(e.type==="binary")return{mode:"binary",file:{}};let i=e.type==="graphql"?e.content??(e.query?e:null):null;if(i){let s=i.query??"",a=i.variables;return{mode:"graphql",graphql:{query:s,variables:a?typeof a=="string"?a:JSON.stringify(a):void 0}}}if(e.content)return{mode:"raw",raw:e.content}}function HU(t){if(!(!t||!t.type||t.type==="none")){if(t.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:t.bearerToken,type:"string"}]};if(t.type==="basic"&&t.basicAuth)return{type:"basic",basic:[{key:"username",value:t.basicAuth.username,type:"string"},{key:"password",value:t.basicAuth.password,type:"string"}]}}}function VU(t){if(!t)return;let e={};return t.followRedirects===!1&&(e.followRedirects=!1),t.followOriginalMethod===!0&&(e.followOriginalHttpMethod=!0),t.followAuthHeader===!1&&(e.followAuthorizationHeader=!1),t.maxRedirects!==void 0&&(e.maxRedirects=t.maxRedirects),t.strictSSL===!1&&(e.disableUrlEncoding=!1),t.timeout!==void 0&&(e.requestTimeout=t.timeout),Object.keys(e).length>0?e:void 0}function lb(t){if(!t)return[];let e=[];return t.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[t.preRequest]}}),t.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[t.postResponse]}}),e}var qc=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Tc.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}collectionsDir;collections=new Map;fileWatcher;loader;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){pt.existsSync(this.collectionsDir)||pt.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let r of e)this.collections.set(r.id,r)}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.collectionsDir,"**/*");let e=()=>{this.loadCollections(),this.onCollectionsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getAllCollections(){return Array.from(this.collections.values())}getCollection(e){return this.collections.get(e)}getCollectionById(e){for(let r of this.collections.values())if(r.id===e)return r}getCollectionByName(e){let r=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===r)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=at(e.name)),await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let r=this.collections.get(e);return r?.variables?{...r.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,r,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[r]=String(n)}deleteCollectionVariable(e,r){let n=this.localCollectionValues.get(e);n&&delete n[r]}clearCollectionVariables(e){this.localCollectionValues.set(e,{})}async deleteCollection(e){if(!this.collections.get(e))return!1;let n=await this.loader.delete(e);return n&&this.collections.delete(e),n}findRequest(e,r){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,r)}findRequestByPath(e,r){let n=this.collections.get(e);if(!n)return;let i=r.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,n);if(s){let a=this.findItemRecursive(i.items,r);if(a){let{id:u,type:f,...h}=n;Object.assign(a,h)}}return s}async addRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;r.id||(r.id=at(r.name));try{if(await this.loader.saveItem(e,r,n),n){let s=this.findItemRecursive(i.items,n);s&&s.type==="folder"&&(s.items=s.items||[],s.items.push(r))}else i.items.push(r);return!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,r){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemRecursive(n.items,r),i}getAllRequests(e){let r=this.collections.get(e);if(!r)return[];let n=[];return this.collectRequestsRecursive(r.items,n),n}findItemRecursive(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,r);if(i)return i}}}findItemByPath(e,r){if(r.length===0)return;let[n,...i]=r,s=e.find(a=>a.name===n);if(s){if(i.length===0)return s;if(s.type==="folder"&&s.items)return this.findItemByPath(s.items,i)}}updateItemRecursive(e,r,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===r)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,r,n))return!0}return!1}deleteItemRecursive(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,r))return!0}return!1}collectRequestsRecursive(e,r){for(let n of e)n.type==="request"?r.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,r)}async createCollection(e){let r={id:at(e),name:e,items:[]};return await this.saveCollection(r),r}async renameCollection(e,r){let n=this.collections.get(e);return n?(n.name=r,await this.saveCollection(n),!0):!1}async duplicateCollection(e,r){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);let i=at(r),s=this.loader.getCollectionPath(e),a=Hn.join(this.collectionsDir,i);if(!pt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let u=Hn.join(a,"collection.json");if(pt.existsSync(u)){let h=JSON.parse(pt.readFileSync(u,"utf-8"));h.id=i,h.name=r,pt.writeFileSync(u,JSON.stringify(h,null,2))}else pt.writeFileSync(u,JSON.stringify({id:i,name:r},null,2));this.loadCollections();let f=this.collections.get(i);if(!f)throw new Error("Failed to load duplicated collection");return f}async createFolder(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:at(e.name),type:"folder",name:e.name,items:[]};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async deleteFolder(e,r){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,r);return i&&this.deleteItemById(n.items,r),i}async renameFolder(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async duplicateFolder(e,r,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,r);if(!s||!pt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let a=Hn.dirname(s),u=at(n),f=Hn.join(a,u);this.copyDirRecursive(s,f);let h=Hn.join(f,"folder.json");if(pt.existsSync(h)){let S=JSON.parse(pt.readFileSync(h,"utf-8"));S.id=u,S.name=n,pt.writeFileSync(h,JSON.stringify(S,null,2))}else pt.writeFileSync(h,JSON.stringify({id:u,name:n,type:"folder"},null,2));let g=this.loader.load(e);g&&this.collections.set(e,g);let m=this.findItemById(g?.items||[],u);return m||{id:u,type:"folder",name:n,items:[]}}async createRequest(e){if(!this.collections.get(e.collectionId))throw new Error("Collection not found");let n={id:e.id||at(e.name),type:"request",name:e.name,method:e.method||"GET",url:e.url,params:e.params,query:e.query,headers:e.headers,body:e.body,auth:e.auth,settings:e.settings,scripts:e.scripts,deprecated:e.deprecated,description:e.description,doc:e.doc,responseSchema:e.responseSchema,bodySchema:e.bodySchema};await this.loader.saveItem(e.collectionId,n,e.parentId);let i=this.loader.load(e.collectionId);return i&&this.collections.set(e.collectionId,i),n}async renameRequest(e,r,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,r,{name:n});if(s){let a=this.findItemById(i.items,r);a&&(a.name=n)}return s}async moveItem(e,r,n){if(!this.collections.get(e))return!1;let s=await this.loader.moveItem(e,r,n);return s&&this.loadCollections(),s}async reorderItems(e,r,n){if(!this.collections.get(e))return!1;let s=await this.loader.reorderItems(e,r,n);return s&&this.loadCollections(),s}findItemById(e,r){for(let n of e){if(n.id===r)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,r);if(i)return i}}}copyDirRecursive(e,r){pt.existsSync(r)||pt.mkdirSync(r,{recursive:!0});for(let n of pt.readdirSync(e,{withFileTypes:!0})){let i=Hn.join(e,n.name),s=Hn.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):pt.copyFileSync(i,s)}}deleteItemById(e,r){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===r)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,r))return!0}return!1}async importCollection(e){let r=pt.readFileSync(e,"utf-8"),n;try{n=JSON.parse(r)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||at(n.name||"Imported Collection"),name:n.name||"Imported Collection",description:n.description,items:n.items||[]};return await this.saveCollection(i),i}async importPostmanCollection(e){let r=h=>{if(!h)return;switch(h.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:h.bearer?.find(T=>T.key==="token")?.value||""};case"basic":let S=h.basic?.find(T=>T.key==="username"),_=h.basic?.find(T=>T.key==="password");return{type:"basic",basicAuth:{username:S?.value||"",password:_?.value||""}};case"apikey":let C=h.apikey?.find(T=>T.key==="key"),x=h.apikey?.find(T=>T.key==="value"),A=h.apikey?.find(T=>T.key==="in");return{type:"apikey",apikey:{key:C?.value||"",value:x?.value||"",in:A?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=h=>{if(!Array.isArray(h)||h.length===0)return;let g={};for(let m of h){let S=m.script?.exec;if(!S)continue;let _=Array.isArray(S)?S.join(`
|
|
225
|
+
`):S;m.listen==="prerequest"?g.preRequest=_:m.listen==="test"&&(g.postResponse=_)}return g.preRequest||g.postResponse?g:void 0},i=h=>{if(!h||typeof h!="object")return;let g={};return h.followRedirects===!1&&(g.followRedirects=!1),h.followOriginalHttpMethod===!0&&(g.followOriginalMethod=!0),h.followAuthorizationHeader===!1&&(g.followAuthHeader=!1),h.maxRedirects!==void 0&&(g.maxRedirects=h.maxRedirects),h.requestTimeout!==void 0&&(g.timeout=h.requestTimeout),Object.keys(g).length>0?g:void 0},s=h=>{if(!h||typeof h=="string")return;let g=h.query;if(!(!Array.isArray(g)||g.length===0))return g.map(m=>({key:m.key||"",value:m.value||"",enabled:m.disabled!==!0}))},a=h=>{if(typeof h=="string")return h;if(!h)return"";let g=new Set;if(Array.isArray(h.variable))for(let S of h.variable)S.key&&g.add(S.key);if(g.size===0&&h.raw)return h.raw;let m="";if(h.protocol&&(m+=h.protocol+"://"),h.host&&(m+=Array.isArray(h.host)?h.host.join("."):h.host),h.port&&(m+=":"+h.port),h.path){let _=(Array.isArray(h.path)?h.path:[h.path]).map(C=>{let x=C.startsWith(":")?C.substring(1):C;return g.has(x)?":"+x:(C.startsWith(":"),C)});m+="/"+_.join("/")}return!m&&h.raw?h.raw:m},u=h=>h.map(g=>{if(g.item)return{id:at(g.name),type:"folder",name:g.name,description:g.description,auth:r(g.auth),scripts:n(g.event),items:u(g.item)};{let m=g.request||{};return{id:at(g.name),type:"request",name:g.name,description:g.description||m.description,method:typeof m.method=="string"?m.method:"GET",url:a(m.url),query:s(m.url),headers:Array.isArray(m.header)?m.header.map(S=>({key:S.key||S.name||"",value:S.value||S.value||"",enabled:S.disabled!==!0})):[],body:(()=>{let S=m.body;if(S){if(S.mode==="raw"&&S.raw){let _=S.options?.raw?.language;return{type:"raw",format:_==="xml"?"xml":_==="html"?"html":_==="javascript"?"javascript":_==="text"?"text":"json",content:S.raw}}if(S.mode==="urlencoded"&&Array.isArray(S.urlencoded))return{type:"x-www-form-urlencoded",content:S.urlencoded.map(_=>({key:_.key||"",value:_.value||"",enabled:_.disabled!==!0}))};if(S.mode==="formdata"&&Array.isArray(S.formdata))return{type:"form-data",content:S.formdata.map(_=>({key:_.key||"",value:_.value||"",type:_.type||"text",enabled:_.disabled!==!0}))};if(S.mode==="graphql"&&S.graphql){let _;if(S.graphql.variables)try{_=JSON.parse(S.graphql.variables)}catch{_=void 0}return{type:"graphql",content:{query:S.graphql.query||"",variables:_}}}if(S.mode==="binary")return{type:"binary",content:""}}})(),auth:r(m.auth),scripts:n(g.event),settings:i(g.protocolProfileBehavior)}}}),f={id:at(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:r(e.auth),scripts:n(e.event),items:u(e.item||[])};return await this.saveCollection(f),f}async exportCollection(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=LU(n),s=JSON.stringify(i,null,2);pt.writeFileSync(r,s,"utf-8")}async exportCollectionAsRestClientFolder(e,r){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Hn.join(r,xt(n.name));pt.mkdirSync(i,{recursive:!0});let s=n.variables||{};Sl(Hn.join(i,`${xt(n.name)}.env`),s),Ac(i,xt(n.name),n.scripts),op(n.items,i,n)}dispose(){this.fileWatcher?.dispose()}};import*as qr from"fs";import*as mn from"path";var er={version:"1.0",storage:{format:"folder",root:"./http-forge-assets",history:"./.http-forge-cache/histories",results:"./.http-forge-cache/results"},request:{timeout:3e4,followRedirects:!0,maxRedirects:10,strictSSL:!0},scripts:{modulePaths:["./http-forge-assets/src","./http-forge-assets/lib"]},runner:{resultsRetentionDays:7,indexPageSize:1e3,recentErrorsLimit:20},environments:{default:"dev"},restClientExport:{path:"collections-rest-client",mergeGlobals:!0},mcp:{excludedCollections:[],excludedSuites:[],toolPrefix:"",maxRequestsPerCall:50,cors:{allowedOrigins:["http://localhost","http://127.0.0.1"]}},proxy:null},_l={config:"http-forge.config.json"},Zo={collections:"collections",environments:"environments",flows:"flows",suites:"suites"};var wl=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=mn.join(e,_l.config),this.config=this.loadConfig(),this.setupFileWatcher()}config;configPath;fileWatcher;loadConfig(){if(!qr.existsSync(this.configPath))return{...er};try{let e=qr.readFileSync(this.configPath,"utf-8"),r=JSON.parse(e);return this.mergeWithDefaults(r)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${_l.config}. Using default configuration.`),{...er}}}mergeWithDefaults(e){return{version:e.version??er.version,storage:{...er.storage,...e.storage},request:{...er.request,...e.request},scripts:{...er.scripts,...e.scripts},runner:{...er.runner,...e.runner},environments:{...er.environments,...e.environments},restClientExport:{...er.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:er.proxy,mcp:{...er.mcp,...e.mcp,cors:{...er.mcp.cors,...e.mcp?.cors}}}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,_l.config);let e=()=>{this.reload()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}getConfig(){return this.config}getStorageConfig(){return this.config.storage}getRequestConfig(){return this.config.request}getScriptsConfig(){return this.config.scripts}getRunnerConfig(){return this.config.runner}getEnvironmentsConfig(){return this.config.environments}getRestClientExportPath(){let e=this.config.restClientExport?.path||"collections-rest-client";return mn.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}getMcpConfig(){return this.config.mcp??er.mcp}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return mn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return mn.join(this.getRootPath(),Zo.collections)}getEnvironmentsPath(){return mn.join(this.getRootPath(),Zo.environments)}getFlowsPath(){return mn.join(this.getRootPath(),Zo.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return mn.join(this.getRootPath(),Zo.suites)}getModulePaths(){return this.config.scripts.modulePaths.map(e=>this.resolvePath(e))}getWorkspacePath(){return this.workspacePath}reload(){this.config=this.loadConfig()}configExists(){return qr.existsSync(this.configPath)}async createDefaultConfig(){let e=JSON.stringify(er,null,2);await qr.promises.writeFile(this.configPath,e,"utf-8");let r=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of r)qr.existsSync(i)||await qr.promises.mkdir(i,{recursive:!0});let n=[this.getHistoryPath(),this.getResultsPath()];for(let i of n)qr.existsSync(i)||await qr.promises.mkdir(i,{recursive:!0});await this.createSampleEnvironments()}async createSampleEnvironments(){let e=this.getEnvironmentsPath(),r={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await qr.promises.writeFile(mn.join(e,"globals.json"),JSON.stringify(r,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await qr.promises.writeFile(mn.join(e,"dev.json"),JSON.stringify(n,null,2),"utf-8");let i={id:"default_headers",name:"Default Headers",headers:{"Content-Type":"application/json",Accept:"application/json"}};await qr.promises.writeFile(mn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}};var WU="httpForge.cookies",$c=class{constructor(e,r=WU){this.store=e;this.storeKey=r;this.loadCookies()}cookies=new Map;loadCookies(){try{let e=this.store.get(this.storeKey);e&&(this.cookies=new Map(Object.entries(e)),this.cleanExpiredCookies())}catch(e){console.error("[CookieService] Failed to load cookies:",e)}}async saveCookies(){try{let e={};this.cookies.forEach((r,n)=>{e[n]=r}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}get(e,r){if(r){let s=this.getCookieKey(e,r),a=this.cookies.get(s);if(a&&!this.isExpired(a))return a}let n=this.getCookieKey(e,"*"),i=this.cookies.get(n);if(i&&!this.isExpired(i))return i;for(let s of this.cookies.values())if(s.name===e&&!this.isExpired(s))if(r&&s.domain){if(this.domainMatches(r,s.domain))return s}else return s}async set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e),await this.saveCookies()}async setFromResponse(e){for(let r of e){let n=this.getCookieKey(r.name,r.domain,r.path);this.cookies.set(n,r)}await this.saveCookies()}has(e,r){return this.get(e,r)!==void 0}async delete(e,r,n){let i=this.getCookieKey(e,r,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let r=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&r.push(n):r.push(n));return r}getCookieHeader(e){let r=this.getAll(e);return lt.formatCookieHeader(r)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let r=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&r.push(n);for(let n of r)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,r){return lt.parseCookieHeaders(e,r)}isExpired(e){return lt.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[r,n]of this.cookies.entries())this.isExpired(n)&&e.push(r);for(let r of e)this.cookies.delete(r);e.length>0&&this.saveCookies()}domainMatches(e,r){return lt.domainMatches(e,r)}get count(){return this.cookies.size}};var Mc=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}localCache=[];pendingOperations=[];get(e,r){return r?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===r||r.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,r){return this.get(e,r)!==void 0}set(e){let r=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));r>=0?this.localCache[r]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,r,n){let i=this.localCache.findIndex(s=>s.name===e&&(!r||s.domain===r||s.domain&&r.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:r,path:n}),!0}getAll(e){return e?this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(r=>{let n=r.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,r){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(r,n);i.length>0&&(i.forEach(s=>{let a=this.localCache.findIndex(u=>u.name===s.name&&u.domain===(s.domain||n));a>=0?this.localCache[a]=s:this.localCache.push(s)}),await this.cookieService.setFromResponse(i))}getCookieHeader(e){let r=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(lt.isExpired(s)||s.domain&&!lt.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return lt.formatCookieHeader(i)}clear(){this.localCache=[],this.pendingOperations.push({type:"clear"})}async flush(){for(let e of this.pendingOperations)switch(e.type){case"set":e.cookie&&await this.cookieService.set(e.cookie);break;case"delete":e.name&&await this.cookieService.delete(e.name,e.domain,e.path);break;case"clear":await this.cookieService.clear();break}this.pendingOperations=[]}};import*as Bt from"fs";import*as Kr from"path";function ap(t){try{let e=JSON.parse(typeof t=="string"?t:t.toString("utf-8"));if(!e)return null;let r=e.environment||e,n=r.name||e.name||"imported-environment",i=r.values||r.variables||e.values||e.variables||[],s={};if(Array.isArray(i))for(let u of i){if(!u)continue;let f=u.key??u.name,h=typeof u.enabled=="boolean"?u.enabled:!0;f&&h!==!1&&(s[f]=u.value??u.initial??"")}else if(typeof i=="object"&&i!==null)for(let[u,f]of Object.entries(i))s[u]=String(f??"");let a=r._postman_exported_at?"Imported from Postman export":r.description||"";return{name:n,variables:s,description:a}}catch{return null}}async function YU(t,e){try{let r=await e.readFile(t);return ap(r)}catch{return null}}var Nc={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Dc=class{constructor(e,r,n,i){this.workspaceFolder=e;this.workspaceStore=r;this.configService=n;this.fileWatcherFactory=i;let s=n.getEnvironmentsPath();this.environmentsPath=s,this.sharedConfigPath=Kr.join(s,"_global.json"),this.localConfigPath=Kr.join(s,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r.get(Nc.SELECTED_ENVIRONMENT,"dev")??"dev",this.localGlobalValues={},this.localEnvironmentValues=new Map,this.loadPersistedEnvironmentOverrides(),this.setupFileWatcher()}environmentsPath;sharedConfigPath;localConfigPath;historiesPath;sharedConfig=null;localConfig=null;selectedEnvironment="dev";fileWatcher;localGlobalValues={};localEnvironmentValues=new Map;onEnvironmentsChanged;setupFileWatcher(){if(!this.fileWatcherFactory||!Bt.existsSync(this.environmentsPath))return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.environmentsPath,"**/*.json");let e=()=>{this.reload(),this.onEnvironmentsChanged?.()};this.fileWatcher.onDidChange(e),this.fileWatcher.onDidCreate(e),this.fileWatcher.onDidDelete(e)}dispose(){this.fileWatcher?.dispose()}getWorkspaceFolder(){return this.workspaceFolder}getRootPath(){return this.configService.getRootPath()}loadConfigs(){if(!Bt.existsSync(this.environmentsPath)){this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}},this.localConfig={credentials:{},variables:{}};return}this.loadFolderConfigs()}getSharedConfig(){return this.sharedConfig||this.loadConfigs(),this.sharedConfig}getLocalConfig(){return this.localConfig||this.loadConfigs(),this.localConfig}getEnvironmentNames(){let e=this.getSharedConfig();return e?.environments?Object.keys(e.environments):[]}getSelectedEnvironment(){return this.selectedEnvironment}async setSelectedEnvironment(e){if(this.selectedEnvironment=e,await this.workspaceStore.update(Nc.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let r=this.getEnvOverridesStateKey(e),n=this.workspaceStore.get(r,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}}getEnvOverridesStateKey(e){return`${Nc.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),r=this.workspaceStore.get(e,{});r&&Object.keys(r).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...r})}persistEnvironmentOverrides(e){let r=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore.update(r,n)}setEnvironmentVariable(e,r){let n=this.selectedEnvironment;this.localEnvironmentValues.has(n)||this.localEnvironmentValues.set(n,{}),this.localEnvironmentValues.get(n)[e]=String(r),this.persistEnvironmentOverrides(n)}deleteEnvironmentVariable(e){let r=this.selectedEnvironment,n=this.localEnvironmentValues.get(r);n&&(delete n[e],this.persistEnvironmentOverrides(r))}clearEnvironmentVariables(){let e=this.selectedEnvironment;this.localEnvironmentValues.set(e,{}),this.persistEnvironmentOverrides(e)}async resetEnvironmentOverrides(e){let r=e||this.selectedEnvironment;this.localEnvironmentValues.delete(r),await this.workspaceStore.update(this.getEnvOverridesStateKey(r),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,r){this.localGlobalValues[e]=String(r)}getGlobalVariable(e){return this.getSharedConfig()?.globalVariables?.[e]}getGlobalVariableLocal(e){return this.localGlobalValues[e]}getGlobalVariables(){return{...this.getSharedConfig()?.globalVariables||{},...this.localGlobalValues}}getGlobalVariableLocals(){return{...this.localGlobalValues}}deleteGlobalVariable(e){delete this.localGlobalValues[e]}clearGlobalVariables(){this.localGlobalValues={}}async setSessionVariable(e,r){this.setEnvironmentVariable(e,r)}getSessionVariable(e){return this.getEnvironmentVariableLocal(e)}getSessionVariables(){return this.getEnvironmentVariableLocals()}async deleteSessionVariable(e){this.deleteEnvironmentVariable(e)}async clearSessionVariables(){this.clearEnvironmentVariables()}hasSessionVariable(e){return this.getEnvironmentVariableLocal(e)!==void 0}getResolvedEnvironment(e){let r=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[r])return null;let s=n.environments[r],a=i?.credentials?.[r],u=i?.variables||{},f=a?.variables||{},h=a&&a.headers||{},g=Fu(n.defaultHeaders||{},h),m=this.localEnvironmentValues.get(r)||{},S={...n.globalVariables||{},...s.variables||{},...u,...f,...m};return{name:r,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:g,variables:S}}resolveVariables(e,r){return this.createResolver(r).resolveString(e,!0)}exportEnvironmentsToFolder(e,r=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!r&&Object.keys(s).length){let a=Kr.join(e,"globals.env");Sl(a,s)}n.forEach(a=>{let u=i?.environments?.[a];if(!u)return;let f={...u.variables||{}};r&&(f={...s,...f});let h=Kr.join(e,`${xt(a)}.env`);Sl(h,f)})}resolveVariablesWithExtra(e,r,n){return this.createResolver(n,r).resolveString(e,!0)}resolveVariablesInObject(e,r){return this.createResolver(r).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,r,n){return this.createResolver(n,r).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return Kr.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Bt.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let r={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,r);for(let[n,i]of Object.entries(e.credentials||{})){let s=this.getEnvLocalConfigPath(n),a={variables:i.variables||{}};this.saveJsonFile(s,a)}this.localConfig=e}importPostmanEnvironmentFile(e){try{let r=Bt.readFileSync(e,"utf-8"),n=ap(r);if(!n)throw new Error("Failed to parse Postman environment file");this.sharedConfig||this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{},defaultHeaders:{}});let i=n.name||`imported-${Date.now()}`;return this.sharedConfig.environments=this.sharedConfig.environments||{},this.sharedConfig.environments[i]=this.sharedConfig.environments[i]||{},this.sharedConfig.environments[i].variables=n.variables,n.description&&(this.sharedConfig.environments[i].description=n.description),this.saveSharedConfig(this.sharedConfig),n}catch(r){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",r),r}}saveEnvLocalConfig(e,r){let n=this.getEnvLocalConfigPath(e),i={variables:r};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:r}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return Kr.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=Hu(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,r){let s={...this.getResolvedEnvironment(e)?.variables||{},...this.getSessionVariables(),...r||{}};return new Mo({globals:{},collectionVariables:{},environmentVariables:s,sessionVariables:{},variables:{}})}saveFolderSharedConfig(e){Bt.existsSync(this.environmentsPath)||Bt.mkdirSync(this.environmentsPath,{recursive:!0});let r={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,r);let n=Bt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!ph(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=Kr.basename(s,".json");if(!i.has(a))try{Bt.unlinkSync(Kr.join(this.environmentsPath,s))}catch{}}for(let[s,a]of Object.entries(e.environments||{})){let u={name:s,description:a.description,requiresConfirmation:a.requiresConfirmation,variables:a.variables||{}};this.saveJsonFile(Kr.join(this.environmentsPath,`${s}.json`),u)}}reload(){this.sharedConfig=null,this.localConfig=null,this.loadConfigs()}getAllEnvironments(){return this.loadConfigs(),this.sharedConfig?Object.entries(this.sharedConfig.environments).map(([e,r])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:r.variables||{}})):[]}async setActiveEnvironment(e){await this.setSelectedEnvironment(e)}async createEnvironment(e){if(this.loadConfigs(),this.sharedConfig||(this.sharedConfig={environments:{},globalVariables:{}}),this.sharedConfig.environments[e])throw new Error(`Environment "${e}" already exists`);this.sharedConfig.environments[e]={description:`Created ${new Date().toISOString()}`,variables:{}},this.saveSharedConfig(this.sharedConfig)}async deleteEnvironment(e){if(this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentExists(e),delete this.sharedConfig.environments[e],this.selectedEnvironment===e){let r=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=r.length>0?r[0]:"dev",await this.workspaceStore.update(Nc.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(r);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[r]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[r].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,r){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(r),this.validateEnvironmentExists(e),r!==e&&(this.validateEnvironmentNameNotTaken(r),this.sharedConfig.environments[r]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=r,await this.workspaceStore.update(Nc.SELECTED_ENVIRONMENT,r)),this.saveSharedConfig(this.sharedConfig))}validateEnvironmentName(e){if(!e||e.trim().length===0)throw new Error("Environment name cannot be empty");if(e.length>128)throw new Error("Environment name cannot exceed 128 characters");if(!/^[a-zA-Z0-9_\-\.]+$/.test(e))throw new Error("Environment name can only contain letters, numbers, hyphens, underscores, and dots")}validateEnvironmentExists(e){if(!this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" not found`)}validateEnvironmentNameNotTaken(e){if(this.sharedConfig?.environments?.[e])throw new Error(`Environment "${e}" already exists`)}validateConfigLoaded(){if(!this.sharedConfig)throw new Error("No environment configuration loaded")}async updateEnvironmentVariables(e,r){if(this.loadConfigs(),!this.sharedConfig)throw new Error("No configuration loaded");let n=this.sharedConfig.environments[e];if(!n)throw new Error(`Environment "${e}" not found`);n.variables=r,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!Bt.existsSync(e))return null;let r=Bt.readFileSync(e,"utf-8");return JSON.parse(r)}catch(r){return console.error(`Failed to load JSON from ${e}:`,r),null}}saveJsonFile(e,r){try{let n=Kr.dirname(e);Bt.existsSync(n)||Bt.mkdirSync(n,{recursive:!0}),Bt.writeFileSync(e,JSON.stringify(r,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}};var Fc=class t{constructor(e,r,n,i,s,a,u,f,h,g,m,S){this.httpService=e;this.scriptExecutor=r;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=a;this.collectionScripts=u;this.folderScriptsChain=f;this.onConsoleOutput=h;this.collectionName=g;this.iteration=m;this.iterationCount=S}async execute(e,r,n){let i=Date.now();return this.executeWithSession(e,r,n,i)}async executeWithSession(e,r,n,i){let s=this.collectPreRequestScripts(e),a=this.collectPostResponseScripts(e),u=this.envConfigService.getResolvedEnvironment(this.environment);if(!u)throw new Error(`Environment "${this.environment}" not found or not configured`);let f={request:e,variables:{...r},environmentVariables:u.variables||{},environmentName:this.environment,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:this.collectionName,iteration:this.iteration,iterationCount:this.iterationCount},onEnvironmentChange:async(m,S,_)=>{m==="set"&&S&&_!==void 0?this.envConfigService.setEnvironmentVariable(S,_):m==="unset"&&S?this.envConfigService.deleteEnvironmentVariable(S):m==="clear"&&this.envConfigService.clearEnvironmentVariables()}},h=this.scriptExecutor.createRequestSession(f),g=null;try{let m={...r},S={...e},_;if(s.length>0){let D=await h.executePreRequest(s);if(D.consoleOutput&&D.consoleOutput.length>0&&this.onConsoleOutput?.(D.consoleOutput),D.nextRequest!==void 0&&(_=D.nextRequest),D.skipRequest){let L={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:e.url||"",method:e.method||"GET",headers:{},body:L,params:{},query:{}},response:{status:0,statusText:"Skipped",headers:{},body:null,time:0,cookies:[]},duration:Date.now()-i,timestamp:Date.now(),passed:!0,assertions:[],modifiedVariables:m,nextRequest:_}}D.success&&(D.modifiedRequest&&(D.modifiedRequest.url&&(S.url=D.modifiedRequest.url),D.modifiedRequest.headers&&(S.headers=D.modifiedRequest.headers),D.modifiedRequest.params&&(S.params=D.modifiedRequest.params),D.modifiedRequest.query&&(S.query=D.modifiedRequest.query),D.modifiedRequest.body!==void 0&&(S.body=D.modifiedRequest.body)),D.modifiedVariables&&(m=D.modifiedVariables))}g=await this.requestPreparer.prepareRequest(S,this.environment,u,m);let{url:C,headers:x,body:A,method:T}=g,j={};for(let D in x)Object.prototype.hasOwnProperty.call(x,D)&&(j[D.toUpperCase()]=x[D]);if(!j.COOKIE&&S.settings?.includeCookies!==!1&&this.cookieJar){let L=this.cookieJar.getCookieHeader(C);L&&(j.COOKIE=L)}let Y={method:T,url:C,headers:j,body:A.content,signal:n,settings:S.settings?{timeout:S.settings.timeout,followRedirects:S.settings.followRedirects,maxRedirects:S.settings.maxRedirects,strictSSL:S.settings.strictSSL}:void 0},V=await this.httpService.execute(Y);this.cookieJar&&V.headers&&await this.cookieJar.setCookiesFromResponse(C,V.headers);let K=Date.now()-i,ee=[],k={},E;if(a.length>0){let D=0;if(V.body)if(typeof V.body=="string")D=Buffer.byteLength(V.body,"utf8");else if(Buffer.isBuffer(V.body))D=V.body.length;else try{D=Buffer.byteLength(JSON.stringify(V.body),"utf8")}catch{D=0}let L={};V.cookies&&Array.isArray(V.cookies)&&V.cookies.forEach(ie=>{ie.name&&(L[ie.name]=ie.value)});let z={executedRequest:g,status:V.status,statusText:V.statusText,headers:rb(V.headers||{}),body:V.body,cookies:L,responseTime:V.time,responseSize:D},Z=await h.executePostResponse(a,z);ee=Z.testResults,k=Z.modifiedEnvironmentVariables||{},E=Z.visualizerData,Z.nextRequest!==void 0&&(_=Z.nextRequest),Z.consoleOutput&&Z.consoleOutput.length>0&&this.onConsoleOutput?.(Z.consoleOutput)}let P=ee.length===0||ee.every(D=>D.passed),N=ee.length>0?P:V.status>=200&&V.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...g,headers:j},response:{status:V.status,statusText:V.statusText,headers:V.headers||{},body:V.body,time:V.time||K,cookies:V.cookies||[]},duration:K,timestamp:Date.now(),passed:N,assertions:ee,modifiedVariables:m,modifiedEnvironmentVariables:k,nextRequest:_,visualizerData:E}}catch(m){return this.handleError(e,g,m,i)}finally{h.dispose?.()}}collectPreRequestScripts(e){let r=[];if(this.collectionScripts?.preRequest&&r.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&r.push(n.preRequest);else this.folderScriptsChain.preRequest&&r.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&r.push(e.scripts.preRequest),r}collectPostResponseScripts(e){let r=[];if(e.scripts?.postResponse&&r.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&r.push(i.postResponse)}else this.folderScriptsChain.postResponse&&r.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&r.push(this.collectionScripts.postResponse),r}handleError(e,r,n,i){let s=Date.now()-i,a=r?.method||e.method,u=r?.url||e.url;this.onConsoleOutput?.([`[error] ${e.name}: ${n.message||n}`]);let f=String(n.name==="AbortError"?"Request was aborted":n.message||n),h=n?.stack?String(n.stack):"",g=this.errorBodyFormat,m,S;g==="html"||g==="both"?(m=t.formatErrorAsHtml(f,h),S={"content-type":"text/html; charset=utf-8"}):(m=f,S={});let _={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:u||"",method:a||"GET",headers:r?.headers||{},body:r?.body||_,params:r?.params||{},query:r?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:S,cookies:[],body:m,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,r){let n=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return`<!doctype html>
|
|
226
226
|
<html>
|
|
227
227
|
<body style="font-family:system-ui,Segoe UI,Roboto,-apple-system,Helvetica,Arial,sans-serif;padding:12px;color:#c7254e;">
|
|
228
228
|
<h2 style="margin-top:0;color:#a94442">Request Error</h2>
|
|
@@ -266,7 +266,7 @@ fragment TypeRef on __Type {
|
|
|
266
266
|
`)){try{let s=new URLSearchParams(i);for(let[a,u]of s)if(gn.test(a)&&u&&!ur(u)){let f=Xo(a),h=2;for(;r.has(f);)f=`${Xo(a)}_${h++}`;r.add(f),e.push({location:"body",field:a,path:n?`${n}.${a}`:a,value:u,variableName:f})}}catch{}return}return}if(Array.isArray(t)){t.forEach((i,s)=>up(i,e,r,`${n}[${s}]`));return}if(typeof t=="object")for(let[i,s]of Object.entries(t)){let a=n?`${n}.${i}`:i;if(gn.test(i)&&s&&typeof s=="string"&&!ur(s)){let u=Xo(i),f=2;for(;r.has(u);)u=`${Xo(i)}_${f++}`;r.add(u),e.push({location:"body",field:i,path:a,value:s,variableName:u})}else typeof s=="object"&&s!==null&&up(s,e,r,a)}}}function ZU(t,e){let r=JSON.parse(JSON.stringify(t));for(let n of e){let i=`{{${n.variableName}}}`;switch(n.location){case"url":r.url&&(r.url=r.url.replace(new RegExp(`([?&])${eB(n.field)}=[^&]*`),`$1${n.field}=${i}`));break;case"header":if(Array.isArray(r.headers)){let s=r.headers.find(a=>a.key===n.field&&a.value===n.value);s&&(s.value=i)}else r.headers&&r.headers[n.field]===n.value&&(r.headers[n.field]=i);break;case"query":if(Array.isArray(r.query)){let s=r.query.find(a=>a.key===n.field&&a.value===n.value);s&&(s.value=i)}else r.query&&r.query[n.field]===n.value&&(r.query[n.field]=i);break;case"auth":if(r.auth){if(n.field==="bearerToken")r.auth.bearerToken=i;else if(n.field==="basicAuth.password"&&r.auth.basicAuth)r.auth.basicAuth.password=i;else if(n.field==="apiKey.value"){let s=r.auth.apikey||r.auth.apiKey;s&&(s.value=i)}}break;case"body":XU(r,n.field,n.path,n.value,i);break}}return r}function XU(t,e,r,n,i){let s=typeof t.body=="object"&&t.body!==null&&"content"in t.body?t.body:null,a=s?s.content:t.body;if(a){if(typeof a=="string"){let u=a.trim();if(u.startsWith("{")||u.startsWith("[")){try{let f=JSON.parse(u);NR(f,e,r||e,n,i);let h=JSON.stringify(f,null,2);s?s.content=h:t.body=h}catch{}return}if(u.includes("=")&&!u.includes(`
|
|
267
267
|
`)){let f=new URLSearchParams(u);if(f.get(e)===n){f.set(e,i);let h=f.toString();s?s.content=h:t.body=h}return}return}typeof a=="object"&&a!==null&&NR(a,e,r||e,n,i)}}function NR(t,e,r,n,i){let s=r.split("."),a=t;for(let f=0;f<s.length-1;f++){let h=s[f],g=h.match(/^(.+)\[(\d+)\]$/);if(g?a=a?.[g[1]]?.[parseInt(g[2])]:a=a?.[h],a==null)return}let u=s[s.length-1];a&&a[u]===n&&(a[u]=i)}function eB(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Bc=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return $r.join(this.historyPath,xt(e))}getCollectionHistoryPath(e,r){return $r.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return $r.join(this.getCollectionHistoryPath(e,r),xt(n))}getSharedEnvironmentHistoryPath(e){return $r.join(this.sharedHistoryPath,xt(e))}getSharedCollectionHistoryPath(e,r){return $r.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return $r.join(this.getSharedCollectionHistoryPath(e,r),xt(n))}getHistoryFilePath(e,r,n){return $r.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return $r.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return $r.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return $r.join(this.getSharedRequestPath(e,r,n),`${i}.json`)}loadHistory(e,r,n){let i=this.getHistoryFilePath(e,r,n);try{if(!ke.existsSync(i))return null;let s=ke.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load history for ${n}:`,s),null}}loadSharedHistory(e,r,n){let i=this.getSharedHistoryFilePath(e,r,n);try{if(!ke.existsSync(i))return null;let s=ke.readFileSync(i,"utf-8"),a=JSON.parse(s);return{environment:e||a.environment,requestPath:r||a.requestPath,requestId:n||a.requestId,method:a.method,requests:a.requests}}catch(s){return console.error(`Failed to load shared history for ${n}:`,s),null}}getEntriesForEnvironment(e,r,n){let i=this.loadHistory(e,r,n);return i?i.requests:[]}getEntriesGroupedByTicket(e,r,n){let i=this.getEntriesForEnvironment(e,r,n),s=new Map;for(let a of i){let u=a.ticket||a.branch||"";s.has(u)||s.set(u,[]),s.get(u).push(a)}return s}getSharedEntriesGroupedByTicket(e,r,n){let i=this.loadSharedHistory(e,r,n)?.requests??[],s=new Map;for(let a of i){let u=a.ticket||a.branch||"";s.has(u)||s.set(u,[]),s.get(u).push(a)}return s}saveHistory(e){let r=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(r)||ke.mkdirSync(r,{recursive:!0}),ke.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save history for ${e.requestId}:`,i),i}}saveSharedHistory(e){let r=this.getSharedRequestPath(e.environment,e.requestPath,e.requestId),n=this.getSharedHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(r)||ke.mkdirSync(r,{recursive:!0}),ke.writeFileSync(n,JSON.stringify(e,null,2),"utf-8")}catch(i){throw console.error(`Failed to save shared history for ${e.requestId}:`,i),i}}addEntry(e,r,n,i,s){let a=this.loadHistory(e,r,n);a||(a={environment:e,requestPath:r,requestId:n,method:i,requests:[]});let u=db({...s,method:i,id:rv(),timestamp:Date.now()});return a.requests.unshift(u),a.requests.length>100&&(a.requests=a.requests.slice(0,100)),this.saveHistory(a),u}deleteEntry(e,r,n,i){let s=this.loadHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(u=>u.id!==i),s.requests.length!==a){this.saveHistory(s);let u=this.getResponseFilePath(e,r,n,i);return ke.existsSync(u)&&ke.unlinkSync(u),!0}return!1}deleteSharedEntry(e,r,n,i){let s=this.loadSharedHistory(e,r,n);if(!s)return!1;let a=s.requests.length;if(s.requests=s.requests.filter(u=>u.id!==i),s.requests.length!==a){this.saveSharedHistory(s);let u=this.getSharedResponseFilePath(e,r,n,i);return ke.existsSync(u)&&ke.unlinkSync(u),!0}return!1}shareEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let u=this.loadHistory(e,r,n);if(!u)return!1;let f=u.requests.findIndex(_=>_.id===i);if(f===-1)return!1;let[h]=u.requests.splice(f,1);this.saveHistory(u);let g=this.loadSharedHistory(e,r,n)||{environment:e,requestPath:r,requestId:n,method:u.method,requests:[]};if(!g.requests.some(_=>_.id===i)){let _={...h,ticket:null,branch:a};g.requests.unshift(_),g.requests.length>100&&(g.requests=g.requests.slice(0,100)),this.saveSharedHistory(g)}let m=this.getResponseFilePath(e,r,n,i),S=this.getSharedResponseFilePath(e,r,n,i);if(ke.existsSync(m)){let _=$r.dirname(S);ke.existsSync(_)||ke.mkdirSync(_,{recursive:!0});try{ke.renameSync(m,S)}catch{try{ke.copyFileSync(m,S)}catch(x){return console.error(`Failed to copy full response from ${m} to ${S}:`,x),!0}try{ke.unlinkSync(m)}catch(x){console.warn(`Failed to remove original full response after copy: ${m}`,x)}}}return!0}moveSharedEntry(e,r,n,i,s){let a=(s||"").trim();if(!a)return!1;let u=this.loadSharedHistory(e,r,n);if(!u)return!1;let f=!1;return u.requests=u.requests.map(h=>h.id===i?(f=!0,{...h,ticket:null,branch:a}):h),f?(this.saveSharedHistory(u),!0):!1}renameSharedGroup(e,r,n,i,s){let a=(i||"").trim(),u=(s||"").trim();if(!a||!u||a===u)return!1;let f=this.loadSharedHistory(e,r,n);if(!f)return!1;let h=!1;return f.requests=f.requests.map(g=>!g.ticket&&g.branch===a?(h=!0,{...g,branch:u}):g),h?(this.saveSharedHistory(f),!0):!1}clearHistory(e,r,n){let i=this.getRequestPath(e,r,n);if(ke.existsSync(i)){let s=ke.readdirSync(i);for(let a of s)ke.unlinkSync($r.join(i,a));ke.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let a=this.getRequestPath(e,r,n),u=this.getResponseFilePath(e,r,n,i);try{ke.existsSync(a)||ke.mkdirSync(a,{recursive:!0});let f=hb(s);ke.writeFileSync(u,JSON.stringify(f,null,2),"utf-8")}catch(f){throw console.error(`Failed to save full response for ${i}:`,f),f}}loadFullResponse(e,r,n,i){let s=this.getResponseFilePath(e,r,n,i);try{if(!ke.existsSync(s))return null;let a=ke.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load full response for ${i}:`,a),null}}loadSharedFullResponse(e,r,n,i){let s=this.getSharedResponseFilePath(e,r,n,i);try{if(!ke.existsSync(s))return null;let a=ke.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load shared full response for ${i}:`,a),null}}};var Cl=class{constructor(e,r){this.historyService=e;this.inferrer=r}async analyze(e,r,n){let i=n?.environment||"default",s=n?.maxSamples||50,a=this.historyService.loadHistory(i,e,r),u=this.historyService.loadSharedHistory(i,e,r),f=[...a?.requests||[],...u?.requests||[]];if(f.length===0)return{responses:{}};let h=f.slice(0,s),g=new Map;for(let S of h){let _=this.historyService.loadFullResponse(i,e,r,S.id);if(_||(_=this.historyService.loadSharedFullResponse(i,e,r,S.id)),_){let C=_.status;g.has(C)||g.set(C,[]),g.get(C).push(_)}}let m={};for(let[S,_]of g){let C=this.buildResponseDefinition(_);m[String(S)]=C}return{responses:m}}buildResponseDefinition(e){let r={};if(e.length===0)return r;let n=e[0];r.description=n.statusText||`Status ${n.status}`;let i=this.extractContentType(n.headers);if(i&&(r.contentType=i),i&&this.isJsonContentType(i)){let a=this.inferBodySchema(n);for(let u=1;u<e.length;u++){let f=this.inferBodySchema(e[u]);f&&a?a=this.inferrer.mergeSchemas(a,f):f&&(a=f)}if(a&&(r.schema=a),n.body!==void 0&&n.body!==null){let u=typeof n.body=="string"?this.tryParseJson(n.body):n.body;u!==void 0&&(r.examples={default:{summary:"Captured from history",value:u}})}}let s=this.findConsistentHeaders(e);return Object.keys(s).length>0&&(r.headers=s),r}inferBodySchema(e){if(e.body===void 0||e.body===null)return;let r=e.body;if(!(typeof r=="string"&&(r=this.tryParseJson(r),r===void 0)))return this.inferrer.inferFromValue(r)}extractContentType(e){for(let[r,n]of Object.entries(e))if(r.toLowerCase()==="content-type")return(Array.isArray(n)?n[0]:n).split(";")[0].trim()}isJsonContentType(e){return e.includes("json")||e.includes("+json")||e==="application/json"}findConsistentHeaders(e){if(e.length===0)return{};let r=new Set(["content-type","content-length","content-encoding","transfer-encoding","connection","date","server","set-cookie","vary","cache-control","expires","pragma","etag","last-modified","age"]),n=new Map,i=new Map;for(let u of e)for(let[f,h]of Object.entries(u.headers)){let g=f.toLowerCase();r.has(g)||(n.set(g,(n.get(g)||0)+1),i.has(g)||i.set(g,Array.isArray(h)?h.join(", "):h))}let s=Math.ceil(e.length/2),a={};for(let[u,f]of n)if(f>=s){let h=i.get(u);a[u]={schema:this.inferHeaderSchema(h)}}return a}inferHeaderSchema(e){return e?/^\d+$/.test(e)?{type:"integer"}:{type:"string"}:{type:"string"}}tryParseJson(e){try{return JSON.parse(e)}catch{return}}};var CP=tv(K0());var OY=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,PY=/^\d{4}-\d{2}-\d{2}$/,kY=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,AY=/^https?:\/\/[^\s]+$/,TY=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,qY=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,$Y=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,to=class{inferFromValue(e){if(e==null)return{nullable:!0};if(Array.isArray(e))return this.inferArraySchema(e);switch(typeof e){case"string":return this.inferStringSchema(e);case"number":return Number.isInteger(e)?{type:"integer"}:{type:"number"};case"boolean":return{type:"boolean"};case"object":return this.inferObjectSchema(e);default:return{}}}mergeSchemas(e,r){if(!e||Object.keys(e).length===0)return{...r};if(!r||Object.keys(r).length===0)return{...e};let n=e.nullable||r.nullable;if(!e.type&&e.nullable)return{...r,nullable:!0};if(!r.type&&r.nullable)return{...e,nullable:!0};if(e.type!==r.type)return e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer"?{type:"number",...n&&{nullable:!0}}:{...n&&{nullable:!0}};let i={type:e.type};return n&&(i.nullable=!0),e.type==="object"&&r.type==="object"?this.mergeObjectSchemas(e,r,n):e.type==="array"&&r.type==="array"?this.mergeArraySchemas(e,r,n):(e.format&&e.format===r.format&&(i.format=e.format),i)}inferStringFormat(e){if(OY.test(e))return"date-time";if(PY.test(e))return"date";if(kY.test(e))return"email";if(TY.test(e))return"uuid";if(AY.test(e))return"uri";if(qY.test(e))return"ipv4";if($Y.test(e))return"ipv6"}inferStringSchema(e){let r={type:"string"},n=this.inferStringFormat(e);return n&&(r.format=n),r}inferArraySchema(e){let r={type:"array"};if(e.length===0)return r;let n=this.inferFromValue(e[0]);for(let i=1;i<e.length;i++)n=this.mergeSchemas(n,this.inferFromValue(e[i]));return r.items=n,r}inferObjectSchema(e){let r={type:"object",properties:{}},n=Object.keys(e);for(let i of n)r.properties[i]=this.inferFromValue(e[i]);return r}mergeObjectSchemas(e,r,n){let i={type:"object",properties:{},...n&&{nullable:!0}},s=e.properties||{},a=r.properties||{},u=new Set([...Object.keys(s),...Object.keys(a)]);for(let m of u)s[m]&&a[m]?i.properties[m]=this.mergeSchemas(s[m],a[m]):s[m]?i.properties[m]={...s[m]}:i.properties[m]={...a[m]};let f=new Set(e.required||Object.keys(s)),h=new Set(r.required||Object.keys(a)),g=[...u].filter(m=>f.has(m)&&h.has(m));return g.length>0&&(i.required=g),i}mergeArraySchemas(e,r,n){let i={type:"array",...n&&{nullable:!0}};return e.items&&r.items?i.items=this.mergeSchemas(e.items,r.items):e.items?i.items={...e.items}:r.items&&(i.items={...r.items}),i}};var MY=new Set(["content-type","authorization","accept","cookie","host","content-length"]),Nl=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new to}inferrer;async export(e,r){let n=this.collectionService.getCollection(e);if(!n)throw new Error(`Collection ${e} not found`);let i={openapi:"3.0.3",info:this.buildInfo(n,r),servers:this.buildServers(r),paths:{},components:{schemas:{},securitySchemes:{}},tags:[]},s=new Map;if(n.auth&&n.auth.type!=="none"&&n.auth.type!=="inherit"){let f=this.mapAuthToSecurityScheme(n.auth);if(f){let{schemeName:h,scheme:g,requirement:m}=f;s.set(h,g),i.security=[m]}}let a=new Set,u=new Set;if(await this.processItems(n.items,i,s,a,u,void 0,n,r),this.augmentServersFromHostVars(u,i.servers,r),s.size>0)for(let[f,h]of s)i.components.securitySchemes[f]=h;else delete i.components.securitySchemes;return i.tags=[...a].map(f=>({name:f})),i.tags.length===0&&delete i.tags,this.deduplicateComponents(i),Object.keys(i.components.schemas).length===0&&delete i.components.schemas,Object.keys(i.components).length===0&&delete i.components,r.format==="yaml"?CP.stringify(i,{indent:2}):JSON.stringify(i,null,2)}buildInfo(e,r){return{title:r.info?.title||e.name,description:r.info?.description||e.description||"",version:r.info?.version||e.version||"1.0.0"}}buildServers(e){let r=[],n=e.environments||[];if(n.length===0){let i=this.envConfigService.getSelectedEnvironment();if(i){let s=this.envConfigService.resolveVariables("{{baseUrl}}",i);s&&s!=="{{baseUrl}}"&&r.push({url:s,description:i})}}else{let i=new Set;for(let s of n){let a=this.envConfigService.resolveVariables("{{baseUrl}}",s);a&&a!=="{{baseUrl}}"&&!i.has(a)&&(i.add(a),r.push({url:a,description:s}))}}return r.length===0&&r.push({url:"http://localhost",description:"Default server"}),r}async processItems(e,r,n,i,s,a,u,f){for(let h of e)if(h.type==="folder"){let g=h,m=a||g.name;i.add(m),g.items&&await this.processItems(g.items,r,n,i,s,m,u,f)}else{let g=h;await this.processRequest(g,r,n,i,s,a,u,f)}}async processRequest(e,r,n,i,s,a,u,f){let{path:h,hostVar:g}=this.normalizeUrl(e.url);g&&s.add(g);let m=(e.method||"GET").toLowerCase();r.paths[h]||(r.paths[h]={});let S={};S.operationId=this.generateOperationId(e,m,h,r),S.summary=this.cleanSummary(e.name),e.description&&(S.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(S.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(S.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,""))),a&&(S.tags=[a]);let _=this.buildParameters(e);_.length>0&&(S.parameters=_);let C=await this.buildRequestBody(e,f);C&&(S.requestBody=C);let x=await this.buildResponses(e,u.id,f);S.responses=x;let A=this.buildOperationSecurity(e,u,n);A!==void 0&&(S.security=A);let T=r.paths[h][m];T?this.mergeOperation(T,S,e.name):r.paths[h][m]=S}mergeOperation(e,r,n){if(r.summary&&r.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
|
|
268
268
|
|
|
269
|
-
Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=new Set(e.tags||[]);for(let s of r.tags)i.add(s);e.tags=[...i]}if(r.parameters){e.parameters||(e.parameters=[]);for(let i of r.parameters){let s=e.parameters.find(a=>a.name===i.name&&a.in===i.in);s?this.mergeParameterSchema(s,i,n):e.parameters.push(i)}}if(r.responses){e.responses||(e.responses={});for(let[i,s]of Object.entries(r.responses))e.responses[i]||(e.responses[i]=s)}if(r.requestBody?.content&&e.requestBody?.content)for(let[i,s]of Object.entries(r.requestBody.content))e.requestBody.content[i]||(e.requestBody.content[i]=s);else r.requestBody&&!e.requestBody&&(e.requestBody=r.requestBody)}mergeParameterSchema(e,r,n){e.schema||(e.schema={});let i=e.schema,s=r.schema||{},a=this.getConstraintKind(i),u=this.getConstraintKind(s);if(a==="none"&&u==="none")this.widenType(i,s);else if(a==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(u==="none")this.widenType(i,s);else if(a===u)this.mergeSameKindConstraints(i,s,a),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(h=>JSON.stringify(h)===JSON.stringify(f))||i.oneOf.push(f)}else if(s.oneOf){let f=this.buildVariantSchema(i);i.oneOf=[f,...s.oneOf]}else{let f=this.buildVariantSchema(i),h=this.buildVariantSchema(s);i.oneOf=[f,h]}this.stripConstraints(i)}if(r.description&&r.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+r.description),r.example!==void 0&&r.example!==e.example){e.examples||(e.examples={},e.example!==void 0&&(e.examples.variant1={value:e.example}));let f=`variant_${n.replace(/[^a-zA-Z0-9_]/g,"_")}`;e.examples[f]={value:r.example},delete e.example}}getConstraintKind(e){return e.oneOf?"oneOf":e.enum&&e.enum.length>0?"enum":e.pattern?"pattern":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"range":e.minLength!==void 0||e.maxLength!==void 0?"length":e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.format?"format":"none"}mergeSameKindConstraints(e,r,n){switch(n){case"enum":{let i=new Set(e.enum||[]);for(let s of r.enum||[])i.add(s);e.enum=[...i];break}case"pattern":{r.pattern&&r.pattern!==e.pattern&&(e.pattern=`(?:${e.pattern})|(?:${r.pattern})`);break}case"range":{r.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.min(e.minimum,r.minimum):r.minimum),r.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.max(e.maximum,r.maximum):r.maximum),r.exclusiveMinimum&&(e.exclusiveMinimum=!0),r.exclusiveMaximum&&(e.exclusiveMaximum=!0),r.multipleOf!==void 0&&(e.multipleOf=e.multipleOf!==void 0?Math.min(e.multipleOf,r.multipleOf):r.multipleOf);break}case"length":{r.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.min(e.minLength,r.minLength):r.minLength),r.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.max(e.maxLength,r.maxLength):r.maxLength);break}case"array":{r.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.min(e.minItems,r.minItems):r.minItems),r.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.max(e.maxItems,r.maxItems):r.maxItems),r.uniqueItems&&(e.uniqueItems=!0);break}case"format":{if(r.format&&r.format!==e.format){let i={type:e.type||"string",format:e.format},s={type:r.type||"string",format:r.format};delete e.format,e.oneOf=[i,s]}break}case"oneOf":{if(r.oneOf)for(let i of r.oneOf)e.oneOf.some(s=>JSON.stringify(s)===JSON.stringify(i))||e.oneOf.push(i);break}}}buildVariantSchema(e){let r={};return e.type&&(r.type=e.type),e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}stripConstraints(e){delete e.enum,delete e.pattern,delete e.format,delete e.minimum,delete e.maximum,delete e.exclusiveMinimum,delete e.exclusiveMaximum,delete e.multipleOf,delete e.minLength,delete e.maxLength,delete e.minItems,delete e.maxItems,delete e.uniqueItems,delete e.nullable}extractConstraints(e){let r={};return e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}widenType(e,r){!r.type||r.type===e.type||(e.type?(e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer")&&(e.type="number"):e.type=r.type)}normalizeUrl(e){let r=e,n=null,i=r.match(/^\{\{(\w+)\}\}/);return i&&(n=i[1],r=r.slice(i[0].length)),r=r.replace(/:([a-zA-Z_]\w*)/g,"{$1}"),r=r.replace(/\{\{(\w+)\}\}/g,"{$1}"),r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1)),r=r.replace(/\/\//g,"/"),{path:r,hostVar:n}}generateOperationId(e,r,n,i){let s=this.toCamelCase(e.name),a=this.collectOperationIds(i);if(a.has(s)&&(s=`${s}${r.charAt(0).toUpperCase()}${r.slice(1)}`),!s||a.has(s)){let u=n.split("/").filter(f=>f&&!f.startsWith("{"));s=r+u.map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")}return s}collectOperationIds(e){let r=new Set;if(e.paths)for(let n of Object.values(e.paths))for(let i of Object.values(n))i.operationId&&r.add(i.operationId);return r}toCamelCase(e){return e.replace(/[^a-zA-Z0-9]+(.)/g,(r,n)=>n.toUpperCase()).replace(/^[A-Z]/,r=>r.toLowerCase()).replace(/[^a-zA-Z0-9]/g,"")}buildParameters(e){let r=[];if(e.params)for(let[n,i]of Object.entries(e.params)){let s={name:n,in:"path",required:!0};if(typeof i=="string")s.schema={type:this.inferTypeFromValue(i)},s.example=this.coerceExample(i,s.schema.type);else{let a=i;a.oneOf?(s.schema={oneOf:a.oneOf},a.type&&(s.schema.type=a.type)):(s.schema={type:a.type||this.inferTypeFromValue(a.value)},a.format&&(s.schema.format=a.format),a.enum&&(s.schema.enum=a.enum),a.pattern&&(s.schema.pattern=a.pattern),a.minimum!==void 0&&(s.schema.minimum=a.minimum),a.maximum!==void 0&&(s.schema.maximum=a.maximum),a.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=a.exclusiveMinimum),a.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=a.exclusiveMaximum),a.multipleOf!==void 0&&(s.schema.multipleOf=a.multipleOf),a.minLength!==void 0&&(s.schema.minLength=a.minLength),a.maxLength!==void 0&&(s.schema.maxLength=a.maxLength),a.minItems!==void 0&&(s.schema.minItems=a.minItems),a.maxItems!==void 0&&(s.schema.maxItems=a.maxItems),a.uniqueItems&&(s.schema.uniqueItems=!0),a.nullable&&(s.schema.nullable=!0)),a.description&&(s.description=a.description),a.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(a.value,s.schema.type||"string")}r.push(s)}if(e.query)for(let n of e.query){if(!n.key)continue;let i=this.buildKeyValueParam(n,"query");r.push(i)}if(e.headers){let n=e.headers.find(i=>i.key.toLowerCase()==="cookie");if(n){let i=this.parseCookieHeader(n.value);r.push(...i)}for(let i of e.headers){if(!i.key||MY.has(i.key.toLowerCase()))continue;let s=this.buildKeyValueParam(i,"header");r.push(s)}}return r}buildKeyValueParam(e,r){let n={name:e.key,in:r,schema:{}};return e.oneOf?(n.schema.oneOf=e.oneOf,e.type&&(n.schema.type=e.type)):(n.schema.type=e.type||"string",e.format&&(n.schema.format=e.format),e.enum&&(n.schema.enum=e.enum),e.pattern&&(n.schema.pattern=e.pattern),e.minimum!==void 0&&(n.schema.minimum=e.minimum),e.maximum!==void 0&&(n.schema.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(n.schema.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(n.schema.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(n.schema.multipleOf=e.multipleOf),e.minLength!==void 0&&(n.schema.minLength=e.minLength),e.maxLength!==void 0&&(n.schema.maxLength=e.maxLength),e.minItems!==void 0&&(n.schema.minItems=e.minItems),e.maxItems!==void 0&&(n.schema.maxItems=e.maxItems),e.uniqueItems&&(n.schema.uniqueItems=!0),e.nullable&&(n.schema.nullable=!0)),e.required&&(n.required=!0),e.description&&(n.description=e.description),e.deprecated&&(n.deprecated=!0),e.value&&(n.example=this.coerceExample(e.value,n.schema.type||"string")),n}parseCookieHeader(e){let r=[],n=e.split(";").map(i=>i.trim()).filter(Boolean);for(let i of n){let s=i.indexOf("=");if(s>0){let a=i.substring(0,s).trim(),u=i.substring(s+1).trim();r.push({name:a,in:"cookie",schema:{type:"string"},example:u})}}return r}inferTypeFromValue(e){return/^-?\d+$/.test(e)?"integer":/^-?\d+\.\d+$/.test(e)?"number":e==="true"||e==="false"?"boolean":"string"}coerceExample(e,r){let n=this.sanitizeEnvVar(e);switch(r){case"integer":return parseInt(n,10)||n;case"number":return parseFloat(n)||n;case"boolean":return n==="true";default:return n}}sanitizeEnvVar(e){return e.replace(/\{\{(\w+)\}\}/g,"<$1>")}sanitizeObjectExamples(e){if(typeof e=="string")return this.sanitizeEnvVar(e);if(Array.isArray(e))return e.map(r=>this.sanitizeObjectExamples(r));if(e!==null&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeObjectExamples(i);return r}return e}async buildRequestBody(e,r){if(!e.body||e.body.type==="none")return null;let n=e.body,i={required:!0,content:{}},s,a,u,f;if(e.bodySchema){if(e.bodySchema.content){for(let[m,S]of Object.entries(e.bodySchema.content)){let _={};S.schema&&(_.schema=S.schema),S.examples&&(_.examples=S.examples),S.encoding&&(_.encoding=S.encoding),i.content[m]=_}let g=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(g&&n.content){let m=this.tryParseBodyContent(n);m!==void 0&&i.content[g]&&(i.content[g].example=m)}return i}s=e.bodySchema.contentType||this.getContentType(n),a=e.bodySchema.schema,e.bodySchema.components,u=this.tryParseBodyContent(n),e.bodySchema.encoding&&(f=e.bodySchema.encoding)}else switch(s=this.getContentType(n),n.type){case"raw":{if(n.format==="json"&&n.content){let g=this.tryParseBodyContent(n);g!==void 0?(a=this.inferrer.inferFromValue(g),u=g):a={type:"string"}}else a={type:"string"},u=typeof n.content=="string"?n.content:void 0;break}case"form-data":{a=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{a=this.buildFormDataSchemaFromBody(n);break}case"binary":{a={type:"string",format:"binary"};break}case"graphql":{a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},u=this.tryParseBodyContent(n);break}default:return null}let h={};return a&&(h.schema=a),u!==void 0&&(h.example=u),f&&(h.encoding=f),i.content[s]=h,i}getContentType(e){if(!e)return"application/json";switch(e.type){case"raw":switch(e.format){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"text":return"text/plain";default:return"text/plain"}case"form-data":return"multipart/form-data";case"x-www-form-urlencoded":return"application/x-www-form-urlencoded";case"binary":return"application/octet-stream";case"graphql":return"application/json";default:return"application/json"}}tryParseBodyContent(e){if(!e||!e.content)return;let r;if(typeof e.content=="string")try{r=JSON.parse(e.content)}catch{r=e.content}else r=e.content;return this.sanitizeObjectExamples(r)}buildFormDataSchemaFromBody(e){let r={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?r.properties[i.key]={type:"string",format:"binary"}:r.properties[i.key]={type:"string"});return r}async buildResponses(e,r,n){let i={};if(e.responseSchema)for(let[s,a]of Object.entries(e.responseSchema.responses)){let u={description:a.description||`Status ${s}`};if(a.content){u.content={};for(let[f,h]of Object.entries(a.content)){let g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),u.content[f]=g}}else if(a.schema){let f=a.contentType||"application/json",h={schema:a.schema};a.examples&&(h.examples=a.examples),u.content={[f]:h}}if(a.headers){u.headers={};for(let[f,h]of Object.entries(a.headers))u.headers[f]={...h.description&&{description:h.description},schema:h.schema}}i[s]=u}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}buildOperationSecurity(e,r,n){if(!e.auth||e.auth.type==="inherit")return;if(e.auth.type==="none")return[];let i=this.mapAuthToSecurityScheme(e.auth);if(!i)return;let{schemeName:s,scheme:a,requirement:u}=i;return n.set(s,a),[u]}mapAuthToSecurityScheme(e){switch(e.type){case"bearer":return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}};case"basic":return{schemeName:"BasicAuth",scheme:{type:"http",scheme:"basic"},requirement:{BasicAuth:[]}};case"apikey":{let r=e.apikey||{key:"X-Api-Key",value:"",in:"header"},n=`ApiKey_${r.key||"key"}`;return{schemeName:n,scheme:{type:"apiKey",in:r.in||"header",name:r.key||"X-Api-Key"},requirement:{[n]:[]}}}case"oauth2":{let r=e.oauth2;if(!r)return;let n={};switch(r.grantType){case"client_credentials":n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"authorization_code":n.authorizationCode={authorizationUrl:r.authUrl||"",tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"password":n.password={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"implicit":n.implicit={authorizationUrl:r.authUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;default:n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:{}}}return{schemeName:"OAuth2",scheme:{type:"oauth2",flows:n},requirement:{OAuth2:[]}}}default:return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}}}}parseScopes(e){let r={};for(let n of e.split(/\s+/))n&&(r[n]="");return r}deduplicateComponents(e){let r=new Map,n=new Map;if(e.paths)for(let[i,s]of Object.entries(e.paths))for(let[a,u]of Object.entries(s)){let f=u;if(f.responses){for(let[h,g]of Object.entries(f.responses))if(g.content)for(let m of Object.values(g.content))m.schema&&this.trackSchema(m.schema,`${a}${i}Response${h}`,r,n)}if(f.requestBody?.content)for(let h of Object.values(f.requestBody.content))h.schema&&this.trackSchema(h.schema,`${a}${i}Request`,r,n)}for(let[i,s]of r)if((n.get(i)||0)>=2){let u=this.sanitizeComponentName(s.name);e.components.schemas[u]=s.schema,this.replaceInlineSchema(e,s.schema,`#/components/schemas/${u}`)}}trackSchema(e,r,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:r,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,r,n){let i=JSON.stringify(r);if(e.paths)for(let s of Object.values(e.paths))for(let a of Object.values(s)){if(a.responses){for(let u of Object.values(a.responses))if(u.content)for(let f of Object.values(u.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(a.requestBody?.content)for(let u of Object.values(a.requestBody.content))u.schema&&JSON.stringify(u.schema)===i&&(u.schema={$ref:n})}}sanitizeComponentName(e){return e.replace(/[^a-zA-Z0-9._-]/g,"").replace(/^[^a-zA-Z]/,"Schema")}cleanSummary(e){return e.replace(/^\[DEPRECATED\]\s*/i,"")}hasDeprecatedPrefix(e){return/^\[DEPRECATED\]/i.test(e)}augmentServersFromHostVars(e,r,n){if(e.size===0)return;let i=new Set(r.map(a=>a.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(a=>!!a);for(let a of e){let u=`{{${a}}}`,f=!1;for(let h of s){let g=this.envConfigService.resolveVariables(u,h);g&&g!==u&&!i.has(g)&&(r.push({url:g,description:h}),i.add(g),f=!0)}if(!f){let h=`{${a}}`;i.has(h)||(r.push({url:h,variables:{[a]:{default:""}}}),i.add(h))}}}};var Zk=tv(K0());import*as Qk from"fs";var Dl=class{generate(e,r){if(!e)return;let n=r||{};if(e.$ref){let i=this.resolveLocalRef(e.$ref,n.components);return i?this.generate(i,n):{}}if(e.nullable&&!e.type)return null;if(e.enum&&e.enum.length>0)return e.enum[0];if(e.default!==void 0)return e.default;if(e.example!==void 0)return e.example;if(e.allOf)return this.generateFromAllOf(e.allOf,e.discriminator,n);if(e.oneOf)return this.generateFromOneOfAnyOf(e.oneOf,e.discriminator,n);if(e.anyOf)return this.generateFromOneOfAnyOf(e.anyOf,e.discriminator,n);switch(e.type){case"string":return this.generateString(e);case"integer":return this.generateInteger(e);case"number":return this.generateNumber(e);case"boolean":return!1;case"array":return this.generateArray(e,n);case"object":return this.generateObject(e,n);default:return e.properties?this.generateObject(e,n):{}}}generateString(e){switch(e.format){case"email":return"user@example.com";case"date-time":return"2026-01-01T00:00:00Z";case"date":return"2026-01-01";case"time":return"00:00:00";case"uri":case"url":return"https://example.com";case"uuid":return"00000000-0000-0000-0000-000000000000";case"ipv4":return"127.0.0.1";case"ipv6":return"::1";case"hostname":return"example.com";case"binary":return"";case"byte":return"c3RyaW5n";case"password":return"********";default:return"string"}}generateInteger(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+1:0}generateNumber(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+.1:0}generateArray(e,r){return e.items?[this.generate(e.items,r)]:[]}generateObject(e,r){let n={},i=e.properties||{};for(let[s,a]of Object.entries(i))r.omitReadOnly&&a.readOnly||(n[s]=this.generate(a,r));return n}generateFromAllOf(e,r,n){let i={type:"object",properties:{},required:[]};for(let a of e){let u=a.$ref?this.resolveLocalRef(a.$ref,n.components)||{}:a;u.properties&&Object.assign(i.properties,u.properties),u.required&&(i.required=[...i.required||[],...u.required])}let s=this.generateObject(i,n);return r?.propertyName&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}generateFromOneOfAnyOf(e,r,n){if(e.length===0)return{};let i=e[0].$ref&&this.resolveLocalRef(e[0].$ref,n.components)||e[0],s=this.generate(i,n);return r?.propertyName&&typeof s=="object"&&s!==null&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}guessDiscriminatorValue(e,r){if(e.length===0)return"unknown";let n=e[0];if(n.$ref){let i=n.$ref.split("/");return i[i.length-1]}return"variant1"}resolveLocalRef(e,r){if(!e||!r)return;let n=e.match(/^#\/components\/(?:schemas\/)?(.+)$/);if(n)return r[n[1]];let i=e.match(/^#\/components\/(.+)$/);if(i)return r[i[1]]}};var Mm=tv(Gk()),Zl=class{async resolve(e){try{return await Mm.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",r),e}}async bundle(e){try{return await Mm.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await Mm.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}};var _4=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Xl=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new Dl,this.refResolver=new Zl}exampleGenerator;refResolver;async import(e,r){let n=await Qk.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=Zk.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},a=r?.collectionName||i.info?.title||"Imported API",f={id:it(a),name:a,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(f.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let m=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);m&&(f.auth=m)}let h=new Map;if(i.tags)for(let m of i.tags){let S={type:"folder",id:it(m.name),name:m.name,description:m.description,items:[]};h.set(m.name,S),f.items.push(S)}if(i.paths)for(let[m,S]of Object.entries(i.paths))for(let _ of["get","post","put","patch","delete","head","options","trace"]){let C=S[_];if(!C)continue;let x=this.processOperation(_,m,C,S,i,s),A=C.tags?.[0];if(A&&h.has(A))h.get(A).items.push(x);else if(A){let T={type:"folder",id:it(A),name:A,items:[x]};h.set(A,T),f.items.push(T)}else f.items.push(x)}await this.collectionService.saveCollection(f);let g;return r?.environmentName&&i.servers&&(g=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:g}}processOperation(e,r,n,i,s,a){let u=it(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,h=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,g=n.deprecated===!0;g&&(h=`[DEPRECATED] ${h}`);let m={type:"request",id:u,name:h,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:g},S=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(m,S,a),n.requestBody&&this.processRequestBody(m,n.requestBody,a),n.responses&&(m.responseSchema=this.processResponses(n.responses,a)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)m.auth={type:"none"};else if(n.security&&n.security.length>0){let _=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);_&&(m.auth=_)}}return m}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],a={},u=[];for(let f of r){let h=f.name,g=f.in,m=f.schema||{},S=f.example!==void 0?String(f.example):this.generateExampleForParam(m,n),_=f.deprecated===!0;switch(g){case"path":{if(f.description||m.type||m.format||m.enum||_||m.pattern||m.minimum!==void 0||m.maximum!==void 0||m.minLength!==void 0||m.maxLength!==void 0||m.multipleOf!==void 0||m.minItems!==void 0||m.maxItems!==void 0||m.uniqueItems||m.nullable||m.oneOf){let x={value:S};m.oneOf?(x.oneOf=m.oneOf,this.applyOneOfHints(x,m.oneOf)):(m.type&&(x.type=m.type),m.format&&(x.format=m.format),m.enum&&(x.enum=m.enum.map(String)),m.pattern&&(x.pattern=m.pattern),m.minimum!==void 0&&(x.minimum=m.minimum),m.maximum!==void 0&&(x.maximum=m.maximum),m.exclusiveMinimum!==void 0&&(x.exclusiveMinimum=m.exclusiveMinimum),m.exclusiveMaximum!==void 0&&(x.exclusiveMaximum=m.exclusiveMaximum),m.multipleOf!==void 0&&(x.multipleOf=m.multipleOf),m.minLength!==void 0&&(x.minLength=m.minLength),m.maxLength!==void 0&&(x.maxLength=m.maxLength),m.minItems!==void 0&&(x.minItems=m.minItems),m.maxItems!==void 0&&(x.maxItems=m.maxItems),m.uniqueItems&&(x.uniqueItems=!0),m.nullable&&(x.nullable=!0)),f.description&&(x.description=f.description),_&&(x.deprecated=!0),a[h]=x}else a[h]=S;break}case"query":{let C={key:h,value:S};this.applySchemaConstraints(C,m,f,_),s.push(C);break}case"header":{let C={key:h,value:S};this.applySchemaConstraints(C,m,f,_),i.push(C);break}case"cookie":{u.push(`${h}={{${h}}}`);break}}}u.length>0&&i.push({key:"Cookie",value:u.join("; ")}),Object.keys(a).length>0&&(e.params=a),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,r,n,i){r.oneOf?(e.oneOf=r.oneOf,this.applyOneOfHints(e,r.oneOf)):(r.type&&(e.type=r.type),r.format&&(e.format=r.format),r.enum&&(e.enum=r.enum.map(String)),r.pattern&&(e.pattern=r.pattern),r.minimum!==void 0&&(e.minimum=r.minimum),r.maximum!==void 0&&(e.maximum=r.maximum),r.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=r.exclusiveMinimum),r.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=r.exclusiveMaximum),r.multipleOf!==void 0&&(e.multipleOf=r.multipleOf),r.minLength!==void 0&&(e.minLength=r.minLength),r.maxLength!==void 0&&(e.maxLength=r.maxLength),r.minItems!==void 0&&(e.minItems=r.minItems),r.maxItems!==void 0&&(e.maxItems=r.maxItems),r.uniqueItems&&(e.uniqueItems=!0),r.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,r){let n=[],i=new Set;for(let s of r)s.type&&i.add(s.type),s.enum&&n.push(...s.enum.map(String));i.size===1&&(e.type=[...i][0]),n.length>0&&(e.enum=[...new Set(n)])}generateExampleForParam(e,r){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:r});return n==null?"":String(n)}processRequestBody(e,r,n){if(!r.content)return;let i=Object.keys(r.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),a=r.content[s],{bodyType:u,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:u,...f&&{format:f},content:""},a){let g=this.generateBodyContent(a,s,n);g!==void 0&&(e.body.content=typeof g=="string"?g:JSON.stringify(g,null,2)),u==="form-data"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n)),u==="x-www-form-urlencoded"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n))}let h=this.buildBodySchema(r,s,n);h&&(e.bodySchema=h)}selectPrimaryContentType(e){for(let i of _4)if(e.includes(i))return i;let r=e.find(i=>i.includes("json"));if(r)return r;let n=e.find(i=>i.startsWith("text/"));return n||e[0]}mapContentTypeToBodyType(e){return e.includes("json")?{bodyType:"raw",bodyFormat:"json"}:e==="application/xml"||e==="text/xml"?{bodyType:"raw",bodyFormat:"xml"}:e==="text/html"?{bodyType:"raw",bodyFormat:"html"}:e.startsWith("text/")?{bodyType:"raw",bodyFormat:"text"}:e==="multipart/form-data"?{bodyType:"form-data"}:e==="application/x-www-form-urlencoded"?{bodyType:"x-www-form-urlencoded"}:e==="application/octet-stream"?{bodyType:"binary"}:{bodyType:"raw",bodyFormat:"text"}}generateBodyContent(e,r,n){if(e.example!==void 0)return e.example;if(e.examples){let i=Object.values(e.examples)[0];if(i?.value!==void 0)return i.value}if(e.schema)return this.exampleGenerator.generate(e.schema,{omitReadOnly:!0,components:n})}buildFormDataEntries(e,r){let n=[],i=e.properties||{},s=new Set(e.required||[]);for(let[a,u]of Object.entries(i)){let f=u,h=f.type==="string"&&f.format==="binary",g={key:a,value:h?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:h?"file":"text",enabled:!0};n.push(g)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let a={contentType:r,schema:s.schema};if(i.length>1){a.content={};for(let f of i){let h=e.content[f],g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),h.encoding&&(g.encoding=h.encoding),a.content[f]=g}}s.encoding&&(a.encoding=s.encoding);let u=this.extractUsedComponents(s.schema,n);return Object.keys(u).length>0&&(a.components=u),a}processResponses(e,r){let n={responses:{}},i={};for(let[s,a]of Object.entries(e)){let u=a,f={description:u.description||`Status ${s}`};if(u.content){let h=Object.keys(u.content);if(h.length===1){let g=h[0],m=u.content[g];f.contentType=g,m.schema&&(f.schema=m.schema),m.examples&&(f.examples=m.examples),m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}else{f.content={};for(let g of h){let m=u.content[g],S={};m.schema&&(S.schema=m.schema),m.examples&&(S.examples=m.examples),f.content[g]=S,m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}}}if(u.headers){f.headers={};for(let[h,g]of Object.entries(u.headers)){let m=g;f.headers[h]={...m.description&&{description:m.description},schema:m.schema||{type:"string"}}}}n.responses[s]=f}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,r){let n=Object.keys(e)[0];if(!n)return;let i=r[n];if(i)switch(i.type){case"http":if(i.scheme==="bearer")return{type:"bearer",bearerToken:""};if(i.scheme==="basic")return{type:"basic",basicAuth:{username:"",password:""}};break;case"apiKey":return{type:"apikey",apikey:{key:i.name||"X-Api-Key",value:"",in:i.in||"header"}};case"oauth2":{let s=i.flows||{},a=s.authorizationCode||s.clientCredentials||s.password||s.implicit||{},u="client_credentials";return s.authorizationCode?u="authorization_code":s.password?u="password":s.implicit&&(u="implicit"),{type:"oauth2",oauth2:{grantType:u,tokenUrl:a.tokenUrl||"",authUrl:a.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(a.scopes||{}).join(" ")}}}}}async createEnvironmentFromServers(e,r){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return r}extractUsedComponents(e,r,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&r[s]&&!i[s]&&(i[s]=r[s],this.extractUsedComponents(r[s],r,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,r,i);e.items&&this.extractUsedComponents(e.items,r,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let a of e[s])this.extractUsedComponents(a,r,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,r,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}};var eu=class{constructor(e,r,n){this.historyAnalyzer=e;this.scriptAnalyzer=r;this.inferrer=n}async infer(e,r,n,i){let s=await this.historyAnalyzer.analyze(e,r,{environment:i?.environment}),a;return i?.postResponseScript&&(a=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,a)}async inferBodySchema(e,r,n,i,s){let a,u;if(r==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}a=this.inferrer.inferFromValue(f),u="application/json"}else r==="form-data"&&i?(a=this.buildFormDataSchema(i),u="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(a=this.buildFormDataSchema(i),u="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(a={type:"string"},u="application/xml"):r==="raw"&&(n==="text"||n==="html")?(a={type:"string"},u=n==="html"?"text/html":"text/plain"):r==="binary"?(a={type:"string",format:"binary"},u="application/octet-stream"):r==="graphql"&&(a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},u="application/json");if(a)return s?this.mergeBodySchemaWithExisting(a,s):{contentType:u,schema:a}}buildFormDataSchema(e){let r={type:"object",properties:{}},n=[];for(let i of e){if(!i.enabled&&i.enabled!==void 0)continue;let s={};i.type?s.type=i.type:s.type="string",i.description&&(s.description=i.description),i.format&&(s.format=i.format),i.enum&&(s.enum=i.enum),i.type==="file"&&(s.type="string",s.format="binary"),r.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(r.required=n),r}mergeResponseSchemas(e,r,n){let i={responses:{}};for(let[s,a]of Object.entries(r.responses))i.responses[s]={...a};if(n&&this.applyScriptHints(i,n),e){for(let[s,a]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],a):i.responses[s]={...a};e.components&&(i.components={...e.components})}return i}applyScriptHints(e,r){for(let n of r.expectedStatuses){let i=String(n);e.responses[i]||(e.responses[i]={description:`Status ${n}`})}for(let[,n]of Object.entries(e.responses))n.schema&&this.augmentSchemaWithHints(n.schema,r)}augmentSchemaWithHints(e,r){if(!(e.type!=="object"||!e.properties))for(let n of r.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,r)}}ensureFieldPath(e,r,n,i=""){if(r.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=r[0],a=s.endsWith("[]"),u=a?s.slice(0,-2):s,f=i?`${i}.${s}`:s,h=r.slice(1);if(!e.properties[u])if(a)e.properties[u]={type:"array",items:{type:"object"}};else if(h.length>0)e.properties[u]={type:"object",properties:{}};else{let g=n.typeHints[f];e.properties[u]={type:g||"string"};return}if(h.length>0){let g=a?e.properties[u].items:e.properties[u];g&&this.ensureFieldPath(g,h,n,f)}}mergeResponseDefinitions(e,r){let n={...e};return r.description&&(n.description=r.description),r.contentType&&(n.contentType=r.contentType),r.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,r.schema):r.schema&&(n.schema=r.schema),r.examples&&(n.examples={...e.examples||{},...r.examples}),r.content&&(n.content={...e.content||{},...r.content}),r.headers&&(n.headers={...e.headers||{},...r.headers}),n}mergeBodySchemaWithExisting(e,r){let n={...r};return r.schema?n.schema=this.inferrer.mergeSchemas(e,r.schema):n.schema=e,n}};var Xk=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,eA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(?:a|an)\(['"](\w+)['"]\)/g,tA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.(?:equal|eql)\((.+?)\)/g,rA=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,nA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(true|false)/g,iA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.have\.(?:lengthOf|length\.above|length\.below)/g,tu=class{analyze(e){let r={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return r;let n=this.stripComments(e);return this.extractFieldPaths(n,r),this.extractTypeAssertions(n,r),this.extractEqualityAssertions(n,r),this.extractBooleanAssertions(n,r),this.extractLengthAssertions(n,r),this.extractStatusAssertions(n,r),r.fieldPaths=[...new Set(r.fieldPaths)],r.expectedStatuses=[...new Set(r.expectedStatuses)],r}stripComments(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,"");return r=r.replace(/\/\/.*$/gm,""),r}extractFieldPaths(e,r){let n,i=new RegExp(Xk.source,Xk.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&r.fieldPaths.push(s)}}extractTypeAssertions(e,r){let n,i=new RegExp(eA.source,eA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(a),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(tA.source,tA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].trim();if(s){let u=this.parseAssertionValue(a);u!==void 0&&(r.valueHints[s]=u,typeof u=="string"?r.typeHints[s]=r.typeHints[s]||"string":typeof u=="number"?r.typeHints[s]=r.typeHints[s]||(Number.isInteger(u)?"integer":"number"):typeof u=="boolean"&&(r.typeHints[s]=r.typeHints[s]||"boolean")),r.fieldPaths.includes(s)||r.fieldPaths.push(s)}}}extractBooleanAssertions(e,r){let n,i=new RegExp(nA.source,nA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]="boolean",r.valueHints[s]=n[2]==="true",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractLengthAssertions(e,r){let n,i=new RegExp(iA.source,iA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]=r.typeHints[s]||"array",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractStatusAssertions(e,r){let n,i=new RegExp(rA.source,rA.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&r.expectedStatuses.push(s)}}normalizeFieldPath(e){let r=e.replace(/^\./,"");return r=r.replace(/\[\d+\]/g,"[]"),r}isCommonMethodCall(e){return new Set(["to","be","have","not","deep","any","all","that","is","has","include","includes","equal","eql","above","below","least","most","within","length","lengthOf","match","string","keys","key","property","ownProperty","status","header","json","text"]).has(e.split(".")[0])}mapAssertionType(e){return{string:"string",number:"number",object:"object",array:"array",boolean:"boolean",null:"null",undefined:"null",int:"integer",integer:"integer",float:"number",double:"number"}[e]||"string"}parseAssertionValue(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let r=Number(e);return!isNaN(r)&&e.trim().length>0?r:e==="true"?!0:e==="false"?!1:e==="null"?null:e}};var ne={Config:Symbol.for("IConfigService"),Console:Symbol.for("IConsoleService"),EnvironmentConfig:Symbol.for("IEnvironmentConfigService"),Collection:Symbol.for("ICollectionService"),HttpRequest:Symbol.for("IHttpRequestService"),HttpClient:Symbol.for("IHttpClient"),Cookie:Symbol.for("ICookieService"),RequestHistory:Symbol.for("IRequestHistoryService"),UrlBuilder:Symbol.for("IUrlBuilder"),RequestPreprocessor:Symbol.for("IRequestPreprocessor"),RequestPreparer:Symbol.for("IRequestPreparer"),InterceptorChain:Symbol.for("IInterceptorChain"),ScriptExecutor:Symbol.for("IScriptExecutor"),DataFileParser:Symbol.for("IDataFileParser"),CollectionRequestExecutor:Symbol.for("ICollectionRequestExecutor"),WorkspaceFolder:Symbol.for("WorkspaceFolder"),PersistentCookieJar:Symbol.for("PersistentCookieJar"),OAuth2TokenManager:Symbol.for("IOAuth2TokenManager"),GraphQLSchemaService:Symbol.for("IGraphQLSchemaService"),SchemaInferrer:Symbol.for("SchemaInferrer"),HistoryAnalyzer:Symbol.for("HistoryAnalyzer"),ScriptAnalyzer:Symbol.for("ScriptAnalyzer"),SchemaInferenceService:Symbol.for("SchemaInferenceService"),OpenApiExporter:Symbol.for("OpenApiExporter"),OpenApiImporter:Symbol.for("OpenApiImporter")};var w4={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}};function oA(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:a,secretStore:u,browserService:f,applicationInfo:h,consoleService:g}=e;t.registerValue(ne.WorkspaceFolder,r),t.registerSingleton(ne.Config,()=>new wl(r,n,i)),t.registerSingleton(ne.Console,()=>g??w4),t.registerSingleton(ne.EnvironmentConfig,S=>new Dc(r,s,S.resolve(ne.Config),n)),t.registerSingleton(ne.Cookie,()=>new $c(a)),t.registerSingleton(ne.Collection,S=>new qc(r,S.resolve(ne.Config),n)),t.registerSingleton(ne.HttpClient,()=>new Do),t.registerSingleton(ne.UrlBuilder,()=>new Dn),t.registerSingleton(ne.InterceptorChain,()=>new Yi),t.registerSingleton(ne.HttpRequest,S=>new Wi(S.resolve(ne.UrlBuilder),S.resolve(ne.InterceptorChain),S.resolve(ne.HttpClient))),t.registerSingleton(ne.RequestPreprocessor,()=>new zo),t.registerSingleton(ne.RequestHistory,S=>{let _=S.resolve(ne.EnvironmentConfig);return new Bc(_.getHistoriesPath(),sA.join(_.getRootPath(),"shared-histories"))}),u&&f&&t.registerSingleton(ne.OAuth2TokenManager,S=>new kc(u,f,S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest))),t.registerSingleton(ne.GraphQLSchemaService,S=>new jc(S.resolve(ne.HttpClient)));let m=h??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ne.RequestPreparer,S=>new Lc(S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest),S.resolve(ne.RequestPreprocessor),S.resolve(ne.OAuth2TokenManager),m)),t.registerSingleton(ne.ScriptExecutor,S=>{let _=S.resolve(ne.Config);return new Zi(S.resolve(ne.HttpRequest),_.getModulePaths())}),t.registerSingleton(ne.DataFileParser,()=>new Go),t.registerSingleton(ne.CollectionRequestExecutor,S=>new Fc(S.resolve(ne.HttpRequest),S.resolve(ne.ScriptExecutor),S.resolve(ne.EnvironmentConfig),S.resolve(ne.RequestPreparer),"")),t.registerSingleton(ne.PersistentCookieJar,S=>new Mc(S.resolve(ne.Cookie))),t.registerSingleton(ne.SchemaInferrer,()=>new to),t.registerSingleton(ne.HistoryAnalyzer,S=>new Cl(S.resolve(ne.RequestHistory),S.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.ScriptAnalyzer,()=>new tu),t.registerSingleton(ne.SchemaInferenceService,S=>new eu(S.resolve(ne.HistoryAnalyzer),S.resolve(ne.ScriptAnalyzer),S.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.OpenApiExporter,S=>new Nl(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig),S.resolve(ne.SchemaInferenceService))),t.registerSingleton(ne.OpenApiImporter,S=>new Xl(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig)))}var Nf=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}static reset(){t._instance&&t._instance.clear(),t._instance=void 0}registerValue(e,r){return this.primitives.set(e,r),this}registerSingleton(e,r){return this.services.set(e,{factory:r,singleton:!0}),this}registerTransient(e,r){return this.services.set(e,{factory:r,singleton:!1}),this}registerInstance(e,r){return this.services.set(e,{factory:()=>r,singleton:!0,instance:r}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let r=this.services.get(e);if(!r)throw new Error(`Service not registered: ${e.toString()}`);return r.singleton?(r.instance||(r.instance=r.factory(this)),r.instance):r.factory(this)}has(e){return this.services.has(e)||this.primitives.has(e)}clear(){this.services.clear(),this.primitives.clear()}get config(){return this.resolve(ne.Config)}get console(){return this.resolve(ne.Console)}get environmentConfig(){return this.resolve(ne.EnvironmentConfig)}get collection(){return this.resolve(ne.Collection)}get httpRequest(){return this.resolve(ne.HttpRequest)}get httpClient(){return this.resolve(ne.HttpClient)}get cookie(){return this.resolve(ne.Cookie)}get requestHistory(){return this.resolve(ne.RequestHistory)}get dataFileParser(){return this.resolve(ne.DataFileParser)}get scriptExecutor(){return this.resolve(ne.ScriptExecutor)}get requestPreparer(){return this.resolve(ne.RequestPreparer)}get persistentCookieJar(){return this.resolve(ne.PersistentCookieJar)}get oauth2TokenManager(){return this.resolve(ne.OAuth2TokenManager)}get graphqlSchemaService(){return this.resolve(ne.GraphQLSchemaService)}};function aA(){return Nf.instance}var uw=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())lt.isExpired(n)||(!n.domain||lt.domainMatches(e,n.domain))&&r.push(n);return r}has(e,r){return this.get(e,r)!==void 0}get(e,r){let n=this.getCookieKey(e,r),i=this.cookies.get(n);if(i&&!lt.isExpired(i))return i}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){if(e)return this.getCookiesForDomain(e);let r=[];for(let n of this.cookies.values())lt.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=lt.extractDomain(e),i=lt.parseCookieHeaders(r,n);for(let s of i){let a=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(a,s)}}getCookieHeader(e){let r=lt.extractDomain(e),n=lt.extractPath(e),s=this.getCookiesForDomain(r).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return lt.formatCookieHeader(s)}clear(){this.cookies.clear()}};function E4(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=T4(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(q4(a))return{contextType:"variable_def",fieldPath:[],prefix:s};let u=a.match(/\.\.\.\s+on\s+(\w*)$/);if(u)return{contextType:"fragment_type",fieldPath:[],prefix:u[1]||""};let f=a.match(/\(\s*(?:[\w]+\s*:\s*(?:"[^"]*"|[^,)]+)\s*,\s*)*(\w+)\s*:\s*(\w*)$/);if(f&&lA(a)){let m=cw(a,r),S=m.length>0?m[m.length-1]:void 0,_=uA(a);return{contextType:"argument_value",fieldPath:m,parentType:S,prefix:f[2]||"",currentArg:f[1],currentField:_||void 0}}if(lA(a)){let m=cw(a,r),S=m.length>0?m[m.length-1]:void 0,_=uA(a);return{contextType:"argument",fieldPath:m,parentType:S,prefix:s,currentField:_||void 0}}if(fw(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let g=cw(a,r);return{contextType:"selection_set",fieldPath:g,parentType:g.length>0?g[g.length-1]:void 0,prefix:s}}function C4(t,e){switch(e.contextType){case"root":return x4(t,e.prefix);case"selection_set":return R4(t,e);case"argument":return I4(t,e);case"argument_value":return O4(t,e);case"directive":return P4(t,e.prefix);case"fragment_type":return k4(t,e.prefix);case"variable_def":return A4(t,e.prefix);default:return[]}}function x4(t,e){let r=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
|
|
269
|
+
Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=new Set(e.tags||[]);for(let s of r.tags)i.add(s);e.tags=[...i]}if(r.parameters){e.parameters||(e.parameters=[]);for(let i of r.parameters){let s=e.parameters.find(a=>a.name===i.name&&a.in===i.in);s?this.mergeParameterSchema(s,i,n):e.parameters.push(i)}}if(r.responses){e.responses||(e.responses={});for(let[i,s]of Object.entries(r.responses))e.responses[i]||(e.responses[i]=s)}if(r.requestBody?.content&&e.requestBody?.content)for(let[i,s]of Object.entries(r.requestBody.content))e.requestBody.content[i]||(e.requestBody.content[i]=s);else r.requestBody&&!e.requestBody&&(e.requestBody=r.requestBody)}mergeParameterSchema(e,r,n){e.schema||(e.schema={});let i=e.schema,s=r.schema||{},a=this.getConstraintKind(i),u=this.getConstraintKind(s);if(a==="none"&&u==="none")this.widenType(i,s);else if(a==="none")Object.assign(i,this.extractConstraints(s)),this.widenType(i,s);else if(u==="none")this.widenType(i,s);else if(a===u)this.mergeSameKindConstraints(i,s,a),this.widenType(i,s);else{if(i.oneOf){let f=this.buildVariantSchema(s);i.oneOf.some(h=>JSON.stringify(h)===JSON.stringify(f))||i.oneOf.push(f)}else if(s.oneOf){let f=this.buildVariantSchema(i);i.oneOf=[f,...s.oneOf]}else{let f=this.buildVariantSchema(i),h=this.buildVariantSchema(s);i.oneOf=[f,h]}this.stripConstraints(i)}if(r.description&&r.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+r.description),r.example!==void 0&&r.example!==e.example){e.examples||(e.examples={},e.example!==void 0&&(e.examples.variant1={value:e.example}));let f=`variant_${n.replace(/[^a-zA-Z0-9_]/g,"_")}`;e.examples[f]={value:r.example},delete e.example}}getConstraintKind(e){return e.oneOf?"oneOf":e.enum&&e.enum.length>0?"enum":e.pattern?"pattern":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"range":e.minLength!==void 0||e.maxLength!==void 0?"length":e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.format?"format":"none"}mergeSameKindConstraints(e,r,n){switch(n){case"enum":{let i=new Set(e.enum||[]);for(let s of r.enum||[])i.add(s);e.enum=[...i];break}case"pattern":{r.pattern&&r.pattern!==e.pattern&&(e.pattern=`(?:${e.pattern})|(?:${r.pattern})`);break}case"range":{r.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.min(e.minimum,r.minimum):r.minimum),r.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.max(e.maximum,r.maximum):r.maximum),r.exclusiveMinimum&&(e.exclusiveMinimum=!0),r.exclusiveMaximum&&(e.exclusiveMaximum=!0),r.multipleOf!==void 0&&(e.multipleOf=e.multipleOf!==void 0?Math.min(e.multipleOf,r.multipleOf):r.multipleOf);break}case"length":{r.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.min(e.minLength,r.minLength):r.minLength),r.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.max(e.maxLength,r.maxLength):r.maxLength);break}case"array":{r.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.min(e.minItems,r.minItems):r.minItems),r.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.max(e.maxItems,r.maxItems):r.maxItems),r.uniqueItems&&(e.uniqueItems=!0);break}case"format":{if(r.format&&r.format!==e.format){let i={type:e.type||"string",format:e.format},s={type:r.type||"string",format:r.format};delete e.format,e.oneOf=[i,s]}break}case"oneOf":{if(r.oneOf)for(let i of r.oneOf)e.oneOf.some(s=>JSON.stringify(s)===JSON.stringify(i))||e.oneOf.push(i);break}}}buildVariantSchema(e){let r={};return e.type&&(r.type=e.type),e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}stripConstraints(e){delete e.enum,delete e.pattern,delete e.format,delete e.minimum,delete e.maximum,delete e.exclusiveMinimum,delete e.exclusiveMaximum,delete e.multipleOf,delete e.minLength,delete e.maxLength,delete e.minItems,delete e.maxItems,delete e.uniqueItems,delete e.nullable}extractConstraints(e){let r={};return e.enum&&(r.enum=[...e.enum]),e.pattern&&(r.pattern=e.pattern),e.format&&(r.format=e.format),e.minimum!==void 0&&(r.minimum=e.minimum),e.maximum!==void 0&&(r.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(r.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(r.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(r.multipleOf=e.multipleOf),e.minLength!==void 0&&(r.minLength=e.minLength),e.maxLength!==void 0&&(r.maxLength=e.maxLength),e.minItems!==void 0&&(r.minItems=e.minItems),e.maxItems!==void 0&&(r.maxItems=e.maxItems),e.uniqueItems&&(r.uniqueItems=!0),e.nullable&&(r.nullable=!0),r}widenType(e,r){!r.type||r.type===e.type||(e.type?(e.type==="integer"&&r.type==="number"||e.type==="number"&&r.type==="integer")&&(e.type="number"):e.type=r.type)}normalizeUrl(e){let r=e,n=null,i=r.match(/^\{\{(\w+)\}\}/);return i&&(n=i[1],r=r.slice(i[0].length)),r=r.replace(/:([a-zA-Z_]\w*)/g,"{$1}"),r=r.replace(/\{\{(\w+)\}\}/g,"{$1}"),r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1)),r=r.replace(/\/\//g,"/"),{path:r,hostVar:n}}generateOperationId(e,r,n,i){let s=this.toCamelCase(e.name),a=this.collectOperationIds(i);if(a.has(s)&&(s=`${s}${r.charAt(0).toUpperCase()}${r.slice(1)}`),!s||a.has(s)){let u=n.split("/").filter(f=>f&&!f.startsWith("{"));s=r+u.map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")}return s}collectOperationIds(e){let r=new Set;if(e.paths)for(let n of Object.values(e.paths))for(let i of Object.values(n))i.operationId&&r.add(i.operationId);return r}toCamelCase(e){return e.replace(/[^a-zA-Z0-9]+(.)/g,(r,n)=>n.toUpperCase()).replace(/^[A-Z]/,r=>r.toLowerCase()).replace(/[^a-zA-Z0-9]/g,"")}buildParameters(e){let r=[];if(e.params)for(let[n,i]of Object.entries(e.params)){let s={name:n,in:"path",required:!0};if(typeof i=="string")s.schema={type:this.inferTypeFromValue(i)},s.example=this.coerceExample(i,s.schema.type);else{let a=i;a.oneOf?(s.schema={oneOf:a.oneOf},a.type&&(s.schema.type=a.type)):(s.schema={type:a.type||this.inferTypeFromValue(a.value)},a.format&&(s.schema.format=a.format),a.enum&&(s.schema.enum=a.enum),a.pattern&&(s.schema.pattern=a.pattern),a.minimum!==void 0&&(s.schema.minimum=a.minimum),a.maximum!==void 0&&(s.schema.maximum=a.maximum),a.exclusiveMinimum!==void 0&&(s.schema.exclusiveMinimum=a.exclusiveMinimum),a.exclusiveMaximum!==void 0&&(s.schema.exclusiveMaximum=a.exclusiveMaximum),a.multipleOf!==void 0&&(s.schema.multipleOf=a.multipleOf),a.minLength!==void 0&&(s.schema.minLength=a.minLength),a.maxLength!==void 0&&(s.schema.maxLength=a.maxLength),a.minItems!==void 0&&(s.schema.minItems=a.minItems),a.maxItems!==void 0&&(s.schema.maxItems=a.maxItems),a.uniqueItems&&(s.schema.uniqueItems=!0),a.nullable&&(s.schema.nullable=!0)),a.description&&(s.description=a.description),a.deprecated&&(s.deprecated=!0),s.example=this.coerceExample(a.value,s.schema.type||"string")}r.push(s)}if(e.query)for(let n of e.query){if(!n.key)continue;let i=this.buildKeyValueParam(n,"query");r.push(i)}if(e.headers){let n=e.headers.find(i=>i.key.toLowerCase()==="cookie");if(n){let i=this.parseCookieHeader(n.value);r.push(...i)}for(let i of e.headers){if(!i.key||MY.has(i.key.toLowerCase()))continue;let s=this.buildKeyValueParam(i,"header");r.push(s)}}return r}buildKeyValueParam(e,r){let n={name:e.key,in:r,schema:{}};return e.oneOf?(n.schema.oneOf=e.oneOf,e.type&&(n.schema.type=e.type)):(n.schema.type=e.type||"string",e.format&&(n.schema.format=e.format),e.enum&&(n.schema.enum=e.enum),e.pattern&&(n.schema.pattern=e.pattern),e.minimum!==void 0&&(n.schema.minimum=e.minimum),e.maximum!==void 0&&(n.schema.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(n.schema.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(n.schema.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(n.schema.multipleOf=e.multipleOf),e.minLength!==void 0&&(n.schema.minLength=e.minLength),e.maxLength!==void 0&&(n.schema.maxLength=e.maxLength),e.minItems!==void 0&&(n.schema.minItems=e.minItems),e.maxItems!==void 0&&(n.schema.maxItems=e.maxItems),e.uniqueItems&&(n.schema.uniqueItems=!0),e.nullable&&(n.schema.nullable=!0)),e.required&&(n.required=!0),e.description&&(n.description=e.description),e.deprecated&&(n.deprecated=!0),e.value&&(n.example=this.coerceExample(e.value,n.schema.type||"string")),n}parseCookieHeader(e){let r=[],n=e.split(";").map(i=>i.trim()).filter(Boolean);for(let i of n){let s=i.indexOf("=");if(s>0){let a=i.substring(0,s).trim(),u=i.substring(s+1).trim();r.push({name:a,in:"cookie",schema:{type:"string"},example:u})}}return r}inferTypeFromValue(e){return/^-?\d+$/.test(e)?"integer":/^-?\d+\.\d+$/.test(e)?"number":e==="true"||e==="false"?"boolean":"string"}coerceExample(e,r){let n=this.sanitizeEnvVar(e);switch(r){case"integer":return parseInt(n,10)||n;case"number":return parseFloat(n)||n;case"boolean":return n==="true";default:return n}}sanitizeEnvVar(e){return e.replace(/\{\{(\w+)\}\}/g,"<$1>")}sanitizeObjectExamples(e){if(typeof e=="string")return this.sanitizeEnvVar(e);if(Array.isArray(e))return e.map(r=>this.sanitizeObjectExamples(r));if(e!==null&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))r[n]=this.sanitizeObjectExamples(i);return r}return e}async buildRequestBody(e,r){if(!e.body||e.body.type==="none")return null;let n=e.body,i={required:!0,content:{}},s,a,u,f;if(e.bodySchema){if(e.bodySchema.content){for(let[m,S]of Object.entries(e.bodySchema.content)){let _={};S.schema&&(_.schema=S.schema),S.examples&&(_.examples=S.examples),S.encoding&&(_.encoding=S.encoding),i.content[m]=_}let g=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(g&&n.content){let m=this.tryParseBodyContent(n);m!==void 0&&i.content[g]&&(i.content[g].example=m)}return i}s=e.bodySchema.contentType||this.getContentType(n),a=e.bodySchema.schema,e.bodySchema.components,u=this.tryParseBodyContent(n),e.bodySchema.encoding&&(f=e.bodySchema.encoding)}else switch(s=this.getContentType(n),n.type){case"raw":{if(n.format==="json"&&n.content){let g=this.tryParseBodyContent(n);g!==void 0?(a=this.inferrer.inferFromValue(g),u=g):a={type:"string"}}else a={type:"string"},u=typeof n.content=="string"?n.content:void 0;break}case"form-data":{a=this.buildFormDataSchemaFromBody(n);break}case"x-www-form-urlencoded":{a=this.buildFormDataSchemaFromBody(n);break}case"binary":{a={type:"string",format:"binary"};break}case"graphql":{a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},u=this.tryParseBodyContent(n);break}default:return null}let h={};return a&&(h.schema=a),u!==void 0&&(h.example=u),f&&(h.encoding=f),i.content[s]=h,i}getContentType(e){if(!e)return"application/json";switch(e.type){case"raw":switch(e.format){case"json":return"application/json";case"xml":return"application/xml";case"html":return"text/html";case"text":return"text/plain";default:return"text/plain"}case"form-data":return"multipart/form-data";case"x-www-form-urlencoded":return"application/x-www-form-urlencoded";case"binary":return"application/octet-stream";case"graphql":return"application/json";default:return"application/json"}}tryParseBodyContent(e){if(!e||!e.content)return;let r;if(typeof e.content=="string")try{r=JSON.parse(e.content)}catch{r=e.content}else r=e.content;return this.sanitizeObjectExamples(r)}buildFormDataSchemaFromBody(e){let r={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?r.properties[i.key]={type:"string",format:"binary"}:r.properties[i.key]={type:"string"});return r}async buildResponses(e,r,n){let i={};if(e.responseSchema)for(let[s,a]of Object.entries(e.responseSchema.responses)){let u={description:a.description||`Status ${s}`};if(a.content){u.content={};for(let[f,h]of Object.entries(a.content)){let g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),u.content[f]=g}}else if(a.schema){let f=a.contentType||"application/json",h={schema:a.schema};a.examples&&(h.examples=a.examples),u.content={[f]:h}}if(a.headers){u.headers={};for(let[f,h]of Object.entries(a.headers))u.headers[f]={...h.description&&{description:h.description},schema:h.schema}}i[s]=u}return Object.keys(i).length===0&&(i[200]={description:"Successful response"}),i}buildOperationSecurity(e,r,n){if(!e.auth||e.auth.type==="inherit")return;if(e.auth.type==="none")return[];let i=this.mapAuthToSecurityScheme(e.auth);if(!i)return;let{schemeName:s,scheme:a,requirement:u}=i;return n.set(s,a),[u]}mapAuthToSecurityScheme(e){switch(e.type){case"bearer":return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}};case"basic":return{schemeName:"BasicAuth",scheme:{type:"http",scheme:"basic"},requirement:{BasicAuth:[]}};case"apikey":{let r=e.apikey||{key:"X-Api-Key",value:"",in:"header"},n=`ApiKey_${r.key||"key"}`;return{schemeName:n,scheme:{type:"apiKey",in:r.in||"header",name:r.key||"X-Api-Key"},requirement:{[n]:[]}}}case"oauth2":{let r=e.oauth2;if(!r)return;let n={};switch(r.grantType){case"client_credentials":n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"authorization_code":n.authorizationCode={authorizationUrl:r.authUrl||"",tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"password":n.password={tokenUrl:r.tokenUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;case"implicit":n.implicit={authorizationUrl:r.authUrl||"",scopes:r.scope?this.parseScopes(r.scope):{}};break;default:n.clientCredentials={tokenUrl:r.tokenUrl||"",scopes:{}}}return{schemeName:"OAuth2",scheme:{type:"oauth2",flows:n},requirement:{OAuth2:[]}}}default:return{schemeName:"BearerAuth",scheme:{type:"http",scheme:"bearer"},requirement:{BearerAuth:[]}}}}parseScopes(e){let r={};for(let n of e.split(/\s+/))n&&(r[n]="");return r}deduplicateComponents(e){let r=new Map,n=new Map;if(e.paths)for(let[i,s]of Object.entries(e.paths))for(let[a,u]of Object.entries(s)){let f=u;if(f.responses){for(let[h,g]of Object.entries(f.responses))if(g.content)for(let m of Object.values(g.content))m.schema&&this.trackSchema(m.schema,`${a}${i}Response${h}`,r,n)}if(f.requestBody?.content)for(let h of Object.values(f.requestBody.content))h.schema&&this.trackSchema(h.schema,`${a}${i}Request`,r,n)}for(let[i,s]of r)if((n.get(i)||0)>=2){let u=this.sanitizeComponentName(s.name);e.components.schemas[u]=s.schema,this.replaceInlineSchema(e,s.schema,`#/components/schemas/${u}`)}}trackSchema(e,r,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:r,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,r,n){let i=JSON.stringify(r);if(e.paths)for(let s of Object.values(e.paths))for(let a of Object.values(s)){if(a.responses){for(let u of Object.values(a.responses))if(u.content)for(let f of Object.values(u.content))f.schema&&JSON.stringify(f.schema)===i&&(f.schema={$ref:n})}if(a.requestBody?.content)for(let u of Object.values(a.requestBody.content))u.schema&&JSON.stringify(u.schema)===i&&(u.schema={$ref:n})}}sanitizeComponentName(e){return e.replace(/[^a-zA-Z0-9._-]/g,"").replace(/^[^a-zA-Z]/,"Schema")}cleanSummary(e){return e.replace(/^\[DEPRECATED\]\s*/i,"")}hasDeprecatedPrefix(e){return/^\[DEPRECATED\]/i.test(e)}augmentServersFromHostVars(e,r,n){if(e.size===0)return;let i=new Set(r.map(a=>a.url)),s=n.environments?.length?n.environments:[this.envConfigService.getSelectedEnvironment()].filter(a=>!!a);for(let a of e){let u=`{{${a}}}`,f=!1;for(let h of s){let g=this.envConfigService.resolveVariables(u,h);g&&g!==u&&!i.has(g)&&(r.push({url:g,description:h}),i.add(g),f=!0)}if(!f){let h=`{${a}}`;i.has(h)||(r.push({url:h,variables:{[a]:{default:""}}}),i.add(h))}}}};var Zk=tv(K0());import*as Qk from"fs";var Dl=class{generate(e,r){if(!e)return;let n=r||{};if(e.$ref){let i=this.resolveLocalRef(e.$ref,n.components);return i?this.generate(i,n):{}}if(e.nullable&&!e.type)return null;if(e.enum&&e.enum.length>0)return e.enum[0];if(e.default!==void 0)return e.default;if(e.example!==void 0)return e.example;if(e.allOf)return this.generateFromAllOf(e.allOf,e.discriminator,n);if(e.oneOf)return this.generateFromOneOfAnyOf(e.oneOf,e.discriminator,n);if(e.anyOf)return this.generateFromOneOfAnyOf(e.anyOf,e.discriminator,n);switch(e.type){case"string":return this.generateString(e);case"integer":return this.generateInteger(e);case"number":return this.generateNumber(e);case"boolean":return!1;case"array":return this.generateArray(e,n);case"object":return this.generateObject(e,n);default:return e.properties?this.generateObject(e,n):{}}}generateString(e){switch(e.format){case"email":return"user@example.com";case"date-time":return"2026-01-01T00:00:00Z";case"date":return"2026-01-01";case"time":return"00:00:00";case"uri":case"url":return"https://example.com";case"uuid":return"00000000-0000-0000-0000-000000000000";case"ipv4":return"127.0.0.1";case"ipv6":return"::1";case"hostname":return"example.com";case"binary":return"";case"byte":return"c3RyaW5n";case"password":return"********";default:return"string"}}generateInteger(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+1:0}generateNumber(e){return e.minimum!==void 0?e.minimum:e.exclusiveMinimum!==void 0?e.exclusiveMinimum+.1:0}generateArray(e,r){return e.items?[this.generate(e.items,r)]:[]}generateObject(e,r){let n={},i=e.properties||{};for(let[s,a]of Object.entries(i))r.omitReadOnly&&a.readOnly||(n[s]=this.generate(a,r));return n}generateFromAllOf(e,r,n){let i={type:"object",properties:{},required:[]};for(let a of e){let u=a.$ref?this.resolveLocalRef(a.$ref,n.components)||{}:a;u.properties&&Object.assign(i.properties,u.properties),u.required&&(i.required=[...i.required||[],...u.required])}let s=this.generateObject(i,n);return r?.propertyName&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}generateFromOneOfAnyOf(e,r,n){if(e.length===0)return{};let i=e[0].$ref&&this.resolveLocalRef(e[0].$ref,n.components)||e[0],s=this.generate(i,n);return r?.propertyName&&typeof s=="object"&&s!==null&&(s[r.propertyName]=this.guessDiscriminatorValue(e,n)),s}guessDiscriminatorValue(e,r){if(e.length===0)return"unknown";let n=e[0];if(n.$ref){let i=n.$ref.split("/");return i[i.length-1]}return"variant1"}resolveLocalRef(e,r){if(!e||!r)return;let n=e.match(/^#\/components\/(?:schemas\/)?(.+)$/);if(n)return r[n[1]];let i=e.match(/^#\/components\/(.+)$/);if(i)return r[i[1]]}};var Mm=tv(Gk()),Zl=class{async resolve(e){try{return await Mm.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",r),e}}async bundle(e){try{return await Mm.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await Mm.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}};var _4=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Xl=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new Dl,this.refResolver=new Zl}exampleGenerator;refResolver;async import(e,r){let n=await Qk.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=Zk.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},a=r?.collectionName||i.info?.title||"Imported API",f={id:at(a),name:a,description:i.info?.description||"",version:i.info?.version||"1.0.0",variables:{},items:[]};if(i.servers&&i.servers.length>0&&(f.variables.baseUrl=i.servers[0].url),i.security&&i.security.length>0&&i.components?.securitySchemes){let m=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);m&&(f.auth=m)}let h=new Map;if(i.tags)for(let m of i.tags){let S={type:"folder",id:at(m.name),name:m.name,description:m.description,items:[]};h.set(m.name,S),f.items.push(S)}if(i.paths)for(let[m,S]of Object.entries(i.paths))for(let _ of["get","post","put","patch","delete","head","options","trace"]){let C=S[_];if(!C)continue;let x=this.processOperation(_,m,C,S,i,s),A=C.tags?.[0];if(A&&h.has(A))h.get(A).items.push(x);else if(A){let T={type:"folder",id:at(A),name:A,items:[x]};h.set(A,T),f.items.push(T)}else f.items.push(x)}await this.collectionService.saveCollection(f);let g;return r?.environmentName&&i.servers&&(g=await this.createEnvironmentFromServers(i.servers,r.environmentName)),{collection:f,environmentCreated:g}}processOperation(e,r,n,i,s,a){let u=at(n.operationId||`${e}-${r}`),f=`{{baseUrl}}${this.convertPathParams(r)}`,h=n.summary||n.operationId||`${e.toUpperCase()} ${r}`,g=n.deprecated===!0;g&&(h=`[DEPRECATED] ${h}`);let m={type:"request",id:u,name:h,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:g},S=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(m,S,a),n.requestBody&&this.processRequestBody(m,n.requestBody,a),n.responses&&(m.responseSchema=this.processResponses(n.responses,a)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)m.auth={type:"none"};else if(n.security&&n.security.length>0){let _=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);_&&(m.auth=_)}}return m}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,r,n){let i=[],s=[],a={},u=[];for(let f of r){let h=f.name,g=f.in,m=f.schema||{},S=f.example!==void 0?String(f.example):this.generateExampleForParam(m,n),_=f.deprecated===!0;switch(g){case"path":{if(f.description||m.type||m.format||m.enum||_||m.pattern||m.minimum!==void 0||m.maximum!==void 0||m.minLength!==void 0||m.maxLength!==void 0||m.multipleOf!==void 0||m.minItems!==void 0||m.maxItems!==void 0||m.uniqueItems||m.nullable||m.oneOf){let x={value:S};m.oneOf?(x.oneOf=m.oneOf,this.applyOneOfHints(x,m.oneOf)):(m.type&&(x.type=m.type),m.format&&(x.format=m.format),m.enum&&(x.enum=m.enum.map(String)),m.pattern&&(x.pattern=m.pattern),m.minimum!==void 0&&(x.minimum=m.minimum),m.maximum!==void 0&&(x.maximum=m.maximum),m.exclusiveMinimum!==void 0&&(x.exclusiveMinimum=m.exclusiveMinimum),m.exclusiveMaximum!==void 0&&(x.exclusiveMaximum=m.exclusiveMaximum),m.multipleOf!==void 0&&(x.multipleOf=m.multipleOf),m.minLength!==void 0&&(x.minLength=m.minLength),m.maxLength!==void 0&&(x.maxLength=m.maxLength),m.minItems!==void 0&&(x.minItems=m.minItems),m.maxItems!==void 0&&(x.maxItems=m.maxItems),m.uniqueItems&&(x.uniqueItems=!0),m.nullable&&(x.nullable=!0)),f.description&&(x.description=f.description),_&&(x.deprecated=!0),a[h]=x}else a[h]=S;break}case"query":{let C={key:h,value:S};this.applySchemaConstraints(C,m,f,_),s.push(C);break}case"header":{let C={key:h,value:S};this.applySchemaConstraints(C,m,f,_),i.push(C);break}case"cookie":{u.push(`${h}={{${h}}}`);break}}}u.length>0&&i.push({key:"Cookie",value:u.join("; ")}),Object.keys(a).length>0&&(e.params=a),s.length>0&&(e.query=s),i.length>0&&(e.headers=i)}applySchemaConstraints(e,r,n,i){r.oneOf?(e.oneOf=r.oneOf,this.applyOneOfHints(e,r.oneOf)):(r.type&&(e.type=r.type),r.format&&(e.format=r.format),r.enum&&(e.enum=r.enum.map(String)),r.pattern&&(e.pattern=r.pattern),r.minimum!==void 0&&(e.minimum=r.minimum),r.maximum!==void 0&&(e.maximum=r.maximum),r.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=r.exclusiveMinimum),r.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=r.exclusiveMaximum),r.multipleOf!==void 0&&(e.multipleOf=r.multipleOf),r.minLength!==void 0&&(e.minLength=r.minLength),r.maxLength!==void 0&&(e.maxLength=r.maxLength),r.minItems!==void 0&&(e.minItems=r.minItems),r.maxItems!==void 0&&(e.maxItems=r.maxItems),r.uniqueItems&&(e.uniqueItems=!0),r.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,r){let n=[],i=new Set;for(let s of r)s.type&&i.add(s.type),s.enum&&n.push(...s.enum.map(String));i.size===1&&(e.type=[...i][0]),n.length>0&&(e.enum=[...new Set(n)])}generateExampleForParam(e,r){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:r});return n==null?"":String(n)}processRequestBody(e,r,n){if(!r.content)return;let i=Object.keys(r.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),a=r.content[s],{bodyType:u,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:u,...f&&{format:f},content:""},a){let g=this.generateBodyContent(a,s,n);g!==void 0&&(e.body.content=typeof g=="string"?g:JSON.stringify(g,null,2)),u==="form-data"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n)),u==="x-www-form-urlencoded"&&a.schema?.properties&&(e.body.content=this.buildFormDataEntries(a.schema,n))}let h=this.buildBodySchema(r,s,n);h&&(e.bodySchema=h)}selectPrimaryContentType(e){for(let i of _4)if(e.includes(i))return i;let r=e.find(i=>i.includes("json"));if(r)return r;let n=e.find(i=>i.startsWith("text/"));return n||e[0]}mapContentTypeToBodyType(e){return e.includes("json")?{bodyType:"raw",bodyFormat:"json"}:e==="application/xml"||e==="text/xml"?{bodyType:"raw",bodyFormat:"xml"}:e==="text/html"?{bodyType:"raw",bodyFormat:"html"}:e.startsWith("text/")?{bodyType:"raw",bodyFormat:"text"}:e==="multipart/form-data"?{bodyType:"form-data"}:e==="application/x-www-form-urlencoded"?{bodyType:"x-www-form-urlencoded"}:e==="application/octet-stream"?{bodyType:"binary"}:{bodyType:"raw",bodyFormat:"text"}}generateBodyContent(e,r,n){if(e.example!==void 0)return e.example;if(e.examples){let i=Object.values(e.examples)[0];if(i?.value!==void 0)return i.value}if(e.schema)return this.exampleGenerator.generate(e.schema,{omitReadOnly:!0,components:n})}buildFormDataEntries(e,r){let n=[],i=e.properties||{},s=new Set(e.required||[]);for(let[a,u]of Object.entries(i)){let f=u,h=f.type==="string"&&f.format==="binary",g={key:a,value:h?"":String(this.exampleGenerator.generate(f,{components:r})||""),type:h?"file":"text",enabled:!0};n.push(g)}return n}buildBodySchema(e,r,n){let i=Object.keys(e.content),s=e.content[r];if(!s?.schema)return;let a={contentType:r,schema:s.schema};if(i.length>1){a.content={};for(let f of i){let h=e.content[f],g={};h.schema&&(g.schema=h.schema),h.examples&&(g.examples=h.examples),h.encoding&&(g.encoding=h.encoding),a.content[f]=g}}s.encoding&&(a.encoding=s.encoding);let u=this.extractUsedComponents(s.schema,n);return Object.keys(u).length>0&&(a.components=u),a}processResponses(e,r){let n={responses:{}},i={};for(let[s,a]of Object.entries(e)){let u=a,f={description:u.description||`Status ${s}`};if(u.content){let h=Object.keys(u.content);if(h.length===1){let g=h[0],m=u.content[g];f.contentType=g,m.schema&&(f.schema=m.schema),m.examples&&(f.examples=m.examples),m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}else{f.content={};for(let g of h){let m=u.content[g],S={};m.schema&&(S.schema=m.schema),m.examples&&(S.examples=m.examples),f.content[g]=S,m.schema&&Object.assign(i,this.extractUsedComponents(m.schema,r))}}}if(u.headers){f.headers={};for(let[h,g]of Object.entries(u.headers)){let m=g;f.headers[h]={...m.description&&{description:m.description},schema:m.schema||{type:"string"}}}}n.responses[s]=f}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,r){let n=Object.keys(e)[0];if(!n)return;let i=r[n];if(i)switch(i.type){case"http":if(i.scheme==="bearer")return{type:"bearer",bearerToken:""};if(i.scheme==="basic")return{type:"basic",basicAuth:{username:"",password:""}};break;case"apiKey":return{type:"apikey",apikey:{key:i.name||"X-Api-Key",value:"",in:i.in||"header"}};case"oauth2":{let s=i.flows||{},a=s.authorizationCode||s.clientCredentials||s.password||s.implicit||{},u="client_credentials";return s.authorizationCode?u="authorization_code":s.password?u="password":s.implicit&&(u="implicit"),{type:"oauth2",oauth2:{grantType:u,tokenUrl:a.tokenUrl||"",authUrl:a.authorizationUrl||"",clientId:"",clientSecret:"",scope:Object.keys(a.scopes||{}).join(" ")}}}}}async createEnvironmentFromServers(e,r){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return r}extractUsedComponents(e,r,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&r[s]&&!i[s]&&(i[s]=r[s],this.extractUsedComponents(r[s],r,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,r,i);e.items&&this.extractUsedComponents(e.items,r,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let a of e[s])this.extractUsedComponents(a,r,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,r,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}};var eu=class{constructor(e,r,n){this.historyAnalyzer=e;this.scriptAnalyzer=r;this.inferrer=n}async infer(e,r,n,i){let s=await this.historyAnalyzer.analyze(e,r,{environment:i?.environment}),a;return i?.postResponseScript&&(a=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,a)}async inferBodySchema(e,r,n,i,s){let a,u;if(r==="raw"&&n==="json"&&e){let f=e;if(typeof e=="string")try{f=JSON.parse(e)}catch{return}a=this.inferrer.inferFromValue(f),u="application/json"}else r==="form-data"&&i?(a=this.buildFormDataSchema(i),u="multipart/form-data"):r==="x-www-form-urlencoded"&&i?(a=this.buildFormDataSchema(i),u="application/x-www-form-urlencoded"):r==="raw"&&n==="xml"?(a={type:"string"},u="application/xml"):r==="raw"&&(n==="text"||n==="html")?(a={type:"string"},u=n==="html"?"text/html":"text/plain"):r==="binary"?(a={type:"string",format:"binary"},u="application/octet-stream"):r==="graphql"&&(a={type:"object",properties:{query:{type:"string"},variables:{type:"object"}}},u="application/json");if(a)return s?this.mergeBodySchemaWithExisting(a,s):{contentType:u,schema:a}}buildFormDataSchema(e){let r={type:"object",properties:{}},n=[];for(let i of e){if(!i.enabled&&i.enabled!==void 0)continue;let s={};i.type?s.type=i.type:s.type="string",i.description&&(s.description=i.description),i.format&&(s.format=i.format),i.enum&&(s.enum=i.enum),i.type==="file"&&(s.type="string",s.format="binary"),r.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(r.required=n),r}mergeResponseSchemas(e,r,n){let i={responses:{}};for(let[s,a]of Object.entries(r.responses))i.responses[s]={...a};if(n&&this.applyScriptHints(i,n),e){for(let[s,a]of Object.entries(e.responses))i.responses[s]?i.responses[s]=this.mergeResponseDefinitions(i.responses[s],a):i.responses[s]={...a};e.components&&(i.components={...e.components})}return i}applyScriptHints(e,r){for(let n of r.expectedStatuses){let i=String(n);e.responses[i]||(e.responses[i]={description:`Status ${n}`})}for(let[,n]of Object.entries(e.responses))n.schema&&this.augmentSchemaWithHints(n.schema,r)}augmentSchemaWithHints(e,r){if(!(e.type!=="object"||!e.properties))for(let n of r.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,r)}}ensureFieldPath(e,r,n,i=""){if(r.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=r[0],a=s.endsWith("[]"),u=a?s.slice(0,-2):s,f=i?`${i}.${s}`:s,h=r.slice(1);if(!e.properties[u])if(a)e.properties[u]={type:"array",items:{type:"object"}};else if(h.length>0)e.properties[u]={type:"object",properties:{}};else{let g=n.typeHints[f];e.properties[u]={type:g||"string"};return}if(h.length>0){let g=a?e.properties[u].items:e.properties[u];g&&this.ensureFieldPath(g,h,n,f)}}mergeResponseDefinitions(e,r){let n={...e};return r.description&&(n.description=r.description),r.contentType&&(n.contentType=r.contentType),r.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,r.schema):r.schema&&(n.schema=r.schema),r.examples&&(n.examples={...e.examples||{},...r.examples}),r.content&&(n.content={...e.content||{},...r.content}),r.headers&&(n.headers={...e.headers||{},...r.headers}),n}mergeBodySchemaWithExisting(e,r){let n={...r};return r.schema?n.schema=this.inferrer.mergeSchemas(e,r.schema):n.schema=e,n}};var Xk=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,eA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(?:a|an)\(['"](\w+)['"]\)/g,tA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.(?:equal|eql)\((.+?)\)/g,rA=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,nA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(true|false)/g,iA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.have\.(?:lengthOf|length\.above|length\.below)/g,tu=class{analyze(e){let r={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return r;let n=this.stripComments(e);return this.extractFieldPaths(n,r),this.extractTypeAssertions(n,r),this.extractEqualityAssertions(n,r),this.extractBooleanAssertions(n,r),this.extractLengthAssertions(n,r),this.extractStatusAssertions(n,r),r.fieldPaths=[...new Set(r.fieldPaths)],r.expectedStatuses=[...new Set(r.expectedStatuses)],r}stripComments(e){let r=e.replace(/\/\*[\s\S]*?\*\//g,"");return r=r.replace(/\/\/.*$/gm,""),r}extractFieldPaths(e,r){let n,i=new RegExp(Xk.source,Xk.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&r.fieldPaths.push(s)}}extractTypeAssertions(e,r){let n,i=new RegExp(eA.source,eA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].toLowerCase();s&&(r.typeHints[s]=this.mapAssertionType(a),r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractEqualityAssertions(e,r){let n,i=new RegExp(tA.source,tA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].trim();if(s){let u=this.parseAssertionValue(a);u!==void 0&&(r.valueHints[s]=u,typeof u=="string"?r.typeHints[s]=r.typeHints[s]||"string":typeof u=="number"?r.typeHints[s]=r.typeHints[s]||(Number.isInteger(u)?"integer":"number"):typeof u=="boolean"&&(r.typeHints[s]=r.typeHints[s]||"boolean")),r.fieldPaths.includes(s)||r.fieldPaths.push(s)}}}extractBooleanAssertions(e,r){let n,i=new RegExp(nA.source,nA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]="boolean",r.valueHints[s]=n[2]==="true",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractLengthAssertions(e,r){let n,i=new RegExp(iA.source,iA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(r.typeHints[s]=r.typeHints[s]||"array",r.fieldPaths.includes(s)||r.fieldPaths.push(s))}}extractStatusAssertions(e,r){let n,i=new RegExp(rA.source,rA.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&r.expectedStatuses.push(s)}}normalizeFieldPath(e){let r=e.replace(/^\./,"");return r=r.replace(/\[\d+\]/g,"[]"),r}isCommonMethodCall(e){return new Set(["to","be","have","not","deep","any","all","that","is","has","include","includes","equal","eql","above","below","least","most","within","length","lengthOf","match","string","keys","key","property","ownProperty","status","header","json","text"]).has(e.split(".")[0])}mapAssertionType(e){return{string:"string",number:"number",object:"object",array:"array",boolean:"boolean",null:"null",undefined:"null",int:"integer",integer:"integer",float:"number",double:"number"}[e]||"string"}parseAssertionValue(e){if(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1);let r=Number(e);return!isNaN(r)&&e.trim().length>0?r:e==="true"?!0:e==="false"?!1:e==="null"?null:e}};var ne={Config:Symbol.for("IConfigService"),Console:Symbol.for("IConsoleService"),EnvironmentConfig:Symbol.for("IEnvironmentConfigService"),Collection:Symbol.for("ICollectionService"),HttpRequest:Symbol.for("IHttpRequestService"),HttpClient:Symbol.for("IHttpClient"),Cookie:Symbol.for("ICookieService"),RequestHistory:Symbol.for("IRequestHistoryService"),UrlBuilder:Symbol.for("IUrlBuilder"),RequestPreprocessor:Symbol.for("IRequestPreprocessor"),RequestPreparer:Symbol.for("IRequestPreparer"),InterceptorChain:Symbol.for("IInterceptorChain"),ScriptExecutor:Symbol.for("IScriptExecutor"),DataFileParser:Symbol.for("IDataFileParser"),CollectionRequestExecutor:Symbol.for("ICollectionRequestExecutor"),WorkspaceFolder:Symbol.for("WorkspaceFolder"),PersistentCookieJar:Symbol.for("PersistentCookieJar"),OAuth2TokenManager:Symbol.for("IOAuth2TokenManager"),GraphQLSchemaService:Symbol.for("IGraphQLSchemaService"),SchemaInferrer:Symbol.for("SchemaInferrer"),HistoryAnalyzer:Symbol.for("HistoryAnalyzer"),ScriptAnalyzer:Symbol.for("ScriptAnalyzer"),SchemaInferenceService:Symbol.for("SchemaInferenceService"),OpenApiExporter:Symbol.for("OpenApiExporter"),OpenApiImporter:Symbol.for("OpenApiImporter")};var w4={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}};function oA(t,e){let{workspaceFolder:r,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:a,secretStore:u,browserService:f,applicationInfo:h,consoleService:g}=e;t.registerValue(ne.WorkspaceFolder,r),t.registerSingleton(ne.Config,()=>new wl(r,n,i)),t.registerSingleton(ne.Console,()=>g??w4),t.registerSingleton(ne.EnvironmentConfig,S=>new Dc(r,s,S.resolve(ne.Config),n)),t.registerSingleton(ne.Cookie,()=>new $c(a)),t.registerSingleton(ne.Collection,S=>new qc(r,S.resolve(ne.Config),n)),t.registerSingleton(ne.HttpClient,()=>new Do),t.registerSingleton(ne.UrlBuilder,()=>new Dn),t.registerSingleton(ne.InterceptorChain,()=>new Yi),t.registerSingleton(ne.HttpRequest,S=>new Wi(S.resolve(ne.UrlBuilder),S.resolve(ne.InterceptorChain),S.resolve(ne.HttpClient))),t.registerSingleton(ne.RequestPreprocessor,()=>new zo),t.registerSingleton(ne.RequestHistory,S=>{let _=S.resolve(ne.EnvironmentConfig);return new Bc(_.getHistoriesPath(),sA.join(_.getRootPath(),"shared-histories"))}),u&&f&&t.registerSingleton(ne.OAuth2TokenManager,S=>new kc(u,f,S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest))),t.registerSingleton(ne.GraphQLSchemaService,S=>new jc(S.resolve(ne.HttpClient)));let m=h??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ne.RequestPreparer,S=>new Lc(S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest),S.resolve(ne.RequestPreprocessor),S.resolve(ne.OAuth2TokenManager),m)),t.registerSingleton(ne.ScriptExecutor,S=>{let _=S.resolve(ne.Config);return new Zi(S.resolve(ne.HttpRequest),_.getModulePaths())}),t.registerSingleton(ne.DataFileParser,()=>new Go),t.registerSingleton(ne.CollectionRequestExecutor,S=>new Fc(S.resolve(ne.HttpRequest),S.resolve(ne.ScriptExecutor),S.resolve(ne.EnvironmentConfig),S.resolve(ne.RequestPreparer),"")),t.registerSingleton(ne.PersistentCookieJar,S=>new Mc(S.resolve(ne.Cookie))),t.registerSingleton(ne.SchemaInferrer,()=>new to),t.registerSingleton(ne.HistoryAnalyzer,S=>new Cl(S.resolve(ne.RequestHistory),S.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.ScriptAnalyzer,()=>new tu),t.registerSingleton(ne.SchemaInferenceService,S=>new eu(S.resolve(ne.HistoryAnalyzer),S.resolve(ne.ScriptAnalyzer),S.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.OpenApiExporter,S=>new Nl(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig),S.resolve(ne.SchemaInferenceService))),t.registerSingleton(ne.OpenApiImporter,S=>new Xl(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig)))}var Nf=class t{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return t._instance||(t._instance=new t),t._instance}static reset(){t._instance&&t._instance.clear(),t._instance=void 0}registerValue(e,r){return this.primitives.set(e,r),this}registerSingleton(e,r){return this.services.set(e,{factory:r,singleton:!0}),this}registerTransient(e,r){return this.services.set(e,{factory:r,singleton:!1}),this}registerInstance(e,r){return this.services.set(e,{factory:()=>r,singleton:!0,instance:r}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let r=this.services.get(e);if(!r)throw new Error(`Service not registered: ${e.toString()}`);return r.singleton?(r.instance||(r.instance=r.factory(this)),r.instance):r.factory(this)}has(e){return this.services.has(e)||this.primitives.has(e)}clear(){this.services.clear(),this.primitives.clear()}get config(){return this.resolve(ne.Config)}get console(){return this.resolve(ne.Console)}get environmentConfig(){return this.resolve(ne.EnvironmentConfig)}get collection(){return this.resolve(ne.Collection)}get httpRequest(){return this.resolve(ne.HttpRequest)}get httpClient(){return this.resolve(ne.HttpClient)}get cookie(){return this.resolve(ne.Cookie)}get requestHistory(){return this.resolve(ne.RequestHistory)}get dataFileParser(){return this.resolve(ne.DataFileParser)}get scriptExecutor(){return this.resolve(ne.ScriptExecutor)}get requestPreparer(){return this.resolve(ne.RequestPreparer)}get persistentCookieJar(){return this.resolve(ne.PersistentCookieJar)}get oauth2TokenManager(){return this.resolve(ne.OAuth2TokenManager)}get graphqlSchemaService(){return this.resolve(ne.GraphQLSchemaService)}};function aA(){return Nf.instance}var uw=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())lt.isExpired(n)||(!n.domain||lt.domainMatches(e,n.domain))&&r.push(n);return r}has(e,r){return this.get(e,r)!==void 0}get(e,r){let n=this.getCookieKey(e,r),i=this.cookies.get(n);if(i&&!lt.isExpired(i))return i}set(e){let r=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(r,e)}delete(e,r,n){let i=this.getCookieKey(e,r,n);return this.cookies.delete(i)}getAll(e){if(e)return this.getCookiesForDomain(e);let r=[];for(let n of this.cookies.values())lt.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=lt.extractDomain(e),i=lt.parseCookieHeaders(r,n);for(let s of i){let a=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(a,s)}}getCookieHeader(e){let r=lt.extractDomain(e),n=lt.extractPath(e),s=this.getCookiesForDomain(r).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return lt.formatCookieHeader(s)}clear(){this.cookies.clear()}};function E4(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=T4(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(q4(a))return{contextType:"variable_def",fieldPath:[],prefix:s};let u=a.match(/\.\.\.\s+on\s+(\w*)$/);if(u)return{contextType:"fragment_type",fieldPath:[],prefix:u[1]||""};let f=a.match(/\(\s*(?:[\w]+\s*:\s*(?:"[^"]*"|[^,)]+)\s*,\s*)*(\w+)\s*:\s*(\w*)$/);if(f&&lA(a)){let m=cw(a,r),S=m.length>0?m[m.length-1]:void 0,_=uA(a);return{contextType:"argument_value",fieldPath:m,parentType:S,prefix:f[2]||"",currentArg:f[1],currentField:_||void 0}}if(lA(a)){let m=cw(a,r),S=m.length>0?m[m.length-1]:void 0,_=uA(a);return{contextType:"argument",fieldPath:m,parentType:S,prefix:s,currentField:_||void 0}}if(fw(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let g=cw(a,r);return{contextType:"selection_set",fieldPath:g,parentType:g.length>0?g[g.length-1]:void 0,prefix:s}}function C4(t,e){switch(e.contextType){case"root":return x4(t,e.prefix);case"selection_set":return R4(t,e);case"argument":return I4(t,e);case"argument_value":return O4(t,e);case"directive":return P4(t,e.prefix);case"fragment_type":return k4(t,e.prefix);case"variable_def":return A4(t,e.prefix);default:return[]}}function x4(t,e){let r=[],n=[{label:"query",detail:"Query operation",insertText:`query \${1:OperationName} {
|
|
270
270
|
$0
|
|
271
271
|
}`},{label:"mutation",detail:"Mutation operation",insertText:`mutation \${1:OperationName} {
|
|
272
272
|
$0
|
|
@@ -505,4 +505,4 @@ Variant: **${n}**`+(r.description?` \u2014 ${r.description}`:"")),r.tags){let i=
|
|
|
505
505
|
}
|
|
506
506
|
</script>
|
|
507
507
|
</body>
|
|
508
|
-
</html>`}};var Nm={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1};import*as Lt from"fs/promises";import*as Lr from"path";function Dm(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,Math.min(r,t.length-1))]}var pw=class{constructor(e){this.configService=e;let r=e.getRunnerConfig();this.basePath=e.getResultsPath(),this.indexPageSize=r.indexPageSize,this.recentErrorsLimit=r.recentErrorsLimit}basePath;currentRunPath=null;currentRunId=null;currentSuiteId=null;currentManifest=null;currentIndexPage=[];currentPageNumber=1;indexPageSize;recentErrors=[];recentErrorsLimit;resultIndex=0;requestDurations={};getBasePath(){return this.basePath}async initializeRun(e,r,n,i){let s=this.generateRunId();return this.currentRunId=s,this.currentSuiteId=e,this.currentRunPath=Lr.join(this.basePath,e,s),await Lt.mkdir(Lr.join(this.currentRunPath,"results"),{recursive:!0}),await Lt.mkdir(Lr.join(this.currentRunPath,"index"),{recursive:!0}),this.currentManifest={version:"1.0",runId:s,suiteId:e,suiteName:r,environment:n,startTime:new Date().toISOString(),status:"running",config:i,stats:{totalRequests:0,passed:0,failed:0,skipped:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0},requestStats:{},totalIndexPages:0,indexPageSize:this.indexPageSize},this.currentIndexPage=[],this.currentPageNumber=1,this.recentErrors=[],this.resultIndex=0,this.requestDurations={},await this.saveManifest(),s}async saveResult(e,r){if(!this.currentRunPath||!this.currentManifest)throw new Error("No active run. Call initializeRun first.");this.resultIndex++;let n=Date.now(),i=String(e).padStart(4,"0"),s=String(this.resultIndex).padStart(6,"0"),a=xt(r.requestId),u=`result-${s}-iter-${i}-${a}.json`,f=Lr.join(this.currentRunPath,"results",u),h={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,status:r.response.status,statusText:r.response.statusText||"",duration:r.duration,passed:r.passed,timestamp:n,request:{headers:r.executedRequest.headers,body:r.executedRequest.body.content},response:{headers:r.response.headers,body:r.response.body},assertions:r.assertions.map(_=>({name:_.name,passed:_.passed,message:_.message||null})),error:r.error||null};await Lt.writeFile(f,JSON.stringify(pb(h),null,2),"utf-8");let g=r.assertions.filter(_=>_.passed).length,m=r.assertions.filter(_=>!_.passed).length,S={i:this.resultIndex,it:e,n:r.name,m:dw[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:g,af:m,r:r.requestId,e:r.passed?null:r.error||null};return this.currentIndexPage.push(S),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(r),this.requestDurations[r.requestId]||(this.requestDurations[r.requestId]=[]),this.requestDurations[r.requestId].push(r.duration),r.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:r.name,status:r.response.status,error:r.error||`Status ${r.response.status}`,resultFile:u}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),S}async finalizeRun(e="completed"){if(!this.currentManifest)return null;this.currentIndexPage.length>0&&await this.writeCurrentIndexPage(),this.currentManifest.endTime=new Date().toISOString(),this.currentManifest.status=e,this.currentManifest.totalIndexPages=this.currentPageNumber-1,this.currentManifest.stats.totalRequests>0&&(this.currentManifest.stats.avgDuration=Math.round(this.currentManifest.stats.totalDuration/this.currentManifest.stats.totalRequests)),this.currentManifest.stats.minDuration===Number.MAX_SAFE_INTEGER&&(this.currentManifest.stats.minDuration=0);for(let a in this.currentManifest.requestStats){let u=this.currentManifest.requestStats[a],f=this.requestDurations[a]||[];u.count>0&&(u.avgDuration=Math.round(u.totalDuration/u.count)),u.minDuration===Number.MAX_SAFE_INTEGER&&(u.minDuration=0),f.length>0&&(f.sort((h,g)=>h-g),u.p50=Dm(f,50),u.p90=Dm(f,90),u.p95=Dm(f,95),u.p99=Dm(f,99))}this.requestDurations={},await this.saveManifest();let r=null,n=this.currentRunPath,i=this.currentSuiteId,s=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,i&&s&&n)try{r=await new Ff(this.basePath).generate(i,s)}catch(a){console.warn("[ResultStorage] HTML report generation failed:",a)}return r}getCurrentStats(){return this.currentManifest?{stats:{...this.currentManifest.stats},requestStats:{...this.currentManifest.requestStats},recentErrors:[...this.recentErrors]}:null}getCurrentRunId(){return this.currentRunId}getCurrentSuiteId(){return this.currentSuiteId}async getResultDetails(e,r,n){let i=Lr.join(this.basePath,e,r,"results",n),s=await Lt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=Lr.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await Lt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=Lr.join(this.basePath,e,r,"manifest.json"),i=await Lt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Lr.join(this.basePath,e);try{let n=await Lt.readdir(r),i=[];for(let s of n.sort().reverse())try{let a=await this.getManifest(e,s);i.push(a)}catch{}return i}catch{return[]}}async listSuites(){try{return(await Lt.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=Lr.join(this.basePath,e,r);await Lt.rm(n,{recursive:!0,force:!0})}async cleanupOldRuns(){let r=this.configService.getRunnerConfig().resultsRetentionDays;if(r===0)return{deleted:0,freed:0};let n=new Date;n.setDate(n.getDate()-r);let i=0,s=0,a=await this.listSuites();for(let u of a){let f=await this.listRuns(u);for(let h of f)if(new Date(h.startTime)<n){let g=Lr.join(this.basePath,u,h.runId),m=await this.getDirectorySize(g);await Lt.rm(g,{recursive:!0,force:!0}),i++,s+=m}}return{deleted:i,freed:s}}generateRunId(){let e=new Date,r=e.toISOString().slice(0,10).replace(/-/g,""),n=e.toTimeString().slice(0,8).replace(/:/g,""),i=String(e.getMilliseconds()).padStart(3,"0");return`run-${r}-${n}-${i}`}async saveManifest(){if(!this.currentRunPath||!this.currentManifest)return;let e=Lr.join(this.currentRunPath,"manifest.json");await Lt.writeFile(e,JSON.stringify(this.currentManifest,null,2),"utf-8")}async writeCurrentIndexPage(){if(!this.currentRunPath||this.currentIndexPage.length===0)return;let e=`page-${String(this.currentPageNumber).padStart(4,"0")}.json`,r=Lr.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await Lt.writeFile(r,JSON.stringify(n),"utf-8"),this.currentPageNumber++,this.currentIndexPage=[]}updateStats(e){if(!this.currentManifest)return;let r=this.currentManifest.stats,n=this.currentManifest.requestStats;r.totalRequests++,r.totalDuration+=e.duration,r.minDuration=Math.min(r.minDuration,e.duration),r.maxDuration=Math.max(r.maxDuration,e.duration),e.passed?r.passed++:r.failed++,n[e.requestId]||(n[e.requestId]={name:e.name,count:0,passed:0,failed:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0});let i=n[e.requestId];i.count++,i.totalDuration+=e.duration,i.minDuration=Math.min(i.minDuration,e.duration),i.maxDuration=Math.max(i.maxDuration,e.duration),e.passed?i.passed++:i.failed++}async getDirectorySize(e){let r=0;try{let n=await Lt.readdir(e,{withFileTypes:!0});for(let i of n){let s=Lr.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let a=await Lt.stat(s);r+=a.size}}}catch{}return r}};function Fm(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function mw(t){return{name:t,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function mA(t){if(t.durations.length===0){t.min=0,t.max=0,t.avg=0,t.p50=0,t.p90=0,t.p95=0,t.p99=0;return}let e=[...t.durations].sort((n,i)=>n-i),r=t.durations.reduce((n,i)=>n+i,0);t.min=e[0],t.max=e[e.length-1],t.avg=Math.round(r/t.durations.length),t.p50=Fm(e,50),t.p90=Fm(e,90),t.p95=Fm(e,95),t.p99=Fm(e,99)}var gw=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=mw("Overall"),this.errors=new Map}createEmptySummary(){return{totalRequests:0,passed:0,failed:0,skipped:0,passRate:0,duration:0,isRunning:!1}}start(){this.startTime=Date.now(),this.summary.isRunning=!0}reset(){this.summary=this.createEmptySummary(),this.byRequest.clear(),this.overall=mw("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,r,n,i,s){this.summary.totalRequests++,i?this.summary.skipped++:n?this.summary.passed++:this.summary.failed++;let a=this.summary.passed+this.summary.failed;if(this.summary.passRate=a>0?Math.round(this.summary.passed/a*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,mw(e));let u=this.byRequest.get(e);if(u.count++,n?u.passed++:u.failed++,u.durations.push(r),mA(u),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),mA(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((r,n)=>{e.push({message:n,count:r})}),e.sort((r,n)=>n.count-r.count),{summary:{...this.summary},byRequest:new Map(this.byRequest),overall:{...this.overall},errors:e}}getSerializableStatistics(){let e=this.getStatistics();return{summary:e.summary,byRequest:Array.from(e.byRequest.values()),overall:e.overall,errors:e.errors}}};import*as Ot from"fs";import*as lo from"path";var yw=class{constructor(e,r,n){this.collectionService=e;this.configService=r;this.suitesDir=r.getSuitesPath(),this.onSuitesChanged=n?.onSuitesChanged,this.ensureSuitesDir(),this.loadSuites(),n?.watch!==!1&&this.setupFileWatcher()}suitesDir;suites=new Map;fileWatcher=null;debounceTimer=null;onSuitesChanged;ensureSuitesDir(){Ot.existsSync(this.suitesDir)||Ot.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Ot.watch(this.suitesDir,(e,r)=>{r&&!r.endsWith(".suite.json")||(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.loadSuites(),this.onSuitesChanged?.()},200))}),this.fileWatcher.on("error",()=>{})}catch{}}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.close(),this.fileWatcher=null}loadSuites(){if(this.suites.clear(),!Ot.existsSync(this.suitesDir))return;let e=Ot.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=lo.join(this.suitesDir,r),i=Ot.readFileSync(n,"utf-8"),s=JSON.parse(i);s.id&&s.name&&this.suites.set(s.id,s)}catch(n){console.error(`[TestSuiteService] Failed to load ${r}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e,r=[]){let n=Date.now(),i={id:it(e),name:e,requests:r,config:{...Nm},createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}async updateSuite(e){e.updatedAt=Date.now(),await this.saveSuiteToDisk(e),this.suites.set(e.id,e)}async duplicateSuite(e,r){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=await this.createSuite(r,n.requests.map(u=>({...u})));i.config={...n.config},i.description=n.description;let s=lo.join(this.suitesDir,e),a=lo.join(this.suitesDir,i.id);return Ot.existsSync(s)&&this.copyDirRecursive(s,a),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Ot.existsSync(r)||Ot.mkdirSync(r,{recursive:!0});for(let n of Ot.readdirSync(e,{withFileTypes:!0})){let i=lo.join(e,n.name),s=lo.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Ot.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=lo.join(this.suitesDir,n);try{return Ot.existsSync(i)&&Ot.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!1}}async createTempSuiteFromCollection(e){let r=this.collectionService.getCollection(e);if(!r){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(r,e,r.name,"",n);let i=Date.now();return{id:`temp-${it(r.name)}`,name:r.name,requests:n,config:{...Nm},isTemporary:!0,createdAt:i,updatedAt:i}}async saveTempSuite(e,r){let n=Date.now(),i={...e,id:it(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}getAllAvailableRequests(){let e=[],r=this.collectionService.getAllCollections();for(let n of r)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,r,n,i,s){if(e.requests)for(let a of e.requests)s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.items)for(let a of e.items)if(a.items||a.folders||a.requests){let u=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,u,s)}else s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.folders)for(let a of e.folders){let u=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,u,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=lo.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Ot.writeFileSync(n,i,"utf-8")}};import*as os from"fs";import*as pa from"path";var vw=class{constructor(e){this.collectionService=e}suite;suiteDir;setSuite(e){this.suite=e}setSuiteDir(e){this.suiteDir=e}getSuite(){return this.suite}loadSuiteRequest(e){if(!this.suiteDir)return;let r=pa.join(this.suiteDir,e,"request.json");if(os.existsSync(r))try{let n=JSON.parse(os.readFileSync(r,"utf-8")),i=pa.join(this.suiteDir,e,"scripts"),s=fh(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,r){if(!this.suiteDir)return;let n=pa.join(this.suiteDir,e);os.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,os.writeFileSync(pa.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=pa.join(n,"scripts");dh(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:os.existsSync(pa.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let r=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(r){let s,a=[];if(n){s=n.scripts;let u=this.findRequestInCollection(n,e.requestId);u&&(a=u.folderScriptsChain)}return{request:r,suiteRequest:e,collectionScripts:s,folderScriptsChain:a}}if(!n){console.warn(`[TestSuiteStore] Collection not found: ${e.collectionId}`);return}let i=this.findRequestInCollection(n,e.requestId);if(!i){console.warn(`[TestSuiteStore] Request not found: ${e.requestId}`);return}return{request:i.request,suiteRequest:e,collectionScripts:n.scripts,folderScriptsChain:i.folderScriptsChain}}findRequestInCollection(e,r,n=[]){let i=e.items||[];return this.searchItems(i,r,n)}searchItems(e,r,n){for(let i of e)if(i.type==="folder"){let s=i;if(!s.items)continue;let a=s.scripts?[...n,s.scripts]:n,u=this.searchItems(s.items||[],r,a);if(u)return u}else if(i.id===r)return{request:this.normalizeRequest(i),folderScriptsChain:n}}normalizeRequest(e){let{type:r,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(r=>({key:r.key||"",value:r.value||"",enabled:r.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([r,n])=>({key:r,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,r){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===r);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let r=this.suite.requests.find(n=>n.slug===e);if(r)return this.resolveRequest(r)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){let n=this.resolveRequest(r);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){if(!r.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);r.slug=Bi(r.name||"request",i)}let n=this.resolveRequest(r);if(n){let i=this.collectionService.getCollection(r.collectionId);e.push({id:`${r.collectionId}:${r.requestId}`,collectionId:r.collectionId,requestId:r.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:r.folderPath||"",enabled:r.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(r.slug),slug:r.slug})}}return e}getSelectedRequests(e){let r=[];for(let n of e){let[i,s]=n.split(":"),a=this.suite?.requests.find(u=>u.collectionId===i&&u.requestId===s);if(a){let u=this.resolveRequest(a);u&&r.push(u)}}return r}addRequest(e,r){if(this.suite){if(this.suiteDir&&r){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=Bi(e.name||r.name||"request",n)}this.saveSuiteRequest(e.slug,r)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let r=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!r.has(e))return e;let n=2;for(;r.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(r=>r.requestId!==e))}reorderRequests(e){if(!this.suite)return;let r=new Map;for(let i of this.suite.requests)r.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=r.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,r){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,r);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=r.name||n.name,n.method=r.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let r=this.suite.requests.find(s=>s.slug===e);if(!r)return;let n=this.collectionService.getCollection(r.collectionId);if(!n)return;let i=this.findRequestInCollection(n,r.requestId);if(i)return this.saveSuiteRequest(e,i.request),r.name=i.request.name||r.name,r.method=i.request.method||r.method,i.request}};export{FE as BODY_FILE_MAP,_l as CONFIG_FILES,Za as CollectionLoader,Tc as CollectionLoaderFactory,Fc as CollectionRequestExecutor,qc as CollectionService,wl as ConfigService,Bu as CookieJar,$c as CookieService,lt as CookieUtils,er as DEFAULT_CONFIG,Fn as DEFAULT_REQUEST_SETTINGS,Nm as DEFAULT_SUITE_CONFIG,KE as DYNAMIC_VARIABLES,Go as DataFileParser,Dc as EnvironmentConfigService,Hi as EnvironmentResolver,Dl as ExampleGenerator,Oc as FetchHttpClient,ju as FolderCollectionLoader,$s as FolderCollectionStore,ob as ForgeContainer,Ns as ForgeEnv,jc as GraphQLSchemaService,dw as HTTP_METHOD_MAP,Df as HTTP_METHOD_REVERSE,Cl as HistoryAnalyzer,Ff as HtmlReportGenerator,Ko as HttpForgeParser,Wi as HttpRequestService,uw as InMemoryCookieJar,Yi as InterceptorChain,bl as JsonCollectionLoader,fv as LoggingRequestInterceptor,yr as METADATA_FILES,rp as ModuleLoader,Pc as NodeFileSystem,Do as NodeHttpClient,kc as OAuth2TokenManager,Nl as OpenApiExporter,Xl as OpenApiImporter,Uu as ParserRegistry,Mc as PersistentCookieJar,Zo as ROOT_DIRECTORIES,Zl as RefResolver,gl as RequestExecutor,Bc as RequestHistoryService,Ic as RequestHistoryStore,Lc as RequestPreparer,zo as RequestPreprocessor,Rc as RequestScriptSession,pw as ResultStorageService,hv as RetryErrorInterceptor,Lu as SCHEMA_FILES,cn as SCRIPTS_DIR,ch as SCRIPT_FILES,eu as SchemaInferenceService,to as SchemaInferrer,tu as ScriptAnalyzer,Zi as ScriptExecutor,Nf as ServiceContainer,ne as ServiceIdentifiers,gw as StatisticsService,yw as TestSuiteService,vw as TestSuiteStore,dv as TimingResponseInterceptor,Dn as UrlBuilder,No as VariableInterpolator,Mo as VariableResolver,ZU as applyExtractionPlan,Yu as applyFilterChain,To as augmentWithDynamicVars,QU as buildExtractionPlan,fA as buildResultFileName,UE as cleanupOldBodyFiles,ip as concatenateScripts,Cc as createExpectChain,PR as createLodashShim,XS as createModuleLoader,np as createMomentShim,eb as createResponseObject,OU as createScriptConsole,tb as createTestFunction,ZN as createVariableResolver,vN as deepClone,iv as deleteItemFromTree,GU as detectSensitiveData,$o as evaluateExpression,M4 as expandSummary,NU as exportCollectionToRestClient,nv as findItemById,_N as formatBytes,sp as formatConsoleOutput,wN as formatDuration,it as generateId,Bi as generateSlug,rv as generateUUID,C4 as getCompletions,MU as getRestClientExportFolder,aA as getServiceContainer,xc as hasChanged,qo as isExpression,SN as isPlainObject,ph as isSystemEnvironmentFile,Hu as loadEnvironmentsFromFolder,Fu as mergeHeadersCaseInsensitive,cv as mergeRequestSettings,rb as normalizeHeaders,Wu as parseFilterChain,ap as parsePostmanEnvironment,YU as parsePostmanEnvironmentFile,E4 as parseQueryContext,jE as prepareBodyForSave,LE as readBodyFromDir,BE as readSchemaFile,fh as readScriptsFromDir,fb as redactBody,hb as redactFullResponse,pb as redactFullResultDetails,Uc as redactHeaders,db as redactHistoryEntry,cb as redactUrl,oA as registerCoreServices,Vi as resolveDynamicVariable,VN as resolveDynamicVariablesInString,bN as safeJsonParse,xt as sanitizeName,sv as searchForItemPath,VE as sortItemsByOrder,Sl as writeEnvFile,op as writeFolderItems,HE as writeSchemaFiles,Ac as writeScriptFile,dh as writeScriptsToDir};
|
|
508
|
+
</html>`}};var Nm={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1};import*as Lt from"fs/promises";import*as Lr from"path";function Dm(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,Math.min(r,t.length-1))]}var pw=class{constructor(e){this.configService=e;let r=e.getRunnerConfig();this.basePath=e.getResultsPath(),this.indexPageSize=r.indexPageSize,this.recentErrorsLimit=r.recentErrorsLimit}basePath;currentRunPath=null;currentRunId=null;currentSuiteId=null;currentManifest=null;currentIndexPage=[];currentPageNumber=1;indexPageSize;recentErrors=[];recentErrorsLimit;resultIndex=0;requestDurations={};getBasePath(){return this.basePath}async initializeRun(e,r,n,i){let s=this.generateRunId();return this.currentRunId=s,this.currentSuiteId=e,this.currentRunPath=Lr.join(this.basePath,e,s),await Lt.mkdir(Lr.join(this.currentRunPath,"results"),{recursive:!0}),await Lt.mkdir(Lr.join(this.currentRunPath,"index"),{recursive:!0}),this.currentManifest={version:"1.0",runId:s,suiteId:e,suiteName:r,environment:n,startTime:new Date().toISOString(),status:"running",config:i,stats:{totalRequests:0,passed:0,failed:0,skipped:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0},requestStats:{},totalIndexPages:0,indexPageSize:this.indexPageSize},this.currentIndexPage=[],this.currentPageNumber=1,this.recentErrors=[],this.resultIndex=0,this.requestDurations={},await this.saveManifest(),s}async saveResult(e,r){if(!this.currentRunPath||!this.currentManifest)throw new Error("No active run. Call initializeRun first.");this.resultIndex++;let n=Date.now(),i=String(e).padStart(4,"0"),s=String(this.resultIndex).padStart(6,"0"),a=xt(r.requestId),u=`result-${s}-iter-${i}-${a}.json`,f=Lr.join(this.currentRunPath,"results",u),h={index:this.resultIndex,iteration:e,requestId:r.requestId,name:r.name,method:r.executedRequest.method,url:r.executedRequest.url,status:r.response.status,statusText:r.response.statusText||"",duration:r.duration,passed:r.passed,timestamp:n,request:{headers:r.executedRequest.headers,body:r.executedRequest.body.content},response:{headers:r.response.headers,body:r.response.body},assertions:r.assertions.map(_=>({name:_.name,passed:_.passed,message:_.message||null})),error:r.error||null};await Lt.writeFile(f,JSON.stringify(pb(h),null,2),"utf-8");let g=r.assertions.filter(_=>_.passed).length,m=r.assertions.filter(_=>!_.passed).length,S={i:this.resultIndex,it:e,n:r.name,m:dw[r.executedRequest.method.toUpperCase()]??0,s:r.response.status,d:r.duration,p:r.passed,ap:g,af:m,r:r.requestId,e:r.passed?null:r.error||null};return this.currentIndexPage.push(S),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(r),this.requestDurations[r.requestId]||(this.requestDurations[r.requestId]=[]),this.requestDurations[r.requestId].push(r.duration),r.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:r.name,status:r.response.status,error:r.error||`Status ${r.response.status}`,resultFile:u}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),S}async finalizeRun(e="completed"){if(!this.currentManifest)return null;this.currentIndexPage.length>0&&await this.writeCurrentIndexPage(),this.currentManifest.endTime=new Date().toISOString(),this.currentManifest.status=e,this.currentManifest.totalIndexPages=this.currentPageNumber-1,this.currentManifest.stats.totalRequests>0&&(this.currentManifest.stats.avgDuration=Math.round(this.currentManifest.stats.totalDuration/this.currentManifest.stats.totalRequests)),this.currentManifest.stats.minDuration===Number.MAX_SAFE_INTEGER&&(this.currentManifest.stats.minDuration=0);for(let a in this.currentManifest.requestStats){let u=this.currentManifest.requestStats[a],f=this.requestDurations[a]||[];u.count>0&&(u.avgDuration=Math.round(u.totalDuration/u.count)),u.minDuration===Number.MAX_SAFE_INTEGER&&(u.minDuration=0),f.length>0&&(f.sort((h,g)=>h-g),u.p50=Dm(f,50),u.p90=Dm(f,90),u.p95=Dm(f,95),u.p99=Dm(f,99))}this.requestDurations={},await this.saveManifest();let r=null,n=this.currentRunPath,i=this.currentSuiteId,s=this.currentRunId;if(this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0,i&&s&&n)try{r=await new Ff(this.basePath).generate(i,s)}catch(a){console.warn("[ResultStorage] HTML report generation failed:",a)}return r}getCurrentStats(){return this.currentManifest?{stats:{...this.currentManifest.stats},requestStats:{...this.currentManifest.requestStats},recentErrors:[...this.recentErrors]}:null}getCurrentRunId(){return this.currentRunId}getCurrentSuiteId(){return this.currentSuiteId}async getResultDetails(e,r,n){let i=Lr.join(this.basePath,e,r,"results",n),s=await Lt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,r,n){let i=Lr.join(this.basePath,e,r,"index",`page-${String(n).padStart(4,"0")}.json`),s=await Lt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,r){let n=Lr.join(this.basePath,e,r,"manifest.json"),i=await Lt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let r=Lr.join(this.basePath,e);try{let n=await Lt.readdir(r),i=[];for(let s of n.sort().reverse())try{let a=await this.getManifest(e,s);i.push(a)}catch{}return i}catch{return[]}}async listSuites(){try{return(await Lt.readdir(this.basePath,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>r.name)}catch{return[]}}async deleteRun(e,r){let n=Lr.join(this.basePath,e,r);await Lt.rm(n,{recursive:!0,force:!0})}async cleanupOldRuns(){let r=this.configService.getRunnerConfig().resultsRetentionDays;if(r===0)return{deleted:0,freed:0};let n=new Date;n.setDate(n.getDate()-r);let i=0,s=0,a=await this.listSuites();for(let u of a){let f=await this.listRuns(u);for(let h of f)if(new Date(h.startTime)<n){let g=Lr.join(this.basePath,u,h.runId),m=await this.getDirectorySize(g);await Lt.rm(g,{recursive:!0,force:!0}),i++,s+=m}}return{deleted:i,freed:s}}generateRunId(){let e=new Date,r=e.toISOString().slice(0,10).replace(/-/g,""),n=e.toTimeString().slice(0,8).replace(/:/g,""),i=String(e.getMilliseconds()).padStart(3,"0");return`run-${r}-${n}-${i}`}async saveManifest(){if(!this.currentRunPath||!this.currentManifest)return;let e=Lr.join(this.currentRunPath,"manifest.json");await Lt.writeFile(e,JSON.stringify(this.currentManifest,null,2),"utf-8")}async writeCurrentIndexPage(){if(!this.currentRunPath||this.currentIndexPage.length===0)return;let e=`page-${String(this.currentPageNumber).padStart(4,"0")}.json`,r=Lr.join(this.currentRunPath,"index",e),n={page:this.currentPageNumber,startIndex:(this.currentPageNumber-1)*this.indexPageSize+1,count:this.currentIndexPage.length,summaries:this.currentIndexPage};await Lt.writeFile(r,JSON.stringify(n),"utf-8"),this.currentPageNumber++,this.currentIndexPage=[]}updateStats(e){if(!this.currentManifest)return;let r=this.currentManifest.stats,n=this.currentManifest.requestStats;r.totalRequests++,r.totalDuration+=e.duration,r.minDuration=Math.min(r.minDuration,e.duration),r.maxDuration=Math.max(r.maxDuration,e.duration),e.passed?r.passed++:r.failed++,n[e.requestId]||(n[e.requestId]={name:e.name,count:0,passed:0,failed:0,totalDuration:0,avgDuration:0,minDuration:Number.MAX_SAFE_INTEGER,maxDuration:0});let i=n[e.requestId];i.count++,i.totalDuration+=e.duration,i.minDuration=Math.min(i.minDuration,e.duration),i.maxDuration=Math.max(i.maxDuration,e.duration),e.passed?i.passed++:i.failed++}async getDirectorySize(e){let r=0;try{let n=await Lt.readdir(e,{withFileTypes:!0});for(let i of n){let s=Lr.join(e,i.name);if(i.isDirectory())r+=await this.getDirectorySize(s);else{let a=await Lt.stat(s);r+=a.size}}}catch{}return r}};function Fm(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function mw(t){return{name:t,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function mA(t){if(t.durations.length===0){t.min=0,t.max=0,t.avg=0,t.p50=0,t.p90=0,t.p95=0,t.p99=0;return}let e=[...t.durations].sort((n,i)=>n-i),r=t.durations.reduce((n,i)=>n+i,0);t.min=e[0],t.max=e[e.length-1],t.avg=Math.round(r/t.durations.length),t.p50=Fm(e,50),t.p90=Fm(e,90),t.p95=Fm(e,95),t.p99=Fm(e,99)}var gw=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=mw("Overall"),this.errors=new Map}createEmptySummary(){return{totalRequests:0,passed:0,failed:0,skipped:0,passRate:0,duration:0,isRunning:!1}}start(){this.startTime=Date.now(),this.summary.isRunning=!0}reset(){this.summary=this.createEmptySummary(),this.byRequest.clear(),this.overall=mw("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,r,n,i,s){this.summary.totalRequests++,i?this.summary.skipped++:n?this.summary.passed++:this.summary.failed++;let a=this.summary.passed+this.summary.failed;if(this.summary.passRate=a>0?Math.round(this.summary.passed/a*1e3)/10:0,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime),i)return;this.byRequest.has(e)||this.byRequest.set(e,mw(e));let u=this.byRequest.get(e);if(u.count++,n?u.passed++:u.failed++,u.durations.push(r),mA(u),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),mA(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((r,n)=>{e.push({message:n,count:r})}),e.sort((r,n)=>n.count-r.count),{summary:{...this.summary},byRequest:new Map(this.byRequest),overall:{...this.overall},errors:e}}getSerializableStatistics(){let e=this.getStatistics();return{summary:e.summary,byRequest:Array.from(e.byRequest.values()),overall:e.overall,errors:e.errors}}};import*as Ot from"fs";import*as lo from"path";var yw=class{constructor(e,r,n){this.collectionService=e;this.configService=r;this.suitesDir=r.getSuitesPath(),this.onSuitesChanged=n?.onSuitesChanged,this.ensureSuitesDir(),this.loadSuites(),n?.watch!==!1&&this.setupFileWatcher()}suitesDir;suites=new Map;fileWatcher=null;debounceTimer=null;onSuitesChanged;ensureSuitesDir(){Ot.existsSync(this.suitesDir)||Ot.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Ot.watch(this.suitesDir,(e,r)=>{r&&!r.endsWith(".suite.json")||(this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.loadSuites(),this.onSuitesChanged?.()},200))}),this.fileWatcher.on("error",()=>{})}catch{}}dispose(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.fileWatcher?.close(),this.fileWatcher=null}loadSuites(){if(this.suites.clear(),!Ot.existsSync(this.suitesDir))return;let e=Ot.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=lo.join(this.suitesDir,r),i=Ot.readFileSync(n,"utf-8"),s=JSON.parse(i);s.id&&s.name&&this.suites.set(s.id,s)}catch(n){console.error(`[TestSuiteService] Failed to load ${r}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e,r=[]){let n=Date.now(),i={id:at(e),name:e,requests:r,config:{...Nm},createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}async updateSuite(e){e.updatedAt=Date.now(),await this.saveSuiteToDisk(e),this.suites.set(e.id,e)}async duplicateSuite(e,r){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=await this.createSuite(r,n.requests.map(u=>({...u})));i.config={...n.config},i.description=n.description;let s=lo.join(this.suitesDir,e),a=lo.join(this.suitesDir,i.id);return Ot.existsSync(s)&&this.copyDirRecursive(s,a),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Ot.existsSync(r)||Ot.mkdirSync(r,{recursive:!0});for(let n of Ot.readdirSync(e,{withFileTypes:!0})){let i=lo.join(e,n.name),s=lo.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Ot.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=lo.join(this.suitesDir,n);try{return Ot.existsSync(i)&&Ot.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!1}}async createTempSuiteFromCollection(e){let r=this.collectionService.getCollection(e);if(!r){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(r,e,r.name,"",n);let i=Date.now();return{id:`temp-${e}`,name:r.name,requests:n,config:{...Nm},isTemporary:!0,createdAt:i,updatedAt:i}}async saveTempSuite(e,r){let n=Date.now(),i={...e,id:at(r),name:r,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}getAllAvailableRequests(){let e=[],r=this.collectionService.getAllCollections();for(let n of r)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,r,n,i,s){if(e.requests)for(let a of e.requests)s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.items)for(let a of e.items)if(a.items||a.folders||a.requests){let u=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,u,s)}else s.push({collectionId:r,collectionName:n,requestId:a.id,name:a.name||"Unnamed Request",method:a.method||"GET",folderPath:i});if(e.folders)for(let a of e.folders){let u=i?`${i}/${a.name}`:a.name;this.extractRequestsFromCollection(a,r,n,u,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let r=`${e.id}.suite.json`,n=lo.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Ot.writeFileSync(n,i,"utf-8")}};import*as os from"fs";import*as pa from"path";var vw=class{constructor(e){this.collectionService=e}suite;suiteDir;setSuite(e){this.suite=e}setSuiteDir(e){this.suiteDir=e}getSuite(){return this.suite}loadSuiteRequest(e){if(!this.suiteDir)return;let r=pa.join(this.suiteDir,e,"request.json");if(os.existsSync(r))try{let n=JSON.parse(os.readFileSync(r,"utf-8")),i=pa.join(this.suiteDir,e,"scripts"),s=fh(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,r){if(!this.suiteDir)return;let n=pa.join(this.suiteDir,e);os.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,os.writeFileSync(pa.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=pa.join(n,"scripts");dh(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:os.existsSync(pa.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let r=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(r){let s,a=[];if(n){s=n.scripts;let u=this.findRequestInCollection(n,e.requestId);u&&(a=u.folderScriptsChain)}return{request:r,suiteRequest:e,collectionScripts:s,folderScriptsChain:a}}if(!n){console.warn(`[TestSuiteStore] Collection not found: ${e.collectionId}`);return}let i=this.findRequestInCollection(n,e.requestId);if(!i){console.warn(`[TestSuiteStore] Request not found: ${e.requestId}`);return}return{request:i.request,suiteRequest:e,collectionScripts:n.scripts,folderScriptsChain:i.folderScriptsChain}}findRequestInCollection(e,r,n=[]){let i=e.items||[];return this.searchItems(i,r,n)}searchItems(e,r,n){for(let i of e)if(i.type==="folder"){let s=i;if(!s.items)continue;let a=s.scripts?[...n,s.scripts]:n,u=this.searchItems(s.items||[],r,a);if(u)return u}else if(i.id===r)return{request:this.normalizeRequest(i),folderScriptsChain:n}}normalizeRequest(e){let{type:r,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(r=>({key:r.key||"",value:r.value||"",enabled:r.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([r,n])=>({key:r,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,r){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===r);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let r=this.suite.requests.find(n=>n.slug===e);if(r)return this.resolveRequest(r)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){let n=this.resolveRequest(r);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let r of this.suite.requests){if(!r.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);r.slug=Bi(r.name||"request",i)}let n=this.resolveRequest(r);if(n){let i=this.collectionService.getCollection(r.collectionId);e.push({id:`${r.collectionId}:${r.requestId}`,collectionId:r.collectionId,requestId:r.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:r.folderPath||"",enabled:r.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(r.slug),slug:r.slug})}}return e}getSelectedRequests(e){let r=[];for(let n of e){let[i,s]=n.split(":"),a=this.suite?.requests.find(u=>u.collectionId===i&&u.requestId===s);if(a){let u=this.resolveRequest(a);u&&r.push(u)}}return r}addRequest(e,r){if(this.suite){if(this.suiteDir&&r){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=Bi(e.name||r.name||"request",n)}this.saveSuiteRequest(e.slug,r)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let r=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!r.has(e))return e;let n=2;for(;r.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(r=>r.requestId!==e))}reorderRequests(e){if(!this.suite)return;let r=new Map;for(let i of this.suite.requests)r.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=r.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,r){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,r);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=r.name||n.name,n.method=r.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let r=this.suite.requests.find(s=>s.slug===e);if(!r)return;let n=this.collectionService.getCollection(r.collectionId);if(!n)return;let i=this.findRequestInCollection(n,r.requestId);if(i)return this.saveSuiteRequest(e,i.request),r.name=i.request.name||r.name,r.method=i.request.method||r.method,i.request}};export{FE as BODY_FILE_MAP,_l as CONFIG_FILES,Za as CollectionLoader,Tc as CollectionLoaderFactory,Fc as CollectionRequestExecutor,qc as CollectionService,wl as ConfigService,Bu as CookieJar,$c as CookieService,lt as CookieUtils,er as DEFAULT_CONFIG,Fn as DEFAULT_REQUEST_SETTINGS,Nm as DEFAULT_SUITE_CONFIG,KE as DYNAMIC_VARIABLES,Go as DataFileParser,Dc as EnvironmentConfigService,Hi as EnvironmentResolver,Dl as ExampleGenerator,Oc as FetchHttpClient,ju as FolderCollectionLoader,$s as FolderCollectionStore,ob as ForgeContainer,Ns as ForgeEnv,jc as GraphQLSchemaService,dw as HTTP_METHOD_MAP,Df as HTTP_METHOD_REVERSE,Cl as HistoryAnalyzer,Ff as HtmlReportGenerator,Ko as HttpForgeParser,Wi as HttpRequestService,uw as InMemoryCookieJar,Yi as InterceptorChain,bl as JsonCollectionLoader,fv as LoggingRequestInterceptor,yr as METADATA_FILES,rp as ModuleLoader,Pc as NodeFileSystem,Do as NodeHttpClient,kc as OAuth2TokenManager,Nl as OpenApiExporter,Xl as OpenApiImporter,Uu as ParserRegistry,Mc as PersistentCookieJar,Zo as ROOT_DIRECTORIES,Zl as RefResolver,gl as RequestExecutor,Bc as RequestHistoryService,Ic as RequestHistoryStore,Lc as RequestPreparer,zo as RequestPreprocessor,Rc as RequestScriptSession,pw as ResultStorageService,hv as RetryErrorInterceptor,Lu as SCHEMA_FILES,cn as SCRIPTS_DIR,ch as SCRIPT_FILES,eu as SchemaInferenceService,to as SchemaInferrer,tu as ScriptAnalyzer,Zi as ScriptExecutor,Nf as ServiceContainer,ne as ServiceIdentifiers,gw as StatisticsService,yw as TestSuiteService,vw as TestSuiteStore,dv as TimingResponseInterceptor,Dn as UrlBuilder,No as VariableInterpolator,Mo as VariableResolver,ZU as applyExtractionPlan,Yu as applyFilterChain,To as augmentWithDynamicVars,QU as buildExtractionPlan,fA as buildResultFileName,UE as cleanupOldBodyFiles,ip as concatenateScripts,Cc as createExpectChain,PR as createLodashShim,XS as createModuleLoader,np as createMomentShim,eb as createResponseObject,OU as createScriptConsole,tb as createTestFunction,ZN as createVariableResolver,vN as deepClone,iv as deleteItemFromTree,GU as detectSensitiveData,$o as evaluateExpression,M4 as expandSummary,NU as exportCollectionToRestClient,nv as findItemById,_N as formatBytes,sp as formatConsoleOutput,wN as formatDuration,at as generateId,Bi as generateSlug,rv as generateUUID,C4 as getCompletions,MU as getRestClientExportFolder,aA as getServiceContainer,xc as hasChanged,qo as isExpression,SN as isPlainObject,ph as isSystemEnvironmentFile,Hu as loadEnvironmentsFromFolder,Fu as mergeHeadersCaseInsensitive,cv as mergeRequestSettings,rb as normalizeHeaders,Wu as parseFilterChain,ap as parsePostmanEnvironment,YU as parsePostmanEnvironmentFile,E4 as parseQueryContext,jE as prepareBodyForSave,LE as readBodyFromDir,BE as readSchemaFile,fh as readScriptsFromDir,fb as redactBody,hb as redactFullResponse,pb as redactFullResultDetails,Uc as redactHeaders,db as redactHistoryEntry,cb as redactUrl,oA as registerCoreServices,Vi as resolveDynamicVariable,VN as resolveDynamicVariablesInString,bN as safeJsonParse,xt as sanitizeName,sv as searchForItemPath,VE as sortItemsByOrder,Sl as writeEnvFile,op as writeFolderItems,HE as writeSchemaFiles,Ac as writeScriptFile,dh as writeScriptsToDir};
|