@http-forge/core 0.2.15 → 0.2.18
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/README.md +41 -0
- package/dist/index.js +173 -173
- package/dist/index.mjs +173 -173
- package/dist/infrastructure/openapi/openapi-exporter.d.ts +12 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,237 +1,237 @@
|
|
|
1
|
-
"use strict";var C$=Object.create;var gh=Object.defineProperty;var E$=Object.getOwnPropertyDescriptor;var x$=Object.getOwnPropertyNames;var R$=Object.getPrototypeOf,I$=Object.prototype.hasOwnProperty;var F=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),O$=(r,e)=>{for(var t in e)gh(r,t,{get:e[t],enumerable:!0})},VC=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of x$(e))!I$.call(r,i)&&i!==t&&gh(r,i,{get:()=>e[i],enumerable:!(n=E$(e,i))||n.enumerable});return r};var Se=(r,e,t)=>(t=r!=null?C$(R$(r)):{},VC(e||!r||!r.__esModule?gh(t,"default",{value:r,enumerable:!0}):t,r)),P$=r=>VC(gh({},"__esModule",{value:!0}),r);var sE=F((Sl,hc)=>{(function(){var r,e="4.17.21",t=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,m=2,g=4,S=1,E=2,C=1,x=2,A=4,q=8,j=16,Y=32,V=64,K=128,ee=256,k=512,w=30,P="...",$=800,D=16,L=1,z=2,Z=3,ie=1/0,fe=9007199254740991,wt=17976931348623157e292,Ce=NaN,he=4294967295,Xe=he-1,Ct=he>>>1,Mt=[["ary",K],["bind",C],["bindKey",x],["curry",q],["curryRight",j],["flip",k],["partial",Y],["partialRight",V],["rearg",ee]],le="[object Arguments]",Xn="[object Array]",Ou="[object AsyncFunction]",ft="[object Boolean]",wn="[object Date]",us="[object DOMException]",jt="[object Error]",dt="[object Function]",ei="[object GeneratorFunction]",tr="[object Map]",Qr="[object Number]",sg="[object Null]",Cn="[object Object]",Wf="[object Promise]",og="[object Proxy]",cs="[object RegExp]",yt="[object Set]",Ai="[object String]",Ia="[object Symbol]",ag="[object Undefined]",fs="[object WeakMap]",fr="[object WeakSet]",ds="[object ArrayBuffer]",ti="[object DataView]",hs="[object Float32Array]",et="[object Float64Array]",Oa="[object Int8Array]",Pa="[object Int16Array]",ps="[object Int32Array]",So="[object Uint8Array]",ms="[object Uint8ClampedArray]",ri="[object Uint16Array]",gs="[object Uint32Array]",lg=/\b__p \+= '';/g,ka=/\b(__p \+=) '' \+/g,ug=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ys=/&(?:amp|lt|gt|quot|#39);/g,Ti=/[&<>"']/g,Pu=RegExp(ys.source),Aa=RegExp(Ti.source),oe=/<%-([\s\S]+?)%>/g,cg=/<%([\s\S]+?)%>/g,Yf=/<%=([\s\S]+?)%>/g,En=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,br=/^\w*$/,Me=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bo=/[\\^$.*+?()[\]{}|]/g,Ge=RegExp(bo.source),qi=/^\s+/,fg=/\s/,Ta=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vt=/\{\n\/\* \[wrapped with (.+)\] \*/,xn=/,? & /,Zr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,kt=/[()=,{}\[\]\/\s]/,jr=/\\(\\)?/g,Rn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ni=/\w*$/,dg=/^[-+]0x[0-9a-f]+$/i,hg=/^0b[01]+$/i,_o=/^\[object .+?Constructor\]$/,Jf=/^0o[0-7]+$/i,pg=/^(?:0|[1-9]\d*)$/,vs=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ii=/($^)/,zf=/['\n\r\u2028\u2029\\]/g,qa="\\ud800-\\udfff",mg="\\u0300-\\u036f",gg="\\ufe20-\\ufe2f",vt="\\u20d0-\\u20ff",Na=mg+gg+vt,Kf="\\u2700-\\u27bf",ku="a-z\\xdf-\\xf6\\xf8-\\xff",Gf="\\xac\\xb1\\xd7\\xf7",yg="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",vg="\\u2000-\\u206f",Sg=" \\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",Qf="A-Z\\xc0-\\xd6\\xd8-\\xde",Zf="\\ufe0e\\ufe0f",Xf=Gf+yg+vg+Sg,Ma="['\u2019]",ed="["+qa+"]",td="["+Xf+"]",$a="["+Na+"]",rd="\\d+",nd="["+Kf+"]",id="["+ku+"]",Ss="[^"+qa+Xf+rd+Kf+ku+Qf+"]",bs="\\ud83c[\\udffb-\\udfff]",sd="(?:"+$a+"|"+bs+")",_s="[^"+qa+"]",Ur="(?:\\ud83c[\\udde6-\\uddff]){2}",Au="[\\ud800-\\udbff][\\udc00-\\udfff]",ws="["+Qf+"]",od="\\u200d",ad="(?:"+id+"|"+Ss+")",bg="(?:"+ws+"|"+Ss+")",ld="(?:"+Ma+"(?:d|ll|m|re|s|t|ve))?",ud="(?:"+Ma+"(?:D|LL|M|RE|S|T|VE))?",cd=sd+"?",Da="["+Zf+"]?",_g="(?:"+od+"(?:"+[_s,Ur,Au].join("|")+")"+Da+cd+")*",fd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",wg="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",dd=Da+cd+_g,Cg="(?:"+[nd,Ur,Au].join("|")+")"+dd,Eg="(?:"+[_s+$a+"?",$a,Ur,Au,ed].join("|")+")",xg=RegExp(Ma,"g"),Rg=RegExp($a,"g"),Tu=RegExp(bs+"(?="+bs+")|"+Eg+dd,"g"),Ig=RegExp([ws+"?"+id+"+"+ld+"(?="+[td,ws,"$"].join("|")+")",bg+"+"+ud+"(?="+[td,ws+ad,"$"].join("|")+")",ws+"?"+ad+"+"+ld,ws+"+"+ud,wg,fd,rd,Cg].join("|"),"g"),Og=RegExp("["+od+qa+Na+Zf+"]"),Pg=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,kg=["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"],Ag=-1,lt={};lt[hs]=lt[et]=lt[Oa]=lt[Pa]=lt[ps]=lt[So]=lt[ms]=lt[ri]=lt[gs]=!0,lt[le]=lt[Xn]=lt[ds]=lt[ft]=lt[ti]=lt[wn]=lt[jt]=lt[dt]=lt[tr]=lt[Qr]=lt[Cn]=lt[cs]=lt[yt]=lt[Ai]=lt[fs]=!1;var it={};it[le]=it[Xn]=it[ds]=it[ti]=it[ft]=it[wn]=it[hs]=it[et]=it[Oa]=it[Pa]=it[ps]=it[tr]=it[Qr]=it[Cn]=it[cs]=it[yt]=it[Ai]=it[Ia]=it[So]=it[ms]=it[ri]=it[gs]=!0,it[jt]=it[dt]=it[fs]=!1;var Tg={\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"},qu={"&":"&","<":"<",">":">",'"':""","'":"'"},Nu={"&":"&","<":"<",">":">",""":'"',"'":"'"},qg={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},hd=parseFloat,pd=parseInt,md=typeof global=="object"&&global&&global.Object===Object&&global,Ng=typeof self=="object"&&self&&self.Object===Object&&self,$t=md||Ng||Function("return this")(),Mu=typeof Sl=="object"&&Sl&&!Sl.nodeType&&Sl,si=Mu&&typeof hc=="object"&&hc&&!hc.nodeType&&hc,ut=si&&si.exports===Mu,Ni=ut&&md.process,Wt=function(){try{var U=si&&si.require&&si.require("util").types;return U||Ni&&Ni.binding&&Ni.binding("util")}catch{}}(),gd=Wt&&Wt.isArrayBuffer,$u=Wt&&Wt.isDate,yd=Wt&&Wt.isMap,vd=Wt&&Wt.isRegExp,wo=Wt&&Wt.isSet,In=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,Ye=U==null?0:U.length;++ve<Ye;){var At=U[ve];J(ae,At,H(At),U)}return ae}function Et(U,J){for(var H=-1,ae=U==null?0:U.length;++H<ae&&J(U[H],H,U)!==!1;);return U}function $g(U,J){for(var H=U==null?0:U.length;H--&&J(U[H],H,U)!==!1;);return U}function Fa(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 oi(U,J){for(var H=-1,ae=U==null?0:U.length,ve=0,Ye=[];++H<ae;){var At=U[H];J(At,H,U)&&(Ye[ve++]=At)}return Ye}function La(U,J){var H=U==null?0:U.length;return!!H&&Cs(U,J,0)>-1}function Du(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 tt(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 Fu(U,J,H,ae){var ve=-1,Ye=U==null?0:U.length;for(ae&&Ye&&(H=U[++ve]);++ve<Ye;)H=J(H,U[ve],ve,U);return H}function Dg(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 Lu(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 Sd=ju("length");function Fg(U){return U.split("")}function Lg(U){return U.match(Zr)||[]}function bd(U,J,H){var ae;return H(U,function(ve,Ye,At){if(J(ve,Ye,At))return ae=Ye,!1}),ae}function ja(U,J,H,ae){for(var ve=U.length,Ye=H+(ae?1:-1);ae?Ye--:++Ye<ve;)if(J(U[Ye],Ye,U))return Ye;return-1}function Cs(U,J,H){return J===J?Id(U,J,H):ja(U,wd,H)}function _d(U,J,H,ae){for(var ve=H-1,Ye=U.length;++ve<Ye;)if(ae(U[ve],J))return ve;return-1}function wd(U){return U!==U}function Mi(U,J){var H=U==null?0:U.length;return H?Bu(U,J)/H:Ce}function ju(U){return function(J){return J==null?r:J[U]}}function Co(U){return function(J){return U==null?r:U[J]}}function Cd(U,J,H,ae,ve){return ve(U,function(Ye,At,Ae){H=ae?(ae=!1,Ye):J(H,Ye,At,Ae)}),H}function Uu(U,J){var H=U.length;for(U.sort(J);H--;)U[H]=U[H].value;return U}function Bu(U,J){for(var H,ae=-1,ve=U.length;++ae<ve;){var Ye=J(U[ae]);Ye!==r&&(H=H===r?Ye:H+Ye)}return H}function Hu(U,J){for(var H=-1,ae=Array(U);++H<U;)ae[H]=J(H);return ae}function jg(U,J){return tt(J,function(H){return[H,U[H]]})}function Ed(U){return U&&U.slice(0,Ua(U)+1).replace(qi,"")}function rr(U){return function(J){return U(J)}}function Vu(U,J){return tt(J,function(H){return U[H]})}function Es(U,J){return U.has(J)}function st(U,J){for(var H=-1,ae=U.length;++H<ae&&Cs(J,U[H],0)>-1;);return H}function xd(U,J){for(var H=U.length;H--&&Cs(J,U[H],0)>-1;);return H}function Ug(U,J){for(var H=U.length,ae=0;H--;)U[H]===J&&++ae;return ae}var Rd=Co(Tg),Bg=Co(qu);function Hg(U){return"\\"+qg[U]}function Vg(U,J){return U==null?r:U[J]}function en(U){return Og.test(U)}function Wg(U){return Pg.test(U)}function Yg(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 Eo(U,J){return function(H){return U(J(H))}}function Br(U,J){for(var H=-1,ae=U.length,ve=0,Ye=[];++H<ae;){var At=U[H];(At===J||At===f)&&(U[H]=f,Ye[ve++]=H)}return Ye}function xs(U){var J=-1,H=Array(U.size);return U.forEach(function(ae){H[++J]=ae}),H}function Jg(U){var J=-1,H=Array(U.size);return U.forEach(function(ae){H[++J]=[ae,ae]}),H}function Id(U,J,H){for(var ae=H-1,ve=U.length;++ae<ve;)if(U[ae]===J)return ae;return-1}function zg(U,J,H){for(var ae=H+1;ae--;)if(U[ae]===J)return ae;return ae}function ai(U){return en(U)?Gg(U):Sd(U)}function dr(U){return en(U)?Qg(U):Fg(U)}function Ua(U){for(var J=U.length;J--&&fg.test(U.charAt(J)););return J}var Kg=Co(Nu);function Gg(U){for(var J=Tu.lastIndex=0;Tu.test(U);)++J;return J}function Qg(U){return U.match(Tu)||[]}function Zg(U){return U.match(Ig)||[]}var Xg=function U(J){J=J==null?$t:li.defaults($t.Object(),J,li.pick($t,kg));var H=J.Array,ae=J.Date,ve=J.Error,Ye=J.Function,At=J.Math,Ae=J.Object,On=J.RegExp,Od=J.String,_r=J.TypeError,xo=H.prototype,Pd=Ye.prototype,Rs=Ae.prototype,Ba=J["__core-js_shared__"],Ro=Pd.toString,Ke=Rs.hasOwnProperty,ey=0,kd=function(){var o=/[^.]+$/.exec(Ba&&Ba.keys&&Ba.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Ha=Rs.toString,ty=Ro.call(Ae),ry=$t._,ny=On("^"+Ro.call(Ke).replace(bo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Va=ut?J.Buffer:r,ui=J.Symbol,Wa=J.Uint8Array,Ad=Va?Va.allocUnsafe:r,Ya=Eo(Ae.getPrototypeOf,Ae),Td=Ae.create,qd=Rs.propertyIsEnumerable,$i=xo.splice,Nd=ui?ui.isConcatSpreadable:r,Io=ui?ui.iterator:r,Di=ui?ui.toStringTag:r,Ja=function(){try{var o=Do(Ae,"defineProperty");return o({},"",{}),o}catch{}}(),iy=J.clearTimeout!==$t.clearTimeout&&J.clearTimeout,sy=ae&&ae.now!==$t.Date.now&&ae.now,oy=J.setTimeout!==$t.setTimeout&&J.setTimeout,za=At.ceil,Oo=At.floor,Ka=Ae.getOwnPropertySymbols,Md=Va?Va.isBuffer:r,Po=J.isFinite,Is=xo.join,Ga=Eo(Ae.keys,Ae),xt=At.max,St=At.min,$d=ae.now,Dd=J.parseInt,Fd=At.random,ay=xo.reverse,Yu=Do(J,"DataView"),ko=Do(J,"Map"),Ju=Do(J,"Promise"),Os=Do(J,"Set"),Ao=Do(J,"WeakMap"),To=Do(Ae,"create"),Qa=Ao&&new Ao,Ps={},ly=Fo(Yu),uy=Fo(ko),cy=Fo(Ju),fy=Fo(Os),dy=Fo(Ao),Za=ui?ui.prototype:r,qo=Za?Za.valueOf:r,Ld=Za?Za.toString:r;function I(o){if(Rt(o)&&!Ee(o)&&!(o instanceof Ie)){if(o instanceof wr)return o;if(Ke.call(o,"__wrapped__"))return uC(o)}return new wr(o)}var ks=function(){function o(){}return function(l){if(!bt(l))return{};if(Td)return Td(l);o.prototype=l;var d=new o;return o.prototype=r,d}}();function Xa(){}function wr(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=r}I.templateSettings={escape:oe,evaluate:cg,interpolate:Yf,variable:"",imports:{_:I}},I.prototype=Xa.prototype,I.prototype.constructor=I,wr.prototype=ks(Xa.prototype),wr.prototype.constructor=wr;function Ie(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=he,this.__views__=[]}function hy(){var o=new Ie(this.__wrapped__);return o.__actions__=Er(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Er(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Er(this.__views__),o}function py(){if(this.__filtered__){var o=new Ie(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function my(){var o=this.__wrapped__.value(),l=this.__dir__,d=Ee(o),v=l<0,_=d?o.length:0,O=GA(0,_,this.__views__),T=O.start,M=O.end,B=M-T,G=v?M:T-1,Q=this.__iteratees__,X=Q.length,re=0,ue=St(B,this.__takeCount__);if(!d||!v&&_==B&&ue==B)return Tw(o,this.__actions__);var me=[];e:for(;B--&&re<ue;){G+=l;for(var Pe=-1,ge=o[G];++Pe<X;){var Fe=Q[Pe],Ue=Fe.iteratee,Yr=Fe.type,mr=Ue(ge);if(Yr==z)ge=mr;else if(!mr){if(Yr==L)continue e;break e}}me[re++]=ge}return me}Ie.prototype=ks(Xa.prototype),Ie.prototype.constructor=Ie;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 el(){this.__data__=To?To(null):{},this.size=0}function gy(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function yy(o){var l=this.__data__;if(To){var d=l[o];return d===a?r:d}return Ke.call(l,o)?l[o]:r}function vy(o){var l=this.__data__;return To?l[o]!==r:Ke.call(l,o)}function Sy(o,l){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=To&&l===r?a:l,this}Pn.prototype.clear=el,Pn.prototype.delete=gy,Pn.prototype.get=yy,Pn.prototype.has=vy,Pn.prototype.set=Sy;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 by(){this.__data__=[],this.size=0}function jd(o){var l=this.__data__,d=Cr(l,o);if(d<0)return!1;var v=l.length-1;return d==v?l.pop():$i.call(l,d,1),--this.size,!0}function _y(o){var l=this.__data__,d=Cr(l,o);return d<0?r:l[d][1]}function wy(o){return Cr(this.__data__,o)>-1}function Ud(o,l){var d=this.__data__,v=Cr(d,o);return v<0?(++this.size,d.push([o,l])):d[v][1]=l,this}kn.prototype.clear=by,kn.prototype.delete=jd,kn.prototype.get=_y,kn.prototype.has=wy,kn.prototype.set=Ud;function An(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 Cy(){this.size=0,this.__data__={hash:new Pn,map:new(ko||kn),string:new Pn}}function Ey(o){var l=oh(this,o).delete(o);return this.size-=l?1:0,l}function ci(o){return oh(this,o).get(o)}function Bd(o){return oh(this,o).has(o)}function xy(o,l){var d=oh(this,o),v=d.size;return d.set(o,l),this.size+=d.size==v?0:1,this}An.prototype.clear=Cy,An.prototype.delete=Ey,An.prototype.get=ci,An.prototype.has=Bd,An.prototype.set=xy;function Fi(o){var l=-1,d=o==null?0:o.length;for(this.__data__=new An;++l<d;)this.add(o[l])}function Ry(o){return this.__data__.set(o,a),this}function te(o){return this.__data__.has(o)}Fi.prototype.add=Fi.prototype.push=Ry,Fi.prototype.has=te;function Hr(o){var l=this.__data__=new kn(o);this.size=l.size}function Iy(){this.__data__=new kn,this.size=0}function Hd(o){var l=this.__data__,d=l.delete(o);return this.size=l.size,d}function He(o){return this.__data__.get(o)}function tl(o){return this.__data__.has(o)}function Vd(o,l){var d=this.__data__;if(d instanceof kn){var v=d.__data__;if(!ko||v.length<t-1)return v.push([o,l]),this.size=++d.size,this;d=this.__data__=new An(v)}return d.set(o,l),this.size=d.size,this}Hr.prototype.clear=Iy,Hr.prototype.delete=Hd,Hr.prototype.get=He,Hr.prototype.has=tl,Hr.prototype.set=Vd;function rl(o,l){var d=Ee(o),v=!d&&Lo(o),_=!d&&!v&&Ms(o),O=!d&&!v&&!_&&ll(o),T=d||v||_||O,M=T?Hu(o.length,Od):[],B=M.length;for(var G in o)(l||Ke.call(o,G))&&!(T&&(G=="length"||_&&(G=="offset"||G=="parent")||O&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||Hi(G,B)))&&M.push(G);return M}function Wd(o){var l=o.length;return l?o[Uy(0,l-1)]:r}function Oy(o,l){return ah(Er(o),Li(l,0,o.length))}function Py(o){return ah(Er(o))}function zu(o,l,d){(d!==r&&!Mn(o[l],d)||d===r&&!(l in o))&&Tn(o,l,d)}function No(o,l,d){var v=o[l];(!(Ke.call(o,l)&&Mn(v,d))||d===r&&!(l in o))&&Tn(o,l,d)}function Cr(o,l){for(var d=o.length;d--;)if(Mn(o[d][0],l))return d;return-1}function ky(o,l,d,v){return fi(o,function(_,O,T){l(v,_,d(_),T)}),v}function Ku(o,l){return o&&hi(l,Yt(l),o)}function Ay(o,l){return o&&hi(l,Rr(l),o)}function Tn(o,l,d){l=="__proto__"&&Ja?Ja(o,l,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[l]=d}function nl(o,l){for(var d=-1,v=l.length,_=H(v),O=o==null;++d<v;)_[d]=O?r:dv(o,l[d]);return _}function Li(o,l,d){return o===o&&(d!==r&&(o=o<=d?o:d),l!==r&&(o=o>=l?o:l)),o}function hr(o,l,d,v,_,O){var T,M=l&h,B=l&m,G=l&g;if(d&&(T=_?d(o,v,_,O):d(o)),T!==r)return T;if(!bt(o))return o;var Q=Ee(o);if(Q){if(T=ZA(o),!M)return Er(o,T)}else{var X=nr(o),re=X==dt||X==ei;if(Ms(o))return Mw(o,M);if(X==Cn||X==le||re&&!_){if(T=B||re?{}:eC(o),!M)return B?UA(o,Ay(T,o)):jA(o,Ku(T,o))}else{if(!it[X])return _?o:{};T=XA(o,X,M)}}O||(O=new Hr);var ue=O.get(o);if(ue)return ue;O.set(o,T),PC(o)?o.forEach(function(ge){T.add(hr(ge,l,d,ge,o,O))}):IC(o)&&o.forEach(function(ge,Fe){T.set(Fe,hr(ge,l,d,Fe,o,O))});var me=G?B?Zy:Qy:B?Rr:Yt,Pe=Q?r:me(o);return Et(Pe||o,function(ge,Fe){Pe&&(Fe=ge,ge=o[Fe]),No(T,Fe,hr(ge,l,d,Fe,o,O))}),T}function Gu(o){var l=Yt(o);return function(d){return Yd(d,o,l)}}function Yd(o,l,d){var v=d.length;if(o==null)return!v;for(o=Ae(o);v--;){var _=d[v],O=l[_],T=o[_];if(T===r&&!(_ in o)||!O(T))return!1}return!0}function tn(o,l,d){if(typeof o!="function")throw new _r(i);return sc(function(){o.apply(r,d)},l)}function As(o,l,d,v){var _=-1,O=La,T=!0,M=o.length,B=[],G=l.length;if(!M)return B;d&&(l=tt(l,rr(d))),v?(O=Du,T=!1):l.length>=t&&(O=Es,T=!1,l=new Fi(l));e:for(;++_<M;){var Q=o[_],X=d==null?Q:d(Q);if(Q=v||Q!==0?Q:0,T&&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 fi=jw(rn),Jd=jw(Zu,!0);function Ty(o,l){var d=!0;return fi(o,function(v,_,O){return d=!!l(v,_,O),d}),d}function il(o,l,d){for(var v=-1,_=o.length;++v<_;){var O=o[v],T=l(O);if(T!=null&&(M===r?T===T&&!Wr(T):d(T,M)))var M=T,B=O}return B}function qy(o,l,d,v){var _=o.length;for(d=xe(d),d<0&&(d=-d>_?0:_+d),v=v===r||v>_?_:xe(v),v<0&&(v+=_),v=d>v?0:AC(v);d<v;)o[d++]=l;return o}function zd(o,l){var d=[];return fi(o,function(v,_,O){l(v,_,O)&&d.push(v)}),d}function Ut(o,l,d,v,_){var O=-1,T=o.length;for(d||(d=tT),_||(_=[]);++O<T;){var M=o[O];l>0&&d(M)?l>1?Ut(M,l-1,d,v,_):Xr(_,M):v||(_[_.length]=M)}return _}var Qu=Uw(),Kd=Uw(!0);function rn(o,l){return o&&Qu(o,l,Yt)}function Zu(o,l){return o&&Kd(o,l,Yt)}function nn(o,l){return oi(l,function(d){return Vi(o[d])})}function ji(o,l){l=qs(l,o);for(var d=0,v=l.length;o!=null&&d<v;)o=o[pi(l[d++])];return d&&d==v?o:r}function Gd(o,l,d){var v=l(o);return Ee(o)?v:Xr(v,d(o))}function zt(o){return o==null?o===r?ag:sg:Di&&Di in Ae(o)?KA(o):lT(o)}function Xu(o,l){return o>l}function Ny(o,l){return o!=null&&Ke.call(o,l)}function My(o,l){return o!=null&&l in Ae(o)}function $y(o,l,d){return o>=St(l,d)&&o<xt(l,d)}function ec(o,l,d){for(var v=d?Du:La,_=o[0].length,O=o.length,T=O,M=H(O),B=1/0,G=[];T--;){var Q=o[T];T&&l&&(Q=tt(Q,rr(l))),B=St(Q.length,B),M[T]=!d&&(l||_>=120&&Q.length>=120)?new Fi(T&&Q):r}Q=o[0];var X=-1,re=M[0];e:for(;++X<_&&G.length<B;){var ue=Q[X],me=l?l(ue):ue;if(ue=d||ue!==0?ue:0,!(re?Es(re,me):v(G,me,d))){for(T=O;--T;){var Pe=M[T];if(!(Pe?Es(Pe,me):v(o[T],me,d)))continue e}re&&re.push(me),G.push(ue)}}return G}function qn(o,l,d,v){return rn(o,function(_,O,T){l(v,d(_),O,T)}),v}function sn(o,l,d){l=qs(l,o),o=iC(o,l);var v=o==null?o:o[pi(ln(l))];return v==null?r:Jt(v,o,d)}function Qd(o){return Rt(o)&&zt(o)==le}function Dy(o){return Rt(o)&&zt(o)==ds}function Fy(o){return Rt(o)&&zt(o)==wn}function Mo(o,l,d,v,_){return o===l?!0:o==null||l==null||!Rt(o)&&!Rt(l)?o!==o&&l!==l:Ly(o,l,d,v,Mo,_)}function Ly(o,l,d,v,_,O){var T=Ee(o),M=Ee(l),B=T?Xn:nr(o),G=M?Xn:nr(l);B=B==le?Cn:B,G=G==le?Cn:G;var Q=B==Cn,X=G==Cn,re=B==G;if(re&&Ms(o)){if(!Ms(l))return!1;T=!0,Q=!1}if(re&&!Q)return O||(O=new Hr),T||ll(o)?Qw(o,l,d,v,_,O):JA(o,l,B,d,v,_,O);if(!(d&S)){var ue=Q&&Ke.call(o,"__wrapped__"),me=X&&Ke.call(l,"__wrapped__");if(ue||me){var Pe=ue?o.value():o,ge=me?l.value():l;return O||(O=new Hr),_(Pe,ge,d,v,O)}}return re?(O||(O=new Hr),zA(o,l,d,v,_,O)):!1}function tc(o){return Rt(o)&&nr(o)==tr}function di(o,l,d,v){var _=d.length,O=_,T=!v;if(o==null)return!O;for(o=Ae(o);_--;){var M=d[_];if(T&&M[2]?M[1]!==o[M[0]]:!(M[0]in o))return!1}for(;++_<O;){M=d[_];var B=M[0],G=o[B],Q=M[1];if(T&&M[2]){if(G===r&&!(B in o))return!1}else{var X=new Hr;if(v)var re=v(G,Q,B,o,l,X);if(!(re===r?Mo(Q,G,S|E,v,X):re))return!1}}return!0}function $o(o){if(!bt(o)||nT(o))return!1;var l=Vi(o)?ny:_o;return l.test(Fo(o))}function je(o){return Rt(o)&&zt(o)==cs}function c(o){return Rt(o)&&nr(o)==yt}function p(o){return Rt(o)&&hh(o.length)&&!!lt[zt(o)]}function y(o){return typeof o=="function"?o:o==null?Ir:typeof o=="object"?Ee(o)?ye(o[0],o[1]):se(o):BC(o)}function b(o){if(!ic(o))return Ga(o);var l=[];for(var d in Ae(o))Ke.call(o,d)&&d!="constructor"&&l.push(d);return l}function R(o){if(!bt(o))return aT(o);var l=ic(o),d=[];for(var v in o)v=="constructor"&&(l||!Ke.call(o,v))||d.push(v);return d}function N(o,l){return o<l}function W(o,l){var d=-1,v=xr(o)?H(o.length):[];return fi(o,function(_,O,T){v[++d]=l(_,O,T)}),v}function se(o){var l=ev(o);return l.length==1&&l[0][2]?rC(l[0][0],l[0][1]):function(d){return d===o||di(d,o,l)}}function ye(o,l){return rv(o)&&tC(l)?rC(pi(o),l):function(d){var v=dv(d,o);return v===r&&v===l?hv(d,o):Mo(l,v,S|E)}}function Oe(o,l,d,v,_){o!==l&&Qu(l,function(O,T){if(_||(_=new Hr),bt(O))Kt(o,l,T,d,Oe,v,_);else{var M=v?v(iv(o,T),O,T+"",o,l,_):r;M===r&&(M=O),zu(o,T,M)}},Rr)}function Kt(o,l,d,v,_,O,T){var M=iv(o,d),B=iv(l,d),G=T.get(B);if(G){zu(o,d,G);return}var Q=O?O(M,B,d+"",o,l,T):r,X=Q===r;if(X){var re=Ee(B),ue=!re&&Ms(B),me=!re&&!ue&&ll(B);Q=B,re||ue||me?Ee(M)?Q=M:Tt(M)?Q=Er(M):ue?(X=!1,Q=Mw(B,!0)):me?(X=!1,Q=$w(B,!0)):Q=[]:oc(B)||Lo(B)?(Q=M,Lo(M)?Q=TC(M):(!bt(M)||Vi(M))&&(Q=eC(B))):X=!1}X&&(T.set(B,Q),_(Q,B,v,O,T),T.delete(B)),zu(o,d,Q)}function on(o,l){var d=o.length;if(d)return l+=l<0?d:0,Hi(l,d)?o[l]:r}function Nn(o,l,d){l.length?l=tt(l,function(O){return Ee(O)?function(T){return ji(T,O.length===1?O[0]:O)}:O}):l=[Ir];var v=-1;l=tt(l,rr(pe()));var _=W(o,function(O,T,M){var B=tt(l,function(G){return G(O)});return{criteria:B,index:++v,value:O}});return Uu(_,function(O,T){return LA(O,T,d)})}function IA(o,l){return Rw(o,l,function(d,v){return hv(o,v)})}function Rw(o,l,d){for(var v=-1,_=l.length,O={};++v<_;){var T=l[v],M=ji(o,T);d(M,T)&&rc(O,qs(T,o),M)}return O}function OA(o){return function(l){return ji(l,o)}}function jy(o,l,d,v){var _=v?_d:Cs,O=-1,T=l.length,M=o;for(o===l&&(l=Er(l)),d&&(M=tt(o,rr(d)));++O<T;)for(var B=0,G=l[O],Q=d?d(G):G;(B=_(M,Q,B,v))>-1;)M!==o&&$i.call(M,B,1),$i.call(o,B,1);return o}function Iw(o,l){for(var d=o?l.length:0,v=d-1;d--;){var _=l[d];if(d==v||_!==O){var O=_;Hi(_)?$i.call(o,_,1):Vy(o,_)}}return o}function Uy(o,l){return o+Oo(Fd()*(l-o+1))}function PA(o,l,d,v){for(var _=-1,O=xt(za((l-o)/(d||1)),0),T=H(O);O--;)T[v?O:++_]=o,o+=d;return T}function By(o,l){var d="";if(!o||l<1||l>fe)return d;do l%2&&(d+=o),l=Oo(l/2),l&&(o+=o);while(l);return d}function Te(o,l){return sv(nC(o,l,Ir),o+"")}function kA(o){return Wd(ul(o))}function AA(o,l){var d=ul(o);return ah(d,Li(l,0,d.length))}function rc(o,l,d,v){if(!bt(o))return o;l=qs(l,o);for(var _=-1,O=l.length,T=O-1,M=o;M!=null&&++_<O;){var B=pi(l[_]),G=d;if(B==="__proto__"||B==="constructor"||B==="prototype")return o;if(_!=T){var Q=M[B];G=v?v(Q,B,M):r,G===r&&(G=bt(Q)?Q:Hi(l[_+1])?[]:{})}No(M,B,G),M=M[B]}return o}var Ow=Qa?function(o,l){return Qa.set(o,l),o}:Ir,TA=Ja?function(o,l){return Ja(o,"toString",{configurable:!0,enumerable:!1,value:mv(l),writable:!0})}:Ir;function qA(o){return ah(ul(o))}function an(o,l,d){var v=-1,_=o.length;l<0&&(l=-l>_?0:_+l),d=d>_?_:d,d<0&&(d+=_),_=l>d?0:d-l>>>0,l>>>=0;for(var O=H(_);++v<_;)O[v]=o[v+l];return O}function NA(o,l){var d;return fi(o,function(v,_,O){return d=l(v,_,O),!d}),!!d}function Zd(o,l,d){var v=0,_=o==null?v:o.length;if(typeof l=="number"&&l===l&&_<=Ct){for(;v<_;){var O=v+_>>>1,T=o[O];T!==null&&!Wr(T)&&(d?T<=l:T<l)?v=O+1:_=O}return _}return Hy(o,l,Ir,d)}function Hy(o,l,d,v){var _=0,O=o==null?0:o.length;if(O===0)return 0;l=d(l);for(var T=l!==l,M=l===null,B=Wr(l),G=l===r;_<O;){var Q=Oo((_+O)/2),X=d(o[Q]),re=X!==r,ue=X===null,me=X===X,Pe=Wr(X);if(T)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?_=Q+1:O=Q}return St(O,Xe)}function Pw(o,l){for(var d=-1,v=o.length,_=0,O=[];++d<v;){var T=o[d],M=l?l(T):T;if(!d||!Mn(M,B)){var B=M;O[_++]=T===0?0:T}}return O}function kw(o){return typeof o=="number"?o:Wr(o)?Ce:+o}function Vr(o){if(typeof o=="string")return o;if(Ee(o))return tt(o,Vr)+"";if(Wr(o))return Ld?Ld.call(o):"";var l=o+"";return l=="0"&&1/o==-ie?"-0":l}function Ts(o,l,d){var v=-1,_=La,O=o.length,T=!0,M=[],B=M;if(d)T=!1,_=Du;else if(O>=t){var G=l?null:WA(o);if(G)return xs(G);T=!1,_=Es,B=new Fi}else B=l?[]:M;e:for(;++v<O;){var Q=o[v],X=l?l(Q):Q;if(Q=d||Q!==0?Q:0,T&&X===X){for(var re=B.length;re--;)if(B[re]===X)continue e;l&&B.push(X),M.push(Q)}else _(B,X,d)||(B!==M&&B.push(X),M.push(Q))}return M}function Vy(o,l){return l=qs(l,o),o=iC(o,l),o==null||delete o[pi(ln(l))]}function Aw(o,l,d,v){return rc(o,l,d(ji(o,l)),v)}function Xd(o,l,d,v){for(var _=o.length,O=v?_:-1;(v?O--:++O<_)&&l(o[O],O,o););return d?an(o,v?0:O,v?O+1:_):an(o,v?O+1:0,v?_:O)}function Tw(o,l){var d=o;return d instanceof Ie&&(d=d.value()),Fu(l,function(v,_){return _.func.apply(_.thisArg,Xr([v],_.args))},d)}function Wy(o,l,d){var v=o.length;if(v<2)return v?Ts(o[0]):[];for(var _=-1,O=H(v);++_<v;)for(var T=o[_],M=-1;++M<v;)M!=_&&(O[_]=As(O[_]||T,o[M],l,d));return Ts(Ut(O,1),l,d)}function qw(o,l,d){for(var v=-1,_=o.length,O=l.length,T={};++v<_;){var M=v<O?l[v]:r;d(T,o[v],M)}return T}function Yy(o){return Tt(o)?o:[]}function Jy(o){return typeof o=="function"?o:Ir}function qs(o,l){return Ee(o)?o:rv(o,l)?[o]:lC(Qe(o))}var MA=Te;function Ns(o,l,d){var v=o.length;return d=d===r?v:d,!l&&d>=v?o:an(o,l,d)}var Nw=iy||function(o){return $t.clearTimeout(o)};function Mw(o,l){if(l)return o.slice();var d=o.length,v=Ad?Ad(d):new o.constructor(d);return o.copy(v),v}function zy(o){var l=new o.constructor(o.byteLength);return new Wa(l).set(new Wa(o)),l}function $A(o,l){var d=l?zy(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function DA(o){var l=new o.constructor(o.source,ni.exec(o));return l.lastIndex=o.lastIndex,l}function FA(o){return qo?Ae(qo.call(o)):{}}function $w(o,l){var d=l?zy(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function Dw(o,l){if(o!==l){var d=o!==r,v=o===null,_=o===o,O=Wr(o),T=l!==r,M=l===null,B=l===l,G=Wr(l);if(!M&&!G&&!O&&o>l||O&&T&&B&&!M&&!G||v&&T&&B||!d&&B||!_)return 1;if(!v&&!O&&!G&&o<l||G&&d&&_&&!v&&!O||M&&d&&_||!T&&_||!B)return-1}return 0}function LA(o,l,d){for(var v=-1,_=o.criteria,O=l.criteria,T=_.length,M=d.length;++v<T;){var B=Dw(_[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 Fw(o,l,d,v){for(var _=-1,O=o.length,T=d.length,M=-1,B=l.length,G=xt(O-T,0),Q=H(B+G),X=!v;++M<B;)Q[M]=l[M];for(;++_<T;)(X||_<O)&&(Q[d[_]]=o[_]);for(;G--;)Q[M++]=o[_++];return Q}function Lw(o,l,d,v){for(var _=-1,O=o.length,T=-1,M=d.length,B=-1,G=l.length,Q=xt(O-M,0),X=H(Q+G),re=!v;++_<Q;)X[_]=o[_];for(var ue=_;++B<G;)X[ue+B]=l[B];for(;++T<M;)(re||_<O)&&(X[ue+d[T]]=o[_++]);return X}function Er(o,l){var d=-1,v=o.length;for(l||(l=H(v));++d<v;)l[d]=o[d];return l}function hi(o,l,d,v){var _=!d;d||(d={});for(var O=-1,T=l.length;++O<T;){var M=l[O],B=v?v(d[M],o[M],M,d,o):r;B===r&&(B=o[M]),_?Tn(d,M,B):No(d,M,B)}return d}function jA(o,l){return hi(o,tv(o),l)}function UA(o,l){return hi(o,Zw(o),l)}function eh(o,l){return function(d,v){var _=Ee(d)?Mg:ky,O=l?l():{};return _(d,o,pe(v,2),O)}}function sl(o){return Te(function(l,d){var v=-1,_=d.length,O=_>1?d[_-1]:r,T=_>2?d[2]:r;for(O=o.length>3&&typeof O=="function"?(_--,O):r,T&&pr(d[0],d[1],T)&&(O=_<3?r:O,_=1),l=Ae(l);++v<_;){var M=d[v];M&&o(l,M,v,O)}return l})}function jw(o,l){return function(d,v){if(d==null)return d;if(!xr(d))return o(d,v);for(var _=d.length,O=l?_:-1,T=Ae(d);(l?O--:++O<_)&&v(T[O],O,T)!==!1;);return d}}function Uw(o){return function(l,d,v){for(var _=-1,O=Ae(l),T=v(l),M=T.length;M--;){var B=T[o?M:++_];if(d(O[B],B,O)===!1)break}return l}}function BA(o,l,d){var v=l&C,_=nc(o);function O(){var T=this&&this!==$t&&this instanceof O?_:o;return T.apply(v?d:this,arguments)}return O}function Bw(o){return function(l){l=Qe(l);var d=en(l)?dr(l):r,v=d?d[0]:l.charAt(0),_=d?Ns(d,1).join(""):l.slice(1);return v[o]()+_}}function ol(o){return function(l){return Fu(jC(LC(l).replace(xg,"")),o,"")}}function nc(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=ks(o.prototype),v=o.apply(d,l);return bt(v)?v:d}}function HA(o,l,d){var v=nc(o);function _(){for(var O=arguments.length,T=H(O),M=O,B=al(_);M--;)T[M]=arguments[M];var G=O<3&&T[0]!==B&&T[O-1]!==B?[]:Br(T,B);if(O-=G.length,O<d)return Jw(o,l,th,_.placeholder,r,T,G,r,r,d-O);var Q=this&&this!==$t&&this instanceof _?v:o;return Jt(Q,this,T)}return _}function Hw(o){return function(l,d,v){var _=Ae(l);if(!xr(l)){var O=pe(d,3);l=Yt(l),d=function(M){return O(_[M],M,_)}}var T=o(l,d,v);return T>-1?_[O?l[T]:T]:r}}function Vw(o){return Bi(function(l){var d=l.length,v=d,_=wr.prototype.thru;for(o&&l.reverse();v--;){var O=l[v];if(typeof O!="function")throw new _r(i);if(_&&!T&&sh(O)=="wrapper")var T=new wr([],!0)}for(v=T?v:d;++v<d;){O=l[v];var M=sh(O),B=M=="wrapper"?Xy(O):r;B&&nv(B[0])&&B[1]==(K|q|Y|ee)&&!B[4].length&&B[9]==1?T=T[sh(B[0])].apply(T,B[3]):T=O.length==1&&nv(O)?T[M]():T.thru(O)}return function(){var G=arguments,Q=G[0];if(T&&G.length==1&&Ee(Q))return T.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 th(o,l,d,v,_,O,T,M,B,G){var Q=l&K,X=l&C,re=l&x,ue=l&(q|j),me=l&k,Pe=re?r:nc(o);function ge(){for(var Fe=arguments.length,Ue=H(Fe),Yr=Fe;Yr--;)Ue[Yr]=arguments[Yr];if(ue)var mr=al(ge),Jr=Ug(Ue,mr);if(v&&(Ue=Fw(Ue,v,_,ue)),O&&(Ue=Lw(Ue,O,T,ue)),Fe-=Jr,ue&&Fe<G){var qt=Br(Ue,mr);return Jw(o,l,th,ge.placeholder,d,Ue,qt,M,B,G-Fe)}var $n=X?d:this,Yi=re?$n[o]:o;return Fe=Ue.length,M?Ue=uT(Ue,M):me&&Fe>1&&Ue.reverse(),Q&&B<Fe&&(Ue.length=B),this&&this!==$t&&this instanceof ge&&(Yi=Pe||nc(Yi)),Yi.apply($n,Ue)}return ge}function Ww(o,l){return function(d,v){return qn(d,o,l(v),{})}}function rh(o,l){return function(d,v){var _;if(d===r&&v===r)return l;if(d!==r&&(_=d),v!==r){if(_===r)return v;typeof d=="string"||typeof v=="string"?(d=Vr(d),v=Vr(v)):(d=kw(d),v=kw(v)),_=o(d,v)}return _}}function Ky(o){return Bi(function(l){return l=tt(l,rr(pe())),Te(function(d){var v=this;return o(l,function(_){return Jt(_,v,d)})})})}function nh(o,l){l=l===r?" ":Vr(l);var d=l.length;if(d<2)return d?By(l,o):l;var v=By(l,za(o/ai(l)));return en(l)?Ns(dr(v),0,o).join(""):v.slice(0,o)}function VA(o,l,d,v){var _=l&C,O=nc(o);function T(){for(var M=-1,B=arguments.length,G=-1,Q=v.length,X=H(Q+B),re=this&&this!==$t&&this instanceof T?O:o;++G<Q;)X[G]=v[G];for(;B--;)X[G++]=arguments[++M];return Jt(re,_?d:this,X)}return T}function Yw(o){return function(l,d,v){return v&&typeof v!="number"&&pr(l,d,v)&&(d=v=r),l=Wi(l),d===r?(d=l,l=0):d=Wi(d),v=v===r?l<d?1:-1:Wi(v),PA(l,d,v,o)}}function ih(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,_,O,T,M,B,G){var Q=l&q,X=Q?T:r,re=Q?r:T,ue=Q?O:r,me=Q?r:O;l|=Q?Y:V,l&=~(Q?V:Y),l&A||(l&=~(C|x));var Pe=[o,l,_,ue,X,me,re,M,B,G],ge=d.apply(r,Pe);return nv(o)&&sC(ge,Pe),ge.placeholder=v,oC(ge,o,l)}function Gy(o){var l=At[o];return function(d,v){if(d=un(d),v=v==null?0:St(xe(v),292),v&&Po(d)){var _=(Qe(d)+"e").split("e"),O=l(_[0]+"e"+(+_[1]+v));return _=(Qe(O)+"e").split("e"),+(_[0]+"e"+(+_[1]-v))}return l(d)}}var WA=Os&&1/xs(new Os([,-0]))[1]==ie?function(o){return new Os(o)}:vv;function zw(o){return function(l){var d=nr(l);return d==tr?Wu(l):d==yt?Jg(l):jg(l,o(l))}}function Ui(o,l,d,v,_,O,T,M){var B=l&x;if(!B&&typeof o!="function")throw new _r(i);var G=v?v.length:0;if(G||(l&=~(Y|V),v=_=r),T=T===r?T:xt(xe(T),0),M=M===r?M:xe(M),G-=_?_.length:0,l&V){var Q=v,X=_;v=_=r}var re=B?r:Xy(o),ue=[o,l,d,v,_,Q,X,O,T,M];if(re&&oT(ue,re),o=ue[0],l=ue[1],d=ue[2],v=ue[3],_=ue[4],M=ue[9]=ue[9]===r?B?0:o.length:xt(ue[9]-G,0),!M&&l&(q|j)&&(l&=~(q|j)),!l||l==C)var me=BA(o,l,d);else l==q||l==j?me=HA(o,l,M):(l==Y||l==(C|Y))&&!_.length?me=VA(o,l,d,v):me=th.apply(r,ue);var Pe=re?Ow:sC;return oC(Pe(me,ue),o,l)}function Kw(o,l,d,v){return o===r||Mn(o,Rs[d])&&!Ke.call(v,d)?l:o}function Gw(o,l,d,v,_,O){return bt(o)&&bt(l)&&(O.set(l,o),Oe(o,l,r,Gw,O),O.delete(l)),o}function YA(o){return oc(o)?r:o}function Qw(o,l,d,v,_,O){var T=d&S,M=o.length,B=l.length;if(M!=B&&!(T&&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&E?new Fi:r;for(O.set(o,l),O.set(l,o);++X<M;){var me=o[X],Pe=l[X];if(v)var ge=T?v(Pe,me,X,l,o,O):v(me,Pe,X,o,l,O);if(ge!==r){if(ge)continue;re=!1;break}if(ue){if(!Lu(l,function(Fe,Ue){if(!Es(ue,Ue)&&(me===Fe||_(me,Fe,d,v,O)))return ue.push(Ue)})){re=!1;break}}else if(!(me===Pe||_(me,Pe,d,v,O))){re=!1;break}}return O.delete(o),O.delete(l),re}function JA(o,l,d,v,_,O,T){switch(d){case ti:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case ds:return!(o.byteLength!=l.byteLength||!O(new Wa(o),new Wa(l)));case ft:case wn:case Qr:return Mn(+o,+l);case jt:return o.name==l.name&&o.message==l.message;case cs:case Ai:return o==l+"";case tr:var M=Wu;case yt:var B=v&S;if(M||(M=xs),o.size!=l.size&&!B)return!1;var G=T.get(o);if(G)return G==l;v|=E,T.set(o,l);var Q=Qw(M(o),M(l),v,_,O,T);return T.delete(o),Q;case Ia:if(qo)return qo.call(o)==qo.call(l)}return!1}function zA(o,l,d,v,_,O){var T=d&S,M=Qy(o),B=M.length,G=Qy(l),Q=G.length;if(B!=Q&&!T)return!1;for(var X=B;X--;){var re=M[X];if(!(T?re in l:Ke.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=T;++X<B;){re=M[X];var Fe=o[re],Ue=l[re];if(v)var Yr=T?v(Ue,Fe,re,l,o,O):v(Fe,Ue,re,o,l,O);if(!(Yr===r?Fe===Ue||_(Fe,Ue,d,v,O):Yr)){Pe=!1;break}ge||(ge=re=="constructor")}if(Pe&&!ge){var mr=o.constructor,Jr=l.constructor;mr!=Jr&&"constructor"in o&&"constructor"in l&&!(typeof mr=="function"&&mr instanceof mr&&typeof Jr=="function"&&Jr instanceof Jr)&&(Pe=!1)}return O.delete(o),O.delete(l),Pe}function Bi(o){return sv(nC(o,r,dC),o+"")}function Qy(o){return Gd(o,Yt,tv)}function Zy(o){return Gd(o,Rr,Zw)}var Xy=Qa?function(o){return Qa.get(o)}:vv;function sh(o){for(var l=o.name+"",d=Ps[l],v=Ke.call(Ps,l)?d.length:0;v--;){var _=d[v],O=_.func;if(O==null||O==o)return _.name}return l}function al(o){var l=Ke.call(I,"placeholder")?I:o;return l.placeholder}function pe(){var o=I.iteratee||gv;return o=o===gv?y:o,arguments.length?o(arguments[0],arguments[1]):o}function oh(o,l){var d=o.__data__;return rT(l)?d[typeof l=="string"?"string":"hash"]:d.map}function ev(o){for(var l=Yt(o),d=l.length;d--;){var v=l[d],_=o[v];l[d]=[v,_,tC(_)]}return l}function Do(o,l){var d=Vg(o,l);return $o(d)?d:r}function KA(o){var l=Ke.call(o,Di),d=o[Di];try{o[Di]=r;var v=!0}catch{}var _=Ha.call(o);return v&&(l?o[Di]=d:delete o[Di]),_}var tv=Ka?function(o){return o==null?[]:(o=Ae(o),oi(Ka(o),function(l){return qd.call(o,l)}))}:Sv,Zw=Ka?function(o){for(var l=[];o;)Xr(l,tv(o)),o=Ya(o);return l}:Sv,nr=zt;(Yu&&nr(new Yu(new ArrayBuffer(1)))!=ti||ko&&nr(new ko)!=tr||Ju&&nr(Ju.resolve())!=Wf||Os&&nr(new Os)!=yt||Ao&&nr(new Ao)!=fs)&&(nr=function(o){var l=zt(o),d=l==Cn?o.constructor:r,v=d?Fo(d):"";if(v)switch(v){case ly:return ti;case uy:return tr;case cy:return Wf;case fy:return yt;case dy:return fs}return l});function GA(o,l,d){for(var v=-1,_=d.length;++v<_;){var O=d[v],T=O.size;switch(O.type){case"drop":o+=T;break;case"dropRight":l-=T;break;case"take":l=St(l,o+T);break;case"takeRight":o=xt(o,l-T);break}}return{start:o,end:l}}function QA(o){var l=o.match(Vt);return l?l[1].split(xn):[]}function Xw(o,l,d){l=qs(l,o);for(var v=-1,_=l.length,O=!1;++v<_;){var T=pi(l[v]);if(!(O=o!=null&&d(o,T)))break;o=o[T]}return O||++v!=_?O:(_=o==null?0:o.length,!!_&&hh(_)&&Hi(T,_)&&(Ee(o)||Lo(o)))}function ZA(o){var l=o.length,d=new o.constructor(l);return l&&typeof o[0]=="string"&&Ke.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function eC(o){return typeof o.constructor=="function"&&!ic(o)?ks(Ya(o)):{}}function XA(o,l,d){var v=o.constructor;switch(l){case ds:return zy(o);case ft:case wn:return new v(+o);case ti:return $A(o,d);case hs:case et:case Oa:case Pa:case ps:case So:case ms:case ri:case gs:return $w(o,d);case tr:return new v;case Qr:case Ai:return new v(o);case cs:return DA(o);case yt:return new v;case Ia:return FA(o)}}function eT(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(Ta,`{
|
|
1
|
+
"use strict";var E$=Object.create;var mh=Object.defineProperty;var C$=Object.getOwnPropertyDescriptor;var x$=Object.getOwnPropertyNames;var R$=Object.getPrototypeOf,O$=Object.prototype.hasOwnProperty;var F=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),I$=(t,e)=>{for(var r in e)mh(t,r,{get:e[r],enumerable:!0})},VE=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of x$(e))!O$.call(t,i)&&i!==r&&mh(t,i,{get:()=>e[i],enumerable:!(n=C$(e,i))||n.enumerable});return t};var Se=(t,e,r)=>(r=t!=null?E$(R$(t)):{},VE(e||!t||!t.__esModule?mh(r,"default",{value:t,enumerable:!0}):r,t)),P$=t=>VE(mh({},"__esModule",{value:!0}),t);var sC=F((Sl,hc)=>{(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,E=2,C=1,x=2,A=4,T=8,j=16,Y=32,V=64,K=128,ee=256,k=512,w=30,P="...",$=800,D=16,L=1,z=2,Z=3,ie=1/0,fe=9007199254740991,wt=17976931348623157e292,Ee=NaN,he=4294967295,Xe=he-1,Et=he>>>1,Mt=[["ary",K],["bind",C],["bindKey",x],["curry",T],["curryRight",j],["flip",k],["partial",Y],["partialRight",V],["rearg",ee]],le="[object Arguments]",Xn="[object Array]",Iu="[object AsyncFunction]",ft="[object Boolean]",wn="[object Date]",us="[object DOMException]",jt="[object Error]",dt="[object Function]",ei="[object GeneratorFunction]",tr="[object Map]",Qr="[object Number]",ig="[object Null]",En="[object Object]",Vf="[object Promise]",sg="[object Proxy]",cs="[object RegExp]",yt="[object Set]",Ai="[object String]",Oa="[object Symbol]",og="[object Undefined]",fs="[object WeakMap]",dr="[object WeakSet]",ds="[object ArrayBuffer]",ti="[object DataView]",hs="[object Float32Array]",et="[object Float64Array]",Ia="[object Int8Array]",Pa="[object Int16Array]",ps="[object Int32Array]",So="[object Uint8Array]",ms="[object Uint8ClampedArray]",ri="[object Uint16Array]",gs="[object Uint32Array]",ag=/\b__p \+= '';/g,ka=/\b(__p \+=) '' \+/g,lg=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ys=/&(?:amp|lt|gt|quot|#39);/g,Ti=/[&<>"']/g,Pu=RegExp(ys.source),Aa=RegExp(Ti.source),oe=/<%-([\s\S]+?)%>/g,ug=/<%([\s\S]+?)%>/g,Wf=/<%=([\s\S]+?)%>/g,Cn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,_r=/^\w*$/,Me=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bo=/[\\^$.*+?()[\]{}|]/g,Ge=RegExp(bo.source),qi=/^\s+/,cg=/\s/,Ta=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Vt=/\{\n\/\* \[wrapped with (.+)\] \*/,xn=/,? & /,Zr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,kt=/[()=,{}\[\]\/\s]/,jr=/\\(\\)?/g,Rn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ni=/\w*$/,fg=/^[-+]0x[0-9a-f]+$/i,dg=/^0b[01]+$/i,_o=/^\[object .+?Constructor\]$/,Yf=/^0o[0-7]+$/i,hg=/^(?:0|[1-9]\d*)$/,vs=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ii=/($^)/,Jf=/['\n\r\u2028\u2029\\]/g,qa="\\ud800-\\udfff",pg="\\u0300-\\u036f",mg="\\ufe20-\\ufe2f",vt="\\u20d0-\\u20ff",Na=pg+mg+vt,zf="\\u2700-\\u27bf",ku="a-z\\xdf-\\xf6\\xf8-\\xff",Kf="\\xac\\xb1\\xd7\\xf7",gg="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",yg="\\u2000-\\u206f",vg=" \\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",Gf="A-Z\\xc0-\\xd6\\xd8-\\xde",Qf="\\ufe0e\\ufe0f",Zf=Kf+gg+yg+vg,Ma="['\u2019]",Xf="["+qa+"]",ed="["+Zf+"]",$a="["+Na+"]",td="\\d+",rd="["+zf+"]",nd="["+ku+"]",Ss="[^"+qa+Zf+td+zf+ku+Gf+"]",bs="\\ud83c[\\udffb-\\udfff]",id="(?:"+$a+"|"+bs+")",_s="[^"+qa+"]",Ur="(?:\\ud83c[\\udde6-\\uddff]){2}",Au="[\\ud800-\\udbff][\\udc00-\\udfff]",ws="["+Gf+"]",sd="\\u200d",od="(?:"+nd+"|"+Ss+")",Sg="(?:"+ws+"|"+Ss+")",ad="(?:"+Ma+"(?:d|ll|m|re|s|t|ve))?",ld="(?:"+Ma+"(?:D|LL|M|RE|S|T|VE))?",ud=id+"?",Da="["+Qf+"]?",bg="(?:"+sd+"(?:"+[_s,Ur,Au].join("|")+")"+Da+ud+")*",cd="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",_g="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",fd=Da+ud+bg,wg="(?:"+[rd,Ur,Au].join("|")+")"+fd,Eg="(?:"+[_s+$a+"?",$a,Ur,Au,Xf].join("|")+")",Cg=RegExp(Ma,"g"),xg=RegExp($a,"g"),Tu=RegExp(bs+"(?="+bs+")|"+Eg+fd,"g"),Rg=RegExp([ws+"?"+nd+"+"+ad+"(?="+[ed,ws,"$"].join("|")+")",Sg+"+"+ld+"(?="+[ed,ws+od,"$"].join("|")+")",ws+"?"+od+"+"+ad,ws+"+"+ld,_g,cd,td,wg].join("|"),"g"),Og=RegExp("["+sd+qa+Na+Qf+"]"),Ig=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pg=["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"],kg=-1,lt={};lt[hs]=lt[et]=lt[Ia]=lt[Pa]=lt[ps]=lt[So]=lt[ms]=lt[ri]=lt[gs]=!0,lt[le]=lt[Xn]=lt[ds]=lt[ft]=lt[ti]=lt[wn]=lt[jt]=lt[dt]=lt[tr]=lt[Qr]=lt[En]=lt[cs]=lt[yt]=lt[Ai]=lt[fs]=!1;var it={};it[le]=it[Xn]=it[ds]=it[ti]=it[ft]=it[wn]=it[hs]=it[et]=it[Ia]=it[Pa]=it[ps]=it[tr]=it[Qr]=it[En]=it[cs]=it[yt]=it[Ai]=it[Oa]=it[So]=it[ms]=it[ri]=it[gs]=!0,it[jt]=it[dt]=it[fs]=!1;var Ag={\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"},qu={"&":"&","<":"<",">":">",'"':""","'":"'"},Nu={"&":"&","<":"<",">":">",""":'"',"'":"'"},Tg={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},dd=parseFloat,hd=parseInt,pd=typeof global=="object"&&global&&global.Object===Object&&global,qg=typeof self=="object"&&self&&self.Object===Object&&self,$t=pd||qg||Function("return this")(),Mu=typeof Sl=="object"&&Sl&&!Sl.nodeType&&Sl,si=Mu&&typeof hc=="object"&&hc&&!hc.nodeType&&hc,ut=si&&si.exports===Mu,Ni=ut&&pd.process,Wt=function(){try{var U=si&&si.require&&si.require("util").types;return U||Ni&&Ni.binding&&Ni.binding("util")}catch{}}(),md=Wt&&Wt.isArrayBuffer,$u=Wt&&Wt.isDate,gd=Wt&&Wt.isMap,yd=Wt&&Wt.isRegExp,wo=Wt&&Wt.isSet,On=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 Ng(U,J,H,ae){for(var ve=-1,Ye=U==null?0:U.length;++ve<Ye;){var At=U[ve];J(ae,At,H(At),U)}return ae}function Ct(U,J){for(var H=-1,ae=U==null?0:U.length;++H<ae&&J(U[H],H,U)!==!1;);return U}function Mg(U,J){for(var H=U==null?0:U.length;H--&&J(U[H],H,U)!==!1;);return U}function Fa(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 oi(U,J){for(var H=-1,ae=U==null?0:U.length,ve=0,Ye=[];++H<ae;){var At=U[H];J(At,H,U)&&(Ye[ve++]=At)}return Ye}function La(U,J){var H=U==null?0:U.length;return!!H&&Es(U,J,0)>-1}function Du(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 tt(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 Fu(U,J,H,ae){var ve=-1,Ye=U==null?0:U.length;for(ae&&Ye&&(H=U[++ve]);++ve<Ye;)H=J(H,U[ve],ve,U);return H}function $g(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 Lu(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 vd=ju("length");function Dg(U){return U.split("")}function Fg(U){return U.match(Zr)||[]}function Sd(U,J,H){var ae;return H(U,function(ve,Ye,At){if(J(ve,Ye,At))return ae=Ye,!1}),ae}function ja(U,J,H,ae){for(var ve=U.length,Ye=H+(ae?1:-1);ae?Ye--:++Ye<ve;)if(J(U[Ye],Ye,U))return Ye;return-1}function Es(U,J,H){return J===J?Rd(U,J,H):ja(U,_d,H)}function bd(U,J,H,ae){for(var ve=H-1,Ye=U.length;++ve<Ye;)if(ae(U[ve],J))return ve;return-1}function _d(U){return U!==U}function Mi(U,J){var H=U==null?0:U.length;return H?Bu(U,J)/H:Ee}function ju(U){return function(J){return J==null?t:J[U]}}function Eo(U){return function(J){return U==null?t:U[J]}}function wd(U,J,H,ae,ve){return ve(U,function(Ye,At,Te){H=ae?(ae=!1,Ye):J(H,Ye,At,Te)}),H}function Uu(U,J){var H=U.length;for(U.sort(J);H--;)U[H]=U[H].value;return U}function Bu(U,J){for(var H,ae=-1,ve=U.length;++ae<ve;){var Ye=J(U[ae]);Ye!==t&&(H=H===t?Ye:H+Ye)}return H}function Hu(U,J){for(var H=-1,ae=Array(U);++H<U;)ae[H]=J(H);return ae}function Lg(U,J){return tt(J,function(H){return[H,U[H]]})}function Ed(U){return U&&U.slice(0,Ua(U)+1).replace(qi,"")}function rr(U){return function(J){return U(J)}}function Vu(U,J){return tt(J,function(H){return U[H]})}function Cs(U,J){return U.has(J)}function st(U,J){for(var H=-1,ae=U.length;++H<ae&&Es(J,U[H],0)>-1;);return H}function Cd(U,J){for(var H=U.length;H--&&Es(J,U[H],0)>-1;);return H}function jg(U,J){for(var H=U.length,ae=0;H--;)U[H]===J&&++ae;return ae}var xd=Eo(Ag),Ug=Eo(qu);function Bg(U){return"\\"+Tg[U]}function Hg(U,J){return U==null?t:U[J]}function en(U){return Og.test(U)}function Vg(U){return Ig.test(U)}function Wg(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 Co(U,J){return function(H){return U(J(H))}}function Br(U,J){for(var H=-1,ae=U.length,ve=0,Ye=[];++H<ae;){var At=U[H];(At===J||At===f)&&(U[H]=f,Ye[ve++]=H)}return Ye}function xs(U){var J=-1,H=Array(U.size);return U.forEach(function(ae){H[++J]=ae}),H}function Yg(U){var J=-1,H=Array(U.size);return U.forEach(function(ae){H[++J]=[ae,ae]}),H}function Rd(U,J,H){for(var ae=H-1,ve=U.length;++ae<ve;)if(U[ae]===J)return ae;return-1}function Jg(U,J,H){for(var ae=H+1;ae--;)if(U[ae]===J)return ae;return ae}function ai(U){return en(U)?Kg(U):vd(U)}function hr(U){return en(U)?Gg(U):Dg(U)}function Ua(U){for(var J=U.length;J--&&cg.test(U.charAt(J)););return J}var zg=Eo(Nu);function Kg(U){for(var J=Tu.lastIndex=0;Tu.test(U);)++J;return J}function Gg(U){return U.match(Tu)||[]}function Qg(U){return U.match(Rg)||[]}var Zg=function U(J){J=J==null?$t:li.defaults($t.Object(),J,li.pick($t,Pg));var H=J.Array,ae=J.Date,ve=J.Error,Ye=J.Function,At=J.Math,Te=J.Object,In=J.RegExp,Od=J.String,wr=J.TypeError,xo=H.prototype,Id=Ye.prototype,Rs=Te.prototype,Ba=J["__core-js_shared__"],Ro=Id.toString,Ke=Rs.hasOwnProperty,Xg=0,Pd=function(){var o=/[^.]+$/.exec(Ba&&Ba.keys&&Ba.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Ha=Rs.toString,ey=Ro.call(Te),ty=$t._,ry=In("^"+Ro.call(Ke).replace(bo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Va=ut?J.Buffer:t,ui=J.Symbol,Wa=J.Uint8Array,kd=Va?Va.allocUnsafe:t,Ya=Co(Te.getPrototypeOf,Te),Ad=Te.create,Td=Rs.propertyIsEnumerable,$i=xo.splice,qd=ui?ui.isConcatSpreadable:t,Oo=ui?ui.iterator:t,Di=ui?ui.toStringTag:t,Ja=function(){try{var o=Do(Te,"defineProperty");return o({},"",{}),o}catch{}}(),ny=J.clearTimeout!==$t.clearTimeout&&J.clearTimeout,iy=ae&&ae.now!==$t.Date.now&&ae.now,sy=J.setTimeout!==$t.setTimeout&&J.setTimeout,za=At.ceil,Io=At.floor,Ka=Te.getOwnPropertySymbols,Nd=Va?Va.isBuffer:t,Po=J.isFinite,Os=xo.join,Ga=Co(Te.keys,Te),xt=At.max,St=At.min,Md=ae.now,$d=J.parseInt,Dd=At.random,oy=xo.reverse,Yu=Do(J,"DataView"),ko=Do(J,"Map"),Ju=Do(J,"Promise"),Is=Do(J,"Set"),Ao=Do(J,"WeakMap"),To=Do(Te,"create"),Qa=Ao&&new Ao,Ps={},ay=Fo(Yu),ly=Fo(ko),uy=Fo(Ju),cy=Fo(Is),fy=Fo(Ao),Za=ui?ui.prototype:t,qo=Za?Za.valueOf:t,Fd=Za?Za.toString:t;function O(o){if(Rt(o)&&!Ce(o)&&!(o instanceof Ie)){if(o instanceof Er)return o;if(Ke.call(o,"__wrapped__"))return uE(o)}return new Er(o)}var ks=function(){function o(){}return function(l){if(!bt(l))return{};if(Ad)return Ad(l);o.prototype=l;var d=new o;return o.prototype=t,d}}();function Xa(){}function Er(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}O.templateSettings={escape:oe,evaluate:ug,interpolate:Wf,variable:"",imports:{_:O}},O.prototype=Xa.prototype,O.prototype.constructor=O,Er.prototype=ks(Xa.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 dy(){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 hy(){if(this.__filtered__){var o=new Ie(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function py(){var o=this.__wrapped__.value(),l=this.__dir__,d=Ce(o),v=l<0,_=d?o.length:0,I=GA(0,_,this.__views__),q=I.start,M=I.end,B=M-q,G=v?M:q-1,Q=this.__iteratees__,X=Q.length,re=0,ue=St(B,this.__takeCount__);if(!d||!v&&_==B&&ue==B)return Tw(o,this.__actions__);var me=[];e:for(;B--&&re<ue;){G+=l;for(var ke=-1,ge=o[G];++ke<X;){var Fe=Q[ke],Ue=Fe.iteratee,Yr=Fe.type,gr=Ue(ge);if(Yr==z)ge=gr;else if(!gr){if(Yr==L)continue e;break e}}me[re++]=ge}return me}Ie.prototype=ks(Xa.prototype),Ie.prototype.constructor=Ie;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 el(){this.__data__=To?To(null):{},this.size=0}function my(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function gy(o){var l=this.__data__;if(To){var d=l[o];return d===a?t:d}return Ke.call(l,o)?l[o]:t}function yy(o){var l=this.__data__;return To?l[o]!==t:Ke.call(l,o)}function vy(o,l){var d=this.__data__;return this.size+=this.has(o)?0:1,d[o]=To&&l===t?a:l,this}Pn.prototype.clear=el,Pn.prototype.delete=my,Pn.prototype.get=gy,Pn.prototype.has=yy,Pn.prototype.set=vy;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 Sy(){this.__data__=[],this.size=0}function Ld(o){var l=this.__data__,d=Cr(l,o);if(d<0)return!1;var v=l.length-1;return d==v?l.pop():$i.call(l,d,1),--this.size,!0}function by(o){var l=this.__data__,d=Cr(l,o);return d<0?t:l[d][1]}function _y(o){return Cr(this.__data__,o)>-1}function jd(o,l){var d=this.__data__,v=Cr(d,o);return v<0?(++this.size,d.push([o,l])):d[v][1]=l,this}kn.prototype.clear=Sy,kn.prototype.delete=Ld,kn.prototype.get=by,kn.prototype.has=_y,kn.prototype.set=jd;function An(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 wy(){this.size=0,this.__data__={hash:new Pn,map:new(ko||kn),string:new Pn}}function Ey(o){var l=sh(this,o).delete(o);return this.size-=l?1:0,l}function ci(o){return sh(this,o).get(o)}function Ud(o){return sh(this,o).has(o)}function Cy(o,l){var d=sh(this,o),v=d.size;return d.set(o,l),this.size+=d.size==v?0:1,this}An.prototype.clear=wy,An.prototype.delete=Ey,An.prototype.get=ci,An.prototype.has=Ud,An.prototype.set=Cy;function Fi(o){var l=-1,d=o==null?0:o.length;for(this.__data__=new An;++l<d;)this.add(o[l])}function xy(o){return this.__data__.set(o,a),this}function te(o){return this.__data__.has(o)}Fi.prototype.add=Fi.prototype.push=xy,Fi.prototype.has=te;function Hr(o){var l=this.__data__=new kn(o);this.size=l.size}function Ry(){this.__data__=new kn,this.size=0}function Bd(o){var l=this.__data__,d=l.delete(o);return this.size=l.size,d}function He(o){return this.__data__.get(o)}function tl(o){return this.__data__.has(o)}function Hd(o,l){var d=this.__data__;if(d instanceof kn){var v=d.__data__;if(!ko||v.length<r-1)return v.push([o,l]),this.size=++d.size,this;d=this.__data__=new An(v)}return d.set(o,l),this.size=d.size,this}Hr.prototype.clear=Ry,Hr.prototype.delete=Bd,Hr.prototype.get=He,Hr.prototype.has=tl,Hr.prototype.set=Hd;function rl(o,l){var d=Ce(o),v=!d&&Lo(o),_=!d&&!v&&Ms(o),I=!d&&!v&&!_&&ll(o),q=d||v||_||I,M=q?Hu(o.length,Od):[],B=M.length;for(var G in o)(l||Ke.call(o,G))&&!(q&&(G=="length"||_&&(G=="offset"||G=="parent")||I&&(G=="buffer"||G=="byteLength"||G=="byteOffset")||Hi(G,B)))&&M.push(G);return M}function Vd(o){var l=o.length;return l?o[jy(0,l-1)]:t}function Oy(o,l){return oh(xr(o),Li(l,0,o.length))}function Iy(o){return oh(xr(o))}function zu(o,l,d){(d!==t&&!Mn(o[l],d)||d===t&&!(l in o))&&Tn(o,l,d)}function No(o,l,d){var v=o[l];(!(Ke.call(o,l)&&Mn(v,d))||d===t&&!(l in o))&&Tn(o,l,d)}function Cr(o,l){for(var d=o.length;d--;)if(Mn(o[d][0],l))return d;return-1}function Py(o,l,d,v){return fi(o,function(_,I,q){l(v,_,d(_),q)}),v}function Ku(o,l){return o&&hi(l,Yt(l),o)}function ky(o,l){return o&&hi(l,Or(l),o)}function Tn(o,l,d){l=="__proto__"&&Ja?Ja(o,l,{configurable:!0,enumerable:!0,value:d,writable:!0}):o[l]=d}function nl(o,l){for(var d=-1,v=l.length,_=H(v),I=o==null;++d<v;)_[d]=I?t:fv(o,l[d]);return _}function Li(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,_,I){var q,M=l&h,B=l&g,G=l&m;if(d&&(q=_?d(o,v,_,I):d(o)),q!==t)return q;if(!bt(o))return o;var Q=Ce(o);if(Q){if(q=ZA(o),!M)return xr(o,q)}else{var X=nr(o),re=X==dt||X==ei;if(Ms(o))return Mw(o,M);if(X==En||X==le||re&&!_){if(q=B||re?{}:eE(o),!M)return B?UA(o,ky(q,o)):jA(o,Ku(q,o))}else{if(!it[X])return _?o:{};q=XA(o,X,M)}}I||(I=new Hr);var ue=I.get(o);if(ue)return ue;I.set(o,q),PE(o)?o.forEach(function(ge){q.add(pr(ge,l,d,ge,o,I))}):OE(o)&&o.forEach(function(ge,Fe){q.set(Fe,pr(ge,l,d,Fe,o,I))});var me=G?B?Qy:Gy:B?Or:Yt,ke=Q?t:me(o);return Ct(ke||o,function(ge,Fe){ke&&(Fe=ge,ge=o[Fe]),No(q,Fe,pr(ge,l,d,Fe,o,I))}),q}function Gu(o){var l=Yt(o);return function(d){return Wd(d,o,l)}}function Wd(o,l,d){var v=d.length;if(o==null)return!v;for(o=Te(o);v--;){var _=d[v],I=l[_],q=o[_];if(q===t&&!(_ in o)||!I(q))return!1}return!0}function tn(o,l,d){if(typeof o!="function")throw new wr(i);return sc(function(){o.apply(t,d)},l)}function As(o,l,d,v){var _=-1,I=La,q=!0,M=o.length,B=[],G=l.length;if(!M)return B;d&&(l=tt(l,rr(d))),v?(I=Du,q=!1):l.length>=r&&(I=Cs,q=!1,l=new Fi(l));e:for(;++_<M;){var Q=o[_],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 I(l,X,v)||B.push(Q)}return B}var fi=jw(rn),Yd=jw(Zu,!0);function Ay(o,l){var d=!0;return fi(o,function(v,_,I){return d=!!l(v,_,I),d}),d}function il(o,l,d){for(var v=-1,_=o.length;++v<_;){var I=o[v],q=l(I);if(q!=null&&(M===t?q===q&&!Wr(q):d(q,M)))var M=q,B=I}return B}function Ty(o,l,d,v){var _=o.length;for(d=xe(d),d<0&&(d=-d>_?0:_+d),v=v===t||v>_?_:xe(v),v<0&&(v+=_),v=d>v?0:AE(v);d<v;)o[d++]=l;return o}function Jd(o,l){var d=[];return fi(o,function(v,_,I){l(v,_,I)&&d.push(v)}),d}function Ut(o,l,d,v,_){var I=-1,q=o.length;for(d||(d=tT),_||(_=[]);++I<q;){var M=o[I];l>0&&d(M)?l>1?Ut(M,l-1,d,v,_):Xr(_,M):v||(_[_.length]=M)}return _}var Qu=Uw(),zd=Uw(!0);function rn(o,l){return o&&Qu(o,l,Yt)}function Zu(o,l){return o&&zd(o,l,Yt)}function nn(o,l){return oi(l,function(d){return Vi(o[d])})}function ji(o,l){l=qs(l,o);for(var d=0,v=l.length;o!=null&&d<v;)o=o[pi(l[d++])];return d&&d==v?o:t}function Kd(o,l,d){var v=l(o);return Ce(o)?v:Xr(v,d(o))}function zt(o){return o==null?o===t?og:ig:Di&&Di in Te(o)?KA(o):lT(o)}function Xu(o,l){return o>l}function qy(o,l){return o!=null&&Ke.call(o,l)}function Ny(o,l){return o!=null&&l in Te(o)}function My(o,l,d){return o>=St(l,d)&&o<xt(l,d)}function ec(o,l,d){for(var v=d?Du:La,_=o[0].length,I=o.length,q=I,M=H(I),B=1/0,G=[];q--;){var Q=o[q];q&&l&&(Q=tt(Q,rr(l))),B=St(Q.length,B),M[q]=!d&&(l||_>=120&&Q.length>=120)?new Fi(q&&Q):t}Q=o[0];var X=-1,re=M[0];e:for(;++X<_&&G.length<B;){var ue=Q[X],me=l?l(ue):ue;if(ue=d||ue!==0?ue:0,!(re?Cs(re,me):v(G,me,d))){for(q=I;--q;){var ke=M[q];if(!(ke?Cs(ke,me):v(o[q],me,d)))continue e}re&&re.push(me),G.push(ue)}}return G}function qn(o,l,d,v){return rn(o,function(_,I,q){l(v,d(_),I,q)}),v}function sn(o,l,d){l=qs(l,o),o=iE(o,l);var v=o==null?o:o[pi(ln(l))];return v==null?t:Jt(v,o,d)}function Gd(o){return Rt(o)&&zt(o)==le}function $y(o){return Rt(o)&&zt(o)==ds}function Dy(o){return Rt(o)&&zt(o)==wn}function Mo(o,l,d,v,_){return o===l?!0:o==null||l==null||!Rt(o)&&!Rt(l)?o!==o&&l!==l:Fy(o,l,d,v,Mo,_)}function Fy(o,l,d,v,_,I){var q=Ce(o),M=Ce(l),B=q?Xn:nr(o),G=M?Xn:nr(l);B=B==le?En:B,G=G==le?En:G;var Q=B==En,X=G==En,re=B==G;if(re&&Ms(o)){if(!Ms(l))return!1;q=!0,Q=!1}if(re&&!Q)return I||(I=new Hr),q||ll(o)?Qw(o,l,d,v,_,I):JA(o,l,B,d,v,_,I);if(!(d&S)){var ue=Q&&Ke.call(o,"__wrapped__"),me=X&&Ke.call(l,"__wrapped__");if(ue||me){var ke=ue?o.value():o,ge=me?l.value():l;return I||(I=new Hr),_(ke,ge,d,v,I)}}return re?(I||(I=new Hr),zA(o,l,d,v,_,I)):!1}function tc(o){return Rt(o)&&nr(o)==tr}function di(o,l,d,v){var _=d.length,I=_,q=!v;if(o==null)return!I;for(o=Te(o);_--;){var M=d[_];if(q&&M[2]?M[1]!==o[M[0]]:!(M[0]in o))return!1}for(;++_<I;){M=d[_];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?Mo(Q,G,S|E,v,X):re))return!1}}return!0}function $o(o){if(!bt(o)||nT(o))return!1;var l=Vi(o)?ry:_o;return l.test(Fo(o))}function je(o){return Rt(o)&&zt(o)==cs}function c(o){return Rt(o)&&nr(o)==yt}function p(o){return Rt(o)&&dh(o.length)&&!!lt[zt(o)]}function y(o){return typeof o=="function"?o:o==null?Ir:typeof o=="object"?Ce(o)?ye(o[0],o[1]):se(o):BE(o)}function b(o){if(!ic(o))return Ga(o);var l=[];for(var d in Te(o))Ke.call(o,d)&&d!="constructor"&&l.push(d);return l}function R(o){if(!bt(o))return aT(o);var l=ic(o),d=[];for(var v in o)v=="constructor"&&(l||!Ke.call(o,v))||d.push(v);return d}function N(o,l){return o<l}function W(o,l){var d=-1,v=Rr(o)?H(o.length):[];return fi(o,function(_,I,q){v[++d]=l(_,I,q)}),v}function se(o){var l=Xy(o);return l.length==1&&l[0][2]?rE(l[0][0],l[0][1]):function(d){return d===o||di(d,o,l)}}function ye(o,l){return tv(o)&&tE(l)?rE(pi(o),l):function(d){var v=fv(d,o);return v===t&&v===l?dv(d,o):Mo(l,v,S|E)}}function Pe(o,l,d,v,_){o!==l&&Qu(l,function(I,q){if(_||(_=new Hr),bt(I))Kt(o,l,q,d,Pe,v,_);else{var M=v?v(nv(o,q),I,q+"",o,l,_):t;M===t&&(M=I),zu(o,q,M)}},Or)}function Kt(o,l,d,v,_,I,q){var M=nv(o,d),B=nv(l,d),G=q.get(B);if(G){zu(o,d,G);return}var Q=I?I(M,B,d+"",o,l,q):t,X=Q===t;if(X){var re=Ce(B),ue=!re&&Ms(B),me=!re&&!ue&&ll(B);Q=B,re||ue||me?Ce(M)?Q=M:Tt(M)?Q=xr(M):ue?(X=!1,Q=Mw(B,!0)):me?(X=!1,Q=$w(B,!0)):Q=[]:oc(B)||Lo(B)?(Q=M,Lo(M)?Q=TE(M):(!bt(M)||Vi(M))&&(Q=eE(B))):X=!1}X&&(q.set(B,Q),_(Q,B,v,I,q),q.delete(B)),zu(o,d,Q)}function on(o,l){var d=o.length;if(d)return l+=l<0?d:0,Hi(l,d)?o[l]:t}function Nn(o,l,d){l.length?l=tt(l,function(I){return Ce(I)?function(q){return ji(q,I.length===1?I[0]:I)}:I}):l=[Ir];var v=-1;l=tt(l,rr(pe()));var _=W(o,function(I,q,M){var B=tt(l,function(G){return G(I)});return{criteria:B,index:++v,value:I}});return Uu(_,function(I,q){return LA(I,q,d)})}function OA(o,l){return Rw(o,l,function(d,v){return dv(o,v)})}function Rw(o,l,d){for(var v=-1,_=l.length,I={};++v<_;){var q=l[v],M=ji(o,q);d(M,q)&&rc(I,qs(q,o),M)}return I}function IA(o){return function(l){return ji(l,o)}}function Ly(o,l,d,v){var _=v?bd:Es,I=-1,q=l.length,M=o;for(o===l&&(l=xr(l)),d&&(M=tt(o,rr(d)));++I<q;)for(var B=0,G=l[I],Q=d?d(G):G;(B=_(M,Q,B,v))>-1;)M!==o&&$i.call(M,B,1),$i.call(o,B,1);return o}function Ow(o,l){for(var d=o?l.length:0,v=d-1;d--;){var _=l[d];if(d==v||_!==I){var I=_;Hi(_)?$i.call(o,_,1):Hy(o,_)}}return o}function jy(o,l){return o+Io(Dd()*(l-o+1))}function PA(o,l,d,v){for(var _=-1,I=xt(za((l-o)/(d||1)),0),q=H(I);I--;)q[v?I:++_]=o,o+=d;return q}function Uy(o,l){var d="";if(!o||l<1||l>fe)return d;do l%2&&(d+=o),l=Io(l/2),l&&(o+=o);while(l);return d}function qe(o,l){return iv(nE(o,l,Ir),o+"")}function kA(o){return Vd(ul(o))}function AA(o,l){var d=ul(o);return oh(d,Li(l,0,d.length))}function rc(o,l,d,v){if(!bt(o))return o;l=qs(l,o);for(var _=-1,I=l.length,q=I-1,M=o;M!=null&&++_<I;){var B=pi(l[_]),G=d;if(B==="__proto__"||B==="constructor"||B==="prototype")return o;if(_!=q){var Q=M[B];G=v?v(Q,B,M):t,G===t&&(G=bt(Q)?Q:Hi(l[_+1])?[]:{})}No(M,B,G),M=M[B]}return o}var Iw=Qa?function(o,l){return Qa.set(o,l),o}:Ir,TA=Ja?function(o,l){return Ja(o,"toString",{configurable:!0,enumerable:!1,value:pv(l),writable:!0})}:Ir;function qA(o){return oh(ul(o))}function an(o,l,d){var v=-1,_=o.length;l<0&&(l=-l>_?0:_+l),d=d>_?_:d,d<0&&(d+=_),_=l>d?0:d-l>>>0,l>>>=0;for(var I=H(_);++v<_;)I[v]=o[v+l];return I}function NA(o,l){var d;return fi(o,function(v,_,I){return d=l(v,_,I),!d}),!!d}function Qd(o,l,d){var v=0,_=o==null?v:o.length;if(typeof l=="number"&&l===l&&_<=Et){for(;v<_;){var I=v+_>>>1,q=o[I];q!==null&&!Wr(q)&&(d?q<=l:q<l)?v=I+1:_=I}return _}return By(o,l,Ir,d)}function By(o,l,d,v){var _=0,I=o==null?0:o.length;if(I===0)return 0;l=d(l);for(var q=l!==l,M=l===null,B=Wr(l),G=l===t;_<I;){var Q=Io((_+I)/2),X=d(o[Q]),re=X!==t,ue=X===null,me=X===X,ke=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||!ke):ue||ke?ge=!1:ge=v?X<=l:X<l;ge?_=Q+1:I=Q}return St(I,Xe)}function Pw(o,l){for(var d=-1,v=o.length,_=0,I=[];++d<v;){var q=o[d],M=l?l(q):q;if(!d||!Mn(M,B)){var B=M;I[_++]=q===0?0:q}}return I}function kw(o){return typeof o=="number"?o:Wr(o)?Ee:+o}function Vr(o){if(typeof o=="string")return o;if(Ce(o))return tt(o,Vr)+"";if(Wr(o))return Fd?Fd.call(o):"";var l=o+"";return l=="0"&&1/o==-ie?"-0":l}function Ts(o,l,d){var v=-1,_=La,I=o.length,q=!0,M=[],B=M;if(d)q=!1,_=Du;else if(I>=r){var G=l?null:WA(o);if(G)return xs(G);q=!1,_=Cs,B=new Fi}else B=l?[]:M;e:for(;++v<I;){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 _(B,X,d)||(B!==M&&B.push(X),M.push(Q))}return M}function Hy(o,l){return l=qs(l,o),o=iE(o,l),o==null||delete o[pi(ln(l))]}function Aw(o,l,d,v){return rc(o,l,d(ji(o,l)),v)}function Zd(o,l,d,v){for(var _=o.length,I=v?_:-1;(v?I--:++I<_)&&l(o[I],I,o););return d?an(o,v?0:I,v?I+1:_):an(o,v?I+1:0,v?_:I)}function Tw(o,l){var d=o;return d instanceof Ie&&(d=d.value()),Fu(l,function(v,_){return _.func.apply(_.thisArg,Xr([v],_.args))},d)}function Vy(o,l,d){var v=o.length;if(v<2)return v?Ts(o[0]):[];for(var _=-1,I=H(v);++_<v;)for(var q=o[_],M=-1;++M<v;)M!=_&&(I[_]=As(I[_]||q,o[M],l,d));return Ts(Ut(I,1),l,d)}function qw(o,l,d){for(var v=-1,_=o.length,I=l.length,q={};++v<_;){var M=v<I?l[v]:t;d(q,o[v],M)}return q}function Wy(o){return Tt(o)?o:[]}function Yy(o){return typeof o=="function"?o:Ir}function qs(o,l){return Ce(o)?o:tv(o,l)?[o]:lE(Qe(o))}var MA=qe;function Ns(o,l,d){var v=o.length;return d=d===t?v:d,!l&&d>=v?o:an(o,l,d)}var Nw=ny||function(o){return $t.clearTimeout(o)};function Mw(o,l){if(l)return o.slice();var d=o.length,v=kd?kd(d):new o.constructor(d);return o.copy(v),v}function Jy(o){var l=new o.constructor(o.byteLength);return new Wa(l).set(new Wa(o)),l}function $A(o,l){var d=l?Jy(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.byteLength)}function DA(o){var l=new o.constructor(o.source,ni.exec(o));return l.lastIndex=o.lastIndex,l}function FA(o){return qo?Te(qo.call(o)):{}}function $w(o,l){var d=l?Jy(o.buffer):o.buffer;return new o.constructor(d,o.byteOffset,o.length)}function Dw(o,l){if(o!==l){var d=o!==t,v=o===null,_=o===o,I=Wr(o),q=l!==t,M=l===null,B=l===l,G=Wr(l);if(!M&&!G&&!I&&o>l||I&&q&&B&&!M&&!G||v&&q&&B||!d&&B||!_)return 1;if(!v&&!I&&!G&&o<l||G&&d&&_&&!v&&!I||M&&d&&_||!q&&_||!B)return-1}return 0}function LA(o,l,d){for(var v=-1,_=o.criteria,I=l.criteria,q=_.length,M=d.length;++v<q;){var B=Dw(_[v],I[v]);if(B){if(v>=M)return B;var G=d[v];return B*(G=="desc"?-1:1)}}return o.index-l.index}function Fw(o,l,d,v){for(var _=-1,I=o.length,q=d.length,M=-1,B=l.length,G=xt(I-q,0),Q=H(B+G),X=!v;++M<B;)Q[M]=l[M];for(;++_<q;)(X||_<I)&&(Q[d[_]]=o[_]);for(;G--;)Q[M++]=o[_++];return Q}function Lw(o,l,d,v){for(var _=-1,I=o.length,q=-1,M=d.length,B=-1,G=l.length,Q=xt(I-M,0),X=H(Q+G),re=!v;++_<Q;)X[_]=o[_];for(var ue=_;++B<G;)X[ue+B]=l[B];for(;++q<M;)(re||_<I)&&(X[ue+d[q]]=o[_++]);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 hi(o,l,d,v){var _=!d;d||(d={});for(var I=-1,q=l.length;++I<q;){var M=l[I],B=v?v(d[M],o[M],M,d,o):t;B===t&&(B=o[M]),_?Tn(d,M,B):No(d,M,B)}return d}function jA(o,l){return hi(o,ev(o),l)}function UA(o,l){return hi(o,Zw(o),l)}function Xd(o,l){return function(d,v){var _=Ce(d)?Ng:Py,I=l?l():{};return _(d,o,pe(v,2),I)}}function sl(o){return qe(function(l,d){var v=-1,_=d.length,I=_>1?d[_-1]:t,q=_>2?d[2]:t;for(I=o.length>3&&typeof I=="function"?(_--,I):t,q&&mr(d[0],d[1],q)&&(I=_<3?t:I,_=1),l=Te(l);++v<_;){var M=d[v];M&&o(l,M,v,I)}return l})}function jw(o,l){return function(d,v){if(d==null)return d;if(!Rr(d))return o(d,v);for(var _=d.length,I=l?_:-1,q=Te(d);(l?I--:++I<_)&&v(q[I],I,q)!==!1;);return d}}function Uw(o){return function(l,d,v){for(var _=-1,I=Te(l),q=v(l),M=q.length;M--;){var B=q[o?M:++_];if(d(I[B],B,I)===!1)break}return l}}function BA(o,l,d){var v=l&C,_=nc(o);function I(){var q=this&&this!==$t&&this instanceof I?_:o;return q.apply(v?d:this,arguments)}return I}function Bw(o){return function(l){l=Qe(l);var d=en(l)?hr(l):t,v=d?d[0]:l.charAt(0),_=d?Ns(d,1).join(""):l.slice(1);return v[o]()+_}}function ol(o){return function(l){return Fu(jE(LE(l).replace(Cg,"")),o,"")}}function nc(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=ks(o.prototype),v=o.apply(d,l);return bt(v)?v:d}}function HA(o,l,d){var v=nc(o);function _(){for(var I=arguments.length,q=H(I),M=I,B=al(_);M--;)q[M]=arguments[M];var G=I<3&&q[0]!==B&&q[I-1]!==B?[]:Br(q,B);if(I-=G.length,I<d)return Jw(o,l,eh,_.placeholder,t,q,G,t,t,d-I);var Q=this&&this!==$t&&this instanceof _?v:o;return Jt(Q,this,q)}return _}function Hw(o){return function(l,d,v){var _=Te(l);if(!Rr(l)){var I=pe(d,3);l=Yt(l),d=function(M){return I(_[M],M,_)}}var q=o(l,d,v);return q>-1?_[I?l[q]:q]:t}}function Vw(o){return Bi(function(l){var d=l.length,v=d,_=Er.prototype.thru;for(o&&l.reverse();v--;){var I=l[v];if(typeof I!="function")throw new wr(i);if(_&&!q&&ih(I)=="wrapper")var q=new Er([],!0)}for(v=q?v:d;++v<d;){I=l[v];var M=ih(I),B=M=="wrapper"?Zy(I):t;B&&rv(B[0])&&B[1]==(K|T|Y|ee)&&!B[4].length&&B[9]==1?q=q[ih(B[0])].apply(q,B[3]):q=I.length==1&&rv(I)?q[M]():q.thru(I)}return function(){var G=arguments,Q=G[0];if(q&&G.length==1&&Ce(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 eh(o,l,d,v,_,I,q,M,B,G){var Q=l&K,X=l&C,re=l&x,ue=l&(T|j),me=l&k,ke=re?t:nc(o);function ge(){for(var Fe=arguments.length,Ue=H(Fe),Yr=Fe;Yr--;)Ue[Yr]=arguments[Yr];if(ue)var gr=al(ge),Jr=jg(Ue,gr);if(v&&(Ue=Fw(Ue,v,_,ue)),I&&(Ue=Lw(Ue,I,q,ue)),Fe-=Jr,ue&&Fe<G){var qt=Br(Ue,gr);return Jw(o,l,eh,ge.placeholder,d,Ue,qt,M,B,G-Fe)}var $n=X?d:this,Yi=re?$n[o]:o;return Fe=Ue.length,M?Ue=uT(Ue,M):me&&Fe>1&&Ue.reverse(),Q&&B<Fe&&(Ue.length=B),this&&this!==$t&&this instanceof ge&&(Yi=ke||nc(Yi)),Yi.apply($n,Ue)}return ge}function Ww(o,l){return function(d,v){return qn(d,o,l(v),{})}}function th(o,l){return function(d,v){var _;if(d===t&&v===t)return l;if(d!==t&&(_=d),v!==t){if(_===t)return v;typeof d=="string"||typeof v=="string"?(d=Vr(d),v=Vr(v)):(d=kw(d),v=kw(v)),_=o(d,v)}return _}}function zy(o){return Bi(function(l){return l=tt(l,rr(pe())),qe(function(d){var v=this;return o(l,function(_){return Jt(_,v,d)})})})}function rh(o,l){l=l===t?" ":Vr(l);var d=l.length;if(d<2)return d?Uy(l,o):l;var v=Uy(l,za(o/ai(l)));return en(l)?Ns(hr(v),0,o).join(""):v.slice(0,o)}function VA(o,l,d,v){var _=l&C,I=nc(o);function q(){for(var M=-1,B=arguments.length,G=-1,Q=v.length,X=H(Q+B),re=this&&this!==$t&&this instanceof q?I:o;++G<Q;)X[G]=v[G];for(;B--;)X[G++]=arguments[++M];return Jt(re,_?d:this,X)}return q}function Yw(o){return function(l,d,v){return v&&typeof v!="number"&&mr(l,d,v)&&(d=v=t),l=Wi(l),d===t?(d=l,l=0):d=Wi(d),v=v===t?l<d?1:-1:Wi(v),PA(l,d,v,o)}}function nh(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,_,I,q,M,B,G){var Q=l&T,X=Q?q:t,re=Q?t:q,ue=Q?I:t,me=Q?t:I;l|=Q?Y:V,l&=~(Q?V:Y),l&A||(l&=~(C|x));var ke=[o,l,_,ue,X,me,re,M,B,G],ge=d.apply(t,ke);return rv(o)&&sE(ge,ke),ge.placeholder=v,oE(ge,o,l)}function Ky(o){var l=At[o];return function(d,v){if(d=un(d),v=v==null?0:St(xe(v),292),v&&Po(d)){var _=(Qe(d)+"e").split("e"),I=l(_[0]+"e"+(+_[1]+v));return _=(Qe(I)+"e").split("e"),+(_[0]+"e"+(+_[1]-v))}return l(d)}}var WA=Is&&1/xs(new Is([,-0]))[1]==ie?function(o){return new Is(o)}:yv;function zw(o){return function(l){var d=nr(l);return d==tr?Wu(l):d==yt?Yg(l):Lg(l,o(l))}}function Ui(o,l,d,v,_,I,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=_=t),q=q===t?q:xt(xe(q),0),M=M===t?M:xe(M),G-=_?_.length:0,l&V){var Q=v,X=_;v=_=t}var re=B?t:Zy(o),ue=[o,l,d,v,_,Q,X,I,q,M];if(re&&oT(ue,re),o=ue[0],l=ue[1],d=ue[2],v=ue[3],_=ue[4],M=ue[9]=ue[9]===t?B?0:o.length:xt(ue[9]-G,0),!M&&l&(T|j)&&(l&=~(T|j)),!l||l==C)var me=BA(o,l,d);else l==T||l==j?me=HA(o,l,M):(l==Y||l==(C|Y))&&!_.length?me=VA(o,l,d,v):me=eh.apply(t,ue);var ke=re?Iw:sE;return oE(ke(me,ue),o,l)}function Kw(o,l,d,v){return o===t||Mn(o,Rs[d])&&!Ke.call(v,d)?l:o}function Gw(o,l,d,v,_,I){return bt(o)&&bt(l)&&(I.set(l,o),Pe(o,l,t,Gw,I),I.delete(l)),o}function YA(o){return oc(o)?t:o}function Qw(o,l,d,v,_,I){var q=d&S,M=o.length,B=l.length;if(M!=B&&!(q&&B>M))return!1;var G=I.get(o),Q=I.get(l);if(G&&Q)return G==l&&Q==o;var X=-1,re=!0,ue=d&E?new Fi:t;for(I.set(o,l),I.set(l,o);++X<M;){var me=o[X],ke=l[X];if(v)var ge=q?v(ke,me,X,l,o,I):v(me,ke,X,o,l,I);if(ge!==t){if(ge)continue;re=!1;break}if(ue){if(!Lu(l,function(Fe,Ue){if(!Cs(ue,Ue)&&(me===Fe||_(me,Fe,d,v,I)))return ue.push(Ue)})){re=!1;break}}else if(!(me===ke||_(me,ke,d,v,I))){re=!1;break}}return I.delete(o),I.delete(l),re}function JA(o,l,d,v,_,I,q){switch(d){case ti:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case ds:return!(o.byteLength!=l.byteLength||!I(new Wa(o),new Wa(l)));case ft:case wn:case Qr:return Mn(+o,+l);case jt:return o.name==l.name&&o.message==l.message;case cs:case Ai:return o==l+"";case tr:var M=Wu;case yt:var B=v&S;if(M||(M=xs),o.size!=l.size&&!B)return!1;var G=q.get(o);if(G)return G==l;v|=E,q.set(o,l);var Q=Qw(M(o),M(l),v,_,I,q);return q.delete(o),Q;case Oa:if(qo)return qo.call(o)==qo.call(l)}return!1}function zA(o,l,d,v,_,I){var q=d&S,M=Gy(o),B=M.length,G=Gy(l),Q=G.length;if(B!=Q&&!q)return!1;for(var X=B;X--;){var re=M[X];if(!(q?re in l:Ke.call(l,re)))return!1}var ue=I.get(o),me=I.get(l);if(ue&&me)return ue==l&&me==o;var ke=!0;I.set(o,l),I.set(l,o);for(var ge=q;++X<B;){re=M[X];var Fe=o[re],Ue=l[re];if(v)var Yr=q?v(Ue,Fe,re,l,o,I):v(Fe,Ue,re,o,l,I);if(!(Yr===t?Fe===Ue||_(Fe,Ue,d,v,I):Yr)){ke=!1;break}ge||(ge=re=="constructor")}if(ke&&!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)&&(ke=!1)}return I.delete(o),I.delete(l),ke}function Bi(o){return iv(nE(o,t,dE),o+"")}function Gy(o){return Kd(o,Yt,ev)}function Qy(o){return Kd(o,Or,Zw)}var Zy=Qa?function(o){return Qa.get(o)}:yv;function ih(o){for(var l=o.name+"",d=Ps[l],v=Ke.call(Ps,l)?d.length:0;v--;){var _=d[v],I=_.func;if(I==null||I==o)return _.name}return l}function al(o){var l=Ke.call(O,"placeholder")?O:o;return l.placeholder}function pe(){var o=O.iteratee||mv;return o=o===mv?y:o,arguments.length?o(arguments[0],arguments[1]):o}function sh(o,l){var d=o.__data__;return rT(l)?d[typeof l=="string"?"string":"hash"]:d.map}function Xy(o){for(var l=Yt(o),d=l.length;d--;){var v=l[d],_=o[v];l[d]=[v,_,tE(_)]}return l}function Do(o,l){var d=Hg(o,l);return $o(d)?d:t}function KA(o){var l=Ke.call(o,Di),d=o[Di];try{o[Di]=t;var v=!0}catch{}var _=Ha.call(o);return v&&(l?o[Di]=d:delete o[Di]),_}var ev=Ka?function(o){return o==null?[]:(o=Te(o),oi(Ka(o),function(l){return Td.call(o,l)}))}:vv,Zw=Ka?function(o){for(var l=[];o;)Xr(l,ev(o)),o=Ya(o);return l}:vv,nr=zt;(Yu&&nr(new Yu(new ArrayBuffer(1)))!=ti||ko&&nr(new ko)!=tr||Ju&&nr(Ju.resolve())!=Vf||Is&&nr(new Is)!=yt||Ao&&nr(new Ao)!=fs)&&(nr=function(o){var l=zt(o),d=l==En?o.constructor:t,v=d?Fo(d):"";if(v)switch(v){case ay:return ti;case ly:return tr;case uy:return Vf;case cy:return yt;case fy:return fs}return l});function GA(o,l,d){for(var v=-1,_=d.length;++v<_;){var I=d[v],q=I.size;switch(I.type){case"drop":o+=q;break;case"dropRight":l-=q;break;case"take":l=St(l,o+q);break;case"takeRight":o=xt(o,l-q);break}}return{start:o,end:l}}function QA(o){var l=o.match(Vt);return l?l[1].split(xn):[]}function Xw(o,l,d){l=qs(l,o);for(var v=-1,_=l.length,I=!1;++v<_;){var q=pi(l[v]);if(!(I=o!=null&&d(o,q)))break;o=o[q]}return I||++v!=_?I:(_=o==null?0:o.length,!!_&&dh(_)&&Hi(q,_)&&(Ce(o)||Lo(o)))}function ZA(o){var l=o.length,d=new o.constructor(l);return l&&typeof o[0]=="string"&&Ke.call(o,"index")&&(d.index=o.index,d.input=o.input),d}function eE(o){return typeof o.constructor=="function"&&!ic(o)?ks(Ya(o)):{}}function XA(o,l,d){var v=o.constructor;switch(l){case ds:return Jy(o);case ft:case wn:return new v(+o);case ti:return $A(o,d);case hs:case et:case Ia:case Pa:case ps:case So:case ms:case ri:case gs:return $w(o,d);case tr:return new v;case Qr:case Ai:return new v(o);case cs:return DA(o);case yt:return new v;case Oa:return FA(o)}}function eT(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(Ta,`{
|
|
2
2
|
/* [wrapped with `+l+`] */
|
|
3
|
-
`)}function tT(o){return Ee(o)||Lo(o)||!!(Nd&&o&&o[Nd])}function Hi(o,l){var d=typeof o;return l=l??fe,!!l&&(d=="number"||d!="symbol"&&pg.test(o))&&o>-1&&o%1==0&&o<l}function pr(o,l,d){if(!bt(d))return!1;var v=typeof l;return(v=="number"?xr(d)&&Hi(l,d.length):v=="string"&&l in d)?Mn(d[l],o):!1}function rv(o,l){if(Ee(o))return!1;var d=typeof o;return d=="number"||d=="symbol"||d=="boolean"||o==null||Wr(o)?!0:br.test(o)||!En.test(o)||l!=null&&o in Ae(l)}function rT(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function nv(o){var l=sh(o),d=I[l];if(typeof d!="function"||!(l in Ie.prototype))return!1;if(o===d)return!0;var v=Xy(d);return!!v&&o===v[0]}function nT(o){return!!kd&&kd in o}var iT=Ba?Vi:bv;function ic(o){var l=o&&o.constructor,d=typeof l=="function"&&l.prototype||Rs;return o===d}function tC(o){return o===o&&!bt(o)}function rC(o,l){return function(d){return d==null?!1:d[o]===l&&(l!==r||o in Ae(d))}}function sT(o){var l=fh(o,function(v){return d.size===u&&d.clear(),v}),d=l.cache;return l}function oT(o,l){var d=o[1],v=l[1],_=d|v,O=_<(C|x|K),T=v==K&&d==q||v==K&&d==ee&&o[7].length<=l[8]||v==(K|ee)&&l[7].length<=l[8]&&d==q;if(!(O||T))return o;v&C&&(o[2]=l[2],_|=d&C?0:A);var M=l[3];if(M){var B=o[3];o[3]=B?Fw(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?Lw(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]:St(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=_,o}function aT(o){var l=[];if(o!=null)for(var d in Ae(o))l.push(d);return l}function lT(o){return Ha.call(o)}function nC(o,l,d){return l=xt(l===r?o.length-1:l,0),function(){for(var v=arguments,_=-1,O=xt(v.length-l,0),T=H(O);++_<O;)T[_]=v[l+_];_=-1;for(var M=H(l+1);++_<l;)M[_]=v[_];return M[l]=d(T),Jt(o,this,M)}}function iC(o,l){return l.length<2?o:ji(o,an(l,0,-1))}function uT(o,l){for(var d=o.length,v=St(l.length,d),_=Er(o);v--;){var O=l[v];o[v]=Hi(O,d)?_[O]:r}return o}function iv(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var sC=aC(Ow),sc=oy||function(o,l){return $t.setTimeout(o,l)},sv=aC(TA);function oC(o,l,d){var v=l+"";return sv(o,eT(v,cT(QA(v),d)))}function aC(o){var l=0,d=0;return function(){var v=$d(),_=D-(v-d);if(d=v,_>0){if(++l>=$)return arguments[0]}else l=0;return o.apply(r,arguments)}}function ah(o,l){var d=-1,v=o.length,_=v-1;for(l=l===r?v:l;++d<l;){var O=Uy(d,_),T=o[O];o[O]=o[d],o[d]=T}return o.length=l,o}var lC=sT(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(Me,function(d,v,_,O){l.push(_?O.replace(jr,"$1"):v||d)}),l});function pi(o){if(typeof o=="string"||Wr(o))return o;var l=o+"";return l=="0"&&1/o==-ie?"-0":l}function Fo(o){if(o!=null){try{return Ro.call(o)}catch{}try{return o+""}catch{}}return""}function cT(o,l){return Et(Mt,function(d){var v="_."+d[0];l&d[1]&&!La(o,v)&&o.push(v)}),o.sort()}function uC(o){if(o instanceof Ie)return o.clone();var l=new wr(o.__wrapped__,o.__chain__);return l.__actions__=Er(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function fT(o,l,d){(d?pr(o,l,d):l===r)?l=1:l=xt(xe(l),0);var v=o==null?0:o.length;if(!v||l<1)return[];for(var _=0,O=0,T=H(za(v/l));_<v;)T[O++]=an(o,_,_+=l);return T}function dT(o){for(var l=-1,d=o==null?0:o.length,v=0,_=[];++l<d;){var O=o[l];O&&(_[v++]=O)}return _}function hT(){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)?Er(d):[d],Ut(l,1))}var pT=Te(function(o,l){return Tt(o)?As(o,Ut(l,1,Tt,!0)):[]}),mT=Te(function(o,l){var d=ln(l);return Tt(d)&&(d=r),Tt(o)?As(o,Ut(l,1,Tt,!0),pe(d,2)):[]}),gT=Te(function(o,l){var d=ln(l);return Tt(d)&&(d=r),Tt(o)?As(o,Ut(l,1,Tt,!0),r,d):[]});function yT(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===r?1:xe(l),an(o,l<0?0:l,v)):[]}function vT(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===r?1:xe(l),l=v-l,an(o,0,l<0?0:l)):[]}function ST(o,l){return o&&o.length?Xd(o,pe(l,3),!0,!0):[]}function bT(o,l){return o&&o.length?Xd(o,pe(l,3),!0):[]}function _T(o,l,d,v){var _=o==null?0:o.length;return _?(d&&typeof d!="number"&&pr(o,l,d)&&(d=0,v=_),qy(o,l,d,v)):[]}function cC(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var _=d==null?0:xe(d);return _<0&&(_=xt(v+_,0)),ja(o,pe(l,3),_)}function fC(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var _=v-1;return d!==r&&(_=xe(d),_=d<0?xt(v+_,0):St(_,v-1)),ja(o,pe(l,3),_,!0)}function dC(o){var l=o==null?0:o.length;return l?Ut(o,1):[]}function wT(o){var l=o==null?0:o.length;return l?Ut(o,ie):[]}function CT(o,l){var d=o==null?0:o.length;return d?(l=l===r?1:xe(l),Ut(o,l)):[]}function ET(o){for(var l=-1,d=o==null?0:o.length,v={};++l<d;){var _=o[l];v[_[0]]=_[1]}return v}function hC(o){return o&&o.length?o[0]:r}function xT(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var _=d==null?0:xe(d);return _<0&&(_=xt(v+_,0)),Cs(o,l,_)}function RT(o){var l=o==null?0:o.length;return l?an(o,0,-1):[]}var IT=Te(function(o){var l=tt(o,Yy);return l.length&&l[0]===o[0]?ec(l):[]}),OT=Te(function(o){var l=ln(o),d=tt(o,Yy);return l===ln(d)?l=r:d.pop(),d.length&&d[0]===o[0]?ec(d,pe(l,2)):[]}),PT=Te(function(o){var l=ln(o),d=tt(o,Yy);return l=typeof l=="function"?l:r,l&&d.pop(),d.length&&d[0]===o[0]?ec(d,r,l):[]});function kT(o,l){return o==null?"":Is.call(o,l)}function ln(o){var l=o==null?0:o.length;return l?o[l-1]:r}function AT(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var _=v;return d!==r&&(_=xe(d),_=_<0?xt(v+_,0):St(_,v-1)),l===l?zg(o,l,_):ja(o,wd,_,!0)}function TT(o,l){return o&&o.length?on(o,xe(l)):r}var qT=Te(pC);function pC(o,l){return o&&o.length&&l&&l.length?jy(o,l):o}function NT(o,l,d){return o&&o.length&&l&&l.length?jy(o,l,pe(d,2)):o}function MT(o,l,d){return o&&o.length&&l&&l.length?jy(o,l,r,d):o}var $T=Bi(function(o,l){var d=o==null?0:o.length,v=nl(o,l);return Iw(o,tt(l,function(_){return Hi(_,d)?+_:_}).sort(Dw)),v});function DT(o,l){var d=[];if(!(o&&o.length))return d;var v=-1,_=[],O=o.length;for(l=pe(l,3);++v<O;){var T=o[v];l(T,v,o)&&(d.push(T),_.push(v))}return Iw(o,_),d}function ov(o){return o==null?o:ay.call(o)}function FT(o,l,d){var v=o==null?0:o.length;return v?(d&&typeof d!="number"&&pr(o,l,d)?(l=0,d=v):(l=l==null?0:xe(l),d=d===r?v:xe(d)),an(o,l,d)):[]}function LT(o,l){return Zd(o,l)}function jT(o,l,d){return Hy(o,l,pe(d,2))}function UT(o,l){var d=o==null?0:o.length;if(d){var v=Zd(o,l);if(v<d&&Mn(o[v],l))return v}return-1}function BT(o,l){return Zd(o,l,!0)}function HT(o,l,d){return Hy(o,l,pe(d,2),!0)}function VT(o,l){var d=o==null?0:o.length;if(d){var v=Zd(o,l,!0)-1;if(Mn(o[v],l))return v}return-1}function WT(o){return o&&o.length?Pw(o):[]}function YT(o,l){return o&&o.length?Pw(o,pe(l,2)):[]}function JT(o){var l=o==null?0:o.length;return l?an(o,1,l):[]}function zT(o,l,d){return o&&o.length?(l=d||l===r?1:xe(l),an(o,0,l<0?0:l)):[]}function KT(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===r?1:xe(l),l=v-l,an(o,l<0?0:l,v)):[]}function GT(o,l){return o&&o.length?Xd(o,pe(l,3),!1,!0):[]}function QT(o,l){return o&&o.length?Xd(o,pe(l,3)):[]}var ZT=Te(function(o){return Ts(Ut(o,1,Tt,!0))}),XT=Te(function(o){var l=ln(o);return Tt(l)&&(l=r),Ts(Ut(o,1,Tt,!0),pe(l,2))}),eq=Te(function(o){var l=ln(o);return l=typeof l=="function"?l:r,Ts(Ut(o,1,Tt,!0),r,l)});function tq(o){return o&&o.length?Ts(o):[]}function rq(o,l){return o&&o.length?Ts(o,pe(l,2)):[]}function nq(o,l){return l=typeof l=="function"?l:r,o&&o.length?Ts(o,r,l):[]}function av(o){if(!(o&&o.length))return[];var l=0;return o=oi(o,function(d){if(Tt(d))return l=xt(d.length,l),!0}),Hu(l,function(d){return tt(o,ju(d))})}function mC(o,l){if(!(o&&o.length))return[];var d=av(o);return l==null?d:tt(d,function(v){return Jt(l,r,v)})}var iq=Te(function(o,l){return Tt(o)?As(o,l):[]}),sq=Te(function(o){return Wy(oi(o,Tt))}),oq=Te(function(o){var l=ln(o);return Tt(l)&&(l=r),Wy(oi(o,Tt),pe(l,2))}),aq=Te(function(o){var l=ln(o);return l=typeof l=="function"?l:r,Wy(oi(o,Tt),r,l)}),lq=Te(av);function uq(o,l){return qw(o||[],l||[],No)}function cq(o,l){return qw(o||[],l||[],rc)}var fq=Te(function(o){var l=o.length,d=l>1?o[l-1]:r;return d=typeof d=="function"?(o.pop(),d):r,mC(o,d)});function gC(o){var l=I(o);return l.__chain__=!0,l}function dq(o,l){return l(o),o}function lh(o,l){return l(o)}var hq=Bi(function(o){var l=o.length,d=l?o[0]:0,v=this.__wrapped__,_=function(O){return nl(O,o)};return l>1||this.__actions__.length||!(v instanceof Ie)||!Hi(d)?this.thru(_):(v=v.slice(d,+d+(l?1:0)),v.__actions__.push({func:lh,args:[_],thisArg:r}),new wr(v,this.__chain__).thru(function(O){return l&&!O.length&&O.push(r),O}))});function pq(){return gC(this)}function mq(){return new wr(this.value(),this.__chain__)}function gq(){this.__values__===r&&(this.__values__=kC(this.value()));var o=this.__index__>=this.__values__.length,l=o?r:this.__values__[this.__index__++];return{done:o,value:l}}function yq(){return this}function vq(o){for(var l,d=this;d instanceof Xa;){var v=uC(d);v.__index__=0,v.__values__=r,l?_.__wrapped__=v:l=v;var _=v;d=d.__wrapped__}return _.__wrapped__=o,l}function Sq(){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:lh,args:[ov],thisArg:r}),new wr(l,this.__chain__)}return this.thru(ov)}function bq(){return Tw(this.__wrapped__,this.__actions__)}var _q=eh(function(o,l,d){Ke.call(o,d)?++o[d]:Tn(o,d,1)});function wq(o,l,d){var v=Ee(o)?Fa:Ty;return d&&pr(o,l,d)&&(l=r),v(o,pe(l,3))}function Cq(o,l){var d=Ee(o)?oi:zd;return d(o,pe(l,3))}var Eq=Hw(cC),xq=Hw(fC);function Rq(o,l){return Ut(uh(o,l),1)}function Iq(o,l){return Ut(uh(o,l),ie)}function Oq(o,l,d){return d=d===r?1:xe(d),Ut(uh(o,l),d)}function yC(o,l){var d=Ee(o)?Et:fi;return d(o,pe(l,3))}function vC(o,l){var d=Ee(o)?$g:Jd;return d(o,pe(l,3))}var Pq=eh(function(o,l,d){Ke.call(o,d)?o[d].push(l):Tn(o,d,[l])});function kq(o,l,d,v){o=xr(o)?o:ul(o),d=d&&!v?xe(d):0;var _=o.length;return d<0&&(d=xt(_+d,0)),ph(o)?d<=_&&o.indexOf(l,d)>-1:!!_&&Cs(o,l,d)>-1}var Aq=Te(function(o,l,d){var v=-1,_=typeof l=="function",O=xr(o)?H(o.length):[];return fi(o,function(T){O[++v]=_?Jt(l,T,d):sn(T,l,d)}),O}),Tq=eh(function(o,l,d){Tn(o,d,l)});function uh(o,l){var d=Ee(o)?tt:W;return d(o,pe(l,3))}function qq(o,l,d,v){return o==null?[]:(Ee(l)||(l=l==null?[]:[l]),d=v?r:d,Ee(d)||(d=d==null?[]:[d]),Nn(o,l,d))}var Nq=eh(function(o,l,d){o[d?0:1].push(l)},function(){return[[],[]]});function Mq(o,l,d){var v=Ee(o)?Fu:Cd,_=arguments.length<3;return v(o,pe(l,4),d,_,fi)}function $q(o,l,d){var v=Ee(o)?Dg:Cd,_=arguments.length<3;return v(o,pe(l,4),d,_,Jd)}function Dq(o,l){var d=Ee(o)?oi:zd;return d(o,dh(pe(l,3)))}function Fq(o){var l=Ee(o)?Wd:kA;return l(o)}function Lq(o,l,d){(d?pr(o,l,d):l===r)?l=1:l=xe(l);var v=Ee(o)?Oy:AA;return v(o,l)}function jq(o){var l=Ee(o)?Py:qA;return l(o)}function Uq(o){if(o==null)return 0;if(xr(o))return ph(o)?ai(o):o.length;var l=nr(o);return l==tr||l==yt?o.size:b(o).length}function Bq(o,l,d){var v=Ee(o)?Lu:NA;return d&&pr(o,l,d)&&(l=r),v(o,pe(l,3))}var Hq=Te(function(o,l){if(o==null)return[];var d=l.length;return d>1&&pr(o,l[0],l[1])?l=[]:d>2&&pr(l[0],l[1],l[2])&&(l=[l[0]]),Nn(o,Ut(l,1),[])}),ch=sy||function(){return $t.Date.now()};function Vq(o,l){if(typeof l!="function")throw new _r(i);return o=xe(o),function(){if(--o<1)return l.apply(this,arguments)}}function SC(o,l,d){return l=d?r:l,l=o&&l==null?o.length:l,Ui(o,K,r,r,r,r,l)}function bC(o,l){var d;if(typeof l!="function")throw new _r(i);return o=xe(o),function(){return--o>0&&(d=l.apply(this,arguments)),o<=1&&(l=r),d}}var lv=Te(function(o,l,d){var v=C;if(d.length){var _=Br(d,al(lv));v|=Y}return Ui(o,v,l,d,_)}),_C=Te(function(o,l,d){var v=C|x;if(d.length){var _=Br(d,al(_C));v|=Y}return Ui(l,v,o,d,_)});function wC(o,l,d){l=d?r:l;var v=Ui(o,q,r,r,r,r,r,l);return v.placeholder=wC.placeholder,v}function CC(o,l,d){l=d?r:l;var v=Ui(o,j,r,r,r,r,r,l);return v.placeholder=CC.placeholder,v}function EC(o,l,d){var v,_,O,T,M,B,G=0,Q=!1,X=!1,re=!0;if(typeof o!="function")throw new _r(i);l=un(l)||0,bt(d)&&(Q=!!d.leading,X="maxWait"in d,O=X?xt(un(d.maxWait)||0,l):O,re="trailing"in d?!!d.trailing:re);function ue(qt){var $n=v,Yi=_;return v=_=r,G=qt,T=o.apply(Yi,$n),T}function me(qt){return G=qt,M=sc(Fe,l),Q?ue(qt):T}function Pe(qt){var $n=qt-B,Yi=qt-G,HC=l-$n;return X?St(HC,O-Yi):HC}function ge(qt){var $n=qt-B,Yi=qt-G;return B===r||$n>=l||$n<0||X&&Yi>=O}function Fe(){var qt=ch();if(ge(qt))return Ue(qt);M=sc(Fe,Pe(qt))}function Ue(qt){return M=r,re&&v?ue(qt):(v=_=r,T)}function Yr(){M!==r&&Nw(M),G=0,v=B=_=M=r}function mr(){return M===r?T:Ue(ch())}function Jr(){var qt=ch(),$n=ge(qt);if(v=arguments,_=this,B=qt,$n){if(M===r)return me(B);if(X)return Nw(M),M=sc(Fe,l),ue(B)}return M===r&&(M=sc(Fe,l)),T}return Jr.cancel=Yr,Jr.flush=mr,Jr}var Wq=Te(function(o,l){return tn(o,1,l)}),Yq=Te(function(o,l,d){return tn(o,un(l)||0,d)});function Jq(o){return Ui(o,k)}function fh(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new _r(i);var d=function(){var v=arguments,_=l?l.apply(this,v):v[0],O=d.cache;if(O.has(_))return O.get(_);var T=o.apply(this,v);return d.cache=O.set(_,T)||O,T};return d.cache=new(fh.Cache||An),d}fh.Cache=An;function dh(o){if(typeof o!="function")throw new _r(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 zq(o){return bC(2,o)}var Kq=MA(function(o,l){l=l.length==1&&Ee(l[0])?tt(l[0],rr(pe())):tt(Ut(l,1),rr(pe()));var d=l.length;return Te(function(v){for(var _=-1,O=St(v.length,d);++_<O;)v[_]=l[_].call(this,v[_]);return Jt(o,this,v)})}),uv=Te(function(o,l){var d=Br(l,al(uv));return Ui(o,Y,r,l,d)}),xC=Te(function(o,l){var d=Br(l,al(xC));return Ui(o,V,r,l,d)}),Gq=Bi(function(o,l){return Ui(o,ee,r,r,r,l)});function Qq(o,l){if(typeof o!="function")throw new _r(i);return l=l===r?l:xe(l),Te(o,l)}function Zq(o,l){if(typeof o!="function")throw new _r(i);return l=l==null?0:xt(xe(l),0),Te(function(d){var v=d[l],_=Ns(d,0,l);return v&&Xr(_,v),Jt(o,this,_)})}function Xq(o,l,d){var v=!0,_=!0;if(typeof o!="function")throw new _r(i);return bt(d)&&(v="leading"in d?!!d.leading:v,_="trailing"in d?!!d.trailing:_),EC(o,l,{leading:v,maxWait:l,trailing:_})}function eN(o){return SC(o,1)}function tN(o,l){return uv(Jy(l),o)}function rN(){if(!arguments.length)return[];var o=arguments[0];return Ee(o)?o:[o]}function nN(o){return hr(o,g)}function iN(o,l){return l=typeof l=="function"?l:r,hr(o,g,l)}function sN(o){return hr(o,h|g)}function oN(o,l){return l=typeof l=="function"?l:r,hr(o,h|g,l)}function aN(o,l){return l==null||Yd(o,l,Yt(l))}function Mn(o,l){return o===l||o!==o&&l!==l}var lN=ih(Xu),uN=ih(function(o,l){return o>=l}),Lo=Qd(function(){return arguments}())?Qd:function(o){return Rt(o)&&Ke.call(o,"callee")&&!qd.call(o,"callee")},Ee=H.isArray,cN=gd?rr(gd):Dy;function xr(o){return o!=null&&hh(o.length)&&!Vi(o)}function Tt(o){return Rt(o)&&xr(o)}function fN(o){return o===!0||o===!1||Rt(o)&&zt(o)==ft}var Ms=Md||bv,dN=$u?rr($u):Fy;function hN(o){return Rt(o)&&o.nodeType===1&&!oc(o)}function pN(o){if(o==null)return!0;if(xr(o)&&(Ee(o)||typeof o=="string"||typeof o.splice=="function"||Ms(o)||ll(o)||Lo(o)))return!o.length;var l=nr(o);if(l==tr||l==yt)return!o.size;if(ic(o))return!b(o).length;for(var d in o)if(Ke.call(o,d))return!1;return!0}function mN(o,l){return Mo(o,l)}function gN(o,l,d){d=typeof d=="function"?d:r;var v=d?d(o,l):r;return v===r?Mo(o,l,r,d):!!v}function cv(o){if(!Rt(o))return!1;var l=zt(o);return l==jt||l==us||typeof o.message=="string"&&typeof o.name=="string"&&!oc(o)}function yN(o){return typeof o=="number"&&Po(o)}function Vi(o){if(!bt(o))return!1;var l=zt(o);return l==dt||l==ei||l==Ou||l==og}function RC(o){return typeof o=="number"&&o==xe(o)}function hh(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=fe}function bt(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function Rt(o){return o!=null&&typeof o=="object"}var IC=yd?rr(yd):tc;function vN(o,l){return o===l||di(o,l,ev(l))}function SN(o,l,d){return d=typeof d=="function"?d:r,di(o,l,ev(l),d)}function bN(o){return OC(o)&&o!=+o}function _N(o){if(iT(o))throw new ve(n);return $o(o)}function wN(o){return o===null}function CN(o){return o==null}function OC(o){return typeof o=="number"||Rt(o)&&zt(o)==Qr}function oc(o){if(!Rt(o)||zt(o)!=Cn)return!1;var l=Ya(o);if(l===null)return!0;var d=Ke.call(l,"constructor")&&l.constructor;return typeof d=="function"&&d instanceof d&&Ro.call(d)==ty}var fv=vd?rr(vd):je;function EN(o){return RC(o)&&o>=-fe&&o<=fe}var PC=wo?rr(wo):c;function ph(o){return typeof o=="string"||!Ee(o)&&Rt(o)&&zt(o)==Ai}function Wr(o){return typeof o=="symbol"||Rt(o)&&zt(o)==Ia}var ll=In?rr(In):p;function xN(o){return o===r}function RN(o){return Rt(o)&&nr(o)==fs}function IN(o){return Rt(o)&&zt(o)==fr}var ON=ih(N),PN=ih(function(o,l){return o<=l});function kC(o){if(!o)return[];if(xr(o))return ph(o)?dr(o):Er(o);if(Io&&o[Io])return Yg(o[Io]());var l=nr(o),d=l==tr?Wu:l==yt?xs:ul;return d(o)}function Wi(o){if(!o)return o===0?o:0;if(o=un(o),o===ie||o===-ie){var l=o<0?-1:1;return l*wt}return o===o?o:0}function xe(o){var l=Wi(o),d=l%1;return l===l?d?l-d:l:0}function AC(o){return o?Li(xe(o),0,he):0}function un(o){if(typeof o=="number")return o;if(Wr(o))return Ce;if(bt(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=bt(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=Ed(o);var d=hg.test(o);return d||Jf.test(o)?pd(o.slice(2),d?2:8):dg.test(o)?Ce:+o}function TC(o){return hi(o,Rr(o))}function kN(o){return o?Li(xe(o),-fe,fe):o===0?o:0}function Qe(o){return o==null?"":Vr(o)}var AN=sl(function(o,l){if(ic(l)||xr(l)){hi(l,Yt(l),o);return}for(var d in l)Ke.call(l,d)&&No(o,d,l[d])}),qC=sl(function(o,l){hi(l,Rr(l),o)}),mh=sl(function(o,l,d,v){hi(l,Rr(l),o,v)}),TN=sl(function(o,l,d,v){hi(l,Yt(l),o,v)}),qN=Bi(nl);function NN(o,l){var d=ks(o);return l==null?d:Ku(d,l)}var MN=Te(function(o,l){o=Ae(o);var d=-1,v=l.length,_=v>2?l[2]:r;for(_&&pr(l[0],l[1],_)&&(v=1);++d<v;)for(var O=l[d],T=Rr(O),M=-1,B=T.length;++M<B;){var G=T[M],Q=o[G];(Q===r||Mn(Q,Rs[G])&&!Ke.call(o,G))&&(o[G]=O[G])}return o}),$N=Te(function(o){return o.push(r,Gw),Jt(NC,r,o)});function DN(o,l){return bd(o,pe(l,3),rn)}function FN(o,l){return bd(o,pe(l,3),Zu)}function LN(o,l){return o==null?o:Qu(o,pe(l,3),Rr)}function jN(o,l){return o==null?o:Kd(o,pe(l,3),Rr)}function UN(o,l){return o&&rn(o,pe(l,3))}function BN(o,l){return o&&Zu(o,pe(l,3))}function HN(o){return o==null?[]:nn(o,Yt(o))}function VN(o){return o==null?[]:nn(o,Rr(o))}function dv(o,l,d){var v=o==null?r:ji(o,l);return v===r?d:v}function WN(o,l){return o!=null&&Xw(o,l,Ny)}function hv(o,l){return o!=null&&Xw(o,l,My)}var YN=Ww(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Ha.call(l)),o[l]=d},mv(Ir)),JN=Ww(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Ha.call(l)),Ke.call(o,l)?o[l].push(d):o[l]=[d]},pe),zN=Te(sn);function Yt(o){return xr(o)?rl(o):b(o)}function Rr(o){return xr(o)?rl(o,!0):R(o)}function KN(o,l){var d={};return l=pe(l,3),rn(o,function(v,_,O){Tn(d,l(v,_,O),v)}),d}function GN(o,l){var d={};return l=pe(l,3),rn(o,function(v,_,O){Tn(d,_,l(v,_,O))}),d}var QN=sl(function(o,l,d){Oe(o,l,d)}),NC=sl(function(o,l,d,v){Oe(o,l,d,v)}),ZN=Bi(function(o,l){var d={};if(o==null)return d;var v=!1;l=tt(l,function(O){return O=qs(O,o),v||(v=O.length>1),O}),hi(o,Zy(o),d),v&&(d=hr(d,h|m|g,YA));for(var _=l.length;_--;)Vy(d,l[_]);return d});function XN(o,l){return MC(o,dh(pe(l)))}var eM=Bi(function(o,l){return o==null?{}:IA(o,l)});function MC(o,l){if(o==null)return{};var d=tt(Zy(o),function(v){return[v]});return l=pe(l),Rw(o,d,function(v,_){return l(v,_[0])})}function tM(o,l,d){l=qs(l,o);var v=-1,_=l.length;for(_||(_=1,o=r);++v<_;){var O=o==null?r:o[pi(l[v])];O===r&&(v=_,O=d),o=Vi(O)?O.call(o):O}return o}function rM(o,l,d){return o==null?o:rc(o,l,d)}function nM(o,l,d,v){return v=typeof v=="function"?v:r,o==null?o:rc(o,l,d,v)}var $C=zw(Yt),DC=zw(Rr);function iM(o,l,d){var v=Ee(o),_=v||Ms(o)||ll(o);if(l=pe(l,4),d==null){var O=o&&o.constructor;_?d=v?new O:[]:bt(o)?d=Vi(O)?ks(Ya(o)):{}:d={}}return(_?Et:rn)(o,function(T,M,B){return l(d,T,M,B)}),d}function sM(o,l){return o==null?!0:Vy(o,l)}function oM(o,l,d){return o==null?o:Aw(o,l,Jy(d))}function aM(o,l,d,v){return v=typeof v=="function"?v:r,o==null?o:Aw(o,l,Jy(d),v)}function ul(o){return o==null?[]:Vu(o,Yt(o))}function lM(o){return o==null?[]:Vu(o,Rr(o))}function uM(o,l,d){return d===r&&(d=l,l=r),d!==r&&(d=un(d),d=d===d?d:0),l!==r&&(l=un(l),l=l===l?l:0),Li(un(o),l,d)}function cM(o,l,d){return l=Wi(l),d===r?(d=l,l=0):d=Wi(d),o=un(o),$y(o,l,d)}function fM(o,l,d){if(d&&typeof d!="boolean"&&pr(o,l,d)&&(l=d=r),d===r&&(typeof l=="boolean"?(d=l,l=r):typeof o=="boolean"&&(d=o,o=r)),o===r&&l===r?(o=0,l=1):(o=Wi(o),l===r?(l=o,o=0):l=Wi(l)),o>l){var v=o;o=l,l=v}if(d||o%1||l%1){var _=Fd();return St(o+_*(l-o+hd("1e-"+((_+"").length-1))),l)}return Uy(o,l)}var dM=ol(function(o,l,d){return l=l.toLowerCase(),o+(d?FC(l):l)});function FC(o){return pv(Qe(o).toLowerCase())}function LC(o){return o=Qe(o),o&&o.replace(vs,Rd).replace(Rg,"")}function hM(o,l,d){o=Qe(o),l=Vr(l);var v=o.length;d=d===r?v:Li(xe(d),0,v);var _=d;return d-=l.length,d>=0&&o.slice(d,_)==l}function pM(o){return o=Qe(o),o&&Aa.test(o)?o.replace(Ti,Bg):o}function mM(o){return o=Qe(o),o&&Ge.test(o)?o.replace(bo,"\\$&"):o}var gM=ol(function(o,l,d){return o+(d?"-":"")+l.toLowerCase()}),yM=ol(function(o,l,d){return o+(d?" ":"")+l.toLowerCase()}),vM=Bw("toLowerCase");function SM(o,l,d){o=Qe(o),l=xe(l);var v=l?ai(o):0;if(!l||v>=l)return o;var _=(l-v)/2;return nh(Oo(_),d)+o+nh(za(_),d)}function bM(o,l,d){o=Qe(o),l=xe(l);var v=l?ai(o):0;return l&&v<l?o+nh(l-v,d):o}function _M(o,l,d){o=Qe(o),l=xe(l);var v=l?ai(o):0;return l&&v<l?nh(l-v,d)+o:o}function wM(o,l,d){return d||l==null?l=0:l&&(l=+l),Dd(Qe(o).replace(qi,""),l||0)}function CM(o,l,d){return(d?pr(o,l,d):l===r)?l=1:l=xe(l),By(Qe(o),l)}function EM(){var o=arguments,l=Qe(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var xM=ol(function(o,l,d){return o+(d?"_":"")+l.toLowerCase()});function RM(o,l,d){return d&&typeof d!="number"&&pr(o,l,d)&&(l=d=r),d=d===r?he:d>>>0,d?(o=Qe(o),o&&(typeof l=="string"||l!=null&&!fv(l))&&(l=Vr(l),!l&&en(o))?Ns(dr(o),0,d):o.split(l,d)):[]}var IM=ol(function(o,l,d){return o+(d?" ":"")+pv(l)});function OM(o,l,d){return o=Qe(o),d=d==null?0:Li(xe(d),0,o.length),l=Vr(l),o.slice(d,d+l.length)==l}function PM(o,l,d){var v=I.templateSettings;d&&pr(o,l,d)&&(l=r),o=Qe(o),l=mh({},l,v,Kw);var _=mh({},l.imports,v.imports,Kw),O=Yt(_),T=Vu(_,O),M,B,G=0,Q=l.interpolate||ii,X="__p += '",re=On((l.escape||ii).source+"|"+Q.source+"|"+(Q===Yf?Rn:ii).source+"|"+(l.evaluate||ii).source+"|$","g"),ue="//# sourceURL="+(Ke.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ag+"]")+`
|
|
4
|
-
`;o.replace(re,function(ge,Fe,Ue,Yr,
|
|
3
|
+
`)}function tT(o){return Ce(o)||Lo(o)||!!(qd&&o&&o[qd])}function Hi(o,l){var d=typeof o;return l=l??fe,!!l&&(d=="number"||d!="symbol"&&hg.test(o))&&o>-1&&o%1==0&&o<l}function mr(o,l,d){if(!bt(d))return!1;var v=typeof l;return(v=="number"?Rr(d)&&Hi(l,d.length):v=="string"&&l in d)?Mn(d[l],o):!1}function tv(o,l){if(Ce(o))return!1;var d=typeof o;return d=="number"||d=="symbol"||d=="boolean"||o==null||Wr(o)?!0:_r.test(o)||!Cn.test(o)||l!=null&&o in Te(l)}function rT(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function rv(o){var l=ih(o),d=O[l];if(typeof d!="function"||!(l in Ie.prototype))return!1;if(o===d)return!0;var v=Zy(d);return!!v&&o===v[0]}function nT(o){return!!Pd&&Pd in o}var iT=Ba?Vi:Sv;function ic(o){var l=o&&o.constructor,d=typeof l=="function"&&l.prototype||Rs;return o===d}function tE(o){return o===o&&!bt(o)}function rE(o,l){return function(d){return d==null?!1:d[o]===l&&(l!==t||o in Te(d))}}function sT(o){var l=ch(o,function(v){return d.size===u&&d.clear(),v}),d=l.cache;return l}function oT(o,l){var d=o[1],v=l[1],_=d|v,I=_<(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(!(I||q))return o;v&C&&(o[2]=l[2],_|=d&C?0:A);var M=l[3];if(M){var B=o[3];o[3]=B?Fw(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?Lw(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]:St(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=_,o}function aT(o){var l=[];if(o!=null)for(var d in Te(o))l.push(d);return l}function lT(o){return Ha.call(o)}function nE(o,l,d){return l=xt(l===t?o.length-1:l,0),function(){for(var v=arguments,_=-1,I=xt(v.length-l,0),q=H(I);++_<I;)q[_]=v[l+_];_=-1;for(var M=H(l+1);++_<l;)M[_]=v[_];return M[l]=d(q),Jt(o,this,M)}}function iE(o,l){return l.length<2?o:ji(o,an(l,0,-1))}function uT(o,l){for(var d=o.length,v=St(l.length,d),_=xr(o);v--;){var I=l[v];o[v]=Hi(I,d)?_[I]:t}return o}function nv(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var sE=aE(Iw),sc=sy||function(o,l){return $t.setTimeout(o,l)},iv=aE(TA);function oE(o,l,d){var v=l+"";return iv(o,eT(v,cT(QA(v),d)))}function aE(o){var l=0,d=0;return function(){var v=Md(),_=D-(v-d);if(d=v,_>0){if(++l>=$)return arguments[0]}else l=0;return o.apply(t,arguments)}}function oh(o,l){var d=-1,v=o.length,_=v-1;for(l=l===t?v:l;++d<l;){var I=jy(d,_),q=o[I];o[I]=o[d],o[d]=q}return o.length=l,o}var lE=sT(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(Me,function(d,v,_,I){l.push(_?I.replace(jr,"$1"):v||d)}),l});function pi(o){if(typeof o=="string"||Wr(o))return o;var l=o+"";return l=="0"&&1/o==-ie?"-0":l}function Fo(o){if(o!=null){try{return Ro.call(o)}catch{}try{return o+""}catch{}}return""}function cT(o,l){return Ct(Mt,function(d){var v="_."+d[0];l&d[1]&&!La(o,v)&&o.push(v)}),o.sort()}function uE(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 fT(o,l,d){(d?mr(o,l,d):l===t)?l=1:l=xt(xe(l),0);var v=o==null?0:o.length;if(!v||l<1)return[];for(var _=0,I=0,q=H(za(v/l));_<v;)q[I++]=an(o,_,_+=l);return q}function dT(o){for(var l=-1,d=o==null?0:o.length,v=0,_=[];++l<d;){var I=o[l];I&&(_[v++]=I)}return _}function hT(){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(Ce(d)?xr(d):[d],Ut(l,1))}var pT=qe(function(o,l){return Tt(o)?As(o,Ut(l,1,Tt,!0)):[]}),mT=qe(function(o,l){var d=ln(l);return Tt(d)&&(d=t),Tt(o)?As(o,Ut(l,1,Tt,!0),pe(d,2)):[]}),gT=qe(function(o,l){var d=ln(l);return Tt(d)&&(d=t),Tt(o)?As(o,Ut(l,1,Tt,!0),t,d):[]});function yT(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===t?1:xe(l),an(o,l<0?0:l,v)):[]}function vT(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===t?1:xe(l),l=v-l,an(o,0,l<0?0:l)):[]}function ST(o,l){return o&&o.length?Zd(o,pe(l,3),!0,!0):[]}function bT(o,l){return o&&o.length?Zd(o,pe(l,3),!0):[]}function _T(o,l,d,v){var _=o==null?0:o.length;return _?(d&&typeof d!="number"&&mr(o,l,d)&&(d=0,v=_),Ty(o,l,d,v)):[]}function cE(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var _=d==null?0:xe(d);return _<0&&(_=xt(v+_,0)),ja(o,pe(l,3),_)}function fE(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var _=v-1;return d!==t&&(_=xe(d),_=d<0?xt(v+_,0):St(_,v-1)),ja(o,pe(l,3),_,!0)}function dE(o){var l=o==null?0:o.length;return l?Ut(o,1):[]}function wT(o){var l=o==null?0:o.length;return l?Ut(o,ie):[]}function ET(o,l){var d=o==null?0:o.length;return d?(l=l===t?1:xe(l),Ut(o,l)):[]}function CT(o){for(var l=-1,d=o==null?0:o.length,v={};++l<d;){var _=o[l];v[_[0]]=_[1]}return v}function hE(o){return o&&o.length?o[0]:t}function xT(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var _=d==null?0:xe(d);return _<0&&(_=xt(v+_,0)),Es(o,l,_)}function RT(o){var l=o==null?0:o.length;return l?an(o,0,-1):[]}var OT=qe(function(o){var l=tt(o,Wy);return l.length&&l[0]===o[0]?ec(l):[]}),IT=qe(function(o){var l=ln(o),d=tt(o,Wy);return l===ln(d)?l=t:d.pop(),d.length&&d[0]===o[0]?ec(d,pe(l,2)):[]}),PT=qe(function(o){var l=ln(o),d=tt(o,Wy);return l=typeof l=="function"?l:t,l&&d.pop(),d.length&&d[0]===o[0]?ec(d,t,l):[]});function kT(o,l){return o==null?"":Os.call(o,l)}function ln(o){var l=o==null?0:o.length;return l?o[l-1]:t}function AT(o,l,d){var v=o==null?0:o.length;if(!v)return-1;var _=v;return d!==t&&(_=xe(d),_=_<0?xt(v+_,0):St(_,v-1)),l===l?Jg(o,l,_):ja(o,_d,_,!0)}function TT(o,l){return o&&o.length?on(o,xe(l)):t}var qT=qe(pE);function pE(o,l){return o&&o.length&&l&&l.length?Ly(o,l):o}function NT(o,l,d){return o&&o.length&&l&&l.length?Ly(o,l,pe(d,2)):o}function MT(o,l,d){return o&&o.length&&l&&l.length?Ly(o,l,t,d):o}var $T=Bi(function(o,l){var d=o==null?0:o.length,v=nl(o,l);return Ow(o,tt(l,function(_){return Hi(_,d)?+_:_}).sort(Dw)),v});function DT(o,l){var d=[];if(!(o&&o.length))return d;var v=-1,_=[],I=o.length;for(l=pe(l,3);++v<I;){var q=o[v];l(q,v,o)&&(d.push(q),_.push(v))}return Ow(o,_),d}function sv(o){return o==null?o:oy.call(o)}function FT(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:xe(l),d=d===t?v:xe(d)),an(o,l,d)):[]}function LT(o,l){return Qd(o,l)}function jT(o,l,d){return By(o,l,pe(d,2))}function UT(o,l){var d=o==null?0:o.length;if(d){var v=Qd(o,l);if(v<d&&Mn(o[v],l))return v}return-1}function BT(o,l){return Qd(o,l,!0)}function HT(o,l,d){return By(o,l,pe(d,2),!0)}function VT(o,l){var d=o==null?0:o.length;if(d){var v=Qd(o,l,!0)-1;if(Mn(o[v],l))return v}return-1}function WT(o){return o&&o.length?Pw(o):[]}function YT(o,l){return o&&o.length?Pw(o,pe(l,2)):[]}function JT(o){var l=o==null?0:o.length;return l?an(o,1,l):[]}function zT(o,l,d){return o&&o.length?(l=d||l===t?1:xe(l),an(o,0,l<0?0:l)):[]}function KT(o,l,d){var v=o==null?0:o.length;return v?(l=d||l===t?1:xe(l),l=v-l,an(o,l<0?0:l,v)):[]}function GT(o,l){return o&&o.length?Zd(o,pe(l,3),!1,!0):[]}function QT(o,l){return o&&o.length?Zd(o,pe(l,3)):[]}var ZT=qe(function(o){return Ts(Ut(o,1,Tt,!0))}),XT=qe(function(o){var l=ln(o);return Tt(l)&&(l=t),Ts(Ut(o,1,Tt,!0),pe(l,2))}),eq=qe(function(o){var l=ln(o);return l=typeof l=="function"?l:t,Ts(Ut(o,1,Tt,!0),t,l)});function tq(o){return o&&o.length?Ts(o):[]}function rq(o,l){return o&&o.length?Ts(o,pe(l,2)):[]}function nq(o,l){return l=typeof l=="function"?l:t,o&&o.length?Ts(o,t,l):[]}function ov(o){if(!(o&&o.length))return[];var l=0;return o=oi(o,function(d){if(Tt(d))return l=xt(d.length,l),!0}),Hu(l,function(d){return tt(o,ju(d))})}function mE(o,l){if(!(o&&o.length))return[];var d=ov(o);return l==null?d:tt(d,function(v){return Jt(l,t,v)})}var iq=qe(function(o,l){return Tt(o)?As(o,l):[]}),sq=qe(function(o){return Vy(oi(o,Tt))}),oq=qe(function(o){var l=ln(o);return Tt(l)&&(l=t),Vy(oi(o,Tt),pe(l,2))}),aq=qe(function(o){var l=ln(o);return l=typeof l=="function"?l:t,Vy(oi(o,Tt),t,l)}),lq=qe(ov);function uq(o,l){return qw(o||[],l||[],No)}function cq(o,l){return qw(o||[],l||[],rc)}var fq=qe(function(o){var l=o.length,d=l>1?o[l-1]:t;return d=typeof d=="function"?(o.pop(),d):t,mE(o,d)});function gE(o){var l=O(o);return l.__chain__=!0,l}function dq(o,l){return l(o),o}function ah(o,l){return l(o)}var hq=Bi(function(o){var l=o.length,d=l?o[0]:0,v=this.__wrapped__,_=function(I){return nl(I,o)};return l>1||this.__actions__.length||!(v instanceof Ie)||!Hi(d)?this.thru(_):(v=v.slice(d,+d+(l?1:0)),v.__actions__.push({func:ah,args:[_],thisArg:t}),new Er(v,this.__chain__).thru(function(I){return l&&!I.length&&I.push(t),I}))});function pq(){return gE(this)}function mq(){return new Er(this.value(),this.__chain__)}function gq(){this.__values__===t&&(this.__values__=kE(this.value()));var o=this.__index__>=this.__values__.length,l=o?t:this.__values__[this.__index__++];return{done:o,value:l}}function yq(){return this}function vq(o){for(var l,d=this;d instanceof Xa;){var v=uE(d);v.__index__=0,v.__values__=t,l?_.__wrapped__=v:l=v;var _=v;d=d.__wrapped__}return _.__wrapped__=o,l}function Sq(){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:ah,args:[sv],thisArg:t}),new Er(l,this.__chain__)}return this.thru(sv)}function bq(){return Tw(this.__wrapped__,this.__actions__)}var _q=Xd(function(o,l,d){Ke.call(o,d)?++o[d]:Tn(o,d,1)});function wq(o,l,d){var v=Ce(o)?Fa:Ay;return d&&mr(o,l,d)&&(l=t),v(o,pe(l,3))}function Eq(o,l){var d=Ce(o)?oi:Jd;return d(o,pe(l,3))}var Cq=Hw(cE),xq=Hw(fE);function Rq(o,l){return Ut(lh(o,l),1)}function Oq(o,l){return Ut(lh(o,l),ie)}function Iq(o,l,d){return d=d===t?1:xe(d),Ut(lh(o,l),d)}function yE(o,l){var d=Ce(o)?Ct:fi;return d(o,pe(l,3))}function vE(o,l){var d=Ce(o)?Mg:Yd;return d(o,pe(l,3))}var Pq=Xd(function(o,l,d){Ke.call(o,d)?o[d].push(l):Tn(o,d,[l])});function kq(o,l,d,v){o=Rr(o)?o:ul(o),d=d&&!v?xe(d):0;var _=o.length;return d<0&&(d=xt(_+d,0)),hh(o)?d<=_&&o.indexOf(l,d)>-1:!!_&&Es(o,l,d)>-1}var Aq=qe(function(o,l,d){var v=-1,_=typeof l=="function",I=Rr(o)?H(o.length):[];return fi(o,function(q){I[++v]=_?Jt(l,q,d):sn(q,l,d)}),I}),Tq=Xd(function(o,l,d){Tn(o,d,l)});function lh(o,l){var d=Ce(o)?tt:W;return d(o,pe(l,3))}function qq(o,l,d,v){return o==null?[]:(Ce(l)||(l=l==null?[]:[l]),d=v?t:d,Ce(d)||(d=d==null?[]:[d]),Nn(o,l,d))}var Nq=Xd(function(o,l,d){o[d?0:1].push(l)},function(){return[[],[]]});function Mq(o,l,d){var v=Ce(o)?Fu:wd,_=arguments.length<3;return v(o,pe(l,4),d,_,fi)}function $q(o,l,d){var v=Ce(o)?$g:wd,_=arguments.length<3;return v(o,pe(l,4),d,_,Yd)}function Dq(o,l){var d=Ce(o)?oi:Jd;return d(o,fh(pe(l,3)))}function Fq(o){var l=Ce(o)?Vd:kA;return l(o)}function Lq(o,l,d){(d?mr(o,l,d):l===t)?l=1:l=xe(l);var v=Ce(o)?Oy:AA;return v(o,l)}function jq(o){var l=Ce(o)?Iy:qA;return l(o)}function Uq(o){if(o==null)return 0;if(Rr(o))return hh(o)?ai(o):o.length;var l=nr(o);return l==tr||l==yt?o.size:b(o).length}function Bq(o,l,d){var v=Ce(o)?Lu:NA;return d&&mr(o,l,d)&&(l=t),v(o,pe(l,3))}var Hq=qe(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]]),Nn(o,Ut(l,1),[])}),uh=iy||function(){return $t.Date.now()};function Vq(o,l){if(typeof l!="function")throw new wr(i);return o=xe(o),function(){if(--o<1)return l.apply(this,arguments)}}function SE(o,l,d){return l=d?t:l,l=o&&l==null?o.length:l,Ui(o,K,t,t,t,t,l)}function bE(o,l){var d;if(typeof l!="function")throw new wr(i);return o=xe(o),function(){return--o>0&&(d=l.apply(this,arguments)),o<=1&&(l=t),d}}var av=qe(function(o,l,d){var v=C;if(d.length){var _=Br(d,al(av));v|=Y}return Ui(o,v,l,d,_)}),_E=qe(function(o,l,d){var v=C|x;if(d.length){var _=Br(d,al(_E));v|=Y}return Ui(l,v,o,d,_)});function wE(o,l,d){l=d?t:l;var v=Ui(o,T,t,t,t,t,t,l);return v.placeholder=wE.placeholder,v}function EE(o,l,d){l=d?t:l;var v=Ui(o,j,t,t,t,t,t,l);return v.placeholder=EE.placeholder,v}function CE(o,l,d){var v,_,I,q,M,B,G=0,Q=!1,X=!1,re=!0;if(typeof o!="function")throw new wr(i);l=un(l)||0,bt(d)&&(Q=!!d.leading,X="maxWait"in d,I=X?xt(un(d.maxWait)||0,l):I,re="trailing"in d?!!d.trailing:re);function ue(qt){var $n=v,Yi=_;return v=_=t,G=qt,q=o.apply(Yi,$n),q}function me(qt){return G=qt,M=sc(Fe,l),Q?ue(qt):q}function ke(qt){var $n=qt-B,Yi=qt-G,HE=l-$n;return X?St(HE,I-Yi):HE}function ge(qt){var $n=qt-B,Yi=qt-G;return B===t||$n>=l||$n<0||X&&Yi>=I}function Fe(){var qt=uh();if(ge(qt))return Ue(qt);M=sc(Fe,ke(qt))}function Ue(qt){return M=t,re&&v?ue(qt):(v=_=t,q)}function Yr(){M!==t&&Nw(M),G=0,v=B=_=M=t}function gr(){return M===t?q:Ue(uh())}function Jr(){var qt=uh(),$n=ge(qt);if(v=arguments,_=this,B=qt,$n){if(M===t)return me(B);if(X)return Nw(M),M=sc(Fe,l),ue(B)}return M===t&&(M=sc(Fe,l)),q}return Jr.cancel=Yr,Jr.flush=gr,Jr}var Wq=qe(function(o,l){return tn(o,1,l)}),Yq=qe(function(o,l,d){return tn(o,un(l)||0,d)});function Jq(o){return Ui(o,k)}function ch(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new wr(i);var d=function(){var v=arguments,_=l?l.apply(this,v):v[0],I=d.cache;if(I.has(_))return I.get(_);var q=o.apply(this,v);return d.cache=I.set(_,q)||I,q};return d.cache=new(ch.Cache||An),d}ch.Cache=An;function fh(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 zq(o){return bE(2,o)}var Kq=MA(function(o,l){l=l.length==1&&Ce(l[0])?tt(l[0],rr(pe())):tt(Ut(l,1),rr(pe()));var d=l.length;return qe(function(v){for(var _=-1,I=St(v.length,d);++_<I;)v[_]=l[_].call(this,v[_]);return Jt(o,this,v)})}),lv=qe(function(o,l){var d=Br(l,al(lv));return Ui(o,Y,t,l,d)}),xE=qe(function(o,l){var d=Br(l,al(xE));return Ui(o,V,t,l,d)}),Gq=Bi(function(o,l){return Ui(o,ee,t,t,t,l)});function Qq(o,l){if(typeof o!="function")throw new wr(i);return l=l===t?l:xe(l),qe(o,l)}function Zq(o,l){if(typeof o!="function")throw new wr(i);return l=l==null?0:xt(xe(l),0),qe(function(d){var v=d[l],_=Ns(d,0,l);return v&&Xr(_,v),Jt(o,this,_)})}function Xq(o,l,d){var v=!0,_=!0;if(typeof o!="function")throw new wr(i);return bt(d)&&(v="leading"in d?!!d.leading:v,_="trailing"in d?!!d.trailing:_),CE(o,l,{leading:v,maxWait:l,trailing:_})}function eN(o){return SE(o,1)}function tN(o,l){return lv(Yy(l),o)}function rN(){if(!arguments.length)return[];var o=arguments[0];return Ce(o)?o:[o]}function nN(o){return pr(o,m)}function iN(o,l){return l=typeof l=="function"?l:t,pr(o,m,l)}function sN(o){return pr(o,h|m)}function oN(o,l){return l=typeof l=="function"?l:t,pr(o,h|m,l)}function aN(o,l){return l==null||Wd(o,l,Yt(l))}function Mn(o,l){return o===l||o!==o&&l!==l}var lN=nh(Xu),uN=nh(function(o,l){return o>=l}),Lo=Gd(function(){return arguments}())?Gd:function(o){return Rt(o)&&Ke.call(o,"callee")&&!Td.call(o,"callee")},Ce=H.isArray,cN=md?rr(md):$y;function Rr(o){return o!=null&&dh(o.length)&&!Vi(o)}function Tt(o){return Rt(o)&&Rr(o)}function fN(o){return o===!0||o===!1||Rt(o)&&zt(o)==ft}var Ms=Nd||Sv,dN=$u?rr($u):Dy;function hN(o){return Rt(o)&&o.nodeType===1&&!oc(o)}function pN(o){if(o==null)return!0;if(Rr(o)&&(Ce(o)||typeof o=="string"||typeof o.splice=="function"||Ms(o)||ll(o)||Lo(o)))return!o.length;var l=nr(o);if(l==tr||l==yt)return!o.size;if(ic(o))return!b(o).length;for(var d in o)if(Ke.call(o,d))return!1;return!0}function mN(o,l){return Mo(o,l)}function gN(o,l,d){d=typeof d=="function"?d:t;var v=d?d(o,l):t;return v===t?Mo(o,l,t,d):!!v}function uv(o){if(!Rt(o))return!1;var l=zt(o);return l==jt||l==us||typeof o.message=="string"&&typeof o.name=="string"&&!oc(o)}function yN(o){return typeof o=="number"&&Po(o)}function Vi(o){if(!bt(o))return!1;var l=zt(o);return l==dt||l==ei||l==Iu||l==sg}function RE(o){return typeof o=="number"&&o==xe(o)}function dh(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=fe}function bt(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function Rt(o){return o!=null&&typeof o=="object"}var OE=gd?rr(gd):tc;function vN(o,l){return o===l||di(o,l,Xy(l))}function SN(o,l,d){return d=typeof d=="function"?d:t,di(o,l,Xy(l),d)}function bN(o){return IE(o)&&o!=+o}function _N(o){if(iT(o))throw new ve(n);return $o(o)}function wN(o){return o===null}function EN(o){return o==null}function IE(o){return typeof o=="number"||Rt(o)&&zt(o)==Qr}function oc(o){if(!Rt(o)||zt(o)!=En)return!1;var l=Ya(o);if(l===null)return!0;var d=Ke.call(l,"constructor")&&l.constructor;return typeof d=="function"&&d instanceof d&&Ro.call(d)==ey}var cv=yd?rr(yd):je;function CN(o){return RE(o)&&o>=-fe&&o<=fe}var PE=wo?rr(wo):c;function hh(o){return typeof o=="string"||!Ce(o)&&Rt(o)&&zt(o)==Ai}function Wr(o){return typeof o=="symbol"||Rt(o)&&zt(o)==Oa}var ll=On?rr(On):p;function xN(o){return o===t}function RN(o){return Rt(o)&&nr(o)==fs}function ON(o){return Rt(o)&&zt(o)==dr}var IN=nh(N),PN=nh(function(o,l){return o<=l});function kE(o){if(!o)return[];if(Rr(o))return hh(o)?hr(o):xr(o);if(Oo&&o[Oo])return Wg(o[Oo]());var l=nr(o),d=l==tr?Wu:l==yt?xs:ul;return d(o)}function Wi(o){if(!o)return o===0?o:0;if(o=un(o),o===ie||o===-ie){var l=o<0?-1:1;return l*wt}return o===o?o:0}function xe(o){var l=Wi(o),d=l%1;return l===l?d?l-d:l:0}function AE(o){return o?Li(xe(o),0,he):0}function un(o){if(typeof o=="number")return o;if(Wr(o))return Ee;if(bt(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=bt(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=Ed(o);var d=dg.test(o);return d||Yf.test(o)?hd(o.slice(2),d?2:8):fg.test(o)?Ee:+o}function TE(o){return hi(o,Or(o))}function kN(o){return o?Li(xe(o),-fe,fe):o===0?o:0}function Qe(o){return o==null?"":Vr(o)}var AN=sl(function(o,l){if(ic(l)||Rr(l)){hi(l,Yt(l),o);return}for(var d in l)Ke.call(l,d)&&No(o,d,l[d])}),qE=sl(function(o,l){hi(l,Or(l),o)}),ph=sl(function(o,l,d,v){hi(l,Or(l),o,v)}),TN=sl(function(o,l,d,v){hi(l,Yt(l),o,v)}),qN=Bi(nl);function NN(o,l){var d=ks(o);return l==null?d:Ku(d,l)}var MN=qe(function(o,l){o=Te(o);var d=-1,v=l.length,_=v>2?l[2]:t;for(_&&mr(l[0],l[1],_)&&(v=1);++d<v;)for(var I=l[d],q=Or(I),M=-1,B=q.length;++M<B;){var G=q[M],Q=o[G];(Q===t||Mn(Q,Rs[G])&&!Ke.call(o,G))&&(o[G]=I[G])}return o}),$N=qe(function(o){return o.push(t,Gw),Jt(NE,t,o)});function DN(o,l){return Sd(o,pe(l,3),rn)}function FN(o,l){return Sd(o,pe(l,3),Zu)}function LN(o,l){return o==null?o:Qu(o,pe(l,3),Or)}function jN(o,l){return o==null?o:zd(o,pe(l,3),Or)}function UN(o,l){return o&&rn(o,pe(l,3))}function BN(o,l){return o&&Zu(o,pe(l,3))}function HN(o){return o==null?[]:nn(o,Yt(o))}function VN(o){return o==null?[]:nn(o,Or(o))}function fv(o,l,d){var v=o==null?t:ji(o,l);return v===t?d:v}function WN(o,l){return o!=null&&Xw(o,l,qy)}function dv(o,l){return o!=null&&Xw(o,l,Ny)}var YN=Ww(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Ha.call(l)),o[l]=d},pv(Ir)),JN=Ww(function(o,l,d){l!=null&&typeof l.toString!="function"&&(l=Ha.call(l)),Ke.call(o,l)?o[l].push(d):o[l]=[d]},pe),zN=qe(sn);function Yt(o){return Rr(o)?rl(o):b(o)}function Or(o){return Rr(o)?rl(o,!0):R(o)}function KN(o,l){var d={};return l=pe(l,3),rn(o,function(v,_,I){Tn(d,l(v,_,I),v)}),d}function GN(o,l){var d={};return l=pe(l,3),rn(o,function(v,_,I){Tn(d,_,l(v,_,I))}),d}var QN=sl(function(o,l,d){Pe(o,l,d)}),NE=sl(function(o,l,d,v){Pe(o,l,d,v)}),ZN=Bi(function(o,l){var d={};if(o==null)return d;var v=!1;l=tt(l,function(I){return I=qs(I,o),v||(v=I.length>1),I}),hi(o,Qy(o),d),v&&(d=pr(d,h|g|m,YA));for(var _=l.length;_--;)Hy(d,l[_]);return d});function XN(o,l){return ME(o,fh(pe(l)))}var eM=Bi(function(o,l){return o==null?{}:OA(o,l)});function ME(o,l){if(o==null)return{};var d=tt(Qy(o),function(v){return[v]});return l=pe(l),Rw(o,d,function(v,_){return l(v,_[0])})}function tM(o,l,d){l=qs(l,o);var v=-1,_=l.length;for(_||(_=1,o=t);++v<_;){var I=o==null?t:o[pi(l[v])];I===t&&(v=_,I=d),o=Vi(I)?I.call(o):I}return o}function rM(o,l,d){return o==null?o:rc(o,l,d)}function nM(o,l,d,v){return v=typeof v=="function"?v:t,o==null?o:rc(o,l,d,v)}var $E=zw(Yt),DE=zw(Or);function iM(o,l,d){var v=Ce(o),_=v||Ms(o)||ll(o);if(l=pe(l,4),d==null){var I=o&&o.constructor;_?d=v?new I:[]:bt(o)?d=Vi(I)?ks(Ya(o)):{}:d={}}return(_?Ct:rn)(o,function(q,M,B){return l(d,q,M,B)}),d}function sM(o,l){return o==null?!0:Hy(o,l)}function oM(o,l,d){return o==null?o:Aw(o,l,Yy(d))}function aM(o,l,d,v){return v=typeof v=="function"?v:t,o==null?o:Aw(o,l,Yy(d),v)}function ul(o){return o==null?[]:Vu(o,Yt(o))}function lM(o){return o==null?[]:Vu(o,Or(o))}function uM(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),Li(un(o),l,d)}function cM(o,l,d){return l=Wi(l),d===t?(d=l,l=0):d=Wi(d),o=un(o),My(o,l,d)}function fM(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=Wi(o),l===t?(l=o,o=0):l=Wi(l)),o>l){var v=o;o=l,l=v}if(d||o%1||l%1){var _=Dd();return St(o+_*(l-o+dd("1e-"+((_+"").length-1))),l)}return jy(o,l)}var dM=ol(function(o,l,d){return l=l.toLowerCase(),o+(d?FE(l):l)});function FE(o){return hv(Qe(o).toLowerCase())}function LE(o){return o=Qe(o),o&&o.replace(vs,xd).replace(xg,"")}function hM(o,l,d){o=Qe(o),l=Vr(l);var v=o.length;d=d===t?v:Li(xe(d),0,v);var _=d;return d-=l.length,d>=0&&o.slice(d,_)==l}function pM(o){return o=Qe(o),o&&Aa.test(o)?o.replace(Ti,Ug):o}function mM(o){return o=Qe(o),o&&Ge.test(o)?o.replace(bo,"\\$&"):o}var gM=ol(function(o,l,d){return o+(d?"-":"")+l.toLowerCase()}),yM=ol(function(o,l,d){return o+(d?" ":"")+l.toLowerCase()}),vM=Bw("toLowerCase");function SM(o,l,d){o=Qe(o),l=xe(l);var v=l?ai(o):0;if(!l||v>=l)return o;var _=(l-v)/2;return rh(Io(_),d)+o+rh(za(_),d)}function bM(o,l,d){o=Qe(o),l=xe(l);var v=l?ai(o):0;return l&&v<l?o+rh(l-v,d):o}function _M(o,l,d){o=Qe(o),l=xe(l);var v=l?ai(o):0;return l&&v<l?rh(l-v,d)+o:o}function wM(o,l,d){return d||l==null?l=0:l&&(l=+l),$d(Qe(o).replace(qi,""),l||0)}function EM(o,l,d){return(d?mr(o,l,d):l===t)?l=1:l=xe(l),Uy(Qe(o),l)}function CM(){var o=arguments,l=Qe(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var xM=ol(function(o,l,d){return o+(d?"_":"")+l.toLowerCase()});function RM(o,l,d){return d&&typeof d!="number"&&mr(o,l,d)&&(l=d=t),d=d===t?he:d>>>0,d?(o=Qe(o),o&&(typeof l=="string"||l!=null&&!cv(l))&&(l=Vr(l),!l&&en(o))?Ns(hr(o),0,d):o.split(l,d)):[]}var OM=ol(function(o,l,d){return o+(d?" ":"")+hv(l)});function IM(o,l,d){return o=Qe(o),d=d==null?0:Li(xe(d),0,o.length),l=Vr(l),o.slice(d,d+l.length)==l}function PM(o,l,d){var v=O.templateSettings;d&&mr(o,l,d)&&(l=t),o=Qe(o),l=ph({},l,v,Kw);var _=ph({},l.imports,v.imports,Kw),I=Yt(_),q=Vu(_,I),M,B,G=0,Q=l.interpolate||ii,X="__p += '",re=In((l.escape||ii).source+"|"+Q.source+"|"+(Q===Wf?Rn:ii).source+"|"+(l.evaluate||ii).source+"|$","g"),ue="//# sourceURL="+(Ke.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++kg+"]")+`
|
|
4
|
+
`;o.replace(re,function(ge,Fe,Ue,Yr,gr,Jr){return Ue||(Ue=Yr),X+=o.slice(G,Jr).replace(Jf,Bg),Fe&&(M=!0,X+=`' +
|
|
5
5
|
__e(`+Fe+`) +
|
|
6
|
-
'`),
|
|
7
|
-
`+
|
|
6
|
+
'`),gr&&(B=!0,X+=`';
|
|
7
|
+
`+gr+`;
|
|
8
8
|
__p += '`),Ue&&(X+=`' +
|
|
9
9
|
((__t = (`+Ue+`)) == null ? '' : __t) +
|
|
10
10
|
'`),G=Jr+ge.length,ge}),X+=`';
|
|
11
11
|
`;var me=Ke.call(l,"variable")&&l.variable;if(!me)X=`with (obj) {
|
|
12
12
|
`+X+`
|
|
13
13
|
}
|
|
14
|
-
`;else if(kt.test(me))throw new ve(s);X=(B?X.replace(
|
|
14
|
+
`;else if(kt.test(me))throw new ve(s);X=(B?X.replace(ag,""):X).replace(ka,"$1").replace(lg,"$1;"),X="function("+(me||"obj")+`) {
|
|
15
15
|
`+(me?"":`obj || (obj = {});
|
|
16
16
|
`)+"var __t, __p = ''"+(M?", __e = _.escape":"")+(B?`, __j = Array.prototype.join;
|
|
17
17
|
function print() { __p += __j.call(arguments, '') }
|
|
18
18
|
`:`;
|
|
19
19
|
`)+X+`return __p
|
|
20
|
-
}`;var Pe=UC(function(){return Ye(O,ue+"return "+X).apply(r,T)});if(Pe.source=X,cv(Pe))throw Pe;return Pe}function kM(o){return Qe(o).toLowerCase()}function AM(o){return Qe(o).toUpperCase()}function TM(o,l,d){if(o=Qe(o),o&&(d||l===r))return Ed(o);if(!o||!(l=Vr(l)))return o;var v=dr(o),_=dr(l),O=st(v,_),T=xd(v,_)+1;return Ns(v,O,T).join("")}function qM(o,l,d){if(o=Qe(o),o&&(d||l===r))return o.slice(0,Ua(o)+1);if(!o||!(l=Vr(l)))return o;var v=dr(o),_=xd(v,dr(l))+1;return Ns(v,0,_).join("")}function NM(o,l,d){if(o=Qe(o),o&&(d||l===r))return o.replace(qi,"");if(!o||!(l=Vr(l)))return o;var v=dr(o),_=st(v,dr(l));return Ns(v,_).join("")}function MM(o,l){var d=w,v=P;if(bt(l)){var _="separator"in l?l.separator:_;d="length"in l?xe(l.length):d,v="omission"in l?Vr(l.omission):v}o=Qe(o);var O=o.length;if(en(o)){var T=dr(o);O=T.length}if(d>=O)return o;var M=d-ai(v);if(M<1)return v;var B=T?Ns(T,0,M).join(""):o.slice(0,M);if(_===r)return B+v;if(T&&(M+=B.length-M),fv(_)){if(o.slice(M).search(_)){var G,Q=B;for(_.global||(_=On(_.source,Qe(ni.exec(_))+"g")),_.lastIndex=0;G=_.exec(Q);)var X=G.index;B=B.slice(0,X===r?M:X)}}else if(o.indexOf(Vr(_),M)!=M){var re=B.lastIndexOf(_);re>-1&&(B=B.slice(0,re))}return B+v}function $M(o){return o=Qe(o),o&&Pu.test(o)?o.replace(ys,Kg):o}var DM=ol(function(o,l,d){return o+(d?" ":"")+l.toUpperCase()}),pv=Bw("toUpperCase");function jC(o,l,d){return o=Qe(o),l=d?r:l,l===r?Wg(o)?Zg(o):Lg(o):o.match(l)||[]}var UC=Te(function(o,l){try{return Jt(o,r,l)}catch(d){return cv(d)?d:new ve(d)}}),FM=Bi(function(o,l){return Et(l,function(d){d=pi(d),Tn(o,d,lv(o[d],o))}),o});function LM(o){var l=o==null?0:o.length,d=pe();return o=l?tt(o,function(v){if(typeof v[1]!="function")throw new _r(i);return[d(v[0]),v[1]]}):[],Te(function(v){for(var _=-1;++_<l;){var O=o[_];if(Jt(O[0],this,v))return Jt(O[1],this,v)}})}function jM(o){return Gu(hr(o,h))}function mv(o){return function(){return o}}function UM(o,l){return o==null||o!==o?l:o}var BM=Vw(),HM=Vw(!0);function Ir(o){return o}function gv(o){return y(typeof o=="function"?o:hr(o,h))}function VM(o){return se(hr(o,h))}function WM(o,l){return ye(o,hr(l,h))}var YM=Te(function(o,l){return function(d){return sn(d,o,l)}}),JM=Te(function(o,l){return function(d){return sn(o,d,l)}});function yv(o,l,d){var v=Yt(l),_=nn(l,v);d==null&&!(bt(l)&&(_.length||!v.length))&&(d=l,l=o,o=this,_=nn(l,Yt(l)));var O=!(bt(d)&&"chain"in d)||!!d.chain,T=Vi(o);return Et(_,function(M){var B=l[M];o[M]=B,T&&(o.prototype[M]=function(){var G=this.__chain__;if(O||G){var Q=o(this.__wrapped__),X=Q.__actions__=Er(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 zM(){return $t._===this&&($t._=ry),this}function vv(){}function KM(o){return o=xe(o),Te(function(l){return on(l,o)})}var GM=Ky(tt),QM=Ky(Fa),ZM=Ky(Lu);function BC(o){return rv(o)?ju(pi(o)):OA(o)}function XM(o){return function(l){return o==null?r:ji(o,l)}}var e$=Yw(),t$=Yw(!0);function Sv(){return[]}function bv(){return!1}function r$(){return{}}function n$(){return""}function i$(){return!0}function s$(o,l){if(o=xe(o),o<1||o>fe)return[];var d=he,v=St(o,he);l=pe(l),o-=he;for(var _=Hu(v,l);++d<o;)l(d);return _}function o$(o){return Ee(o)?tt(o,pi):Wr(o)?[o]:Er(lC(Qe(o)))}function a$(o){var l=++ey;return Qe(o)+l}var l$=rh(function(o,l){return o+l},0),u$=Gy("ceil"),c$=rh(function(o,l){return o/l},1),f$=Gy("floor");function d$(o){return o&&o.length?il(o,Ir,Xu):r}function h$(o,l){return o&&o.length?il(o,pe(l,2),Xu):r}function p$(o){return Mi(o,Ir)}function m$(o,l){return Mi(o,pe(l,2))}function g$(o){return o&&o.length?il(o,Ir,N):r}function y$(o,l){return o&&o.length?il(o,pe(l,2),N):r}var v$=rh(function(o,l){return o*l},1),S$=Gy("round"),b$=rh(function(o,l){return o-l},0);function _$(o){return o&&o.length?Bu(o,Ir):0}function w$(o,l){return o&&o.length?Bu(o,pe(l,2)):0}return I.after=Vq,I.ary=SC,I.assign=AN,I.assignIn=qC,I.assignInWith=mh,I.assignWith=TN,I.at=qN,I.before=bC,I.bind=lv,I.bindAll=FM,I.bindKey=_C,I.castArray=rN,I.chain=gC,I.chunk=fT,I.compact=dT,I.concat=hT,I.cond=LM,I.conforms=jM,I.constant=mv,I.countBy=_q,I.create=NN,I.curry=wC,I.curryRight=CC,I.debounce=EC,I.defaults=MN,I.defaultsDeep=$N,I.defer=Wq,I.delay=Yq,I.difference=pT,I.differenceBy=mT,I.differenceWith=gT,I.drop=yT,I.dropRight=vT,I.dropRightWhile=ST,I.dropWhile=bT,I.fill=_T,I.filter=Cq,I.flatMap=Rq,I.flatMapDeep=Iq,I.flatMapDepth=Oq,I.flatten=dC,I.flattenDeep=wT,I.flattenDepth=CT,I.flip=Jq,I.flow=BM,I.flowRight=HM,I.fromPairs=ET,I.functions=HN,I.functionsIn=VN,I.groupBy=Pq,I.initial=RT,I.intersection=IT,I.intersectionBy=OT,I.intersectionWith=PT,I.invert=YN,I.invertBy=JN,I.invokeMap=Aq,I.iteratee=gv,I.keyBy=Tq,I.keys=Yt,I.keysIn=Rr,I.map=uh,I.mapKeys=KN,I.mapValues=GN,I.matches=VM,I.matchesProperty=WM,I.memoize=fh,I.merge=QN,I.mergeWith=NC,I.method=YM,I.methodOf=JM,I.mixin=yv,I.negate=dh,I.nthArg=KM,I.omit=ZN,I.omitBy=XN,I.once=zq,I.orderBy=qq,I.over=GM,I.overArgs=Kq,I.overEvery=QM,I.overSome=ZM,I.partial=uv,I.partialRight=xC,I.partition=Nq,I.pick=eM,I.pickBy=MC,I.property=BC,I.propertyOf=XM,I.pull=qT,I.pullAll=pC,I.pullAllBy=NT,I.pullAllWith=MT,I.pullAt=$T,I.range=e$,I.rangeRight=t$,I.rearg=Gq,I.reject=Dq,I.remove=DT,I.rest=Qq,I.reverse=ov,I.sampleSize=Lq,I.set=rM,I.setWith=nM,I.shuffle=jq,I.slice=FT,I.sortBy=Hq,I.sortedUniq=WT,I.sortedUniqBy=YT,I.split=RM,I.spread=Zq,I.tail=JT,I.take=zT,I.takeRight=KT,I.takeRightWhile=GT,I.takeWhile=QT,I.tap=dq,I.throttle=Xq,I.thru=lh,I.toArray=kC,I.toPairs=$C,I.toPairsIn=DC,I.toPath=o$,I.toPlainObject=TC,I.transform=iM,I.unary=eN,I.union=ZT,I.unionBy=XT,I.unionWith=eq,I.uniq=tq,I.uniqBy=rq,I.uniqWith=nq,I.unset=sM,I.unzip=av,I.unzipWith=mC,I.update=oM,I.updateWith=aM,I.values=ul,I.valuesIn=lM,I.without=iq,I.words=jC,I.wrap=tN,I.xor=sq,I.xorBy=oq,I.xorWith=aq,I.zip=lq,I.zipObject=uq,I.zipObjectDeep=cq,I.zipWith=fq,I.entries=$C,I.entriesIn=DC,I.extend=qC,I.extendWith=mh,yv(I,I),I.add=l$,I.attempt=UC,I.camelCase=dM,I.capitalize=FC,I.ceil=u$,I.clamp=uM,I.clone=nN,I.cloneDeep=sN,I.cloneDeepWith=oN,I.cloneWith=iN,I.conformsTo=aN,I.deburr=LC,I.defaultTo=UM,I.divide=c$,I.endsWith=hM,I.eq=Mn,I.escape=pM,I.escapeRegExp=mM,I.every=wq,I.find=Eq,I.findIndex=cC,I.findKey=DN,I.findLast=xq,I.findLastIndex=fC,I.findLastKey=FN,I.floor=f$,I.forEach=yC,I.forEachRight=vC,I.forIn=LN,I.forInRight=jN,I.forOwn=UN,I.forOwnRight=BN,I.get=dv,I.gt=lN,I.gte=uN,I.has=WN,I.hasIn=hv,I.head=hC,I.identity=Ir,I.includes=kq,I.indexOf=xT,I.inRange=cM,I.invoke=zN,I.isArguments=Lo,I.isArray=Ee,I.isArrayBuffer=cN,I.isArrayLike=xr,I.isArrayLikeObject=Tt,I.isBoolean=fN,I.isBuffer=Ms,I.isDate=dN,I.isElement=hN,I.isEmpty=pN,I.isEqual=mN,I.isEqualWith=gN,I.isError=cv,I.isFinite=yN,I.isFunction=Vi,I.isInteger=RC,I.isLength=hh,I.isMap=IC,I.isMatch=vN,I.isMatchWith=SN,I.isNaN=bN,I.isNative=_N,I.isNil=CN,I.isNull=wN,I.isNumber=OC,I.isObject=bt,I.isObjectLike=Rt,I.isPlainObject=oc,I.isRegExp=fv,I.isSafeInteger=EN,I.isSet=PC,I.isString=ph,I.isSymbol=Wr,I.isTypedArray=ll,I.isUndefined=xN,I.isWeakMap=RN,I.isWeakSet=IN,I.join=kT,I.kebabCase=gM,I.last=ln,I.lastIndexOf=AT,I.lowerCase=yM,I.lowerFirst=vM,I.lt=ON,I.lte=PN,I.max=d$,I.maxBy=h$,I.mean=p$,I.meanBy=m$,I.min=g$,I.minBy=y$,I.stubArray=Sv,I.stubFalse=bv,I.stubObject=r$,I.stubString=n$,I.stubTrue=i$,I.multiply=v$,I.nth=TT,I.noConflict=zM,I.noop=vv,I.now=ch,I.pad=SM,I.padEnd=bM,I.padStart=_M,I.parseInt=wM,I.random=fM,I.reduce=Mq,I.reduceRight=$q,I.repeat=CM,I.replace=EM,I.result=tM,I.round=S$,I.runInContext=U,I.sample=Fq,I.size=Uq,I.snakeCase=xM,I.some=Bq,I.sortedIndex=LT,I.sortedIndexBy=jT,I.sortedIndexOf=UT,I.sortedLastIndex=BT,I.sortedLastIndexBy=HT,I.sortedLastIndexOf=VT,I.startCase=IM,I.startsWith=OM,I.subtract=b$,I.sum=_$,I.sumBy=w$,I.template=PM,I.times=s$,I.toFinite=Wi,I.toInteger=xe,I.toLength=AC,I.toLower=kM,I.toNumber=un,I.toSafeInteger=kN,I.toString=Qe,I.toUpper=AM,I.trim=TM,I.trimEnd=qM,I.trimStart=NM,I.truncate=MM,I.unescape=$M,I.uniqueId=a$,I.upperCase=DM,I.upperFirst=pv,I.each=yC,I.eachRight=vC,I.first=hC,yv(I,function(){var o={};return rn(I,function(l,d){Ke.call(I.prototype,d)||(o[d]=l)}),o}(),{chain:!1}),I.VERSION=e,Et(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){I[o].placeholder=I}),Et(["drop","take"],function(o,l){Ie.prototype[o]=function(d){d=d===r?1:xt(xe(d),0);var v=this.__filtered__&&!l?new Ie(this):this.clone();return v.__filtered__?v.__takeCount__=St(d,v.__takeCount__):v.__views__.push({size:St(d,he),type:o+(v.__dir__<0?"Right":"")}),v},Ie.prototype[o+"Right"]=function(d){return this.reverse()[o](d).reverse()}}),Et(["filter","map","takeWhile"],function(o,l){var d=l+1,v=d==L||d==Z;Ie.prototype[o]=function(_){var O=this.clone();return O.__iteratees__.push({iteratee:pe(_,3),type:d}),O.__filtered__=O.__filtered__||v,O}}),Et(["head","last"],function(o,l){var d="take"+(l?"Right":"");Ie.prototype[o]=function(){return this[d](1).value()[0]}}),Et(["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(Ir)},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(dh(pe(o)))},Ie.prototype.slice=function(o,l){o=xe(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!==r&&(l=xe(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),_=I[v?"take"+(l=="last"?"Right":""):l],O=v||/^find/.test(l);_&&(I.prototype[l]=function(){var T=this.__wrapped__,M=v?[1]:arguments,B=T instanceof Ie,G=M[0],Q=B||Ee(T),X=function(Fe){var Ue=_.apply(I,Xr([Fe],M));return v&&re?Ue[0]:Ue};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){T=Pe?T:new Ie(this);var ge=o.apply(T,M);return ge.__actions__.push({func:lh,args:[X],thisArg:r}),new wr(ge,re)}return me&&Pe?o.apply(this,M):(ge=this.thru(X),me?v?ge.value()[0]:ge.value():ge)})}),Et(["pop","push","shift","sort","splice","unshift"],function(o){var l=xo[o],d=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",v=/^(?:pop|shift)$/.test(o);I.prototype[o]=function(){var _=arguments;if(v&&!this.__chain__){var O=this.value();return l.apply(Ee(O)?O:[],_)}return this[d](function(T){return l.apply(Ee(T)?T:[],_)})}}),rn(Ie.prototype,function(o,l){var d=I[l];if(d){var v=d.name+"";Ke.call(Ps,v)||(Ps[v]=[]),Ps[v].push({name:l,func:d})}}),Ps[th(r,x).name]=[{name:"wrapper",func:r}],Ie.prototype.clone=hy,Ie.prototype.reverse=py,Ie.prototype.value=my,I.prototype.at=hq,I.prototype.chain=pq,I.prototype.commit=mq,I.prototype.next=gq,I.prototype.plant=vq,I.prototype.reverse=Sq,I.prototype.toJSON=I.prototype.valueOf=I.prototype.value=bq,I.prototype.first=I.prototype.head,Io&&(I.prototype[Io]=yq),I},li=Xg();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($t._=li,define(function(){return li})):si?((si.exports=li)._=li,Mu._=li):$t._=li}).call(Sl)});var oE=F((Nv,bl)=>{(function(r,e){typeof Nv=="object"&&typeof bl<"u"?bl.exports=e():typeof define=="function"&&define.amd?define(e):r.moment=e()})(Nv,function(){"use strict";var r;function e(){return r.apply(null,arguments)}function t(c){r=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 m(c,p){var y=[],b,R=c.length;for(b=0;b<R;++b)y.push(p(c[b],b));return y}function g(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 Es(c,p,y,b,!0).utc()}function E(){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=E()),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 q(c){var p=S(NaN);return c!=null?g(C(p),c):C(p).userInvalidated=!0,p}var j=e.momentProperties=[],Y=!1;function V(c,p){var y,b,R,N=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),N>0)for(y=0;y<N;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 w(c,p){var y=!0;return g(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,c),y){var b=[],R,N,W,se=arguments.length;for(N=0;N<se;N++){if(R="",typeof arguments[N]=="object"){R+=`
|
|
20
|
+
}`;var ke=UE(function(){return Ye(I,ue+"return "+X).apply(t,q)});if(ke.source=X,uv(ke))throw ke;return ke}function kM(o){return Qe(o).toLowerCase()}function AM(o){return Qe(o).toUpperCase()}function TM(o,l,d){if(o=Qe(o),o&&(d||l===t))return Ed(o);if(!o||!(l=Vr(l)))return o;var v=hr(o),_=hr(l),I=st(v,_),q=Cd(v,_)+1;return Ns(v,I,q).join("")}function qM(o,l,d){if(o=Qe(o),o&&(d||l===t))return o.slice(0,Ua(o)+1);if(!o||!(l=Vr(l)))return o;var v=hr(o),_=Cd(v,hr(l))+1;return Ns(v,0,_).join("")}function NM(o,l,d){if(o=Qe(o),o&&(d||l===t))return o.replace(qi,"");if(!o||!(l=Vr(l)))return o;var v=hr(o),_=st(v,hr(l));return Ns(v,_).join("")}function MM(o,l){var d=w,v=P;if(bt(l)){var _="separator"in l?l.separator:_;d="length"in l?xe(l.length):d,v="omission"in l?Vr(l.omission):v}o=Qe(o);var I=o.length;if(en(o)){var q=hr(o);I=q.length}if(d>=I)return o;var M=d-ai(v);if(M<1)return v;var B=q?Ns(q,0,M).join(""):o.slice(0,M);if(_===t)return B+v;if(q&&(M+=B.length-M),cv(_)){if(o.slice(M).search(_)){var G,Q=B;for(_.global||(_=In(_.source,Qe(ni.exec(_))+"g")),_.lastIndex=0;G=_.exec(Q);)var X=G.index;B=B.slice(0,X===t?M:X)}}else if(o.indexOf(Vr(_),M)!=M){var re=B.lastIndexOf(_);re>-1&&(B=B.slice(0,re))}return B+v}function $M(o){return o=Qe(o),o&&Pu.test(o)?o.replace(ys,zg):o}var DM=ol(function(o,l,d){return o+(d?" ":"")+l.toUpperCase()}),hv=Bw("toUpperCase");function jE(o,l,d){return o=Qe(o),l=d?t:l,l===t?Vg(o)?Qg(o):Fg(o):o.match(l)||[]}var UE=qe(function(o,l){try{return Jt(o,t,l)}catch(d){return uv(d)?d:new ve(d)}}),FM=Bi(function(o,l){return Ct(l,function(d){d=pi(d),Tn(o,d,av(o[d],o))}),o});function LM(o){var l=o==null?0:o.length,d=pe();return o=l?tt(o,function(v){if(typeof v[1]!="function")throw new wr(i);return[d(v[0]),v[1]]}):[],qe(function(v){for(var _=-1;++_<l;){var I=o[_];if(Jt(I[0],this,v))return Jt(I[1],this,v)}})}function jM(o){return Gu(pr(o,h))}function pv(o){return function(){return o}}function UM(o,l){return o==null||o!==o?l:o}var BM=Vw(),HM=Vw(!0);function Ir(o){return o}function mv(o){return y(typeof o=="function"?o:pr(o,h))}function VM(o){return se(pr(o,h))}function WM(o,l){return ye(o,pr(l,h))}var YM=qe(function(o,l){return function(d){return sn(d,o,l)}}),JM=qe(function(o,l){return function(d){return sn(o,d,l)}});function gv(o,l,d){var v=Yt(l),_=nn(l,v);d==null&&!(bt(l)&&(_.length||!v.length))&&(d=l,l=o,o=this,_=nn(l,Yt(l)));var I=!(bt(d)&&"chain"in d)||!!d.chain,q=Vi(o);return Ct(_,function(M){var B=l[M];o[M]=B,q&&(o.prototype[M]=function(){var G=this.__chain__;if(I||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 zM(){return $t._===this&&($t._=ty),this}function yv(){}function KM(o){return o=xe(o),qe(function(l){return on(l,o)})}var GM=zy(tt),QM=zy(Fa),ZM=zy(Lu);function BE(o){return tv(o)?ju(pi(o)):IA(o)}function XM(o){return function(l){return o==null?t:ji(o,l)}}var e$=Yw(),t$=Yw(!0);function vv(){return[]}function Sv(){return!1}function r$(){return{}}function n$(){return""}function i$(){return!0}function s$(o,l){if(o=xe(o),o<1||o>fe)return[];var d=he,v=St(o,he);l=pe(l),o-=he;for(var _=Hu(v,l);++d<o;)l(d);return _}function o$(o){return Ce(o)?tt(o,pi):Wr(o)?[o]:xr(lE(Qe(o)))}function a$(o){var l=++Xg;return Qe(o)+l}var l$=th(function(o,l){return o+l},0),u$=Ky("ceil"),c$=th(function(o,l){return o/l},1),f$=Ky("floor");function d$(o){return o&&o.length?il(o,Ir,Xu):t}function h$(o,l){return o&&o.length?il(o,pe(l,2),Xu):t}function p$(o){return Mi(o,Ir)}function m$(o,l){return Mi(o,pe(l,2))}function g$(o){return o&&o.length?il(o,Ir,N):t}function y$(o,l){return o&&o.length?il(o,pe(l,2),N):t}var v$=th(function(o,l){return o*l},1),S$=Ky("round"),b$=th(function(o,l){return o-l},0);function _$(o){return o&&o.length?Bu(o,Ir):0}function w$(o,l){return o&&o.length?Bu(o,pe(l,2)):0}return O.after=Vq,O.ary=SE,O.assign=AN,O.assignIn=qE,O.assignInWith=ph,O.assignWith=TN,O.at=qN,O.before=bE,O.bind=av,O.bindAll=FM,O.bindKey=_E,O.castArray=rN,O.chain=gE,O.chunk=fT,O.compact=dT,O.concat=hT,O.cond=LM,O.conforms=jM,O.constant=pv,O.countBy=_q,O.create=NN,O.curry=wE,O.curryRight=EE,O.debounce=CE,O.defaults=MN,O.defaultsDeep=$N,O.defer=Wq,O.delay=Yq,O.difference=pT,O.differenceBy=mT,O.differenceWith=gT,O.drop=yT,O.dropRight=vT,O.dropRightWhile=ST,O.dropWhile=bT,O.fill=_T,O.filter=Eq,O.flatMap=Rq,O.flatMapDeep=Oq,O.flatMapDepth=Iq,O.flatten=dE,O.flattenDeep=wT,O.flattenDepth=ET,O.flip=Jq,O.flow=BM,O.flowRight=HM,O.fromPairs=CT,O.functions=HN,O.functionsIn=VN,O.groupBy=Pq,O.initial=RT,O.intersection=OT,O.intersectionBy=IT,O.intersectionWith=PT,O.invert=YN,O.invertBy=JN,O.invokeMap=Aq,O.iteratee=mv,O.keyBy=Tq,O.keys=Yt,O.keysIn=Or,O.map=lh,O.mapKeys=KN,O.mapValues=GN,O.matches=VM,O.matchesProperty=WM,O.memoize=ch,O.merge=QN,O.mergeWith=NE,O.method=YM,O.methodOf=JM,O.mixin=gv,O.negate=fh,O.nthArg=KM,O.omit=ZN,O.omitBy=XN,O.once=zq,O.orderBy=qq,O.over=GM,O.overArgs=Kq,O.overEvery=QM,O.overSome=ZM,O.partial=lv,O.partialRight=xE,O.partition=Nq,O.pick=eM,O.pickBy=ME,O.property=BE,O.propertyOf=XM,O.pull=qT,O.pullAll=pE,O.pullAllBy=NT,O.pullAllWith=MT,O.pullAt=$T,O.range=e$,O.rangeRight=t$,O.rearg=Gq,O.reject=Dq,O.remove=DT,O.rest=Qq,O.reverse=sv,O.sampleSize=Lq,O.set=rM,O.setWith=nM,O.shuffle=jq,O.slice=FT,O.sortBy=Hq,O.sortedUniq=WT,O.sortedUniqBy=YT,O.split=RM,O.spread=Zq,O.tail=JT,O.take=zT,O.takeRight=KT,O.takeRightWhile=GT,O.takeWhile=QT,O.tap=dq,O.throttle=Xq,O.thru=ah,O.toArray=kE,O.toPairs=$E,O.toPairsIn=DE,O.toPath=o$,O.toPlainObject=TE,O.transform=iM,O.unary=eN,O.union=ZT,O.unionBy=XT,O.unionWith=eq,O.uniq=tq,O.uniqBy=rq,O.uniqWith=nq,O.unset=sM,O.unzip=ov,O.unzipWith=mE,O.update=oM,O.updateWith=aM,O.values=ul,O.valuesIn=lM,O.without=iq,O.words=jE,O.wrap=tN,O.xor=sq,O.xorBy=oq,O.xorWith=aq,O.zip=lq,O.zipObject=uq,O.zipObjectDeep=cq,O.zipWith=fq,O.entries=$E,O.entriesIn=DE,O.extend=qE,O.extendWith=ph,gv(O,O),O.add=l$,O.attempt=UE,O.camelCase=dM,O.capitalize=FE,O.ceil=u$,O.clamp=uM,O.clone=nN,O.cloneDeep=sN,O.cloneDeepWith=oN,O.cloneWith=iN,O.conformsTo=aN,O.deburr=LE,O.defaultTo=UM,O.divide=c$,O.endsWith=hM,O.eq=Mn,O.escape=pM,O.escapeRegExp=mM,O.every=wq,O.find=Cq,O.findIndex=cE,O.findKey=DN,O.findLast=xq,O.findLastIndex=fE,O.findLastKey=FN,O.floor=f$,O.forEach=yE,O.forEachRight=vE,O.forIn=LN,O.forInRight=jN,O.forOwn=UN,O.forOwnRight=BN,O.get=fv,O.gt=lN,O.gte=uN,O.has=WN,O.hasIn=dv,O.head=hE,O.identity=Ir,O.includes=kq,O.indexOf=xT,O.inRange=cM,O.invoke=zN,O.isArguments=Lo,O.isArray=Ce,O.isArrayBuffer=cN,O.isArrayLike=Rr,O.isArrayLikeObject=Tt,O.isBoolean=fN,O.isBuffer=Ms,O.isDate=dN,O.isElement=hN,O.isEmpty=pN,O.isEqual=mN,O.isEqualWith=gN,O.isError=uv,O.isFinite=yN,O.isFunction=Vi,O.isInteger=RE,O.isLength=dh,O.isMap=OE,O.isMatch=vN,O.isMatchWith=SN,O.isNaN=bN,O.isNative=_N,O.isNil=EN,O.isNull=wN,O.isNumber=IE,O.isObject=bt,O.isObjectLike=Rt,O.isPlainObject=oc,O.isRegExp=cv,O.isSafeInteger=CN,O.isSet=PE,O.isString=hh,O.isSymbol=Wr,O.isTypedArray=ll,O.isUndefined=xN,O.isWeakMap=RN,O.isWeakSet=ON,O.join=kT,O.kebabCase=gM,O.last=ln,O.lastIndexOf=AT,O.lowerCase=yM,O.lowerFirst=vM,O.lt=IN,O.lte=PN,O.max=d$,O.maxBy=h$,O.mean=p$,O.meanBy=m$,O.min=g$,O.minBy=y$,O.stubArray=vv,O.stubFalse=Sv,O.stubObject=r$,O.stubString=n$,O.stubTrue=i$,O.multiply=v$,O.nth=TT,O.noConflict=zM,O.noop=yv,O.now=uh,O.pad=SM,O.padEnd=bM,O.padStart=_M,O.parseInt=wM,O.random=fM,O.reduce=Mq,O.reduceRight=$q,O.repeat=EM,O.replace=CM,O.result=tM,O.round=S$,O.runInContext=U,O.sample=Fq,O.size=Uq,O.snakeCase=xM,O.some=Bq,O.sortedIndex=LT,O.sortedIndexBy=jT,O.sortedIndexOf=UT,O.sortedLastIndex=BT,O.sortedLastIndexBy=HT,O.sortedLastIndexOf=VT,O.startCase=OM,O.startsWith=IM,O.subtract=b$,O.sum=_$,O.sumBy=w$,O.template=PM,O.times=s$,O.toFinite=Wi,O.toInteger=xe,O.toLength=AE,O.toLower=kM,O.toNumber=un,O.toSafeInteger=kN,O.toString=Qe,O.toUpper=AM,O.trim=TM,O.trimEnd=qM,O.trimStart=NM,O.truncate=MM,O.unescape=$M,O.uniqueId=a$,O.upperCase=DM,O.upperFirst=hv,O.each=yE,O.eachRight=vE,O.first=hE,gv(O,function(){var o={};return rn(O,function(l,d){Ke.call(O.prototype,d)||(o[d]=l)}),o}(),{chain:!1}),O.VERSION=e,Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){O[o].placeholder=O}),Ct(["drop","take"],function(o,l){Ie.prototype[o]=function(d){d=d===t?1:xt(xe(d),0);var v=this.__filtered__&&!l?new Ie(this):this.clone();return v.__filtered__?v.__takeCount__=St(d,v.__takeCount__):v.__views__.push({size:St(d,he),type:o+(v.__dir__<0?"Right":"")}),v},Ie.prototype[o+"Right"]=function(d){return this.reverse()[o](d).reverse()}}),Ct(["filter","map","takeWhile"],function(o,l){var d=l+1,v=d==L||d==Z;Ie.prototype[o]=function(_){var I=this.clone();return I.__iteratees__.push({iteratee:pe(_,3),type:d}),I.__filtered__=I.__filtered__||v,I}}),Ct(["head","last"],function(o,l){var d="take"+(l?"Right":"");Ie.prototype[o]=function(){return this[d](1).value()[0]}}),Ct(["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(Ir)},Ie.prototype.find=function(o){return this.filter(o).head()},Ie.prototype.findLast=function(o){return this.reverse().find(o)},Ie.prototype.invokeMap=qe(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(fh(pe(o)))},Ie.prototype.slice=function(o,l){o=xe(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=xe(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),_=O[v?"take"+(l=="last"?"Right":""):l],I=v||/^find/.test(l);_&&(O.prototype[l]=function(){var q=this.__wrapped__,M=v?[1]:arguments,B=q instanceof Ie,G=M[0],Q=B||Ce(q),X=function(Fe){var Ue=_.apply(O,Xr([Fe],M));return v&&re?Ue[0]:Ue};Q&&d&&typeof G=="function"&&G.length!=1&&(B=Q=!1);var re=this.__chain__,ue=!!this.__actions__.length,me=I&&!re,ke=B&&!ue;if(!I&&Q){q=ke?q:new Ie(this);var ge=o.apply(q,M);return ge.__actions__.push({func:ah,args:[X],thisArg:t}),new Er(ge,re)}return me&&ke?o.apply(this,M):(ge=this.thru(X),me?v?ge.value()[0]:ge.value():ge)})}),Ct(["pop","push","shift","sort","splice","unshift"],function(o){var l=xo[o],d=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",v=/^(?:pop|shift)$/.test(o);O.prototype[o]=function(){var _=arguments;if(v&&!this.__chain__){var I=this.value();return l.apply(Ce(I)?I:[],_)}return this[d](function(q){return l.apply(Ce(q)?q:[],_)})}}),rn(Ie.prototype,function(o,l){var d=O[l];if(d){var v=d.name+"";Ke.call(Ps,v)||(Ps[v]=[]),Ps[v].push({name:l,func:d})}}),Ps[eh(t,x).name]=[{name:"wrapper",func:t}],Ie.prototype.clone=dy,Ie.prototype.reverse=hy,Ie.prototype.value=py,O.prototype.at=hq,O.prototype.chain=pq,O.prototype.commit=mq,O.prototype.next=gq,O.prototype.plant=vq,O.prototype.reverse=Sq,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=bq,O.prototype.first=O.prototype.head,Oo&&(O.prototype[Oo]=yq),O},li=Zg();typeof define=="function"&&typeof define.amd=="object"&&define.amd?($t._=li,define(function(){return li})):si?((si.exports=li)._=li,Mu._=li):$t._=li}).call(Sl)});var oC=F((qv,bl)=>{(function(t,e){typeof qv=="object"&&typeof bl<"u"?bl.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(qv,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 Cs(c,p,y,b,!0).utc()}function E(){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=E()),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,N=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),N>0)for(y=0;y<N;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 w(c,p){var y=!0;return m(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,c),y){var b=[],R,N,W,se=arguments.length;for(N=0;N<se;N++){if(R="",typeof arguments[N]=="object"){R+=`
|
|
21
21
|
[`+N+"] ";for(W in arguments[0])s(arguments[0],W)&&(R+=W+": "+arguments[0][W]+", ");R=R.slice(0,-2)}else R=arguments[N];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 $(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=g({},c),b;for(b in p)s(p,b)&&(i(c[b])&&i(p[b])?(y[b]={},g(y[b],c[b]),g(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]=g({},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 wt(c,p,y){var b=this._calendar[c]||this._calendar.sameElse;return D(b)?b.call(p,y):b}function Ce(c,p,y){var b=""+Math.abs(c),R=p-b.length,N=c>=0;return(N?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,Xe=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ct={},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 Ce(R.apply(this,arguments),p[1],p[2])}),y&&(Mt[y]=function(){return this.localeData().ordinal(R.apply(this,arguments),c)})}function Xn(c){return c.match(/\[[\s\S]/)?c.replace(/^\[|\]$/g,""):c.replace(/\\/g,"")}function Ou(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]=Xn(p[y]);return function(R){var N="",W;for(W=0;W<b;W++)N+=D(p[W])?p[W].call(R,c):p[W];return N}}function ft(c,p){return c.isValid()?(p=wn(p,c.localeData()),Ct[p]=Ct[p]||Ou(p),Ct[p](c)):c.localeData().invalidDate()}function wn(c,p){var y=5;function b(R){return p.longDateFormat(R)||R}for(Xe.lastIndex=0;y>=0&&Xe.test(c);)c=c.replace(Xe,b),Xe.lastIndex=0,y-=1;return c}var us={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 dt="Invalid date";function ei(){return this._invalidDate}var tr="%d",Qr=/\d{1,2}/;function sg(c){return this._ordinal.replace("%d",c)}var Cn={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 Wf(c,p,y,b){var R=this._relativeTime[y];return D(R)?R(c,p,y,b):R.replace(/%d/i,c)}function og(c,p){var y=this._relativeTime[c>0?"future":"past"];return D(y)?y(p):y.replace(/%s/i,p)}var cs={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 yt(c){return typeof c=="string"?cs[c]||cs[c.toLowerCase()]:void 0}function Ai(c){var p={},y,b;for(b in c)s(c,b)&&(y=yt(b),y&&(p[y]=c[b]));return p}var Ia={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 ag(c){var p=[],y;for(y in c)s(c,y)&&p.push({unit:y,priority:Ia[y]});return p.sort(function(b,R){return b.priority-R.priority}),p}var fs=/\d/,fr=/\d\d/,ds=/\d{3}/,ti=/\d{4}/,hs=/[+-]?\d{6}/,et=/\d\d?/,Oa=/\d\d\d\d?/,Pa=/\d\d\d\d\d\d?/,ps=/\d{1,3}/,So=/\d{1,4}/,ms=/[+-]?\d{1,6}/,ri=/\d+/,gs=/[+-]?\d+/,lg=/Z|[+-]\d\d:?\d\d/gi,ka=/Z|[+-]\d\d(?::?\d\d)?/gi,ug=/[+-]?\d+(\.\d{1,3})?/,ys=/[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,Ti=/^[1-9]\d?/,Pu=/^([1-9]\d|\d)/,Aa;Aa={};function oe(c,p,y){Aa[c]=D(p)?p:function(b,R){return b&&y?y:p}}function cg(c,p){return s(Aa,c)?Aa[c](p._strict,p._locale):new RegExp(Yf(c))}function Yf(c){return En(c.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(p,y,b,R,N){return y||b||R||N}))}function En(c){return c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function br(c){return c<0?Math.ceil(c)||0:Math.floor(c)}function Me(c){var p=+c,y=0;return p!==0&&isFinite(p)&&(y=br(p)),y}var bo={};function Ge(c,p){var y,b=p,R;for(typeof c=="string"&&(c=[c]),f(p)&&(b=function(N,W){W[p]=Me(N)}),R=c.length,y=0;y<R;y++)bo[c[y]]=b}function qi(c,p){Ge(c,function(y,b,R,N){R._w=R._w||{},p(y,R._w,R,N)})}function fg(c,p,y){p!=null&&s(bo,c)&&bo[c](p,y._a,y,c)}function Ta(c){return c%4===0&&c%100!==0||c%400===0}var Vt=0,xn=1,Zr=2,kt=3,jr=4,Rn=5,ni=6,dg=7,hg=8;le("Y",0,0,function(){var c=this.year();return c<=9999?Ce(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",gs),oe("YY",et,fr),oe("YYYY",So,ti),oe("YYYYY",ms,hs),oe("YYYYYY",ms,hs),Ge(["YYYYY","YYYYYY"],Vt),Ge("YYYY",function(c,p){p[Vt]=c.length===2?e.parseTwoDigitYear(c):Me(c)}),Ge("YY",function(c,p){p[Vt]=e.parseTwoDigitYear(c)}),Ge("Y",function(c,p){p[Vt]=parseInt(c,10)});function _o(c){return Ta(c)?366:365}e.parseTwoDigitYear=function(c){return Me(c)+(Me(c)>68?1900:2e3)};var Jf=vs("FullYear",!0);function pg(){return Ta(this.year())}function vs(c,p){return function(y){return y!=null?(zf(this,c,y),e.updateOffset(this,p),this):ii(this,c)}}function ii(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 zf(c,p,y){var b,R,N,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}N=y,W=c.month(),se=c.date(),se=se===29&&W===1&&!Ta(N)?28:se,R?b.setUTCFullYear(N,W,se):b.setFullYear(N,W,se)}}function qa(c){return c=yt(c),D(this[c])?this[c]():this}function mg(c,p){if(typeof c=="object"){c=Ai(c);var y=ag(c),b,R=y.length;for(b=0;b<R;b++)this[y[b].unit](c[y[b].unit])}else if(c=yt(c),D(this[c]))return this[c](p);return this}function gg(c,p){return(c%p+p)%p}var vt;Array.prototype.indexOf?vt=Array.prototype.indexOf:vt=function(c){var p;for(p=0;p<this.length;++p)if(this[p]===c)return p;return-1};function Na(c,p){if(isNaN(c)||isNaN(p))return NaN;var y=gg(p,12);return c+=(p-y)/12,y===1?Ta(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",et,Ti),oe("MM",et,fr),oe("MMM",function(c,p){return p.monthsShortRegex(c)}),oe("MMMM",function(c,p){return p.monthsRegex(c)}),Ge(["M","MM"],function(c,p){p[xn]=Me(c)-1}),Ge(["MMM","MMMM"],function(c,p,y,b){var R=y._locale.monthsParse(c,b,y._strict);R!=null?p[xn]=R:C(y).invalidMonth=c});var Kf="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ku="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Gf=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,yg=ys,vg=ys;function Sg(c,p){return c?n(this._months)?this._months[c.month()]:this._months[(this._months.isFormat||Gf).test(p)?"format":"standalone"][c.month()]:n(this._months)?this._months:this._months.standalone}function Qf(c,p){return c?n(this._monthsShort)?this._monthsShort[c.month()]:this._monthsShort[Gf.test(p)?"format":"standalone"][c.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Zf(c,p,y){var b,R,N,W=c.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],b=0;b<12;++b)N=S([2e3,b]),this._shortMonthsParse[b]=this.monthsShort(N,"").toLocaleLowerCase(),this._longMonthsParse[b]=this.months(N,"").toLocaleLowerCase();return y?p==="MMM"?(R=vt.call(this._shortMonthsParse,W),R!==-1?R:null):(R=vt.call(this._longMonthsParse,W),R!==-1?R:null):p==="MMM"?(R=vt.call(this._shortMonthsParse,W),R!==-1?R:(R=vt.call(this._longMonthsParse,W),R!==-1?R:null)):(R=vt.call(this._longMonthsParse,W),R!==-1?R:(R=vt.call(this._shortMonthsParse,W),R!==-1?R:null))}function Xf(c,p,y){var b,R,N;if(this._monthsParseExact)return Zf.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]&&(N="^"+this.months(R,"")+"|^"+this.monthsShort(R,""),this._monthsParse[b]=new RegExp(N.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 Ma(c,p){if(!c.isValid())return c;if(typeof p=="string"){if(/^\d+$/.test(p))p=Me(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,Na(c.year(),y)),c._isUTC?c._d.setUTCMonth(y,b):c._d.setMonth(y,b),c}function ed(c){return c!=null?(Ma(this,c),e.updateOffset(this,!0),this):ii(this,"Month")}function td(){return Na(this.year(),this.month())}function $a(c){return this._monthsParseExact?(s(this,"_monthsRegex")||nd.call(this),c?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=yg),this._monthsShortStrictRegex&&c?this._monthsShortStrictRegex:this._monthsShortRegex)}function rd(c){return this._monthsParseExact?(s(this,"_monthsRegex")||nd.call(this),c?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=vg),this._monthsStrictRegex&&c?this._monthsStrictRegex:this._monthsRegex)}function nd(){function c(ye,Oe){return Oe.length-ye.length}var p=[],y=[],b=[],R,N,W,se;for(R=0;R<12;R++)N=S([2e3,R]),W=En(this.monthsShort(N,"")),se=En(this.months(N,"")),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 id(c,p,y,b,R,N,W){var se;return c<100&&c>=0?(se=new Date(c+400,p,y,b,R,N,W),isFinite(se.getFullYear())&&se.setFullYear(c)):se=new Date(c,p,y,b,R,N,W),se}function Ss(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 bs(c,p,y){var b=7+p-y,R=(7+Ss(c,0,b).getUTCDay()-p)%7;return-R+b-1}function sd(c,p,y,b,R){var N=(7+y-b)%7,W=bs(c,b,R),se=1+7*(p-1)+N+W,ye,Oe;return se<=0?(ye=c-1,Oe=_o(ye)+se):se>_o(c)?(ye=c+1,Oe=se-_o(c)):(ye=c,Oe=se),{year:ye,dayOfYear:Oe}}function _s(c,p,y){var b=bs(c.year(),p,y),R=Math.floor((c.dayOfYear()-b-1)/7)+1,N,W;return R<1?(W=c.year()-1,N=R+Ur(W,p,y)):R>Ur(c.year(),p,y)?(N=R-Ur(c.year(),p,y),W=c.year()+1):(W=c.year(),N=R),{week:N,year:W}}function Ur(c,p,y){var b=bs(c,p,y),R=bs(c+1,p,y);return(_o(c)-b+R)/7}le("w",["ww",2],"wo","week"),le("W",["WW",2],"Wo","isoWeek"),oe("w",et,Ti),oe("ww",et,fr),oe("W",et,Ti),oe("WW",et,fr),qi(["w","ww","W","WW"],function(c,p,y,b){p[b.substr(0,1)]=Me(c)});function Au(c){return _s(c,this._week.dow,this._week.doy).week}var ws={dow:0,doy:6};function od(){return this._week.dow}function ad(){return this._week.doy}function bg(c){var p=this.localeData().week(this);return c==null?p:this.add((c-p)*7,"d")}function ld(c){var p=_s(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",et),oe("e",et),oe("E",et),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)}),qi(["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}),qi(["d","e","E"],function(c,p,y,b){p[b]=Me(c)});function ud(c,p){return typeof c!="string"?c:isNaN(c)?(c=p.weekdaysParse(c),typeof c=="number"?c:null):parseInt(c,10)}function cd(c,p){return typeof c=="string"?p.weekdaysParse(c)%7||7:isNaN(c)?null:c}function Da(c,p){return c.slice(p,7).concat(c.slice(0,p))}var _g="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),fd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),wg="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),dd=ys,Cg=ys,Eg=ys;function xg(c,p){var y=n(this._weekdays)?this._weekdays:this._weekdays[c&&c!==!0&&this._weekdays.isFormat.test(p)?"format":"standalone"];return c===!0?Da(y,this._week.dow):c?y[c.day()]:y}function Rg(c){return c===!0?Da(this._weekdaysShort,this._week.dow):c?this._weekdaysShort[c.day()]:this._weekdaysShort}function Tu(c){return c===!0?Da(this._weekdaysMin,this._week.dow):c?this._weekdaysMin[c.day()]:this._weekdaysMin}function Ig(c,p,y){var b,R,N,W=c.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],b=0;b<7;++b)N=S([2e3,1]).day(b),this._minWeekdaysParse[b]=this.weekdaysMin(N,"").toLocaleLowerCase(),this._shortWeekdaysParse[b]=this.weekdaysShort(N,"").toLocaleLowerCase(),this._weekdaysParse[b]=this.weekdays(N,"").toLocaleLowerCase();return y?p==="dddd"?(R=vt.call(this._weekdaysParse,W),R!==-1?R:null):p==="ddd"?(R=vt.call(this._shortWeekdaysParse,W),R!==-1?R:null):(R=vt.call(this._minWeekdaysParse,W),R!==-1?R:null):p==="dddd"?(R=vt.call(this._weekdaysParse,W),R!==-1||(R=vt.call(this._shortWeekdaysParse,W),R!==-1)?R:(R=vt.call(this._minWeekdaysParse,W),R!==-1?R:null)):p==="ddd"?(R=vt.call(this._shortWeekdaysParse,W),R!==-1||(R=vt.call(this._weekdaysParse,W),R!==-1)?R:(R=vt.call(this._minWeekdaysParse,W),R!==-1?R:null)):(R=vt.call(this._minWeekdaysParse,W),R!==-1||(R=vt.call(this._weekdaysParse,W),R!==-1)?R:(R=vt.call(this._shortWeekdaysParse,W),R!==-1?R:null))}function Og(c,p,y){var b,R,N;if(this._weekdaysParseExact)return Ig.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]||(N="^"+this.weekdays(R,"")+"|^"+this.weekdaysShort(R,"")+"|^"+this.weekdaysMin(R,""),this._weekdaysParse[b]=new RegExp(N.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 Pg(c){if(!this.isValid())return c!=null?this:NaN;var p=ii(this,"Day");return c!=null?(c=ud(c,this.localeData()),this.add(c-p,"d")):p}function kg(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 Ag(c){if(!this.isValid())return c!=null?this:NaN;if(c!=null){var p=cd(c,this.localeData());return this.day(this.day()%7?p:p-7)}else return this.day()||7}function lt(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||qu.call(this),c?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=dd),this._weekdaysStrictRegex&&c?this._weekdaysStrictRegex:this._weekdaysRegex)}function it(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||qu.call(this),c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Cg),this._weekdaysShortStrictRegex&&c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Tg(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||qu.call(this),c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Eg),this._weekdaysMinStrictRegex&&c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function qu(){function c(Kt,on){return on.length-Kt.length}var p=[],y=[],b=[],R=[],N,W,se,ye,Oe;for(N=0;N<7;N++)W=S([2e3,1]).day(N),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 Nu(){return this.hours()%12||12}function qg(){return this.hours()||24}le("H",["HH",2],0,"hour"),le("h",["hh",2],0,Nu),le("k",["kk",2],0,qg),le("hmm",0,0,function(){return""+Nu.apply(this)+Ce(this.minutes(),2)}),le("hmmss",0,0,function(){return""+Nu.apply(this)+Ce(this.minutes(),2)+Ce(this.seconds(),2)}),le("Hmm",0,0,function(){return""+this.hours()+Ce(this.minutes(),2)}),le("Hmmss",0,0,function(){return""+this.hours()+Ce(this.minutes(),2)+Ce(this.seconds(),2)});function hd(c,p){le(c,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),p)})}hd("a",!0),hd("A",!1);function pd(c,p){return p._meridiemParse}oe("a",pd),oe("A",pd),oe("H",et,Pu),oe("h",et,Ti),oe("k",et,Ti),oe("HH",et,fr),oe("hh",et,fr),oe("kk",et,fr),oe("hmm",Oa),oe("hmmss",Pa),oe("Hmm",Oa),oe("Hmmss",Pa),Ge(["H","HH"],kt),Ge(["k","kk"],function(c,p,y){var b=Me(c);p[kt]=b===24?0:b}),Ge(["a","A"],function(c,p,y){y._isPm=y._locale.isPM(c),y._meridiem=c}),Ge(["h","hh"],function(c,p,y){p[kt]=Me(c),C(y).bigHour=!0}),Ge("hmm",function(c,p,y){var b=c.length-2;p[kt]=Me(c.substr(0,b)),p[jr]=Me(c.substr(b)),C(y).bigHour=!0}),Ge("hmmss",function(c,p,y){var b=c.length-4,R=c.length-2;p[kt]=Me(c.substr(0,b)),p[jr]=Me(c.substr(b,2)),p[Rn]=Me(c.substr(R)),C(y).bigHour=!0}),Ge("Hmm",function(c,p,y){var b=c.length-2;p[kt]=Me(c.substr(0,b)),p[jr]=Me(c.substr(b))}),Ge("Hmmss",function(c,p,y){var b=c.length-4,R=c.length-2;p[kt]=Me(c.substr(0,b)),p[jr]=Me(c.substr(b,2)),p[Rn]=Me(c.substr(R))});function md(c){return(c+"").toLowerCase().charAt(0)==="p"}var Ng=/[ap]\.?m?\.?/i,$t=vs("Hours",!0);function Mu(c,p,y){return c>11?y?"pm":"PM":y?"am":"AM"}var si={calendar:fe,longDateFormat:us,invalidDate:dt,ordinal:tr,dayOfMonthOrdinalParse:Qr,relativeTime:Cn,months:Kf,monthsShort:ku,week:ws,weekdays:_g,weekdaysMin:wg,weekdaysShort:fd,meridiemParse:Ng},ut={},Ni={},Wt;function gd(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 $u(c){return c&&c.toLowerCase().replace("_","-")}function yd(c){for(var p=0,y,b,R,N;p<c.length;){for(N=$u(c[p]).split("-"),y=N.length,b=$u(c[p+1]),b=b?b.split("-"):null;y>0;){if(R=wo(N.slice(0,y).join("-")),R)return R;if(b&&b.length>=y&&gd(N,b)>=y-1)break;y--}p++}return Wt}function vd(c){return!!(c&&c.match("^[^/\\\\]*$"))}function wo(c){var p=null,y;if(ut[c]===void 0&&typeof bl<"u"&&bl&&bl.exports&&vd(c))try{p=Wt._abbr,y=require,y("./locale/"+c),In(p)}catch{ut[c]=null}return ut[c]}function In(c,p){var y;return c&&(u(p)?y=Et(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=si;if(p.abbr=c,ut[c]!=null)$("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=ut[c]._config;else if(p.parentLocale!=null)if(ut[p.parentLocale]!=null)b=ut[p.parentLocale]._config;else if(y=wo(p.parentLocale),y!=null)b=y._config;else return Ni[p.parentLocale]||(Ni[p.parentLocale]=[]),Ni[p.parentLocale].push({name:c,config:p}),null;return ut[c]=new Z(z(b,p)),Ni[c]&&Ni[c].forEach(function(R){Jt(R.name,R.config)}),In(c),ut[c]}else return delete ut[c],null}function Mg(c,p){if(p!=null){var y,b,R=si;ut[c]!=null&&ut[c].parentLocale!=null?ut[c].set(z(ut[c]._config,p)):(b=wo(c),b!=null&&(R=b._config),p=z(R,p),b==null&&(p.abbr=c),y=new Z(p),y.parentLocale=ut[c],ut[c]=y),In(c)}else ut[c]!=null&&(ut[c].parentLocale!=null?(ut[c]=ut[c].parentLocale,c===In()&&In(c)):ut[c]!=null&&delete ut[c]);return ut[c]}function Et(c){var p;if(c&&c._locale&&c._locale._abbr&&(c=c._locale._abbr),!c)return Wt;if(!n(c)){if(p=wo(c),p)return p;c=[c]}return yd(c)}function $g(){return ie(ut)}function Fa(c){var p,y=c._a;return y&&C(c).overflow===-2&&(p=y[xn]<0||y[xn]>11?xn:y[Zr]<1||y[Zr]>Na(y[Vt],y[xn])?Zr:y[kt]<0||y[kt]>24||y[kt]===24&&(y[jr]!==0||y[Rn]!==0||y[ni]!==0)?kt:y[jr]<0||y[jr]>59?jr:y[Rn]<0||y[Rn]>59?Rn:y[ni]<0||y[ni]>999?ni:-1,C(c)._overflowDayOfYear&&(p<Vt||p>Zr)&&(p=Zr),C(c)._overflowWeeks&&p===-1&&(p=dg),C(c)._overflowWeekday&&p===-1&&(p=hg),C(c).overflow=p),c}var oi=/^\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)?)?$/,La=/^\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)?)?$/,Du=/Z|[+-]\d\d(?::?\d\d)?/,tt=[["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/]],Fu=/^\/?Date\((-?\d+)/i,Dg=/^(?:(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}))$/,Lu={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 Sd(c){var p,y,b=c._i,R=oi.exec(b)||La.exec(b),N,W,se,ye,Oe=tt.length,Kt=Xr.length;if(R){for(C(c).iso=!0,p=0,y=Oe;p<y;p++)if(tt[p][1].exec(R[1])){W=tt[p][0],N=tt[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(!N&&se!=null){c._isValid=!1;return}if(R[4])if(Du.exec(R[4]))ye="Z";else{c._isValid=!1;return}c._f=W+(se||"")+(ye||""),Uu(c)}else c._isValid=!1}function Fg(c,p,y,b,R,N){var W=[Lg(c),ku.indexOf(p),parseInt(y,10),parseInt(b,10),parseInt(R,10)];return N&&W.push(parseInt(N,10)),W}function Lg(c){var p=parseInt(c,10);return p<=49?2e3+p:p<=999?1900+p:p}function bd(c){return c.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function ja(c,p,y){if(c){var b=fd.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 Cs(c,p,y){if(c)return Lu[c];if(p)return 0;var b=parseInt(y,10),R=b%100,N=(b-R)/100;return N*60+R}function _d(c){var p=Dg.exec(bd(c._i)),y;if(p){if(y=Fg(p[4],p[3],p[2],p[5],p[6],p[7]),!ja(p[1],y,c))return;c._a=y,c._tzm=Cs(p[8],p[9],p[10]),c._d=Ss.apply(null,c._a),c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),C(c).rfc2822=!0}else c._isValid=!1}function wd(c){var p=Fu.exec(c._i);if(p!==null){c._d=new Date(+p[1]);return}if(Sd(c),c._isValid===!1)delete c._isValid;else return;if(_d(c),c._isValid===!1)delete c._isValid;else return;c._strict?c._isValid=!1:e.createFromInputFallback(c)}e.createFromInputFallback=w("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 Mi(c,p,y){return c??p??y}function ju(c){var p=new Date(e.now());return c._useUTC?[p.getUTCFullYear(),p.getUTCMonth(),p.getUTCDate()]:[p.getFullYear(),p.getMonth(),p.getDate()]}function Co(c){var p,y,b=[],R,N,W;if(!c._d){for(R=ju(c),c._w&&c._a[Zr]==null&&c._a[xn]==null&&Cd(c),c._dayOfYear!=null&&(W=Mi(c._a[Vt],R[Vt]),(c._dayOfYear>_o(W)||c._dayOfYear===0)&&(C(c)._overflowDayOfYear=!0),y=Ss(W,0,c._dayOfYear),c._a[xn]=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[kt]===24&&c._a[jr]===0&&c._a[Rn]===0&&c._a[ni]===0&&(c._nextDay=!0,c._a[kt]=0),c._d=(c._useUTC?Ss:id).apply(null,b),N=c._useUTC?c._d.getUTCDay():c._d.getDay(),c._tzm!=null&&c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),c._nextDay&&(c._a[kt]=24),c._w&&typeof c._w.d<"u"&&c._w.d!==N&&(C(c).weekdayMismatch=!0)}}function Cd(c){var p,y,b,R,N,W,se,ye,Oe;p=c._w,p.GG!=null||p.W!=null||p.E!=null?(N=1,W=4,y=Mi(p.GG,c._a[Vt],_s(st(),1,4).year),b=Mi(p.W,1),R=Mi(p.E,1),(R<1||R>7)&&(ye=!0)):(N=c._locale._week.dow,W=c._locale._week.doy,Oe=_s(st(),N,W),y=Mi(p.gg,c._a[Vt],Oe.year),b=Mi(p.w,Oe.week),p.d!=null?(R=p.d,(R<0||R>6)&&(ye=!0)):p.e!=null?(R=p.e+N,(p.e<0||p.e>6)&&(ye=!0)):R=N),b<1||b>Ur(y,N,W)?C(c)._overflowWeeks=!0:ye!=null?C(c)._overflowWeekday=!0:(se=sd(y,b,R,N,W),c._a[Vt]=se.year,c._dayOfYear=se.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Uu(c){if(c._f===e.ISO_8601){Sd(c);return}if(c._f===e.RFC_2822){_d(c);return}c._a=[],C(c).empty=!0;var p=""+c._i,y,b,R,N,W,se=p.length,ye=0,Oe,Kt;for(R=wn(c._f,c._locale).match(he)||[],Kt=R.length,y=0;y<Kt;y++)N=R[y],b=(p.match(cg(N,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[N]?(b?C(c).empty=!1:C(c).unusedTokens.push(N),fg(N,b,c)):c._strict&&!b&&C(c).unusedTokens.push(N);C(c).charsLeftOver=se-ye,p.length>0&&C(c).unusedInput.push(p),c._a[kt]<=12&&C(c).bigHour===!0&&c._a[kt]>0&&(C(c).bigHour=void 0),C(c).parsedDateParts=c._a.slice(0),C(c).meridiem=c._meridiem,c._a[kt]=Bu(c._locale,c._a[kt],c._meridiem),Oe=C(c).era,Oe!==null&&(c._a[Vt]=c._locale.erasConvertYear(Oe,c._a[Vt])),Co(c),Fa(c)}function Bu(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 Hu(c){var p,y,b,R,N,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++)N=0,W=!1,p=V({},c),c._useUTC!=null&&(p._useUTC=c._useUTC),p._f=c._f[R],Uu(p),A(p)&&(W=!0),N+=C(p).charsLeftOver,N+=C(p).unusedTokens.length*10,C(p).score=N,se?N<b&&(b=N,y=p):(b==null||N<b||W)&&(b=N,y=p,W&&(se=!0));g(c,y||p)}function jg(c){if(!c._d){var p=Ai(c._i),y=p.day===void 0?p.date:p.day;c._a=m([p.year,p.month,y,p.hour,p.minute,p.second,p.millisecond],function(b){return b&&parseInt(b,10)}),Co(c)}}function Ed(c){var p=new K(Fa(rr(c)));return p._nextDay&&(p.add(1,"d"),p._nextDay=void 0),p}function rr(c){var p=c._i,y=c._f;return c._locale=c._locale||Et(c._l),p===null||y===void 0&&p===""?q({nullInput:!0}):(typeof p=="string"&&(c._i=p=c._locale.preparse(p)),ee(p)?new K(Fa(p)):(h(p)?c._d=p:n(y)?Hu(c):y?Uu(c):Vu(c),A(c)||(c._d=null),c))}function Vu(c){var p=c._i;u(p)?c._d=new Date(e.now()):h(p)?c._d=new Date(p.valueOf()):typeof p=="string"?wd(c):n(p)?(c._a=m(p.slice(0),function(y){return parseInt(y,10)}),Co(c)):i(p)?jg(c):f(p)?c._d=new Date(p):e.createFromInputFallback(c)}function Es(c,p,y,b,R){var N={};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),N._isAMomentObject=!0,N._useUTC=N._isUTC=R,N._l=y,N._i=c,N._f=p,N._strict=b,Ed(N)}function st(c,p,y,b){return Es(c,p,y,b,!1)}var xd=w("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=st.apply(null,arguments);return this.isValid()&&c.isValid()?c<this?this:c:q()}),Ug=w("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=st.apply(null,arguments);return this.isValid()&&c.isValid()?c>this?this:c:q()});function Rd(c,p){var y,b;if(p.length===1&&n(p[0])&&(p=p[0]),!p.length)return st();for(y=p[0],b=1;b<p.length;++b)(!p[b].isValid()||p[b][c](y))&&(y=p[b]);return y}function Bg(){var c=[].slice.call(arguments,0);return Rd("isBefore",c)}function Hg(){var c=[].slice.call(arguments,0);return Rd("isAfter",c)}var Vg=function(){return Date.now?Date.now():+new Date},en=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Wg(c){var p,y=!1,b,R=en.length;for(p in c)if(s(c,p)&&!(vt.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]])!==Me(c[en[b]])&&(y=!0)}return!0}function Yg(){return this._isValid}function Wu(){return Ae(NaN)}function Eo(c){var p=Ai(c),y=p.year||0,b=p.quarter||0,R=p.month||0,N=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=Wg(p),this._milliseconds=+Kt+Oe*1e3+ye*6e4+se*1e3*60*60,this._days=+W+N*7,this._months=+R+b*3+y*12,this._data={},this._locale=Et(),this._bubble()}function Br(c){return c instanceof Eo}function xs(c){return c<0?Math.round(-1*c)*-1:Math.round(c)}function Jg(c,p,y){var b=Math.min(c.length,p.length),R=Math.abs(c.length-p.length),N=0,W;for(W=0;W<b;W++)(y&&c[W]!==p[W]||!y&&Me(c[W])!==Me(p[W]))&&N++;return N+R}function Id(c,p){le(c,0,0,function(){var y=this.utcOffset(),b="+";return y<0&&(y=-y,b="-"),b+Ce(~~(y/60),2)+p+Ce(~~y%60,2)})}Id("Z",":"),Id("ZZ",""),oe("Z",ka),oe("ZZ",ka),Ge(["Z","ZZ"],function(c,p,y){y._useUTC=!0,y._tzm=ai(ka,c)});var zg=/([\+\-]|\d\d)/gi;function ai(c,p){var y=(p||"").match(c),b,R,N;return y===null?null:(b=y[y.length-1]||[],R=(b+"").match(zg)||["-",0,0],N=+(R[1]*60)+Me(R[2]),N===0?0:R[0]==="+"?N:-N)}function dr(c,p){var y,b;return p._isUTC?(y=p.clone(),b=(ee(c)||h(c)?c.valueOf():st(c).valueOf())-y.valueOf(),y._d.setTime(y._d.valueOf()+b),e.updateOffset(y,!1),y):st(c).local()}function Ua(c){return-Math.round(c._d.getTimezoneOffset())}e.updateOffset=function(){};function Kg(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=ai(ka,c),c===null)return this}else Math.abs(c)<16&&!y&&(c=c*60);return!this._isUTC&&p&&(R=Ua(this)),this._offset=c,this._isUTC=!0,R!=null&&this.add(R,"m"),b!==c&&(!p||this._changeInProgress?Pd(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:Ua(this)}function Gg(c,p){return c!=null?(typeof c!="string"&&(c=-c),this.utcOffset(c,p),this):-this.utcOffset()}function Qg(c){return this.utcOffset(0,c)}function Zg(c){return this._isUTC&&(this.utcOffset(0,c),this._isUTC=!1,c&&this.subtract(Ua(this),"m")),this}function Xg(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var c=ai(lg,this._i);c!=null?this.utcOffset(c):this.utcOffset(0,!0)}return this}function li(c){return this.isValid()?(c=c?st(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=rr(c),c._a?(p=c._isUTC?S(c._a):st(c._a),this._isDSTShifted=this.isValid()&&Jg(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 Ye=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,At=/^(-|\+)?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,N,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=Ye.exec(c))?(R=b[1]==="-"?-1:1,y={y:0,d:Me(b[Zr])*R,h:Me(b[kt])*R,m:Me(b[jr])*R,s:Me(b[Rn])*R,ms:Me(xs(b[ni]*1e3))*R}):(b=At.exec(c))?(R=b[1]==="-"?-1:1,y={y:On(b[2],R),M:On(b[3],R),w:On(b[4],R),d:On(b[5],R),h:On(b[6],R),m:On(b[7],R),s:On(b[8],R)}):y==null?y={}:typeof y=="object"&&("from"in y||"to"in y)&&(W=_r(st(y.from),st(y.to)),y={},y.ms=W.milliseconds,y.M=W.months),N=new Eo(y),Br(c)&&s(c,"_locale")&&(N._locale=c._locale),Br(c)&&s(c,"_isValid")&&(N._isValid=c._isValid),N}Ae.fn=Eo.prototype,Ae.invalid=Wu;function On(c,p){var y=c&&parseFloat(c.replace(",","."));return(isNaN(y)?0:y)*p}function Od(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 _r(c,p){var y;return c.isValid()&&p.isValid()?(p=dr(p,c),c.isBefore(p)?y=Od(c,p):(y=Od(p,c),y.milliseconds=-y.milliseconds,y.months=-y.months),y):{milliseconds:0,months:0}}function xo(c,p){return function(y,b){var R,N;return b!==null&&!isNaN(+b)&&($(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."),N=y,y=b,b=N),R=Ae(y,b),Pd(this,R,c),this}}function Pd(c,p,y,b){var R=p._milliseconds,N=xs(p._days),W=xs(p._months);c.isValid()&&(b=b??!0,W&&Ma(c,ii(c,"Month")+W*y),N&&zf(c,"Date",ii(c,"Date")+N*y),R&&c._d.setTime(c._d.valueOf()+R*y),b&&e.updateOffset(c,N||W))}var Rs=xo(1,"add"),Ba=xo(-1,"subtract");function Ro(c){return typeof c=="string"||c instanceof String}function Ke(c){return ee(c)||h(c)||Ro(c)||f(c)||kd(c)||ey(c)||c===null||c===void 0}function ey(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,N,W=b.length;for(R=0;R<W;R+=1)N=b[R],y=y||s(c,N);return p&&y}function kd(c){var p=n(c),y=!1;return p&&(y=c.filter(function(b){return!f(b)&&Ro(c)}).length===0),p&&y}function Ha(c){var p=i(c)&&!a(c),y=!1,b=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],R,N;for(R=0;R<b.length;R+=1)N=b[R],y=y||s(c,N);return p&&y}function ty(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 ry(c,p){arguments.length===1&&(arguments[0]?Ke(arguments[0])?(c=arguments[0],p=void 0):Ha(arguments[0])&&(p=arguments[0],c=void 0):(c=void 0,p=void 0));var y=c||st(),b=dr(y,this).startOf("day"),R=e.calendarFormat(this,b)||"sameElse",N=p&&(D(p[R])?p[R].call(this,y):p[R]);return this.format(N||this.localeData().calendar(R,this,st(y)))}function ny(){return new K(this)}function Va(c,p){var y=ee(c)?c:st(c);return this.isValid()&&y.isValid()?(p=yt(p)||"millisecond",p==="millisecond"?this.valueOf()>y.valueOf():y.valueOf()<this.clone().startOf(p).valueOf()):!1}function ui(c,p){var y=ee(c)?c:st(c);return this.isValid()&&y.isValid()?(p=yt(p)||"millisecond",p==="millisecond"?this.valueOf()<y.valueOf():this.clone().endOf(p).valueOf()<y.valueOf()):!1}function Wa(c,p,y,b){var R=ee(c)?c:st(c),N=ee(p)?p:st(p);return this.isValid()&&R.isValid()&&N.isValid()?(b=b||"()",(b[0]==="("?this.isAfter(R,y):!this.isBefore(R,y))&&(b[1]===")"?this.isBefore(N,y):!this.isAfter(N,y))):!1}function Ad(c,p){var y=ee(c)?c:st(c),b;return this.isValid()&&y.isValid()?(p=yt(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 Ya(c,p){return this.isSame(c,p)||this.isAfter(c,p)}function Td(c,p){return this.isSame(c,p)||this.isBefore(c,p)}function qd(c,p,y){var b,R,N;if(!this.isValid())return NaN;if(b=dr(c,this),!b.isValid())return NaN;switch(R=(b.utcOffset()-this.utcOffset())*6e4,p=yt(p),p){case"year":N=$i(this,b)/12;break;case"month":N=$i(this,b);break;case"quarter":N=$i(this,b)/3;break;case"second":N=(this-b)/1e3;break;case"minute":N=(this-b)/6e4;break;case"hour":N=(this-b)/36e5;break;case"day":N=(this-b-R)/864e5;break;case"week":N=(this-b-R)/6048e5;break;default:N=this-b}return y?N:br(N)}function $i(c,p){if(c.date()<p.date())return-$i(p,c);var y=(p.year()-c.year())*12+(p.month()-c.month()),b=c.clone().add(y,"months"),R,N;return p-b<0?(R=c.clone().add(y-1,"months"),N=(p-b)/(b-R)):(R=c.clone().add(y+1,"months"),N=(p-b)/(R-b)),-(y+N)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Nd(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Io(c){if(!this.isValid())return null;var p=c!==!0,y=p?this.clone().utc():this;return y.year()<0||y.year()>9999?ft(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",ft(y,"Z")):ft(y,p?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Di(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var c="moment",p="",y,b,R,N;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",N=p+'[")]',this.format(y+b+R+N)}function Ja(c){c||(c=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var p=ft(this,c);return this.localeData().postformat(p)}function iy(c,p){return this.isValid()&&(ee(c)&&c.isValid()||st(c).isValid())?Ae({to:this,from:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function sy(c){return this.from(st(),c)}function oy(c,p){return this.isValid()&&(ee(c)&&c.isValid()||st(c).isValid())?Ae({from:this,to:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function za(c){return this.to(st(),c)}function Oo(c){var p;return c===void 0?this._locale._abbr:(p=Et(c),p!=null&&(this._locale=p),this)}var Ka=w("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 Md(){return this._locale}var Po=1e3,Is=60*Po,Ga=60*Is,xt=(365*400+97)*24*Ga;function St(c,p){return(c%p+p)%p}function $d(c,p,y){return c<100&&c>=0?new Date(c+400,p,y)-xt:new Date(c,p,y).valueOf()}function Dd(c,p,y){return c<100&&c>=0?Date.UTC(c+400,p,y)-xt:Date.UTC(c,p,y)}function Fd(c){var p,y;if(c=yt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(y=this._isUTC?Dd:$d,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-=St(p+(this._isUTC?0:this.utcOffset()*Is),Ga);break;case"minute":p=this._d.valueOf(),p-=St(p,Is);break;case"second":p=this._d.valueOf(),p-=St(p,Po);break}return this._d.setTime(p),e.updateOffset(this,!0),this}function ay(c){var p,y;if(c=yt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(y=this._isUTC?Dd:$d,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+=Ga-St(p+(this._isUTC?0:this.utcOffset()*Is),Ga)-1;break;case"minute":p=this._d.valueOf(),p+=Is-St(p,Is)-1;break;case"second":p=this._d.valueOf(),p+=Po-St(p,Po)-1;break}return this._d.setTime(p),e.updateOffset(this,!0),this}function Yu(){return this._d.valueOf()-(this._offset||0)*6e4}function ko(){return Math.floor(this.valueOf()/1e3)}function Ju(){return new Date(this.valueOf())}function Os(){var c=this;return[c.year(),c.month(),c.date(),c.hour(),c.minute(),c.second(),c.millisecond()]}function Ao(){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 To(){return this.isValid()?this.toISOString():null}function Qa(){return A(this)}function Ps(){return g({},C(this))}function ly(){return C(this).overflow}function uy(){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",hy),oe("NNNNN",py),Ge(["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",ri),oe("yy",ri),oe("yyy",ri),oe("yyyy",ri),oe("yo",my),Ge(["y","yy","yyy","yyyy"],Vt),Ge(["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 cy(c,p){var y,b,R,N=this._eras||Et("en")._eras;for(y=0,b=N.length;y<b;++y){switch(typeof N[y].since){case"string":R=e(N[y].since).startOf("day"),N[y].since=R.valueOf();break}switch(typeof N[y].until){case"undefined":N[y].until=1/0;break;case"string":R=e(N[y].until).startOf("day").valueOf(),N[y].until=R.valueOf();break}}return N}function fy(c,p,y){var b,R,N=this.eras(),W,se,ye;for(c=c.toUpperCase(),b=0,R=N.length;b<R;++b)if(W=N[b].name.toUpperCase(),se=N[b].abbr.toUpperCase(),ye=N[b].narrow.toUpperCase(),y)switch(p){case"N":case"NN":case"NNN":if(se===c)return N[b];break;case"NNNN":if(W===c)return N[b];break;case"NNNNN":if(ye===c)return N[b];break}else if([W,se,ye].indexOf(c)>=0)return N[b]}function dy(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 Za(){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 qo(){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 Ld(){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 ks(c){return s(this,"_erasNameRegex")||Pn.call(this),c?this._erasNameRegex:this._erasRegex}function Xa(c){return s(this,"_erasAbbrRegex")||Pn.call(this),c?this._erasAbbrRegex:this._erasRegex}function wr(c){return s(this,"_erasNarrowRegex")||Pn.call(this),c?this._erasNarrowRegex:this._erasRegex}function Ie(c,p){return p.erasAbbrRegex(c)}function hy(c,p){return p.erasNameRegex(c)}function py(c,p){return p.erasNarrowRegex(c)}function my(c,p){return p._eraYearOrdinalRegex||ri}function Pn(){var c=[],p=[],y=[],b=[],R,N,W,se,ye,Oe=this.eras();for(R=0,N=Oe.length;R<N;++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 el(c,p){le(0,[c,c.length],0,p)}el("gggg","weekYear"),el("ggggg","weekYear"),el("GGGG","isoWeekYear"),el("GGGGG","isoWeekYear"),oe("G",gs),oe("g",gs),oe("GG",et,fr),oe("gg",et,fr),oe("GGGG",So,ti),oe("gggg",So,ti),oe("GGGGG",ms,hs),oe("ggggg",ms,hs),qi(["gggg","ggggg","GGGG","GGGGG"],function(c,p,y,b){p[b.substr(0,2)]=Me(c)}),qi(["gg","GG"],function(c,p,y,b){p[b]=e.parseTwoDigitYear(c)});function gy(c){return jd.call(this,c,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function yy(c){return jd.call(this,c,this.isoWeek(),this.isoWeekday(),1,4)}function vy(){return Ur(this.year(),1,4)}function Sy(){return Ur(this.isoWeekYear(),1,4)}function kn(){var c=this.localeData()._week;return Ur(this.year(),c.dow,c.doy)}function by(){var c=this.localeData()._week;return Ur(this.weekYear(),c.dow,c.doy)}function jd(c,p,y,b,R){var N;return c==null?_s(this,b,R).year:(N=Ur(c,b,R),p>N&&(p=N),_y.call(this,c,p,y,b,R))}function _y(c,p,y,b,R){var N=sd(c,p,y,b,R),W=Ss(N.year,0,N.dayOfYear);return this.year(W.getUTCFullYear()),this.month(W.getUTCMonth()),this.date(W.getUTCDate()),this}le("Q",0,"Qo","quarter"),oe("Q",fs),Ge("Q",function(c,p){p[xn]=(Me(c)-1)*3});function wy(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",et,Ti),oe("DD",et,fr),oe("Do",function(c,p){return c?p._dayOfMonthOrdinalParse||p._ordinalParse:p._dayOfMonthOrdinalParseLenient}),Ge(["D","DD"],Zr),Ge("Do",function(c,p){p[Zr]=Me(c.match(et)[0])});var Ud=vs("Date",!0);le("DDD",["DDDD",3],"DDDo","dayOfYear"),oe("DDD",ps),oe("DDDD",ds),Ge(["DDD","DDDD"],function(c,p,y){y._dayOfYear=Me(c)});function An(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",et,Pu),oe("mm",et,fr),Ge(["m","mm"],jr);var Cy=vs("Minutes",!1);le("s",["ss",2],0,"second"),oe("s",et,Pu),oe("ss",et,fr),Ge(["s","ss"],Rn);var Ey=vs("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",ps,fs),oe("SS",ps,fr),oe("SSS",ps,ds);var ci,Bd;for(ci="SSSS";ci.length<=9;ci+="S")oe(ci,ri);function xy(c,p){p[ni]=Me(("0."+c)*1e3)}for(ci="S";ci.length<=9;ci+="S")Ge(ci,xy);Bd=vs("Milliseconds",!1),le("z",0,0,"zoneAbbr"),le("zz",0,0,"zoneName");function Fi(){return this._isUTC?"UTC":""}function Ry(){return this._isUTC?"Coordinated Universal Time":""}var te=K.prototype;te.add=Rs,te.calendar=ry,te.clone=ny,te.diff=qd,te.endOf=ay,te.format=Ja,te.from=iy,te.fromNow=sy,te.to=oy,te.toNow=za,te.get=qa,te.invalidAt=ly,te.isAfter=Va,te.isBefore=ui,te.isBetween=Wa,te.isSame=Ad,te.isSameOrAfter=Ya,te.isSameOrBefore=Td,te.isValid=Qa,te.lang=Ka,te.locale=Oo,te.localeData=Md,te.max=Ug,te.min=xd,te.parsingFlags=Ps,te.set=mg,te.startOf=Fd,te.subtract=Ba,te.toArray=Os,te.toObject=Ao,te.toDate=Ju,te.toISOString=Io,te.inspect=Di,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=To,te.toString=Nd,te.unix=ko,te.valueOf=Yu,te.creationData=uy,te.eraName=Za,te.eraNarrow=qo,te.eraAbbr=Ld,te.eraYear=I,te.year=Jf,te.isLeapYear=pg,te.weekYear=gy,te.isoWeekYear=yy,te.quarter=te.quarters=wy,te.month=ed,te.daysInMonth=td,te.week=te.weeks=bg,te.isoWeek=te.isoWeeks=ld,te.weeksInYear=kn,te.weeksInWeekYear=by,te.isoWeeksInYear=vy,te.isoWeeksInISOWeekYear=Sy,te.date=Ud,te.day=te.days=Pg,te.weekday=kg,te.isoWeekday=Ag,te.dayOfYear=An,te.hour=te.hours=$t,te.minute=te.minutes=Cy,te.second=te.seconds=Ey,te.millisecond=te.milliseconds=Bd,te.utcOffset=Kg,te.utc=Qg,te.local=Zg,te.parseZone=Xg,te.hasAlignedHourOffset=li,te.isDST=U,te.isLocal=H,te.isUtcOffset=ae,te.isUtc=ve,te.isUTC=ve,te.zoneAbbr=Fi,te.zoneName=Ry,te.dates=w("dates accessor is deprecated. Use date instead.",Ud),te.months=w("months accessor is deprecated. Use month instead",ed),te.years=w("years accessor is deprecated. Use year instead",Jf),te.zone=w("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Gg),te.isDSTShifted=w("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",J);function Hr(c){return st(c*1e3)}function Iy(){return st.apply(null,arguments).parseZone()}function Hd(c){return c}var He=Z.prototype;He.calendar=wt,He.longDateFormat=jt,He.invalidDate=ei,He.ordinal=sg,He.preparse=Hd,He.postformat=Hd,He.relativeTime=Wf,He.pastFuture=og,He.set=L,He.eras=cy,He.erasParse=fy,He.erasConvertYear=dy,He.erasAbbrRegex=Xa,He.erasNameRegex=ks,He.erasNarrowRegex=wr,He.months=Sg,He.monthsShort=Qf,He.monthsParse=Xf,He.monthsRegex=rd,He.monthsShortRegex=$a,He.week=Au,He.firstDayOfYear=ad,He.firstDayOfWeek=od,He.weekdays=xg,He.weekdaysMin=Tu,He.weekdaysShort=Rg,He.weekdaysParse=Og,He.weekdaysRegex=lt,He.weekdaysShortRegex=it,He.weekdaysMinRegex=Tg,He.isPM=md,He.meridiem=Mu;function tl(c,p,y,b){var R=Et(),N=S().set(b,p);return R[y](N,c)}function Vd(c,p,y){if(f(c)&&(p=c,c=void 0),c=c||"",p!=null)return tl(c,p,y,"month");var b,R=[];for(b=0;b<12;b++)R[b]=tl(c,b,y,"month");return R}function rl(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=Et(),N=c?R._week.dow:0,W,se=[];if(y!=null)return tl(p,(y+N)%7,b,"day");for(W=0;W<7;W++)se[W]=tl(p,(W+N)%7,b,"day");return se}function Wd(c,p){return Vd(c,p,"months")}function Oy(c,p){return Vd(c,p,"monthsShort")}function Py(c,p,y){return rl(c,p,y,"weekdays")}function zu(c,p,y){return rl(c,p,y,"weekdaysShort")}function No(c,p,y){return rl(c,p,y,"weekdaysMin")}In("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=Me(c%100/10)===1?"th":p===1?"st":p===2?"nd":p===3?"rd":"th";return c+y}}),e.lang=w("moment.lang is deprecated. Use moment.locale instead.",In),e.langData=w("moment.langData is deprecated. Use moment.localeData instead.",Et);var Cr=Math.abs;function ky(){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 Ku(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 Ay(c,p){return Ku(this,c,p,1)}function Tn(c,p){return Ku(this,c,p,-1)}function nl(c){return c<0?Math.floor(c):Math.ceil(c)}function Li(){var c=this._milliseconds,p=this._days,y=this._months,b=this._data,R,N,W,se,ye;return c>=0&&p>=0&&y>=0||c<=0&&p<=0&&y<=0||(c+=nl(Gu(y)+p)*864e5,p=0,y=0),b.milliseconds=c%1e3,R=br(c/1e3),b.seconds=R%60,N=br(R/60),b.minutes=N%60,W=br(N/60),b.hours=W%24,p+=br(W/24),ye=br(hr(p)),y+=ye,p-=nl(Gu(ye)),se=br(y/12),y%=12,b.days=p,b.months=y,b.years=se,this}function hr(c){return c*4800/146097}function Gu(c){return c*146097/4800}function Yd(c){if(!this.isValid())return NaN;var p,y,b=this._milliseconds;if(c=yt(c),c==="month"||c==="quarter"||c==="year")switch(p=this._days+b/864e5,y=this._months+hr(p),c){case"month":return y;case"quarter":return y/3;case"year":return y/12}else switch(p=this._days+Math.round(Gu(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 As=tn("ms"),fi=tn("s"),Jd=tn("m"),Ty=tn("h"),il=tn("d"),qy=tn("w"),zd=tn("M"),Ut=tn("Q"),Qu=tn("y"),Kd=As;function rn(){return Ae(this)}function Zu(c){return c=yt(c),this.isValid()?this[c+"s"]():NaN}function nn(c){return function(){return this.isValid()?this._data[c]:NaN}}var ji=nn("milliseconds"),Gd=nn("seconds"),zt=nn("minutes"),Xu=nn("hours"),Ny=nn("days"),My=nn("months"),$y=nn("years");function ec(){return br(this.days()/7)}var qn=Math.round,sn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Qd(c,p,y,b,R){return R.relativeTime(p||1,!!y,c,b)}function Dy(c,p,y,b){var R=Ae(c).abs(),N=qn(R.as("s")),W=qn(R.as("m")),se=qn(R.as("h")),ye=qn(R.as("d")),Oe=qn(R.as("M")),Kt=qn(R.as("w")),on=qn(R.as("y")),Nn=N<=y.ss&&["s",N]||N<y.s&&["ss",N]||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&&(Nn=Nn||Kt<=1&&["w"]||Kt<y.w&&["ww",Kt]),Nn=Nn||Oe<=1&&["M"]||Oe<y.M&&["MM",Oe]||on<=1&&["y"]||["yy",on],Nn[2]=p,Nn[3]=+c>0,Nn[4]=b,Qd.apply(null,Nn)}function Fy(c){return c===void 0?qn:typeof c=="function"?(qn=c,!0):!1}function Mo(c,p){return sn[c]===void 0?!1:p===void 0?sn[c]:(sn[c]=p,c==="s"&&(sn.ss=p-1),!0)}function Ly(c,p){if(!this.isValid())return this.localeData().invalidDate();var y=!1,b=sn,R,N;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(),N=Dy(this,!y,b,R),y&&(N=R.pastFuture(+this,N)),R.postformat(N)}var tc=Math.abs;function di(c){return(c>0)-(c<0)||+c}function $o(){if(!this.isValid())return this.localeData().invalidDate();var c=tc(this._milliseconds)/1e3,p=tc(this._days),y=tc(this._months),b,R,N,W,se=this.asSeconds(),ye,Oe,Kt,on;return se?(b=br(c/60),R=br(b/60),c%=60,b%=60,N=br(y/12),y%=12,W=c?c.toFixed(3).replace(/\.?0+$/,""):"",ye=se<0?"-":"",Oe=di(this._months)!==di(se)?"-":"",Kt=di(this._days)!==di(se)?"-":"",on=di(this._milliseconds)!==di(se)?"-":"",ye+"P"+(N?Oe+N+"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 je=Eo.prototype;je.isValid=Yg,je.abs=ky,je.add=Ay,je.subtract=Tn,je.as=Yd,je.asMilliseconds=As,je.asSeconds=fi,je.asMinutes=Jd,je.asHours=Ty,je.asDays=il,je.asWeeks=qy,je.asMonths=zd,je.asQuarters=Ut,je.asYears=Qu,je.valueOf=Kd,je._bubble=Li,je.clone=rn,je.get=Zu,je.milliseconds=ji,je.seconds=Gd,je.minutes=zt,je.hours=Xu,je.days=Ny,je.weeks=ec,je.months=My,je.years=$y,je.humanize=Ly,je.toISOString=$o,je.toString=$o,je.toJSON=$o,je.locale=Oo,je.localeData=Md,je.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$o),je.lang=Ka,le("X",0,0,"unix"),le("x",0,0,"valueOf"),oe("x",gs),oe("X",ug),Ge("X",function(c,p,y){y._d=new Date(parseFloat(c)*1e3)}),Ge("x",function(c,p,y){y._d=new Date(Me(c))});return e.version="2.30.1",t(st),e.fn=te,e.min=Bg,e.max=Hg,e.now=Vg,e.utc=S,e.unix=Hr,e.months=Wd,e.isDate=h,e.locale=In,e.invalid=q,e.duration=Ae,e.isMoment=ee,e.weekdays=Py,e.parseZone=Iy,e.localeData=Et,e.isDuration=Br,e.monthsShort=Oy,e.weekdaysMin=No,e.defineLocale=Jt,e.updateLocale=Mg,e.locales=$g,e.weekdaysShort=zu,e.normalizeUnits=yt,e.relativeTimeRounding=Fy,e.relativeTimeThreshold=Mo,e.calendarFormat=ty,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 lE=F((aE,Ah)=>{(function(r,e){typeof define=="function"&&define.amd?define([],e):typeof Ah<"u"&&Ah.exports?Ah.exports=e():r.tv4=e()})(aE,function(){Object.keys||(Object.keys=function(){var k=Object.prototype.hasOwnProperty,w=!{toString:null}.propertyIsEnumerable("toString"),P=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],$=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(w)for(var Z=0;Z<$;Z++)k.call(D,P[Z])&&L.push(P[Z]);return L}}()),Object.create||(Object.create=function(){function k(){}return function(w){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return k.prototype=w,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 w=Object(this),P=w.length>>>0;if(P===0)return-1;var $=0;if(arguments.length>1&&($=Number(arguments[1]),$!==$?$=0:$!==0&&$!==1/0&&$!==-1/0&&($=($>0||-1)*Math.floor(Math.abs($)))),$>=P)return-1;for(var D=$>=0?$:Math.max(P-Math.abs($),0);D<P;D++)if(D in w&&w[D]===k)return D;return-1}),Object.isFrozen||(Object.isFrozen=function(k){for(var w="tv4_test_frozen_key";k.hasOwnProperty(w);)w+=Math.random();try{return k[w]=!0,delete k[w],!1}catch{return!0}});var r={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},e={"*":!0};function t(k){return encodeURI(k).replace(/%25[0-9][0-9]/g,function(w){return"%"+w.substring(3)})}function n(k){var w="";r[k.charAt(0)]&&(w=k.charAt(0),k=k.substring(1));var P="",$="",D=!0,L=!1,z=!1;w==="+"?D=!1:w==="."?($=".",P="."):w==="/"?($="/",P="/"):w==="#"?($="#",D=!1):w===";"?($=";",P=";",L=!0,z=!0):w==="?"?($="?",P="&",L=!0):w==="&"&&($="&",P="&",L=!0);for(var Z=[],ie=k.split(","),fe=[],wt={},Ce=0;Ce<ie.length;Ce++){var he=ie[Ce],Xe=null;if(he.indexOf(":")!==-1){var Ct=he.split(":");he=Ct[0],Xe=parseInt(Ct[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:Xe,name:he,suffices:Mt};fe.push(le),wt[he]=le,Z.push(he)}var Xn=function(Ou){for(var ft="",wn=0,us=0;us<fe.length;us++){var jt=fe[us],dt=Ou(jt.name);if(dt==null||Array.isArray(dt)&&dt.length===0||typeof dt=="object"&&Object.keys(dt).length===0){wn++;continue}if(us===wn?ft+=$:ft+=P||",",Array.isArray(dt)){L&&(ft+=jt.name+"=");for(var ei=0;ei<dt.length;ei++)ei>0&&(ft+=jt.suffices["*"]&&P||",",jt.suffices["*"]&&L&&(ft+=jt.name+"=")),ft+=D?encodeURIComponent(dt[ei]).replace(/!/g,"%21"):t(dt[ei])}else if(typeof dt=="object"){L&&!jt.suffices["*"]&&(ft+=jt.name+"=");var tr=!0;for(var Qr in dt)tr||(ft+=jt.suffices["*"]&&P||","),tr=!1,ft+=D?encodeURIComponent(Qr).replace(/!/g,"%21"):t(Qr),ft+=jt.suffices["*"]?"=":",",ft+=D?encodeURIComponent(dt[Qr]).replace(/!/g,"%21"):t(dt[Qr])}else L&&(ft+=jt.name,(!z||dt!=="")&&(ft+="=")),jt.truncate!=null&&(dt=dt.substring(0,jt.truncate)),ft+=D?encodeURIComponent(dt).replace(/!/g,"%21"):t(dt)}return ft};return Xn.varNames=Z,{prefix:$,substitution:Xn}}function i(k){if(!(this instanceof i))return new i(k);for(var w=k.split("{"),P=[w.shift()],$=[],D=[],L=[];w.length>0;){var z=w.shift(),Z=z.split("}")[0],ie=z.substring(Z.length+1),fe=n(Z);D.push(fe.substitution),$.push(fe.prefix),P.push(ie),L=L.concat(fe.substitution.varNames)}this.fill=function(wt){for(var Ce=P[0],he=0;he<D.length;he++){var Xe=D[he];Ce+=Xe(wt),Ce+=P[he+1]}return Ce},this.varNames=L,this.template=k}i.prototype={toString:function(){return this.template},fillFromObject:function(k){return this.fill(function(w){return k[w]})}};var s=function(w,P,$,D,L){if(this.missing=[],this.missingMap={},this.formatValidators=w?Object.create(w.formatValidators):{},this.schemas=w?Object.create(w.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=$||E("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},w)for(var z in w.definedKeywords)this.definedKeywords[z]=w.definedKeywords[z].slice(0)};s.prototype.defineKeyword=function(k,w){this.definedKeywords[k]=this.definedKeywords[k]||[],this.definedKeywords[k].push(w)},s.prototype.createError=function(k,w,P,$,D,L,z){var Z=new j(k,w,P,$,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,w,P){for(var $=k;$<this.errors.length;$++)this.errors[$]=this.errors[$].prefixWith(w,P);return this},s.prototype.banUnknownProperties=function(k,w){for(var P in this.unknownPropertyPaths){var $=this.createError(C.UNKNOWN_PROPERTY,{path:P},P,"",null,k,w),D=this.handleError($);if(D)return D}return null},s.prototype.addFormat=function(k,w){if(typeof k=="object"){for(var P in k)this.addFormat(P,k[P]);return this}this.formatValidators[k]=w},s.prototype.resolveRefs=function(k,w){if(k.$ref!==void 0){if(w=w||{},w[k.$ref])return this.createError(C.CIRCULAR_REFERENCE,{urls:Object.keys(w).join(", ")},"","",null,void 0,k);w[k.$ref]=!0,k=this.getSchema(k.$ref,w)}return k},s.prototype.getSchema=function(k,w){var P;if(this.schemas[k]!==void 0)return P=this.schemas[k],this.resolveRefs(P,w);var $=k,D="";if(k.indexOf("#")!==-1&&(D=k.substring(k.indexOf("#")+1),$=k.substring(0,k.indexOf("#"))),typeof this.schemas[$]=="object"){P=this.schemas[$];var L=decodeURIComponent(D);if(L==="")return this.resolveRefs(P,w);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,w)}this.missing[$]===void 0&&(this.missing.push($),this.missing[$]=$,this.missingMap[$]=$)},s.prototype.searchSchemas=function(k,w){if(Array.isArray(k))for(var P=0;P<k.length;P++)this.searchSchemas(k[P],w);else if(k&&typeof k=="object"){typeof k.id=="string"&&Y(w,k.id)&&this.schemas[k.id]===void 0&&(this.schemas[k.id]=k);for(var $ in k)if($!=="enum"){if(typeof k[$]=="object")this.searchSchemas(k[$],w);else if($==="$ref"){var D=g(k[$]);D&&this.schemas[D]===void 0&&this.missingMap[D]===void 0&&(this.missingMap[D]=D)}}}},s.prototype.addSchema=function(k,w){if(typeof k!="string"||typeof w>"u")if(typeof k=="object"&&typeof k.id=="string")w=k,k=w.id;else return;k===g(k)+"#"&&(k=g(k)),this.schemas[k]=w,delete this.missingMap[k],S(w,k),this.searchSchemas(w,k)},s.prototype.getSchemaMap=function(){var k={};for(var w in this.schemas)k[w]=this.schemas[w];return k},s.prototype.getSchemaUris=function(k){var w=[];for(var P in this.schemas)(!k||k.test(P))&&w.push(P);return w},s.prototype.getMissingUris=function(k){var w=[];for(var P in this.missingMap)(!k||k.test(P))&&w.push(P);return w},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(k,w,P,$,D){var L;if(w=this.resolveRefs(w),w){if(w instanceof j)return this.errors.push(w),w}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 wt=k[this.validatedSchemasKey].indexOf(w);if(wt!==-1)return this.errors=this.errors.concat(k[this.validationErrorsKey][wt]),null}if(Object.isFrozen(k)&&(Z=this.scannedFrozen.indexOf(k),Z!==-1)){var Ce=this.scannedFrozenSchemas[Z].indexOf(w);if(Ce!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[Z][Ce]),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]=w,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]=w,k[this.validationErrorsKey][fe]=[]}}var he=this.errors.length,Xe=this.validateBasic(k,w,D)||this.validateNumeric(k,w,D)||this.validateString(k,w,D)||this.validateArray(k,w,D)||this.validateObject(k,w,D)||this.validateCombinations(k,w,D)||this.validateHypermedia(k,w,D)||this.validateFormat(k,w,D)||this.validateDefinedKeywords(k,w,D)||null;if(L){for(;this.scanned.length;){var Ct=this.scanned.pop();delete Ct[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Xe||he!==this.errors.length)for(;P&&P.length||$&&$.length;){var Mt=P&&P.length?""+P.pop():null,le=$&&$.length?""+$.pop():null;Xe&&(Xe=Xe.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(Xe)},s.prototype.validateFormat=function(k,w){if(typeof w.format!="string"||!this.formatValidators[w.format])return null;var P=this.formatValidators[w.format].call(null,k,w);return typeof P=="string"||typeof P=="number"?this.createError(C.FORMAT_CUSTOM,{message:P},"","/format",null,k,w):P&&typeof P=="object"?this.createError(C.FORMAT_CUSTOM,{message:P.message||"?"},P.dataPath||"",P.schemaPath||"/format",null,k,w):null},s.prototype.validateDefinedKeywords=function(k,w,P){for(var $ in this.definedKeywords)if(!(typeof w[$]>"u"))for(var D=this.definedKeywords[$],L=0;L<D.length;L++){var z=D[L],Z=z(k,w[$],w,P);if(typeof Z=="string"||typeof Z=="number")return this.createError(C.KEYWORD_CUSTOM,{key:$,message:Z},"","",null,k,w).prefixWith(null,$);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:$,message:Z.message||"?"},wt=Z.schemaPath||"/"+$.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ie,fe,Z.dataPath||null,wt,null,k,w)}}return null};function a(k,w){if(k===w)return!0;if(k&&w&&typeof k=="object"&&typeof w=="object"){if(Array.isArray(k)!==Array.isArray(w))return!1;if(Array.isArray(k)){if(k.length!==w.length)return!1;for(var P=0;P<k.length;P++)if(!a(k[P],w[P]))return!1}else{var $;for($ in k)if(w[$]===void 0&&k[$]!==void 0)return!1;for($ in w)if(k[$]===void 0&&w[$]!==void 0)return!1;for($ in k)if(!a(k[$],w[$]))return!1}return!0}return!1}s.prototype.validateBasic=function(w,P,$){var D;return(D=this.validateType(w,P,$))||(D=this.validateEnum(w,P,$))?D.prefixWith(null,"type"):null},s.prototype.validateType=function(w,P){if(P.type===void 0)return null;var $=typeof w;w===null?$="null":Array.isArray(w)&&($="array");var D=P.type;Array.isArray(D)||(D=[D]);for(var L=0;L<D.length;L++){var z=D[L];if(z===$||z==="integer"&&$==="number"&&w%1===0)return null}return this.createError(C.INVALID_TYPE,{type:$,expected:D.join("/")},"","",null,w,P)},s.prototype.validateEnum=function(w,P){if(P.enum===void 0)return null;for(var $=0;$<P.enum.length;$++){var D=P.enum[$];if(a(w,D))return null}return this.createError(C.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(w):w},"","",null,w,P)},s.prototype.validateNumeric=function(w,P,$){return this.validateMultipleOf(w,P,$)||this.validateMinMax(w,P,$)||this.validateNaN(w,P,$)||null};var u=Math.pow(2,-51),f=1-u;s.prototype.validateMultipleOf=function(w,P){var $=P.multipleOf||P.divisibleBy;if($===void 0)return null;if(typeof w=="number"){var D=w/$%1;if(D>=u&&D<f)return this.createError(C.NUMBER_MULTIPLE_OF,{value:w,multipleOf:$},"","",null,w,P)}return null},s.prototype.validateMinMax=function(w,P){if(typeof w!="number")return null;if(P.minimum!==void 0){if(w<P.minimum)return this.createError(C.NUMBER_MINIMUM,{value:w,minimum:P.minimum},"","/minimum",null,w,P);if(P.exclusiveMinimum&&w===P.minimum)return this.createError(C.NUMBER_MINIMUM_EXCLUSIVE,{value:w,minimum:P.minimum},"","/exclusiveMinimum",null,w,P)}if(P.maximum!==void 0){if(w>P.maximum)return this.createError(C.NUMBER_MAXIMUM,{value:w,maximum:P.maximum},"","/maximum",null,w,P);if(P.exclusiveMaximum&&w===P.maximum)return this.createError(C.NUMBER_MAXIMUM_EXCLUSIVE,{value:w,maximum:P.maximum},"","/exclusiveMaximum",null,w,P)}return null},s.prototype.validateNaN=function(w,P){return typeof w!="number"?null:isNaN(w)===!0||w===1/0||w===-1/0?this.createError(C.NUMBER_NOT_A_NUMBER,{value:w},"","/type",null,w,P):null},s.prototype.validateString=function(w,P,$){return this.validateStringLength(w,P,$)||this.validateStringPattern(w,P,$)||null},s.prototype.validateStringLength=function(w,P){return typeof w!="string"?null:P.minLength!==void 0&&w.length<P.minLength?this.createError(C.STRING_LENGTH_SHORT,{length:w.length,minimum:P.minLength},"","/minLength",null,w,P):P.maxLength!==void 0&&w.length>P.maxLength?this.createError(C.STRING_LENGTH_LONG,{length:w.length,maximum:P.maxLength},"","/maxLength",null,w,P):null},s.prototype.validateStringPattern=function(w,P){if(typeof w!="string"||typeof P.pattern!="string"&&!(P.pattern instanceof RegExp))return null;var $;if(P.pattern instanceof RegExp)$=P.pattern;else{var D,L="",z=P.pattern.match(/^\/(.+)\/([img]*)$/);z?(D=z[1],L=z[2]):D=P.pattern,$=new RegExp(D,L)}return $.test(w)?null:this.createError(C.STRING_PATTERN,{pattern:P.pattern},"","/pattern",null,w,P)},s.prototype.validateArray=function(w,P,$){return Array.isArray(w)&&(this.validateArrayLength(w,P,$)||this.validateArrayUniqueItems(w,P,$)||this.validateArrayItems(w,P,$))||null},s.prototype.validateArrayLength=function(w,P){var $;return P.minItems!==void 0&&w.length<P.minItems&&($=this.createError(C.ARRAY_LENGTH_SHORT,{length:w.length,minimum:P.minItems},"","/minItems",null,w,P),this.handleError($))||P.maxItems!==void 0&&w.length>P.maxItems&&($=this.createError(C.ARRAY_LENGTH_LONG,{length:w.length,maximum:P.maxItems},"","/maxItems",null,w,P),this.handleError($))?$:null},s.prototype.validateArrayUniqueItems=function(w,P){if(P.uniqueItems){for(var $=0;$<w.length;$++)for(var D=$+1;D<w.length;D++)if(a(w[$],w[D])){var L=this.createError(C.ARRAY_UNIQUE,{match1:$,match2:D},"","/uniqueItems",null,w,P);if(this.handleError(L))return L}}return null},s.prototype.validateArrayItems=function(w,P,$){if(P.items===void 0)return null;var D,L;if(Array.isArray(P.items)){for(L=0;L<w.length;L++)if(L<P.items.length){if(D=this.validateAll(w[L],P.items[L],[L],["items",L],$+"/"+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,w,P),this.handleError(D)))return D}else if(D=this.validateAll(w[L],P.additionalItems,[L],["additionalItems"],$+"/"+L))return D}}else for(L=0;L<w.length;L++)if(D=this.validateAll(w[L],P.items,[L],["items"],$+"/"+L))return D;return null},s.prototype.validateObject=function(w,P,$){return typeof w!="object"||w===null||Array.isArray(w)?null:this.validateObjectMinMaxProperties(w,P,$)||this.validateObjectRequiredProperties(w,P,$)||this.validateObjectProperties(w,P,$)||this.validateObjectDependencies(w,P,$)||null},s.prototype.validateObjectMinMaxProperties=function(w,P){var $=Object.keys(w),D;return P.minProperties!==void 0&&$.length<P.minProperties&&(D=this.createError(C.OBJECT_PROPERTIES_MINIMUM,{propertyCount:$.length,minimum:P.minProperties},"","/minProperties",null,w,P),this.handleError(D))||P.maxProperties!==void 0&&$.length>P.maxProperties&&(D=this.createError(C.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:$.length,maximum:P.maxProperties},"","/maxProperties",null,w,P),this.handleError(D))?D:null},s.prototype.validateObjectRequiredProperties=function(w,P){if(P.required!==void 0)for(var $=0;$<P.required.length;$++){var D=P.required[$];if(w[D]===void 0){var L=this.createError(C.OBJECT_REQUIRED,{key:D},"","/required/"+$,null,w,P);if(this.handleError(L))return L}}return null},s.prototype.validateObjectProperties=function(w,P,$){var D;for(var L in w){var z=$+"/"+L.replace(/~/g,"~0").replace(/\//g,"~1"),Z=!1;if(P.properties!==void 0&&P.properties[L]!==void 0&&(Z=!0,D=this.validateAll(w[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(w[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,w,P).prefixWith(L,null),this.handleError(D)))return D}else if(D=this.validateAll(w[L],P.additionalProperties,[L],["additionalProperties"],z))return D}else this.trackUnknownProperties&&!this.knownPropertyPaths[z]&&(this.unknownPropertyPaths[z]=!0)}return null},s.prototype.validateObjectDependencies=function(w,P,$){var D;if(P.dependencies!==void 0){for(var L in P.dependencies)if(w[L]!==void 0){var z=P.dependencies[L];if(typeof z=="string"){if(w[z]===void 0&&(D=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:L,missing:z},"","",null,w,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(w[ie]===void 0&&(D=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:L,missing:ie},"","/"+Z,null,w,P).prefixWith(null,L).prefixWith(null,"dependencies"),this.handleError(D)))return D}else if(D=this.validateAll(w,z,[],["dependencies",L],$))return D}}return null},s.prototype.validateCombinations=function(w,P,$){return this.validateAllOf(w,P,$)||this.validateAnyOf(w,P,$)||this.validateOneOf(w,P,$)||this.validateNot(w,P,$)||null},s.prototype.validateAllOf=function(w,P,$){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(w,z,[],["allOf",L],$))return D}return null},s.prototype.validateAnyOf=function(w,P,$){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 wt=P.anyOf[fe],Ce=this.errors.length,he=this.validateAll(w,wt,[],["anyOf",fe],$);if(he===null&&Ce===this.errors.length){if(this.errors=this.errors.slice(0,L),this.trackUnknownProperties){for(var Xe in this.knownPropertyPaths)Z[Xe]=!0,delete z[Xe];for(var Ct in this.unknownPropertyPaths)Z[Ct]||(z[Ct]=!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,w,P)},s.prototype.validateOneOf=function(w,P,$){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 wt=P.oneOf[fe],Ce=this.errors.length,he=this.validateAll(w,wt,[],["oneOf",fe],$);if(he===null&&Ce===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,w,P);if(this.trackUnknownProperties){for(var Xe in this.knownPropertyPaths)ie[Xe]=!0,delete Z[Xe];for(var Ct in this.unknownPropertyPaths)ie[Ct]||(Z[Ct]=!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,w,P)):(this.errors=this.errors.slice(0,z),null)},s.prototype.validateNot=function(w,P,$){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(w,P.not,null,null,$),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,w,P):null},s.prototype.validateHypermedia=function(w,P,$){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 w)){ie=!1;break}if(ie){var wt=Z.fillFromObject(w),Ce={$ref:wt};if(D=this.validateAll(w,Ce,[],["links",L],$))return D}}}};function h(k){var w=String(k).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return w?{href:w[0]||"",protocol:w[1]||"",authority:w[2]||"",host:w[3]||"",hostname:w[4]||"",port:w[5]||"",pathname:w[6]||"",search:w[7]||"",hash:w[8]||""}:null}function m(k,w){function P($){var D=[];return $.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(L){L==="/.."?D.pop():D.push(L)}),D.join("").replace(/^\//,$.charAt(0)==="/"?"/":"")}return w=h(w||""),k=h(k||""),!w||!k?null:(w.protocol||k.protocol)+(w.protocol||w.authority?w.authority:k.authority)+P(w.protocol||w.authority||w.pathname.charAt(0)==="/"?w.pathname:w.pathname?(k.authority&&!k.pathname?"/":"")+k.pathname.slice(0,k.pathname.lastIndexOf("/")+1)+w.pathname:k.pathname)+(w.protocol||w.authority||w.pathname?w.search:w.search||k.search)+w.hash}function g(k){return k.split("#")[0]}function S(k,w){if(k&&typeof k=="object")if(w===void 0?w=k.id:typeof k.id=="string"&&(w=m(w,k.id),k.id=w),Array.isArray(k))for(var P=0;P<k.length;P++)S(k[P],w);else{typeof k.$ref=="string"&&(k.$ref=m(w,k.$ref));for(var $ in k)$!=="enum"&&S(k[$],w)}}function E(k){k=k||"en";var w=V[k];return function(P){var $=w[P.code]||q[P.code];if(typeof $!="string")return"Unknown error code "+P.code+": "+JSON.stringify(P.messageParams);var D=P.params;return $.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 q={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,w,P,$,D){if(Error.call(this),k===void 0)throw new Error("No error code supplied: "+$);this.message="",this.params=w,this.code=k,this.dataPath=P||"",this.schemaPath=$||"",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,w){if(k!==null&&(k=k.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+k+this.dataPath),w!==null&&(w=w.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+w+this.schemaPath),this.subErrors!==null)for(var P=0;P<this.subErrors.length;P++)this.subErrors[P].prefixWith(k,w);return this};function Y(k,w){if(w.substring(0,k.length)===k){var P=w.substring(k.length);if(w.length>0&&w.charAt(k.length-1)==="/"||P.charAt(0)==="#"||P.charAt(0)==="?")return!0}return!1}var V={};function K(k){var w=new s,P,$,D={setErrorReporter:function(L){return typeof L=="string"?this.language(L):($=L,!0)},addFormat:function(){w.addFormat.apply(w,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=E(P),wt=$?function(Xe,Ct,Mt){return $(Xe,Ct,Mt)||fe(Xe,Ct,Mt)}:fe,Ce=new s(w,!1,wt,Z,ie);typeof z=="string"&&(z={$ref:z}),Ce.addSchema("",z);var he=Ce.validateAll(L,z,null,null,"");return!he&&ie&&(he=Ce.banUnknownProperties(L,z)),this.error=he,this.missing=Ce.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=E(P),wt=$?function(Xe,Ct,Mt){return $(Xe,Ct,Mt)||fe(Xe,Ct,Mt)}:fe,Ce=new s(w,!0,wt,Z,ie);typeof z=="string"&&(z={$ref:z}),Ce.addSchema("",z),Ce.validateAll(L,z,null,null,""),ie&&Ce.banUnknownProperties(L,z);var he={toString:function(){return this.valid?"valid":this.error.message}};return he.errors=Ce.errors,he.missing=Ce.missing,he.valid=he.errors.length===0,he},addSchema:function(){return w.addSchema.apply(w,arguments)},getSchema:function(){return w.getSchema.apply(w,arguments)},getSchemaMap:function(){return w.getSchemaMap.apply(w,arguments)},getSchemaUris:function(){return w.getSchemaUris.apply(w,arguments)},getMissingUris:function(){return w.getMissingUris.apply(w,arguments)},dropSchemas:function(){w.dropSchemas.apply(w,arguments)},defineKeyword:function(){w.defineKeyword.apply(w,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,q[L]=q[z]=Z;for(var ie in V){var fe=V[ie];fe[L]&&(fe[z]=fe[z]||fe[L])}},reset:function(){w.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:S,resolveUrl:m,getDocumentUri:g,errorCodes:C};return D.language(k||"en"),D}var ee=K();return ee.addLanguage("en-gb",q),ee.tv4=ee,ee})});var gc=F(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.regexpCode=Je.getEsmExportName=Je.getProperty=Je.safeStringify=Je.stringify=Je.strConcat=Je.addCodeArg=Je.str=Je._=Je.nil=Je._Code=Je.Name=Je.IDENTIFIER=Je._CodeOrName=void 0;var pc=class{};Je._CodeOrName=pc;Je.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Bo=class extends pc{constructor(e){if(super(),!Je.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}}};Je.Name=Bo;var dn=class extends pc{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((t,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>(n instanceof Bo&&(t[n.str]=(t[n.str]||0)+1),t),{})}};Je._Code=dn;Je.nil=new dn("");function uE(r,...e){let t=[r[0]],n=0;for(;n<e.length;)$v(t,e[n]),t.push(r[++n]);return new dn(t)}Je._=uE;var Mv=new dn("+");function cE(r,...e){let t=[mc(r[0])],n=0;for(;n<e.length;)t.push(Mv),$v(t,e[n]),t.push(Mv,mc(r[++n]));return nD(t),new dn(t)}Je.str=cE;function $v(r,e){e instanceof dn?r.push(...e._items):e instanceof Bo?r.push(e):r.push(oD(e))}Je.addCodeArg=$v;function nD(r){let e=1;for(;e<r.length-1;){if(r[e]===Mv){let t=iD(r[e-1],r[e+1]);if(t!==void 0){r.splice(e-1,3,t);continue}r[e++]="+"}e++}}function iD(r,e){if(e==='""')return r;if(r==='""')return e;if(typeof r=="string")return e instanceof Bo||r[r.length-1]!=='"'?void 0:typeof e!="string"?`${r.slice(0,-1)}${e}"`:e[0]==='"'?r.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(r instanceof Bo))return`"${r}${e.slice(1)}`}function sD(r,e){return e.emptyStr()?r:r.emptyStr()?e:cE`${r}${e}`}Je.strConcat=sD;function oD(r){return typeof r=="number"||typeof r=="boolean"||r===null?r:mc(Array.isArray(r)?r.join(","):r)}function aD(r){return new dn(mc(r))}Je.stringify=aD;function mc(r){return JSON.stringify(r).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Je.safeStringify=mc;function lD(r){return typeof r=="string"&&Je.IDENTIFIER.test(r)?new dn(`.${r}`):uE`[${r}]`}Je.getProperty=lD;function uD(r){if(typeof r=="string"&&Je.IDENTIFIER.test(r))return new dn(`${r}`);throw new Error(`CodeGen: invalid export name: ${r}, use explicit $id name mapping`)}Je.getEsmExportName=uD;function cD(r){return new dn(r.toString())}Je.regexpCode=cD});var Lv=F(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.ValueScope=kr.ValueScopeName=kr.Scope=kr.varKinds=kr.UsedValueState=void 0;var Pr=gc(),Dv=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Th;(function(r){r[r.Started=0]="Started",r[r.Completed=1]="Completed"})(Th||(kr.UsedValueState=Th={}));kr.varKinds={const:new Pr.Name("const"),let:new Pr.Name("let"),var:new Pr.Name("var")};var qh=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof Pr.Name?e:this.name(e)}name(e){return new Pr.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(!((n=(t=this._parent)===null||t===void 0?void 0:t._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=qh;var Nh=class extends Pr.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=(0,Pr._)`.${new Pr.Name(t)}[${n}]`}};kr.ValueScopeName=Nh;var fD=(0,Pr._)`\n`,Fv=class extends qh{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?fD:Pr.nil}}get(){return this._scope}name(e){return new Nh(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:s}=i,a=(n=t.key)!==null&&n!==void 0?n:t.ref,u=this._values[s];if(u){let m=u.get(a);if(m)return m}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]=t.ref,i.setValue(t,{property:s,itemIndex:h}),i}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,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,t,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},t,n)}_reduceValues(e,t,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,Th.Started);let m=t(h);if(m){let g=this.opts.es5?kr.varKinds.var:kr.varKinds.const;s=(0,Pr._)`${s}${g} ${h} = ${m};${this.opts._n}`}else if(m=i?.(h))s=(0,Pr._)`${s}${m}${this.opts._n}`;else throw new Dv(h);f.set(h,Th.Completed)})}return s}};kr.ValueScope=Fv});var $e=F(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.or=Ne.and=Ne.not=Ne.CodeGen=Ne.operators=Ne.varKinds=Ne.ValueScopeName=Ne.ValueScope=Ne.Scope=Ne.Name=Ne.regexpCode=Ne.stringify=Ne.getProperty=Ne.nil=Ne.strConcat=Ne.str=Ne._=void 0;var Be=gc(),Fn=Lv(),Hs=gc();Object.defineProperty(Ne,"_",{enumerable:!0,get:function(){return Hs._}});Object.defineProperty(Ne,"str",{enumerable:!0,get:function(){return Hs.str}});Object.defineProperty(Ne,"strConcat",{enumerable:!0,get:function(){return Hs.strConcat}});Object.defineProperty(Ne,"nil",{enumerable:!0,get:function(){return Hs.nil}});Object.defineProperty(Ne,"getProperty",{enumerable:!0,get:function(){return Hs.getProperty}});Object.defineProperty(Ne,"stringify",{enumerable:!0,get:function(){return Hs.stringify}});Object.defineProperty(Ne,"regexpCode",{enumerable:!0,get:function(){return Hs.regexpCode}});Object.defineProperty(Ne,"Name",{enumerable:!0,get:function(){return Hs.Name}});var Fh=Lv();Object.defineProperty(Ne,"Scope",{enumerable:!0,get:function(){return Fh.Scope}});Object.defineProperty(Ne,"ValueScope",{enumerable:!0,get:function(){return Fh.ValueScope}});Object.defineProperty(Ne,"ValueScopeName",{enumerable:!0,get:function(){return Fh.ValueScopeName}});Object.defineProperty(Ne,"varKinds",{enumerable:!0,get:function(){return Fh.varKinds}});Ne.operators={GT:new Be._Code(">"),GTE:new Be._Code(">="),LT:new Be._Code("<"),LTE:new Be._Code("<="),EQ:new Be._Code("==="),NEQ:new Be._Code("!=="),NOT:new Be._Code("!"),OR:new Be._Code("||"),AND:new Be._Code("&&"),ADD:new Be._Code("+")};var Ki=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},jv=class extends Ki{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?Fn.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=wl(this.rhs,e,t)),this}get names(){return this.rhs instanceof Be._CodeOrName?this.rhs.names:{}}},Mh=class extends Ki{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof Be.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=wl(this.rhs,e,t),this}get names(){let e=this.lhs instanceof Be.Name?{}:{...this.lhs.names};return Dh(e,this.rhs)}},Uv=class extends Mh{constructor(e,t,n,i){super(e,n,i),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Bv=class extends Ki{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Hv=class extends Ki{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Vv=class extends Ki{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Wv=class extends Ki{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=wl(this.code,e,t),this}get names(){return this.code instanceof Be._CodeOrName?this.code.names:{}}},yc=class extends Ki{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,i=n.length;for(;i--;){let s=n[i];s.optimizeNames(e,t)||(dD(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Wo(e,t.names),{})}},Gi=class extends yc{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Yv=class extends yc{},_l=class extends Gi{};_l.kind="else";var Ho=class r extends Gi{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let n=t.optimizeNodes();t=this.else=Array.isArray(n)?new _l(n):n}if(t)return e===!1?t instanceof r?t:t.nodes:this.nodes.length?this:new r(fE(e),t instanceof r?[t]:t.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!!(super.optimizeNames(e,t)||this.else))return this.condition=wl(this.condition,e,t),this}get names(){let e=super.names;return Dh(e,this.condition),this.else&&Wo(e,this.else.names),e}};Ho.kind="if";var Vo=class extends Gi{};Vo.kind="for";var Jv=class extends Vo{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=wl(this.iteration,e,t),this}get names(){return Wo(super.names,this.iteration.names)}},zv=class extends Vo{constructor(e,t,n,i){super(),this.varKind=e,this.name=t,this.from=n,this.to=i}render(e){let t=e.es5?Fn.varKinds.var:this.varKind,{name:n,from:i,to:s}=this;return`for(${t} ${n}=${i}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Dh(super.names,this.from);return Dh(e,this.to)}},$h=class extends Vo{constructor(e,t,n,i){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=wl(this.iterable,e,t),this}get names(){return Wo(super.names,this.iterable.names)}},vc=class extends Gi{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};vc.kind="func";var Sc=class extends yc{render(e){return"return "+super.render(e)}};Sc.kind="return";var Kv=class extends Gi{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var n,i;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(i=this.finally)===null||i===void 0||i.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&Wo(e,this.catch.names),this.finally&&Wo(e,this.finally.names),e}},bc=class extends Gi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};bc.kind="catch";var _c=class extends Gi{render(e){return"finally"+super.render(e)}};_c.kind="finally";var Gv=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
24
|
-
`:""},this._extScope=e,this._scope=new Fn.Scope({parent:e}),this._nodes=[new Yv]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,i){let s=this._scope.toName(t);return n!==void 0&&i&&(this._constants[s.str]=n),this._leafNode(new jv(e,s,n)),s}const(e,t,n){return this._def(Fn.varKinds.const,e,t,n)}let(e,t,n){return this._def(Fn.varKinds.let,e,t,n)}var(e,t,n){return this._def(Fn.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new Mh(e,t,n))}add(e,t){return this._leafNode(new Uv(e,Ne.operators.ADD,t))}code(e){return typeof e=="function"?e():e!==Be.nil&&this._leafNode(new Wv(e)),this}object(...e){let t=["{"];for(let[n,i]of e)t.length>1&&t.push(","),t.push(n),(n!==i||this.opts.es5)&&(t.push(":"),(0,Be.addCodeArg)(t,i));return t.push("}"),new Be._Code(t)}if(e,t,n){if(this._blockNode(new Ho(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Ho(e))}else(){return this._elseNode(new _l)}endIf(){return this._endBlockNode(Ho,_l)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new Jv(e),t)}forRange(e,t,n,i,s=this.opts.es5?Fn.varKinds.var:Fn.varKinds.let){let a=this._scope.toName(e);return this._for(new zv(s,a,t,n),()=>i(a))}forOf(e,t,n,i=Fn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let a=t instanceof Be.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,Be._)`${a}.length`,u=>{this.var(s,(0,Be._)`${a}[${u}]`),n(s)})}return this._for(new $h("of",i,s,t),()=>n(s))}forIn(e,t,n,i=this.opts.es5?Fn.varKinds.var:Fn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Be._)`Object.keys(${t})`,n);let s=this._scope.toName(e);return this._for(new $h("in",i,s,t),()=>n(s))}endFor(){return this._endBlockNode(Vo)}label(e){return this._leafNode(new Bv(e))}break(e){return this._leafNode(new Hv(e))}return(e){let t=new Sc;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Sc)}try(e,t,n){if(!t&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Kv;if(this._blockNode(i),this.code(e),t){let s=this.name("e");this._currNode=i.catch=new bc(s),t(s)}return n&&(this._currNode=i.finally=new _c,this.code(n)),this._endBlockNode(bc,_c)}throw(e){return this._leafNode(new Vv(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=Be.nil,n,i){return this._blockNode(new vc(e,t,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(vc)}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,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof Ho))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};Ne.CodeGen=Gv;function Wo(r,e){for(let t in e)r[t]=(r[t]||0)+(e[t]||0);return r}function Dh(r,e){return e instanceof Be._CodeOrName?Wo(r,e.names):r}function wl(r,e,t){if(r instanceof Be.Name)return n(r);if(!i(r))return r;return new Be._Code(r._items.reduce((s,a)=>(a instanceof Be.Name&&(a=n(a)),a instanceof Be._Code?s.push(...a._items):s.push(a),s),[]));function n(s){let a=t[s.str];return a===void 0||e[s.str]!==1?s:(delete e[s.str],a)}function i(s){return s instanceof Be._Code&&s._items.some(a=>a instanceof Be.Name&&e[a.str]===1&&t[a.str]!==void 0)}}function dD(r,e){for(let t in e)r[t]=(r[t]||0)-(e[t]||0)}function fE(r){return typeof r=="boolean"||typeof r=="number"||r===null?!r:(0,Be._)`!${Qv(r)}`}Ne.not=fE;var hD=dE(Ne.operators.AND);function pD(...r){return r.reduce(hD)}Ne.and=pD;var mD=dE(Ne.operators.OR);function gD(...r){return r.reduce(mD)}Ne.or=gD;function dE(r){return(e,t)=>e===Be.nil?t:t===Be.nil?e:(0,Be._)`${Qv(e)} ${r} ${Qv(t)}`}function Qv(r){return r instanceof Be.Name?r:(0,Be._)`(${r})`}});var ze=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.checkStrictMode=De.getErrorPath=De.Type=De.useFunc=De.setEvaluated=De.evaluatedPropsToName=De.mergeEvaluated=De.eachItem=De.unescapeJsonPointer=De.escapeJsonPointer=De.escapeFragment=De.unescapeFragment=De.schemaRefOrVal=De.schemaHasRulesButRef=De.schemaHasRules=De.checkUnknownRules=De.alwaysValidSchema=De.toHash=void 0;var ct=$e(),yD=gc();function vD(r){let e={};for(let t of r)e[t]=!0;return e}De.toHash=vD;function SD(r,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(mE(r,e),!gE(e,r.self.RULES.all))}De.alwaysValidSchema=SD;function mE(r,e=r.schema){let{opts:t,self:n}=r;if(!t.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let s in e)i[s]||SE(r,`unknown keyword: "${s}"`)}De.checkUnknownRules=mE;function gE(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(e[t])return!0;return!1}De.schemaHasRules=gE;function bD(r,e){if(typeof r=="boolean")return!r;for(let t in r)if(t!=="$ref"&&e.all[t])return!0;return!1}De.schemaHasRulesButRef=bD;function _D({topSchemaRef:r,schemaPath:e},t,n,i){if(!i){if(typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="string")return(0,ct._)`${t}`}return(0,ct._)`${r}${e}${(0,ct.getProperty)(n)}`}De.schemaRefOrVal=_D;function wD(r){return yE(decodeURIComponent(r))}De.unescapeFragment=wD;function CD(r){return encodeURIComponent(Xv(r))}De.escapeFragment=CD;function Xv(r){return typeof r=="number"?`${r}`:r.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=Xv;function yE(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=yE;function ED(r,e){if(Array.isArray(r))for(let t of r)e(t);else e(r)}De.eachItem=ED;function hE({mergeNames:r,mergeToName:e,mergeValues:t,resultToName:n}){return(i,s,a,u)=>{let f=a===void 0?s:a instanceof ct.Name?(s instanceof ct.Name?r(i,s,a):e(i,s,a),a):s instanceof ct.Name?(e(i,a,s),s):t(s,a);return u===ct.Name&&!(f instanceof ct.Name)?n(i,f):f}}De.mergeEvaluated={props:hE({mergeNames:(r,e,t)=>r.if((0,ct._)`${t} !== true && ${e} !== undefined`,()=>{r.if((0,ct._)`${e} === true`,()=>r.assign(t,!0),()=>r.assign(t,(0,ct._)`${t} || {}`).code((0,ct._)`Object.assign(${t}, ${e})`))}),mergeToName:(r,e,t)=>r.if((0,ct._)`${t} !== true`,()=>{e===!0?r.assign(t,!0):(r.assign(t,(0,ct._)`${t} || {}`),eS(r,t,e))}),mergeValues:(r,e)=>r===!0?!0:{...r,...e},resultToName:vE}),items:hE({mergeNames:(r,e,t)=>r.if((0,ct._)`${t} !== true && ${e} !== undefined`,()=>r.assign(t,(0,ct._)`${e} === true ? true : ${t} > ${e} ? ${t} : ${e}`)),mergeToName:(r,e,t)=>r.if((0,ct._)`${t} !== true`,()=>r.assign(t,e===!0?!0:(0,ct._)`${t} > ${e} ? ${t} : ${e}`)),mergeValues:(r,e)=>r===!0?!0:Math.max(r,e),resultToName:(r,e)=>r.var("items",e)})};function vE(r,e){if(e===!0)return r.var("props",!0);let t=r.var("props",(0,ct._)`{}`);return e!==void 0&&eS(r,t,e),t}De.evaluatedPropsToName=vE;function eS(r,e,t){Object.keys(t).forEach(n=>r.assign((0,ct._)`${e}${(0,ct.getProperty)(n)}`,!0))}De.setEvaluated=eS;var pE={};function xD(r,e){return r.scopeValue("func",{ref:e,code:pE[e.code]||(pE[e.code]=new yD._Code(e.code))})}De.useFunc=xD;var Zv;(function(r){r[r.Num=0]="Num",r[r.Str=1]="Str"})(Zv||(De.Type=Zv={}));function RD(r,e,t){if(r instanceof ct.Name){let n=e===Zv.Num;return t?n?(0,ct._)`"[" + ${r} + "]"`:(0,ct._)`"['" + ${r} + "']"`:n?(0,ct._)`"/" + ${r}`:(0,ct._)`"/" + ${r}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return t?(0,ct.getProperty)(r).toString():"/"+Xv(r)}De.getErrorPath=RD;function SE(r,e,t=r.opts.strictSchema){if(t){if(e=`strict mode: ${e}`,t===!0)throw new Error(e);r.self.logger.warn(e)}}De.checkStrictMode=SE});var Qi=F(tS=>{"use strict";Object.defineProperty(tS,"__esModule",{value:!0});var ir=$e(),ID={data:new ir.Name("data"),valCxt:new ir.Name("valCxt"),instancePath:new ir.Name("instancePath"),parentData:new ir.Name("parentData"),parentDataProperty:new ir.Name("parentDataProperty"),rootData:new ir.Name("rootData"),dynamicAnchors:new ir.Name("dynamicAnchors"),vErrors:new ir.Name("vErrors"),errors:new ir.Name("errors"),this:new ir.Name("this"),self:new ir.Name("self"),scope:new ir.Name("scope"),json:new ir.Name("json"),jsonPos:new ir.Name("jsonPos"),jsonLen:new ir.Name("jsonLen"),jsonPart:new ir.Name("jsonPart")};tS.default=ID});var wc=F(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.extendErrors=sr.resetErrorsCount=sr.reportExtraError=sr.reportError=sr.keyword$DataError=sr.keywordError=void 0;var Ve=$e(),Lh=ze(),gr=Qi();sr.keywordError={message:({keyword:r})=>(0,Ve.str)`must pass "${r}" keyword validation`};sr.keyword$DataError={message:({keyword:r,schemaType:e})=>e?(0,Ve.str)`"${r}" keyword must be ${e} ($data)`:(0,Ve.str)`"${r}" keyword is invalid ($data)`};function OD(r,e=sr.keywordError,t,n){let{it:i}=r,{gen:s,compositeRule:a,allErrors:u}=i,f=wE(r,e,t);n??(a||u)?bE(s,f):_E(i,(0,Ve._)`[${f}]`)}sr.reportError=OD;function PD(r,e=sr.keywordError,t){let{it:n}=r,{gen:i,compositeRule:s,allErrors:a}=n,u=wE(r,e,t);bE(i,u),s||a||_E(n,gr.default.vErrors)}sr.reportExtraError=PD;function kD(r,e){r.assign(gr.default.errors,e),r.if((0,Ve._)`${gr.default.vErrors} !== null`,()=>r.if(e,()=>r.assign((0,Ve._)`${gr.default.vErrors}.length`,e),()=>r.assign(gr.default.vErrors,null)))}sr.resetErrorsCount=kD;function AD({gen:r,keyword:e,schemaValue:t,data:n,errsCount:i,it:s}){if(i===void 0)throw new Error("ajv implementation error");let a=r.name("err");r.forRange("i",i,gr.default.errors,u=>{r.const(a,(0,Ve._)`${gr.default.vErrors}[${u}]`),r.if((0,Ve._)`${a}.instancePath === undefined`,()=>r.assign((0,Ve._)`${a}.instancePath`,(0,Ve.strConcat)(gr.default.instancePath,s.errorPath))),r.assign((0,Ve._)`${a}.schemaPath`,(0,Ve.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(r.assign((0,Ve._)`${a}.schema`,t),r.assign((0,Ve._)`${a}.data`,n))})}sr.extendErrors=AD;function bE(r,e){let t=r.const("err",e);r.if((0,Ve._)`${gr.default.vErrors} === null`,()=>r.assign(gr.default.vErrors,(0,Ve._)`[${t}]`),(0,Ve._)`${gr.default.vErrors}.push(${t})`),r.code((0,Ve._)`${gr.default.errors}++`)}function _E(r,e){let{gen:t,validateName:n,schemaEnv:i}=r;i.$async?t.throw((0,Ve._)`new ${r.ValidationError}(${e})`):(t.assign((0,Ve._)`${n}.errors`,e),t.return(!1))}var Yo={keyword:new Ve.Name("keyword"),schemaPath:new Ve.Name("schemaPath"),params:new Ve.Name("params"),propertyName:new Ve.Name("propertyName"),message:new Ve.Name("message"),schema:new Ve.Name("schema"),parentSchema:new Ve.Name("parentSchema")};function wE(r,e,t){let{createErrors:n}=r.it;return n===!1?(0,Ve._)`{}`:TD(r,e,t)}function TD(r,e,t={}){let{gen:n,it:i}=r,s=[qD(i,t),ND(r,t)];return MD(r,e,s),n.object(...s)}function qD({errorPath:r},{instancePath:e}){let t=e?(0,Ve.str)`${r}${(0,Lh.getErrorPath)(e,Lh.Type.Str)}`:r;return[gr.default.instancePath,(0,Ve.strConcat)(gr.default.instancePath,t)]}function ND({keyword:r,it:{errSchemaPath:e}},{schemaPath:t,parentSchema:n}){let i=n?e:(0,Ve.str)`${e}/${r}`;return t&&(i=(0,Ve.str)`${i}${(0,Lh.getErrorPath)(t,Lh.Type.Str)}`),[Yo.schemaPath,i]}function MD(r,{params:e,message:t},n){let{keyword:i,data:s,schemaValue:a,it:u}=r,{opts:f,propertyName:h,topSchemaRef:m,schemaPath:g}=u;n.push([Yo.keyword,i],[Yo.params,typeof e=="function"?e(r):e||(0,Ve._)`{}`]),f.messages&&n.push([Yo.message,typeof t=="function"?t(r):t]),f.verbose&&n.push([Yo.schema,a],[Yo.parentSchema,(0,Ve._)`${m}${g}`],[gr.default.data,s]),h&&n.push([Yo.propertyName,h])}});var EE=F(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.boolOrEmptySchema=Cl.topBoolOrEmptySchema=void 0;var $D=wc(),DD=$e(),FD=Qi(),LD={message:"boolean schema is false"};function jD(r){let{gen:e,schema:t,validateName:n}=r;t===!1?CE(r,!1):typeof t=="object"&&t.$async===!0?e.return(FD.default.data):(e.assign((0,DD._)`${n}.errors`,null),e.return(!0))}Cl.topBoolOrEmptySchema=jD;function UD(r,e){let{gen:t,schema:n}=r;n===!1?(t.var(e,!1),CE(r)):t.var(e,!0)}Cl.boolOrEmptySchema=UD;function CE(r,e){let{gen:t,data:n}=r,i={gen:t,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:r};(0,$D.reportError)(i,LD,void 0,e)}});var rS=F(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.getRules=El.isJSONType=void 0;var BD=["string","number","integer","boolean","null","object","array"],HD=new Set(BD);function VD(r){return typeof r=="string"&&HD.has(r)}El.isJSONType=VD;function WD(){let r={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...r,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},r.number,r.string,r.array,r.object],post:{rules:[]},all:{},keywords:{}}}El.getRules=WD});var nS=F(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.shouldUseRule=Vs.shouldUseGroup=Vs.schemaHasRulesForType=void 0;function YD({schema:r,self:e},t){let n=e.RULES.types[t];return n&&n!==!0&&xE(r,n)}Vs.schemaHasRulesForType=YD;function xE(r,e){return e.rules.some(t=>RE(r,t))}Vs.shouldUseGroup=xE;function RE(r,e){var t;return r[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(n=>r[n]!==void 0))}Vs.shouldUseRule=RE});var Cc=F(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.reportTypeError=or.checkDataTypes=or.checkDataType=or.coerceAndCheckDataType=or.getJSONTypes=or.getSchemaTypes=or.DataType=void 0;var JD=rS(),zD=nS(),KD=wc(),Re=$e(),IE=ze(),xl;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(xl||(or.DataType=xl={}));function GD(r){let e=OE(r.type);if(e.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&e.push("null")}return e}or.getSchemaTypes=GD;function OE(r){let e=Array.isArray(r)?r:r?[r]:[];if(e.every(JD.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}or.getJSONTypes=OE;function QD(r,e){let{gen:t,data:n,opts:i}=r,s=ZD(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,zD.schemaHasRulesForType)(r,e[0]));if(a){let u=sS(e,n,i.strictNumbers,xl.Wrong);t.if(u,()=>{s.length?XD(r,e,s):oS(r)})}return a}or.coerceAndCheckDataType=QD;var PE=new Set(["string","number","integer","boolean","null"]);function ZD(r,e){return e?r.filter(t=>PE.has(t)||e==="array"&&t==="array"):[]}function XD(r,e,t){let{gen:n,data:i,opts:s}=r,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(sS(e,i,s.strictNumbers),()=>n.assign(u,i))),n.if((0,Re._)`${u} !== undefined`);for(let h of t)(PE.has(h)||h==="array"&&s.coerceTypes==="array")&&f(h);n.else(),oS(r),n.endIf(),n.if((0,Re._)`${u} !== undefined`,()=>{n.assign(i,u),eF(r,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
|
-
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(u,(0,
|
|
26
|
-
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(u,(0,
|
|
27
|
-
|| ${a} === "boolean" || ${i} === null`).assign(u,(0,Re._)`[${i}]`)}}}function eF({gen:r,parentData:e,parentDataProperty:t},n){r.if((0,Re._)`${e} !== undefined`,()=>r.assign((0,Re._)`${e}[${t}]`,n))}function iS(r,e,t,n=xl.Correct){let i=n===xl.Correct?Re.operators.EQ:Re.operators.NEQ,s;switch(r){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} ${r}`}return n===xl.Correct?s:(0,Re.not)(s);function a(u=Re.nil){return(0,Re.and)((0,Re._)`typeof ${e} == "number"`,u,t?(0,Re._)`isFinite(${e})`:Re.nil)}}or.checkDataType=iS;function sS(r,e,t,n){if(r.length===1)return iS(r[0],e,t,n);let i,s=(0,IE.toHash)(r);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,iS(a,e,t,n));return i}or.checkDataTypes=sS;var tF={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:e})=>typeof r=="string"?(0,Re._)`{type: ${r}}`:(0,Re._)`{type: ${e}}`};function oS(r){let e=rF(r);(0,KD.reportError)(e,tF)}or.reportTypeError=oS;function rF(r){let{gen:e,data:t,schema:n}=r,i=(0,IE.schemaRefOrVal)(r,n,"type");return{gen:e,keyword:"type",data:t,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:r}}});var AE=F(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.assignDefaults=void 0;var Rl=$e(),nF=ze();function iF(r,e){let{properties:t,items:n}=r.schema;if(e==="object"&&t)for(let i in t)kE(r,i,t[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>kE(r,s,i.default))}jh.assignDefaults=iF;function kE(r,e,t){let{gen:n,compositeRule:i,data:s,opts:a}=r;if(t===void 0)return;let u=(0,Rl._)`${s}${(0,Rl.getProperty)(e)}`;if(i){(0,nF.checkStrictMode)(r,`default is ignored for: ${u}`);return}let f=(0,Rl._)`${u} === undefined`;a.useDefaults==="empty"&&(f=(0,Rl._)`${f} || ${u} === null || ${u} === ""`),n.if(f,(0,Rl._)`${u} = ${(0,Rl.stringify)(t)}`)}});var hn=F(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.validateUnion=at.validateArray=at.usePattern=at.callValidateCode=at.schemaProperties=at.allSchemaProperties=at.noPropertyInData=at.propertyInData=at.isOwnProperty=at.hasPropFunc=at.reportMissingProp=at.checkMissingProp=at.checkReportMissingProp=void 0;var ht=$e(),aS=ze(),Ws=Qi(),sF=ze();function oF(r,e){let{gen:t,data:n,it:i}=r;t.if(uS(t,n,e,i.opts.ownProperties),()=>{r.setParams({missingProperty:(0,ht._)`${e}`},!0),r.error()})}at.checkReportMissingProp=oF;function aF({gen:r,data:e,it:{opts:t}},n,i){return(0,ht.or)(...n.map(s=>(0,ht.and)(uS(r,e,s,t.ownProperties),(0,ht._)`${i} = ${s}`)))}at.checkMissingProp=aF;function lF(r,e){r.setParams({missingProperty:e},!0),r.error()}at.reportMissingProp=lF;function TE(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ht._)`Object.prototype.hasOwnProperty`})}at.hasPropFunc=TE;function lS(r,e,t){return(0,ht._)`${TE(r)}.call(${e}, ${t})`}at.isOwnProperty=lS;function uF(r,e,t,n){let i=(0,ht._)`${e}${(0,ht.getProperty)(t)} !== undefined`;return n?(0,ht._)`${i} && ${lS(r,e,t)}`:i}at.propertyInData=uF;function uS(r,e,t,n){let i=(0,ht._)`${e}${(0,ht.getProperty)(t)} === undefined`;return n?(0,ht.or)(i,(0,ht.not)(lS(r,e,t))):i}at.noPropertyInData=uS;function qE(r){return r?Object.keys(r).filter(e=>e!=="__proto__"):[]}at.allSchemaProperties=qE;function cF(r,e){return qE(e).filter(t=>!(0,aS.alwaysValidSchema)(r,e[t]))}at.schemaProperties=cF;function fF({schemaCode:r,data:e,it:{gen:t,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},u,f,h){let m=h?(0,ht._)`${r}, ${e}, ${n}${i}`:e,g=[[Ws.default.instancePath,(0,ht.strConcat)(Ws.default.instancePath,s)],[Ws.default.parentData,a.parentData],[Ws.default.parentDataProperty,a.parentDataProperty],[Ws.default.rootData,Ws.default.rootData]];a.opts.dynamicRef&&g.push([Ws.default.dynamicAnchors,Ws.default.dynamicAnchors]);let S=(0,ht._)`${m}, ${t.object(...g)}`;return f!==ht.nil?(0,ht._)`${u}.call(${f}, ${S})`:(0,ht._)`${u}(${S})`}at.callValidateCode=fF;var dF=(0,ht._)`new RegExp`;function hF({gen:r,it:{opts:e}},t){let n=e.unicodeRegExp?"u":"",{regExp:i}=e.code,s=i(t,n);return r.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,ht._)`${i.code==="new RegExp"?dF:(0,sF.useFunc)(r,i)}(${t}, ${n})`})}at.usePattern=hF;function pF(r){let{gen:e,data:t,keyword:n,it:i}=r,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,ht._)`${t}.length`);e.forRange("i",0,f,h=>{r.subschema({keyword:n,dataProp:h,dataPropType:aS.Type.Num},s),e.if((0,ht.not)(s),u)})}}at.validateArray=pF;function mF(r){let{gen:e,schema:t,keyword:n,it:i}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(f=>(0,aS.alwaysValidSchema)(i,f))&&!i.opts.unevaluated)return;let a=e.let("valid",!1),u=e.name("_valid");e.block(()=>t.forEach((f,h)=>{let m=r.subschema({keyword:n,schemaProp:h,compositeRule:!0},u);e.assign(a,(0,ht._)`${a} || ${u}`),r.mergeValidEvaluated(m,u)||e.if((0,ht.not)(a))})),r.result(a,()=>r.reset(),()=>r.error(!0))}at.validateUnion=mF});var $E=F(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.validateKeywordUsage=bi.validSchemaType=bi.funcKeywordCode=bi.macroKeywordCode=void 0;var yr=$e(),Jo=Qi(),gF=hn(),yF=wc();function vF(r,e){let{gen:t,keyword:n,schema:i,parentSchema:s,it:a}=r,u=e.macro.call(a.self,i,s,a),f=ME(t,n,u);a.opts.validateSchema!==!1&&a.self.validateSchema(u,!0);let h=t.name("valid");r.subschema({schema:u,schemaPath:yr.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},h),r.pass(h,()=>r.error(!0))}bi.macroKeywordCode=vF;function SF(r,e){var t;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:u,it:f}=r;_F(f,e);let h=!u&&e.compile?e.compile.call(f.self,s,a,f):e.validate,m=ME(n,i,h),g=n.let("valid");r.block$data(g,S),r.ok((t=e.valid)!==null&&t!==void 0?t:g);function S(){if(e.errors===!1)x(),e.modifying&&NE(r),A(()=>r.error());else{let q=e.async?E():C();e.modifying&&NE(r),A(()=>bF(r,q))}}function E(){let q=n.let("ruleErrs",null);return n.try(()=>x((0,yr._)`await `),j=>n.assign(g,!1).if((0,yr._)`${j} instanceof ${f.ValidationError}`,()=>n.assign(q,(0,yr._)`${j}.errors`),()=>n.throw(j))),q}function C(){let q=(0,yr._)`${m}.errors`;return n.assign(q,null),x(yr.nil),q}function x(q=e.async?(0,yr._)`await `:yr.nil){let j=f.opts.passContext?Jo.default.this:Jo.default.self,Y=!("compile"in e&&!u||e.schema===!1);n.assign(g,(0,yr._)`${q}${(0,gF.callValidateCode)(r,m,j,Y)}`,e.modifying)}function A(q){var j;n.if((0,yr.not)((j=e.valid)!==null&&j!==void 0?j:g),q)}}bi.funcKeywordCode=SF;function NE(r){let{gen:e,data:t,it:n}=r;e.if(n.parentData,()=>e.assign(t,(0,yr._)`${n.parentData}[${n.parentDataProperty}]`))}function bF(r,e){let{gen:t}=r;t.if((0,yr._)`Array.isArray(${e})`,()=>{t.assign(Jo.default.vErrors,(0,yr._)`${Jo.default.vErrors} === null ? ${e} : ${Jo.default.vErrors}.concat(${e})`).assign(Jo.default.errors,(0,yr._)`${Jo.default.vErrors}.length`),(0,yF.extendErrors)(r)},()=>r.error())}function _F({schemaEnv:r},e){if(e.async&&!r.$async)throw new Error("async keyword in sync schema")}function ME(r,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return r.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,yr.stringify)(t)})}function wF(r,e,t=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(r):n==="object"?r&&typeof r=="object"&&!Array.isArray(r):typeof r==n||t&&typeof r>"u")}bi.validSchemaType=wF;function CF({schema:r,opts:e,self:t,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(r,u)))throw new Error(`parent schema must have dependencies of ${s}: ${a.join(",")}`);if(i.validateSchema&&!i.validateSchema(r[s])){let f=`keyword "${s}" value is invalid at path "${n}": `+t.errorsText(i.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(f);else throw new Error(f)}}bi.validateKeywordUsage=CF});var FE=F(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.extendSubschemaMode=Ys.extendSubschemaData=Ys.getSubschema=void 0;var _i=$e(),DE=ze();function EF(r,{keyword:e,schemaProp:t,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=r.schema[e];return t===void 0?{schema:u,schemaPath:(0,_i._)`${r.schemaPath}${(0,_i.getProperty)(e)}`,errSchemaPath:`${r.errSchemaPath}/${e}`}:{schema:u[t],schemaPath:(0,_i._)`${r.schemaPath}${(0,_i.getProperty)(e)}${(0,_i.getProperty)(t)}`,errSchemaPath:`${r.errSchemaPath}/${e}/${(0,DE.escapeFragment)(t)}`}}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')}Ys.getSubschema=EF;function xF(r,e,{dataProp:t,dataPropType:n,data:i,dataTypes:s,propertyName:a}){if(i!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:u}=e;if(t!==void 0){let{errorPath:h,dataPathArr:m,opts:g}=e,S=u.let("data",(0,_i._)`${e.data}${(0,_i.getProperty)(t)}`,!0);f(S),r.errorPath=(0,_i.str)`${h}${(0,DE.getErrorPath)(t,n,g.jsPropertySyntax)}`,r.parentDataProperty=(0,_i._)`${t}`,r.dataPathArr=[...m,r.parentDataProperty]}if(i!==void 0){let h=i instanceof _i.Name?i:u.let("data",i,!0);f(h),a!==void 0&&(r.propertyName=a)}s&&(r.dataTypes=s);function f(h){r.data=h,r.dataLevel=e.dataLevel+1,r.dataTypes=[],e.definedProperties=new Set,r.parentData=e.data,r.dataNames=[...e.dataNames,h]}}Ys.extendSubschemaData=xF;function RF(r,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:n,createErrors:i,allErrors:s}){n!==void 0&&(r.compositeRule=n),i!==void 0&&(r.createErrors=i),s!==void 0&&(r.allErrors=s),r.jtdDiscriminator=e,r.jtdMetadata=t}Ys.extendSubschemaMode=RF});var cS=F((q6,LE)=>{"use strict";LE.exports=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,i,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!r(e[i],t[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[i]))return!1;for(i=n;i--!==0;){var a=s[i];if(!r(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}});var UE=F((N6,jE)=>{"use strict";var Js=jE.exports=function(r,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var n=typeof t=="function"?t:t.pre||function(){},i=t.post||function(){};Uh(e,n,i,r,"",r)};Js.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Js.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Js.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Js.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 Uh(r,e,t,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 m in n){var g=n[m];if(Array.isArray(g)){if(m in Js.arrayKeywords)for(var S=0;S<g.length;S++)Uh(r,e,t,g[S],i+"/"+m+"/"+S,s,i,m,n,S)}else if(m in Js.propsKeywords){if(g&&typeof g=="object")for(var E in g)Uh(r,e,t,g[E],i+"/"+m+"/"+IF(E),s,i,m,n,E)}else(m in Js.keywords||r.allKeys&&!(m in Js.skipKeywords))&&Uh(r,e,t,g,i+"/"+m,s,i,m,n)}t(n,i,s,a,u,f,h)}}function IF(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}});var Ec=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 OF=ze(),PF=cS(),kF=UE(),AF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function TF(r,e=!0){return typeof r=="boolean"?!0:e===!0?!fS(r):e?BE(r)<=e:!1}Ar.inlineRef=TF;var qF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function fS(r){for(let e in r){if(qF.has(e))return!0;let t=r[e];if(Array.isArray(t)&&t.some(fS)||typeof t=="object"&&fS(t))return!0}return!1}function BE(r){let e=0;for(let t in r){if(t==="$ref")return 1/0;if(e++,!AF.has(t)&&(typeof r[t]=="object"&&(0,OF.eachItem)(r[t],n=>e+=BE(n)),e===1/0))return 1/0}return e}function HE(r,e="",t){t!==!1&&(e=Il(e));let n=r.parse(e);return VE(r,n)}Ar.getFullPath=HE;function VE(r,e){return r.serialize(e).split("#")[0]+"#"}Ar._getFullPath=VE;var NF=/#\/?$/;function Il(r){return r?r.replace(NF,""):""}Ar.normalizeId=Il;function MF(r,e,t){return t=Il(t),r.resolve(e,t)}Ar.resolveUrl=MF;var $F=/^[a-z_][-a-z0-9._]*$/i;function DF(r,e){if(typeof r=="boolean")return{};let{schemaId:t,uriResolver:n}=this.opts,i=Il(r[t]||e),s={"":i},a=HE(n,i,!1),u={},f=new Set;return kF(r,{allKeys:!0},(g,S,E,C)=>{if(C===void 0)return;let x=a+S,A=s[C];typeof g[t]=="string"&&(A=q.call(this,g[t])),j.call(this,g.$anchor),j.call(this,g.$dynamicAnchor),s[S]=A;function q(Y){let V=this.opts.uriResolver.resolve;if(Y=Il(A?V(A,Y):Y),f.has(Y))throw m(Y);f.add(Y);let K=this.refs[Y];return typeof K=="string"&&(K=this.refs[K]),typeof K=="object"?h(g,K.schema,Y):Y!==Il(x)&&(Y[0]==="#"?(h(g,u[Y],Y),u[Y]=g):this.refs[Y]=x),Y}function j(Y){if(typeof Y=="string"){if(!$F.test(Y))throw new Error(`invalid anchor "${Y}"`);q.call(this,`#${Y}`)}}}),u;function h(g,S,E){if(S!==void 0&&!PF(g,S))throw m(E)}function m(g){return new Error(`reference "${g}" resolves to more than one schema`)}}Ar.getSchemaRefs=DF});var Ic=F(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.getData=zs.KeywordCxt=zs.validateFunctionCode=void 0;var KE=EE(),WE=Cc(),hS=nS(),Bh=Cc(),FF=AE(),Rc=$E(),dS=FE(),ce=$e(),be=Qi(),LF=Ec(),Zi=ze(),xc=wc();function jF(r){if(ZE(r)&&(XE(r),QE(r))){HF(r);return}GE(r,()=>(0,KE.topBoolOrEmptySchema)(r))}zs.validateFunctionCode=jF;function GE({gen:r,validateName:e,schema:t,schemaEnv:n,opts:i},s){i.code.es5?r.func(e,(0,ce._)`${be.default.data}, ${be.default.valCxt}`,n.$async,()=>{r.code((0,ce._)`"use strict"; ${YE(t,i)}`),BF(r,i),r.code(s)}):r.func(e,(0,ce._)`${be.default.data}, ${UF(i)}`,n.$async,()=>r.code(YE(t,i)).code(s))}function UF(r){return(0,ce._)`{${be.default.instancePath}="", ${be.default.parentData}, ${be.default.parentDataProperty}, ${be.default.rootData}=${be.default.data}${r.dynamicRef?(0,ce._)`, ${be.default.dynamicAnchors}={}`:ce.nil}}={}`}function BF(r,e){r.if(be.default.valCxt,()=>{r.var(be.default.instancePath,(0,ce._)`${be.default.valCxt}.${be.default.instancePath}`),r.var(be.default.parentData,(0,ce._)`${be.default.valCxt}.${be.default.parentData}`),r.var(be.default.parentDataProperty,(0,ce._)`${be.default.valCxt}.${be.default.parentDataProperty}`),r.var(be.default.rootData,(0,ce._)`${be.default.valCxt}.${be.default.rootData}`),e.dynamicRef&&r.var(be.default.dynamicAnchors,(0,ce._)`${be.default.valCxt}.${be.default.dynamicAnchors}`)},()=>{r.var(be.default.instancePath,(0,ce._)`""`),r.var(be.default.parentData,(0,ce._)`undefined`),r.var(be.default.parentDataProperty,(0,ce._)`undefined`),r.var(be.default.rootData,be.default.data),e.dynamicRef&&r.var(be.default.dynamicAnchors,(0,ce._)`{}`)})}function HF(r){let{schema:e,opts:t,gen:n}=r;GE(r,()=>{t.$comment&&e.$comment&&tx(r),zF(r),n.let(be.default.vErrors,null),n.let(be.default.errors,0),t.unevaluated&&VF(r),ex(r),QF(r)})}function VF(r){let{gen:e,validateName:t}=r;r.evaluated=e.const("evaluated",(0,ce._)`${t}.evaluated`),e.if((0,ce._)`${r.evaluated}.dynamicProps`,()=>e.assign((0,ce._)`${r.evaluated}.props`,(0,ce._)`undefined`)),e.if((0,ce._)`${r.evaluated}.dynamicItems`,()=>e.assign((0,ce._)`${r.evaluated}.items`,(0,ce._)`undefined`))}function YE(r,e){let t=typeof r=="object"&&r[e.schemaId];return t&&(e.code.source||e.code.process)?(0,ce._)`/*# sourceURL=${t} */`:ce.nil}function WF(r,e){if(ZE(r)&&(XE(r),QE(r))){YF(r,e);return}(0,KE.boolOrEmptySchema)(r,e)}function QE({schema:r,self:e}){if(typeof r=="boolean")return!r;for(let t in r)if(e.RULES.all[t])return!0;return!1}function ZE(r){return typeof r.schema!="boolean"}function YF(r,e){let{schema:t,gen:n,opts:i}=r;i.$comment&&t.$comment&&tx(r),KF(r),GF(r);let s=n.const("_errs",be.default.errors);ex(r,s),n.var(e,(0,ce._)`${s} === ${be.default.errors}`)}function XE(r){(0,Zi.checkUnknownRules)(r),JF(r)}function ex(r,e){if(r.opts.jtd)return JE(r,[],!1,e);let t=(0,WE.getSchemaTypes)(r.schema),n=(0,WE.coerceAndCheckDataType)(r,t);JE(r,t,!n,e)}function JF(r){let{schema:e,errSchemaPath:t,opts:n,self:i}=r;e.$ref&&n.ignoreKeywordsWithRef&&(0,Zi.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function zF(r){let{schema:e,opts:t}=r;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,Zi.checkStrictMode)(r,"default is ignored in the schema root")}function KF(r){let e=r.schema[r.opts.schemaId];e&&(r.baseId=(0,LF.resolveUrl)(r.opts.uriResolver,r.baseId,e))}function GF(r){if(r.schema.$async&&!r.schemaEnv.$async)throw new Error("async schema in sync schema")}function tx({gen:r,schemaEnv:e,schema:t,errSchemaPath:n,opts:i}){let s=t.$comment;if(i.$comment===!0)r.code((0,ce._)`${be.default.self}.logger.log(${s})`);else if(typeof i.$comment=="function"){let a=(0,ce.str)`${n}/$comment`,u=r.scopeValue("root",{ref:e.root});r.code((0,ce._)`${be.default.self}.opts.$comment(${s}, ${a}, ${u}.schema)`)}}function QF(r){let{gen:e,schemaEnv:t,validateName:n,ValidationError:i,opts:s}=r;t.$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&&ZF(r),e.return((0,ce._)`${be.default.errors} === 0`))}function ZF({gen:r,evaluated:e,props:t,items:n}){t instanceof ce.Name&&r.assign((0,ce._)`${e}.props`,t),n instanceof ce.Name&&r.assign((0,ce._)`${e}.items`,n)}function JE(r,e,t,n){let{gen:i,schema:s,data:a,allErrors:u,opts:f,self:h}=r,{RULES:m}=h;if(s.$ref&&(f.ignoreKeywordsWithRef||!(0,Zi.schemaHasRulesButRef)(s,m))){i.block(()=>nx(r,"$ref",m.all.$ref.definition));return}f.jtd||XF(r,e),i.block(()=>{for(let S of m.rules)g(S);g(m.post)});function g(S){(0,hS.shouldUseGroup)(s,S)&&(S.type?(i.if((0,Bh.checkDataType)(S.type,a,f.strictNumbers)),zE(r,S),e.length===1&&e[0]===S.type&&t&&(i.else(),(0,Bh.reportTypeError)(r)),i.endIf()):zE(r,S),u||i.if((0,ce._)`${be.default.errors} === ${n||0}`))}}function zE(r,e){let{gen:t,schema:n,opts:{useDefaults:i}}=r;i&&(0,FF.assignDefaults)(r,e.type),t.block(()=>{for(let s of e.rules)(0,hS.shouldUseRule)(n,s)&&nx(r,s.keyword,s.definition,e.type)})}function XF(r,e){r.schemaEnv.meta||!r.opts.strictTypes||(eL(r,e),r.opts.allowUnionTypes||tL(r,e),rL(r,r.dataTypes))}function eL(r,e){if(e.length){if(!r.dataTypes.length){r.dataTypes=e;return}e.forEach(t=>{rx(r.dataTypes,t)||pS(r,`type "${t}" not allowed by context "${r.dataTypes.join(",")}"`)}),iL(r,e)}}function tL(r,e){e.length>1&&!(e.length===2&&e.includes("null"))&&pS(r,"use allowUnionTypes to allow union type keyword")}function rL(r,e){let t=r.self.RULES.all;for(let n in t){let i=t[n];if(typeof i=="object"&&(0,hS.shouldUseRule)(r.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>nL(e,a))&&pS(r,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function nL(r,e){return r.includes(e)||e==="number"&&r.includes("integer")}function rx(r,e){return r.includes(e)||e==="integer"&&r.includes("number")}function iL(r,e){let t=[];for(let n of r.dataTypes)rx(e,n)?t.push(n):e.includes("integer")&&n==="number"&&t.push("integer");r.dataTypes=t}function pS(r,e){let t=r.schemaEnv.baseId+r.errSchemaPath;e+=` at "${t}" (strictTypes)`,(0,Zi.checkStrictMode)(r,e,r.opts.strictTypes)}var Hh=class{constructor(e,t,n){if((0,Rc.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Zi.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",ix(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Rc.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const("_errs",be.default.errors))}result(e,t,n){this.failResult((0,ce.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,ce.not)(e),void 0,t)}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:t}=this;this.fail((0,ce._)`${t} !== undefined && (${(0,ce.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?xc.reportExtraError:xc.reportError)(this,this.def.error,t)}$dataError(){(0,xc.reportError)(this,this.def.$dataError||xc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,xc.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=ce.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=ce.nil,t=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`,t)),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:t,schemaType:n,def:i,it:s}=this;return(0,ce.or)(a(),u());function a(){if(n.length){if(!(t instanceof ce.Name))throw new Error("ajv implementation error");let f=Array.isArray(n)?n:[n];return(0,ce._)`${(0,Bh.checkDataTypes)(f,t,s.opts.strictNumbers,Bh.DataType.Wrong)}`}return ce.nil}function u(){if(i.validateSchema){let f=e.scopeValue("validate$data",{ref:i.validateSchema});return(0,ce._)`!${f}(${t})`}return ce.nil}}subschema(e,t){let n=(0,dS.getSubschema)(this.it,e);(0,dS.extendSubschemaData)(n,this.it,e),(0,dS.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return WF(i,t),i}mergeEvaluated(e,t){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Zi.mergeEvaluated.props(i,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=Zi.mergeEvaluated.items(i,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:i}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return i.if(t,()=>this.mergeEvaluated(e,ce.Name)),!0}};zs.KeywordCxt=Hh;function nx(r,e,t,n){let i=new Hh(r,t,e);"code"in t?t.code(i,n):i.$data&&t.validate?(0,Rc.funcKeywordCode)(i,t):"macro"in t?(0,Rc.macroKeywordCode)(i,t):(t.compile||t.validate)&&(0,Rc.funcKeywordCode)(i,t)}var sL=/^\/(?:[^~]|~0|~1)*$/,oL=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ix(r,{dataLevel:e,dataNames:t,dataPathArr:n}){let i,s;if(r==="")return be.default.rootData;if(r[0]==="/"){if(!sL.test(r))throw new Error(`Invalid JSON-pointer: ${r}`);i=r,s=be.default.rootData}else{let h=oL.exec(r);if(!h)throw new Error(`Invalid JSON-pointer: ${r}`);let m=+h[1];if(i=h[2],i==="#"){if(m>=e)throw new Error(f("property/index",m));return n[e-m]}if(m>e)throw new Error(f("data",m));if(s=t[e-m],!i)return s}let a=s,u=i.split("/");for(let h of u)h&&(s=(0,ce._)`${s}${(0,ce.getProperty)((0,Zi.unescapeJsonPointer)(h))}`,a=(0,ce._)`${a} && ${s}`);return a;function f(h,m){return`Cannot access ${h} ${m} levels up, current level is ${e}`}}zs.getData=ix});var Vh=F(gS=>{"use strict";Object.defineProperty(gS,"__esModule",{value:!0});var mS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};gS.default=mS});var Oc=F(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});var yS=Ec(),vS=class extends Error{constructor(e,t,n,i){super(i||`can't resolve reference ${n} from id ${t}`),this.missingRef=(0,yS.resolveUrl)(e,t,n),this.missingSchema=(0,yS.normalizeId)((0,yS.getFullPath)(e,this.missingRef))}};SS.default=vS});var Yh=F(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.resolveSchema=pn.getCompilingSchema=pn.resolveRef=pn.compileSchema=pn.SchemaEnv=void 0;var Ln=$e(),aL=Vh(),zo=Qi(),jn=Ec(),sx=ze(),lL=Ic(),Ol=class{constructor(e){var t;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=(t=e.baseId)!==null&&t!==void 0?t:(0,jn.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};pn.SchemaEnv=Ol;function _S(r){let e=ox.call(this,r);if(e)return e;let t=(0,jn.getFullPath)(this.opts.uriResolver,r.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Ln.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),u;r.$async&&(u=a.scopeValue("Error",{ref:aL.default,code:(0,Ln._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");r.validateName=f;let h={gen:a,allErrors:this.opts.allErrors,data:zo.default.data,parentData:zo.default.parentData,parentDataProperty:zo.default.parentDataProperty,dataNames:[zo.default.data],dataPathArr:[Ln.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:r.schema,code:(0,Ln.stringify)(r.schema)}:{ref:r.schema}),validateName:f,ValidationError:u,schema:r.schema,schemaEnv:r,rootId:t,baseId:r.baseId||t,schemaPath:Ln.nil,errSchemaPath:r.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ln._)`""`,opts:this.opts,self:this},m;try{this._compilations.add(r),(0,lL.validateFunctionCode)(h),a.optimize(this.opts.code.optimize);let g=a.toString();m=`${a.scopeRefs(zo.default.scope)}return ${g}`,this.opts.code.process&&(m=this.opts.code.process(m,r));let E=new Function(`${zo.default.self}`,`${zo.default.scope}`,m)(this,this.scope.get());if(this.scope.value(f,{ref:E}),E.errors=null,E.schema=r.schema,E.schemaEnv=r,r.$async&&(E.$async=!0),this.opts.code.source===!0&&(E.source={validateName:f,validateCode:g,scopeValues:a._values}),this.opts.unevaluated){let{props:C,items:x}=h;E.evaluated={props:C instanceof Ln.Name?void 0:C,items:x instanceof Ln.Name?void 0:x,dynamicProps:C instanceof Ln.Name,dynamicItems:x instanceof Ln.Name},E.source&&(E.source.evaluated=(0,Ln.stringify)(E.evaluated))}return r.validate=E,r}catch(g){throw delete r.validate,delete r.validateName,m&&this.logger.error("Error compiling schema, function code:",m),g}finally{this._compilations.delete(r)}}pn.compileSchema=_S;function uL(r,e,t){var n;t=(0,jn.resolveUrl)(this.opts.uriResolver,e,t);let i=r.refs[t];if(i)return i;let s=dL.call(this,r,t);if(s===void 0){let a=(n=r.localRefs)===null||n===void 0?void 0:n[t],{schemaId:u}=this.opts;a&&(s=new Ol({schema:a,schemaId:u,root:r,baseId:e}))}if(s!==void 0)return r.refs[t]=cL.call(this,s)}pn.resolveRef=uL;function cL(r){return(0,jn.inlineRef)(r.schema,this.opts.inlineRefs)?r.schema:r.validate?r:_S.call(this,r)}function ox(r){for(let e of this._compilations)if(fL(e,r))return e}pn.getCompilingSchema=ox;function fL(r,e){return r.schema===e.schema&&r.root===e.root&&r.baseId===e.baseId}function dL(r,e){let t;for(;typeof(t=this.refs[e])=="string";)e=t;return t||this.schemas[e]||Wh.call(this,r,e)}function Wh(r,e){let t=this.opts.uriResolver.parse(e),n=(0,jn._getFullPath)(this.opts.uriResolver,t),i=(0,jn.getFullPath)(this.opts.uriResolver,r.baseId,void 0);if(Object.keys(r.schema).length>0&&n===i)return bS.call(this,t,r);let s=(0,jn.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let u=Wh.call(this,r,a);return typeof u?.schema!="object"?void 0:bS.call(this,t,u)}if(typeof a?.schema=="object"){if(a.validate||_S.call(this,a),s===(0,jn.normalizeId)(e)){let{schema:u}=a,{schemaId:f}=this.opts,h=u[f];return h&&(i=(0,jn.resolveUrl)(this.opts.uriResolver,i,h)),new Ol({schema:u,schemaId:f,root:r,baseId:i})}return bS.call(this,t,a)}}pn.resolveSchema=Wh;var hL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function bS(r,{baseId:e,schema:t,root:n}){var i;if(((i=r.fragment)===null||i===void 0?void 0:i[0])!=="/")return;for(let u of r.fragment.slice(1).split("/")){if(typeof t=="boolean")return;let f=t[(0,sx.unescapeFragment)(u)];if(f===void 0)return;t=f;let h=typeof t=="object"&&t[this.opts.schemaId];!hL.has(u)&&h&&(e=(0,jn.resolveUrl)(this.opts.uriResolver,e,h))}let s;if(typeof t!="boolean"&&t.$ref&&!(0,sx.schemaHasRulesButRef)(t,this.RULES)){let u=(0,jn.resolveUrl)(this.opts.uriResolver,e,t.$ref);s=Wh.call(this,n,u)}let{schemaId:a}=this.opts;if(s=s||new Ol({schema:t,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var ax=F((j6,pL)=>{pL.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 CS=F((U6,fx)=>{"use strict";var mL=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),ux=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 wS(r){let e="",t=0,n=0;for(n=0;n<r.length;n++)if(t=r[n].charCodeAt(0),t!==48){if(!(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102))return"";e+=r[n];break}for(n+=1;n<r.length;n++){if(t=r[n].charCodeAt(0),!(t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102))return"";e+=r[n]}return e}var gL=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function lx(r){return r.length=0,!0}function yL(r,e,t){if(r.length){let n=wS(r);if(n!=="")e.push(n);else return t.error=!0,!1;r.length=0}return!0}function vL(r){let e=0,t={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,u=yL;for(let f=0;f<r.length;f++){let h=r[f];if(!(h==="["||h==="]"))if(h===":"){if(s===!0&&(a=!0),!u(i,n,t))break;if(++e>7){t.error=!0;break}f>0&&r[f-1]===":"&&(s=!0),n.push(":");continue}else if(h==="%"){if(!u(i,n,t))break;u=lx}else{i.push(h);continue}}return i.length&&(u===lx?t.zone=i.join(""):a?n.push(i.join("")):n.push(wS(i))),t.address=n.join(""),t}function cx(r){if(SL(r,":")<2)return{host:r,isIPV6:!1};let e=vL(r);if(e.error)return{host:r,isIPV6:!1};{let t=e.address,n=e.address;return e.zone&&(t+="%"+e.zone,n+="%25"+e.zone),{host:t,isIPV6:!0,escapedHost:n}}}function SL(r,e){let t=0;for(let n=0;n<r.length;n++)r[n]===e&&t++;return t}function bL(r){let e=r,t=[],n=-1,i=0;for(;i=e.length;){if(i===1){if(e===".")break;if(e==="/"){t.push("/");break}else{t.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]==="/")){t.push("/");break}}else if(i===3&&e==="/.."){t.length!==0&&t.pop(),t.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),t.length!==0&&t.pop();continue}}if((n=e.indexOf("/",1))===-1){t.push(e);break}else t.push(e.slice(0,n)),e=e.slice(n)}return t.join("")}function _L(r,e){let t=e!==!0?escape:unescape;return r.scheme!==void 0&&(r.scheme=t(r.scheme)),r.userinfo!==void 0&&(r.userinfo=t(r.userinfo)),r.host!==void 0&&(r.host=t(r.host)),r.path!==void 0&&(r.path=t(r.path)),r.query!==void 0&&(r.query=t(r.query)),r.fragment!==void 0&&(r.fragment=t(r.fragment)),r}function wL(r){let e=[];if(r.userinfo!==void 0&&(e.push(r.userinfo),e.push("@")),r.host!==void 0){let t=unescape(r.host);if(!ux(t)){let n=cx(t);n.isIPV6===!0?t=`[${n.escapedHost}]`:t=r.host}e.push(t)}return(typeof r.port=="number"||typeof r.port=="string")&&(e.push(":"),e.push(String(r.port))),e.length?e.join(""):void 0}fx.exports={nonSimpleDomain:gL,recomposeAuthority:wL,normalizeComponentEncoding:_L,removeDotSegments:bL,isIPv4:ux,isUUID:mL,normalizeIPv6:cx,stringArrayToHexStripped:wS}});var gx=F((B6,mx)=>{"use strict";var{isUUID:CL}=CS(),EL=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,xL=["http","https","ws","wss","urn","urn:uuid"];function RL(r){return xL.indexOf(r)!==-1}function ES(r){return r.secure===!0?!0:r.secure===!1?!1:r.scheme?r.scheme.length===3&&(r.scheme[0]==="w"||r.scheme[0]==="W")&&(r.scheme[1]==="s"||r.scheme[1]==="S")&&(r.scheme[2]==="s"||r.scheme[2]==="S"):!1}function dx(r){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r}function hx(r){let e=String(r.scheme).toLowerCase()==="https";return(r.port===(e?443:80)||r.port==="")&&(r.port=void 0),r.path||(r.path="/"),r}function IL(r){return r.secure=ES(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r}function OL(r){if((r.port===(ES(r)?443:80)||r.port==="")&&(r.port=void 0),typeof r.secure=="boolean"&&(r.scheme=r.secure?"wss":"ws",r.secure=void 0),r.resourceName){let[e,t]=r.resourceName.split("?");r.path=e&&e!=="/"?e:void 0,r.query=t,r.resourceName=void 0}return r.fragment=void 0,r}function PL(r,e){if(!r.path)return r.error="URN can not be parsed",r;let t=r.path.match(EL);if(t){let n=e.scheme||r.scheme||"urn";r.nid=t[1].toLowerCase(),r.nss=t[2];let i=`${n}:${e.nid||r.nid}`,s=xS(i);r.path=void 0,s&&(r=s.parse(r,e))}else r.error=r.error||"URN can not be parsed.";return r}function kL(r,e){if(r.nid===void 0)throw new Error("URN without nid cannot be serialized");let t=e.scheme||r.scheme||"urn",n=r.nid.toLowerCase(),i=`${t}:${e.nid||n}`,s=xS(i);s&&(r=s.serialize(r,e));let a=r,u=r.nss;return a.path=`${n||e.nid}:${u}`,e.skipEscape=!0,a}function AL(r,e){let t=r;return t.uuid=t.nss,t.nss=void 0,!e.tolerant&&(!t.uuid||!CL(t.uuid))&&(t.error=t.error||"UUID is not valid."),t}function TL(r){let e=r;return e.nss=(r.uuid||"").toLowerCase(),e}var px={scheme:"http",domainHost:!0,parse:dx,serialize:hx},qL={scheme:"https",domainHost:px.domainHost,parse:dx,serialize:hx},Jh={scheme:"ws",domainHost:!0,parse:IL,serialize:OL},NL={scheme:"wss",domainHost:Jh.domainHost,parse:Jh.parse,serialize:Jh.serialize},ML={scheme:"urn",parse:PL,serialize:kL,skipNormalize:!0},$L={scheme:"urn:uuid",parse:AL,serialize:TL,skipNormalize:!0},zh={http:px,https:qL,ws:Jh,wss:NL,urn:ML,"urn:uuid":$L};Object.setPrototypeOf(zh,null);function xS(r){return r&&(zh[r]||zh[r.toLowerCase()])||void 0}mx.exports={wsIsSecure:ES,SCHEMES:zh,isValidSchemeName:RL,getSchemeHandler:xS}});var Sx=F((H6,Gh)=>{"use strict";var{normalizeIPv6:DL,removeDotSegments:Pc,recomposeAuthority:FL,normalizeComponentEncoding:Kh,isIPv4:LL,nonSimpleDomain:jL}=CS(),{SCHEMES:UL,getSchemeHandler:yx}=gx();function BL(r,e){return typeof r=="string"?r=wi(Xi(r,e),e):typeof r=="object"&&(r=Xi(wi(r,e),e)),r}function HL(r,e,t){let n=t?Object.assign({scheme:"null"},t):{scheme:"null"},i=vx(Xi(r,n),Xi(e,n),n,!0);return n.skipEscape=!0,wi(i,n)}function vx(r,e,t,n){let i={};return n||(r=Xi(wi(r,t),t),e=Xi(wi(e,t),t)),t=t||{},!t.tolerant&&e.scheme?(i.scheme=e.scheme,i.userinfo=e.userinfo,i.host=e.host,i.port=e.port,i.path=Pc(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=Pc(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Pc(e.path):((r.userinfo!==void 0||r.host!==void 0||r.port!==void 0)&&!r.path?i.path="/"+e.path:r.path?i.path=r.path.slice(0,r.path.lastIndexOf("/")+1)+e.path:i.path=e.path,i.path=Pc(i.path)),i.query=e.query):(i.path=r.path,e.query!==void 0?i.query=e.query:i.query=r.query),i.userinfo=r.userinfo,i.host=r.host,i.port=r.port),i.scheme=r.scheme),i.fragment=e.fragment,i}function VL(r,e,t){return typeof r=="string"?(r=unescape(r),r=wi(Kh(Xi(r,t),!0),{...t,skipEscape:!0})):typeof r=="object"&&(r=wi(Kh(r,!0),{...t,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=wi(Kh(Xi(e,t),!0),{...t,skipEscape:!0})):typeof e=="object"&&(e=wi(Kh(e,!0),{...t,skipEscape:!0})),r.toLowerCase()===e.toLowerCase()}function wi(r,e){let t={host:r.host,scheme:r.scheme,userinfo:r.userinfo,port:r.port,path:r.path,query:r.query,nid:r.nid,nss:r.nss,uuid:r.uuid,fragment:r.fragment,reference:r.reference,resourceName:r.resourceName,secure:r.secure,error:""},n=Object.assign({},e),i=[],s=yx(n.scheme||t.scheme);s&&s.serialize&&s.serialize(t,n),t.path!==void 0&&(n.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),n.reference!=="suffix"&&t.scheme&&i.push(t.scheme,":");let a=FL(t);if(a!==void 0&&(n.reference!=="suffix"&&i.push("//"),i.push(a),t.path&&t.path[0]!=="/"&&i.push("/")),t.path!==void 0){let u=t.path;!n.absolutePath&&(!s||!s.absolutePath)&&(u=Pc(u)),a===void 0&&u[0]==="/"&&u[1]==="/"&&(u="/%2F"+u.slice(2)),i.push(u)}return t.query!==void 0&&i.push("?",t.query),t.fragment!==void 0&&i.push("#",t.fragment),i.join("")}var WL=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Xi(r,e){let t=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},i=!1;t.reference==="suffix"&&(t.scheme?r=t.scheme+":"+r:r="//"+r);let s=r.match(WL);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(LL(n.host)===!1){let f=DL(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",t.reference&&t.reference!=="suffix"&&t.reference!==n.reference&&(n.error=n.error||"URI is not a "+t.reference+" reference.");let a=yx(t.scheme||n.scheme);if(!t.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(t.domainHost||a&&a.domainHost)&&i===!1&&jL(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)&&(r.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,t)}else n.error=n.error||"URI can not be parsed.";return n}var RS={SCHEMES:UL,normalize:BL,resolve:HL,resolveComponent:vx,equal:VL,serialize:wi,parse:Xi};Gh.exports=RS;Gh.exports.default=RS;Gh.exports.fastUri=RS});var _x=F(IS=>{"use strict";Object.defineProperty(IS,"__esModule",{value:!0});var bx=Sx();bx.code='require("ajv/dist/runtime/uri").default';IS.default=bx});var Px=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 YL=Ic();Object.defineProperty(Qt,"KeywordCxt",{enumerable:!0,get:function(){return YL.KeywordCxt}});var Pl=$e();Object.defineProperty(Qt,"_",{enumerable:!0,get:function(){return Pl._}});Object.defineProperty(Qt,"str",{enumerable:!0,get:function(){return Pl.str}});Object.defineProperty(Qt,"stringify",{enumerable:!0,get:function(){return Pl.stringify}});Object.defineProperty(Qt,"nil",{enumerable:!0,get:function(){return Pl.nil}});Object.defineProperty(Qt,"Name",{enumerable:!0,get:function(){return Pl.Name}});Object.defineProperty(Qt,"CodeGen",{enumerable:!0,get:function(){return Pl.CodeGen}});var JL=Vh(),Rx=Oc(),zL=rS(),kc=Yh(),KL=$e(),Ac=Ec(),Qh=Cc(),PS=ze(),wx=ax(),GL=_x(),Ix=(r,e)=>new RegExp(r,e);Ix.code="new RegExp";var QL=["removeAdditional","useDefaults","coerceTypes"],ZL=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),XL={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."},ej={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Cx=200;function tj(r){var e,t,n,i,s,a,u,f,h,m,g,S,E,C,x,A,q,j,Y,V,K,ee,k,w,P;let $=r.strict,D=(e=r.code)===null||e===void 0?void 0:e.optimize,L=D===!0||D===void 0?1:D||0,z=(n=(t=r.code)===null||t===void 0?void 0:t.regExp)!==null&&n!==void 0?n:Ix,Z=(i=r.uriResolver)!==null&&i!==void 0?i:GL.default;return{strictSchema:(a=(s=r.strictSchema)!==null&&s!==void 0?s:$)!==null&&a!==void 0?a:!0,strictNumbers:(f=(u=r.strictNumbers)!==null&&u!==void 0?u:$)!==null&&f!==void 0?f:!0,strictTypes:(m=(h=r.strictTypes)!==null&&h!==void 0?h:$)!==null&&m!==void 0?m:"log",strictTuples:(S=(g=r.strictTuples)!==null&&g!==void 0?g:$)!==null&&S!==void 0?S:"log",strictRequired:(C=(E=r.strictRequired)!==null&&E!==void 0?E:$)!==null&&C!==void 0?C:!1,code:r.code?{...r.code,optimize:L,regExp:z}:{optimize:L,regExp:z},loopRequired:(x=r.loopRequired)!==null&&x!==void 0?x:Cx,loopEnum:(A=r.loopEnum)!==null&&A!==void 0?A:Cx,meta:(q=r.meta)!==null&&q!==void 0?q:!0,messages:(j=r.messages)!==null&&j!==void 0?j:!0,inlineRefs:(Y=r.inlineRefs)!==null&&Y!==void 0?Y:!0,schemaId:(V=r.schemaId)!==null&&V!==void 0?V:"$id",addUsedSchema:(K=r.addUsedSchema)!==null&&K!==void 0?K:!0,validateSchema:(ee=r.validateSchema)!==null&&ee!==void 0?ee:!0,validateFormats:(k=r.validateFormats)!==null&&k!==void 0?k:!0,unicodeRegExp:(w=r.unicodeRegExp)!==null&&w!==void 0?w:!0,int32range:(P=r.int32range)!==null&&P!==void 0?P:!0,uriResolver:Z}}var Tc=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...tj(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new KL.ValueScope({scope:{},prefixes:ZL,es5:t,lines:n}),this.logger=aj(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,zL.getRules)(),Ex.call(this,XL,e,"NOT SUPPORTED"),Ex.call(this,ej,e,"DEPRECATED","warn"),this._metaOpts=sj.call(this),e.formats&&nj.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&ij.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),rj.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,i=wx;n==="id"&&(i={...wx},i.id=i.$id,delete i.$id),t&&e&&this.addMetaSchema(i,i[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){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(t);return"$async"in n||(this.errors=n.errors),i}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){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,t);async function i(m,g){await s.call(this,m.$schema);let S=this._addSchema(m,g);return S.validate||a.call(this,S)}async function s(m){m&&!this.getSchema(m)&&await i.call(this,{$ref:m},!0)}async function a(m){try{return this._compileSchemaEnv(m)}catch(g){if(!(g instanceof Rx.default))throw g;return u.call(this,g),await f.call(this,g.missingSchema),a.call(this,m)}}function u({missingSchema:m,missingRef:g}){if(this.refs[m])throw new Error(`AnySchema ${m} is loaded but ${g} cannot be resolved`)}async function f(m){let g=await h.call(this,m);this.refs[m]||await s.call(this,g.$schema),this.refs[m]||this.addSchema(g,m,t)}async function h(m){let g=this._loading[m];if(g)return g;try{return await(this._loading[m]=n(m))}finally{delete this._loading[m]}}}addSchema(e,t,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 t=(0,Ac.normalizeId)(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,i,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){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&&t){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 t;for(;typeof(t=xx.call(this,e))=="string";)e=t;if(t===void 0){let{schemaId:n}=this.opts,i=new kc.SchemaEnv({schema:{},schemaId:n});if(t=kc.resolveSchema.call(this,i,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}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 t=xx.call(this,e);return typeof t=="object"&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,Ac.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e=="string")n=e,typeof t=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=n);else if(typeof e=="object"&&t===void 0){if(t=e,n=t.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(uj.call(this,n,t),!t)return(0,PS.eachItem)(n,s=>OS.call(this,s)),this;fj.call(this,t);let i={...t,type:(0,Qh.getJSONTypes)(t.type),schemaType:(0,Qh.getJSONTypes)(t.schemaType)};return(0,PS.eachItem)(n,i.type.length===0?s=>OS.call(this,s,i):s=>i.type.forEach(a=>OS.call(this,s,i,a))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let i=n.rules.findIndex(s=>s.keyword===e);i>=0&&n.rules.splice(i,1)}return this}addFormat(e,t){return typeof t=="string"&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(i=>`${n}${i.instancePath} ${i.message}`).reduce((i,s)=>i+t+s)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let i of t){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,m=a[u];h&&m&&(a[u]=Ox(m))}}return e}_removeAllSchemas(e,t){for(let n in e){let i=e[n];(!t||t.test(n))&&(typeof i=="string"?delete e[n]:i&&!i.meta&&(this._cache.delete(i.schema),delete e[n]))}}_addSchema(e,t,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,Ac.normalizeId)(a||n);let h=Ac.getSchemaRefs.call(this,e,n);return f=new kc.SchemaEnv({schema:e,schemaId:u,meta:t,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):kc.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{kc.compileSchema.call(this,e)}finally{this.opts=t}}};Tc.ValidationError=JL.default;Tc.MissingRefError=Rx.default;Qt.default=Tc;function Ex(r,e,t,n="error"){for(let i in r){let s=i;s in e&&this.logger[n](`${t}: option ${i}. ${r[s]}`)}}function xx(r){return r=(0,Ac.normalizeId)(r),this.schemas[r]||this.refs[r]}function rj(){let r=this.opts.schemas;if(r)if(Array.isArray(r))this.addSchema(r);else for(let e in r)this.addSchema(r[e],e)}function nj(){for(let r in this.opts.formats){let e=this.opts.formats[r];e&&this.addFormat(r,e)}}function ij(r){if(Array.isArray(r)){this.addVocabulary(r);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in r){let t=r[e];t.keyword||(t.keyword=e),this.addKeyword(t)}}function sj(){let r={...this.opts};for(let e of QL)delete r[e];return r}var oj={log(){},warn(){},error(){}};function aj(r){if(r===!1)return oj;if(r===void 0)return console;if(r.log&&r.warn&&r.error)return r;throw new Error("logger must implement log, warn and error methods")}var lj=/^[a-z_$][a-z0-9_$:-]*$/i;function uj(r,e){let{RULES:t}=this;if((0,PS.eachItem)(r,n=>{if(t.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!lj.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 OS(r,e,t){var n;let i=e?.post;if(t&&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===t);if(a||(a={type:t,rules:[]},s.rules.push(a)),s.keywords[r]=!0,!e)return;let u={keyword:r,definition:{...e,type:(0,Qh.getJSONTypes)(e.type),schemaType:(0,Qh.getJSONTypes)(e.schemaType)}};e.before?cj.call(this,a,u,e.before):a.rules.push(u),s.all[r]=u,(n=e.implements)===null||n===void 0||n.forEach(f=>this.addKeyword(f))}function cj(r,e,t){let n=r.rules.findIndex(i=>i.keyword===t);n>=0?r.rules.splice(n,0,e):(r.rules.push(e),this.logger.warn(`rule ${t} is not defined`))}function fj(r){let{metaSchema:e}=r;e!==void 0&&(r.$data&&this.opts.$data&&(e=Ox(e)),r.validateSchema=this.compile(e,!0))}var dj={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Ox(r){return{anyOf:[r,dj]}}});var kx=F(kS=>{"use strict";Object.defineProperty(kS,"__esModule",{value:!0});var hj={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};kS.default=hj});var Nx=F(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.callRef=Ko.getValidate=void 0;var pj=Oc(),Ax=hn(),Tr=$e(),kl=Qi(),Tx=Yh(),Zh=ze(),mj={keyword:"$ref",schemaType:"string",code(r){let{gen:e,schema:t,it:n}=r,{baseId:i,schemaEnv:s,validateName:a,opts:u,self:f}=n,{root:h}=s;if((t==="#"||t==="#/")&&i===h.baseId)return g();let m=Tx.resolveRef.call(f,h,i,t);if(m===void 0)throw new pj.default(n.opts.uriResolver,i,t);if(m instanceof Tx.SchemaEnv)return S(m);return E(m);function g(){if(s===h)return Xh(r,a,s,s.$async);let C=e.scopeValue("root",{ref:h});return Xh(r,(0,Tr._)`${C}.validate`,h,h.$async)}function S(C){let x=qx(r,C);Xh(r,x,C,C.$async)}function E(C){let x=e.scopeValue("schema",u.code.source===!0?{ref:C,code:(0,Tr.stringify)(C)}:{ref:C}),A=e.name("valid"),q=r.subschema({schema:C,dataTypes:[],schemaPath:Tr.nil,topSchemaRef:x,errSchemaPath:t},A);r.mergeEvaluated(q),r.ok(A)}}};function qx(r,e){let{gen:t}=r;return e.validate?t.scopeValue("validate",{ref:e.validate}):(0,Tr._)`${t.scopeValue("wrapper",{ref:e})}.validate`}Ko.getValidate=qx;function Xh(r,e,t,n){let{gen:i,it:s}=r,{allErrors:a,schemaEnv:u,opts:f}=s,h=f.passContext?kl.default.this:Tr.nil;n?m():g();function m(){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,Ax.callValidateCode)(r,e,h)}`),E(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)}),r.ok(C)}function g(){r.result((0,Ax.callValidateCode)(r,e,h),()=>E(e),()=>S(e))}function S(C){let x=(0,Tr._)`${C}.errors`;i.assign(kl.default.vErrors,(0,Tr._)`${kl.default.vErrors} === null ? ${x} : ${kl.default.vErrors}.concat(${x})`),i.assign(kl.default.errors,(0,Tr._)`${kl.default.vErrors}.length`)}function E(C){var x;if(!s.opts.unevaluated)return;let A=(x=t?.validate)===null||x===void 0?void 0:x.evaluated;if(s.props!==!0)if(A&&!A.dynamicProps)A.props!==void 0&&(s.props=Zh.mergeEvaluated.props(i,A.props,s.props));else{let q=i.var("props",(0,Tr._)`${C}.evaluated.props`);s.props=Zh.mergeEvaluated.props(i,q,s.props,Tr.Name)}if(s.items!==!0)if(A&&!A.dynamicItems)A.items!==void 0&&(s.items=Zh.mergeEvaluated.items(i,A.items,s.items));else{let q=i.var("items",(0,Tr._)`${C}.evaluated.items`);s.items=Zh.mergeEvaluated.items(i,q,s.items,Tr.Name)}}}Ko.callRef=Xh;Ko.default=mj});var Mx=F(AS=>{"use strict";Object.defineProperty(AS,"__esModule",{value:!0});var gj=kx(),yj=Nx(),vj=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",gj.default,yj.default];AS.default=vj});var $x=F(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});var ep=$e(),Ks=ep.operators,tp={maximum:{okStr:"<=",ok:Ks.LTE,fail:Ks.GT},minimum:{okStr:">=",ok:Ks.GTE,fail:Ks.LT},exclusiveMaximum:{okStr:"<",ok:Ks.LT,fail:Ks.GTE},exclusiveMinimum:{okStr:">",ok:Ks.GT,fail:Ks.LTE}},Sj={message:({keyword:r,schemaCode:e})=>(0,ep.str)`must be ${tp[r].okStr} ${e}`,params:({keyword:r,schemaCode:e})=>(0,ep._)`{comparison: ${tp[r].okStr}, limit: ${e}}`},bj={keyword:Object.keys(tp),type:"number",schemaType:"number",$data:!0,error:Sj,code(r){let{keyword:e,data:t,schemaCode:n}=r;r.fail$data((0,ep._)`${t} ${tp[e].fail} ${n} || isNaN(${t})`)}};TS.default=bj});var Dx=F(qS=>{"use strict";Object.defineProperty(qS,"__esModule",{value:!0});var qc=$e(),_j={message:({schemaCode:r})=>(0,qc.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,qc._)`{multipleOf: ${r}}`},wj={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:_j,code(r){let{gen:e,data:t,schemaCode:n,it:i}=r,s=i.opts.multipleOfPrecision,a=e.let("res"),u=s?(0,qc._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,qc._)`${a} !== parseInt(${a})`;r.fail$data((0,qc._)`(${n} === 0 || (${a} = ${t}/${n}, ${u}))`)}};qS.default=wj});var Lx=F(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});function Fx(r){let e=r.length,t=0,n=0,i;for(;n<e;)t++,i=r.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=r.charCodeAt(n),(i&64512)===56320&&n++);return t}NS.default=Fx;Fx.code='require("ajv/dist/runtime/ucs2length").default'});var jx=F(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});var Go=$e(),Cj=ze(),Ej=Lx(),xj={message({keyword:r,schemaCode:e}){let t=r==="maxLength"?"more":"fewer";return(0,Go.str)`must NOT have ${t} than ${e} characters`},params:({schemaCode:r})=>(0,Go._)`{limit: ${r}}`},Rj={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:xj,code(r){let{keyword:e,data:t,schemaCode:n,it:i}=r,s=e==="maxLength"?Go.operators.GT:Go.operators.LT,a=i.opts.unicode===!1?(0,Go._)`${t}.length`:(0,Go._)`${(0,Cj.useFunc)(r.gen,Ej.default)}(${t})`;r.fail$data((0,Go._)`${a} ${s} ${n}`)}};MS.default=Rj});var Ux=F($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});var Ij=hn(),rp=$e(),Oj={message:({schemaCode:r})=>(0,rp.str)`must match pattern "${r}"`,params:({schemaCode:r})=>(0,rp._)`{pattern: ${r}}`},Pj={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Oj,code(r){let{data:e,$data:t,schema:n,schemaCode:i,it:s}=r,a=s.opts.unicodeRegExp?"u":"",u=t?(0,rp._)`(new RegExp(${i}, ${a}))`:(0,Ij.usePattern)(r,n);r.fail$data((0,rp._)`!${u}.test(${e})`)}};$S.default=Pj});var Bx=F(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var Nc=$e(),kj={message({keyword:r,schemaCode:e}){let t=r==="maxProperties"?"more":"fewer";return(0,Nc.str)`must NOT have ${t} than ${e} properties`},params:({schemaCode:r})=>(0,Nc._)`{limit: ${r}}`},Aj={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:kj,code(r){let{keyword:e,data:t,schemaCode:n}=r,i=e==="maxProperties"?Nc.operators.GT:Nc.operators.LT;r.fail$data((0,Nc._)`Object.keys(${t}).length ${i} ${n}`)}};DS.default=Aj});var Hx=F(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});var Mc=hn(),$c=$e(),Tj=ze(),qj={message:({params:{missingProperty:r}})=>(0,$c.str)`must have required property '${r}'`,params:({params:{missingProperty:r}})=>(0,$c._)`{missingProperty: ${r}}`},Nj={keyword:"required",type:"object",schemaType:"array",$data:!0,error:qj,code(r){let{gen:e,schema:t,schemaCode:n,data:i,$data:s,it:a}=r,{opts:u}=a;if(!s&&t.length===0)return;let f=t.length>=u.loopRequired;if(a.allErrors?h():m(),u.strictRequired){let E=r.parentSchema.properties,{definedProperties:C}=r.it;for(let x of t)if(E?.[x]===void 0&&!C.has(x)){let A=a.schemaEnv.baseId+a.errSchemaPath,q=`required property "${x}" is not defined at "${A}" (strictRequired)`;(0,Tj.checkStrictMode)(a,q,a.opts.strictRequired)}}function h(){if(f||s)r.block$data($c.nil,g);else for(let E of t)(0,Mc.checkReportMissingProp)(r,E)}function m(){let E=e.let("missing");if(f||s){let C=e.let("valid",!0);r.block$data(C,()=>S(E,C)),r.ok(C)}else e.if((0,Mc.checkMissingProp)(r,t,E)),(0,Mc.reportMissingProp)(r,E),e.else()}function g(){e.forOf("prop",n,E=>{r.setParams({missingProperty:E}),e.if((0,Mc.noPropertyInData)(e,i,E,u.ownProperties),()=>r.error())})}function S(E,C){r.setParams({missingProperty:E}),e.forOf(E,n,()=>{e.assign(C,(0,Mc.propertyInData)(e,i,E,u.ownProperties)),e.if((0,$c.not)(C),()=>{r.error(),e.break()})},$c.nil)}}};FS.default=Nj});var Vx=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var Dc=$e(),Mj={message({keyword:r,schemaCode:e}){let t=r==="maxItems"?"more":"fewer";return(0,Dc.str)`must NOT have ${t} than ${e} items`},params:({schemaCode:r})=>(0,Dc._)`{limit: ${r}}`},$j={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Mj,code(r){let{keyword:e,data:t,schemaCode:n}=r,i=e==="maxItems"?Dc.operators.GT:Dc.operators.LT;r.fail$data((0,Dc._)`${t}.length ${i} ${n}`)}};LS.default=$j});var np=F(jS=>{"use strict";Object.defineProperty(jS,"__esModule",{value:!0});var Wx=cS();Wx.code='require("ajv/dist/runtime/equal").default';jS.default=Wx});var Yx=F(BS=>{"use strict";Object.defineProperty(BS,"__esModule",{value:!0});var US=Cc(),Zt=$e(),Dj=ze(),Fj=np(),Lj={message:({params:{i:r,j:e}})=>(0,Zt.str)`must NOT have duplicate items (items ## ${e} and ${r} are identical)`,params:({params:{i:r,j:e}})=>(0,Zt._)`{i: ${r}, j: ${e}}`},jj={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Lj,code(r){let{gen:e,data:t,$data:n,schema:i,parentSchema:s,schemaCode:a,it:u}=r;if(!n&&!i)return;let f=e.let("valid"),h=s.items?(0,US.getSchemaTypes)(s.items):[];r.block$data(f,m,(0,Zt._)`${a} === false`),r.ok(f);function m(){let C=e.let("i",(0,Zt._)`${t}.length`),x=e.let("j");r.setParams({i:C,j:x}),e.assign(f,!0),e.if((0,Zt._)`${C} > 1`,()=>(g()?S:E)(C,x))}function g(){return h.length>0&&!h.some(C=>C==="object"||C==="array")}function S(C,x){let A=e.name("item"),q=(0,US.checkDataTypes)(h,A,u.opts.strictNumbers,US.DataType.Wrong),j=e.const("indices",(0,Zt._)`{}`);e.for((0,Zt._)`;${C}--;`,()=>{e.let(A,(0,Zt._)`${t}[${C}]`),e.if(q,(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}]`),r.error(),e.assign(f,!1).break()}).code((0,Zt._)`${j}[${A}] = ${C}`)})}function E(C,x){let A=(0,Dj.useFunc)(e,Fj.default),q=e.name("outer");e.label(q).for((0,Zt._)`;${C}--;`,()=>e.for((0,Zt._)`${x} = ${C}; ${x}--;`,()=>e.if((0,Zt._)`${A}(${t}[${C}], ${t}[${x}])`,()=>{r.error(),e.assign(f,!1).break(q)})))}}};BS.default=jj});var Jx=F(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var HS=$e(),Uj=ze(),Bj=np(),Hj={message:"must be equal to constant",params:({schemaCode:r})=>(0,HS._)`{allowedValue: ${r}}`},Vj={keyword:"const",$data:!0,error:Hj,code(r){let{gen:e,data:t,$data:n,schemaCode:i,schema:s}=r;n||s&&typeof s=="object"?r.fail$data((0,HS._)`!${(0,Uj.useFunc)(e,Bj.default)}(${t}, ${i})`):r.fail((0,HS._)`${s} !== ${t}`)}};VS.default=Vj});var zx=F(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});var Fc=$e(),Wj=ze(),Yj=np(),Jj={message:"must be equal to one of the allowed values",params:({schemaCode:r})=>(0,Fc._)`{allowedValues: ${r}}`},zj={keyword:"enum",schemaType:"array",$data:!0,error:Jj,code(r){let{gen:e,data:t,$data:n,schema:i,schemaCode:s,it:a}=r;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,Wj.useFunc)(e,Yj.default)),m;if(u||n)m=e.let("valid"),r.block$data(m,g);else{if(!Array.isArray(i))throw new Error("ajv implementation error");let E=e.const("vSchema",s);m=(0,Fc.or)(...i.map((C,x)=>S(E,x)))}r.pass(m);function g(){e.assign(m,!1),e.forOf("v",s,E=>e.if((0,Fc._)`${h()}(${t}, ${E})`,()=>e.assign(m,!0).break()))}function S(E,C){let x=i[C];return typeof x=="object"&&x!==null?(0,Fc._)`${h()}(${t}, ${E}[${C}])`:(0,Fc._)`${t} === ${x}`}}};WS.default=zj});var Kx=F(YS=>{"use strict";Object.defineProperty(YS,"__esModule",{value:!0});var Kj=$x(),Gj=Dx(),Qj=jx(),Zj=Ux(),Xj=Bx(),e2=Hx(),t2=Vx(),r2=Yx(),n2=Jx(),i2=zx(),s2=[Kj.default,Gj.default,Qj.default,Zj.default,Xj.default,e2.default,t2.default,r2.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},n2.default,i2.default];YS.default=s2});var zS=F(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.validateAdditionalItems=void 0;var Qo=$e(),JS=ze(),o2={message:({params:{len:r}})=>(0,Qo.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,Qo._)`{limit: ${r}}`},a2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:o2,code(r){let{parentSchema:e,it:t}=r,{items:n}=e;if(!Array.isArray(n)){(0,JS.checkStrictMode)(t,'"additionalItems" is ignored when "items" is not an array of schemas');return}Gx(r,n)}};function Gx(r,e){let{gen:t,schema:n,data:i,keyword:s,it:a}=r;a.items=!0;let u=t.const("len",(0,Qo._)`${i}.length`);if(n===!1)r.setParams({len:e.length}),r.pass((0,Qo._)`${u} <= ${e.length}`);else if(typeof n=="object"&&!(0,JS.alwaysValidSchema)(a,n)){let h=t.var("valid",(0,Qo._)`${u} <= ${e.length}`);t.if((0,Qo.not)(h),()=>f(h)),r.ok(h)}function f(h){t.forRange("i",e.length,u,m=>{r.subschema({keyword:s,dataProp:m,dataPropType:JS.Type.Num},h),a.allErrors||t.if((0,Qo.not)(h),()=>t.break())})}}Lc.validateAdditionalItems=Gx;Lc.default=a2});var KS=F(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.validateTuple=void 0;var Qx=$e(),ip=ze(),l2=hn(),u2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(r){let{schema:e,it:t}=r;if(Array.isArray(e))return Zx(r,"additionalItems",e);t.items=!0,!(0,ip.alwaysValidSchema)(t,e)&&r.ok((0,l2.validateArray)(r))}};function Zx(r,e,t=r.schema){let{gen:n,parentSchema:i,data:s,keyword:a,it:u}=r;m(i),u.opts.unevaluated&&t.length&&u.items!==!0&&(u.items=ip.mergeEvaluated.items(n,t.length,u.items));let f=n.name("valid"),h=n.const("len",(0,Qx._)`${s}.length`);t.forEach((g,S)=>{(0,ip.alwaysValidSchema)(u,g)||(n.if((0,Qx._)`${h} > ${S}`,()=>r.subschema({keyword:a,schemaProp:S,dataProp:S},f)),r.ok(f))});function m(g){let{opts:S,errSchemaPath:E}=u,C=t.length,x=C===g.minItems&&(C===g.maxItems||g[e]===!1);if(S.strictTuples&&!x){let A=`"${a}" is ${C}-tuple, but minItems or maxItems/${e} are not specified or different at path "${E}"`;(0,ip.checkStrictMode)(u,A,S.strictTuples)}}}jc.validateTuple=Zx;jc.default=u2});var Xx=F(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var c2=KS(),f2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,c2.validateTuple)(r,"items")};GS.default=f2});var tR=F(QS=>{"use strict";Object.defineProperty(QS,"__esModule",{value:!0});var eR=$e(),d2=ze(),h2=hn(),p2=zS(),m2={message:({params:{len:r}})=>(0,eR.str)`must NOT have more than ${r} items`,params:({params:{len:r}})=>(0,eR._)`{limit: ${r}}`},g2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:m2,code(r){let{schema:e,parentSchema:t,it:n}=r,{prefixItems:i}=t;n.items=!0,!(0,d2.alwaysValidSchema)(n,e)&&(i?(0,p2.validateAdditionalItems)(r,i):r.ok((0,h2.validateArray)(r)))}};QS.default=g2});var rR=F(ZS=>{"use strict";Object.defineProperty(ZS,"__esModule",{value:!0});var mn=$e(),sp=ze(),y2={message:({params:{min:r,max:e}})=>e===void 0?(0,mn.str)`must contain at least ${r} valid item(s)`:(0,mn.str)`must contain at least ${r} and no more than ${e} valid item(s)`,params:({params:{min:r,max:e}})=>e===void 0?(0,mn._)`{minContains: ${r}}`:(0,mn._)`{minContains: ${r}, maxContains: ${e}}`},v2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:y2,code(r){let{gen:e,schema:t,parentSchema:n,data:i,it:s}=r,a,u,{minContains:f,maxContains:h}=n;s.opts.next?(a=f===void 0?1:f,u=h):a=1;let m=e.const("len",(0,mn._)`${i}.length`);if(r.setParams({min:a,max:u}),u===void 0&&a===0){(0,sp.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(u!==void 0&&a>u){(0,sp.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),r.fail();return}if((0,sp.alwaysValidSchema)(s,t)){let x=(0,mn._)`${m} >= ${a}`;u!==void 0&&(x=(0,mn._)`${x} && ${m} <= ${u}`),r.pass(x);return}s.items=!0;let g=e.name("valid");u===void 0&&a===1?E(g,()=>e.if(g,()=>e.break())):a===0?(e.let(g,!0),u!==void 0&&e.if((0,mn._)`${i}.length > 0`,S)):(e.let(g,!1),S()),r.result(g,()=>r.reset());function S(){let x=e.name("_valid"),A=e.let("count",0);E(x,()=>e.if(x,()=>C(A)))}function E(x,A){e.forRange("i",0,m,q=>{r.subschema({keyword:"contains",dataProp:q,dataPropType:sp.Type.Num,compositeRule:!0},x),A()})}function C(x){e.code((0,mn._)`${x}++`),u===void 0?e.if((0,mn._)`${x} >= ${a}`,()=>e.assign(g,!0).break()):(e.if((0,mn._)`${x} > ${u}`,()=>e.assign(g,!1).break()),a===1?e.assign(g,!0):e.if((0,mn._)`${x} >= ${a}`,()=>e.assign(g,!0)))}}};ZS.default=v2});var sR=F(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.validateSchemaDeps=Ci.validatePropertyDeps=Ci.error=void 0;var XS=$e(),S2=ze(),Uc=hn();Ci.error={message:({params:{property:r,depsCount:e,deps:t}})=>{let n=e===1?"property":"properties";return(0,XS.str)`must have ${n} ${t} when property ${r} is present`},params:({params:{property:r,depsCount:e,deps:t,missingProperty:n}})=>(0,XS._)`{property: ${r},
|
|
23
|
+
`+new Error().stack),y=!1}return p.apply(this,arguments)},p)}var P={};function $(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 wt(c,p,y){var b=this._calendar[c]||this._calendar.sameElse;return D(b)?b.call(p,y):b}function Ee(c,p,y){var b=""+Math.abs(c),R=p-b.length,N=c>=0;return(N?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,Xe=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Et={},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 Ee(R.apply(this,arguments),p[1],p[2])}),y&&(Mt[y]=function(){return this.localeData().ordinal(R.apply(this,arguments),c)})}function Xn(c){return c.match(/\[[\s\S]/)?c.replace(/^\[|\]$/g,""):c.replace(/\\/g,"")}function Iu(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]=Xn(p[y]);return function(R){var N="",W;for(W=0;W<b;W++)N+=D(p[W])?p[W].call(R,c):p[W];return N}}function ft(c,p){return c.isValid()?(p=wn(p,c.localeData()),Et[p]=Et[p]||Iu(p),Et[p](c)):c.localeData().invalidDate()}function wn(c,p){var y=5;function b(R){return p.longDateFormat(R)||R}for(Xe.lastIndex=0;y>=0&&Xe.test(c);)c=c.replace(Xe,b),Xe.lastIndex=0,y-=1;return c}var us={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 dt="Invalid date";function ei(){return this._invalidDate}var tr="%d",Qr=/\d{1,2}/;function ig(c){return this._ordinal.replace("%d",c)}var En={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 Vf(c,p,y,b){var R=this._relativeTime[y];return D(R)?R(c,p,y,b):R.replace(/%d/i,c)}function sg(c,p){var y=this._relativeTime[c>0?"future":"past"];return D(y)?y(p):y.replace(/%s/i,p)}var cs={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 yt(c){return typeof c=="string"?cs[c]||cs[c.toLowerCase()]:void 0}function Ai(c){var p={},y,b;for(b in c)s(c,b)&&(y=yt(b),y&&(p[y]=c[b]));return p}var Oa={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 og(c){var p=[],y;for(y in c)s(c,y)&&p.push({unit:y,priority:Oa[y]});return p.sort(function(b,R){return b.priority-R.priority}),p}var fs=/\d/,dr=/\d\d/,ds=/\d{3}/,ti=/\d{4}/,hs=/[+-]?\d{6}/,et=/\d\d?/,Ia=/\d\d\d\d?/,Pa=/\d\d\d\d\d\d?/,ps=/\d{1,3}/,So=/\d{1,4}/,ms=/[+-]?\d{1,6}/,ri=/\d+/,gs=/[+-]?\d+/,ag=/Z|[+-]\d\d:?\d\d/gi,ka=/Z|[+-]\d\d(?::?\d\d)?/gi,lg=/[+-]?\d+(\.\d{1,3})?/,ys=/[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,Ti=/^[1-9]\d?/,Pu=/^([1-9]\d|\d)/,Aa;Aa={};function oe(c,p,y){Aa[c]=D(p)?p:function(b,R){return b&&y?y:p}}function ug(c,p){return s(Aa,c)?Aa[c](p._strict,p._locale):new RegExp(Wf(c))}function Wf(c){return Cn(c.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(p,y,b,R,N){return y||b||R||N}))}function Cn(c){return c.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function _r(c){return c<0?Math.ceil(c)||0:Math.floor(c)}function Me(c){var p=+c,y=0;return p!==0&&isFinite(p)&&(y=_r(p)),y}var bo={};function Ge(c,p){var y,b=p,R;for(typeof c=="string"&&(c=[c]),f(p)&&(b=function(N,W){W[p]=Me(N)}),R=c.length,y=0;y<R;y++)bo[c[y]]=b}function qi(c,p){Ge(c,function(y,b,R,N){R._w=R._w||{},p(y,R._w,R,N)})}function cg(c,p,y){p!=null&&s(bo,c)&&bo[c](p,y._a,y,c)}function Ta(c){return c%4===0&&c%100!==0||c%400===0}var Vt=0,xn=1,Zr=2,kt=3,jr=4,Rn=5,ni=6,fg=7,dg=8;le("Y",0,0,function(){var c=this.year();return c<=9999?Ee(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",gs),oe("YY",et,dr),oe("YYYY",So,ti),oe("YYYYY",ms,hs),oe("YYYYYY",ms,hs),Ge(["YYYYY","YYYYYY"],Vt),Ge("YYYY",function(c,p){p[Vt]=c.length===2?e.parseTwoDigitYear(c):Me(c)}),Ge("YY",function(c,p){p[Vt]=e.parseTwoDigitYear(c)}),Ge("Y",function(c,p){p[Vt]=parseInt(c,10)});function _o(c){return Ta(c)?366:365}e.parseTwoDigitYear=function(c){return Me(c)+(Me(c)>68?1900:2e3)};var Yf=vs("FullYear",!0);function hg(){return Ta(this.year())}function vs(c,p){return function(y){return y!=null?(Jf(this,c,y),e.updateOffset(this,p),this):ii(this,c)}}function ii(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 Jf(c,p,y){var b,R,N,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}N=y,W=c.month(),se=c.date(),se=se===29&&W===1&&!Ta(N)?28:se,R?b.setUTCFullYear(N,W,se):b.setFullYear(N,W,se)}}function qa(c){return c=yt(c),D(this[c])?this[c]():this}function pg(c,p){if(typeof c=="object"){c=Ai(c);var y=og(c),b,R=y.length;for(b=0;b<R;b++)this[y[b].unit](c[y[b].unit])}else if(c=yt(c),D(this[c]))return this[c](p);return this}function mg(c,p){return(c%p+p)%p}var vt;Array.prototype.indexOf?vt=Array.prototype.indexOf:vt=function(c){var p;for(p=0;p<this.length;++p)if(this[p]===c)return p;return-1};function Na(c,p){if(isNaN(c)||isNaN(p))return NaN;var y=mg(p,12);return c+=(p-y)/12,y===1?Ta(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",et,Ti),oe("MM",et,dr),oe("MMM",function(c,p){return p.monthsShortRegex(c)}),oe("MMMM",function(c,p){return p.monthsRegex(c)}),Ge(["M","MM"],function(c,p){p[xn]=Me(c)-1}),Ge(["MMM","MMMM"],function(c,p,y,b){var R=y._locale.monthsParse(c,b,y._strict);R!=null?p[xn]=R:C(y).invalidMonth=c});var zf="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ku="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Kf=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,gg=ys,yg=ys;function vg(c,p){return c?n(this._months)?this._months[c.month()]:this._months[(this._months.isFormat||Kf).test(p)?"format":"standalone"][c.month()]:n(this._months)?this._months:this._months.standalone}function Gf(c,p){return c?n(this._monthsShort)?this._monthsShort[c.month()]:this._monthsShort[Kf.test(p)?"format":"standalone"][c.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Qf(c,p,y){var b,R,N,W=c.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],b=0;b<12;++b)N=S([2e3,b]),this._shortMonthsParse[b]=this.monthsShort(N,"").toLocaleLowerCase(),this._longMonthsParse[b]=this.months(N,"").toLocaleLowerCase();return y?p==="MMM"?(R=vt.call(this._shortMonthsParse,W),R!==-1?R:null):(R=vt.call(this._longMonthsParse,W),R!==-1?R:null):p==="MMM"?(R=vt.call(this._shortMonthsParse,W),R!==-1?R:(R=vt.call(this._longMonthsParse,W),R!==-1?R:null)):(R=vt.call(this._longMonthsParse,W),R!==-1?R:(R=vt.call(this._shortMonthsParse,W),R!==-1?R:null))}function Zf(c,p,y){var b,R,N;if(this._monthsParseExact)return Qf.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]&&(N="^"+this.months(R,"")+"|^"+this.monthsShort(R,""),this._monthsParse[b]=new RegExp(N.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 Ma(c,p){if(!c.isValid())return c;if(typeof p=="string"){if(/^\d+$/.test(p))p=Me(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,Na(c.year(),y)),c._isUTC?c._d.setUTCMonth(y,b):c._d.setMonth(y,b),c}function Xf(c){return c!=null?(Ma(this,c),e.updateOffset(this,!0),this):ii(this,"Month")}function ed(){return Na(this.year(),this.month())}function $a(c){return this._monthsParseExact?(s(this,"_monthsRegex")||rd.call(this),c?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=gg),this._monthsShortStrictRegex&&c?this._monthsShortStrictRegex:this._monthsShortRegex)}function td(c){return this._monthsParseExact?(s(this,"_monthsRegex")||rd.call(this),c?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=yg),this._monthsStrictRegex&&c?this._monthsStrictRegex:this._monthsRegex)}function rd(){function c(ye,Pe){return Pe.length-ye.length}var p=[],y=[],b=[],R,N,W,se;for(R=0;R<12;R++)N=S([2e3,R]),W=Cn(this.monthsShort(N,"")),se=Cn(this.months(N,"")),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 nd(c,p,y,b,R,N,W){var se;return c<100&&c>=0?(se=new Date(c+400,p,y,b,R,N,W),isFinite(se.getFullYear())&&se.setFullYear(c)):se=new Date(c,p,y,b,R,N,W),se}function Ss(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 bs(c,p,y){var b=7+p-y,R=(7+Ss(c,0,b).getUTCDay()-p)%7;return-R+b-1}function id(c,p,y,b,R){var N=(7+y-b)%7,W=bs(c,b,R),se=1+7*(p-1)+N+W,ye,Pe;return se<=0?(ye=c-1,Pe=_o(ye)+se):se>_o(c)?(ye=c+1,Pe=se-_o(c)):(ye=c,Pe=se),{year:ye,dayOfYear:Pe}}function _s(c,p,y){var b=bs(c.year(),p,y),R=Math.floor((c.dayOfYear()-b-1)/7)+1,N,W;return R<1?(W=c.year()-1,N=R+Ur(W,p,y)):R>Ur(c.year(),p,y)?(N=R-Ur(c.year(),p,y),W=c.year()+1):(W=c.year(),N=R),{week:N,year:W}}function Ur(c,p,y){var b=bs(c,p,y),R=bs(c+1,p,y);return(_o(c)-b+R)/7}le("w",["ww",2],"wo","week"),le("W",["WW",2],"Wo","isoWeek"),oe("w",et,Ti),oe("ww",et,dr),oe("W",et,Ti),oe("WW",et,dr),qi(["w","ww","W","WW"],function(c,p,y,b){p[b.substr(0,1)]=Me(c)});function Au(c){return _s(c,this._week.dow,this._week.doy).week}var ws={dow:0,doy:6};function sd(){return this._week.dow}function od(){return this._week.doy}function Sg(c){var p=this.localeData().week(this);return c==null?p:this.add((c-p)*7,"d")}function ad(c){var p=_s(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",et),oe("e",et),oe("E",et),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)}),qi(["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}),qi(["d","e","E"],function(c,p,y,b){p[b]=Me(c)});function ld(c,p){return typeof c!="string"?c:isNaN(c)?(c=p.weekdaysParse(c),typeof c=="number"?c:null):parseInt(c,10)}function ud(c,p){return typeof c=="string"?p.weekdaysParse(c)%7||7:isNaN(c)?null:c}function Da(c,p){return c.slice(p,7).concat(c.slice(0,p))}var bg="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),cd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),_g="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),fd=ys,wg=ys,Eg=ys;function Cg(c,p){var y=n(this._weekdays)?this._weekdays:this._weekdays[c&&c!==!0&&this._weekdays.isFormat.test(p)?"format":"standalone"];return c===!0?Da(y,this._week.dow):c?y[c.day()]:y}function xg(c){return c===!0?Da(this._weekdaysShort,this._week.dow):c?this._weekdaysShort[c.day()]:this._weekdaysShort}function Tu(c){return c===!0?Da(this._weekdaysMin,this._week.dow):c?this._weekdaysMin[c.day()]:this._weekdaysMin}function Rg(c,p,y){var b,R,N,W=c.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],b=0;b<7;++b)N=S([2e3,1]).day(b),this._minWeekdaysParse[b]=this.weekdaysMin(N,"").toLocaleLowerCase(),this._shortWeekdaysParse[b]=this.weekdaysShort(N,"").toLocaleLowerCase(),this._weekdaysParse[b]=this.weekdays(N,"").toLocaleLowerCase();return y?p==="dddd"?(R=vt.call(this._weekdaysParse,W),R!==-1?R:null):p==="ddd"?(R=vt.call(this._shortWeekdaysParse,W),R!==-1?R:null):(R=vt.call(this._minWeekdaysParse,W),R!==-1?R:null):p==="dddd"?(R=vt.call(this._weekdaysParse,W),R!==-1||(R=vt.call(this._shortWeekdaysParse,W),R!==-1)?R:(R=vt.call(this._minWeekdaysParse,W),R!==-1?R:null)):p==="ddd"?(R=vt.call(this._shortWeekdaysParse,W),R!==-1||(R=vt.call(this._weekdaysParse,W),R!==-1)?R:(R=vt.call(this._minWeekdaysParse,W),R!==-1?R:null)):(R=vt.call(this._minWeekdaysParse,W),R!==-1||(R=vt.call(this._weekdaysParse,W),R!==-1)?R:(R=vt.call(this._shortWeekdaysParse,W),R!==-1?R:null))}function Og(c,p,y){var b,R,N;if(this._weekdaysParseExact)return Rg.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]||(N="^"+this.weekdays(R,"")+"|^"+this.weekdaysShort(R,"")+"|^"+this.weekdaysMin(R,""),this._weekdaysParse[b]=new RegExp(N.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 Ig(c){if(!this.isValid())return c!=null?this:NaN;var p=ii(this,"Day");return c!=null?(c=ld(c,this.localeData()),this.add(c-p,"d")):p}function Pg(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 kg(c){if(!this.isValid())return c!=null?this:NaN;if(c!=null){var p=ud(c,this.localeData());return this.day(this.day()%7?p:p-7)}else return this.day()||7}function lt(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||qu.call(this),c?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=fd),this._weekdaysStrictRegex&&c?this._weekdaysStrictRegex:this._weekdaysRegex)}function it(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||qu.call(this),c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=wg),this._weekdaysShortStrictRegex&&c?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ag(c){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||qu.call(this),c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Eg),this._weekdaysMinStrictRegex&&c?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function qu(){function c(Kt,on){return on.length-Kt.length}var p=[],y=[],b=[],R=[],N,W,se,ye,Pe;for(N=0;N<7;N++)W=S([2e3,1]).day(N),se=Cn(this.weekdaysMin(W,"")),ye=Cn(this.weekdaysShort(W,"")),Pe=Cn(this.weekdays(W,"")),p.push(se),y.push(ye),b.push(Pe),R.push(se),R.push(ye),R.push(Pe);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 Nu(){return this.hours()%12||12}function Tg(){return this.hours()||24}le("H",["HH",2],0,"hour"),le("h",["hh",2],0,Nu),le("k",["kk",2],0,Tg),le("hmm",0,0,function(){return""+Nu.apply(this)+Ee(this.minutes(),2)}),le("hmmss",0,0,function(){return""+Nu.apply(this)+Ee(this.minutes(),2)+Ee(this.seconds(),2)}),le("Hmm",0,0,function(){return""+this.hours()+Ee(this.minutes(),2)}),le("Hmmss",0,0,function(){return""+this.hours()+Ee(this.minutes(),2)+Ee(this.seconds(),2)});function dd(c,p){le(c,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),p)})}dd("a",!0),dd("A",!1);function hd(c,p){return p._meridiemParse}oe("a",hd),oe("A",hd),oe("H",et,Pu),oe("h",et,Ti),oe("k",et,Ti),oe("HH",et,dr),oe("hh",et,dr),oe("kk",et,dr),oe("hmm",Ia),oe("hmmss",Pa),oe("Hmm",Ia),oe("Hmmss",Pa),Ge(["H","HH"],kt),Ge(["k","kk"],function(c,p,y){var b=Me(c);p[kt]=b===24?0:b}),Ge(["a","A"],function(c,p,y){y._isPm=y._locale.isPM(c),y._meridiem=c}),Ge(["h","hh"],function(c,p,y){p[kt]=Me(c),C(y).bigHour=!0}),Ge("hmm",function(c,p,y){var b=c.length-2;p[kt]=Me(c.substr(0,b)),p[jr]=Me(c.substr(b)),C(y).bigHour=!0}),Ge("hmmss",function(c,p,y){var b=c.length-4,R=c.length-2;p[kt]=Me(c.substr(0,b)),p[jr]=Me(c.substr(b,2)),p[Rn]=Me(c.substr(R)),C(y).bigHour=!0}),Ge("Hmm",function(c,p,y){var b=c.length-2;p[kt]=Me(c.substr(0,b)),p[jr]=Me(c.substr(b))}),Ge("Hmmss",function(c,p,y){var b=c.length-4,R=c.length-2;p[kt]=Me(c.substr(0,b)),p[jr]=Me(c.substr(b,2)),p[Rn]=Me(c.substr(R))});function pd(c){return(c+"").toLowerCase().charAt(0)==="p"}var qg=/[ap]\.?m?\.?/i,$t=vs("Hours",!0);function Mu(c,p,y){return c>11?y?"pm":"PM":y?"am":"AM"}var si={calendar:fe,longDateFormat:us,invalidDate:dt,ordinal:tr,dayOfMonthOrdinalParse:Qr,relativeTime:En,months:zf,monthsShort:ku,week:ws,weekdays:bg,weekdaysMin:_g,weekdaysShort:cd,meridiemParse:qg},ut={},Ni={},Wt;function md(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 $u(c){return c&&c.toLowerCase().replace("_","-")}function gd(c){for(var p=0,y,b,R,N;p<c.length;){for(N=$u(c[p]).split("-"),y=N.length,b=$u(c[p+1]),b=b?b.split("-"):null;y>0;){if(R=wo(N.slice(0,y).join("-")),R)return R;if(b&&b.length>=y&&md(N,b)>=y-1)break;y--}p++}return Wt}function yd(c){return!!(c&&c.match("^[^/\\\\]*$"))}function wo(c){var p=null,y;if(ut[c]===void 0&&typeof bl<"u"&&bl&&bl.exports&&yd(c))try{p=Wt._abbr,y=require,y("./locale/"+c),On(p)}catch{ut[c]=null}return ut[c]}function On(c,p){var y;return c&&(u(p)?y=Ct(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=si;if(p.abbr=c,ut[c]!=null)$("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=ut[c]._config;else if(p.parentLocale!=null)if(ut[p.parentLocale]!=null)b=ut[p.parentLocale]._config;else if(y=wo(p.parentLocale),y!=null)b=y._config;else return Ni[p.parentLocale]||(Ni[p.parentLocale]=[]),Ni[p.parentLocale].push({name:c,config:p}),null;return ut[c]=new Z(z(b,p)),Ni[c]&&Ni[c].forEach(function(R){Jt(R.name,R.config)}),On(c),ut[c]}else return delete ut[c],null}function Ng(c,p){if(p!=null){var y,b,R=si;ut[c]!=null&&ut[c].parentLocale!=null?ut[c].set(z(ut[c]._config,p)):(b=wo(c),b!=null&&(R=b._config),p=z(R,p),b==null&&(p.abbr=c),y=new Z(p),y.parentLocale=ut[c],ut[c]=y),On(c)}else ut[c]!=null&&(ut[c].parentLocale!=null?(ut[c]=ut[c].parentLocale,c===On()&&On(c)):ut[c]!=null&&delete ut[c]);return ut[c]}function Ct(c){var p;if(c&&c._locale&&c._locale._abbr&&(c=c._locale._abbr),!c)return Wt;if(!n(c)){if(p=wo(c),p)return p;c=[c]}return gd(c)}function Mg(){return ie(ut)}function Fa(c){var p,y=c._a;return y&&C(c).overflow===-2&&(p=y[xn]<0||y[xn]>11?xn:y[Zr]<1||y[Zr]>Na(y[Vt],y[xn])?Zr:y[kt]<0||y[kt]>24||y[kt]===24&&(y[jr]!==0||y[Rn]!==0||y[ni]!==0)?kt:y[jr]<0||y[jr]>59?jr:y[Rn]<0||y[Rn]>59?Rn:y[ni]<0||y[ni]>999?ni:-1,C(c)._overflowDayOfYear&&(p<Vt||p>Zr)&&(p=Zr),C(c)._overflowWeeks&&p===-1&&(p=fg),C(c)._overflowWeekday&&p===-1&&(p=dg),C(c).overflow=p),c}var oi=/^\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)?)?$/,La=/^\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)?)?$/,Du=/Z|[+-]\d\d(?::?\d\d)?/,tt=[["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/]],Fu=/^\/?Date\((-?\d+)/i,$g=/^(?:(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}))$/,Lu={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 vd(c){var p,y,b=c._i,R=oi.exec(b)||La.exec(b),N,W,se,ye,Pe=tt.length,Kt=Xr.length;if(R){for(C(c).iso=!0,p=0,y=Pe;p<y;p++)if(tt[p][1].exec(R[1])){W=tt[p][0],N=tt[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(!N&&se!=null){c._isValid=!1;return}if(R[4])if(Du.exec(R[4]))ye="Z";else{c._isValid=!1;return}c._f=W+(se||"")+(ye||""),Uu(c)}else c._isValid=!1}function Dg(c,p,y,b,R,N){var W=[Fg(c),ku.indexOf(p),parseInt(y,10),parseInt(b,10),parseInt(R,10)];return N&&W.push(parseInt(N,10)),W}function Fg(c){var p=parseInt(c,10);return p<=49?2e3+p:p<=999?1900+p:p}function Sd(c){return c.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function ja(c,p,y){if(c){var b=cd.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 Es(c,p,y){if(c)return Lu[c];if(p)return 0;var b=parseInt(y,10),R=b%100,N=(b-R)/100;return N*60+R}function bd(c){var p=$g.exec(Sd(c._i)),y;if(p){if(y=Dg(p[4],p[3],p[2],p[5],p[6],p[7]),!ja(p[1],y,c))return;c._a=y,c._tzm=Es(p[8],p[9],p[10]),c._d=Ss.apply(null,c._a),c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),C(c).rfc2822=!0}else c._isValid=!1}function _d(c){var p=Fu.exec(c._i);if(p!==null){c._d=new Date(+p[1]);return}if(vd(c),c._isValid===!1)delete c._isValid;else return;if(bd(c),c._isValid===!1)delete c._isValid;else return;c._strict?c._isValid=!1:e.createFromInputFallback(c)}e.createFromInputFallback=w("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 Mi(c,p,y){return c??p??y}function ju(c){var p=new Date(e.now());return c._useUTC?[p.getUTCFullYear(),p.getUTCMonth(),p.getUTCDate()]:[p.getFullYear(),p.getMonth(),p.getDate()]}function Eo(c){var p,y,b=[],R,N,W;if(!c._d){for(R=ju(c),c._w&&c._a[Zr]==null&&c._a[xn]==null&&wd(c),c._dayOfYear!=null&&(W=Mi(c._a[Vt],R[Vt]),(c._dayOfYear>_o(W)||c._dayOfYear===0)&&(C(c)._overflowDayOfYear=!0),y=Ss(W,0,c._dayOfYear),c._a[xn]=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[kt]===24&&c._a[jr]===0&&c._a[Rn]===0&&c._a[ni]===0&&(c._nextDay=!0,c._a[kt]=0),c._d=(c._useUTC?Ss:nd).apply(null,b),N=c._useUTC?c._d.getUTCDay():c._d.getDay(),c._tzm!=null&&c._d.setUTCMinutes(c._d.getUTCMinutes()-c._tzm),c._nextDay&&(c._a[kt]=24),c._w&&typeof c._w.d<"u"&&c._w.d!==N&&(C(c).weekdayMismatch=!0)}}function wd(c){var p,y,b,R,N,W,se,ye,Pe;p=c._w,p.GG!=null||p.W!=null||p.E!=null?(N=1,W=4,y=Mi(p.GG,c._a[Vt],_s(st(),1,4).year),b=Mi(p.W,1),R=Mi(p.E,1),(R<1||R>7)&&(ye=!0)):(N=c._locale._week.dow,W=c._locale._week.doy,Pe=_s(st(),N,W),y=Mi(p.gg,c._a[Vt],Pe.year),b=Mi(p.w,Pe.week),p.d!=null?(R=p.d,(R<0||R>6)&&(ye=!0)):p.e!=null?(R=p.e+N,(p.e<0||p.e>6)&&(ye=!0)):R=N),b<1||b>Ur(y,N,W)?C(c)._overflowWeeks=!0:ye!=null?C(c)._overflowWeekday=!0:(se=id(y,b,R,N,W),c._a[Vt]=se.year,c._dayOfYear=se.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function Uu(c){if(c._f===e.ISO_8601){vd(c);return}if(c._f===e.RFC_2822){bd(c);return}c._a=[],C(c).empty=!0;var p=""+c._i,y,b,R,N,W,se=p.length,ye=0,Pe,Kt;for(R=wn(c._f,c._locale).match(he)||[],Kt=R.length,y=0;y<Kt;y++)N=R[y],b=(p.match(ug(N,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[N]?(b?C(c).empty=!1:C(c).unusedTokens.push(N),cg(N,b,c)):c._strict&&!b&&C(c).unusedTokens.push(N);C(c).charsLeftOver=se-ye,p.length>0&&C(c).unusedInput.push(p),c._a[kt]<=12&&C(c).bigHour===!0&&c._a[kt]>0&&(C(c).bigHour=void 0),C(c).parsedDateParts=c._a.slice(0),C(c).meridiem=c._meridiem,c._a[kt]=Bu(c._locale,c._a[kt],c._meridiem),Pe=C(c).era,Pe!==null&&(c._a[Vt]=c._locale.erasConvertYear(Pe,c._a[Vt])),Eo(c),Fa(c)}function Bu(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 Hu(c){var p,y,b,R,N,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++)N=0,W=!1,p=V({},c),c._useUTC!=null&&(p._useUTC=c._useUTC),p._f=c._f[R],Uu(p),A(p)&&(W=!0),N+=C(p).charsLeftOver,N+=C(p).unusedTokens.length*10,C(p).score=N,se?N<b&&(b=N,y=p):(b==null||N<b||W)&&(b=N,y=p,W&&(se=!0));m(c,y||p)}function Lg(c){if(!c._d){var p=Ai(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)}),Eo(c)}}function Ed(c){var p=new K(Fa(rr(c)));return p._nextDay&&(p.add(1,"d"),p._nextDay=void 0),p}function rr(c){var p=c._i,y=c._f;return c._locale=c._locale||Ct(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(Fa(p)):(h(p)?c._d=p:n(y)?Hu(c):y?Uu(c):Vu(c),A(c)||(c._d=null),c))}function Vu(c){var p=c._i;u(p)?c._d=new Date(e.now()):h(p)?c._d=new Date(p.valueOf()):typeof p=="string"?_d(c):n(p)?(c._a=g(p.slice(0),function(y){return parseInt(y,10)}),Eo(c)):i(p)?Lg(c):f(p)?c._d=new Date(p):e.createFromInputFallback(c)}function Cs(c,p,y,b,R){var N={};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),N._isAMomentObject=!0,N._useUTC=N._isUTC=R,N._l=y,N._i=c,N._f=p,N._strict=b,Ed(N)}function st(c,p,y,b){return Cs(c,p,y,b,!1)}var Cd=w("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=st.apply(null,arguments);return this.isValid()&&c.isValid()?c<this?this:c:T()}),jg=w("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var c=st.apply(null,arguments);return this.isValid()&&c.isValid()?c>this?this:c:T()});function xd(c,p){var y,b;if(p.length===1&&n(p[0])&&(p=p[0]),!p.length)return st();for(y=p[0],b=1;b<p.length;++b)(!p[b].isValid()||p[b][c](y))&&(y=p[b]);return y}function Ug(){var c=[].slice.call(arguments,0);return xd("isBefore",c)}function Bg(){var c=[].slice.call(arguments,0);return xd("isAfter",c)}var Hg=function(){return Date.now?Date.now():+new Date},en=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Vg(c){var p,y=!1,b,R=en.length;for(p in c)if(s(c,p)&&!(vt.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]])!==Me(c[en[b]])&&(y=!0)}return!0}function Wg(){return this._isValid}function Wu(){return Te(NaN)}function Co(c){var p=Ai(c),y=p.year||0,b=p.quarter||0,R=p.month||0,N=p.week||p.isoWeek||0,W=p.day||0,se=p.hour||0,ye=p.minute||0,Pe=p.second||0,Kt=p.millisecond||0;this._isValid=Vg(p),this._milliseconds=+Kt+Pe*1e3+ye*6e4+se*1e3*60*60,this._days=+W+N*7,this._months=+R+b*3+y*12,this._data={},this._locale=Ct(),this._bubble()}function Br(c){return c instanceof Co}function xs(c){return c<0?Math.round(-1*c)*-1:Math.round(c)}function Yg(c,p,y){var b=Math.min(c.length,p.length),R=Math.abs(c.length-p.length),N=0,W;for(W=0;W<b;W++)(y&&c[W]!==p[W]||!y&&Me(c[W])!==Me(p[W]))&&N++;return N+R}function Rd(c,p){le(c,0,0,function(){var y=this.utcOffset(),b="+";return y<0&&(y=-y,b="-"),b+Ee(~~(y/60),2)+p+Ee(~~y%60,2)})}Rd("Z",":"),Rd("ZZ",""),oe("Z",ka),oe("ZZ",ka),Ge(["Z","ZZ"],function(c,p,y){y._useUTC=!0,y._tzm=ai(ka,c)});var Jg=/([\+\-]|\d\d)/gi;function ai(c,p){var y=(p||"").match(c),b,R,N;return y===null?null:(b=y[y.length-1]||[],R=(b+"").match(Jg)||["-",0,0],N=+(R[1]*60)+Me(R[2]),N===0?0:R[0]==="+"?N:-N)}function hr(c,p){var y,b;return p._isUTC?(y=p.clone(),b=(ee(c)||h(c)?c.valueOf():st(c).valueOf())-y.valueOf(),y._d.setTime(y._d.valueOf()+b),e.updateOffset(y,!1),y):st(c).local()}function Ua(c){return-Math.round(c._d.getTimezoneOffset())}e.updateOffset=function(){};function zg(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=ai(ka,c),c===null)return this}else Math.abs(c)<16&&!y&&(c=c*60);return!this._isUTC&&p&&(R=Ua(this)),this._offset=c,this._isUTC=!0,R!=null&&this.add(R,"m"),b!==c&&(!p||this._changeInProgress?Id(this,Te(c-b,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?b:Ua(this)}function Kg(c,p){return c!=null?(typeof c!="string"&&(c=-c),this.utcOffset(c,p),this):-this.utcOffset()}function Gg(c){return this.utcOffset(0,c)}function Qg(c){return this._isUTC&&(this.utcOffset(0,c),this._isUTC=!1,c&&this.subtract(Ua(this),"m")),this}function Zg(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var c=ai(ag,this._i);c!=null?this.utcOffset(c):this.utcOffset(0,!0)}return this}function li(c){return this.isValid()?(c=c?st(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=rr(c),c._a?(p=c._isUTC?S(c._a):st(c._a),this._isDSTShifted=this.isValid()&&Yg(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 Ye=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,At=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Te(c,p){var y=c,b=null,R,N,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=Ye.exec(c))?(R=b[1]==="-"?-1:1,y={y:0,d:Me(b[Zr])*R,h:Me(b[kt])*R,m:Me(b[jr])*R,s:Me(b[Rn])*R,ms:Me(xs(b[ni]*1e3))*R}):(b=At.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(st(y.from),st(y.to)),y={},y.ms=W.milliseconds,y.M=W.months),N=new Co(y),Br(c)&&s(c,"_locale")&&(N._locale=c._locale),Br(c)&&s(c,"_isValid")&&(N._isValid=c._isValid),N}Te.fn=Co.prototype,Te.invalid=Wu;function In(c,p){var y=c&&parseFloat(c.replace(",","."));return(isNaN(y)?0:y)*p}function Od(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=Od(c,p):(y=Od(p,c),y.milliseconds=-y.milliseconds,y.months=-y.months),y):{milliseconds:0,months:0}}function xo(c,p){return function(y,b){var R,N;return b!==null&&!isNaN(+b)&&($(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."),N=y,y=b,b=N),R=Te(y,b),Id(this,R,c),this}}function Id(c,p,y,b){var R=p._milliseconds,N=xs(p._days),W=xs(p._months);c.isValid()&&(b=b??!0,W&&Ma(c,ii(c,"Month")+W*y),N&&Jf(c,"Date",ii(c,"Date")+N*y),R&&c._d.setTime(c._d.valueOf()+R*y),b&&e.updateOffset(c,N||W))}var Rs=xo(1,"add"),Ba=xo(-1,"subtract");function Ro(c){return typeof c=="string"||c instanceof String}function Ke(c){return ee(c)||h(c)||Ro(c)||f(c)||Pd(c)||Xg(c)||c===null||c===void 0}function Xg(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,N,W=b.length;for(R=0;R<W;R+=1)N=b[R],y=y||s(c,N);return p&&y}function Pd(c){var p=n(c),y=!1;return p&&(y=c.filter(function(b){return!f(b)&&Ro(c)}).length===0),p&&y}function Ha(c){var p=i(c)&&!a(c),y=!1,b=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],R,N;for(R=0;R<b.length;R+=1)N=b[R],y=y||s(c,N);return p&&y}function ey(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 ty(c,p){arguments.length===1&&(arguments[0]?Ke(arguments[0])?(c=arguments[0],p=void 0):Ha(arguments[0])&&(p=arguments[0],c=void 0):(c=void 0,p=void 0));var y=c||st(),b=hr(y,this).startOf("day"),R=e.calendarFormat(this,b)||"sameElse",N=p&&(D(p[R])?p[R].call(this,y):p[R]);return this.format(N||this.localeData().calendar(R,this,st(y)))}function ry(){return new K(this)}function Va(c,p){var y=ee(c)?c:st(c);return this.isValid()&&y.isValid()?(p=yt(p)||"millisecond",p==="millisecond"?this.valueOf()>y.valueOf():y.valueOf()<this.clone().startOf(p).valueOf()):!1}function ui(c,p){var y=ee(c)?c:st(c);return this.isValid()&&y.isValid()?(p=yt(p)||"millisecond",p==="millisecond"?this.valueOf()<y.valueOf():this.clone().endOf(p).valueOf()<y.valueOf()):!1}function Wa(c,p,y,b){var R=ee(c)?c:st(c),N=ee(p)?p:st(p);return this.isValid()&&R.isValid()&&N.isValid()?(b=b||"()",(b[0]==="("?this.isAfter(R,y):!this.isBefore(R,y))&&(b[1]===")"?this.isBefore(N,y):!this.isAfter(N,y))):!1}function kd(c,p){var y=ee(c)?c:st(c),b;return this.isValid()&&y.isValid()?(p=yt(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 Ya(c,p){return this.isSame(c,p)||this.isAfter(c,p)}function Ad(c,p){return this.isSame(c,p)||this.isBefore(c,p)}function Td(c,p,y){var b,R,N;if(!this.isValid())return NaN;if(b=hr(c,this),!b.isValid())return NaN;switch(R=(b.utcOffset()-this.utcOffset())*6e4,p=yt(p),p){case"year":N=$i(this,b)/12;break;case"month":N=$i(this,b);break;case"quarter":N=$i(this,b)/3;break;case"second":N=(this-b)/1e3;break;case"minute":N=(this-b)/6e4;break;case"hour":N=(this-b)/36e5;break;case"day":N=(this-b-R)/864e5;break;case"week":N=(this-b-R)/6048e5;break;default:N=this-b}return y?N:_r(N)}function $i(c,p){if(c.date()<p.date())return-$i(p,c);var y=(p.year()-c.year())*12+(p.month()-c.month()),b=c.clone().add(y,"months"),R,N;return p-b<0?(R=c.clone().add(y-1,"months"),N=(p-b)/(b-R)):(R=c.clone().add(y+1,"months"),N=(p-b)/(R-b)),-(y+N)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function qd(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Oo(c){if(!this.isValid())return null;var p=c!==!0,y=p?this.clone().utc():this;return y.year()<0||y.year()>9999?ft(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",ft(y,"Z")):ft(y,p?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Di(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var c="moment",p="",y,b,R,N;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",N=p+'[")]',this.format(y+b+R+N)}function Ja(c){c||(c=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var p=ft(this,c);return this.localeData().postformat(p)}function ny(c,p){return this.isValid()&&(ee(c)&&c.isValid()||st(c).isValid())?Te({to:this,from:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function iy(c){return this.from(st(),c)}function sy(c,p){return this.isValid()&&(ee(c)&&c.isValid()||st(c).isValid())?Te({from:this,to:c}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function za(c){return this.to(st(),c)}function Io(c){var p;return c===void 0?this._locale._abbr:(p=Ct(c),p!=null&&(this._locale=p),this)}var Ka=w("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 Nd(){return this._locale}var Po=1e3,Os=60*Po,Ga=60*Os,xt=(365*400+97)*24*Ga;function St(c,p){return(c%p+p)%p}function Md(c,p,y){return c<100&&c>=0?new Date(c+400,p,y)-xt:new Date(c,p,y).valueOf()}function $d(c,p,y){return c<100&&c>=0?Date.UTC(c+400,p,y)-xt:Date.UTC(c,p,y)}function Dd(c){var p,y;if(c=yt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(y=this._isUTC?$d:Md,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-=St(p+(this._isUTC?0:this.utcOffset()*Os),Ga);break;case"minute":p=this._d.valueOf(),p-=St(p,Os);break;case"second":p=this._d.valueOf(),p-=St(p,Po);break}return this._d.setTime(p),e.updateOffset(this,!0),this}function oy(c){var p,y;if(c=yt(c),c===void 0||c==="millisecond"||!this.isValid())return this;switch(y=this._isUTC?$d:Md,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+=Ga-St(p+(this._isUTC?0:this.utcOffset()*Os),Ga)-1;break;case"minute":p=this._d.valueOf(),p+=Os-St(p,Os)-1;break;case"second":p=this._d.valueOf(),p+=Po-St(p,Po)-1;break}return this._d.setTime(p),e.updateOffset(this,!0),this}function Yu(){return this._d.valueOf()-(this._offset||0)*6e4}function ko(){return Math.floor(this.valueOf()/1e3)}function Ju(){return new Date(this.valueOf())}function Is(){var c=this;return[c.year(),c.month(),c.date(),c.hour(),c.minute(),c.second(),c.millisecond()]}function Ao(){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 To(){return this.isValid()?this.toISOString():null}function Qa(){return A(this)}function Ps(){return m({},C(this))}function ay(){return C(this).overflow}function ly(){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",dy),oe("NNNNN",hy),Ge(["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",ri),oe("yy",ri),oe("yyy",ri),oe("yyyy",ri),oe("yo",py),Ge(["y","yy","yyy","yyyy"],Vt),Ge(["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 uy(c,p){var y,b,R,N=this._eras||Ct("en")._eras;for(y=0,b=N.length;y<b;++y){switch(typeof N[y].since){case"string":R=e(N[y].since).startOf("day"),N[y].since=R.valueOf();break}switch(typeof N[y].until){case"undefined":N[y].until=1/0;break;case"string":R=e(N[y].until).startOf("day").valueOf(),N[y].until=R.valueOf();break}}return N}function cy(c,p,y){var b,R,N=this.eras(),W,se,ye;for(c=c.toUpperCase(),b=0,R=N.length;b<R;++b)if(W=N[b].name.toUpperCase(),se=N[b].abbr.toUpperCase(),ye=N[b].narrow.toUpperCase(),y)switch(p){case"N":case"NN":case"NNN":if(se===c)return N[b];break;case"NNNN":if(W===c)return N[b];break;case"NNNNN":if(ye===c)return N[b];break}else if([W,se,ye].indexOf(c)>=0)return N[b]}function fy(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 Za(){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 qo(){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 Fd(){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 O(){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 ks(c){return s(this,"_erasNameRegex")||Pn.call(this),c?this._erasNameRegex:this._erasRegex}function Xa(c){return s(this,"_erasAbbrRegex")||Pn.call(this),c?this._erasAbbrRegex:this._erasRegex}function Er(c){return s(this,"_erasNarrowRegex")||Pn.call(this),c?this._erasNarrowRegex:this._erasRegex}function Ie(c,p){return p.erasAbbrRegex(c)}function dy(c,p){return p.erasNameRegex(c)}function hy(c,p){return p.erasNarrowRegex(c)}function py(c,p){return p._eraYearOrdinalRegex||ri}function Pn(){var c=[],p=[],y=[],b=[],R,N,W,se,ye,Pe=this.eras();for(R=0,N=Pe.length;R<N;++R)W=Cn(Pe[R].name),se=Cn(Pe[R].abbr),ye=Cn(Pe[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 el(c,p){le(0,[c,c.length],0,p)}el("gggg","weekYear"),el("ggggg","weekYear"),el("GGGG","isoWeekYear"),el("GGGGG","isoWeekYear"),oe("G",gs),oe("g",gs),oe("GG",et,dr),oe("gg",et,dr),oe("GGGG",So,ti),oe("gggg",So,ti),oe("GGGGG",ms,hs),oe("ggggg",ms,hs),qi(["gggg","ggggg","GGGG","GGGGG"],function(c,p,y,b){p[b.substr(0,2)]=Me(c)}),qi(["gg","GG"],function(c,p,y,b){p[b]=e.parseTwoDigitYear(c)});function my(c){return Ld.call(this,c,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function gy(c){return Ld.call(this,c,this.isoWeek(),this.isoWeekday(),1,4)}function yy(){return Ur(this.year(),1,4)}function vy(){return Ur(this.isoWeekYear(),1,4)}function kn(){var c=this.localeData()._week;return Ur(this.year(),c.dow,c.doy)}function Sy(){var c=this.localeData()._week;return Ur(this.weekYear(),c.dow,c.doy)}function Ld(c,p,y,b,R){var N;return c==null?_s(this,b,R).year:(N=Ur(c,b,R),p>N&&(p=N),by.call(this,c,p,y,b,R))}function by(c,p,y,b,R){var N=id(c,p,y,b,R),W=Ss(N.year,0,N.dayOfYear);return this.year(W.getUTCFullYear()),this.month(W.getUTCMonth()),this.date(W.getUTCDate()),this}le("Q",0,"Qo","quarter"),oe("Q",fs),Ge("Q",function(c,p){p[xn]=(Me(c)-1)*3});function _y(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",et,Ti),oe("DD",et,dr),oe("Do",function(c,p){return c?p._dayOfMonthOrdinalParse||p._ordinalParse:p._dayOfMonthOrdinalParseLenient}),Ge(["D","DD"],Zr),Ge("Do",function(c,p){p[Zr]=Me(c.match(et)[0])});var jd=vs("Date",!0);le("DDD",["DDDD",3],"DDDo","dayOfYear"),oe("DDD",ps),oe("DDDD",ds),Ge(["DDD","DDDD"],function(c,p,y){y._dayOfYear=Me(c)});function An(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",et,Pu),oe("mm",et,dr),Ge(["m","mm"],jr);var wy=vs("Minutes",!1);le("s",["ss",2],0,"second"),oe("s",et,Pu),oe("ss",et,dr),Ge(["s","ss"],Rn);var Ey=vs("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",ps,fs),oe("SS",ps,dr),oe("SSS",ps,ds);var ci,Ud;for(ci="SSSS";ci.length<=9;ci+="S")oe(ci,ri);function Cy(c,p){p[ni]=Me(("0."+c)*1e3)}for(ci="S";ci.length<=9;ci+="S")Ge(ci,Cy);Ud=vs("Milliseconds",!1),le("z",0,0,"zoneAbbr"),le("zz",0,0,"zoneName");function Fi(){return this._isUTC?"UTC":""}function xy(){return this._isUTC?"Coordinated Universal Time":""}var te=K.prototype;te.add=Rs,te.calendar=ty,te.clone=ry,te.diff=Td,te.endOf=oy,te.format=Ja,te.from=ny,te.fromNow=iy,te.to=sy,te.toNow=za,te.get=qa,te.invalidAt=ay,te.isAfter=Va,te.isBefore=ui,te.isBetween=Wa,te.isSame=kd,te.isSameOrAfter=Ya,te.isSameOrBefore=Ad,te.isValid=Qa,te.lang=Ka,te.locale=Io,te.localeData=Nd,te.max=jg,te.min=Cd,te.parsingFlags=Ps,te.set=pg,te.startOf=Dd,te.subtract=Ba,te.toArray=Is,te.toObject=Ao,te.toDate=Ju,te.toISOString=Oo,te.inspect=Di,typeof Symbol<"u"&&Symbol.for!=null&&(te[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),te.toJSON=To,te.toString=qd,te.unix=ko,te.valueOf=Yu,te.creationData=ly,te.eraName=Za,te.eraNarrow=qo,te.eraAbbr=Fd,te.eraYear=O,te.year=Yf,te.isLeapYear=hg,te.weekYear=my,te.isoWeekYear=gy,te.quarter=te.quarters=_y,te.month=Xf,te.daysInMonth=ed,te.week=te.weeks=Sg,te.isoWeek=te.isoWeeks=ad,te.weeksInYear=kn,te.weeksInWeekYear=Sy,te.isoWeeksInYear=yy,te.isoWeeksInISOWeekYear=vy,te.date=jd,te.day=te.days=Ig,te.weekday=Pg,te.isoWeekday=kg,te.dayOfYear=An,te.hour=te.hours=$t,te.minute=te.minutes=wy,te.second=te.seconds=Ey,te.millisecond=te.milliseconds=Ud,te.utcOffset=zg,te.utc=Gg,te.local=Qg,te.parseZone=Zg,te.hasAlignedHourOffset=li,te.isDST=U,te.isLocal=H,te.isUtcOffset=ae,te.isUtc=ve,te.isUTC=ve,te.zoneAbbr=Fi,te.zoneName=xy,te.dates=w("dates accessor is deprecated. Use date instead.",jd),te.months=w("months accessor is deprecated. Use month instead",Xf),te.years=w("years accessor is deprecated. Use year instead",Yf),te.zone=w("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Kg),te.isDSTShifted=w("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",J);function Hr(c){return st(c*1e3)}function Ry(){return st.apply(null,arguments).parseZone()}function Bd(c){return c}var He=Z.prototype;He.calendar=wt,He.longDateFormat=jt,He.invalidDate=ei,He.ordinal=ig,He.preparse=Bd,He.postformat=Bd,He.relativeTime=Vf,He.pastFuture=sg,He.set=L,He.eras=uy,He.erasParse=cy,He.erasConvertYear=fy,He.erasAbbrRegex=Xa,He.erasNameRegex=ks,He.erasNarrowRegex=Er,He.months=vg,He.monthsShort=Gf,He.monthsParse=Zf,He.monthsRegex=td,He.monthsShortRegex=$a,He.week=Au,He.firstDayOfYear=od,He.firstDayOfWeek=sd,He.weekdays=Cg,He.weekdaysMin=Tu,He.weekdaysShort=xg,He.weekdaysParse=Og,He.weekdaysRegex=lt,He.weekdaysShortRegex=it,He.weekdaysMinRegex=Ag,He.isPM=pd,He.meridiem=Mu;function tl(c,p,y,b){var R=Ct(),N=S().set(b,p);return R[y](N,c)}function Hd(c,p,y){if(f(c)&&(p=c,c=void 0),c=c||"",p!=null)return tl(c,p,y,"month");var b,R=[];for(b=0;b<12;b++)R[b]=tl(c,b,y,"month");return R}function rl(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=Ct(),N=c?R._week.dow:0,W,se=[];if(y!=null)return tl(p,(y+N)%7,b,"day");for(W=0;W<7;W++)se[W]=tl(p,(W+N)%7,b,"day");return se}function Vd(c,p){return Hd(c,p,"months")}function Oy(c,p){return Hd(c,p,"monthsShort")}function Iy(c,p,y){return rl(c,p,y,"weekdays")}function zu(c,p,y){return rl(c,p,y,"weekdaysShort")}function No(c,p,y){return rl(c,p,y,"weekdaysMin")}On("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=Me(c%100/10)===1?"th":p===1?"st":p===2?"nd":p===3?"rd":"th";return c+y}}),e.lang=w("moment.lang is deprecated. Use moment.locale instead.",On),e.langData=w("moment.langData is deprecated. Use moment.localeData instead.",Ct);var Cr=Math.abs;function Py(){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 Ku(c,p,y,b){var R=Te(p,y);return c._milliseconds+=b*R._milliseconds,c._days+=b*R._days,c._months+=b*R._months,c._bubble()}function ky(c,p){return Ku(this,c,p,1)}function Tn(c,p){return Ku(this,c,p,-1)}function nl(c){return c<0?Math.floor(c):Math.ceil(c)}function Li(){var c=this._milliseconds,p=this._days,y=this._months,b=this._data,R,N,W,se,ye;return c>=0&&p>=0&&y>=0||c<=0&&p<=0&&y<=0||(c+=nl(Gu(y)+p)*864e5,p=0,y=0),b.milliseconds=c%1e3,R=_r(c/1e3),b.seconds=R%60,N=_r(R/60),b.minutes=N%60,W=_r(N/60),b.hours=W%24,p+=_r(W/24),ye=_r(pr(p)),y+=ye,p-=nl(Gu(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 Gu(c){return c*146097/4800}function Wd(c){if(!this.isValid())return NaN;var p,y,b=this._milliseconds;if(c=yt(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(Gu(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 As=tn("ms"),fi=tn("s"),Yd=tn("m"),Ay=tn("h"),il=tn("d"),Ty=tn("w"),Jd=tn("M"),Ut=tn("Q"),Qu=tn("y"),zd=As;function rn(){return Te(this)}function Zu(c){return c=yt(c),this.isValid()?this[c+"s"]():NaN}function nn(c){return function(){return this.isValid()?this._data[c]:NaN}}var ji=nn("milliseconds"),Kd=nn("seconds"),zt=nn("minutes"),Xu=nn("hours"),qy=nn("days"),Ny=nn("months"),My=nn("years");function ec(){return _r(this.days()/7)}var qn=Math.round,sn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Gd(c,p,y,b,R){return R.relativeTime(p||1,!!y,c,b)}function $y(c,p,y,b){var R=Te(c).abs(),N=qn(R.as("s")),W=qn(R.as("m")),se=qn(R.as("h")),ye=qn(R.as("d")),Pe=qn(R.as("M")),Kt=qn(R.as("w")),on=qn(R.as("y")),Nn=N<=y.ss&&["s",N]||N<y.s&&["ss",N]||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&&(Nn=Nn||Kt<=1&&["w"]||Kt<y.w&&["ww",Kt]),Nn=Nn||Pe<=1&&["M"]||Pe<y.M&&["MM",Pe]||on<=1&&["y"]||["yy",on],Nn[2]=p,Nn[3]=+c>0,Nn[4]=b,Gd.apply(null,Nn)}function Dy(c){return c===void 0?qn:typeof c=="function"?(qn=c,!0):!1}function Mo(c,p){return sn[c]===void 0?!1:p===void 0?sn[c]:(sn[c]=p,c==="s"&&(sn.ss=p-1),!0)}function Fy(c,p){if(!this.isValid())return this.localeData().invalidDate();var y=!1,b=sn,R,N;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(),N=$y(this,!y,b,R),y&&(N=R.pastFuture(+this,N)),R.postformat(N)}var tc=Math.abs;function di(c){return(c>0)-(c<0)||+c}function $o(){if(!this.isValid())return this.localeData().invalidDate();var c=tc(this._milliseconds)/1e3,p=tc(this._days),y=tc(this._months),b,R,N,W,se=this.asSeconds(),ye,Pe,Kt,on;return se?(b=_r(c/60),R=_r(b/60),c%=60,b%=60,N=_r(y/12),y%=12,W=c?c.toFixed(3).replace(/\.?0+$/,""):"",ye=se<0?"-":"",Pe=di(this._months)!==di(se)?"-":"",Kt=di(this._days)!==di(se)?"-":"",on=di(this._milliseconds)!==di(se)?"-":"",ye+"P"+(N?Pe+N+"Y":"")+(y?Pe+y+"M":"")+(p?Kt+p+"D":"")+(R||b||c?"T":"")+(R?on+R+"H":"")+(b?on+b+"M":"")+(c?on+W+"S":"")):"P0D"}var je=Co.prototype;je.isValid=Wg,je.abs=Py,je.add=ky,je.subtract=Tn,je.as=Wd,je.asMilliseconds=As,je.asSeconds=fi,je.asMinutes=Yd,je.asHours=Ay,je.asDays=il,je.asWeeks=Ty,je.asMonths=Jd,je.asQuarters=Ut,je.asYears=Qu,je.valueOf=zd,je._bubble=Li,je.clone=rn,je.get=Zu,je.milliseconds=ji,je.seconds=Kd,je.minutes=zt,je.hours=Xu,je.days=qy,je.weeks=ec,je.months=Ny,je.years=My,je.humanize=Fy,je.toISOString=$o,je.toString=$o,je.toJSON=$o,je.locale=Io,je.localeData=Nd,je.toIsoString=w("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",$o),je.lang=Ka,le("X",0,0,"unix"),le("x",0,0,"valueOf"),oe("x",gs),oe("X",lg),Ge("X",function(c,p,y){y._d=new Date(parseFloat(c)*1e3)}),Ge("x",function(c,p,y){y._d=new Date(Me(c))});return e.version="2.30.1",r(st),e.fn=te,e.min=Ug,e.max=Bg,e.now=Hg,e.utc=S,e.unix=Hr,e.months=Vd,e.isDate=h,e.locale=On,e.invalid=T,e.duration=Te,e.isMoment=ee,e.weekdays=Iy,e.parseZone=Ry,e.localeData=Ct,e.isDuration=Br,e.monthsShort=Oy,e.weekdaysMin=No,e.defineLocale=Jt,e.updateLocale=Ng,e.locales=Mg,e.weekdaysShort=zu,e.normalizeUnits=yt,e.relativeTimeRounding=Dy,e.relativeTimeThreshold=Mo,e.calendarFormat=ey,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 lC=F((aC,kh)=>{(function(t,e){typeof define=="function"&&define.amd?define([],e):typeof kh<"u"&&kh.exports?kh.exports=e():t.tv4=e()})(aC,function(){Object.keys||(Object.keys=function(){var k=Object.prototype.hasOwnProperty,w=!{toString:null}.propertyIsEnumerable("toString"),P=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],$=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(w)for(var Z=0;Z<$;Z++)k.call(D,P[Z])&&L.push(P[Z]);return L}}()),Object.create||(Object.create=function(){function k(){}return function(w){if(arguments.length!==1)throw new Error("Object.create implementation only accepts one parameter.");return k.prototype=w,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 w=Object(this),P=w.length>>>0;if(P===0)return-1;var $=0;if(arguments.length>1&&($=Number(arguments[1]),$!==$?$=0:$!==0&&$!==1/0&&$!==-1/0&&($=($>0||-1)*Math.floor(Math.abs($)))),$>=P)return-1;for(var D=$>=0?$:Math.max(P-Math.abs($),0);D<P;D++)if(D in w&&w[D]===k)return D;return-1}),Object.isFrozen||(Object.isFrozen=function(k){for(var w="tv4_test_frozen_key";k.hasOwnProperty(w);)w+=Math.random();try{return k[w]=!0,delete k[w],!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(w){return"%"+w.substring(3)})}function n(k){var w="";t[k.charAt(0)]&&(w=k.charAt(0),k=k.substring(1));var P="",$="",D=!0,L=!1,z=!1;w==="+"?D=!1:w==="."?($=".",P="."):w==="/"?($="/",P="/"):w==="#"?($="#",D=!1):w===";"?($=";",P=";",L=!0,z=!0):w==="?"?($="?",P="&",L=!0):w==="&"&&($="&",P="&",L=!0);for(var Z=[],ie=k.split(","),fe=[],wt={},Ee=0;Ee<ie.length;Ee++){var he=ie[Ee],Xe=null;if(he.indexOf(":")!==-1){var Et=he.split(":");he=Et[0],Xe=parseInt(Et[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:Xe,name:he,suffices:Mt};fe.push(le),wt[he]=le,Z.push(he)}var Xn=function(Iu){for(var ft="",wn=0,us=0;us<fe.length;us++){var jt=fe[us],dt=Iu(jt.name);if(dt==null||Array.isArray(dt)&&dt.length===0||typeof dt=="object"&&Object.keys(dt).length===0){wn++;continue}if(us===wn?ft+=$:ft+=P||",",Array.isArray(dt)){L&&(ft+=jt.name+"=");for(var ei=0;ei<dt.length;ei++)ei>0&&(ft+=jt.suffices["*"]&&P||",",jt.suffices["*"]&&L&&(ft+=jt.name+"=")),ft+=D?encodeURIComponent(dt[ei]).replace(/!/g,"%21"):r(dt[ei])}else if(typeof dt=="object"){L&&!jt.suffices["*"]&&(ft+=jt.name+"=");var tr=!0;for(var Qr in dt)tr||(ft+=jt.suffices["*"]&&P||","),tr=!1,ft+=D?encodeURIComponent(Qr).replace(/!/g,"%21"):r(Qr),ft+=jt.suffices["*"]?"=":",",ft+=D?encodeURIComponent(dt[Qr]).replace(/!/g,"%21"):r(dt[Qr])}else L&&(ft+=jt.name,(!z||dt!=="")&&(ft+="=")),jt.truncate!=null&&(dt=dt.substring(0,jt.truncate)),ft+=D?encodeURIComponent(dt).replace(/!/g,"%21"):r(dt)}return ft};return Xn.varNames=Z,{prefix:$,substitution:Xn}}function i(k){if(!(this instanceof i))return new i(k);for(var w=k.split("{"),P=[w.shift()],$=[],D=[],L=[];w.length>0;){var z=w.shift(),Z=z.split("}")[0],ie=z.substring(Z.length+1),fe=n(Z);D.push(fe.substitution),$.push(fe.prefix),P.push(ie),L=L.concat(fe.substitution.varNames)}this.fill=function(wt){for(var Ee=P[0],he=0;he<D.length;he++){var Xe=D[he];Ee+=Xe(wt),Ee+=P[he+1]}return Ee},this.varNames=L,this.template=k}i.prototype={toString:function(){return this.template},fillFromObject:function(k){return this.fill(function(w){return k[w]})}};var s=function(w,P,$,D,L){if(this.missing=[],this.missingMap={},this.formatValidators=w?Object.create(w.formatValidators):{},this.schemas=w?Object.create(w.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=$||E("en"),typeof this.errorReporter=="string")throw new Error("debug");if(this.definedKeywords={},w)for(var z in w.definedKeywords)this.definedKeywords[z]=w.definedKeywords[z].slice(0)};s.prototype.defineKeyword=function(k,w){this.definedKeywords[k]=this.definedKeywords[k]||[],this.definedKeywords[k].push(w)},s.prototype.createError=function(k,w,P,$,D,L,z){var Z=new j(k,w,P,$,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,w,P){for(var $=k;$<this.errors.length;$++)this.errors[$]=this.errors[$].prefixWith(w,P);return this},s.prototype.banUnknownProperties=function(k,w){for(var P in this.unknownPropertyPaths){var $=this.createError(C.UNKNOWN_PROPERTY,{path:P},P,"",null,k,w),D=this.handleError($);if(D)return D}return null},s.prototype.addFormat=function(k,w){if(typeof k=="object"){for(var P in k)this.addFormat(P,k[P]);return this}this.formatValidators[k]=w},s.prototype.resolveRefs=function(k,w){if(k.$ref!==void 0){if(w=w||{},w[k.$ref])return this.createError(C.CIRCULAR_REFERENCE,{urls:Object.keys(w).join(", ")},"","",null,void 0,k);w[k.$ref]=!0,k=this.getSchema(k.$ref,w)}return k},s.prototype.getSchema=function(k,w){var P;if(this.schemas[k]!==void 0)return P=this.schemas[k],this.resolveRefs(P,w);var $=k,D="";if(k.indexOf("#")!==-1&&(D=k.substring(k.indexOf("#")+1),$=k.substring(0,k.indexOf("#"))),typeof this.schemas[$]=="object"){P=this.schemas[$];var L=decodeURIComponent(D);if(L==="")return this.resolveRefs(P,w);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,w)}this.missing[$]===void 0&&(this.missing.push($),this.missing[$]=$,this.missingMap[$]=$)},s.prototype.searchSchemas=function(k,w){if(Array.isArray(k))for(var P=0;P<k.length;P++)this.searchSchemas(k[P],w);else if(k&&typeof k=="object"){typeof k.id=="string"&&Y(w,k.id)&&this.schemas[k.id]===void 0&&(this.schemas[k.id]=k);for(var $ in k)if($!=="enum"){if(typeof k[$]=="object")this.searchSchemas(k[$],w);else if($==="$ref"){var D=m(k[$]);D&&this.schemas[D]===void 0&&this.missingMap[D]===void 0&&(this.missingMap[D]=D)}}}},s.prototype.addSchema=function(k,w){if(typeof k!="string"||typeof w>"u")if(typeof k=="object"&&typeof k.id=="string")w=k,k=w.id;else return;k===m(k)+"#"&&(k=m(k)),this.schemas[k]=w,delete this.missingMap[k],S(w,k),this.searchSchemas(w,k)},s.prototype.getSchemaMap=function(){var k={};for(var w in this.schemas)k[w]=this.schemas[w];return k},s.prototype.getSchemaUris=function(k){var w=[];for(var P in this.schemas)(!k||k.test(P))&&w.push(P);return w},s.prototype.getMissingUris=function(k){var w=[];for(var P in this.missingMap)(!k||k.test(P))&&w.push(P);return w},s.prototype.dropSchemas=function(){this.schemas={},this.reset()},s.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},s.prototype.validateAll=function(k,w,P,$,D){var L;if(w=this.resolveRefs(w),w){if(w instanceof j)return this.errors.push(w),w}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 wt=k[this.validatedSchemasKey].indexOf(w);if(wt!==-1)return this.errors=this.errors.concat(k[this.validationErrorsKey][wt]),null}if(Object.isFrozen(k)&&(Z=this.scannedFrozen.indexOf(k),Z!==-1)){var Ee=this.scannedFrozenSchemas[Z].indexOf(w);if(Ee!==-1)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[Z][Ee]),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]=w,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]=w,k[this.validationErrorsKey][fe]=[]}}var he=this.errors.length,Xe=this.validateBasic(k,w,D)||this.validateNumeric(k,w,D)||this.validateString(k,w,D)||this.validateArray(k,w,D)||this.validateObject(k,w,D)||this.validateCombinations(k,w,D)||this.validateHypermedia(k,w,D)||this.validateFormat(k,w,D)||this.validateDefinedKeywords(k,w,D)||null;if(L){for(;this.scanned.length;){var Et=this.scanned.pop();delete Et[this.validatedSchemasKey]}this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(Xe||he!==this.errors.length)for(;P&&P.length||$&&$.length;){var Mt=P&&P.length?""+P.pop():null,le=$&&$.length?""+$.pop():null;Xe&&(Xe=Xe.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(Xe)},s.prototype.validateFormat=function(k,w){if(typeof w.format!="string"||!this.formatValidators[w.format])return null;var P=this.formatValidators[w.format].call(null,k,w);return typeof P=="string"||typeof P=="number"?this.createError(C.FORMAT_CUSTOM,{message:P},"","/format",null,k,w):P&&typeof P=="object"?this.createError(C.FORMAT_CUSTOM,{message:P.message||"?"},P.dataPath||"",P.schemaPath||"/format",null,k,w):null},s.prototype.validateDefinedKeywords=function(k,w,P){for(var $ in this.definedKeywords)if(!(typeof w[$]>"u"))for(var D=this.definedKeywords[$],L=0;L<D.length;L++){var z=D[L],Z=z(k,w[$],w,P);if(typeof Z=="string"||typeof Z=="number")return this.createError(C.KEYWORD_CUSTOM,{key:$,message:Z},"","",null,k,w).prefixWith(null,$);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:$,message:Z.message||"?"},wt=Z.schemaPath||"/"+$.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(ie,fe,Z.dataPath||null,wt,null,k,w)}}return null};function a(k,w){if(k===w)return!0;if(k&&w&&typeof k=="object"&&typeof w=="object"){if(Array.isArray(k)!==Array.isArray(w))return!1;if(Array.isArray(k)){if(k.length!==w.length)return!1;for(var P=0;P<k.length;P++)if(!a(k[P],w[P]))return!1}else{var $;for($ in k)if(w[$]===void 0&&k[$]!==void 0)return!1;for($ in w)if(k[$]===void 0&&w[$]!==void 0)return!1;for($ in k)if(!a(k[$],w[$]))return!1}return!0}return!1}s.prototype.validateBasic=function(w,P,$){var D;return(D=this.validateType(w,P,$))||(D=this.validateEnum(w,P,$))?D.prefixWith(null,"type"):null},s.prototype.validateType=function(w,P){if(P.type===void 0)return null;var $=typeof w;w===null?$="null":Array.isArray(w)&&($="array");var D=P.type;Array.isArray(D)||(D=[D]);for(var L=0;L<D.length;L++){var z=D[L];if(z===$||z==="integer"&&$==="number"&&w%1===0)return null}return this.createError(C.INVALID_TYPE,{type:$,expected:D.join("/")},"","",null,w,P)},s.prototype.validateEnum=function(w,P){if(P.enum===void 0)return null;for(var $=0;$<P.enum.length;$++){var D=P.enum[$];if(a(w,D))return null}return this.createError(C.ENUM_MISMATCH,{value:typeof JSON<"u"?JSON.stringify(w):w},"","",null,w,P)},s.prototype.validateNumeric=function(w,P,$){return this.validateMultipleOf(w,P,$)||this.validateMinMax(w,P,$)||this.validateNaN(w,P,$)||null};var u=Math.pow(2,-51),f=1-u;s.prototype.validateMultipleOf=function(w,P){var $=P.multipleOf||P.divisibleBy;if($===void 0)return null;if(typeof w=="number"){var D=w/$%1;if(D>=u&&D<f)return this.createError(C.NUMBER_MULTIPLE_OF,{value:w,multipleOf:$},"","",null,w,P)}return null},s.prototype.validateMinMax=function(w,P){if(typeof w!="number")return null;if(P.minimum!==void 0){if(w<P.minimum)return this.createError(C.NUMBER_MINIMUM,{value:w,minimum:P.minimum},"","/minimum",null,w,P);if(P.exclusiveMinimum&&w===P.minimum)return this.createError(C.NUMBER_MINIMUM_EXCLUSIVE,{value:w,minimum:P.minimum},"","/exclusiveMinimum",null,w,P)}if(P.maximum!==void 0){if(w>P.maximum)return this.createError(C.NUMBER_MAXIMUM,{value:w,maximum:P.maximum},"","/maximum",null,w,P);if(P.exclusiveMaximum&&w===P.maximum)return this.createError(C.NUMBER_MAXIMUM_EXCLUSIVE,{value:w,maximum:P.maximum},"","/exclusiveMaximum",null,w,P)}return null},s.prototype.validateNaN=function(w,P){return typeof w!="number"?null:isNaN(w)===!0||w===1/0||w===-1/0?this.createError(C.NUMBER_NOT_A_NUMBER,{value:w},"","/type",null,w,P):null},s.prototype.validateString=function(w,P,$){return this.validateStringLength(w,P,$)||this.validateStringPattern(w,P,$)||null},s.prototype.validateStringLength=function(w,P){return typeof w!="string"?null:P.minLength!==void 0&&w.length<P.minLength?this.createError(C.STRING_LENGTH_SHORT,{length:w.length,minimum:P.minLength},"","/minLength",null,w,P):P.maxLength!==void 0&&w.length>P.maxLength?this.createError(C.STRING_LENGTH_LONG,{length:w.length,maximum:P.maxLength},"","/maxLength",null,w,P):null},s.prototype.validateStringPattern=function(w,P){if(typeof w!="string"||typeof P.pattern!="string"&&!(P.pattern instanceof RegExp))return null;var $;if(P.pattern instanceof RegExp)$=P.pattern;else{var D,L="",z=P.pattern.match(/^\/(.+)\/([img]*)$/);z?(D=z[1],L=z[2]):D=P.pattern,$=new RegExp(D,L)}return $.test(w)?null:this.createError(C.STRING_PATTERN,{pattern:P.pattern},"","/pattern",null,w,P)},s.prototype.validateArray=function(w,P,$){return Array.isArray(w)&&(this.validateArrayLength(w,P,$)||this.validateArrayUniqueItems(w,P,$)||this.validateArrayItems(w,P,$))||null},s.prototype.validateArrayLength=function(w,P){var $;return P.minItems!==void 0&&w.length<P.minItems&&($=this.createError(C.ARRAY_LENGTH_SHORT,{length:w.length,minimum:P.minItems},"","/minItems",null,w,P),this.handleError($))||P.maxItems!==void 0&&w.length>P.maxItems&&($=this.createError(C.ARRAY_LENGTH_LONG,{length:w.length,maximum:P.maxItems},"","/maxItems",null,w,P),this.handleError($))?$:null},s.prototype.validateArrayUniqueItems=function(w,P){if(P.uniqueItems){for(var $=0;$<w.length;$++)for(var D=$+1;D<w.length;D++)if(a(w[$],w[D])){var L=this.createError(C.ARRAY_UNIQUE,{match1:$,match2:D},"","/uniqueItems",null,w,P);if(this.handleError(L))return L}}return null},s.prototype.validateArrayItems=function(w,P,$){if(P.items===void 0)return null;var D,L;if(Array.isArray(P.items)){for(L=0;L<w.length;L++)if(L<P.items.length){if(D=this.validateAll(w[L],P.items[L],[L],["items",L],$+"/"+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,w,P),this.handleError(D)))return D}else if(D=this.validateAll(w[L],P.additionalItems,[L],["additionalItems"],$+"/"+L))return D}}else for(L=0;L<w.length;L++)if(D=this.validateAll(w[L],P.items,[L],["items"],$+"/"+L))return D;return null},s.prototype.validateObject=function(w,P,$){return typeof w!="object"||w===null||Array.isArray(w)?null:this.validateObjectMinMaxProperties(w,P,$)||this.validateObjectRequiredProperties(w,P,$)||this.validateObjectProperties(w,P,$)||this.validateObjectDependencies(w,P,$)||null},s.prototype.validateObjectMinMaxProperties=function(w,P){var $=Object.keys(w),D;return P.minProperties!==void 0&&$.length<P.minProperties&&(D=this.createError(C.OBJECT_PROPERTIES_MINIMUM,{propertyCount:$.length,minimum:P.minProperties},"","/minProperties",null,w,P),this.handleError(D))||P.maxProperties!==void 0&&$.length>P.maxProperties&&(D=this.createError(C.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:$.length,maximum:P.maxProperties},"","/maxProperties",null,w,P),this.handleError(D))?D:null},s.prototype.validateObjectRequiredProperties=function(w,P){if(P.required!==void 0)for(var $=0;$<P.required.length;$++){var D=P.required[$];if(w[D]===void 0){var L=this.createError(C.OBJECT_REQUIRED,{key:D},"","/required/"+$,null,w,P);if(this.handleError(L))return L}}return null},s.prototype.validateObjectProperties=function(w,P,$){var D;for(var L in w){var z=$+"/"+L.replace(/~/g,"~0").replace(/\//g,"~1"),Z=!1;if(P.properties!==void 0&&P.properties[L]!==void 0&&(Z=!0,D=this.validateAll(w[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(w[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,w,P).prefixWith(L,null),this.handleError(D)))return D}else if(D=this.validateAll(w[L],P.additionalProperties,[L],["additionalProperties"],z))return D}else this.trackUnknownProperties&&!this.knownPropertyPaths[z]&&(this.unknownPropertyPaths[z]=!0)}return null},s.prototype.validateObjectDependencies=function(w,P,$){var D;if(P.dependencies!==void 0){for(var L in P.dependencies)if(w[L]!==void 0){var z=P.dependencies[L];if(typeof z=="string"){if(w[z]===void 0&&(D=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:L,missing:z},"","",null,w,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(w[ie]===void 0&&(D=this.createError(C.OBJECT_DEPENDENCY_KEY,{key:L,missing:ie},"","/"+Z,null,w,P).prefixWith(null,L).prefixWith(null,"dependencies"),this.handleError(D)))return D}else if(D=this.validateAll(w,z,[],["dependencies",L],$))return D}}return null},s.prototype.validateCombinations=function(w,P,$){return this.validateAllOf(w,P,$)||this.validateAnyOf(w,P,$)||this.validateOneOf(w,P,$)||this.validateNot(w,P,$)||null},s.prototype.validateAllOf=function(w,P,$){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(w,z,[],["allOf",L],$))return D}return null},s.prototype.validateAnyOf=function(w,P,$){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 wt=P.anyOf[fe],Ee=this.errors.length,he=this.validateAll(w,wt,[],["anyOf",fe],$);if(he===null&&Ee===this.errors.length){if(this.errors=this.errors.slice(0,L),this.trackUnknownProperties){for(var Xe in this.knownPropertyPaths)Z[Xe]=!0,delete z[Xe];for(var Et in this.unknownPropertyPaths)Z[Et]||(z[Et]=!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,w,P)},s.prototype.validateOneOf=function(w,P,$){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 wt=P.oneOf[fe],Ee=this.errors.length,he=this.validateAll(w,wt,[],["oneOf",fe],$);if(he===null&&Ee===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,w,P);if(this.trackUnknownProperties){for(var Xe in this.knownPropertyPaths)ie[Xe]=!0,delete Z[Xe];for(var Et in this.unknownPropertyPaths)ie[Et]||(Z[Et]=!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,w,P)):(this.errors=this.errors.slice(0,z),null)},s.prototype.validateNot=function(w,P,$){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(w,P.not,null,null,$),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,w,P):null},s.prototype.validateHypermedia=function(w,P,$){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 w)){ie=!1;break}if(ie){var wt=Z.fillFromObject(w),Ee={$ref:wt};if(D=this.validateAll(w,Ee,[],["links",L],$))return D}}}};function h(k){var w=String(k).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return w?{href:w[0]||"",protocol:w[1]||"",authority:w[2]||"",host:w[3]||"",hostname:w[4]||"",port:w[5]||"",pathname:w[6]||"",search:w[7]||"",hash:w[8]||""}:null}function g(k,w){function P($){var D=[];return $.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(L){L==="/.."?D.pop():D.push(L)}),D.join("").replace(/^\//,$.charAt(0)==="/"?"/":"")}return w=h(w||""),k=h(k||""),!w||!k?null:(w.protocol||k.protocol)+(w.protocol||w.authority?w.authority:k.authority)+P(w.protocol||w.authority||w.pathname.charAt(0)==="/"?w.pathname:w.pathname?(k.authority&&!k.pathname?"/":"")+k.pathname.slice(0,k.pathname.lastIndexOf("/")+1)+w.pathname:k.pathname)+(w.protocol||w.authority||w.pathname?w.search:w.search||k.search)+w.hash}function m(k){return k.split("#")[0]}function S(k,w){if(k&&typeof k=="object")if(w===void 0?w=k.id:typeof k.id=="string"&&(w=g(w,k.id),k.id=w),Array.isArray(k))for(var P=0;P<k.length;P++)S(k[P],w);else{typeof k.$ref=="string"&&(k.$ref=g(w,k.$ref));for(var $ in k)$!=="enum"&&S(k[$],w)}}function E(k){k=k||"en";var w=V[k];return function(P){var $=w[P.code]||T[P.code];if(typeof $!="string")return"Unknown error code "+P.code+": "+JSON.stringify(P.messageParams);var D=P.params;return $.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,w,P,$,D){if(Error.call(this),k===void 0)throw new Error("No error code supplied: "+$);this.message="",this.params=w,this.code=k,this.dataPath=P||"",this.schemaPath=$||"",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,w){if(k!==null&&(k=k.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+k+this.dataPath),w!==null&&(w=w.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+w+this.schemaPath),this.subErrors!==null)for(var P=0;P<this.subErrors.length;P++)this.subErrors[P].prefixWith(k,w);return this};function Y(k,w){if(w.substring(0,k.length)===k){var P=w.substring(k.length);if(w.length>0&&w.charAt(k.length-1)==="/"||P.charAt(0)==="#"||P.charAt(0)==="?")return!0}return!1}var V={};function K(k){var w=new s,P,$,D={setErrorReporter:function(L){return typeof L=="string"?this.language(L):($=L,!0)},addFormat:function(){w.addFormat.apply(w,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=E(P),wt=$?function(Xe,Et,Mt){return $(Xe,Et,Mt)||fe(Xe,Et,Mt)}:fe,Ee=new s(w,!1,wt,Z,ie);typeof z=="string"&&(z={$ref:z}),Ee.addSchema("",z);var he=Ee.validateAll(L,z,null,null,"");return!he&&ie&&(he=Ee.banUnknownProperties(L,z)),this.error=he,this.missing=Ee.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=E(P),wt=$?function(Xe,Et,Mt){return $(Xe,Et,Mt)||fe(Xe,Et,Mt)}:fe,Ee=new s(w,!0,wt,Z,ie);typeof z=="string"&&(z={$ref:z}),Ee.addSchema("",z),Ee.validateAll(L,z,null,null,""),ie&&Ee.banUnknownProperties(L,z);var he={toString:function(){return this.valid?"valid":this.error.message}};return he.errors=Ee.errors,he.missing=Ee.missing,he.valid=he.errors.length===0,he},addSchema:function(){return w.addSchema.apply(w,arguments)},getSchema:function(){return w.getSchema.apply(w,arguments)},getSchemaMap:function(){return w.getSchemaMap.apply(w,arguments)},getSchemaUris:function(){return w.getSchemaUris.apply(w,arguments)},getMissingUris:function(){return w.getMissingUris.apply(w,arguments)},dropSchemas:function(){w.dropSchemas.apply(w,arguments)},defineKeyword:function(){w.defineKeyword.apply(w,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(){w.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 gc=F(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.regexpCode=Je.getEsmExportName=Je.getProperty=Je.safeStringify=Je.stringify=Je.strConcat=Je.addCodeArg=Je.str=Je._=Je.nil=Je._Code=Je.Name=Je.IDENTIFIER=Je._CodeOrName=void 0;var pc=class{};Je._CodeOrName=pc;Je.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Bo=class extends pc{constructor(e){if(super(),!Je.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}}};Je.Name=Bo;var dn=class extends pc{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 Bo&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Je._Code=dn;Je.nil=new dn("");function uC(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Mv(r,e[n]),r.push(t[++n]);return new dn(r)}Je._=uC;var Nv=new dn("+");function cC(t,...e){let r=[mc(t[0])],n=0;for(;n<e.length;)r.push(Nv),Mv(r,e[n]),r.push(Nv,mc(t[++n]));return nD(r),new dn(r)}Je.str=cC;function Mv(t,e){e instanceof dn?t.push(...e._items):e instanceof Bo?t.push(e):t.push(oD(e))}Je.addCodeArg=Mv;function nD(t){let e=1;for(;e<t.length-1;){if(t[e]===Nv){let r=iD(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function iD(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Bo||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 Bo))return`"${t}${e.slice(1)}`}function sD(t,e){return e.emptyStr()?t:t.emptyStr()?e:cC`${t}${e}`}Je.strConcat=sD;function oD(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:mc(Array.isArray(t)?t.join(","):t)}function aD(t){return new dn(mc(t))}Je.stringify=aD;function mc(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Je.safeStringify=mc;function lD(t){return typeof t=="string"&&Je.IDENTIFIER.test(t)?new dn(`.${t}`):uC`[${t}]`}Je.getProperty=lD;function uD(t){if(typeof t=="string"&&Je.IDENTIFIER.test(t))return new dn(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}Je.getEsmExportName=uD;function cD(t){return new dn(t.toString())}Je.regexpCode=cD});var Fv=F(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.ValueScope=kr.ValueScopeName=kr.Scope=kr.varKinds=kr.UsedValueState=void 0;var Pr=gc(),$v=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Ah;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Ah||(kr.UsedValueState=Ah={}));kr.varKinds={const:new Pr.Name("const"),let:new Pr.Name("let"),var:new Pr.Name("var")};var Th=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=Th;var qh=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=qh;var fD=(0,Pr._)`\n`,Dv=class extends Th{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?fD:Pr.nil}}get(){return this._scope}name(e){return new qh(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,Ah.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 $v(h);f.set(h,Ah.Completed)})}return s}};kr.ValueScope=Dv});var $e=F(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.or=Ne.and=Ne.not=Ne.CodeGen=Ne.operators=Ne.varKinds=Ne.ValueScopeName=Ne.ValueScope=Ne.Scope=Ne.Name=Ne.regexpCode=Ne.stringify=Ne.getProperty=Ne.nil=Ne.strConcat=Ne.str=Ne._=void 0;var Be=gc(),Fn=Fv(),Hs=gc();Object.defineProperty(Ne,"_",{enumerable:!0,get:function(){return Hs._}});Object.defineProperty(Ne,"str",{enumerable:!0,get:function(){return Hs.str}});Object.defineProperty(Ne,"strConcat",{enumerable:!0,get:function(){return Hs.strConcat}});Object.defineProperty(Ne,"nil",{enumerable:!0,get:function(){return Hs.nil}});Object.defineProperty(Ne,"getProperty",{enumerable:!0,get:function(){return Hs.getProperty}});Object.defineProperty(Ne,"stringify",{enumerable:!0,get:function(){return Hs.stringify}});Object.defineProperty(Ne,"regexpCode",{enumerable:!0,get:function(){return Hs.regexpCode}});Object.defineProperty(Ne,"Name",{enumerable:!0,get:function(){return Hs.Name}});var Dh=Fv();Object.defineProperty(Ne,"Scope",{enumerable:!0,get:function(){return Dh.Scope}});Object.defineProperty(Ne,"ValueScope",{enumerable:!0,get:function(){return Dh.ValueScope}});Object.defineProperty(Ne,"ValueScopeName",{enumerable:!0,get:function(){return Dh.ValueScopeName}});Object.defineProperty(Ne,"varKinds",{enumerable:!0,get:function(){return Dh.varKinds}});Ne.operators={GT:new Be._Code(">"),GTE:new Be._Code(">="),LT:new Be._Code("<"),LTE:new Be._Code("<="),EQ:new Be._Code("==="),NEQ:new Be._Code("!=="),NOT:new Be._Code("!"),OR:new Be._Code("||"),AND:new Be._Code("&&"),ADD:new Be._Code("+")};var Ki=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Lv=class extends Ki{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Fn.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=wl(this.rhs,e,r)),this}get names(){return this.rhs instanceof Be._CodeOrName?this.rhs.names:{}}},Nh=class extends Ki{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 Be.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=wl(this.rhs,e,r),this}get names(){let e=this.lhs instanceof Be.Name?{}:{...this.lhs.names};return $h(e,this.rhs)}},jv=class extends Nh{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},Uv=class extends Ki{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Bv=class extends Ki{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Hv=class extends Ki{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Vv=class extends Ki{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=wl(this.code,e,r),this}get names(){return this.code instanceof Be._CodeOrName?this.code.names:{}}},yc=class extends Ki{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)||(dD(e,s.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Wo(e,r.names),{})}},Gi=class extends yc{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Wv=class extends yc{},_l=class extends Gi{};_l.kind="else";var Ho=class t extends Gi{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 _l(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(fC(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=wl(this.condition,e,r),this}get names(){let e=super.names;return $h(e,this.condition),this.else&&Wo(e,this.else.names),e}};Ho.kind="if";var Vo=class extends Gi{};Vo.kind="for";var Yv=class extends Vo{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=wl(this.iteration,e,r),this}get names(){return Wo(super.names,this.iteration.names)}},Jv=class extends Vo{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Fn.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=$h(super.names,this.from);return $h(e,this.to)}},Mh=class extends Vo{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=wl(this.iterable,e,r),this}get names(){return Wo(super.names,this.iterable.names)}},vc=class extends Gi{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)}};vc.kind="func";var Sc=class extends yc{render(e){return"return "+super.render(e)}};Sc.kind="return";var zv=class extends Gi{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&&Wo(e,this.catch.names),this.finally&&Wo(e,this.finally.names),e}},bc=class extends Gi{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};bc.kind="catch";var _c=class extends Gi{render(e){return"finally"+super.render(e)}};_c.kind="finally";var Kv=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
24
|
+
`:""},this._extScope=e,this._scope=new Fn.Scope({parent:e}),this._nodes=[new Wv]}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 Lv(e,s,n)),s}const(e,r,n){return this._def(Fn.varKinds.const,e,r,n)}let(e,r,n){return this._def(Fn.varKinds.let,e,r,n)}var(e,r,n){return this._def(Fn.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Nh(e,r,n))}add(e,r){return this._leafNode(new jv(e,Ne.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==Be.nil&&this._leafNode(new Vv(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,Be.addCodeArg)(r,i));return r.push("}"),new Be._Code(r)}if(e,r,n){if(this._blockNode(new Ho(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 Ho(e))}else(){return this._elseNode(new _l)}endIf(){return this._endBlockNode(Ho,_l)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Yv(e),r)}forRange(e,r,n,i,s=this.opts.es5?Fn.varKinds.var:Fn.varKinds.let){let a=this._scope.toName(e);return this._for(new Jv(s,a,r,n),()=>i(a))}forOf(e,r,n,i=Fn.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let a=r instanceof Be.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,Be._)`${a}.length`,u=>{this.var(s,(0,Be._)`${a}[${u}]`),n(s)})}return this._for(new Mh("of",i,s,r),()=>n(s))}forIn(e,r,n,i=this.opts.es5?Fn.varKinds.var:Fn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Be._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Mh("in",i,s,r),()=>n(s))}endFor(){return this._endBlockNode(Vo)}label(e){return this._leafNode(new Uv(e))}break(e){return this._leafNode(new Bv(e))}return(e){let r=new Sc;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Sc)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new zv;if(this._blockNode(i),this.code(e),r){let s=this.name("e");this._currNode=i.catch=new bc(s),r(s)}return n&&(this._currNode=i.finally=new _c,this.code(n)),this._endBlockNode(bc,_c)}throw(e){return this._leafNode(new Hv(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=Be.nil,n,i){return this._blockNode(new vc(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(vc)}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 Ho))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}};Ne.CodeGen=Kv;function Wo(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function $h(t,e){return e instanceof Be._CodeOrName?Wo(t,e.names):t}function wl(t,e,r){if(t instanceof Be.Name)return n(t);if(!i(t))return t;return new Be._Code(t._items.reduce((s,a)=>(a instanceof Be.Name&&(a=n(a)),a instanceof Be._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 Be._Code&&s._items.some(a=>a instanceof Be.Name&&e[a.str]===1&&r[a.str]!==void 0)}}function dD(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function fC(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Be._)`!${Gv(t)}`}Ne.not=fC;var hD=dC(Ne.operators.AND);function pD(...t){return t.reduce(hD)}Ne.and=pD;var mD=dC(Ne.operators.OR);function gD(...t){return t.reduce(mD)}Ne.or=gD;function dC(t){return(e,r)=>e===Be.nil?r:r===Be.nil?e:(0,Be._)`${Gv(e)} ${t} ${Gv(r)}`}function Gv(t){return t instanceof Be.Name?t:(0,Be._)`(${t})`}});var ze=F(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.checkStrictMode=De.getErrorPath=De.Type=De.useFunc=De.setEvaluated=De.evaluatedPropsToName=De.mergeEvaluated=De.eachItem=De.unescapeJsonPointer=De.escapeJsonPointer=De.escapeFragment=De.unescapeFragment=De.schemaRefOrVal=De.schemaHasRulesButRef=De.schemaHasRules=De.checkUnknownRules=De.alwaysValidSchema=De.toHash=void 0;var ct=$e(),yD=gc();function vD(t){let e={};for(let r of t)e[r]=!0;return e}De.toHash=vD;function SD(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(mC(t,e),!gC(e,t.self.RULES.all))}De.alwaysValidSchema=SD;function mC(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]||SC(t,`unknown keyword: "${s}"`)}De.checkUnknownRules=mC;function gC(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}De.schemaHasRules=gC;function bD(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}De.schemaHasRulesButRef=bD;function _D({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ct._)`${r}`}return(0,ct._)`${t}${e}${(0,ct.getProperty)(n)}`}De.schemaRefOrVal=_D;function wD(t){return yC(decodeURIComponent(t))}De.unescapeFragment=wD;function ED(t){return encodeURIComponent(Zv(t))}De.escapeFragment=ED;function Zv(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}De.escapeJsonPointer=Zv;function yC(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}De.unescapeJsonPointer=yC;function CD(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}De.eachItem=CD;function hC({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,s,a,u)=>{let f=a===void 0?s:a instanceof ct.Name?(s instanceof ct.Name?t(i,s,a):e(i,s,a),a):s instanceof ct.Name?(e(i,a,s),s):r(s,a);return u===ct.Name&&!(f instanceof ct.Name)?n(i,f):f}}De.mergeEvaluated={props:hC({mergeNames:(t,e,r)=>t.if((0,ct._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ct._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ct._)`${r} || {}`).code((0,ct._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ct._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ct._)`${r} || {}`),Xv(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:vC}),items:hC({mergeNames:(t,e,r)=>t.if((0,ct._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ct._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ct._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ct._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function vC(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ct._)`{}`);return e!==void 0&&Xv(t,r,e),r}De.evaluatedPropsToName=vC;function Xv(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ct._)`${e}${(0,ct.getProperty)(n)}`,!0))}De.setEvaluated=Xv;var pC={};function xD(t,e){return t.scopeValue("func",{ref:e,code:pC[e.code]||(pC[e.code]=new yD._Code(e.code))})}De.useFunc=xD;var Qv;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Qv||(De.Type=Qv={}));function RD(t,e,r){if(t instanceof ct.Name){let n=e===Qv.Num;return r?n?(0,ct._)`"[" + ${t} + "]"`:(0,ct._)`"['" + ${t} + "']"`:n?(0,ct._)`"/" + ${t}`:(0,ct._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ct.getProperty)(t).toString():"/"+Zv(t)}De.getErrorPath=RD;function SC(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}De.checkStrictMode=SC});var Qi=F(eS=>{"use strict";Object.defineProperty(eS,"__esModule",{value:!0});var sr=$e(),OD={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")};eS.default=OD});var wc=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 Ve=$e(),Fh=ze(),yr=Qi();or.keywordError={message:({keyword:t})=>(0,Ve.str)`must pass "${t}" keyword validation`};or.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Ve.str)`"${t}" keyword must be ${e} ($data)`:(0,Ve.str)`"${t}" keyword is invalid ($data)`};function ID(t,e=or.keywordError,r,n){let{it:i}=t,{gen:s,compositeRule:a,allErrors:u}=i,f=wC(t,e,r);n??(a||u)?bC(s,f):_C(i,(0,Ve._)`[${f}]`)}or.reportError=ID;function PD(t,e=or.keywordError,r){let{it:n}=t,{gen:i,compositeRule:s,allErrors:a}=n,u=wC(t,e,r);bC(i,u),s||a||_C(n,yr.default.vErrors)}or.reportExtraError=PD;function kD(t,e){t.assign(yr.default.errors,e),t.if((0,Ve._)`${yr.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Ve._)`${yr.default.vErrors}.length`,e),()=>t.assign(yr.default.vErrors,null)))}or.resetErrorsCount=kD;function AD({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,yr.default.errors,u=>{t.const(a,(0,Ve._)`${yr.default.vErrors}[${u}]`),t.if((0,Ve._)`${a}.instancePath === undefined`,()=>t.assign((0,Ve._)`${a}.instancePath`,(0,Ve.strConcat)(yr.default.instancePath,s.errorPath))),t.assign((0,Ve._)`${a}.schemaPath`,(0,Ve.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,Ve._)`${a}.schema`,r),t.assign((0,Ve._)`${a}.data`,n))})}or.extendErrors=AD;function bC(t,e){let r=t.const("err",e);t.if((0,Ve._)`${yr.default.vErrors} === null`,()=>t.assign(yr.default.vErrors,(0,Ve._)`[${r}]`),(0,Ve._)`${yr.default.vErrors}.push(${r})`),t.code((0,Ve._)`${yr.default.errors}++`)}function _C(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,Ve._)`new ${t.ValidationError}(${e})`):(r.assign((0,Ve._)`${n}.errors`,e),r.return(!1))}var Yo={keyword:new Ve.Name("keyword"),schemaPath:new Ve.Name("schemaPath"),params:new Ve.Name("params"),propertyName:new Ve.Name("propertyName"),message:new Ve.Name("message"),schema:new Ve.Name("schema"),parentSchema:new Ve.Name("parentSchema")};function wC(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,Ve._)`{}`:TD(t,e,r)}function TD(t,e,r={}){let{gen:n,it:i}=t,s=[qD(i,r),ND(t,r)];return MD(t,e,s),n.object(...s)}function qD({errorPath:t},{instancePath:e}){let r=e?(0,Ve.str)`${t}${(0,Fh.getErrorPath)(e,Fh.Type.Str)}`:t;return[yr.default.instancePath,(0,Ve.strConcat)(yr.default.instancePath,r)]}function ND({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,Ve.str)`${e}/${t}`;return r&&(i=(0,Ve.str)`${i}${(0,Fh.getErrorPath)(r,Fh.Type.Str)}`),[Yo.schemaPath,i]}function MD(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([Yo.keyword,i],[Yo.params,typeof e=="function"?e(t):e||(0,Ve._)`{}`]),f.messages&&n.push([Yo.message,typeof r=="function"?r(t):r]),f.verbose&&n.push([Yo.schema,a],[Yo.parentSchema,(0,Ve._)`${g}${m}`],[yr.default.data,s]),h&&n.push([Yo.propertyName,h])}});var CC=F(El=>{"use strict";Object.defineProperty(El,"__esModule",{value:!0});El.boolOrEmptySchema=El.topBoolOrEmptySchema=void 0;var $D=wc(),DD=$e(),FD=Qi(),LD={message:"boolean schema is false"};function jD(t){let{gen:e,schema:r,validateName:n}=t;r===!1?EC(t,!1):typeof r=="object"&&r.$async===!0?e.return(FD.default.data):(e.assign((0,DD._)`${n}.errors`,null),e.return(!0))}El.topBoolOrEmptySchema=jD;function UD(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),EC(t)):r.var(e,!0)}El.boolOrEmptySchema=UD;function EC(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,$D.reportError)(i,LD,void 0,e)}});var tS=F(Cl=>{"use strict";Object.defineProperty(Cl,"__esModule",{value:!0});Cl.getRules=Cl.isJSONType=void 0;var BD=["string","number","integer","boolean","null","object","array"],HD=new Set(BD);function VD(t){return typeof t=="string"&&HD.has(t)}Cl.isJSONType=VD;function WD(){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:{}}}Cl.getRules=WD});var rS=F(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.shouldUseRule=Vs.shouldUseGroup=Vs.schemaHasRulesForType=void 0;function YD({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&xC(t,n)}Vs.schemaHasRulesForType=YD;function xC(t,e){return e.rules.some(r=>RC(t,r))}Vs.shouldUseGroup=xC;function RC(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))}Vs.shouldUseRule=RC});var Ec=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 JD=tS(),zD=rS(),KD=wc(),Oe=$e(),OC=ze(),xl;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(xl||(ar.DataType=xl={}));function GD(t){let e=IC(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=GD;function IC(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(JD.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}ar.getJSONTypes=IC;function QD(t,e){let{gen:r,data:n,opts:i}=t,s=ZD(e,i.coerceTypes),a=e.length>0&&!(s.length===0&&e.length===1&&(0,zD.schemaHasRulesForType)(t,e[0]));if(a){let u=iS(e,n,i.strictNumbers,xl.Wrong);r.if(u,()=>{s.length?XD(t,e,s):sS(t)})}return a}ar.coerceAndCheckDataType=QD;var PC=new Set(["string","number","integer","boolean","null"]);function ZD(t,e){return e?t.filter(r=>PC.has(r)||e==="array"&&r==="array"):[]}function XD(t,e,r){let{gen:n,data:i,opts:s}=t,a=n.let("dataType",(0,Oe._)`typeof ${i}`),u=n.let("coerced",(0,Oe._)`undefined`);s.coerceTypes==="array"&&n.if((0,Oe._)`${a} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,Oe._)`${i}[0]`).assign(a,(0,Oe._)`typeof ${i}`).if(iS(e,i,s.strictNumbers),()=>n.assign(u,i))),n.if((0,Oe._)`${u} !== undefined`);for(let h of r)(PC.has(h)||h==="array"&&s.coerceTypes==="array")&&f(h);n.else(),sS(t),n.endIf(),n.if((0,Oe._)`${u} !== undefined`,()=>{n.assign(i,u),eF(t,u)});function f(h){switch(h){case"string":n.elseIf((0,Oe._)`${a} == "number" || ${a} == "boolean"`).assign(u,(0,Oe._)`"" + ${i}`).elseIf((0,Oe._)`${i} === null`).assign(u,(0,Oe._)`""`);return;case"number":n.elseIf((0,Oe._)`${a} == "boolean" || ${i} === null
|
|
25
|
+
|| (${a} == "string" && ${i} && ${i} == +${i})`).assign(u,(0,Oe._)`+${i}`);return;case"integer":n.elseIf((0,Oe._)`${a} === "boolean" || ${i} === null
|
|
26
|
+
|| (${a} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(u,(0,Oe._)`+${i}`);return;case"boolean":n.elseIf((0,Oe._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(u,!1).elseIf((0,Oe._)`${i} === "true" || ${i} === 1`).assign(u,!0);return;case"null":n.elseIf((0,Oe._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(u,null);return;case"array":n.elseIf((0,Oe._)`${a} === "string" || ${a} === "number"
|
|
27
|
+
|| ${a} === "boolean" || ${i} === null`).assign(u,(0,Oe._)`[${i}]`)}}}function eF({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,Oe._)`${e} !== undefined`,()=>t.assign((0,Oe._)`${e}[${r}]`,n))}function nS(t,e,r,n=xl.Correct){let i=n===xl.Correct?Oe.operators.EQ:Oe.operators.NEQ,s;switch(t){case"null":return(0,Oe._)`${e} ${i} null`;case"array":s=(0,Oe._)`Array.isArray(${e})`;break;case"object":s=(0,Oe._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a((0,Oe._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return(0,Oe._)`typeof ${e} ${i} ${t}`}return n===xl.Correct?s:(0,Oe.not)(s);function a(u=Oe.nil){return(0,Oe.and)((0,Oe._)`typeof ${e} == "number"`,u,r?(0,Oe._)`isFinite(${e})`:Oe.nil)}}ar.checkDataType=nS;function iS(t,e,r,n){if(t.length===1)return nS(t[0],e,r,n);let i,s=(0,OC.toHash)(t);if(s.array&&s.object){let a=(0,Oe._)`typeof ${e} != "object"`;i=s.null?a:(0,Oe._)`!${e} || ${a}`,delete s.null,delete s.array,delete s.object}else i=Oe.nil;s.number&&delete s.integer;for(let a in s)i=(0,Oe.and)(i,nS(a,e,r,n));return i}ar.checkDataTypes=iS;var tF={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,Oe._)`{type: ${t}}`:(0,Oe._)`{type: ${e}}`};function sS(t){let e=rF(t);(0,KD.reportError)(e,tF)}ar.reportTypeError=sS;function rF(t){let{gen:e,data:r,schema:n}=t,i=(0,OC.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}});var AC=F(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.assignDefaults=void 0;var Rl=$e(),nF=ze();function iF(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let i in r)kC(t,i,r[i].default);else e==="array"&&Array.isArray(n)&&n.forEach((i,s)=>kC(t,s,i.default))}Lh.assignDefaults=iF;function kC(t,e,r){let{gen:n,compositeRule:i,data:s,opts:a}=t;if(r===void 0)return;let u=(0,Rl._)`${s}${(0,Rl.getProperty)(e)}`;if(i){(0,nF.checkStrictMode)(t,`default is ignored for: ${u}`);return}let f=(0,Rl._)`${u} === undefined`;a.useDefaults==="empty"&&(f=(0,Rl._)`${f} || ${u} === null || ${u} === ""`),n.if(f,(0,Rl._)`${u} = ${(0,Rl.stringify)(r)}`)}});var hn=F(at=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.validateUnion=at.validateArray=at.usePattern=at.callValidateCode=at.schemaProperties=at.allSchemaProperties=at.noPropertyInData=at.propertyInData=at.isOwnProperty=at.hasPropFunc=at.reportMissingProp=at.checkMissingProp=at.checkReportMissingProp=void 0;var ht=$e(),oS=ze(),Ws=Qi(),sF=ze();function oF(t,e){let{gen:r,data:n,it:i}=t;r.if(lS(r,n,e,i.opts.ownProperties),()=>{t.setParams({missingProperty:(0,ht._)`${e}`},!0),t.error()})}at.checkReportMissingProp=oF;function aF({gen:t,data:e,it:{opts:r}},n,i){return(0,ht.or)(...n.map(s=>(0,ht.and)(lS(t,e,s,r.ownProperties),(0,ht._)`${i} = ${s}`)))}at.checkMissingProp=aF;function lF(t,e){t.setParams({missingProperty:e},!0),t.error()}at.reportMissingProp=lF;function TC(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ht._)`Object.prototype.hasOwnProperty`})}at.hasPropFunc=TC;function aS(t,e,r){return(0,ht._)`${TC(t)}.call(${e}, ${r})`}at.isOwnProperty=aS;function uF(t,e,r,n){let i=(0,ht._)`${e}${(0,ht.getProperty)(r)} !== undefined`;return n?(0,ht._)`${i} && ${aS(t,e,r)}`:i}at.propertyInData=uF;function lS(t,e,r,n){let i=(0,ht._)`${e}${(0,ht.getProperty)(r)} === undefined`;return n?(0,ht.or)(i,(0,ht.not)(aS(t,e,r))):i}at.noPropertyInData=lS;function qC(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}at.allSchemaProperties=qC;function cF(t,e){return qC(e).filter(r=>!(0,oS.alwaysValidSchema)(t,e[r]))}at.schemaProperties=cF;function fF({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:s},it:a},u,f,h){let g=h?(0,ht._)`${t}, ${e}, ${n}${i}`:e,m=[[Ws.default.instancePath,(0,ht.strConcat)(Ws.default.instancePath,s)],[Ws.default.parentData,a.parentData],[Ws.default.parentDataProperty,a.parentDataProperty],[Ws.default.rootData,Ws.default.rootData]];a.opts.dynamicRef&&m.push([Ws.default.dynamicAnchors,Ws.default.dynamicAnchors]);let S=(0,ht._)`${g}, ${r.object(...m)}`;return f!==ht.nil?(0,ht._)`${u}.call(${f}, ${S})`:(0,ht._)`${u}(${S})`}at.callValidateCode=fF;var dF=(0,ht._)`new RegExp`;function hF({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,ht._)`${i.code==="new RegExp"?dF:(0,sF.useFunc)(t,i)}(${r}, ${n})`})}at.usePattern=hF;function pF(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,ht._)`${r}.length`);e.forRange("i",0,f,h=>{t.subschema({keyword:n,dataProp:h,dataPropType:oS.Type.Num},s),e.if((0,ht.not)(s),u)})}}at.validateArray=pF;function mF(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,oS.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,ht._)`${a} || ${u}`),t.mergeValidEvaluated(g,u)||e.if((0,ht.not)(a))})),t.result(a,()=>t.reset(),()=>t.error(!0))}at.validateUnion=mF});var $C=F(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.validateKeywordUsage=bi.validSchemaType=bi.funcKeywordCode=bi.macroKeywordCode=void 0;var vr=$e(),Jo=Qi(),gF=hn(),yF=wc();function vF(t,e){let{gen:r,keyword:n,schema:i,parentSchema:s,it:a}=t,u=e.macro.call(a.self,i,s,a),f=MC(r,n,u);a.opts.validateSchema!==!1&&a.self.validateSchema(u,!0);let h=r.name("valid");t.subschema({schema:u,schemaPath:vr.nil,errSchemaPath:`${a.errSchemaPath}/${n}`,topSchemaRef:f,compositeRule:!0},h),t.pass(h,()=>t.error(!0))}bi.macroKeywordCode=vF;function SF(t,e){var r;let{gen:n,keyword:i,schema:s,parentSchema:a,$data:u,it:f}=t;_F(f,e);let h=!u&&e.compile?e.compile.call(f.self,s,a,f):e.validate,g=MC(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&&NC(t),A(()=>t.error());else{let T=e.async?E():C();e.modifying&&NC(t),A(()=>bF(t,T))}}function E(){let T=n.let("ruleErrs",null);return n.try(()=>x((0,vr._)`await `),j=>n.assign(m,!1).if((0,vr._)`${j} instanceof ${f.ValidationError}`,()=>n.assign(T,(0,vr._)`${j}.errors`),()=>n.throw(j))),T}function C(){let T=(0,vr._)`${g}.errors`;return n.assign(T,null),x(vr.nil),T}function x(T=e.async?(0,vr._)`await `:vr.nil){let j=f.opts.passContext?Jo.default.this:Jo.default.self,Y=!("compile"in e&&!u||e.schema===!1);n.assign(m,(0,vr._)`${T}${(0,gF.callValidateCode)(t,g,j,Y)}`,e.modifying)}function A(T){var j;n.if((0,vr.not)((j=e.valid)!==null&&j!==void 0?j:m),T)}}bi.funcKeywordCode=SF;function NC(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,vr._)`${n.parentData}[${n.parentDataProperty}]`))}function bF(t,e){let{gen:r}=t;r.if((0,vr._)`Array.isArray(${e})`,()=>{r.assign(Jo.default.vErrors,(0,vr._)`${Jo.default.vErrors} === null ? ${e} : ${Jo.default.vErrors}.concat(${e})`).assign(Jo.default.errors,(0,vr._)`${Jo.default.vErrors}.length`),(0,yF.extendErrors)(t)},()=>t.error())}function _F({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function MC(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,vr.stringify)(r)})}function wF(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")}bi.validSchemaType=wF;function EF({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)}}bi.validateKeywordUsage=EF});var FC=F(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.extendSubschemaMode=Ys.extendSubschemaData=Ys.getSubschema=void 0;var _i=$e(),DC=ze();function CF(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,_i._)`${t.schemaPath}${(0,_i.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:u[r],schemaPath:(0,_i._)`${t.schemaPath}${(0,_i.getProperty)(e)}${(0,_i.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,DC.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')}Ys.getSubschema=CF;function xF(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,_i._)`${e.data}${(0,_i.getProperty)(r)}`,!0);f(S),t.errorPath=(0,_i.str)`${h}${(0,DC.getErrorPath)(r,n,m.jsPropertySyntax)}`,t.parentDataProperty=(0,_i._)`${r}`,t.dataPathArr=[...g,t.parentDataProperty]}if(i!==void 0){let h=i instanceof _i.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]}}Ys.extendSubschemaData=xF;function RF(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}Ys.extendSubschemaMode=RF});var uS=F((N6,LC)=>{"use strict";LC.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 UC=F((M6,jC)=>{"use strict";var Js=jC.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(){};jh(e,n,i,t,"",t)};Js.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Js.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Js.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Js.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 jh(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 Js.arrayKeywords)for(var S=0;S<m.length;S++)jh(t,e,r,m[S],i+"/"+g+"/"+S,s,i,g,n,S)}else if(g in Js.propsKeywords){if(m&&typeof m=="object")for(var E in m)jh(t,e,r,m[E],i+"/"+g+"/"+OF(E),s,i,g,n,E)}else(g in Js.keywords||t.allKeys&&!(g in Js.skipKeywords))&&jh(t,e,r,m,i+"/"+g,s,i,g,n)}r(n,i,s,a,u,f,h)}}function OF(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Cc=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 IF=ze(),PF=uS(),kF=UC(),AF=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function TF(t,e=!0){return typeof t=="boolean"?!0:e===!0?!cS(t):e?BC(t)<=e:!1}Ar.inlineRef=TF;var qF=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function cS(t){for(let e in t){if(qF.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(cS)||typeof r=="object"&&cS(r))return!0}return!1}function BC(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!AF.has(r)&&(typeof t[r]=="object"&&(0,IF.eachItem)(t[r],n=>e+=BC(n)),e===1/0))return 1/0}return e}function HC(t,e="",r){r!==!1&&(e=Ol(e));let n=t.parse(e);return VC(t,n)}Ar.getFullPath=HC;function VC(t,e){return t.serialize(e).split("#")[0]+"#"}Ar._getFullPath=VC;var NF=/#\/?$/;function Ol(t){return t?t.replace(NF,""):""}Ar.normalizeId=Ol;function MF(t,e,r){return r=Ol(r),t.resolve(e,r)}Ar.resolveUrl=MF;var $F=/^[a-z_][-a-z0-9._]*$/i;function DF(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,i=Ol(t[r]||e),s={"":i},a=HC(n,i,!1),u={},f=new Set;return kF(t,{allKeys:!0},(m,S,E,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=Ol(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!==Ol(x)&&(Y[0]==="#"?(h(m,u[Y],Y),u[Y]=m):this.refs[Y]=x),Y}function j(Y){if(typeof Y=="string"){if(!$F.test(Y))throw new Error(`invalid anchor "${Y}"`);T.call(this,`#${Y}`)}}}),u;function h(m,S,E){if(S!==void 0&&!PF(m,S))throw g(E)}function g(m){return new Error(`reference "${m}" resolves to more than one schema`)}}Ar.getSchemaRefs=DF});var Oc=F(zs=>{"use strict";Object.defineProperty(zs,"__esModule",{value:!0});zs.getData=zs.KeywordCxt=zs.validateFunctionCode=void 0;var KC=CC(),WC=Ec(),dS=rS(),Uh=Ec(),FF=AC(),Rc=$C(),fS=FC(),ce=$e(),_e=Qi(),LF=Cc(),Zi=ze(),xc=wc();function jF(t){if(ZC(t)&&(XC(t),QC(t))){HF(t);return}GC(t,()=>(0,KC.topBoolOrEmptySchema)(t))}zs.validateFunctionCode=jF;function GC({gen:t,validateName:e,schema:r,schemaEnv:n,opts:i},s){i.code.es5?t.func(e,(0,ce._)`${_e.default.data}, ${_e.default.valCxt}`,n.$async,()=>{t.code((0,ce._)`"use strict"; ${YC(r,i)}`),BF(t,i),t.code(s)}):t.func(e,(0,ce._)`${_e.default.data}, ${UF(i)}`,n.$async,()=>t.code(YC(r,i)).code(s))}function UF(t){return(0,ce._)`{${_e.default.instancePath}="", ${_e.default.parentData}, ${_e.default.parentDataProperty}, ${_e.default.rootData}=${_e.default.data}${t.dynamicRef?(0,ce._)`, ${_e.default.dynamicAnchors}={}`:ce.nil}}={}`}function BF(t,e){t.if(_e.default.valCxt,()=>{t.var(_e.default.instancePath,(0,ce._)`${_e.default.valCxt}.${_e.default.instancePath}`),t.var(_e.default.parentData,(0,ce._)`${_e.default.valCxt}.${_e.default.parentData}`),t.var(_e.default.parentDataProperty,(0,ce._)`${_e.default.valCxt}.${_e.default.parentDataProperty}`),t.var(_e.default.rootData,(0,ce._)`${_e.default.valCxt}.${_e.default.rootData}`),e.dynamicRef&&t.var(_e.default.dynamicAnchors,(0,ce._)`${_e.default.valCxt}.${_e.default.dynamicAnchors}`)},()=>{t.var(_e.default.instancePath,(0,ce._)`""`),t.var(_e.default.parentData,(0,ce._)`undefined`),t.var(_e.default.parentDataProperty,(0,ce._)`undefined`),t.var(_e.default.rootData,_e.default.data),e.dynamicRef&&t.var(_e.default.dynamicAnchors,(0,ce._)`{}`)})}function HF(t){let{schema:e,opts:r,gen:n}=t;GC(t,()=>{r.$comment&&e.$comment&&tx(t),zF(t),n.let(_e.default.vErrors,null),n.let(_e.default.errors,0),r.unevaluated&&VF(t),ex(t),QF(t)})}function VF(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 YC(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 WF(t,e){if(ZC(t)&&(XC(t),QC(t))){YF(t,e);return}(0,KC.boolOrEmptySchema)(t,e)}function QC({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 ZC(t){return typeof t.schema!="boolean"}function YF(t,e){let{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&tx(t),KF(t),GF(t);let s=n.const("_errs",_e.default.errors);ex(t,s),n.var(e,(0,ce._)`${s} === ${_e.default.errors}`)}function XC(t){(0,Zi.checkUnknownRules)(t),JF(t)}function ex(t,e){if(t.opts.jtd)return JC(t,[],!1,e);let r=(0,WC.getSchemaTypes)(t.schema),n=(0,WC.coerceAndCheckDataType)(t,r);JC(t,r,!n,e)}function JF(t){let{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Zi.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function zF(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Zi.checkStrictMode)(t,"default is ignored in the schema root")}function KF(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,LF.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function GF(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function tx({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){let s=r.$comment;if(i.$comment===!0)t.code((0,ce._)`${_e.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._)`${_e.default.self}.opts.$comment(${s}, ${a}, ${u}.schema)`)}}function QF(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:s}=t;r.$async?e.if((0,ce._)`${_e.default.errors} === 0`,()=>e.return(_e.default.data),()=>e.throw((0,ce._)`new ${i}(${_e.default.vErrors})`)):(e.assign((0,ce._)`${n}.errors`,_e.default.vErrors),s.unevaluated&&ZF(t),e.return((0,ce._)`${_e.default.errors} === 0`))}function ZF({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,Zi.schemaHasRulesButRef)(s,g))){i.block(()=>nx(t,"$ref",g.all.$ref.definition));return}f.jtd||XF(t,e),i.block(()=>{for(let S of g.rules)m(S);m(g.post)});function m(S){(0,dS.shouldUseGroup)(s,S)&&(S.type?(i.if((0,Uh.checkDataType)(S.type,a,f.strictNumbers)),zC(t,S),e.length===1&&e[0]===S.type&&r&&(i.else(),(0,Uh.reportTypeError)(t)),i.endIf()):zC(t,S),u||i.if((0,ce._)`${_e.default.errors} === ${n||0}`))}}function zC(t,e){let{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,FF.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,dS.shouldUseRule)(n,s)&&nx(t,s.keyword,s.definition,e.type)})}function XF(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(eL(t,e),t.opts.allowUnionTypes||tL(t,e),rL(t,t.dataTypes))}function eL(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{rx(t.dataTypes,r)||hS(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),iL(t,e)}}function tL(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&hS(t,"use allowUnionTypes to allow union type keyword")}function rL(t,e){let r=t.self.RULES.all;for(let n in r){let i=r[n];if(typeof i=="object"&&(0,dS.shouldUseRule)(t.schema,i)){let{type:s}=i.definition;s.length&&!s.some(a=>nL(e,a))&&hS(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function nL(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function rx(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function iL(t,e){let r=[];for(let n of t.dataTypes)rx(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function hS(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Zi.checkStrictMode)(t,e,t.opts.strictTypes)}var Bh=class{constructor(e,r,n){if((0,Rc.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,Zi.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",ix(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Rc.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",_e.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?xc.reportExtraError:xc.reportError)(this,this.def.error,r)}$dataError(){(0,xc.reportError)(this,this.def.$dataError||xc.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,xc.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,Uh.checkDataTypes)(f,r,s.opts.strictNumbers,Uh.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,fS.getSubschema)(this.it,e);(0,fS.extendSubschemaData)(n,this.it,e),(0,fS.extendSubschemaMode)(n,e);let i={...this.it,...n,items:void 0,props:void 0};return WF(i,r),i}mergeEvaluated(e,r){let{it:n,gen:i}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Zi.mergeEvaluated.props(i,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Zi.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}};zs.KeywordCxt=Bh;function nx(t,e,r,n){let i=new Bh(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,Rc.funcKeywordCode)(i,r):"macro"in r?(0,Rc.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,Rc.funcKeywordCode)(i,r)}var sL=/^\/(?:[^~]|~0|~1)*$/,oL=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ix(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,s;if(t==="")return _e.default.rootData;if(t[0]==="/"){if(!sL.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,s=_e.default.rootData}else{let h=oL.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,Zi.unescapeJsonPointer)(h))}`,a=(0,ce._)`${a} && ${s}`);return a;function f(h,g){return`Cannot access ${h} ${g} levels up, current level is ${e}`}}zs.getData=ix});var Hh=F(mS=>{"use strict";Object.defineProperty(mS,"__esModule",{value:!0});var pS=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};mS.default=pS});var Ic=F(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});var gS=Cc(),yS=class extends Error{constructor(e,r,n,i){super(i||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,gS.resolveUrl)(e,r,n),this.missingSchema=(0,gS.normalizeId)((0,gS.getFullPath)(e,this.missingRef))}};vS.default=yS});var Wh=F(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.resolveSchema=pn.getCompilingSchema=pn.resolveRef=pn.compileSchema=pn.SchemaEnv=void 0;var Ln=$e(),aL=Hh(),zo=Qi(),jn=Cc(),sx=ze(),lL=Oc(),Il=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,jn.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};pn.SchemaEnv=Il;function bS(t){let e=ox.call(this,t);if(e)return e;let r=(0,jn.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Ln.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s}),u;t.$async&&(u=a.scopeValue("Error",{ref:aL.default,code:(0,Ln._)`require("ajv/dist/runtime/validation_error").default`}));let f=a.scopeName("validate");t.validateName=f;let h={gen:a,allErrors:this.opts.allErrors,data:zo.default.data,parentData:zo.default.parentData,parentDataProperty:zo.default.parentDataProperty,dataNames:[zo.default.data],dataPathArr:[Ln.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,Ln.stringify)(t.schema)}:{ref:t.schema}),validateName:f,ValidationError:u,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Ln.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Ln._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(t),(0,lL.validateFunctionCode)(h),a.optimize(this.opts.code.optimize);let m=a.toString();g=`${a.scopeRefs(zo.default.scope)}return ${m}`,this.opts.code.process&&(g=this.opts.code.process(g,t));let E=new Function(`${zo.default.self}`,`${zo.default.scope}`,g)(this,this.scope.get());if(this.scope.value(f,{ref:E}),E.errors=null,E.schema=t.schema,E.schemaEnv=t,t.$async&&(E.$async=!0),this.opts.code.source===!0&&(E.source={validateName:f,validateCode:m,scopeValues:a._values}),this.opts.unevaluated){let{props:C,items:x}=h;E.evaluated={props:C instanceof Ln.Name?void 0:C,items:x instanceof Ln.Name?void 0:x,dynamicProps:C instanceof Ln.Name,dynamicItems:x instanceof Ln.Name},E.source&&(E.source.evaluated=(0,Ln.stringify)(E.evaluated))}return t.validate=E,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)}}pn.compileSchema=bS;function uL(t,e,r){var n;r=(0,jn.resolveUrl)(this.opts.uriResolver,e,r);let i=t.refs[r];if(i)return i;let s=dL.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 Il({schema:a,schemaId:u,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=cL.call(this,s)}pn.resolveRef=uL;function cL(t){return(0,jn.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:bS.call(this,t)}function ox(t){for(let e of this._compilations)if(fL(e,t))return e}pn.getCompilingSchema=ox;function fL(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function dL(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||Vh.call(this,t,e)}function Vh(t,e){let r=this.opts.uriResolver.parse(e),n=(0,jn._getFullPath)(this.opts.uriResolver,r),i=(0,jn.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===i)return SS.call(this,r,t);let s=(0,jn.normalizeId)(n),a=this.refs[s]||this.schemas[s];if(typeof a=="string"){let u=Vh.call(this,t,a);return typeof u?.schema!="object"?void 0:SS.call(this,r,u)}if(typeof a?.schema=="object"){if(a.validate||bS.call(this,a),s===(0,jn.normalizeId)(e)){let{schema:u}=a,{schemaId:f}=this.opts,h=u[f];return h&&(i=(0,jn.resolveUrl)(this.opts.uriResolver,i,h)),new Il({schema:u,schemaId:f,root:t,baseId:i})}return SS.call(this,r,a)}}pn.resolveSchema=Vh;var hL=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function SS(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,sx.unescapeFragment)(u)];if(f===void 0)return;r=f;let h=typeof r=="object"&&r[this.opts.schemaId];!hL.has(u)&&h&&(e=(0,jn.resolveUrl)(this.opts.uriResolver,e,h))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,sx.schemaHasRulesButRef)(r,this.RULES)){let u=(0,jn.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=Vh.call(this,n,u)}let{schemaId:a}=this.opts;if(s=s||new Il({schema:r,schemaId:a,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var ax=F((U6,pL)=>{pL.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 wS=F((B6,fx)=>{"use strict";var mL=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),ux=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 _S(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 gL=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function lx(t){return t.length=0,!0}function yL(t,e,r){if(t.length){let n=_S(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function vL(t){let e=0,r={error:!1,address:"",zone:""},n=[],i=[],s=!1,a=!1,u=yL;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=lx}else{i.push(h);continue}}return i.length&&(u===lx?r.zone=i.join(""):a?n.push(i.join("")):n.push(_S(i))),r.address=n.join(""),r}function cx(t){if(SL(t,":")<2)return{host:t,isIPV6:!1};let e=vL(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 SL(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function bL(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 _L(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 wL(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!ux(r)){let n=cx(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}fx.exports={nonSimpleDomain:gL,recomposeAuthority:wL,normalizeComponentEncoding:_L,removeDotSegments:bL,isIPv4:ux,isUUID:mL,normalizeIPv6:cx,stringArrayToHexStripped:_S}});var gx=F((H6,mx)=>{"use strict";var{isUUID:EL}=wS(),CL=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,xL=["http","https","ws","wss","urn","urn:uuid"];function RL(t){return xL.indexOf(t)!==-1}function ES(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 dx(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function hx(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 OL(t){return t.secure=ES(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function IL(t){if((t.port===(ES(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 PL(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(CL);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=CS(i);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function kL(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=CS(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 AL(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!EL(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function TL(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var px={scheme:"http",domainHost:!0,parse:dx,serialize:hx},qL={scheme:"https",domainHost:px.domainHost,parse:dx,serialize:hx},Yh={scheme:"ws",domainHost:!0,parse:OL,serialize:IL},NL={scheme:"wss",domainHost:Yh.domainHost,parse:Yh.parse,serialize:Yh.serialize},ML={scheme:"urn",parse:PL,serialize:kL,skipNormalize:!0},$L={scheme:"urn:uuid",parse:AL,serialize:TL,skipNormalize:!0},Jh={http:px,https:qL,ws:Yh,wss:NL,urn:ML,"urn:uuid":$L};Object.setPrototypeOf(Jh,null);function CS(t){return t&&(Jh[t]||Jh[t.toLowerCase()])||void 0}mx.exports={wsIsSecure:ES,SCHEMES:Jh,isValidSchemeName:RL,getSchemeHandler:CS}});var Sx=F((V6,Kh)=>{"use strict";var{normalizeIPv6:DL,removeDotSegments:Pc,recomposeAuthority:FL,normalizeComponentEncoding:zh,isIPv4:LL,nonSimpleDomain:jL}=wS(),{SCHEMES:UL,getSchemeHandler:yx}=gx();function BL(t,e){return typeof t=="string"?t=wi(Xi(t,e),e):typeof t=="object"&&(t=Xi(wi(t,e),e)),t}function HL(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=vx(Xi(t,n),Xi(e,n),n,!0);return n.skipEscape=!0,wi(i,n)}function vx(t,e,r,n){let i={};return n||(t=Xi(wi(t,r),r),e=Xi(wi(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=Pc(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=Pc(e.path||""),i.query=e.query):(e.path?(e.path[0]==="/"?i.path=Pc(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=Pc(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 VL(t,e,r){return typeof t=="string"?(t=unescape(t),t=wi(zh(Xi(t,r),!0),{...r,skipEscape:!0})):typeof t=="object"&&(t=wi(zh(t,!0),{...r,skipEscape:!0})),typeof e=="string"?(e=unescape(e),e=wi(zh(Xi(e,r),!0),{...r,skipEscape:!0})):typeof e=="object"&&(e=wi(zh(e,!0),{...r,skipEscape:!0})),t.toLowerCase()===e.toLowerCase()}function wi(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=yx(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=FL(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=Pc(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 WL=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function Xi(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(WL);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(LL(n.host)===!1){let f=DL(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=yx(r.scheme||n.scheme);if(!r.unicodeSupport&&(!a||!a.unicodeSupport)&&n.host&&(r.domainHost||a&&a.domainHost)&&i===!1&&jL(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 xS={SCHEMES:UL,normalize:BL,resolve:HL,resolveComponent:vx,equal:VL,serialize:wi,parse:Xi};Kh.exports=xS;Kh.exports.default=xS;Kh.exports.fastUri=xS});var _x=F(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});var bx=Sx();bx.code='require("ajv/dist/runtime/uri").default';RS.default=bx});var Px=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 YL=Oc();Object.defineProperty(Qt,"KeywordCxt",{enumerable:!0,get:function(){return YL.KeywordCxt}});var Pl=$e();Object.defineProperty(Qt,"_",{enumerable:!0,get:function(){return Pl._}});Object.defineProperty(Qt,"str",{enumerable:!0,get:function(){return Pl.str}});Object.defineProperty(Qt,"stringify",{enumerable:!0,get:function(){return Pl.stringify}});Object.defineProperty(Qt,"nil",{enumerable:!0,get:function(){return Pl.nil}});Object.defineProperty(Qt,"Name",{enumerable:!0,get:function(){return Pl.Name}});Object.defineProperty(Qt,"CodeGen",{enumerable:!0,get:function(){return Pl.CodeGen}});var JL=Hh(),Rx=Ic(),zL=tS(),kc=Wh(),KL=$e(),Ac=Cc(),Gh=Ec(),IS=ze(),wx=ax(),GL=_x(),Ox=(t,e)=>new RegExp(t,e);Ox.code="new RegExp";var QL=["removeAdditional","useDefaults","coerceTypes"],ZL=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),XL={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."},ej={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Ex=200;function tj(t){var e,r,n,i,s,a,u,f,h,g,m,S,E,C,x,A,T,j,Y,V,K,ee,k,w,P;let $=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:Ox,Z=(i=t.uriResolver)!==null&&i!==void 0?i:GL.default;return{strictSchema:(a=(s=t.strictSchema)!==null&&s!==void 0?s:$)!==null&&a!==void 0?a:!0,strictNumbers:(f=(u=t.strictNumbers)!==null&&u!==void 0?u:$)!==null&&f!==void 0?f:!0,strictTypes:(g=(h=t.strictTypes)!==null&&h!==void 0?h:$)!==null&&g!==void 0?g:"log",strictTuples:(S=(m=t.strictTuples)!==null&&m!==void 0?m:$)!==null&&S!==void 0?S:"log",strictRequired:(C=(E=t.strictRequired)!==null&&E!==void 0?E:$)!==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:Ex,loopEnum:(A=t.loopEnum)!==null&&A!==void 0?A:Ex,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:(w=t.unicodeRegExp)!==null&&w!==void 0?w:!0,int32range:(P=t.int32range)!==null&&P!==void 0?P:!0,uriResolver:Z}}var Tc=class{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...tj(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new KL.ValueScope({scope:{},prefixes:ZL,es5:r,lines:n}),this.logger=aj(e.logger);let i=e.validateFormats;e.validateFormats=!1,this.RULES=(0,zL.getRules)(),Cx.call(this,XL,e,"NOT SUPPORTED"),Cx.call(this,ej,e,"DEPRECATED","warn"),this._metaOpts=sj.call(this),e.formats&&nj.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&ij.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),rj.call(this),e.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,i=wx;n==="id"&&(i={...wx},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 Rx.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,Ac.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=xx.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,i=new kc.SchemaEnv({schema:{},schemaId:n});if(r=kc.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=xx.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,Ac.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(uj.call(this,n,r),!r)return(0,IS.eachItem)(n,s=>OS.call(this,s)),this;fj.call(this,r);let i={...r,type:(0,Gh.getJSONTypes)(r.type),schemaType:(0,Gh.getJSONTypes)(r.schemaType)};return(0,IS.eachItem)(n,i.type.length===0?s=>OS.call(this,s,i):s=>i.type.forEach(a=>OS.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]=Ix(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,Ac.normalizeId)(a||n);let h=Ac.getSchemaRefs.call(this,e,n);return f=new kc.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):kc.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{kc.compileSchema.call(this,e)}finally{this.opts=r}}};Tc.ValidationError=JL.default;Tc.MissingRefError=Rx.default;Qt.default=Tc;function Cx(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 xx(t){return t=(0,Ac.normalizeId)(t),this.schemas[t]||this.refs[t]}function rj(){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 nj(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function ij(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 sj(){let t={...this.opts};for(let e of QL)delete t[e];return t}var oj={log(){},warn(){},error(){}};function aj(t){if(t===!1)return oj;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 lj=/^[a-z_$][a-z0-9_$:-]*$/i;function uj(t,e){let{RULES:r}=this;if((0,IS.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!lj.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 OS(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,Gh.getJSONTypes)(e.type),schemaType:(0,Gh.getJSONTypes)(e.schemaType)}};e.before?cj.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 cj(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 fj(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Ix(e)),t.validateSchema=this.compile(e,!0))}var dj={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Ix(t){return{anyOf:[t,dj]}}});var kx=F(PS=>{"use strict";Object.defineProperty(PS,"__esModule",{value:!0});var hj={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};PS.default=hj});var Nx=F(Ko=>{"use strict";Object.defineProperty(Ko,"__esModule",{value:!0});Ko.callRef=Ko.getValidate=void 0;var pj=Ic(),Ax=hn(),Tr=$e(),kl=Qi(),Tx=Wh(),Qh=ze(),mj={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=Tx.resolveRef.call(f,h,i,r);if(g===void 0)throw new pj.default(n.opts.uriResolver,i,r);if(g instanceof Tx.SchemaEnv)return S(g);return E(g);function m(){if(s===h)return Zh(t,a,s,s.$async);let C=e.scopeValue("root",{ref:h});return Zh(t,(0,Tr._)`${C}.validate`,h,h.$async)}function S(C){let x=qx(t,C);Zh(t,x,C,C.$async)}function E(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 qx(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Tr._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Ko.getValidate=qx;function Zh(t,e,r,n){let{gen:i,it:s}=t,{allErrors:a,schemaEnv:u,opts:f}=s,h=f.passContext?kl.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,Ax.callValidateCode)(t,e,h)}`),E(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,Ax.callValidateCode)(t,e,h),()=>E(e),()=>S(e))}function S(C){let x=(0,Tr._)`${C}.errors`;i.assign(kl.default.vErrors,(0,Tr._)`${kl.default.vErrors} === null ? ${x} : ${kl.default.vErrors}.concat(${x})`),i.assign(kl.default.errors,(0,Tr._)`${kl.default.vErrors}.length`)}function E(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=Qh.mergeEvaluated.props(i,A.props,s.props));else{let T=i.var("props",(0,Tr._)`${C}.evaluated.props`);s.props=Qh.mergeEvaluated.props(i,T,s.props,Tr.Name)}if(s.items!==!0)if(A&&!A.dynamicItems)A.items!==void 0&&(s.items=Qh.mergeEvaluated.items(i,A.items,s.items));else{let T=i.var("items",(0,Tr._)`${C}.evaluated.items`);s.items=Qh.mergeEvaluated.items(i,T,s.items,Tr.Name)}}}Ko.callRef=Zh;Ko.default=mj});var Mx=F(kS=>{"use strict";Object.defineProperty(kS,"__esModule",{value:!0});var gj=kx(),yj=Nx(),vj=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",gj.default,yj.default];kS.default=vj});var $x=F(AS=>{"use strict";Object.defineProperty(AS,"__esModule",{value:!0});var Xh=$e(),Ks=Xh.operators,ep={maximum:{okStr:"<=",ok:Ks.LTE,fail:Ks.GT},minimum:{okStr:">=",ok:Ks.GTE,fail:Ks.LT},exclusiveMaximum:{okStr:"<",ok:Ks.LT,fail:Ks.GTE},exclusiveMinimum:{okStr:">",ok:Ks.GT,fail:Ks.LTE}},Sj={message:({keyword:t,schemaCode:e})=>(0,Xh.str)`must be ${ep[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Xh._)`{comparison: ${ep[t].okStr}, limit: ${e}}`},bj={keyword:Object.keys(ep),type:"number",schemaType:"number",$data:!0,error:Sj,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,Xh._)`${r} ${ep[e].fail} ${n} || isNaN(${r})`)}};AS.default=bj});var Dx=F(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});var qc=$e(),_j={message:({schemaCode:t})=>(0,qc.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,qc._)`{multipleOf: ${t}}`},wj={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:_j,code(t){let{gen:e,data:r,schemaCode:n,it:i}=t,s=i.opts.multipleOfPrecision,a=e.let("res"),u=s?(0,qc._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,qc._)`${a} !== parseInt(${a})`;t.fail$data((0,qc._)`(${n} === 0 || (${a} = ${r}/${n}, ${u}))`)}};TS.default=wj});var Lx=F(qS=>{"use strict";Object.defineProperty(qS,"__esModule",{value:!0});function Fx(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}qS.default=Fx;Fx.code='require("ajv/dist/runtime/ucs2length").default'});var jx=F(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});var Go=$e(),Ej=ze(),Cj=Lx(),xj={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Go.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Go._)`{limit: ${t}}`},Rj={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:xj,code(t){let{keyword:e,data:r,schemaCode:n,it:i}=t,s=e==="maxLength"?Go.operators.GT:Go.operators.LT,a=i.opts.unicode===!1?(0,Go._)`${r}.length`:(0,Go._)`${(0,Ej.useFunc)(t.gen,Cj.default)}(${r})`;t.fail$data((0,Go._)`${a} ${s} ${n}`)}};NS.default=Rj});var Ux=F(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});var Oj=hn(),tp=$e(),Ij={message:({schemaCode:t})=>(0,tp.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,tp._)`{pattern: ${t}}`},Pj={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:Ij,code(t){let{data:e,$data:r,schema:n,schemaCode:i,it:s}=t,a=s.opts.unicodeRegExp?"u":"",u=r?(0,tp._)`(new RegExp(${i}, ${a}))`:(0,Oj.usePattern)(t,n);t.fail$data((0,tp._)`!${u}.test(${e})`)}};MS.default=Pj});var Bx=F($S=>{"use strict";Object.defineProperty($S,"__esModule",{value:!0});var Nc=$e(),kj={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,Nc.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,Nc._)`{limit: ${t}}`},Aj={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:kj,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxProperties"?Nc.operators.GT:Nc.operators.LT;t.fail$data((0,Nc._)`Object.keys(${r}).length ${i} ${n}`)}};$S.default=Aj});var Hx=F(DS=>{"use strict";Object.defineProperty(DS,"__esModule",{value:!0});var Mc=hn(),$c=$e(),Tj=ze(),qj={message:({params:{missingProperty:t}})=>(0,$c.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,$c._)`{missingProperty: ${t}}`},Nj={keyword:"required",type:"object",schemaType:"array",$data:!0,error:qj,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 E=t.parentSchema.properties,{definedProperties:C}=t.it;for(let x of r)if(E?.[x]===void 0&&!C.has(x)){let A=a.schemaEnv.baseId+a.errSchemaPath,T=`required property "${x}" is not defined at "${A}" (strictRequired)`;(0,Tj.checkStrictMode)(a,T,a.opts.strictRequired)}}function h(){if(f||s)t.block$data($c.nil,m);else for(let E of r)(0,Mc.checkReportMissingProp)(t,E)}function g(){let E=e.let("missing");if(f||s){let C=e.let("valid",!0);t.block$data(C,()=>S(E,C)),t.ok(C)}else e.if((0,Mc.checkMissingProp)(t,r,E)),(0,Mc.reportMissingProp)(t,E),e.else()}function m(){e.forOf("prop",n,E=>{t.setParams({missingProperty:E}),e.if((0,Mc.noPropertyInData)(e,i,E,u.ownProperties),()=>t.error())})}function S(E,C){t.setParams({missingProperty:E}),e.forOf(E,n,()=>{e.assign(C,(0,Mc.propertyInData)(e,i,E,u.ownProperties)),e.if((0,$c.not)(C),()=>{t.error(),e.break()})},$c.nil)}}};DS.default=Nj});var Vx=F(FS=>{"use strict";Object.defineProperty(FS,"__esModule",{value:!0});var Dc=$e(),Mj={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,Dc.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,Dc._)`{limit: ${t}}`},$j={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Mj,code(t){let{keyword:e,data:r,schemaCode:n}=t,i=e==="maxItems"?Dc.operators.GT:Dc.operators.LT;t.fail$data((0,Dc._)`${r}.length ${i} ${n}`)}};FS.default=$j});var rp=F(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});var Wx=uS();Wx.code='require("ajv/dist/runtime/equal").default';LS.default=Wx});var Yx=F(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});var jS=Ec(),Zt=$e(),Dj=ze(),Fj=rp(),Lj={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}}`},jj={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Lj,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,jS.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:E)(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,jS.checkDataTypes)(h,A,u.opts.strictNumbers,jS.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 E(C,x){let A=(0,Dj.useFunc)(e,Fj.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)})))}}};US.default=jj});var Jx=F(HS=>{"use strict";Object.defineProperty(HS,"__esModule",{value:!0});var BS=$e(),Uj=ze(),Bj=rp(),Hj={message:"must be equal to constant",params:({schemaCode:t})=>(0,BS._)`{allowedValue: ${t}}`},Vj={keyword:"const",$data:!0,error:Hj,code(t){let{gen:e,data:r,$data:n,schemaCode:i,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,BS._)`!${(0,Uj.useFunc)(e,Bj.default)}(${r}, ${i})`):t.fail((0,BS._)`${s} !== ${r}`)}};HS.default=Vj});var zx=F(VS=>{"use strict";Object.defineProperty(VS,"__esModule",{value:!0});var Fc=$e(),Wj=ze(),Yj=rp(),Jj={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,Fc._)`{allowedValues: ${t}}`},zj={keyword:"enum",schemaType:"array",$data:!0,error:Jj,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,Wj.useFunc)(e,Yj.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=e.const("vSchema",s);g=(0,Fc.or)(...i.map((C,x)=>S(E,x)))}t.pass(g);function m(){e.assign(g,!1),e.forOf("v",s,E=>e.if((0,Fc._)`${h()}(${r}, ${E})`,()=>e.assign(g,!0).break()))}function S(E,C){let x=i[C];return typeof x=="object"&&x!==null?(0,Fc._)`${h()}(${r}, ${E}[${C}])`:(0,Fc._)`${r} === ${x}`}}};VS.default=zj});var Kx=F(WS=>{"use strict";Object.defineProperty(WS,"__esModule",{value:!0});var Kj=$x(),Gj=Dx(),Qj=jx(),Zj=Ux(),Xj=Bx(),e2=Hx(),t2=Vx(),r2=Yx(),n2=Jx(),i2=zx(),s2=[Kj.default,Gj.default,Qj.default,Zj.default,Xj.default,e2.default,t2.default,r2.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},n2.default,i2.default];WS.default=s2});var JS=F(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.validateAdditionalItems=void 0;var Qo=$e(),YS=ze(),o2={message:({params:{len:t}})=>(0,Qo.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Qo._)`{limit: ${t}}`},a2={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:o2,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,YS.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}Gx(t,n)}};function Gx(t,e){let{gen:r,schema:n,data:i,keyword:s,it:a}=t;a.items=!0;let u=r.const("len",(0,Qo._)`${i}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Qo._)`${u} <= ${e.length}`);else if(typeof n=="object"&&!(0,YS.alwaysValidSchema)(a,n)){let h=r.var("valid",(0,Qo._)`${u} <= ${e.length}`);r.if((0,Qo.not)(h),()=>f(h)),t.ok(h)}function f(h){r.forRange("i",e.length,u,g=>{t.subschema({keyword:s,dataProp:g,dataPropType:YS.Type.Num},h),a.allErrors||r.if((0,Qo.not)(h),()=>r.break())})}}Lc.validateAdditionalItems=Gx;Lc.default=a2});var zS=F(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.validateTuple=void 0;var Qx=$e(),np=ze(),l2=hn(),u2={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return Zx(t,"additionalItems",e);r.items=!0,!(0,np.alwaysValidSchema)(r,e)&&t.ok((0,l2.validateArray)(t))}};function Zx(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=np.mergeEvaluated.items(n,r.length,u.items));let f=n.name("valid"),h=n.const("len",(0,Qx._)`${s}.length`);r.forEach((m,S)=>{(0,np.alwaysValidSchema)(u,m)||(n.if((0,Qx._)`${h} > ${S}`,()=>t.subschema({keyword:a,schemaProp:S,dataProp:S},f)),t.ok(f))});function g(m){let{opts:S,errSchemaPath:E}=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 "${E}"`;(0,np.checkStrictMode)(u,A,S.strictTuples)}}}jc.validateTuple=Zx;jc.default=u2});var Xx=F(KS=>{"use strict";Object.defineProperty(KS,"__esModule",{value:!0});var c2=zS(),f2={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,c2.validateTuple)(t,"items")};KS.default=f2});var tR=F(GS=>{"use strict";Object.defineProperty(GS,"__esModule",{value:!0});var eR=$e(),d2=ze(),h2=hn(),p2=JS(),m2={message:({params:{len:t}})=>(0,eR.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,eR._)`{limit: ${t}}`},g2={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:m2,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,!(0,d2.alwaysValidSchema)(n,e)&&(i?(0,p2.validateAdditionalItems)(t,i):t.ok((0,h2.validateArray)(t)))}};GS.default=g2});var rR=F(QS=>{"use strict";Object.defineProperty(QS,"__esModule",{value:!0});var mn=$e(),ip=ze(),y2={message:({params:{min:t,max:e}})=>e===void 0?(0,mn.str)`must contain at least ${t} valid item(s)`:(0,mn.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,mn._)`{minContains: ${t}}`:(0,mn._)`{minContains: ${t}, maxContains: ${e}}`},v2={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:y2,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,mn._)`${i}.length`);if(t.setParams({min:a,max:u}),u===void 0&&a===0){(0,ip.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(u!==void 0&&a>u){(0,ip.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,ip.alwaysValidSchema)(s,r)){let x=(0,mn._)`${g} >= ${a}`;u!==void 0&&(x=(0,mn._)`${x} && ${g} <= ${u}`),t.pass(x);return}s.items=!0;let m=e.name("valid");u===void 0&&a===1?E(m,()=>e.if(m,()=>e.break())):a===0?(e.let(m,!0),u!==void 0&&e.if((0,mn._)`${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);E(x,()=>e.if(x,()=>C(A)))}function E(x,A){e.forRange("i",0,g,T=>{t.subschema({keyword:"contains",dataProp:T,dataPropType:ip.Type.Num,compositeRule:!0},x),A()})}function C(x){e.code((0,mn._)`${x}++`),u===void 0?e.if((0,mn._)`${x} >= ${a}`,()=>e.assign(m,!0).break()):(e.if((0,mn._)`${x} > ${u}`,()=>e.assign(m,!1).break()),a===1?e.assign(m,!0):e.if((0,mn._)`${x} >= ${a}`,()=>e.assign(m,!0)))}}};QS.default=v2});var sR=F(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.validateSchemaDeps=Ei.validatePropertyDeps=Ei.error=void 0;var ZS=$e(),S2=ze(),Uc=hn();Ei.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,ZS.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,ZS._)`{property: ${t},
|
|
28
28
|
missingProperty: ${n},
|
|
29
29
|
depsCount: ${e},
|
|
30
|
-
deps: ${t}}`};var b2={keyword:"dependencies",type:"object",schemaType:"object",error:Ci.error,code(r){let[e,t]=_2(r);nR(r,e),iR(r,t)}};function _2({schema:r}){let e={},t={};for(let n in r){if(n==="__proto__")continue;let i=Array.isArray(r[n])?e:t;i[n]=r[n]}return[e,t]}function nR(r,e=r.schema){let{gen:t,data:n,it:i}=r;if(Object.keys(e).length===0)return;let s=t.let("missing");for(let a in e){let u=e[a];if(u.length===0)continue;let f=(0,Uc.propertyInData)(t,n,a,i.opts.ownProperties);r.setParams({property:a,depsCount:u.length,deps:u.join(", ")}),i.allErrors?t.if(f,()=>{for(let h of u)(0,Uc.checkReportMissingProp)(r,h)}):(t.if((0,XS._)`${f} && (${(0,Uc.checkMissingProp)(r,u,s)})`),(0,Uc.reportMissingProp)(r,s),t.else())}}Ci.validatePropertyDeps=nR;function iR(r,e=r.schema){let{gen:t,data:n,keyword:i,it:s}=r,a=t.name("valid");for(let u in e)(0,S2.alwaysValidSchema)(s,e[u])||(t.if((0,Uc.propertyInData)(t,n,u,s.opts.ownProperties),()=>{let f=r.subschema({keyword:i,schemaProp:u},a);r.mergeValidEvaluated(f,a)},()=>t.var(a,!0)),r.ok(a))}Ci.validateSchemaDeps=iR;Ci.default=b2});var aR=F(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});var oR=$e(),w2=ze(),C2={message:"property name must be valid",params:({params:r})=>(0,oR._)`{propertyName: ${r.propertyName}}`},E2={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:C2,code(r){let{gen:e,schema:t,data:n,it:i}=r;if((0,w2.alwaysValidSchema)(i,t))return;let s=e.name("valid");e.forIn("key",n,a=>{r.setParams({propertyName:a}),r.subschema({keyword:"propertyNames",data:a,dataTypes:["string"],propertyName:a,compositeRule:!0},s),e.if((0,oR.not)(s),()=>{r.error(!0),i.allErrors||e.break()})}),r.ok(s)}};eb.default=E2});var rb=F(tb=>{"use strict";Object.defineProperty(tb,"__esModule",{value:!0});var op=hn(),Un=$e(),x2=Qi(),ap=ze(),R2={message:"must NOT have additional properties",params:({params:r})=>(0,Un._)`{additionalProperty: ${r.additionalProperty}}`},I2={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:R2,code(r){let{gen:e,schema:t,parentSchema:n,data:i,errsCount:s,it:a}=r;if(!s)throw new Error("ajv implementation error");let{allErrors:u,opts:f}=a;if(a.props=!0,f.removeAdditional!=="all"&&(0,ap.alwaysValidSchema)(a,t))return;let h=(0,op.allSchemaProperties)(n.properties),m=(0,op.allSchemaProperties)(n.patternProperties);g(),r.ok((0,Un._)`${s} === ${x2.default.errors}`);function g(){e.forIn("key",i,A=>{!h.length&&!m.length?C(A):e.if(S(A),()=>C(A))})}function S(A){let q;if(h.length>8){let j=(0,ap.schemaRefOrVal)(a,n.properties,"properties");q=(0,op.isOwnProperty)(e,j,A)}else h.length?q=(0,Un.or)(...h.map(j=>(0,Un._)`${A} === ${j}`)):q=Un.nil;return m.length&&(q=(0,Un.or)(q,...m.map(j=>(0,Un._)`${(0,op.usePattern)(r,j)}.test(${A})`))),(0,Un.not)(q)}function E(A){e.code((0,Un._)`delete ${i}[${A}]`)}function C(A){if(f.removeAdditional==="all"||f.removeAdditional&&t===!1){E(A);return}if(t===!1){r.setParams({additionalProperty:A}),r.error(),u||e.break();return}if(typeof t=="object"&&!(0,ap.alwaysValidSchema)(a,t)){let q=e.name("valid");f.removeAdditional==="failing"?(x(A,q,!1),e.if((0,Un.not)(q),()=>{r.reset(),E(A)})):(x(A,q),u||e.if((0,Un.not)(q),()=>e.break()))}}function x(A,q,j){let Y={keyword:"additionalProperties",dataProp:A,dataPropType:ap.Type.Str};j===!1&&Object.assign(Y,{compositeRule:!0,createErrors:!1,allErrors:!1}),r.subschema(Y,q)}}};tb.default=I2});var cR=F(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0});var O2=Ic(),lR=hn(),nb=ze(),uR=rb(),P2={keyword:"properties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,parentSchema:n,data:i,it:s}=r;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&uR.default.code(new O2.KeywordCxt(s,uR.default,"additionalProperties"));let a=(0,lR.allSchemaProperties)(t);for(let g of a)s.definedProperties.add(g);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=nb.mergeEvaluated.props(e,(0,nb.toHash)(a),s.props));let u=a.filter(g=>!(0,nb.alwaysValidSchema)(s,t[g]));if(u.length===0)return;let f=e.name("valid");for(let g of u)h(g)?m(g):(e.if((0,lR.propertyInData)(e,i,g,s.opts.ownProperties)),m(g),s.allErrors||e.else().var(f,!0),e.endIf()),r.it.definedProperties.add(g),r.ok(f);function h(g){return s.opts.useDefaults&&!s.compositeRule&&t[g].default!==void 0}function m(g){r.subschema({keyword:"properties",schemaProp:g,dataProp:g},f)}}};ib.default=P2});var pR=F(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});var fR=hn(),lp=$e(),dR=ze(),hR=ze(),k2={keyword:"patternProperties",type:"object",schemaType:"object",code(r){let{gen:e,schema:t,data:n,parentSchema:i,it:s}=r,{opts:a}=s,u=(0,fR.allSchemaProperties)(t),f=u.filter(x=>(0,dR.alwaysValidSchema)(s,t[x]));if(u.length===0||f.length===u.length&&(!s.opts.unevaluated||s.props===!0))return;let h=a.strictSchema&&!a.allowMatchingProperties&&i.properties,m=e.name("valid");s.props!==!0&&!(s.props instanceof lp.Name)&&(s.props=(0,hR.evaluatedPropsToName)(e,s.props));let{props:g}=s;S();function S(){for(let x of u)h&&E(x),s.allErrors?C(x):(e.var(m,!0),C(x),e.if(m))}function E(x){for(let A in h)new RegExp(x).test(A)&&(0,dR.checkStrictMode)(s,`property ${A} matches pattern ${x} (use allowMatchingProperties)`)}function C(x){e.forIn("key",n,A=>{e.if((0,lp._)`${(0,fR.usePattern)(r,x)}.test(${A})`,()=>{let q=f.includes(x);q||r.subschema({keyword:"patternProperties",schemaProp:x,dataProp:A,dataPropType:hR.Type.Str},m),s.opts.unevaluated&&g!==!0?e.assign((0,lp._)`${g}[${A}]`,!0):!q&&!s.allErrors&&e.if((0,lp.not)(m),()=>e.break())})})}}};sb.default=k2});var mR=F(ob=>{"use strict";Object.defineProperty(ob,"__esModule",{value:!0});var A2=ze(),T2={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){let{gen:e,schema:t,it:n}=r;if((0,A2.alwaysValidSchema)(n,t)){r.fail();return}let i=e.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),r.failResult(i,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};ob.default=T2});var gR=F(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});var q2=hn(),N2={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:q2.validateUnion,error:{message:"must match a schema in anyOf"}};ab.default=N2});var yR=F(lb=>{"use strict";Object.defineProperty(lb,"__esModule",{value:!0});var up=$e(),M2=ze(),$2={message:"must match exactly one schema in oneOf",params:({params:r})=>(0,up._)`{passingSchemas: ${r.passing}}`},D2={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:$2,code(r){let{gen:e,schema:t,parentSchema:n,it:i}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;let s=t,a=e.let("valid",!1),u=e.let("passing",null),f=e.name("_valid");r.setParams({passing:u}),e.block(h),r.result(a,()=>r.reset(),()=>r.error(!0));function h(){s.forEach((m,g)=>{let S;(0,M2.alwaysValidSchema)(i,m)?e.var(f,!0):S=r.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},f),g>0&&e.if((0,up._)`${f} && ${a}`).assign(a,!1).assign(u,(0,up._)`[${u}, ${g}]`).else(),e.if(f,()=>{e.assign(a,!0),e.assign(u,g),S&&r.mergeEvaluated(S,up.Name)})})}}};lb.default=D2});var vR=F(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var F2=ze(),L2={keyword:"allOf",schemaType:"array",code(r){let{gen:e,schema:t,it:n}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");let i=e.name("valid");t.forEach((s,a)=>{if((0,F2.alwaysValidSchema)(n,s))return;let u=r.subschema({keyword:"allOf",schemaProp:a},i);r.ok(i),r.mergeEvaluated(u)})}};ub.default=L2});var _R=F(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var cp=$e(),bR=ze(),j2={message:({params:r})=>(0,cp.str)`must match "${r.ifClause}" schema`,params:({params:r})=>(0,cp._)`{failingKeyword: ${r.ifClause}}`},U2={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:j2,code(r){let{gen:e,parentSchema:t,it:n}=r;t.then===void 0&&t.else===void 0&&(0,bR.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=SR(n,"then"),s=SR(n,"else");if(!i&&!s)return;let a=e.let("valid",!0),u=e.name("_valid");if(f(),r.reset(),i&&s){let m=e.let("ifClause");r.setParams({ifClause:m}),e.if(u,h("then",m),h("else",m))}else i?e.if(u,h("then")):e.if((0,cp.not)(u),h("else"));r.pass(a,()=>r.error(!0));function f(){let m=r.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);r.mergeEvaluated(m)}function h(m,g){return()=>{let S=r.subschema({keyword:m},u);e.assign(a,u),r.mergeValidEvaluated(S,a),g?e.assign(g,(0,cp._)`${m}`):r.setParams({ifClause:m})}}}};function SR(r,e){let t=r.schema[e];return t!==void 0&&!(0,bR.alwaysValidSchema)(r,t)}cb.default=U2});var wR=F(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});var B2=ze(),H2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:e,it:t}){e.if===void 0&&(0,B2.checkStrictMode)(t,`"${r}" without "if" is ignored`)}};fb.default=H2});var CR=F(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var V2=zS(),W2=Xx(),Y2=KS(),J2=tR(),z2=rR(),K2=sR(),G2=aR(),Q2=rb(),Z2=cR(),X2=pR(),eU=mR(),tU=gR(),rU=yR(),nU=vR(),iU=_R(),sU=wR();function oU(r=!1){let e=[eU.default,tU.default,rU.default,nU.default,iU.default,sU.default,G2.default,Q2.default,K2.default,Z2.default,X2.default];return r?e.push(W2.default,J2.default):e.push(V2.default,Y2.default),e.push(z2.default),e}db.default=oU});var ER=F(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});var Nt=$e(),aU={message:({schemaCode:r})=>(0,Nt.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,Nt._)`{format: ${r}}`},lU={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:aU,code(r,e){let{gen:t,data:n,$data:i,schema:s,schemaCode:a,it:u}=r,{opts:f,errSchemaPath:h,schemaEnv:m,self:g}=u;if(!f.validateFormats)return;i?S():E();function S(){let C=t.scopeValue("formats",{ref:g.formats,code:f.code.formats}),x=t.const("fDef",(0,Nt._)`${C}[${a}]`),A=t.let("fType"),q=t.let("format");t.if((0,Nt._)`typeof ${x} == "object" && !(${x} instanceof RegExp)`,()=>t.assign(A,(0,Nt._)`${x}.type || "string"`).assign(q,(0,Nt._)`${x}.validate`),()=>t.assign(A,(0,Nt._)`"string"`).assign(q,x)),r.fail$data((0,Nt.or)(j(),Y()));function j(){return f.strictSchema===!1?Nt.nil:(0,Nt._)`${a} && !${q}`}function Y(){let V=m.$async?(0,Nt._)`(${x}.async ? await ${q}(${n}) : ${q}(${n}))`:(0,Nt._)`${q}(${n})`,K=(0,Nt._)`(typeof ${q} == "function" ? ${V} : ${q}.test(${n}))`;return(0,Nt._)`${q} && ${q} !== true && ${A} === ${e} && !${K}`}}function E(){let C=g.formats[s];if(!C){j();return}if(C===!0)return;let[x,A,q]=Y(C);x===e&&r.pass(V());function j(){if(f.strictSchema===!1){g.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,Nt.regexpCode)(K):f.code.formats?(0,Nt._)`${f.code.formats}${(0,Nt.getProperty)(s)}`:void 0,k=t.scopeValue("formats",{key:s,ref:K,code:ee});return typeof K=="object"&&!(K instanceof RegExp)?[K.type||"string",K.validate,(0,Nt._)`${k}.validate`]:["string",K,k]}function V(){if(typeof C=="object"&&!(C instanceof RegExp)&&C.async){if(!m.$async)throw new Error("async format in sync schema");return(0,Nt._)`await ${q}(${n})`}return typeof A=="function"?(0,Nt._)`${q}(${n})`:(0,Nt._)`${q}.test(${n})`}}}};hb.default=lU});var xR=F(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});var uU=ER(),cU=[uU.default];pb.default=cU});var RR=F(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.contentVocabulary=Al.metadataVocabulary=void 0;Al.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Al.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var OR=F(mb=>{"use strict";Object.defineProperty(mb,"__esModule",{value:!0});var fU=Mx(),dU=Kx(),hU=CR(),pU=xR(),IR=RR(),mU=[fU.default,dU.default,(0,hU.default)(),pU.default,IR.metadataVocabulary,IR.contentVocabulary];mb.default=mU});var kR=F(fp=>{"use strict";Object.defineProperty(fp,"__esModule",{value:!0});fp.DiscrError=void 0;var PR;(function(r){r.Tag="tag",r.Mapping="mapping"})(PR||(fp.DiscrError=PR={}))});var TR=F(yb=>{"use strict";Object.defineProperty(yb,"__esModule",{value:!0});var Tl=$e(),gb=kR(),AR=Yh(),gU=Oc(),yU=ze(),vU={message:({params:{discrError:r,tagName:e}})=>r===gb.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:r,tag:e,tagName:t}})=>(0,Tl._)`{error: ${r}, tag: ${t}, tagValue: ${e}}`},SU={keyword:"discriminator",type:"object",schemaType:"object",error:vU,code(r){let{gen:e,data:t,schema:n,parentSchema:i,it:s}=r,{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,Tl._)`${t}${(0,Tl.getProperty)(u)}`);e.if((0,Tl._)`typeof ${h} == "string"`,()=>m(),()=>r.error(!1,{discrError:gb.DiscrError.Tag,tag:h,tagName:u})),r.ok(f);function m(){let E=S();e.if(!1);for(let C in E)e.elseIf((0,Tl._)`${h} === ${C}`),e.assign(f,g(E[C]));e.else(),r.error(!1,{discrError:gb.DiscrError.Mapping,tag:h,tagName:u}),e.endIf()}function g(E){let C=e.name("valid"),x=r.subschema({keyword:"oneOf",schemaProp:E},C);return r.mergeEvaluated(x,Tl.Name),C}function S(){var E;let C={},x=q(i),A=!0;for(let V=0;V<a.length;V++){let K=a[V];if(K?.$ref&&!(0,yU.schemaHasRulesButRef)(K,s.self.RULES)){let k=K.$ref;if(K=AR.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,k),K instanceof AR.SchemaEnv&&(K=K.schema),K===void 0)throw new gU.default(s.opts.uriResolver,s.baseId,k)}let ee=(E=K?.properties)===null||E===void 0?void 0:E[u];if(typeof ee!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${u}"`);A=A&&(x||q(K)),j(ee,V)}if(!A)throw new Error(`discriminator: "${u}" must be required`);return C;function q({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}}}};yb.default=SU});var qR=F((A4,bU)=>{bU.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 MR=F((pt,vb)=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.MissingRefError=pt.ValidationError=pt.CodeGen=pt.Name=pt.nil=pt.stringify=pt.str=pt._=pt.KeywordCxt=pt.Ajv=void 0;var _U=Px(),wU=OR(),CU=TR(),NR=qR(),EU=["/properties"],dp="http://json-schema.org/draft-07/schema",ql=class extends _U.default{_addVocabularies(){super._addVocabularies(),wU.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(CU.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(NR,EU):NR;this.addMetaSchema(e,dp,!1),this.refs["http://json-schema.org/schema"]=dp}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(dp)?dp:void 0)}};pt.Ajv=ql;vb.exports=pt=ql;vb.exports.Ajv=ql;Object.defineProperty(pt,"__esModule",{value:!0});pt.default=ql;var xU=Ic();Object.defineProperty(pt,"KeywordCxt",{enumerable:!0,get:function(){return xU.KeywordCxt}});var Nl=$e();Object.defineProperty(pt,"_",{enumerable:!0,get:function(){return Nl._}});Object.defineProperty(pt,"str",{enumerable:!0,get:function(){return Nl.str}});Object.defineProperty(pt,"stringify",{enumerable:!0,get:function(){return Nl.stringify}});Object.defineProperty(pt,"nil",{enumerable:!0,get:function(){return Nl.nil}});Object.defineProperty(pt,"Name",{enumerable:!0,get:function(){return Nl.Name}});Object.defineProperty(pt,"CodeGen",{enumerable:!0,get:function(){return Nl.CodeGen}});var RU=Vh();Object.defineProperty(pt,"ValidationError",{enumerable:!0,get:function(){return RU.default}});var IU=Oc();Object.defineProperty(pt,"MissingRefError",{enumerable:!0,get:function(){return IU.default}})});var We=F(er=>{"use strict";var xb=Symbol.for("yaml.alias"),QR=Symbol.for("yaml.document"),Rp=Symbol.for("yaml.map"),ZR=Symbol.for("yaml.pair"),Rb=Symbol.for("yaml.scalar"),Ip=Symbol.for("yaml.seq"),es=Symbol.for("yaml.node.type"),KU=r=>!!r&&typeof r=="object"&&r[es]===xb,GU=r=>!!r&&typeof r=="object"&&r[es]===QR,QU=r=>!!r&&typeof r=="object"&&r[es]===Rp,ZU=r=>!!r&&typeof r=="object"&&r[es]===ZR,XR=r=>!!r&&typeof r=="object"&&r[es]===Rb,XU=r=>!!r&&typeof r=="object"&&r[es]===Ip;function eI(r){if(r&&typeof r=="object")switch(r[es]){case Rp:case Ip:return!0}return!1}function eB(r){if(r&&typeof r=="object")switch(r[es]){case xb:case Rp:case Rb:case Ip:return!0}return!1}var tB=r=>(XR(r)||eI(r))&&!!r.anchor;er.ALIAS=xb;er.DOC=QR;er.MAP=Rp;er.NODE_TYPE=es;er.PAIR=ZR;er.SCALAR=Rb;er.SEQ=Ip;er.hasAnchor=tB;er.isAlias=KU;er.isCollection=eI;er.isDocument=GU;er.isMap=QU;er.isNode=eB;er.isPair=ZU;er.isScalar=XR;er.isSeq=XU});var Qc=F(Ib=>{"use strict";var Ht=We(),Mr=Symbol("break visit"),tI=Symbol("skip children"),Ri=Symbol("remove node");function Op(r,e){let t=rI(e);Ht.isDocument(r)?ru(null,r.contents,t,Object.freeze([r]))===Ri&&(r.contents=null):ru(null,r,t,Object.freeze([]))}Op.BREAK=Mr;Op.SKIP=tI;Op.REMOVE=Ri;function ru(r,e,t,n){let i=nI(r,e,t,n);if(Ht.isNode(i)||Ht.isPair(i))return iI(r,n,i),ru(r,i,t,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=ru(s,e.items[s],t,n);if(typeof a=="number")s=a-1;else{if(a===Mr)return Mr;a===Ri&&(e.items.splice(s,1),s-=1)}}}else if(Ht.isPair(e)){n=Object.freeze(n.concat(e));let s=ru("key",e.key,t,n);if(s===Mr)return Mr;s===Ri&&(e.key=null);let a=ru("value",e.value,t,n);if(a===Mr)return Mr;a===Ri&&(e.value=null)}}return i}async function Pp(r,e){let t=rI(e);Ht.isDocument(r)?await nu(null,r.contents,t,Object.freeze([r]))===Ri&&(r.contents=null):await nu(null,r,t,Object.freeze([]))}Pp.BREAK=Mr;Pp.SKIP=tI;Pp.REMOVE=Ri;async function nu(r,e,t,n){let i=await nI(r,e,t,n);if(Ht.isNode(i)||Ht.isPair(i))return iI(r,n,i),nu(r,i,t,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 nu(s,e.items[s],t,n);if(typeof a=="number")s=a-1;else{if(a===Mr)return Mr;a===Ri&&(e.items.splice(s,1),s-=1)}}}else if(Ht.isPair(e)){n=Object.freeze(n.concat(e));let s=await nu("key",e.key,t,n);if(s===Mr)return Mr;s===Ri&&(e.key=null);let a=await nu("value",e.value,t,n);if(a===Mr)return Mr;a===Ri&&(e.value=null)}}return i}function rI(r){return typeof r=="object"&&(r.Collection||r.Node||r.Value)?Object.assign({Alias:r.Node,Map:r.Node,Scalar:r.Node,Seq:r.Node},r.Value&&{Map:r.Value,Scalar:r.Value,Seq:r.Value},r.Collection&&{Map:r.Collection,Seq:r.Collection},r):r}function nI(r,e,t,n){if(typeof t=="function")return t(r,e,n);if(Ht.isMap(e))return t.Map?.(r,e,n);if(Ht.isSeq(e))return t.Seq?.(r,e,n);if(Ht.isPair(e))return t.Pair?.(r,e,n);if(Ht.isScalar(e))return t.Scalar?.(r,e,n);if(Ht.isAlias(e))return t.Alias?.(r,e,n)}function iI(r,e,t){let n=e[e.length-1];if(Ht.isCollection(n))n.items[r]=t;else if(Ht.isPair(n))r==="key"?n.key=t:n.value=t;else if(Ht.isDocument(n))n.contents=t;else{let i=Ht.isAlias(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}Ib.visit=Op;Ib.visitAsync=Pp});var Ob=F(oI=>{"use strict";var sI=We(),rB=Qc(),nB={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},iB=r=>r.replace(/[!,[\]{}]/g,e=>nB[e]),Zc=class r{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},r.defaultYaml,e),this.tags=Object.assign({},r.defaultTags,t)}clone(){let e=new r(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new r(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:r.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},r.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:r.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},r.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(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 t(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 t(6,`Unsupported YAML version ${s}`,a),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}let[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);let s=this.tags[n];if(s)try{return s+decodeURIComponent(i)}catch(a){return t(String(a)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+iB(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags),i;if(e&&n.length>0&&sI.isNode(e.contents)){let s={};rB.visit(e.contents,(a,u)=>{sI.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)))&&t.push(`%TAG ${s} ${a}`);return t.join(`
|
|
31
|
-
`)}};
|
|
32
|
-
`)?Mb(
|
|
30
|
+
deps: ${r}}`};var b2={keyword:"dependencies",type:"object",schemaType:"object",error:Ei.error,code(t){let[e,r]=_2(t);nR(t,e),iR(t,r)}};function _2({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 nR(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,Uc.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,Uc.checkReportMissingProp)(t,h)}):(r.if((0,ZS._)`${f} && (${(0,Uc.checkMissingProp)(t,u,s)})`),(0,Uc.reportMissingProp)(t,s),r.else())}}Ei.validatePropertyDeps=nR;function iR(t,e=t.schema){let{gen:r,data:n,keyword:i,it:s}=t,a=r.name("valid");for(let u in e)(0,S2.alwaysValidSchema)(s,e[u])||(r.if((0,Uc.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))}Ei.validateSchemaDeps=iR;Ei.default=b2});var aR=F(XS=>{"use strict";Object.defineProperty(XS,"__esModule",{value:!0});var oR=$e(),w2=ze(),E2={message:"property name must be valid",params:({params:t})=>(0,oR._)`{propertyName: ${t.propertyName}}`},C2={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:E2,code(t){let{gen:e,schema:r,data:n,it:i}=t;if((0,w2.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,oR.not)(s),()=>{t.error(!0),i.allErrors||e.break()})}),t.ok(s)}};XS.default=C2});var tb=F(eb=>{"use strict";Object.defineProperty(eb,"__esModule",{value:!0});var sp=hn(),Un=$e(),x2=Qi(),op=ze(),R2={message:"must NOT have additional properties",params:({params:t})=>(0,Un._)`{additionalProperty: ${t.additionalProperty}}`},O2={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:R2,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,op.alwaysValidSchema)(a,r))return;let h=(0,sp.allSchemaProperties)(n.properties),g=(0,sp.allSchemaProperties)(n.patternProperties);m(),t.ok((0,Un._)`${s} === ${x2.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,op.schemaRefOrVal)(a,n.properties,"properties");T=(0,sp.isOwnProperty)(e,j,A)}else h.length?T=(0,Un.or)(...h.map(j=>(0,Un._)`${A} === ${j}`)):T=Un.nil;return g.length&&(T=(0,Un.or)(T,...g.map(j=>(0,Un._)`${(0,sp.usePattern)(t,j)}.test(${A})`))),(0,Un.not)(T)}function E(A){e.code((0,Un._)`delete ${i}[${A}]`)}function C(A){if(f.removeAdditional==="all"||f.removeAdditional&&r===!1){E(A);return}if(r===!1){t.setParams({additionalProperty:A}),t.error(),u||e.break();return}if(typeof r=="object"&&!(0,op.alwaysValidSchema)(a,r)){let T=e.name("valid");f.removeAdditional==="failing"?(x(A,T,!1),e.if((0,Un.not)(T),()=>{t.reset(),E(A)})):(x(A,T),u||e.if((0,Un.not)(T),()=>e.break()))}}function x(A,T,j){let Y={keyword:"additionalProperties",dataProp:A,dataPropType:op.Type.Str};j===!1&&Object.assign(Y,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(Y,T)}}};eb.default=O2});var cR=F(nb=>{"use strict";Object.defineProperty(nb,"__esModule",{value:!0});var I2=Oc(),lR=hn(),rb=ze(),uR=tb(),P2={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&&uR.default.code(new I2.KeywordCxt(s,uR.default,"additionalProperties"));let a=(0,lR.allSchemaProperties)(r);for(let m of a)s.definedProperties.add(m);s.opts.unevaluated&&a.length&&s.props!==!0&&(s.props=rb.mergeEvaluated.props(e,(0,rb.toHash)(a),s.props));let u=a.filter(m=>!(0,rb.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,lR.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)}}};nb.default=P2});var pR=F(ib=>{"use strict";Object.defineProperty(ib,"__esModule",{value:!0});var fR=hn(),ap=$e(),dR=ze(),hR=ze(),k2={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,fR.allSchemaProperties)(r),f=u.filter(x=>(0,dR.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 ap.Name)&&(s.props=(0,hR.evaluatedPropsToName)(e,s.props));let{props:m}=s;S();function S(){for(let x of u)h&&E(x),s.allErrors?C(x):(e.var(g,!0),C(x),e.if(g))}function E(x){for(let A in h)new RegExp(x).test(A)&&(0,dR.checkStrictMode)(s,`property ${A} matches pattern ${x} (use allowMatchingProperties)`)}function C(x){e.forIn("key",n,A=>{e.if((0,ap._)`${(0,fR.usePattern)(t,x)}.test(${A})`,()=>{let T=f.includes(x);T||t.subschema({keyword:"patternProperties",schemaProp:x,dataProp:A,dataPropType:hR.Type.Str},g),s.opts.unevaluated&&m!==!0?e.assign((0,ap._)`${m}[${A}]`,!0):!T&&!s.allErrors&&e.if((0,ap.not)(g),()=>e.break())})})}}};ib.default=k2});var mR=F(sb=>{"use strict";Object.defineProperty(sb,"__esModule",{value:!0});var A2=ze(),T2={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,A2.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"}};sb.default=T2});var gR=F(ob=>{"use strict";Object.defineProperty(ob,"__esModule",{value:!0});var q2=hn(),N2={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:q2.validateUnion,error:{message:"must match a schema in anyOf"}};ob.default=N2});var yR=F(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});var lp=$e(),M2=ze(),$2={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,lp._)`{passingSchemas: ${t.passing}}`},D2={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:$2,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,M2.alwaysValidSchema)(i,g)?e.var(f,!0):S=t.subschema({keyword:"oneOf",schemaProp:m,compositeRule:!0},f),m>0&&e.if((0,lp._)`${f} && ${a}`).assign(a,!1).assign(u,(0,lp._)`[${u}, ${m}]`).else(),e.if(f,()=>{e.assign(a,!0),e.assign(u,m),S&&t.mergeEvaluated(S,lp.Name)})})}}};ab.default=D2});var vR=F(lb=>{"use strict";Object.defineProperty(lb,"__esModule",{value:!0});var F2=ze(),L2={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,F2.alwaysValidSchema)(n,s))return;let u=t.subschema({keyword:"allOf",schemaProp:a},i);t.ok(i),t.mergeEvaluated(u)})}};lb.default=L2});var _R=F(ub=>{"use strict";Object.defineProperty(ub,"__esModule",{value:!0});var up=$e(),bR=ze(),j2={message:({params:t})=>(0,up.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,up._)`{failingKeyword: ${t.ifClause}}`},U2={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:j2,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,bR.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let i=SR(n,"then"),s=SR(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,up.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,up._)`${g}`):t.setParams({ifClause:g})}}}};function SR(t,e){let r=t.schema[e];return r!==void 0&&!(0,bR.alwaysValidSchema)(t,r)}ub.default=U2});var wR=F(cb=>{"use strict";Object.defineProperty(cb,"__esModule",{value:!0});var B2=ze(),H2={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,B2.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};cb.default=H2});var ER=F(fb=>{"use strict";Object.defineProperty(fb,"__esModule",{value:!0});var V2=JS(),W2=Xx(),Y2=zS(),J2=tR(),z2=rR(),K2=sR(),G2=aR(),Q2=tb(),Z2=cR(),X2=pR(),eU=mR(),tU=gR(),rU=yR(),nU=vR(),iU=_R(),sU=wR();function oU(t=!1){let e=[eU.default,tU.default,rU.default,nU.default,iU.default,sU.default,G2.default,Q2.default,K2.default,Z2.default,X2.default];return t?e.push(W2.default,J2.default):e.push(V2.default,Y2.default),e.push(z2.default),e}fb.default=oU});var CR=F(db=>{"use strict";Object.defineProperty(db,"__esModule",{value:!0});var Nt=$e(),aU={message:({schemaCode:t})=>(0,Nt.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,Nt._)`{format: ${t}}`},lU={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:aU,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():E();function S(){let C=r.scopeValue("formats",{ref:m.formats,code:f.code.formats}),x=r.const("fDef",(0,Nt._)`${C}[${a}]`),A=r.let("fType"),T=r.let("format");r.if((0,Nt._)`typeof ${x} == "object" && !(${x} instanceof RegExp)`,()=>r.assign(A,(0,Nt._)`${x}.type || "string"`).assign(T,(0,Nt._)`${x}.validate`),()=>r.assign(A,(0,Nt._)`"string"`).assign(T,x)),t.fail$data((0,Nt.or)(j(),Y()));function j(){return f.strictSchema===!1?Nt.nil:(0,Nt._)`${a} && !${T}`}function Y(){let V=g.$async?(0,Nt._)`(${x}.async ? await ${T}(${n}) : ${T}(${n}))`:(0,Nt._)`${T}(${n})`,K=(0,Nt._)`(typeof ${T} == "function" ? ${V} : ${T}.test(${n}))`;return(0,Nt._)`${T} && ${T} !== true && ${A} === ${e} && !${K}`}}function E(){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,Nt.regexpCode)(K):f.code.formats?(0,Nt._)`${f.code.formats}${(0,Nt.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,Nt._)`${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,Nt._)`await ${T}(${n})`}return typeof A=="function"?(0,Nt._)`${T}(${n})`:(0,Nt._)`${T}.test(${n})`}}}};db.default=lU});var xR=F(hb=>{"use strict";Object.defineProperty(hb,"__esModule",{value:!0});var uU=CR(),cU=[uU.default];hb.default=cU});var RR=F(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.contentVocabulary=Al.metadataVocabulary=void 0;Al.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Al.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var IR=F(pb=>{"use strict";Object.defineProperty(pb,"__esModule",{value:!0});var fU=Mx(),dU=Kx(),hU=ER(),pU=xR(),OR=RR(),mU=[fU.default,dU.default,(0,hU.default)(),pU.default,OR.metadataVocabulary,OR.contentVocabulary];pb.default=mU});var kR=F(cp=>{"use strict";Object.defineProperty(cp,"__esModule",{value:!0});cp.DiscrError=void 0;var PR;(function(t){t.Tag="tag",t.Mapping="mapping"})(PR||(cp.DiscrError=PR={}))});var TR=F(gb=>{"use strict";Object.defineProperty(gb,"__esModule",{value:!0});var Tl=$e(),mb=kR(),AR=Wh(),gU=Ic(),yU=ze(),vU={message:({params:{discrError:t,tagName:e}})=>t===mb.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,Tl._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},SU={keyword:"discriminator",type:"object",schemaType:"object",error:vU,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,Tl._)`${r}${(0,Tl.getProperty)(u)}`);e.if((0,Tl._)`typeof ${h} == "string"`,()=>g(),()=>t.error(!1,{discrError:mb.DiscrError.Tag,tag:h,tagName:u})),t.ok(f);function g(){let E=S();e.if(!1);for(let C in E)e.elseIf((0,Tl._)`${h} === ${C}`),e.assign(f,m(E[C]));e.else(),t.error(!1,{discrError:mb.DiscrError.Mapping,tag:h,tagName:u}),e.endIf()}function m(E){let C=e.name("valid"),x=t.subschema({keyword:"oneOf",schemaProp:E},C);return t.mergeEvaluated(x,Tl.Name),C}function S(){var E;let C={},x=T(i),A=!0;for(let V=0;V<a.length;V++){let K=a[V];if(K?.$ref&&!(0,yU.schemaHasRulesButRef)(K,s.self.RULES)){let k=K.$ref;if(K=AR.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,k),K instanceof AR.SchemaEnv&&(K=K.schema),K===void 0)throw new gU.default(s.opts.uriResolver,s.baseId,k)}let ee=(E=K?.properties)===null||E===void 0?void 0:E[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}}}};gb.default=SU});var qR=F((T4,bU)=>{bU.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 MR=F((pt,yb)=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.MissingRefError=pt.ValidationError=pt.CodeGen=pt.Name=pt.nil=pt.stringify=pt.str=pt._=pt.KeywordCxt=pt.Ajv=void 0;var _U=Px(),wU=IR(),EU=TR(),NR=qR(),CU=["/properties"],fp="http://json-schema.org/draft-07/schema",ql=class extends _U.default{_addVocabularies(){super._addVocabularies(),wU.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(EU.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(NR,CU):NR;this.addMetaSchema(e,fp,!1),this.refs["http://json-schema.org/schema"]=fp}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(fp)?fp:void 0)}};pt.Ajv=ql;yb.exports=pt=ql;yb.exports.Ajv=ql;Object.defineProperty(pt,"__esModule",{value:!0});pt.default=ql;var xU=Oc();Object.defineProperty(pt,"KeywordCxt",{enumerable:!0,get:function(){return xU.KeywordCxt}});var Nl=$e();Object.defineProperty(pt,"_",{enumerable:!0,get:function(){return Nl._}});Object.defineProperty(pt,"str",{enumerable:!0,get:function(){return Nl.str}});Object.defineProperty(pt,"stringify",{enumerable:!0,get:function(){return Nl.stringify}});Object.defineProperty(pt,"nil",{enumerable:!0,get:function(){return Nl.nil}});Object.defineProperty(pt,"Name",{enumerable:!0,get:function(){return Nl.Name}});Object.defineProperty(pt,"CodeGen",{enumerable:!0,get:function(){return Nl.CodeGen}});var RU=Hh();Object.defineProperty(pt,"ValidationError",{enumerable:!0,get:function(){return RU.default}});var OU=Ic();Object.defineProperty(pt,"MissingRefError",{enumerable:!0,get:function(){return OU.default}})});var We=F(er=>{"use strict";var xb=Symbol.for("yaml.alias"),QR=Symbol.for("yaml.document"),xp=Symbol.for("yaml.map"),ZR=Symbol.for("yaml.pair"),Rb=Symbol.for("yaml.scalar"),Rp=Symbol.for("yaml.seq"),es=Symbol.for("yaml.node.type"),GU=t=>!!t&&typeof t=="object"&&t[es]===xb,QU=t=>!!t&&typeof t=="object"&&t[es]===QR,ZU=t=>!!t&&typeof t=="object"&&t[es]===xp,XU=t=>!!t&&typeof t=="object"&&t[es]===ZR,XR=t=>!!t&&typeof t=="object"&&t[es]===Rb,eB=t=>!!t&&typeof t=="object"&&t[es]===Rp;function eO(t){if(t&&typeof t=="object")switch(t[es]){case xp:case Rp:return!0}return!1}function tB(t){if(t&&typeof t=="object")switch(t[es]){case xb:case xp:case Rb:case Rp:return!0}return!1}var rB=t=>(XR(t)||eO(t))&&!!t.anchor;er.ALIAS=xb;er.DOC=QR;er.MAP=xp;er.NODE_TYPE=es;er.PAIR=ZR;er.SCALAR=Rb;er.SEQ=Rp;er.hasAnchor=rB;er.isAlias=GU;er.isCollection=eO;er.isDocument=QU;er.isMap=ZU;er.isNode=tB;er.isPair=XU;er.isScalar=XR;er.isSeq=eB});var Gc=F(Ob=>{"use strict";var Ht=We(),Mr=Symbol("break visit"),tO=Symbol("skip children"),Ri=Symbol("remove node");function Op(t,e){let r=rO(e);Ht.isDocument(t)?ru(null,t.contents,r,Object.freeze([t]))===Ri&&(t.contents=null):ru(null,t,r,Object.freeze([]))}Op.BREAK=Mr;Op.SKIP=tO;Op.REMOVE=Ri;function ru(t,e,r,n){let i=nO(t,e,r,n);if(Ht.isNode(i)||Ht.isPair(i))return iO(t,n,i),ru(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=ru(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Mr)return Mr;a===Ri&&(e.items.splice(s,1),s-=1)}}}else if(Ht.isPair(e)){n=Object.freeze(n.concat(e));let s=ru("key",e.key,r,n);if(s===Mr)return Mr;s===Ri&&(e.key=null);let a=ru("value",e.value,r,n);if(a===Mr)return Mr;a===Ri&&(e.value=null)}}return i}async function Ip(t,e){let r=rO(e);Ht.isDocument(t)?await nu(null,t.contents,r,Object.freeze([t]))===Ri&&(t.contents=null):await nu(null,t,r,Object.freeze([]))}Ip.BREAK=Mr;Ip.SKIP=tO;Ip.REMOVE=Ri;async function nu(t,e,r,n){let i=await nO(t,e,r,n);if(Ht.isNode(i)||Ht.isPair(i))return iO(t,n,i),nu(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 nu(s,e.items[s],r,n);if(typeof a=="number")s=a-1;else{if(a===Mr)return Mr;a===Ri&&(e.items.splice(s,1),s-=1)}}}else if(Ht.isPair(e)){n=Object.freeze(n.concat(e));let s=await nu("key",e.key,r,n);if(s===Mr)return Mr;s===Ri&&(e.key=null);let a=await nu("value",e.value,r,n);if(a===Mr)return Mr;a===Ri&&(e.value=null)}}return i}function rO(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 nO(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 iO(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`)}}Ob.visit=Op;Ob.visitAsync=Ip});var Ib=F(oO=>{"use strict";var sO=We(),nB=Gc(),iB={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},sB=t=>t.replace(/[!,[\]{}]/g,e=>iB[e]),Qc=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+sB(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&&sO.isNode(e.contents)){let s={};nB.visit(e.contents,(a,u)=>{sO.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(`
|
|
31
|
+
`)}};Qc.defaultYaml={explicit:!1,version:"1.2"};Qc.defaultTags={"!!":"tag:yaml.org,2002:"};oO.Directives=Qc});var Pp=F(Zc=>{"use strict";var aO=We(),oB=Gc();function aB(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function lO(t){let e=new Set;return oB.visit(t,{Value(r,n){n.anchor&&e.add(n.anchor)}}),e}function uO(t,e){for(let r=1;;++r){let n=`${t}${r}`;if(!e.has(n))return n}}function lB(t,e){let r=[],n=new Map,i=null;return{onAnchor:s=>{r.push(s),i??(i=lO(t));let a=uO(e,i);return i.add(a),a},setAnchors:()=>{for(let s of r){let a=n.get(s);if(typeof a=="object"&&a.anchor&&(aO.isScalar(a.node)||aO.isCollection(a.node)))a.node.anchor=a.anchor;else{let u=new Error("Failed to resolve repeated object (this should not happen)");throw u.source=s,u}}},sourceObjects:n}}Zc.anchorIsValid=aB;Zc.anchorNames=lO;Zc.createNodeAnchors=lB;Zc.findNewAnchor=uO});var Pb=F(cO=>{"use strict";function Xc(t,e,r,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,s=n.length;i<s;++i){let a=n[i],u=Xc(t,n,String(i),a);u===void 0?delete n[i]:u!==a&&(n[i]=u)}else if(n instanceof Map)for(let i of Array.from(n.keys())){let s=n.get(i),a=Xc(t,n,i,s);a===void 0?n.delete(i):a!==s&&n.set(i,a)}else if(n instanceof Set)for(let i of Array.from(n)){let s=Xc(t,n,i,i);s===void 0?n.delete(i):s!==i&&(n.delete(i),n.add(s))}else for(let[i,s]of Object.entries(n)){let a=Xc(t,n,i,s);a===void 0?delete n[i]:a!==s&&(n[i]=a)}return t.call(e,r,n)}cO.applyReviver=Xc});var to=F(dO=>{"use strict";var uB=We();function fO(t,e,r){if(Array.isArray(t))return t.map((n,i)=>fO(n,String(i),r));if(t&&typeof t.toJSON=="function"){if(!r||!uB.hasAnchor(t))return t.toJSON(e,r);let n={aliasCount:0,count:1,res:void 0};r.anchors.set(t,n),r.onCreate=s=>{n.res=s,delete r.onCreate};let i=t.toJSON(e,r);return r.onCreate&&r.onCreate(i),i}return typeof t=="bigint"&&!r?.keep?Number(t):t}dO.toJS=fO});var kp=F(pO=>{"use strict";var cB=Pb(),hO=We(),fB=to(),kb=class{constructor(e){Object.defineProperty(this,hO.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:n,onAnchor:i,reviver:s}={}){if(!hO.isDocument(e))throw new TypeError("A document argument is required");let a={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},u=fB.toJS(this,"",a);if(typeof i=="function")for(let{count:f,res:h}of a.anchors.values())i(h,f);return typeof s=="function"?cB.applyReviver(s,{"":u},"",u):u}};pO.NodeBase=kb});var ef=F(mO=>{"use strict";var dB=Pp(),hB=Gc(),iu=We(),pB=kp(),mB=to(),Ab=class extends pB.NodeBase{constructor(e){super(iu.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){let n;r?.aliasResolveCache?n=r.aliasResolveCache:(n=[],hB.visit(e,{Node:(s,a)=>{(iu.isAlias(a)||iu.hasAnchor(a))&&n.push(a)}}),r&&(r.aliasResolveCache=n));let i;for(let s of n){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,r){if(!r)return{source:this.source};let{anchors:n,doc:i,maxAliasCount:s}=r,a=this.resolve(i,r);if(!a){let f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let u=n.get(a);if(u||(mB.toJS(a,null,r),u=n.get(a)),u?.res===void 0){let f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(s>=0&&(u.count+=1,u.aliasCount===0&&(u.aliasCount=Ap(i,a,n)),u.count*u.aliasCount>s)){let f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return u.res}toString(e,r,n){let i=`*${this.source}`;if(e){if(dB.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}};function Ap(t,e,r){if(iu.isAlias(e)){let n=e.resolve(t),i=r&&n&&r.get(n);return i?i.count*i.aliasCount:0}else if(iu.isCollection(e)){let n=0;for(let i of e.items){let s=Ap(t,i,r);s>n&&(n=s)}return n}else if(iu.isPair(e)){let n=Ap(t,e.key,r),i=Ap(t,e.value,r);return Math.max(n,i)}return 1}mO.Alias=Ab});var Dt=F(Tb=>{"use strict";var gB=We(),yB=kp(),vB=to(),SB=t=>!t||typeof t!="function"&&typeof t!="object",ro=class extends yB.NodeBase{constructor(e){super(gB.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:vB.toJS(this.value,e,r)}toString(){return String(this.value)}};ro.BLOCK_FOLDED="BLOCK_FOLDED";ro.BLOCK_LITERAL="BLOCK_LITERAL";ro.PLAIN="PLAIN";ro.QUOTE_DOUBLE="QUOTE_DOUBLE";ro.QUOTE_SINGLE="QUOTE_SINGLE";Tb.Scalar=ro;Tb.isScalarValue=SB});var tf=F(yO=>{"use strict";var bB=ef(),oa=We(),gO=Dt(),_B="tag:yaml.org,2002:";function wB(t,e,r){if(e){let n=r.filter(s=>s.tag===e),i=n.find(s=>!s.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return r.find(n=>n.identify?.(t)&&!n.format)}function EB(t,e,r){if(oa.isDocument(t)&&(t=t.contents),oa.isNode(t))return t;if(oa.isPair(t)){let m=r.schema[oa.MAP].createNode?.(r.schema,null,r);return m.items.push(t),m}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:n,onAnchor:i,onTagObj:s,schema:a,sourceObjects:u}=r,f;if(n&&t&&typeof t=="object"){if(f=u.get(t),f)return f.anchor??(f.anchor=i(t)),new bB.Alias(f.anchor);f={anchor:null,node:null},u.set(t,f)}e?.startsWith("!!")&&(e=_B+e.slice(2));let h=wB(t,e,a.tags);if(!h){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let m=new gO.Scalar(t);return f&&(f.node=m),m}h=t instanceof Map?a[oa.MAP]:Symbol.iterator in Object(t)?a[oa.SEQ]:a[oa.MAP]}s&&(s(h),delete r.onTagObj);let g=h?.createNode?h.createNode(r.schema,t,r):typeof h?.nodeClass?.from=="function"?h.nodeClass.from(r.schema,t,r):new gO.Scalar(t);return e?g.tag=e:h.default||(g.tag=h.tag),f&&(f.node=g),g}yO.createNode=EB});var qp=F(Tp=>{"use strict";var CB=tf(),Oi=We(),xB=kp();function qb(t,e,r){let n=r;for(let i=e.length-1;i>=0;--i){let s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){let a=[];a[s]=n,n=a}else n=new Map([[s,n]])}return CB.createNode(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var vO=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Nb=class extends xB.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(n=>Oi.isNode(n)||Oi.isPair(n)?n.clone(e):n),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(vO(e))this.add(r);else{let[n,...i]=e,s=this.get(n,!0);if(Oi.isCollection(s))s.addIn(i,r);else if(s===void 0&&this.schema)this.set(n,qb(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){let[r,...n]=e;if(n.length===0)return this.delete(r);let i=this.get(r,!0);if(Oi.isCollection(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${n}`)}getIn(e,r){let[n,...i]=e,s=this.get(n,!0);return i.length===0?!r&&Oi.isScalar(s)?s.value:s:Oi.isCollection(s)?s.getIn(i,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!Oi.isPair(r))return!1;let n=r.value;return n==null||e&&Oi.isScalar(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[r,...n]=e;if(n.length===0)return this.has(r);let i=this.get(r,!0);return Oi.isCollection(i)?i.hasIn(n):!1}setIn(e,r){let[n,...i]=e;if(i.length===0)this.set(n,r);else{let s=this.get(n,!0);if(Oi.isCollection(s))s.setIn(i,r);else if(s===void 0&&this.schema)this.set(n,qb(this.schema,i,r));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}};Tp.Collection=Nb;Tp.collectionFromPath=qb;Tp.isEmptyPath=vO});var rf=F(Np=>{"use strict";var RB=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Mb(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var OB=(t,e,r)=>t.endsWith(`
|
|
32
|
+
`)?Mb(r,e):r.includes(`
|
|
33
33
|
`)?`
|
|
34
|
-
`+Mb(
|
|
35
|
-
`)
|
|
36
|
-
`&&E!==" "){let V=
|
|
37
|
-
`&&V!==" "&&(S=x)}if(x>=
|
|
38
|
-
${e}${
|
|
39
|
-
${e}${
|
|
40
|
-
`);n=e,i=e+1,s=
|
|
41
|
-
`){if(s-a>n)return!0;if(a=s+1,i-a<=n)return!1}return!0}function
|
|
34
|
+
`+Mb(r,e):(t.endsWith(" ")?"":" ")+r;Np.indentComment=Mb;Np.lineComment=OB;Np.stringifyComment=RB});var bO=F(nf=>{"use strict";var IB="flow",$b="block",Mp="quoted";function PB(t,e,r="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:s=20,onFold:a,onOverflow:u}={}){if(!i||i<0)return t;i<s&&(s=0);let f=Math.max(1+s,1+i-e.length);if(t.length<=f)return t;let h=[],g={},m=i-e.length;typeof n=="number"&&(n>i-Math.max(2,s)?h.push(0):m=i-n);let S,E,C=!1,x=-1,A=-1,T=-1;r===$b&&(x=SO(t,x,e.length),x!==-1&&(m=x+f));for(let Y;Y=t[x+=1];){if(r===Mp&&Y==="\\"){switch(A=x,t[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}T=x}if(Y===`
|
|
35
|
+
`)r===$b&&(x=SO(t,x,e.length)),m=x+e.length+f,S=void 0;else{if(Y===" "&&E&&E!==" "&&E!==`
|
|
36
|
+
`&&E!==" "){let V=t[x+1];V&&V!==" "&&V!==`
|
|
37
|
+
`&&V!==" "&&(S=x)}if(x>=m)if(S)h.push(S),m=S+f,S=void 0;else if(r===Mp){for(;E===" "||E===" ";)E=Y,Y=t[x+=1],C=!0;let V=x>T+1?x-2:A-1;if(g[V])return t;h.push(V),g[V]=!0,m=V+f,S=void 0}else C=!0}E=Y}if(C&&u&&u(),h.length===0)return t;a&&a();let j=t.slice(0,h[0]);for(let Y=0;Y<h.length;++Y){let V=h[Y],K=h[Y+1]||t.length;V===0?j=`
|
|
38
|
+
${e}${t.slice(0,K)}`:(r===Mp&&g[V]&&(j+=`${t[V]}\\`),j+=`
|
|
39
|
+
${e}${t.slice(V+1,K)}`)}return j}function SO(t,e,r){let n=e,i=e+1,s=t[i];for(;s===" "||s===" ";)if(e<i+r)s=t[++e];else{do s=t[++e];while(s&&s!==`
|
|
40
|
+
`);n=e,i=e+1,s=t[i]}return n}nf.FOLD_BLOCK=$b;nf.FOLD_FLOW=IB;nf.FOLD_QUOTED=Mp;nf.foldFlowLines=PB});var of=F(_O=>{"use strict";var Hn=Dt(),no=bO(),Dp=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Fp=t=>/^(%|---|\.\.\.)/m.test(t);function kB(t,e,r){if(!e||e<0)return!1;let n=e-r,i=t.length;if(i<=n)return!1;for(let s=0,a=0;s<i;++s)if(t[s]===`
|
|
41
|
+
`){if(s-a>n)return!0;if(a=s+1,i-a<=n)return!1}return!0}function sf(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Fp(t)?" ":""),a="",u=0;for(let f=0,h=r[f];h;h=r[++f])if(h===" "&&r[f+1]==="\\"&&r[f+2]==="n"&&(a+=r.slice(u,f)+"\\ ",f+=1,u=f,h="\\"),h==="\\")switch(r[f+1]){case"u":{a+=r.slice(u,f);let g=r.substr(f+2,4);switch(g){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:g.substr(0,2)==="00"?a+="\\x"+g.substr(2):a+=r.substr(f,6)}f+=5,u=f+1}break;case"n":if(n||r[f+2]==='"'||r.length<i)f+=1;else{for(a+=r.slice(u,f)+`
|
|
42
42
|
|
|
43
|
-
`;
|
|
44
|
-
`,f+=2;a+=s,
|
|
45
|
-
`)||/[ \t]\n|\n[ \t]/.test(
|
|
46
|
-
${
|
|
43
|
+
`;r[f+2]==="\\"&&r[f+3]==="n"&&r[f+4]!=='"';)a+=`
|
|
44
|
+
`,f+=2;a+=s,r[f+2]===" "&&(a+="\\"),f+=1,u=f+1}break;default:f+=1}return a=u?a+r.slice(u):r,n?a:no.foldFlowLines(a,s,no.FOLD_QUOTED,Dp(e,!1))}function Db(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
|
|
45
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return sf(t,e);let r=e.indent||(Fp(t)?" ":""),n="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
46
|
+
${r}`)+"'";return e.implicitKey?n:no.foldFlowLines(n,r,no.FOLD_FLOW,Dp(e,!1))}function su(t,e){let{singleQuote:r}=e.options,n;if(r===!1)n=sf;else{let i=t.includes('"'),s=t.includes("'");i&&!s?n=Db:s&&!i?n=sf:n=r?Db:sf}return n(t,e)}var Fb;try{Fb=new RegExp(`(^|(?<!
|
|
47
47
|
))
|
|
48
48
|
+(?!
|
|
49
|
-
|$)`,"g")}catch{Fb=/\n+(?!\n|$)/g}function
|
|
49
|
+
|$)`,"g")}catch{Fb=/\n+(?!\n|$)/g}function $p({comment:t,type:e,value:r},n,i,s){let{blockQuote:a,commentString:u,lineWidth:f}=n.options;if(!a||/\n[\t ]+$/.test(r))return su(r,n);let h=n.indent||(n.forceBlockIndent||Fp(r)?" ":""),g=a==="literal"?!0:a==="folded"||e===Hn.Scalar.BLOCK_FOLDED?!1:e===Hn.Scalar.BLOCK_LITERAL?!0:!kB(r,f,h.length);if(!r)return g?`|
|
|
50
50
|
`:`>
|
|
51
|
-
`;let
|
|
52
|
-
`&&K!==" "&&K!==" ")break}let E=
|
|
53
|
-
`);C===-1?
|
|
54
|
-
`&&(E=E.slice(0,-1)),E=E.replace(Fb,`$&${h}`));let x=!1,A,
|
|
55
|
-
`)
|
|
56
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`),ee=!1,k=
|
|
57
|
-
${h}${w}`}return
|
|
58
|
-
${h}${j}${
|
|
59
|
-
`)||
|
|
60
|
-
`)?su(s,e)
|
|
61
|
-
`))return
|
|
62
|
-
${f}`);if(a){let S=x=>x.default&&x.tag!=="tag:yaml.org,2002:str"&&x.test?.test(
|
|
63
|
-
${e.indent}${u}`:u}Lb.createStringifyContext
|
|
64
|
-
${u}:`):(A=`${A}:`,S&&(A+=
|
|
51
|
+
`;let m,S;for(S=r.length;S>0;--S){let K=r[S-1];if(K!==`
|
|
52
|
+
`&&K!==" "&&K!==" ")break}let E=r.substring(S),C=E.indexOf(`
|
|
53
|
+
`);C===-1?m="-":r===E||C!==E.length-1?(m="+",s&&s()):m="",E&&(r=r.slice(0,-E.length),E[E.length-1]===`
|
|
54
|
+
`&&(E=E.slice(0,-1)),E=E.replace(Fb,`$&${h}`));let x=!1,A,T=-1;for(A=0;A<r.length;++A){let K=r[A];if(K===" ")x=!0;else if(K===`
|
|
55
|
+
`)T=A;else break}let j=r.substring(0,T<A?T+1:A);j&&(r=r.substring(j.length),j=j.replace(/\n+/g,`$&${h}`));let V=(x?h?"2":"1":"")+m;if(t&&(V+=" "+u(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!g){let K=r.replace(/\n+/g,`
|
|
56
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`),ee=!1,k=Dp(n,!0);a!=="folded"&&e!==Hn.Scalar.BLOCK_FOLDED&&(k.onOverflow=()=>{ee=!0});let w=no.foldFlowLines(`${j}${K}${E}`,h,no.FOLD_BLOCK,k);if(!ee)return`>${V}
|
|
57
|
+
${h}${w}`}return r=r.replace(/\n+/g,`$&${h}`),`|${V}
|
|
58
|
+
${h}${j}${r}${E}`}function AB(t,e,r,n){let{type:i,value:s}=t,{actualString:a,implicitKey:u,indent:f,indentStep:h,inFlow:g}=e;if(u&&s.includes(`
|
|
59
|
+
`)||g&&/[[\]{},]/.test(s))return su(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return u||g||!s.includes(`
|
|
60
|
+
`)?su(s,e):$p(t,e,r,n);if(!u&&!g&&i!==Hn.Scalar.PLAIN&&s.includes(`
|
|
61
|
+
`))return $p(t,e,r,n);if(Fp(s)){if(f==="")return e.forceBlockIndent=!0,$p(t,e,r,n);if(u&&f===h)return su(s,e)}let m=s.replace(/\n+/g,`$&
|
|
62
|
+
${f}`);if(a){let S=x=>x.default&&x.tag!=="tag:yaml.org,2002:str"&&x.test?.test(m),{compat:E,tags:C}=e.doc.schema;if(C.some(S)||E?.some(S))return su(s,e)}return u?m:no.foldFlowLines(m,f,no.FOLD_FLOW,Dp(e,!1))}function TB(t,e,r,n){let{implicitKey:i,inFlow:s}=e,a=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:u}=t;u!==Hn.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(u=Hn.Scalar.QUOTE_DOUBLE);let f=g=>{switch(g){case Hn.Scalar.BLOCK_FOLDED:case Hn.Scalar.BLOCK_LITERAL:return i||s?su(a.value,e):$p(a,e,r,n);case Hn.Scalar.QUOTE_DOUBLE:return sf(a.value,e);case Hn.Scalar.QUOTE_SINGLE:return Db(a.value,e);case Hn.Scalar.PLAIN:return AB(a,e,r,n);default:return null}},h=f(u);if(h===null){let{defaultKeyType:g,defaultStringType:m}=e.options,S=i&&g||m;if(h=f(S),h===null)throw new Error(`Unsupported default string type ${S}`)}return h}_O.stringifyString=TB});var af=F(Lb=>{"use strict";var qB=Pp(),io=We(),NB=rf(),MB=of();function $B(t,e){let r=Object.assign({blockQuote:!0,commentString:NB.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),n;switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:n,options:r}}function DB(t,e){if(e.tag){let i=t.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let r,n;if(io.isScalar(e)){n=e.value;let i=t.filter(s=>s.identify?.(n));if(i.length>1){let s=i.filter(a=>a.test);s.length>0&&(i=s)}r=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else n=e,r=t.find(i=>i.nodeClass&&n instanceof i.nodeClass);if(!r){let i=n?.constructor?.name??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${i} value`)}return r}function FB(t,e,{anchors:r,doc:n}){if(!n.directives)return"";let i=[],s=(io.isScalar(t)||io.isCollection(t))&&t.anchor;s&&qB.anchorIsValid(s)&&(r.add(s),i.push(`&${s}`));let a=t.tag??(e.default?null:e.tag);return a&&i.push(n.directives.tagString(a)),i.join(" ")}function LB(t,e,r,n){if(io.isPair(t))return t.toString(e,r,n);if(io.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let i,s=io.isNode(t)?t:e.doc.createNode(t,{onTagObj:f=>i=f});i??(i=DB(e.doc.schema.tags,s));let a=FB(s,i,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);let u=typeof i.stringify=="function"?i.stringify(s,e,r,n):io.isScalar(s)?MB.stringifyString(s,e,r,n):s.toString(e,r,n);return a?io.isScalar(s)||u[0]==="{"||u[0]==="["?`${a} ${u}`:`${a}
|
|
63
|
+
${e.indent}${u}`:u}Lb.createStringifyContext=$B;Lb.stringify=LB});var xO=F(CO=>{"use strict";var ts=We(),wO=Dt(),EO=af(),lf=rf();function jB({key:t,value:e},r,n,i){let{allNullValues:s,doc:a,indent:u,indentStep:f,options:{commentString:h,indentSeq:g,simpleKeys:m}}=r,S=ts.isNode(t)&&t.comment||null;if(m){if(S)throw new Error("With simple keys, key nodes cannot have comments");if(ts.isCollection(t)||!ts.isNode(t)&&typeof t=="object"){let k="With simple keys, collection cannot be used as a key value";throw new Error(k)}}let E=!m&&(!t||S&&e==null&&!r.inFlow||ts.isCollection(t)||(ts.isScalar(t)?t.type===wO.Scalar.BLOCK_FOLDED||t.type===wO.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!E&&(m||!s),indent:u+f});let C=!1,x=!1,A=EO.stringify(t,r,()=>C=!0,()=>x=!0);if(!E&&!r.inFlow&&A.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");E=!0}if(r.inFlow){if(s||e==null)return C&&n&&n(),A===""?"?":E?`? ${A}`:A}else if(s&&!m||e==null&&E)return A=`? ${A}`,S&&!C?A+=lf.lineComment(A,r.indent,h(S)):x&&i&&i(),A;C&&(S=null),E?(S&&(A+=lf.lineComment(A,r.indent,h(S))),A=`? ${A}
|
|
64
|
+
${u}:`):(A=`${A}:`,S&&(A+=lf.lineComment(A,r.indent,h(S))));let T,j,Y;ts.isNode(e)?(T=!!e.spaceBefore,j=e.commentBefore,Y=e.comment):(T=!1,j=null,Y=null,e&&typeof e=="object"&&(e=a.createNode(e))),r.implicitKey=!1,!E&&!S&&ts.isScalar(e)&&(r.indentAtStart=A.length+1),x=!1,!g&&f.length>=2&&!r.inFlow&&!E&&ts.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let V=!1,K=EO.stringify(e,r,()=>V=!0,()=>x=!0),ee=" ";if(S||T||j){if(ee=T?`
|
|
65
65
|
`:"",j){let k=h(j);ee+=`
|
|
66
|
-
${
|
|
66
|
+
${lf.indentComment(k,r.indent)}`}K===""&&!r.inFlow?ee===`
|
|
67
67
|
`&&Y&&(ee=`
|
|
68
68
|
|
|
69
69
|
`):ee+=`
|
|
70
|
-
${
|
|
71
|
-
`),P=w!==-1,$=
|
|
72
|
-
${
|
|
73
|
-
`)&&(ee="");return A+=ee+K,
|
|
70
|
+
${r.indent}`}else if(!E&&ts.isCollection(e)){let k=K[0],w=K.indexOf(`
|
|
71
|
+
`),P=w!==-1,$=r.inFlow??e.flow??e.items.length===0;if(P||!$){let D=!1;if(P&&(k==="&"||k==="!")){let L=K.indexOf(" ");k==="&"&&L!==-1&&L<w&&K[L+1]==="!"&&(L=K.indexOf(" ",L+1)),(L===-1||w<L)&&(D=!0)}D||(ee=`
|
|
72
|
+
${r.indent}`)}}else(K===""||K[0]===`
|
|
73
|
+
`)&&(ee="");return A+=ee+K,r.inFlow?V&&n&&n():Y&&!V?A+=lf.lineComment(A,r.indent,h(Y)):x&&i&&i(),A}CO.stringifyPair=jB});var Ub=F(jb=>{"use strict";var RO=require("process");function UB(t,...e){t==="debug"&&console.log(...e)}function BB(t,e){(t==="debug"||t==="warn")&&(typeof RO.emitWarning=="function"?RO.emitWarning(e):console.warn(e))}jb.debug=UB;jb.warn=BB});var Bp=F(Up=>{"use strict";var uf=We(),OO=Dt(),Lp="<<",jp={identify:t=>t===Lp||typeof t=="symbol"&&t.description===Lp,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new OO.Scalar(Symbol(Lp)),{addToJSMap:IO}),stringify:()=>Lp},HB=(t,e)=>(jp.identify(e)||uf.isScalar(e)&&(!e.type||e.type===OO.Scalar.PLAIN)&&jp.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===jp.tag&&r.default);function IO(t,e,r){if(r=t&&uf.isAlias(r)?r.resolve(t.doc):r,uf.isSeq(r))for(let n of r.items)Bb(t,e,n);else if(Array.isArray(r))for(let n of r)Bb(t,e,n);else Bb(t,e,r)}function Bb(t,e,r){let n=t&&uf.isAlias(r)?r.resolve(t.doc):r;if(!uf.isMap(n))throw new Error("Merge sources must be maps or map aliases");let i=n.toJSON(null,t,Map);for(let[s,a]of i)e instanceof Map?e.has(s)||e.set(s,a):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}Up.addMergeToJSMap=IO;Up.isMergeKey=HB;Up.merge=jp});var Vb=F(AO=>{"use strict";var VB=Ub(),PO=Bp(),WB=af(),kO=We(),Hb=to();function YB(t,e,{key:r,value:n}){if(kO.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,n);else if(PO.isMergeKey(t,r))PO.addMergeToJSMap(t,e,n);else{let i=Hb.toJS(r,"",t);if(e instanceof Map)e.set(i,Hb.toJS(n,i,t));else if(e instanceof Set)e.add(i);else{let s=JB(r,i,t),a=Hb.toJS(n,s,t);s in e?Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[s]=a}}return e}function JB(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(kO.isNode(t)&&r?.doc){let n=WB.createStringifyContext(r.doc,{});n.anchors=new Set;for(let s of r.anchors.keys())n.anchors.add(s.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=t.toString(n);if(!r.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),VB.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return i}return JSON.stringify(e)}AO.addPairToJSMap=YB});var so=F(Wb=>{"use strict";var TO=tf(),zB=xO(),KB=Vb(),Hp=We();function GB(t,e,r){let n=TO.createNode(t,void 0,r),i=TO.createNode(e,void 0,r);return new Vp(n,i)}var Vp=class t{constructor(e,r=null){Object.defineProperty(this,Hp.NODE_TYPE,{value:Hp.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:n}=this;return Hp.isNode(r)&&(r=r.clone(e)),Hp.isNode(n)&&(n=n.clone(e)),new t(r,n)}toJSON(e,r){let n=r?.mapAsMap?new Map:{};return KB.addPairToJSMap(r,n,this)}toString(e,r,n){return e?.doc?zB.stringifyPair(this,e,r,n):JSON.stringify(this)}};Wb.Pair=Vp;Wb.createPair=GB});var Yb=F(NO=>{"use strict";var aa=We(),qO=af(),Wp=rf();function QB(t,e,r){return(e.inFlow??t.flow?XB:ZB)(t,e,r)}function ZB({comment:t,items:e},r,{blockItemPrefix:n,flowChars:i,itemIndent:s,onChompKeep:a,onComment:u}){let{indent:f,options:{commentString:h}}=r,g=Object.assign({},r,{indent:s,type:null}),m=!1,S=[];for(let C=0;C<e.length;++C){let x=e[C],A=null;if(aa.isNode(x))!m&&x.spaceBefore&&S.push(""),Yp(r,S,x.commentBefore,m),x.comment&&(A=x.comment);else if(aa.isPair(x)){let j=aa.isNode(x.key)?x.key:null;j&&(!m&&j.spaceBefore&&S.push(""),Yp(r,S,j.commentBefore,m))}m=!1;let T=qO.stringify(x,g,()=>A=null,()=>m=!0);A&&(T+=Wp.lineComment(T,s,h(A))),m&&A&&(m=!1),S.push(n+T)}let E;if(S.length===0)E=i.start+i.end;else{E=S[0];for(let C=1;C<S.length;++C){let x=S[C];E+=x?`
|
|
74
74
|
${f}${x}`:`
|
|
75
|
-
`}}return
|
|
76
|
-
`+
|
|
77
|
-
`))&&(h=!0),
|
|
75
|
+
`}}return t?(E+=`
|
|
76
|
+
`+Wp.indentComment(h(t),f),u&&u()):m&&a&&a(),E}function XB({items:t},e,{flowChars:r,itemIndent:n}){let{indent:i,indentStep:s,flowCollectionPadding:a,options:{commentString:u}}=e;n+=s;let f=Object.assign({},e,{indent:n,inFlow:!0,type:null}),h=!1,g=0,m=[];for(let C=0;C<t.length;++C){let x=t[C],A=null;if(aa.isNode(x))x.spaceBefore&&m.push(""),Yp(e,m,x.commentBefore,!1),x.comment&&(A=x.comment);else if(aa.isPair(x)){let j=aa.isNode(x.key)?x.key:null;j&&(j.spaceBefore&&m.push(""),Yp(e,m,j.commentBefore,!1),j.comment&&(h=!0));let Y=aa.isNode(x.value)?x.value:null;Y?(Y.comment&&(A=Y.comment),Y.commentBefore&&(h=!0)):x.value==null&&j?.comment&&(A=j.comment)}A&&(h=!0);let T=qO.stringify(x,f,()=>A=null);C<t.length-1&&(T+=","),A&&(T+=Wp.lineComment(T,n,u(A))),!h&&(m.length>g||T.includes(`
|
|
77
|
+
`))&&(h=!0),m.push(T),g=m.length}let{start:S,end:E}=r;if(m.length===0)return S+E;if(!h){let C=m.reduce((x,A)=>x+A.length+2,2);h=e.options.lineWidth>0&&C>e.options.lineWidth}if(h){let C=S;for(let x of m)C+=x?`
|
|
78
78
|
${s}${i}${x}`:`
|
|
79
79
|
`;return`${C}
|
|
80
|
-
${i}${E}`}else return`${S}${a}${
|
|
81
|
-
`:" ")}return
|
|
80
|
+
${i}${E}`}else return`${S}${a}${m.join(" ")}${a}${E}`}function Yp({indent:t,options:{commentString:e}},r,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){let s=Wp.indentComment(e(n),t);r.push(s.trimStart())}}NO.stringifyCollection=QB});var ao=F(zb=>{"use strict";var eH=Yb(),tH=Vb(),rH=qp(),oo=We(),Jp=so(),nH=Dt();function cf(t,e){let r=oo.isScalar(e)?e.value:e;for(let n of t)if(oo.isPair(n)&&(n.key===e||n.key===r||oo.isScalar(n.key)&&n.key.value===r))return n}var Jb=class extends rH.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(oo.MAP,e),this.items=[]}static from(e,r,n){let{keepUndefined:i,replacer:s}=n,a=new this(e),u=(f,h)=>{if(typeof s=="function")h=s.call(r,f,h);else if(Array.isArray(s)&&!s.includes(f))return;(h!==void 0||i)&&a.items.push(Jp.createPair(f,h,n))};if(r instanceof Map)for(let[f,h]of r)u(f,h);else if(r&&typeof r=="object")for(let f of Object.keys(r))u(f,r[f]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,r){let n;oo.isPair(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new Jp.Pair(e,e?.value):n=new Jp.Pair(e.key,e.value);let i=cf(this.items,n.key),s=this.schema?.sortMapEntries;if(i){if(!r)throw new Error(`Key ${n.key} already set`);oo.isScalar(i.value)&&nH.isScalarValue(n.value)?i.value.value=n.value:i.value=n.value}else if(s){let a=this.items.findIndex(u=>s(n,u)<0);a===-1?this.items.push(n):this.items.splice(a,0,n)}else this.items.push(n)}delete(e){let r=cf(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let i=cf(this.items,e)?.value;return(!r&&oo.isScalar(i)?i.value:i)??void 0}has(e){return!!cf(this.items,e)}set(e,r){this.add(new Jp.Pair(e,r),!0)}toJSON(e,r,n){let i=n?new n:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(i);for(let s of this.items)tH.addPairToJSMap(r,i,s);return i}toString(e,r,n){if(!e)return JSON.stringify(this);for(let i of this.items)if(!oo.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),eH.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:r})}};zb.YAMLMap=Jb;zb.findPair=cf});var ou=F($O=>{"use strict";var iH=We(),MO=ao(),sH={collection:"map",default:!0,nodeClass:MO.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return iH.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>MO.YAMLMap.from(t,e,r)};$O.map=sH});var lo=F(DO=>{"use strict";var oH=tf(),aH=Yb(),lH=qp(),Kp=We(),uH=Dt(),cH=to(),Kb=class extends lH.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Kp.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=zp(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let n=zp(e);if(typeof n!="number")return;let i=this.items[n];return!r&&Kp.isScalar(i)?i.value:i}has(e){let r=zp(e);return typeof r=="number"&&r<this.items.length}set(e,r){let n=zp(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[n];Kp.isScalar(i)&&uH.isScalarValue(r)?i.value=r:this.items[n]=r}toJSON(e,r){let n=[];r?.onCreate&&r.onCreate(n);let i=0;for(let s of this.items)n.push(cH.toJS(s,String(i++),r));return n}toString(e,r,n){return e?aH.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:r}):JSON.stringify(this)}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r)){let a=0;for(let u of r){if(typeof i=="function"){let f=r instanceof Set?u:String(a++);u=i.call(r,f,u)}s.items.push(oH.createNode(u,void 0,n))}}return s}};function zp(t){let e=Kp.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}DO.YAMLSeq=Kb});var au=F(LO=>{"use strict";var fH=We(),FO=lo(),dH={collection:"seq",default:!0,nodeClass:FO.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return fH.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>FO.YAMLSeq.from(t,e,r)};LO.seq=dH});var ff=F(jO=>{"use strict";var hH=of(),pH={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,n){return e=Object.assign({actualString:!0},e),hH.stringifyString(t,e,r,n)}};jO.string=pH});var Gp=F(HO=>{"use strict";var UO=Dt(),BO={identify:t=>t==null,createNode:()=>new UO.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new UO.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&BO.test.test(t)?t:e.options.nullStr};HO.nullTag=BO});var Gb=F(WO=>{"use strict";var mH=Dt(),VO={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new mH.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&VO.test.test(t)){let n=t[0]==="t"||t[0]==="T";if(e===n)return t}return e?r.options.trueStr:r.options.falseStr}};WO.boolTag=VO});var lu=F(YO=>{"use strict";function gH({format:t,minFractionDigits:e,tag:r,value:n}){if(typeof n=="bigint")return String(n);let i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(n,-0)?"-0":JSON.stringify(n);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let u=e-(s.length-a-1);for(;u-- >0;)s+="0"}return s}YO.stringifyNumber=gH});var Zb=F(Qp=>{"use strict";var yH=Dt(),Qb=lu(),vH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Qb.stringifyNumber},SH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Qb.stringifyNumber(t)}},bH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new yH.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Qb.stringifyNumber};Qp.float=bH;Qp.floatExp=SH;Qp.floatNaN=vH});var e0=F(Xp=>{"use strict";var JO=lu(),Zp=t=>typeof t=="bigint"||Number.isInteger(t),Xb=(t,e,r,{intAsBigInt:n})=>n?BigInt(t):parseInt(t.substring(e),r);function zO(t,e,r){let{value:n}=t;return Zp(n)&&n>=0?r+n.toString(e):JO.stringifyNumber(t)}var _H={identify:t=>Zp(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>Xb(t,2,8,r),stringify:t=>zO(t,8,"0o")},wH={identify:Zp,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>Xb(t,0,10,r),stringify:JO.stringifyNumber},EH={identify:t=>Zp(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>Xb(t,2,16,r),stringify:t=>zO(t,16,"0x")};Xp.int=wH;Xp.intHex=EH;Xp.intOct=_H});var GO=F(KO=>{"use strict";var CH=ou(),xH=Gp(),RH=au(),OH=ff(),IH=Gb(),t0=Zb(),r0=e0(),PH=[CH.map,RH.seq,OH.string,xH.nullTag,IH.boolTag,r0.intOct,r0.int,r0.intHex,t0.floatNaN,t0.floatExp,t0.float];KO.schema=PH});var XO=F(ZO=>{"use strict";var kH=Dt(),AH=ou(),TH=au();function QO(t){return typeof t=="bigint"||Number.isInteger(t)}var em=({value:t})=>JSON.stringify(t),qH=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:em},{identify:t=>t==null,createNode:()=>new kH.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:em},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:em},{identify:QO,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>QO(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:em}],NH={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},MH=[AH.map,TH.seq].concat(qH,NH);ZO.schema=MH});var i0=F(eI=>{"use strict";var df=require("buffer"),n0=Dt(),$H=of(),DH={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof df.Buffer=="function")return df.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),n=new Uint8Array(r.length);for(let i=0;i<r.length;++i)n[i]=r.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},n,i,s){if(!r)return"";let a=r,u;if(typeof df.Buffer=="function")u=a instanceof df.Buffer?a.toString("base64"):df.Buffer.from(a.buffer).toString("base64");else if(typeof btoa=="function"){let f="";for(let h=0;h<a.length;++h)f+=String.fromCharCode(a[h]);u=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=n0.Scalar.BLOCK_LITERAL),e!==n0.Scalar.QUOTE_DOUBLE){let f=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),h=Math.ceil(u.length/f),g=new Array(h);for(let m=0,S=0;m<h;++m,S+=f)g[m]=u.substr(S,f);u=g.join(e===n0.Scalar.BLOCK_LITERAL?`
|
|
81
|
+
`:" ")}return $H.stringifyString({comment:t,type:e,value:u},n,i,s)}};eI.binary=DH});var nm=F(rm=>{"use strict";var tm=We(),s0=so(),FH=Dt(),LH=lo();function tI(t,e){if(tm.isSeq(t))for(let r=0;r<t.items.length;++r){let n=t.items[r];if(!tm.isPair(n)){if(tm.isMap(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");let i=n.items[0]||new s0.Pair(new FH.Scalar(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
|
|
82
82
|
${i.key.commentBefore}`:n.commentBefore),n.comment){let s=i.value??i.key;s.comment=s.comment?`${n.comment}
|
|
83
|
-
${s.comment}`:n.comment}n=i}r.items[t]=rm.isPair(n)?n:new s0.Pair(n)}}else e("Expected a sequence for this tag");return r}function rO(r,e,t){let{replacer:n}=t,i=new FH.YAMLSeq(r);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(s++),a));let u,f;if(Array.isArray(a))if(a.length===2)u=a[0],f=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let h=Object.keys(a);if(h.length===1)u=h[0],f=a[u];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else u=a;i.items.push(s0.createPair(u,f,t))}return i}var LH={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:tO,createNode:rO};nm.createPairs=rO;nm.pairs=LH;nm.resolvePairs=tO});var l0=F(a0=>{"use strict";var nO=We(),o0=to(),pf=ao(),jH=lo(),iO=im(),la=class r extends jH.YAMLSeq{constructor(){super(),this.add=pf.YAMLMap.prototype.add.bind(this),this.delete=pf.YAMLMap.prototype.delete.bind(this),this.get=pf.YAMLMap.prototype.get.bind(this),this.has=pf.YAMLMap.prototype.has.bind(this),this.set=pf.YAMLMap.prototype.set.bind(this),this.tag=r.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let i of this.items){let s,a;if(nO.isPair(i)?(s=o0.toJS(i.key,"",t),a=o0.toJS(i.value,s,t)):s=o0.toJS(i,"",t),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,a)}return n}static from(e,t,n){let i=iO.createPairs(e,t,n),s=new this;return s.items=i.items,s}};la.tag="tag:yaml.org,2002:omap";var UH={collection:"seq",identify:r=>r instanceof Map,nodeClass:la,default:!1,tag:"tag:yaml.org,2002:omap",resolve(r,e){let t=iO.resolvePairs(r,e),n=[];for(let{key:i}of t.items)nO.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new la,t)},createNode:(r,e,t)=>la.from(r,e,t)};a0.YAMLOMap=la;a0.omap=UH});var uO=F(u0=>{"use strict";var sO=Dt();function oO({value:r,source:e},t){return e&&(r?aO:lO).test.test(e)?e:r?t.options.trueStr:t.options.falseStr}var aO={identify:r=>r===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new sO.Scalar(!0),stringify:oO},lO={identify:r=>r===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new sO.Scalar(!1),stringify:oO};u0.falseTag=lO;u0.trueTag=aO});var cO=F(sm=>{"use strict";var BH=Dt(),c0=lu(),HH={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:r=>r.slice(-3).toLowerCase()==="nan"?NaN:r[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:c0.stringifyNumber},VH={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:r=>parseFloat(r.replace(/_/g,"")),stringify(r){let e=Number(r.value);return isFinite(e)?e.toExponential():c0.stringifyNumber(r)}},WH={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(r){let e=new BH.Scalar(parseFloat(r.replace(/_/g,""))),t=r.indexOf(".");if(t!==-1){let n=r.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:c0.stringifyNumber};sm.float=WH;sm.floatExp=VH;sm.floatNaN=HH});var dO=F(gf=>{"use strict";var fO=lu(),mf=r=>typeof r=="bigint"||Number.isInteger(r);function om(r,e,t,{intAsBigInt:n}){let i=r[0];if((i==="-"||i==="+")&&(e+=1),r=r.substring(e).replace(/_/g,""),n){switch(t){case 2:r=`0b${r}`;break;case 8:r=`0o${r}`;break;case 16:r=`0x${r}`;break}let a=BigInt(r);return i==="-"?BigInt(-1)*a:a}let s=parseInt(r,t);return i==="-"?-1*s:s}function f0(r,e,t){let{value:n}=r;if(mf(n)){let i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return fO.stringifyNumber(r)}var YH={identify:mf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(r,e,t)=>om(r,2,2,t),stringify:r=>f0(r,2,"0b")},JH={identify:mf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(r,e,t)=>om(r,1,8,t),stringify:r=>f0(r,8,"0")},zH={identify:mf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(r,e,t)=>om(r,0,10,t),stringify:fO.stringifyNumber},KH={identify:mf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(r,e,t)=>om(r,2,16,t),stringify:r=>f0(r,16,"0x")};gf.int=zH;gf.intBin=YH;gf.intHex=KH;gf.intOct=JH});var h0=F(d0=>{"use strict";var um=We(),am=so(),lm=ao(),ua=class r extends lm.YAMLMap{constructor(e){super(e),this.tag=r.tag}add(e){let t;um.isPair(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new am.Pair(e.key,null):t=new am.Pair(e,null),lm.findPair(this.items,t.key)||this.items.push(t)}get(e,t){let n=lm.findPair(this.items,e);return!t&&um.isPair(n)?um.isScalar(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=lm.findPair(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new am.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){let{replacer:i}=n,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let a of t)typeof i=="function"&&(a=i.call(t,a,a)),s.items.push(am.createPair(a,null,n));return s}};ua.tag="tag:yaml.org,2002:set";var GH={collection:"map",identify:r=>r instanceof Set,nodeClass:ua,default:!1,tag:"tag:yaml.org,2002:set",createNode:(r,e,t)=>ua.from(r,e,t),resolve(r,e){if(um.isMap(r)){if(r.hasAllNullValues(!0))return Object.assign(new ua,r);e("Set items must all have null values")}else e("Expected a mapping for this tag");return r}};d0.YAMLSet=ua;d0.set=GH});var m0=F(cm=>{"use strict";var QH=lu();function p0(r,e){let t=r[0],n=t==="-"||t==="+"?r.substring(1):r,i=a=>e?BigInt(a):Number(a),s=n.replace(/_/g,"").split(":").reduce((a,u)=>a*i(60)+i(u),i(0));return t==="-"?i(-1)*s:s}function hO(r){let{value:e}=r,t=a=>a;if(typeof e=="bigint")t=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return QH.stringifyNumber(r);let n="";e<0&&(n="-",e*=t(-1));let i=t(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var ZH={identify:r=>typeof r=="bigint"||Number.isInteger(r),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(r,e,{intAsBigInt:t})=>p0(r,t),stringify:hO},XH={identify:r=>typeof r=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:r=>p0(r,!1),stringify:hO},pO={identify:r=>r instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(r){let e=r.match(pO.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,t,n,i,s,a,u]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,h=Date.UTC(t,n-1,i,s||0,a||0,u||0,f),m=e[8];if(m&&m!=="Z"){let g=p0(m,!1);Math.abs(g)<30&&(g*=60),h-=6e4*g}return new Date(h)},stringify:({value:r})=>r?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};cm.floatTime=XH;cm.intTime=ZH;cm.timestamp=pO});var yO=F(gO=>{"use strict";var eV=ou(),tV=Qp(),rV=au(),nV=df(),iV=i0(),mO=uO(),g0=cO(),fm=dO(),sV=Hp(),oV=l0(),aV=im(),lV=h0(),y0=m0(),uV=[eV.map,rV.seq,nV.string,tV.nullTag,mO.trueTag,mO.falseTag,fm.intBin,fm.intOct,fm.int,fm.intHex,g0.floatNaN,g0.floatExp,g0.float,iV.binary,sV.merge,oV.omap,aV.pairs,lV.set,y0.intTime,y0.floatTime,y0.timestamp];gO.schema=uV});var IO=F(b0=>{"use strict";var _O=ou(),cV=Qp(),wO=au(),fV=df(),dV=Gb(),v0=Zb(),S0=e0(),hV=GI(),pV=XI(),CO=i0(),yf=Hp(),EO=l0(),xO=im(),vO=yO(),RO=h0(),dm=m0(),SO=new Map([["core",hV.schema],["failsafe",[_O.map,wO.seq,fV.string]],["json",pV.schema],["yaml11",vO.schema],["yaml-1.1",vO.schema]]),bO={binary:CO.binary,bool:dV.boolTag,float:v0.float,floatExp:v0.floatExp,floatNaN:v0.floatNaN,floatTime:dm.floatTime,int:S0.int,intHex:S0.intHex,intOct:S0.intOct,intTime:dm.intTime,map:_O.map,merge:yf.merge,null:cV.nullTag,omap:EO.omap,pairs:xO.pairs,seq:wO.seq,set:RO.set,timestamp:dm.timestamp},mV={"tag:yaml.org,2002:binary":CO.binary,"tag:yaml.org,2002:merge":yf.merge,"tag:yaml.org,2002:omap":EO.omap,"tag:yaml.org,2002:pairs":xO.pairs,"tag:yaml.org,2002:set":RO.set,"tag:yaml.org,2002:timestamp":dm.timestamp};function gV(r,e,t){let n=SO.get(e);if(n&&!r)return t&&!n.includes(yf.merge)?n.concat(yf.merge):n.slice();let i=n;if(!i)if(Array.isArray(r))i=[];else{let s=Array.from(SO.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(r))for(let s of r)i=i.concat(s);else typeof r=="function"&&(i=r(i.slice()));return t&&(i=i.concat(yf.merge)),i.reduce((s,a)=>{let u=typeof a=="string"?bO[a]:a;if(!u){let f=JSON.stringify(a),h=Object.keys(bO).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return s.includes(u)||s.push(u),s},[])}b0.coreKnownTags=mV;b0.getTags=gV});var C0=F(OO=>{"use strict";var _0=We(),yV=ou(),vV=au(),SV=df(),hm=IO(),bV=(r,e)=>r.key<e.key?-1:r.key>e.key?1:0,w0=class r{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:u}){this.compat=Array.isArray(e)?hm.getTags(e,"compat"):e?hm.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?hm.coreKnownTags:{},this.tags=hm.getTags(t,this.name,n),this.toStringOptions=u??null,Object.defineProperty(this,_0.MAP,{value:yV.map}),Object.defineProperty(this,_0.SCALAR,{value:SV.string}),Object.defineProperty(this,_0.SEQ,{value:vV.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?bV:null}clone(){let e=Object.create(r.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};OO.Schema=w0});var kO=F(PO=>{"use strict";var _V=We(),E0=lf(),vf=nf();function wV(r,e){let t=[],n=e.directives===!0;if(e.directives!==!1&&r.directives){let f=r.directives.toString(r);f?(t.push(f),n=!0):r.directives.docStart&&(n=!0)}n&&t.push("---");let i=E0.createStringifyContext(r,e),{commentString:s}=i.options;if(r.commentBefore){t.length!==1&&t.unshift("");let f=s(r.commentBefore);t.unshift(vf.indentComment(f,""))}let a=!1,u=null;if(r.contents){if(_V.isNode(r.contents)){if(r.contents.spaceBefore&&n&&t.push(""),r.contents.commentBefore){let m=s(r.contents.commentBefore);t.push(vf.indentComment(m,""))}i.forceBlockIndent=!!r.comment,u=r.contents.comment}let f=u?void 0:()=>a=!0,h=E0.stringify(r.contents,i,()=>u=null,f);u&&(h+=vf.lineComment(h,"",s(u))),(h[0]==="|"||h[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${h}`:t.push(h)}else t.push(E0.stringify(r.contents,i));if(r.directives?.docEnd)if(r.comment){let f=s(r.comment);f.includes(`
|
|
84
|
-
`)?(
|
|
83
|
+
${s.comment}`:n.comment}n=i}t.items[r]=tm.isPair(n)?n:new s0.Pair(n)}}else e("Expected a sequence for this tag");return t}function rI(t,e,r){let{replacer:n}=r,i=new LH.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof n=="function"&&(a=n.call(e,String(s++),a));let u,f;if(Array.isArray(a))if(a.length===2)u=a[0],f=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){let h=Object.keys(a);if(h.length===1)u=h[0],f=a[u];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else u=a;i.items.push(s0.createPair(u,f,r))}return i}var jH={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:tI,createNode:rI};rm.createPairs=rI;rm.pairs=jH;rm.resolvePairs=tI});var l0=F(a0=>{"use strict";var nI=We(),o0=to(),hf=ao(),UH=lo(),iI=nm(),la=class t extends UH.YAMLSeq{constructor(){super(),this.add=hf.YAMLMap.prototype.add.bind(this),this.delete=hf.YAMLMap.prototype.delete.bind(this),this.get=hf.YAMLMap.prototype.get.bind(this),this.has=hf.YAMLMap.prototype.has.bind(this),this.set=hf.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let n=new Map;r?.onCreate&&r.onCreate(n);for(let i of this.items){let s,a;if(nI.isPair(i)?(s=o0.toJS(i.key,"",r),a=o0.toJS(i.value,s,r)):s=o0.toJS(i,"",r),n.has(s))throw new Error("Ordered maps must not include duplicate keys");n.set(s,a)}return n}static from(e,r,n){let i=iI.createPairs(e,r,n),s=new this;return s.items=i.items,s}};la.tag="tag:yaml.org,2002:omap";var BH={collection:"seq",identify:t=>t instanceof Map,nodeClass:la,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=iI.resolvePairs(t,e),n=[];for(let{key:i}of r.items)nI.isScalar(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new la,r)},createNode:(t,e,r)=>la.from(t,e,r)};a0.YAMLOMap=la;a0.omap=BH});var uI=F(u0=>{"use strict";var sI=Dt();function oI({value:t,source:e},r){return e&&(t?aI:lI).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var aI={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new sI.Scalar(!0),stringify:oI},lI={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new sI.Scalar(!1),stringify:oI};u0.falseTag=lI;u0.trueTag=aI});var cI=F(im=>{"use strict";var HH=Dt(),c0=lu(),VH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:c0.stringifyNumber},WH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():c0.stringifyNumber(t)}},YH={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new HH.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let n=t.substring(r+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:c0.stringifyNumber};im.float=YH;im.floatExp=WH;im.floatNaN=VH});var dI=F(mf=>{"use strict";var fI=lu(),pf=t=>typeof t=="bigint"||Number.isInteger(t);function sm(t,e,r,{intAsBigInt:n}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),n){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let a=BigInt(t);return i==="-"?BigInt(-1)*a:a}let s=parseInt(t,r);return i==="-"?-1*s:s}function f0(t,e,r){let{value:n}=t;if(pf(n)){let i=n.toString(e);return n<0?"-"+r+i.substr(1):r+i}return fI.stringifyNumber(t)}var JH={identify:pf,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>sm(t,2,2,r),stringify:t=>f0(t,2,"0b")},zH={identify:pf,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>sm(t,1,8,r),stringify:t=>f0(t,8,"0")},KH={identify:pf,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>sm(t,0,10,r),stringify:fI.stringifyNumber},GH={identify:pf,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>sm(t,2,16,r),stringify:t=>f0(t,16,"0x")};mf.int=KH;mf.intBin=JH;mf.intHex=GH;mf.intOct=zH});var h0=F(d0=>{"use strict";var lm=We(),om=so(),am=ao(),ua=class t extends am.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;lm.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new om.Pair(e.key,null):r=new om.Pair(e,null),am.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let n=am.findPair(this.items,e);return!r&&lm.isPair(n)?lm.isScalar(n.key)?n.key.value:n.key:n}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let n=am.findPair(this.items,e);n&&!r?this.items.splice(this.items.indexOf(n),1):!n&&r&&this.items.push(new om.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,n);throw new Error("Set items must all have null values")}static from(e,r,n){let{replacer:i}=n,s=new this(e);if(r&&Symbol.iterator in Object(r))for(let a of r)typeof i=="function"&&(a=i.call(r,a,a)),s.items.push(om.createPair(a,null,n));return s}};ua.tag="tag:yaml.org,2002:set";var QH={collection:"map",identify:t=>t instanceof Set,nodeClass:ua,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ua.from(t,e,r),resolve(t,e){if(lm.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ua,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};d0.YAMLSet=ua;d0.set=QH});var m0=F(um=>{"use strict";var ZH=lu();function p0(t,e){let r=t[0],n=r==="-"||r==="+"?t.substring(1):t,i=a=>e?BigInt(a):Number(a),s=n.replace(/_/g,"").split(":").reduce((a,u)=>a*i(60)+i(u),i(0));return r==="-"?i(-1)*s:s}function hI(t){let{value:e}=t,r=a=>a;if(typeof e=="bigint")r=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return ZH.stringifyNumber(t);let n="";e<0&&(n="-",e*=r(-1));let i=r(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),n+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var XH={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>p0(t,r),stringify:hI},eV={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>p0(t,!1),stringify:hI},pI={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(pI.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,n,i,s,a,u]=e.map(Number),f=e[7]?Number((e[7]+"00").substr(1,3)):0,h=Date.UTC(r,n-1,i,s||0,a||0,u||0,f),g=e[8];if(g&&g!=="Z"){let m=p0(g,!1);Math.abs(m)<30&&(m*=60),h-=6e4*m}return new Date(h)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};um.floatTime=eV;um.intTime=XH;um.timestamp=pI});var yI=F(gI=>{"use strict";var tV=ou(),rV=Gp(),nV=au(),iV=ff(),sV=i0(),mI=uI(),g0=cI(),cm=dI(),oV=Bp(),aV=l0(),lV=nm(),uV=h0(),y0=m0(),cV=[tV.map,nV.seq,iV.string,rV.nullTag,mI.trueTag,mI.falseTag,cm.intBin,cm.intOct,cm.int,cm.intHex,g0.floatNaN,g0.floatExp,g0.float,sV.binary,oV.merge,aV.omap,lV.pairs,uV.set,y0.intTime,y0.floatTime,y0.timestamp];gI.schema=cV});var OI=F(b0=>{"use strict";var _I=ou(),fV=Gp(),wI=au(),dV=ff(),hV=Gb(),v0=Zb(),S0=e0(),pV=GO(),mV=XO(),EI=i0(),gf=Bp(),CI=l0(),xI=nm(),vI=yI(),RI=h0(),fm=m0(),SI=new Map([["core",pV.schema],["failsafe",[_I.map,wI.seq,dV.string]],["json",mV.schema],["yaml11",vI.schema],["yaml-1.1",vI.schema]]),bI={binary:EI.binary,bool:hV.boolTag,float:v0.float,floatExp:v0.floatExp,floatNaN:v0.floatNaN,floatTime:fm.floatTime,int:S0.int,intHex:S0.intHex,intOct:S0.intOct,intTime:fm.intTime,map:_I.map,merge:gf.merge,null:fV.nullTag,omap:CI.omap,pairs:xI.pairs,seq:wI.seq,set:RI.set,timestamp:fm.timestamp},gV={"tag:yaml.org,2002:binary":EI.binary,"tag:yaml.org,2002:merge":gf.merge,"tag:yaml.org,2002:omap":CI.omap,"tag:yaml.org,2002:pairs":xI.pairs,"tag:yaml.org,2002:set":RI.set,"tag:yaml.org,2002:timestamp":fm.timestamp};function yV(t,e,r){let n=SI.get(e);if(n&&!t)return r&&!n.includes(gf.merge)?n.concat(gf.merge):n.slice();let i=n;if(!i)if(Array.isArray(t))i=[];else{let s=Array.from(SI.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(t))for(let s of t)i=i.concat(s);else typeof t=="function"&&(i=t(i.slice()));return r&&(i=i.concat(gf.merge)),i.reduce((s,a)=>{let u=typeof a=="string"?bI[a]:a;if(!u){let f=JSON.stringify(a),h=Object.keys(bI).map(g=>JSON.stringify(g)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return s.includes(u)||s.push(u),s},[])}b0.coreKnownTags=gV;b0.getTags=yV});var E0=F(II=>{"use strict";var _0=We(),vV=ou(),SV=au(),bV=ff(),dm=OI(),_V=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,w0=class t{constructor({compat:e,customTags:r,merge:n,resolveKnownTags:i,schema:s,sortMapEntries:a,toStringDefaults:u}){this.compat=Array.isArray(e)?dm.getTags(e,"compat"):e?dm.getTags(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?dm.coreKnownTags:{},this.tags=dm.getTags(r,this.name,n),this.toStringOptions=u??null,Object.defineProperty(this,_0.MAP,{value:vV.map}),Object.defineProperty(this,_0.SCALAR,{value:bV.string}),Object.defineProperty(this,_0.SEQ,{value:SV.seq}),this.sortMapEntries=typeof a=="function"?a:a===!0?_V:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};II.Schema=w0});var kI=F(PI=>{"use strict";var wV=We(),C0=af(),yf=rf();function EV(t,e){let r=[],n=e.directives===!0;if(e.directives!==!1&&t.directives){let f=t.directives.toString(t);f?(r.push(f),n=!0):t.directives.docStart&&(n=!0)}n&&r.push("---");let i=C0.createStringifyContext(t,e),{commentString:s}=i.options;if(t.commentBefore){r.length!==1&&r.unshift("");let f=s(t.commentBefore);r.unshift(yf.indentComment(f,""))}let a=!1,u=null;if(t.contents){if(wV.isNode(t.contents)){if(t.contents.spaceBefore&&n&&r.push(""),t.contents.commentBefore){let g=s(t.contents.commentBefore);r.push(yf.indentComment(g,""))}i.forceBlockIndent=!!t.comment,u=t.contents.comment}let f=u?void 0:()=>a=!0,h=C0.stringify(t.contents,i,()=>u=null,f);u&&(h+=yf.lineComment(h,"",s(u))),(h[0]==="|"||h[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${h}`:r.push(h)}else r.push(C0.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let f=s(t.comment);f.includes(`
|
|
84
|
+
`)?(r.push("..."),r.push(yf.indentComment(f,""))):r.push(`... ${f}`)}else r.push("...");else{let f=t.comment;f&&a&&(f=f.replace(/^\n+/,"")),f&&((!a||u)&&r[r.length-1]!==""&&r.push(""),r.push(yf.indentComment(s(f),"")))}return r.join(`
|
|
85
85
|
`)+`
|
|
86
|
-
`}
|
|
87
|
-
`),a=u+a}if(/[^ ]/.test(a)){let u=1,f=
|
|
86
|
+
`}PI.stringifyDocument=EV});var vf=F(AI=>{"use strict";var CV=ef(),uu=qp(),vn=We(),xV=so(),RV=to(),OV=E0(),IV=kI(),x0=Pp(),PV=Pb(),kV=tf(),R0=Ib(),O0=class t{constructor(e,r,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,vn.NODE_TYPE,{value:vn.DOC});let i=null;typeof r=="function"||Array.isArray(r)?i=r:n===void 0&&r&&(n=r,r=void 0);let s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=s;let{version:a}=s;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new R0.Directives({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let e=Object.create(t.prototype,{[vn.NODE_TYPE]:{value:vn.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=vn.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){cu(this.contents)&&this.contents.add(e)}addIn(e,r){cu(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let n=x0.anchorNames(this);e.anchor=!r||n.has(r)?x0.findNewAnchor(r||"a",n):r}return new CV.Alias(e.anchor)}createNode(e,r,n){let i;if(typeof r=="function")e=r.call({"":e},"",e),i=r;else if(Array.isArray(r)){let A=j=>typeof j=="number"||j instanceof String||j instanceof Number,T=r.filter(A).map(String);T.length>0&&(r=r.concat(T)),i=r}else n===void 0&&r&&(n=r,r=void 0);let{aliasDuplicateObjects:s,anchorPrefix:a,flow:u,keepUndefined:f,onTagObj:h,tag:g}=n??{},{onAnchor:m,setAnchors:S,sourceObjects:E}=x0.createNodeAnchors(this,a||"a"),C={aliasDuplicateObjects:s??!0,keepUndefined:f??!1,onAnchor:m,onTagObj:h,replacer:i,schema:this.schema,sourceObjects:E},x=kV.createNode(e,g,C);return u&&vn.isCollection(x)&&(x.flow=!0),S(),x}createPair(e,r,n={}){let i=this.createNode(e,null,n),s=this.createNode(r,null,n);return new xV.Pair(i,s)}delete(e){return cu(this.contents)?this.contents.delete(e):!1}deleteIn(e){return uu.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):cu(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return vn.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return uu.isEmptyPath(e)?!r&&vn.isScalar(this.contents)?this.contents.value:this.contents:vn.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return vn.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return uu.isEmptyPath(e)?this.contents!==void 0:vn.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=uu.collectionFromPath(this.schema,[e],r):cu(this.contents)&&this.contents.set(e,r)}setIn(e,r){uu.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=uu.collectionFromPath(this.schema,Array.from(e),r):cu(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new R0.Directives({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new R0.Directives({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(n)this.schema=new OV.Schema(Object.assign(n,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:n,maxAliasCount:i,onAnchor:s,reviver:a}={}){let u={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},f=RV.toJS(this.contents,r??"",u);if(typeof s=="function")for(let{count:h,res:g}of u.anchors.values())s(g,h);return typeof a=="function"?PV.applyReviver(a,{"":f},"",f):f}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return IV.stringifyDocument(this,e)}};function cu(t){if(vn.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}AI.Document=O0});var _f=F(bf=>{"use strict";var Sf=class extends Error{constructor(e,r,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=r}},I0=class extends Sf{constructor(e,r,n){super("YAMLParseError",e,r,n)}},P0=class extends Sf{constructor(e,r,n){super("YAMLWarning",e,r,n)}},AV=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(u=>e.linePos(u));let{line:n,col:i}=r.linePos[0];r.message+=` at line ${n}, column ${i}`;let s=i-1,a=t.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){let u=Math.min(s-39,a.length-79);a="\u2026"+a.substring(u),s-=u-1}if(a.length>80&&(a=a.substring(0,79)+"\u2026"),n>1&&/^ *$/.test(a.substring(0,s))){let u=t.substring(e.lineStarts[n-2],e.lineStarts[n-1]);u.length>80&&(u=u.substring(0,79)+`\u2026
|
|
87
|
+
`),a=u+a}if(/[^ ]/.test(a)){let u=1,f=r.linePos[1];f?.line===n&&f.col>i&&(u=Math.max(1,Math.min(f.col-i,80-s)));let h=" ".repeat(s)+"^".repeat(u);r.message+=`:
|
|
88
88
|
|
|
89
89
|
${a}
|
|
90
90
|
${h}
|
|
91
|
-
`}};
|
|
92
|
-
`))return!0;if(
|
|
93
|
-
`+x.comment:u.comment=x.comment);continue}(x.newlineAfterProp
|
|
94
|
-
`+Y.comment:j.comment=Y.comment);let V=new
|
|
95
|
-
`+ee.comment:h.comment=ee.comment),
|
|
96
|
-
`+k:w.comment=k,ee.comment=ee.comment.substring(k.length+1)}}if(!a&&!V&&!ee.found){let k=K?r
|
|
97
|
-
`+P.comment:w.comment=P.comment);let D=new
|
|
98
|
-
`+A.comment:h.comment=A.comment),h.range=[n.offset,x,A.offset]}else h.range=[n.offset,x,x];return h}
|
|
99
|
-
`.repeat(Math.max(1,a.length-1)):"",A=n+i.length;return e.source&&(A+=e.source.length),{value:x,type:s,comment:i.comment,range:[n,A,A]}}let f=e.indent+i.indent,h=e.offset+i.length,
|
|
100
|
-
`;for(let x=
|
|
101
|
-
`):A.length>f||
|
|
91
|
+
`}};bf.YAMLError=Sf;bf.YAMLParseError=I0;bf.YAMLWarning=P0;bf.prettifyError=AV});var wf=F(TI=>{"use strict";function TV(t,{flow:e,indicator:r,next:n,offset:i,onError:s,parentIndent:a,startOnNewline:u}){let f=!1,h=u,g=u,m="",S="",E=!1,C=!1,x=null,A=null,T=null,j=null,Y=null,V=null,K=null;for(let w of t)switch(C&&(w.type!=="space"&&w.type!=="newline"&&w.type!=="comma"&&s(w.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),C=!1),x&&(h&&w.type!=="comment"&&w.type!=="newline"&&s(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),w.type){case"space":!e&&(r!=="doc-start"||n?.type!=="flow-collection")&&w.source.includes(" ")&&(x=w),g=!0;break;case"comment":{g||s(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let P=w.source.substring(1)||" ";m?m+=S+P:m=P,S="",h=!1;break}case"newline":h?m?m+=w.source:(!V||r!=="seq-item-ind")&&(f=!0):S+=w.source,h=!0,E=!0,(A||T)&&(j=w),g=!0;break;case"anchor":A&&s(w,"MULTIPLE_ANCHORS","A node can have at most one anchor"),w.source.endsWith(":")&&s(w.offset+w.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),A=w,K??(K=w.offset),h=!1,g=!1,C=!0;break;case"tag":{T&&s(w,"MULTIPLE_TAGS","A node can have at most one tag"),T=w,K??(K=w.offset),h=!1,g=!1,C=!0;break}case r:(A||T)&&s(w,"BAD_PROP_ORDER",`Anchors and tags must be after the ${w.source} indicator`),V&&s(w,"UNEXPECTED_TOKEN",`Unexpected ${w.source} in ${e??"collection"}`),V=w,h=r==="seq-item-ind"||r==="explicit-key-ind",g=!1;break;case"comma":if(e){Y&&s(w,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),Y=w,h=!1,g=!1;break}default:s(w,"UNEXPECTED_TOKEN",`Unexpected ${w.type} token`),h=!1,g=!1}let ee=t[t.length-1],k=ee?ee.offset+ee.source.length:i;return C&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&s(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x&&(h&&x.indent<=a||n?.type==="block-map"||n?.type==="block-seq")&&s(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:Y,found:V,spaceBefore:f,comment:m,hasNewline:E,anchor:A,tag:T,newlineAfterProp:j,end:k,start:K??k}}TI.resolveProps=TV});var hm=F(qI=>{"use strict";function k0(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
|
|
92
|
+
`))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(k0(e.key)||k0(e.value))return!0}return!1;default:return!0}}qI.containsNewline=k0});var A0=F(NI=>{"use strict";var qV=hm();function NV(t,e,r){if(e?.type==="flow-collection"){let n=e.end[0];n.indent===t&&(n.source==="]"||n.source==="}")&&qV.containsNewline(e)&&r(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}NI.flowIndentCheck=NV});var T0=F($I=>{"use strict";var MI=We();function MV(t,e,r){let{uniqueKeys:n}=t.options;if(n===!1)return!1;let i=typeof n=="function"?n:(s,a)=>s===a||MI.isScalar(s)&&MI.isScalar(a)&&s.value===a.value;return e.some(s=>i(s.key,r))}$I.mapIncludes=MV});var BI=F(UI=>{"use strict";var DI=so(),$V=ao(),FI=wf(),DV=hm(),LI=A0(),FV=T0(),jI="All mapping items must start at the same column";function LV({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=s?.nodeClass??$V.YAMLMap,u=new a(r.schema);r.atRoot&&(r.atRoot=!1);let f=n.offset,h=null;for(let g of n.items){let{start:m,key:S,sep:E,value:C}=g,x=FI.resolveProps(m,{indicator:"explicit-key-ind",next:S??E?.[0],offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0}),A=!x.found;if(A){if(S&&(S.type==="block-seq"?i(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in S&&S.indent!==n.indent&&i(f,"BAD_INDENT",jI)),!x.anchor&&!x.tag&&!E){h=x.end,x.comment&&(u.comment?u.comment+=`
|
|
93
|
+
`+x.comment:u.comment=x.comment);continue}(x.newlineAfterProp||DV.containsNewline(S))&&i(S??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else x.found?.indent!==n.indent&&i(f,"BAD_INDENT",jI);r.atKey=!0;let T=x.end,j=S?t(r,S,x,i):e(r,T,m,null,x,i);r.schema.compat&&LI.flowIndentCheck(n.indent,S,i),r.atKey=!1,FV.mapIncludes(r,u.items,j)&&i(T,"DUPLICATE_KEY","Map keys must be unique");let Y=FI.resolveProps(E??[],{indicator:"map-value-ind",next:C,offset:j.range[2],onError:i,parentIndent:n.indent,startOnNewline:!S||S.type==="block-scalar"});if(f=Y.end,Y.found){A&&(C?.type==="block-map"&&!Y.hasNewline&&i(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&x.start<Y.found.offset-1024&&i(j.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let V=C?t(r,C,Y,i):e(r,f,E,null,Y,i);r.schema.compat&&LI.flowIndentCheck(n.indent,C,i),f=V.range[2];let K=new DI.Pair(j,V);r.options.keepSourceTokens&&(K.srcToken=g),u.items.push(K)}else{A&&i(j.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),Y.comment&&(j.comment?j.comment+=`
|
|
94
|
+
`+Y.comment:j.comment=Y.comment);let V=new DI.Pair(j);r.options.keepSourceTokens&&(V.srcToken=g),u.items.push(V)}}return h&&h<f&&i(h,"IMPOSSIBLE","Map comment with trailing content"),u.range=[n.offset,f,h??f],u}UI.resolveBlockMap=LV});var VI=F(HI=>{"use strict";var jV=lo(),UV=wf(),BV=A0();function HV({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=s?.nodeClass??jV.YAMLSeq,u=new a(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let f=n.offset,h=null;for(let{start:g,value:m}of n.items){let S=UV.resolveProps(g,{indicator:"seq-item-ind",next:m,offset:f,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!S.found)if(S.anchor||S.tag||m)m?.type==="block-seq"?i(S.end,"BAD_INDENT","All sequence items must start at the same column"):i(f,"MISSING_CHAR","Sequence item without - indicator");else{h=S.end,S.comment&&(u.comment=S.comment);continue}let E=m?t(r,m,S,i):e(r,S.end,g,null,S,i);r.schema.compat&&BV.flowIndentCheck(n.indent,m,i),f=E.range[2],u.items.push(E)}return u.range=[n.offset,f,h??f],u}HI.resolveBlockSeq=HV});var fu=F(WI=>{"use strict";function VV(t,e,r,n){let i="";if(t){let s=!1,a="";for(let u of t){let{source:f,type:h}=u;switch(h){case"space":s=!0;break;case"comment":{r&&!s&&n(u,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let g=f.substring(1)||" ";i?i+=a+g:i=g,a="";break}case"newline":i&&(a+=f),s=!0;break;default:n(u,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}e+=f.length}}return{comment:i,offset:e}}WI.resolveEnd=VV});var KI=F(zI=>{"use strict";var WV=We(),YV=so(),YI=ao(),JV=lo(),zV=fu(),JI=wf(),KV=hm(),GV=T0(),q0="Block collections are not allowed within flow collections",N0=t=>t&&(t.type==="block-map"||t.type==="block-seq");function QV({composeNode:t,composeEmptyNode:e},r,n,i,s){let a=n.start.source==="{",u=a?"flow map":"flow sequence",f=s?.nodeClass??(a?YI.YAMLMap:JV.YAMLSeq),h=new f(r.schema);h.flow=!0;let g=r.atRoot;g&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let m=n.offset+n.start.source.length;for(let A=0;A<n.items.length;++A){let T=n.items[A],{start:j,key:Y,sep:V,value:K}=T,ee=JI.resolveProps(j,{flow:u,indicator:"explicit-key-ind",next:Y??V?.[0],offset:m,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!ee.found){if(!ee.anchor&&!ee.tag&&!V&&!K){A===0&&ee.comma?i(ee.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`):A<n.items.length-1&&i(ee.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${u}`),ee.comment&&(h.comment?h.comment+=`
|
|
95
|
+
`+ee.comment:h.comment=ee.comment),m=ee.end;continue}!a&&r.options.strict&&KV.containsNewline(Y)&&i(Y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(A===0)ee.comma&&i(ee.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${u}`);else if(ee.comma||i(ee.start,"MISSING_CHAR",`Missing , between ${u} items`),ee.comment){let k="";e:for(let w of j)switch(w.type){case"comma":case"space":break;case"comment":k=w.source.substring(1);break e;default:break e}if(k){let w=h.items[h.items.length-1];WV.isPair(w)&&(w=w.value??w.key),w.comment?w.comment+=`
|
|
96
|
+
`+k:w.comment=k,ee.comment=ee.comment.substring(k.length+1)}}if(!a&&!V&&!ee.found){let k=K?t(r,K,ee,i):e(r,ee.end,V,null,ee,i);h.items.push(k),m=k.range[2],N0(K)&&i(k.range,"BLOCK_IN_FLOW",q0)}else{r.atKey=!0;let k=ee.end,w=Y?t(r,Y,ee,i):e(r,k,j,null,ee,i);N0(Y)&&i(w.range,"BLOCK_IN_FLOW",q0),r.atKey=!1;let P=JI.resolveProps(V??[],{flow:u,indicator:"map-value-ind",next:K,offset:w.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(P.found){if(!a&&!ee.found&&r.options.strict){if(V)for(let L of V){if(L===P.found)break;if(L.type==="newline"){i(L,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}ee.start<P.found.offset-1024&&i(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else K&&("source"in K&&K.source?.[0]===":"?i(K,"MISSING_CHAR",`Missing space after : in ${u}`):i(P.start,"MISSING_CHAR",`Missing , or : between ${u} items`));let $=K?t(r,K,P,i):P.found?e(r,P.end,V,null,P,i):null;$?N0(K)&&i($.range,"BLOCK_IN_FLOW",q0):P.comment&&(w.comment?w.comment+=`
|
|
97
|
+
`+P.comment:w.comment=P.comment);let D=new YV.Pair(w,$);if(r.options.keepSourceTokens&&(D.srcToken=T),a){let L=h;GV.mapIncludes(r,L.items,w)&&i(k,"DUPLICATE_KEY","Map keys must be unique"),L.items.push(D)}else{let L=new YI.YAMLMap(r.schema);L.flow=!0,L.items.push(D);let z=($??w).range;L.range=[w.range[0],z[1],z[2]],h.items.push(L)}m=$?$.range[2]:P.end}}let S=a?"}":"]",[E,...C]=n.end,x=m;if(E?.source===S)x=E.offset+E.source.length;else{let A=u[0].toUpperCase()+u.substring(1),T=g?`${A} must end with a ${S}`:`${A} in block collection must be sufficiently indented and end with a ${S}`;i(m,g?"MISSING_CHAR":"BAD_INDENT",T),E&&E.source.length!==1&&C.unshift(E)}if(C.length>0){let A=zV.resolveEnd(C,x,r.options.strict,i);A.comment&&(h.comment?h.comment+=`
|
|
98
|
+
`+A.comment:h.comment=A.comment),h.range=[n.offset,x,A.offset]}else h.range=[n.offset,x,x];return h}zI.resolveFlowCollection=QV});var QI=F(GI=>{"use strict";var ZV=We(),XV=Dt(),eW=ao(),tW=lo(),rW=BI(),nW=VI(),iW=KI();function M0(t,e,r,n,i,s){let a=r.type==="block-map"?rW.resolveBlockMap(t,e,r,n,s):r.type==="block-seq"?nW.resolveBlockSeq(t,e,r,n,s):iW.resolveFlowCollection(t,e,r,n,s),u=a.constructor;return i==="!"||i===u.tagName?(a.tag=u.tagName,a):(i&&(a.tag=i),a)}function sW(t,e,r,n,i){let s=n.tag,a=s?e.directives.tagName(s.source,S=>i(s,"TAG_RESOLVE_FAILED",S)):null;if(r.type==="block-seq"){let{anchor:S,newlineAfterProp:E}=n,C=S&&s?S.offset>s.offset?S:s:S??s;C&&(!E||E.offset<C.offset)&&i(C,"MISSING_CHAR","Missing newline after block sequence props")}let u=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===eW.YAMLMap.tagName&&u==="map"||a===tW.YAMLSeq.tagName&&u==="seq")return M0(t,e,r,i,a);let f=e.schema.tags.find(S=>S.tag===a&&S.collection===u);if(!f){let S=e.schema.knownTags[a];if(S?.collection===u)e.schema.tags.push(Object.assign({},S,{default:!1})),f=S;else return S?i(s,"BAD_COLLECTION_TYPE",`${S.tag} used for ${u} collection, but expects ${S.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),M0(t,e,r,i,a)}let h=M0(t,e,r,i,a,f),g=f.resolve?.(h,S=>i(s,"TAG_RESOLVE_FAILED",S),e.options)??h,m=ZV.isNode(g)?g:new XV.Scalar(g);return m.range=h.range,m.tag=a,f?.format&&(m.format=f.format),m}GI.composeCollection=sW});var D0=F(ZI=>{"use strict";var $0=Dt();function oW(t,e,r){let n=e.offset,i=aW(e,t.options.strict,r);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};let s=i.mode===">"?$0.Scalar.BLOCK_FOLDED:$0.Scalar.BLOCK_LITERAL,a=e.source?lW(e.source):[],u=a.length;for(let x=a.length-1;x>=0;--x){let A=a[x][1];if(A===""||A==="\r")u=x;else break}if(u===0){let x=i.chomp==="+"&&a.length>0?`
|
|
99
|
+
`.repeat(Math.max(1,a.length-1)):"",A=n+i.length;return e.source&&(A+=e.source.length),{value:x,type:s,comment:i.comment,range:[n,A,A]}}let f=e.indent+i.indent,h=e.offset+i.length,g=0;for(let x=0;x<u;++x){let[A,T]=a[x];if(T===""||T==="\r")i.indent===0&&A.length>f&&(f=A.length);else{A.length<f&&r(h+A.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(f=A.length),g=x,f===0&&!t.atRoot&&r(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=A.length+T.length+1}for(let x=a.length-1;x>=u;--x)a[x][0].length>f&&(u=x+1);let m="",S="",E=!1;for(let x=0;x<g;++x)m+=a[x][0].slice(f)+`
|
|
100
|
+
`;for(let x=g;x<u;++x){let[A,T]=a[x];h+=A.length+T.length+1;let j=T[T.length-1]==="\r";if(j&&(T=T.slice(0,-1)),T&&A.length<f){let V=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;r(h-T.length-(j?2:1),"BAD_INDENT",V),A=""}s===$0.Scalar.BLOCK_LITERAL?(m+=S+A.slice(f)+T,S=`
|
|
101
|
+
`):A.length>f||T[0]===" "?(S===" "?S=`
|
|
102
102
|
`:!E&&S===`
|
|
103
103
|
`&&(S=`
|
|
104
104
|
|
|
105
|
-
`),
|
|
106
|
-
`,E=!0):
|
|
107
|
-
`?
|
|
105
|
+
`),m+=S+A.slice(f)+T,S=`
|
|
106
|
+
`,E=!0):T===""?S===`
|
|
107
|
+
`?m+=`
|
|
108
108
|
`:S=`
|
|
109
|
-
`:(
|
|
110
|
-
`+a[x][0].slice(f);
|
|
111
|
-
`&&(
|
|
112
|
-
`);break;default:
|
|
113
|
-
`}let C=n+i.length+e.source.length;return{value:
|
|
114
|
-
`,"sy"),
|
|
115
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,
|
|
109
|
+
`:(m+=S+T,S=" ",E=!1)}switch(i.chomp){case"-":break;case"+":for(let x=u;x<a.length;++x)m+=`
|
|
110
|
+
`+a[x][0].slice(f);m[m.length-1]!==`
|
|
111
|
+
`&&(m+=`
|
|
112
|
+
`);break;default:m+=`
|
|
113
|
+
`}let C=n+i.length+e.source.length;return{value:m,type:s,comment:i.comment,range:[n,C,C]}}function aW({offset:t,props:e},r,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],s=i[0],a=0,u="",f=-1;for(let S=1;S<i.length;++S){let E=i[S];if(!u&&(E==="-"||E==="+"))u=E;else{let C=Number(E);!a&&C?a=C:f===-1&&(f=t+S)}}f!==-1&&n(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let h=!1,g="",m=i.length;for(let S=1;S<e.length;++S){let E=e[S];switch(E.type){case"space":h=!0;case"newline":m+=E.source.length;break;case"comment":r&&!h&&n(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=E.source.length,g=E.source.substring(1);break;case"error":n(E,"UNEXPECTED_TOKEN",E.message),m+=E.source.length;break;default:{let C=`Unexpected token in block scalar header: ${E.type}`;n(E,"UNEXPECTED_TOKEN",C);let x=E.source;x&&typeof x=="string"&&(m+=x.length)}}}return{mode:s,indent:a,chomp:u,comment:g,length:m}}function lW(t){let e=t.split(/\n( *)/),r=e[0],n=r.match(/^( *)/),s=[n?.[1]?[n[1],r.slice(n[1].length)]:["",r]];for(let a=1;a<e.length;a+=2)s.push([e[a],e[a+1]]);return s}ZI.resolveBlockScalar=oW});var L0=F(eP=>{"use strict";var F0=Dt(),uW=fu();function cW(t,e,r){let{offset:n,type:i,source:s,end:a}=t,u,f,h=(S,E,C)=>r(n+S,E,C);switch(i){case"scalar":u=F0.Scalar.PLAIN,f=fW(s,h);break;case"single-quoted-scalar":u=F0.Scalar.QUOTE_SINGLE,f=dW(s,h);break;case"double-quoted-scalar":u=F0.Scalar.QUOTE_DOUBLE,f=hW(s,h);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+s.length,n+s.length]}}let g=n+s.length,m=uW.resolveEnd(a,g,e,r);return{value:f,type:u,comment:m.comment,range:[n,g,m.offset]}}function fW(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),XI(t)}function dW(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),XI(t.slice(1,-1)).replace(/''/g,"'")}function XI(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
114
|
+
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
115
|
+
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(t);if(!n)return t;let i=n[1],s=" ",a=e.lastIndex;for(r.lastIndex=a;n=r.exec(t);)n[1]===""?s===`
|
|
116
116
|
`?i+=s:s=`
|
|
117
|
-
`:(i+=s+n[1],s=" "),a=
|
|
117
|
+
`:(i+=s+n[1],s=" "),a=r.lastIndex;let u=/[ \t]*(.*)/sy;return u.lastIndex=a,n=u.exec(t),i+s+(n?.[1]??"")}function hW(t,e){let r="";for(let n=1;n<t.length-1;++n){let i=t[n];if(!(i==="\r"&&t[n+1]===`
|
|
118
118
|
`))if(i===`
|
|
119
|
-
`){let{fold:s,offset:a}=
|
|
120
|
-
`)for(s=
|
|
121
|
-
`)for(s=
|
|
122
|
-
`&&!(a==="\r"&&
|
|
123
|
-
`)&&(
|
|
124
|
-
`||n==="\r")&&!(n==="\r"&&
|
|
119
|
+
`){let{fold:s,offset:a}=pW(t,n);r+=s,n=a}else if(i==="\\"){let s=t[++n],a=mW[s];if(a)r+=a;else if(s===`
|
|
120
|
+
`)for(s=t[n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="\r"&&t[n+1]===`
|
|
121
|
+
`)for(s=t[++n+1];s===" "||s===" ";)s=t[++n+1];else if(s==="x"||s==="u"||s==="U"){let u={x:2,u:4,U:8}[s];r+=gW(t,n+1,u,e),n+=u}else{let u=t.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),r+=u}}else if(i===" "||i===" "){let s=n,a=t[n+1];for(;a===" "||a===" ";)a=t[++n+1];a!==`
|
|
122
|
+
`&&!(a==="\r"&&t[n+2]===`
|
|
123
|
+
`)&&(r+=n>s?t.slice(s,n+1):i)}else r+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function pW(t,e){let r="",n=t[e+1];for(;(n===" "||n===" "||n===`
|
|
124
|
+
`||n==="\r")&&!(n==="\r"&&t[e+2]!==`
|
|
125
125
|
`);)n===`
|
|
126
|
-
`&&(
|
|
127
|
-
`),e+=1,n=
|
|
128
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
126
|
+
`&&(r+=`
|
|
127
|
+
`),e+=1,n=t[e+1];return r||(r=" "),{fold:r,offset:e}}var mW={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
128
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function gW(t,e,r,n){let i=t.substr(e,r),a=i.length===r&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let u=t.substr(e-2,r+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${u}`),u}return String.fromCodePoint(a)}eP.resolveFlowScalar=cW});var nP=F(rP=>{"use strict";var ca=We(),tP=Dt(),yW=D0(),vW=L0();function SW(t,e,r,n){let{value:i,type:s,comment:a,range:u}=e.type==="block-scalar"?yW.resolveBlockScalar(t,e,n):vW.resolveFlowScalar(e,t.options.strict,n),f=r?t.directives.tagName(r.source,m=>n(r,"TAG_RESOLVE_FAILED",m)):null,h;t.options.stringKeys&&t.atKey?h=t.schema[ca.SCALAR]:f?h=bW(t.schema,i,f,r,n):e.type==="scalar"?h=_W(t,i,e,n):h=t.schema[ca.SCALAR];let g;try{let m=h.resolve(i,S=>n(r??e,"TAG_RESOLVE_FAILED",S),t.options);g=ca.isScalar(m)?m:new tP.Scalar(m)}catch(m){let S=m instanceof Error?m.message:String(m);n(r??e,"TAG_RESOLVE_FAILED",S),g=new tP.Scalar(i)}return g.range=u,g.source=i,s&&(g.type=s),f&&(g.tag=f),h.format&&(g.format=h.format),a&&(g.comment=a),g}function bW(t,e,r,n,i){if(r==="!")return t[ca.SCALAR];let s=[];for(let u of t.tags)if(!u.collection&&u.tag===r)if(u.default&&u.test)s.push(u);else return u;for(let u of s)if(u.test?.test(e))return u;let a=t.knownTags[r];return a&&!a.collection?(t.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[ca.SCALAR])}function _W({atKey:t,directives:e,schema:r},n,i,s){let a=r.tags.find(u=>(u.default===!0||t&&u.default==="key")&&u.test?.test(n))||r[ca.SCALAR];if(r.compat){let u=r.compat.find(f=>f.default&&f.test?.test(n))??r[ca.SCALAR];if(a.tag!==u.tag){let f=e.tagString(a.tag),h=e.tagString(u.tag),g=`Value may be parsed as either ${f} or ${h}`;s(i,"TAG_RESOLVE_FAILED",g,!0)}}return a}rP.composeScalar=SW});var sP=F(iP=>{"use strict";function wW(t,e,r){if(e){r??(r=e.length);for(let n=r-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++n];i?.type==="space";)t+=i.source.length,i=e[++n];break}}return t}iP.emptyScalarPosition=wW});var lP=F(U0=>{"use strict";var EW=ef(),CW=We(),xW=QI(),oP=nP(),RW=fu(),OW=sP(),IW={composeNode:aP,composeEmptyNode:j0};function aP(t,e,r,n){let i=t.atKey,{spaceBefore:s,comment:a,anchor:u,tag:f}=r,h,g=!0;switch(e.type){case"alias":h=PW(t,e,n),(u||f)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":h=oP.composeScalar(t,e,f,n),u&&(h.anchor=u.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":h=xW.composeCollection(IW,t,e,r,n),u&&(h.anchor=u.source.substring(1));break;default:{let m=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",m),h=j0(t,e.offset,void 0,null,r,n),g=!1}}return u&&h.anchor===""&&n(u,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!CW.isScalar(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&n(f??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(h.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?h.comment=a:h.commentBefore=a),t.options.keepSourceTokens&&g&&(h.srcToken=e),h}function j0(t,e,r,n,{spaceBefore:i,comment:s,anchor:a,tag:u,end:f},h){let g={type:"scalar",offset:OW.emptyScalarPosition(e,r,n),indent:-1,source:""},m=oP.composeScalar(t,g,u,h);return a&&(m.anchor=a.source.substring(1),m.anchor===""&&h(a,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(m.spaceBefore=!0),s&&(m.comment=s,m.range[2]=f),m}function PW({options:t},{offset:e,source:r,end:n},i){let s=new EW.Alias(r.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let a=e+r.length,u=RW.resolveEnd(n,a,t.strict,i);return s.range=[e,a,u.offset],u.comment&&(s.comment=u.comment),s}U0.composeEmptyNode=j0;U0.composeNode=aP});var fP=F(cP=>{"use strict";var kW=vf(),uP=lP(),AW=fu(),TW=wf();function qW(t,e,{offset:r,start:n,value:i,end:s},a){let u=Object.assign({_directives:e},t),f=new kW.Document(void 0,u),h={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},g=TW.resolveProps(n,{indicator:"doc-start",next:i??s?.[0],offset:r,onError:a,parentIndent:0,startOnNewline:!0});g.found&&(f.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!g.hasNewline&&a(g.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=i?uP.composeNode(h,i,g,a):uP.composeEmptyNode(h,g.end,n,null,g,a);let m=f.contents.range[2],S=AW.resolveEnd(s,m,!1,a);return S.comment&&(f.comment=S.comment),f.range=[r,m,S.offset],f}cP.composeDoc=qW});var H0=F(pP=>{"use strict";var NW=require("process"),MW=Ib(),$W=vf(),Ef=_f(),dP=We(),DW=fP(),FW=fu();function Cf(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function hP(t){let e="",r=!1,n=!1;for(let i=0;i<t.length;++i){let s=t[i];switch(s[0]){case"#":e+=(e===""?"":n?`
|
|
129
129
|
|
|
130
130
|
`:`
|
|
131
|
-
`)+(s.substring(1)||" "),
|
|
131
|
+
`)+(s.substring(1)||" "),r=!0,n=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),r=!1;break;default:r||(n=!0),r=!1}}return{comment:e,afterEmptyLine:n}}var B0=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,n,i,s)=>{let a=Cf(r);s?this.warnings.push(new Ef.YAMLWarning(a,n,i)):this.errors.push(new Ef.YAMLParseError(a,n,i))},this.directives=new MW.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:n,afterEmptyLine:i}=hP(this.prelude);if(n){let s=e.contents;if(r)e.comment=e.comment?`${e.comment}
|
|
132
132
|
${n}`:n;else if(i||e.directives.docStart||!s)e.commentBefore=n;else if(dP.isCollection(s)&&!s.flow&&s.items.length>0){let a=s.items[0];dP.isPair(a)&&(a=a.key);let u=a.commentBefore;a.commentBefore=u?`${n}
|
|
133
133
|
${u}`:n}else{let a=s.commentBefore;s.commentBefore=a?`${n}
|
|
134
|
-
${a}`:n}}
|
|
135
|
-
${
|
|
134
|
+
${a}`:n}}r?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:hP(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,n=-1){for(let i of e)yield*this.next(i);yield*this.end(r,n)}*next(e){switch(NW.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,n,i)=>{let s=Cf(e);s[0]+=r,this.onError(s,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=DW.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Ef.YAMLParseError(Cf(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){let n="Unexpected doc-end without preceding document";this.errors.push(new Ef.YAMLParseError(Cf(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;let r=FW.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let n=this.doc.comment;this.doc.comment=n?`${n}
|
|
135
|
+
${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Ef.YAMLParseError(Cf(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let n=Object.assign({_directives:this.directives},this.options),i=new $W.Document(void 0,n);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,r,r],this.decorate(i,!1),yield i}}};pP.Composer=B0});var yP=F(pm=>{"use strict";var LW=D0(),jW=L0(),UW=_f(),mP=of();function BW(t,e=!0,r){if(t){let n=(i,s,a)=>{let u=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(r)r(u,s,a);else throw new UW.YAMLParseError([u,u+1],s,a)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return jW.resolveFlowScalar(t,e,n);case"block-scalar":return LW.resolveBlockScalar({options:{strict:e}},t,n)}}return null}function HW(t,e){let{implicitKey:r=!1,indent:n,inFlow:i=!1,offset:s=-1,type:a="PLAIN"}=e,u=mP.stringifyString({type:a,value:t},{implicitKey:r,indent:n>0?" ".repeat(n):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),f=e.end??[{type:"newline",offset:-1,indent:n,source:`
|
|
136
136
|
`}];switch(u[0]){case"|":case">":{let h=u.indexOf(`
|
|
137
|
-
`),
|
|
138
|
-
`,S=[{type:"block-scalar-header",offset:s,indent:n,source:
|
|
139
|
-
`}),{type:"block-scalar",offset:s,indent:n,props:S,source:
|
|
140
|
-
`),n=e.substring(0,
|
|
141
|
-
`;if(
|
|
142
|
-
`});for(let f of Object.keys(
|
|
143
|
-
`};delete
|
|
137
|
+
`),g=u.substring(0,h),m=u.substring(h+1)+`
|
|
138
|
+
`,S=[{type:"block-scalar-header",offset:s,indent:n,source:g}];return gP(S,f)||S.push({type:"newline",offset:-1,indent:n,source:`
|
|
139
|
+
`}),{type:"block-scalar",offset:s,indent:n,props:S,source:m}}case'"':return{type:"double-quoted-scalar",offset:s,indent:n,source:u,end:f};case"'":return{type:"single-quoted-scalar",offset:s,indent:n,source:u,end:f};default:return{type:"scalar",offset:s,indent:n,source:u,end:f}}}function VW(t,e,r={}){let{afterKey:n=!1,implicitKey:i=!1,inFlow:s=!1,type:a}=r,u="indent"in t?t.indent:null;if(n&&typeof u=="number"&&(u+=2),!a)switch(t.type){case"single-quoted-scalar":a="QUOTE_SINGLE";break;case"double-quoted-scalar":a="QUOTE_DOUBLE";break;case"block-scalar":{let h=t.props[0];if(h.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a=h.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:a="PLAIN"}let f=mP.stringifyString({type:a,value:e},{implicitKey:i||u===null,indent:u!==null&&u>0?" ".repeat(u):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":WW(t,f);break;case'"':V0(t,f,"double-quoted-scalar");break;case"'":V0(t,f,"single-quoted-scalar");break;default:V0(t,f,"scalar")}}function WW(t,e){let r=e.indexOf(`
|
|
140
|
+
`),n=e.substring(0,r),i=e.substring(r+1)+`
|
|
141
|
+
`;if(t.type==="block-scalar"){let s=t.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=n,t.source=i}else{let{offset:s}=t,a="indent"in t?t.indent:-1,u=[{type:"block-scalar-header",offset:s,indent:a,source:n}];gP(u,"end"in t?t.end:void 0)||u.push({type:"newline",offset:-1,indent:a,source:`
|
|
142
|
+
`});for(let f of Object.keys(t))f!=="type"&&f!=="offset"&&delete t[f];Object.assign(t,{type:"block-scalar",indent:a,props:u,source:i})}}function gP(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function V0(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let n=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let s of n)s.offset+=i;delete t.props,Object.assign(t,{type:r,source:e,end:n});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
|
|
143
|
+
`};delete t.items,Object.assign(t,{type:r,source:e,end:[i]});break}default:{let n="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(let s of Object.keys(t))s!=="type"&&s!=="offset"&&delete t[s];Object.assign(t,{type:r,indent:n,source:e,end:i})}}}pm.createScalarToken=HW;pm.resolveAsScalar=BW;pm.setScalarValue=VW});var SP=F(vP=>{"use strict";var YW=t=>"type"in t?gm(t):mm(t);function gm(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=gm(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=mm(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=mm(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=mm(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function mm({start:t,key:e,sep:r,value:n}){let i="";for(let s of t)i+=s.source;if(e&&(i+=gm(e)),r)for(let s of r)i+=s.source;return n&&(i+=gm(n)),i}vP.stringify=YW});var EP=F(wP=>{"use strict";var W0=Symbol("break visit"),JW=Symbol("skip children"),bP=Symbol("remove item");function fa(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),_P(Object.freeze([]),t,e)}fa.BREAK=W0;fa.SKIP=JW;fa.REMOVE=bP;fa.itemAtPath=(t,e)=>{let r=t;for(let[n,i]of e){let s=r?.[n];if(s&&"items"in s)r=s.items[i];else return}return r};fa.parentCollection=(t,e)=>{let r=fa.itemAtPath(t,e.slice(0,-1)),n=e[e.length-1][0],i=r?.[n];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function _P(t,e,r){let n=r(e,t);if(typeof n=="symbol")return n;for(let i of["key","value"]){let s=e[i];if(s&&"items"in s){for(let a=0;a<s.items.length;++a){let u=_P(Object.freeze(t.concat([[i,a]])),s.items[a],r);if(typeof u=="number")a=u-1;else{if(u===W0)return W0;u===bP&&(s.items.splice(a,1),a-=1)}}typeof n=="function"&&i==="key"&&(n=n(e,t))}}return typeof n=="function"?n(e,t):n}wP.visit=fa});var ym=F($r=>{"use strict";var Y0=yP(),zW=SP(),KW=EP(),J0="\uFEFF",z0="",K0="",G0="",GW=t=>!!t&&"items"in t,QW=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function ZW(t){switch(t){case J0:return"<BOM>";case z0:return"<DOC>";case K0:return"<FLOW_END>";case G0:return"<SCALAR>";default:return JSON.stringify(t)}}function XW(t){switch(t){case J0:return"byte-order-mark";case z0:return"doc-mode";case K0:return"flow-error-end";case G0:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
144
144
|
`:case`\r
|
|
145
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(
|
|
146
|
-
`:case"\r":case" ":return!0;default:return!1}}var
|
|
147
|
-
\r `),Q0=
|
|
148
|
-
`?!0:
|
|
149
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let
|
|
150
|
-
`||!i&&!this.atEnd)return e+n+1}return
|
|
151
|
-
`||n>=this.indentNext||!
|
|
152
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===
|
|
145
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}$r.createScalarToken=Y0.createScalarToken;$r.resolveAsScalar=Y0.resolveAsScalar;$r.setScalarValue=Y0.setScalarValue;$r.stringify=zW.stringify;$r.visit=KW.visit;$r.BOM=J0;$r.DOCUMENT=z0;$r.FLOW_END=K0;$r.SCALAR=G0;$r.isCollection=GW;$r.isScalar=QW;$r.prettyToken=ZW;$r.tokenType=XW});var X0=F(xP=>{"use strict";var xf=ym();function Vn(t){switch(t){case void 0:case" ":case`
|
|
146
|
+
`:case"\r":case" ":return!0;default:return!1}}var CP=new Set("0123456789ABCDEFabcdef"),eY=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),vm=new Set(",[]{}"),tY=new Set(` ,[]{}
|
|
147
|
+
\r `),Q0=t=>!t||tY.has(t),Z0=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let n=this.next??"stream";for(;n&&(r||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
|
|
148
|
+
`?!0:r==="\r"?this.buffer[e+1]===`
|
|
149
|
+
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let n=0;for(;r===" ";)r=this.buffer[++n+e];if(r==="\r"){let i=this.buffer[n+e+1];if(i===`
|
|
150
|
+
`||!i&&!this.atEnd)return e+n+1}return r===`
|
|
151
|
+
`||n>=this.indentNext||!r&&!this.atEnd?e+n:-1}if(r==="-"||r==="."){let n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&Vn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
152
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===xf.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,n=e.indexOf("#");for(;n!==-1;){let s=e[n-1];if(s===" "||s===" "){r=n-1;break}else n=e.indexOf("#",n+1)}for(;;){let s=e[r-1];if(s===" "||s===" ")r-=1;else break}let i=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield xf.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&Vn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Vn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Vn(r)){let n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Q0),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,n=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=n=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&Vn(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield xf.FLOW_END,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Q0),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let a=this.charAt(1);if(this.flowKey||Vn(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let s=0;for(;this.buffer[r-1-s]==="\\";)s+=1;if(s%2===0)break;r=this.buffer.indexOf('"',r+1)}let n=this.buffer.substring(0,r),i=n.indexOf(`
|
|
153
153
|
`,this.pos);if(i!==-1){for(;i!==-1;){let s=this.continueScalar(i+1);if(s===-1)break;i=n.indexOf(`
|
|
154
|
-
`,s)}i!==-1&&(
|
|
155
|
-
`:e=s,
|
|
156
|
-
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(
|
|
154
|
+
`,s)}i!==-1&&(r=i-(n[i-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>Vn(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,n;e:for(let s=this.pos;n=this.buffer[s];++s)switch(n){case" ":r+=1;break;case`
|
|
155
|
+
`:e=s,r=0;break;case"\r":{let a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
156
|
+
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
157
157
|
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
|
|
158
158
|
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let s=e-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);let u=s;for(;a===" ";)a=this.buffer[--s];if(a===`
|
|
159
|
-
`&&s>=this.pos&&s+1+
|
|
159
|
+
`&&s>=this.pos&&s+1+r>u)e=s;else break}while(!0);return yield xf.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){let s=this.buffer[n+1];if(Vn(s)||e&&vm.has(s))break;r=n}else if(Vn(i)){let s=this.buffer[n+1];if(i==="\r"&&(s===`
|
|
160
160
|
`?(n+=1,i=`
|
|
161
|
-
`,s=this.buffer[n+1]):
|
|
162
|
-
`){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&
|
|
161
|
+
`,s=this.buffer[n+1]):r=n),s==="#"||e&&vm.has(s))break;if(i===`
|
|
162
|
+
`){let a=this.continueScalar(n+1);if(a===-1)break;n=Math.max(n,a-2)}}else{if(e&&vm.has(i))break;r=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield xf.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(r&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Q0))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{let e=this.flowLevel>0,r=this.charAt(1);if(Vn(r)||e&&vm.has(r))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!Vn(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(eY.has(r))r=this.buffer[++e];else if(r==="%"&&CP.has(this.buffer[e+1])&&CP.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
163
163
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
164
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let
|
|
165
|
-
`)+1;for(;
|
|
166
|
-
`,
|
|
167
|
-
`)+1;for(;
|
|
168
|
-
`,
|
|
164
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,n;do n=this.buffer[++r];while(n===" "||e&&n===" ");let i=r-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=r),i}*pushUntil(e){let r=this.pos,n=this.buffer[r];for(;!e(n);)n=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};xP.Lexer=Z0});var t_=F(RP=>{"use strict";var e_=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,n=this.lineStarts.length;for(;r<n;){let s=r+n>>1;this.lineStarts[s]<e?r=s+1:n=s}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let i=this.lineStarts[r-1];return{line:r,col:e-i+1}}}};RP.LineCounter=e_});var n_=F(AP=>{"use strict";var rY=require("process"),OP=ym(),nY=X0();function uo(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function IP(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function kP(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Sm(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function du(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function PP(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!uo(e.start,"explicit-key-ind")&&!uo(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,kP(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}var r_=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new nY.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,r))yield*this.next(n);r||(yield*this.end())}*next(e){if(this.source=e,rY.env.LOG_TOKENS&&console.log("|",OP.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=OP.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let n=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in n?n.indent:0:r.type==="flow-collection"&&n.type==="document"&&(r.indent=0),r.type==="flow-collection"&&PP(r),n.type){case"document":n.value=r;break;case"block-scalar":n.props.push(r);break;case"block-map":{let i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=r;else{Object.assign(i,{key:r,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:r}):i.value=r;break}case"flow-collection":{let i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:r,sep:[]}):i.sep?i.value=r:Object.assign(i,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let i=r.items[r.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&IP(i.start)===-1&&(r.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<r.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{IP(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let r=Sm(this.peek(2)),n=du(r),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
|
|
165
|
+
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
166
|
+
`,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,i=n&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",s=[];if(i&&r.sep&&!r.value){let a=[];for(let u=0;u<r.sep.length;++u){let f=r.sep[u];switch(f.type){case"newline":a.push(u);break;case"space":break;case"comment":f.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=r.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":i||r.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):i||r.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(uo(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(kP(r.key)&&!uo(r.sep,"newline")){let a=du(r.start),u=r.key,f=r.sep;f.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:u,sep:f}]})}else s.length>0?r.sep=r.sep.concat(s,this.sourceToken):r.sep.push(this.sourceToken);else if(uo(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let a=du(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):uo(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let a=this.flowScalar(this.type);i||r.value?(e.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(a):(Object.assign(r,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{let a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!r.explicitKey&&r.sep&&!uo(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else n&&e.items.push({start:s});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let n="end"in r.value?r.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,r.start),i.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||uo(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let n=this.startBlockValue(e);if(n){this.stack.push(n);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:i,sep:[]}):r.sep?this.stack.push(i):Object.assign(r,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){let i=Sm(n),s=du(i);PP(e);let a=e.end.splice(1,e.end.length);a.push(this.sourceToken);let u={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
|
|
167
|
+
`)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
|
|
168
|
+
`,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=Sm(e),n=du(r);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=Sm(e),n=du(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};AP.Parser=r_});var $P=F(Of=>{"use strict";var TP=H0(),iY=vf(),Rf=_f(),sY=Ub(),oY=We(),aY=t_(),qP=n_();function NP(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new aY.LineCounter||null,prettyErrors:e}}function lY(t,e={}){let{lineCounter:r,prettyErrors:n}=NP(e),i=new qP.Parser(r?.addNewLine),s=new TP.Composer(e),a=Array.from(s.compose(i.parse(t)));if(n&&r)for(let u of a)u.errors.forEach(Rf.prettifyError(t,r)),u.warnings.forEach(Rf.prettifyError(t,r));return a.length>0?a:Object.assign([],{empty:!0},s.streamInfo())}function MP(t,e={}){let{lineCounter:r,prettyErrors:n}=NP(e),i=new qP.Parser(r?.addNewLine),s=new TP.Composer(e),a=null;for(let u of s.compose(i.parse(t),!0,t.length))if(!a)a=u;else if(a.options.logLevel!=="silent"){a.errors.push(new Rf.YAMLParseError(u.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&r&&(a.errors.forEach(Rf.prettifyError(t,r)),a.warnings.forEach(Rf.prettifyError(t,r))),a}function uY(t,e,r){let n;typeof e=="function"?n=e:r===void 0&&e&&typeof e=="object"&&(r=e);let i=MP(t,r);if(!i)return null;if(i.warnings.forEach(s=>sY.warn(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},r))}function cY(t,e,r){let n=null;if(typeof e=="function"||Array.isArray(e)?n=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let i=Math.round(r);r=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=r??e??{};if(!i)return}return oY.isDocument(t)&&!n?t.toString(r):new iY.Document(t,n,r).toString(r)}Of.parse=uY;Of.parseAllDocuments=lY;Of.parseDocument=MP;Of.stringify=cY});var s_=F(Ze=>{"use strict";var fY=H0(),dY=vf(),hY=E0(),i_=_f(),pY=ef(),co=We(),mY=so(),gY=Dt(),yY=ao(),vY=lo(),SY=ym(),bY=X0(),_Y=t_(),wY=n_(),bm=$P(),DP=Gc();Ze.Composer=fY.Composer;Ze.Document=dY.Document;Ze.Schema=hY.Schema;Ze.YAMLError=i_.YAMLError;Ze.YAMLParseError=i_.YAMLParseError;Ze.YAMLWarning=i_.YAMLWarning;Ze.Alias=pY.Alias;Ze.isAlias=co.isAlias;Ze.isCollection=co.isCollection;Ze.isDocument=co.isDocument;Ze.isMap=co.isMap;Ze.isNode=co.isNode;Ze.isPair=co.isPair;Ze.isScalar=co.isScalar;Ze.isSeq=co.isSeq;Ze.Pair=mY.Pair;Ze.Scalar=gY.Scalar;Ze.YAMLMap=yY.YAMLMap;Ze.YAMLSeq=vY.YAMLSeq;Ze.CST=SY;Ze.Lexer=bY.Lexer;Ze.LineCounter=_Y.LineCounter;Ze.Parser=wY.Parser;Ze.parse=bm.parse;Ze.parseAllDocuments=bm.parseAllDocuments;Ze.parseDocument=bm.parseDocument;Ze.stringify=bm.stringify;Ze.visit=DP.visit;Ze.visitAsync=DP.visitAsync});var _m=F(hu=>{"use strict";Object.defineProperty(hu,"__esModule",{value:!0});hu.getDeepKeys=hu.toJSON=void 0;var AY=["function","symbol","undefined"],TY=["constructor","prototype","__proto__"],qY=Object.getPrototypeOf({});function NY(){let t={},e=this;for(let r of LP(e))if(typeof r=="string"){let n=e[r],i=typeof n;AY.includes(i)||(t[r]=n)}return t}hu.toJSON=NY;function LP(t,e=[]){let r=[];for(;t&&t!==qY;)r=r.concat(Object.getOwnPropertyNames(t),Object.getOwnPropertySymbols(t)),t=Object.getPrototypeOf(t);let n=new Set(r);for(let i of e.concat(TY))n.delete(i);return n}hu.getDeepKeys=LP});var o_=F(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.addInspectMethod=pu.format=void 0;var jP=require("util"),MY=_m(),UP=jP.inspect.custom||Symbol.for("nodejs.util.inspect.custom");pu.format=jP.format;function $Y(t){t[UP]=DY}pu.addInspectMethod=$Y;function DY(){let t={},e=this;for(let r of MY.getDeepKeys(e)){let n=e[r];t[r]=n}return delete t[UP],t}});var VP=F(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.lazyJoinStacks=Ii.joinStacks=Ii.isWritableStack=Ii.isLazyStack=void 0;var FY=/\r?\n/,LY=/\bono[ @]/;function jY(t){return!!(t&&t.configurable&&typeof t.get=="function")}Ii.isLazyStack=jY;function UY(t){return!!(!t||t.writable||typeof t.set=="function")}Ii.isWritableStack=UY;function BP(t,e){let r=HP(t.stack),n=e?e.stack:void 0;return r&&n?r+`
|
|
169
169
|
|
|
170
|
-
`+n:
|
|
171
|
-
`)}return
|
|
172
|
-
`:"")+t.message),{originalError:t,props:n,message:s}}mu.normalizeArgs=KY});var l_=F(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});Rm.Ono=void 0;var xm=JP(),KP=zP(),GY=wm(),QY=a_;Rm.Ono=QY;function a_(r,e){e=KP.normalizeOptions(e);function t(...n){let{originalError:i,props:s,message:a}=KP.normalizeArgs(n,e),u=new r(a);return xm.extendError(u,i,s)}return t[Symbol.species]=r,t}a_.toJSON=function(e){return GY.toJSON.call(e)};a_.extend=function(e,t,n){return n||t instanceof Error?xm.extendError(e,t,n):t?xm.extendError(e,void 0,t):xm.extendError(e)}});var GP=F(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.ono=void 0;var pa=l_(),ZY=Pi;Im.ono=ZY;Pi.error=new pa.Ono(Error);Pi.eval=new pa.Ono(EvalError);Pi.range=new pa.Ono(RangeError);Pi.reference=new pa.Ono(ReferenceError);Pi.syntax=new pa.Ono(SyntaxError);Pi.type=new pa.Ono(TypeError);Pi.uri=new pa.Ono(URIError);var XY=Pi;function Pi(...r){let e=r[0];if(typeof e=="object"&&typeof e.name=="string"){for(let t of Object.values(XY))if(typeof t=="function"&&t.name==="ono"){let n=t[Symbol.species];if(n&&n!==Error&&(e instanceof n||e.name===n.name))return t.apply(void 0,r)}}return Pi.error.apply(void 0,r)}});var ZP=F(QP=>{"use strict";Object.defineProperty(QP,"__esModule",{value:!0});var W7=require("util")});var fo=F((Wn,gu)=>{"use strict";var eJ=Wn&&Wn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),tJ=Wn&&Wn.__exportStar||function(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&eJ(e,r,t)};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.ono=void 0;var XP=GP();Object.defineProperty(Wn,"ono",{enumerable:!0,get:function(){return XP.ono}});var rJ=l_();Object.defineProperty(Wn,"Ono",{enumerable:!0,get:function(){return rJ.Ono}});tJ(ZP(),Wn);Wn.default=XP.ono;typeof gu=="object"&&typeof gu.exports=="object"&&(gu.exports=Object.assign(gu.exports.default,gu.exports))});var u_=F(Pf=>{"use strict";var nJ=Pf&&Pf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pf,"__esModule",{value:!0});Pf.default=iJ;var ek=nJ(require("path"));function iJ(r){return r.startsWith("\\\\?\\")?r:r.split(ek.default?.win32?.sep).join(ek.default?.posix?.sep??"/")}});var tk=F(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.isWindows=void 0;var sJ=/^win/.test(globalThis.process?globalThis.process.platform:""),oJ=()=>sJ;Om.isWindows=oJ});var Sn=F(gt=>{"use strict";var aJ=gt&>.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),lJ=gt&>.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),uJ=gt&>.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&aJ(t,e,n[i]);return lJ(t,e),t}}(),cJ=gt&>.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(gt,"__esModule",{value:!0});gt.parse=void 0;gt.resolve=rk;gt.cwd=nk;gt.getProtocol=p_;gt.getExtension=vJ;gt.stripQuery=ik;gt.getHash=sk;gt.stripHash=d_;gt.isHttp=SJ;gt.isFileSystemPath=h_;gt.fromFileSystemPath=bJ;gt.toFileSystemPath=_J;gt.safePointerToPath=wJ;gt.relative=CJ;var km=cJ(u_()),f_=uJ(require("path")),fJ=/\//g,dJ=/^(\w{2,}):\/\//i,hJ=/~1/g,pJ=/~0/g,mJ=require("path"),Pm=tk(),gJ=[[/\?/g,"%3F"],[/#/g,"%23"]],c_=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],yJ=r=>new URL(r);gt.parse=yJ;function rk(r,e){let t=new URL((0,km.default)(r),"https://aaa.nonexistanturl.com"),n=new URL((0,km.default)(e),t),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:a,hash:u}=n;return s+a+u+i}return n.toString()+i}function nk(){if(typeof window<"u")return location.href;let r=process.cwd(),e=r.slice(-1);return e==="/"||e==="\\"?r:r+"/"}function p_(r){let e=dJ.exec(r||"");if(e)return e[1].toLowerCase()}function vJ(r){let e=r.lastIndexOf(".");return e>=0?ik(r.substr(e).toLowerCase()):""}function ik(r){let e=r.indexOf("?");return e>=0&&(r=r.substr(0,e)),r}function sk(r){if(!r)return"#";let e=r.indexOf("#");return e>=0?r.substring(e):"#"}function d_(r){if(!r)return"";let e=r.indexOf("#");return e>=0&&(r=r.substring(0,e)),r}function SJ(r){let e=p_(r);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function h_(r){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=p_(r);return e===void 0||e==="file"}function bJ(r){if((0,Pm.isWindows)()){let e=nk(),t=r.toUpperCase(),i=(0,km.default)(e).toUpperCase(),s=t.includes(i),a=t.includes(i),u=f_.win32?.isAbsolute(r)||r.startsWith("http://")||r.startsWith("https://")||r.startsWith("file://");!(s||a||u)&&!e.startsWith("http")&&(r=(0,mJ.join)(e,r)),r=(0,km.default)(r)}r=encodeURI(r);for(let e of gJ)r=r.replace(e[0],e[1]);return r}function _J(r,e){r=decodeURI(r);for(let n=0;n<c_.length;n+=2)r=r.replace(c_[n],c_[n+1]);let t=r.substr(0,7).toLowerCase()==="file://";return t&&(r=r[7]==="/"?r.substr(8):r.substr(7),(0,Pm.isWindows)()&&r[1]==="/"&&(r=r[0]+":"+r.substr(1)),e?r="file:///"+r:(t=!1,r=(0,Pm.isWindows)()?r:"/"+r)),(0,Pm.isWindows)()&&!t&&(r=r.replace(fJ,"\\"),r.substr(1,2)===":\\"&&(r=r[0].toUpperCase()+r.substr(1))),r}function wJ(r){return r.length<=1||r[0]!=="#"||r[1]!=="/"?[]:r.slice(2).split("/").map(e=>decodeURIComponent(e).replace(hJ,"/").replace(pJ,"~"))}function CJ(r,e){if(!h_(r)||!h_(e))return rk(r,e);let t=f_.default.dirname(d_(r)),n=d_(e);return f_.default.relative(t,n)+sk(e)}});var bn=F(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.InvalidPointerError=Ot.TimeoutError=Ot.MissingPointerError=Ot.UnmatchedResolverError=Ot.ResolverError=Ot.UnmatchedParserError=Ot.ParserError=Ot.JSONParserErrorGroup=Ot.JSONParserError=void 0;Ot.isHandledError=EJ;Ot.normalizeError=xJ;var ok=fo(),Am=Sn(),Yn=class extends Error{constructor(e,t){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=t,this.path=null,ok.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};Ot.JSONParserError=Yn;var Tm=class r extends Error{constructor(e){super(),this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${(0,Am.toFileSystemPath)(e.$refs._root$Ref.path)}'`,ok.Ono.extend(this)}static getParserErrors(e){let t=[];for(let n of Object.values(e.$refs._$refs))n.errors&&t.push(...n.errors);return t}get errors(){return r.getParserErrors(this.files)}};Ot.JSONParserErrorGroup=Tm;var m_=class extends Yn{constructor(e,t){super(`Error parsing ${t}: ${e}`,t),this.code="EPARSER",this.name="ParserError"}};Ot.ParserError=m_;var g_=class extends Yn{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};Ot.UnmatchedParserError=g_;var y_=class extends Yn{constructor(e,t){super(e.message||`Error reading file "${t}"`,t),this.code="ERESOLVER",this.name="ResolverError","code"in e&&(this.ioErrorCode=String(e.code))}};Ot.ResolverError=y_;var v_=class extends Yn{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};Ot.UnmatchedResolverError=v_;var S_=class extends Yn{constructor(e,t,n,i,s){super(`Missing $ref pointer "${(0,Am.getHash)(t)}". Token "${e}" does not exist.`,(0,Am.stripHash)(t)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};Ot.MissingPointerError=S_;var b_=class extends Yn{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};Ot.TimeoutError=b_;var __=class extends Yn{constructor(e,t){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,Am.stripHash)(t)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};Ot.InvalidPointerError=__;function EJ(r){return r instanceof Yn||r instanceof Tm}function xJ(r){return r.path===null&&(r.path=[]),r}});var kf=F(Dr=>{"use strict";var RJ=Dr&&Dr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),IJ=Dr&&Dr.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),OJ=Dr&&Dr.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&RJ(t,e,n[i]);return IJ(t,e),t}}(),PJ=Dr&&Dr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.nullSymbol=void 0;var w_=PJ(yu()),C_=OJ(Sn()),Nm=bn();Dr.nullSymbol=Symbol("null");var kJ=/\//g,AJ=/~/g,TJ=/~1/g,qJ=/~0/g,NJ=r=>{try{return decodeURIComponent(r)}catch{return r}},Mm=class r{constructor(e,t,n){this.$ref=e,this.path=t,this.originalPath=n||t,this.value=void 0,this.circular=!1,this.indirections=0}resolve(e,t,n){let i=r.parse(this.path,this.originalPath),s=[];this.value=lk(e);for(let a=0;a<i.length;a++){if(qm(this,t,n)&&(this.path=r.join(this.path,i.slice(a))),typeof this.value=="object"&&this.value!==null&&!uk(n)&&"$ref"in this.value)return this;let u=i[a];if(this.value[u]===void 0||this.value[u]===null&&a===i.length-1){let f=!1;for(let E=i.length-1;E>a;E--){let C=i.slice(a,E+1).join("/");if(this.value[C]!==void 0){this.value=this.value[C],a=E,f=!0;break}}if(f)continue;if(u in this.value&&this.value[u]===null){this.value=Dr.nullSymbol;continue}this.value=null;let h=this.$ref.path||"",m=this.path.replace(h,""),g=r.join("",s),S=n?.replace(h,"");throw new Nm.MissingPointerError(u,decodeURI(this.originalPath),m,g,S)}else this.value=this.value[u];s.push(u)}return(!this.value||this.value.$ref&&C_.resolve(this.path,this.value.$ref)!==n)&&qm(this,t,n),this}set(e,t,n){let i=r.parse(this.path),s;if(i.length===0)return this.value=t,t;this.value=lk(e);for(let a=0;a<i.length-1;a++)qm(this,n),s=i[a],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=ak(this,s,{});return qm(this,n),s=i[i.length-1],ak(this,s,t),e}static parse(e,t){let n=C_.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=NJ(i[s].replace(TJ,"/").replace(qJ,"~"));if(i[0]!=="")throw new Nm.InvalidPointerError(n,t===void 0?e:t);return i.slice(1)}static join(e,t){e.indexOf("#")===-1&&(e+="#"),t=Array.isArray(t)?t:[t];for(let n=0;n<t.length;n++){let i=t[n];e+="/"+encodeURIComponent(i.replace(AJ,"~0").replace(kJ,"~1"))}return e}};function qm(r,e,t){if(w_.default.isAllowed$Ref(r.value,e)){let n=C_.resolve(r.path,r.value.$ref);if(n===r.path&&!uk(t))r.circular=!0;else{let i=r.$ref.$refs._resolve(n,r.path,e);return i===null?!1:(r.indirections+=i.indirections+1,w_.default.isExtended$Ref(r.value)?(r.value=w_.default.dereference(r.value,i.value),!1):(r.$ref=i.$ref,r.path=i.path,r.value=i.value,!0))}}}Dr.default=Mm;function ak(r,e,t){if(r.value&&typeof r.value=="object")e==="-"&&Array.isArray(r.value)?r.value.push(t):r.value[e]=t;else throw new Nm.JSONParserError(`Error assigning $ref pointer "${r.path}".
|
|
173
|
-
Cannot set "${e}" of a non-object.`);return
|
|
174
|
-
"${i}" not found.`);s.set(n,
|
|
175
|
-
"${s}" not found.`);return a.resolve(i,n,e,
|
|
176
|
-
Parsed value is empty`);return a}catch(a){throw!a&&e.continueOnError?new ma.UnmatchedParserError(
|
|
170
|
+
`+n:r||n}Ii.joinStacks=BP;function BY(t,e,r){r?Object.defineProperty(e,"stack",{get:()=>{let n=t.get.apply(e);return BP({stack:n},r)},enumerable:!1,configurable:!0}):HY(e,t)}Ii.lazyJoinStacks=BY;function HP(t){if(t){let e=t.split(FY),r;for(let n=0;n<e.length;n++){let i=e[n];if(LY.test(i))r===void 0&&(r=n);else if(r!==void 0){e.splice(r,n-r);break}}if(e.length>0)return e.join(`
|
|
171
|
+
`)}return t}function HY(t,e){Object.defineProperty(t,"stack",{get:()=>HP(e.get.apply(t)),enumerable:!1,configurable:!0})}});var JP=F(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});Em.extendError=void 0;var WP=o_(),wm=VP(),YP=_m(),VY=["name","message","stack"];function WY(t,e,r){let n=t;return YY(n,e),e&&typeof e=="object"&&JY(n,e),n.toJSON=YP.toJSON,WP.addInspectMethod&&WP.addInspectMethod(n),r&&typeof r=="object"&&Object.assign(n,r),n}Em.extendError=WY;function YY(t,e){let r=Object.getOwnPropertyDescriptor(t,"stack");wm.isLazyStack(r)?wm.lazyJoinStacks(r,t,e):wm.isWritableStack(r)&&(t.stack=wm.joinStacks(t,e))}function JY(t,e){let r=YP.getDeepKeys(e,VY),n=t,i=e;for(let s of r)if(n[s]===void 0)try{n[s]=i[s]}catch{}}});var zP=F(mu=>{"use strict";Object.defineProperty(mu,"__esModule",{value:!0});mu.normalizeArgs=mu.normalizeOptions=void 0;var zY=o_();function KY(t){return t=t||{},{concatMessages:t.concatMessages===void 0?!0:!!t.concatMessages,format:t.format===void 0?zY.format:typeof t.format=="function"?t.format:!1}}mu.normalizeOptions=KY;function GY(t,e){let r,n,i,s="";return typeof t[0]=="string"?i=t:typeof t[1]=="string"?(t[0]instanceof Error?r=t[0]:n=t[0],i=t.slice(1)):(r=t[0],n=t[1],i=t.slice(2)),i.length>0&&(e.format?s=e.format.apply(void 0,i):s=i.join(" ")),e.concatMessages&&r&&r.message&&(s+=(s?`
|
|
172
|
+
`:"")+r.message),{originalError:r,props:n,message:s}}mu.normalizeArgs=GY});var l_=F(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});xm.Ono=void 0;var Cm=JP(),KP=zP(),QY=_m(),ZY=a_;xm.Ono=ZY;function a_(t,e){e=KP.normalizeOptions(e);function r(...n){let{originalError:i,props:s,message:a}=KP.normalizeArgs(n,e),u=new t(a);return Cm.extendError(u,i,s)}return r[Symbol.species]=t,r}a_.toJSON=function(e){return QY.toJSON.call(e)};a_.extend=function(e,r,n){return n||r instanceof Error?Cm.extendError(e,r,n):r?Cm.extendError(e,void 0,r):Cm.extendError(e)}});var GP=F(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});Rm.ono=void 0;var pa=l_(),XY=Pi;Rm.ono=XY;Pi.error=new pa.Ono(Error);Pi.eval=new pa.Ono(EvalError);Pi.range=new pa.Ono(RangeError);Pi.reference=new pa.Ono(ReferenceError);Pi.syntax=new pa.Ono(SyntaxError);Pi.type=new pa.Ono(TypeError);Pi.uri=new pa.Ono(URIError);var eJ=Pi;function Pi(...t){let e=t[0];if(typeof e=="object"&&typeof e.name=="string"){for(let r of Object.values(eJ))if(typeof r=="function"&&r.name==="ono"){let n=r[Symbol.species];if(n&&n!==Error&&(e instanceof n||e.name===n.name))return r.apply(void 0,t)}}return Pi.error.apply(void 0,t)}});var ZP=F(QP=>{"use strict";Object.defineProperty(QP,"__esModule",{value:!0});var Y7=require("util")});var fo=F((Wn,gu)=>{"use strict";var tJ=Wn&&Wn.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rJ=Wn&&Wn.__exportStar||function(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&tJ(e,t,r)};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.ono=void 0;var XP=GP();Object.defineProperty(Wn,"ono",{enumerable:!0,get:function(){return XP.ono}});var nJ=l_();Object.defineProperty(Wn,"Ono",{enumerable:!0,get:function(){return nJ.Ono}});rJ(ZP(),Wn);Wn.default=XP.ono;typeof gu=="object"&&typeof gu.exports=="object"&&(gu.exports=Object.assign(gu.exports.default,gu.exports))});var u_=F(If=>{"use strict";var iJ=If&&If.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(If,"__esModule",{value:!0});If.default=sJ;var ek=iJ(require("path"));function sJ(t){return t.startsWith("\\\\?\\")?t:t.split(ek.default?.win32?.sep).join(ek.default?.posix?.sep??"/")}});var tk=F(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.isWindows=void 0;var oJ=/^win/.test(globalThis.process?globalThis.process.platform:""),aJ=()=>oJ;Om.isWindows=aJ});var Sn=F(gt=>{"use strict";var lJ=gt&>.__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]}),uJ=gt&>.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),cJ=gt&>.__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"&&lJ(r,e,n[i]);return uJ(r,e),r}}(),fJ=gt&>.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gt,"__esModule",{value:!0});gt.parse=void 0;gt.resolve=rk;gt.cwd=nk;gt.getProtocol=p_;gt.getExtension=SJ;gt.stripQuery=ik;gt.getHash=sk;gt.stripHash=d_;gt.isHttp=bJ;gt.isFileSystemPath=h_;gt.fromFileSystemPath=_J;gt.toFileSystemPath=wJ;gt.safePointerToPath=EJ;gt.relative=CJ;var Pm=fJ(u_()),f_=cJ(require("path")),dJ=/\//g,hJ=/^(\w{2,}):\/\//i,pJ=/~1/g,mJ=/~0/g,gJ=require("path"),Im=tk(),yJ=[[/\?/g,"%3F"],[/#/g,"%23"]],c_=[/%23/g,"#",/%24/g,"$",/%26/g,"&",/%2C/g,",",/%40/g,"@"],vJ=t=>new URL(t);gt.parse=vJ;function rk(t,e){let r=new URL((0,Pm.default)(t),"https://aaa.nonexistanturl.com"),n=new URL((0,Pm.default)(e),r),i=e.match(/(\s*)$/)?.[1]||"";if(n.hostname==="aaa.nonexistanturl.com"){let{pathname:s,search:a,hash:u}=n;return s+a+u+i}return n.toString()+i}function nk(){if(typeof window<"u")return location.href;let t=process.cwd(),e=t.slice(-1);return e==="/"||e==="\\"?t:t+"/"}function p_(t){let e=hJ.exec(t||"");if(e)return e[1].toLowerCase()}function SJ(t){let e=t.lastIndexOf(".");return e>=0?ik(t.substr(e).toLowerCase()):""}function ik(t){let e=t.indexOf("?");return e>=0&&(t=t.substr(0,e)),t}function sk(t){if(!t)return"#";let e=t.indexOf("#");return e>=0?t.substring(e):"#"}function d_(t){if(!t)return"";let e=t.indexOf("#");return e>=0&&(t=t.substring(0,e)),t}function bJ(t){let e=p_(t);return e==="http"||e==="https"?!0:e===void 0?typeof window<"u":!1}function h_(t){if(typeof window<"u"||typeof process<"u"&&process.browser)return!1;let e=p_(t);return e===void 0||e==="file"}function _J(t){if((0,Im.isWindows)()){let e=nk(),r=t.toUpperCase(),i=(0,Pm.default)(e).toUpperCase(),s=r.includes(i),a=r.includes(i),u=f_.win32?.isAbsolute(t)||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("file://");!(s||a||u)&&!e.startsWith("http")&&(t=(0,gJ.join)(e,t)),t=(0,Pm.default)(t)}t=encodeURI(t);for(let e of yJ)t=t.replace(e[0],e[1]);return t}function wJ(t,e){t=decodeURI(t);for(let n=0;n<c_.length;n+=2)t=t.replace(c_[n],c_[n+1]);let r=t.substr(0,7).toLowerCase()==="file://";return r&&(t=t[7]==="/"?t.substr(8):t.substr(7),(0,Im.isWindows)()&&t[1]==="/"&&(t=t[0]+":"+t.substr(1)),e?t="file:///"+t:(r=!1,t=(0,Im.isWindows)()?t:"/"+t)),(0,Im.isWindows)()&&!r&&(t=t.replace(dJ,"\\"),t.substr(1,2)===":\\"&&(t=t[0].toUpperCase()+t.substr(1))),t}function EJ(t){return t.length<=1||t[0]!=="#"||t[1]!=="/"?[]:t.slice(2).split("/").map(e=>decodeURIComponent(e).replace(pJ,"/").replace(mJ,"~"))}function CJ(t,e){if(!h_(t)||!h_(e))return rk(t,e);let r=f_.default.dirname(d_(t)),n=d_(e);return f_.default.relative(r,n)+sk(e)}});var bn=F(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.InvalidPointerError=It.TimeoutError=It.MissingPointerError=It.UnmatchedResolverError=It.ResolverError=It.UnmatchedParserError=It.ParserError=It.JSONParserErrorGroup=It.JSONParserError=void 0;It.isHandledError=xJ;It.normalizeError=RJ;var ok=fo(),km=Sn(),Yn=class extends Error{constructor(e,r){super(),this.code="EUNKNOWN",this.name="JSONParserError",this.message=e,this.source=r,this.path=null,ok.Ono.extend(this)}get footprint(){return`${this.path}+${this.source}+${this.code}+${this.message}`}};It.JSONParserError=Yn;var Am=class t extends Error{constructor(e){super(),this.files=e,this.name="JSONParserErrorGroup",this.message=`${this.errors.length} error${this.errors.length>1?"s":""} occurred while reading '${(0,km.toFileSystemPath)(e.$refs._root$Ref.path)}'`,ok.Ono.extend(this)}static getParserErrors(e){let r=[];for(let n of Object.values(e.$refs._$refs))n.errors&&r.push(...n.errors);return r}get errors(){return t.getParserErrors(this.files)}};It.JSONParserErrorGroup=Am;var m_=class extends Yn{constructor(e,r){super(`Error parsing ${r}: ${e}`,r),this.code="EPARSER",this.name="ParserError"}};It.ParserError=m_;var g_=class extends Yn{constructor(e){super(`Could not find parser for "${e}"`,e),this.code="EUNMATCHEDPARSER",this.name="UnmatchedParserError"}};It.UnmatchedParserError=g_;var y_=class extends Yn{constructor(e,r){super(e.message||`Error reading file "${r}"`,r),this.code="ERESOLVER",this.name="ResolverError","code"in e&&(this.ioErrorCode=String(e.code))}};It.ResolverError=y_;var v_=class extends Yn{constructor(e){super(`Could not find resolver for "${e}"`,e),this.code="EUNMATCHEDRESOLVER",this.name="UnmatchedResolverError"}};It.UnmatchedResolverError=v_;var S_=class extends Yn{constructor(e,r,n,i,s){super(`Missing $ref pointer "${(0,km.getHash)(r)}". Token "${e}" does not exist.`,(0,km.stripHash)(r)),this.code="EMISSINGPOINTER",this.name="MissingPointerError",this.targetToken=e,this.targetRef=n,this.targetFound=i,this.parentPath=s}};It.MissingPointerError=S_;var b_=class extends Yn{constructor(e){super(`Dereferencing timeout reached: ${e}ms`),this.code="ETIMEOUT",this.name="TimeoutError"}};It.TimeoutError=b_;var __=class extends Yn{constructor(e,r){super(`Invalid $ref pointer "${e}". Pointers must begin with "#/"`,(0,km.stripHash)(r)),this.code="EUNMATCHEDRESOLVER",this.name="InvalidPointerError"}};It.InvalidPointerError=__;function xJ(t){return t instanceof Yn||t instanceof Am}function RJ(t){return t.path===null&&(t.path=[]),t}});var Pf=F(Dr=>{"use strict";var OJ=Dr&&Dr.__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]}),IJ=Dr&&Dr.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),PJ=Dr&&Dr.__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"&&OJ(r,e,n[i]);return IJ(r,e),r}}(),kJ=Dr&&Dr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Dr,"__esModule",{value:!0});Dr.nullSymbol=void 0;var w_=kJ(yu()),E_=PJ(Sn()),qm=bn();Dr.nullSymbol=Symbol("null");var AJ=/\//g,TJ=/~/g,qJ=/~1/g,NJ=/~0/g,MJ=t=>{try{return decodeURIComponent(t)}catch{return t}},Nm=class t{constructor(e,r,n){this.$ref=e,this.path=r,this.originalPath=n||r,this.value=void 0,this.circular=!1,this.indirections=0}resolve(e,r,n){let i=t.parse(this.path,this.originalPath),s=[];this.value=lk(e);for(let a=0;a<i.length;a++){if(Tm(this,r,n)&&(this.path=t.join(this.path,i.slice(a))),typeof this.value=="object"&&this.value!==null&&!uk(n)&&"$ref"in this.value)return this;let u=i[a];if(this.value[u]===void 0||this.value[u]===null&&a===i.length-1){let f=!1;for(let E=i.length-1;E>a;E--){let C=i.slice(a,E+1).join("/");if(this.value[C]!==void 0){this.value=this.value[C],a=E,f=!0;break}}if(f)continue;if(u in this.value&&this.value[u]===null){this.value=Dr.nullSymbol;continue}this.value=null;let h=this.$ref.path||"",g=this.path.replace(h,""),m=t.join("",s),S=n?.replace(h,"");throw new qm.MissingPointerError(u,decodeURI(this.originalPath),g,m,S)}else this.value=this.value[u];s.push(u)}return(!this.value||this.value.$ref&&E_.resolve(this.path,this.value.$ref)!==n)&&Tm(this,r,n),this}set(e,r,n){let i=t.parse(this.path),s;if(i.length===0)return this.value=r,r;this.value=lk(e);for(let a=0;a<i.length-1;a++)Tm(this,n),s=i[a],this.value&&this.value[s]!==void 0?this.value=this.value[s]:this.value=ak(this,s,{});return Tm(this,n),s=i[i.length-1],ak(this,s,r),e}static parse(e,r){let n=E_.getHash(e).substring(1);if(!n)return[];let i=n.split("/");for(let s=0;s<i.length;s++)i[s]=MJ(i[s].replace(qJ,"/").replace(NJ,"~"));if(i[0]!=="")throw new qm.InvalidPointerError(n,r===void 0?e:r);return i.slice(1)}static join(e,r){e.indexOf("#")===-1&&(e+="#"),r=Array.isArray(r)?r:[r];for(let n=0;n<r.length;n++){let i=r[n];e+="/"+encodeURIComponent(i.replace(TJ,"~0").replace(AJ,"~1"))}return e}};function Tm(t,e,r){if(w_.default.isAllowed$Ref(t.value,e)){let n=E_.resolve(t.path,t.value.$ref);if(n===t.path&&!uk(r))t.circular=!0;else{let i=t.$ref.$refs._resolve(n,t.path,e);return i===null?!1:(t.indirections+=i.indirections+1,w_.default.isExtended$Ref(t.value)?(t.value=w_.default.dereference(t.value,i.value),!1):(t.$ref=i.$ref,t.path=i.path,t.value=i.value,!0))}}}Dr.default=Nm;function ak(t,e,r){if(t.value&&typeof t.value=="object")e==="-"&&Array.isArray(t.value)?t.value.push(r):t.value[e]=r;else throw new qm.JSONParserError(`Error assigning $ref pointer "${t.path}".
|
|
173
|
+
Cannot set "${e}" of a non-object.`);return r}function lk(t){if((0,qm.isHandledError)(t))throw t;return t}function uk(t){return typeof t=="string"&&Nm.parse(t).length==0}});var yu=F(ns=>{"use strict";var $J=ns&&ns.__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]}),DJ=ns&&ns.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),FJ=ns&&ns.__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"&&$J(r,e,n[i]);return DJ(r,e),r}}();Object.defineProperty(ns,"__esModule",{value:!0});var Mm=FJ(Pf()),$m=bn(),C_=Sn(),x_=class t{constructor(e){this.errors=[],this.$refs=e}addError(e){this.errors===void 0&&(this.errors=[]);let r=this.errors.map(({footprint:n})=>n);"errors"in e&&Array.isArray(e.errors)?this.errors.push(...e.errors.map($m.normalizeError).filter(({footprint:n})=>!r.includes(n))):(!("footprint"in e)||!r.includes(e.footprint))&&this.errors.push((0,$m.normalizeError)(e))}exists(e,r){try{return this.resolve(e,r),!0}catch{return!1}}get(e,r){return this.resolve(e,r)?.value}resolve(e,r,n,i){let s=new Mm.default(this,e,n);try{let a=s.resolve(this.value,r,i);return a.value===Mm.nullSymbol&&(a.value=null),a}catch(a){if(!r||!r.continueOnError||!(0,$m.isHandledError)(a))throw a;return a.path===null&&(a.path=(0,C_.safePointerToPath)((0,C_.getHash)(i))),a instanceof $m.InvalidPointerError&&(a.source=decodeURI((0,C_.stripHash)(i))),this.addError(a),null}}set(e,r){let n=new Mm.default(this,e);this.value=n.set(this.value,r),this.value===Mm.nullSymbol&&(this.value=null)}static is$Ref(e){return!!e&&typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string"&&e.$ref.length>0}static isExternal$Ref(e){return t.is$Ref(e)&&e.$ref[0]!=="#"}static isAllowed$Ref(e,r){if(this.is$Ref(e)){if(e.$ref.substring(0,2)==="#/"||e.$ref==="#")return!0;if(e.$ref[0]!=="#"&&(!r||r.resolve?.external))return!0}}static isExtended$Ref(e){return t.is$Ref(e)&&Object.keys(e).length>1}static dereference(e,r){if(r&&typeof r=="object"&&t.isExtended$Ref(e)){let n={};for(let i of Object.keys(e))i!=="$ref"&&(n[i]=e[i]);for(let i of Object.keys(r))i in n||(n[i]=r[i]);return n}else return r}};ns.default=x_});var pk=F(Jn=>{"use strict";var LJ=Jn&&Jn.__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]}),jJ=Jn&&Jn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),UJ=Jn&&Jn.__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"&&LJ(r,e,n[i]);return jJ(r,e),r}}(),hk=Jn&&Jn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jn,"__esModule",{value:!0});var ck=fo(),BJ=hk(yu()),ho=UJ(Sn()),fk=hk(u_()),R_=class{paths(...e){return dk(this._$refs,e.flat()).map(n=>(0,fk.default)(n.decoded))}values(...e){let r=this._$refs;return dk(r,e.flat()).reduce((i,s)=>(i[(0,fk.default)(s.decoded)]=r[s.encoded].value,i),{})}exists(e,r){try{return this._resolve(e,"",r),!0}catch{return!1}}get(e,r){return this._resolve(e,"",r).value}set(e,r){let n=ho.resolve(this._root$Ref.path,e),i=ho.stripHash(n),s=this._$refs[i];if(!s)throw(0,ck.ono)(`Error resolving $ref pointer "${e}".
|
|
174
|
+
"${i}" not found.`);s.set(n,r)}_get$Ref(e){e=ho.resolve(this._root$Ref.path,e);let r=ho.stripHash(e);return this._$refs[r]}_add(e){let r=ho.stripHash(e),n=new BJ.default(this);return n.path=r,this._$refs[r]=n,this._root$Ref=this._root$Ref||n,n}_resolve(e,r,n){let i=ho.resolve(this._root$Ref.path,e),s=ho.stripHash(i),a=this._$refs[s];if(!a)throw(0,ck.ono)(`Error resolving $ref pointer "${e}".
|
|
175
|
+
"${s}" not found.`);return a.resolve(i,n,e,r)}constructor(){this._$refs={},this.toJSON=this.values,this.circular=!1,this._$refs={},this._root$Ref=null}};Jn.default=R_;function dk(t,e){let r=Object.keys(t);return e=Array.isArray(e[0])?e[0]:Array.prototype.slice.call(e),e.length>0&&e[0]&&(r=r.filter(n=>e.includes(t[n].pathType))),r.map(n=>({encoded:n,decoded:t[n].pathType==="file"?ho.toFileSystemPath(n,!0):n}))}});var gk=F(vu=>{"use strict";Object.defineProperty(vu,"__esModule",{value:!0});vu.all=HJ;vu.filter=VJ;vu.sort=WJ;vu.run=YJ;function HJ(t){return Object.keys(t||{}).filter(e=>typeof t[e]=="object").map(e=>(t[e].name=e,t[e]))}function VJ(t,e,r){return t.filter(n=>!!mk(n,e,r))}function WJ(t){for(let e of t)e.order=e.order||Number.MAX_SAFE_INTEGER;return t.sort((e,r)=>e.order-r.order)}async function YJ(t,e,r,n){let i,s,a=0;return new Promise((u,f)=>{h();function h(){if(i=t[a++],!i)return f(s);try{let E=mk(i,e,r,g,n);if(E&&typeof E.then=="function")E.then(m,S);else if(E!==void 0)m(E);else if(a===t.length)throw new Error("No promise has been returned or callback has been called.")}catch(E){S(E)}}function g(E,C){E?S(E):m(C)}function m(E){u({plugin:i,result:E})}function S(E){s={plugin:i,error:E},h()}})}function mk(t,e,r,n,i){let s=t[e];if(typeof s=="function")return s.apply(t,[r,n,i]);if(!n){if(s instanceof RegExp)return s.test(r.url);if(typeof s=="string")return s===r.extension;if(Array.isArray(s))return s.indexOf(r.extension)!==-1}return s}});var I_=F(is=>{"use strict";var JJ=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]}),zJ=is&&is.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),yk=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"&&JJ(r,e,n[i]);return zJ(r,e),r}}();Object.defineProperty(is,"__esModule",{value:!0});var O_=fo(),KJ=yk(Sn()),po=yk(gk()),ma=bn();async function GJ(t,e,r){let n=t.indexOf("#"),i="";n>=0&&(i=t.substring(n),t=t.substring(0,n));let s=e._add(t),a={url:t,hash:i,extension:KJ.getExtension(t)};try{let u=await QJ(a,r,e);s.pathType=u.plugin.name,a.data=u.result;let f=await ZJ(a,r,e);return s.value=f.result,f.result}catch(u){throw(0,ma.isHandledError)(u)&&(s.value=u),u}}async function QJ(t,e,r){let n=po.all(e.resolve);n=po.filter(n,"canRead",t),po.sort(n);try{return await po.run(n,"read",t,r)}catch(i){throw!i&&e.continueOnError?new ma.UnmatchedResolverError(t.url):!i||!("error"in i)?O_.ono.syntax(`Unable to resolve $ref pointer "${t.url}"`):i.error instanceof ma.ResolverError?i.error:new ma.ResolverError(i,t.url)}}async function ZJ(t,e,r){let n=po.all(e.parse),i=po.filter(n,"canParse",t),s=i.length>0?i:n;po.sort(s);try{let a=await po.run(s,"parse",t,r);if(!a.plugin.allowEmpty&&XJ(a.result))throw O_.ono.syntax(`Error parsing "${t.url}" as ${a.plugin.name}.
|
|
176
|
+
Parsed value is empty`);return a}catch(a){throw!a&&e.continueOnError?new ma.UnmatchedParserError(t.url):a&&a.message&&a.message.startsWith("Error parsing")?a:!a||!("error"in a)?O_.ono.syntax(`Unable to parse ${t.url}`):a.error instanceof ma.ParserError?a.error:new ma.ParserError(a.error.message,t.url)}}function XJ(t){return t===void 0||typeof t=="object"&&Object.keys(t).length===0||typeof t=="string"&&t.trim().length===0||Buffer.isBuffer(t)&&t.length===0}is.default=GJ});var Sk=F(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});var vk=bn();P_.default={order:100,allowEmpty:!0,canParse:".json",allowBOM:!0,async parse(t){let e=t.data;if(Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string"){if(e.trim().length===0)return;try{return JSON.parse(e)}catch(r){if(this.allowBOM)try{let n=e.indexOf("{");return e=e.slice(n),JSON.parse(e)}catch(n){throw new vk.ParserError(n.message,t.url)}throw new vk.ParserError(r.message,t.url)}}else return e}}});var Su=F((i5,ga)=>{"use strict";function bk(t){return typeof t>"u"||t===null}function ez(t){return typeof t=="object"&&t!==null}function tz(t){return Array.isArray(t)?t:bk(t)?[]:[t]}function rz(t,e){var r,n,i,s;if(e)for(s=Object.keys(e),r=0,n=s.length;r<n;r+=1)i=s[r],t[i]=e[i];return t}function nz(t,e){var r="",n;for(n=0;n<e;n+=1)r+=t;return r}function iz(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}ga.exports.isNothing=bk;ga.exports.isObject=ez;ga.exports.toArray=tz;ga.exports.repeat=nz;ga.exports.isNegativeZero=iz;ga.exports.extend=rz});var bu=F((s5,wk)=>{"use strict";function _k(t,e){var r="",n=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(r+='in "'+t.mark.name+'" '),r+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(r+=`
|
|
177
177
|
|
|
178
|
-
`+
|
|
179
|
-
`+u;for(h=k_(
|
|
180
|
-
`,u+=
|
|
181
|
-
`,f=1;f<=e.linesAfter&&!(a+f>=i.length);f++)h=k_(
|
|
182
|
-
`;return u.replace(/\n$/,"")}
|
|
183
|
-
\r`;function
|
|
184
|
-
`:
|
|
185
|
-
`,e-1))}function
|
|
186
|
-
`,s?1+f:f):i===Z_&&s&&(
|
|
187
|
-
`);break}for(n?Sa(
|
|
188
|
-
`,s?1+f:f)):h?(h=!1,
|
|
189
|
-
`,f+1)):f===0?s&&(
|
|
190
|
-
`,f):
|
|
191
|
-
`,s?1+f:f),s=!0,a=!0,f=0,t
|
|
192
|
-
`),
|
|
193
|
-
`,n),i===-1?(a=
|
|
194
|
-
`&&(s+=
|
|
195
|
-
`+
|
|
196
|
-
`,i=n&&(
|
|
197
|
-
`||
|
|
198
|
-
`),s=i?"+":n?"":"-";return
|
|
199
|
-
`}function g1(
|
|
200
|
-
`?
|
|
201
|
-
`);return h=h!==-1?h:
|
|
202
|
-
`||
|
|
203
|
-
`:"")+y1(f,e),i=s}return n}function y1(
|
|
204
|
-
`+
|
|
205
|
-
`,
|
|
206
|
-
`+
|
|
207
|
-
`:""}A1.exports.dump=
|
|
178
|
+
`+t.mark.snippet),n+" "+r):n}function kf(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=_k(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}kf.prototype=Object.create(Error.prototype);kf.prototype.constructor=kf;kf.prototype.toString=function(e){return this.name+": "+_k(this,e)};wk.exports=kf});var Ck=F((o5,Ek)=>{"use strict";var Af=Su();function k_(t,e,r,n,i){var s="",a="",u=Math.floor(i/2)-1;return n-e>u&&(s=" ... ",e=n-u+s.length),r-n>u&&(a=" ...",r=n+u-a.length),{str:s+t.slice(e,r).replace(/\t/g,"\u2192")+a,pos:n-e+s.length}}function A_(t,e){return Af.repeat(" ",e-t.length)+t}function sz(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var r=/\r?\n|\r|\0/g,n=[0],i=[],s,a=-1;s=r.exec(t.buffer);)i.push(s.index),n.push(s.index+s[0].length),t.position<=s.index&&a<0&&(a=n.length-2);a<0&&(a=n.length-1);var u="",f,h,g=Math.min(t.line+e.linesAfter,i.length).toString().length,m=e.maxLength-(e.indent+g+3);for(f=1;f<=e.linesBefore&&!(a-f<0);f++)h=k_(t.buffer,n[a-f],i[a-f],t.position-(n[a]-n[a-f]),m),u=Af.repeat(" ",e.indent)+A_((t.line-f+1).toString(),g)+" | "+h.str+`
|
|
179
|
+
`+u;for(h=k_(t.buffer,n[a],i[a],t.position,m),u+=Af.repeat(" ",e.indent)+A_((t.line+1).toString(),g)+" | "+h.str+`
|
|
180
|
+
`,u+=Af.repeat("-",e.indent+g+3+h.pos)+`^
|
|
181
|
+
`,f=1;f<=e.linesAfter&&!(a+f>=i.length);f++)h=k_(t.buffer,n[a+f],i[a+f],t.position-(n[a]-n[a+f]),m),u+=Af.repeat(" ",e.indent)+A_((t.line+f+1).toString(),g)+" | "+h.str+`
|
|
182
|
+
`;return u.replace(/\n$/,"")}Ek.exports=sz});var cr=F((a5,Rk)=>{"use strict";var xk=bu(),oz=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],az=["scalar","sequence","mapping"];function lz(t){var e={};return t!==null&&Object.keys(t).forEach(function(r){t[r].forEach(function(n){e[String(n)]=r})}),e}function uz(t,e){if(e=e||{},Object.keys(e).forEach(function(r){if(oz.indexOf(r)===-1)throw new xk('Unknown option "'+r+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(r){return r},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=lz(e.styleAliases||null),az.indexOf(this.kind)===-1)throw new xk('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}Rk.exports=uz});var N_=F((l5,Ik)=>{"use strict";var Tf=bu(),T_=cr();function Ok(t,e){var r=[];return t[e].forEach(function(n){var i=r.length;r.forEach(function(s,a){s.tag===n.tag&&s.kind===n.kind&&s.multi===n.multi&&(i=a)}),r[i]=n}),r}function cz(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,r;function n(i){i.multi?(t.multi[i.kind].push(i),t.multi.fallback.push(i)):t[i.kind][i.tag]=t.fallback[i.tag]=i}for(e=0,r=arguments.length;e<r;e+=1)arguments[e].forEach(n);return t}function q_(t){return this.extend(t)}q_.prototype.extend=function(e){var r=[],n=[];if(e instanceof T_)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(r=r.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new Tf("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");r.forEach(function(s){if(!(s instanceof T_))throw new Tf("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new Tf("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new Tf("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),n.forEach(function(s){if(!(s instanceof T_))throw new Tf("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(q_.prototype);return i.implicit=(this.implicit||[]).concat(r),i.explicit=(this.explicit||[]).concat(n),i.compiledImplicit=Ok(i,"implicit"),i.compiledExplicit=Ok(i,"explicit"),i.compiledTypeMap=cz(i.compiledImplicit,i.compiledExplicit),i};Ik.exports=q_});var M_=F((u5,Pk)=>{"use strict";var fz=cr();Pk.exports=new fz("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}})});var $_=F((c5,kk)=>{"use strict";var dz=cr();kk.exports=new dz("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}})});var D_=F((f5,Ak)=>{"use strict";var hz=cr();Ak.exports=new hz("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}})});var F_=F((d5,Tk)=>{"use strict";var pz=N_();Tk.exports=new pz({explicit:[M_(),$_(),D_()]})});var L_=F((h5,qk)=>{"use strict";var mz=cr();function gz(t){if(t===null)return!0;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function yz(){return null}function vz(t){return t===null}qk.exports=new mz("tag:yaml.org,2002:null",{kind:"scalar",resolve:gz,construct:yz,predicate:vz,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"})});var j_=F((p5,Nk)=>{"use strict";var Sz=cr();function bz(t){if(t===null)return!1;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function _z(t){return t==="true"||t==="True"||t==="TRUE"}function wz(t){return Object.prototype.toString.call(t)==="[object Boolean]"}Nk.exports=new Sz("tag:yaml.org,2002:bool",{kind:"scalar",resolve:bz,construct:_z,predicate:wz,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"})});var U_=F((m5,Mk)=>{"use strict";var Ez=Su(),Cz=cr();function xz(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function Rz(t){return 48<=t&&t<=55}function Oz(t){return 48<=t&&t<=57}function Iz(t){if(t===null)return!1;var e=t.length,r=0,n=!1,i;if(!e)return!1;if(i=t[r],(i==="-"||i==="+")&&(i=t[++r]),i==="0"){if(r+1===e)return!0;if(i=t[++r],i==="b"){for(r++;r<e;r++)if(i=t[r],i!=="_"){if(i!=="0"&&i!=="1")return!1;n=!0}return n&&i!=="_"}if(i==="x"){for(r++;r<e;r++)if(i=t[r],i!=="_"){if(!xz(t.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}if(i==="o"){for(r++;r<e;r++)if(i=t[r],i!=="_"){if(!Rz(t.charCodeAt(r)))return!1;n=!0}return n&&i!=="_"}}if(i==="_")return!1;for(;r<e;r++)if(i=t[r],i!=="_"){if(!Oz(t.charCodeAt(r)))return!1;n=!0}return!(!n||i==="_")}function Pz(t){var e=t,r=1,n;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),n=e[0],(n==="-"||n==="+")&&(n==="-"&&(r=-1),e=e.slice(1),n=e[0]),e==="0")return 0;if(n==="0"){if(e[1]==="b")return r*parseInt(e.slice(2),2);if(e[1]==="x")return r*parseInt(e.slice(2),16);if(e[1]==="o")return r*parseInt(e.slice(2),8)}return r*parseInt(e,10)}function kz(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!Ez.isNegativeZero(t)}Mk.exports=new Cz("tag:yaml.org,2002:int",{kind:"scalar",resolve:Iz,construct:Pz,predicate:kz,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}})});var B_=F((g5,Dk)=>{"use strict";var $k=Su(),Az=cr(),Tz=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function qz(t){return!(t===null||!Tz.test(t)||t[t.length-1]==="_")}function Nz(t){var e,r;return e=t.replace(/_/g,"").toLowerCase(),r=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?r===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:r*parseFloat(e,10)}var Mz=/^[-+]?[0-9]+e/;function $z(t,e){var r;if(isNaN(t))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if($k.isNegativeZero(t))return"-0.0";return r=t.toString(10),Mz.test(r)?r.replace("e",".e"):r}function Dz(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||$k.isNegativeZero(t))}Dk.exports=new Az("tag:yaml.org,2002:float",{kind:"scalar",resolve:qz,construct:Nz,predicate:Dz,represent:$z,defaultStyle:"lowercase"})});var H_=F((y5,Fk)=>{"use strict";Fk.exports=F_().extend({implicit:[L_(),j_(),U_(),B_()]})});var V_=F((v5,Lk)=>{"use strict";Lk.exports=H_()});var W_=F((S5,Bk)=>{"use strict";var Fz=cr(),jk=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Uk=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Lz(t){return t===null?!1:jk.exec(t)!==null||Uk.exec(t)!==null}function jz(t){var e,r,n,i,s,a,u,f=0,h=null,g,m,S;if(e=jk.exec(t),e===null&&(e=Uk.exec(t)),e===null)throw new Error("Date resolve error");if(r=+e[1],n=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(r,n,i));if(s=+e[4],a=+e[5],u=+e[6],e[7]){for(f=e[7].slice(0,3);f.length<3;)f+="0";f=+f}return e[9]&&(g=+e[10],m=+(e[11]||0),h=(g*60+m)*6e4,e[9]==="-"&&(h=-h)),S=new Date(Date.UTC(r,n,i,s,a,u,f)),h&&S.setTime(S.getTime()-h),S}function Uz(t){return t.toISOString()}Bk.exports=new Fz("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Lz,construct:jz,instanceOf:Date,represent:Uz})});var Y_=F((b5,Hk)=>{"use strict";var Bz=cr();function Hz(t){return t==="<<"||t===null}Hk.exports=new Bz("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Hz})});var z_=F((_5,Vk)=>{"use strict";var Vz=cr(),J_=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
183
|
+
\r`;function Wz(t){if(t===null)return!1;var e,r,n=0,i=t.length,s=J_;for(r=0;r<i;r++)if(e=s.indexOf(t.charAt(r)),!(e>64)){if(e<0)return!1;n+=6}return n%8===0}function Yz(t){var e,r,n=t.replace(/[\r\n=]/g,""),i=n.length,s=J_,a=0,u=[];for(e=0;e<i;e++)e%4===0&&e&&(u.push(a>>16&255),u.push(a>>8&255),u.push(a&255)),a=a<<6|s.indexOf(n.charAt(e));return r=i%4*6,r===0?(u.push(a>>16&255),u.push(a>>8&255),u.push(a&255)):r===18?(u.push(a>>10&255),u.push(a>>2&255)):r===12&&u.push(a>>4&255),new Uint8Array(u)}function Jz(t){var e="",r=0,n,i,s=t.length,a=J_;for(n=0;n<s;n++)n%3===0&&n&&(e+=a[r>>18&63],e+=a[r>>12&63],e+=a[r>>6&63],e+=a[r&63]),r=(r<<8)+t[n];return i=s%3,i===0?(e+=a[r>>18&63],e+=a[r>>12&63],e+=a[r>>6&63],e+=a[r&63]):i===2?(e+=a[r>>10&63],e+=a[r>>4&63],e+=a[r<<2&63],e+=a[64]):i===1&&(e+=a[r>>2&63],e+=a[r<<4&63],e+=a[64],e+=a[64]),e}function zz(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}Vk.exports=new Vz("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Wz,construct:Yz,predicate:zz,represent:Jz})});var K_=F((w5,Wk)=>{"use strict";var Kz=cr(),Gz=Object.prototype.hasOwnProperty,Qz=Object.prototype.toString;function Zz(t){if(t===null)return!0;var e=[],r,n,i,s,a,u=t;for(r=0,n=u.length;r<n;r+=1){if(i=u[r],a=!1,Qz.call(i)!=="[object Object]")return!1;for(s in i)if(Gz.call(i,s))if(!a)a=!0;else return!1;if(!a)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}function Xz(t){return t!==null?t:[]}Wk.exports=new Kz("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Zz,construct:Xz})});var G_=F((E5,Yk)=>{"use strict";var eK=cr(),tK=Object.prototype.toString;function rK(t){if(t===null)return!0;var e,r,n,i,s,a=t;for(s=new Array(a.length),e=0,r=a.length;e<r;e+=1){if(n=a[e],tK.call(n)!=="[object Object]"||(i=Object.keys(n),i.length!==1))return!1;s[e]=[i[0],n[i[0]]]}return!0}function nK(t){if(t===null)return[];var e,r,n,i,s,a=t;for(s=new Array(a.length),e=0,r=a.length;e<r;e+=1)n=a[e],i=Object.keys(n),s[e]=[i[0],n[i[0]]];return s}Yk.exports=new eK("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:rK,construct:nK})});var Q_=F((C5,Jk)=>{"use strict";var iK=cr(),sK=Object.prototype.hasOwnProperty;function oK(t){if(t===null)return!0;var e,r=t;for(e in r)if(sK.call(r,e)&&r[e]!==null)return!1;return!0}function aK(t){return t!==null?t:{}}Jk.exports=new iK("tag:yaml.org,2002:set",{kind:"mapping",resolve:oK,construct:aK})});var Dm=F((x5,zk)=>{"use strict";zk.exports=V_().extend({implicit:[W_(),Y_()],explicit:[z_(),K_(),G_(),Q_()]})});var f1=F((R5,tw)=>{"use strict";var va=Su(),t1=bu(),lK=Ck(),uK=Dm(),go=Object.prototype.hasOwnProperty,Fm=1,r1=2,n1=3,Lm=4,Z_=1,cK=2,Kk=3,fK=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,dK=/[\x85\u2028\u2029]/,hK=/[,\[\]\{\}]/,i1=/^(?:!|!!|![a-z\-]+!)$/i,s1=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Gk(t){return Object.prototype.toString.call(t)}function ki(t){return t===10||t===13}function Sa(t){return t===9||t===32}function Fr(t){return t===9||t===32||t===10||t===13}function _u(t){return t===44||t===91||t===93||t===123||t===125}function pK(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}function mK(t){return t===120?2:t===117?4:t===85?8:0}function gK(t){return 48<=t&&t<=57?t-48:-1}function Qk(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?`
|
|
184
|
+
`:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function yK(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function o1(t,e,r){e==="__proto__"?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r}var a1=new Array(256),l1=new Array(256);for(ya=0;ya<256;ya++)a1[ya]=Qk(ya)?1:0,l1[ya]=Qk(ya);var ya;function vK(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||uK,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function u1(t,e){var r={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return r.snippet=lK(r),new t1(e,r)}function de(t,e){throw u1(t,e)}function jm(t,e){t.onWarning&&t.onWarning.call(null,u1(t,e))}var Zk={YAML:function(e,r,n){var i,s,a;e.version!==null&&de(e,"duplication of %YAML directive"),n.length!==1&&de(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),i===null&&de(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),a=parseInt(i[2],10),s!==1&&de(e,"unacceptable YAML version of the document"),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&jm(e,"unsupported YAML version of the document")},TAG:function(e,r,n){var i,s;n.length!==2&&de(e,"TAG directive accepts exactly two arguments"),i=n[0],s=n[1],i1.test(i)||de(e,"ill-formed tag handle (first argument) of the TAG directive"),go.call(e.tagMap,i)&&de(e,'there is a previously declared suffix for "'+i+'" tag handle'),s1.test(s)||de(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{de(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s}};function mo(t,e,r,n){var i,s,a,u;if(e<r){if(u=t.input.slice(e,r),n)for(i=0,s=u.length;i<s;i+=1)a=u.charCodeAt(i),a===9||32<=a&&a<=1114111||de(t,"expected valid JSON character");else fK.test(u)&&de(t,"the stream contains non-printable characters");t.result+=u}}function Xk(t,e,r,n){var i,s,a,u;for(va.isObject(r)||de(t,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(r),a=0,u=i.length;a<u;a+=1)s=i[a],go.call(e,s)||(o1(e,s,r[s]),n[s]=!0)}function wu(t,e,r,n,i,s,a,u,f){var h,g;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),h=0,g=i.length;h<g;h+=1)Array.isArray(i[h])&&de(t,"nested arrays are not supported inside keys"),typeof i=="object"&&Gk(i[h])==="[object Object]"&&(i[h]="[object Object]");if(typeof i=="object"&&Gk(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),n==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(h=0,g=s.length;h<g;h+=1)Xk(t,e,s[h],r);else Xk(t,e,s,r);else!t.json&&!go.call(r,i)&&go.call(e,i)&&(t.line=a||t.line,t.lineStart=u||t.lineStart,t.position=f||t.position,de(t,"duplicated mapping key")),o1(e,i,s),delete r[i];return e}function X_(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):de(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1}function Ft(t,e,r){for(var n=0,i=t.input.charCodeAt(t.position);i!==0;){for(;Sa(i);)i===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),i=t.input.charCodeAt(++t.position);if(e&&i===35)do i=t.input.charCodeAt(++t.position);while(i!==10&&i!==13&&i!==0);if(ki(i))for(X_(t),i=t.input.charCodeAt(t.position),n++,t.lineIndent=0;i===32;)t.lineIndent++,i=t.input.charCodeAt(++t.position);else break}return r!==-1&&n!==0&&t.lineIndent<r&&jm(t,"deficient indentation"),n}function Um(t){var e=t.position,r;return r=t.input.charCodeAt(e),!!((r===45||r===46)&&r===t.input.charCodeAt(e+1)&&r===t.input.charCodeAt(e+2)&&(e+=3,r=t.input.charCodeAt(e),r===0||Fr(r)))}function ew(t,e){e===1?t.result+=" ":e>1&&(t.result+=va.repeat(`
|
|
185
|
+
`,e-1))}function SK(t,e,r){var n,i,s,a,u,f,h,g,m=t.kind,S=t.result,E;if(E=t.input.charCodeAt(t.position),Fr(E)||_u(E)||E===35||E===38||E===42||E===33||E===124||E===62||E===39||E===34||E===37||E===64||E===96||(E===63||E===45)&&(i=t.input.charCodeAt(t.position+1),Fr(i)||r&&_u(i)))return!1;for(t.kind="scalar",t.result="",s=a=t.position,u=!1;E!==0;){if(E===58){if(i=t.input.charCodeAt(t.position+1),Fr(i)||r&&_u(i))break}else if(E===35){if(n=t.input.charCodeAt(t.position-1),Fr(n))break}else{if(t.position===t.lineStart&&Um(t)||r&&_u(E))break;if(ki(E))if(f=t.line,h=t.lineStart,g=t.lineIndent,Ft(t,!1,-1),t.lineIndent>=e){u=!0,E=t.input.charCodeAt(t.position);continue}else{t.position=a,t.line=f,t.lineStart=h,t.lineIndent=g;break}}u&&(mo(t,s,a,!1),ew(t,t.line-f),s=a=t.position,u=!1),Sa(E)||(a=t.position+1),E=t.input.charCodeAt(++t.position)}return mo(t,s,a,!1),t.result?!0:(t.kind=m,t.result=S,!1)}function bK(t,e){var r,n,i;if(r=t.input.charCodeAt(t.position),r!==39)return!1;for(t.kind="scalar",t.result="",t.position++,n=i=t.position;(r=t.input.charCodeAt(t.position))!==0;)if(r===39)if(mo(t,n,t.position,!0),r=t.input.charCodeAt(++t.position),r===39)n=t.position,t.position++,i=t.position;else return!0;else ki(r)?(mo(t,n,i,!0),ew(t,Ft(t,!1,e)),n=i=t.position):t.position===t.lineStart&&Um(t)?de(t,"unexpected end of the document within a single quoted scalar"):(t.position++,i=t.position);de(t,"unexpected end of the stream within a single quoted scalar")}function _K(t,e){var r,n,i,s,a,u;if(u=t.input.charCodeAt(t.position),u!==34)return!1;for(t.kind="scalar",t.result="",t.position++,r=n=t.position;(u=t.input.charCodeAt(t.position))!==0;){if(u===34)return mo(t,r,t.position,!0),t.position++,!0;if(u===92){if(mo(t,r,t.position,!0),u=t.input.charCodeAt(++t.position),ki(u))Ft(t,!1,e);else if(u<256&&a1[u])t.result+=l1[u],t.position++;else if((a=mK(u))>0){for(i=a,s=0;i>0;i--)u=t.input.charCodeAt(++t.position),(a=pK(u))>=0?s=(s<<4)+a:de(t,"expected hexadecimal character");t.result+=yK(s),t.position++}else de(t,"unknown escape sequence");r=n=t.position}else ki(u)?(mo(t,r,n,!0),ew(t,Ft(t,!1,e)),r=n=t.position):t.position===t.lineStart&&Um(t)?de(t,"unexpected end of the document within a double quoted scalar"):(t.position++,n=t.position)}de(t,"unexpected end of the stream within a double quoted scalar")}function wK(t,e){var r=!0,n,i,s,a=t.tag,u,f=t.anchor,h,g,m,S,E,C=Object.create(null),x,A,T,j;if(j=t.input.charCodeAt(t.position),j===91)g=93,E=!1,u=[];else if(j===123)g=125,E=!0,u={};else return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=u),j=t.input.charCodeAt(++t.position);j!==0;){if(Ft(t,!0,e),j=t.input.charCodeAt(t.position),j===g)return t.position++,t.tag=a,t.anchor=f,t.kind=E?"mapping":"sequence",t.result=u,!0;r?j===44&&de(t,"expected the node content, but found ','"):de(t,"missed comma between flow collection entries"),A=x=T=null,m=S=!1,j===63&&(h=t.input.charCodeAt(t.position+1),Fr(h)&&(m=S=!0,t.position++,Ft(t,!0,e))),n=t.line,i=t.lineStart,s=t.position,Eu(t,e,Fm,!1,!0),A=t.tag,x=t.result,Ft(t,!0,e),j=t.input.charCodeAt(t.position),(S||t.line===n)&&j===58&&(m=!0,j=t.input.charCodeAt(++t.position),Ft(t,!0,e),Eu(t,e,Fm,!1,!0),T=t.result),E?wu(t,u,C,A,x,T,n,i,s):m?u.push(wu(t,null,C,A,x,T,n,i,s)):u.push(x),Ft(t,!0,e),j=t.input.charCodeAt(t.position),j===44?(r=!0,j=t.input.charCodeAt(++t.position)):r=!1}de(t,"unexpected end of the stream within a flow collection")}function EK(t,e){var r,n,i=Z_,s=!1,a=!1,u=e,f=0,h=!1,g,m;if(m=t.input.charCodeAt(t.position),m===124)n=!1;else if(m===62)n=!0;else return!1;for(t.kind="scalar",t.result="";m!==0;)if(m=t.input.charCodeAt(++t.position),m===43||m===45)Z_===i?i=m===43?Kk:cK:de(t,"repeat of a chomping mode identifier");else if((g=gK(m))>=0)g===0?de(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?de(t,"repeat of an indentation width identifier"):(u=e+g-1,a=!0);else break;if(Sa(m)){do m=t.input.charCodeAt(++t.position);while(Sa(m));if(m===35)do m=t.input.charCodeAt(++t.position);while(!ki(m)&&m!==0)}for(;m!==0;){for(X_(t),t.lineIndent=0,m=t.input.charCodeAt(t.position);(!a||t.lineIndent<u)&&m===32;)t.lineIndent++,m=t.input.charCodeAt(++t.position);if(!a&&t.lineIndent>u&&(u=t.lineIndent),ki(m)){f++;continue}if(t.lineIndent<u){i===Kk?t.result+=va.repeat(`
|
|
186
|
+
`,s?1+f:f):i===Z_&&s&&(t.result+=`
|
|
187
|
+
`);break}for(n?Sa(m)?(h=!0,t.result+=va.repeat(`
|
|
188
|
+
`,s?1+f:f)):h?(h=!1,t.result+=va.repeat(`
|
|
189
|
+
`,f+1)):f===0?s&&(t.result+=" "):t.result+=va.repeat(`
|
|
190
|
+
`,f):t.result+=va.repeat(`
|
|
191
|
+
`,s?1+f:f),s=!0,a=!0,f=0,r=t.position;!ki(m)&&m!==0;)m=t.input.charCodeAt(++t.position);mo(t,r,t.position,!1)}return!0}function e1(t,e){var r,n=t.tag,i=t.anchor,s=[],a,u=!1,f;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=s),f=t.input.charCodeAt(t.position);f!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,de(t,"tab characters must not be used in indentation")),!(f!==45||(a=t.input.charCodeAt(t.position+1),!Fr(a))));){if(u=!0,t.position++,Ft(t,!0,-1)&&t.lineIndent<=e){s.push(null),f=t.input.charCodeAt(t.position);continue}if(r=t.line,Eu(t,e,n1,!1,!0),s.push(t.result),Ft(t,!0,-1),f=t.input.charCodeAt(t.position),(t.line===r||t.lineIndent>e)&&f!==0)de(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return u?(t.tag=n,t.anchor=i,t.kind="sequence",t.result=s,!0):!1}function CK(t,e,r){var n,i,s,a,u,f,h=t.tag,g=t.anchor,m={},S=Object.create(null),E=null,C=null,x=null,A=!1,T=!1,j;if(t.firstTabInLine!==-1)return!1;for(t.anchor!==null&&(t.anchorMap[t.anchor]=m),j=t.input.charCodeAt(t.position);j!==0;){if(!A&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,de(t,"tab characters must not be used in indentation")),n=t.input.charCodeAt(t.position+1),s=t.line,(j===63||j===58)&&Fr(n))j===63?(A&&(wu(t,m,S,E,C,null,a,u,f),E=C=x=null),T=!0,A=!0,i=!0):A?(A=!1,i=!0):de(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,j=n;else{if(a=t.line,u=t.lineStart,f=t.position,!Eu(t,r,r1,!1,!0))break;if(t.line===s){for(j=t.input.charCodeAt(t.position);Sa(j);)j=t.input.charCodeAt(++t.position);if(j===58)j=t.input.charCodeAt(++t.position),Fr(j)||de(t,"a whitespace character is expected after the key-value separator within a block mapping"),A&&(wu(t,m,S,E,C,null,a,u,f),E=C=x=null),T=!0,A=!1,i=!1,E=t.tag,C=t.result;else if(T)de(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=h,t.anchor=g,!0}else if(T)de(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=h,t.anchor=g,!0}if((t.line===s||t.lineIndent>e)&&(A&&(a=t.line,u=t.lineStart,f=t.position),Eu(t,e,Lm,!0,i)&&(A?C=t.result:x=t.result),A||(wu(t,m,S,E,C,x,a,u,f),E=C=x=null),Ft(t,!0,-1),j=t.input.charCodeAt(t.position)),(t.line===s||t.lineIndent>e)&&j!==0)de(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return A&&wu(t,m,S,E,C,null,a,u,f),T&&(t.tag=h,t.anchor=g,t.kind="mapping",t.result=m),T}function xK(t){var e,r=!1,n=!1,i,s,a;if(a=t.input.charCodeAt(t.position),a!==33)return!1;if(t.tag!==null&&de(t,"duplication of a tag property"),a=t.input.charCodeAt(++t.position),a===60?(r=!0,a=t.input.charCodeAt(++t.position)):a===33?(n=!0,i="!!",a=t.input.charCodeAt(++t.position)):i="!",e=t.position,r){do a=t.input.charCodeAt(++t.position);while(a!==0&&a!==62);t.position<t.length?(s=t.input.slice(e,t.position),a=t.input.charCodeAt(++t.position)):de(t,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!Fr(a);)a===33&&(n?de(t,"tag suffix cannot contain exclamation marks"):(i=t.input.slice(e-1,t.position+1),i1.test(i)||de(t,"named tag handle cannot contain such characters"),n=!0,e=t.position+1)),a=t.input.charCodeAt(++t.position);s=t.input.slice(e,t.position),hK.test(s)&&de(t,"tag suffix cannot contain flow indicator characters")}s&&!s1.test(s)&&de(t,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{de(t,"tag name is malformed: "+s)}return r?t.tag=s:go.call(t.tagMap,i)?t.tag=t.tagMap[i]+s:i==="!"?t.tag="!"+s:i==="!!"?t.tag="tag:yaml.org,2002:"+s:de(t,'undeclared tag handle "'+i+'"'),!0}function RK(t){var e,r;if(r=t.input.charCodeAt(t.position),r!==38)return!1;for(t.anchor!==null&&de(t,"duplication of an anchor property"),r=t.input.charCodeAt(++t.position),e=t.position;r!==0&&!Fr(r)&&!_u(r);)r=t.input.charCodeAt(++t.position);return t.position===e&&de(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),!0}function OK(t){var e,r,n;if(n=t.input.charCodeAt(t.position),n!==42)return!1;for(n=t.input.charCodeAt(++t.position),e=t.position;n!==0&&!Fr(n)&&!_u(n);)n=t.input.charCodeAt(++t.position);return t.position===e&&de(t,"name of an alias node must contain at least one character"),r=t.input.slice(e,t.position),go.call(t.anchorMap,r)||de(t,'unidentified alias "'+r+'"'),t.result=t.anchorMap[r],Ft(t,!0,-1),!0}function Eu(t,e,r,n,i){var s,a,u,f=1,h=!1,g=!1,m,S,E,C,x,A;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,s=a=u=Lm===r||n1===r,n&&Ft(t,!0,-1)&&(h=!0,t.lineIndent>e?f=1:t.lineIndent===e?f=0:t.lineIndent<e&&(f=-1)),f===1)for(;xK(t)||RK(t);)Ft(t,!0,-1)?(h=!0,u=s,t.lineIndent>e?f=1:t.lineIndent===e?f=0:t.lineIndent<e&&(f=-1)):u=!1;if(u&&(u=h||i),(f===1||Lm===r)&&(Fm===r||r1===r?x=e:x=e+1,A=t.position-t.lineStart,f===1?u&&(e1(t,A)||CK(t,A,x))||wK(t,x)?g=!0:(a&&EK(t,x)||bK(t,x)||_K(t,x)?g=!0:OK(t)?(g=!0,(t.tag!==null||t.anchor!==null)&&de(t,"alias node should not have any properties")):SK(t,x,Fm===r)&&(g=!0,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):f===0&&(g=u&&e1(t,A))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&de(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),m=0,S=t.implicitTypes.length;m<S;m+=1)if(C=t.implicitTypes[m],C.resolve(t.result)){t.result=C.construct(t.result),t.tag=C.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(go.call(t.typeMap[t.kind||"fallback"],t.tag))C=t.typeMap[t.kind||"fallback"][t.tag];else for(C=null,E=t.typeMap.multi[t.kind||"fallback"],m=0,S=E.length;m<S;m+=1)if(t.tag.slice(0,E[m].tag.length)===E[m].tag){C=E[m];break}C||de(t,"unknown tag !<"+t.tag+">"),t.result!==null&&C.kind!==t.kind&&de(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+C.kind+'", not "'+t.kind+'"'),C.resolve(t.result,t.tag)?(t.result=C.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):de(t,"cannot resolve a node with !<"+t.tag+"> explicit tag")}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||g}function IK(t){var e=t.position,r,n,i,s=!1,a;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(a=t.input.charCodeAt(t.position))!==0&&(Ft(t,!0,-1),a=t.input.charCodeAt(t.position),!(t.lineIndent>0||a!==37));){for(s=!0,a=t.input.charCodeAt(++t.position),r=t.position;a!==0&&!Fr(a);)a=t.input.charCodeAt(++t.position);for(n=t.input.slice(r,t.position),i=[],n.length<1&&de(t,"directive name must not be less than one character in length");a!==0;){for(;Sa(a);)a=t.input.charCodeAt(++t.position);if(a===35){do a=t.input.charCodeAt(++t.position);while(a!==0&&!ki(a));break}if(ki(a))break;for(r=t.position;a!==0&&!Fr(a);)a=t.input.charCodeAt(++t.position);i.push(t.input.slice(r,t.position))}a!==0&&X_(t),go.call(Zk,n)?Zk[n](t,n,i):jm(t,'unknown document directive "'+n+'"')}if(Ft(t,!0,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,Ft(t,!0,-1)):s&&de(t,"directives end mark is expected"),Eu(t,t.lineIndent-1,Lm,!1,!0),Ft(t,!0,-1),t.checkLineBreaks&&dK.test(t.input.slice(e,t.position))&&jm(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&Um(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,Ft(t,!0,-1));return}if(t.position<t.length-1)de(t,"end of the stream or a document separator is expected");else return}function c1(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
|
|
192
|
+
`),t.charCodeAt(0)===65279&&(t=t.slice(1)));var r=new vK(t,e),n=t.indexOf("\0");for(n!==-1&&(r.position=n,de(r,"null byte is not allowed in input")),r.input+="\0";r.input.charCodeAt(r.position)===32;)r.lineIndent+=1,r.position+=1;for(;r.position<r.length-1;)IK(r);return r.documents}function PK(t,e,r){e!==null&&typeof e=="object"&&typeof r>"u"&&(r=e,e=null);var n=c1(t,r);if(typeof e!="function")return n;for(var i=0,s=n.length;i<s;i+=1)e(n[i])}function kK(t,e){var r=c1(t,e);if(r.length!==0){if(r.length===1)return r[0];throw new t1("expected a single document in the stream, but found more")}}tw.exports.loadAll=PK;tw.exports.load=kK});var T1=F((O5,A1)=>{"use strict";var Vm=Su(),Df=bu(),AK=Dm(),b1=Object.prototype.toString,_1=Object.prototype.hasOwnProperty,ow=65279,TK=9,Nf=10,qK=13,NK=32,MK=33,$K=34,rw=35,DK=37,FK=38,LK=39,jK=42,w1=44,UK=45,Bm=58,BK=61,HK=62,VK=63,WK=64,E1=91,C1=93,YK=96,x1=123,JK=124,R1=125,fr={};fr[0]="\\0";fr[7]="\\a";fr[8]="\\b";fr[9]="\\t";fr[10]="\\n";fr[11]="\\v";fr[12]="\\f";fr[13]="\\r";fr[27]="\\e";fr[34]='\\"';fr[92]="\\\\";fr[133]="\\N";fr[160]="\\_";fr[8232]="\\L";fr[8233]="\\P";var zK=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],KK=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function GK(t,e){var r,n,i,s,a,u,f;if(e===null)return{};for(r={},n=Object.keys(e),i=0,s=n.length;i<s;i+=1)a=n[i],u=String(e[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),f=t.compiledTypeMap.fallback[a],f&&_1.call(f.styleAliases,u)&&(u=f.styleAliases[u]),r[a]=u;return r}function QK(t){var e,r,n;if(e=t.toString(16).toUpperCase(),t<=255)r="x",n=2;else if(t<=65535)r="u",n=4;else if(t<=4294967295)r="U",n=8;else throw new Df("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+r+Vm.repeat("0",n-e.length)+e}var ZK=1,Mf=2;function XK(t){this.schema=t.schema||AK,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||!1,this.skipInvalid=t.skipInvalid||!1,this.flowLevel=Vm.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=GK(this.schema,t.styles||null),this.sortKeys=t.sortKeys||!1,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||!1,this.noCompatMode=t.noCompatMode||!1,this.condenseFlow=t.condenseFlow||!1,this.quotingType=t.quotingType==='"'?Mf:ZK,this.forceQuotes=t.forceQuotes||!1,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function d1(t,e){for(var r=Vm.repeat(" ",e),n=0,i=-1,s="",a,u=t.length;n<u;)i=t.indexOf(`
|
|
193
|
+
`,n),i===-1?(a=t.slice(n),n=u):(a=t.slice(n,i+1),n=i+1),a.length&&a!==`
|
|
194
|
+
`&&(s+=r),s+=a;return s}function nw(t,e){return`
|
|
195
|
+
`+Vm.repeat(" ",t.indent*e)}function eG(t,e){var r,n,i;for(r=0,n=t.implicitTypes.length;r<n;r+=1)if(i=t.implicitTypes[r],i.resolve(e))return!0;return!1}function Hm(t){return t===NK||t===TK}function $f(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==ow||65536<=t&&t<=1114111}function h1(t){return $f(t)&&t!==ow&&t!==qK&&t!==Nf}function p1(t,e,r){var n=h1(t),i=n&&!Hm(t);return(r?n:n&&t!==w1&&t!==E1&&t!==C1&&t!==x1&&t!==R1)&&t!==rw&&!(e===Bm&&!i)||h1(e)&&!Hm(e)&&t===rw||e===Bm&&i}function tG(t){return $f(t)&&t!==ow&&!Hm(t)&&t!==UK&&t!==VK&&t!==Bm&&t!==w1&&t!==E1&&t!==C1&&t!==x1&&t!==R1&&t!==rw&&t!==FK&&t!==jK&&t!==MK&&t!==JK&&t!==BK&&t!==HK&&t!==LK&&t!==$K&&t!==DK&&t!==WK&&t!==YK}function rG(t){return!Hm(t)&&t!==Bm}function qf(t,e){var r=t.charCodeAt(e),n;return r>=55296&&r<=56319&&e+1<t.length&&(n=t.charCodeAt(e+1),n>=56320&&n<=57343)?(r-55296)*1024+n-56320+65536:r}function O1(t){var e=/^\n* /;return e.test(t)}var I1=1,iw=2,P1=3,k1=4,Cu=5;function nG(t,e,r,n,i,s,a,u){var f,h=0,g=null,m=!1,S=!1,E=n!==-1,C=-1,x=tG(qf(t,0))&&rG(qf(t,t.length-1));if(e||a)for(f=0;f<t.length;h>=65536?f+=2:f++){if(h=qf(t,f),!$f(h))return Cu;x=x&&p1(h,g,u),g=h}else{for(f=0;f<t.length;h>=65536?f+=2:f++){if(h=qf(t,f),h===Nf)m=!0,E&&(S=S||f-C-1>n&&t[C+1]!==" ",C=f);else if(!$f(h))return Cu;x=x&&p1(h,g,u),g=h}S=S||E&&f-C-1>n&&t[C+1]!==" "}return!m&&!S?x&&!a&&!i(t)?I1:s===Mf?Cu:iw:r>9&&O1(t)?Cu:a?s===Mf?Cu:iw:S?k1:P1}function iG(t,e,r,n,i){t.dump=function(){if(e.length===0)return t.quotingType===Mf?'""':"''";if(!t.noCompatMode&&(zK.indexOf(e)!==-1||KK.test(e)))return t.quotingType===Mf?'"'+e+'"':"'"+e+"'";var s=t.indent*Math.max(1,r),a=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-s),u=n||t.flowLevel>-1&&r>=t.flowLevel;function f(h){return eG(t,h)}switch(nG(e,u,t.indent,a,f,t.quotingType,t.forceQuotes&&!n,i)){case I1:return e;case iw:return"'"+e.replace(/'/g,"''")+"'";case P1:return"|"+m1(e,t.indent)+g1(d1(e,s));case k1:return">"+m1(e,t.indent)+g1(d1(sG(e,a),s));case Cu:return'"'+oG(e,a)+'"';default:throw new Df("impossible error: invalid scalar style")}}()}function m1(t,e){var r=O1(t)?String(e):"",n=t[t.length-1]===`
|
|
196
|
+
`,i=n&&(t[t.length-2]===`
|
|
197
|
+
`||t===`
|
|
198
|
+
`),s=i?"+":n?"":"-";return r+s+`
|
|
199
|
+
`}function g1(t){return t[t.length-1]===`
|
|
200
|
+
`?t.slice(0,-1):t}function sG(t,e){for(var r=/(\n+)([^\n]*)/g,n=function(){var h=t.indexOf(`
|
|
201
|
+
`);return h=h!==-1?h:t.length,r.lastIndex=h,y1(t.slice(0,h),e)}(),i=t[0]===`
|
|
202
|
+
`||t[0]===" ",s,a;a=r.exec(t);){var u=a[1],f=a[2];s=f[0]===" ",n+=u+(!i&&!s&&f!==""?`
|
|
203
|
+
`:"")+y1(f,e),i=s}return n}function y1(t,e){if(t===""||t[0]===" ")return t;for(var r=/ [^ ]/g,n,i=0,s,a=0,u=0,f="";n=r.exec(t);)u=n.index,u-i>e&&(s=a>i?a:u,f+=`
|
|
204
|
+
`+t.slice(i,s),i=s+1),a=u;return f+=`
|
|
205
|
+
`,t.length-i>e&&a>i?f+=t.slice(i,a)+`
|
|
206
|
+
`+t.slice(a+1):f+=t.slice(i),f.slice(1)}function oG(t){for(var e="",r=0,n,i=0;i<t.length;r>=65536?i+=2:i++)r=qf(t,i),n=fr[r],!n&&$f(r)?(e+=t[i],r>=65536&&(e+=t[i+1])):e+=n||QK(r);return e}function aG(t,e,r){var n="",i=t.tag,s,a,u;for(s=0,a=r.length;s<a;s+=1)u=r[s],t.replacer&&(u=t.replacer.call(r,String(s),u)),(ss(t,e,u,!1,!1)||typeof u>"u"&&ss(t,e,null,!1,!1))&&(n!==""&&(n+=","+(t.condenseFlow?"":" ")),n+=t.dump);t.tag=i,t.dump="["+n+"]"}function v1(t,e,r,n){var i="",s=t.tag,a,u,f;for(a=0,u=r.length;a<u;a+=1)f=r[a],t.replacer&&(f=t.replacer.call(r,String(a),f)),(ss(t,e+1,f,!0,!0,!1,!0)||typeof f>"u"&&ss(t,e+1,null,!0,!0,!1,!0))&&((!n||i!=="")&&(i+=nw(t,e)),t.dump&&Nf===t.dump.charCodeAt(0)?i+="-":i+="- ",i+=t.dump);t.tag=s,t.dump=i||"[]"}function lG(t,e,r){var n="",i=t.tag,s=Object.keys(r),a,u,f,h,g;for(a=0,u=s.length;a<u;a+=1)g="",n!==""&&(g+=", "),t.condenseFlow&&(g+='"'),f=s[a],h=r[f],t.replacer&&(h=t.replacer.call(r,f,h)),ss(t,e,f,!1,!1)&&(t.dump.length>1024&&(g+="? "),g+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),ss(t,e,h,!1,!1)&&(g+=t.dump,n+=g));t.tag=i,t.dump="{"+n+"}"}function uG(t,e,r,n){var i="",s=t.tag,a=Object.keys(r),u,f,h,g,m,S;if(t.sortKeys===!0)a.sort();else if(typeof t.sortKeys=="function")a.sort(t.sortKeys);else if(t.sortKeys)throw new Df("sortKeys must be a boolean or a function");for(u=0,f=a.length;u<f;u+=1)S="",(!n||i!=="")&&(S+=nw(t,e)),h=a[u],g=r[h],t.replacer&&(g=t.replacer.call(r,h,g)),ss(t,e+1,h,!0,!0,!0)&&(m=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,m&&(t.dump&&Nf===t.dump.charCodeAt(0)?S+="?":S+="? "),S+=t.dump,m&&(S+=nw(t,e)),ss(t,e+1,g,!0,m)&&(t.dump&&Nf===t.dump.charCodeAt(0)?S+=":":S+=": ",S+=t.dump,i+=S));t.tag=s,t.dump=i||"{}"}function S1(t,e,r){var n,i,s,a,u,f;for(i=r?t.explicitTypes:t.implicitTypes,s=0,a=i.length;s<a;s+=1)if(u=i[s],(u.instanceOf||u.predicate)&&(!u.instanceOf||typeof e=="object"&&e instanceof u.instanceOf)&&(!u.predicate||u.predicate(e))){if(r?u.multi&&u.representName?t.tag=u.representName(e):t.tag=u.tag:t.tag="?",u.represent){if(f=t.styleMap[u.tag]||u.defaultStyle,b1.call(u.represent)==="[object Function]")n=u.represent(e,f);else if(_1.call(u.represent,f))n=u.represent[f](e,f);else throw new Df("!<"+u.tag+'> tag resolver accepts not "'+f+'" style');t.dump=n}return!0}return!1}function ss(t,e,r,n,i,s,a){t.tag=null,t.dump=r,S1(t,r,!1)||S1(t,r,!0);var u=b1.call(t.dump),f=n,h;n&&(n=t.flowLevel<0||t.flowLevel>e);var g=u==="[object Object]"||u==="[object Array]",m,S;if(g&&(m=t.duplicates.indexOf(r),S=m!==-1),(t.tag!==null&&t.tag!=="?"||S||t.indent!==2&&e>0)&&(i=!1),S&&t.usedDuplicates[m])t.dump="*ref_"+m;else{if(g&&S&&!t.usedDuplicates[m]&&(t.usedDuplicates[m]=!0),u==="[object Object]")n&&Object.keys(t.dump).length!==0?(uG(t,e,t.dump,i),S&&(t.dump="&ref_"+m+t.dump)):(lG(t,e,t.dump),S&&(t.dump="&ref_"+m+" "+t.dump));else if(u==="[object Array]")n&&t.dump.length!==0?(t.noArrayIndent&&!a&&e>0?v1(t,e-1,t.dump,i):v1(t,e,t.dump,i),S&&(t.dump="&ref_"+m+t.dump)):(aG(t,e,t.dump),S&&(t.dump="&ref_"+m+" "+t.dump));else if(u==="[object String]")t.tag!=="?"&&iG(t,t.dump,e,s,f);else{if(u==="[object Undefined]")return!1;if(t.skipInvalid)return!1;throw new Df("unacceptable kind of an object to dump "+u)}t.tag!==null&&t.tag!=="?"&&(h=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?h="!"+h:h.slice(0,18)==="tag:yaml.org,2002:"?h="!!"+h.slice(18):h="!<"+h+">",t.dump=h+" "+t.dump)}return!0}function cG(t,e){var r=[],n=[],i,s;for(sw(t,r,n),i=0,s=n.length;i<s;i+=1)e.duplicates.push(r[n[i]]);e.usedDuplicates=new Array(s)}function sw(t,e,r){var n,i,s;if(t!==null&&typeof t=="object")if(i=e.indexOf(t),i!==-1)r.indexOf(i)===-1&&r.push(i);else if(e.push(t),Array.isArray(t))for(i=0,s=t.length;i<s;i+=1)sw(t[i],e,r);else for(n=Object.keys(t),i=0,s=n.length;i<s;i+=1)sw(t[n[i]],e,r)}function fG(t,e){e=e||{};var r=new XK(e);r.noRefs||cG(t,r);var n=t;return r.replacer&&(n=r.replacer.call({"":n},"",n)),ss(r,0,n,!0,!0)?r.dump+`
|
|
207
|
+
`:""}A1.exports.dump=fG});var lw=F((I5,br)=>{"use strict";var q1=f1(),dG=T1();function aw(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=N_();br.exports.FAILSAFE_SCHEMA=F_();br.exports.JSON_SCHEMA=H_();br.exports.CORE_SCHEMA=V_();br.exports.DEFAULT_SCHEMA=Dm();br.exports.load=q1.load;br.exports.loadAll=q1.loadAll;br.exports.dump=dG.dump;br.exports.YAMLException=bu();br.exports.types={binary:z_(),float:B_(),map:D_(),null:L_(),pairs:G_(),set:Q_(),timestamp:W_(),bool:j_(),int:U_(),merge:Y_(),omap:K_(),seq:$_(),str:M_()};br.exports.safeLoad=aw("safeLoad","load");br.exports.safeLoadAll=aw("safeLoadAll","loadAll");br.exports.safeDump=aw("safeDump","dump")});var N1=F(Ff=>{"use strict";var hG=Ff&&Ff.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ff,"__esModule",{value:!0});var pG=bn(),mG=hG(lw()),gG=lw();Ff.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 mG.default.load(e,{schema:gG.JSON_SCHEMA})}catch(r){throw new pG.ParserError(r?.message||"Parser Error",t.url)}else return e}}});var M1=F(uw=>{"use strict";Object.defineProperty(uw,"__esModule",{value:!0});var yG=bn(),vG=/\.(txt|htm|html|md|xml|js|min|map|css|scss|less|svg)$/i;uw.default={order:300,allowEmpty:!0,encoding:"utf8",canParse(t){return(typeof t.data=="string"||Buffer.isBuffer(t.data))&&vG.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 yG.ParserError("data is not text",t.url)}}});var $1=F(cw=>{"use strict";Object.defineProperty(cw,"__esModule",{value:!0});var SG=/\.(jpeg|jpg|gif|png|bmp|ico)$/i;cw.default={order:400,allowEmpty:!0,canParse(t){return Buffer.isBuffer(t.data)&&SG.test(t.url)},parse(t){return Buffer.isBuffer(t.data)?t.data:Buffer.from(t.data)}}});var j1=F(zn=>{"use strict";var bG=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]}),_G=zn&&zn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),wG=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"&&bG(r,e,n[i]);return _G(r,e),r}}(),EG=zn&&zn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zn,"__esModule",{value:!0});var CG=EG(require("fs")),D1=fo(),F1=wG(Sn()),L1=bn();zn.default={order:100,canRead(t){return F1.isFileSystemPath(t.url)},async read(t){let e;try{e=F1.toFileSystemPath(t.url)}catch(r){throw new L1.ResolverError(D1.ono.uri(r,`Malformed URI: ${t.url}`),t.url)}try{return await CG.default.promises.readFile(e)}catch(r){throw new L1.ResolverError((0,D1.ono)(r,`Error opening file "${e}"`),e)}}}});var H1=F(os=>{"use strict";var xG=os&&os.__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=os&&os.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),OG=os&&os.__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}}();Object.defineProperty(os,"__esModule",{value:!0});var Wm=fo(),Lf=OG(Sn()),U1=bn();os.default={order:200,headers:null,timeout:6e4,redirects:5,withCredentials:!1,canRead(t){return Lf.isHttp(t.url)},read(t){let e=Lf.parse(t.url);return typeof window<"u"&&!e.protocol&&(e.protocol=Lf.parse(location.href).protocol),B1(e,this)}};async function B1(t,e,r){t=Lf.parse(t);let n=r||[];n.push(t.href);try{let i=await IG(t,e);if(i.status>=400)throw(0,Wm.ono)({status:i.status},`HTTP ERROR ${i.status}`);if(i.status>=300){if(!Number.isNaN(e.redirects)&&n.length>e.redirects)throw new U1.ResolverError((0,Wm.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,Ym.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=jf.resolve(r.href,i.headers.location);return B1(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new U1.ResolverError((0,Ym.ono)(i,`Error downloading ${r.href}`),r.href)}}async function IG(r,e){let t,n;e.timeout&&(t=new AbortController,n=setTimeout(()=>t.abort(),e.timeout));let i=await fetch(r,{method:"GET",headers:e.headers||{},credentials:e.withCredentials?"include":"same-origin",signal:t?t.signal:null});return n&&clearTimeout(n),i}});var fw=F(as=>{"use strict";var xu=as&&as.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(as,"__esModule",{value:!0});as.getNewOptions=as.getJsonSchemaRefParserDefaultOptions=void 0;var OG=xu(Sk()),PG=xu(N1()),kG=xu(M1()),AG=xu($1()),TG=xu(j1()),qG=xu(H1()),NG=()=>({parse:{json:{...OG.default},yaml:{...PG.default},text:{...kG.default},binary:{...AG.default}},resolve:{file:{...TG.default},http:{...qG.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});as.getJsonSchemaRefParserDefaultOptions=NG;var MG=r=>{let e=(0,as.getJsonSchemaRefParserDefaultOptions)();return r&&W1(e,r),e};as.getNewOptions=MG;function W1(r,e){if(V1(e)){let t=Object.keys(e).filter(n=>!["__proto__","constructor","prototype"].includes(n));for(let n=0;n<t.length;n++){let i=t[n],s=e[i],a=r[i];V1(s)?r[i]=W1(a||{},s):s!==void 0&&(r[i]=s)}}return r}function V1(r){return r&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}});var J1=F(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.normalizeArgs=Y1;var $G=fw();function Y1(r){let e,t,n,i,s=Array.prototype.slice.call(r);typeof s[s.length-1]=="function"&&(i=s.pop()),typeof s[0]=="string"?(e=s[0],typeof s[2]=="object"?(t=s[1],n=s[2]):(t=void 0,n=s[1])):(e="",t=s[0],n=s[1]);try{n=(0,$G.getNewOptions)(n)}catch(a){console.error(`JSON Schema Ref Parser: Error normalizing options: ${a}`)}return!n.mutateInputSchema&&typeof t=="object"&&(t=JSON.parse(JSON.stringify(t))),{path:e,schema:t,options:n,callback:i}}Jm.default=Y1});var z1=F(Kn=>{"use strict";var DG=Kn&&Kn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),FG=Kn&&Kn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),LG=Kn&&Kn.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&DG(t,e,n[i]);return FG(t,e),t}}(),dw=Kn&&Kn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Kn,"__esModule",{value:!0});var jG=dw(yu()),UG=dw(kf()),BG=dw(O_()),Ru=LG(Sn()),HG=bn();function VG(r,e){if(!e.resolve?.external)return Promise.resolve();try{let t=hw(r.schema,r.$refs._root$Ref.path+"#",r.$refs,e);return Promise.all(t)}catch(t){return Promise.reject(t)}}function hw(r,e,t,n,i,s){i||(i=new Set);let a=[];if(r&&typeof r=="object"&&!ArrayBuffer.isView(r)&&!i.has(r)){i.add(r),jG.default.isExternal$Ref(r)&&a.push(WG(r,e,t,n));let u=Object.keys(r);for(let f of u){let h=UG.default.join(e,f),m=r[f];a=a.concat(hw(m,h,t,n,i,s))}}return a}async function WG(r,e,t,n){let i=n.dereference?.externalReferenceResolution==="root",s=Ru.resolve(i?Ru.cwd():e,r.$ref),a=Ru.stripHash(s),u=t._$refs[a];if(u)return Promise.resolve(u.value);try{let f=await(0,BG.default)(s,t,n),h=hw(f,a+"#",t,n,new Set,!0);return Promise.all(h)}catch(f){if(!n?.continueOnError||!(0,HG.isHandledError)(f))throw f;return t._$refs[a]&&(f.source=decodeURI(Ru.stripHash(e)),f.path=Ru.safePointerToPath(Ru.getHash(e))),[]}}Kn.default=VG});var Q1=F(Gn=>{"use strict";var YG=Gn&&Gn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),JG=Gn&&Gn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),zG=Gn&&Gn.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&YG(t,e,n[i]);return JG(t,e),t}}(),G1=Gn&&Gn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Gn,"__esModule",{value:!0});var zm=G1(yu()),Uf=G1(kf()),pw=zG(Sn());function KG(r,e){let t=[];mw(r,"schema",r.$refs._root$Ref.path+"#","#",0,t,r.$refs,e),GG(t)}function mw(r,e,t,n,i,s,a,u){let f=e===null?r:r[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(zm.default.isAllowed$Ref(f))K1(r,e,t,n,i,s,a,u);else{let h=Object.keys(f).sort((m,g)=>m==="definitions"?-1:g==="definitions"?1:m.length-g.length);for(let m of h){let g=Uf.default.join(t,m),S=Uf.default.join(n,m),E=f[m];zm.default.isAllowed$Ref(E)?K1(f,m,t,S,i,s,a,u):mw(f,m,g,S,i,s,a,u)}}}function K1(r,e,t,n,i,s,a,u){let f=e===null?r:r[e],h=pw.resolve(t,f.$ref),m=a._resolve(h,n,u);if(m===null)return;let S=Uf.default.parse(n).length,E=pw.stripHash(m.path),C=pw.getHash(m.path),x=E!==a._root$Ref.path,A=zm.default.isExtended$Ref(f);i+=m.indirections;let q=QG(s,r,e);if(q)if(S<q.depth||i<q.indirections)ZG(s,q);else return;s.push({$ref:f,parent:r,key:e,pathFromRoot:n,depth:S,file:E,hash:C,value:m.value,circular:m.circular,extended:A,external:x,indirections:i}),(!q||x)&&mw(m.value,null,m.path,n,i+1,s,a,u)}function GG(r){r.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,t,n;for(let i of r)i.external?i.file===e&&i.hash===t?i.$ref.$ref=n:i.file===e&&i.hash.indexOf(t+"/")===0?i.$ref.$ref=Uf.default.join(n,Uf.default.parse(i.hash.replace(t,"#"))):(e=i.file,t=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=zm.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function QG(r,e,t){for(let n of r)if(n&&n.parent===e&&n.key===t)return n}function ZG(r,e){let t=r.indexOf(e);r.splice(t,1)}Gn.default=KG});var nA=F(Qn=>{"use strict";var XG=Qn&&Qn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),e3=Qn&&Qn.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),t3=Qn&&Qn.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&XG(t,e,n[i]);return e3(t,e),t}}(),tA=Qn&&Qn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Qn,"__esModule",{value:!0});var Km=tA(yu()),Z1=tA(kf()),r3=fo(),X1=t3(Sn()),n3=bn();Qn.default=i3;function i3(r,e){let t=Date.now(),n=gw(r.schema,r.$refs._root$Ref.path,"#",new Set,new Set,new Map,r.$refs,e,t);r.$refs.circular=n.circular,r.schema=n.value}function gw(r,e,t,n,i,s,a,u,f){let h,m={value:r,circular:!1};if(u&&u.timeoutMs&&Date.now()-f>u.timeoutMs)throw new n3.TimeoutError(u.timeoutMs);let g=u.dereference||{},S=g.excludedPathMatcher||(()=>!1);if((g?.circular==="ignore"||!i.has(r))&&r&&typeof r=="object"&&!ArrayBuffer.isView(r)&&!S(t)){if(n.add(r),i.add(r),Km.default.isAllowed$Ref(r,u))h=eA(r,e,t,n,i,s,a,u,f),m.circular=h.circular,m.value=h.value;else for(let E of Object.keys(r)){let C=Z1.default.join(e,E),x=Z1.default.join(t,E);if(S(x))continue;let A=r[E],q=!1;if(Km.default.isAllowed$Ref(A,u)){if(h=eA(A,C,x,n,i,s,a,u,f),q=h.circular,r[E]!==h.value){let j=new Map;g?.preservedProperties&&typeof r[E]=="object"&&!Array.isArray(r[E])&&g?.preservedProperties.forEach(Y=>{Y in r[E]&&j.set(Y,r[E][Y])}),r[E]=h.value,g?.preservedProperties&&j.size&&typeof r[E]=="object"&&!Array.isArray(r[E])&&j.forEach((Y,V)=>{r[E][V]=Y}),g?.onDereference?.(A.$ref,r[E],r,E)}}else n.has(A)?q=rA(C,a,u):(h=gw(A,C,x,n,i,s,a,u,f),q=h.circular,r[E]!==h.value&&(r[E]=h.value));m.circular=m.circular||q}n.delete(r)}return m}function eA(r,e,t,n,i,s,a,u,f){let m=Km.default.isExternal$Ref(r)&&u?.dereference?.externalReferenceResolution==="root",g=X1.resolve(m?X1.cwd():e,r.$ref),S=s.get(g);if(S&&!S.circular){let j=Object.keys(r);if(j.length>1){let Y={};for(let V of j)V!=="$ref"&&!(V in S.value)&&(Y[V]=r[V]);return{circular:S.circular,value:Object.assign({},S.value,Y)}}return S}let E=a._resolve(g,e,u);if(E===null)return{circular:!1,value:null};let C=E.circular,x=C||n.has(E.value);x&&rA(e,a,u);let A=Km.default.dereference(r,E.value);if(!x){let j=gw(A,E.path,t,n,i,s,a,u,f);x=j.circular,A=j.value}x&&!C&&u.dereference?.circular==="ignore"&&(A=r),C&&(A.$ref=t);let q={circular:x,value:A};return Object.keys(r).length===1&&s.set(g,q),q}function rA(r,e,t){if(e.circular=!0,t?.dereference?.onCircular?.(r),!t.dereference.circular)throw r3.ono.reference(`Circular $ref pointer found at ${r}`);return!0}});var iA=F(yw=>{"use strict";Object.defineProperty(yw,"__esModule",{value:!0});function s3(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}yw.default=s3()});var oA=F(Bf=>{"use strict";var o3=Bf&&Bf.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Bf,"__esModule",{value:!0});Bf.default=a3;var sA=o3(iA());function a3(r,e){if(r){e.then(function(t){(0,sA.default)(function(){r(null,t)})},function(t){(0,sA.default)(function(){r(t)})});return}else return e}});var cA=F(_e=>{"use strict";var l3=_e&&_e.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),u3=_e&&_e.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),c3=_e&&_e.__importStar||function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&l3(t,e,n[i]);return u3(t,e),t}}(),_a=_e&&_e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};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 aA=_a(pk()),f3=_a(O_()),Hf=_a(J1());_e.jsonSchemaParserNormalizeArgs=Hf.default;var d3=_a(z1()),h3=_a(Q1()),uA=_a(nA());_e.dereferenceInternal=uA.default;var ba=c3(Sn()),_n=bn();Object.defineProperty(_e,"JSONParserError",{enumerable:!0,get:function(){return _n.JSONParserError}});Object.defineProperty(_e,"InvalidPointerError",{enumerable:!0,get:function(){return _n.InvalidPointerError}});Object.defineProperty(_e,"MissingPointerError",{enumerable:!0,get:function(){return _n.MissingPointerError}});Object.defineProperty(_e,"ResolverError",{enumerable:!0,get:function(){return _n.ResolverError}});Object.defineProperty(_e,"ParserError",{enumerable:!0,get:function(){return _n.ParserError}});Object.defineProperty(_e,"UnmatchedParserError",{enumerable:!0,get:function(){return _n.UnmatchedParserError}});Object.defineProperty(_e,"UnmatchedResolverError",{enumerable:!0,get:function(){return _n.UnmatchedResolverError}});Object.defineProperty(_e,"isHandledError",{enumerable:!0,get:function(){return _n.isHandledError}});Object.defineProperty(_e,"JSONParserErrorGroup",{enumerable:!0,get:function(){return _n.JSONParserErrorGroup}});var lA=fo(),Zn=_a(oA()),p3=fw();Object.defineProperty(_e,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return p3.getJsonSchemaRefParserDefaultOptions}});var yo=class r{constructor(){this.schema=null,this.$refs=new aA.default}async parse(){let e=(0,Hf.default)(arguments),t;if(!e.path&&!e.schema){let i=(0,lA.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,Zn.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new aA.default;let n="http";if(ba.isFileSystemPath(e.path))e.path=ba.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=ba.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=ba.resolve(ba.cwd(),e.path),e.schema&&typeof e.schema=="object"){let i=this.$refs._add(e.path);i.value=e.schema,i.pathType=n,t=Promise.resolve(e.schema)}else t=(0,f3.default)(e.path,this.$refs,e.options);try{let i=await t;if(i!==null&&typeof i=="object"&&!Buffer.isBuffer(i))return this.schema=i,(0,Zn.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,Zn.default)(e.callback,Promise.resolve(this.schema));throw lA.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,_n.isHandledError)(i)?(0,Zn.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[ba.stripHash(e.path)]&&this.$refs._$refs[ba.stripHash(e.path)].addError(i),(0,Zn.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new r;return e.parse.apply(e,arguments)}async resolve(){let e=(0,Hf.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,d3.default)(this,e.options),vw(this),(0,Zn.default)(e.callback,Promise.resolve(this.$refs))}catch(t){return(0,Zn.default)(e.callback,Promise.reject(t))}}static resolve(){let e=new r;return e.resolve.apply(e,arguments)}static bundle(){let e=new r;return e.bundle.apply(e,arguments)}async bundle(){let e=(0,Hf.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,h3.default)(this,e.options),vw(this),(0,Zn.default)(e.callback,Promise.resolve(this.schema))}catch(t){return(0,Zn.default)(e.callback,Promise.reject(t))}}static dereference(){let e=new r;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,Hf.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,uA.default)(this,e.options),vw(this),(0,Zn.default)(e.callback,Promise.resolve(this.schema))}catch(t){return(0,Zn.default)(e.callback,Promise.reject(t))}}};_e.$RefParser=yo;_e.default=yo;function vw(r){if(_n.JSONParserErrorGroup.getParserErrors(r).length>0)throw new _n.JSONParserErrorGroup(r)}_e.parse=yo.parse;_e.resolve=yo.resolve;_e.bundle=yo.bundle;_e.dereference=yo.dereference});var I3={};O$(I3,{BODY_FILE_MAP:()=>_v,CONFIG_FILES:()=>ra,CollectionLoader:()=>jo,CollectionLoaderFactory:()=>Wl,CollectionRequestExecutor:()=>Gl,CollectionService:()=>Yl,ConfigService:()=>na,CookieJar:()=>pl,CookieService:()=>Jl,CookieUtils:()=>ot,DEFAULT_CONFIG:()=>vr,DEFAULT_REQUEST_SETTINGS:()=>fn,DEFAULT_SUITE_CONFIG:()=>Vf,DYNAMIC_VARIABLES:()=>Tv,DataFileParser:()=>Zs,EnvironmentConfigService:()=>Kl,EnvironmentResolver:()=>gi,ExampleGenerator:()=>ha,FetchHttpClient:()=>Ll,FolderCollectionLoader:()=>dl,FolderCollectionStore:()=>Ji,ForgeContainer:()=>yp,ForgeEnv:()=>zi,GraphQLSchemaService:()=>Zl,HTTP_METHOD_MAP:()=>Zm,HTTP_METHOD_REVERSE:()=>Cw,HistoryAnalyzer:()=>sa,HttpForgeParser:()=>Qs,HttpRequestService:()=>vi,InMemoryCookieJar:()=>Qm,InterceptorChain:()=>Si,JsonCollectionLoader:()=>ta,LoggingRequestInterceptor:()=>Oh,METADATA_FILES:()=>Or,ModuleLoader:()=>Hc,NodeFileSystem:()=>jl,NodeHttpClient:()=>Bs,OAuth2TokenManager:()=>Hl,OpenApiExporter:()=>da,OpenApiImporter:()=>Ca,ParserRegistry:()=>hl,PersistentCookieJar:()=>zl,ROOT_DIRECTORIES:()=>eo,RefResolver:()=>wa,RequestExecutor:()=>Zo,RequestHistoryService:()=>tu,RequestHistoryStore:()=>Fl,RequestPreparer:()=>Ql,RequestPreprocessor:()=>Gs,RequestScriptSession:()=>Dl,ResultStorageService:()=>eg,RetryErrorInterceptor:()=>kh,SCHEMA_FILES:()=>fl,SCRIPTS_DIR:()=>zr,SCRIPT_FILES:()=>ac,SchemaInferenceService:()=>Ea,SchemaInferrer:()=>rs,ScriptAnalyzer:()=>xa,ScriptExecutor:()=>xi,ServiceContainer:()=>Iu,ServiceIdentifiers:()=>ne,StatisticsService:()=>rg,TestSuiteService:()=>ng,TestSuiteStore:()=>ig,TimingResponseInterceptor:()=>Ph,UrlBuilder:()=>cn,VariableInterpolator:()=>Us,VariableResolver:()=>js,applyExtractionPlan:()=>GR,applyFilterChain:()=>vl,augmentWithDynamicVars:()=>Ds,buildExtractionPlan:()=>KR,buildResultFileName:()=>Ew,cleanupOldBodyFiles:()=>Ev,concatenateScripts:()=>Yc,createExpectChain:()=>Ml,createLodashShim:()=>Wc,createModuleLoader:()=>hp,createMomentShim:()=>Vc,createResponseObject:()=>pp,createScriptConsole:()=>DR,createTestFunction:()=>mp,createVariableResolver:()=>iE,deepClone:()=>WC,deleteItemFromTree:()=>Sh,detectSensitiveData:()=>zR,evaluateExpression:()=>Ls,expandSummary:()=>xA,exportCollectionToRestClient:()=>HR,findItemById:()=>vh,formatBytes:()=>zC,formatConsoleOutput:()=>Jc,formatDuration:()=>KC,generateId:()=>rt,generateSlug:()=>mi,generateUUID:()=>yh,getCompletions:()=>CA,getRestClientExportFolder:()=>BR,getServiceContainer:()=>bw,hasChanged:()=>$l,isExpression:()=>Fs,isPlainObject:()=>YC,isSystemEnvironmentFile:()=>cc,loadEnvironmentsFromFolder:()=>ml,mergeHeadersCaseInsensitive:()=>cl,mergeRequestSettings:()=>Ih,normalizeHeaders:()=>gp,parseFilterChain:()=>yl,parsePostmanEnvironment:()=>Kc,parsePostmanEnvironmentFile:()=>YR,parseQueryContext:()=>wA,prepareBodyForSave:()=>Cv,readBodyFromDir:()=>wv,readSchemaFile:()=>xv,readScriptsFromDir:()=>lc,redactBody:()=>wp,redactFullResponse:()=>Ep,redactFullResultDetails:()=>xp,redactHeaders:()=>eu,redactHistoryEntry:()=>Cp,redactUrl:()=>_p,registerCoreServices:()=>Sw,resolveDynamicVariable:()=>yi,resolveDynamicVariablesInString:()=>rE,safeJsonParse:()=>JC,sanitizeName:()=>_t,searchForItemPath:()=>bh,sortItemsByOrder:()=>Iv,writeEnvFile:()=>ea,writeFolderItems:()=>zc,writeSchemaFiles:()=>Rv,writeScriptFile:()=>Vl,writeScriptsToDir:()=>uc});module.exports=P$(I3);var jo=class{constructor(e,t){this.fileSystem=e;this.parserRegistry=t}directory;setDirectory(e){this.directory=e}async loadAll(){return this.directory?this.loadDirectory(this.directory):[]}async load(e,t={}){let n=await this.fileSystem.readFile(e);if(t.format){let s=this.parserRegistry.get(t.format);if(!s)throw new Error(`No parser registered for format: ${t.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,t=["*.json","*.forge.json"]){let n=[],i=await this.fileSystem.glob(t,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 t=await this.fileSystem.readFile(e);return this.parserRegistry.detect(t)!==null}catch{return!1}}getSupportedFormats(){return this.parserRegistry.getFormats()}};var we=Se(require("fs")),qe=Se(require("path"));function _t(r){return r.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function rt(r){let e=Date.now().toString(36)+Math.random().toString(36).substr(2,9);return r?`${_t(r)}_${e}`:e}function yh(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}function cl(r,e){let t={},n={};for(let[i,s]of Object.entries(r)){let a=i.toLowerCase();n[a]=i,t[i]=s}for(let[i,s]of Object.entries(e)){let a=i.toLowerCase(),u=n[a];u&&delete t[u],n[a]=i,t[i]=s}return t}function WC(r){return JSON.parse(JSON.stringify(r))}function YC(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function JC(r,e){try{return JSON.parse(r)}catch{return e}}function zC(r){if(r===0)return"0 B";let e=1024,t=["B","KB","MB","GB"],n=Math.floor(Math.log(r)/Math.log(e));return`${parseFloat((r/Math.pow(e,n)).toFixed(1))} ${t[n]}`}function KC(r){return r<1e3?`${r} ms`:`${(r/1e3).toFixed(2)} s`}var nt=Se(require("fs")),Dn=Se(require("path")),ac={preRequest:"pre-request.js",postResponse:"post-response.js"},Or={collection:"collection.json",folder:"folder.json",request:"request.json"},_v={"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"}},fl={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},zr="scripts";function lc(r){if(!nt.existsSync(r))return;let e={},t=Dn.join(r,ac.preRequest);nt.existsSync(t)&&(e.preRequest=nt.readFileSync(t,"utf-8"));let n=Dn.join(r,ac.postResponse);return nt.existsSync(n)&&(e.postResponse=nt.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function uc(r,e){await nt.promises.mkdir(r,{recursive:!0});let t=Dn.join(r,ac.preRequest);e.preRequest?await nt.promises.writeFile(t,e.preRequest,"utf-8"):nt.existsSync(t)&&await nt.promises.unlink(t);let n=Dn.join(r,ac.postResponse);e.postResponse?await nt.promises.writeFile(n,e.postResponse,"utf-8"):nt.existsSync(n)&&await nt.promises.unlink(n)}function wv(r){for(let[e,t]of Object.entries(_v)){let n=Dn.join(r,e);if(nt.existsSync(n))try{let i=nt.readFileSync(n,"utf-8"),s;if(t.type==="graphql")try{s=JSON.parse(i)}catch{s=i}else s=i;return{type:t.type,format:t.format,content:s}}catch(i){console.error(`[FolderIO] Failed to load body from ${n}:`,i)}}}function Cv(r){if(!r||r.type==="none")return{bodyForMetadata:r};if(r.type==="raw"){let e=r.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 r.content=="string"?r.content:JSON.stringify(r.content,null,2):String(r.content||"");return{bodyForMetadata:{type:r.type,format:r.format},externalBodyFile:{filename:n,content:i}}}}if(r.type==="graphql"){let e=typeof r.content=="string"?r.content:JSON.stringify(r.content,null,2);return{bodyForMetadata:{type:r.type},externalBodyFile:{filename:"body.graphql",content:e}}}return{bodyForMetadata:r}}async function Ev(r,e){for(let t of Object.keys(_v))if(t!==e){let n=Dn.join(r,t);if(nt.existsSync(n))try{await nt.promises.unlink(n)}catch{}}}function xv(r){if(nt.existsSync(r))try{let e=nt.readFileSync(r,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${r}:`,e);return}}async function Rv(r,e,t){let n=Dn.join(r,fl.responseSchema),i=Dn.join(r,fl.bodySchema);e?await nt.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):nt.existsSync(n)&&await nt.promises.unlink(n),t?await nt.promises.writeFile(i,JSON.stringify(t,null,2),"utf-8"):nt.existsSync(i)&&await nt.promises.unlink(i)}function vh(r,e){for(let t of r){if(t.id===e)return t;if(t.type==="folder"&&t.items){let n=vh(t.items,e);if(n)return n}}}function Sh(r,e){for(let t=0;t<r.length;t++){let n=r[t];if(n.id===e)return r.splice(t,1),!0;if(n.type==="folder"&&n.items&&Sh(n.items,e))return!0}return!1}function Iv(r,e){let t=new Map(r.map(i=>[i.id,i])),n=[];for(let i of e){let s=t.get(i);s&&(n.push(s),t.delete(i))}for(let i of t.values())n.push(i);return n}function bh(r,e){let t;try{t=nt.readdirSync(r,{withFileTypes:!0})}catch{return}for(let n of t){if(!n.isDirectory()||n.name===zr)continue;if(n.name===e)return Dn.join(r,n.name);let i=bh(Dn.join(r,n.name),e);if(i)return i}}function mi(r,e=[]){let t=r.toLowerCase().trim(),n=t.match(/^(get|post|put|patch|delete|head|options)[_\s-]/i),i=n?n[1]:"",s=t.match(/t(\d+)/gi)||[],a=0;for(let S of s){let E=parseInt(S.substring(1));E>a&&(a=E)}let u="";if(a>0)u=`t${a}`;else{let S=t.match(/[_\s-](\d+\.\d+)[_\s-]/);S&&(u=`v${S[1].replace(".","_")}`)}let f=t;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),m=[];i&&m.push(i),m.push(...h),u&&m.push(u);let g=m.join("-");if(g||(g="item"),e.includes(g)){let S=2;for(;e.includes(`${g}-${S}`);)S++;g=`${g}-${S}`}return g}var Ji=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(){we.existsSync(this.collectionsDir)||we.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!we.existsSync(this.collectionsDir))return[];let e=we.readdirSync(this.collectionsDir,{withFileTypes:!0}),t=[];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),t.push(i))}catch(i){console.error(`[FolderCollectionStore] Failed to load ${n.name}:`,i)}return t}loadCollectionFromFolder(e){let t=qe.join(this.collectionsDir,e),n=qe.join(t,Or.collection);if(we.existsSync(n))try{let i=we.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(qe.join(t,zr)),u=this.loadItemsFromDir(t,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,t,n){let i=[],s=new Map,a=we.readdirSync(e,{withFileTypes:!0});for(let u of a){if(!u.isDirectory()||u.name===zr)continue;let f=qe.join(e,u.name);if(we.existsSync(qe.join(f,Or.folder))){let h=this.loadFolderFromDir(f,u.name);h&&s.set(u.name,h)}else if(we.existsSync(qe.join(f,Or.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,t){let n=qe.join(e,Or.folder);try{let i=we.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(qe.join(e,zr)),u=this.loadItemsFromDir(e,s.id,s.order);return this.slugToIdMap.set(t,s.id),this.idToSlugMap.set(s.id,t),{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,t){let n=qe.join(e,Or.request);try{let i=we.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(qe.join(e,zr)),u=s.body,f=this.loadBodyFromDir(e);f&&(u=f);let h=this.loadSchemaFile(qe.join(e,fl.responseSchema)),m=this.loadSchemaFile(qe.join(e,fl.bodySchema)),g=qe.join(e,"doc.md"),S=we.existsSync(g)?we.readFileSync(g,"utf-8"):void 0;return this.slugToIdMap.set(t,s.id),this.idToSlugMap.set(s.id,t),{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},...m&&{bodySchema:m}}}catch(i){console.error(`[FolderCollectionStore] Failed to load request ${e}:`,i);return}}loadScriptsFromDir(e){return lc(e)}loadBodyFromDir(e){return wv(e)}loadSchemaFile(e){return xv(e)}async saveSchemaFiles(e,t){return Rv(e,t.responseSchema,t.bodySchema)}load(e){if(this.cache.has(e))return this.cache.get(e);let t=this.idToSlugMap.get(e);if(t){let n=this.loadCollectionFromFolder(t);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=rt(e.name));let t=this.idToSlugMap.get(e.id);if(!t){let s=we.readdirSync(this.collectionsDir);t=mi(e.name,s),this.idToSlugMap.set(e.id,t),this.slugToIdMap.set(t,e.id)}let n=qe.join(this.collectionsDir,t);await we.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 we.promises.writeFile(qe.join(n,Or.collection),JSON.stringify(i,null,2),"utf-8"),e.scripts&&await this.saveScriptsToDir(qe.join(n,zr),e.scripts),await this.saveItemsToDir(n,e.items),this.cache.set(e.id,e)}async saveItemsToDir(e,t){let n=[];for(let i of t){let s=this.idToSlugMap.get(i.id);s||(s=mi(i.name,n),this.idToSlugMap.set(i.id,s),this.slugToIdMap.set(s,i.id)),n.push(s);let a=qe.join(e,s);await we.promises.mkdir(a,{recursive:!0}),i.type==="folder"?await this.saveFolderToDir(a,i):await this.saveRequestToDir(a,i)}}async saveFolderToDir(e,t){let n={id:t.id,name:t.name,description:t.description,auth:t.auth};await we.promises.writeFile(qe.join(e,Or.folder),JSON.stringify(n,null,2),"utf-8"),t.scripts&&await this.saveScriptsToDir(qe.join(e,zr),t.scripts),t.items&&await this.saveItemsToDir(e,t.items)}async saveRequestToDir(e,t){let{bodyForMetadata:n,externalBodyFile:i}=this.prepareBodyForSave(t.body),s={id:t.id,name:t.name,method:t.method||"GET",url:t.url||"",description:t.description,params:t.params,query:t.query,headers:t.headers,body:n,auth:t.auth,settings:t.settings,...t.deprecated&&{deprecated:t.deprecated}};await we.promises.writeFile(qe.join(e,Or.request),JSON.stringify(s,null,2),"utf-8"),i&&await we.promises.writeFile(qe.join(e,i.filename),i.content,"utf-8"),await this.cleanupOldBodyFiles(e,i?.filename),await this.saveSchemaFiles(e,t),t.doc&&await we.promises.writeFile(qe.join(e,"doc.md"),t.doc,"utf-8"),t.scripts&&await this.saveScriptsToDir(qe.join(e,zr),t.scripts)}prepareBodyForSave(e){return Cv(e)}async cleanupOldBodyFiles(e,t){return Ev(e,t)}async saveScriptsToDir(e,t){return uc(e,t)}async delete(e){let t=this.idToSlugMap.get(e);if(!t&&(this.loadAll(),t=this.idToSlugMap.get(e),!t))return!1;let n=qe.join(this.collectionsDir,t);if(!we.existsSync(n))return!1;try{return await we.promises.rm(n,{recursive:!0,force:!0}),this.cache.delete(e),this.idToSlugMap.delete(e),this.slugToIdMap.delete(t),!0}catch(i){return console.error(`[FolderCollectionStore] Failed to delete collection ${e}:`,i),!1}}exists(e){let t=this.idToSlugMap.get(e);return t?we.existsSync(qe.join(this.collectionsDir,t,Or.collection)):!1}getCollectionPath(e){let t=this.idToSlugMap.get(e)||e;return qe.join(this.collectionsDir,t)}getItemPath(e,t){return this.findItemPath(e,t)}async create(e,t){let n={id:t||rt(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,t,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemPath(e,t);if(!s)throw new Error(`Item ${t} not found in collection ${e}`);await this.saveScriptsToDir(qe.join(s,zr),n);let a=this.findItemById(i.items,t);a&&(a.scripts=n)}loadScripts(e,t){let n=this.findItemPath(e,t);if(n)return this.loadScriptsFromDir(qe.join(n,zr))}async updateCollectionMetadata(e,t){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=qe.join(this.collectionsDir,i),a=qe.join(s,Or.collection),u=we.readFileSync(a,"utf-8"),h={...JSON.parse(u),...t,id:e};await we.promises.writeFile(a,JSON.stringify(h,null,2),"utf-8"),t.name!==void 0&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.version!==void 0&&(n.version=t.version),t.variables!==void 0&&(n.variables=t.variables),t.auth!==void 0&&(n.auth=t.auth)}async saveItem(e,t,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 m=this.findItemPath(e,n);if(!m)throw new Error(`Parent folder ${n} not found`);a=m}else a=qe.join(this.collectionsDir,s);let u=this.idToSlugMap.get(t.id);if(!u){let m=we.readdirSync(a).filter(g=>we.statSync(qe.join(a,g)).isDirectory()&&g!==zr);u=mi(t.name,m),this.idToSlugMap.set(t.id,u),this.slugToIdMap.set(u,t.id)}let f=qe.join(a,u);await we.promises.mkdir(f,{recursive:!0}),t.type==="folder"?await this.saveFolderToDir(f,t):await this.saveRequestToDir(f,t);let h=this.findItemById(i.items,t.id);if(h)Object.assign(h,t);else if(n){let m=this.findItemById(i.items,n);m&&m.type==="folder"&&(m.items=m.items||[],m.items.push(t))}else i.items.push(t)}async deleteItem(e,t){let n=this.load(e);if(!n)return!1;let i=this.findItemPath(e,t);if(!i||!we.existsSync(i))return!1;try{await we.promises.rm(i,{recursive:!0,force:!0}),this.deleteItemFromTree(n.items,t);let s=this.idToSlugMap.get(t);return s&&(this.slugToIdMap.delete(s),this.idToSlugMap.delete(t)),!0}catch(s){return console.error(`[FolderCollectionStore] Failed to delete item ${t}:`,s),!1}}async updateItem(e,t,n){let i=this.load(e);if(!i)return!1;let s=this.findItemPath(e,t);if(!s)return!1;let a=this.findItemById(i.items,t);if(!a)return!1;let{id:u,type:f,items:h,...m}=n;return Object.assign(a,m),a.type==="folder"?await this.saveFolderToDir(s,a):await this.saveRequestToDir(s,a),!0}async moveItem(e,t,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,t);if(!a||!we.existsSync(a))return!1;let u;if(n){let m=this.findItemPath(e,n);if(!m)return!1;u=m}else u=qe.join(this.collectionsDir,s);let f=this.idToSlugMap.get(t);if(!f)return!1;let h=qe.join(u,f);if(we.existsSync(h))return!1;try{await we.promises.rename(a,h);let m=this.findItemById(i.items,t);if(m){let g=m.type==="folder"?{...m,items:m.items?[...m.items]:[]}:{...m};if(this.deleteItemFromTree(i.items,t),n){let S=this.findItemById(i.items,n);S&&S.type==="folder"&&(S.items=S.items||[],S.items.push(g))}else i.items.push(g)}return!0}catch(m){return console.error(`[FolderCollectionStore] Failed to move item ${t}:`,m),!1}}async reorderItems(e,t,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(t){let u=this.findItemPath(e,t);if(!u)return!1;let f=qe.join(u,Or.folder),h=we.readFileSync(f,"utf-8"),m=JSON.parse(h);m.order=a,await we.promises.writeFile(f,JSON.stringify(m,null,2),"utf-8");let g=this.findItemById(i.items,t);g&&g.type==="folder"&&g.items&&(g.items=this.sortItemsByOrder(g.items,n))}else{let u=qe.join(this.collectionsDir,s,Or.collection),f=we.readFileSync(u,"utf-8"),h=JSON.parse(f);h.order=a,await we.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,t){return Iv(e,t)}findItemPath(e,t){let n=this.idToSlugMap.get(e);if(!n)return;let i=this.idToSlugMap.get(t);if(i)return bh(qe.join(this.collectionsDir,n),i)}findItemById(e,t){return vh(e,t)}deleteItemFromTree(e,t){return Sh(e,t)}};function Ov(r,e){return{id:r.id,name:r.name,description:r.description,variables:r.variables||{},auth:r.auth,scripts:r.scripts,items:(r.items||[]).map(GC),source:{format:"folder",filePath:e,version:r.version}}}function GC(r){if(r.type==="folder")return{type:"folder",id:r.id,name:r.name,description:r.description,auth:r.auth,scripts:r.scripts,items:(r.items||[]).map(GC)};let e=r;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 k$(r){return{id:r.id,name:r.name,description:r.description,version:r.source?.version,variables:r.variables,auth:r.auth,scripts:r.scripts,items:(r.items||[]).map(Pv)}}function Pv(r){return r.type==="folder"?{type:"folder",id:r.id,name:r.name,description:r.description,auth:r.auth,scripts:r.scripts,items:(r.items||[]).map(Pv)}:{type:"request",id:r.id,name:r.name,description:r.description,method:r.method,url:r.url,headers:r.headers,query:r.query,params:r.params,body:r.body,auth:r.auth,settings:r.settings,scripts:r.scripts,...r.deprecated&&{deprecated:r.deprecated},...r.doc&&{doc:r.doc}}}var dl=class{store;constructor(e){this.store=new Ji(e)}loadAll(){return this.store.loadAll().map(t=>Ov(t,this.store.getCollectionPath(t.id)))}getSlugById(e){return this.store.getSlugById(e)}getIdBySlug(e){return this.store.getIdBySlug(e)}load(e){let t=this.store.load(e);if(t)return Ov(t,this.store.getCollectionPath(t.id))}async create(e,t){let n=await this.store.create(e,t);return Ov(n,this.store.getCollectionPath(n.id))}async save(e){return this.store.save(k$(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,t){return this.store.updateCollectionMetadata(e,t)}async saveItem(e,t,n){return this.store.saveItem(e,Pv(t),n)}async updateItem(e,t,n){let i={...n};return this.store.updateItem(e,t,i)}async deleteItem(e,t){return this.store.deleteItem(e,t)}async moveItem(e,t,n){return this.store.moveItem(e,t,n)}async reorderItems(e,t,n){return this.store.reorderItems(e,t,n)}async saveScripts(e,t,n){return this.store.saveScripts(e,t,n)}loadScripts(e,t){return this.store.loadScripts(e,t)}};var hl=class{parsers=new Map;register(e,t){this.parsers.set(e.toLowerCase(),t)}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[t,n]of this.parsers)if(n.canParse(e))return{parser:n,format:t};return null}clear(){this.parsers.clear()}};var ot=class{static parseSetCookie(e,t){let n=e.split(";").map(m=>m.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:t};for(let m of s){let g=m.indexOf("="),S=(g===-1?m:m.substring(0,g)).toLowerCase(),E=g===-1?"":m.substring(g+1);switch(S){case"domain":h.domain=E.startsWith(".")?E.substring(1):E;break;case"path":h.path=E;break;case"expires":h.expires=E;break;case"max-age":h.maxAge=parseInt(E,10);break;case"httponly":h.httpOnly=!0;break;case"secure":h.secure=!0;break;case"samesite":h.sameSite=E;break}}return h}static parseCookieHeaders(e,t){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,t);u&&n.push(u)}return n}static formatCookieHeader(e){return e.map(t=>`${t.name}=${t.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,t){if(t==="*")return!0;let n=e.toLowerCase().split(".").reverse(),i=t.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 pl=class{cookies=new Map;getCookieKey(e,t,n){return`${t||"*"}|${n||"/"}|${e}`}get(e,t){if(t){let s=this.getCookieKey(e,t),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(t&&s.domain){if(this.domainMatches(t,s.domain))return s}else return s}set(e){let t=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(t,e)}setFromResponse(e){for(let t of e){let n=this.getCookieKey(t.name,t.domain,t.path);this.cookies.set(n,t)}}has(e,t){return this.get(e,t)!==void 0}delete(e,t,n){let i=this.getCookieKey(e,t,n);return this.cookies.delete(i)}getAll(e){let t=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&t.push(n):t.push(n));return t}getCookieHeader(e){let t=this.getAll(e);return ot.formatCookieHeader(t)}clear(){this.cookies.clear()}clearDomain(e){let t=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&t.push(n);for(let n of t)this.cookies.delete(n)}parseCookieHeaders(e,t){return ot.parseCookieHeaders(e,t)}isExpired(e){return ot.isExpired(e)}domainMatches(e,t){return ot.domainMatches(e,t)}get count(){return this.cookies.size}cleanExpiredCookies(){let e=[];for(let[t,n]of this.cookies.entries())this.isExpired(n)&&e.push(t);for(let t of e)this.cookies.delete(t)}};var $s=Se(require("fs")),Uo=Se(require("path"));function cc(r){let e=r.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function ml(r){if(!$s.existsSync(r))return A$();let e=_h(Uo.join(r,"_global.json"))||{},t=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=$s.readdirSync(r).filter(h=>h.endsWith(".json")).filter(h=>!h.endsWith(".local.json")).filter(h=>!cc(h)),s={};for(let h of i){let m=_h(Uo.join(r,h))||{},g=Uo.basename(h,".json");s[g]={description:m.description,requiresConfirmation:m.requiresConfirmation,variables:m.variables||{}}}let u=(_h(Uo.join(r,"_global.local.json"))||{}).variables||{},f={};for(let h of Object.keys(s)){let m=Uo.join(r,`${h}.local.json`);if($s.existsSync(m)){let g=_h(m)||{};f[h]={variables:g.variables||{}}}}return{globalVariables:t,defaultHeaders:n,environments:s,localVariables:u,localCredentials:f}}function A$(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function _h(r){try{if(!$s.existsSync(r))return null;let e=$s.readFileSync(r,"utf-8");return JSON.parse(e)}catch(e){return console.error(`[environment-file-loader] Failed to load JSON from ${r}:`,e),null}}var gi=class r{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,t){let n=this.sessionEnvironmentValues.get(this.selectedEnvironment);n||(n={},this.sessionEnvironmentValues.set(this.selectedEnvironment,n)),n[e]=t}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 t=e||this.selectedEnvironment,n=this.config.environments[t],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(t);s&&(i={...i,...s})}return i}getEnvironmentVariables(e){let t=this.config.environments[e];if(!t)return{};let n={};return t.inherits&&this.config.environments[t.inherits]&&(n={...this.getEnvironmentVariables(t.inherits)}),{...n,...t.variables}}getGlobals(){return{...this.config.globalVariables||{},...this.sessionGlobals}}setGlobal(e,t){this.sessionGlobals[e]=t}resolve(e){let t=e||this.selectedEnvironment;return{name:t,merged:this.getVariables(t),globals:this.getGlobals()}}static fromVariables(e,t="default"){return new r({environments:{[t]:{name:t,variables:e}},selectedEnvironment:t})}};var cn=class{buildUrl(e,t={},n={}){let i=e;return i=this.replacePathParams(i,t),i=this.appendQueryParams(i,n),i}replacePathParams(e,t){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,m=s.replace(h,(g,S,E)=>{let C=t[S];return C!==void 0&&C!==""?encodeURIComponent(C):E?"":(console.warn(`[UrlBuilder] Missing required path parameter: ${S}`),g)});return m=m.replace(/([^:])\/+/g,"$1/"),m.length>1&&m.endsWith("/")&&(m=m.slice(0,-1)),`${n}${i}${m}${a}`}extractPathParams(e){let t=/:(\w+)(?:\([^)]*\))?(\?)?/g,n=[],i;for(;(i=t.exec(e))!==null;)n.push(i[1]);return[...new Set(n)]}appendQueryParams(e,t){let n=e,i={};if(e.includes("?")){let[f,h]=e.split("?");n=f,h&&new URLSearchParams(h).forEach((g,S)=>{i[S]=g})}let s={...i,...t},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}};var QC=Se(require("crypto")),Ch=new Uint8Array(256),wh=Ch.length;function kv(){return wh>Ch.length-16&&(QC.default.randomFillSync(Ch),wh=0),Ch.slice(wh,wh+=16)}var Gt=[];for(let r=0;r<256;++r)Gt.push((r+256).toString(16).slice(1));function ZC(r,e=0){return Gt[r[e+0]]+Gt[r[e+1]]+Gt[r[e+2]]+Gt[r[e+3]]+"-"+Gt[r[e+4]]+Gt[r[e+5]]+"-"+Gt[r[e+6]]+Gt[r[e+7]]+"-"+Gt[r[e+8]]+Gt[r[e+9]]+"-"+Gt[r[e+10]]+Gt[r[e+11]]+Gt[r[e+12]]+Gt[r[e+13]]+Gt[r[e+14]]+Gt[r[e+15]]}var XC=Se(require("crypto")),Av={randomUUID:XC.default.randomUUID};function T$(r,e,t){if(Av.randomUUID&&!e&&!r)return Av.randomUUID();r=r||{};let n=r.random||(r.rng||kv)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){t=t||0;for(let i=0;i<16;++i)e[t+i]=n[i];return e}return ZC(n)}var gl=T$;function q$(r=0,e=999){return Math.floor(Math.random()*(e-r+1))+r}function N$(){return Date.now()}function eE(){return gl()}function M$(){return gl()}function tE(r=10){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t="";for(let n=0;n<r;n++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}function $$(){let r=tE(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${r}@${e[Math.floor(Math.random()*e.length)]}`}function D$(){return Math.random()<.5}function F$(r=10){let e="0123456789abcdef",t="";for(let n=0;n<r;n++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}function L$(){return Math.floor(Date.now()/1e3)}function j$(){return new Date().toISOString()}function U$(){return new Date().toISOString().split("T")[0]}function B$(){return new Date().toISOString().split("T")[1].split(".")[0]}function H$(){return new Date().toISOString()}function V$(r=""){return Buffer.from(String(r)).toString("base64")}function W$(r=""){return Buffer.from(String(r),"base64").toString("utf-8")}function Y$(r=""){return encodeURIComponent(String(r))}function J$(r=""){return decodeURIComponent(String(r))}var Tv={randomInt:q$,timestamp:N$,guid:M$,uuid:eE,randomUUID:eE,randomString:tE,randomHexadecimal:F$,randomEmail:$$,randomBoolean:D$,isoTimestamp:H$,timestamp_s:L$,datetime:j$,date:U$,time:B$,base64Encode:V$,base64Decode:W$,urlEncode:Y$,urlDecode:J$};function z$(r){return r?r.split(",").map(e=>{let t=e.trim(),n=Number(t);return!isNaN(n)&&t!==""?n:t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t}):[]}function yi(r,e){let t=Tv[r];return t?e&&e.length>0?t(...e):t():null}function rE(r){return!r||typeof r!="string"?r:r.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,t,n)=>{try{let i=n?z$(n):void 0,s=yi(t,i);return s===null?e:String(s)}catch{return e}})}function Ds(r,e){let t=/\$([a-zA-Z_][a-zA-Z0-9_]*)/g,n=null,i;for(;(i=t.exec(r))!==null;){let s=i[0],a=i[1];if(!(s in e)){let u=yi(a);u!==null&&(n||(n={...e}),n[s]=u)}}return n??e}var Eh=Se(require("vm")),K$=100;function Fs(r){let e=r.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function Ls(r,e={}){try{let t={...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=Eh.createContext(t);return Eh.runInContext(r,n,{timeout:K$,displayErrors:!1})}catch{return}}var xh=Se(require("crypto"));function yl(r){if(!r||!r.includes("|"))return null;let e=G$(r);if(e.length<2)return null;let t=e[0].trim(),n=[];for(let i=1;i<e.length;i++){let s=e[i].trim();if(!s)continue;let a=Q$(s);a&&n.push(a)}return n.length===0?null:{input:t,filters:n}}function G$(r){let e=[],t="",n=0,i=!1,s=!1;for(let a=0;a<r.length;a++){let u=r[a],f=a>0?r[a-1]:"",h=a<r.length-1?r[a+1]:"";if(f==="\\"){t+=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==="|"){t+="||",a++;continue}e.push(t),t="";continue}t+=u}return t&&e.push(t),e}function Q$(r){let e=r.indexOf("(");if(e===-1)return{name:r.trim(),args:[]};let t=r.substring(0,e).trim(),n=r.substring(e+1,r.lastIndexOf(")"));return{name:t,args:Z$(n)}}function Z$(r){if(!r||!r.trim())return[];let e=[],t="",n=!1,i=!1;for(let s=0;s<r.length;s++){let a=r[s];if((s>0?r[s-1]:"")==="\\"){t+=a;continue}if(a==="'"&&!i){n=!n,t+=a;continue}else if(a==='"'&&!n){i=!i,t+=a;continue}else if(a===","&&!n&&!i){e.push(t.trim()),t="";continue}t+=a}return t.trim()&&e.push(t.trim()),e}function It(r,e){if(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))return r.slice(1,-1);let t=Number(r);if(!isNaN(t)&&r!=="")return t;if(r==="true")return!0;if(r==="false")return!1;if(e&&r in e){let n=e[r],i=Number(n);return!isNaN(i)&&n!==""?i:n}return r}function vl(r,e,t={}){let n=r;for(let i of e)n=X$(n,i.name,i.args,t);return n}function X$(r,e,t,n){switch(e){case"upper":return String(r).toUpperCase();case"lower":return String(r).toLowerCase();case"trim":return String(r).trim();case"length":return Array.isArray(r)?r.length:String(r).length;case"substring":{let i=It(t[0],n),s=t[1]!==void 0?It(t[1],n):void 0;return String(r).substring(i<0?String(r).length+i:i,s!==void 0?s<0?String(r).length+s:s:void 0)}case"replace":{let i=t[0]!==void 0?String(It(t[0],n)):"",s=t[1]!==void 0?String(It(t[1],n)):"";return String(r).replace(new RegExp(tD(i),"g"),s)}case"split":{let i=t[0]!==void 0?String(It(t[0],n)):",";return String(r).split(i)}case"join":{let i=t[0]!==void 0?String(It(t[0],n)):",";return Array.isArray(r)?r.join(i):String(r)}case"removeQuotes":return String(r).replace(/["']/g,"");case"removeSpaces":return String(r).replace(/\s/g,"");case"format":{let i=t[0]!==void 0?String(It(t[0],n)):"{0}";i=i.replace("{0}",String(r));for(let s=1;s<t.length;s++){let a=It(t[s],n);i=i.replace(`{${s}}`,String(a))}return i}case"add":{let i=It(t[0],n);return Number(r)+i}case"subtract":{let i=It(t[0],n);return Number(r)-i}case"multiply":{let i=It(t[0],n);return Number(r)*i}case"abs":return Math.abs(Number(r));case"btoa":return Buffer.from(String(r)).toString("base64");case"atob":return Buffer.from(String(r),"base64").toString("utf-8");case"urlEncode":return encodeURIComponent(String(r));case"urlDecode":return decodeURIComponent(String(r));case"hash":{let i=String(t[0]!==void 0?It(t[0],n):"md5").toLowerCase(),s=String(t[1]!==void 0?It(t[1],n):"base64"),u={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return xh.createHash(u).update(String(r)).digest(s)}case"hmac":{let i=t[0]?String(It(t[0],n)):"",s=String(t[1]!==void 0?It(t[1],n):"sha256").toLowerCase(),a=String(t[2]!==void 0?It(t[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return xh.createHmac(f,i).update(String(r)).digest(a)}case"first":return Array.isArray(r)?r[0]:r;case"last":return Array.isArray(r)?r[r.length-1]:r;case"at":{let i=It(t[0],n);return Array.isArray(r)?r.at(i):r}case"slice":{let i=It(t[0],n),s=t[1]!==void 0?It(t[1],n):void 0;return Array.isArray(r)?r.slice(i,s):String(r).slice(i,s)}case"unique":return Array.isArray(r)?[...new Set(r)]:r;case"filter":return!Array.isArray(r)||!t[0]?r:eD(r,t[0],n);case"map":{if(!Array.isArray(r))return r;let i=t.map(s=>String(It(s,n)));return i.length===1?r.map(s=>fc(s,i[0])):r.map(s=>{let a={};for(let u of i){let f=fc(s,u);f!==void 0&&(a[u]=f)}return a})}case"prop":{let i=t[0]!==void 0?String(It(t[0],n)):"";if(Array.isArray(r)){let s=r.map(a=>fc(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return r&&typeof r=="object"?fc(r,i):r}case"parseJSON":try{return JSON.parse(String(r))}catch{return r}case"stringify":try{return JSON.stringify(r)}catch{return String(r)}case"isEmail":return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(r));case"isUrl":try{return new URL(String(r)),!0}catch{return!1}case"setIfValue":return r||void 0;case"setNull":return r===null?null:r;default:return r}}function eD(r,e,t){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return r;let[,i,s,a]=n,u=It(a,t);return r.filter(f=>{let h=fc(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 fc(r,e){if(!(!r||typeof r!="object"))return e in r?r[e]:e.split(".").reduce((t,n)=>t?.[n],r)}function tD(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nE(r,e){if(r)return r.split(",").map(t=>{let n=t.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 js=class{allVariables;constructor(e){this.allVariables={...e.globals,...e.collectionVariables,...e.environmentVariables,...e.sessionVariables,...e.variables}}resolveString(e,t=!1){if(typeof e!="string")return e;if(!t)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,t,n=!1){if(typeof e!="string")return e;let i={...this.allVariables,...t};if(!n)return e.replace(/\{\{([^}]+)\}\}/g,(h,m)=>this.resolveTemplateContent(m.trim(),i,h));let s="",a=0,u=/\{\{([^}]+)\}\}/g,f;for(;(f=u.exec(e))!==null;){let h=f[1].trim(),m=this.resolveTemplateContent(h,i,f[0]);if(m!==f[0]){s+=e.slice(a,f.index);let g=this.getStringContext(e,f.index);s+=g?this.escapeForString(String(m),g):String(m)}else s+=e.slice(a,f.index+f[0].length);a=f.index+f[0].length}return s+=e.slice(a),s}resolveObject(e,t=!1){if(typeof e=="string")return this.resolveString(e,t);if(Array.isArray(e))return e.map(n=>this.resolveObject(n,t));if(e!==null&&typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.resolveObject(s,t);return n}return e}resolveObjectWithExtra(e,t,n=!1){if(typeof e=="string")return this.resolveStringWithExtra(e,t,n);if(Array.isArray(e))return e.map(i=>this.resolveObjectWithExtra(i,t,n));if(e!==null&&typeof e=="object"){let i={};for(let[s,a]of Object.entries(e))i[s]=this.resolveObjectWithExtra(a,t,n);return i}return e}resolveTemplateContent(e,t,n){let i=e.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(i){let u=nE(i[2],t),f=yi(i[1],u);return f!==null?String(f):n}let s=yl(e);if(s){let u=this.resolveFilterInput(s.input,t);if(u!==void 0){let f=vl(u,s.filters,t);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(t[u]!==void 0){let f=this.deserializeValue(t[u]),h=a[2],m=this.resolvePropertyAccess(f,h);if(m!==void 0)return typeof m=="object"?JSON.stringify(m):String(m)}}if(t[e]!==void 0){let u=t[e];return typeof u=="string"&&u.charCodeAt(0)===30?u.slice(1):String(u)}if(Fs(e)){let u=this.deserializeVariables(t),f=Ds(e,u),h=Ls(e,f);if(h!==void 0)return String(h)}return n}resolveFilterInput(e,t){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=nE(n[2],t),a=yi(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(t[s]!==void 0){let a=this.deserializeValue(t[s]),u=this.resolvePropertyAccess(a,i[2]);if(u!==void 0)return u}}if(t[e]!==void 0)return this.deserializeValue(t[e]);if(Fs(e)){let s=this.deserializeVariables(t),a=Ds(e,s),u=Ls(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 t={};for(let[n,i]of Object.entries(e))t[n]=this.deserializeValue(i);return t}resolvePropertyAccess(e,t){let n=e,i=/\[(\d+|"[^"]*"|'[^']*')\]|\.([a-zA-Z_][a-zA-Z0-9_]*)/g,s;for(;(s=i.exec(t))!==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,t){let n=e.replace(/\\/g,"\\\\");return t==='"'?n=n.replace(/"/g,'\\"'):n=n.replace(/'/g,"\\'"),n.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}getStringContext(e,t){let n=null;for(let i=0;i<t;i++){let s=e[i];(i>0?e[i-1]:"")!=="\\"&&(s==='"'||s==="'")&&(n===null?n=s:n===s&&(n=null))}return n}},Us=class{interpolate(e,t){return!e||typeof e!="string"?e:new js({globals:{},collectionVariables:{},environmentVariables:{},sessionVariables:{},variables:t}).resolveString(e,!0)}extractVariables(e){if(!e||typeof e!="string")return[];let t=[],n,i=/\{\{([^}]+)\}\}/g;for(;(n=i.exec(e))!==null;){let s=n[1].trim();!s.startsWith("$")&&!s.includes("|")&&/^[a-zA-Z_]\w*$/.test(s)&&(t.includes(s)||t.push(s))}return t}interpolateObject(e,t){if(e==null)return e;if(typeof e=="string")return this.interpolate(e,t);if(Array.isArray(e))return e.map(n=>this.interpolateObject(n,t));if(typeof e=="object"){let n={};for(let[i,s]of Object.entries(e))n[i]=this.interpolateObject(s,t);return n}return e}};function iE(r){return new js(r)}var zi=class r{envStore;interpolator;urlBuilder;constructor(e,t){this.envStore=e,this.interpolator=t||new Us,this.urlBuilder=new cn}get(e){return this.envStore.get(e)}set(e,t){this.envStore.set(e,t)}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,t={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,t)}buildUrl(e,t={}){let n=this.interpolator.interpolate(e,this.getAll());return this.urlBuilder.buildUrl(n,t.params||{},t.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 t=gi.fromVariables(e);return new r(t)}static fromResolver(e){return new r(e)}};var rD=Se(require("http")),dc=Se(require("https")),qv=require("url"),Rh=Se(require("zlib")),fn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Bs=class{settings;version;constructor(e){this.settings={...fn,...e};try{this.version=require("../../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 t=this.mergeSettings(e.settings);return await this.executeInternal(e,t,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,t,n,i){let s=Date.now(),a=new qv.URL(e.url),u=a.protocol==="https:",f=this.sanitizeHeaders(e.headers||{});Object.keys(f).some(g=>g.toLowerCase()==="user-agent")||(f["User-Agent"]=`HttpForge/${this.version}`);let m={hostname:a.hostname,port:a.port||(u?443:80),path:a.pathname+a.search,method:e.method,headers:{...f},timeout:t.timeout||void 0};return t.decompress&&!f["accept-encoding"]&&!f["Accept-Encoding"]&&(m.headers["Accept-Encoding"]="gzip, deflate"),u&&(m.rejectUnauthorized=t.strictSSL,t.strictSSL?m.agent=dc.globalAgent:m.agent=new dc.Agent({rejectUnauthorized:!1})),new Promise((g,S)=>{if(i?.aborted){let x=new Error("Request cancelled");x.name="AbortError",S(x);return}let C=(u?dc:rD).request(m,async x=>{let A=x.statusCode||0;if(t.followRedirects&&[301,302,303,307,308].includes(A)){if(n>=t.maxRedirects){S(new Error(`Maximum redirects (${t.maxRedirects}) exceeded`));return}let j=x.headers.location;if(!j){S(new Error("Redirect response missing Location header"));return}let Y=new qv.URL(j,e.url).toString(),V=e.method;!t.followOriginalMethod&&[301,302,303].includes(A)&&(V="GET");let K={...e.headers};t.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},t,n+1,i),k=Date.now();ee.time=k-s,g(ee)}catch(ee){S(ee)}return}let q=[];x.on("data",j=>q.push(j)),x.on("end",()=>{let j=Date.now(),Y=Buffer.concat(q),V=x.headers["content-encoding"];if(t.decompress&&V)try{V==="gzip"?Y=Rh.gunzipSync(Y):V==="deflate"&&(Y=Rh.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,$]of Object.entries(x.headers))(typeof $=="string"||Array.isArray($))&&(k[P]=$);let w=this.parseCookies(x.headers["set-cookie"],a.hostname);g({status:x.statusCode||0,statusText:x.statusMessage||"",headers:k,cookies:w,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 t={};for(let[n,i]of Object.entries(e))t[n]=this.sanitizeHeaderValue(String(i));return t}parseCookies(e,t){return e?e.map(n=>{let i=n.split(";").map(m=>m.trim()),[s,...a]=i,[u,f]=s.split("="),h={name:u.trim(),value:f?.trim()||"",domain:t};for(let m of a){let[g,S]=m.split("=");switch(g.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 Ih(r){return{timeout:r?.timeout??fn.timeout,followRedirects:r?.followRedirects??fn.followRedirects,followOriginalMethod:r?.followOriginalMethod??fn.followOriginalMethod,followAuthHeader:r?.followAuthHeader??fn.followAuthHeader,maxRedirects:r?.maxRedirects??fn.maxRedirects,strictSSL:r?.strictSSL??fn.strictSSL,decompress:r?.decompress??fn.decompress,includeCookies:r?.includeCookies??fn.includeCookies}}var vi=class{constructor(e,t,n){this.urlBuilder=e;this.interceptors=t;this.httpClient=n}async execute(e){let t=Ih(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:t});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,t={},n={}){return this.urlBuilder.buildUrl(e,t,n)}};var Si=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 t=this.requestInterceptors.findIndex(n=>n.name===e);return t>=0?(this.requestInterceptors.splice(t,1),!0):!1}removeResponseInterceptor(e){let t=this.responseInterceptors.findIndex(n=>n.name===e);return t>=0?(this.responseInterceptors.splice(t,1),!0):!1}removeErrorInterceptor(e){let t=this.errorInterceptors.findIndex(n=>n.name===e);return t>=0?(this.errorInterceptors.splice(t,1),!0):!1}async executeRequestInterceptors(e,t){let n=e;for(let i of this.requestInterceptors)try{n=await i.intercept(n,t)}catch(s){throw console.error(`[InterceptorChain] Request interceptor '${i.name}' failed:`,s),s}return n}async executeResponseInterceptors(e,t,n){let i=e;for(let s of this.responseInterceptors)try{i=await s.intercept(i,t,n)}catch(a){throw console.error(`[InterceptorChain] Response interceptor '${s.name}' failed:`,a),a}return i}async executeErrorInterceptors(e,t,n){for(let i of this.errorInterceptors)try{let s=await i.handle(e,t,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((t,n)=>(t.priority??100)-(n.priority??100))}},Oh=class{name="logging";priority=1e3;intercept(e,t){return e}},Ph=class{name="timing";priority=1;intercept(e,t,n){return e}},kh=class{name="retry";priority=1;maxRetries;retryableErrors;constructor(e=3,t=["ECONNRESET","ETIMEDOUT"]){this.maxRetries=e,this.retryableErrors=t}handle(e,t,n){let i=this.retryableErrors.some(s=>e.message.includes(s))}};var Xt=Se(require("crypto")),AU=Se(require("querystring")),LR=Se(require("vm"));var OU=Se(require("crypto")),Bc=Se(require("fs")),$R=require("module"),Ei=Se(require("path"));function Vc(){return{format:(r,e)=>{let t=r?new Date(r):new Date;return e==="YYYY-MM-DD"?t.toISOString().split("T")[0]:t.toISOString()},unix:()=>Math.floor(Date.now()/1e3),utc:()=>{let r=new Date;return{format:()=>r.toISOString(),toISOString:()=>r.toISOString()}},__isShim:!0,__warning:"This is a lightweight shim. For full features, install moment.js via modules/package.json"}}function Wc(){return{get:(r,e,t)=>{let n=e.split("."),i=r;for(let s of n)if(i=i?.[s],i===void 0)return t;return i},set:(r,e,t)=>{let n=e.split("."),i=r;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]]=t,r},cloneDeep:r=>JSON.parse(JSON.stringify(r))}}var Hc=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:gl}),crypto:()=>OU,path:()=>Ei,querystring:()=>require("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>sE(),Wc),moment:()=>this.loadOptionalModule("moment",()=>oE(),Vc),tv4:()=>this.loadOptionalModule("tv4",()=>lE()),ajv:()=>this.loadOptionalModule("ajv",()=>MR()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>require("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=[],t={}){this.options={allowCustomModules:!0,maxResolveDepth:10,...t,outputChannel:t.outputChannel||{appendLine:n=>{console.log(`[ModuleLoader] ${n}`)}}};for(let n of e)if(this.initializeModules(n)){this.modulesPath=n;break}}loadOptionalModule(e,t,n){try{return t()}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,t){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,Wm.ono)({status:i.status},`HTTP ${i.status} redirect with no location header`);{let s=Lf.resolve(t.href,i.headers.location);return B1(s,e,n)}}else{if(i.body){let s=await i.arrayBuffer();return Buffer.from(s)}return Buffer.alloc(0)}}catch(i){throw new U1.ResolverError((0,Wm.ono)(i,`Error downloading ${t.href}`),t.href)}}async function IG(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 fw=F(as=>{"use strict";var xu=as&&as.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(as,"__esModule",{value:!0});as.getNewOptions=as.getJsonSchemaRefParserDefaultOptions=void 0;var PG=xu(Sk()),kG=xu(N1()),AG=xu(M1()),TG=xu($1()),qG=xu(j1()),NG=xu(H1()),MG=()=>({parse:{json:{...PG.default},yaml:{...kG.default},text:{...AG.default},binary:{...TG.default}},resolve:{file:{...qG.default},http:{...NG.default},external:!0},continueOnError:!1,dereference:{circular:!0,excludedPathMatcher:()=>!1,referenceResolution:"relative"},mutateInputSchema:!0});as.getJsonSchemaRefParserDefaultOptions=MG;var $G=t=>{let e=(0,as.getJsonSchemaRefParserDefaultOptions)();return t&&W1(e,t),e};as.getNewOptions=$G;function W1(t,e){if(V1(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];V1(s)?t[i]=W1(a||{},s):s!==void 0&&(t[i]=s)}}return t}function V1(t){return t&&typeof t=="object"&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}});var J1=F(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});Ym.normalizeArgs=Y1;var DG=fw();function Y1(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,DG.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}}Ym.default=Y1});var z1=F(Kn=>{"use strict";var FG=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]}),LG=Kn&&Kn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),jG=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"&&FG(r,e,n[i]);return LG(r,e),r}}(),dw=Kn&&Kn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kn,"__esModule",{value:!0});var UG=dw(yu()),BG=dw(Pf()),HG=dw(I_()),Ru=jG(Sn()),VG=bn();function WG(t,e){if(!e.resolve?.external)return Promise.resolve();try{let r=hw(t.schema,t.$refs._root$Ref.path+"#",t.$refs,e);return Promise.all(r)}catch(r){return Promise.reject(r)}}function hw(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),UG.default.isExternal$Ref(t)&&a.push(YG(t,e,r,n));let u=Object.keys(t);for(let f of u){let h=BG.default.join(e,f),g=t[f];a=a.concat(hw(g,h,r,n,i,s))}}return a}async function YG(t,e,r,n){let i=n.dereference?.externalReferenceResolution==="root",s=Ru.resolve(i?Ru.cwd():e,t.$ref),a=Ru.stripHash(s),u=r._$refs[a];if(u)return Promise.resolve(u.value);try{let f=await(0,HG.default)(s,r,n),h=hw(f,a+"#",r,n,new Set,!0);return Promise.all(h)}catch(f){if(!n?.continueOnError||!(0,VG.isHandledError)(f))throw f;return r._$refs[a]&&(f.source=decodeURI(Ru.stripHash(e)),f.path=Ru.safePointerToPath(Ru.getHash(e))),[]}}Kn.default=WG});var Q1=F(Gn=>{"use strict";var JG=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]}),zG=Gn&&Gn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),KG=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"&&JG(r,e,n[i]);return zG(r,e),r}}(),G1=Gn&&Gn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gn,"__esModule",{value:!0});var Jm=G1(yu()),jf=G1(Pf()),pw=KG(Sn());function GG(t,e){let r=[];mw(t,"schema",t.$refs._root$Ref.path+"#","#",0,r,t.$refs,e),QG(r)}function mw(t,e,r,n,i,s,a,u){let f=e===null?t:t[e];if(f&&typeof f=="object"&&!ArrayBuffer.isView(f))if(Jm.default.isAllowed$Ref(f))K1(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=jf.default.join(r,g),S=jf.default.join(n,g),E=f[g];Jm.default.isAllowed$Ref(E)?K1(f,g,r,S,i,s,a,u):mw(f,g,m,S,i,s,a,u)}}}function K1(t,e,r,n,i,s,a,u){let f=e===null?t:t[e],h=pw.resolve(r,f.$ref),g=a._resolve(h,n,u);if(g===null)return;let S=jf.default.parse(n).length,E=pw.stripHash(g.path),C=pw.getHash(g.path),x=E!==a._root$Ref.path,A=Jm.default.isExtended$Ref(f);i+=g.indirections;let T=ZG(s,t,e);if(T)if(S<T.depth||i<T.indirections)XG(s,T);else return;s.push({$ref:f,parent:t,key:e,pathFromRoot:n,depth:S,file:E,hash:C,value:g.value,circular:g.circular,extended:A,external:x,indirections:i}),(!T||x)&&mw(g.value,null,g.path,n,i+1,s,a,u)}function QG(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=jf.default.join(n,jf.default.parse(i.hash.replace(r,"#"))):(e=i.file,r=i.hash,n=i.pathFromRoot,i.$ref=i.parent[i.key]=Jm.default.dereference(i.$ref,i.value),i.circular&&(i.$ref.$ref=i.pathFromRoot)):i.$ref.$ref=i.hash}function ZG(t,e,r){for(let n of t)if(n&&n.parent===e&&n.key===r)return n}function XG(t,e){let r=t.indexOf(e);t.splice(r,1)}Gn.default=GG});var nA=F(Qn=>{"use strict";var e3=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]}),t3=Qn&&Qn.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r3=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"&&e3(r,e,n[i]);return t3(r,e),r}}(),tA=Qn&&Qn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qn,"__esModule",{value:!0});var zm=tA(yu()),Z1=tA(Pf()),n3=fo(),X1=r3(Sn()),i3=bn();Qn.default=s3;function s3(t,e){let r=Date.now(),n=gw(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 gw(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 i3.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),zm.default.isAllowed$Ref(t,u))h=eA(t,e,r,n,i,s,a,u,f),g.circular=h.circular,g.value=h.value;else for(let E of Object.keys(t)){let C=Z1.default.join(e,E),x=Z1.default.join(r,E);if(S(x))continue;let A=t[E],T=!1;if(zm.default.isAllowed$Ref(A,u)){if(h=eA(A,C,x,n,i,s,a,u,f),T=h.circular,t[E]!==h.value){let j=new Map;m?.preservedProperties&&typeof t[E]=="object"&&!Array.isArray(t[E])&&m?.preservedProperties.forEach(Y=>{Y in t[E]&&j.set(Y,t[E][Y])}),t[E]=h.value,m?.preservedProperties&&j.size&&typeof t[E]=="object"&&!Array.isArray(t[E])&&j.forEach((Y,V)=>{t[E][V]=Y}),m?.onDereference?.(A.$ref,t[E],t,E)}}else n.has(A)?T=rA(C,a,u):(h=gw(A,C,x,n,i,s,a,u,f),T=h.circular,t[E]!==h.value&&(t[E]=h.value));g.circular=g.circular||T}n.delete(t)}return g}function eA(t,e,r,n,i,s,a,u,f){let g=zm.default.isExternal$Ref(t)&&u?.dereference?.externalReferenceResolution==="root",m=X1.resolve(g?X1.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 E=a._resolve(m,e,u);if(E===null)return{circular:!1,value:null};let C=E.circular,x=C||n.has(E.value);x&&rA(e,a,u);let A=zm.default.dereference(t,E.value);if(!x){let j=gw(A,E.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 rA(t,e,r){if(e.circular=!0,r?.dereference?.onCircular?.(t),!r.dereference.circular)throw n3.ono.reference(`Circular $ref pointer found at ${t}`);return!0}});var iA=F(yw=>{"use strict";Object.defineProperty(yw,"__esModule",{value:!0});function o3(){return typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:typeof setImmediate=="function"?setImmediate:function(e){setTimeout(e,0)}}yw.default=o3()});var oA=F(Uf=>{"use strict";var a3=Uf&&Uf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Uf,"__esModule",{value:!0});Uf.default=l3;var sA=a3(iA());function l3(t,e){if(t){e.then(function(r){(0,sA.default)(function(){t(null,r)})},function(r){(0,sA.default)(function(){t(r)})});return}else return e}});var cA=F(we=>{"use strict";var u3=we&&we.__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]}),c3=we&&we.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),f3=we&&we.__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"&&u3(r,e,n[i]);return c3(r,e),r}}(),_a=we&&we.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(we,"__esModule",{value:!0});we.getJsonSchemaRefParserDefaultOptions=we.jsonSchemaParserNormalizeArgs=we.dereferenceInternal=we.JSONParserErrorGroup=we.isHandledError=we.UnmatchedParserError=we.ParserError=we.ResolverError=we.MissingPointerError=we.InvalidPointerError=we.JSONParserError=we.UnmatchedResolverError=we.dereference=we.bundle=we.resolve=we.parse=we.$RefParser=void 0;var aA=_a(pk()),d3=_a(I_()),Bf=_a(J1());we.jsonSchemaParserNormalizeArgs=Bf.default;var h3=_a(z1()),p3=_a(Q1()),uA=_a(nA());we.dereferenceInternal=uA.default;var ba=f3(Sn()),_n=bn();Object.defineProperty(we,"JSONParserError",{enumerable:!0,get:function(){return _n.JSONParserError}});Object.defineProperty(we,"InvalidPointerError",{enumerable:!0,get:function(){return _n.InvalidPointerError}});Object.defineProperty(we,"MissingPointerError",{enumerable:!0,get:function(){return _n.MissingPointerError}});Object.defineProperty(we,"ResolverError",{enumerable:!0,get:function(){return _n.ResolverError}});Object.defineProperty(we,"ParserError",{enumerable:!0,get:function(){return _n.ParserError}});Object.defineProperty(we,"UnmatchedParserError",{enumerable:!0,get:function(){return _n.UnmatchedParserError}});Object.defineProperty(we,"UnmatchedResolverError",{enumerable:!0,get:function(){return _n.UnmatchedResolverError}});Object.defineProperty(we,"isHandledError",{enumerable:!0,get:function(){return _n.isHandledError}});Object.defineProperty(we,"JSONParserErrorGroup",{enumerable:!0,get:function(){return _n.JSONParserErrorGroup}});var lA=fo(),Zn=_a(oA()),m3=fw();Object.defineProperty(we,"getJsonSchemaRefParserDefaultOptions",{enumerable:!0,get:function(){return m3.getJsonSchemaRefParserDefaultOptions}});var yo=class t{constructor(){this.schema=null,this.$refs=new aA.default}async parse(){let e=(0,Bf.default)(arguments),r;if(!e.path&&!e.schema){let i=(0,lA.ono)(`Expected a file path, URL, or object. Got ${e.path||e.schema}`);return(0,Zn.default)(e.callback,Promise.reject(i))}this.schema=null,this.$refs=new aA.default;let n="http";if(ba.isFileSystemPath(e.path))e.path=ba.fromFileSystemPath(e.path),n="file";else if(!e.path&&e.schema&&"$id"in e.schema&&e.schema.$id){let i=ba.parse(e.schema.$id),s=i.protocol==="https:"?443:80;e.path=`${i.protocol}//${i.hostname}:${s}`}if(e.path=ba.resolve(ba.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,d3.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,Zn.default)(e.callback,Promise.resolve(this.schema));if(e.options.continueOnError)return this.schema=null,(0,Zn.default)(e.callback,Promise.resolve(this.schema));throw lA.ono.syntax(`"${this.$refs._root$Ref.path||i}" is not a valid JSON Schema`)}catch(i){return!e.options.continueOnError||!(0,_n.isHandledError)(i)?(0,Zn.default)(e.callback,Promise.reject(i)):(this.$refs._$refs[ba.stripHash(e.path)]&&this.$refs._$refs[ba.stripHash(e.path)].addError(i),(0,Zn.default)(e.callback,Promise.resolve(null)))}}static parse(){let e=new t;return e.parse.apply(e,arguments)}async resolve(){let e=(0,Bf.default)(arguments);try{return await this.parse(e.path,e.schema,e.options),await(0,h3.default)(this,e.options),vw(this),(0,Zn.default)(e.callback,Promise.resolve(this.$refs))}catch(r){return(0,Zn.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,Bf.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,p3.default)(this,e.options),vw(this),(0,Zn.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,Zn.default)(e.callback,Promise.reject(r))}}static dereference(){let e=new t;return e.dereference.apply(e,arguments)}async dereference(){let e=(0,Bf.default)(arguments);try{return await this.resolve(e.path,e.schema,e.options),(0,uA.default)(this,e.options),vw(this),(0,Zn.default)(e.callback,Promise.resolve(this.schema))}catch(r){return(0,Zn.default)(e.callback,Promise.reject(r))}}};we.$RefParser=yo;we.default=yo;function vw(t){if(_n.JSONParserErrorGroup.getParserErrors(t).length>0)throw new _n.JSONParserErrorGroup(t)}we.parse=yo.parse;we.resolve=yo.resolve;we.bundle=yo.bundle;we.dereference=yo.dereference});var I3={};I$(I3,{BODY_FILE_MAP:()=>bv,CONFIG_FILES:()=>ra,CollectionLoader:()=>jo,CollectionLoaderFactory:()=>Wl,CollectionRequestExecutor:()=>Gl,CollectionService:()=>Yl,ConfigService:()=>na,CookieJar:()=>pl,CookieService:()=>Jl,CookieUtils:()=>ot,DEFAULT_CONFIG:()=>Sr,DEFAULT_REQUEST_SETTINGS:()=>fn,DEFAULT_SUITE_CONFIG:()=>Hf,DYNAMIC_VARIABLES:()=>Av,DataFileParser:()=>Zs,EnvironmentConfigService:()=>Kl,EnvironmentResolver:()=>gi,ExampleGenerator:()=>ha,FetchHttpClient:()=>Ll,FolderCollectionLoader:()=>dl,FolderCollectionStore:()=>Ji,ForgeContainer:()=>gp,ForgeEnv:()=>zi,GraphQLSchemaService:()=>Zl,HTTP_METHOD_MAP:()=>Qm,HTTP_METHOD_REVERSE:()=>Ew,HistoryAnalyzer:()=>sa,HttpForgeParser:()=>Qs,HttpRequestService:()=>vi,InMemoryCookieJar:()=>Gm,InterceptorChain:()=>Si,JsonCollectionLoader:()=>ta,LoggingRequestInterceptor:()=>Oh,METADATA_FILES:()=>ir,ModuleLoader:()=>Hc,NodeFileSystem:()=>jl,NodeHttpClient:()=>Bs,OAuth2TokenManager:()=>Hl,OpenApiExporter:()=>da,OpenApiImporter:()=>Ea,ParserRegistry:()=>hl,PersistentCookieJar:()=>zl,ROOT_DIRECTORIES:()=>eo,RefResolver:()=>wa,RequestExecutor:()=>Zo,RequestHistoryService:()=>tu,RequestHistoryStore:()=>Fl,RequestPreparer:()=>Ql,RequestPreprocessor:()=>Gs,RequestScriptSession:()=>Dl,ResultStorageService:()=>Xm,RetryErrorInterceptor:()=>Ph,SCHEMA_FILES:()=>fl,SCRIPTS_DIR:()=>zr,SCRIPT_FILES:()=>ac,SchemaInferenceService:()=>Ca,SchemaInferrer:()=>rs,ScriptAnalyzer:()=>xa,ScriptExecutor:()=>xi,ServiceContainer:()=>Ou,ServiceIdentifiers:()=>ne,StatisticsService:()=>tg,TestSuiteService:()=>rg,TestSuiteStore:()=>ng,TimingResponseInterceptor:()=>Ih,UrlBuilder:()=>cn,VariableInterpolator:()=>Us,VariableResolver:()=>js,applyExtractionPlan:()=>GR,applyFilterChain:()=>vl,augmentWithDynamicVars:()=>Ds,buildExtractionPlan:()=>KR,buildResultFileName:()=>Cw,cleanupOldBodyFiles:()=>Ev,concatenateScripts:()=>Wc,createExpectChain:()=>Ml,createLodashShim:()=>vb,createModuleLoader:()=>dp,createMomentShim:()=>Vc,createResponseObject:()=>hp,createScriptConsole:()=>DR,createTestFunction:()=>pp,createVariableResolver:()=>iC,deepClone:()=>WE,deleteItemFromTree:()=>vh,detectSensitiveData:()=>zR,evaluateExpression:()=>Ls,expandSummary:()=>xA,exportCollectionToRestClient:()=>HR,findItemById:()=>yh,formatBytes:()=>zE,formatConsoleOutput:()=>Yc,formatDuration:()=>KE,generateId:()=>rt,generateSlug:()=>mi,generateUUID:()=>gh,getCompletions:()=>EA,getRestClientExportFolder:()=>BR,getServiceContainer:()=>bw,hasChanged:()=>$l,isExpression:()=>Fs,isPlainObject:()=>YE,isSystemEnvironmentFile:()=>cc,loadEnvironmentsFromFolder:()=>ml,mergeHeadersCaseInsensitive:()=>cl,mergeRequestSettings:()=>Rh,normalizeHeaders:()=>mp,parseFilterChain:()=>yl,parsePostmanEnvironment:()=>zc,parsePostmanEnvironmentFile:()=>YR,parseQueryContext:()=>wA,prepareBodyForSave:()=>wv,readBodyFromDir:()=>_v,readSchemaFile:()=>Cv,readScriptsFromDir:()=>lc,redactBody:()=>_p,redactFullResponse:()=>Ep,redactFullResultDetails:()=>Cp,redactHeaders:()=>eu,redactHistoryEntry:()=>wp,redactUrl:()=>bp,registerCoreServices:()=>Sw,resolveDynamicVariable:()=>yi,resolveDynamicVariablesInString:()=>rC,safeJsonParse:()=>JE,sanitizeName:()=>_t,searchForItemPath:()=>Sh,sortItemsByOrder:()=>Rv,writeEnvFile:()=>ea,writeFolderItems:()=>Jc,writeSchemaFiles:()=>xv,writeScriptFile:()=>Vl,writeScriptsToDir:()=>uc});module.exports=P$(I3);var jo=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()}};var be=Se(require("fs")),Re=Se(require("path"));function _t(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_").replace(/\s+/g,"-").toLowerCase().substring(0,100)}function rt(t){let e=Date.now().toString(36)+Math.random().toString(36).substr(2,9);return t?`${_t(t)}_${e}`:e}function gh(){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 cl(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 WE(t){return JSON.parse(JSON.stringify(t))}function YE(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function JE(t,e){try{return JSON.parse(t)}catch{return e}}function zE(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 KE(t){return t<1e3?`${t} ms`:`${(t/1e3).toFixed(2)} s`}var nt=Se(require("fs")),Dn=Se(require("path")),ac={preRequest:"pre-request.js",postResponse:"post-response.js"},ir={collection:"collection.json",folder:"folder.json",request:"request.json"},bv={"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"}},fl={responseSchema:"response.schema.json",bodySchema:"body.schema.json"},zr="scripts";function lc(t){if(!nt.existsSync(t))return;let e={},r=Dn.join(t,ac.preRequest);nt.existsSync(r)&&(e.preRequest=nt.readFileSync(r,"utf-8"));let n=Dn.join(t,ac.postResponse);return nt.existsSync(n)&&(e.postResponse=nt.readFileSync(n,"utf-8")),Object.keys(e).length>0?e:void 0}async function uc(t,e){await nt.promises.mkdir(t,{recursive:!0});let r=Dn.join(t,ac.preRequest);e.preRequest?await nt.promises.writeFile(r,e.preRequest,"utf-8"):nt.existsSync(r)&&await nt.promises.unlink(r);let n=Dn.join(t,ac.postResponse);e.postResponse?await nt.promises.writeFile(n,e.postResponse,"utf-8"):nt.existsSync(n)&&await nt.promises.unlink(n)}function _v(t){for(let[e,r]of Object.entries(bv)){let n=Dn.join(t,e);if(nt.existsSync(n))try{let i=nt.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 wv(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 Ev(t,e){for(let r of Object.keys(bv))if(r!==e){let n=Dn.join(t,r);if(nt.existsSync(n))try{await nt.promises.unlink(n)}catch{}}}function Cv(t){if(nt.existsSync(t))try{let e=nt.readFileSync(t,"utf-8");return JSON.parse(e)}catch(e){console.error(`[FolderIO] Failed to load schema file ${t}:`,e);return}}async function xv(t,e,r){let n=Dn.join(t,fl.responseSchema),i=Dn.join(t,fl.bodySchema);e?await nt.promises.writeFile(n,JSON.stringify(e,null,2),"utf-8"):nt.existsSync(n)&&await nt.promises.unlink(n),r?await nt.promises.writeFile(i,JSON.stringify(r,null,2),"utf-8"):nt.existsSync(i)&&await nt.promises.unlink(i)}function yh(t,e){for(let r of t){if(r.id===e)return r;if(r.type==="folder"&&r.items){let n=yh(r.items,e);if(n)return n}}}function vh(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&&vh(n.items,e))return!0}return!1}function Rv(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 Sh(t,e){let r;try{r=nt.readdirSync(t,{withFileTypes:!0})}catch{return}for(let n of r){if(!n.isDirectory()||n.name===zr)continue;if(n.name===e)return Dn.join(t,n.name);let i=Sh(Dn.join(t,n.name),e);if(i)return i}}function mi(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 E=parseInt(S.substring(1));E>a&&(a=E)}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 Ji=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(){be.existsSync(this.collectionsDir)||be.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),this.slugToIdMap.clear(),this.idToSlugMap.clear(),!be.existsSync(this.collectionsDir))return[];let e=be.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=Re.join(this.collectionsDir,e),n=Re.join(r,ir.collection);if(be.existsSync(n))try{let i=be.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Re.join(r,zr)),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=be.readdirSync(e,{withFileTypes:!0});for(let u of a){if(!u.isDirectory()||u.name===zr)continue;let f=Re.join(e,u.name);if(be.existsSync(Re.join(f,ir.folder))){let h=this.loadFolderFromDir(f,u.name);h&&s.set(u.name,h)}else if(be.existsSync(Re.join(f,ir.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=Re.join(e,ir.folder);try{let i=be.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Re.join(e,zr)),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=Re.join(e,ir.request);try{let i=be.readFileSync(n,"utf-8"),s=JSON.parse(i),a=this.loadScriptsFromDir(Re.join(e,zr)),u=s.body,f=this.loadBodyFromDir(e);f&&(u=f);let h=this.loadSchemaFile(Re.join(e,fl.responseSchema)),g=this.loadSchemaFile(Re.join(e,fl.bodySchema)),m=Re.join(e,"doc.md"),S=be.existsSync(m)?be.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 lc(e)}loadBodyFromDir(e){return _v(e)}loadSchemaFile(e){return Cv(e)}async saveSchemaFiles(e,r){return xv(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=rt(e.name));let r=this.idToSlugMap.get(e.id);if(!r){let a=be.readdirSync(this.collectionsDir);r=mi(e.name,a),this.idToSlugMap.set(e.id,r),this.slugToIdMap.set(r,e.id)}let n=Re.join(this.collectionsDir,r);await be.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 be.promises.writeFile(Re.join(n,ir.collection),JSON.stringify(i,null,2),"utf-8"),e.scripts&&await this.saveScriptsToDir(Re.join(n,zr),e.scripts);let s=await this.saveItemsToDir(n,e.items);s.length>0&&(i.order=s,await be.promises.writeFile(Re.join(n,ir.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=mi(i.name,n),this.idToSlugMap.set(i.id,s),this.slugToIdMap.set(s,i.id)),n.push(s);let a=Re.join(e,s);await be.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 be.promises.writeFile(Re.join(e,ir.folder),JSON.stringify(n,null,2),"utf-8"),r.scripts&&await this.saveScriptsToDir(Re.join(e,zr),r.scripts),r.items){let i=await this.saveItemsToDir(e,r.items);i.length>0&&(n.order=i,await be.promises.writeFile(Re.join(e,ir.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 be.promises.writeFile(Re.join(e,ir.request),JSON.stringify(s,null,2),"utf-8"),i&&await be.promises.writeFile(Re.join(e,i.filename),i.content,"utf-8"),await this.cleanupOldBodyFiles(e,i?.filename),await this.saveSchemaFiles(e,r),r.doc&&await be.promises.writeFile(Re.join(e,"doc.md"),r.doc,"utf-8"),r.scripts&&await this.saveScriptsToDir(Re.join(e,zr),r.scripts)}prepareBodyForSave(e){return wv(e)}async cleanupOldBodyFiles(e,r){return Ev(e,r)}async saveScriptsToDir(e,r){return uc(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=Re.join(this.collectionsDir,r);if(!be.existsSync(n))return!1;try{return await be.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?be.existsSync(Re.join(this.collectionsDir,r,ir.collection)):!1}getCollectionPath(e){let r=this.idToSlugMap.get(e)||e;return Re.join(this.collectionsDir,r)}getItemPath(e,r){return this.findItemPath(e,r)}async create(e,r){let n={id:r||rt(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(Re.join(s,zr),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(Re.join(n,zr))}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=Re.join(this.collectionsDir,i),a=Re.join(s,ir.collection),u=be.readFileSync(a,"utf-8"),h={...JSON.parse(u),...r,id:e};await be.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=Re.join(this.collectionsDir,s);let u=this.idToSlugMap.get(r.id);if(!u){let g=be.readdirSync(a).filter(m=>be.statSync(Re.join(a,m)).isDirectory()&&m!==zr);u=mi(r.name,g),this.idToSlugMap.set(r.id,u),this.slugToIdMap.set(u,r.id)}let f=Re.join(a,u);await be.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||!be.existsSync(i))return!1;try{await be.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||!be.existsSync(a))return!1;let u;if(n){let g=this.findItemPath(e,n);if(!g)return!1;u=g}else u=Re.join(this.collectionsDir,s);let f=this.idToSlugMap.get(r);if(!f)return!1;let h=Re.join(u,f);if(be.existsSync(h))return!1;try{await be.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=Re.join(u,ir.folder),h=be.readFileSync(f,"utf-8"),g=JSON.parse(h);g.order=a,await be.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=Re.join(this.collectionsDir,s,ir.collection),f=be.readFileSync(u,"utf-8"),h=JSON.parse(f);h.order=a,await be.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 Rv(e,r)}findItemPath(e,r){let n=this.idToSlugMap.get(e);if(!n)return;let i=this.idToSlugMap.get(r);if(i)return Sh(Re.join(this.collectionsDir,n),i)}findItemById(e,r){return yh(e,r)}deleteItemFromTree(e,r){return vh(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(GE),source:{format:"folder",filePath:e,version:t.version}}}function GE(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(GE)};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 k$(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(Iv)}}function Iv(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(Iv)}:{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 dl=class{store;constructor(e){this.store=new Ji(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(k$(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,Iv(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 hl=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 ot=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(),E=m===-1?"":g.substring(m+1);switch(S){case"domain":h.domain=E.startsWith(".")?E.substring(1):E;break;case"path":h.path=E;break;case"expires":h.expires=E;break;case"max-age":h.maxAge=parseInt(E,10);break;case"httponly":h.httpOnly=!0;break;case"secure":h.secure=!0;break;case"samesite":h.sameSite=E;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 pl=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 ot.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 ot.parseCookieHeaders(e,r)}isExpired(e){return ot.isExpired(e)}domainMatches(e,r){return ot.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)}};var $s=Se(require("fs")),Uo=Se(require("path"));function cc(t){let e=t.toLowerCase();return e==="_global.json"||e==="_global.local.json"||e.endsWith(".local.json")}function ml(t){if(!$s.existsSync(t))return A$();let e=bh(Uo.join(t,"_global.json"))||{},r=e.globalVariables||e.variables||{},n=e.defaultHeaders||{},i=$s.readdirSync(t).filter(h=>h.endsWith(".json")).filter(h=>!h.endsWith(".local.json")).filter(h=>!cc(h)),s={};for(let h of i){let g=bh(Uo.join(t,h))||{},m=Uo.basename(h,".json");s[m]={description:g.description,requiresConfirmation:g.requiresConfirmation,variables:g.variables||{}}}let u=(bh(Uo.join(t,"_global.local.json"))||{}).variables||{},f={};for(let h of Object.keys(s)){let g=Uo.join(t,`${h}.local.json`);if($s.existsSync(g)){let m=bh(g)||{};f[h]={variables:m.variables||{}}}}return{globalVariables:r,defaultHeaders:n,environments:s,localVariables:u,localCredentials:f}}function A$(){return{globalVariables:{},defaultHeaders:{},environments:{},localVariables:{},localCredentials:{}}}function bh(t){try{if(!$s.existsSync(t))return null;let e=$s.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 gi=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 cn=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,E)=>{let C=r[S];return C!==void 0&&C!==""?encodeURIComponent(C):E?"":(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}};var QE=Se(require("crypto")),wh=new Uint8Array(256),_h=wh.length;function Pv(){return _h>wh.length-16&&(QE.default.randomFillSync(wh),_h=0),wh.slice(_h,_h+=16)}var Gt=[];for(let t=0;t<256;++t)Gt.push((t+256).toString(16).slice(1));function ZE(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]]}var XE=Se(require("crypto")),kv={randomUUID:XE.default.randomUUID};function T$(t,e,r){if(kv.randomUUID&&!e&&!t)return kv.randomUUID();t=t||{};let n=t.random||(t.rng||Pv)();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 ZE(n)}var gl=T$;function q$(t=0,e=999){return Math.floor(Math.random()*(e-t+1))+t}function N$(){return Date.now()}function eC(){return gl()}function M$(){return gl()}function tC(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 $$(){let t=tC(8).toLowerCase(),e=["example.com","test.org","mail.dev","sample.net"];return`${t}@${e[Math.floor(Math.random()*e.length)]}`}function D$(){return Math.random()<.5}function F$(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 L$(){return Math.floor(Date.now()/1e3)}function j$(){return new Date().toISOString()}function U$(){return new Date().toISOString().split("T")[0]}function B$(){return new Date().toISOString().split("T")[1].split(".")[0]}function H$(){return new Date().toISOString()}function V$(t=""){return Buffer.from(String(t)).toString("base64")}function W$(t=""){return Buffer.from(String(t),"base64").toString("utf-8")}function Y$(t=""){return encodeURIComponent(String(t))}function J$(t=""){return decodeURIComponent(String(t))}var Av={randomInt:q$,timestamp:N$,guid:M$,uuid:eC,randomUUID:eC,randomString:tC,randomHexadecimal:F$,randomEmail:$$,randomBoolean:D$,isoTimestamp:H$,timestamp_s:L$,datetime:j$,date:U$,time:B$,base64Encode:V$,base64Decode:W$,urlEncode:Y$,urlDecode:J$};function z$(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 yi(t,e){let r=Av[t];return r?e&&e.length>0?r(...e):r():null}function rC(t){return!t||typeof t!="string"?t:t.replace(/\{\{\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?\}\}/g,(e,r,n)=>{try{let i=n?z$(n):void 0,s=yi(r,i);return s===null?e:String(s)}catch{return e}})}function Ds(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=yi(a);u!==null&&(n||(n={...e}),n[s]=u)}}return n??e}var Eh=Se(require("vm")),K$=100;function Fs(t){let e=t.trim();return!e||/^(\$?)[a-zA-Z_][a-zA-Z0-9_]*(\([^)]*\))?$/.test(e)||/(?<!\|)\|(?!\|)/.test(e)?!1:/[+\-*/%<>=!&|?:~^()[\]{}.,`]/.test(e)}function Ls(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=Eh.createContext(r);return Eh.runInContext(t,n,{timeout:K$,displayErrors:!1})}catch{return}}var Ch=Se(require("crypto"));function yl(t){if(!t||!t.includes("|"))return null;let e=G$(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=Q$(s);a&&n.push(a)}return n.length===0?null:{input:r,filters:n}}function G$(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 Q$(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:Z$(n)}}function Z$(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 Ot(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 vl(t,e,r={}){let n=t;for(let i of e)n=X$(n,i.name,i.args,r);return n}function X$(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=Ot(r[0],n),s=r[1]!==void 0?Ot(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(Ot(r[0],n)):"",s=r[1]!==void 0?String(Ot(r[1],n)):"";return String(t).replace(new RegExp(tD(i),"g"),s)}case"split":{let i=r[0]!==void 0?String(Ot(r[0],n)):",";return String(t).split(i)}case"join":{let i=r[0]!==void 0?String(Ot(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(Ot(r[0],n)):"{0}";i=i.replace("{0}",String(t));for(let s=1;s<r.length;s++){let a=Ot(r[s],n);i=i.replace(`{${s}}`,String(a))}return i}case"add":{let i=Ot(r[0],n);return Number(t)+i}case"subtract":{let i=Ot(r[0],n);return Number(t)-i}case"multiply":{let i=Ot(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?Ot(r[0],n):"md5").toLowerCase(),s=String(r[1]!==void 0?Ot(r[1],n):"base64"),u={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[i]||"md5";return Ch.createHash(u).update(String(t)).digest(s)}case"hmac":{let i=r[0]?String(Ot(r[0],n)):"",s=String(r[1]!==void 0?Ot(r[1],n):"sha256").toLowerCase(),a=String(r[2]!==void 0?Ot(r[2],n):"base64"),f={md5:"md5",sha1:"sha1",sha256:"sha256",sha512:"sha512"}[s]||"sha256";return Ch.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=Ot(r[0],n);return Array.isArray(t)?t.at(i):t}case"slice":{let i=Ot(r[0],n),s=r[1]!==void 0?Ot(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:eD(t,r[0],n);case"map":{if(!Array.isArray(t))return t;let i=r.map(s=>String(Ot(s,n)));return i.length===1?t.map(s=>fc(s,i[0])):t.map(s=>{let a={};for(let u of i){let f=fc(s,u);f!==void 0&&(a[u]=f)}return a})}case"prop":{let i=r[0]!==void 0?String(Ot(r[0],n)):"";if(Array.isArray(t)){let s=t.map(a=>fc(a,i)).filter(a=>a!==void 0);return s.length===1?s[0]:s.join(",")}return t&&typeof t=="object"?fc(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 eD(t,e,r){let n=e.match(/^([\w.]+)\s*(>=|<=|!=|\*=|\^=|\$=|>|<|=)\s*(.+)$/);if(!n)return t;let[,i,s,a]=n,u=Ot(a,r);return t.filter(f=>{let h=fc(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 fc(t,e){if(!(!t||typeof t!="object"))return e in t?t[e]:e.split(".").reduce((r,n)=>r?.[n],t)}function tD(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function nC(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 js=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=nC(i[2],r),f=yi(i[1],u);return f!==null?String(f):n}let s=yl(e);if(s){let u=this.resolveFilterInput(s.input,r);if(u!==void 0){let f=vl(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(Fs(e)){let u=this.deserializeVariables(r),f=Ds(e,u),h=Ls(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=nC(n[2],r),a=yi(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(Fs(e)){let s=this.deserializeVariables(r),a=Ds(e,s),u=Ls(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}},Us=class{interpolate(e,r){return!e||typeof e!="string"?e:new js({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 iC(t){return new js(t)}var zi=class t{envStore;interpolator;urlBuilder;constructor(e,r){this.envStore=e,this.interpolator=r||new Us,this.urlBuilder=new cn}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=gi.fromVariables(e);return new t(r)}static fromResolver(e){return new t(e)}};var rD=Se(require("http")),dc=Se(require("https")),Tv=require("url"),xh=Se(require("zlib")),fn={timeout:3e4,followRedirects:!0,followOriginalMethod:!1,followAuthHeader:!1,maxRedirects:10,strictSSL:!0,decompress:!0,includeCookies:!1},Bs=class{settings;version;constructor(e){this.settings={...fn,...e};try{this.version=require("../../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 Tv.URL(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=dc.globalAgent:g.agent=new dc.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?dc:rD).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 Tv.URL(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=xh.gunzipSync(Y):V==="deflate"&&(Y=xh.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,$]of Object.entries(x.headers))(typeof $=="string"||Array.isArray($))&&(k[P]=$);let w=this.parseCookies(x.headers["set-cookie"],a.hostname);m({status:x.statusCode||0,statusText:x.statusMessage||"",headers:k,cookies:w,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 Rh(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 vi=class{constructor(e,r,n){this.urlBuilder=e;this.interceptors=r;this.httpClient=n}async execute(e){let r=Rh(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 Si=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))}},Oh=class{name="logging";priority=1e3;intercept(e,r){return e}},Ih=class{name="timing";priority=1;intercept(e,r,n){return e}},Ph=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))}};var Xt=Se(require("crypto")),AU=Se(require("querystring")),LR=Se(require("vm"));var IU=Se(require("crypto")),Bc=Se(require("fs")),$R=require("module"),Ci=Se(require("path"));function Vc(){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 vb(){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 Hc=class{availableModules=new Set;customModulesRequire;globalSetupExports;options;modulesPath=null;moduleCache=new Map;resolveStack=new Set;builtinModules={uuid:()=>({v4:gl}),crypto:()=>IU,path:()=>Ci,querystring:()=>require("querystring"),lodash:()=>this.loadOptionalModule("lodash",()=>sC(),vb),moment:()=>this.loadOptionalModule("moment",()=>oC(),Vc),tv4:()=>this.loadOptionalModule("tv4",()=>lC()),ajv:()=>this.loadOptionalModule("ajv",()=>MR()),"crypto-js":()=>this.loadOptionalModule("crypto-js",()=>require("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": {
|
|
214
214
|
"${e}": "${n}"
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
Then run: cd http-forge/modules && npm install`}initializeModules(e){if(this.logDebug("Initializing module loader..."),!this.options.allowCustomModules)return this.logDebug("Custom modules disabled by configuration"),!0;try{let
|
|
218
|
-
Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}finally{this.resolveStack.delete(e)}}}getModuleSuggestions(e){let
|
|
217
|
+
Then run: cd http-forge/modules && npm install`}initializeModules(e){if(this.logDebug("Initializing module loader..."),!this.options.allowCustomModules)return this.logDebug("Custom modules disabled by configuration"),!0;try{let r=Ci.join(e,"package.json");return Bc.existsSync(r)?(this.customModulesRequire=(0,$R.createRequire)(r),this.loadAvailableModules(e),this.loadGlobalSetup(e),this.logDebug(`Module loader initialized with ${this.availableModules.size} workspace modules`),!0):(this.logDebug(`No modules/package.json found at ${e}`),!1)}catch(r){return console.error("Failed to initialize modules:",r),!1}}loadAvailableModules(e){try{let r=Ci.join(e,"package.json"),n=Bc.readFileSync(r,"utf-8"),i=JSON.parse(n);if(typeof i!="object"||i===null)throw new Error("Invalid package.json: must be an object");let s=i.dependencies||{},a=i.devDependencies||{};if(typeof s!="object"||typeof a!="object")throw new Error("Invalid dependencies in package.json");Object.keys(s).forEach(u=>{typeof u=="string"&&u.trim()&&this.availableModules.add(u.trim())}),Object.keys(a).forEach(u=>{typeof u=="string"&&u.trim()&&this.availableModules.add(u.trim())}),this.logDebug(`Loaded ${this.availableModules.size} modules from package.json`)}catch(r){let n=`Failed to load workspace modules from package.json: ${r instanceof Error?r.message:r}`;this.logError(n)}}loadGlobalSetup(e){let r=Ci.join(e,"global-setup.js");if(Bc.existsSync(r))try{this.customModulesRequire&&(this.globalSetupExports=this.customModulesRequire("./global-setup.js"))}catch(n){console.error("Failed to load global-setup.js:",n),this.globalSetupExports=void 0}}createRequireFunction(){return e=>{let r=Date.now();try{if(this.resolveStack.has(e))throw new Error(`Circular dependency detected: ${Array.from(this.resolveStack).join(" -> ")} -> ${e}`);if(this.resolveStack.size>=this.options.maxResolveDepth)throw new Error(`Maximum module resolve depth (${this.options.maxResolveDepth}) exceeded`);this.resolveStack.add(e);let n=this.moduleCache.get(e);if(n)return this.logDebug(`Module cache hit: ${e}`),n.module;if(this.builtinModules[e]){this.logDebug(`Loading built-in module: ${e}`);let a=this.builtinModules[e]();return this.cacheModule(e,a,"builtin",Date.now()-r),a}if(!this.modulesPath)throw new Error("Module loading is not initialized. No valid modules/ directory found. Create http-forge-assets/modules/package.json first.");if(e.startsWith("./")||e.startsWith("../")){if(!this.customModulesRequire)throw new Error(`Cannot load local module '${e}': No modules/ folder found. Create http-forge-assets/modules/package.json first.`);let a=Ci.resolve(this.modulesPath,e),u=Ci.normalize(a),f=Ci.normalize(this.modulesPath);if(!u.startsWith(f))throw new Error(`Security violation: Attempt to load module outside modules directory: ${e}`);try{this.logDebug(`Loading relative module: ${e}`);let h=this.customModulesRequire(e);return this.cacheModule(e,h,"relative",Date.now()-r),h}catch(h){throw new Error(`Failed to load local module '${e}': ${h.message}`)}}if(this.availableModules.has(e)&&this.customModulesRequire)try{this.logDebug(`Loading workspace module: ${e}`);let a=this.customModulesRequire(e);return this.cacheModule(e,a,"workspace",Date.now()-r),a}catch(a){throw new Error(`Module '${e}' is in package.json but failed to load: ${a.message}`)}let i=this.getModuleSuggestions(e),s=`Module '${e}' is not available.`;throw i.length>0&&(s+=` Did you mean: ${i.join(", ")}?`),s+=`
|
|
218
|
+
Add it to http-forge/modules/package.json and run npm install.`,new Error(s)}finally{this.resolveStack.delete(e)}}}getModuleSuggestions(e){let r=this.getAvailableModules(),n=[];for(let i of r)if(i.startsWith(e.substring(0,3))&&(n.push(i),n.length>=3))break;return n}cacheModule(e,r,n,i){this.moduleCache.set(e,{module:r,source:n,resolveTime:i}),i>100&&this.logDebug(`Slow module load: ${e} took ${i}ms`)}getGlobalSetupExports(){return this.globalSetupExports}hasCustomModules(){return this.customModulesRequire!==void 0}getAvailableModules(){return[...Object.keys(this.builtinModules),...Array.from(this.availableModules)].sort()}clearCache(){this.moduleCache.clear(),this.logDebug("Module cache cleared")}getCacheStats(){return{size:this.moduleCache.size,hits:0}}logDebug(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader] ${e}`)}logError(e){this.options.outputChannel&&this.options.outputChannel.appendLine(`[ModuleLoader ERROR] ${e}`),console.error(`[ModuleLoader ERROR] ${e}`)}};function dp(t,e){return new Hc(t,e)}var Sb=Se(require("vm"));function PU(t){let e={...t};return e.get=r=>{let n=r.toLowerCase();for(let[i,s]of Object.entries(t))if(i.toLowerCase()===n)return s},e.has=r=>{let n=r.toLowerCase();return Object.keys(t).some(i=>i.toLowerCase()===n)},e.toObject=()=>({...t}),e.each=r=>{for(let[n,i]of Object.entries(t))r({key:n,value:i})},e}function hp(t){let e=PU(t.headers);return{status:t.status,code:t.status,statusText:t.statusText,headers:e,body:t.body,cookies:t.cookies||{},responseTime:t.responseTime,responseSize:t.responseSize,getHeader(r){let n=r.toLowerCase();for(let[i,s]of Object.entries(t.headers))if(i.toLowerCase()===n)return s},getCookie(r){return t.cookies?.[r]},reason(){return this.statusText},json(){if(typeof this.body=="object")return this.body;try{return JSON.parse(this.body)}catch{return null}},text(){return typeof this.body=="string"?this.body:JSON.stringify(this.body)},cookie(r){return this.cookies?.[r]},hasCookie(r){return this.cookies?r in this.cookies:!1},to:{have:{status(r){if(t.status!==r)throw new Error(`Expected status ${r} but got ${t.status}`)},header(r,n){let i=t.headers[r]||t.headers[r.toLowerCase()];if(!i)throw new Error(`Expected header "${r}" to exist`);if(n!==void 0&&i!==n)throw new Error(`Expected header "${r}" to be "${n}" but got "${i}"`)},body(r){let n=typeof t.body=="string"?t.body:JSON.stringify(t.body);if(r!==void 0&&n!==r)throw new Error(`Expected body to be "${r}" but got "${n}"`)},jsonBody(r){let n=typeof t.body=="object"?t.body:JSON.parse(t.body);if(r!==void 0&&JSON.stringify(n)!==JSON.stringify(r))throw new Error("Expected JSON body to match")}},be:{get ok(){if(t.status<200||t.status>=300)throw new Error(`Expected response to be OK (2xx) but got ${t.status}`);return()=>{}},get success(){if(t.status<200||t.status>=300)throw new Error(`Expected response to be successful (2xx) but got ${t.status}`);return()=>{}},get error(){if(t.status<400)throw new Error(`Expected response to be error (4xx/5xx) but got ${t.status}`);return()=>{}},get clientError(){if(t.status<400||t.status>=500)throw new Error(`Expected response to be client error (4xx) but got ${t.status}`);return()=>{}},get serverError(){if(t.status<500||t.status>=600)throw new Error(`Expected response to be server error (5xx) but got ${t.status}`);return()=>{}}}}}}function Ml(t){return{_value:t,_negated:!1,_deep:!1,get not(){return this._negated=!this._negated,this},get to(){return this},get be(){return this},get have(){return this},get deep(){return this._deep=!0,this},_assert(r,n){if(!(this._negated?!r:r))throw new Error(n)},equal(r){return this._deep?(this._deep=!1,this.eql(r)):(this._assert(this._value===r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}equal ${JSON.stringify(r)}`),this)},eql(r){let n=JSON.stringify(this._value)===JSON.stringify(r);return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}deeply equal ${JSON.stringify(r)}`),this},property(r,n){let i=typeof this._value=="object"&&this._value!==null&&r in this._value;return n!==void 0?this._assert(i&&this._value[r]===n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${r}" with value ${JSON.stringify(n)}`):this._assert(i,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have property "${r}"`),this},get ok(){return this._assert(!!this._value,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be truthy`),this},get exist(){return this._assert(this._value!==null&&this._value!==void 0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}exist`),this},include(r){let n=!1;return typeof this._value=="string"?n=this._value.includes(r):Array.isArray(this._value)?n=this._value.includes(r):typeof this._value=="object"&&this._value!==null&&(n=r in this._value),this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}include ${JSON.stringify(r)}`),this},oneOf(r){let n=Array.isArray(r)&&r.includes(this._value);return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be one of ${JSON.stringify(r)}`),this},match(r){let n=r.test(String(this._value));return this._assert(n,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}match ${r}`),this},above(r){return this._assert(Number(this._value)>r,`Expected ${this._value} to ${this._negated?"not ":""}be above ${r}`),this},below(r){return this._assert(Number(this._value)<r,`Expected ${this._value} to ${this._negated?"not ":""}be below ${r}`),this},greaterThan(r){return this.above(r)},lessThan(r){return this.below(r)},within(r,n){let i=Number(this._value);return this._assert(i>=r&&i<=n,`Expected ${this._value} to ${this._negated?"not ":""}be within ${r}..${n}`),this},get true(){return this._assert(this._value===!0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be true`),this},get false(){return this._assert(this._value===!1,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be false`),this},get null(){return this._assert(this._value===null,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be null`),this},get undefined(){return this._assert(this._value===void 0,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be undefined`),this},get empty(){let r=!1;return this._value===null||this._value===void 0?r=!0:typeof this._value=="string"||Array.isArray(this._value)?r=this._value.length===0:typeof this._value=="object"&&(r=Object.keys(this._value).length===0),this._assert(r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be empty`),this},length(r){let n=Array.isArray(this._value)||typeof this._value=="string"?this._value.length:Object.keys(this._value||{}).length;return this._assert(n===r,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have length ${r}`),this},lengthOf(r){return this.length(r)},a(r){let n=Array.isArray(this._value)?"array":typeof this._value;return this._assert(n===r.toLowerCase(),`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}be a(n) ${r} (got ${n})`),this},an(r){return this.a(r)},members(r){let n=this._value,i=Array.isArray(n)&&Array.isArray(r)&&r.every(s=>n.some(a=>JSON.stringify(a)===JSON.stringify(s)));return this._assert(i,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have members ${JSON.stringify(r)}`),this},keys(...r){let n=Array.isArray(r[0])?r[0]:r,i=Object.keys(this._value||{}),s=n.every(a=>i.includes(a));return this._assert(s,`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}have keys ${JSON.stringify(n)}`),this},string(r){return this._assert(typeof this._value=="string"&&this._value.includes(r),`Expected ${JSON.stringify(this._value)} to ${this._negated?"not ":""}contain string "${r}"`),this}}}function Wc(t){return typeof t=="string"?t:t.filter(e=>e&&e.trim()).join(`
|
|
219
219
|
|
|
220
220
|
// --- Next Script ---
|
|
221
221
|
|
|
222
|
-
`)}function $l(r,e){return JSON.stringify(r)!==JSON.stringify(e)}function Jc(r){return r.map(e=>{let t=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}] ${t}`})}function DR(r){return{log:(...e)=>r.push({level:"log",args:e}),info:(...e)=>r.push({level:"info",args:e}),warn:(...e)=>r.push({level:"warn",args:e}),error:(...e)=>r.push({level:"error",args:e})}}function mp(r){let e=[],t=(n,i)=>{try{let s=i();if(s&&typeof s.then=="function"){let a=s.then(()=>{r.push({name:n,passed:!0})},u=>{r.push({name:n,passed:!1,message:u.message||String(u)})});e.push(a)}else r.push({name:n,passed:!0})}catch(s){r.push({name:n,passed:!1,message:s.message})}};return t._pendingTests=e,t}function gp(r){let e={};for(let[t,n]of Object.entries(r))e[t]=Array.isArray(n)?n.join(", "):n;return e}function kU(r){let e=null;try{e=new URL(r)}catch{}return{toString(){return r},valueOf(){return r},[Symbol.toPrimitive](n){return n==="number"?NaN:r},getHost(){return e?e.hostname:""},getPath(){return e?e.pathname:r},getPathWithQuery(){return e?e.pathname+e.search:r},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}`:r},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 Dl=class{constructor(e,t){this.deps=e;this.initialContext=t;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,t={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,t)}createSharedContext(){let e=this.initialContext,t=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 m=u.getAll(f).map(g=>({name:g.name,value:g.value,domain:g.domain,path:g.path,httpOnly:g.httpOnly,secure:g.secure}));h(null,m)}catch(m){h(m,[])}},get(f,h,m){try{if(!u){m(null,void 0);return}let g=u.get(h,f);m(null,g?{name:g.name,value:g.value,domain:g.domain}:void 0)}catch(g){m(g,void 0)}},set(f,h,m,g){try{if(!u){(g||m)?.(null);return}typeof h=="string"&&typeof m=="string"?(u.set({name:h,value:m,domain:f}),g?.(null)):typeof h=="object"&&(u.set({...h,domain:f}),m?.(null))}catch(S){(g||m)?.(S)}},unset(f,h,m){try{if(!u){m?.(null);return}u.delete(h,f),m?.(null)}catch(g){m?.(g)}},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(t,e),response:null,test:mp(this.assertions),expect:Ml,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,t){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 kU(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 t.request?.auth||null},set auth(u){t.request&&(t.request.auth=u)},get certificate(){return t.request?.certificate||null},set certificate(u){t.request&&(t.request.certificate=u)},get description(){return t.request?.description||null},set description(u){t.request&&(t.request.description=u)},get name(){return t.request?.name||null},set name(u){t.request&&(t.request.name=u)},get id(){return t.request?.id||null},get disabled(){return t.request?.disabled||!1},set disabled(u){t.request&&(t.request.disabled=u)},get messages(){return t.request?.messages||[]},get methodPath(){return t.request?.methodPath||null},get metadata(){return t.request?.metadata||[]},getHeaders(u){let f={};for(let[h,m]of Object.entries(e.headers))typeof m=="string"&&(f[h]=m);return f},addQueryParams(u){if(typeof u=="string"){let f=new URLSearchParams(u);for(let[h,m]of f)e.query||(e.query={}),e.query[h]=m}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){t.request&&(typeof u=="string"?(t.request.auth||(t.request.auth={}),t.request.auth.type=u,f&&(t.request.auth.parameters=f)):typeof u=="object"&&(t.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:t.request?.auth,certificate:t.request?.certificate,description:t.request?.description,name:t.request?.name,id:t.request?.id,disabled:t.request?.disabled,metadata:t.request?.metadata,messages:t.request?.messages,methodPath:t.request?.methodPath}},describe(u,f){t.request&&(t.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 t=Yc(e);if(!t||!t.trim())return{success:!0};try{this.consoleMessages.length=0;let n=this.ctx.variables.replaceIn(t);Sb.runInContext(n,this.vmContext,{timeout:5e3});let i=Jc(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:$l(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:a?this.modifiedRequest.body:void 0,params:$l(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:$l(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,t){let n=Yc(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=pp(t),this.ctx.request=this.createRequestObject(t.executedRequest,this.initialContext);let i=this.ctx.variables.replaceIn(n);Sb.runInContext(i,this.vmContext,{timeout:5e3}),this.ctx.test._pendingTests?.length>0&&(await Promise.all(this.ctx.test._pendingTests),this.ctx.test._pendingTests.length=0);let s=Jc(this.consoleMessages);return{testResults:[...this.assertions],consoleOutput:s.length>0?s: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,t){return e===t||!e&&!t?!0:!e||!t?!1:e.type===t.type&&e.format===t.format&&JSON.stringify(e.content)===JSON.stringify(t.content)}dispose(){this.vmContext=null,this.ctx=null,this.assertions=[]}};function jR(r,e){if(r)return r.split(",").map(t=>{let n=t.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 UR(r){if(typeof r=="string"&&r.charCodeAt(0)===30)try{return JSON.parse(r.slice(1))}catch{return r}return r}function TU(r,e){if(r==="@")return"";if(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))return r.slice(1,-1);let t=r.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(t){let n=jR(t[2],e),i=yi(t[1],n);return i!==null?i:void 0}if(e[r]!==void 0)return UR(e[r]);if(Fs(r)){let n=Ds(r,e),i=Ls(r,n);if(i!==void 0)return i}}var Le=class r{_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 r(Buffer.from(e,"hex"))}static fromBase64(e){return new r(Buffer.from(e,"base64"))}static fromUtf8(e){return new r(Buffer.from(e,"utf8"))}};function FR(r,e,t,n){let i=Buffer.concat([Buffer.from(r,"utf8"),n||Buffer.alloc(0)]),s=[],a=Buffer.alloc(0);for(;Buffer.concat(s).length<e+t;)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+t)}}function bb(r,e,t){let n=i=>r==="aes"?`aes-${i*8}-cbc`:r==="des"?"des-cbc":r==="des-ede3"?"des-ede3-cbc":r;return{encrypt(i,s,a){let u=i instanceof Le?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=Xt.randomBytes(8),{key:h,iv:m}=FR(s,e,t,f),g=Xt.createCipheriv(n(e),h,m),S=Buffer.concat([g.update(u),g.final()]),E=Buffer.concat([Buffer.from("Salted__"),f,S]);return{ciphertext:new Le(S),salt:new Le(f),toString:C=>C?C.stringify(new Le(E)):E.toString("base64")}}else{let f=s.toBuffer(),h=a?.iv&&a.iv instanceof Le?a.iv.toBuffer():Buffer.alloc(t),m=Xt.createCipheriv(n(f.length),f,h);a?.padding===!1&&m.setAutoPadding(!1);let g=Buffer.concat([m.update(u),m.final()]);return{ciphertext:new Le(g),toString:S=>S?S.stringify(new Le(g)):g.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:m,iv:g}=FR(s,e,t,h),S=Xt.createDecipheriv(n(e),m,g);return new Le(Buffer.concat([S.update(f),S.final()]))}else{let u=s.toBuffer(),f=a?.iv&&a.iv instanceof Le?a.iv.toBuffer():Buffer.alloc(t),h=typeof i=="string"?Buffer.from(i,"base64"):i.ciphertext?i.ciphertext.toBuffer():Buffer.from(i),m=Xt.createDecipheriv(n(u.length),u,f);return a?.padding===!1&&m.setAutoPadding(!1),new Le(Buffer.concat([m.update(h),m.final()]))}}}}function qU(){let r=t=>n=>{let i=n instanceof Le?n.toBuffer():Buffer.from(String(n),"utf8");return new Le(Xt.createHash(t).update(i).digest())},e=t=>(n,i)=>{let s=n instanceof Le?n.toBuffer():Buffer.from(String(n),"utf8"),a=i instanceof Le?i.toBuffer():Buffer.from(String(i),"utf8");return new Le(Xt.createHmac(t,a).update(s).digest())};return{MD5:r("md5"),SHA1:r("sha1"),SHA224:r("sha224"),SHA256:r("sha256"),SHA384:r("sha384"),SHA512:r("sha512"),SHA3:r("sha3-256"),RIPEMD160:r("ripemd160"),HmacMD5:e("md5"),HmacSHA1:e("sha1"),HmacSHA256:e("sha256"),HmacSHA512:e("sha512"),AES:bb("aes",32,16),DES:bb("des",8,8),TripleDES:bb("des-ede3",24,8),PBKDF2(t,n,i){let s=t instanceof Le?t.toBuffer():Buffer.from(String(t),"utf8"),a=n instanceof Le?n.toBuffer():Buffer.from(String(n),"utf8"),u=(i?.keySize||4)*4,f=i?.iterations||1;return new Le(Xt.pbkdf2Sync(s,a,f,u,"sha1"))},enc:{Base64:{stringify:t=>(t instanceof Le?t.toBuffer():Buffer.from(String(t))).toString("base64"),parse:t=>Le.fromBase64(t)},Utf8:{stringify:t=>(t instanceof Le?t.toBuffer():Buffer.from(String(t))).toString("utf8"),parse:t=>Le.fromUtf8(t)},Hex:{stringify:t=>(t instanceof Le?t.toBuffer():Buffer.from(String(t))).toString("hex"),parse:t=>Le.fromHex(t)},Latin1:{stringify:t=>(t instanceof Le?t.toBuffer():Buffer.from(String(t))).toString("latin1"),parse:t=>new Le(Buffer.from(t,"latin1"))},Utf16:{stringify:t=>(t instanceof Le?t.toBuffer():Buffer.from(String(t))).toString("utf16le"),parse:t=>new Le(Buffer.from(t,"utf16le"))},Utf16BE:{stringify:t=>(t instanceof Le?t.toBuffer():Buffer.from(String(t))).swap16().toString("utf16le"),parse:t=>new Le(Buffer.from(t,"utf16le").swap16())}},lib:{WordArray:{create:t=>t?typeof t=="string"?new Le(Buffer.from(t,"utf8")):Buffer.isBuffer(t)?new Le(t):new Le(Buffer.from(String(t))):new Le(Buffer.alloc(0)),random:t=>new Le(Xt.randomBytes(t))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var xi=class r{constructor(e,t=[]){this.httpService=e;this.moduleLoader=hp(t)}moduleLoader;createRequestSession(e){return new Dl({createVM:this.createVM.bind(this),createCommonContext:this.createCommonContext.bind(this)},e)}createVM(e,t){let n=this.moduleLoader.getGlobalSetupExports(),i={ctx:e,hf:e,pm:e,console:t,...n||{},global:n,setTimeout,setInterval,clearTimeout,clearInterval,URL,URLSearchParams,Buffer,atob:s=>Buffer.from(s,"base64").toString("binary"),btoa:s=>Buffer.from(s,"binary").toString("base64"),TextEncoder,TextDecoder,crypto:Xt,_:Wc(),require:this.moduleLoader.createRequireFunction(),moment:Vc(),querystring:AU,CryptoJS:qU(),jsonStringify:(s,a,u)=>JSON.stringify(s,a,u),jsonParse:s=>JSON.parse(s),xml2Json:s=>{try{let a=this.moduleLoader.createRequireFunction()("xml2js"),u;return a.parseString(s,{explicitArray:!1},(f,h)=>{if(f)throw f;u=h}),u}catch{throw new Error("xml2Json() requires the xml2js module. Add it to your modules/package.json and run npm install.")}}};return LR.createContext(i)}createCommonContext(e,t){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),m=this.createVariableScope(i),g=this.createEnvironmentScope(a,e.environmentName,e.onEnvironmentChange,!0),S={...g,set:(C,x)=>{let A=this.serializeValue(x);g.set(C,A),n[C]=A},unset(C){g.unset(C),delete n[C]},clear(){g.clear();for(let C of Object.keys(a))delete n[C]}};return h.replaceIn=f.replaceIn,m.replaceIn=f.replaceIn,S.replaceIn=f.replaceIn,{globals:h,collectionVariables:m,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:Ml,info:e.info||{eventName:t,requestName:void 0,requestId:void 0}}}static JSON_TYPE_MARKER="";serializeValue(e){return typeof e=="string"?e:r.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:t=>this.deserializeValue(e[t]),set:(t,n)=>{e[t]=this.serializeValue(n)},has(t){return t in e},unset(t){delete e[t]},clear(){Object.keys(e).forEach(t=>delete e[t])},toObject(){return{...e}}}}createMergedVariableScope(e,t,n,i,s={}){let a={get:u=>u in e?this.deserializeValue(e[u]):u in s?s[u]:u in t?this.deserializeValue(t[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 t||u in t||u in n||u in i},unset(u){delete e[u]},clear(){Object.keys(e).forEach(u=>delete e[u])},toObject(){return{...i,...n,...t,...s,...e}},replaceIn(u){if(!u||typeof u!="string")return u;let f=a.toObject();return u.replace(/\{\{([^}]+)\}\}/g,(h,m)=>{let g=m.trim(),S=g.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)(?:\(([^)]*)\))?$/);if(S)try{let x=jR(S[2],f),A=yi(S[1],x);return A!==null?String(A):h}catch{return h}let E=yl(g);if(E){let x=TU(E.input,f);if(x!==void 0){let A=vl(x,E.filters,f);return A!==void 0?String(A):h}return h}let C=a.get(g);if(C!==void 0)return String(C);if(Fs(g)){let x={};for(let[j,Y]of Object.entries(f))x[j]=UR(Y);let A=Ds(g,x),q=Ls(g,A);if(q!==void 0)return String(q)}return h})}};return a}createEnvironmentScope(e,t,n,i){let s=(a,u,f)=>{n&&(i?n(a,u,f):n(u||"",a==="set"?f:void 0))};return{name:t||"",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,t)=>{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(t){i.then(s=>t(null,s)).catch(s=>t(s,null));return}return i}:(e,t)=>{let n=new Error("sendRequest not available - HTTP service not configured");if(t){t(n,null);return}return Promise.reject(n)}}};var Zo=class{constructor(e,t,n,i,s){this.httpClient=e;this.forgeEnv=t;this.cookieJar=n;this.preprocessor=i;if(s?.scriptExecutor)this.scriptExecutor=s.scriptExecutor;else{let a=s?.forgeRoot?[require("path").join(s.forgeRoot,"modules")]:[],u=new vi(new cn,new Si,e);this.scriptExecutor=new xi(u,a)}}scriptExecutor;async execute(e,t,n={}){let i=Date.now(),s={...this.forgeEnv.getAll()},a={...n.additionalVariables||{}},u={...s},f=this.buildHttpRequest(e,n.overrides),h=this.findFolderPath(t,e.id),m=this.buildScriptChain(e,t,h),g={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:t.variables||{},globals:{},sessionVariables:{},environmentVariables:u,environmentName:this.forgeEnv.getActiveEnvironment?.()||void 0,cookieJar:this.cookieJar,info:{eventName:"prerequest",requestName:e.name,requestId:e.id,collectionName:t?.name},onSessionChange:n.onSessionChange,onEnvironmentChange:n.onEnvironmentChange},S=this.scriptExecutor.createRequestSession(g),E,C;try{if(!n.skipPreRequest&&m.preRequest.length>0){let q=await S.executePreRequest(m.preRequest);if(E={success:q.success,error:q.error,modifiedVariables:q.modifiedVariables,modifiedEnvironment:q.modifiedEnvironmentVariables,modifiedGlobals:q.modifiedGlobals,modifiedCollectionVariables:q.modifiedCollectionVariables,consoleOutput:q.consoleOutput,modifiedRequest:q.modifiedRequest?{url:q.modifiedRequest.url,method:q.modifiedRequest.method,headers:q.modifiedRequest.headers,body:q.modifiedRequest.body?.content}:void 0},q.modifiedVariables&&(a={...a,...q.modifiedVariables}),q.modifiedEnvironmentVariables&&(u={...u,...q.modifiedEnvironmentVariables}),q.modifiedRequest){let j=q.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(!q.success)throw new Error(`Pre-request script failed: ${q.error}`)}let x={...u,...a};f=this.interpolateRequest(f,x);let A=await this.httpClient.send(f);if(!n.skipPostResponse&&m.postResponse.length>0){let q=await S.executePostResponse(m.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:q.testResults,consoleOutput:q.consoleOutput,modifiedEnvironment:q.modifiedEnvironmentVariables},q.modifiedEnvironmentVariables&&(u={...u,...q.modifiedEnvironmentVariables})}return{response:A,preRequestResult:E,postResponseResult:C,totalTime:Date.now()-i,finalRequest:f,variables:{environment:u,local:a}}}finally{S.dispose?.()}}async executeSimple(e,t={}){let n=e,i={...this.forgeEnv.getAll(),...t.variables||{}};return n=this.interpolateRequest(e,i),t.timeout&&(n={...n,timeout:t.timeout}),this.httpClient.send(n)}buildHttpRequest(e,t){let n=e.url;if(e.query&&e.query.length>0){let m=new URLSearchParams;for(let g of e.query)g.enabled!==!1&&m.append(g.key,g.value);n+=(n.includes("?")?"&":"?")+m.toString()}let i=t?.url||n,s=t?.method||e.method,a={};if(e.headers&&Array.isArray(e.headers))for(let m of e.headers)m.enabled!==!1&&(a[m.key]=m.value);let u={...a,...t?.headers||{}},f,h=t?.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:t?.timeout||e.settings?.timeout,settings:{...e.settings,...t?.settings}}}interpolateRequest(e,t){let n=zi.create(t);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,t,n=[]){let i=[],s=[];t.scripts?.preRequest&&i.push(t.scripts.preRequest),t.scripts?.postResponse&&s.push(t.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,t){let n=[],i=(s,a)=>{for(let u of s){if(u.type==="request"&&u.id===t)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 NU(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,r=>{let e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}var Fl=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,t){let n=this.requestIndex.get(e)||[],i=[];for(let s of n){let a=this.entries.get(s);a&&(!t||a.environment===t)&&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,t,n,i,s){let a=NU(),u=Date.now(),f={id:a,timestamp:u,environment:i,method:t.method,ticket:s?.ticket,branch:s?.branch,note:s?.note,sentRequest:{url:t.url,method:t.method,headers:{...t.headers},body:t.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 m=h.pop();m&&(this.entries.delete(m),this.fullResponses.delete(m))}if(this.requestIndex.set(e,h),this.storeFullResponses){let m={timestamp:u,status:n.status,statusText:n.statusText,headers:{...n.headers},cookies:n.cookies||[],body:n.body,time:n.time};this.fullResponses.set(a,m)}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 t=this.requestIndex.get(e);if(t){for(let n of t)this.entries.delete(n),this.fullResponses.delete(n);this.requestIndex.delete(e)}}clearAll(){this.entries.clear(),this.requestIndex.clear(),this.fullResponses.clear()}};var Ll=class{async send(e){let t=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")||"",m;try{h.includes("application/json")?m=await u.json():h.includes("text/")?m=await u.text():m=await u.text()}catch{m=null}let g={};return u.headers.forEach((S,E)=>{let C=g[E];C!==void 0?g[E]=Array.isArray(C)?[...C,S]:[C,S]:g[E]=S}),{status:u.status,statusText:u.statusText,headers:g,cookies:[],body:m,time:f-t}}catch(a){throw a.name==="AbortError"?new Error(`Request timeout after ${i}ms`):a}finally{clearTimeout(s)}}};var _b={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"},Gs=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 t={};for(let[n,i]of Object.entries(e))t[n]=this.sanitizeHeaderValue(String(i));return t}encodeBody(e){if(!e||e.type==="none")return null;let{type:t,content:n}=e;switch(t){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 t=new URLSearchParams;for(let n of e)n.enabled!==!1&&n.key&&t.append(n.key,n.value||"");return t.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,t,n){if(Object.keys(e).some(a=>a.toLowerCase()==="content-type"))return;if(n){e["Content-Type"]=n;return}if(!t||t.type==="none")return;let s;switch(t.type){case"x-www-form-urlencoded":s=_b["x-www-form-urlencoded"];break;case"raw":s=t.format?_b[t.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=_b.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}};var Qs=class{format="http-forge";canParse(e){try{let t=JSON.parse(e);return typeof t=="object"&&t!==null&&"id"in t&&"name"in t&&"items"in t&&Array.isArray(t.items)&&!t.info?.schema?.includes("postman")&&!t._type}catch{return!1}}parse(e,t){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:t,version:n.version}}}convertItems(e){return e.map(t=>t.type==="folder"?this.convertFolder(t):this.convertRequest(t))}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 t={};if(e.headers)for(let i of e.headers)i.enabled!==!1&&(t[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(t).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 Zs=class{parse(e,t){return t.toLowerCase().endsWith(".json")?this.parseJson(e):this.parseCsv(e)}parseJson(e){try{let t=JSON.parse(e);return Array.isArray(t)?t:[t]}catch{throw new Error("Failed to parse JSON data file: Invalid JSON format")}}parseCsv(e){let t=e.split(/\r?\n/).filter(s=>s.trim());if(t.length<2)return[{}];let n=this.parseCsvLine(t[0]),i=[];for(let s=1;s<t.length;s++){let a=this.parseCsvLine(t[s]),u={};n.forEach((f,h)=>{u[f]=a[h]||""}),i.push(u)}return i}parseCsvLine(e){let t=[],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?(t.push(n.trim()),n=""):n+=a}return t.push(n.trim()),t}};var Kr=Se(require("fs/promises")),Ul=Se(require("path")),jl=class{async readFile(e){return Kr.readFile(e,"utf-8")}async writeFile(e,t){let n=Ul.dirname(e);await this.mkdir(n),await Kr.writeFile(e,t,"utf-8")}async exists(e){try{return await Kr.access(e),!0}catch{return!1}}async mkdir(e){await Kr.mkdir(e,{recursive:!0})}async glob(e,t){let n=t||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let a=Ul.basename(s);for(let u of e)if(this.matchPattern(a,u)){i.push(s);break}})}catch{}return i}async readDir(e){return Kr.readdir(e)}async isDirectory(e){try{return(await Kr.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,t){let n=await Kr.readdir(e,{withFileTypes:!0});for(let i of n){let s=Ul.join(e,i.name);i.isDirectory()?await this.walkDirectory(s,t):i.isFile()&&t(s)}}matchPattern(e,t){let n=t.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${n}$`,"i").test(e)}};var yp=class r{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 Us,this.fileSystem=e.fileSystem||new jl,this.preprocessor=e.preprocessor||new Gs,this.dataFileParser=e.dataFileParser||new Zs,this.cookieJar=e.cookieJar||new pl,e.enableHistory?this.requestHistory=e.requestHistory||new Fl({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 Bs(s)}else this.httpClient=new Ll;let t=e.forgeRoot?[require("path").join(e.forgeRoot,"modules")]:[],n=new vi(new cn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new xi(n,t),this.parserRegistry=new hl,this.parserRegistry.register("http-forge",new Qs),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=require("path").join(e.forgeRoot,"collections");this.collectionLoader=new dl(s)}else this.collectionLoader=new jo(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new gi(e.environmentConfig):gi.fromVariables({}),this.forgeEnv=zi.fromResolver(this.environmentStore),this.requestExecutor=new Zo(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let t=new Si;if(e.requestInterceptors)for(let n of e.requestInterceptors)t.addRequestInterceptor(n);if(e.responseInterceptors)for(let n of e.responseInterceptors)t.addResponseInterceptor(n);if(e.errorInterceptors)for(let n of e.errorInterceptors)t.addErrorInterceptor(n);return t}async loadCollection(e){if(this.collectionLoader instanceof jo)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,t,n){return this.requestExecutor.execute(e,t,n)}async executeSimple(e,t){return this.requestExecutor.executeSimple(e,t)}registerParser(e,t){this.parserRegistry.register(e,t)}setEnvironmentConfig(e){this.environmentStore=new gi(e),this.forgeEnv=zi.fromResolver(this.environmentStore),this.requestExecutor=new Zo(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:this.options.forgeRoot,scriptExecutor:this.scriptExecutor})}static create(e){return new r(e)}static fromForgeRoot(e="./http-forge",t={}){let n=require("path"),i=n.join(e,"environments"),s,a=ml(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 m=a.localCredentials[f]?.variables||{};s.environments[f]={name:f,variables:{...h.variables,...m}}}}else{let f=require("fs"),h=n.join(i,"environments.json");if(f.existsSync(h))try{let m=f.readFileSync(h,"utf-8"),g=JSON.parse(m);if(s={globalVariables:g.globalVariables||{},environments:{},selectedEnvironment:g.selectedEnvironment},g.environments)for(let[S,E]of Object.entries(g.environments)){let C=E;s.environments[S]={name:C.name||S,variables:C.variables||{}}}}catch(m){console.warn(`[ForgeContainer] Failed to load environments from ${h}:`,m)}}return new r({...t,forgeRoot:e,storageFormat:t.storageFormat??"folder",environmentConfig:s})}};var SA=Se(require("path"));var Bl=Se(require("crypto")),MU=3e4,Hl=class{constructor(e,t,n,i,s="henry-huang.http-forge/oauth2/callback"){this.secretStore=e;this.browserService=t;this.envConfigService=n;this.httpService=i;this.callbackPath=s}tokenCache=new Map;pendingAuthCallback=null;pendingImplicitCallback=null;async getToken(e,t){if(e.accessToken)return{accessToken:this.resolve(e.accessToken,t),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,t)}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,t)}catch{await this.secretStore.delete(`oauth2_refresh_${n}`)}}let s;switch(e.grantType){case"client_credentials":s=await this.fetchToken(e,t,"client_credentials");break;case"password":s=await this.fetchToken(e,t,"password");break;case"authorization_code":s=await this.authorizationCodeFlow(e,t);break;case"implicit":s=await this.implicitFlow(e,t);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,t,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",t);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()}),m=this.parseTokenResponse(h.body,e);m.refreshToken||(m.refreshToken=t);let g=this.buildCacheKeyString(e);return this.tokenCache.set(g,m),m.refreshToken&&await this.storeRefreshToken(g,m.refreshToken),m}async authorizationCodeFlow(e,t){let n=this.resolve(e.authUrl||"",t),i=this.resolve(e.tokenUrl||"",t),s=this.resolve(e.clientId||"",t),a=this.resolve(e.clientSecret||"",t),u=e.scope?this.resolve(e.scope,t):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,m,g;if(f){h=this.generateCodeVerifier();let ee=e.pkceMethod||"S256";m=ee==="S256"?this.generateCodeChallengeS256(h):h,g=ee}let S=e.state||Bl.randomBytes(16).toString("hex"),E=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",E),u&&C.searchParams.set("scope",u),C.searchParams.set("state",S),m&&(C.searchParams.set("code_challenge",m),C.searchParams.set("code_challenge_method",g)),e.audience&&C.searchParams.set("audience",this.resolve(e.audience,t)),e.resource&&C.searchParams.set("resource",this.resolve(e.resource,t)),e.extraParams)for(let[ee,k]of Object.entries(e.extraParams))C.searchParams.set(ee,this.resolve(k,t));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 q=new URLSearchParams;q.append("grant_type","authorization_code"),q.append("code",A.code),q.append("redirect_uri",E),h&&q.append("code_verifier",h);let j={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,j,q,s,a,t);let Y=await this.httpService.execute({method:"POST",url:i,headers:j,body:q.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,t){let n=this.resolve(e.authUrl||"",t),i=this.resolve(e.clientId||"",t),s=e.scope?this.resolve(e.scope,t):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||Bl.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,t)),e.resource&&f.searchParams.set("resource",this.resolve(e.resource,t)),e.extraParams)for(let[E,C]of Object.entries(e.extraParams))f.searchParams.set(E,this.resolve(C,t));this.pendingImplicitCallback&&(this.pendingImplicitCallback.reject(new Error("OAuth2 implicit flow superseded by a new request")),this.pendingImplicitCallback=null);let h=new Promise((E,C)=>{this.pendingImplicitCallback={resolve:E,reject:C,state:a}});await this.browserService.openExternal(f.toString());let m;try{m=await Promise.race([h,new Promise((E,C)=>setTimeout(()=>{this.pendingImplicitCallback=null,C(new Error("OAuth2 implicit flow timed out after 2 minutes"))},12e4))])}finally{this.pendingImplicitCallback=null}if(m.state&&m.state!==a)throw new Error("OAuth2 state mismatch \u2014 potential CSRF attack");let g={accessToken:m.accessToken,tokenType:m.tokenType||e.tokenPrefix||"Bearer",expiresAt:m.expiresIn?Date.now()+m.expiresIn*1e3:void 0,raw:{access_token:m.accessToken,token_type:m.tokenType,expires_in:m.expiresIn}},S=this.buildCacheKeyString(e);return this.tokenCache.set(S,g),g}handleAuthorizationCallback(e,t,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:t}),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,t,n,i){this.pendingImplicitCallback&&(this.pendingImplicitCallback.resolve({accessToken:e,tokenType:t,expiresIn:n,state:i}),this.pendingImplicitCallback=null)}clearToken(e){let t=`${e.tokenUrl}|${e.clientId}|${e.scope||""}|${e.grantType}`;this.tokenCache.delete(t),this.secretStore.delete(`oauth2_refresh_${t}`)}clearAllTokens(){for(let e of this.tokenCache.keys())this.secretStore.delete(`oauth2_refresh_${e}`);this.tokenCache.clear()}async fetchToken(e,t,n){let i=this.resolve(e.tokenUrl||"",t);if(!i)throw new Error("OAuth2 tokenUrl is required");let s=this.resolve(e.clientId||"",t),a=this.resolve(e.clientSecret||"",t),u=e.scope?this.resolve(e.scope,t):void 0,f=new URLSearchParams;if(f.append("grant_type",n),u&&f.append("scope",u),n==="password"){let g=this.resolve(e.username||"",t),S=this.resolve(e.password||"",t);if(!g)throw new Error("OAuth2 password grant requires username");f.append("username",g),f.append("password",S)}if(e.audience&&f.append("audience",this.resolve(e.audience,t)),e.resource&&f.append("resource",this.resolve(e.resource,t)),e.extraParams)for(let[g,S]of Object.entries(e.extraParams))f.append(g,this.resolve(S,t));let h={"Content-Type":"application/x-www-form-urlencoded"};this.applyClientAuth(e,h,f,s,a,t);let m=await this.httpService.execute({method:"POST",url:i,headers:h,body:f.toString()});return this.parseTokenResponse(m.body,e)}applyClientAuth(e,t,n,i,s,a){if(e.clientAuthentication==="header"){let u=Buffer.from(`${i}:${s}`).toString("base64");t.Authorization=`Basic ${u}`}else i&&n.set("client_id",i),s&&n.set("client_secret",s)}parseTokenResponse(e,t){if(!e||typeof e!="object")throw new Error("OAuth2 token response is not a valid JSON object");let n=e,i=t.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||t.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-MU:!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,t){return this.envConfigService.resolveVariables(e,t)}generateCodeVerifier(){return Bl.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Bl.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,t){try{await this.secretStore.store(`oauth2_refresh_${e}`,t)}catch{}}};var Xo=Se(require("fs")),Xs=Se(require("path"));function ea(r,e={}){let t=[];Object.entries(e).forEach(([n,i])=>{t.push(`${n}=${i}`)}),t.length&&Xo.writeFileSync(r,t.join(`
|
|
223
|
-
`),"utf-8")}function Vl(
|
|
224
|
-
`)}function DU(r){let e=r.url;if(r.query&&r.query.length){let t=r.query.filter(n=>n.enabled!==!1).map(n=>`${encodeURIComponent(n.key)}=${encodeURIComponent(n.value)}`).join("&");t&&(e+=(e.includes("?")?"&":"?")+t)}return e}var ar=Se(require("fs")),wb=Se(require("path"));var ta=class{collectionsDir;cache=new Map;constructor(e){this.collectionsDir=e,this.ensureDirectory()}ensureDirectory(){ar.existsSync(this.collectionsDir)||ar.mkdirSync(this.collectionsDir,{recursive:!0})}loadAll(){if(this.cache.clear(),!ar.existsSync(this.collectionsDir))return[];let e=ar.readdirSync(this.collectionsDir),t=[];for(let n of e)if(n.endsWith(".json"))try{let i=wb.join(this.collectionsDir,n),s=ar.readFileSync(i,"utf-8"),a=JSON.parse(s);a.id&&a.name&&(this.cache.set(a.id,a),t.push(a))}catch(i){console.error(`[JsonCollectionLoader] Failed to load ${n}:`,i)}return t}load(e){if(this.cache.has(e))return this.cache.get(e);let t=this.getCollectionPath(e);if(ar.existsSync(t))try{let n=ar.readFileSync(t,"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=rt(e.name));let t=this.getCollectionPath(e.id),n=JSON.stringify(e,null,2);await ar.promises.writeFile(t,n,"utf-8"),this.cache.set(e.id,e)}async delete(e){let t=this.getCollectionPath(e);if(!ar.existsSync(t))return!1;try{return await ar.promises.unlink(t),this.cache.delete(e),!0}catch(n){return console.error(`[JsonCollectionLoader] Failed to delete collection ${e}:`,n),!1}}exists(e){return ar.existsSync(this.getCollectionPath(e))}getCollectionPath(e){return wb.join(this.collectionsDir,`${e}.json`)}getItemPath(e,t){}async create(e,t){let n={id:t||rt(e),name:e,items:[]};return await this.save(n),n}async saveScripts(e,t,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,t);s&&(s.scripts=n,await this.save(i))}loadScripts(e,t){let n=this.load(e);return n?this.findItemById(n.items,t)?.scripts:void 0}async updateCollectionMetadata(e,t){let n=this.load(e);if(!n)throw new Error(`Collection ${e} not found`);t.name!==void 0&&(n.name=t.name),t.description!==void 0&&(n.description=t.description),t.version!==void 0&&(n.version=t.version),t.variables!==void 0&&(n.variables=t.variables),t.auth!==void 0&&(n.auth=t.auth),await this.save(n)}async saveItem(e,t,n){let i=this.load(e);if(!i)throw new Error(`Collection ${e} not found`);let s=this.findItemById(i.items,t.id);if(s)Object.assign(s,t);else if(n){let a=this.findItemById(i.items,n);if(a&&a.type==="folder")a.items=a.items||[],a.items.push(t);else throw new Error(`Parent folder ${n} not found`)}else i.items.push(t);await this.save(i)}async deleteItem(e,t){let n=this.load(e);if(!n)return!1;let i=this.deleteItemById(n.items,t);return i&&await this.save(n),i}async updateItem(e,t,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,t);if(!s)return!1;let{id:a,type:u,...f}=n;return Object.assign(s,f),await this.save(i),!0}async moveItem(e,t,n){let i=this.load(e);if(!i)return!1;let s=this.findItemById(i.items,t);if(!s)return!1;let a={...s};if(!this.deleteItemById(i.items,t))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,t,n){let i=this.load(e);if(!i)return!1;try{let s;if(t){let f=this.findItemById(i.items,t);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(t){let f=this.findItemById(i.items,t);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,t){for(let n of e){if(n.id===t)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,t);if(i)return i}}}deleteItemById(e,t){for(let n=0;n<e.length;n++){if(e[n].id===t)return e.splice(n,1),!0;let i=e[n];if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,t))return!0}return!1}};var Wl=class{static create(e){let t=e.getStorageConfig(),n=e.getCollectionsPath();return t.format==="folder"?new Ji(n):new ta(n)}static createForFormat(e,t){return e==="folder"?new Ji(t):new ta(t)}};var mt=Se(require("fs")),Bn=Se(require("path"));function VR(r){if(typeof r!="string")return"text";let e=r.trim();try{let t=JSON.parse(e);if(typeof t=="object"&&t!==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 FU(r){return{info:{name:r.name,_postman_id:r.id,schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:r.items.map(e=>WR(e)),event:Cb(r.scripts),variable:r.variables?Object.entries(r.variables).map(([e,t])=>({key:e,value:t})):[]}}function WR(r){if(r.type==="folder")return{name:r.name,item:r.items?r.items.map(WR):[],event:Cb(r.scripts)};if(r.type==="request"){let e=r;return{name:e.name,request:{method:e.method,header:(e.headers||[]).filter(t=>t.enabled!==!1).map(LU),url:jU(e),body:UU(e),auth:BU(e.auth)},event:Cb(e.scripts)}}}function LU(r){return{key:r.key,value:r.value,disabled:r.enabled===!1}}function jU(r){let e=r.url,t=r.url.replace(/^[a-zA-Z]+:\/\//,""),n=[],i=t.match(/^([^\/\?]+)/);if(i){let h=i[1];/^{{.*}}$/.test(h)?n=[h]:n=h.split(".")}let s=[],a=t.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(r.query)&&r.query.length>0)u=r.query.map(h=>{let m={key:h.key,value:h.value};return h.enabled===!1&&(m.disabled=!0),m});else{let h=t.indexOf("?");h!==-1&&(u=t.substring(h+1).split("&").map(g=>{let[S,...E]=g.split("=");return{key:S,value:E.join("=")}}))}let f;return r.params&&typeof r.params=="object"&&(f=Object.entries(r.params).map(([h,m])=>({key:h,value:String(m)}))),{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 UU(r){if(!r.body)return;let e=r.body;if(typeof e=="string"){let t=VR(e);return{mode:"raw",raw:e,options:{raw:{language:t}}}}if(e.type==="raw"){let t=e.format||VR(e.content);return{mode:"raw",raw:e.content,options:{raw:{language:t}}}}if(e.type==="formdata"&&Array.isArray(e.fields))return{mode:"formdata",formdata:e.fields.map(t=>({key:t.key,value:t.value,type:t.type||"text",disabled:t.enabled===!1}))};if(e.type==="urlencoded"&&Array.isArray(e.fields))return{mode:"urlencoded",urlencoded:e.fields.map(t=>({key:t.key,value:t.value,disabled:t.enabled===!1}))};if(e.type==="file"&&e.fileName)return{mode:"file",file:{src:e.fileName}};if(e.type==="graphql"&&e.query)return{mode:"graphql",graphql:{query:e.query,variables:e.variables?typeof e.variables=="string"?e.variables:JSON.stringify(e.variables):void 0}};if(e.content)return{mode:"raw",raw:e.content}}function BU(r){if(!(!r||!r.type||r.type==="none")){if(r.type==="bearer")return{type:"bearer",bearer:[{key:"token",value:r.bearerToken,type:"string"}]};if(r.type==="basic"&&r.basicAuth)return{type:"basic",basic:[{key:"username",value:r.basicAuth.username,type:"string"},{key:"password",value:r.basicAuth.password,type:"string"}]}}}function Cb(r){if(!r)return[];let e=[];return r.preRequest&&e.push({listen:"prerequest",script:{type:"text/javascript",exec:[r.preRequest]}}),r.postResponse&&e.push({listen:"test",script:{type:"text/javascript",exec:[r.postResponse]}}),e}var Yl=class{constructor(e,t,n){this.workspaceRoot=e;this.configService=t;this.fileWatcherFactory=n;this.collectionsDir=t.getCollectionsPath(),this.loader=Wl.create(t),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}collectionsDir;collections=new Map;fileWatcher;loader;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){mt.existsSync(this.collectionsDir)||mt.mkdirSync(this.collectionsDir,{recursive:!0})}loadCollections(){this.collections.clear();let e=this.loader.loadAll();for(let t of e)this.collections.set(t.id,t)}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 t of this.collections.values())if(t.id===e)return t}getCollectionByName(e){let t=e.toLowerCase();for(let n of this.collections.values())if(n.name.toLowerCase()===t)return n}async saveCollection(e){if(this.ensureCollectionsDir(),!e.name)throw new Error("Collection name is required");e.id||(e.id=rt(e.name)),await this.loader.save(e),this.collections.set(e.id,e)}getCollectionVariables(e){let t=this.collections.get(e);return t?.variables?{...t.variables}:{}}getCollectionVariableLocals(e){return{...this.localCollectionValues.get(e)||{}}}setCollectionVariable(e,t,n){this.localCollectionValues.has(e)||this.localCollectionValues.set(e,{}),this.localCollectionValues.get(e)[t]=String(n)}deleteCollectionVariable(e,t){let n=this.localCollectionValues.get(e);n&&delete n[t]}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,t){let n=this.collections.get(e);if(n)return this.findItemRecursive(n.items,t)}findRequestByPath(e,t){let n=this.collections.get(e);if(!n)return;let i=t.split("/").filter(s=>s.trim());return this.findItemByPath(n.items,i)}async updateRequest(e,t,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,t,n);if(s){let a=this.findItemRecursive(i.items,t);if(a){let{id:u,type:f,...h}=n;Object.assign(a,h)}}return s}async addRequest(e,t,n){let i=this.collections.get(e);if(!i)return!1;t.id||(t.id=rt(t.name));try{if(await this.loader.saveItem(e,t,n),n){let s=this.findItemRecursive(i.items,n);s&&s.type==="folder"&&(s.items=s.items||[],s.items.push(t))}else i.items.push(t);return!0}catch(s){return console.error("[CollectionService] Failed to add request:",s),!1}}async deleteRequest(e,t){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,t);return i&&this.deleteItemRecursive(n.items,t),i}getAllRequests(e){let t=this.collections.get(e);if(!t)return[];let n=[];return this.collectRequestsRecursive(t.items,n),n}findItemRecursive(e,t){for(let n of e){if(n.id===t)return n;if(n.type==="folder"&&n.items){let i=this.findItemRecursive(n.items,t);if(i)return i}}}findItemByPath(e,t){if(t.length===0)return;let[n,...i]=t,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,t,n){for(let i=0;i<e.length;i++){let s=e[i];if(s.id===t)return e[i]={...s,...n},!0;if(s.type==="folder"&&s.items&&this.updateItemRecursive(s.items,t,n))return!0}return!1}deleteItemRecursive(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===t)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemRecursive(i.items,t))return!0}return!1}collectRequestsRecursive(e,t){for(let n of e)n.type==="request"?t.push(n):n.type==="folder"&&n.items&&this.collectRequestsRecursive(n.items,t)}async createCollection(e){let t={id:rt(e),name:e,items:[]};return await this.saveCollection(t),t}async renameCollection(e,t){let n=this.collections.get(e);return n?(n.name=t,await this.saveCollection(n),!0):!1}async duplicateCollection(e,t){if(!this.collections.get(e))throw new Error(`Collection not found: ${e}`);let i=rt(t),s=this.loader.getCollectionPath(e),a=Bn.join(this.collectionsDir,i);if(!mt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let u=Bn.join(a,"collection.json");if(mt.existsSync(u)){let h=JSON.parse(mt.readFileSync(u,"utf-8"));h.id=i,h.name=t,mt.writeFileSync(u,JSON.stringify(h,null,2))}else mt.writeFileSync(u,JSON.stringify({id:i,name:t},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:rt(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,t){let n=this.collections.get(e);if(!n)return!1;let i=await this.loader.deleteItem(e,t);return i&&this.deleteItemById(n.items,t),i}async renameFolder(e,t,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,t,{name:n});if(s){let a=this.findItemById(i.items,t);a&&(a.name=n)}return s}async duplicateFolder(e,t,n){if(!this.collections.get(e))throw new Error("Collection not found");let s=this.loader.getItemPath(e,t);if(!s||!mt.existsSync(s))throw new Error(`Folder not found on disk: ${t}`);let a=Bn.dirname(s),u=rt(n),f=Bn.join(a,u);this.copyDirRecursive(s,f);let h=Bn.join(f,"folder.json");if(mt.existsSync(h)){let S=JSON.parse(mt.readFileSync(h,"utf-8"));S.id=u,S.name=n,mt.writeFileSync(h,JSON.stringify(S,null,2))}else mt.writeFileSync(h,JSON.stringify({id:u,name:n,type:"folder"},null,2));let m=this.loader.load(e);m&&this.collections.set(e,m);let g=this.findItemById(m?.items||[],u);return g||{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||rt(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,t,n){let i=this.collections.get(e);if(!i)return!1;let s=await this.loader.updateItem(e,t,{name:n});if(s){let a=this.findItemById(i.items,t);a&&(a.name=n)}return s}async moveItem(e,t,n){if(!this.collections.get(e))return!1;let s=await this.loader.moveItem(e,t,n);return s&&this.loadCollections(),s}async reorderItems(e,t,n){if(!this.collections.get(e))return!1;let s=await this.loader.reorderItems(e,t,n);return s&&this.loadCollections(),s}findItemById(e,t){for(let n of e){if(n.id===t)return n;if(n.type==="folder"&&n.items){let i=this.findItemById(n.items,t);if(i)return i}}}copyDirRecursive(e,t){mt.existsSync(t)||mt.mkdirSync(t,{recursive:!0});for(let n of mt.readdirSync(e,{withFileTypes:!0})){let i=Bn.join(e,n.name),s=Bn.join(t,n.name);n.isDirectory()?this.copyDirRecursive(i,s):mt.copyFileSync(i,s)}}deleteItemById(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.id===t)return e.splice(n,1),!0;if(i.type==="folder"&&i.items&&this.deleteItemById(i.items,t))return!0}return!1}async importCollection(e){let t=mt.readFileSync(e,"utf-8"),n;try{n=JSON.parse(t)}catch{throw new Error("Invalid JSON file")}if(n.info&&n.info._postman_id)return this.importPostmanCollection(n);let i={id:n.id||rt(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 t=f=>{if(!f)return;switch(f.type?.toLowerCase()){case"bearer":return{type:"bearer",bearerToken:f.bearer?.find(A=>A.key==="token")?.value||""};case"basic":let g=f.basic?.find(A=>A.key==="username"),S=f.basic?.find(A=>A.key==="password");return{type:"basic",basicAuth:{username:g?.value||"",password:S?.value||""}};case"apikey":let E=f.apikey?.find(A=>A.key==="key"),C=f.apikey?.find(A=>A.key==="value"),x=f.apikey?.find(A=>A.key==="in");return{type:"apikey",apikey:{key:E?.value||"",value:C?.value||"",in:x?.value||"header"}};case"noauth":return{type:"none"};default:return}},n=f=>{if(!Array.isArray(f)||f.length===0)return;let h={};for(let m of f){let g=m.script?.exec;if(!g)continue;let S=Array.isArray(g)?g.join(`
|
|
225
|
-
`):g;m.listen==="prerequest"?h.preRequest=S:m.listen==="test"&&(h.postResponse=S)}return h.preRequest||h.postResponse?h:void 0},i=f=>{if(!f||typeof f=="string")return;let h=f.query;if(!(!Array.isArray(h)||h.length===0))return h.map(m=>({key:m.key||"",value:m.value||"",enabled:m.disabled!==!0}))},s=f=>{if(typeof f=="string")return f;if(!f)return"";let h=new Set;if(Array.isArray(f.variable))for(let g of f.variable)g.key&&h.add(g.key);if(h.size===0&&f.raw)return f.raw;let m="";if(f.protocol&&(m+=f.protocol+"://"),f.host&&(m+=Array.isArray(f.host)?f.host.join("."):f.host),f.port&&(m+=":"+f.port),f.path){let S=(Array.isArray(f.path)?f.path:[f.path]).map(E=>{let C=E.startsWith(":")?E.substring(1):E;return h.has(C)?":"+C:(E.startsWith(":"),E)});m+="/"+S.join("/")}return!m&&f.raw?f.raw:m},a=f=>f.map(h=>{if(h.item)return{id:rt(h.name),type:"folder",name:h.name,description:h.description,auth:t(h.auth),scripts:n(h.event),items:a(h.item)};{let m=h.request||{};return{id:rt(h.name),type:"request",name:h.name,description:h.description||m.description,method:typeof m.method=="string"?m.method:"GET",url:s(m.url),query:i(m.url),headers:Array.isArray(m.header)?m.header.map(g=>({key:g.key||g.name||"",value:g.value||g.value||"",enabled:g.disabled!==!0})):[],body:m.body?.raw?{type:"raw",content:m.body.raw}:void 0,auth:t(m.auth),scripts:n(h.event)}}}),u={id:rt(e.info?.name||"Imported Postman Collection"),name:e.info?.name||"Imported Postman Collection",description:e.info?.description,auth:t(e.auth),scripts:n(e.event),items:a(e.item||[])};return await this.saveCollection(u),u}async exportCollection(e,t){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=FU(n),s=JSON.stringify(i,null,2);mt.writeFileSync(t,s,"utf-8")}async exportCollectionAsRestClientFolder(e,t){let n=this.collections.get(e);if(!n)throw new Error("Collection not found");let i=Bn.join(t,_t(n.name));mt.mkdirSync(i,{recursive:!0});let s=n.variables||{};ea(Bn.join(i,`${_t(n.name)}.env`),s),Vl(i,_t(n.name),n.scripts),zc(n.items,i,n)}dispose(){this.fileWatcher?.dispose()}};var qr=Se(require("fs")),gn=Se(require("path"));var vr={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},proxy:null},ra={config:"http-forge.config.json"},eo={collections:"collections",environments:"environments",flows:"flows",suites:"suites"};var na=class{constructor(e,t,n){this.workspacePath=e;this.fileWatcherFactory=t;this.notifications=n;this.configPath=gn.join(e,ra.config),this.config=this.loadConfig(),this.setupFileWatcher()}config;configPath;fileWatcher;loadConfig(){if(!qr.existsSync(this.configPath))return{...vr};try{let e=qr.readFileSync(this.configPath,"utf-8"),t=JSON.parse(e);return this.mergeWithDefaults(t)}catch(e){return console.error("[ConfigService] Failed to load config:",e),this.notifications?.showWarning(`Failed to parse ${ra.config}. Using default configuration.`),{...vr}}}mergeWithDefaults(e){return{version:e.version??vr.version,storage:{...vr.storage,...e.storage},request:{...vr.request,...e.request},scripts:{...vr.scripts,...e.scripts},runner:{...vr.runner,...e.runner},environments:{...vr.environments,...e.environments},restClientExport:{...vr.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:vr.proxy}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,ra.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 gn.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}resolvePath(e){let t=e.startsWith("./")?e.slice(2):e;return gn.join(this.workspacePath,...t.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return gn.join(this.getRootPath(),eo.collections)}getEnvironmentsPath(){return gn.join(this.getRootPath(),eo.environments)}getFlowsPath(){return gn.join(this.getRootPath(),eo.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return gn.join(this.getRootPath(),eo.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(vr,null,2);await qr.promises.writeFile(this.configPath,e,"utf-8");let t=[this.getCollectionsPath(),this.getEnvironmentsPath(),this.getFlowsPath(),this.getSuitesPath()];for(let i of t)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(),t={id:"globals",name:"Global Variables",variables:{appName:"HTTP Forge"}};await qr.promises.writeFile(gn.join(e,"globals.json"),JSON.stringify(t,null,2),"utf-8");let n={id:"env_dev",name:"Development",variables:{baseUrl:"http://localhost:3000",apiVersion:"v1"}};await qr.promises.writeFile(gn.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(gn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}};var HU="httpForge.cookies",Jl=class{constructor(e,t=HU){this.store=e;this.storeKey=t;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((t,n)=>{e[n]=t}),await this.store.update(this.storeKey,e)}catch(e){console.error("[CookieService] Failed to save cookies:",e)}}getCookieKey(e,t,n){return`${t||"*"}|${n||"/"}|${e}`}get(e,t){if(t){let s=this.getCookieKey(e,t),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(t&&s.domain){if(this.domainMatches(t,s.domain))return s}else return s}async set(e){let t=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(t,e),await this.saveCookies()}async setFromResponse(e){for(let t of e){let n=this.getCookieKey(t.name,t.domain,t.path);this.cookies.set(n,t)}await this.saveCookies()}has(e,t){return this.get(e,t)!==void 0}async delete(e,t,n){let i=this.getCookieKey(e,t,n),s=this.cookies.delete(i);return s&&await this.saveCookies(),s}getAll(e){let t=[];for(let n of this.cookies.values())this.isExpired(n)||(e?(!n.domain||this.domainMatches(e,n.domain))&&t.push(n):t.push(n));return t}getCookieHeader(e){let t=this.getAll(e);return ot.formatCookieHeader(t)}async clear(){this.cookies.clear(),await this.saveCookies()}async clearDomain(e){let t=[];for(let[n,i]of this.cookies.entries())i.domain&&this.domainMatches(e,i.domain)&&t.push(n);for(let n of t)this.cookies.delete(n);await this.saveCookies()}parseCookieHeaders(e,t){return ot.parseCookieHeaders(e,t)}isExpired(e){return ot.isExpired(e)}cleanExpiredCookies(){let e=[];for(let[t,n]of this.cookies.entries())this.isExpired(n)&&e.push(t);for(let t of e)this.cookies.delete(t);e.length>0&&this.saveCookies()}domainMatches(e,t){return ot.domainMatches(e,t)}get count(){return this.cookies.size}};var zl=class{constructor(e){this.cookieService=e;this.localCache=[...e.getAll()]}localCache=[];pendingOperations=[];get(e,t){return t?this.localCache.find(n=>n.name===e&&(!n.domain||n.domain===t||t.endsWith(n.domain))):this.localCache.find(n=>n.name===e)}has(e,t){return this.get(e,t)!==void 0}set(e){let t=this.localCache.findIndex(n=>n.name===e.name&&(!e.domain||n.domain===e.domain));t>=0?this.localCache[t]=e:this.localCache.push(e),this.pendingOperations.push({type:"set",cookie:e})}delete(e,t,n){let i=this.localCache.findIndex(s=>s.name===e&&(!t||s.domain===t||s.domain&&t.endsWith(s.domain)));return i>=0&&this.localCache.splice(i,1),this.pendingOperations.push({type:"delete",name:e,domain:t,path:n}),!0}getAll(e){return e?this.localCache.filter(t=>{let n=t.domain||"";return n===e||e.endsWith(n)}):[...this.localCache]}getCookiesForDomain(e){return this.localCache.filter(t=>{let n=t.domain||"";return n===e||e.endsWith(n)})}async setCookiesFromResponse(e,t){let n=new URL(e).hostname,i=this.cookieService.parseCookieHeaders(t,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 t=new URL(e).hostname,n=new URL(e).pathname,i=this.localCache.filter(s=>!(ot.isExpired(s)||s.domain&&!ot.domainMatches(t,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return ot.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=[]}};var Bt=Se(require("fs")),Gr=Se(require("path"));function Kc(r){try{let e=JSON.parse(typeof r=="string"?r:r.toString("utf-8"));if(!e)return null;let t=e.environment||e,n=t.name||e.name||"imported-environment",i=t.values||t.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=t._postman_exported_at?"Imported from Postman export":t.description||"";return{name:n,variables:s,description:a}}catch{return null}}async function YR(r,e){try{let t=await e.readFile(r);return Kc(t)}catch{return null}}var Gc={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Kl=class{constructor(e,t,n,i){this.workspaceFolder=e;this.workspaceStore=t;this.configService=n;this.fileWatcherFactory=i;let s=n.getEnvironmentsPath();this.environmentsPath=s,this.sharedConfigPath=Gr.join(s,"_global.json"),this.localConfigPath=Gr.join(s,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=t.get(Gc.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(Gc.SELECTED_ENVIRONMENT,e),!this.localEnvironmentValues.has(e)){let t=this.getEnvOverridesStateKey(e),n=this.workspaceStore.get(t,{});n&&Object.keys(n).length>0&&this.localEnvironmentValues.set(e,{...n})}}getEnvOverridesStateKey(e){return`${Gc.ENV_OVERRIDES_PREFIX}${e||this.selectedEnvironment}`}loadPersistedEnvironmentOverrides(){let e=this.getEnvOverridesStateKey(),t=this.workspaceStore.get(e,{});t&&Object.keys(t).length>0&&this.localEnvironmentValues.set(this.selectedEnvironment,{...t})}persistEnvironmentOverrides(e){let t=this.getEnvOverridesStateKey(e),n=this.localEnvironmentValues.get(e)||{};this.workspaceStore.update(t,n)}setEnvironmentVariable(e,t){let n=this.selectedEnvironment;this.localEnvironmentValues.has(n)||this.localEnvironmentValues.set(n,{}),this.localEnvironmentValues.get(n)[e]=String(t),this.persistEnvironmentOverrides(n)}deleteEnvironmentVariable(e){let t=this.selectedEnvironment,n=this.localEnvironmentValues.get(t);n&&(delete n[e],this.persistEnvironmentOverrides(t))}clearEnvironmentVariables(){let e=this.selectedEnvironment;this.localEnvironmentValues.set(e,{}),this.persistEnvironmentOverrides(e)}async resetEnvironmentOverrides(e){let t=e||this.selectedEnvironment;this.localEnvironmentValues.delete(t),await this.workspaceStore.update(this.getEnvOverridesStateKey(t),void 0)}getEnvironmentVariableLocal(e){return this.localEnvironmentValues.get(this.selectedEnvironment)?.[e]}getEnvironmentVariableLocals(){return{...this.localEnvironmentValues.get(this.selectedEnvironment)||{}}}setGlobalVariable(e,t){this.localGlobalValues[e]=String(t)}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,t){this.setEnvironmentVariable(e,t)}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 t=e||this.selectedEnvironment,n=this.getSharedConfig(),i=this.getLocalConfig();if(!n?.environments?.[t])return null;let s=n.environments[t],a=i?.credentials?.[t],u=i?.variables||{},f=a?.variables||{},h=a&&a.headers||{},m=cl(n.defaultHeaders||{},h),g=this.localEnvironmentValues.get(t)||{},S={...n.globalVariables||{},...s.variables||{},...u,...f,...g};return{name:t,description:s.description,requiresConfirmation:s.requiresConfirmation,headers:m,variables:S}}resolveVariables(e,t){return this.createResolver(t).resolveString(e,!0)}exportEnvironmentsToFolder(e,t=!0){let n=this.getEnvironmentNames(),i=this.getSharedConfig(),s=i?.globalVariables?{...i.globalVariables}:{};if(!t&&Object.keys(s).length){let a=Gr.join(e,"globals.env");ea(a,s)}n.forEach(a=>{let u=i?.environments?.[a];if(!u)return;let f={...u.variables||{}};t&&(f={...s,...f});let h=Gr.join(e,`${_t(a)}.env`);ea(h,f)})}resolveVariablesWithExtra(e,t,n){return this.createResolver(n,t).resolveString(e,!0)}resolveVariablesInObject(e,t){return this.createResolver(t).resolveObject(e,!0)}resolveVariablesInObjectWithExtra(e,t,n){return this.createResolver(n,t).resolveObject(e,!0)}getHistoriesPath(){return this.historiesPath}getSharedConfigPath(){return this.sharedConfigPath}getLocalConfigPath(){return this.localConfigPath}getEnvironmentConfigPath(e){return Gr.join(this.environmentsPath,`${e}.json`)}localConfigExists(){return Bt.existsSync(this.localConfigPath)}saveSharedConfig(e){this.saveFolderSharedConfig(e),this.sharedConfig=e}saveLocalConfig(e){let t={variables:e.variables||{}};this.saveJsonFile(this.localConfigPath,t);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 t=Bt.readFileSync(e,"utf-8"),n=Kc(t);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(t){throw console.error("[EnvironmentConfigService] importPostmanEnvironmentFile failed:",t),t}}saveEnvLocalConfig(e,t){let n=this.getEnvLocalConfigPath(e),i={variables:t};this.saveJsonFile(n,i),this.localConfig||(this.localConfig={credentials:{},variables:{}}),this.localConfig.credentials||(this.localConfig.credentials={}),this.localConfig.credentials[e]={variables:t}}getEnvLocalPath(e){return this.getEnvLocalConfigPath(e)}getEnvLocalConfigPath(e){return Gr.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=ml(this.environmentsPath);this.sharedConfig={environments:e.environments,globalVariables:e.globalVariables,defaultHeaders:e.defaultHeaders},this.localConfig={credentials:e.localCredentials,variables:e.localVariables}}createResolver(e,t){let s={...this.getResolvedEnvironment(e)?.variables||{},...this.getSessionVariables(),...t||{}};return new js({globals:{},collectionVariables:{},environmentVariables:s,sessionVariables:{},variables:{}})}saveFolderSharedConfig(e){Bt.existsSync(this.environmentsPath)||Bt.mkdirSync(this.environmentsPath,{recursive:!0});let t={variables:e.globalVariables||{},defaultHeaders:e.defaultHeaders||{}};this.saveJsonFile(this.sharedConfigPath,t);let n=Bt.readdirSync(this.environmentsPath).filter(s=>s.endsWith(".json")).filter(s=>!cc(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=Gr.basename(s,".json");if(!i.has(a))try{Bt.unlinkSync(Gr.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(Gr.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,t])=>({id:e,name:e,active:e===this.selectedEnvironment,variables:t.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 t=Object.keys(this.sharedConfig.environments);this.selectedEnvironment=t.length>0?t[0]:"dev",await this.workspaceStore.update(Gc.SELECTED_ENVIRONMENT,this.selectedEnvironment)}this.saveSharedConfig(this.sharedConfig)}async duplicateEnvironment(e,t){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(t),this.validateEnvironmentExists(e),this.validateEnvironmentNameNotTaken(t);let n=this.sharedConfig.environments[e];this.sharedConfig.environments[t]=JSON.parse(JSON.stringify(n)),this.sharedConfig.environments[t].description=`Copied from ${e}`,this.saveSharedConfig(this.sharedConfig)}async renameEnvironment(e,t){this.loadConfigs(),this.validateConfigLoaded(),this.validateEnvironmentName(t),this.validateEnvironmentExists(e),t!==e&&(this.validateEnvironmentNameNotTaken(t),this.sharedConfig.environments[t]=this.sharedConfig.environments[e],delete this.sharedConfig.environments[e],this.selectedEnvironment===e&&(this.selectedEnvironment=t,await this.workspaceStore.update(Gc.SELECTED_ENVIRONMENT,t)),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,t){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=t,this.saveSharedConfig(this.sharedConfig)}loadJsonFile(e){try{if(!Bt.existsSync(e))return null;let t=Bt.readFileSync(e,"utf-8");return JSON.parse(t)}catch(t){return console.error(`Failed to load JSON from ${e}:`,t),null}}saveJsonFile(e,t){try{let n=Gr.dirname(e);Bt.existsSync(n)||Bt.mkdirSync(n,{recursive:!0}),Bt.writeFileSync(e,JSON.stringify(t,null,2),"utf-8")}catch(n){throw console.error(`Failed to save JSON to ${e}:`,n),n}}};var Gl=class r{constructor(e,t,n,i,s,a,u,f,h,m,g,S){this.httpService=e;this.scriptExecutor=t;this.envConfigService=n;this.requestPreparer=i;this.environment=s;this.cookieJar=a;this.collectionScripts=u;this.folderScriptsChain=f;this.onConsoleOutput=h;this.collectionName=m;this.iteration=g;this.iterationCount=S}async execute(e,t,n){let i=Date.now();return this.executeWithSession(e,t,n,i)}async executeWithSession(e,t,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:{...t},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(g,S,E)=>{g==="set"&&S&&E!==void 0?this.envConfigService.setEnvironmentVariable(S,E):g==="unset"&&S?this.envConfigService.deleteEnvironmentVariable(S):g==="clear"&&this.envConfigService.clearEnvironmentVariables()}},h=this.scriptExecutor.createRequestSession(f),m=null;try{let g={...t},S={...e},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&&(E=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:g,nextRequest:E}}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&&(g=D.modifiedVariables))}m=await this.requestPreparer.prepareRequest(S,this.environment,u,g);let{url:C,headers:x,body:A,method:q}=m,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:q,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={},w;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:m,status:V.status,statusText:V.statusText,headers:gp(V.headers||{}),body:V.body,cookies:L,responseTime:V.time,responseSize:D},Z=await h.executePostResponse(a,z);ee=Z.testResults,k=Z.modifiedEnvironmentVariables||{},w=Z.visualizerData,Z.nextRequest!==void 0&&(E=Z.nextRequest),Z.consoleOutput&&Z.consoleOutput.length>0&&this.onConsoleOutput?.(Z.consoleOutput)}let P=ee.length===0||ee.every(D=>D.passed),$=ee.length>0?P:V.status>=200&&V.status<=302;return{requestId:e.id,name:e.name,executedRequest:{...m,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:$,assertions:ee,modifiedVariables:g,modifiedEnvironmentVariables:k,nextRequest:E,visualizerData:w}}catch(g){return this.handleError(e,m,g,i)}finally{h.dispose?.()}}collectPreRequestScripts(e){let t=[];if(this.collectionScripts?.preRequest&&t.push(this.collectionScripts.preRequest),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain))for(let n of this.folderScriptsChain)n?.preRequest&&t.push(n.preRequest);else this.folderScriptsChain.preRequest&&t.push(this.folderScriptsChain.preRequest);return e.scripts?.preRequest&&t.push(e.scripts.preRequest),t}collectPostResponseScripts(e){let t=[];if(e.scripts?.postResponse&&t.push(e.scripts.postResponse),this.folderScriptsChain)if(Array.isArray(this.folderScriptsChain)){let n=[...this.folderScriptsChain].reverse();for(let i of n)i?.postResponse&&t.push(i.postResponse)}else this.folderScriptsChain.postResponse&&t.push(this.folderScriptsChain.postResponse);return this.collectionScripts?.postResponse&&t.push(this.collectionScripts.postResponse),t}handleError(e,t,n,i){let s=Date.now()-i,a=t?.method||e.method,u=t?.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):"",m=this.errorBodyFormat,g,S;m==="html"||m==="both"?(g=r.formatErrorAsHtml(f,h),S={"content-type":"text/html; charset=utf-8"}):(g=f,S={});let E={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:u||"",method:a||"GET",headers:t?.headers||{},body:t?.body||E,params:t?.params||{},query:t?.query||{}},response:{status:0,statusText:n.name==="AbortError"?"Aborted":n.code||n.message||"Request Error",headers:S,cookies:[],body:g,time:0},duration:s,timestamp:Date.now(),passed:!1,assertions:[],error:f}}get errorBodyFormat(){return"text"}static formatErrorAsHtml(e,t){let n=i=>i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");return`<!doctype html>
|
|
222
|
+
`)}function $l(t,e){return JSON.stringify(t)!==JSON.stringify(e)}function Yc(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 DR(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 pp(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 mp(t){let e={};for(let[r,n]of Object.entries(t))e[r]=Array.isArray(n)?n.join(", "):n;return e}function kU(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 Dl=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:pp(this.assertions),expect:Ml,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 kU(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=Wc(e);if(!r||!r.trim())return{success:!0};try{this.consoleMessages.length=0;let n=this.ctx.variables.replaceIn(r);Sb.runInContext(n,this.vmContext,{timeout:5e3});let i=Yc(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:$l(this.modifiedRequest.headers,this.initialContext.request.headers)?this.modifiedRequest.headers:void 0,body:a?this.modifiedRequest.body:void 0,params:$l(this.modifiedRequest.params,this.initialContext.request.params||{})?this.modifiedRequest.params:void 0,query:$l(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=Wc(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=hp(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);Sb.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=Yc(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 jR(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 UR(t){if(typeof t=="string"&&t.charCodeAt(0)===30)try{return JSON.parse(t.slice(1))}catch{return t}return t}function TU(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=jR(r[2],e),i=yi(r[1],n);return i!==null?i:void 0}if(e[t]!==void 0)return UR(e[t]);if(Fs(t)){let n=Ds(t,e),i=Ls(t,n);if(i!==void 0)return i}}var Le=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 FR(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 bb(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 Le?i.toBuffer():Buffer.from(String(i),"utf8");if(typeof s=="string"){let f=Xt.randomBytes(8),{key:h,iv:g}=FR(s,e,r,f),m=Xt.createCipheriv(n(e),h,g),S=Buffer.concat([m.update(u),m.final()]),E=Buffer.concat([Buffer.from("Salted__"),f,S]);return{ciphertext:new Le(S),salt:new Le(f),toString:C=>C?C.stringify(new Le(E)):E.toString("base64")}}else{let f=s.toBuffer(),h=a?.iv&&a.iv instanceof Le?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 Le(m),toString:S=>S?S.stringify(new Le(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}=FR(s,e,r,h),S=Xt.createDecipheriv(n(e),g,m);return new Le(Buffer.concat([S.update(f),S.final()]))}else{let u=s.toBuffer(),f=a?.iv&&a.iv instanceof Le?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 Le(Buffer.concat([g.update(h),g.final()]))}}}}function qU(){let t=r=>n=>{let i=n instanceof Le?n.toBuffer():Buffer.from(String(n),"utf8");return new Le(Xt.createHash(r).update(i).digest())},e=r=>(n,i)=>{let s=n instanceof Le?n.toBuffer():Buffer.from(String(n),"utf8"),a=i instanceof Le?i.toBuffer():Buffer.from(String(i),"utf8");return new Le(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:bb("aes",32,16),DES:bb("des",8,8),TripleDES:bb("des-ede3",24,8),PBKDF2(r,n,i){let s=r instanceof Le?r.toBuffer():Buffer.from(String(r),"utf8"),a=n instanceof Le?n.toBuffer():Buffer.from(String(n),"utf8"),u=(i?.keySize||4)*4,f=i?.iterations||1;return new Le(Xt.pbkdf2Sync(s,a,f,u,"sha1"))},enc:{Base64:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("base64"),parse:r=>Le.fromBase64(r)},Utf8:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("utf8"),parse:r=>Le.fromUtf8(r)},Hex:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("hex"),parse:r=>Le.fromHex(r)},Latin1:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("latin1"),parse:r=>new Le(Buffer.from(r,"latin1"))},Utf16:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).toString("utf16le"),parse:r=>new Le(Buffer.from(r,"utf16le"))},Utf16BE:{stringify:r=>(r instanceof Le?r.toBuffer():Buffer.from(String(r))).swap16().toString("utf16le"),parse:r=>new Le(Buffer.from(r,"utf16le").swap16())}},lib:{WordArray:{create:r=>r?typeof r=="string"?new Le(Buffer.from(r,"utf8")):Buffer.isBuffer(r)?new Le(r):new Le(Buffer.from(String(r))):new Le(Buffer.alloc(0)),random:r=>new Le(Xt.randomBytes(r))}},pad:{Pkcs7:{_name:"pkcs7"},NoPadding:{_name:"nopadding"},ZeroPadding:{_name:"zeropadding"}},mode:{CBC:{_name:"cbc"},ECB:{_name:"ecb"}}}}var xi=class t{constructor(e,r=[]){this.httpService=e;this.moduleLoader=dp(r)}moduleLoader;createRequestSession(e){return new Dl({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:Vc(),querystring:AU,CryptoJS:qU(),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 LR.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:Ml,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=jR(S[2],f),A=yi(S[1],x);return A!==null?String(A):h}catch{return h}let E=yl(m);if(E){let x=TU(E.input,f);if(x!==void 0){let A=vl(x,E.filters,f);return A!==void 0?String(A):h}return h}let C=a.get(m);if(C!==void 0)return String(C);if(Fs(m)){let x={};for(let[j,Y]of Object.entries(f))x[j]=UR(Y);let A=Ds(m,x),T=Ls(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 Zo=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?[require("path").join(s.forgeRoot,"modules")]:[],u=new vi(new cn,new Si,e);this.scriptExecutor=new xi(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),E,C;try{if(!n.skipPreRequest&&g.preRequest.length>0){let T=await S.executePreRequest(g.preRequest);if(E={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:E,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=zi.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 NU(){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 Fl=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=NU(),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 Ll=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,E)=>{let C=m[E];C!==void 0?m[E]=Array.isArray(C)?[...C,S]:[C,S]:m[E]=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 _b={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"},Gs=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=_b["x-www-form-urlencoded"];break;case"raw":s=r.format?_b[r.format]:"text/plain",s||(s="text/plain");break;case"graphql":s=_b.graphql;break;case"binary":s="application/octet-stream";break}s&&(e["Content-Type"]=s)}};var Qs=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 Zs=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}};var Kr=Se(require("fs/promises")),Ul=Se(require("path")),jl=class{async readFile(e){return Kr.readFile(e,"utf-8")}async writeFile(e,r){let n=Ul.dirname(e);await this.mkdir(n),await Kr.writeFile(e,r,"utf-8")}async exists(e){try{return await Kr.access(e),!0}catch{return!1}}async mkdir(e){await Kr.mkdir(e,{recursive:!0})}async glob(e,r){let n=r||process.cwd(),i=[];try{await this.walkDirectory(n,s=>{let a=Ul.basename(s);for(let u of e)if(this.matchPattern(a,u)){i.push(s);break}})}catch{}return i}async readDir(e){return Kr.readdir(e)}async isDirectory(e){try{return(await Kr.stat(e)).isDirectory()}catch{return!1}}async walkDirectory(e,r){let n=await Kr.readdir(e,{withFileTypes:!0});for(let i of n){let s=Ul.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 gp=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 Us,this.fileSystem=e.fileSystem||new jl,this.preprocessor=e.preprocessor||new Gs,this.dataFileParser=e.dataFileParser||new Zs,this.cookieJar=e.cookieJar||new pl,e.enableHistory?this.requestHistory=e.requestHistory||new Fl({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 Bs(s)}else this.httpClient=new Ll;let r=e.forgeRoot?[require("path").join(e.forgeRoot,"modules")]:[],n=new vi(new cn,this.interceptorChain,this.httpClient);if(this.scriptExecutor=e.scriptExecutor||new xi(n,r),this.parserRegistry=new hl,this.parserRegistry.register("http-forge",new Qs),(e.storageFormat??"folder")==="folder"&&e.forgeRoot){let s=require("path").join(e.forgeRoot,"collections");this.collectionLoader=new dl(s)}else this.collectionLoader=new jo(this.fileSystem,this.parserRegistry);this.environmentStore=e.environmentConfig?new gi(e.environmentConfig):gi.fromVariables({}),this.forgeEnv=zi.fromResolver(this.environmentStore),this.requestExecutor=new Zo(this.httpClient,this.forgeEnv,this.cookieJar,this.preprocessor,{forgeRoot:e.forgeRoot,scriptExecutor:this.scriptExecutor})}createInterceptorChain(e){let r=new Si;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 jo)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 gi(e),this.forgeEnv=zi.fromResolver(this.environmentStore),this.requestExecutor=new Zo(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=require("path"),i=n.join(e,"environments"),s,a=ml(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=require("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,E]of Object.entries(m.environments)){let C=E;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})}};var SA=Se(require("path"));var Bl=Se(require("crypto")),MU=3e4,Hl=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||Bl.randomBytes(16).toString("hex"),E=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",E),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",E),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||Bl.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[E,C]of Object.entries(e.extraParams))f.searchParams.set(E,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((E,C)=>{this.pendingImplicitCallback={resolve:E,reject:C,state:a}});await this.browserService.openExternal(f.toString());let g;try{g=await Promise.race([h,new Promise((E,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-MU:!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 Bl.randomBytes(32).toString("base64url")}generateCodeChallengeS256(e){return Bl.createHash("sha256").update(e).digest("base64url")}async storeRefreshToken(e,r){try{await this.secretStore.store(`oauth2_refresh_${e}`,r)}catch{}}};var Xo=Se(require("fs")),Xs=Se(require("path"));function ea(t,e={}){let r=[];Object.entries(e).forEach(([n,i])=>{r.push(`${n}=${i}`)}),r.length&&Xo.writeFileSync(t,r.join(`
|
|
223
|
+
`),"utf-8")}function Vl(t,e,r){r&&(r.preRequest&&r.preRequest.trim()&&Xo.writeFileSync(Xs.join(t,`${e}.pre.js`),r.preRequest,"utf-8"),r.postResponse&&r.postResponse.trim()&&Xo.writeFileSync(Xs.join(t,`${e}.post.js`),r.postResponse,"utf-8"))}function BR(t,e){let n=e&&e.trim()?e.trim():"collections-rest-client";return Xs.isAbsolute(n)?n:Xs.join(t,n)}async function HR(t,e,r,n,i){await t.exportCollectionAsRestClientFolder(r,n),e.exportEnvironmentsToFolder(n,i)}function Jc(t,e,r){t.forEach(n=>{if(n.type==="folder"){let i=Xs.join(e,_t(n.name));Xo.mkdirSync(i,{recursive:!0}),Vl(i,_t(n.name),n.scripts),Jc(n.items||[],i,r)}else if(n.type==="request"){let i=n,s=_t(i.name)+".http",a=Xs.join(e,s),u=$U(i,r);Xo.writeFileSync(a,u,"utf-8"),Vl(e,_t(i.name),i.scripts)}})}function $U(t,e){let r=[];r.push(`### ${e.name} / ${t.name}`),r.push(`# collection env: ${_t(e.name)}.env`),r.push(`# request scripts: ${_t(t.name)}.pre.js and .post.js`);let n=DU(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 DU(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}var lr=Se(require("fs")),wb=Se(require("path"));var ta=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=wb.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=rt(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 wb.join(this.collectionsDir,`${e}.json`)}getItemPath(e,r){}async create(e,r){let n={id:r||rt(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 Wl=class{static create(e){let r=e.getStorageConfig(),n=e.getCollectionsPath();return r.format==="folder"?new Ji(n):new ta(n)}static createForFormat(e,r){return e==="folder"?new Ji(r):new ta(r)}};var mt=Se(require("fs")),Bn=Se(require("path"));function VR(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 FU(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=>WR(e)),event:Eb(t.scripts),variable:t.variables?Object.entries(t.variables).map(([e,r])=>({key:e,value:r})):[]}}function WR(t){if(t.type==="folder")return{name:t.name,item:t.items?t.items.map(WR):[],event:Eb(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(LU),url:jU(e),body:UU(e),auth:BU(e.auth),description:e.description},event:Eb(e.scripts),protocolProfileBehavior:HU(e.settings)}}}function LU(t){return{key:t.key,value:t.value,disabled:t.enabled===!1}}function jU(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,...E]=m.split("=");return{key:S,value:E.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 UU(t){if(!t.body)return;let e=t.body;if(typeof e=="string"){let s=VR(e);return{mode:"raw",raw:e,options:{raw:{language:s}}}}if(e.type==="raw"){let s=e.format||VR(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 BU(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 HU(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 Eb(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 Yl=class{constructor(e,r,n){this.workspaceRoot=e;this.configService=r;this.fileWatcherFactory=n;this.collectionsDir=r.getCollectionsPath(),this.loader=Wl.create(r),this.ensureCollectionsDir(),this.loadCollections(),this.setupFileWatcher()}collectionsDir;collections=new Map;fileWatcher;loader;localCollectionValues=new Map;onCollectionsChanged;ensureCollectionsDir(){mt.existsSync(this.collectionsDir)||mt.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=rt(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=rt(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:rt(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=rt(r),s=this.loader.getCollectionPath(e),a=Bn.join(this.collectionsDir,i);if(!mt.existsSync(s))throw new Error(`Collection directory not found: ${s}`);this.copyDirRecursive(s,a);let u=Bn.join(a,"collection.json");if(mt.existsSync(u)){let h=JSON.parse(mt.readFileSync(u,"utf-8"));h.id=i,h.name=r,mt.writeFileSync(u,JSON.stringify(h,null,2))}else mt.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:rt(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||!mt.existsSync(s))throw new Error(`Folder not found on disk: ${r}`);let a=Bn.dirname(s),u=rt(n),f=Bn.join(a,u);this.copyDirRecursive(s,f);let h=Bn.join(f,"folder.json");if(mt.existsSync(h)){let S=JSON.parse(mt.readFileSync(h,"utf-8"));S.id=u,S.name=n,mt.writeFileSync(h,JSON.stringify(S,null,2))}else mt.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||rt(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){mt.existsSync(r)||mt.mkdirSync(r,{recursive:!0});for(let n of mt.readdirSync(e,{withFileTypes:!0})){let i=Bn.join(e,n.name),s=Bn.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):mt.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=mt.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||rt(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"),E=h.basic?.find(T=>T.key==="password");return{type:"basic",basicAuth:{username:S?.value||"",password:E?.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 E=Array.isArray(S)?S.join(`
|
|
225
|
+
`):S;m.listen==="prerequest"?g.preRequest=E:m.listen==="test"&&(g.postResponse=E)}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 E=(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+="/"+E.join("/")}return!m&&h.raw?h.raw:m},u=h=>h.map(g=>{if(g.item)return{id:rt(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:rt(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 E=S.options?.raw?.language;return{type:"raw",format:E==="xml"?"xml":E==="html"?"html":E==="javascript"?"javascript":E==="text"?"text":"json",content:S.raw}}if(S.mode==="urlencoded"&&Array.isArray(S.urlencoded))return{type:"x-www-form-urlencoded",content:S.urlencoded.map(E=>({key:E.key||"",value:E.value||"",enabled:E.disabled!==!0}))};if(S.mode==="formdata"&&Array.isArray(S.formdata))return{type:"form-data",content:S.formdata.map(E=>({key:E.key||"",value:E.value||"",type:E.type||"text",enabled:E.disabled!==!0}))};if(S.mode==="graphql"&&S.graphql){let E;if(S.graphql.variables)try{E=JSON.parse(S.graphql.variables)}catch{E=void 0}return{type:"graphql",content:{query:S.graphql.query||"",variables:E}}}if(S.mode==="binary")return{type:"binary",content:""}}})(),auth:r(m.auth),scripts:n(g.event),settings:i(g.protocolProfileBehavior)}}}),f={id:rt(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=FU(n),s=JSON.stringify(i,null,2);mt.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=Bn.join(r,_t(n.name));mt.mkdirSync(i,{recursive:!0});let s=n.variables||{};ea(Bn.join(i,`${_t(n.name)}.env`),s),Vl(i,_t(n.name),n.scripts),Jc(n.items,i,n)}dispose(){this.fileWatcher?.dispose()}};var qr=Se(require("fs")),gn=Se(require("path"));var Sr={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},proxy:null},ra={config:"http-forge.config.json"},eo={collections:"collections",environments:"environments",flows:"flows",suites:"suites"};var na=class{constructor(e,r,n){this.workspacePath=e;this.fileWatcherFactory=r;this.notifications=n;this.configPath=gn.join(e,ra.config),this.config=this.loadConfig(),this.setupFileWatcher()}config;configPath;fileWatcher;loadConfig(){if(!qr.existsSync(this.configPath))return{...Sr};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 ${ra.config}. Using default configuration.`),{...Sr}}}mergeWithDefaults(e){return{version:e.version??Sr.version,storage:{...Sr.storage,...e.storage},request:{...Sr.request,...e.request},scripts:{...Sr.scripts,...e.scripts},runner:{...Sr.runner,...e.runner},environments:{...Sr.environments,...e.environments},restClientExport:{...Sr.restClientExport,...e.restClientExport},proxy:e.proxy!==void 0?e.proxy:Sr.proxy}}setupFileWatcher(){if(!this.fileWatcherFactory)return;this.fileWatcher=this.fileWatcherFactory.createFileWatcher(this.workspacePath,ra.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 gn.isAbsolute(e)?e:this.resolvePath(e)}getRestClientMergeGlobals(){return this.config.restClientExport?.mergeGlobals??!0}getProxyConfig(){return this.config.proxy??null}resolvePath(e){let r=e.startsWith("./")?e.slice(2):e;return gn.join(this.workspacePath,...r.split("/"))}getRootPath(){return this.resolvePath(this.config.storage.root)}getCollectionsPath(){return gn.join(this.getRootPath(),eo.collections)}getEnvironmentsPath(){return gn.join(this.getRootPath(),eo.environments)}getFlowsPath(){return gn.join(this.getRootPath(),eo.flows)}getHistoryPath(){return this.resolvePath(this.config.storage.history)}getResultsPath(){return this.resolvePath(this.config.storage.results)}getSuitesPath(){return gn.join(this.getRootPath(),eo.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(Sr,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(gn.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(gn.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(gn.join(e,"default-headers.json"),JSON.stringify(i,null,2),"utf-8")}dispose(){this.fileWatcher?.dispose()}};var VU="httpForge.cookies",Jl=class{constructor(e,r=VU){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 ot.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 ot.parseCookieHeaders(e,r)}isExpired(e){return ot.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 ot.domainMatches(e,r)}get count(){return this.cookies.size}};var zl=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=>!(ot.isExpired(s)||s.domain&&!ot.domainMatches(r,s.domain)||!s.domain||s.path&&!n.startsWith(s.path)));if(i.length!==0)return ot.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=[]}};var Bt=Se(require("fs")),Gr=Se(require("path"));function zc(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 YR(t,e){try{let r=await e.readFile(t);return zc(r)}catch{return null}}var Kc={SELECTED_ENVIRONMENT:"httpForge.selectedEnvironment",ENV_OVERRIDES_PREFIX:"httpForge.envOverrides."},Kl=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=Gr.join(s,"_global.json"),this.localConfigPath=Gr.join(s,"_global.local.json"),this.historiesPath=n.getHistoryPath(),this.selectedEnvironment=r.get(Kc.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(Kc.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`${Kc.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=cl(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=Gr.join(e,"globals.env");ea(a,s)}n.forEach(a=>{let u=i?.environments?.[a];if(!u)return;let f={...u.variables||{}};r&&(f={...s,...f});let h=Gr.join(e,`${_t(a)}.env`);ea(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 Gr.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=zc(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 Gr.join(this.environmentsPath,`${e}.local.json`)}loadFolderConfigs(){let e=ml(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 js({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=>!cc(s)),i=new Set(Object.keys(e.environments||{}));for(let s of n){let a=Gr.basename(s,".json");if(!i.has(a))try{Bt.unlinkSync(Gr.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(Gr.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(Kc.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(Kc.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=Gr.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 Gl=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,E)=>{m==="set"&&S&&E!==void 0?this.envConfigService.setEnvironmentVariable(S,E):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},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&&(E=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:E}}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={},w;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:mp(V.headers||{}),body:V.body,cookies:L,responseTime:V.time,responseSize:D},Z=await h.executePostResponse(a,z);ee=Z.testResults,k=Z.modifiedEnvironmentVariables||{},w=Z.visualizerData,Z.nextRequest!==void 0&&(E=Z.nextRequest),Z.consoleOutput&&Z.consoleOutput.length>0&&this.onConsoleOutput?.(Z.consoleOutput)}let P=ee.length===0||ee.every(D=>D.passed),$=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:$,assertions:ee,modifiedVariables:m,modifiedEnvironmentVariables:k,nextRequest:E,visualizerData:w}}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 E={type:"none",content:null};return{requestId:e.id,name:e.name,executedRequest:{url:u||"",method:a||"GET",headers:r?.headers||{},body:r?.body||E,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>
|
|
229
229
|
<p><strong>${n(e)}</strong></p>
|
|
230
|
-
${
|
|
231
|
-
${n(
|
|
230
|
+
${r?`<pre style="white-space:pre-wrap;padding:10px;border:1px solid #eee;border-radius:4px;">
|
|
231
|
+
${n(r)}
|
|
232
232
|
</pre>`:""}
|
|
233
233
|
</body>
|
|
234
|
-
</html>`}};var Ql=class{constructor(e,
|
|
234
|
+
</html>`}};var Ql=class{constructor(e,r,n,i,s){this.envConfigService=e;this.httpService=r;this.preprocessor=n;this.tokenManager=i;this.appInfo=s}async prepareRequest(e,r,n,i){let s=i&&Object.keys(i).length>0,a=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.params||{},i,r):this.envConfigService.resolveVariablesInObject(e.params||{},r),u=s?this.envConfigService.resolveVariablesInObjectWithExtra(e.query||{},i,r):this.envConfigService.resolveVariablesInObject(e.query||{},r),f=cl(n?.headers||{},e.headers||{}),h=s?this.envConfigService.resolveVariablesInObjectWithExtra(f,i,r):this.envConfigService.resolveVariablesInObject(f,r);if(h=this.preprocessor.sanitizeHeaders(h),!Object.keys(h).some(T=>T.toLowerCase()==="user-agent")){let T=this.appInfo?.version||"0.0.0",j=this.appInfo?.name||"HttpForge";h["User-Agent"]=`${j}/${T}`}if(e.auth?.type==="bearer"&&e.auth.bearerToken){let T=s?this.envConfigService.resolveVariablesWithExtra(e.auth.bearerToken,i,r):this.envConfigService.resolveVariables(e.auth.bearerToken,r);h.Authorization=`Bearer ${T}`}if(e.auth?.type==="basic"&&e.auth.basicAuth){let T=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.username||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.username||"",r),j=s?this.envConfigService.resolveVariablesWithExtra(e.auth.basicAuth.password||"",i,r):this.envConfigService.resolveVariables(e.auth.basicAuth.password||"",r),Y=Buffer.from(`${T}:${j}`).toString("base64");h.Authorization=`Basic ${Y}`}e.auth?.type==="apikey"&&e.auth.apikey&&this.applyApiKey(e.auth.apikey,h,u,r,i),e.auth?.type==="oauth2"&&e.auth.oauth2&&await this.applyOAuth2(e.auth.oauth2,h,r);let m=null;if(e.body&&e.body.type!=="none"){let T=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesInObjectWithExtra(e.body.content,i,r):this.envConfigService.resolveVariablesInObject(e.body.content,r);if((e.body.format==="json"||e.body.type==="graphql")&&typeof T=="string")try{T=JSON.parse(T)}catch{e.body.format==="json"&&console.warn("[RequestPreparer] Failed to parse JSON body after variable resolution, keeping as string")}let j={type:e.body.type,format:e.body.format,content:T};m=this.preprocessor.encodeBody(j)}this.preprocessor.setContentTypeHeader(h,e.body,e.bodyContentType);let S=e.method||"GET",E=e.url||"",C=i&&Object.keys(i).length>0?this.envConfigService.resolveVariablesWithExtra(E,i,r):this.envConfigService.resolveVariables(E,r),x=this.httpService.buildUrl(C,a,u),A={type:e.body?.type||"none",format:e.body?.format,content:m};return{url:x,method:S,headers:h,body:A,params:a,query:u}}async applyOAuth2(e,r,n){if(e.accessToken){let s=this.envConfigService.resolveVariables(e.accessToken,n),a=e.tokenPrefix||"Bearer";r.Authorization=`${a} ${s}`;return}if(!this.tokenManager)throw new Error("OAuth2 authentication requires IOAuth2TokenManager. Ensure the service is properly registered.");let i=await this.tokenManager.getToken(e,n);r.Authorization=`${i.tokenType} ${i.accessToken}`}applyApiKey(e,r,n,i,s){if(!e||!e.key)return;let a=s&&Object.keys(s).length>0,u=a?this.envConfigService.resolveVariablesWithExtra(e.key||"",s,i):this.envConfigService.resolveVariables(e.key||"",i),f=a?this.envConfigService.resolveVariablesWithExtra(e.value||"",s,i):this.envConfigService.resolveVariables(e.value||"",i);(e.in||"header").toLowerCase()==="query"?n[u]=f:r[u]=f}};var WU=`
|
|
235
235
|
query IntrospectionQuery {
|
|
236
236
|
__schema {
|
|
237
237
|
queryType { name }
|
|
@@ -259,21 +259,21 @@ fragment TypeRef on __Type {
|
|
|
259
259
|
kind name
|
|
260
260
|
ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name ofType { kind name } } } } } } }
|
|
261
261
|
}
|
|
262
|
-
`.trim(),Zl=class{constructor(e){this.httpClient=e}schemaCache=new Map;async fetchSchema(e,
|
|
263
|
-
`),i=/^\s*(query|mutation|subscription)\s+(\w+)/;for(let s=0;s<n.length;s++){let a=n[s].match(i);a&&
|
|
264
|
-
`))return
|
|
265
|
-
`)){try{let n=new URLSearchParams(
|
|
266
|
-
`)){try{let s=new URLSearchParams(i);for(let[a,u]of s)if(yn.test(a)&&u&&!
|
|
267
|
-
`)){let f=new URLSearchParams(u);if(f.get(e)===n){f.set(e,i);let h=f.toString();s?s.content=h:r.body=h}return}return}typeof a=="object"&&a!==null&&JR(a,e,t||e,n,i)}}function JR(r,e,t,n,i){let s=t.split("."),a=r;for(let f=0;f<s.length-1;f++){let h=s[f],m=h.match(/^(.+)\[(\d+)\]$/);if(m?a=a?.[m[1]]?.[parseInt(m[2])]:a=a?.[h],a==null)return}let u=s[s.length-1];a&&a[u]===n&&(a[u]=i)}function zU(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var tu=class{historyPath;sharedHistoryPath;constructor(e,t){this.historyPath=e,this.sharedHistoryPath=t}getEnvironmentHistoryPath(e){return Nr.join(this.historyPath,_t(e))}getCollectionHistoryPath(e,t){return Nr.join(this.getEnvironmentHistoryPath(e),t)}getRequestPath(e,t,n){return Nr.join(this.getCollectionHistoryPath(e,t),_t(n))}getSharedEnvironmentHistoryPath(e){return Nr.join(this.sharedHistoryPath,_t(e))}getSharedCollectionHistoryPath(e,t){return Nr.join(this.getSharedEnvironmentHistoryPath(e),t)}getSharedRequestPath(e,t,n){return Nr.join(this.getSharedCollectionHistoryPath(e,t),_t(n))}getHistoryFilePath(e,t,n){return Nr.join(this.getRequestPath(e,t,n),"transactions.json")}getSharedHistoryFilePath(e,t,n){return Nr.join(this.getSharedRequestPath(e,t,n),"transactions.json")}getResponseFilePath(e,t,n,i){return Nr.join(this.getRequestPath(e,t,n),`${i}.json`)}getSharedResponseFilePath(e,t,n,i){return Nr.join(this.getSharedRequestPath(e,t,n),`${i}.json`)}loadHistory(e,t,n){let i=this.getHistoryFilePath(e,t,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:t||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,t,n){let i=this.getSharedHistoryFilePath(e,t,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:t||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,t,n){let i=this.loadHistory(e,t,n);return i?i.requests:[]}getEntriesGroupedByTicket(e,t,n){let i=this.getEntriesForEnvironment(e,t,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,t,n){let i=this.loadSharedHistory(e,t,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 t=this.getRequestPath(e.environment,e.requestPath,e.requestId),n=this.getHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(t)||ke.mkdirSync(t,{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 t=this.getSharedRequestPath(e.environment,e.requestPath,e.requestId),n=this.getSharedHistoryFilePath(e.environment,e.requestPath,e.requestId);try{ke.existsSync(t)||ke.mkdirSync(t,{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,t,n,i,s){let a=this.loadHistory(e,t,n);a||(a={environment:e,requestPath:t,requestId:n,method:i,requests:[]});let u=Cp({...s,method:i,id:yh(),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,t,n,i){let s=this.loadHistory(e,t,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,t,n,i);return ke.existsSync(u)&&ke.unlinkSync(u),!0}return!1}deleteSharedEntry(e,t,n,i){let s=this.loadSharedHistory(e,t,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,t,n,i);return ke.existsSync(u)&&ke.unlinkSync(u),!0}return!1}shareEntry(e,t,n,i,s){let a=(s||"").trim();if(!a)return!1;let u=this.loadHistory(e,t,n);if(!u)return!1;let f=u.requests.findIndex(E=>E.id===i);if(f===-1)return!1;let[h]=u.requests.splice(f,1);this.saveHistory(u);let m=this.loadSharedHistory(e,t,n)||{environment:e,requestPath:t,requestId:n,method:u.method,requests:[]};if(!m.requests.some(E=>E.id===i)){let E={...h,ticket:null,branch:a};m.requests.unshift(E),m.requests.length>100&&(m.requests=m.requests.slice(0,100)),this.saveSharedHistory(m)}let g=this.getResponseFilePath(e,t,n,i),S=this.getSharedResponseFilePath(e,t,n,i);if(ke.existsSync(g)){let E=Nr.dirname(S);ke.existsSync(E)||ke.mkdirSync(E,{recursive:!0});try{ke.renameSync(g,S)}catch{try{ke.copyFileSync(g,S)}catch(x){return console.error(`Failed to copy full response from ${g} to ${S}:`,x),!0}try{ke.unlinkSync(g)}catch(x){console.warn(`Failed to remove original full response after copy: ${g}`,x)}}}return!0}moveSharedEntry(e,t,n,i,s){let a=(s||"").trim();if(!a)return!1;let u=this.loadSharedHistory(e,t,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,t,n,i,s){let a=(i||"").trim(),u=(s||"").trim();if(!a||!u||a===u)return!1;let f=this.loadSharedHistory(e,t,n);if(!f)return!1;let h=!1;return f.requests=f.requests.map(m=>!m.ticket&&m.branch===a?(h=!0,{...m,branch:u}):m),h?(this.saveSharedHistory(f),!0):!1}clearHistory(e,t,n){let i=this.getRequestPath(e,t,n);if(ke.existsSync(i)){let s=ke.readdirSync(i);for(let a of s)ke.unlinkSync(Nr.join(i,a));ke.rmdirSync(i)}}saveFullResponse(e,t,n,i,s){let a=this.getRequestPath(e,t,n),u=this.getResponseFilePath(e,t,n,i);try{ke.existsSync(a)||ke.mkdirSync(a,{recursive:!0});let f=Ep(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,t,n,i){let s=this.getResponseFilePath(e,t,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,t,n,i){let s=this.getSharedResponseFilePath(e,t,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 sa=class{constructor(e,t){this.historyService=e;this.inferrer=t}async analyze(e,t,n){let i=n?.environment||"default",s=n?.maxSamples||50,a=this.historyService.loadHistory(i,e,t),u=this.historyService.loadSharedHistory(i,e,t),f=[...a?.requests||[],...u?.requests||[]];if(f.length===0)return{responses:{}};let h=f.slice(0,s),m=new Map;for(let S of h){let E=this.historyService.loadFullResponse(i,e,t,S.id);if(E||(E=this.historyService.loadSharedFullResponse(i,e,t,S.id)),E){let C=E.status;m.has(C)||m.set(C,[]),m.get(C).push(E)}}let g={};for(let[S,E]of m){let C=this.buildResponseDefinition(E);g[String(S)]=C}return{responses:g}}buildResponseDefinition(e){let t={};if(e.length===0)return t;let n=e[0];t.description=n.statusText||`Status ${n.status}`;let i=this.extractContentType(n.headers);if(i&&(t.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&&(t.schema=a),n.body!==void 0&&n.body!==null){let u=typeof n.body=="string"?this.tryParseJson(n.body):n.body;u!==void 0&&(t.examples={default:{summary:"Captured from history",value:u}})}}let s=this.findConsistentHeaders(e);return Object.keys(s).length>0&&(t.headers=s),t}inferBodySchema(e){if(e.body===void 0||e.body===null)return;let t=e.body;if(!(typeof t=="string"&&(t=this.tryParseJson(t),t===void 0)))return this.inferrer.inferFromValue(t)}extractContentType(e){for(let[t,n]of Object.entries(e))if(t.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 t=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 m=f.toLowerCase();t.has(m)||(n.set(m,(n.get(m)||0)+1),i.has(m)||i.set(m,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 FP=Se(s_());var wY=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,CY=/^\d{4}-\d{2}-\d{2}$/,EY=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,xY=/^https?:\/\/[^\s]+$/,RY=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,IY=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,OY=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,rs=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,t){if(!e||Object.keys(e).length===0)return{...t};if(!t||Object.keys(t).length===0)return{...e};let n=e.nullable||t.nullable;if(!e.type&&e.nullable)return{...t,nullable:!0};if(!t.type&&t.nullable)return{...e,nullable:!0};if(e.type!==t.type)return e.type==="integer"&&t.type==="number"||e.type==="number"&&t.type==="integer"?{type:"number",...n&&{nullable:!0}}:{...n&&{nullable:!0}};let i={type:e.type};return n&&(i.nullable=!0),e.type==="object"&&t.type==="object"?this.mergeObjectSchemas(e,t,n):e.type==="array"&&t.type==="array"?this.mergeArraySchemas(e,t,n):(e.format&&e.format===t.format&&(i.format=e.format),i)}inferStringFormat(e){if(wY.test(e))return"date-time";if(CY.test(e))return"date";if(EY.test(e))return"email";if(RY.test(e))return"uuid";if(xY.test(e))return"uri";if(IY.test(e))return"ipv4";if(OY.test(e))return"ipv6"}inferStringSchema(e){let t={type:"string"},n=this.inferStringFormat(e);return n&&(t.format=n),t}inferArraySchema(e){let t={type:"array"};if(e.length===0)return t;let n=this.inferFromValue(e[0]);for(let i=1;i<e.length;i++)n=this.mergeSchemas(n,this.inferFromValue(e[i]));return t.items=n,t}inferObjectSchema(e){let t={type:"object",properties:{}},n=Object.keys(e);for(let i of n)t.properties[i]=this.inferFromValue(e[i]);return t}mergeObjectSchemas(e,t,n){let i={type:"object",properties:{},...n&&{nullable:!0}},s=e.properties||{},a=t.properties||{},u=new Set([...Object.keys(s),...Object.keys(a)]);for(let g of u)s[g]&&a[g]?i.properties[g]=this.mergeSchemas(s[g],a[g]):s[g]?i.properties[g]={...s[g]}:i.properties[g]={...a[g]};let f=new Set(e.required||Object.keys(s)),h=new Set(t.required||Object.keys(a)),m=[...u].filter(g=>f.has(g)&&h.has(g));return m.length>0&&(i.required=m),i}mergeArraySchemas(e,t,n){let i={type:"array",...n&&{nullable:!0}};return e.items&&t.items?i.items=this.mergeSchemas(e.items,t.items):e.items?i.items={...e.items}:t.items&&(i.items={...t.items}),i}};var PY=new Set(["content-type","authorization","accept","cookie","host","content-length"]),da=class{constructor(e,t,n){this.collectionService=e;this.envConfigService=t;this.inferenceService=n;this.inferrer=new rs}inferrer;async export(e,t){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,t),servers:this.buildServers(t),paths:{},components:{schemas:{},securitySchemes:{}},tags:[]},s=new Map;if(n.auth&&n.auth.type!=="none"&&n.auth.type!=="inherit"){let u=this.mapAuthToSecurityScheme(n.auth);if(u){let{schemeName:f,scheme:h,requirement:m}=u;s.set(f,h),i.security=[m]}}let a=new Set;if(await this.processItems(n.items,i,s,a,void 0,n,t),s.size>0)for(let[u,f]of s)i.components.securitySchemes[u]=f;else delete i.components.securitySchemes;return i.tags=[...a].map(u=>({name:u})),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,t.format==="yaml"?FP.stringify(i,{indent:2}):JSON.stringify(i,null,2)}buildInfo(e,t){return{title:t.info?.title||e.name,description:t.info?.description||e.description||"",version:t.info?.version||e.version||"1.0.0"}}buildServers(e){let t=[],n=e.environments||[];if(n.length===0){let i=this.envConfigService.getSelectedEnvironment();if(i){let s=this.envConfigService.resolveVariables("{{baseUrl}}",i);s&&s!=="{{baseUrl}}"&&t.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),t.push({url:a,description:s}))}}return t.length===0&&t.push({url:"http://localhost",description:"Default server"}),t}async processItems(e,t,n,i,s,a,u){for(let f of e)if(f.type==="folder"){let h=f,m=s||h.name;i.add(m),h.items&&await this.processItems(h.items,t,n,i,m,a,u)}else{let h=f;await this.processRequest(h,t,n,i,s,a,u)}}async processRequest(e,t,n,i,s,a,u){let f=this.normalizeUrl(e.url),h=(e.method||"GET").toLowerCase();t.paths[f]||(t.paths[f]={});let m={};m.operationId=this.generateOperationId(e,h,f,t),m.summary=this.cleanSummary(e.name),e.description&&(m.description=e.description),(e.deprecated||this.hasDeprecatedPrefix(e.name))&&(m.deprecated=!0,this.hasDeprecatedPrefix(e.name)&&(m.summary=e.name.replace(/^\[DEPRECATED\]\s*/i,""))),s&&(m.tags=[s]);let g=this.buildParameters(e);g.length>0&&(m.parameters=g);let S=await this.buildRequestBody(e,u);S&&(m.requestBody=S);let E=await this.buildResponses(e,a.id,u);m.responses=E;let C=this.buildOperationSecurity(e,a,n);C!==void 0&&(m.security=C);let x=t.paths[f][h];x?this.mergeOperation(x,m,e.name):t.paths[f][h]=m}mergeOperation(e,t,n){if(t.summary&&t.summary!==e.summary&&(e.description=(e.description||e.summary||"")+`
|
|
262
|
+
`.trim(),Zl=class{constructor(e){this.httpClient=e}schemaCache=new Map;async fetchSchema(e,r){let n={method:"POST",url:e,headers:{"Content-Type":"application/json",Accept:"application/json",...r||{}},body:JSON.stringify({query:WU,operationName:"IntrospectionQuery"})},i=await this.httpClient.send(n);if(i.status<200||i.status>=300)throw new Error(`Introspection query failed with status ${i.status}: ${i.statusText}`);let s=typeof i.body=="string"?JSON.parse(i.body):i.body;if(s.errors&&s.errors.length>0){let u=s.errors.map(f=>f.message).join("; ");throw new Error(`Introspection query returned errors: ${u}`)}if(!s.data?.__schema)throw new Error("Invalid introspection response: missing __schema");let a=this.parseSchema(s.data.__schema,e);return this.schemaCache.set(e,a),a}getCachedSchema(e){return this.schemaCache.get(e)}extractOperations(e){let r=[],n=e.split(`
|
|
263
|
+
`),i=/^\s*(query|mutation|subscription)\s+(\w+)/;for(let s=0;s<n.length;s++){let a=n[s].match(i);a&&r.push({type:a[1],name:a[2],line:s+1})}return r.length===0&&e.trim().startsWith("{")&&r.push({type:"query",name:"(anonymous)",line:1}),r}clearCache(e){e?this.schemaCache.delete(e):this.schemaCache.clear()}schemaToSerializable(e){let r={};for(let[n,i]of e.types)r[n]=i;return{queryType:e.queryType,mutationType:e.mutationType,subscriptionType:e.subscriptionType,types:r,directives:e.directives,fetchedAt:e.fetchedAt,endpointUrl:e.endpointUrl}}parseSchema(e,r){let n=new Map;for(let s of e.types||[]){if(s.name.startsWith("__"))continue;let a={name:s.name,kind:s.kind,description:s.description||void 0,fields:(s.fields||[]).map(u=>this.parseField(u)),inputFields:(s.inputFields||[]).map(u=>this.parseArg(u)),enumValues:(s.enumValues||[]).map(u=>({name:u.name,description:u.description||void 0,isDeprecated:u.isDeprecated||!1,deprecationReason:u.deprecationReason||void 0})),interfaces:(s.interfaces||[]).map(u=>this.renderTypeRef(u)),possibleTypes:(s.possibleTypes||[]).map(u=>this.renderTypeRef(u))};n.set(a.name,a)}let i=(e.directives||[]).map(s=>({name:s.name,description:s.description||void 0,locations:s.locations||[],args:(s.args||[]).map(a=>this.parseArg(a))}));return{queryType:e.queryType?.name||"Query",mutationType:e.mutationType?.name||void 0,subscriptionType:e.subscriptionType?.name||void 0,types:n,directives:i,fetchedAt:Date.now(),endpointUrl:r}}parseField(e){return{name:e.name,type:this.renderTypeRef(e.type),args:(e.args||[]).map(r=>this.parseArg(r)),description:e.description||void 0,isDeprecated:e.isDeprecated||!1,deprecationReason:e.deprecationReason||void 0}}parseArg(e){return{name:e.name,type:this.renderTypeRef(e.type),defaultValue:e.defaultValue??void 0,description:e.description||void 0}}renderTypeRef(e){return e?e.kind==="NON_NULL"?`${this.renderTypeRef(e.ofType)}!`:e.kind==="LIST"?`[${this.renderTypeRef(e.ofType)}]`:e.name||"Unknown":"Unknown"}};var Ae=Se(require("fs")),Nr=Se(require("path"));var Xl="***",Cb=/^(authorization|proxy-authorization|www-authenticate)$|(token|cookie|secret|credential|api[_\-]?key|bearer|session[_\-]?id)/i,yn=/(password|passwd|pwd|token|cookie|secret|credential|api[_\-]?key|apikey|access[_\-]?token|refresh[_\-]?token|client[_\-]?secret|private[_\-]?key|auth[_\-]?code|bearer|session[_\-]?id|jwt)/i;function eu(t){let e={};for(let[r,n]of Object.entries(t))Cb.test(r)?e[r]=Array.isArray(n)?n.map(()=>Xl):Xl:e[r]=n;return e}function bp(t){try{let e=new URL(t),r=!1;for(let[n]of e.searchParams)yn.test(n)&&(e.searchParams.set(n,Xl),r=!0);return r?e.toString():t}catch{return t}}function Sp(t){if(t==null)return t;if(Array.isArray(t))return t.map(r=>Sp(r));if(typeof t!="object")return t;let e={};for(let[r,n]of Object.entries(t))yn.test(r)?e[r]=Xl:typeof n=="object"&&n!==null?e[r]=Sp(n):e[r]=n;return e}function YU(t){try{let e=new URLSearchParams(t),r=!1;for(let[n]of e)yn.test(n)&&(e.set(n,Xl),r=!0);return r?e.toString():t}catch{return t}}function _p(t){if(t==null)return t;if(typeof t=="object"&&!Buffer.isBuffer(t))return Sp(t);if(typeof t=="string"){let e=t.trim();if(e.startsWith("{")||e.startsWith("["))try{let r=JSON.parse(e),n=Sp(r);return JSON.stringify(n)}catch{}if(e.includes("=")&&!e.includes(`
|
|
264
|
+
`))return YU(e)}return t}function wp(t){return{...t,sentRequest:{...t.sentRequest,url:bp(t.sentRequest.url),headers:eu(t.sentRequest.headers),body:t.sentRequest.body!=null?_p(t.sentRequest.body):t.sentRequest.body}}}function Ep(t){return{...t,headers:eu(t.headers),cookies:t.cookies.map(e=>e&&typeof e=="object"&&e.name&&yn.test(e.name)?{...e,value:Xl}:e)}}function Cp(t){return{...t,url:bp(t.url),request:{headers:eu(t.request.headers),body:t.request.body!=null?_p(t.request.body):t.request.body},response:{headers:eu(t.response.headers),body:t.response.body}}}var JU=/\{\{[^}]+\}\}/;function ur(t){return typeof t=="string"&&JU.test(t)}function zR(t){let e=[];if(t.url)try{let r=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[n,i]of r.searchParams)yn.test(n)&&i&&!ur(i)&&e.push({location:"url",field:n,message:`URL query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}if(t.headers){let r=Array.isArray(t.headers)?t.headers.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.headers);for(let[n,i]of r)Cb.test(n)&&i&&!ur(i)&&e.push({location:"header",field:n,message:`Header "${n}" contains a hardcoded value. Use a {{variable}} instead (e.g. {{${n.toLowerCase().replace(/[^a-z0-9]/g,"_")}}})`})}if(t.query){let r=Array.isArray(t.query)?t.query.filter(n=>n.enabled!==!1).map(n=>[n.key,n.value]):Object.entries(t.query);for(let[n,i]of r)yn.test(n)&&i&&!ur(i)&&e.push({location:"query",field:n,message:`Query parameter "${n}" contains a hardcoded value. Use a {{variable}} instead.`})}if(t.auth){let r=t.auth;if(r.bearerToken&&!ur(r.bearerToken)&&e.push({location:"auth",field:"bearerToken",message:"Bearer token contains a hardcoded value. Store it in a {{variable}} in your .local.json environment file."}),r.basicAuth&&r.basicAuth.password&&!ur(r.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",message:"Basic auth password contains a hardcoded value. Use a {{variable}} instead."}),r.apikey||r.apiKey){let n=r.apikey||r.apiKey;n.value&&!ur(n.value)&&e.push({location:"auth",field:"apiKey.value",message:"API key contains a hardcoded value. Use a {{variable}} instead."})}}if(t.body){let r=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;r&&yp(r,e)}return e}function yp(t,e){if(t!=null){if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")||r.startsWith("[")){try{yp(JSON.parse(r),e)}catch{}return}if(r.includes("=")&&!r.includes(`
|
|
265
|
+
`)){try{let n=new URLSearchParams(r);for(let[i,s]of n)yn.test(i)&&s&&!ur(s)&&e.push({location:"body",field:i,message:`Form field "${i}" contains a hardcoded value. Use a {{variable}} instead.`})}catch{}return}return}if(Array.isArray(t)){t.forEach(r=>yp(r,e));return}if(typeof t=="object")for(let[r,n]of Object.entries(t))yn.test(r)&&n&&typeof n=="string"&&!ur(n)?e.push({location:"body",field:r,message:`Body field "${r}" contains a hardcoded value. Use a {{variable}} instead.`}):typeof n=="object"&&n!==null&&yp(n,e)}}function ia(t){return t.replace(/\./g,"_").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_").replace(/^_|_$/g,"").toLowerCase()}function KR(t){let e=[],r=new Set;function n(i){let s=i,a=2;for(;r.has(s);)s=`${i}_${a++}`;return r.add(s),s}if(t.url)try{let i=new URL(t.url.includes("://")?t.url:`http://placeholder${t.url.startsWith("/")?"":"/"}${t.url}`);for(let[s,a]of i.searchParams)yn.test(s)&&a&&!ur(a)&&e.push({location:"url",field:s,value:a,variableName:n(ia(s))})}catch{}if(t.headers){let i=Array.isArray(t.headers)?t.headers.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.headers);for(let[s,a]of i)Cb.test(s)&&a&&!ur(a)&&e.push({location:"header",field:s,value:a,variableName:n(ia(s))})}if(t.query){let i=Array.isArray(t.query)?t.query.filter(s=>s.enabled!==!1).map(s=>[s.key,s.value]):Object.entries(t.query);for(let[s,a]of i)yn.test(s)&&a&&!ur(a)&&e.push({location:"query",field:s,value:a,variableName:n(ia(s))})}if(t.auth){let i=t.auth;if(i.bearerToken&&!ur(i.bearerToken)&&e.push({location:"auth",field:"bearerToken",value:i.bearerToken,variableName:n("bearer_token")}),i.basicAuth&&i.basicAuth.password&&!ur(i.basicAuth.password)&&e.push({location:"auth",field:"basicAuth.password",value:i.basicAuth.password,variableName:n("basic_auth_password")}),i.apikey||i.apiKey){let s=i.apikey||i.apiKey;s.value&&!ur(s.value)&&e.push({location:"auth",field:"apiKey.value",value:s.value,variableName:n("api_key")})}}if(t.body){let i=typeof t.body=="object"&&"content"in t.body?t.body.content:t.body;i&&vp(i,e,r,"")}return e}function vp(t,e,r,n){if(t!=null){if(typeof t=="string"){let i=t.trim();if(i.startsWith("{")||i.startsWith("[")){try{vp(JSON.parse(i),e,r,n)}catch{}return}if(i.includes("=")&&!i.includes(`
|
|
266
|
+
`)){try{let s=new URLSearchParams(i);for(let[a,u]of s)if(yn.test(a)&&u&&!ur(u)){let f=ia(a),h=2;for(;r.has(f);)f=`${ia(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)=>vp(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(yn.test(i)&&s&&typeof s=="string"&&!ur(s)){let u=ia(i),f=2;for(;r.has(u);)u=`${ia(i)}_${f++}`;r.add(u),e.push({location:"body",field:i,path:a,value:s,variableName:u})}else typeof s=="object"&&s!==null&&vp(s,e,r,a)}}}function GR(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(`([?&])${KU(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":zU(r,n.field,n.path,n.value,i);break}}return r}function zU(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);JR(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
|
+
`)){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&&JR(a,e,r||e,n,i)}}function JR(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 KU(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var tu=class{historyPath;sharedHistoryPath;constructor(e,r){this.historyPath=e,this.sharedHistoryPath=r}getEnvironmentHistoryPath(e){return Nr.join(this.historyPath,_t(e))}getCollectionHistoryPath(e,r){return Nr.join(this.getEnvironmentHistoryPath(e),r)}getRequestPath(e,r,n){return Nr.join(this.getCollectionHistoryPath(e,r),_t(n))}getSharedEnvironmentHistoryPath(e){return Nr.join(this.sharedHistoryPath,_t(e))}getSharedCollectionHistoryPath(e,r){return Nr.join(this.getSharedEnvironmentHistoryPath(e),r)}getSharedRequestPath(e,r,n){return Nr.join(this.getSharedCollectionHistoryPath(e,r),_t(n))}getHistoryFilePath(e,r,n){return Nr.join(this.getRequestPath(e,r,n),"transactions.json")}getSharedHistoryFilePath(e,r,n){return Nr.join(this.getSharedRequestPath(e,r,n),"transactions.json")}getResponseFilePath(e,r,n,i){return Nr.join(this.getRequestPath(e,r,n),`${i}.json`)}getSharedResponseFilePath(e,r,n,i){return Nr.join(this.getSharedRequestPath(e,r,n),`${i}.json`)}loadHistory(e,r,n){let i=this.getHistoryFilePath(e,r,n);try{if(!Ae.existsSync(i))return null;let s=Ae.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(!Ae.existsSync(i))return null;let s=Ae.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{Ae.existsSync(r)||Ae.mkdirSync(r,{recursive:!0}),Ae.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{Ae.existsSync(r)||Ae.mkdirSync(r,{recursive:!0}),Ae.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=wp({...s,method:i,id:gh(),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 Ae.existsSync(u)&&Ae.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 Ae.existsSync(u)&&Ae.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(E=>E.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(E=>E.id===i)){let E={...h,ticket:null,branch:a};g.requests.unshift(E),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(Ae.existsSync(m)){let E=Nr.dirname(S);Ae.existsSync(E)||Ae.mkdirSync(E,{recursive:!0});try{Ae.renameSync(m,S)}catch{try{Ae.copyFileSync(m,S)}catch(x){return console.error(`Failed to copy full response from ${m} to ${S}:`,x),!0}try{Ae.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(Ae.existsSync(i)){let s=Ae.readdirSync(i);for(let a of s)Ae.unlinkSync(Nr.join(i,a));Ae.rmdirSync(i)}}saveFullResponse(e,r,n,i,s){let a=this.getRequestPath(e,r,n),u=this.getResponseFilePath(e,r,n,i);try{Ae.existsSync(a)||Ae.mkdirSync(a,{recursive:!0});let f=Ep(s);Ae.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(!Ae.existsSync(s))return null;let a=Ae.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(!Ae.existsSync(s))return null;let a=Ae.readFileSync(s,"utf-8");return JSON.parse(a)}catch(a){return console.error(`Failed to load shared full response for ${i}:`,a),null}}};var sa=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 E=this.historyService.loadFullResponse(i,e,r,S.id);if(E||(E=this.historyService.loadSharedFullResponse(i,e,r,S.id)),E){let C=E.status;g.has(C)||g.set(C,[]),g.get(C).push(E)}}let m={};for(let[S,E]of g){let C=this.buildResponseDefinition(E);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 FP=Se(s_());var EY=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})$/,CY=/^\d{4}-\d{2}-\d{2}$/,xY=/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,RY=/^https?:\/\/[^\s]+$/,OY=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,IY=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,PY=/^(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$/,rs=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(EY.test(e))return"date-time";if(CY.test(e))return"date";if(xY.test(e))return"email";if(OY.test(e))return"uuid";if(RY.test(e))return"uri";if(IY.test(e))return"ipv4";if(PY.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 kY=new Set(["content-type","authorization","accept","cookie","host","content-length"]),da=class{constructor(e,r,n){this.collectionService=e;this.envConfigService=r;this.inferenceService=n;this.inferrer=new rs}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"?FP.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 E=this.buildParameters(e);E.length>0&&(S.parameters=E);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}**`+(t.description?` \u2014 ${t.description}`:"")),t.tags){let i=new Set(e.tags||[]);for(let s of t.tags)i.add(s);e.tags=[...i]}if(t.parameters){e.parameters||(e.parameters=[]);for(let i of t.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(t.responses){e.responses||(e.responses={});for(let[i,s]of Object.entries(t.responses))e.responses[i]||(e.responses[i]=s)}if(t.requestBody?.content&&e.requestBody?.content)for(let[i,s]of Object.entries(t.requestBody.content))e.requestBody.content[i]||(e.requestBody.content[i]=s);else t.requestBody&&!e.requestBody&&(e.requestBody=t.requestBody)}mergeParameterSchema(e,t,n){e.schema||(e.schema={});let i=e.schema,s=t.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(t.description&&t.description!==e.description&&(e.description=(e.description||"")+(e.description?"; ":"")+t.description),t.example!==void 0&&t.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:t.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,t,n){switch(n){case"enum":{let i=new Set(e.enum||[]);for(let s of t.enum||[])i.add(s);e.enum=[...i];break}case"pattern":{t.pattern&&t.pattern!==e.pattern&&(e.pattern=`(?:${e.pattern})|(?:${t.pattern})`);break}case"range":{t.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.min(e.minimum,t.minimum):t.minimum),t.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.max(e.maximum,t.maximum):t.maximum),t.exclusiveMinimum&&(e.exclusiveMinimum=!0),t.exclusiveMaximum&&(e.exclusiveMaximum=!0),t.multipleOf!==void 0&&(e.multipleOf=e.multipleOf!==void 0?Math.min(e.multipleOf,t.multipleOf):t.multipleOf);break}case"length":{t.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.min(e.minLength,t.minLength):t.minLength),t.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.max(e.maxLength,t.maxLength):t.maxLength);break}case"array":{t.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.min(e.minItems,t.minItems):t.minItems),t.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.max(e.maxItems,t.maxItems):t.maxItems),t.uniqueItems&&(e.uniqueItems=!0);break}case"format":{if(t.format&&t.format!==e.format){let i={type:e.type||"string",format:e.format},s={type:t.type||"string",format:t.format};delete e.format,e.oneOf=[i,s]}break}case"oneOf":{if(t.oneOf)for(let i of t.oneOf)e.oneOf.some(s=>JSON.stringify(s)===JSON.stringify(i))||e.oneOf.push(i);break}}}buildVariantSchema(e){let t={};return e.type&&(t.type=e.type),e.enum&&(t.enum=[...e.enum]),e.pattern&&(t.pattern=e.pattern),e.format&&(t.format=e.format),e.minimum!==void 0&&(t.minimum=e.minimum),e.maximum!==void 0&&(t.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(t.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(t.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(t.multipleOf=e.multipleOf),e.minLength!==void 0&&(t.minLength=e.minLength),e.maxLength!==void 0&&(t.maxLength=e.maxLength),e.minItems!==void 0&&(t.minItems=e.minItems),e.maxItems!==void 0&&(t.maxItems=e.maxItems),e.uniqueItems&&(t.uniqueItems=!0),e.nullable&&(t.nullable=!0),t}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 t={};return e.enum&&(t.enum=[...e.enum]),e.pattern&&(t.pattern=e.pattern),e.format&&(t.format=e.format),e.minimum!==void 0&&(t.minimum=e.minimum),e.maximum!==void 0&&(t.maximum=e.maximum),e.exclusiveMinimum!==void 0&&(t.exclusiveMinimum=e.exclusiveMinimum),e.exclusiveMaximum!==void 0&&(t.exclusiveMaximum=e.exclusiveMaximum),e.multipleOf!==void 0&&(t.multipleOf=e.multipleOf),e.minLength!==void 0&&(t.minLength=e.minLength),e.maxLength!==void 0&&(t.maxLength=e.maxLength),e.minItems!==void 0&&(t.minItems=e.minItems),e.maxItems!==void 0&&(t.maxItems=e.maxItems),e.uniqueItems&&(t.uniqueItems=!0),e.nullable&&(t.nullable=!0),t}widenType(e,t){!t.type||t.type===e.type||(e.type?(e.type==="integer"&&t.type==="number"||e.type==="number"&&t.type==="integer")&&(e.type="number"):e.type=t.type)}normalizeUrl(e){let t=e.replace(/\{\{[^}]*(?:base[_]?url|BASE[_]?URL)[^}]*\}\}/i,"");return t=t.replace(/:([a-zA-Z_]\w*)/g,"{$1}"),t=t.replace(/\{\{(\w+)\}\}/g,"{$1}"),t.startsWith("/")||(t="/"+t),t.length>1&&t.endsWith("/")&&(t=t.slice(0,-1)),t=t.replace(/\/\//g,"/"),t}generateOperationId(e,t,n,i){let s=this.toCamelCase(e.name),a=this.collectOperationIds(i);if(a.has(s)&&(s=`${s}${t.charAt(0).toUpperCase()}${t.slice(1)}`),!s||a.has(s)){let u=n.split("/").filter(f=>f&&!f.startsWith("{"));s=t+u.map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")}return s}collectOperationIds(e){let t=new Set;if(e.paths)for(let n of Object.values(e.paths))for(let i of Object.values(n))i.operationId&&t.add(i.operationId);return t}toCamelCase(e){return e.replace(/[^a-zA-Z0-9]+(.)/g,(t,n)=>n.toUpperCase()).replace(/^[A-Z]/,t=>t.toLowerCase()).replace(/[^a-zA-Z0-9]/g,"")}buildParameters(e){let t=[];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")}t.push(s)}if(e.query)for(let n of e.query){if(!n.key)continue;let i=this.buildKeyValueParam(n,"query");t.push(i)}if(e.headers){let n=e.headers.find(i=>i.key.toLowerCase()==="cookie");if(n){let i=this.parseCookieHeader(n.value);t.push(...i)}for(let i of e.headers){if(!i.key||PY.has(i.key.toLowerCase()))continue;let s=this.buildKeyValueParam(i,"header");t.push(s)}}return t}buildKeyValueParam(e,t){let n={name:e.key,in:t,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 t=[],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();t.push({name:a,in:"cookie",schema:{type:"string"},example:u})}}return t}inferTypeFromValue(e){return/^-?\d+$/.test(e)?"integer":/^-?\d+\.\d+$/.test(e)?"number":e==="true"||e==="false"?"boolean":"string"}coerceExample(e,t){switch(t){case"integer":return parseInt(e,10)||e;case"number":return parseFloat(e)||e;case"boolean":return e==="true";default:return e}}async buildRequestBody(e,t){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[g,S]of Object.entries(e.bodySchema.content)){let E={};S.schema&&(E.schema=S.schema),S.examples&&(E.examples=S.examples),S.encoding&&(E.encoding=S.encoding),i.content[g]=E}let m=e.bodySchema.contentType||Object.keys(e.bodySchema.content)[0];if(m&&n.content){let g=this.tryParseBodyContent(n);g!==void 0&&i.content[m]&&(i.content[m].example=g)}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 m=this.tryParseBodyContent(n);m!==void 0?(a=this.inferrer.inferFromValue(m),u=m):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)){if(typeof e.content=="string")try{return JSON.parse(e.content)}catch{return e.content}return e.content}}buildFormDataSchemaFromBody(e){let t={type:"object",properties:{}},n=e.formData||e.urlencoded||[];for(let i of n)i.enabled!==!1&&(i.type==="file"?t.properties[i.key]={type:"string",format:"binary"}:t.properties[i.key]={type:"string"});return t}async buildResponses(e,t,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 m={};h.schema&&(m.schema=h.schema),h.examples&&(m.examples=h.examples),u.content[f]=m}}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,t,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 t=e.apikey||{key:"X-Api-Key",value:"",in:"header"},n=`ApiKey_${t.key||"key"}`;return{schemeName:n,scheme:{type:"apiKey",in:t.in||"header",name:t.key||"X-Api-Key"},requirement:{[n]:[]}}}case"oauth2":{let t=e.oauth2;if(!t)return;let n={};switch(t.grantType){case"client_credentials":n.clientCredentials={tokenUrl:t.tokenUrl||"",scopes:t.scope?this.parseScopes(t.scope):{}};break;case"authorization_code":n.authorizationCode={authorizationUrl:t.authUrl||"",tokenUrl:t.tokenUrl||"",scopes:t.scope?this.parseScopes(t.scope):{}};break;case"password":n.password={tokenUrl:t.tokenUrl||"",scopes:t.scope?this.parseScopes(t.scope):{}};break;case"implicit":n.implicit={authorizationUrl:t.authUrl||"",scopes:t.scope?this.parseScopes(t.scope):{}};break;default:n.clientCredentials={tokenUrl:t.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 t={};for(let n of e.split(/\s+/))n&&(t[n]="");return t}deduplicateComponents(e){let t=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,m]of Object.entries(f.responses))if(m.content)for(let g of Object.values(m.content))g.schema&&this.trackSchema(g.schema,`${a}${i}Response${h}`,t,n)}if(f.requestBody?.content)for(let h of Object.values(f.requestBody.content))h.schema&&this.trackSchema(h.schema,`${a}${i}Request`,t,n)}for(let[i,s]of t)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,t,n,i){if(!e||e.type!=="object"||!e.properties)return;let s=JSON.stringify(e);n.has(s)||n.set(s,{name:t,schema:e}),i.set(s,(i.get(s)||0)+1)}replaceInlineSchema(e,t,n){let i=JSON.stringify(t);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)}};var fA=Se(require("fs")),dA=Se(s_());var ha=class{generate(e,t){if(!e)return;let n=t||{};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,t){return e.items?[this.generate(e.items,t)]:[]}generateObject(e,t){let n={},i=e.properties||{};for(let[s,a]of Object.entries(i))t.omitReadOnly&&a.readOnly||(n[s]=this.generate(a,t));return n}generateFromAllOf(e,t,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 t?.propertyName&&(s[t.propertyName]=this.guessDiscriminatorValue(e,n)),s}generateFromOneOfAnyOf(e,t,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 t?.propertyName&&typeof s=="object"&&s!==null&&(s[t.propertyName]=this.guessDiscriminatorValue(e,n)),s}guessDiscriminatorValue(e,t){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,t){if(!e||!t)return;let n=e.match(/^#\/components\/(?:schemas\/)?(.+)$/);if(n)return t[n[1]];let i=e.match(/^#\/components\/(.+)$/);if(i)return t[i[1]]}};var Gm=Se(cA()),wa=class{async resolve(e){try{return await Gm.default.dereference(e,{dereference:{circular:"ignore"}})}catch(t){return console.error("[RefResolver] Failed to fully resolve $ref pointers:",t),e}}async bundle(e){try{return await Gm.default.bundle(e)}catch(t){return console.error("[RefResolver] Failed to bundle $ref pointers:",t),e}}async resolveFile(e){try{return await Gm.default.dereference(e,{dereference:{circular:"ignore"}})}catch(t){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,t),t}}};var m3=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Ca=class{constructor(e,t){this.collectionService=e;this.envConfigService=t;this.exampleGenerator=new ha,this.refResolver=new wa}exampleGenerator;refResolver;async import(e,t){let n=await fA.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=dA.parse(n):i=JSON.parse(n),i=await this.refResolver.resolve(i);let s=i.components?.schemas||{},a=t?.collectionName||i.info?.title||"Imported API",f={id:rt(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 g=this.mapSecurityToAuth(i.security[0],i.components.securitySchemes);g&&(f.auth=g)}let h=new Map;if(i.tags)for(let g of i.tags){let S={type:"folder",id:rt(g.name),name:g.name,description:g.description,items:[]};h.set(g.name,S),f.items.push(S)}if(i.paths)for(let[g,S]of Object.entries(i.paths))for(let E of["get","post","put","patch","delete","head","options","trace"]){let C=S[E];if(!C)continue;let x=this.processOperation(E,g,C,S,i,s),A=C.tags?.[0];if(A&&h.has(A))h.get(A).items.push(x);else if(A){let q={type:"folder",id:rt(A),name:A,items:[x]};h.set(A,q),f.items.push(q)}else f.items.push(x)}await this.collectionService.saveCollection(f);let m;return t?.environmentName&&i.servers&&(m=await this.createEnvironmentFromServers(i.servers,t.environmentName)),{collection:f,environmentCreated:m}}processOperation(e,t,n,i,s,a){let u=rt(n.operationId||`${e}-${t}`),f=`{{baseUrl}}${this.convertPathParams(t)}`,h=n.summary||n.operationId||`${e.toUpperCase()} ${t}`,m=n.deprecated===!0;m&&(h=`[DEPRECATED] ${h}`);let g={type:"request",id:u,name:h,method:e.toUpperCase(),url:f,description:n.description||"",deprecated:m},S=[...i.parameters||[],...n.parameters||[]];if(this.processParameters(g,S,a),n.requestBody&&this.processRequestBody(g,n.requestBody,a),n.responses&&(g.responseSchema=this.processResponses(n.responses,a)),n.security!==void 0&&s.components?.securitySchemes){if(Array.isArray(n.security)&&n.security.length===0)g.auth={type:"none"};else if(n.security&&n.security.length>0){let E=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);E&&(g.auth=E)}}return g}convertPathParams(e){return e.replace(/\{(\w+)\}/g,":$1")}processParameters(e,t,n){let i=[],s=[],a={},u=[];for(let f of t){let h=f.name,m=f.in,g=f.schema||{},S=f.example!==void 0?String(f.example):this.generateExampleForParam(g,n),E=f.deprecated===!0;switch(m){case"path":{if(f.description||g.type||g.format||g.enum||E||g.pattern||g.minimum!==void 0||g.maximum!==void 0||g.minLength!==void 0||g.maxLength!==void 0||g.multipleOf!==void 0||g.minItems!==void 0||g.maxItems!==void 0||g.uniqueItems||g.nullable||g.oneOf){let x={value:S};g.oneOf?(x.oneOf=g.oneOf,this.applyOneOfHints(x,g.oneOf)):(g.type&&(x.type=g.type),g.format&&(x.format=g.format),g.enum&&(x.enum=g.enum.map(String)),g.pattern&&(x.pattern=g.pattern),g.minimum!==void 0&&(x.minimum=g.minimum),g.maximum!==void 0&&(x.maximum=g.maximum),g.exclusiveMinimum!==void 0&&(x.exclusiveMinimum=g.exclusiveMinimum),g.exclusiveMaximum!==void 0&&(x.exclusiveMaximum=g.exclusiveMaximum),g.multipleOf!==void 0&&(x.multipleOf=g.multipleOf),g.minLength!==void 0&&(x.minLength=g.minLength),g.maxLength!==void 0&&(x.maxLength=g.maxLength),g.minItems!==void 0&&(x.minItems=g.minItems),g.maxItems!==void 0&&(x.maxItems=g.maxItems),g.uniqueItems&&(x.uniqueItems=!0),g.nullable&&(x.nullable=!0)),f.description&&(x.description=f.description),E&&(x.deprecated=!0),a[h]=x}else a[h]=S;break}case"query":{let C={key:h,value:S};this.applySchemaConstraints(C,g,f,E),s.push(C);break}case"header":{let C={key:h,value:S};this.applySchemaConstraints(C,g,f,E),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,t,n,i){t.oneOf?(e.oneOf=t.oneOf,this.applyOneOfHints(e,t.oneOf)):(t.type&&(e.type=t.type),t.format&&(e.format=t.format),t.enum&&(e.enum=t.enum.map(String)),t.pattern&&(e.pattern=t.pattern),t.minimum!==void 0&&(e.minimum=t.minimum),t.maximum!==void 0&&(e.maximum=t.maximum),t.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=t.exclusiveMinimum),t.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=t.exclusiveMaximum),t.multipleOf!==void 0&&(e.multipleOf=t.multipleOf),t.minLength!==void 0&&(e.minLength=t.minLength),t.maxLength!==void 0&&(e.maxLength=t.maxLength),t.minItems!==void 0&&(e.minItems=t.minItems),t.maxItems!==void 0&&(e.maxItems=t.maxItems),t.uniqueItems&&(e.uniqueItems=!0),t.nullable&&(e.nullable=!0)),n.required&&(e.required=!0),n.description&&(e.description=n.description),i&&(e.deprecated=!0)}applyOneOfHints(e,t){let n=[],i=new Set;for(let s of t)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,t){if(!e)return"";let n=this.exampleGenerator.generate(e,{components:t});return n==null?"":String(n)}processRequestBody(e,t,n){if(!t.content)return;let i=Object.keys(t.content);if(i.length===0)return;let s=this.selectPrimaryContentType(i),a=t.content[s],{bodyType:u,bodyFormat:f}=this.mapContentTypeToBodyType(s);if(e.body={type:u,...f&&{format:f},content:""},a){let m=this.generateBodyContent(a,s,n);m!==void 0&&(e.body.content=typeof m=="string"?m:JSON.stringify(m,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(t,s,n);h&&(e.bodySchema=h)}selectPrimaryContentType(e){for(let i of m3)if(e.includes(i))return i;let t=e.find(i=>i.includes("json"));if(t)return t;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,t,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,t){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",m={key:a,value:h?"":String(this.exampleGenerator.generate(f,{components:t})||""),type:h?"file":"text",enabled:!0};n.push(m)}return n}buildBodySchema(e,t,n){let i=Object.keys(e.content),s=e.content[t];if(!s?.schema)return;let a={contentType:t,schema:s.schema};if(i.length>1){a.content={};for(let f of i){let h=e.content[f],m={};h.schema&&(m.schema=h.schema),h.examples&&(m.examples=h.examples),h.encoding&&(m.encoding=h.encoding),a.content[f]=m}}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,t){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 m=h[0],g=u.content[m];f.contentType=m,g.schema&&(f.schema=g.schema),g.examples&&(f.examples=g.examples),g.schema&&Object.assign(i,this.extractUsedComponents(g.schema,t))}else{f.content={};for(let m of h){let g=u.content[m],S={};g.schema&&(S.schema=g.schema),g.examples&&(S.examples=g.examples),f.content[m]=S,g.schema&&Object.assign(i,this.extractUsedComponents(g.schema,t))}}}if(u.headers){f.headers={};for(let[h,m]of Object.entries(u.headers)){let g=m;f.headers[h]={...g.description&&{description:g.description},schema:g.schema||{type:"string"}}}}n.responses[s]=f}return Object.keys(i).length>0&&(n.components=i),n}mapSecurityToAuth(e,t){let n=Object.keys(e)[0];if(!n)return;let i=t[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,t){if(e.length>0){let n=e[0].url;this.envConfigService.setEnvironmentVariable("baseUrl",n)}return t}extractUsedComponents(e,t,n){let i=n||{};if(!e)return i;if(e.$ref){let s=this.extractRefName(e.$ref);s&&t[s]&&!i[s]&&(i[s]=t[s],this.extractUsedComponents(t[s],t,i))}if(e.properties)for(let s of Object.values(e.properties))this.extractUsedComponents(s,t,i);e.items&&this.extractUsedComponents(e.items,t,i);for(let s of["allOf","oneOf","anyOf"])if(e[s])for(let a of e[s])this.extractUsedComponents(a,t,i);return e.additionalProperties&&typeof e.additionalProperties=="object"&&this.extractUsedComponents(e.additionalProperties,t,i),i}extractRefName(e){return e.match(/^#\/components\/schemas\/(.+)$/)?.[1]}};var Ea=class{constructor(e,t,n){this.historyAnalyzer=e;this.scriptAnalyzer=t;this.inferrer=n}async infer(e,t,n,i){let s=await this.historyAnalyzer.analyze(e,t,{environment:i?.environment}),a;return i?.postResponseScript&&(a=this.scriptAnalyzer.analyze(i.postResponseScript)),this.mergeResponseSchemas(n,s,a)}async inferBodySchema(e,t,n,i,s){let a,u;if(t==="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 t==="form-data"&&i?(a=this.buildFormDataSchema(i),u="multipart/form-data"):t==="x-www-form-urlencoded"&&i?(a=this.buildFormDataSchema(i),u="application/x-www-form-urlencoded"):t==="raw"&&n==="xml"?(a={type:"string"},u="application/xml"):t==="raw"&&(n==="text"||n==="html")?(a={type:"string"},u=n==="html"?"text/html":"text/plain"):t==="binary"?(a={type:"string",format:"binary"},u="application/octet-stream"):t==="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 t={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"),t.properties[i.key]=s,i.required&&n.push(i.key)}return n.length>0&&(t.required=n),t}mergeResponseSchemas(e,t,n){let i={responses:{}};for(let[s,a]of Object.entries(t.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,t){for(let n of t.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,t)}augmentSchemaWithHints(e,t){if(!(e.type!=="object"||!e.properties))for(let n of t.fieldPaths){let i=n.split(".");this.ensureFieldPath(e,i,t)}}ensureFieldPath(e,t,n,i=""){if(t.length===0||e.type!=="object")return;e.properties||(e.properties={});let s=t[0],a=s.endsWith("[]"),u=a?s.slice(0,-2):s,f=i?`${i}.${s}`:s,h=t.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 m=n.typeHints[f];e.properties[u]={type:m||"string"};return}if(h.length>0){let m=a?e.properties[u].items:e.properties[u];m&&this.ensureFieldPath(m,h,n,f)}}mergeResponseDefinitions(e,t){let n={...e};return t.description&&(n.description=t.description),t.contentType&&(n.contentType=t.contentType),t.schema&&e.schema?n.schema=this.inferrer.mergeSchemas(e.schema,t.schema):t.schema&&(n.schema=t.schema),t.examples&&(n.examples={...e.examples||{},...t.examples}),t.content&&(n.content={...e.content||{},...t.content}),t.headers&&(n.headers={...e.headers||{},...t.headers}),n}mergeBodySchemaWithExisting(e,t){let n={...t};return t.schema?n.schema=this.inferrer.mergeSchemas(e,t.schema):n.schema=e,n}};var hA=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,pA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(?:a|an)\(['"](\w+)['"]\)/g,mA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.(?:equal|eql)\((.+?)\)/g,gA=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,yA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(true|false)/g,vA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.have\.(?:lengthOf|length\.above|length\.below)/g,xa=class{analyze(e){let t={fieldPaths:[],typeHints:{},valueHints:{},expectedStatuses:[]};if(!e||e.trim().length===0)return t;let n=this.stripComments(e);return this.extractFieldPaths(n,t),this.extractTypeAssertions(n,t),this.extractEqualityAssertions(n,t),this.extractBooleanAssertions(n,t),this.extractLengthAssertions(n,t),this.extractStatusAssertions(n,t),t.fieldPaths=[...new Set(t.fieldPaths)],t.expectedStatuses=[...new Set(t.expectedStatuses)],t}stripComments(e){let t=e.replace(/\/\*[\s\S]*?\*\//g,"");return t=t.replace(/\/\/.*$/gm,""),t}extractFieldPaths(e,t){let n,i=new RegExp(hA.source,hA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&!this.isCommonMethodCall(s)&&t.fieldPaths.push(s)}}extractTypeAssertions(e,t){let n,i=new RegExp(pA.source,pA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]),a=n[2].toLowerCase();s&&(t.typeHints[s]=this.mapAssertionType(a),t.fieldPaths.includes(s)||t.fieldPaths.push(s))}}extractEqualityAssertions(e,t){let n,i=new RegExp(mA.source,mA.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&&(t.valueHints[s]=u,typeof u=="string"?t.typeHints[s]=t.typeHints[s]||"string":typeof u=="number"?t.typeHints[s]=t.typeHints[s]||(Number.isInteger(u)?"integer":"number"):typeof u=="boolean"&&(t.typeHints[s]=t.typeHints[s]||"boolean")),t.fieldPaths.includes(s)||t.fieldPaths.push(s)}}}extractBooleanAssertions(e,t){let n,i=new RegExp(yA.source,yA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(t.typeHints[s]="boolean",t.valueHints[s]=n[2]==="true",t.fieldPaths.includes(s)||t.fieldPaths.push(s))}}extractLengthAssertions(e,t){let n,i=new RegExp(vA.source,vA.flags);for(;(n=i.exec(e))!==null;){let s=this.normalizeFieldPath(n[1]);s&&(t.typeHints[s]=t.typeHints[s]||"array",t.fieldPaths.includes(s)||t.fieldPaths.push(s))}}extractStatusAssertions(e,t){let n,i=new RegExp(gA.source,gA.flags);for(;(n=i.exec(e))!==null;){let s=parseInt(n[1],10);!isNaN(s)&&s>=100&&s<600&&t.expectedStatuses.push(s)}}normalizeFieldPath(e){let t=e.replace(/^\./,"");return t=t.replace(/\[\d+\]/g,"[]"),t}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 t=Number(e);return!isNaN(t)&&e.trim().length>0?t: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 g3={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}};function Sw(r,e){let{workspaceFolder:t,fileWatcherFactory:n,notificationService:i,workspaceStore:s,globalStore:a,secretStore:u,browserService:f,applicationInfo:h,consoleService:m}=e;r.registerValue(ne.WorkspaceFolder,t),r.registerSingleton(ne.Config,()=>new na(t,n,i)),r.registerSingleton(ne.Console,()=>m??g3),r.registerSingleton(ne.EnvironmentConfig,S=>new Kl(t,s,S.resolve(ne.Config),n)),r.registerSingleton(ne.Cookie,()=>new Jl(a)),r.registerSingleton(ne.Collection,S=>new Yl(t,S.resolve(ne.Config),n)),r.registerSingleton(ne.HttpClient,()=>new Bs),r.registerSingleton(ne.UrlBuilder,()=>new cn),r.registerSingleton(ne.InterceptorChain,()=>new Si),r.registerSingleton(ne.HttpRequest,S=>new vi(S.resolve(ne.UrlBuilder),S.resolve(ne.InterceptorChain),S.resolve(ne.HttpClient))),r.registerSingleton(ne.RequestPreprocessor,()=>new Gs),r.registerSingleton(ne.RequestHistory,S=>{let E=S.resolve(ne.EnvironmentConfig);return new tu(E.getHistoriesPath(),SA.join(E.getRootPath(),"shared-histories"))}),u&&f&&r.registerSingleton(ne.OAuth2TokenManager,S=>new Hl(u,f,S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest))),r.registerSingleton(ne.GraphQLSchemaService,S=>new Zl(S.resolve(ne.HttpClient)));let g=h??{name:"HttpForge",version:"0.0.0"};r.registerSingleton(ne.RequestPreparer,S=>new Ql(S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest),S.resolve(ne.RequestPreprocessor),S.resolve(ne.OAuth2TokenManager),g)),r.registerSingleton(ne.ScriptExecutor,S=>{let E=S.resolve(ne.Config);return new xi(S.resolve(ne.HttpRequest),E.getModulePaths())}),r.registerSingleton(ne.DataFileParser,()=>new Zs),r.registerSingleton(ne.CollectionRequestExecutor,S=>new Gl(S.resolve(ne.HttpRequest),S.resolve(ne.ScriptExecutor),S.resolve(ne.EnvironmentConfig),S.resolve(ne.RequestPreparer),"")),r.registerSingleton(ne.PersistentCookieJar,S=>new zl(S.resolve(ne.Cookie))),r.registerSingleton(ne.SchemaInferrer,()=>new rs),r.registerSingleton(ne.HistoryAnalyzer,S=>new sa(S.resolve(ne.RequestHistory),S.resolve(ne.SchemaInferrer))),r.registerSingleton(ne.ScriptAnalyzer,()=>new xa),r.registerSingleton(ne.SchemaInferenceService,S=>new Ea(S.resolve(ne.HistoryAnalyzer),S.resolve(ne.ScriptAnalyzer),S.resolve(ne.SchemaInferrer))),r.registerSingleton(ne.OpenApiExporter,S=>new da(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig),S.resolve(ne.SchemaInferenceService))),r.registerSingleton(ne.OpenApiImporter,S=>new Ca(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig)))}var Iu=class r{static _instance;services=new Map;primitives=new Map;constructor(){}static get instance(){return r._instance||(r._instance=new r),r._instance}static reset(){r._instance&&r._instance.clear(),r._instance=void 0}registerValue(e,t){return this.primitives.set(e,t),this}registerSingleton(e,t){return this.services.set(e,{factory:t,singleton:!0}),this}registerTransient(e,t){return this.services.set(e,{factory:t,singleton:!1}),this}registerInstance(e,t){return this.services.set(e,{factory:()=>t,singleton:!0,instance:t}),this}resolve(e){if(this.primitives.has(e))return this.primitives.get(e);let t=this.services.get(e);if(!t)throw new Error(`Service not registered: ${e.toString()}`);return t.singleton?(t.instance||(t.instance=t.factory(this)),t.instance):t.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 bw(){return Iu.instance}var Qm=class{cookies=new Map;getCookieKey(e,t,n){return`${t||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let t=[];for(let n of this.cookies.values())ot.isExpired(n)||(!n.domain||ot.domainMatches(e,n.domain))&&t.push(n);return t}has(e,t){return this.get(e,t)!==void 0}get(e,t){let n=this.getCookieKey(e,t),i=this.cookies.get(n);if(i&&!ot.isExpired(i))return i}set(e){let t=this.getCookieKey(e.name,e.domain,e.path);this.cookies.set(t,e)}delete(e,t,n){let i=this.getCookieKey(e,t,n);return this.cookies.delete(i)}getAll(e){if(e)return this.getCookiesForDomain(e);let t=[];for(let n of this.cookies.values())ot.isExpired(n)||t.push(n);return t}setCookiesFromResponse(e,t){let n=ot.extractDomain(e),i=ot.parseCookieHeaders(t,n);for(let s of i){let a=this.getCookieKey(s.name,s.domain,s.path);this.cookies.set(a,s)}}getCookieHeader(e){let t=ot.extractDomain(e),n=ot.extractPath(e),s=this.getCookiesForDomain(t).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return ot.formatCookieHeader(s)}clear(){this.cookies.clear()}};function wA(r,e,t){let n=r.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=E3(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(x3(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&&bA(a)){let g=_w(a,t),S=g.length>0?g[g.length-1]:void 0,E=_A(a);return{contextType:"argument_value",fieldPath:g,parentType:S,prefix:f[2]||"",currentArg:f[1],currentField:E||void 0}}if(bA(a)){let g=_w(a,t),S=g.length>0?g[g.length-1]:void 0,E=_A(a);return{contextType:"argument",fieldPath:g,parentType:S,prefix:s,currentField:E||void 0}}if(ww(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let m=_w(a,t);return{contextType:"selection_set",fieldPath:m,parentType:m.length>0?m[m.length-1]:void 0,prefix:s}}function CA(r,e){switch(e.contextType){case"root":return y3(r,e.prefix);case"selection_set":return v3(r,e);case"argument":return S3(r,e);case"argument_value":return b3(r,e);case"directive":return _3(r,e.prefix);case"fragment_type":return w3(r,e.prefix);case"variable_def":return C3(r,e.prefix);default:return[]}}function y3(r,e){let t=[],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||kY.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 E={};S.schema&&(E.schema=S.schema),S.examples&&(E.examples=S.examples),S.encoding&&(E.encoding=S.encoding),i.content[m]=E}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 fA=Se(require("fs")),dA=Se(s_());var ha=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 Km=Se(cA()),wa=class{async resolve(e){try{return await Km.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 Km.default.bundle(e)}catch(r){return console.error("[RefResolver] Failed to bundle $ref pointers:",r),e}}async resolveFile(e){try{return await Km.default.dereference(e,{dereference:{circular:"ignore"}})}catch(r){throw console.error(`[RefResolver] Failed to resolve file ${e}:`,r),r}}};var g3=["application/json","text/plain","text/html","multipart/form-data","application/x-www-form-urlencoded"],Ea=class{constructor(e,r){this.collectionService=e;this.envConfigService=r;this.exampleGenerator=new ha,this.refResolver=new wa}exampleGenerator;refResolver;async import(e,r){let n=await fA.promises.readFile(e,"utf-8"),i;e.endsWith(".yaml")||e.endsWith(".yml")?i=dA.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:rt(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:rt(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 E of["get","post","put","patch","delete","head","options","trace"]){let C=S[E];if(!C)continue;let x=this.processOperation(E,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:rt(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=rt(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 E=this.mapSecurityToAuth(n.security[0],s.components.securitySchemes);E&&(m.auth=E)}}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),E=f.deprecated===!0;switch(g){case"path":{if(f.description||m.type||m.format||m.enum||E||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),E&&(x.deprecated=!0),a[h]=x}else a[h]=S;break}case"query":{let C={key:h,value:S};this.applySchemaConstraints(C,m,f,E),s.push(C);break}case"header":{let C={key:h,value:S};this.applySchemaConstraints(C,m,f,E),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 g3)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 Ca=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 hA=/(?:jsonData|responseJson|data|json|body|response\.json\(\))\.([a-zA-Z_][\w.\[\]]*)/g,pA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(?:a|an)\(['"](\w+)['"]\)/g,mA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.(?:equal|eql)\((.+?)\)/g,gA=/(?:to\.have\.status|response\.code.*?equal)\((\d+)\)/g,yA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.be\.(true|false)/g,vA=/pm\.expect\(.*?\.([a-zA-Z_][\w.]*)\)\.to\.have\.(?:lengthOf|length\.above|length\.below)/g,xa=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(hA.source,hA.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(pA.source,pA.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(mA.source,mA.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(yA.source,yA.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(vA.source,vA.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(gA.source,gA.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 y3={log:()=>{},trace:()=>{},debug:()=>{},info:()=>{},warn:()=>{},error:()=>{},logBatch:()=>{},logRawLines:()=>{},show:()=>{},clear:()=>{},dispose:()=>{}};function Sw(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 na(r,n,i)),t.registerSingleton(ne.Console,()=>g??y3),t.registerSingleton(ne.EnvironmentConfig,S=>new Kl(r,s,S.resolve(ne.Config),n)),t.registerSingleton(ne.Cookie,()=>new Jl(a)),t.registerSingleton(ne.Collection,S=>new Yl(r,S.resolve(ne.Config),n)),t.registerSingleton(ne.HttpClient,()=>new Bs),t.registerSingleton(ne.UrlBuilder,()=>new cn),t.registerSingleton(ne.InterceptorChain,()=>new Si),t.registerSingleton(ne.HttpRequest,S=>new vi(S.resolve(ne.UrlBuilder),S.resolve(ne.InterceptorChain),S.resolve(ne.HttpClient))),t.registerSingleton(ne.RequestPreprocessor,()=>new Gs),t.registerSingleton(ne.RequestHistory,S=>{let E=S.resolve(ne.EnvironmentConfig);return new tu(E.getHistoriesPath(),SA.join(E.getRootPath(),"shared-histories"))}),u&&f&&t.registerSingleton(ne.OAuth2TokenManager,S=>new Hl(u,f,S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest))),t.registerSingleton(ne.GraphQLSchemaService,S=>new Zl(S.resolve(ne.HttpClient)));let m=h??{name:"HttpForge",version:"0.0.0"};t.registerSingleton(ne.RequestPreparer,S=>new Ql(S.resolve(ne.EnvironmentConfig),S.resolve(ne.HttpRequest),S.resolve(ne.RequestPreprocessor),S.resolve(ne.OAuth2TokenManager),m)),t.registerSingleton(ne.ScriptExecutor,S=>{let E=S.resolve(ne.Config);return new xi(S.resolve(ne.HttpRequest),E.getModulePaths())}),t.registerSingleton(ne.DataFileParser,()=>new Zs),t.registerSingleton(ne.CollectionRequestExecutor,S=>new Gl(S.resolve(ne.HttpRequest),S.resolve(ne.ScriptExecutor),S.resolve(ne.EnvironmentConfig),S.resolve(ne.RequestPreparer),"")),t.registerSingleton(ne.PersistentCookieJar,S=>new zl(S.resolve(ne.Cookie))),t.registerSingleton(ne.SchemaInferrer,()=>new rs),t.registerSingleton(ne.HistoryAnalyzer,S=>new sa(S.resolve(ne.RequestHistory),S.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.ScriptAnalyzer,()=>new xa),t.registerSingleton(ne.SchemaInferenceService,S=>new Ca(S.resolve(ne.HistoryAnalyzer),S.resolve(ne.ScriptAnalyzer),S.resolve(ne.SchemaInferrer))),t.registerSingleton(ne.OpenApiExporter,S=>new da(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig),S.resolve(ne.SchemaInferenceService))),t.registerSingleton(ne.OpenApiImporter,S=>new Ea(S.resolve(ne.Collection),S.resolve(ne.EnvironmentConfig)))}var Ou=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 bw(){return Ou.instance}var Gm=class{cookies=new Map;getCookieKey(e,r,n){return`${r||"*"}|${n||"/"}|${e}`}getCookiesForDomain(e){let r=[];for(let n of this.cookies.values())ot.isExpired(n)||(!n.domain||ot.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&&!ot.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())ot.isExpired(n)||r.push(n);return r}setCookiesFromResponse(e,r){let n=ot.extractDomain(e),i=ot.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=ot.extractDomain(e),n=ot.extractPath(e),s=this.getCookiesForDomain(r).filter(a=>a.path?n.startsWith(a.path):!0);if(s.length!==0)return ot.formatCookieHeader(s)}clear(){this.cookies.clear()}};function wA(t,e,r){let n=t.slice(0,e),i=n.match(/([a-zA-Z_]\w*)$/),s=i?i[1]:"",a=x3(n);if(a.trimEnd().endsWith("@")||s&&a.trimEnd().endsWith("@"+s))return{contextType:"directive",fieldPath:[],prefix:s};if(R3(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&&bA(a)){let m=_w(a,r),S=m.length>0?m[m.length-1]:void 0,E=_A(a);return{contextType:"argument_value",fieldPath:m,parentType:S,prefix:f[2]||"",currentArg:f[1],currentField:E||void 0}}if(bA(a)){let m=_w(a,r),S=m.length>0?m[m.length-1]:void 0,E=_A(a);return{contextType:"argument",fieldPath:m,parentType:S,prefix:s,currentField:E||void 0}}if(ww(a,"{","}")===0)return{contextType:"root",fieldPath:[],prefix:s};let g=_w(a,r);return{contextType:"selection_set",fieldPath:g,parentType:g.length>0?g[g.length-1]:void 0,prefix:s}}function EA(t,e){switch(e.contextType){case"root":return v3(t,e.prefix);case"selection_set":return S3(t,e);case"argument":return b3(t,e);case"argument_value":return _3(t,e);case"directive":return w3(t,e.prefix);case"fragment_type":return E3(t,e.prefix);case"variable_def":return C3(t,e.prefix);default:return[]}}function v3(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
|
|
273
273
|
}`},{label:"subscription",detail:"Subscription operation",insertText:`subscription \${1:OperationName} {
|
|
274
274
|
$0
|
|
275
|
-
}`},{label:"fragment",detail:"Fragment definition",insertText:"fragment ${1:FragmentName} on ${2:TypeName} {\n $0\n}"}];for(let s of n)s.label==="mutation"&&!
|
|
275
|
+
}`},{label:"fragment",detail:"Fragment definition",insertText:"fragment ${1:FragmentName} on ${2:TypeName} {\n $0\n}"}];for(let s of n)s.label==="mutation"&&!t.mutationType||s.label==="subscription"&&!t.subscriptionType||(!e||s.label.startsWith(e.toLowerCase()))&&r.push({label:s.label,kind:"keyword",detail:s.detail,insertText:s.insertText,sortOrder:0});let i=t.types.get(t.queryType);if(i)for(let s of i.fields)(!e||s.name.toLowerCase().startsWith(e.toLowerCase()))&&r.push(CA(s,1,t));return r}function S3(t,e){let r=[],n=e.parentType;if(!n)return r;let i=t.types.get(n);if(!i)return r;if(i.kind==="OBJECT"||i.kind==="INTERFACE"){for(let s of i.fields)(!e.prefix||s.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push(CA(s,0,t));(!e.prefix||"__typename".startsWith(e.prefix.toLowerCase()))&&r.push({label:"__typename",kind:"field",detail:"String!",description:"The name of the current object type",sortOrder:10})}if(i.kind==="UNION"||i.kind==="INTERFACE")for(let s of i.possibleTypes){let a=s.replace(/[!\[\]]/g,"");(!e.prefix||a.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push({label:`... on ${a}`,kind:"snippet",detail:`Inline fragment on ${a}`,insertText:`... on ${a} {
|
|
276
276
|
$0
|
|
277
|
-
}`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&
|
|
277
|
+
}`,sortOrder:5})}return(!e.prefix||"...".startsWith(e.prefix))&&r.push({label:"...",kind:"snippet",detail:"Fragment spread",insertText:"...${1:FragmentName}",sortOrder:8}),r}function b3(t,e){if(!e.currentField||!e.parentType)return[];let r=t.types.get(e.parentType);if(!r)return[];let n=r.fields.find(s=>s.name===e.currentField);if(!n)return[];let i=[];for(let s of n.args)(!e.prefix||s.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&i.push({label:s.name,kind:"argument",detail:s.type,description:s.description,insertText:`${s.name}: `,sortOrder:0});return i}function _3(t,e){if(!e.currentArg||!e.currentField||!e.parentType)return[];let r=[],n=t.types.get(e.parentType);if(!n)return r;let i=n.fields.find(f=>f.name===e.currentField);if(!i)return r;let s=i.args.find(f=>f.name===e.currentArg);if(!s)return r;let a=s.type.replace(/[!\[\]]/g,""),u=t.types.get(a);if(u&&u.kind==="ENUM")for(let f of u.enumValues)(!e.prefix||f.name.toLowerCase().startsWith(e.prefix.toLowerCase()))&&r.push({label:f.name,kind:"enum",detail:u.name,description:f.description,deprecated:f.isDeprecated,sortOrder:0});else if(a==="Boolean")for(let f of["true","false"])(!e.prefix||f.startsWith(e.prefix.toLowerCase()))&&r.push({label:f,kind:"keyword",detail:"Boolean",sortOrder:0});return r}function w3(t,e){let r=[];for(let n of t.directives)if(!e||n.name.toLowerCase().startsWith(e.toLowerCase())){let i=n.args.length>0?`(${n.args.map(s=>`${s.name}: ${s.type}`).join(", ")})`:"";r.push({label:`@${n.name}`,kind:"directive",detail:i||void 0,description:n.description,insertText:n.args.length>0?`@${n.name}($1)`:`@${n.name}`,sortOrder:0})}return r}function E3(t,e){let r=[];for(let[n,i]of t.types)(i.kind==="OBJECT"||i.kind==="INTERFACE"||i.kind==="UNION")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&r.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return r}function C3(t,e){let r=[];for(let[n,i]of t.types)(i.kind==="SCALAR"||i.kind==="INPUT_OBJECT"||i.kind==="ENUM")&&(!e||n.toLowerCase().startsWith(e.toLowerCase()))&&r.push({label:n,kind:"type",detail:i.kind,description:i.description,sortOrder:0});return r}function CA(t,e,r){let n=t.type.replace(/[!\[\]]/g,""),i=!1;if(r){let a=r.types.get(n);i=!!a&&(a.kind==="OBJECT"||a.kind==="INTERFACE"||a.kind==="UNION")}else i=!new Set(["String","Int","Float","Boolean","ID"]).has(n);let s=t.name;if(t.args.length>0){let a=t.args.filter(u=>u.type.endsWith("!"));if(a.length>0){let u=a.map((f,h)=>`${f.name}: \${${h+1}}`).join(", ");s=`${t.name}(${u})`}}return i&&(s+=` {
|
|
278
278
|
$0
|
|
279
|
-
}`),{label:r.name,kind:"field",detail:r.type,description:r.description,insertText:s,deprecated:r.isDeprecated,sortOrder:e}}function E3(r){return r.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function ww(r,e,t){let n=0;for(let i of r)i===e?n++:i===t&&n--;return n}function bA(r){return ww(r,"(",")")>0}function x3(r){if(ww(r,"(",")")<=0)return!1;let t=r.indexOf("{"),n=t>=0?r.slice(0,t):r;return/\$\w+\s*:\s*\w*$/.test(n)}function _A(r){let e=0;for(let t=r.length-1;t>=0;t--)if(r[t]===")")e++;else if(r[t]==="("){if(e===0){let i=r.slice(0,t).trimEnd().match(/(\w+)$/);return i?i[1]:null}e--}return null}function _w(r,e){if(!e)return[];let t=[],n=e.queryType,i=r.match(/\b(query|mutation|subscription)\b/);i&&(i[1]==="mutation"&&e.mutationType?n=e.mutationType:i[1]==="subscription"&&e.subscriptionType&&(n=e.subscriptionType)),t.push(n);let s=R3(r),a=e.types.get(n);for(let u=0;u<s.length;u++){let f=s[u];if(f!=="{"){if(f==="}"){t.pop(),a=t.length>0?e.types.get(t[t.length-1]):void 0;continue}if(u+1<s.length&&(s[u+1]==="{"||s[u+1]==="(")){let h=u+1;if(s[h]==="("){let m=1;for(h++;h<s.length&&m>0;)s[h]==="("?m++:s[h]===")"&&m--,h++}if(h<s.length&&s[h]==="{"&&a){let m=a.fields.find(g=>g.name===f);if(m){let g=m.type.replace(/[!\[\]]/g,"");t.push(g),a=e.types.get(g)}}}}}return t}function R3(r){let e=[],t=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=t.exec(r))!==null;)e.push(n[1]);return e}var Vf={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1};var Zm={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Cw={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"};function Ew(r,e,t){let n=String(r).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${t}.json`}function xA(r){return{index:r.i,iteration:r.it,name:r.n,method:Cw[r.m]||"GET",status:r.s,duration:r.d,passed:r.p,assertionsPassed:r.ap,assertionsFailed:r.af,requestId:r.r,resultFile:Ew(r.i,r.it,r.r),error:r.e}}var Lt=Se(require("fs/promises")),Lr=Se(require("path"));function Xm(r,e){if(r.length===0)return 0;let t=Math.ceil(e/100*r.length)-1;return r[Math.max(0,Math.min(t,r.length-1))]}var eg=class{constructor(e){this.configService=e;let t=e.getRunnerConfig();this.basePath=e.getResultsPath(),this.indexPageSize=t.indexPageSize,this.recentErrorsLimit=t.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,t,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:t,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,t){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=_t(t.requestId),u=`result-${s}-iter-${i}-${a}.json`,f=Lr.join(this.currentRunPath,"results",u),h={index:this.resultIndex,iteration:e,requestId:t.requestId,name:t.name,method:t.executedRequest.method,url:t.executedRequest.url,status:t.response.status,statusText:t.response.statusText||"",duration:t.duration,passed:t.passed,timestamp:n,request:{headers:t.executedRequest.headers,body:t.executedRequest.body.content},response:{headers:t.response.headers,body:t.response.body},assertions:t.assertions.map(E=>({name:E.name,passed:E.passed,message:E.message||null})),error:t.error||null};await Lt.writeFile(f,JSON.stringify(xp(h),null,2),"utf-8");let m=t.assertions.filter(E=>E.passed).length,g=t.assertions.filter(E=>!E.passed).length,S={i:this.resultIndex,it:e,n:t.name,m:Zm[t.executedRequest.method.toUpperCase()]??0,s:t.response.status,d:t.duration,p:t.passed,ap:m,af:g,r:t.requestId,e:t.passed?null:t.error||null};return this.currentIndexPage.push(S),this.currentIndexPage.length>=this.indexPageSize&&await this.writeCurrentIndexPage(),this.updateStats(t),this.requestDurations[t.requestId]||(this.requestDurations[t.requestId]=[]),this.requestDurations[t.requestId].push(t.duration),t.passed||(this.recentErrors.unshift({timestamp:n,iteration:e,requestName:t.name,status:t.response.status,error:t.error||`Status ${t.response.status}`,resultFile:u}),this.recentErrors.length>this.recentErrorsLimit&&this.recentErrors.pop()),S}async finalizeRun(e="completed"){if(this.currentManifest){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 t in this.currentManifest.requestStats){let n=this.currentManifest.requestStats[t],i=this.requestDurations[t]||[];n.count>0&&(n.avgDuration=Math.round(n.totalDuration/n.count)),n.minDuration===Number.MAX_SAFE_INTEGER&&(n.minDuration=0),i.length>0&&(i.sort((s,a)=>s-a),n.p50=Xm(i,50),n.p90=Xm(i,90),n.p95=Xm(i,95),n.p99=Xm(i,99))}this.requestDurations={},await this.saveManifest(),this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0}}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,t,n){let i=Lr.join(this.basePath,e,t,"results",n),s=await Lt.readFile(i,"utf-8");return JSON.parse(s)}async getIndexPage(e,t,n){let i=Lr.join(this.basePath,e,t,"index",`page-${String(n).padStart(4,"0")}.json`),s=await Lt.readFile(i,"utf-8");return JSON.parse(s)}async getManifest(e,t){let n=Lr.join(this.basePath,e,t,"manifest.json"),i=await Lt.readFile(n,"utf-8");return JSON.parse(i)}async listRuns(e){let t=Lr.join(this.basePath,e);try{let n=await Lt.readdir(t),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(t=>t.isDirectory()).map(t=>t.name)}catch{return[]}}async deleteRun(e,t){let n=Lr.join(this.basePath,e,t);await Lt.rm(n,{recursive:!0,force:!0})}async cleanupOldRuns(){let t=this.configService.getRunnerConfig().resultsRetentionDays;if(t===0)return{deleted:0,freed:0};let n=new Date;n.setDate(n.getDate()-t);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 m=Lr.join(this.basePath,u,h.runId),g=await this.getDirectorySize(m);await Lt.rm(m,{recursive:!0,force:!0}),i++,s+=g}}return{deleted:i,freed:s}}generateRunId(){let e=new Date,t=e.toISOString().slice(0,10).replace(/-/g,""),n=e.toTimeString().slice(0,8).replace(/:/g,""),i=String(e.getMilliseconds()).padStart(3,"0");return`run-${t}-${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`,t=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(t,JSON.stringify(n),"utf-8"),this.currentPageNumber++,this.currentIndexPage=[]}updateStats(e){if(!this.currentManifest)return;let t=this.currentManifest.stats,n=this.currentManifest.requestStats;t.totalRequests++,t.totalDuration+=e.duration,t.minDuration=Math.min(t.minDuration,e.duration),t.maxDuration=Math.max(t.maxDuration,e.duration),e.passed?t.passed++:t.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 t=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())t+=await this.getDirectorySize(s);else{let a=await Lt.stat(s);t+=a.size}}}catch{}return t}};function tg(r,e){if(r.length===0)return 0;let t=Math.ceil(e/100*r.length)-1;return r[Math.max(0,t)]}function xw(r){return{name:r,count:0,passed:0,failed:0,skipped:0,min:0,max:0,avg:0,p50:0,p90:0,p95:0,p99:0,durations:[]}}function RA(r){if(r.durations.length===0){r.min=0,r.max=0,r.avg=0,r.p50=0,r.p90=0,r.p95=0,r.p99=0;return}let e=[...r.durations].sort((n,i)=>n-i),t=r.durations.reduce((n,i)=>n+i,0);r.min=e[0],r.max=e[e.length-1],r.avg=Math.round(t/r.durations.length),r.p50=tg(e,50),r.p90=tg(e,90),r.p95=tg(e,95),r.p99=tg(e,99)}var rg=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=xw("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=xw("Overall"),this.errors.clear(),this.startTime=0}complete(){this.summary.isRunning=!1,this.startTime>0&&(this.summary.duration=Date.now()-this.startTime)}addResult(e,t,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,xw(e));let u=this.byRequest.get(e);if(u.count++,n?u.passed++:u.failed++,u.durations.push(t),RA(u),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(t),RA(this.overall),s){let f=this.errors.get(s)||0;this.errors.set(s,f+1)}}getStatistics(){let e=[];return this.errors.forEach((t,n)=>{e.push({message:n,count:t})}),e.sort((t,n)=>n.count-t.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}}};var Pt=Se(require("fs")),vo=Se(require("path"));var ng=class{constructor(e,t,n){this.collectionService=e;this.configService=t;this.suitesDir=t.getSuitesPath(),this.onSuitesChanged=n?.onSuitesChanged,this.ensureSuitesDir(),this.loadSuites(),n?.watch!==!1&&this.setupFileWatcher()}suitesDir;suites=new Map;fileWatcher=null;debounceTimer=null;onSuitesChanged;ensureSuitesDir(){Pt.existsSync(this.suitesDir)||Pt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Pt.watch(this.suitesDir,(e,t)=>{t&&!t.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(),!Pt.existsSync(this.suitesDir))return;let e=Pt.readdirSync(this.suitesDir);for(let t of e)if(t.endsWith(".suite.json"))try{let n=vo.join(this.suitesDir,t),i=Pt.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 ${t}:`,n)}}async getAllSuites(){return Array.from(this.suites.values())}async getSuite(e){return this.suites.get(e)}async createSuite(e,t=[]){let n=Date.now(),i={id:rt(e),name:e,requests:t,config:{...Vf},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,t){let n=this.suites.get(e);if(!n)throw new Error(`Suite not found: ${e}`);let i=await this.createSuite(t,n.requests.map(u=>({...u})));i.config={...n.config},i.description=n.description;let s=vo.join(this.suitesDir,e),a=vo.join(this.suitesDir,i.id);return Pt.existsSync(s)&&this.copyDirRecursive(s,a),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,t){Pt.existsSync(t)||Pt.mkdirSync(t,{recursive:!0});for(let n of Pt.readdirSync(e,{withFileTypes:!0})){let i=vo.join(e,n.name),s=vo.join(t,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Pt.copyFileSync(i,s)}}async deleteSuite(e){let t=this.suites.get(e);if(!t)return!1;let n=`${t.id}.suite.json`,i=vo.join(this.suitesDir,n);try{return Pt.existsSync(i)&&Pt.unlinkSync(i),this.suites.delete(e),!0}catch(s){return console.error("[TestSuiteService] Failed to delete suite:",s),!1}}async createTempSuiteFromCollection(e){let t=this.collectionService.getCollection(e);if(!t){console.error(`[TestSuiteService] Collection not found: ${e}`);return}let n=[];this.extractRequestsFromCollection(t,e,t.name,"",n);let i=Date.now();return{id:`temp-${rt(t.name)}`,name:t.name,requests:n,config:{...Vf},isTemporary:!0,createdAt:i,updatedAt:i}}async saveTempSuite(e,t){let n=Date.now(),i={...e,id:rt(t),name:t,isTemporary:!1,createdAt:n,updatedAt:n};return await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}getAllAvailableRequests(){let e=[],t=this.collectionService.getAllCollections();for(let n of t)this.extractRequestsFromCollection(n,n.id,n.name,"",e);return e}extractRequestsFromCollection(e,t,n,i,s){if(e.requests)for(let a of e.requests)s.push({collectionId:t,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,t,n,u,s)}else s.push({collectionId:t,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,t,n,u,s)}}async saveSuiteToDisk(e){this.ensureSuitesDir();let t=`${e.id}.suite.json`,n=vo.join(this.suitesDir,t),i=JSON.stringify(e,null,2);Pt.writeFileSync(n,i,"utf-8")}};var ls=Se(require("fs")),Ra=Se(require("path"));var ig=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 t=Ra.join(this.suiteDir,e,"request.json");if(ls.existsSync(t))try{let n=JSON.parse(ls.readFileSync(t,"utf-8")),i=Ra.join(this.suiteDir,e,"scripts"),s=lc(i);return s&&(n.scripts=s),n}catch(n){console.error(`[TestSuiteStore] Failed to load request from ${e}:`,n);return}}saveSuiteRequest(e,t){if(!this.suiteDir)return;let n=Ra.join(this.suiteDir,e);ls.mkdirSync(n,{recursive:!0});let i=t.scripts,s={...t};if(delete s.scripts,ls.writeFileSync(Ra.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=Ra.join(n,"scripts");uc(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:ls.existsSync(Ra.join(this.suiteDir,e,"request.json"))}resolveRequest(e){let t=e.slug?this.loadSuiteRequest(e.slug):void 0,n=this.collectionService.getCollection(e.collectionId);if(t){let s,a=[];if(n){s=n.scripts;let u=this.findRequestInCollection(n,e.requestId);u&&(a=u.folderScriptsChain)}return{request:t,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,t,n=[]){let i=e.items||[];return this.searchItems(i,t,n)}searchItems(e,t,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||[],t,a);if(u)return u}else if(i.id===t)return{request:this.normalizeRequest(i),folderScriptsChain:n}}normalizeRequest(e){let{type:t,...n}=e;return n}normalizeKeyValues(e){return e?Array.isArray(e)?e.map(t=>({key:t.key||"",value:t.value||"",enabled:t.enabled!==!1})):typeof e=="object"?Object.entries(e).map(([t,n])=>({key:t,value:String(n||""),enabled:!0})):[]:[]}getRequestWithContext(e,t){if(!this.suite)return;let n=this.suite.requests.find(i=>i.collectionId===e&&i.requestId===t);if(n)return this.resolveRequest(n)}getRequestBySlug(e){if(!this.suite)return;let t=this.suite.requests.find(n=>n.slug===e);if(t)return this.resolveRequest(t)}getAllSuiteRequests(){if(!this.suite)return[];let e=[];for(let t of this.suite.requests){let n=this.resolveRequest(t);n&&e.push(n)}return e}getResolvedRequests(){if(!this.suite)return[];let e=[];for(let t of this.suite.requests){if(!t.slug){let i=this.suite.requests.map(s=>s.slug||"").filter(Boolean);t.slug=mi(t.name||"request",i)}let n=this.resolveRequest(t);if(n){let i=this.collectionService.getCollection(t.collectionId);e.push({id:`${t.collectionId}:${t.requestId}`,collectionId:t.collectionId,requestId:t.requestId,name:n.request.name||"Unknown",method:n.request.method||"GET",url:n.request.url||"",collectionName:i?.name||"Unknown Collection",folderPath:t.folderPath||"",enabled:t.enabled!==!1,hasEmbeddedRequest:this.hasEmbeddedRequest(t.slug),slug:t.slug})}}return e}getSelectedRequests(e){let t=[];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&&t.push(u)}}return t}addRequest(e,t){if(this.suite){if(this.suiteDir&&t){if(e.slug)e.slug=this.resolveUniqueSlug(e.slug);else{let n=this.suite.requests.map(i=>i.slug||"").filter(Boolean);e.slug=mi(e.name||t.name||"request",n)}this.saveSuiteRequest(e.slug,t)}this.suite.requests.push(e)}}resolveUniqueSlug(e){if(!this.suite)return e;let t=new Set(this.suite.requests.map(i=>i.slug).filter(Boolean));if(!t.has(e))return e;let n=2;for(;t.has(`${e}-${n}`);)n++;return`${e}-${n}`}removeRequest(e){this.suite&&(this.suite.requests=this.suite.requests.filter(t=>t.requestId!==e))}reorderRequests(e){if(!this.suite)return;let t=new Map;for(let i of this.suite.requests)t.set(`${i.collectionId}:${i.requestId}`,i);let n=[];for(let i of e){let s=t.get(i);s&&n.push(s)}this.suite.requests=n}updateSuiteRequest(e,t){if(!this.suite||!this.suiteDir)return;this.saveSuiteRequest(e,t);let n=this.suite.requests.find(i=>i.slug===e);n&&(n.name=t.name||n.name,n.method=t.method||n.method)}resyncFromCollection(e){if(!this.suite||!this.suiteDir)return;let t=this.suite.requests.find(s=>s.slug===e);if(!t)return;let n=this.collectionService.getCollection(t.collectionId);if(!n)return;let i=this.findRequestInCollection(n,t.requestId);if(i)return this.saveSuiteRequest(e,i.request),t.name=i.request.name||t.name,t.method=i.request.method||t.method,i.request}};0&&(module.exports={BODY_FILE_MAP,CONFIG_FILES,CollectionLoader,CollectionLoaderFactory,CollectionRequestExecutor,CollectionService,ConfigService,CookieJar,CookieService,CookieUtils,DEFAULT_CONFIG,DEFAULT_REQUEST_SETTINGS,DEFAULT_SUITE_CONFIG,DYNAMIC_VARIABLES,DataFileParser,EnvironmentConfigService,EnvironmentResolver,ExampleGenerator,FetchHttpClient,FolderCollectionLoader,FolderCollectionStore,ForgeContainer,ForgeEnv,GraphQLSchemaService,HTTP_METHOD_MAP,HTTP_METHOD_REVERSE,HistoryAnalyzer,HttpForgeParser,HttpRequestService,InMemoryCookieJar,InterceptorChain,JsonCollectionLoader,LoggingRequestInterceptor,METADATA_FILES,ModuleLoader,NodeFileSystem,NodeHttpClient,OAuth2TokenManager,OpenApiExporter,OpenApiImporter,ParserRegistry,PersistentCookieJar,ROOT_DIRECTORIES,RefResolver,RequestExecutor,RequestHistoryService,RequestHistoryStore,RequestPreparer,RequestPreprocessor,RequestScriptSession,ResultStorageService,RetryErrorInterceptor,SCHEMA_FILES,SCRIPTS_DIR,SCRIPT_FILES,SchemaInferenceService,SchemaInferrer,ScriptAnalyzer,ScriptExecutor,ServiceContainer,ServiceIdentifiers,StatisticsService,TestSuiteService,TestSuiteStore,TimingResponseInterceptor,UrlBuilder,VariableInterpolator,VariableResolver,applyExtractionPlan,applyFilterChain,augmentWithDynamicVars,buildExtractionPlan,buildResultFileName,cleanupOldBodyFiles,concatenateScripts,createExpectChain,createLodashShim,createModuleLoader,createMomentShim,createResponseObject,createScriptConsole,createTestFunction,createVariableResolver,deepClone,deleteItemFromTree,detectSensitiveData,evaluateExpression,expandSummary,exportCollectionToRestClient,findItemById,formatBytes,formatConsoleOutput,formatDuration,generateId,generateSlug,generateUUID,getCompletions,getRestClientExportFolder,getServiceContainer,hasChanged,isExpression,isPlainObject,isSystemEnvironmentFile,loadEnvironmentsFromFolder,mergeHeadersCaseInsensitive,mergeRequestSettings,normalizeHeaders,parseFilterChain,parsePostmanEnvironment,parsePostmanEnvironmentFile,parseQueryContext,prepareBodyForSave,readBodyFromDir,readSchemaFile,readScriptsFromDir,redactBody,redactFullResponse,redactFullResultDetails,redactHeaders,redactHistoryEntry,redactUrl,registerCoreServices,resolveDynamicVariable,resolveDynamicVariablesInString,safeJsonParse,sanitizeName,searchForItemPath,sortItemsByOrder,writeEnvFile,writeFolderItems,writeSchemaFiles,writeScriptFile,writeScriptsToDir});
|
|
279
|
+
}`),{label:t.name,kind:"field",detail:t.type,description:t.description,insertText:s,deprecated:t.isDeprecated,sortOrder:e}}function x3(t){return t.replace(/"""[\s\S]*?"""/g,'""').replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/#[^\n]*/g,"")}function ww(t,e,r){let n=0;for(let i of t)i===e?n++:i===r&&n--;return n}function bA(t){return ww(t,"(",")")>0}function R3(t){if(ww(t,"(",")")<=0)return!1;let r=t.indexOf("{"),n=r>=0?t.slice(0,r):t;return/\$\w+\s*:\s*\w*$/.test(n)}function _A(t){let e=0;for(let r=t.length-1;r>=0;r--)if(t[r]===")")e++;else if(t[r]==="("){if(e===0){let i=t.slice(0,r).trimEnd().match(/(\w+)$/);return i?i[1]:null}e--}return null}function _w(t,e){if(!e)return[];let r=[],n=e.queryType,i=t.match(/\b(query|mutation|subscription)\b/);i&&(i[1]==="mutation"&&e.mutationType?n=e.mutationType:i[1]==="subscription"&&e.subscriptionType&&(n=e.subscriptionType)),r.push(n);let s=O3(t),a=e.types.get(n);for(let u=0;u<s.length;u++){let f=s[u];if(f!=="{"){if(f==="}"){r.pop(),a=r.length>0?e.types.get(r[r.length-1]):void 0;continue}if(u+1<s.length&&(s[u+1]==="{"||s[u+1]==="(")){let h=u+1;if(s[h]==="("){let g=1;for(h++;h<s.length&&g>0;)s[h]==="("?g++:s[h]===")"&&g--,h++}if(h<s.length&&s[h]==="{"&&a){let g=a.fields.find(m=>m.name===f);if(g){let m=g.type.replace(/[!\[\]]/g,"");r.push(m),a=e.types.get(m)}}}}}return r}function O3(t){let e=[],r=/([a-zA-Z_]\w*|[{}(),:=@!$\[\].]|\.\.\.|"[^"]*"|\d+)/g,n;for(;(n=r.exec(t))!==null;)e.push(n[1]);return e}var Hf={iterations:1,delayBetweenRequests:0,stopOnError:!1,readFromSharedSession:!1,writeToSharedSession:!1};var Qm={GET:0,POST:1,PUT:2,DELETE:3,PATCH:4,HEAD:5,OPTIONS:6,TRACE:7,CONNECT:8},Ew={0:"GET",1:"POST",2:"PUT",3:"DELETE",4:"PATCH",5:"HEAD",6:"OPTIONS",7:"TRACE",8:"CONNECT"};function Cw(t,e,r){let n=String(t).padStart(6,"0"),i=String(e).padStart(4,"0");return`result-${n}-iter-${i}-${r}.json`}function xA(t){return{index:t.i,iteration:t.it,name:t.n,method:Ew[t.m]||"GET",status:t.s,duration:t.d,passed:t.p,assertionsPassed:t.ap,assertionsFailed:t.af,requestId:t.r,resultFile:Cw(t.i,t.it,t.r),error:t.e}}var Lt=Se(require("fs/promises")),Lr=Se(require("path"));function Zm(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 Xm=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=_t(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(E=>({name:E.name,passed:E.passed,message:E.message||null})),error:r.error||null};await Lt.writeFile(f,JSON.stringify(Cp(h),null,2),"utf-8");let g=r.assertions.filter(E=>E.passed).length,m=r.assertions.filter(E=>!E.passed).length,S={i:this.resultIndex,it:e,n:r.name,m:Qm[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){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 r in this.currentManifest.requestStats){let n=this.currentManifest.requestStats[r],i=this.requestDurations[r]||[];n.count>0&&(n.avgDuration=Math.round(n.totalDuration/n.count)),n.minDuration===Number.MAX_SAFE_INTEGER&&(n.minDuration=0),i.length>0&&(i.sort((s,a)=>s-a),n.p50=Zm(i,50),n.p90=Zm(i,90),n.p95=Zm(i,95),n.p99=Zm(i,99))}this.requestDurations={},await this.saveManifest(),this.currentRunPath=null,this.currentRunId=null,this.currentSuiteId=null,this.currentManifest=null,this.currentIndexPage=[],this.recentErrors=[],this.resultIndex=0}}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 eg(t,e){if(t.length===0)return 0;let r=Math.ceil(e/100*t.length)-1;return t[Math.max(0,r)]}function xw(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 RA(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=eg(e,50),t.p90=eg(e,90),t.p95=eg(e,95),t.p99=eg(e,99)}var tg=class{summary;byRequest;overall;errors;startTime=0;constructor(){this.summary=this.createEmptySummary(),this.byRequest=new Map,this.overall=xw("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=xw("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,xw(e));let u=this.byRequest.get(e);if(u.count++,n?u.passed++:u.failed++,u.durations.push(r),RA(u),this.overall.count++,n?this.overall.passed++:this.overall.failed++,this.overall.durations.push(r),RA(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}}};var Pt=Se(require("fs")),vo=Se(require("path"));var rg=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(){Pt.existsSync(this.suitesDir)||Pt.mkdirSync(this.suitesDir,{recursive:!0})}setupFileWatcher(){try{this.fileWatcher=Pt.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(),!Pt.existsSync(this.suitesDir))return;let e=Pt.readdirSync(this.suitesDir);for(let r of e)if(r.endsWith(".suite.json"))try{let n=vo.join(this.suitesDir,r),i=Pt.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:rt(e),name:e,requests:r,config:{...Hf},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=vo.join(this.suitesDir,e),a=vo.join(this.suitesDir,i.id);return Pt.existsSync(s)&&this.copyDirRecursive(s,a),await this.saveSuiteToDisk(i),this.suites.set(i.id,i),i}copyDirRecursive(e,r){Pt.existsSync(r)||Pt.mkdirSync(r,{recursive:!0});for(let n of Pt.readdirSync(e,{withFileTypes:!0})){let i=vo.join(e,n.name),s=vo.join(r,n.name);n.isDirectory()?this.copyDirRecursive(i,s):Pt.copyFileSync(i,s)}}async deleteSuite(e){let r=this.suites.get(e);if(!r)return!1;let n=`${r.id}.suite.json`,i=vo.join(this.suitesDir,n);try{return Pt.existsSync(i)&&Pt.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-${rt(r.name)}`,name:r.name,requests:n,config:{...Hf},isTemporary:!0,createdAt:i,updatedAt:i}}async saveTempSuite(e,r){let n=Date.now(),i={...e,id:rt(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=vo.join(this.suitesDir,r),i=JSON.stringify(e,null,2);Pt.writeFileSync(n,i,"utf-8")}};var ls=Se(require("fs")),Ra=Se(require("path"));var ng=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=Ra.join(this.suiteDir,e,"request.json");if(ls.existsSync(r))try{let n=JSON.parse(ls.readFileSync(r,"utf-8")),i=Ra.join(this.suiteDir,e,"scripts"),s=lc(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=Ra.join(this.suiteDir,e);ls.mkdirSync(n,{recursive:!0});let i=r.scripts,s={...r};if(delete s.scripts,ls.writeFileSync(Ra.join(n,"request.json"),JSON.stringify(s,null,2),"utf-8"),i){let a=Ra.join(n,"scripts");uc(a,{preRequest:i.preRequest||void 0,postResponse:i.postResponse||void 0})}}hasEmbeddedRequest(e){return!this.suiteDir||!e?!1:ls.existsSync(Ra.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=mi(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=mi(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}};0&&(module.exports={BODY_FILE_MAP,CONFIG_FILES,CollectionLoader,CollectionLoaderFactory,CollectionRequestExecutor,CollectionService,ConfigService,CookieJar,CookieService,CookieUtils,DEFAULT_CONFIG,DEFAULT_REQUEST_SETTINGS,DEFAULT_SUITE_CONFIG,DYNAMIC_VARIABLES,DataFileParser,EnvironmentConfigService,EnvironmentResolver,ExampleGenerator,FetchHttpClient,FolderCollectionLoader,FolderCollectionStore,ForgeContainer,ForgeEnv,GraphQLSchemaService,HTTP_METHOD_MAP,HTTP_METHOD_REVERSE,HistoryAnalyzer,HttpForgeParser,HttpRequestService,InMemoryCookieJar,InterceptorChain,JsonCollectionLoader,LoggingRequestInterceptor,METADATA_FILES,ModuleLoader,NodeFileSystem,NodeHttpClient,OAuth2TokenManager,OpenApiExporter,OpenApiImporter,ParserRegistry,PersistentCookieJar,ROOT_DIRECTORIES,RefResolver,RequestExecutor,RequestHistoryService,RequestHistoryStore,RequestPreparer,RequestPreprocessor,RequestScriptSession,ResultStorageService,RetryErrorInterceptor,SCHEMA_FILES,SCRIPTS_DIR,SCRIPT_FILES,SchemaInferenceService,SchemaInferrer,ScriptAnalyzer,ScriptExecutor,ServiceContainer,ServiceIdentifiers,StatisticsService,TestSuiteService,TestSuiteStore,TimingResponseInterceptor,UrlBuilder,VariableInterpolator,VariableResolver,applyExtractionPlan,applyFilterChain,augmentWithDynamicVars,buildExtractionPlan,buildResultFileName,cleanupOldBodyFiles,concatenateScripts,createExpectChain,createLodashShim,createModuleLoader,createMomentShim,createResponseObject,createScriptConsole,createTestFunction,createVariableResolver,deepClone,deleteItemFromTree,detectSensitiveData,evaluateExpression,expandSummary,exportCollectionToRestClient,findItemById,formatBytes,formatConsoleOutput,formatDuration,generateId,generateSlug,generateUUID,getCompletions,getRestClientExportFolder,getServiceContainer,hasChanged,isExpression,isPlainObject,isSystemEnvironmentFile,loadEnvironmentsFromFolder,mergeHeadersCaseInsensitive,mergeRequestSettings,normalizeHeaders,parseFilterChain,parsePostmanEnvironment,parsePostmanEnvironmentFile,parseQueryContext,prepareBodyForSave,readBodyFromDir,readSchemaFile,readScriptsFromDir,redactBody,redactFullResponse,redactFullResultDetails,redactHeaders,redactHistoryEntry,redactUrl,registerCoreServices,resolveDynamicVariable,resolveDynamicVariablesInString,safeJsonParse,sanitizeName,searchForItemPath,sortItemsByOrder,writeEnvFile,writeFolderItems,writeSchemaFiles,writeScriptFile,writeScriptsToDir});
|