nemar-cli 0.8.14-dev.857 → 0.8.14-dev.858

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.
Files changed (2) hide show
  1. package/dist/index.js +55 -55
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -26,9 +26,9 @@ Expecting one of '${$.join("', '")}'`);if(this._lifeCycleHooks[D])this._lifeCycl
26
26
  `),this._exit(0,"commander.version",D)}),this}description(D,F){if(D===void 0&&F===void 0)return this._description;if(this._description=D,F)this._argsDescription=F;return this}summary(D){if(D===void 0)return this._summary;return this._summary=D,this}alias(D){if(D===void 0)return this._aliases[0];let F=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)F=this.commands[this.commands.length-1];if(D===F._name)throw Error("Command alias can't be the same as its name");let $=this.parent?._findCommand(D);if($){let J=[$.name()].concat($.aliases()).join("|");throw Error(`cannot add alias '${D}' to command '${this.name()}' as already have command '${J}'`)}return F._aliases.push(D),this}aliases(D){if(D===void 0)return this._aliases;return D.forEach((F)=>this.alias(F)),this}usage(D){if(D===void 0){if(this._usage)return this._usage;let F=this.registeredArguments.map(($)=>{return Bu($)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?F:[]).join(" ")}return this._usage=D,this}name(D){if(D===void 0)return this._name;return this._name=D,this}nameFromFilename(D){return this._name=T8.basename(D,T8.extname(D)),this}executableDir(D){if(D===void 0)return this._executableDir;return this._executableDir=D,this}helpInformation(D){let F=this.createHelp();if(F.helpWidth===void 0)F.helpWidth=D&&D.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth();return F.formatHelp(this,F)}_getHelpContext(D){D=D||{};let F={error:!!D.error},$;if(F.error)$=(J)=>this._outputConfiguration.writeErr(J);else $=(J)=>this._outputConfiguration.writeOut(J);return F.write=D.write||$,F.command=this,F}outputHelp(D){let F;if(typeof D==="function")F=D,D=void 0;let $=this._getHelpContext(D);this._getCommandAndAncestors().reverse().forEach((Q)=>Q.emit("beforeAllHelp",$)),this.emit("beforeHelp",$);let J=this.helpInformation($);if(F){if(J=F(J),typeof J!=="string"&&!Buffer.isBuffer(J))throw Error("outputHelp callback must return a string or a Buffer")}if($.write(J),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",$),this._getCommandAndAncestors().forEach((Q)=>Q.emit("afterAllHelp",$))}helpOption(D,F){if(typeof D==="boolean"){if(D)this._helpOption=this._helpOption??void 0;else this._helpOption=null;return this}return D=D??"-h, --help",F=F??"display help for command",this._helpOption=this.createOption(D,F),this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(D){return this._helpOption=D,this}help(D){this.outputHelp(D);let F=e0.exitCode||0;if(F===0&&D&&typeof D!=="function"&&D.error)F=1;this._exit(F,"commander.help","(outputHelp)")}addHelpText(D,F){let $=["beforeAll","before","after","afterAll"];if(!$.includes(D))throw Error(`Unexpected value for position to addHelpText.
27
27
  Expecting one of '${$.join("', '")}'`);let J=`${D}Help`;return this.on(J,(Q)=>{let Y;if(typeof F==="function")Y=F({error:Q.error,command:Q.command});else Y=F;if(Y)Q.write(`${Y}
28
28
  `)}),this}_outputHelpIfRequested(D){let F=this._getHelpOption();if(F&&D.find((J)=>F.is(J)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function $q(D){return D.map((F)=>{if(!F.startsWith("--inspect"))return F;let $,J="127.0.0.1",Q="9229",Y;if((Y=F.match(/^(--inspect(-brk)?)$/))!==null)$=Y[1];else if((Y=F.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if($=Y[1],/^\d+$/.test(Y[3]))Q=Y[3];else J=Y[3];else if((Y=F.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)$=Y[1],J=Y[3],Q=Y[4];if($&&Q!=="0")return`${$}=${J}:${parseInt(Q)+1}`;return F})}Wu.Command=hQ});var Xq=z((zu)=>{var{Argument:Qq}=o9(),{Command:bQ}=Jq(),{CommanderError:qu,InvalidArgumentError:Yq}=gF(),{Help:Ku}=yQ(),{Option:Bq}=xQ();zu.program=new bQ;zu.createCommand=(D)=>new bQ(D);zu.createOption=(D,F)=>new Bq(D,F);zu.createArgument=(D,F)=>new Qq(D,F);zu.Command=bQ;zu.Option=Bq;zu.Argument=Qq;zu.Help=Ku;zu.CommanderError=qu;zu.InvalidArgumentError=Yq;zu.InvalidOptionArgumentError=Yq});var uF=z((ju,uQ)=>{var Z0=ju;ju.default=Z0;var I0="\x1B[",bF="\x1B]",a4="\x07",r9=";",Eq=process.env.TERM_PROGRAM==="Apple_Terminal";Z0.cursorTo=(D,F)=>{if(typeof D!=="number")throw TypeError("The `x` argument is required");if(typeof F!=="number")return I0+(D+1)+"G";return I0+(F+1)+";"+(D+1)+"H"};Z0.cursorMove=(D,F)=>{if(typeof D!=="number")throw TypeError("The `x` argument is required");let $="";if(D<0)$+=I0+-D+"D";else if(D>0)$+=I0+D+"C";if(F<0)$+=I0+-F+"A";else if(F>0)$+=I0+F+"B";return $};Z0.cursorUp=(D=1)=>I0+D+"A";Z0.cursorDown=(D=1)=>I0+D+"B";Z0.cursorForward=(D=1)=>I0+D+"C";Z0.cursorBackward=(D=1)=>I0+D+"D";Z0.cursorLeft=I0+"G";Z0.cursorSavePosition=Eq?"\x1B7":I0+"s";Z0.cursorRestorePosition=Eq?"\x1B8":I0+"u";Z0.cursorGetPosition=I0+"6n";Z0.cursorNextLine=I0+"E";Z0.cursorPrevLine=I0+"F";Z0.cursorHide=I0+"?25l";Z0.cursorShow=I0+"?25h";Z0.eraseLines=(D)=>{let F="";for(let $=0;$<D;$++)F+=Z0.eraseLine+($<D-1?Z0.cursorUp():"");if(D)F+=Z0.cursorLeft;return F};Z0.eraseEndLine=I0+"K";Z0.eraseStartLine=I0+"1K";Z0.eraseLine=I0+"2K";Z0.eraseDown=I0+"J";Z0.eraseUp=I0+"1J";Z0.eraseScreen=I0+"2J";Z0.scrollUp=I0+"S";Z0.scrollDown=I0+"T";Z0.clearScreen="\x1Bc";Z0.clearTerminal=process.platform==="win32"?`${Z0.eraseScreen}${I0}0f`:`${Z0.eraseScreen}${I0}3J${I0}H`;Z0.beep=a4;Z0.link=(D,F)=>{return[bF,"8",r9,r9,F,a4,D,bF,"8",r9,r9,a4].join("")};Z0.image=(D,F={})=>{let $=`${bF}1337;File=inline=1`;if(F.width)$+=`;width=${F.width}`;if(F.height)$+=`;height=${F.height}`;if(F.preserveAspectRatio===!1)$+=";preserveAspectRatio=0";return $+":"+D.toString("base64")+a4};Z0.iTerm={setCwd:(D=process.cwd())=>`${bF}50;CurrentDir=${D}${a4}`,annotation:(D,F={})=>{let $=`${bF}1337;`,J=typeof F.x<"u",Q=typeof F.y<"u";if((J||Q)&&!(J&&Q&&typeof F.length<"u"))throw Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");if(D=D.replace(/\|/g,""),$+=F.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",F.length>0)$+=(J?[D,F.length,F.x,F.y]:[F.length,D]).join("|");else $+=D;return $+a4}}});var q1=z((sZ0,Vq)=>{var Pu=K0("tty"),Iu=Pu?.WriteStream?.prototype?.hasColors?.()??!1,X0=(D,F)=>{if(!Iu)return(Q)=>Q;let $=`\x1B[${D}m`,J=`\x1B[${F}m`;return(Q)=>{let Y=Q+"",B=Y.indexOf(J);if(B===-1)return $+Y+J;let X=$,G=0,q=(F===22?J:"")+$;while(B!==-1)X+=Y.slice(G,B)+q,G=B+J.length,B=Y.indexOf(J,G);return X+=Y.slice(G)+J,X}},Q0={};Q0.reset=X0(0,0);Q0.bold=X0(1,22);Q0.dim=X0(2,22);Q0.italic=X0(3,23);Q0.underline=X0(4,24);Q0.overline=X0(53,55);Q0.inverse=X0(7,27);Q0.hidden=X0(8,28);Q0.strikethrough=X0(9,29);Q0.black=X0(30,39);Q0.red=X0(31,39);Q0.green=X0(32,39);Q0.yellow=X0(33,39);Q0.blue=X0(34,39);Q0.magenta=X0(35,39);Q0.cyan=X0(36,39);Q0.white=X0(37,39);Q0.gray=X0(90,39);Q0.bgBlack=X0(40,49);Q0.bgRed=X0(41,49);Q0.bgGreen=X0(42,49);Q0.bgYellow=X0(43,49);Q0.bgBlue=X0(44,49);Q0.bgMagenta=X0(45,49);Q0.bgCyan=X0(46,49);Q0.bgWhite=X0(47,49);Q0.bgGray=X0(100,49);Q0.redBright=X0(91,39);Q0.greenBright=X0(92,39);Q0.yellowBright=X0(93,39);Q0.blueBright=X0(94,39);Q0.magentaBright=X0(95,39);Q0.cyanBright=X0(96,39);Q0.whiteBright=X0(97,39);Q0.bgRedBright=X0(101,49);Q0.bgGreenBright=X0(102,49);Q0.bgYellowBright=X0(103,49);Q0.bgBlueBright=X0(104,49);Q0.bgMagentaBright=X0(105,49);Q0.bgCyanBright=X0(106,49);Q0.bgWhiteBright=X0(107,49);Vq.exports=Q0});import D8 from"process";function Su(){if(D8.platform!=="win32")return D8.env.TERM!=="linux";return Boolean(D8.env.WT_SESSION)||Boolean(D8.env.TERMINUS_SUBLIME)||D8.env.ConEmuTask==="{cmd::Cmder}"||D8.env.TERM_PROGRAM==="Terminus-Sublime"||D8.env.TERM_PROGRAM==="vscode"||D8.env.TERM==="xterm-256color"||D8.env.TERM==="alacritty"||D8.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Zq,Uq,ku,vu,yu,xu,_u,D6,tZ0;var t9=I(()=>{Zq={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Uq={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},ku={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},vu={...Zq,...Uq},yu={...Zq,...ku},xu=Su(),_u=xu?vu:yu,D6=_u,tZ0=Object.entries(Uq)});var mF=z((DU0,Mq)=>{function Lq(D){return!!D&&(typeof D==="object"||typeof D==="function")&&typeof D.then==="function"}var Aq=Mq.exports=function(D,F,$="async"){if(typeof F==="string")$=F,F=void 0;return F=F||function(){},function(){var J=arguments,Q=this,Y=new Promise(function(B,X){var G=!1;let H=function(N){if(G)console.warn("Run-async promise already resolved.");G=!0,B(N)};var q=!1;let K=function(N){if(q)console.warn("Run-async promise already rejected.");q=!0,X(N)};var V=!1,E=!1,Z=!1,L=function(){if(Z)return console.warn("Run-async async() called outside a valid run-async context, callback will be ignored."),function(){};if(E)console.warn(`Run-async wrapped function (async) returned a promise.
29
- Calls to async() callback can have unexpected results.`);return V=!0,function(N,w){if(N)K(N);else H(w)}},A;if(Q&&$&&Proxy)A=new Proxy(Q,{get(N,w){if(w===$){if(w in N)console.warn(`${$} property is been shadowed by run-sync`);return L}return Reflect.get(...arguments)}});else A={[$]:L};var M=D.apply(A,Array.prototype.slice.call(J));if(V){if(Lq(M))console.warn("Run-async wrapped function (sync) returned a promise but async() callback must be executed to resolve.")}else if(Lq(M))E=!0,M.then(H,K);else H(M);Z=!0});return Y.then(F.bind(null,null),F),Y}};Aq.cb=function(D,F){return Aq(function(){var $=Array.prototype.slice.call(arguments);if($.length===D.length-1)$.push(this.async());return D.apply(this,$)},F)}});var S0=z((Nq)=>{Object.defineProperty(Nq,"__esModule",{value:!0});Nq.isFunction=void 0;function fu(D){return typeof D==="function"}Nq.isFunction=fu});var F6=z((Cq)=>{Object.defineProperty(Cq,"__esModule",{value:!0});Cq.createErrorClass=void 0;function gu(D){var F=function(J){Error.call(J),J.stack=Error().stack},$=D(F);return $.prototype=Object.create(Error.prototype),$.prototype.constructor=$,$}Cq.createErrorClass=gu});var mQ=z((wq)=>{Object.defineProperty(wq,"__esModule",{value:!0});wq.UnsubscriptionError=void 0;var hu=F6();wq.UnsubscriptionError=hu.createErrorClass(function(D){return function($){D(this),this.message=$?$.length+` errors occurred during unsubscription:
29
+ Calls to async() callback can have unexpected results.`);return V=!0,function(N,w){if(N)K(N);else H(w)}},M;if(Q&&$&&Proxy)M=new Proxy(Q,{get(N,w){if(w===$){if(w in N)console.warn(`${$} property is been shadowed by run-sync`);return L}return Reflect.get(...arguments)}});else M={[$]:L};var A=D.apply(M,Array.prototype.slice.call(J));if(V){if(Lq(A))console.warn("Run-async wrapped function (sync) returned a promise but async() callback must be executed to resolve.")}else if(Lq(A))E=!0,A.then(H,K);else H(A);Z=!0});return Y.then(F.bind(null,null),F),Y}};Aq.cb=function(D,F){return Aq(function(){var $=Array.prototype.slice.call(arguments);if($.length===D.length-1)$.push(this.async());return D.apply(this,$)},F)}});var S0=z((Nq)=>{Object.defineProperty(Nq,"__esModule",{value:!0});Nq.isFunction=void 0;function fu(D){return typeof D==="function"}Nq.isFunction=fu});var F6=z((Cq)=>{Object.defineProperty(Cq,"__esModule",{value:!0});Cq.createErrorClass=void 0;function gu(D){var F=function(J){Error.call(J),J.stack=Error().stack},$=D(F);return $.prototype=Object.create(Error.prototype),$.prototype.constructor=$,$}Cq.createErrorClass=gu});var mQ=z((wq)=>{Object.defineProperty(wq,"__esModule",{value:!0});wq.UnsubscriptionError=void 0;var hu=F6();wq.UnsubscriptionError=hu.createErrorClass(function(D){return function($){D(this),this.message=$?$.length+` errors occurred during unsubscription:
30
30
  `+$.map(function(J,Q){return Q+1+") "+J.toString()}).join(`
31
- `):"",this.name="UnsubscriptionError",this.errors=$}})});var P8=z((Tq)=>{Object.defineProperty(Tq,"__esModule",{value:!0});Tq.arrRemove=void 0;function bu(D,F){if(D){var $=D.indexOf(F);0<=$&&D.splice($,1)}}Tq.arrRemove=bu});var F1=z((pD)=>{var Iq=pD&&pD.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")},Sq=pD&&pD.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},kq=pD&&pD.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(pD,"__esModule",{value:!0});pD.isSubscription=pD.EMPTY_SUBSCRIPTION=pD.Subscription=void 0;var lF=S0(),lQ=mQ(),vq=P8(),pQ=function(){function D(F){this.initialTeardown=F,this.closed=!1,this._parentage=null,this._finalizers=null}return D.prototype.unsubscribe=function(){var F,$,J,Q,Y;if(!this.closed){this.closed=!0;var B=this._parentage;if(B)if(this._parentage=null,Array.isArray(B))try{for(var X=Iq(B),G=X.next();!G.done;G=X.next()){var H=G.value;H.remove(this)}}catch(L){F={error:L}}finally{try{if(G&&!G.done&&($=X.return))$.call(X)}finally{if(F)throw F.error}}else B.remove(this);var q=this.initialTeardown;if(lF.isFunction(q))try{q()}catch(L){Y=L instanceof lQ.UnsubscriptionError?L.errors:[L]}var K=this._finalizers;if(K){this._finalizers=null;try{for(var V=Iq(K),E=V.next();!E.done;E=V.next()){var Z=E.value;try{yq(Z)}catch(L){if(Y=Y!==null&&Y!==void 0?Y:[],L instanceof lQ.UnsubscriptionError)Y=kq(kq([],Sq(Y)),Sq(L.errors));else Y.push(L)}}}catch(L){J={error:L}}finally{try{if(E&&!E.done&&(Q=V.return))Q.call(V)}finally{if(J)throw J.error}}}if(Y)throw new lQ.UnsubscriptionError(Y)}},D.prototype.add=function(F){var $;if(F&&F!==this)if(this.closed)yq(F);else{if(F instanceof D){if(F.closed||F._hasParent(this))return;F._addParent(this)}(this._finalizers=($=this._finalizers)!==null&&$!==void 0?$:[]).push(F)}},D.prototype._hasParent=function(F){var $=this._parentage;return $===F||Array.isArray($)&&$.includes(F)},D.prototype._addParent=function(F){var $=this._parentage;this._parentage=Array.isArray($)?($.push(F),$):$?[$,F]:F},D.prototype._removeParent=function(F){var $=this._parentage;if($===F)this._parentage=null;else if(Array.isArray($))vq.arrRemove($,F)},D.prototype.remove=function(F){var $=this._finalizers;if($&&vq.arrRemove($,F),F instanceof D)F._removeParent(this)},D.EMPTY=function(){var F=new D;return F.closed=!0,F}(),D}();pD.Subscription=pQ;pD.EMPTY_SUBSCRIPTION=pQ.EMPTY;function uu(D){return D instanceof pQ||D&&"closed"in D&&lF.isFunction(D.remove)&&lF.isFunction(D.add)&&lF.isFunction(D.unsubscribe)}pD.isSubscription=uu;function yq(D){if(lF.isFunction(D))D();else D.unsubscribe()}});var o4=z((xq)=>{Object.defineProperty(xq,"__esModule",{value:!0});xq.config=void 0;xq.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}});var dQ=z((F8)=>{var fq=F8&&F8.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},gq=F8&&F8.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(F8,"__esModule",{value:!0});F8.timeoutProvider=void 0;F8.timeoutProvider={setTimeout:function(D,F){var $=[];for(var J=2;J<arguments.length;J++)$[J-2]=arguments[J];var Q=F8.timeoutProvider.delegate;if(Q===null||Q===void 0?void 0:Q.setTimeout)return Q.setTimeout.apply(Q,gq([D,F],fq($)));return setTimeout.apply(void 0,gq([D,F],fq($)))},clearTimeout:function(D){var F=F8.timeoutProvider.delegate;return((F===null||F===void 0?void 0:F.clearTimeout)||clearTimeout)(D)},delegate:void 0}});var cQ=z((hq)=>{Object.defineProperty(hq,"__esModule",{value:!0});hq.reportUnhandledError=void 0;var mu=o4(),lu=dQ();function pu(D){lu.timeoutProvider.setTimeout(function(){var F=mu.config.onUnhandledError;if(F)F(D);else throw D})}hq.reportUnhandledError=pu});var zD=z((uq)=>{Object.defineProperty(uq,"__esModule",{value:!0});uq.noop=void 0;function du(){}uq.noop=du});var dq=z((lq)=>{Object.defineProperty(lq,"__esModule",{value:!0});lq.createNotification=lq.nextNotification=lq.errorNotification=lq.COMPLETE_NOTIFICATION=void 0;lq.COMPLETE_NOTIFICATION=function(){return e9("C",void 0,void 0)}();function cu(D){return e9("E",void 0,D)}lq.errorNotification=cu;function nu(D){return e9("N",D,void 0)}lq.nextNotification=nu;function e9(D,F,$){return{kind:D,value:F,error:$}}lq.createNotification=e9});var D7=z((nq)=>{Object.defineProperty(nq,"__esModule",{value:!0});nq.captureError=nq.errorContext=void 0;var cq=o4(),t6=null;function su(D){if(cq.config.useDeprecatedSynchronousErrorHandling){var F=!t6;if(F)t6={errorThrown:!1,error:null};if(D(),F){var $=t6,J=$.errorThrown,Q=$.error;if(t6=null,J)throw Q}}else D()}nq.errorContext=su;function ru(D){if(cq.config.useDeprecatedSynchronousErrorHandling&&t6)t6.errorThrown=!0,t6.error=D}nq.captureError=ru});var s4=z((P1)=>{var sq=P1&&P1.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(P1,"__esModule",{value:!0});P1.EMPTY_OBSERVER=P1.SafeSubscriber=P1.Subscriber=void 0;var eu=S0(),aq=F1(),oQ=o4(),Dm=cQ(),oq=zD(),nQ=dq(),Fm=dQ(),$m=D7(),rq=function(D){sq(F,D);function F($){var J=D.call(this)||this;if(J.isStopped=!1,$){if(J.destination=$,aq.isSubscription($))$.add(J)}else J.destination=P1.EMPTY_OBSERVER;return J}return F.create=function($,J,Q){return new tq($,J,Q)},F.prototype.next=function($){if(this.isStopped)aQ(nQ.nextNotification($),this);else this._next($)},F.prototype.error=function($){if(this.isStopped)aQ(nQ.errorNotification($),this);else this.isStopped=!0,this._error($)},F.prototype.complete=function(){if(this.isStopped)aQ(nQ.COMPLETE_NOTIFICATION,this);else this.isStopped=!0,this._complete()},F.prototype.unsubscribe=function(){if(!this.closed)this.isStopped=!0,D.prototype.unsubscribe.call(this),this.destination=null},F.prototype._next=function($){this.destination.next($)},F.prototype._error=function($){try{this.destination.error($)}finally{this.unsubscribe()}},F.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},F}(aq.Subscription);P1.Subscriber=rq;var Jm=Function.prototype.bind;function iQ(D,F){return Jm.call(D,F)}var Qm=function(){function D(F){this.partialObserver=F}return D.prototype.next=function(F){var $=this.partialObserver;if($.next)try{$.next(F)}catch(J){F7(J)}},D.prototype.error=function(F){var $=this.partialObserver;if($.error)try{$.error(F)}catch(J){F7(J)}else F7(F)},D.prototype.complete=function(){var F=this.partialObserver;if(F.complete)try{F.complete()}catch($){F7($)}},D}(),tq=function(D){sq(F,D);function F($,J,Q){var Y=D.call(this)||this,B;if(eu.isFunction($)||!$)B={next:$!==null&&$!==void 0?$:void 0,error:J!==null&&J!==void 0?J:void 0,complete:Q!==null&&Q!==void 0?Q:void 0};else{var X;if(Y&&oQ.config.useDeprecatedNextContext)X=Object.create($),X.unsubscribe=function(){return Y.unsubscribe()},B={next:$.next&&iQ($.next,X),error:$.error&&iQ($.error,X),complete:$.complete&&iQ($.complete,X)};else B=$}return Y.destination=new Qm(B),Y}return F}(rq);P1.SafeSubscriber=tq;function F7(D){if(oQ.config.useDeprecatedSynchronousErrorHandling)$m.captureError(D);else Dm.reportUnhandledError(D)}function Ym(D){throw D}function aQ(D,F){var $=oQ.config.onStoppedNotification;$&&Fm.timeoutProvider.setTimeout(function(){return $(D,F)})}P1.EMPTY_OBSERVER={closed:!0,next:oq.noop,error:Ym,complete:oq.noop}});var pF=z((eq)=>{Object.defineProperty(eq,"__esModule",{value:!0});eq.observable=void 0;eq.observable=function(){return typeof Symbol==="function"&&Symbol.observable||"@@observable"}()});var ED=z((FK)=>{Object.defineProperty(FK,"__esModule",{value:!0});FK.identity=void 0;function Bm(D){return D}FK.identity=Bm});var dF=z((QK)=>{Object.defineProperty(QK,"__esModule",{value:!0});QK.pipeFromArray=QK.pipe=void 0;var Xm=ED();function Gm(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return JK(D)}QK.pipe=Gm;function JK(D){if(D.length===0)return Xm.identity;if(D.length===1)return D[0];return function($){return D.reduce(function(J,Q){return Q(J)},$)}}QK.pipeFromArray=JK});var v0=z((XK)=>{Object.defineProperty(XK,"__esModule",{value:!0});XK.Observable=void 0;var rQ=s4(),Hm=F1(),qm=pF(),Km=dF(),zm=o4(),sQ=S0(),Em=D7(),Vm=function(){function D(F){if(F)this._subscribe=F}return D.prototype.lift=function(F){var $=new D;return $.source=this,$.operator=F,$},D.prototype.subscribe=function(F,$,J){var Q=this,Y=Um(F)?F:new rQ.SafeSubscriber(F,$,J);return Em.errorContext(function(){var B=Q,X=B.operator,G=B.source;Y.add(X?X.call(Y,G):G?Q._subscribe(Y):Q._trySubscribe(Y))}),Y},D.prototype._trySubscribe=function(F){try{return this._subscribe(F)}catch($){F.error($)}},D.prototype.forEach=function(F,$){var J=this;return $=BK($),new $(function(Q,Y){var B=new rQ.SafeSubscriber({next:function(X){try{F(X)}catch(G){Y(G),B.unsubscribe()}},error:Y,complete:Q});J.subscribe(B)})},D.prototype._subscribe=function(F){var $;return($=this.source)===null||$===void 0?void 0:$.subscribe(F)},D.prototype[qm.observable]=function(){return this},D.prototype.pipe=function(){var F=[];for(var $=0;$<arguments.length;$++)F[$]=arguments[$];return Km.pipeFromArray(F)(this)},D.prototype.toPromise=function(F){var $=this;return F=BK(F),new F(function(J,Q){var Y;$.subscribe(function(B){return Y=B},function(B){return Q(B)},function(){return J(Y)})})},D.create=function(F){return new D(F)},D}();XK.Observable=Vm;function BK(D){var F;return(F=D!==null&&D!==void 0?D:zm.config.Promise)!==null&&F!==void 0?F:Promise}function Zm(D){return D&&sQ.isFunction(D.next)&&sQ.isFunction(D.error)&&sQ.isFunction(D.complete)}function Um(D){return D&&D instanceof rQ.Subscriber||Zm(D)&&Hm.isSubscription(D)}});var x=z((HK)=>{Object.defineProperty(HK,"__esModule",{value:!0});HK.operate=HK.hasLift=void 0;var Lm=S0();function WK(D){return Lm.isFunction(D===null||D===void 0?void 0:D.lift)}HK.hasLift=WK;function Am(D){return function(F){if(WK(F))return F.lift(function($){try{return D($,this)}catch(J){this.error(J)}});throw TypeError("Unable to lift unknown Observable type")}}HK.operate=Am});var p=z(($6)=>{var Nm=$6&&$6.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty($6,"__esModule",{value:!0});$6.OperatorSubscriber=$6.createOperatorSubscriber=void 0;var Rm=s4();function Cm(D,F,$,J,Q){return new KK(D,F,$,J,Q)}$6.createOperatorSubscriber=Cm;var KK=function(D){Nm(F,D);function F($,J,Q,Y,B,X){var G=D.call(this,$)||this;return G.onFinalize=B,G.shouldUnsubscribe=X,G._next=J?function(H){try{J(H)}catch(q){$.error(q)}}:D.prototype._next,G._error=Y?function(H){try{Y(H)}catch(q){$.error(q)}finally{this.unsubscribe()}}:D.prototype._error,G._complete=Q?function(){try{Q()}catch(H){$.error(H)}finally{this.unsubscribe()}}:D.prototype._complete,G}return F.prototype.unsubscribe=function(){var $;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var J=this.closed;D.prototype.unsubscribe.call(this),!J&&(($=this.onFinalize)===null||$===void 0||$.call(this))}},F}(Rm.Subscriber);$6.OperatorSubscriber=KK});var tQ=z((zK)=>{Object.defineProperty(zK,"__esModule",{value:!0});zK.refCount=void 0;var Om=x(),wm=p();function jm(){return Om.operate(function(D,F){var $=null;D._refCount++;var J=wm.createOperatorSubscriber(F,void 0,void 0,void 0,function(){if(!D||D._refCount<=0||0<--D._refCount){$=null;return}var Q=D._connection,Y=$;if($=null,Q&&(!Y||Q===Y))Q.unsubscribe();F.unsubscribe()});if(D.subscribe(J),!J.closed)$=D.connect()})}zK.refCount=jm});var cF=z((r4)=>{var Tm=r4&&r4.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(r4,"__esModule",{value:!0});r4.ConnectableObservable=void 0;var Pm=v0(),VK=F1(),Im=tQ(),Sm=p(),km=x(),vm=function(D){Tm(F,D);function F($,J){var Q=D.call(this)||this;if(Q.source=$,Q.subjectFactory=J,Q._subject=null,Q._refCount=0,Q._connection=null,km.hasLift($))Q.lift=$.lift;return Q}return F.prototype._subscribe=function($){return this.getSubject().subscribe($)},F.prototype.getSubject=function(){var $=this._subject;if(!$||$.isStopped)this._subject=this.subjectFactory();return this._subject},F.prototype._teardown=function(){this._refCount=0;var $=this._connection;this._subject=this._connection=null,$===null||$===void 0||$.unsubscribe()},F.prototype.connect=function(){var $=this,J=this._connection;if(!J){J=this._connection=new VK.Subscription;var Q=this.getSubject();if(J.add(this.source.subscribe(Sm.createOperatorSubscriber(Q,void 0,function(){$._teardown(),Q.complete()},function(Y){$._teardown(),Q.error(Y)},function(){return $._teardown()}))),J.closed)this._connection=null,J=VK.Subscription.EMPTY}return J},F.prototype.refCount=function(){return Im.refCount()(this)},F}(Pm.Observable);r4.ConnectableObservable=vm});var UK=z((ZK)=>{Object.defineProperty(ZK,"__esModule",{value:!0});ZK.performanceTimestampProvider=void 0;ZK.performanceTimestampProvider={now:function(){return(ZK.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}});var DY=z((I1)=>{var LK=I1&&I1.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},AK=I1&&I1.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(I1,"__esModule",{value:!0});I1.animationFrameProvider=void 0;var ym=F1();I1.animationFrameProvider={schedule:function(D){var F=requestAnimationFrame,$=cancelAnimationFrame,J=I1.animationFrameProvider.delegate;if(J)F=J.requestAnimationFrame,$=J.cancelAnimationFrame;var Q=F(function(Y){$=void 0,D(Y)});return new ym.Subscription(function(){return $===null||$===void 0?void 0:$(Q)})},requestAnimationFrame:function(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=I1.animationFrameProvider.delegate;return(($===null||$===void 0?void 0:$.requestAnimationFrame)||requestAnimationFrame).apply(void 0,AK([],LK(D)))},cancelAnimationFrame:function(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=I1.animationFrameProvider.delegate;return(($===null||$===void 0?void 0:$.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,AK([],LK(D)))},delegate:void 0}});var OK=z((RK)=>{Object.defineProperty(RK,"__esModule",{value:!0});RK.animationFrames=void 0;var xm=v0(),_m=UK(),MK=DY();function fm(D){return D?NK(D):gm}RK.animationFrames=fm;function NK(D){return new xm.Observable(function(F){var $=D||_m.performanceTimestampProvider,J=$.now(),Q=0,Y=function(){if(!F.closed)Q=MK.animationFrameProvider.requestAnimationFrame(function(B){Q=0;var X=$.now();F.next({timestamp:D?X:B,elapsed:X-J}),Y()})};return Y(),function(){if(Q)MK.animationFrameProvider.cancelAnimationFrame(Q)}})}var gm=NK()});var FY=z((wK)=>{Object.defineProperty(wK,"__esModule",{value:!0});wK.ObjectUnsubscribedError=void 0;var hm=F6();wK.ObjectUnsubscribedError=hm.createErrorClass(function(D){return function(){D(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})});var VD=z(($8)=>{var PK=$8&&$8.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}(),bm=$8&&$8.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty($8,"__esModule",{value:!0});$8.AnonymousSubject=$8.Subject=void 0;var TK=v0(),JY=F1(),um=FY(),mm=P8(),$Y=D7(),IK=function(D){PK(F,D);function F(){var $=D.call(this)||this;return $.closed=!1,$.currentObservers=null,$.observers=[],$.isStopped=!1,$.hasError=!1,$.thrownError=null,$}return F.prototype.lift=function($){var J=new QY(this,this);return J.operator=$,J},F.prototype._throwIfClosed=function(){if(this.closed)throw new um.ObjectUnsubscribedError},F.prototype.next=function($){var J=this;$Y.errorContext(function(){var Q,Y;if(J._throwIfClosed(),!J.isStopped){if(!J.currentObservers)J.currentObservers=Array.from(J.observers);try{for(var B=bm(J.currentObservers),X=B.next();!X.done;X=B.next()){var G=X.value;G.next($)}}catch(H){Q={error:H}}finally{try{if(X&&!X.done&&(Y=B.return))Y.call(B)}finally{if(Q)throw Q.error}}}})},F.prototype.error=function($){var J=this;$Y.errorContext(function(){if(J._throwIfClosed(),!J.isStopped){J.hasError=J.isStopped=!0,J.thrownError=$;var Q=J.observers;while(Q.length)Q.shift().error($)}})},F.prototype.complete=function(){var $=this;$Y.errorContext(function(){if($._throwIfClosed(),!$.isStopped){$.isStopped=!0;var J=$.observers;while(J.length)J.shift().complete()}})},F.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(F.prototype,"observed",{get:function(){var $;return(($=this.observers)===null||$===void 0?void 0:$.length)>0},enumerable:!1,configurable:!0}),F.prototype._trySubscribe=function($){return this._throwIfClosed(),D.prototype._trySubscribe.call(this,$)},F.prototype._subscribe=function($){return this._throwIfClosed(),this._checkFinalizedStatuses($),this._innerSubscribe($)},F.prototype._innerSubscribe=function($){var J=this,Q=this,Y=Q.hasError,B=Q.isStopped,X=Q.observers;if(Y||B)return JY.EMPTY_SUBSCRIPTION;return this.currentObservers=null,X.push($),new JY.Subscription(function(){J.currentObservers=null,mm.arrRemove(X,$)})},F.prototype._checkFinalizedStatuses=function($){var J=this,Q=J.hasError,Y=J.thrownError,B=J.isStopped;if(Q)$.error(Y);else if(B)$.complete()},F.prototype.asObservable=function(){var $=new TK.Observable;return $.source=this,$},F.create=function($,J){return new QY($,J)},F}(TK.Observable);$8.Subject=IK;var QY=function(D){PK(F,D);function F($,J){var Q=D.call(this)||this;return Q.destination=$,Q.source=J,Q}return F.prototype.next=function($){var J,Q;(Q=(J=this.destination)===null||J===void 0?void 0:J.next)===null||Q===void 0||Q.call(J,$)},F.prototype.error=function($){var J,Q;(Q=(J=this.destination)===null||J===void 0?void 0:J.error)===null||Q===void 0||Q.call(J,$)},F.prototype.complete=function(){var $,J;(J=($=this.destination)===null||$===void 0?void 0:$.complete)===null||J===void 0||J.call($)},F.prototype._subscribe=function($){var J,Q;return(Q=(J=this.source)===null||J===void 0?void 0:J.subscribe($))!==null&&Q!==void 0?Q:JY.EMPTY_SUBSCRIPTION},F}(IK);$8.AnonymousSubject=QY});var YY=z((t4)=>{var lm=t4&&t4.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(t4,"__esModule",{value:!0});t4.BehaviorSubject=void 0;var pm=VD(),dm=function(D){lm(F,D);function F($){var J=D.call(this)||this;return J._value=$,J}return Object.defineProperty(F.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),F.prototype._subscribe=function($){var J=D.prototype._subscribe.call(this,$);return!J.closed&&$.next(this._value),J},F.prototype.getValue=function(){var $=this,J=$.hasError,Q=$.thrownError,Y=$._value;if(J)throw Q;return this._throwIfClosed(),Y},F.prototype.next=function($){D.prototype.next.call(this,this._value=$)},F}(pm.Subject);t4.BehaviorSubject=dm});var $7=z((SK)=>{Object.defineProperty(SK,"__esModule",{value:!0});SK.dateTimestampProvider=void 0;SK.dateTimestampProvider={now:function(){return(SK.dateTimestampProvider.delegate||Date).now()},delegate:void 0}});var J7=z((e4)=>{var cm=e4&&e4.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(e4,"__esModule",{value:!0});e4.ReplaySubject=void 0;var nm=VD(),im=$7(),am=function(D){cm(F,D);function F($,J,Q){if($===void 0)$=1/0;if(J===void 0)J=1/0;if(Q===void 0)Q=im.dateTimestampProvider;var Y=D.call(this)||this;return Y._bufferSize=$,Y._windowTime=J,Y._timestampProvider=Q,Y._buffer=[],Y._infiniteTimeWindow=!0,Y._infiniteTimeWindow=J===1/0,Y._bufferSize=Math.max(1,$),Y._windowTime=Math.max(1,J),Y}return F.prototype.next=function($){var J=this,Q=J.isStopped,Y=J._buffer,B=J._infiniteTimeWindow,X=J._timestampProvider,G=J._windowTime;if(!Q)Y.push($),!B&&Y.push(X.now()+G);this._trimBuffer(),D.prototype.next.call(this,$)},F.prototype._subscribe=function($){this._throwIfClosed(),this._trimBuffer();var J=this._innerSubscribe($),Q=this,Y=Q._infiniteTimeWindow,B=Q._buffer,X=B.slice();for(var G=0;G<X.length&&!$.closed;G+=Y?1:2)$.next(X[G]);return this._checkFinalizedStatuses($),J},F.prototype._trimBuffer=function(){var $=this,J=$._bufferSize,Q=$._timestampProvider,Y=$._buffer,B=$._infiniteTimeWindow,X=(B?1:2)*J;if(J<1/0&&X<Y.length&&Y.splice(0,Y.length-X),!B){var G=Q.now(),H=0;for(var q=1;q<Y.length&&Y[q]<=G;q+=2)H=q;H&&Y.splice(0,H+1)}},F}(nm.Subject);e4.ReplaySubject=am});var Q7=z((D3)=>{var om=D3&&D3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(D3,"__esModule",{value:!0});D3.AsyncSubject=void 0;var sm=VD(),rm=function(D){om(F,D);function F(){var $=D!==null&&D.apply(this,arguments)||this;return $._value=null,$._hasValue=!1,$._isComplete=!1,$}return F.prototype._checkFinalizedStatuses=function($){var J=this,Q=J.hasError,Y=J._hasValue,B=J._value,X=J.thrownError,G=J.isStopped,H=J._isComplete;if(Q)$.error(X);else if(G||H)Y&&$.next(B),$.complete()},F.prototype.next=function($){if(!this.isStopped)this._value=$,this._hasValue=!0},F.prototype.complete=function(){var $=this,J=$._hasValue,Q=$._value,Y=$._isComplete;if(!Y)this._isComplete=!0,J&&D.prototype.next.call(this,Q),D.prototype.complete.call(this)},F}(sm.Subject);D3.AsyncSubject=rm});var kK=z((F3)=>{var tm=F3&&F3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(F3,"__esModule",{value:!0});F3.Action=void 0;var em=F1(),Dl=function(D){tm(F,D);function F($,J){return D.call(this)||this}return F.prototype.schedule=function($,J){if(J===void 0)J=0;return this},F}(em.Subscription);F3.Action=Dl});var xK=z((J8)=>{var vK=J8&&J8.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},yK=J8&&J8.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(J8,"__esModule",{value:!0});J8.intervalProvider=void 0;J8.intervalProvider={setInterval:function(D,F){var $=[];for(var J=2;J<arguments.length;J++)$[J-2]=arguments[J];var Q=J8.intervalProvider.delegate;if(Q===null||Q===void 0?void 0:Q.setInterval)return Q.setInterval.apply(Q,yK([D,F],vK($)));return setInterval.apply(void 0,yK([D,F],vK($)))},clearInterval:function(D){var F=J8.intervalProvider.delegate;return((F===null||F===void 0?void 0:F.clearInterval)||clearInterval)(D)},delegate:void 0}});var J3=z(($3)=>{var Fl=$3&&$3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty($3,"__esModule",{value:!0});$3.AsyncAction=void 0;var $l=kK(),_K=xK(),Jl=P8(),Ql=function(D){Fl(F,D);function F($,J){var Q=D.call(this,$,J)||this;return Q.scheduler=$,Q.work=J,Q.pending=!1,Q}return F.prototype.schedule=function($,J){var Q;if(J===void 0)J=0;if(this.closed)return this;this.state=$;var Y=this.id,B=this.scheduler;if(Y!=null)this.id=this.recycleAsyncId(B,Y,J);return this.pending=!0,this.delay=J,this.id=(Q=this.id)!==null&&Q!==void 0?Q:this.requestAsyncId(B,this.id,J),this},F.prototype.requestAsyncId=function($,J,Q){if(Q===void 0)Q=0;return _K.intervalProvider.setInterval($.flush.bind($,this),Q)},F.prototype.recycleAsyncId=function($,J,Q){if(Q===void 0)Q=0;if(Q!=null&&this.delay===Q&&this.pending===!1)return J;if(J!=null)_K.intervalProvider.clearInterval(J);return},F.prototype.execute=function($,J){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var Q=this._execute($,J);if(Q)return Q;else if(this.pending===!1&&this.id!=null)this.id=this.recycleAsyncId(this.scheduler,this.id,null)},F.prototype._execute=function($,J){var Q=!1,Y;try{this.work($)}catch(B){Q=!0,Y=B?B:Error("Scheduled action threw falsy error")}if(Q)return this.unsubscribe(),Y},F.prototype.unsubscribe=function(){if(!this.closed){var $=this,J=$.id,Q=$.scheduler,Y=Q.actions;if(this.work=this.state=this.scheduler=null,this.pending=!1,Jl.arrRemove(Y,this),J!=null)this.id=this.recycleAsyncId(Q,J,null);this.delay=null,D.prototype.unsubscribe.call(this)}},F}($l.Action);$3.AsyncAction=Ql});var bK=z((gK)=>{Object.defineProperty(gK,"__esModule",{value:!0});gK.TestTools=gK.Immediate=void 0;var Yl=1,XY,Y7={};function fK(D){if(D in Y7)return delete Y7[D],!0;return!1}gK.Immediate={setImmediate:function(D){var F=Yl++;if(Y7[F]=!0,!XY)XY=Promise.resolve();return XY.then(function(){return fK(F)&&D()}),F},clearImmediate:function(D){fK(D)}};gK.TestTools={pending:function(){return Object.keys(Y7).length}}});var mK=z((Q8)=>{var Xl=Q8&&Q8.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},Gl=Q8&&Q8.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(Q8,"__esModule",{value:!0});Q8.immediateProvider=void 0;var uK=bK(),Wl=uK.Immediate.setImmediate,Hl=uK.Immediate.clearImmediate;Q8.immediateProvider={setImmediate:function(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=Q8.immediateProvider.delegate;return(($===null||$===void 0?void 0:$.setImmediate)||Wl).apply(void 0,Gl([],Xl(D)))},clearImmediate:function(D){var F=Q8.immediateProvider.delegate;return((F===null||F===void 0?void 0:F.clearImmediate)||Hl)(D)},delegate:void 0}});var pK=z((Q3)=>{var ql=Q3&&Q3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(Q3,"__esModule",{value:!0});Q3.AsapAction=void 0;var Kl=J3(),lK=mK(),zl=function(D){ql(F,D);function F($,J){var Q=D.call(this,$,J)||this;return Q.scheduler=$,Q.work=J,Q}return F.prototype.requestAsyncId=function($,J,Q){if(Q===void 0)Q=0;if(Q!==null&&Q>0)return D.prototype.requestAsyncId.call(this,$,J,Q);return $.actions.push(this),$._scheduled||($._scheduled=lK.immediateProvider.setImmediate($.flush.bind($,void 0)))},F.prototype.recycleAsyncId=function($,J,Q){var Y;if(Q===void 0)Q=0;if(Q!=null?Q>0:this.delay>0)return D.prototype.recycleAsyncId.call(this,$,J,Q);var B=$.actions;if(J!=null&&((Y=B[B.length-1])===null||Y===void 0?void 0:Y.id)!==J){if(lK.immediateProvider.clearImmediate(J),$._scheduled===J)$._scheduled=void 0}return},F}(Kl.AsyncAction);Q3.AsapAction=zl});var GY=z((dK)=>{Object.defineProperty(dK,"__esModule",{value:!0});dK.Scheduler=void 0;var El=$7(),Vl=function(){function D(F,$){if($===void 0)$=D.now;this.schedulerActionCtor=F,this.now=$}return D.prototype.schedule=function(F,$,J){if($===void 0)$=0;return new this.schedulerActionCtor(this,F).schedule(J,$)},D.now=El.dateTimestampProvider.now,D}();dK.Scheduler=Vl});var B3=z((Y3)=>{var Zl=Y3&&Y3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(Y3,"__esModule",{value:!0});Y3.AsyncScheduler=void 0;var nK=GY(),Ul=function(D){Zl(F,D);function F($,J){if(J===void 0)J=nK.Scheduler.now;var Q=D.call(this,$,J)||this;return Q.actions=[],Q._active=!1,Q}return F.prototype.flush=function($){var J=this.actions;if(this._active){J.push($);return}var Q;this._active=!0;do if(Q=$.execute($.state,$.delay))break;while($=J.shift());if(this._active=!1,Q){while($=J.shift())$.unsubscribe();throw Q}},F}(nK.Scheduler);Y3.AsyncScheduler=Ul});var iK=z((X3)=>{var Ll=X3&&X3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(X3,"__esModule",{value:!0});X3.AsapScheduler=void 0;var Al=B3(),Ml=function(D){Ll(F,D);function F(){return D!==null&&D.apply(this,arguments)||this}return F.prototype.flush=function($){this._active=!0;var J=this._scheduled;this._scheduled=void 0;var Q=this.actions,Y;$=$||Q.shift();do if(Y=$.execute($.state,$.delay))break;while(($=Q[0])&&$.id===J&&Q.shift());if(this._active=!1,Y){while(($=Q[0])&&$.id===J&&Q.shift())$.unsubscribe();throw Y}},F}(Al.AsyncScheduler);X3.AsapScheduler=Ml});var rK=z((aK)=>{Object.defineProperty(aK,"__esModule",{value:!0});aK.asap=aK.asapScheduler=void 0;var Nl=pK(),Rl=iK();aK.asapScheduler=new Rl.AsapScheduler(Nl.AsapAction);aK.asap=aK.asapScheduler});var dD=z((tK)=>{Object.defineProperty(tK,"__esModule",{value:!0});tK.async=tK.asyncScheduler=void 0;var Cl=J3(),Ol=B3();tK.asyncScheduler=new Ol.AsyncScheduler(Cl.AsyncAction);tK.async=tK.asyncScheduler});var Fz=z((G3)=>{var wl=G3&&G3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(G3,"__esModule",{value:!0});G3.QueueAction=void 0;var jl=J3(),Tl=function(D){wl(F,D);function F($,J){var Q=D.call(this,$,J)||this;return Q.scheduler=$,Q.work=J,Q}return F.prototype.schedule=function($,J){if(J===void 0)J=0;if(J>0)return D.prototype.schedule.call(this,$,J);return this.delay=J,this.state=$,this.scheduler.flush(this),this},F.prototype.execute=function($,J){return J>0||this.closed?D.prototype.execute.call(this,$,J):this._execute($,J)},F.prototype.requestAsyncId=function($,J,Q){if(Q===void 0)Q=0;if(Q!=null&&Q>0||Q==null&&this.delay>0)return D.prototype.requestAsyncId.call(this,$,J,Q);return $.flush(this),0},F}(jl.AsyncAction);G3.QueueAction=Tl});var $z=z((W3)=>{var Pl=W3&&W3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(W3,"__esModule",{value:!0});W3.QueueScheduler=void 0;var Il=B3(),Sl=function(D){Pl(F,D);function F(){return D!==null&&D.apply(this,arguments)||this}return F}(Il.AsyncScheduler);W3.QueueScheduler=Sl});var Bz=z((Jz)=>{Object.defineProperty(Jz,"__esModule",{value:!0});Jz.queue=Jz.queueScheduler=void 0;var kl=Fz(),vl=$z();Jz.queueScheduler=new vl.QueueScheduler(kl.QueueAction);Jz.queue=Jz.queueScheduler});var Gz=z((H3)=>{var yl=H3&&H3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(H3,"__esModule",{value:!0});H3.AnimationFrameAction=void 0;var xl=J3(),Xz=DY(),_l=function(D){yl(F,D);function F($,J){var Q=D.call(this,$,J)||this;return Q.scheduler=$,Q.work=J,Q}return F.prototype.requestAsyncId=function($,J,Q){if(Q===void 0)Q=0;if(Q!==null&&Q>0)return D.prototype.requestAsyncId.call(this,$,J,Q);return $.actions.push(this),$._scheduled||($._scheduled=Xz.animationFrameProvider.requestAnimationFrame(function(){return $.flush(void 0)}))},F.prototype.recycleAsyncId=function($,J,Q){var Y;if(Q===void 0)Q=0;if(Q!=null?Q>0:this.delay>0)return D.prototype.recycleAsyncId.call(this,$,J,Q);var B=$.actions;if(J!=null&&J===$._scheduled&&((Y=B[B.length-1])===null||Y===void 0?void 0:Y.id)!==J)Xz.animationFrameProvider.cancelAnimationFrame(J),$._scheduled=void 0;return},F}(xl.AsyncAction);H3.AnimationFrameAction=_l});var Wz=z((q3)=>{var fl=q3&&q3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(q3,"__esModule",{value:!0});q3.AnimationFrameScheduler=void 0;var gl=B3(),hl=function(D){fl(F,D);function F(){return D!==null&&D.apply(this,arguments)||this}return F.prototype.flush=function($){this._active=!0;var J;if($)J=$.id;else J=this._scheduled,this._scheduled=void 0;var Q=this.actions,Y;$=$||Q.shift();do if(Y=$.execute($.state,$.delay))break;while(($=Q[0])&&$.id===J&&Q.shift());if(this._active=!1,Y){while(($=Q[0])&&$.id===J&&Q.shift())$.unsubscribe();throw Y}},F}(gl.AsyncScheduler);q3.AnimationFrameScheduler=hl});var zz=z((Hz)=>{Object.defineProperty(Hz,"__esModule",{value:!0});Hz.animationFrame=Hz.animationFrameScheduler=void 0;var bl=Gz(),ul=Wz();Hz.animationFrameScheduler=new ul.AnimationFrameScheduler(bl.AnimationFrameAction);Hz.animationFrame=Hz.animationFrameScheduler});var Zz=z((J6)=>{var Ez=J6&&J6.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(J6,"__esModule",{value:!0});J6.VirtualAction=J6.VirtualTimeScheduler=void 0;var ml=J3(),ll=F1(),pl=B3(),dl=function(D){Ez(F,D);function F($,J){if($===void 0)$=Vz;if(J===void 0)J=1/0;var Q=D.call(this,$,function(){return Q.frame})||this;return Q.maxFrames=J,Q.frame=0,Q.index=-1,Q}return F.prototype.flush=function(){var $=this,J=$.actions,Q=$.maxFrames,Y,B;while((B=J[0])&&B.delay<=Q)if(J.shift(),this.frame=B.delay,Y=B.execute(B.state,B.delay))break;if(Y){while(B=J.shift())B.unsubscribe();throw Y}},F.frameTimeFactor=10,F}(pl.AsyncScheduler);J6.VirtualTimeScheduler=dl;var Vz=function(D){Ez(F,D);function F($,J,Q){if(Q===void 0)Q=$.index+=1;var Y=D.call(this,$,J)||this;return Y.scheduler=$,Y.work=J,Y.index=Q,Y.active=!0,Y.index=$.index=Q,Y}return F.prototype.schedule=function($,J){if(J===void 0)J=0;if(Number.isFinite(J)){if(!this.id)return D.prototype.schedule.call(this,$,J);this.active=!1;var Q=new F(this.scheduler,this.work);return this.add(Q),Q.schedule($,J)}else return ll.Subscription.EMPTY},F.prototype.requestAsyncId=function($,J,Q){if(Q===void 0)Q=0;this.delay=$.frame+Q;var Y=$.actions;return Y.push(this),Y.sort(F.sortActions),1},F.prototype.recycleAsyncId=function($,J,Q){if(Q===void 0)Q=0;return},F.prototype._execute=function($,J){if(this.active===!0)return D.prototype._execute.call(this,$,J)},F.sortActions=function($,J){if($.delay===J.delay)if($.index===J.index)return 0;else if($.index>J.index)return 1;else return-1;else if($.delay>J.delay)return 1;else return-1},F}(ml.AsyncAction);J6.VirtualAction=Vz});var S1=z((Lz)=>{Object.defineProperty(Lz,"__esModule",{value:!0});Lz.empty=Lz.EMPTY=void 0;var Uz=v0();Lz.EMPTY=new Uz.Observable(function(D){return D.complete()});function cl(D){return D?nl(D):Lz.EMPTY}Lz.empty=cl;function nl(D){return new Uz.Observable(function(F){return D.schedule(function(){return F.complete()})})}});var nF=z((Nz)=>{Object.defineProperty(Nz,"__esModule",{value:!0});Nz.isScheduler=void 0;var il=S0();function al(D){return D&&il.isFunction(D.schedule)}Nz.isScheduler=al});var cD=z((Cz)=>{Object.defineProperty(Cz,"__esModule",{value:!0});Cz.popNumber=Cz.popScheduler=Cz.popResultSelector=void 0;var ol=S0(),sl=nF();function WY(D){return D[D.length-1]}function rl(D){return ol.isFunction(WY(D))?D.pop():void 0}Cz.popResultSelector=rl;function tl(D){return sl.isScheduler(WY(D))?D.pop():void 0}Cz.popScheduler=tl;function el(D,F){return typeof WY(D)==="number"?D.pop():F}Cz.popNumber=el});var B7=z((wz)=>{Object.defineProperty(wz,"__esModule",{value:!0});wz.isArrayLike=void 0;wz.isArrayLike=function(D){return D&&typeof D.length==="number"&&typeof D!=="function"}});var HY=z((Tz)=>{Object.defineProperty(Tz,"__esModule",{value:!0});Tz.isPromise=void 0;var $p=S0();function Jp(D){return $p.isFunction(D===null||D===void 0?void 0:D.then)}Tz.isPromise=Jp});var qY=z((Iz)=>{Object.defineProperty(Iz,"__esModule",{value:!0});Iz.isInteropObservable=void 0;var Qp=pF(),Yp=S0();function Bp(D){return Yp.isFunction(D[Qp.observable])}Iz.isInteropObservable=Bp});var KY=z((kz)=>{Object.defineProperty(kz,"__esModule",{value:!0});kz.isAsyncIterable=void 0;var Xp=S0();function Gp(D){return Symbol.asyncIterator&&Xp.isFunction(D===null||D===void 0?void 0:D[Symbol.asyncIterator])}kz.isAsyncIterable=Gp});var zY=z((yz)=>{Object.defineProperty(yz,"__esModule",{value:!0});yz.createInvalidObservableTypeError=void 0;function Wp(D){return TypeError("You provided "+(D!==null&&typeof D==="object"?"an invalid object":"'"+D+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}yz.createInvalidObservableTypeError=Wp});var EY=z((fz)=>{Object.defineProperty(fz,"__esModule",{value:!0});fz.iterator=fz.getSymbolIterator=void 0;function _z(){if(typeof Symbol!=="function"||!Symbol.iterator)return"@@iterator";return Symbol.iterator}fz.getSymbolIterator=_z;fz.iterator=_z()});var VY=z((hz)=>{Object.defineProperty(hz,"__esModule",{value:!0});hz.isIterable=void 0;var qp=EY(),Kp=S0();function zp(D){return Kp.isFunction(D===null||D===void 0?void 0:D[qp.iterator])}hz.isIterable=zp});var X7=z((K1)=>{var Ep=K1&&K1.__generator||function(D,F){var $={label:0,sent:function(){if(Y[0]&1)throw Y[1];return Y[1]},trys:[],ops:[]},J,Q,Y,B;return B={next:X(0),throw:X(1),return:X(2)},typeof Symbol==="function"&&(B[Symbol.iterator]=function(){return this}),B;function X(H){return function(q){return G([H,q])}}function G(H){if(J)throw TypeError("Generator is already executing.");while($)try{if(J=1,Q&&(Y=H[0]&2?Q.return:H[0]?Q.throw||((Y=Q.return)&&Y.call(Q),0):Q.next)&&!(Y=Y.call(Q,H[1])).done)return Y;if(Q=0,Y)H=[H[0]&2,Y.value];switch(H[0]){case 0:case 1:Y=H;break;case 4:return $.label++,{value:H[1],done:!1};case 5:$.label++,Q=H[1],H=[0];continue;case 7:H=$.ops.pop(),$.trys.pop();continue;default:if((Y=$.trys,!(Y=Y.length>0&&Y[Y.length-1]))&&(H[0]===6||H[0]===2)){$=0;continue}if(H[0]===3&&(!Y||H[1]>Y[0]&&H[1]<Y[3])){$.label=H[1];break}if(H[0]===6&&$.label<Y[1]){$.label=Y[1],Y=H;break}if(Y&&$.label<Y[2]){$.label=Y[2],$.ops.push(H);break}if(Y[2])$.ops.pop();$.trys.pop();continue}H=F.call(D,$)}catch(q){H=[6,q],Q=0}finally{J=Y=0}if(H[0]&5)throw H[1];return{value:H[0]?H[1]:void 0,done:!0}}},K3=K1&&K1.__await||function(D){return this instanceof K3?(this.v=D,this):new K3(D)},Vp=K1&&K1.__asyncGenerator||function(D,F,$){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var J=$.apply(D,F||[]),Q,Y=[];return Q={},B("next"),B("throw"),B("return"),Q[Symbol.asyncIterator]=function(){return this},Q;function B(V){if(J[V])Q[V]=function(E){return new Promise(function(Z,L){Y.push([V,E,Z,L])>1||X(V,E)})}}function X(V,E){try{G(J[V](E))}catch(Z){K(Y[0][3],Z)}}function G(V){V.value instanceof K3?Promise.resolve(V.value.v).then(H,q):K(Y[0][2],V)}function H(V){X("next",V)}function q(V){X("throw",V)}function K(V,E){if(V(E),Y.shift(),Y.length)X(Y[0][0],Y[0][1])}};Object.defineProperty(K1,"__esModule",{value:!0});K1.isReadableStreamLike=K1.readableStreamLikeToAsyncGenerator=void 0;var Zp=S0();function Up(D){return Vp(this,arguments,function(){var $,J,Q,Y;return Ep(this,function(B){switch(B.label){case 0:$=D.getReader(),B.label=1;case 1:B.trys.push([1,,9,10]),B.label=2;case 2:return[4,K3($.read())];case 3:if(J=B.sent(),Q=J.value,Y=J.done,!Y)return[3,5];return[4,K3(void 0)];case 4:return[2,B.sent()];case 5:return[4,K3(Q)];case 6:return[4,B.sent()];case 7:return B.sent(),[3,2];case 8:return[3,10];case 9:return $.releaseLock(),[7];case 10:return[2]}})})}K1.readableStreamLikeToAsyncGenerator=Up;function Lp(D){return Zp.isFunction(D===null||D===void 0?void 0:D.getReader)}K1.isReadableStreamLike=Lp});var Y0=z((d0)=>{var Ap=d0&&d0.__awaiter||function(D,F,$,J){function Q(Y){return Y instanceof $?Y:new $(function(B){B(Y)})}return new($||($=Promise))(function(Y,B){function X(q){try{H(J.next(q))}catch(K){B(K)}}function G(q){try{H(J.throw(q))}catch(K){B(K)}}function H(q){q.done?Y(q.value):Q(q.value).then(X,G)}H((J=J.apply(D,F||[])).next())})},Mp=d0&&d0.__generator||function(D,F){var $={label:0,sent:function(){if(Y[0]&1)throw Y[1];return Y[1]},trys:[],ops:[]},J,Q,Y,B;return B={next:X(0),throw:X(1),return:X(2)},typeof Symbol==="function"&&(B[Symbol.iterator]=function(){return this}),B;function X(H){return function(q){return G([H,q])}}function G(H){if(J)throw TypeError("Generator is already executing.");while($)try{if(J=1,Q&&(Y=H[0]&2?Q.return:H[0]?Q.throw||((Y=Q.return)&&Y.call(Q),0):Q.next)&&!(Y=Y.call(Q,H[1])).done)return Y;if(Q=0,Y)H=[H[0]&2,Y.value];switch(H[0]){case 0:case 1:Y=H;break;case 4:return $.label++,{value:H[1],done:!1};case 5:$.label++,Q=H[1],H=[0];continue;case 7:H=$.ops.pop(),$.trys.pop();continue;default:if((Y=$.trys,!(Y=Y.length>0&&Y[Y.length-1]))&&(H[0]===6||H[0]===2)){$=0;continue}if(H[0]===3&&(!Y||H[1]>Y[0]&&H[1]<Y[3])){$.label=H[1];break}if(H[0]===6&&$.label<Y[1]){$.label=Y[1],Y=H;break}if(Y&&$.label<Y[2]){$.label=Y[2],$.ops.push(H);break}if(Y[2])$.ops.pop();$.trys.pop();continue}H=F.call(D,$)}catch(q){H=[6,q],Q=0}finally{J=Y=0}if(H[0]&5)throw H[1];return{value:H[0]?H[1]:void 0,done:!0}}},Np=d0&&d0.__asyncValues||function(D){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var F=D[Symbol.asyncIterator],$;return F?F.call(D):(D=typeof ZY==="function"?ZY(D):D[Symbol.iterator](),$={},J("next"),J("throw"),J("return"),$[Symbol.asyncIterator]=function(){return this},$);function J(Y){$[Y]=D[Y]&&function(B){return new Promise(function(X,G){B=D[Y](B),Q(X,G,B.done,B.value)})}}function Q(Y,B,X,G){Promise.resolve(G).then(function(H){Y({value:H,done:X})},B)}},ZY=d0&&d0.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(d0,"__esModule",{value:!0});d0.fromReadableStreamLike=d0.fromAsyncIterable=d0.fromIterable=d0.fromPromise=d0.fromArrayLike=d0.fromInteropObservable=d0.innerFrom=void 0;var Rp=B7(),Cp=HY(),z3=v0(),Op=qY(),wp=KY(),jp=zY(),Tp=VY(),uz=X7(),Pp=S0(),Ip=cQ(),Sp=pF();function kp(D){if(D instanceof z3.Observable)return D;if(D!=null){if(Op.isInteropObservable(D))return mz(D);if(Rp.isArrayLike(D))return lz(D);if(Cp.isPromise(D))return pz(D);if(wp.isAsyncIterable(D))return UY(D);if(Tp.isIterable(D))return dz(D);if(uz.isReadableStreamLike(D))return cz(D)}throw jp.createInvalidObservableTypeError(D)}d0.innerFrom=kp;function mz(D){return new z3.Observable(function(F){var $=D[Sp.observable]();if(Pp.isFunction($.subscribe))return $.subscribe(F);throw TypeError("Provided object does not correctly implement Symbol.observable")})}d0.fromInteropObservable=mz;function lz(D){return new z3.Observable(function(F){for(var $=0;$<D.length&&!F.closed;$++)F.next(D[$]);F.complete()})}d0.fromArrayLike=lz;function pz(D){return new z3.Observable(function(F){D.then(function($){if(!F.closed)F.next($),F.complete()},function($){return F.error($)}).then(null,Ip.reportUnhandledError)})}d0.fromPromise=pz;function dz(D){return new z3.Observable(function(F){var $,J;try{for(var Q=ZY(D),Y=Q.next();!Y.done;Y=Q.next()){var B=Y.value;if(F.next(B),F.closed)return}}catch(X){$={error:X}}finally{try{if(Y&&!Y.done&&(J=Q.return))J.call(Q)}finally{if($)throw $.error}}F.complete()})}d0.fromIterable=dz;function UY(D){return new z3.Observable(function(F){vp(D,F).catch(function($){return F.error($)})})}d0.fromAsyncIterable=UY;function cz(D){return UY(uz.readableStreamLikeToAsyncGenerator(D))}d0.fromReadableStreamLike=cz;function vp(D,F){var $,J,Q,Y;return Ap(this,void 0,void 0,function(){var B,X;return Mp(this,function(G){switch(G.label){case 0:G.trys.push([0,5,6,11]),$=Np(D),G.label=1;case 1:return[4,$.next()];case 2:if(J=G.sent(),!!J.done)return[3,4];if(B=J.value,F.next(B),F.closed)return[2];G.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return X=G.sent(),Q={error:X},[3,11];case 6:if(G.trys.push([6,,9,10]),!(J&&!J.done&&(Y=$.return)))return[3,8];return[4,Y.call($)];case 7:G.sent(),G.label=8;case 8:return[3,10];case 9:if(Q)throw Q.error;return[7];case 10:return[7];case 11:return F.complete(),[2]}})})}});var I8=z((nz)=>{Object.defineProperty(nz,"__esModule",{value:!0});nz.executeSchedule=void 0;function yp(D,F,$,J,Q){if(J===void 0)J=0;if(Q===void 0)Q=!1;var Y=F.schedule(function(){if($(),Q)D.add(this.schedule(null,J));else this.unsubscribe()},J);if(D.add(Y),!Q)return Y}nz.executeSchedule=yp});var iF=z((az)=>{Object.defineProperty(az,"__esModule",{value:!0});az.observeOn=void 0;var LY=I8(),xp=x(),_p=p();function fp(D,F){if(F===void 0)F=0;return xp.operate(function($,J){$.subscribe(_p.createOperatorSubscriber(J,function(Q){return LY.executeSchedule(J,D,function(){return J.next(Q)},F)},function(){return LY.executeSchedule(J,D,function(){return J.complete()},F)},function(Q){return LY.executeSchedule(J,D,function(){return J.error(Q)},F)}))})}az.observeOn=fp});var aF=z((sz)=>{Object.defineProperty(sz,"__esModule",{value:!0});sz.subscribeOn=void 0;var gp=x();function hp(D,F){if(F===void 0)F=0;return gp.operate(function($,J){J.add(D.schedule(function(){return $.subscribe(J)},F))})}sz.subscribeOn=hp});var DE=z((tz)=>{Object.defineProperty(tz,"__esModule",{value:!0});tz.scheduleObservable=void 0;var bp=Y0(),up=iF(),mp=aF();function lp(D,F){return bp.innerFrom(D).pipe(mp.subscribeOn(F),up.observeOn(F))}tz.scheduleObservable=lp});var JE=z((FE)=>{Object.defineProperty(FE,"__esModule",{value:!0});FE.schedulePromise=void 0;var pp=Y0(),dp=iF(),cp=aF();function np(D,F){return pp.innerFrom(D).pipe(cp.subscribeOn(F),dp.observeOn(F))}FE.schedulePromise=np});var BE=z((QE)=>{Object.defineProperty(QE,"__esModule",{value:!0});QE.scheduleArray=void 0;var ip=v0();function ap(D,F){return new ip.Observable(function($){var J=0;return F.schedule(function(){if(J===D.length)$.complete();else if($.next(D[J++]),!$.closed)this.schedule()})})}QE.scheduleArray=ap});var AY=z((GE)=>{Object.defineProperty(GE,"__esModule",{value:!0});GE.scheduleIterable=void 0;var op=v0(),sp=EY(),rp=S0(),XE=I8();function tp(D,F){return new op.Observable(function($){var J;return XE.executeSchedule($,F,function(){J=D[sp.iterator](),XE.executeSchedule($,F,function(){var Q,Y,B;try{Q=J.next(),Y=Q.value,B=Q.done}catch(X){$.error(X);return}if(B)$.complete();else $.next(Y)},0,!0)}),function(){return rp.isFunction(J===null||J===void 0?void 0:J.return)&&J.return()}})}GE.scheduleIterable=tp});var MY=z((qE)=>{Object.defineProperty(qE,"__esModule",{value:!0});qE.scheduleAsyncIterable=void 0;var ep=v0(),HE=I8();function Dd(D,F){if(!D)throw Error("Iterable cannot be null");return new ep.Observable(function($){HE.executeSchedule($,F,function(){var J=D[Symbol.asyncIterator]();HE.executeSchedule($,F,function(){J.next().then(function(Q){if(Q.done)$.complete();else $.next(Q.value)})},0,!0)})})}qE.scheduleAsyncIterable=Dd});var VE=z((zE)=>{Object.defineProperty(zE,"__esModule",{value:!0});zE.scheduleReadableStreamLike=void 0;var Fd=MY(),$d=X7();function Jd(D,F){return Fd.scheduleAsyncIterable($d.readableStreamLikeToAsyncGenerator(D),F)}zE.scheduleReadableStreamLike=Jd});var NY=z((ZE)=>{Object.defineProperty(ZE,"__esModule",{value:!0});ZE.scheduled=void 0;var Qd=DE(),Yd=JE(),Bd=BE(),Xd=AY(),Gd=MY(),Wd=qY(),Hd=HY(),qd=B7(),Kd=VY(),zd=KY(),Ed=zY(),Vd=X7(),Zd=VE();function Ud(D,F){if(D!=null){if(Wd.isInteropObservable(D))return Qd.scheduleObservable(D,F);if(qd.isArrayLike(D))return Bd.scheduleArray(D,F);if(Hd.isPromise(D))return Yd.schedulePromise(D,F);if(zd.isAsyncIterable(D))return Gd.scheduleAsyncIterable(D,F);if(Kd.isIterable(D))return Xd.scheduleIterable(D,F);if(Vd.isReadableStreamLike(D))return Zd.scheduleReadableStreamLike(D,F)}throw Ed.createInvalidObservableTypeError(D)}ZE.scheduled=Ud});var S8=z((LE)=>{Object.defineProperty(LE,"__esModule",{value:!0});LE.from=void 0;var Ld=NY(),Ad=Y0();function Md(D,F){return F?Ld.scheduled(D,F):Ad.innerFrom(D)}LE.from=Md});var G7=z((ME)=>{Object.defineProperty(ME,"__esModule",{value:!0});ME.of=void 0;var Nd=cD(),Rd=S8();function Cd(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=Nd.popScheduler(D);return Rd.from(D,$)}ME.of=Cd});var RY=z((RE)=>{Object.defineProperty(RE,"__esModule",{value:!0});RE.throwError=void 0;var Od=v0(),wd=S0();function jd(D,F){var $=wd.isFunction(D)?D:function(){return D},J=function(Q){return Q.error($())};return new Od.Observable(F?function(Q){return F.schedule(J,0,Q)}:J)}RE.throwError=jd});var W7=z((jE)=>{Object.defineProperty(jE,"__esModule",{value:!0});jE.observeNotification=jE.Notification=jE.NotificationKind=void 0;var Td=S1(),Pd=G7(),Id=RY(),Sd=S0(),kd;(function(D){D.NEXT="N",D.ERROR="E",D.COMPLETE="C"})(kd=jE.NotificationKind||(jE.NotificationKind={}));var vd=function(){function D(F,$,J){this.kind=F,this.value=$,this.error=J,this.hasValue=F==="N"}return D.prototype.observe=function(F){return wE(this,F)},D.prototype.do=function(F,$,J){var Q=this,Y=Q.kind,B=Q.value,X=Q.error;return Y==="N"?F===null||F===void 0?void 0:F(B):Y==="E"?$===null||$===void 0?void 0:$(X):J===null||J===void 0?void 0:J()},D.prototype.accept=function(F,$,J){var Q;return Sd.isFunction((Q=F)===null||Q===void 0?void 0:Q.next)?this.observe(F):this.do(F,$,J)},D.prototype.toObservable=function(){var F=this,$=F.kind,J=F.value,Q=F.error,Y=$==="N"?Pd.of(J):$==="E"?Id.throwError(function(){return Q}):$==="C"?Td.EMPTY:0;if(!Y)throw TypeError("Unexpected notification kind "+$);return Y},D.createNext=function(F){return new D("N",F)},D.createError=function(F){return new D("E",void 0,F)},D.createComplete=function(){return D.completeNotification},D.completeNotification=new D("C"),D}();jE.Notification=vd;function wE(D,F){var $,J,Q,Y=D,B=Y.kind,X=Y.value,G=Y.error;if(typeof B!=="string")throw TypeError('Invalid notification, missing "kind"');B==="N"?($=F.next)===null||$===void 0||$.call(F,X):B==="E"?(J=F.error)===null||J===void 0||J.call(F,G):(Q=F.complete)===null||Q===void 0||Q.call(F)}jE.observeNotification=wE});var kE=z((IE)=>{Object.defineProperty(IE,"__esModule",{value:!0});IE.isObservable=void 0;var xd=v0(),PE=S0();function _d(D){return!!D&&(D instanceof xd.Observable||PE.isFunction(D.lift)&&PE.isFunction(D.subscribe))}IE.isObservable=_d});var Q6=z((vE)=>{Object.defineProperty(vE,"__esModule",{value:!0});vE.EmptyError=void 0;var fd=F6();vE.EmptyError=fd.createErrorClass(function(D){return function(){D(this),this.name="EmptyError",this.message="no elements in sequence"}})});var fE=z((xE)=>{Object.defineProperty(xE,"__esModule",{value:!0});xE.lastValueFrom=void 0;var gd=Q6();function hd(D,F){var $=typeof F==="object";return new Promise(function(J,Q){var Y=!1,B;D.subscribe({next:function(X){B=X,Y=!0},error:Q,complete:function(){if(Y)J(B);else if($)J(F.defaultValue);else Q(new gd.EmptyError)}})})}xE.lastValueFrom=hd});var bE=z((gE)=>{Object.defineProperty(gE,"__esModule",{value:!0});gE.firstValueFrom=void 0;var bd=Q6(),ud=s4();function md(D,F){var $=typeof F==="object";return new Promise(function(J,Q){var Y=new ud.SafeSubscriber({next:function(B){J(B),Y.unsubscribe()},error:Q,complete:function(){if($)J(F.defaultValue);else Q(new bd.EmptyError)}});D.subscribe(Y)})}gE.firstValueFrom=md});var CY=z((uE)=>{Object.defineProperty(uE,"__esModule",{value:!0});uE.ArgumentOutOfRangeError=void 0;var ld=F6();uE.ArgumentOutOfRangeError=ld.createErrorClass(function(D){return function(){D(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})});var OY=z((lE)=>{Object.defineProperty(lE,"__esModule",{value:!0});lE.NotFoundError=void 0;var pd=F6();lE.NotFoundError=pd.createErrorClass(function(D){return function($){D(this),this.name="NotFoundError",this.message=$}})});var wY=z((dE)=>{Object.defineProperty(dE,"__esModule",{value:!0});dE.SequenceError=void 0;var dd=F6();dE.SequenceError=dd.createErrorClass(function(D){return function($){D(this),this.name="SequenceError",this.message=$}})});var H7=z((nE)=>{Object.defineProperty(nE,"__esModule",{value:!0});nE.isValidDate=void 0;function cd(D){return D instanceof Date&&!isNaN(D)}nE.isValidDate=cd});var q7=z((aE)=>{Object.defineProperty(aE,"__esModule",{value:!0});aE.timeout=aE.TimeoutError=void 0;var nd=dD(),id=H7(),ad=x(),od=Y0(),sd=F6(),rd=p(),td=I8();aE.TimeoutError=sd.createErrorClass(function(D){return function($){if($===void 0)$=null;D(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=$}});function ed(D,F){var $=id.isValidDate(D)?{first:D}:typeof D==="number"?{each:D}:D,J=$.first,Q=$.each,Y=$.with,B=Y===void 0?Dc:Y,X=$.scheduler,G=X===void 0?F!==null&&F!==void 0?F:nd.asyncScheduler:X,H=$.meta,q=H===void 0?null:H;if(J==null&&Q==null)throw TypeError("No timeout provided.");return ad.operate(function(K,V){var E,Z,L=null,A=0,M=function(N){Z=td.executeSchedule(V,G,function(){try{E.unsubscribe(),od.innerFrom(B({meta:q,lastValue:L,seen:A})).subscribe(V)}catch(w){V.error(w)}},N)};E=K.subscribe(rd.createOperatorSubscriber(V,function(N){Z===null||Z===void 0||Z.unsubscribe(),A++,V.next(L=N),Q>0&&M(Q)},void 0,void 0,function(){if(!(Z===null||Z===void 0?void 0:Z.closed))Z===null||Z===void 0||Z.unsubscribe();L=null})),!A&&M(J!=null?typeof J==="number"?J:+J-G.now():Q)})}aE.timeout=ed;function Dc(D){throw new aE.TimeoutError(D)}});var Y6=z((rE)=>{Object.defineProperty(rE,"__esModule",{value:!0});rE.map=void 0;var Fc=x(),$c=p();function Jc(D,F){return Fc.operate(function($,J){var Q=0;$.subscribe($c.createOperatorSubscriber(J,function(Y){J.next(D.call(F,Y,Q++))}))})}rE.map=Jc});var X6=z((B6)=>{var Qc=B6&&B6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},Yc=B6&&B6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(B6,"__esModule",{value:!0});B6.mapOneOrManyArgs=void 0;var Bc=Y6(),Xc=Array.isArray;function Gc(D,F){return Xc(F)?D.apply(void 0,Yc([],Qc(F))):D(F)}function Wc(D){return Bc.map(function(F){return Gc(D,F)})}B6.mapOneOrManyArgs=Wc});var TY=z((G6)=>{var Hc=G6&&G6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},eE=G6&&G6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(G6,"__esModule",{value:!0});G6.bindCallbackInternals=void 0;var qc=nF(),Kc=v0(),zc=aF(),Ec=X6(),Vc=iF(),Zc=Q7();function jY(D,F,$,J){if($)if(qc.isScheduler($))J=$;else return function(){var Q=[];for(var Y=0;Y<arguments.length;Y++)Q[Y]=arguments[Y];return jY(D,F,J).apply(this,Q).pipe(Ec.mapOneOrManyArgs($))};if(J)return function(){var Q=[];for(var Y=0;Y<arguments.length;Y++)Q[Y]=arguments[Y];return jY(D,F).apply(this,Q).pipe(zc.subscribeOn(J),Vc.observeOn(J))};return function(){var Q=this,Y=[];for(var B=0;B<arguments.length;B++)Y[B]=arguments[B];var X=new Zc.AsyncSubject,G=!0;return new Kc.Observable(function(H){var q=X.subscribe(H);if(G){G=!1;var K=!1,V=!1;if(F.apply(Q,eE(eE([],Hc(Y)),[function(){var E=[];for(var Z=0;Z<arguments.length;Z++)E[Z]=arguments[Z];if(D){var L=E.shift();if(L!=null){X.error(L);return}}if(X.next(1<E.length?E:E[0]),V=!0,K)X.complete()}])),V)X.complete();K=!0}return q})}}G6.bindCallbackInternals=jY});var $V=z((DV)=>{Object.defineProperty(DV,"__esModule",{value:!0});DV.bindCallback=void 0;var Uc=TY();function Lc(D,F,$){return Uc.bindCallbackInternals(!1,D,F,$)}DV.bindCallback=Lc});var YV=z((JV)=>{Object.defineProperty(JV,"__esModule",{value:!0});JV.bindNodeCallback=void 0;var Ac=TY();function Mc(D,F,$){return Ac.bindCallbackInternals(!0,D,F,$)}JV.bindNodeCallback=Mc});var PY=z((BV)=>{Object.defineProperty(BV,"__esModule",{value:!0});BV.argsArgArrayOrObject=void 0;var Nc=Array.isArray,Rc=Object.getPrototypeOf,Cc=Object.prototype,Oc=Object.keys;function wc(D){if(D.length===1){var F=D[0];if(Nc(F))return{args:F,keys:null};if(jc(F)){var $=Oc(F);return{args:$.map(function(J){return F[J]}),keys:$}}}return{args:D,keys:null}}BV.argsArgArrayOrObject=wc;function jc(D){return D&&typeof D==="object"&&Rc(D)===Cc}});var IY=z((GV)=>{Object.defineProperty(GV,"__esModule",{value:!0});GV.createObject=void 0;function Tc(D,F){return D.reduce(function($,J,Q){return $[J]=F[Q],$},{})}GV.createObject=Tc});var K7=z((VV)=>{Object.defineProperty(VV,"__esModule",{value:!0});VV.combineLatestInit=VV.combineLatest=void 0;var Pc=v0(),Ic=PY(),KV=S8(),zV=ED(),Sc=X6(),HV=cD(),kc=IY(),vc=p(),yc=I8();function xc(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=HV.popScheduler(D),J=HV.popResultSelector(D),Q=Ic.argsArgArrayOrObject(D),Y=Q.args,B=Q.keys;if(Y.length===0)return KV.from([],$);var X=new Pc.Observable(EV(Y,$,B?function(G){return kc.createObject(B,G)}:zV.identity));return J?X.pipe(Sc.mapOneOrManyArgs(J)):X}VV.combineLatest=xc;function EV(D,F,$){if($===void 0)$=zV.identity;return function(J){qV(F,function(){var Q=D.length,Y=Array(Q),B=Q,X=Q,G=function(q){qV(F,function(){var K=KV.from(D[q],F),V=!1;K.subscribe(vc.createOperatorSubscriber(J,function(E){if(Y[q]=E,!V)V=!0,X--;if(!X)J.next($(Y.slice()))},function(){if(!--B)J.complete()}))},J)};for(var H=0;H<Q;H++)G(H)},J)}}VV.combineLatestInit=EV;function qV(D,F,$){if(D)yc.executeSchedule($,D,F);else F()}});var z7=z((LV)=>{Object.defineProperty(LV,"__esModule",{value:!0});LV.mergeInternals=void 0;var fc=Y0(),gc=I8(),UV=p();function hc(D,F,$,J,Q,Y,B,X){var G=[],H=0,q=0,K=!1,V=function(){if(K&&!G.length&&!H)F.complete()},E=function(L){return H<J?Z(L):G.push(L)},Z=function(L){Y&&F.next(L),H++;var A=!1;fc.innerFrom($(L,q++)).subscribe(UV.createOperatorSubscriber(F,function(M){if(Q===null||Q===void 0||Q(M),Y)E(M);else F.next(M)},function(){A=!0},void 0,function(){if(A)try{H--;var M=function(){var N=G.shift();if(B)gc.executeSchedule(F,B,function(){return Z(N)});else Z(N)};while(G.length&&H<J)M();V()}catch(N){F.error(N)}}))};return D.subscribe(UV.createOperatorSubscriber(F,E,function(){K=!0,V()})),function(){X===null||X===void 0||X()}}LV.mergeInternals=hc});var k8=z((NV)=>{Object.defineProperty(NV,"__esModule",{value:!0});NV.mergeMap=void 0;var bc=Y6(),uc=Y0(),mc=x(),lc=z7(),pc=S0();function MV(D,F,$){if($===void 0)$=1/0;if(pc.isFunction(F))return MV(function(J,Q){return bc.map(function(Y,B){return F(J,Y,Q,B)})(uc.innerFrom(D(J,Q)))},$);else if(typeof F==="number")$=F;return mc.operate(function(J,Q){return lc.mergeInternals(J,Q,D,$)})}NV.mergeMap=MV});var oF=z((CV)=>{Object.defineProperty(CV,"__esModule",{value:!0});CV.mergeAll=void 0;var dc=k8(),cc=ED();function nc(D){if(D===void 0)D=1/0;return dc.mergeMap(cc.identity,D)}CV.mergeAll=nc});var E7=z((wV)=>{Object.defineProperty(wV,"__esModule",{value:!0});wV.concatAll=void 0;var ic=oF();function ac(){return ic.mergeAll(1)}wV.concatAll=ac});var sF=z((TV)=>{Object.defineProperty(TV,"__esModule",{value:!0});TV.concat=void 0;var oc=E7(),sc=cD(),rc=S8();function tc(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return oc.concatAll()(rc.from(D,sc.popScheduler(D)))}TV.concat=tc});var rF=z((IV)=>{Object.defineProperty(IV,"__esModule",{value:!0});IV.defer=void 0;var ec=v0(),Dn=Y0();function Fn(D){return new ec.Observable(function(F){Dn.innerFrom(D()).subscribe(F)})}IV.defer=Fn});var yV=z((kV)=>{Object.defineProperty(kV,"__esModule",{value:!0});kV.connectable=void 0;var $n=VD(),Jn=v0(),Qn=rF(),Yn={connector:function(){return new $n.Subject},resetOnDisconnect:!0};function Bn(D,F){if(F===void 0)F=Yn;var $=null,J=F.connector,Q=F.resetOnDisconnect,Y=Q===void 0?!0:Q,B=J(),X=new Jn.Observable(function(G){return B.subscribe(G)});return X.connect=function(){if(!$||$.closed){if($=Qn.defer(function(){return D}).subscribe(B),Y)$.add(function(){return B=J()})}return $},X}kV.connectable=Bn});var fV=z((xV)=>{Object.defineProperty(xV,"__esModule",{value:!0});xV.forkJoin=void 0;var Xn=v0(),Gn=PY(),Wn=Y0(),Hn=cD(),qn=p(),Kn=X6(),zn=IY();function En(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=Hn.popResultSelector(D),J=Gn.argsArgArrayOrObject(D),Q=J.args,Y=J.keys,B=new Xn.Observable(function(X){var G=Q.length;if(!G){X.complete();return}var H=Array(G),q=G,K=G,V=function(Z){var L=!1;Wn.innerFrom(Q[Z]).subscribe(qn.createOperatorSubscriber(X,function(A){if(!L)L=!0,K--;H[Z]=A},function(){return q--},void 0,function(){if(!q||!L){if(!K)X.next(Y?zn.createObject(Y,H):H);X.complete()}}))};for(var E=0;E<G;E++)V(E)});return $?B.pipe(Kn.mapOneOrManyArgs($)):B}xV.forkJoin=En});var hV=z((E3)=>{var Vn=E3&&E3.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y};Object.defineProperty(E3,"__esModule",{value:!0});E3.fromEvent=void 0;var Zn=Y0(),Un=v0(),Ln=k8(),An=B7(),e6=S0(),Mn=X6(),Nn=["addListener","removeListener"],Rn=["addEventListener","removeEventListener"],Cn=["on","off"];function SY(D,F,$,J){if(e6.isFunction($))J=$,$=void 0;if(J)return SY(D,F,$).pipe(Mn.mapOneOrManyArgs(J));var Q=Vn(jn(D)?Rn.map(function(X){return function(G){return D[X](F,G,$)}}):On(D)?Nn.map(gV(D,F)):wn(D)?Cn.map(gV(D,F)):[],2),Y=Q[0],B=Q[1];if(!Y){if(An.isArrayLike(D))return Ln.mergeMap(function(X){return SY(X,F,$)})(Zn.innerFrom(D))}if(!Y)throw TypeError("Invalid event target");return new Un.Observable(function(X){var G=function(){var H=[];for(var q=0;q<arguments.length;q++)H[q]=arguments[q];return X.next(1<H.length?H:H[0])};return Y(G),function(){return B(G)}})}E3.fromEvent=SY;function gV(D,F){return function($){return function(J){return D[$](F,J)}}}function On(D){return e6.isFunction(D.addListener)&&e6.isFunction(D.removeListener)}function wn(D){return e6.isFunction(D.on)&&e6.isFunction(D.off)}function jn(D){return e6.isFunction(D.addEventListener)&&e6.isFunction(D.removeEventListener)}});var lV=z((uV)=>{Object.defineProperty(uV,"__esModule",{value:!0});uV.fromEventPattern=void 0;var Tn=v0(),Pn=S0(),In=X6();function bV(D,F,$){if($)return bV(D,F).pipe(In.mapOneOrManyArgs($));return new Tn.Observable(function(J){var Q=function(){var B=[];for(var X=0;X<arguments.length;X++)B[X]=arguments[X];return J.next(B.length===1?B[0]:B)},Y=D(Q);return Pn.isFunction(F)?function(){return F(Q,Y)}:void 0})}uV.fromEventPattern=bV});var dV=z((V3)=>{var Sn=V3&&V3.__generator||function(D,F){var $={label:0,sent:function(){if(Y[0]&1)throw Y[1];return Y[1]},trys:[],ops:[]},J,Q,Y,B;return B={next:X(0),throw:X(1),return:X(2)},typeof Symbol==="function"&&(B[Symbol.iterator]=function(){return this}),B;function X(H){return function(q){return G([H,q])}}function G(H){if(J)throw TypeError("Generator is already executing.");while($)try{if(J=1,Q&&(Y=H[0]&2?Q.return:H[0]?Q.throw||((Y=Q.return)&&Y.call(Q),0):Q.next)&&!(Y=Y.call(Q,H[1])).done)return Y;if(Q=0,Y)H=[H[0]&2,Y.value];switch(H[0]){case 0:case 1:Y=H;break;case 4:return $.label++,{value:H[1],done:!1};case 5:$.label++,Q=H[1],H=[0];continue;case 7:H=$.ops.pop(),$.trys.pop();continue;default:if((Y=$.trys,!(Y=Y.length>0&&Y[Y.length-1]))&&(H[0]===6||H[0]===2)){$=0;continue}if(H[0]===3&&(!Y||H[1]>Y[0]&&H[1]<Y[3])){$.label=H[1];break}if(H[0]===6&&$.label<Y[1]){$.label=Y[1],Y=H;break}if(Y&&$.label<Y[2]){$.label=Y[2],$.ops.push(H);break}if(Y[2])$.ops.pop();$.trys.pop();continue}H=F.call(D,$)}catch(q){H=[6,q],Q=0}finally{J=Y=0}if(H[0]&5)throw H[1];return{value:H[0]?H[1]:void 0,done:!0}}};Object.defineProperty(V3,"__esModule",{value:!0});V3.generate=void 0;var pV=ED(),kn=nF(),vn=rF(),yn=AY();function xn(D,F,$,J,Q){var Y,B,X,G;if(arguments.length===1)Y=D,G=Y.initialState,F=Y.condition,$=Y.iterate,B=Y.resultSelector,X=B===void 0?pV.identity:B,Q=Y.scheduler;else if(G=D,!J||kn.isScheduler(J))X=pV.identity,Q=J;else X=J;function H(){var q;return Sn(this,function(K){switch(K.label){case 0:q=G,K.label=1;case 1:if(!(!F||F(q)))return[3,4];return[4,X(q)];case 2:K.sent(),K.label=3;case 3:return q=$(q),[3,1];case 4:return[2]}})}return vn.defer(Q?function(){return yn.scheduleIterable(H(),Q)}:H)}V3.generate=xn});var iV=z((cV)=>{Object.defineProperty(cV,"__esModule",{value:!0});cV.iif=void 0;var _n=rF();function fn(D,F,$){return _n.defer(function(){return D()?F:$})}cV.iif=fn});var W6=z((aV)=>{Object.defineProperty(aV,"__esModule",{value:!0});aV.timer=void 0;var gn=v0(),hn=dD(),bn=nF(),un=H7();function mn(D,F,$){if(D===void 0)D=0;if($===void 0)$=hn.async;var J=-1;if(F!=null)if(bn.isScheduler(F))$=F;else J=F;return new gn.Observable(function(Q){var Y=un.isValidDate(D)?+D-$.now():D;if(Y<0)Y=0;var B=0;return $.schedule(function(){if(!Q.closed)if(Q.next(B++),0<=J)this.schedule(void 0,J);else Q.complete()},Y)})}aV.timer=mn});var kY=z((sV)=>{Object.defineProperty(sV,"__esModule",{value:!0});sV.interval=void 0;var ln=dD(),pn=W6();function dn(D,F){if(D===void 0)D=0;if(F===void 0)F=ln.asyncScheduler;if(D<0)D=0;return pn.timer(D,D,F)}sV.interval=dn});var FZ=z((eV)=>{Object.defineProperty(eV,"__esModule",{value:!0});eV.merge=void 0;var cn=oF(),nn=Y0(),an=S1(),tV=cD(),on=S8();function sn(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=tV.popScheduler(D),J=tV.popNumber(D,1/0),Q=D;return!Q.length?an.EMPTY:Q.length===1?nn.innerFrom(Q[0]):cn.mergeAll(J)(on.from(Q,$))}eV.merge=sn});var vY=z(($Z)=>{Object.defineProperty($Z,"__esModule",{value:!0});$Z.never=$Z.NEVER=void 0;var rn=v0(),tn=zD();$Z.NEVER=new rn.Observable(tn.noop);function en(){return $Z.NEVER}$Z.never=en});var Z3=z((YZ)=>{Object.defineProperty(YZ,"__esModule",{value:!0});YZ.argsOrArgArray=void 0;var Di=Array.isArray;function Fi(D){return D.length===1&&Di(D[0])?D[0]:D}YZ.argsOrArgArray=Fi});var yY=z((GZ)=>{Object.defineProperty(GZ,"__esModule",{value:!0});GZ.onErrorResumeNext=void 0;var $i=v0(),Ji=Z3(),Qi=p(),XZ=zD(),Yi=Y0();function Bi(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=Ji.argsOrArgArray(D);return new $i.Observable(function(J){var Q=0,Y=function(){if(Q<$.length){var B=void 0;try{B=Yi.innerFrom($[Q++])}catch(G){Y();return}var X=new Qi.OperatorSubscriber(J,void 0,XZ.noop,XZ.noop);B.subscribe(X),X.add(Y)}else J.complete()};Y()})}GZ.onErrorResumeNext=Bi});var KZ=z((HZ)=>{Object.defineProperty(HZ,"__esModule",{value:!0});HZ.pairs=void 0;var Xi=S8();function Gi(D,F){return Xi.from(Object.entries(D),F)}HZ.pairs=Gi});var VZ=z((zZ)=>{Object.defineProperty(zZ,"__esModule",{value:!0});zZ.not=void 0;function Wi(D,F){return function($,J){return!D.call(F,$,J)}}zZ.not=Wi});var D4=z((ZZ)=>{Object.defineProperty(ZZ,"__esModule",{value:!0});ZZ.filter=void 0;var Hi=x(),qi=p();function Ki(D,F){return Hi.operate(function($,J){var Q=0;$.subscribe(qi.createOperatorSubscriber(J,function(Y){return D.call(F,Y,Q++)&&J.next(Y)}))})}ZZ.filter=Ki});var RZ=z((MZ)=>{Object.defineProperty(MZ,"__esModule",{value:!0});MZ.partition=void 0;var zi=VZ(),LZ=D4(),AZ=Y0();function Ei(D,F,$){return[LZ.filter(F,$)(AZ.innerFrom(D)),LZ.filter(zi.not(F,$))(AZ.innerFrom(D))]}MZ.partition=Ei});var xY=z((wZ)=>{Object.defineProperty(wZ,"__esModule",{value:!0});wZ.raceInit=wZ.race=void 0;var Vi=v0(),CZ=Y0(),Zi=Z3(),Ui=p();function Li(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return D=Zi.argsOrArgArray(D),D.length===1?CZ.innerFrom(D[0]):new Vi.Observable(OZ(D))}wZ.race=Li;function OZ(D){return function(F){var $=[],J=function(Y){$.push(CZ.innerFrom(D[Y]).subscribe(Ui.createOperatorSubscriber(F,function(B){if($){for(var X=0;X<$.length;X++)X!==Y&&$[X].unsubscribe();$=null}F.next(B)})))};for(var Q=0;$&&!F.closed&&Q<D.length;Q++)J(Q)}}wZ.raceInit=OZ});var IZ=z((TZ)=>{Object.defineProperty(TZ,"__esModule",{value:!0});TZ.range=void 0;var Mi=v0(),Ni=S1();function Ri(D,F,$){if(F==null)F=D,D=0;if(F<=0)return Ni.EMPTY;var J=F+D;return new Mi.Observable($?function(Q){var Y=D;return $.schedule(function(){if(Y<J)Q.next(Y++),this.schedule();else Q.complete()})}:function(Q){var Y=D;while(Y<J&&!Q.closed)Q.next(Y++);Q.complete()})}TZ.range=Ri});var vZ=z((SZ)=>{Object.defineProperty(SZ,"__esModule",{value:!0});SZ.using=void 0;var Ci=v0(),Oi=Y0(),wi=S1();function ji(D,F){return new Ci.Observable(function($){var J=D(),Q=F(J),Y=Q?Oi.innerFrom(Q):wi.EMPTY;return Y.subscribe($),function(){if(J)J.unsubscribe()}})}SZ.using=ji});var V7=z((H6)=>{var Ti=H6&&H6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},Pi=H6&&H6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(H6,"__esModule",{value:!0});H6.zip=void 0;var Ii=v0(),Si=Y0(),ki=Z3(),vi=S1(),yi=p(),xi=cD();function _i(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=xi.popResultSelector(D),J=ki.argsOrArgArray(D);return J.length?new Ii.Observable(function(Q){var Y=J.map(function(){return[]}),B=J.map(function(){return!1});Q.add(function(){Y=B=null});var X=function(H){Si.innerFrom(J[H]).subscribe(yi.createOperatorSubscriber(Q,function(q){if(Y[H].push(q),Y.every(function(V){return V.length})){var K=Y.map(function(V){return V.shift()});if(Q.next($?$.apply(void 0,Pi([],Ti(K))):K),Y.some(function(V,E){return!V.length&&B[E]}))Q.complete()}},function(){B[H]=!0,!Y[H].length&&Q.complete()}))};for(var G=0;!Q.closed&&G<J.length;G++)X(G);return function(){Y=B=null}}):vi.EMPTY}H6.zip=_i});var xZ=z((yZ)=>{Object.defineProperty(yZ,"__esModule",{value:!0})});var _Y=z((fZ)=>{Object.defineProperty(fZ,"__esModule",{value:!0});fZ.audit=void 0;var fi=x(),gi=Y0(),_Z=p();function hi(D){return fi.operate(function(F,$){var J=!1,Q=null,Y=null,B=!1,X=function(){if(Y===null||Y===void 0||Y.unsubscribe(),Y=null,J){J=!1;var H=Q;Q=null,$.next(H)}B&&$.complete()},G=function(){Y=null,B&&$.complete()};F.subscribe(_Z.createOperatorSubscriber($,function(H){if(J=!0,Q=H,!Y)gi.innerFrom(D(H)).subscribe(Y=_Z.createOperatorSubscriber($,X,G))},function(){B=!0,(!J||!Y||Y.closed)&&$.complete()}))})}fZ.audit=hi});var uZ=z((hZ)=>{Object.defineProperty(hZ,"__esModule",{value:!0});hZ.auditTime=void 0;var bi=dD(),ui=_Y(),mi=W6();function li(D,F){if(F===void 0)F=bi.asyncScheduler;return ui.audit(function(){return mi.timer(D,F)})}hZ.auditTime=li});var dZ=z((lZ)=>{Object.defineProperty(lZ,"__esModule",{value:!0});lZ.buffer=void 0;var pi=x(),di=zD(),mZ=p(),ci=Y0();function ni(D){return pi.operate(function(F,$){var J=[];return F.subscribe(mZ.createOperatorSubscriber($,function(Q){return J.push(Q)},function(){$.next(J),$.complete()})),ci.innerFrom(D).subscribe(mZ.createOperatorSubscriber($,function(){var Q=J;J=[],$.next(Q)},di.noop)),function(){J=null}})}lZ.buffer=ni});var cZ=z((U3)=>{var fY=U3&&U3.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(U3,"__esModule",{value:!0});U3.bufferCount=void 0;var ii=x(),ai=p(),oi=P8();function si(D,F){if(F===void 0)F=null;return F=F!==null&&F!==void 0?F:D,ii.operate(function($,J){var Q=[],Y=0;$.subscribe(ai.createOperatorSubscriber(J,function(B){var X,G,H,q,K=null;if(Y++%F===0)Q.push([]);try{for(var V=fY(Q),E=V.next();!E.done;E=V.next()){var Z=E.value;if(Z.push(B),D<=Z.length)K=K!==null&&K!==void 0?K:[],K.push(Z)}}catch(M){X={error:M}}finally{try{if(E&&!E.done&&(G=V.return))G.call(V)}finally{if(X)throw X.error}}if(K)try{for(var L=fY(K),A=L.next();!A.done;A=L.next()){var Z=A.value;oi.arrRemove(Q,Z),J.next(Z)}}catch(M){H={error:M}}finally{try{if(A&&!A.done&&(q=L.return))q.call(L)}finally{if(H)throw H.error}}},function(){var B,X;try{for(var G=fY(Q),H=G.next();!H.done;H=G.next()){var q=H.value;J.next(q)}}catch(K){B={error:K}}finally{try{if(H&&!H.done&&(X=G.return))X.call(G)}finally{if(B)throw B.error}}J.complete()},void 0,function(){Q=null}))})}U3.bufferCount=si});var iZ=z((L3)=>{var ri=L3&&L3.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(L3,"__esModule",{value:!0});L3.bufferTime=void 0;var ti=F1(),ei=x(),Da=p(),Fa=P8(),$a=dD(),Ja=cD(),nZ=I8();function Qa(D){var F,$,J=[];for(var Q=1;Q<arguments.length;Q++)J[Q-1]=arguments[Q];var Y=(F=Ja.popScheduler(J))!==null&&F!==void 0?F:$a.asyncScheduler,B=($=J[0])!==null&&$!==void 0?$:null,X=J[1]||1/0;return ei.operate(function(G,H){var q=[],K=!1,V=function(L){var{buffer:A,subs:M}=L;M.unsubscribe(),Fa.arrRemove(q,L),H.next(A),K&&E()},E=function(){if(q){var L=new ti.Subscription;H.add(L);var A=[],M={buffer:A,subs:L};q.push(M),nZ.executeSchedule(L,Y,function(){return V(M)},D)}};if(B!==null&&B>=0)nZ.executeSchedule(H,Y,E,B,!0);else K=!0;E();var Z=Da.createOperatorSubscriber(H,function(L){var A,M,N=q.slice();try{for(var w=ri(N),P=w.next();!P.done;P=w.next()){var C=P.value,T=C.buffer;T.push(L),X<=T.length&&V(C)}}catch(y){A={error:y}}finally{try{if(P&&!P.done&&(M=w.return))M.call(w)}finally{if(A)throw A.error}}},function(){while(q===null||q===void 0?void 0:q.length)H.next(q.shift().buffer);Z===null||Z===void 0||Z.unsubscribe(),H.complete(),H.unsubscribe()},void 0,function(){return q=null});G.subscribe(Z)})}L3.bufferTime=Qa});var sZ=z((A3)=>{var Ya=A3&&A3.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(A3,"__esModule",{value:!0});A3.bufferToggle=void 0;var Ba=F1(),Xa=x(),aZ=Y0(),gY=p(),oZ=zD(),Ga=P8();function Wa(D,F){return Xa.operate(function($,J){var Q=[];aZ.innerFrom(D).subscribe(gY.createOperatorSubscriber(J,function(Y){var B=[];Q.push(B);var X=new Ba.Subscription,G=function(){Ga.arrRemove(Q,B),J.next(B),X.unsubscribe()};X.add(aZ.innerFrom(F(Y)).subscribe(gY.createOperatorSubscriber(J,G,oZ.noop)))},oZ.noop)),$.subscribe(gY.createOperatorSubscriber(J,function(Y){var B,X;try{for(var G=Ya(Q),H=G.next();!H.done;H=G.next()){var q=H.value;q.push(Y)}}catch(K){B={error:K}}finally{try{if(H&&!H.done&&(X=G.return))X.call(G)}finally{if(B)throw B.error}}},function(){while(Q.length>0)J.next(Q.shift());J.complete()}))})}A3.bufferToggle=Wa});var DU=z((tZ)=>{Object.defineProperty(tZ,"__esModule",{value:!0});tZ.bufferWhen=void 0;var Ha=x(),qa=zD(),rZ=p(),Ka=Y0();function za(D){return Ha.operate(function(F,$){var J=null,Q=null,Y=function(){Q===null||Q===void 0||Q.unsubscribe();var B=J;J=[],B&&$.next(B),Ka.innerFrom(D()).subscribe(Q=rZ.createOperatorSubscriber($,Y,qa.noop))};Y(),F.subscribe(rZ.createOperatorSubscriber($,function(B){return J===null||J===void 0?void 0:J.push(B)},function(){J&&$.next(J),$.complete()},void 0,function(){return J=Q=null}))})}tZ.bufferWhen=za});var QU=z(($U)=>{Object.defineProperty($U,"__esModule",{value:!0});$U.catchError=void 0;var Ea=Y0(),Va=p(),Za=x();function FU(D){return Za.operate(function(F,$){var J=null,Q=!1,Y;if(J=F.subscribe(Va.createOperatorSubscriber($,void 0,void 0,function(B){if(Y=Ea.innerFrom(D(B,FU(D)(F))),J)J.unsubscribe(),J=null,Y.subscribe($);else Q=!0})),Q)J.unsubscribe(),J=null,Y.subscribe($)})}$U.catchError=FU});var hY=z((YU)=>{Object.defineProperty(YU,"__esModule",{value:!0});YU.scanInternals=void 0;var Ua=p();function La(D,F,$,J,Q){return function(Y,B){var X=$,G=F,H=0;Y.subscribe(Ua.createOperatorSubscriber(B,function(q){var K=H++;G=X?D(G,q,K):(X=!0,q),J&&B.next(G)},Q&&function(){X&&B.next(G),B.complete()}))}}YU.scanInternals=La});var M3=z((XU)=>{Object.defineProperty(XU,"__esModule",{value:!0});XU.reduce=void 0;var Aa=hY(),Ma=x();function Na(D,F){return Ma.operate(Aa.scanInternals(D,F,arguments.length>=2,!1,!0))}XU.reduce=Na});var bY=z((WU)=>{Object.defineProperty(WU,"__esModule",{value:!0});WU.toArray=void 0;var Ra=M3(),Ca=x(),Oa=function(D,F){return D.push(F),D};function wa(){return Ca.operate(function(D,F){Ra.reduce(Oa,[])(D).subscribe(F)})}WU.toArray=wa});var uY=z((qU)=>{Object.defineProperty(qU,"__esModule",{value:!0});qU.joinAllInternals=void 0;var ja=ED(),Ta=X6(),Pa=dF(),Ia=k8(),Sa=bY();function ka(D,F){return Pa.pipe(Sa.toArray(),Ia.mergeMap(function($){return D($)}),F?Ta.mapOneOrManyArgs(F):ja.identity)}qU.joinAllInternals=ka});var mY=z((zU)=>{Object.defineProperty(zU,"__esModule",{value:!0});zU.combineLatestAll=void 0;var va=K7(),ya=uY();function xa(D){return ya.joinAllInternals(va.combineLatest,D)}zU.combineLatestAll=xa});var UU=z((VU)=>{Object.defineProperty(VU,"__esModule",{value:!0});VU.combineAll=void 0;var _a=mY();VU.combineAll=_a.combineLatestAll});var NU=z((q6)=>{var LU=q6&&q6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},AU=q6&&q6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(q6,"__esModule",{value:!0});q6.combineLatest=void 0;var fa=K7(),ga=x(),ha=Z3(),ba=X6(),ua=dF(),ma=cD();function MU(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=ma.popResultSelector(D);return $?ua.pipe(MU.apply(void 0,AU([],LU(D))),ba.mapOneOrManyArgs($)):ga.operate(function(J,Q){fa.combineLatestInit(AU([J],LU(ha.argsOrArgArray(D))))(Q)})}q6.combineLatest=MU});var RU=z((K6)=>{var la=K6&&K6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},pa=K6&&K6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(K6,"__esModule",{value:!0});K6.combineLatestWith=void 0;var da=NU();function ca(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return da.combineLatest.apply(void 0,pa([],la(D)))}K6.combineLatestWith=ca});var lY=z((OU)=>{Object.defineProperty(OU,"__esModule",{value:!0});OU.concatMap=void 0;var CU=k8(),na=S0();function ia(D,F){return na.isFunction(F)?CU.mergeMap(D,F,1):CU.mergeMap(D,1)}OU.concatMap=ia});var IU=z((TU)=>{Object.defineProperty(TU,"__esModule",{value:!0});TU.concatMapTo=void 0;var jU=lY(),aa=S0();function oa(D,F){return aa.isFunction(F)?jU.concatMap(function(){return D},F):jU.concatMap(function(){return D})}TU.concatMapTo=oa});var SU=z((z6)=>{var sa=z6&&z6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},ra=z6&&z6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(z6,"__esModule",{value:!0});z6.concat=void 0;var ta=x(),ea=E7(),Do=cD(),Fo=S8();function $o(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=Do.popScheduler(D);return ta.operate(function(J,Q){ea.concatAll()(Fo.from(ra([J],sa(D)),$)).subscribe(Q)})}z6.concat=$o});var kU=z((E6)=>{var Jo=E6&&E6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},Qo=E6&&E6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(E6,"__esModule",{value:!0});E6.concatWith=void 0;var Yo=SU();function Bo(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return Yo.concat.apply(void 0,Qo([],Jo(D)))}E6.concatWith=Bo});var xU=z((vU)=>{Object.defineProperty(vU,"__esModule",{value:!0});vU.fromSubscribable=void 0;var Xo=v0();function Go(D){return new Xo.Observable(function(F){return D.subscribe(F)})}vU.fromSubscribable=Go});var Z7=z((_U)=>{Object.defineProperty(_U,"__esModule",{value:!0});_U.connect=void 0;var Wo=VD(),Ho=Y0(),qo=x(),Ko=xU(),zo={connector:function(){return new Wo.Subject}};function Eo(D,F){if(F===void 0)F=zo;var $=F.connector;return qo.operate(function(J,Q){var Y=$();Ho.innerFrom(D(Ko.fromSubscribable(Y))).subscribe(Q),Q.add(J.subscribe(Y))})}_U.connect=Eo});var bU=z((gU)=>{Object.defineProperty(gU,"__esModule",{value:!0});gU.count=void 0;var Vo=M3();function Zo(D){return Vo.reduce(function(F,$,J){return!D||D($,J)?F+1:F},0)}gU.count=Zo});var pU=z((mU)=>{Object.defineProperty(mU,"__esModule",{value:!0});mU.debounce=void 0;var Uo=x(),Lo=zD(),uU=p(),Ao=Y0();function Mo(D){return Uo.operate(function(F,$){var J=!1,Q=null,Y=null,B=function(){if(Y===null||Y===void 0||Y.unsubscribe(),Y=null,J){J=!1;var X=Q;Q=null,$.next(X)}};F.subscribe(uU.createOperatorSubscriber($,function(X){Y===null||Y===void 0||Y.unsubscribe(),J=!0,Q=X,Y=uU.createOperatorSubscriber($,B,Lo.noop),Ao.innerFrom(D(X)).subscribe(Y)},function(){B(),$.complete()},void 0,function(){Q=Y=null}))})}mU.debounce=Mo});var nU=z((dU)=>{Object.defineProperty(dU,"__esModule",{value:!0});dU.debounceTime=void 0;var No=dD(),Ro=x(),Co=p();function Oo(D,F){if(F===void 0)F=No.asyncScheduler;return Ro.operate(function($,J){var Q=null,Y=null,B=null,X=function(){if(Q){Q.unsubscribe(),Q=null;var H=Y;Y=null,J.next(H)}};function G(){var H=B+D,q=F.now();if(q<H){Q=this.schedule(void 0,H-q),J.add(Q);return}X()}$.subscribe(Co.createOperatorSubscriber(J,function(H){if(Y=H,B=F.now(),!Q)Q=F.schedule(G,D),J.add(Q)},function(){X(),J.complete()},void 0,function(){Y=Q=null}))})}dU.debounceTime=Oo});var tF=z((iU)=>{Object.defineProperty(iU,"__esModule",{value:!0});iU.defaultIfEmpty=void 0;var wo=x(),jo=p();function To(D){return wo.operate(function(F,$){var J=!1;F.subscribe(jo.createOperatorSubscriber($,function(Q){J=!0,$.next(Q)},function(){if(!J)$.next(D);$.complete()}))})}iU.defaultIfEmpty=To});var eF=z((oU)=>{Object.defineProperty(oU,"__esModule",{value:!0});oU.take=void 0;var Po=S1(),Io=x(),So=p();function ko(D){return D<=0?function(){return Po.EMPTY}:Io.operate(function(F,$){var J=0;F.subscribe(So.createOperatorSubscriber($,function(Q){if(++J<=D){if($.next(Q),D<=J)$.complete()}}))})}oU.take=ko});var pY=z((rU)=>{Object.defineProperty(rU,"__esModule",{value:!0});rU.ignoreElements=void 0;var vo=x(),yo=p(),xo=zD();function _o(){return vo.operate(function(D,F){D.subscribe(yo.createOperatorSubscriber(F,xo.noop))})}rU.ignoreElements=_o});var dY=z((eU)=>{Object.defineProperty(eU,"__esModule",{value:!0});eU.mapTo=void 0;var fo=Y6();function go(D){return fo.map(function(){return D})}eU.mapTo=go});var cY=z((JL)=>{Object.defineProperty(JL,"__esModule",{value:!0});JL.delayWhen=void 0;var ho=sF(),FL=eF(),bo=pY(),uo=dY(),mo=k8(),lo=Y0();function $L(D,F){if(F)return function($){return ho.concat(F.pipe(FL.take(1),bo.ignoreElements()),$.pipe($L(D)))};return mo.mergeMap(function($,J){return lo.innerFrom(D($,J)).pipe(FL.take(1),uo.mapTo($))})}JL.delayWhen=$L});var XL=z((YL)=>{Object.defineProperty(YL,"__esModule",{value:!0});YL.delay=void 0;var po=dD(),co=cY(),no=W6();function io(D,F){if(F===void 0)F=po.asyncScheduler;var $=no.timer(D,F);return co.delayWhen(function(){return $})}YL.delay=io});var HL=z((GL)=>{Object.defineProperty(GL,"__esModule",{value:!0});GL.dematerialize=void 0;var ao=W7(),oo=x(),so=p();function ro(){return oo.operate(function(D,F){D.subscribe(so.createOperatorSubscriber(F,function($){return ao.observeNotification($,F)}))})}GL.dematerialize=ro});var EL=z((KL)=>{Object.defineProperty(KL,"__esModule",{value:!0});KL.distinct=void 0;var to=x(),qL=p(),eo=zD(),Ds=Y0();function Fs(D,F){return to.operate(function($,J){var Q=new Set;$.subscribe(qL.createOperatorSubscriber(J,function(Y){var B=D?D(Y):Y;if(!Q.has(B))Q.add(B),J.next(Y)})),F&&Ds.innerFrom(F).subscribe(qL.createOperatorSubscriber(J,function(){return Q.clear()},eo.noop))})}KL.distinct=Fs});var nY=z((VL)=>{Object.defineProperty(VL,"__esModule",{value:!0});VL.distinctUntilChanged=void 0;var $s=ED(),Js=x(),Qs=p();function Ys(D,F){if(F===void 0)F=$s.identity;return D=D!==null&&D!==void 0?D:Bs,Js.operate(function($,J){var Q,Y=!0;$.subscribe(Qs.createOperatorSubscriber(J,function(B){var X=F(B);if(Y||!D(Q,X))Y=!1,Q=X,J.next(B)}))})}VL.distinctUntilChanged=Ys;function Bs(D,F){return D===F}});var AL=z((UL)=>{Object.defineProperty(UL,"__esModule",{value:!0});UL.distinctUntilKeyChanged=void 0;var Xs=nY();function Gs(D,F){return Xs.distinctUntilChanged(function($,J){return F?F($[D],J[D]):$[D]===J[D]})}UL.distinctUntilKeyChanged=Gs});var D5=z((ML)=>{Object.defineProperty(ML,"__esModule",{value:!0});ML.throwIfEmpty=void 0;var Ws=Q6(),Hs=x(),qs=p();function Ks(D){if(D===void 0)D=zs;return Hs.operate(function(F,$){var J=!1;F.subscribe(qs.createOperatorSubscriber($,function(Q){J=!0,$.next(Q)},function(){return J?$.complete():$.error(D())}))})}ML.throwIfEmpty=Ks;function zs(){return new Ws.EmptyError}});var wL=z((CL)=>{Object.defineProperty(CL,"__esModule",{value:!0});CL.elementAt=void 0;var RL=CY(),Es=D4(),Vs=D5(),Zs=tF(),Us=eF();function Ls(D,F){if(D<0)throw new RL.ArgumentOutOfRangeError;var $=arguments.length>=2;return function(J){return J.pipe(Es.filter(function(Q,Y){return Y===D}),Us.take(1),$?Zs.defaultIfEmpty(F):Vs.throwIfEmpty(function(){return new RL.ArgumentOutOfRangeError}))}}CL.elementAt=Ls});var jL=z((V6)=>{var As=V6&&V6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},Ms=V6&&V6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(V6,"__esModule",{value:!0});V6.endWith=void 0;var Ns=sF(),Rs=G7();function Cs(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return function($){return Ns.concat($,Rs.of.apply(void 0,Ms([],As(D))))}}V6.endWith=Cs});var IL=z((TL)=>{Object.defineProperty(TL,"__esModule",{value:!0});TL.every=void 0;var Os=x(),ws=p();function js(D,F){return Os.operate(function($,J){var Q=0;$.subscribe(ws.createOperatorSubscriber(J,function(Y){if(!D.call(F,Y,Q++,$))J.next(!1),J.complete()},function(){J.next(!0),J.complete()}))})}TL.every=js});var iY=z((yL)=>{Object.defineProperty(yL,"__esModule",{value:!0});yL.exhaustMap=void 0;var Ts=Y6(),SL=Y0(),Ps=x(),kL=p();function vL(D,F){if(F)return function($){return $.pipe(vL(function(J,Q){return SL.innerFrom(D(J,Q)).pipe(Ts.map(function(Y,B){return F(J,Y,Q,B)}))}))};return Ps.operate(function($,J){var Q=0,Y=null,B=!1;$.subscribe(kL.createOperatorSubscriber(J,function(X){if(!Y)Y=kL.createOperatorSubscriber(J,void 0,function(){Y=null,B&&J.complete()}),SL.innerFrom(D(X,Q++)).subscribe(Y)},function(){B=!0,!Y&&J.complete()}))})}yL.exhaustMap=vL});var aY=z((_L)=>{Object.defineProperty(_L,"__esModule",{value:!0});_L.exhaustAll=void 0;var Is=iY(),Ss=ED();function ks(){return Is.exhaustMap(Ss.identity)}_L.exhaustAll=ks});var bL=z((gL)=>{Object.defineProperty(gL,"__esModule",{value:!0});gL.exhaust=void 0;var vs=aY();gL.exhaust=vs.exhaustAll});var lL=z((uL)=>{Object.defineProperty(uL,"__esModule",{value:!0});uL.expand=void 0;var ys=x(),xs=z7();function _s(D,F,$){if(F===void 0)F=1/0;return F=(F||0)<1?1/0:F,ys.operate(function(J,Q){return xs.mergeInternals(J,Q,D,F,void 0,!0,$)})}uL.expand=_s});var cL=z((pL)=>{Object.defineProperty(pL,"__esModule",{value:!0});pL.finalize=void 0;var fs=x();function gs(D){return fs.operate(function(F,$){try{F.subscribe($)}finally{$.add(D)}})}pL.finalize=gs});var oY=z((iL)=>{Object.defineProperty(iL,"__esModule",{value:!0});iL.createFind=iL.find=void 0;var hs=x(),bs=p();function us(D,F){return hs.operate(nL(D,F,"value"))}iL.find=us;function nL(D,F,$){var J=$==="index";return function(Q,Y){var B=0;Q.subscribe(bs.createOperatorSubscriber(Y,function(X){var G=B++;if(D.call(F,X,G,Q))Y.next(J?G:X),Y.complete()},function(){Y.next(J?-1:void 0),Y.complete()}))}}iL.createFind=nL});var rL=z((oL)=>{Object.defineProperty(oL,"__esModule",{value:!0});oL.findIndex=void 0;var ls=x(),ps=oY();function ds(D,F){return ls.operate(ps.createFind(D,F,"index"))}oL.findIndex=ds});var DA=z((tL)=>{Object.defineProperty(tL,"__esModule",{value:!0});tL.first=void 0;var cs=Q6(),ns=D4(),is=eF(),as=tF(),os=D5(),ss=ED();function rs(D,F){var $=arguments.length>=2;return function(J){return J.pipe(D?ns.filter(function(Q,Y){return D(Q,Y,J)}):ss.identity,is.take(1),$?as.defaultIfEmpty(F):os.throwIfEmpty(function(){return new cs.EmptyError}))}}tL.first=rs});var QA=z(($A)=>{Object.defineProperty($A,"__esModule",{value:!0});$A.groupBy=void 0;var ts=v0(),es=Y0(),Dr=VD(),Fr=x(),FA=p();function $r(D,F,$,J){return Fr.operate(function(Q,Y){var B;if(!F||typeof F==="function")B=F;else $=F.duration,B=F.element,J=F.connector;var X=new Map,G=function(Z){X.forEach(Z),Z(Y)},H=function(Z){return G(function(L){return L.error(Z)})},q=0,K=!1,V=new FA.OperatorSubscriber(Y,function(Z){try{var L=D(Z),A=X.get(L);if(!A){X.set(L,A=J?J():new Dr.Subject);var M=E(L,A);if(Y.next(M),$){var N=FA.createOperatorSubscriber(A,function(){A.complete(),N===null||N===void 0||N.unsubscribe()},void 0,void 0,function(){return X.delete(L)});V.add(es.innerFrom($(M)).subscribe(N))}}A.next(B?B(Z):Z)}catch(w){H(w)}},function(){return G(function(Z){return Z.complete()})},H,function(){return X.clear()},function(){return K=!0,q===0});Q.subscribe(V);function E(Z,L){var A=new ts.Observable(function(M){q++;var N=L.subscribe(M);return function(){N.unsubscribe(),--q===0&&K&&V.unsubscribe()}});return A.key=Z,A}})}$A.groupBy=$r});var XA=z((YA)=>{Object.defineProperty(YA,"__esModule",{value:!0});YA.isEmpty=void 0;var Jr=x(),Qr=p();function Yr(){return Jr.operate(function(D,F){D.subscribe(Qr.createOperatorSubscriber(F,function(){F.next(!1),F.complete()},function(){F.next(!0),F.complete()}))})}YA.isEmpty=Yr});var sY=z((N3)=>{var Br=N3&&N3.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(N3,"__esModule",{value:!0});N3.takeLast=void 0;var Xr=S1(),Gr=x(),Wr=p();function Hr(D){return D<=0?function(){return Xr.EMPTY}:Gr.operate(function(F,$){var J=[];F.subscribe(Wr.createOperatorSubscriber($,function(Q){J.push(Q),D<J.length&&J.shift()},function(){var Q,Y;try{for(var B=Br(J),X=B.next();!X.done;X=B.next()){var G=X.value;$.next(G)}}catch(H){Q={error:H}}finally{try{if(X&&!X.done&&(Y=B.return))Y.call(B)}finally{if(Q)throw Q.error}}$.complete()},void 0,function(){J=null}))})}N3.takeLast=Hr});var HA=z((GA)=>{Object.defineProperty(GA,"__esModule",{value:!0});GA.last=void 0;var qr=Q6(),Kr=D4(),zr=sY(),Er=D5(),Vr=tF(),Zr=ED();function Ur(D,F){var $=arguments.length>=2;return function(J){return J.pipe(D?Kr.filter(function(Q,Y){return D(Q,Y,J)}):Zr.identity,zr.takeLast(1),$?Vr.defaultIfEmpty(F):Er.throwIfEmpty(function(){return new qr.EmptyError}))}}GA.last=Ur});var zA=z((qA)=>{Object.defineProperty(qA,"__esModule",{value:!0});qA.materialize=void 0;var rY=W7(),Lr=x(),Ar=p();function Mr(){return Lr.operate(function(D,F){D.subscribe(Ar.createOperatorSubscriber(F,function($){F.next(rY.Notification.createNext($))},function(){F.next(rY.Notification.createComplete()),F.complete()},function($){F.next(rY.Notification.createError($)),F.complete()}))})}qA.materialize=Mr});var ZA=z((EA)=>{Object.defineProperty(EA,"__esModule",{value:!0});EA.max=void 0;var Nr=M3(),Rr=S0();function Cr(D){return Nr.reduce(Rr.isFunction(D)?function(F,$){return D(F,$)>0?F:$}:function(F,$){return F>$?F:$})}EA.max=Cr});var AA=z((UA)=>{Object.defineProperty(UA,"__esModule",{value:!0});UA.flatMap=void 0;var Or=k8();UA.flatMap=Or.mergeMap});var CA=z((NA)=>{Object.defineProperty(NA,"__esModule",{value:!0});NA.mergeMapTo=void 0;var MA=k8(),wr=S0();function jr(D,F,$){if($===void 0)$=1/0;if(wr.isFunction(F))return MA.mergeMap(function(){return D},F,$);if(typeof F==="number")$=F;return MA.mergeMap(function(){return D},$)}NA.mergeMapTo=jr});var jA=z((OA)=>{Object.defineProperty(OA,"__esModule",{value:!0});OA.mergeScan=void 0;var Tr=x(),Pr=z7();function Ir(D,F,$){if($===void 0)$=1/0;return Tr.operate(function(J,Q){var Y=F;return Pr.mergeInternals(J,Q,function(B,X){return D(Y,B,X)},$,function(B){Y=B},!1,void 0,function(){return Y=null})})}OA.mergeScan=Ir});var PA=z((Z6)=>{var Sr=Z6&&Z6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},kr=Z6&&Z6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(Z6,"__esModule",{value:!0});Z6.merge=void 0;var vr=x(),yr=oF(),TA=cD(),xr=S8();function _r(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=TA.popScheduler(D),J=TA.popNumber(D,1/0);return vr.operate(function(Q,Y){yr.mergeAll(J)(xr.from(kr([Q],Sr(D)),$)).subscribe(Y)})}Z6.merge=_r});var IA=z((U6)=>{var fr=U6&&U6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},gr=U6&&U6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(U6,"__esModule",{value:!0});U6.mergeWith=void 0;var hr=PA();function br(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return hr.merge.apply(void 0,gr([],fr(D)))}U6.mergeWith=br});var vA=z((SA)=>{Object.defineProperty(SA,"__esModule",{value:!0});SA.min=void 0;var ur=M3(),mr=S0();function lr(D){return ur.reduce(mr.isFunction(D)?function(F,$){return D(F,$)<0?F:$}:function(F,$){return F<$?F:$})}SA.min=lr});var U7=z((xA)=>{Object.defineProperty(xA,"__esModule",{value:!0});xA.multicast=void 0;var pr=cF(),yA=S0(),dr=Z7();function cr(D,F){var $=yA.isFunction(D)?D:function(){return D};if(yA.isFunction(F))return dr.connect(F,{connector:$});return function(J){return new pr.ConnectableObservable(J,$)}}xA.multicast=cr});var gA=z((Y8)=>{var nr=Y8&&Y8.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},ir=Y8&&Y8.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(Y8,"__esModule",{value:!0});Y8.onErrorResumeNext=Y8.onErrorResumeNextWith=void 0;var ar=Z3(),or=yY();function fA(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=ar.argsOrArgArray(D);return function(J){return or.onErrorResumeNext.apply(void 0,ir([J],nr($)))}}Y8.onErrorResumeNextWith=fA;Y8.onErrorResumeNext=fA});var uA=z((hA)=>{Object.defineProperty(hA,"__esModule",{value:!0});hA.pairwise=void 0;var sr=x(),rr=p();function tr(){return sr.operate(function(D,F){var $,J=!1;D.subscribe(rr.createOperatorSubscriber(F,function(Q){var Y=$;$=Q,J&&F.next([Y,Q]),J=!0}))})}hA.pairwise=tr});var pA=z((mA)=>{Object.defineProperty(mA,"__esModule",{value:!0});mA.pluck=void 0;var er=Y6();function Dt(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=D.length;if($===0)throw Error("list of properties cannot be empty.");return er.map(function(J){var Q=J;for(var Y=0;Y<$;Y++){var B=Q===null||Q===void 0?void 0:Q[D[Y]];if(typeof B<"u")Q=B;else return}return Q})}mA.pluck=Dt});var nA=z((dA)=>{Object.defineProperty(dA,"__esModule",{value:!0});dA.publish=void 0;var Ft=VD(),$t=U7(),Jt=Z7();function Qt(D){return D?function(F){return Jt.connect(D)(F)}:function(F){return $t.multicast(new Ft.Subject)(F)}}dA.publish=Qt});var oA=z((iA)=>{Object.defineProperty(iA,"__esModule",{value:!0});iA.publishBehavior=void 0;var Yt=YY(),Bt=cF();function Xt(D){return function(F){var $=new Yt.BehaviorSubject(D);return new Bt.ConnectableObservable(F,function(){return $})}}iA.publishBehavior=Xt});var tA=z((sA)=>{Object.defineProperty(sA,"__esModule",{value:!0});sA.publishLast=void 0;var Gt=Q7(),Wt=cF();function Ht(){return function(D){var F=new Gt.AsyncSubject;return new Wt.ConnectableObservable(D,function(){return F})}}sA.publishLast=Ht});var $M=z((DM)=>{Object.defineProperty(DM,"__esModule",{value:!0});DM.publishReplay=void 0;var qt=J7(),Kt=U7(),eA=S0();function zt(D,F,$,J){if($&&!eA.isFunction($))J=$;var Q=eA.isFunction($)?$:void 0;return function(Y){return Kt.multicast(new qt.ReplaySubject(D,F,J),Q)(Y)}}DM.publishReplay=zt});var JM=z((L6)=>{var Et=L6&&L6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},Vt=L6&&L6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(L6,"__esModule",{value:!0});L6.raceWith=void 0;var Zt=xY(),Ut=x(),Lt=ED();function At(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return!D.length?Lt.identity:Ut.operate(function($,J){Zt.raceInit(Vt([$],Et(D)))(J)})}L6.raceWith=At});var XM=z((YM)=>{Object.defineProperty(YM,"__esModule",{value:!0});YM.repeat=void 0;var Mt=S1(),Nt=x(),QM=p(),Rt=Y0(),Ct=W6();function Ot(D){var F,$=1/0,J;if(D!=null)if(typeof D==="object")F=D.count,$=F===void 0?1/0:F,J=D.delay;else $=D;return $<=0?function(){return Mt.EMPTY}:Nt.operate(function(Q,Y){var B=0,X,G=function(){if(X===null||X===void 0||X.unsubscribe(),X=null,J!=null){var q=typeof J==="number"?Ct.timer(J):Rt.innerFrom(J(B)),K=QM.createOperatorSubscriber(Y,function(){K.unsubscribe(),H()});q.subscribe(K)}else H()},H=function(){var q=!1;if(X=Q.subscribe(QM.createOperatorSubscriber(Y,void 0,function(){if(++B<$)if(X)G();else q=!0;else Y.complete()})),q)G()};H()})}YM.repeat=Ot});var qM=z((WM)=>{Object.defineProperty(WM,"__esModule",{value:!0});WM.repeatWhen=void 0;var wt=Y0(),jt=VD(),Tt=x(),GM=p();function Pt(D){return Tt.operate(function(F,$){var J,Q=!1,Y,B=!1,X=!1,G=function(){return X&&B&&($.complete(),!0)},H=function(){if(!Y)Y=new jt.Subject,wt.innerFrom(D(Y)).subscribe(GM.createOperatorSubscriber($,function(){if(J)q();else Q=!0},function(){B=!0,G()}));return Y},q=function(){if(X=!1,J=F.subscribe(GM.createOperatorSubscriber($,void 0,function(){X=!0,!G()&&H().next()})),Q)J.unsubscribe(),J=null,Q=!1,q()};q()})}WM.repeatWhen=Pt});var VM=z((zM)=>{Object.defineProperty(zM,"__esModule",{value:!0});zM.retry=void 0;var It=x(),KM=p(),St=ED(),kt=W6(),vt=Y0();function yt(D){if(D===void 0)D=1/0;var F;if(D&&typeof D==="object")F=D;else F={count:D};var $=F.count,J=$===void 0?1/0:$,Q=F.delay,Y=F.resetOnSuccess,B=Y===void 0?!1:Y;return J<=0?St.identity:It.operate(function(X,G){var H=0,q,K=function(){var V=!1;if(q=X.subscribe(KM.createOperatorSubscriber(G,function(E){if(B)H=0;G.next(E)},void 0,function(E){if(H++<J){var Z=function(){if(q)q.unsubscribe(),q=null,K();else V=!0};if(Q!=null){var L=typeof Q==="number"?kt.timer(Q):vt.innerFrom(Q(E,H)),A=KM.createOperatorSubscriber(G,function(){A.unsubscribe(),Z()},function(){G.complete()});L.subscribe(A)}else Z()}else G.error(E)})),V)q.unsubscribe(),q=null,K()};K()})}zM.retry=yt});var AM=z((UM)=>{Object.defineProperty(UM,"__esModule",{value:!0});UM.retryWhen=void 0;var xt=Y0(),_t=VD(),ft=x(),ZM=p();function gt(D){return ft.operate(function(F,$){var J,Q=!1,Y,B=function(){if(J=F.subscribe(ZM.createOperatorSubscriber($,void 0,void 0,function(X){if(!Y)Y=new _t.Subject,xt.innerFrom(D(Y)).subscribe(ZM.createOperatorSubscriber($,function(){return J?B():Q=!0}));if(Y)Y.next(X)})),Q)J.unsubscribe(),J=null,Q=!1,B()};B()})}UM.retryWhen=gt});var tY=z((NM)=>{Object.defineProperty(NM,"__esModule",{value:!0});NM.sample=void 0;var ht=Y0(),bt=x(),ut=zD(),MM=p();function mt(D){return bt.operate(function(F,$){var J=!1,Q=null;F.subscribe(MM.createOperatorSubscriber($,function(Y){J=!0,Q=Y})),ht.innerFrom(D).subscribe(MM.createOperatorSubscriber($,function(){if(J){J=!1;var Y=Q;Q=null,$.next(Y)}},ut.noop))})}NM.sample=mt});var wM=z((CM)=>{Object.defineProperty(CM,"__esModule",{value:!0});CM.sampleTime=void 0;var lt=dD(),pt=tY(),dt=kY();function ct(D,F){if(F===void 0)F=lt.asyncScheduler;return pt.sample(dt.interval(D,F))}CM.sampleTime=ct});var PM=z((jM)=>{Object.defineProperty(jM,"__esModule",{value:!0});jM.scan=void 0;var nt=x(),it=hY();function at(D,F){return nt.operate(it.scanInternals(D,F,arguments.length>=2,!0))}jM.scan=at});var vM=z((SM)=>{Object.defineProperty(SM,"__esModule",{value:!0});SM.sequenceEqual=void 0;var ot=x(),st=p(),rt=Y0();function tt(D,F){if(F===void 0)F=function($,J){return $===J};return ot.operate(function($,J){var Q=IM(),Y=IM(),B=function(G){J.next(G),J.complete()},X=function(G,H){var q=st.createOperatorSubscriber(J,function(K){var{buffer:V,complete:E}=H;if(V.length===0)E?B(!1):G.buffer.push(K);else!F(K,V.shift())&&B(!1)},function(){G.complete=!0;var{complete:K,buffer:V}=H;K&&B(V.length===0),q===null||q===void 0||q.unsubscribe()});return q};$.subscribe(X(Q,Y)),rt.innerFrom(D).subscribe(X(Y,Q))})}SM.sequenceEqual=tt;function IM(){return{buffer:[],complete:!1}}});var DB=z((A6)=>{var et=A6&&A6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},De=A6&&A6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(A6,"__esModule",{value:!0});A6.share=void 0;var yM=Y0(),Fe=VD(),xM=s4(),$e=x();function Je(D){if(D===void 0)D={};var F=D.connector,$=F===void 0?function(){return new Fe.Subject}:F,J=D.resetOnError,Q=J===void 0?!0:J,Y=D.resetOnComplete,B=Y===void 0?!0:Y,X=D.resetOnRefCountZero,G=X===void 0?!0:X;return function(H){var q,K,V,E=0,Z=!1,L=!1,A=function(){K===null||K===void 0||K.unsubscribe(),K=void 0},M=function(){A(),q=V=void 0,Z=L=!1},N=function(){var w=q;M(),w===null||w===void 0||w.unsubscribe()};return $e.operate(function(w,P){if(E++,!L&&!Z)A();var C=V=V!==null&&V!==void 0?V:$();if(P.add(function(){if(E--,E===0&&!L&&!Z)K=eY(N,G)}),C.subscribe(P),!q&&E>0)q=new xM.SafeSubscriber({next:function(T){return C.next(T)},error:function(T){L=!0,A(),K=eY(M,Q,T),C.error(T)},complete:function(){Z=!0,A(),K=eY(M,B),C.complete()}}),yM.innerFrom(w).subscribe(q)})(H)}}A6.share=Je;function eY(D,F){var $=[];for(var J=2;J<arguments.length;J++)$[J-2]=arguments[J];if(F===!0){D();return}if(F===!1)return;var Q=new xM.SafeSubscriber({next:function(){Q.unsubscribe(),D()}});return yM.innerFrom(F.apply(void 0,De([],et($)))).subscribe(Q)}});var gM=z((_M)=>{Object.defineProperty(_M,"__esModule",{value:!0});_M.shareReplay=void 0;var Qe=J7(),Ye=DB();function Be(D,F,$){var J,Q,Y,B,X=!1;if(D&&typeof D==="object")J=D.bufferSize,B=J===void 0?1/0:J,Q=D.windowTime,F=Q===void 0?1/0:Q,Y=D.refCount,X=Y===void 0?!1:Y,$=D.scheduler;else B=D!==null&&D!==void 0?D:1/0;return Ye.share({connector:function(){return new Qe.ReplaySubject(B,F,$)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:X})}_M.shareReplay=Be});var uM=z((hM)=>{Object.defineProperty(hM,"__esModule",{value:!0});hM.single=void 0;var Xe=Q6(),Ge=wY(),We=OY(),He=x(),qe=p();function Ke(D){return He.operate(function(F,$){var J=!1,Q,Y=!1,B=0;F.subscribe(qe.createOperatorSubscriber($,function(X){if(Y=!0,!D||D(X,B++,F))J&&$.error(new Ge.SequenceError("Too many matching values")),J=!0,Q=X},function(){if(J)$.next(Q),$.complete();else $.error(Y?new We.NotFoundError("No matching values"):new Xe.EmptyError)}))})}hM.single=Ke});var pM=z((mM)=>{Object.defineProperty(mM,"__esModule",{value:!0});mM.skip=void 0;var ze=D4();function Ee(D){return ze.filter(function(F,$){return D<=$})}mM.skip=Ee});var nM=z((dM)=>{Object.defineProperty(dM,"__esModule",{value:!0});dM.skipLast=void 0;var Ve=ED(),Ze=x(),Ue=p();function Le(D){return D<=0?Ve.identity:Ze.operate(function(F,$){var J=Array(D),Q=0;return F.subscribe(Ue.createOperatorSubscriber($,function(Y){var B=Q++;if(B<D)J[B]=Y;else{var X=B%D,G=J[X];J[X]=Y,$.next(G)}})),function(){J=null}})}dM.skipLast=Le});var sM=z((aM)=>{Object.defineProperty(aM,"__esModule",{value:!0});aM.skipUntil=void 0;var Ae=x(),iM=p(),Me=Y0(),Ne=zD();function Re(D){return Ae.operate(function(F,$){var J=!1,Q=iM.createOperatorSubscriber($,function(){Q===null||Q===void 0||Q.unsubscribe(),J=!0},Ne.noop);Me.innerFrom(D).subscribe(Q),F.subscribe(iM.createOperatorSubscriber($,function(Y){return J&&$.next(Y)}))})}aM.skipUntil=Re});var eM=z((rM)=>{Object.defineProperty(rM,"__esModule",{value:!0});rM.skipWhile=void 0;var Ce=x(),Oe=p();function we(D){return Ce.operate(function(F,$){var J=!1,Q=0;F.subscribe(Oe.createOperatorSubscriber($,function(Y){return(J||(J=!D(Y,Q++)))&&$.next(Y)}))})}rM.skipWhile=we});var JN=z((FN)=>{Object.defineProperty(FN,"__esModule",{value:!0});FN.startWith=void 0;var DN=sF(),je=cD(),Te=x();function Pe(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=je.popScheduler(D);return Te.operate(function(J,Q){($?DN.concat(D,J,$):DN.concat(D,J)).subscribe(Q)})}FN.startWith=Pe});var F5=z((YN)=>{Object.defineProperty(YN,"__esModule",{value:!0});YN.switchMap=void 0;var Ie=Y0(),Se=x(),QN=p();function ke(D,F){return Se.operate(function($,J){var Q=null,Y=0,B=!1,X=function(){return B&&!Q&&J.complete()};$.subscribe(QN.createOperatorSubscriber(J,function(G){Q===null||Q===void 0||Q.unsubscribe();var H=0,q=Y++;Ie.innerFrom(D(G,q)).subscribe(Q=QN.createOperatorSubscriber(J,function(K){return J.next(F?F(G,K,q,H++):K)},function(){Q=null,X()}))},function(){B=!0,X()}))})}YN.switchMap=ke});var WN=z((XN)=>{Object.defineProperty(XN,"__esModule",{value:!0});XN.switchAll=void 0;var ve=F5(),ye=ED();function xe(){return ve.switchMap(ye.identity)}XN.switchAll=xe});var zN=z((qN)=>{Object.defineProperty(qN,"__esModule",{value:!0});qN.switchMapTo=void 0;var HN=F5(),_e=S0();function fe(D,F){return _e.isFunction(F)?HN.switchMap(function(){return D},F):HN.switchMap(function(){return D})}qN.switchMapTo=fe});var ZN=z((EN)=>{Object.defineProperty(EN,"__esModule",{value:!0});EN.switchScan=void 0;var ge=F5(),he=x();function be(D,F){return he.operate(function($,J){var Q=F;return ge.switchMap(function(Y,B){return D(Q,Y,B)},function(Y,B){return Q=B,B})($).subscribe(J),function(){Q=null}})}EN.switchScan=be});var AN=z((UN)=>{Object.defineProperty(UN,"__esModule",{value:!0});UN.takeUntil=void 0;var ue=x(),me=p(),le=Y0(),pe=zD();function de(D){return ue.operate(function(F,$){le.innerFrom(D).subscribe(me.createOperatorSubscriber($,function(){return $.complete()},pe.noop)),!$.closed&&F.subscribe($)})}UN.takeUntil=de});var RN=z((MN)=>{Object.defineProperty(MN,"__esModule",{value:!0});MN.takeWhile=void 0;var ce=x(),ne=p();function ie(D,F){if(F===void 0)F=!1;return ce.operate(function($,J){var Q=0;$.subscribe(ne.createOperatorSubscriber(J,function(Y){var B=D(Y,Q++);(B||F)&&J.next(Y),!B&&J.complete()}))})}MN.takeWhile=ie});var wN=z((CN)=>{Object.defineProperty(CN,"__esModule",{value:!0});CN.tap=void 0;var ae=S0(),oe=x(),se=p(),re=ED();function te(D,F,$){var J=ae.isFunction(D)||F||$?{next:D,error:F,complete:$}:D;return J?oe.operate(function(Q,Y){var B;(B=J.subscribe)===null||B===void 0||B.call(J);var X=!0;Q.subscribe(se.createOperatorSubscriber(Y,function(G){var H;(H=J.next)===null||H===void 0||H.call(J,G),Y.next(G)},function(){var G;X=!1,(G=J.complete)===null||G===void 0||G.call(J),Y.complete()},function(G){var H;X=!1,(H=J.error)===null||H===void 0||H.call(J,G),Y.error(G)},function(){var G,H;if(X)(G=J.unsubscribe)===null||G===void 0||G.call(J);(H=J.finalize)===null||H===void 0||H.call(J)}))}):re.identity}CN.tap=te});var FB=z((TN)=>{Object.defineProperty(TN,"__esModule",{value:!0});TN.throttle=void 0;var ee=x(),jN=p(),D00=Y0();function F00(D,F){return ee.operate(function($,J){var Q=F!==null&&F!==void 0?F:{},Y=Q.leading,B=Y===void 0?!0:Y,X=Q.trailing,G=X===void 0?!1:X,H=!1,q=null,K=null,V=!1,E=function(){if(K===null||K===void 0||K.unsubscribe(),K=null,G)A(),V&&J.complete()},Z=function(){K=null,V&&J.complete()},L=function(M){return K=D00.innerFrom(D(M)).subscribe(jN.createOperatorSubscriber(J,E,Z))},A=function(){if(H){H=!1;var M=q;q=null,J.next(M),!V&&L(M)}};$.subscribe(jN.createOperatorSubscriber(J,function(M){H=!0,q=M,!(K&&!K.closed)&&(B?A():L(M))},function(){V=!0,!(G&&H&&K&&!K.closed)&&J.complete()}))})}TN.throttle=F00});var kN=z((IN)=>{Object.defineProperty(IN,"__esModule",{value:!0});IN.throttleTime=void 0;var $00=dD(),J00=FB(),Q00=W6();function Y00(D,F,$){if(F===void 0)F=$00.asyncScheduler;var J=Q00.timer(D,F);return J00.throttle(function(){return J},$)}IN.throttleTime=Y00});var _N=z((yN)=>{Object.defineProperty(yN,"__esModule",{value:!0});yN.TimeInterval=yN.timeInterval=void 0;var B00=dD(),X00=x(),G00=p();function W00(D){if(D===void 0)D=B00.asyncScheduler;return X00.operate(function(F,$){var J=D.now();F.subscribe(G00.createOperatorSubscriber($,function(Q){var Y=D.now(),B=Y-J;J=Y,$.next(new vN(Q,B))}))})}yN.timeInterval=W00;var vN=function(){function D(F,$){this.value=F,this.interval=$}return D}();yN.TimeInterval=vN});var hN=z((fN)=>{Object.defineProperty(fN,"__esModule",{value:!0});fN.timeoutWith=void 0;var q00=dD(),K00=H7(),z00=q7();function E00(D,F,$){var J,Q,Y;if($=$!==null&&$!==void 0?$:q00.async,K00.isValidDate(D))J=D;else if(typeof D==="number")Q=D;if(F)Y=function(){return F};else throw TypeError("No observable provided to switch to");if(J==null&&Q==null)throw TypeError("No timeout provided.");return z00.timeout({first:J,each:Q,scheduler:$,with:Y})}fN.timeoutWith=E00});var mN=z((bN)=>{Object.defineProperty(bN,"__esModule",{value:!0});bN.timestamp=void 0;var V00=$7(),Z00=Y6();function U00(D){if(D===void 0)D=V00.dateTimestampProvider;return Z00.map(function(F){return{value:F,timestamp:D.now()}})}bN.timestamp=U00});var nN=z((dN)=>{Object.defineProperty(dN,"__esModule",{value:!0});dN.window=void 0;var lN=VD(),L00=x(),pN=p(),A00=zD(),M00=Y0();function N00(D){return L00.operate(function(F,$){var J=new lN.Subject;$.next(J.asObservable());var Q=function(Y){J.error(Y),$.error(Y)};return F.subscribe(pN.createOperatorSubscriber($,function(Y){return J===null||J===void 0?void 0:J.next(Y)},function(){J.complete(),$.complete()},Q)),M00.innerFrom(D).subscribe(pN.createOperatorSubscriber($,function(){J.complete(),$.next(J=new lN.Subject)},A00.noop,Q)),function(){J===null||J===void 0||J.unsubscribe(),J=null}})}dN.window=N00});var aN=z((R3)=>{var R00=R3&&R3.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(R3,"__esModule",{value:!0});R3.windowCount=void 0;var iN=VD(),C00=x(),O00=p();function w00(D,F){if(F===void 0)F=0;var $=F>0?F:D;return C00.operate(function(J,Q){var Y=[new iN.Subject],B=[],X=0;Q.next(Y[0].asObservable()),J.subscribe(O00.createOperatorSubscriber(Q,function(G){var H,q;try{for(var K=R00(Y),V=K.next();!V.done;V=K.next()){var E=V.value;E.next(G)}}catch(A){H={error:A}}finally{try{if(V&&!V.done&&(q=K.return))q.call(K)}finally{if(H)throw H.error}}var Z=X-D+1;if(Z>=0&&Z%$===0)Y.shift().complete();if(++X%$===0){var L=new iN.Subject;Y.push(L),Q.next(L.asObservable())}},function(){while(Y.length>0)Y.shift().complete();Q.complete()},function(G){while(Y.length>0)Y.shift().error(G);Q.error(G)},function(){B=null,Y=null}))})}R3.windowCount=w00});var tN=z((sN)=>{Object.defineProperty(sN,"__esModule",{value:!0});sN.windowTime=void 0;var j00=VD(),T00=dD(),P00=F1(),I00=x(),S00=p(),k00=P8(),v00=cD(),oN=I8();function y00(D){var F,$,J=[];for(var Q=1;Q<arguments.length;Q++)J[Q-1]=arguments[Q];var Y=(F=v00.popScheduler(J))!==null&&F!==void 0?F:T00.asyncScheduler,B=($=J[0])!==null&&$!==void 0?$:null,X=J[1]||1/0;return I00.operate(function(G,H){var q=[],K=!1,V=function(A){var{window:M,subs:N}=A;M.complete(),N.unsubscribe(),k00.arrRemove(q,A),K&&E()},E=function(){if(q){var A=new P00.Subscription;H.add(A);var M=new j00.Subject,N={window:M,subs:A,seen:0};q.push(N),H.next(M.asObservable()),oN.executeSchedule(A,Y,function(){return V(N)},D)}};if(B!==null&&B>=0)oN.executeSchedule(H,Y,E,B,!0);else K=!0;E();var Z=function(A){return q.slice().forEach(A)},L=function(A){Z(function(M){var N=M.window;return A(N)}),A(H),H.unsubscribe()};return G.subscribe(S00.createOperatorSubscriber(H,function(A){Z(function(M){M.window.next(A),X<=++M.seen&&V(M)})},function(){return L(function(A){return A.complete()})},function(A){return L(function(M){return M.error(A)})})),function(){q=null}})}sN.windowTime=y00});var FR=z((C3)=>{var x00=C3&&C3.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(C3,"__esModule",{value:!0});C3.windowToggle=void 0;var _00=VD(),f00=F1(),g00=x(),eN=Y0(),$B=p(),DR=zD(),h00=P8();function b00(D,F){return g00.operate(function($,J){var Q=[],Y=function(B){while(0<Q.length)Q.shift().error(B);J.error(B)};eN.innerFrom(D).subscribe($B.createOperatorSubscriber(J,function(B){var X=new _00.Subject;Q.push(X);var G=new f00.Subscription,H=function(){h00.arrRemove(Q,X),X.complete(),G.unsubscribe()},q;try{q=eN.innerFrom(F(B))}catch(K){Y(K);return}J.next(X.asObservable()),G.add(q.subscribe($B.createOperatorSubscriber(J,H,DR.noop,Y)))},DR.noop)),$.subscribe($B.createOperatorSubscriber(J,function(B){var X,G,H=Q.slice();try{for(var q=x00(H),K=q.next();!K.done;K=q.next()){var V=K.value;V.next(B)}}catch(E){X={error:E}}finally{try{if(K&&!K.done&&(G=q.return))G.call(q)}finally{if(X)throw X.error}}},function(){while(0<Q.length)Q.shift().complete();J.complete()},Y,function(){while(0<Q.length)Q.shift().unsubscribe()}))})}C3.windowToggle=b00});var YR=z((JR)=>{Object.defineProperty(JR,"__esModule",{value:!0});JR.windowWhen=void 0;var u00=VD(),m00=x(),$R=p(),l00=Y0();function p00(D){return m00.operate(function(F,$){var J,Q,Y=function(X){J.error(X),$.error(X)},B=function(){Q===null||Q===void 0||Q.unsubscribe(),J===null||J===void 0||J.complete(),J=new u00.Subject,$.next(J.asObservable());var X;try{X=l00.innerFrom(D())}catch(G){Y(G);return}X.subscribe(Q=$R.createOperatorSubscriber($,B,B,Y))};B(),F.subscribe($R.createOperatorSubscriber($,function(X){return J.next(X)},function(){J.complete(),$.complete()},Y,function(){Q===null||Q===void 0||Q.unsubscribe(),J=null}))})}JR.windowWhen=p00});var WR=z((M6)=>{var BR=M6&&M6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},XR=M6&&M6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(M6,"__esModule",{value:!0});M6.withLatestFrom=void 0;var d00=x(),GR=p(),c00=Y0(),n00=ED(),i00=zD(),a00=cD();function o00(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=a00.popResultSelector(D);return d00.operate(function(J,Q){var Y=D.length,B=Array(Y),X=D.map(function(){return!1}),G=!1,H=function(K){c00.innerFrom(D[K]).subscribe(GR.createOperatorSubscriber(Q,function(V){if(B[K]=V,!G&&!X[K])X[K]=!0,(G=X.every(n00.identity))&&(X=null)},i00.noop))};for(var q=0;q<Y;q++)H(q);J.subscribe(GR.createOperatorSubscriber(Q,function(K){if(G){var V=XR([K],BR(B));Q.next($?$.apply(void 0,XR([],BR(V))):V)}}))})}M6.withLatestFrom=o00});var KR=z((HR)=>{Object.defineProperty(HR,"__esModule",{value:!0});HR.zipAll=void 0;var s00=V7(),r00=uY();function t00(D){return r00.joinAllInternals(s00.zip,D)}HR.zipAll=t00});var zR=z((N6)=>{var e00=N6&&N6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},DD0=N6&&N6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(N6,"__esModule",{value:!0});N6.zip=void 0;var FD0=V7(),$D0=x();function JD0(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return $D0.operate(function($,J){FD0.zip.apply(void 0,DD0([$],e00(D))).subscribe(J)})}N6.zip=JD0});var ER=z((R6)=>{var QD0=R6&&R6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},YD0=R6&&R6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(R6,"__esModule",{value:!0});R6.zipWith=void 0;var BD0=zR();function XD0(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return BD0.zip.apply(void 0,YD0([],QD0(D)))}R6.zipWith=XD0});var $1=z((U)=>{var GD0=U&&U.__createBinding||(Object.create?function(D,F,$,J){if(J===void 0)J=$;Object.defineProperty(D,J,{enumerable:!0,get:function(){return F[$]}})}:function(D,F,$,J){if(J===void 0)J=$;D[J]=F[$]}),WD0=U&&U.__exportStar||function(D,F){for(var $ in D)if($!=="default"&&!Object.prototype.hasOwnProperty.call(F,$))GD0(F,D,$)};Object.defineProperty(U,"__esModule",{value:!0});U.interval=U.iif=U.generate=U.fromEventPattern=U.fromEvent=U.from=U.forkJoin=U.empty=U.defer=U.connectable=U.concat=U.combineLatest=U.bindNodeCallback=U.bindCallback=U.UnsubscriptionError=U.TimeoutError=U.SequenceError=U.ObjectUnsubscribedError=U.NotFoundError=U.EmptyError=U.ArgumentOutOfRangeError=U.firstValueFrom=U.lastValueFrom=U.isObservable=U.identity=U.noop=U.pipe=U.NotificationKind=U.Notification=U.Subscriber=U.Subscription=U.Scheduler=U.VirtualAction=U.VirtualTimeScheduler=U.animationFrameScheduler=U.animationFrame=U.queueScheduler=U.queue=U.asyncScheduler=U.async=U.asapScheduler=U.asap=U.AsyncSubject=U.ReplaySubject=U.BehaviorSubject=U.Subject=U.animationFrames=U.observable=U.ConnectableObservable=U.Observable=void 0;U.filter=U.expand=U.exhaustMap=U.exhaustAll=U.exhaust=U.every=U.endWith=U.elementAt=U.distinctUntilKeyChanged=U.distinctUntilChanged=U.distinct=U.dematerialize=U.delayWhen=U.delay=U.defaultIfEmpty=U.debounceTime=U.debounce=U.count=U.connect=U.concatWith=U.concatMapTo=U.concatMap=U.concatAll=U.combineLatestWith=U.combineLatestAll=U.combineAll=U.catchError=U.bufferWhen=U.bufferToggle=U.bufferTime=U.bufferCount=U.buffer=U.auditTime=U.audit=U.config=U.NEVER=U.EMPTY=U.scheduled=U.zip=U.using=U.timer=U.throwError=U.range=U.race=U.partition=U.pairs=U.onErrorResumeNext=U.of=U.never=U.merge=void 0;U.switchMap=U.switchAll=U.subscribeOn=U.startWith=U.skipWhile=U.skipUntil=U.skipLast=U.skip=U.single=U.shareReplay=U.share=U.sequenceEqual=U.scan=U.sampleTime=U.sample=U.refCount=U.retryWhen=U.retry=U.repeatWhen=U.repeat=U.reduce=U.raceWith=U.publishReplay=U.publishLast=U.publishBehavior=U.publish=U.pluck=U.pairwise=U.onErrorResumeNextWith=U.observeOn=U.multicast=U.min=U.mergeWith=U.mergeScan=U.mergeMapTo=U.mergeMap=U.flatMap=U.mergeAll=U.max=U.materialize=U.mapTo=U.map=U.last=U.isEmpty=U.ignoreElements=U.groupBy=U.first=U.findIndex=U.find=U.finalize=void 0;U.zipWith=U.zipAll=U.withLatestFrom=U.windowWhen=U.windowToggle=U.windowTime=U.windowCount=U.window=U.toArray=U.timestamp=U.timeoutWith=U.timeout=U.timeInterval=U.throwIfEmpty=U.throttleTime=U.throttle=U.tap=U.takeWhile=U.takeUntil=U.takeLast=U.take=U.switchScan=U.switchMapTo=void 0;var HD0=v0();Object.defineProperty(U,"Observable",{enumerable:!0,get:function(){return HD0.Observable}});var qD0=cF();Object.defineProperty(U,"ConnectableObservable",{enumerable:!0,get:function(){return qD0.ConnectableObservable}});var KD0=pF();Object.defineProperty(U,"observable",{enumerable:!0,get:function(){return KD0.observable}});var zD0=OK();Object.defineProperty(U,"animationFrames",{enumerable:!0,get:function(){return zD0.animationFrames}});var ED0=VD();Object.defineProperty(U,"Subject",{enumerable:!0,get:function(){return ED0.Subject}});var VD0=YY();Object.defineProperty(U,"BehaviorSubject",{enumerable:!0,get:function(){return VD0.BehaviorSubject}});var ZD0=J7();Object.defineProperty(U,"ReplaySubject",{enumerable:!0,get:function(){return ZD0.ReplaySubject}});var UD0=Q7();Object.defineProperty(U,"AsyncSubject",{enumerable:!0,get:function(){return UD0.AsyncSubject}});var VR=rK();Object.defineProperty(U,"asap",{enumerable:!0,get:function(){return VR.asap}});Object.defineProperty(U,"asapScheduler",{enumerable:!0,get:function(){return VR.asapScheduler}});var ZR=dD();Object.defineProperty(U,"async",{enumerable:!0,get:function(){return ZR.async}});Object.defineProperty(U,"asyncScheduler",{enumerable:!0,get:function(){return ZR.asyncScheduler}});var UR=Bz();Object.defineProperty(U,"queue",{enumerable:!0,get:function(){return UR.queue}});Object.defineProperty(U,"queueScheduler",{enumerable:!0,get:function(){return UR.queueScheduler}});var LR=zz();Object.defineProperty(U,"animationFrame",{enumerable:!0,get:function(){return LR.animationFrame}});Object.defineProperty(U,"animationFrameScheduler",{enumerable:!0,get:function(){return LR.animationFrameScheduler}});var AR=Zz();Object.defineProperty(U,"VirtualTimeScheduler",{enumerable:!0,get:function(){return AR.VirtualTimeScheduler}});Object.defineProperty(U,"VirtualAction",{enumerable:!0,get:function(){return AR.VirtualAction}});var LD0=GY();Object.defineProperty(U,"Scheduler",{enumerable:!0,get:function(){return LD0.Scheduler}});var AD0=F1();Object.defineProperty(U,"Subscription",{enumerable:!0,get:function(){return AD0.Subscription}});var MD0=s4();Object.defineProperty(U,"Subscriber",{enumerable:!0,get:function(){return MD0.Subscriber}});var MR=W7();Object.defineProperty(U,"Notification",{enumerable:!0,get:function(){return MR.Notification}});Object.defineProperty(U,"NotificationKind",{enumerable:!0,get:function(){return MR.NotificationKind}});var ND0=dF();Object.defineProperty(U,"pipe",{enumerable:!0,get:function(){return ND0.pipe}});var RD0=zD();Object.defineProperty(U,"noop",{enumerable:!0,get:function(){return RD0.noop}});var CD0=ED();Object.defineProperty(U,"identity",{enumerable:!0,get:function(){return CD0.identity}});var OD0=kE();Object.defineProperty(U,"isObservable",{enumerable:!0,get:function(){return OD0.isObservable}});var wD0=fE();Object.defineProperty(U,"lastValueFrom",{enumerable:!0,get:function(){return wD0.lastValueFrom}});var jD0=bE();Object.defineProperty(U,"firstValueFrom",{enumerable:!0,get:function(){return jD0.firstValueFrom}});var TD0=CY();Object.defineProperty(U,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return TD0.ArgumentOutOfRangeError}});var PD0=Q6();Object.defineProperty(U,"EmptyError",{enumerable:!0,get:function(){return PD0.EmptyError}});var ID0=OY();Object.defineProperty(U,"NotFoundError",{enumerable:!0,get:function(){return ID0.NotFoundError}});var SD0=FY();Object.defineProperty(U,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return SD0.ObjectUnsubscribedError}});var kD0=wY();Object.defineProperty(U,"SequenceError",{enumerable:!0,get:function(){return kD0.SequenceError}});var vD0=q7();Object.defineProperty(U,"TimeoutError",{enumerable:!0,get:function(){return vD0.TimeoutError}});var yD0=mQ();Object.defineProperty(U,"UnsubscriptionError",{enumerable:!0,get:function(){return yD0.UnsubscriptionError}});var xD0=$V();Object.defineProperty(U,"bindCallback",{enumerable:!0,get:function(){return xD0.bindCallback}});var _D0=YV();Object.defineProperty(U,"bindNodeCallback",{enumerable:!0,get:function(){return _D0.bindNodeCallback}});var fD0=K7();Object.defineProperty(U,"combineLatest",{enumerable:!0,get:function(){return fD0.combineLatest}});var gD0=sF();Object.defineProperty(U,"concat",{enumerable:!0,get:function(){return gD0.concat}});var hD0=yV();Object.defineProperty(U,"connectable",{enumerable:!0,get:function(){return hD0.connectable}});var bD0=rF();Object.defineProperty(U,"defer",{enumerable:!0,get:function(){return bD0.defer}});var uD0=S1();Object.defineProperty(U,"empty",{enumerable:!0,get:function(){return uD0.empty}});var mD0=fV();Object.defineProperty(U,"forkJoin",{enumerable:!0,get:function(){return mD0.forkJoin}});var lD0=S8();Object.defineProperty(U,"from",{enumerable:!0,get:function(){return lD0.from}});var pD0=hV();Object.defineProperty(U,"fromEvent",{enumerable:!0,get:function(){return pD0.fromEvent}});var dD0=lV();Object.defineProperty(U,"fromEventPattern",{enumerable:!0,get:function(){return dD0.fromEventPattern}});var cD0=dV();Object.defineProperty(U,"generate",{enumerable:!0,get:function(){return cD0.generate}});var nD0=iV();Object.defineProperty(U,"iif",{enumerable:!0,get:function(){return nD0.iif}});var iD0=kY();Object.defineProperty(U,"interval",{enumerable:!0,get:function(){return iD0.interval}});var aD0=FZ();Object.defineProperty(U,"merge",{enumerable:!0,get:function(){return aD0.merge}});var oD0=vY();Object.defineProperty(U,"never",{enumerable:!0,get:function(){return oD0.never}});var sD0=G7();Object.defineProperty(U,"of",{enumerable:!0,get:function(){return sD0.of}});var rD0=yY();Object.defineProperty(U,"onErrorResumeNext",{enumerable:!0,get:function(){return rD0.onErrorResumeNext}});var tD0=KZ();Object.defineProperty(U,"pairs",{enumerable:!0,get:function(){return tD0.pairs}});var eD0=RZ();Object.defineProperty(U,"partition",{enumerable:!0,get:function(){return eD0.partition}});var D10=xY();Object.defineProperty(U,"race",{enumerable:!0,get:function(){return D10.race}});var F10=IZ();Object.defineProperty(U,"range",{enumerable:!0,get:function(){return F10.range}});var $10=RY();Object.defineProperty(U,"throwError",{enumerable:!0,get:function(){return $10.throwError}});var J10=W6();Object.defineProperty(U,"timer",{enumerable:!0,get:function(){return J10.timer}});var Q10=vZ();Object.defineProperty(U,"using",{enumerable:!0,get:function(){return Q10.using}});var Y10=V7();Object.defineProperty(U,"zip",{enumerable:!0,get:function(){return Y10.zip}});var B10=NY();Object.defineProperty(U,"scheduled",{enumerable:!0,get:function(){return B10.scheduled}});var X10=S1();Object.defineProperty(U,"EMPTY",{enumerable:!0,get:function(){return X10.EMPTY}});var G10=vY();Object.defineProperty(U,"NEVER",{enumerable:!0,get:function(){return G10.NEVER}});WD0(xZ(),U);var W10=o4();Object.defineProperty(U,"config",{enumerable:!0,get:function(){return W10.config}});var H10=_Y();Object.defineProperty(U,"audit",{enumerable:!0,get:function(){return H10.audit}});var q10=uZ();Object.defineProperty(U,"auditTime",{enumerable:!0,get:function(){return q10.auditTime}});var K10=dZ();Object.defineProperty(U,"buffer",{enumerable:!0,get:function(){return K10.buffer}});var z10=cZ();Object.defineProperty(U,"bufferCount",{enumerable:!0,get:function(){return z10.bufferCount}});var E10=iZ();Object.defineProperty(U,"bufferTime",{enumerable:!0,get:function(){return E10.bufferTime}});var V10=sZ();Object.defineProperty(U,"bufferToggle",{enumerable:!0,get:function(){return V10.bufferToggle}});var Z10=DU();Object.defineProperty(U,"bufferWhen",{enumerable:!0,get:function(){return Z10.bufferWhen}});var U10=QU();Object.defineProperty(U,"catchError",{enumerable:!0,get:function(){return U10.catchError}});var L10=UU();Object.defineProperty(U,"combineAll",{enumerable:!0,get:function(){return L10.combineAll}});var A10=mY();Object.defineProperty(U,"combineLatestAll",{enumerable:!0,get:function(){return A10.combineLatestAll}});var M10=RU();Object.defineProperty(U,"combineLatestWith",{enumerable:!0,get:function(){return M10.combineLatestWith}});var N10=E7();Object.defineProperty(U,"concatAll",{enumerable:!0,get:function(){return N10.concatAll}});var R10=lY();Object.defineProperty(U,"concatMap",{enumerable:!0,get:function(){return R10.concatMap}});var C10=IU();Object.defineProperty(U,"concatMapTo",{enumerable:!0,get:function(){return C10.concatMapTo}});var O10=kU();Object.defineProperty(U,"concatWith",{enumerable:!0,get:function(){return O10.concatWith}});var w10=Z7();Object.defineProperty(U,"connect",{enumerable:!0,get:function(){return w10.connect}});var j10=bU();Object.defineProperty(U,"count",{enumerable:!0,get:function(){return j10.count}});var T10=pU();Object.defineProperty(U,"debounce",{enumerable:!0,get:function(){return T10.debounce}});var P10=nU();Object.defineProperty(U,"debounceTime",{enumerable:!0,get:function(){return P10.debounceTime}});var I10=tF();Object.defineProperty(U,"defaultIfEmpty",{enumerable:!0,get:function(){return I10.defaultIfEmpty}});var S10=XL();Object.defineProperty(U,"delay",{enumerable:!0,get:function(){return S10.delay}});var k10=cY();Object.defineProperty(U,"delayWhen",{enumerable:!0,get:function(){return k10.delayWhen}});var v10=HL();Object.defineProperty(U,"dematerialize",{enumerable:!0,get:function(){return v10.dematerialize}});var y10=EL();Object.defineProperty(U,"distinct",{enumerable:!0,get:function(){return y10.distinct}});var x10=nY();Object.defineProperty(U,"distinctUntilChanged",{enumerable:!0,get:function(){return x10.distinctUntilChanged}});var _10=AL();Object.defineProperty(U,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return _10.distinctUntilKeyChanged}});var f10=wL();Object.defineProperty(U,"elementAt",{enumerable:!0,get:function(){return f10.elementAt}});var g10=jL();Object.defineProperty(U,"endWith",{enumerable:!0,get:function(){return g10.endWith}});var h10=IL();Object.defineProperty(U,"every",{enumerable:!0,get:function(){return h10.every}});var b10=bL();Object.defineProperty(U,"exhaust",{enumerable:!0,get:function(){return b10.exhaust}});var u10=aY();Object.defineProperty(U,"exhaustAll",{enumerable:!0,get:function(){return u10.exhaustAll}});var m10=iY();Object.defineProperty(U,"exhaustMap",{enumerable:!0,get:function(){return m10.exhaustMap}});var l10=lL();Object.defineProperty(U,"expand",{enumerable:!0,get:function(){return l10.expand}});var p10=D4();Object.defineProperty(U,"filter",{enumerable:!0,get:function(){return p10.filter}});var d10=cL();Object.defineProperty(U,"finalize",{enumerable:!0,get:function(){return d10.finalize}});var c10=oY();Object.defineProperty(U,"find",{enumerable:!0,get:function(){return c10.find}});var n10=rL();Object.defineProperty(U,"findIndex",{enumerable:!0,get:function(){return n10.findIndex}});var i10=DA();Object.defineProperty(U,"first",{enumerable:!0,get:function(){return i10.first}});var a10=QA();Object.defineProperty(U,"groupBy",{enumerable:!0,get:function(){return a10.groupBy}});var o10=pY();Object.defineProperty(U,"ignoreElements",{enumerable:!0,get:function(){return o10.ignoreElements}});var s10=XA();Object.defineProperty(U,"isEmpty",{enumerable:!0,get:function(){return s10.isEmpty}});var r10=HA();Object.defineProperty(U,"last",{enumerable:!0,get:function(){return r10.last}});var t10=Y6();Object.defineProperty(U,"map",{enumerable:!0,get:function(){return t10.map}});var e10=dY();Object.defineProperty(U,"mapTo",{enumerable:!0,get:function(){return e10.mapTo}});var D80=zA();Object.defineProperty(U,"materialize",{enumerable:!0,get:function(){return D80.materialize}});var F80=ZA();Object.defineProperty(U,"max",{enumerable:!0,get:function(){return F80.max}});var $80=oF();Object.defineProperty(U,"mergeAll",{enumerable:!0,get:function(){return $80.mergeAll}});var J80=AA();Object.defineProperty(U,"flatMap",{enumerable:!0,get:function(){return J80.flatMap}});var Q80=k8();Object.defineProperty(U,"mergeMap",{enumerable:!0,get:function(){return Q80.mergeMap}});var Y80=CA();Object.defineProperty(U,"mergeMapTo",{enumerable:!0,get:function(){return Y80.mergeMapTo}});var B80=jA();Object.defineProperty(U,"mergeScan",{enumerable:!0,get:function(){return B80.mergeScan}});var X80=IA();Object.defineProperty(U,"mergeWith",{enumerable:!0,get:function(){return X80.mergeWith}});var G80=vA();Object.defineProperty(U,"min",{enumerable:!0,get:function(){return G80.min}});var W80=U7();Object.defineProperty(U,"multicast",{enumerable:!0,get:function(){return W80.multicast}});var H80=iF();Object.defineProperty(U,"observeOn",{enumerable:!0,get:function(){return H80.observeOn}});var q80=gA();Object.defineProperty(U,"onErrorResumeNextWith",{enumerable:!0,get:function(){return q80.onErrorResumeNextWith}});var K80=uA();Object.defineProperty(U,"pairwise",{enumerable:!0,get:function(){return K80.pairwise}});var z80=pA();Object.defineProperty(U,"pluck",{enumerable:!0,get:function(){return z80.pluck}});var E80=nA();Object.defineProperty(U,"publish",{enumerable:!0,get:function(){return E80.publish}});var V80=oA();Object.defineProperty(U,"publishBehavior",{enumerable:!0,get:function(){return V80.publishBehavior}});var Z80=tA();Object.defineProperty(U,"publishLast",{enumerable:!0,get:function(){return Z80.publishLast}});var U80=$M();Object.defineProperty(U,"publishReplay",{enumerable:!0,get:function(){return U80.publishReplay}});var L80=JM();Object.defineProperty(U,"raceWith",{enumerable:!0,get:function(){return L80.raceWith}});var A80=M3();Object.defineProperty(U,"reduce",{enumerable:!0,get:function(){return A80.reduce}});var M80=XM();Object.defineProperty(U,"repeat",{enumerable:!0,get:function(){return M80.repeat}});var N80=qM();Object.defineProperty(U,"repeatWhen",{enumerable:!0,get:function(){return N80.repeatWhen}});var R80=VM();Object.defineProperty(U,"retry",{enumerable:!0,get:function(){return R80.retry}});var C80=AM();Object.defineProperty(U,"retryWhen",{enumerable:!0,get:function(){return C80.retryWhen}});var O80=tQ();Object.defineProperty(U,"refCount",{enumerable:!0,get:function(){return O80.refCount}});var w80=tY();Object.defineProperty(U,"sample",{enumerable:!0,get:function(){return w80.sample}});var j80=wM();Object.defineProperty(U,"sampleTime",{enumerable:!0,get:function(){return j80.sampleTime}});var T80=PM();Object.defineProperty(U,"scan",{enumerable:!0,get:function(){return T80.scan}});var P80=vM();Object.defineProperty(U,"sequenceEqual",{enumerable:!0,get:function(){return P80.sequenceEqual}});var I80=DB();Object.defineProperty(U,"share",{enumerable:!0,get:function(){return I80.share}});var S80=gM();Object.defineProperty(U,"shareReplay",{enumerable:!0,get:function(){return S80.shareReplay}});var k80=uM();Object.defineProperty(U,"single",{enumerable:!0,get:function(){return k80.single}});var v80=pM();Object.defineProperty(U,"skip",{enumerable:!0,get:function(){return v80.skip}});var y80=nM();Object.defineProperty(U,"skipLast",{enumerable:!0,get:function(){return y80.skipLast}});var x80=sM();Object.defineProperty(U,"skipUntil",{enumerable:!0,get:function(){return x80.skipUntil}});var _80=eM();Object.defineProperty(U,"skipWhile",{enumerable:!0,get:function(){return _80.skipWhile}});var f80=JN();Object.defineProperty(U,"startWith",{enumerable:!0,get:function(){return f80.startWith}});var g80=aF();Object.defineProperty(U,"subscribeOn",{enumerable:!0,get:function(){return g80.subscribeOn}});var h80=WN();Object.defineProperty(U,"switchAll",{enumerable:!0,get:function(){return h80.switchAll}});var b80=F5();Object.defineProperty(U,"switchMap",{enumerable:!0,get:function(){return b80.switchMap}});var u80=zN();Object.defineProperty(U,"switchMapTo",{enumerable:!0,get:function(){return u80.switchMapTo}});var m80=ZN();Object.defineProperty(U,"switchScan",{enumerable:!0,get:function(){return m80.switchScan}});var l80=eF();Object.defineProperty(U,"take",{enumerable:!0,get:function(){return l80.take}});var p80=sY();Object.defineProperty(U,"takeLast",{enumerable:!0,get:function(){return p80.takeLast}});var d80=AN();Object.defineProperty(U,"takeUntil",{enumerable:!0,get:function(){return d80.takeUntil}});var c80=RN();Object.defineProperty(U,"takeWhile",{enumerable:!0,get:function(){return c80.takeWhile}});var n80=wN();Object.defineProperty(U,"tap",{enumerable:!0,get:function(){return n80.tap}});var i80=FB();Object.defineProperty(U,"throttle",{enumerable:!0,get:function(){return i80.throttle}});var a80=kN();Object.defineProperty(U,"throttleTime",{enumerable:!0,get:function(){return a80.throttleTime}});var o80=D5();Object.defineProperty(U,"throwIfEmpty",{enumerable:!0,get:function(){return o80.throwIfEmpty}});var s80=_N();Object.defineProperty(U,"timeInterval",{enumerable:!0,get:function(){return s80.timeInterval}});var r80=q7();Object.defineProperty(U,"timeout",{enumerable:!0,get:function(){return r80.timeout}});var t80=hN();Object.defineProperty(U,"timeoutWith",{enumerable:!0,get:function(){return t80.timeoutWith}});var e80=mN();Object.defineProperty(U,"timestamp",{enumerable:!0,get:function(){return e80.timestamp}});var D60=bY();Object.defineProperty(U,"toArray",{enumerable:!0,get:function(){return D60.toArray}});var F60=nN();Object.defineProperty(U,"window",{enumerable:!0,get:function(){return F60.window}});var $60=aN();Object.defineProperty(U,"windowCount",{enumerable:!0,get:function(){return $60.windowCount}});var J60=tN();Object.defineProperty(U,"windowTime",{enumerable:!0,get:function(){return J60.windowTime}});var Q60=FR();Object.defineProperty(U,"windowToggle",{enumerable:!0,get:function(){return Q60.windowToggle}});var Y60=YR();Object.defineProperty(U,"windowWhen",{enumerable:!0,get:function(){return Y60.windowWhen}});var B60=WR();Object.defineProperty(U,"withLatestFrom",{enumerable:!0,get:function(){return B60.withLatestFrom}});var X60=KR();Object.defineProperty(U,"zipAll",{enumerable:!0,get:function(){return X60.zipAll}});var G60=ER();Object.defineProperty(U,"zipWith",{enumerable:!0,get:function(){return G60.zipWith}})});function W60(D,F){return{value:D,key:F||{}}}function ZD(D){let F=a0.fromEvent(D.input,"keypress",W60).pipe(a0.takeUntil(a0.fromEvent(D,"close"))).pipe(a0.filter(({key:$})=>$.name!=="enter"&&$.name!=="return"));return{line:a0.fromEvent(D,"line"),keypress:F,normalizedUpKey:F.pipe(a0.filter(({key:$})=>$.name==="up"||$.name==="k"||$.name==="p"&&$.ctrl),a0.share()),normalizedDownKey:F.pipe(a0.filter(({key:$})=>$.name==="down"||$.name==="j"||$.name==="n"&&$.ctrl),a0.share()),numberKey:F.pipe(a0.filter(($)=>$.value&&"123456789".includes($.value)),a0.map(($)=>Number($.value)),a0.share()),spaceKey:F.pipe(a0.filter(({key:$})=>$&&$.name==="space"),a0.share()),aKey:F.pipe(a0.filter(({key:$})=>$&&$.name==="a"),a0.share()),iKey:F.pipe(a0.filter(({key:$})=>$&&$.name==="i"),a0.share())}}var a0;var v8=I(()=>{a0=s($1(),1)});class B8{constructor(D,F={}){let{isInfinite:$=!0}=F;this.lastIndex=0,this.screen=D,this.isInfinite=$}paginate(D,F,$){$||=7;let J=D.split(`
31
+ `):"",this.name="UnsubscriptionError",this.errors=$}})});var P8=z((Tq)=>{Object.defineProperty(Tq,"__esModule",{value:!0});Tq.arrRemove=void 0;function bu(D,F){if(D){var $=D.indexOf(F);0<=$&&D.splice($,1)}}Tq.arrRemove=bu});var F1=z((pD)=>{var Iq=pD&&pD.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")},Sq=pD&&pD.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},kq=pD&&pD.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(pD,"__esModule",{value:!0});pD.isSubscription=pD.EMPTY_SUBSCRIPTION=pD.Subscription=void 0;var lF=S0(),lQ=mQ(),vq=P8(),pQ=function(){function D(F){this.initialTeardown=F,this.closed=!1,this._parentage=null,this._finalizers=null}return D.prototype.unsubscribe=function(){var F,$,J,Q,Y;if(!this.closed){this.closed=!0;var B=this._parentage;if(B)if(this._parentage=null,Array.isArray(B))try{for(var X=Iq(B),G=X.next();!G.done;G=X.next()){var H=G.value;H.remove(this)}}catch(L){F={error:L}}finally{try{if(G&&!G.done&&($=X.return))$.call(X)}finally{if(F)throw F.error}}else B.remove(this);var q=this.initialTeardown;if(lF.isFunction(q))try{q()}catch(L){Y=L instanceof lQ.UnsubscriptionError?L.errors:[L]}var K=this._finalizers;if(K){this._finalizers=null;try{for(var V=Iq(K),E=V.next();!E.done;E=V.next()){var Z=E.value;try{yq(Z)}catch(L){if(Y=Y!==null&&Y!==void 0?Y:[],L instanceof lQ.UnsubscriptionError)Y=kq(kq([],Sq(Y)),Sq(L.errors));else Y.push(L)}}}catch(L){J={error:L}}finally{try{if(E&&!E.done&&(Q=V.return))Q.call(V)}finally{if(J)throw J.error}}}if(Y)throw new lQ.UnsubscriptionError(Y)}},D.prototype.add=function(F){var $;if(F&&F!==this)if(this.closed)yq(F);else{if(F instanceof D){if(F.closed||F._hasParent(this))return;F._addParent(this)}(this._finalizers=($=this._finalizers)!==null&&$!==void 0?$:[]).push(F)}},D.prototype._hasParent=function(F){var $=this._parentage;return $===F||Array.isArray($)&&$.includes(F)},D.prototype._addParent=function(F){var $=this._parentage;this._parentage=Array.isArray($)?($.push(F),$):$?[$,F]:F},D.prototype._removeParent=function(F){var $=this._parentage;if($===F)this._parentage=null;else if(Array.isArray($))vq.arrRemove($,F)},D.prototype.remove=function(F){var $=this._finalizers;if($&&vq.arrRemove($,F),F instanceof D)F._removeParent(this)},D.EMPTY=function(){var F=new D;return F.closed=!0,F}(),D}();pD.Subscription=pQ;pD.EMPTY_SUBSCRIPTION=pQ.EMPTY;function uu(D){return D instanceof pQ||D&&"closed"in D&&lF.isFunction(D.remove)&&lF.isFunction(D.add)&&lF.isFunction(D.unsubscribe)}pD.isSubscription=uu;function yq(D){if(lF.isFunction(D))D();else D.unsubscribe()}});var o4=z((xq)=>{Object.defineProperty(xq,"__esModule",{value:!0});xq.config=void 0;xq.config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}});var dQ=z((F8)=>{var fq=F8&&F8.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},gq=F8&&F8.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(F8,"__esModule",{value:!0});F8.timeoutProvider=void 0;F8.timeoutProvider={setTimeout:function(D,F){var $=[];for(var J=2;J<arguments.length;J++)$[J-2]=arguments[J];var Q=F8.timeoutProvider.delegate;if(Q===null||Q===void 0?void 0:Q.setTimeout)return Q.setTimeout.apply(Q,gq([D,F],fq($)));return setTimeout.apply(void 0,gq([D,F],fq($)))},clearTimeout:function(D){var F=F8.timeoutProvider.delegate;return((F===null||F===void 0?void 0:F.clearTimeout)||clearTimeout)(D)},delegate:void 0}});var cQ=z((hq)=>{Object.defineProperty(hq,"__esModule",{value:!0});hq.reportUnhandledError=void 0;var mu=o4(),lu=dQ();function pu(D){lu.timeoutProvider.setTimeout(function(){var F=mu.config.onUnhandledError;if(F)F(D);else throw D})}hq.reportUnhandledError=pu});var zD=z((uq)=>{Object.defineProperty(uq,"__esModule",{value:!0});uq.noop=void 0;function du(){}uq.noop=du});var dq=z((lq)=>{Object.defineProperty(lq,"__esModule",{value:!0});lq.createNotification=lq.nextNotification=lq.errorNotification=lq.COMPLETE_NOTIFICATION=void 0;lq.COMPLETE_NOTIFICATION=function(){return e9("C",void 0,void 0)}();function cu(D){return e9("E",void 0,D)}lq.errorNotification=cu;function nu(D){return e9("N",D,void 0)}lq.nextNotification=nu;function e9(D,F,$){return{kind:D,value:F,error:$}}lq.createNotification=e9});var D7=z((nq)=>{Object.defineProperty(nq,"__esModule",{value:!0});nq.captureError=nq.errorContext=void 0;var cq=o4(),t6=null;function su(D){if(cq.config.useDeprecatedSynchronousErrorHandling){var F=!t6;if(F)t6={errorThrown:!1,error:null};if(D(),F){var $=t6,J=$.errorThrown,Q=$.error;if(t6=null,J)throw Q}}else D()}nq.errorContext=su;function ru(D){if(cq.config.useDeprecatedSynchronousErrorHandling&&t6)t6.errorThrown=!0,t6.error=D}nq.captureError=ru});var s4=z((P1)=>{var sq=P1&&P1.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(P1,"__esModule",{value:!0});P1.EMPTY_OBSERVER=P1.SafeSubscriber=P1.Subscriber=void 0;var eu=S0(),aq=F1(),oQ=o4(),Dm=cQ(),oq=zD(),nQ=dq(),Fm=dQ(),$m=D7(),rq=function(D){sq(F,D);function F($){var J=D.call(this)||this;if(J.isStopped=!1,$){if(J.destination=$,aq.isSubscription($))$.add(J)}else J.destination=P1.EMPTY_OBSERVER;return J}return F.create=function($,J,Q){return new tq($,J,Q)},F.prototype.next=function($){if(this.isStopped)aQ(nQ.nextNotification($),this);else this._next($)},F.prototype.error=function($){if(this.isStopped)aQ(nQ.errorNotification($),this);else this.isStopped=!0,this._error($)},F.prototype.complete=function(){if(this.isStopped)aQ(nQ.COMPLETE_NOTIFICATION,this);else this.isStopped=!0,this._complete()},F.prototype.unsubscribe=function(){if(!this.closed)this.isStopped=!0,D.prototype.unsubscribe.call(this),this.destination=null},F.prototype._next=function($){this.destination.next($)},F.prototype._error=function($){try{this.destination.error($)}finally{this.unsubscribe()}},F.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},F}(aq.Subscription);P1.Subscriber=rq;var Jm=Function.prototype.bind;function iQ(D,F){return Jm.call(D,F)}var Qm=function(){function D(F){this.partialObserver=F}return D.prototype.next=function(F){var $=this.partialObserver;if($.next)try{$.next(F)}catch(J){F7(J)}},D.prototype.error=function(F){var $=this.partialObserver;if($.error)try{$.error(F)}catch(J){F7(J)}else F7(F)},D.prototype.complete=function(){var F=this.partialObserver;if(F.complete)try{F.complete()}catch($){F7($)}},D}(),tq=function(D){sq(F,D);function F($,J,Q){var Y=D.call(this)||this,B;if(eu.isFunction($)||!$)B={next:$!==null&&$!==void 0?$:void 0,error:J!==null&&J!==void 0?J:void 0,complete:Q!==null&&Q!==void 0?Q:void 0};else{var X;if(Y&&oQ.config.useDeprecatedNextContext)X=Object.create($),X.unsubscribe=function(){return Y.unsubscribe()},B={next:$.next&&iQ($.next,X),error:$.error&&iQ($.error,X),complete:$.complete&&iQ($.complete,X)};else B=$}return Y.destination=new Qm(B),Y}return F}(rq);P1.SafeSubscriber=tq;function F7(D){if(oQ.config.useDeprecatedSynchronousErrorHandling)$m.captureError(D);else Dm.reportUnhandledError(D)}function Ym(D){throw D}function aQ(D,F){var $=oQ.config.onStoppedNotification;$&&Fm.timeoutProvider.setTimeout(function(){return $(D,F)})}P1.EMPTY_OBSERVER={closed:!0,next:oq.noop,error:Ym,complete:oq.noop}});var pF=z((eq)=>{Object.defineProperty(eq,"__esModule",{value:!0});eq.observable=void 0;eq.observable=function(){return typeof Symbol==="function"&&Symbol.observable||"@@observable"}()});var ED=z((FK)=>{Object.defineProperty(FK,"__esModule",{value:!0});FK.identity=void 0;function Bm(D){return D}FK.identity=Bm});var dF=z((QK)=>{Object.defineProperty(QK,"__esModule",{value:!0});QK.pipeFromArray=QK.pipe=void 0;var Xm=ED();function Gm(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return JK(D)}QK.pipe=Gm;function JK(D){if(D.length===0)return Xm.identity;if(D.length===1)return D[0];return function($){return D.reduce(function(J,Q){return Q(J)},$)}}QK.pipeFromArray=JK});var v0=z((XK)=>{Object.defineProperty(XK,"__esModule",{value:!0});XK.Observable=void 0;var rQ=s4(),Hm=F1(),qm=pF(),Km=dF(),zm=o4(),sQ=S0(),Em=D7(),Vm=function(){function D(F){if(F)this._subscribe=F}return D.prototype.lift=function(F){var $=new D;return $.source=this,$.operator=F,$},D.prototype.subscribe=function(F,$,J){var Q=this,Y=Um(F)?F:new rQ.SafeSubscriber(F,$,J);return Em.errorContext(function(){var B=Q,X=B.operator,G=B.source;Y.add(X?X.call(Y,G):G?Q._subscribe(Y):Q._trySubscribe(Y))}),Y},D.prototype._trySubscribe=function(F){try{return this._subscribe(F)}catch($){F.error($)}},D.prototype.forEach=function(F,$){var J=this;return $=BK($),new $(function(Q,Y){var B=new rQ.SafeSubscriber({next:function(X){try{F(X)}catch(G){Y(G),B.unsubscribe()}},error:Y,complete:Q});J.subscribe(B)})},D.prototype._subscribe=function(F){var $;return($=this.source)===null||$===void 0?void 0:$.subscribe(F)},D.prototype[qm.observable]=function(){return this},D.prototype.pipe=function(){var F=[];for(var $=0;$<arguments.length;$++)F[$]=arguments[$];return Km.pipeFromArray(F)(this)},D.prototype.toPromise=function(F){var $=this;return F=BK(F),new F(function(J,Q){var Y;$.subscribe(function(B){return Y=B},function(B){return Q(B)},function(){return J(Y)})})},D.create=function(F){return new D(F)},D}();XK.Observable=Vm;function BK(D){var F;return(F=D!==null&&D!==void 0?D:zm.config.Promise)!==null&&F!==void 0?F:Promise}function Zm(D){return D&&sQ.isFunction(D.next)&&sQ.isFunction(D.error)&&sQ.isFunction(D.complete)}function Um(D){return D&&D instanceof rQ.Subscriber||Zm(D)&&Hm.isSubscription(D)}});var x=z((HK)=>{Object.defineProperty(HK,"__esModule",{value:!0});HK.operate=HK.hasLift=void 0;var Lm=S0();function WK(D){return Lm.isFunction(D===null||D===void 0?void 0:D.lift)}HK.hasLift=WK;function Am(D){return function(F){if(WK(F))return F.lift(function($){try{return D($,this)}catch(J){this.error(J)}});throw TypeError("Unable to lift unknown Observable type")}}HK.operate=Am});var p=z(($6)=>{var Nm=$6&&$6.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty($6,"__esModule",{value:!0});$6.OperatorSubscriber=$6.createOperatorSubscriber=void 0;var Rm=s4();function Cm(D,F,$,J,Q){return new KK(D,F,$,J,Q)}$6.createOperatorSubscriber=Cm;var KK=function(D){Nm(F,D);function F($,J,Q,Y,B,X){var G=D.call(this,$)||this;return G.onFinalize=B,G.shouldUnsubscribe=X,G._next=J?function(H){try{J(H)}catch(q){$.error(q)}}:D.prototype._next,G._error=Y?function(H){try{Y(H)}catch(q){$.error(q)}finally{this.unsubscribe()}}:D.prototype._error,G._complete=Q?function(){try{Q()}catch(H){$.error(H)}finally{this.unsubscribe()}}:D.prototype._complete,G}return F.prototype.unsubscribe=function(){var $;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var J=this.closed;D.prototype.unsubscribe.call(this),!J&&(($=this.onFinalize)===null||$===void 0||$.call(this))}},F}(Rm.Subscriber);$6.OperatorSubscriber=KK});var tQ=z((zK)=>{Object.defineProperty(zK,"__esModule",{value:!0});zK.refCount=void 0;var Om=x(),wm=p();function jm(){return Om.operate(function(D,F){var $=null;D._refCount++;var J=wm.createOperatorSubscriber(F,void 0,void 0,void 0,function(){if(!D||D._refCount<=0||0<--D._refCount){$=null;return}var Q=D._connection,Y=$;if($=null,Q&&(!Y||Q===Y))Q.unsubscribe();F.unsubscribe()});if(D.subscribe(J),!J.closed)$=D.connect()})}zK.refCount=jm});var cF=z((r4)=>{var Tm=r4&&r4.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(r4,"__esModule",{value:!0});r4.ConnectableObservable=void 0;var Pm=v0(),VK=F1(),Im=tQ(),Sm=p(),km=x(),vm=function(D){Tm(F,D);function F($,J){var Q=D.call(this)||this;if(Q.source=$,Q.subjectFactory=J,Q._subject=null,Q._refCount=0,Q._connection=null,km.hasLift($))Q.lift=$.lift;return Q}return F.prototype._subscribe=function($){return this.getSubject().subscribe($)},F.prototype.getSubject=function(){var $=this._subject;if(!$||$.isStopped)this._subject=this.subjectFactory();return this._subject},F.prototype._teardown=function(){this._refCount=0;var $=this._connection;this._subject=this._connection=null,$===null||$===void 0||$.unsubscribe()},F.prototype.connect=function(){var $=this,J=this._connection;if(!J){J=this._connection=new VK.Subscription;var Q=this.getSubject();if(J.add(this.source.subscribe(Sm.createOperatorSubscriber(Q,void 0,function(){$._teardown(),Q.complete()},function(Y){$._teardown(),Q.error(Y)},function(){return $._teardown()}))),J.closed)this._connection=null,J=VK.Subscription.EMPTY}return J},F.prototype.refCount=function(){return Im.refCount()(this)},F}(Pm.Observable);r4.ConnectableObservable=vm});var UK=z((ZK)=>{Object.defineProperty(ZK,"__esModule",{value:!0});ZK.performanceTimestampProvider=void 0;ZK.performanceTimestampProvider={now:function(){return(ZK.performanceTimestampProvider.delegate||performance).now()},delegate:void 0}});var DY=z((I1)=>{var LK=I1&&I1.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},AK=I1&&I1.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(I1,"__esModule",{value:!0});I1.animationFrameProvider=void 0;var ym=F1();I1.animationFrameProvider={schedule:function(D){var F=requestAnimationFrame,$=cancelAnimationFrame,J=I1.animationFrameProvider.delegate;if(J)F=J.requestAnimationFrame,$=J.cancelAnimationFrame;var Q=F(function(Y){$=void 0,D(Y)});return new ym.Subscription(function(){return $===null||$===void 0?void 0:$(Q)})},requestAnimationFrame:function(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=I1.animationFrameProvider.delegate;return(($===null||$===void 0?void 0:$.requestAnimationFrame)||requestAnimationFrame).apply(void 0,AK([],LK(D)))},cancelAnimationFrame:function(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=I1.animationFrameProvider.delegate;return(($===null||$===void 0?void 0:$.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,AK([],LK(D)))},delegate:void 0}});var OK=z((RK)=>{Object.defineProperty(RK,"__esModule",{value:!0});RK.animationFrames=void 0;var xm=v0(),_m=UK(),MK=DY();function fm(D){return D?NK(D):gm}RK.animationFrames=fm;function NK(D){return new xm.Observable(function(F){var $=D||_m.performanceTimestampProvider,J=$.now(),Q=0,Y=function(){if(!F.closed)Q=MK.animationFrameProvider.requestAnimationFrame(function(B){Q=0;var X=$.now();F.next({timestamp:D?X:B,elapsed:X-J}),Y()})};return Y(),function(){if(Q)MK.animationFrameProvider.cancelAnimationFrame(Q)}})}var gm=NK()});var FY=z((wK)=>{Object.defineProperty(wK,"__esModule",{value:!0});wK.ObjectUnsubscribedError=void 0;var hm=F6();wK.ObjectUnsubscribedError=hm.createErrorClass(function(D){return function(){D(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})});var VD=z(($8)=>{var PK=$8&&$8.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}(),bm=$8&&$8.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty($8,"__esModule",{value:!0});$8.AnonymousSubject=$8.Subject=void 0;var TK=v0(),JY=F1(),um=FY(),mm=P8(),$Y=D7(),IK=function(D){PK(F,D);function F(){var $=D.call(this)||this;return $.closed=!1,$.currentObservers=null,$.observers=[],$.isStopped=!1,$.hasError=!1,$.thrownError=null,$}return F.prototype.lift=function($){var J=new QY(this,this);return J.operator=$,J},F.prototype._throwIfClosed=function(){if(this.closed)throw new um.ObjectUnsubscribedError},F.prototype.next=function($){var J=this;$Y.errorContext(function(){var Q,Y;if(J._throwIfClosed(),!J.isStopped){if(!J.currentObservers)J.currentObservers=Array.from(J.observers);try{for(var B=bm(J.currentObservers),X=B.next();!X.done;X=B.next()){var G=X.value;G.next($)}}catch(H){Q={error:H}}finally{try{if(X&&!X.done&&(Y=B.return))Y.call(B)}finally{if(Q)throw Q.error}}}})},F.prototype.error=function($){var J=this;$Y.errorContext(function(){if(J._throwIfClosed(),!J.isStopped){J.hasError=J.isStopped=!0,J.thrownError=$;var Q=J.observers;while(Q.length)Q.shift().error($)}})},F.prototype.complete=function(){var $=this;$Y.errorContext(function(){if($._throwIfClosed(),!$.isStopped){$.isStopped=!0;var J=$.observers;while(J.length)J.shift().complete()}})},F.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(F.prototype,"observed",{get:function(){var $;return(($=this.observers)===null||$===void 0?void 0:$.length)>0},enumerable:!1,configurable:!0}),F.prototype._trySubscribe=function($){return this._throwIfClosed(),D.prototype._trySubscribe.call(this,$)},F.prototype._subscribe=function($){return this._throwIfClosed(),this._checkFinalizedStatuses($),this._innerSubscribe($)},F.prototype._innerSubscribe=function($){var J=this,Q=this,Y=Q.hasError,B=Q.isStopped,X=Q.observers;if(Y||B)return JY.EMPTY_SUBSCRIPTION;return this.currentObservers=null,X.push($),new JY.Subscription(function(){J.currentObservers=null,mm.arrRemove(X,$)})},F.prototype._checkFinalizedStatuses=function($){var J=this,Q=J.hasError,Y=J.thrownError,B=J.isStopped;if(Q)$.error(Y);else if(B)$.complete()},F.prototype.asObservable=function(){var $=new TK.Observable;return $.source=this,$},F.create=function($,J){return new QY($,J)},F}(TK.Observable);$8.Subject=IK;var QY=function(D){PK(F,D);function F($,J){var Q=D.call(this)||this;return Q.destination=$,Q.source=J,Q}return F.prototype.next=function($){var J,Q;(Q=(J=this.destination)===null||J===void 0?void 0:J.next)===null||Q===void 0||Q.call(J,$)},F.prototype.error=function($){var J,Q;(Q=(J=this.destination)===null||J===void 0?void 0:J.error)===null||Q===void 0||Q.call(J,$)},F.prototype.complete=function(){var $,J;(J=($=this.destination)===null||$===void 0?void 0:$.complete)===null||J===void 0||J.call($)},F.prototype._subscribe=function($){var J,Q;return(Q=(J=this.source)===null||J===void 0?void 0:J.subscribe($))!==null&&Q!==void 0?Q:JY.EMPTY_SUBSCRIPTION},F}(IK);$8.AnonymousSubject=QY});var YY=z((t4)=>{var lm=t4&&t4.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(t4,"__esModule",{value:!0});t4.BehaviorSubject=void 0;var pm=VD(),dm=function(D){lm(F,D);function F($){var J=D.call(this)||this;return J._value=$,J}return Object.defineProperty(F.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),F.prototype._subscribe=function($){var J=D.prototype._subscribe.call(this,$);return!J.closed&&$.next(this._value),J},F.prototype.getValue=function(){var $=this,J=$.hasError,Q=$.thrownError,Y=$._value;if(J)throw Q;return this._throwIfClosed(),Y},F.prototype.next=function($){D.prototype.next.call(this,this._value=$)},F}(pm.Subject);t4.BehaviorSubject=dm});var $7=z((SK)=>{Object.defineProperty(SK,"__esModule",{value:!0});SK.dateTimestampProvider=void 0;SK.dateTimestampProvider={now:function(){return(SK.dateTimestampProvider.delegate||Date).now()},delegate:void 0}});var J7=z((e4)=>{var cm=e4&&e4.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(e4,"__esModule",{value:!0});e4.ReplaySubject=void 0;var nm=VD(),im=$7(),am=function(D){cm(F,D);function F($,J,Q){if($===void 0)$=1/0;if(J===void 0)J=1/0;if(Q===void 0)Q=im.dateTimestampProvider;var Y=D.call(this)||this;return Y._bufferSize=$,Y._windowTime=J,Y._timestampProvider=Q,Y._buffer=[],Y._infiniteTimeWindow=!0,Y._infiniteTimeWindow=J===1/0,Y._bufferSize=Math.max(1,$),Y._windowTime=Math.max(1,J),Y}return F.prototype.next=function($){var J=this,Q=J.isStopped,Y=J._buffer,B=J._infiniteTimeWindow,X=J._timestampProvider,G=J._windowTime;if(!Q)Y.push($),!B&&Y.push(X.now()+G);this._trimBuffer(),D.prototype.next.call(this,$)},F.prototype._subscribe=function($){this._throwIfClosed(),this._trimBuffer();var J=this._innerSubscribe($),Q=this,Y=Q._infiniteTimeWindow,B=Q._buffer,X=B.slice();for(var G=0;G<X.length&&!$.closed;G+=Y?1:2)$.next(X[G]);return this._checkFinalizedStatuses($),J},F.prototype._trimBuffer=function(){var $=this,J=$._bufferSize,Q=$._timestampProvider,Y=$._buffer,B=$._infiniteTimeWindow,X=(B?1:2)*J;if(J<1/0&&X<Y.length&&Y.splice(0,Y.length-X),!B){var G=Q.now(),H=0;for(var q=1;q<Y.length&&Y[q]<=G;q+=2)H=q;H&&Y.splice(0,H+1)}},F}(nm.Subject);e4.ReplaySubject=am});var Q7=z((D3)=>{var om=D3&&D3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(D3,"__esModule",{value:!0});D3.AsyncSubject=void 0;var sm=VD(),rm=function(D){om(F,D);function F(){var $=D!==null&&D.apply(this,arguments)||this;return $._value=null,$._hasValue=!1,$._isComplete=!1,$}return F.prototype._checkFinalizedStatuses=function($){var J=this,Q=J.hasError,Y=J._hasValue,B=J._value,X=J.thrownError,G=J.isStopped,H=J._isComplete;if(Q)$.error(X);else if(G||H)Y&&$.next(B),$.complete()},F.prototype.next=function($){if(!this.isStopped)this._value=$,this._hasValue=!0},F.prototype.complete=function(){var $=this,J=$._hasValue,Q=$._value,Y=$._isComplete;if(!Y)this._isComplete=!0,J&&D.prototype.next.call(this,Q),D.prototype.complete.call(this)},F}(sm.Subject);D3.AsyncSubject=rm});var kK=z((F3)=>{var tm=F3&&F3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(F3,"__esModule",{value:!0});F3.Action=void 0;var em=F1(),Dl=function(D){tm(F,D);function F($,J){return D.call(this)||this}return F.prototype.schedule=function($,J){if(J===void 0)J=0;return this},F}(em.Subscription);F3.Action=Dl});var xK=z((J8)=>{var vK=J8&&J8.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},yK=J8&&J8.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(J8,"__esModule",{value:!0});J8.intervalProvider=void 0;J8.intervalProvider={setInterval:function(D,F){var $=[];for(var J=2;J<arguments.length;J++)$[J-2]=arguments[J];var Q=J8.intervalProvider.delegate;if(Q===null||Q===void 0?void 0:Q.setInterval)return Q.setInterval.apply(Q,yK([D,F],vK($)));return setInterval.apply(void 0,yK([D,F],vK($)))},clearInterval:function(D){var F=J8.intervalProvider.delegate;return((F===null||F===void 0?void 0:F.clearInterval)||clearInterval)(D)},delegate:void 0}});var J3=z(($3)=>{var Fl=$3&&$3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty($3,"__esModule",{value:!0});$3.AsyncAction=void 0;var $l=kK(),_K=xK(),Jl=P8(),Ql=function(D){Fl(F,D);function F($,J){var Q=D.call(this,$,J)||this;return Q.scheduler=$,Q.work=J,Q.pending=!1,Q}return F.prototype.schedule=function($,J){var Q;if(J===void 0)J=0;if(this.closed)return this;this.state=$;var Y=this.id,B=this.scheduler;if(Y!=null)this.id=this.recycleAsyncId(B,Y,J);return this.pending=!0,this.delay=J,this.id=(Q=this.id)!==null&&Q!==void 0?Q:this.requestAsyncId(B,this.id,J),this},F.prototype.requestAsyncId=function($,J,Q){if(Q===void 0)Q=0;return _K.intervalProvider.setInterval($.flush.bind($,this),Q)},F.prototype.recycleAsyncId=function($,J,Q){if(Q===void 0)Q=0;if(Q!=null&&this.delay===Q&&this.pending===!1)return J;if(J!=null)_K.intervalProvider.clearInterval(J);return},F.prototype.execute=function($,J){if(this.closed)return Error("executing a cancelled action");this.pending=!1;var Q=this._execute($,J);if(Q)return Q;else if(this.pending===!1&&this.id!=null)this.id=this.recycleAsyncId(this.scheduler,this.id,null)},F.prototype._execute=function($,J){var Q=!1,Y;try{this.work($)}catch(B){Q=!0,Y=B?B:Error("Scheduled action threw falsy error")}if(Q)return this.unsubscribe(),Y},F.prototype.unsubscribe=function(){if(!this.closed){var $=this,J=$.id,Q=$.scheduler,Y=Q.actions;if(this.work=this.state=this.scheduler=null,this.pending=!1,Jl.arrRemove(Y,this),J!=null)this.id=this.recycleAsyncId(Q,J,null);this.delay=null,D.prototype.unsubscribe.call(this)}},F}($l.Action);$3.AsyncAction=Ql});var bK=z((gK)=>{Object.defineProperty(gK,"__esModule",{value:!0});gK.TestTools=gK.Immediate=void 0;var Yl=1,XY,Y7={};function fK(D){if(D in Y7)return delete Y7[D],!0;return!1}gK.Immediate={setImmediate:function(D){var F=Yl++;if(Y7[F]=!0,!XY)XY=Promise.resolve();return XY.then(function(){return fK(F)&&D()}),F},clearImmediate:function(D){fK(D)}};gK.TestTools={pending:function(){return Object.keys(Y7).length}}});var mK=z((Q8)=>{var Xl=Q8&&Q8.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},Gl=Q8&&Q8.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(Q8,"__esModule",{value:!0});Q8.immediateProvider=void 0;var uK=bK(),Wl=uK.Immediate.setImmediate,Hl=uK.Immediate.clearImmediate;Q8.immediateProvider={setImmediate:function(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=Q8.immediateProvider.delegate;return(($===null||$===void 0?void 0:$.setImmediate)||Wl).apply(void 0,Gl([],Xl(D)))},clearImmediate:function(D){var F=Q8.immediateProvider.delegate;return((F===null||F===void 0?void 0:F.clearImmediate)||Hl)(D)},delegate:void 0}});var pK=z((Q3)=>{var ql=Q3&&Q3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(Q3,"__esModule",{value:!0});Q3.AsapAction=void 0;var Kl=J3(),lK=mK(),zl=function(D){ql(F,D);function F($,J){var Q=D.call(this,$,J)||this;return Q.scheduler=$,Q.work=J,Q}return F.prototype.requestAsyncId=function($,J,Q){if(Q===void 0)Q=0;if(Q!==null&&Q>0)return D.prototype.requestAsyncId.call(this,$,J,Q);return $.actions.push(this),$._scheduled||($._scheduled=lK.immediateProvider.setImmediate($.flush.bind($,void 0)))},F.prototype.recycleAsyncId=function($,J,Q){var Y;if(Q===void 0)Q=0;if(Q!=null?Q>0:this.delay>0)return D.prototype.recycleAsyncId.call(this,$,J,Q);var B=$.actions;if(J!=null&&((Y=B[B.length-1])===null||Y===void 0?void 0:Y.id)!==J){if(lK.immediateProvider.clearImmediate(J),$._scheduled===J)$._scheduled=void 0}return},F}(Kl.AsyncAction);Q3.AsapAction=zl});var GY=z((dK)=>{Object.defineProperty(dK,"__esModule",{value:!0});dK.Scheduler=void 0;var El=$7(),Vl=function(){function D(F,$){if($===void 0)$=D.now;this.schedulerActionCtor=F,this.now=$}return D.prototype.schedule=function(F,$,J){if($===void 0)$=0;return new this.schedulerActionCtor(this,F).schedule(J,$)},D.now=El.dateTimestampProvider.now,D}();dK.Scheduler=Vl});var B3=z((Y3)=>{var Zl=Y3&&Y3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(Y3,"__esModule",{value:!0});Y3.AsyncScheduler=void 0;var nK=GY(),Ul=function(D){Zl(F,D);function F($,J){if(J===void 0)J=nK.Scheduler.now;var Q=D.call(this,$,J)||this;return Q.actions=[],Q._active=!1,Q}return F.prototype.flush=function($){var J=this.actions;if(this._active){J.push($);return}var Q;this._active=!0;do if(Q=$.execute($.state,$.delay))break;while($=J.shift());if(this._active=!1,Q){while($=J.shift())$.unsubscribe();throw Q}},F}(nK.Scheduler);Y3.AsyncScheduler=Ul});var iK=z((X3)=>{var Ll=X3&&X3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(X3,"__esModule",{value:!0});X3.AsapScheduler=void 0;var Al=B3(),Ml=function(D){Ll(F,D);function F(){return D!==null&&D.apply(this,arguments)||this}return F.prototype.flush=function($){this._active=!0;var J=this._scheduled;this._scheduled=void 0;var Q=this.actions,Y;$=$||Q.shift();do if(Y=$.execute($.state,$.delay))break;while(($=Q[0])&&$.id===J&&Q.shift());if(this._active=!1,Y){while(($=Q[0])&&$.id===J&&Q.shift())$.unsubscribe();throw Y}},F}(Al.AsyncScheduler);X3.AsapScheduler=Ml});var rK=z((aK)=>{Object.defineProperty(aK,"__esModule",{value:!0});aK.asap=aK.asapScheduler=void 0;var Nl=pK(),Rl=iK();aK.asapScheduler=new Rl.AsapScheduler(Nl.AsapAction);aK.asap=aK.asapScheduler});var dD=z((tK)=>{Object.defineProperty(tK,"__esModule",{value:!0});tK.async=tK.asyncScheduler=void 0;var Cl=J3(),Ol=B3();tK.asyncScheduler=new Ol.AsyncScheduler(Cl.AsyncAction);tK.async=tK.asyncScheduler});var Fz=z((G3)=>{var wl=G3&&G3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(G3,"__esModule",{value:!0});G3.QueueAction=void 0;var jl=J3(),Tl=function(D){wl(F,D);function F($,J){var Q=D.call(this,$,J)||this;return Q.scheduler=$,Q.work=J,Q}return F.prototype.schedule=function($,J){if(J===void 0)J=0;if(J>0)return D.prototype.schedule.call(this,$,J);return this.delay=J,this.state=$,this.scheduler.flush(this),this},F.prototype.execute=function($,J){return J>0||this.closed?D.prototype.execute.call(this,$,J):this._execute($,J)},F.prototype.requestAsyncId=function($,J,Q){if(Q===void 0)Q=0;if(Q!=null&&Q>0||Q==null&&this.delay>0)return D.prototype.requestAsyncId.call(this,$,J,Q);return $.flush(this),0},F}(jl.AsyncAction);G3.QueueAction=Tl});var $z=z((W3)=>{var Pl=W3&&W3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(W3,"__esModule",{value:!0});W3.QueueScheduler=void 0;var Il=B3(),Sl=function(D){Pl(F,D);function F(){return D!==null&&D.apply(this,arguments)||this}return F}(Il.AsyncScheduler);W3.QueueScheduler=Sl});var Bz=z((Jz)=>{Object.defineProperty(Jz,"__esModule",{value:!0});Jz.queue=Jz.queueScheduler=void 0;var kl=Fz(),vl=$z();Jz.queueScheduler=new vl.QueueScheduler(kl.QueueAction);Jz.queue=Jz.queueScheduler});var Gz=z((H3)=>{var yl=H3&&H3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(H3,"__esModule",{value:!0});H3.AnimationFrameAction=void 0;var xl=J3(),Xz=DY(),_l=function(D){yl(F,D);function F($,J){var Q=D.call(this,$,J)||this;return Q.scheduler=$,Q.work=J,Q}return F.prototype.requestAsyncId=function($,J,Q){if(Q===void 0)Q=0;if(Q!==null&&Q>0)return D.prototype.requestAsyncId.call(this,$,J,Q);return $.actions.push(this),$._scheduled||($._scheduled=Xz.animationFrameProvider.requestAnimationFrame(function(){return $.flush(void 0)}))},F.prototype.recycleAsyncId=function($,J,Q){var Y;if(Q===void 0)Q=0;if(Q!=null?Q>0:this.delay>0)return D.prototype.recycleAsyncId.call(this,$,J,Q);var B=$.actions;if(J!=null&&J===$._scheduled&&((Y=B[B.length-1])===null||Y===void 0?void 0:Y.id)!==J)Xz.animationFrameProvider.cancelAnimationFrame(J),$._scheduled=void 0;return},F}(xl.AsyncAction);H3.AnimationFrameAction=_l});var Wz=z((q3)=>{var fl=q3&&q3.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(q3,"__esModule",{value:!0});q3.AnimationFrameScheduler=void 0;var gl=B3(),hl=function(D){fl(F,D);function F(){return D!==null&&D.apply(this,arguments)||this}return F.prototype.flush=function($){this._active=!0;var J;if($)J=$.id;else J=this._scheduled,this._scheduled=void 0;var Q=this.actions,Y;$=$||Q.shift();do if(Y=$.execute($.state,$.delay))break;while(($=Q[0])&&$.id===J&&Q.shift());if(this._active=!1,Y){while(($=Q[0])&&$.id===J&&Q.shift())$.unsubscribe();throw Y}},F}(gl.AsyncScheduler);q3.AnimationFrameScheduler=hl});var zz=z((Hz)=>{Object.defineProperty(Hz,"__esModule",{value:!0});Hz.animationFrame=Hz.animationFrameScheduler=void 0;var bl=Gz(),ul=Wz();Hz.animationFrameScheduler=new ul.AnimationFrameScheduler(bl.AnimationFrameAction);Hz.animationFrame=Hz.animationFrameScheduler});var Zz=z((J6)=>{var Ez=J6&&J6.__extends||function(){var D=function(F,$){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,Q){J.__proto__=Q}||function(J,Q){for(var Y in Q)if(Object.prototype.hasOwnProperty.call(Q,Y))J[Y]=Q[Y]},D(F,$)};return function(F,$){if(typeof $!=="function"&&$!==null)throw TypeError("Class extends value "+String($)+" is not a constructor or null");D(F,$);function J(){this.constructor=F}F.prototype=$===null?Object.create($):(J.prototype=$.prototype,new J)}}();Object.defineProperty(J6,"__esModule",{value:!0});J6.VirtualAction=J6.VirtualTimeScheduler=void 0;var ml=J3(),ll=F1(),pl=B3(),dl=function(D){Ez(F,D);function F($,J){if($===void 0)$=Vz;if(J===void 0)J=1/0;var Q=D.call(this,$,function(){return Q.frame})||this;return Q.maxFrames=J,Q.frame=0,Q.index=-1,Q}return F.prototype.flush=function(){var $=this,J=$.actions,Q=$.maxFrames,Y,B;while((B=J[0])&&B.delay<=Q)if(J.shift(),this.frame=B.delay,Y=B.execute(B.state,B.delay))break;if(Y){while(B=J.shift())B.unsubscribe();throw Y}},F.frameTimeFactor=10,F}(pl.AsyncScheduler);J6.VirtualTimeScheduler=dl;var Vz=function(D){Ez(F,D);function F($,J,Q){if(Q===void 0)Q=$.index+=1;var Y=D.call(this,$,J)||this;return Y.scheduler=$,Y.work=J,Y.index=Q,Y.active=!0,Y.index=$.index=Q,Y}return F.prototype.schedule=function($,J){if(J===void 0)J=0;if(Number.isFinite(J)){if(!this.id)return D.prototype.schedule.call(this,$,J);this.active=!1;var Q=new F(this.scheduler,this.work);return this.add(Q),Q.schedule($,J)}else return ll.Subscription.EMPTY},F.prototype.requestAsyncId=function($,J,Q){if(Q===void 0)Q=0;this.delay=$.frame+Q;var Y=$.actions;return Y.push(this),Y.sort(F.sortActions),1},F.prototype.recycleAsyncId=function($,J,Q){if(Q===void 0)Q=0;return},F.prototype._execute=function($,J){if(this.active===!0)return D.prototype._execute.call(this,$,J)},F.sortActions=function($,J){if($.delay===J.delay)if($.index===J.index)return 0;else if($.index>J.index)return 1;else return-1;else if($.delay>J.delay)return 1;else return-1},F}(ml.AsyncAction);J6.VirtualAction=Vz});var S1=z((Lz)=>{Object.defineProperty(Lz,"__esModule",{value:!0});Lz.empty=Lz.EMPTY=void 0;var Uz=v0();Lz.EMPTY=new Uz.Observable(function(D){return D.complete()});function cl(D){return D?nl(D):Lz.EMPTY}Lz.empty=cl;function nl(D){return new Uz.Observable(function(F){return D.schedule(function(){return F.complete()})})}});var nF=z((Nz)=>{Object.defineProperty(Nz,"__esModule",{value:!0});Nz.isScheduler=void 0;var il=S0();function al(D){return D&&il.isFunction(D.schedule)}Nz.isScheduler=al});var cD=z((Cz)=>{Object.defineProperty(Cz,"__esModule",{value:!0});Cz.popNumber=Cz.popScheduler=Cz.popResultSelector=void 0;var ol=S0(),sl=nF();function WY(D){return D[D.length-1]}function rl(D){return ol.isFunction(WY(D))?D.pop():void 0}Cz.popResultSelector=rl;function tl(D){return sl.isScheduler(WY(D))?D.pop():void 0}Cz.popScheduler=tl;function el(D,F){return typeof WY(D)==="number"?D.pop():F}Cz.popNumber=el});var B7=z((wz)=>{Object.defineProperty(wz,"__esModule",{value:!0});wz.isArrayLike=void 0;wz.isArrayLike=function(D){return D&&typeof D.length==="number"&&typeof D!=="function"}});var HY=z((Tz)=>{Object.defineProperty(Tz,"__esModule",{value:!0});Tz.isPromise=void 0;var $p=S0();function Jp(D){return $p.isFunction(D===null||D===void 0?void 0:D.then)}Tz.isPromise=Jp});var qY=z((Iz)=>{Object.defineProperty(Iz,"__esModule",{value:!0});Iz.isInteropObservable=void 0;var Qp=pF(),Yp=S0();function Bp(D){return Yp.isFunction(D[Qp.observable])}Iz.isInteropObservable=Bp});var KY=z((kz)=>{Object.defineProperty(kz,"__esModule",{value:!0});kz.isAsyncIterable=void 0;var Xp=S0();function Gp(D){return Symbol.asyncIterator&&Xp.isFunction(D===null||D===void 0?void 0:D[Symbol.asyncIterator])}kz.isAsyncIterable=Gp});var zY=z((yz)=>{Object.defineProperty(yz,"__esModule",{value:!0});yz.createInvalidObservableTypeError=void 0;function Wp(D){return TypeError("You provided "+(D!==null&&typeof D==="object"?"an invalid object":"'"+D+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}yz.createInvalidObservableTypeError=Wp});var EY=z((fz)=>{Object.defineProperty(fz,"__esModule",{value:!0});fz.iterator=fz.getSymbolIterator=void 0;function _z(){if(typeof Symbol!=="function"||!Symbol.iterator)return"@@iterator";return Symbol.iterator}fz.getSymbolIterator=_z;fz.iterator=_z()});var VY=z((hz)=>{Object.defineProperty(hz,"__esModule",{value:!0});hz.isIterable=void 0;var qp=EY(),Kp=S0();function zp(D){return Kp.isFunction(D===null||D===void 0?void 0:D[qp.iterator])}hz.isIterable=zp});var X7=z((K1)=>{var Ep=K1&&K1.__generator||function(D,F){var $={label:0,sent:function(){if(Y[0]&1)throw Y[1];return Y[1]},trys:[],ops:[]},J,Q,Y,B;return B={next:X(0),throw:X(1),return:X(2)},typeof Symbol==="function"&&(B[Symbol.iterator]=function(){return this}),B;function X(H){return function(q){return G([H,q])}}function G(H){if(J)throw TypeError("Generator is already executing.");while($)try{if(J=1,Q&&(Y=H[0]&2?Q.return:H[0]?Q.throw||((Y=Q.return)&&Y.call(Q),0):Q.next)&&!(Y=Y.call(Q,H[1])).done)return Y;if(Q=0,Y)H=[H[0]&2,Y.value];switch(H[0]){case 0:case 1:Y=H;break;case 4:return $.label++,{value:H[1],done:!1};case 5:$.label++,Q=H[1],H=[0];continue;case 7:H=$.ops.pop(),$.trys.pop();continue;default:if((Y=$.trys,!(Y=Y.length>0&&Y[Y.length-1]))&&(H[0]===6||H[0]===2)){$=0;continue}if(H[0]===3&&(!Y||H[1]>Y[0]&&H[1]<Y[3])){$.label=H[1];break}if(H[0]===6&&$.label<Y[1]){$.label=Y[1],Y=H;break}if(Y&&$.label<Y[2]){$.label=Y[2],$.ops.push(H);break}if(Y[2])$.ops.pop();$.trys.pop();continue}H=F.call(D,$)}catch(q){H=[6,q],Q=0}finally{J=Y=0}if(H[0]&5)throw H[1];return{value:H[0]?H[1]:void 0,done:!0}}},K3=K1&&K1.__await||function(D){return this instanceof K3?(this.v=D,this):new K3(D)},Vp=K1&&K1.__asyncGenerator||function(D,F,$){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var J=$.apply(D,F||[]),Q,Y=[];return Q={},B("next"),B("throw"),B("return"),Q[Symbol.asyncIterator]=function(){return this},Q;function B(V){if(J[V])Q[V]=function(E){return new Promise(function(Z,L){Y.push([V,E,Z,L])>1||X(V,E)})}}function X(V,E){try{G(J[V](E))}catch(Z){K(Y[0][3],Z)}}function G(V){V.value instanceof K3?Promise.resolve(V.value.v).then(H,q):K(Y[0][2],V)}function H(V){X("next",V)}function q(V){X("throw",V)}function K(V,E){if(V(E),Y.shift(),Y.length)X(Y[0][0],Y[0][1])}};Object.defineProperty(K1,"__esModule",{value:!0});K1.isReadableStreamLike=K1.readableStreamLikeToAsyncGenerator=void 0;var Zp=S0();function Up(D){return Vp(this,arguments,function(){var $,J,Q,Y;return Ep(this,function(B){switch(B.label){case 0:$=D.getReader(),B.label=1;case 1:B.trys.push([1,,9,10]),B.label=2;case 2:return[4,K3($.read())];case 3:if(J=B.sent(),Q=J.value,Y=J.done,!Y)return[3,5];return[4,K3(void 0)];case 4:return[2,B.sent()];case 5:return[4,K3(Q)];case 6:return[4,B.sent()];case 7:return B.sent(),[3,2];case 8:return[3,10];case 9:return $.releaseLock(),[7];case 10:return[2]}})})}K1.readableStreamLikeToAsyncGenerator=Up;function Lp(D){return Zp.isFunction(D===null||D===void 0?void 0:D.getReader)}K1.isReadableStreamLike=Lp});var Y0=z((d0)=>{var Ap=d0&&d0.__awaiter||function(D,F,$,J){function Q(Y){return Y instanceof $?Y:new $(function(B){B(Y)})}return new($||($=Promise))(function(Y,B){function X(q){try{H(J.next(q))}catch(K){B(K)}}function G(q){try{H(J.throw(q))}catch(K){B(K)}}function H(q){q.done?Y(q.value):Q(q.value).then(X,G)}H((J=J.apply(D,F||[])).next())})},Mp=d0&&d0.__generator||function(D,F){var $={label:0,sent:function(){if(Y[0]&1)throw Y[1];return Y[1]},trys:[],ops:[]},J,Q,Y,B;return B={next:X(0),throw:X(1),return:X(2)},typeof Symbol==="function"&&(B[Symbol.iterator]=function(){return this}),B;function X(H){return function(q){return G([H,q])}}function G(H){if(J)throw TypeError("Generator is already executing.");while($)try{if(J=1,Q&&(Y=H[0]&2?Q.return:H[0]?Q.throw||((Y=Q.return)&&Y.call(Q),0):Q.next)&&!(Y=Y.call(Q,H[1])).done)return Y;if(Q=0,Y)H=[H[0]&2,Y.value];switch(H[0]){case 0:case 1:Y=H;break;case 4:return $.label++,{value:H[1],done:!1};case 5:$.label++,Q=H[1],H=[0];continue;case 7:H=$.ops.pop(),$.trys.pop();continue;default:if((Y=$.trys,!(Y=Y.length>0&&Y[Y.length-1]))&&(H[0]===6||H[0]===2)){$=0;continue}if(H[0]===3&&(!Y||H[1]>Y[0]&&H[1]<Y[3])){$.label=H[1];break}if(H[0]===6&&$.label<Y[1]){$.label=Y[1],Y=H;break}if(Y&&$.label<Y[2]){$.label=Y[2],$.ops.push(H);break}if(Y[2])$.ops.pop();$.trys.pop();continue}H=F.call(D,$)}catch(q){H=[6,q],Q=0}finally{J=Y=0}if(H[0]&5)throw H[1];return{value:H[0]?H[1]:void 0,done:!0}}},Np=d0&&d0.__asyncValues||function(D){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var F=D[Symbol.asyncIterator],$;return F?F.call(D):(D=typeof ZY==="function"?ZY(D):D[Symbol.iterator](),$={},J("next"),J("throw"),J("return"),$[Symbol.asyncIterator]=function(){return this},$);function J(Y){$[Y]=D[Y]&&function(B){return new Promise(function(X,G){B=D[Y](B),Q(X,G,B.done,B.value)})}}function Q(Y,B,X,G){Promise.resolve(G).then(function(H){Y({value:H,done:X})},B)}},ZY=d0&&d0.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(d0,"__esModule",{value:!0});d0.fromReadableStreamLike=d0.fromAsyncIterable=d0.fromIterable=d0.fromPromise=d0.fromArrayLike=d0.fromInteropObservable=d0.innerFrom=void 0;var Rp=B7(),Cp=HY(),z3=v0(),Op=qY(),wp=KY(),jp=zY(),Tp=VY(),uz=X7(),Pp=S0(),Ip=cQ(),Sp=pF();function kp(D){if(D instanceof z3.Observable)return D;if(D!=null){if(Op.isInteropObservable(D))return mz(D);if(Rp.isArrayLike(D))return lz(D);if(Cp.isPromise(D))return pz(D);if(wp.isAsyncIterable(D))return UY(D);if(Tp.isIterable(D))return dz(D);if(uz.isReadableStreamLike(D))return cz(D)}throw jp.createInvalidObservableTypeError(D)}d0.innerFrom=kp;function mz(D){return new z3.Observable(function(F){var $=D[Sp.observable]();if(Pp.isFunction($.subscribe))return $.subscribe(F);throw TypeError("Provided object does not correctly implement Symbol.observable")})}d0.fromInteropObservable=mz;function lz(D){return new z3.Observable(function(F){for(var $=0;$<D.length&&!F.closed;$++)F.next(D[$]);F.complete()})}d0.fromArrayLike=lz;function pz(D){return new z3.Observable(function(F){D.then(function($){if(!F.closed)F.next($),F.complete()},function($){return F.error($)}).then(null,Ip.reportUnhandledError)})}d0.fromPromise=pz;function dz(D){return new z3.Observable(function(F){var $,J;try{for(var Q=ZY(D),Y=Q.next();!Y.done;Y=Q.next()){var B=Y.value;if(F.next(B),F.closed)return}}catch(X){$={error:X}}finally{try{if(Y&&!Y.done&&(J=Q.return))J.call(Q)}finally{if($)throw $.error}}F.complete()})}d0.fromIterable=dz;function UY(D){return new z3.Observable(function(F){vp(D,F).catch(function($){return F.error($)})})}d0.fromAsyncIterable=UY;function cz(D){return UY(uz.readableStreamLikeToAsyncGenerator(D))}d0.fromReadableStreamLike=cz;function vp(D,F){var $,J,Q,Y;return Ap(this,void 0,void 0,function(){var B,X;return Mp(this,function(G){switch(G.label){case 0:G.trys.push([0,5,6,11]),$=Np(D),G.label=1;case 1:return[4,$.next()];case 2:if(J=G.sent(),!!J.done)return[3,4];if(B=J.value,F.next(B),F.closed)return[2];G.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return X=G.sent(),Q={error:X},[3,11];case 6:if(G.trys.push([6,,9,10]),!(J&&!J.done&&(Y=$.return)))return[3,8];return[4,Y.call($)];case 7:G.sent(),G.label=8;case 8:return[3,10];case 9:if(Q)throw Q.error;return[7];case 10:return[7];case 11:return F.complete(),[2]}})})}});var I8=z((nz)=>{Object.defineProperty(nz,"__esModule",{value:!0});nz.executeSchedule=void 0;function yp(D,F,$,J,Q){if(J===void 0)J=0;if(Q===void 0)Q=!1;var Y=F.schedule(function(){if($(),Q)D.add(this.schedule(null,J));else this.unsubscribe()},J);if(D.add(Y),!Q)return Y}nz.executeSchedule=yp});var iF=z((az)=>{Object.defineProperty(az,"__esModule",{value:!0});az.observeOn=void 0;var LY=I8(),xp=x(),_p=p();function fp(D,F){if(F===void 0)F=0;return xp.operate(function($,J){$.subscribe(_p.createOperatorSubscriber(J,function(Q){return LY.executeSchedule(J,D,function(){return J.next(Q)},F)},function(){return LY.executeSchedule(J,D,function(){return J.complete()},F)},function(Q){return LY.executeSchedule(J,D,function(){return J.error(Q)},F)}))})}az.observeOn=fp});var aF=z((sz)=>{Object.defineProperty(sz,"__esModule",{value:!0});sz.subscribeOn=void 0;var gp=x();function hp(D,F){if(F===void 0)F=0;return gp.operate(function($,J){J.add(D.schedule(function(){return $.subscribe(J)},F))})}sz.subscribeOn=hp});var DE=z((tz)=>{Object.defineProperty(tz,"__esModule",{value:!0});tz.scheduleObservable=void 0;var bp=Y0(),up=iF(),mp=aF();function lp(D,F){return bp.innerFrom(D).pipe(mp.subscribeOn(F),up.observeOn(F))}tz.scheduleObservable=lp});var JE=z((FE)=>{Object.defineProperty(FE,"__esModule",{value:!0});FE.schedulePromise=void 0;var pp=Y0(),dp=iF(),cp=aF();function np(D,F){return pp.innerFrom(D).pipe(cp.subscribeOn(F),dp.observeOn(F))}FE.schedulePromise=np});var BE=z((QE)=>{Object.defineProperty(QE,"__esModule",{value:!0});QE.scheduleArray=void 0;var ip=v0();function ap(D,F){return new ip.Observable(function($){var J=0;return F.schedule(function(){if(J===D.length)$.complete();else if($.next(D[J++]),!$.closed)this.schedule()})})}QE.scheduleArray=ap});var AY=z((GE)=>{Object.defineProperty(GE,"__esModule",{value:!0});GE.scheduleIterable=void 0;var op=v0(),sp=EY(),rp=S0(),XE=I8();function tp(D,F){return new op.Observable(function($){var J;return XE.executeSchedule($,F,function(){J=D[sp.iterator](),XE.executeSchedule($,F,function(){var Q,Y,B;try{Q=J.next(),Y=Q.value,B=Q.done}catch(X){$.error(X);return}if(B)$.complete();else $.next(Y)},0,!0)}),function(){return rp.isFunction(J===null||J===void 0?void 0:J.return)&&J.return()}})}GE.scheduleIterable=tp});var MY=z((qE)=>{Object.defineProperty(qE,"__esModule",{value:!0});qE.scheduleAsyncIterable=void 0;var ep=v0(),HE=I8();function Dd(D,F){if(!D)throw Error("Iterable cannot be null");return new ep.Observable(function($){HE.executeSchedule($,F,function(){var J=D[Symbol.asyncIterator]();HE.executeSchedule($,F,function(){J.next().then(function(Q){if(Q.done)$.complete();else $.next(Q.value)})},0,!0)})})}qE.scheduleAsyncIterable=Dd});var VE=z((zE)=>{Object.defineProperty(zE,"__esModule",{value:!0});zE.scheduleReadableStreamLike=void 0;var Fd=MY(),$d=X7();function Jd(D,F){return Fd.scheduleAsyncIterable($d.readableStreamLikeToAsyncGenerator(D),F)}zE.scheduleReadableStreamLike=Jd});var NY=z((ZE)=>{Object.defineProperty(ZE,"__esModule",{value:!0});ZE.scheduled=void 0;var Qd=DE(),Yd=JE(),Bd=BE(),Xd=AY(),Gd=MY(),Wd=qY(),Hd=HY(),qd=B7(),Kd=VY(),zd=KY(),Ed=zY(),Vd=X7(),Zd=VE();function Ud(D,F){if(D!=null){if(Wd.isInteropObservable(D))return Qd.scheduleObservable(D,F);if(qd.isArrayLike(D))return Bd.scheduleArray(D,F);if(Hd.isPromise(D))return Yd.schedulePromise(D,F);if(zd.isAsyncIterable(D))return Gd.scheduleAsyncIterable(D,F);if(Kd.isIterable(D))return Xd.scheduleIterable(D,F);if(Vd.isReadableStreamLike(D))return Zd.scheduleReadableStreamLike(D,F)}throw Ed.createInvalidObservableTypeError(D)}ZE.scheduled=Ud});var S8=z((LE)=>{Object.defineProperty(LE,"__esModule",{value:!0});LE.from=void 0;var Ld=NY(),Ad=Y0();function Md(D,F){return F?Ld.scheduled(D,F):Ad.innerFrom(D)}LE.from=Md});var G7=z((ME)=>{Object.defineProperty(ME,"__esModule",{value:!0});ME.of=void 0;var Nd=cD(),Rd=S8();function Cd(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=Nd.popScheduler(D);return Rd.from(D,$)}ME.of=Cd});var RY=z((RE)=>{Object.defineProperty(RE,"__esModule",{value:!0});RE.throwError=void 0;var Od=v0(),wd=S0();function jd(D,F){var $=wd.isFunction(D)?D:function(){return D},J=function(Q){return Q.error($())};return new Od.Observable(F?function(Q){return F.schedule(J,0,Q)}:J)}RE.throwError=jd});var W7=z((jE)=>{Object.defineProperty(jE,"__esModule",{value:!0});jE.observeNotification=jE.Notification=jE.NotificationKind=void 0;var Td=S1(),Pd=G7(),Id=RY(),Sd=S0(),kd;(function(D){D.NEXT="N",D.ERROR="E",D.COMPLETE="C"})(kd=jE.NotificationKind||(jE.NotificationKind={}));var vd=function(){function D(F,$,J){this.kind=F,this.value=$,this.error=J,this.hasValue=F==="N"}return D.prototype.observe=function(F){return wE(this,F)},D.prototype.do=function(F,$,J){var Q=this,Y=Q.kind,B=Q.value,X=Q.error;return Y==="N"?F===null||F===void 0?void 0:F(B):Y==="E"?$===null||$===void 0?void 0:$(X):J===null||J===void 0?void 0:J()},D.prototype.accept=function(F,$,J){var Q;return Sd.isFunction((Q=F)===null||Q===void 0?void 0:Q.next)?this.observe(F):this.do(F,$,J)},D.prototype.toObservable=function(){var F=this,$=F.kind,J=F.value,Q=F.error,Y=$==="N"?Pd.of(J):$==="E"?Id.throwError(function(){return Q}):$==="C"?Td.EMPTY:0;if(!Y)throw TypeError("Unexpected notification kind "+$);return Y},D.createNext=function(F){return new D("N",F)},D.createError=function(F){return new D("E",void 0,F)},D.createComplete=function(){return D.completeNotification},D.completeNotification=new D("C"),D}();jE.Notification=vd;function wE(D,F){var $,J,Q,Y=D,B=Y.kind,X=Y.value,G=Y.error;if(typeof B!=="string")throw TypeError('Invalid notification, missing "kind"');B==="N"?($=F.next)===null||$===void 0||$.call(F,X):B==="E"?(J=F.error)===null||J===void 0||J.call(F,G):(Q=F.complete)===null||Q===void 0||Q.call(F)}jE.observeNotification=wE});var kE=z((IE)=>{Object.defineProperty(IE,"__esModule",{value:!0});IE.isObservable=void 0;var xd=v0(),PE=S0();function _d(D){return!!D&&(D instanceof xd.Observable||PE.isFunction(D.lift)&&PE.isFunction(D.subscribe))}IE.isObservable=_d});var Q6=z((vE)=>{Object.defineProperty(vE,"__esModule",{value:!0});vE.EmptyError=void 0;var fd=F6();vE.EmptyError=fd.createErrorClass(function(D){return function(){D(this),this.name="EmptyError",this.message="no elements in sequence"}})});var fE=z((xE)=>{Object.defineProperty(xE,"__esModule",{value:!0});xE.lastValueFrom=void 0;var gd=Q6();function hd(D,F){var $=typeof F==="object";return new Promise(function(J,Q){var Y=!1,B;D.subscribe({next:function(X){B=X,Y=!0},error:Q,complete:function(){if(Y)J(B);else if($)J(F.defaultValue);else Q(new gd.EmptyError)}})})}xE.lastValueFrom=hd});var bE=z((gE)=>{Object.defineProperty(gE,"__esModule",{value:!0});gE.firstValueFrom=void 0;var bd=Q6(),ud=s4();function md(D,F){var $=typeof F==="object";return new Promise(function(J,Q){var Y=new ud.SafeSubscriber({next:function(B){J(B),Y.unsubscribe()},error:Q,complete:function(){if($)J(F.defaultValue);else Q(new bd.EmptyError)}});D.subscribe(Y)})}gE.firstValueFrom=md});var CY=z((uE)=>{Object.defineProperty(uE,"__esModule",{value:!0});uE.ArgumentOutOfRangeError=void 0;var ld=F6();uE.ArgumentOutOfRangeError=ld.createErrorClass(function(D){return function(){D(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})});var OY=z((lE)=>{Object.defineProperty(lE,"__esModule",{value:!0});lE.NotFoundError=void 0;var pd=F6();lE.NotFoundError=pd.createErrorClass(function(D){return function($){D(this),this.name="NotFoundError",this.message=$}})});var wY=z((dE)=>{Object.defineProperty(dE,"__esModule",{value:!0});dE.SequenceError=void 0;var dd=F6();dE.SequenceError=dd.createErrorClass(function(D){return function($){D(this),this.name="SequenceError",this.message=$}})});var H7=z((nE)=>{Object.defineProperty(nE,"__esModule",{value:!0});nE.isValidDate=void 0;function cd(D){return D instanceof Date&&!isNaN(D)}nE.isValidDate=cd});var q7=z((aE)=>{Object.defineProperty(aE,"__esModule",{value:!0});aE.timeout=aE.TimeoutError=void 0;var nd=dD(),id=H7(),ad=x(),od=Y0(),sd=F6(),rd=p(),td=I8();aE.TimeoutError=sd.createErrorClass(function(D){return function($){if($===void 0)$=null;D(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=$}});function ed(D,F){var $=id.isValidDate(D)?{first:D}:typeof D==="number"?{each:D}:D,J=$.first,Q=$.each,Y=$.with,B=Y===void 0?Dc:Y,X=$.scheduler,G=X===void 0?F!==null&&F!==void 0?F:nd.asyncScheduler:X,H=$.meta,q=H===void 0?null:H;if(J==null&&Q==null)throw TypeError("No timeout provided.");return ad.operate(function(K,V){var E,Z,L=null,M=0,A=function(N){Z=td.executeSchedule(V,G,function(){try{E.unsubscribe(),od.innerFrom(B({meta:q,lastValue:L,seen:M})).subscribe(V)}catch(w){V.error(w)}},N)};E=K.subscribe(rd.createOperatorSubscriber(V,function(N){Z===null||Z===void 0||Z.unsubscribe(),M++,V.next(L=N),Q>0&&A(Q)},void 0,void 0,function(){if(!(Z===null||Z===void 0?void 0:Z.closed))Z===null||Z===void 0||Z.unsubscribe();L=null})),!M&&A(J!=null?typeof J==="number"?J:+J-G.now():Q)})}aE.timeout=ed;function Dc(D){throw new aE.TimeoutError(D)}});var Y6=z((rE)=>{Object.defineProperty(rE,"__esModule",{value:!0});rE.map=void 0;var Fc=x(),$c=p();function Jc(D,F){return Fc.operate(function($,J){var Q=0;$.subscribe($c.createOperatorSubscriber(J,function(Y){J.next(D.call(F,Y,Q++))}))})}rE.map=Jc});var X6=z((B6)=>{var Qc=B6&&B6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},Yc=B6&&B6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(B6,"__esModule",{value:!0});B6.mapOneOrManyArgs=void 0;var Bc=Y6(),Xc=Array.isArray;function Gc(D,F){return Xc(F)?D.apply(void 0,Yc([],Qc(F))):D(F)}function Wc(D){return Bc.map(function(F){return Gc(D,F)})}B6.mapOneOrManyArgs=Wc});var TY=z((G6)=>{var Hc=G6&&G6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},eE=G6&&G6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(G6,"__esModule",{value:!0});G6.bindCallbackInternals=void 0;var qc=nF(),Kc=v0(),zc=aF(),Ec=X6(),Vc=iF(),Zc=Q7();function jY(D,F,$,J){if($)if(qc.isScheduler($))J=$;else return function(){var Q=[];for(var Y=0;Y<arguments.length;Y++)Q[Y]=arguments[Y];return jY(D,F,J).apply(this,Q).pipe(Ec.mapOneOrManyArgs($))};if(J)return function(){var Q=[];for(var Y=0;Y<arguments.length;Y++)Q[Y]=arguments[Y];return jY(D,F).apply(this,Q).pipe(zc.subscribeOn(J),Vc.observeOn(J))};return function(){var Q=this,Y=[];for(var B=0;B<arguments.length;B++)Y[B]=arguments[B];var X=new Zc.AsyncSubject,G=!0;return new Kc.Observable(function(H){var q=X.subscribe(H);if(G){G=!1;var K=!1,V=!1;if(F.apply(Q,eE(eE([],Hc(Y)),[function(){var E=[];for(var Z=0;Z<arguments.length;Z++)E[Z]=arguments[Z];if(D){var L=E.shift();if(L!=null){X.error(L);return}}if(X.next(1<E.length?E:E[0]),V=!0,K)X.complete()}])),V)X.complete();K=!0}return q})}}G6.bindCallbackInternals=jY});var $V=z((DV)=>{Object.defineProperty(DV,"__esModule",{value:!0});DV.bindCallback=void 0;var Uc=TY();function Lc(D,F,$){return Uc.bindCallbackInternals(!1,D,F,$)}DV.bindCallback=Lc});var YV=z((JV)=>{Object.defineProperty(JV,"__esModule",{value:!0});JV.bindNodeCallback=void 0;var Ac=TY();function Mc(D,F,$){return Ac.bindCallbackInternals(!0,D,F,$)}JV.bindNodeCallback=Mc});var PY=z((BV)=>{Object.defineProperty(BV,"__esModule",{value:!0});BV.argsArgArrayOrObject=void 0;var Nc=Array.isArray,Rc=Object.getPrototypeOf,Cc=Object.prototype,Oc=Object.keys;function wc(D){if(D.length===1){var F=D[0];if(Nc(F))return{args:F,keys:null};if(jc(F)){var $=Oc(F);return{args:$.map(function(J){return F[J]}),keys:$}}}return{args:D,keys:null}}BV.argsArgArrayOrObject=wc;function jc(D){return D&&typeof D==="object"&&Rc(D)===Cc}});var IY=z((GV)=>{Object.defineProperty(GV,"__esModule",{value:!0});GV.createObject=void 0;function Tc(D,F){return D.reduce(function($,J,Q){return $[J]=F[Q],$},{})}GV.createObject=Tc});var K7=z((VV)=>{Object.defineProperty(VV,"__esModule",{value:!0});VV.combineLatestInit=VV.combineLatest=void 0;var Pc=v0(),Ic=PY(),KV=S8(),zV=ED(),Sc=X6(),HV=cD(),kc=IY(),vc=p(),yc=I8();function xc(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=HV.popScheduler(D),J=HV.popResultSelector(D),Q=Ic.argsArgArrayOrObject(D),Y=Q.args,B=Q.keys;if(Y.length===0)return KV.from([],$);var X=new Pc.Observable(EV(Y,$,B?function(G){return kc.createObject(B,G)}:zV.identity));return J?X.pipe(Sc.mapOneOrManyArgs(J)):X}VV.combineLatest=xc;function EV(D,F,$){if($===void 0)$=zV.identity;return function(J){qV(F,function(){var Q=D.length,Y=Array(Q),B=Q,X=Q,G=function(q){qV(F,function(){var K=KV.from(D[q],F),V=!1;K.subscribe(vc.createOperatorSubscriber(J,function(E){if(Y[q]=E,!V)V=!0,X--;if(!X)J.next($(Y.slice()))},function(){if(!--B)J.complete()}))},J)};for(var H=0;H<Q;H++)G(H)},J)}}VV.combineLatestInit=EV;function qV(D,F,$){if(D)yc.executeSchedule($,D,F);else F()}});var z7=z((LV)=>{Object.defineProperty(LV,"__esModule",{value:!0});LV.mergeInternals=void 0;var fc=Y0(),gc=I8(),UV=p();function hc(D,F,$,J,Q,Y,B,X){var G=[],H=0,q=0,K=!1,V=function(){if(K&&!G.length&&!H)F.complete()},E=function(L){return H<J?Z(L):G.push(L)},Z=function(L){Y&&F.next(L),H++;var M=!1;fc.innerFrom($(L,q++)).subscribe(UV.createOperatorSubscriber(F,function(A){if(Q===null||Q===void 0||Q(A),Y)E(A);else F.next(A)},function(){M=!0},void 0,function(){if(M)try{H--;var A=function(){var N=G.shift();if(B)gc.executeSchedule(F,B,function(){return Z(N)});else Z(N)};while(G.length&&H<J)A();V()}catch(N){F.error(N)}}))};return D.subscribe(UV.createOperatorSubscriber(F,E,function(){K=!0,V()})),function(){X===null||X===void 0||X()}}LV.mergeInternals=hc});var k8=z((NV)=>{Object.defineProperty(NV,"__esModule",{value:!0});NV.mergeMap=void 0;var bc=Y6(),uc=Y0(),mc=x(),lc=z7(),pc=S0();function MV(D,F,$){if($===void 0)$=1/0;if(pc.isFunction(F))return MV(function(J,Q){return bc.map(function(Y,B){return F(J,Y,Q,B)})(uc.innerFrom(D(J,Q)))},$);else if(typeof F==="number")$=F;return mc.operate(function(J,Q){return lc.mergeInternals(J,Q,D,$)})}NV.mergeMap=MV});var oF=z((CV)=>{Object.defineProperty(CV,"__esModule",{value:!0});CV.mergeAll=void 0;var dc=k8(),cc=ED();function nc(D){if(D===void 0)D=1/0;return dc.mergeMap(cc.identity,D)}CV.mergeAll=nc});var E7=z((wV)=>{Object.defineProperty(wV,"__esModule",{value:!0});wV.concatAll=void 0;var ic=oF();function ac(){return ic.mergeAll(1)}wV.concatAll=ac});var sF=z((TV)=>{Object.defineProperty(TV,"__esModule",{value:!0});TV.concat=void 0;var oc=E7(),sc=cD(),rc=S8();function tc(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return oc.concatAll()(rc.from(D,sc.popScheduler(D)))}TV.concat=tc});var rF=z((IV)=>{Object.defineProperty(IV,"__esModule",{value:!0});IV.defer=void 0;var ec=v0(),Dn=Y0();function Fn(D){return new ec.Observable(function(F){Dn.innerFrom(D()).subscribe(F)})}IV.defer=Fn});var yV=z((kV)=>{Object.defineProperty(kV,"__esModule",{value:!0});kV.connectable=void 0;var $n=VD(),Jn=v0(),Qn=rF(),Yn={connector:function(){return new $n.Subject},resetOnDisconnect:!0};function Bn(D,F){if(F===void 0)F=Yn;var $=null,J=F.connector,Q=F.resetOnDisconnect,Y=Q===void 0?!0:Q,B=J(),X=new Jn.Observable(function(G){return B.subscribe(G)});return X.connect=function(){if(!$||$.closed){if($=Qn.defer(function(){return D}).subscribe(B),Y)$.add(function(){return B=J()})}return $},X}kV.connectable=Bn});var fV=z((xV)=>{Object.defineProperty(xV,"__esModule",{value:!0});xV.forkJoin=void 0;var Xn=v0(),Gn=PY(),Wn=Y0(),Hn=cD(),qn=p(),Kn=X6(),zn=IY();function En(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=Hn.popResultSelector(D),J=Gn.argsArgArrayOrObject(D),Q=J.args,Y=J.keys,B=new Xn.Observable(function(X){var G=Q.length;if(!G){X.complete();return}var H=Array(G),q=G,K=G,V=function(Z){var L=!1;Wn.innerFrom(Q[Z]).subscribe(qn.createOperatorSubscriber(X,function(M){if(!L)L=!0,K--;H[Z]=M},function(){return q--},void 0,function(){if(!q||!L){if(!K)X.next(Y?zn.createObject(Y,H):H);X.complete()}}))};for(var E=0;E<G;E++)V(E)});return $?B.pipe(Kn.mapOneOrManyArgs($)):B}xV.forkJoin=En});var hV=z((E3)=>{var Vn=E3&&E3.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y};Object.defineProperty(E3,"__esModule",{value:!0});E3.fromEvent=void 0;var Zn=Y0(),Un=v0(),Ln=k8(),An=B7(),e6=S0(),Mn=X6(),Nn=["addListener","removeListener"],Rn=["addEventListener","removeEventListener"],Cn=["on","off"];function SY(D,F,$,J){if(e6.isFunction($))J=$,$=void 0;if(J)return SY(D,F,$).pipe(Mn.mapOneOrManyArgs(J));var Q=Vn(jn(D)?Rn.map(function(X){return function(G){return D[X](F,G,$)}}):On(D)?Nn.map(gV(D,F)):wn(D)?Cn.map(gV(D,F)):[],2),Y=Q[0],B=Q[1];if(!Y){if(An.isArrayLike(D))return Ln.mergeMap(function(X){return SY(X,F,$)})(Zn.innerFrom(D))}if(!Y)throw TypeError("Invalid event target");return new Un.Observable(function(X){var G=function(){var H=[];for(var q=0;q<arguments.length;q++)H[q]=arguments[q];return X.next(1<H.length?H:H[0])};return Y(G),function(){return B(G)}})}E3.fromEvent=SY;function gV(D,F){return function($){return function(J){return D[$](F,J)}}}function On(D){return e6.isFunction(D.addListener)&&e6.isFunction(D.removeListener)}function wn(D){return e6.isFunction(D.on)&&e6.isFunction(D.off)}function jn(D){return e6.isFunction(D.addEventListener)&&e6.isFunction(D.removeEventListener)}});var lV=z((uV)=>{Object.defineProperty(uV,"__esModule",{value:!0});uV.fromEventPattern=void 0;var Tn=v0(),Pn=S0(),In=X6();function bV(D,F,$){if($)return bV(D,F).pipe(In.mapOneOrManyArgs($));return new Tn.Observable(function(J){var Q=function(){var B=[];for(var X=0;X<arguments.length;X++)B[X]=arguments[X];return J.next(B.length===1?B[0]:B)},Y=D(Q);return Pn.isFunction(F)?function(){return F(Q,Y)}:void 0})}uV.fromEventPattern=bV});var dV=z((V3)=>{var Sn=V3&&V3.__generator||function(D,F){var $={label:0,sent:function(){if(Y[0]&1)throw Y[1];return Y[1]},trys:[],ops:[]},J,Q,Y,B;return B={next:X(0),throw:X(1),return:X(2)},typeof Symbol==="function"&&(B[Symbol.iterator]=function(){return this}),B;function X(H){return function(q){return G([H,q])}}function G(H){if(J)throw TypeError("Generator is already executing.");while($)try{if(J=1,Q&&(Y=H[0]&2?Q.return:H[0]?Q.throw||((Y=Q.return)&&Y.call(Q),0):Q.next)&&!(Y=Y.call(Q,H[1])).done)return Y;if(Q=0,Y)H=[H[0]&2,Y.value];switch(H[0]){case 0:case 1:Y=H;break;case 4:return $.label++,{value:H[1],done:!1};case 5:$.label++,Q=H[1],H=[0];continue;case 7:H=$.ops.pop(),$.trys.pop();continue;default:if((Y=$.trys,!(Y=Y.length>0&&Y[Y.length-1]))&&(H[0]===6||H[0]===2)){$=0;continue}if(H[0]===3&&(!Y||H[1]>Y[0]&&H[1]<Y[3])){$.label=H[1];break}if(H[0]===6&&$.label<Y[1]){$.label=Y[1],Y=H;break}if(Y&&$.label<Y[2]){$.label=Y[2],$.ops.push(H);break}if(Y[2])$.ops.pop();$.trys.pop();continue}H=F.call(D,$)}catch(q){H=[6,q],Q=0}finally{J=Y=0}if(H[0]&5)throw H[1];return{value:H[0]?H[1]:void 0,done:!0}}};Object.defineProperty(V3,"__esModule",{value:!0});V3.generate=void 0;var pV=ED(),kn=nF(),vn=rF(),yn=AY();function xn(D,F,$,J,Q){var Y,B,X,G;if(arguments.length===1)Y=D,G=Y.initialState,F=Y.condition,$=Y.iterate,B=Y.resultSelector,X=B===void 0?pV.identity:B,Q=Y.scheduler;else if(G=D,!J||kn.isScheduler(J))X=pV.identity,Q=J;else X=J;function H(){var q;return Sn(this,function(K){switch(K.label){case 0:q=G,K.label=1;case 1:if(!(!F||F(q)))return[3,4];return[4,X(q)];case 2:K.sent(),K.label=3;case 3:return q=$(q),[3,1];case 4:return[2]}})}return vn.defer(Q?function(){return yn.scheduleIterable(H(),Q)}:H)}V3.generate=xn});var iV=z((cV)=>{Object.defineProperty(cV,"__esModule",{value:!0});cV.iif=void 0;var _n=rF();function fn(D,F,$){return _n.defer(function(){return D()?F:$})}cV.iif=fn});var W6=z((aV)=>{Object.defineProperty(aV,"__esModule",{value:!0});aV.timer=void 0;var gn=v0(),hn=dD(),bn=nF(),un=H7();function mn(D,F,$){if(D===void 0)D=0;if($===void 0)$=hn.async;var J=-1;if(F!=null)if(bn.isScheduler(F))$=F;else J=F;return new gn.Observable(function(Q){var Y=un.isValidDate(D)?+D-$.now():D;if(Y<0)Y=0;var B=0;return $.schedule(function(){if(!Q.closed)if(Q.next(B++),0<=J)this.schedule(void 0,J);else Q.complete()},Y)})}aV.timer=mn});var kY=z((sV)=>{Object.defineProperty(sV,"__esModule",{value:!0});sV.interval=void 0;var ln=dD(),pn=W6();function dn(D,F){if(D===void 0)D=0;if(F===void 0)F=ln.asyncScheduler;if(D<0)D=0;return pn.timer(D,D,F)}sV.interval=dn});var FZ=z((eV)=>{Object.defineProperty(eV,"__esModule",{value:!0});eV.merge=void 0;var cn=oF(),nn=Y0(),an=S1(),tV=cD(),on=S8();function sn(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=tV.popScheduler(D),J=tV.popNumber(D,1/0),Q=D;return!Q.length?an.EMPTY:Q.length===1?nn.innerFrom(Q[0]):cn.mergeAll(J)(on.from(Q,$))}eV.merge=sn});var vY=z(($Z)=>{Object.defineProperty($Z,"__esModule",{value:!0});$Z.never=$Z.NEVER=void 0;var rn=v0(),tn=zD();$Z.NEVER=new rn.Observable(tn.noop);function en(){return $Z.NEVER}$Z.never=en});var Z3=z((YZ)=>{Object.defineProperty(YZ,"__esModule",{value:!0});YZ.argsOrArgArray=void 0;var Di=Array.isArray;function Fi(D){return D.length===1&&Di(D[0])?D[0]:D}YZ.argsOrArgArray=Fi});var yY=z((GZ)=>{Object.defineProperty(GZ,"__esModule",{value:!0});GZ.onErrorResumeNext=void 0;var $i=v0(),Ji=Z3(),Qi=p(),XZ=zD(),Yi=Y0();function Bi(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=Ji.argsOrArgArray(D);return new $i.Observable(function(J){var Q=0,Y=function(){if(Q<$.length){var B=void 0;try{B=Yi.innerFrom($[Q++])}catch(G){Y();return}var X=new Qi.OperatorSubscriber(J,void 0,XZ.noop,XZ.noop);B.subscribe(X),X.add(Y)}else J.complete()};Y()})}GZ.onErrorResumeNext=Bi});var KZ=z((HZ)=>{Object.defineProperty(HZ,"__esModule",{value:!0});HZ.pairs=void 0;var Xi=S8();function Gi(D,F){return Xi.from(Object.entries(D),F)}HZ.pairs=Gi});var VZ=z((zZ)=>{Object.defineProperty(zZ,"__esModule",{value:!0});zZ.not=void 0;function Wi(D,F){return function($,J){return!D.call(F,$,J)}}zZ.not=Wi});var D4=z((ZZ)=>{Object.defineProperty(ZZ,"__esModule",{value:!0});ZZ.filter=void 0;var Hi=x(),qi=p();function Ki(D,F){return Hi.operate(function($,J){var Q=0;$.subscribe(qi.createOperatorSubscriber(J,function(Y){return D.call(F,Y,Q++)&&J.next(Y)}))})}ZZ.filter=Ki});var RZ=z((MZ)=>{Object.defineProperty(MZ,"__esModule",{value:!0});MZ.partition=void 0;var zi=VZ(),LZ=D4(),AZ=Y0();function Ei(D,F,$){return[LZ.filter(F,$)(AZ.innerFrom(D)),LZ.filter(zi.not(F,$))(AZ.innerFrom(D))]}MZ.partition=Ei});var xY=z((wZ)=>{Object.defineProperty(wZ,"__esModule",{value:!0});wZ.raceInit=wZ.race=void 0;var Vi=v0(),CZ=Y0(),Zi=Z3(),Ui=p();function Li(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return D=Zi.argsOrArgArray(D),D.length===1?CZ.innerFrom(D[0]):new Vi.Observable(OZ(D))}wZ.race=Li;function OZ(D){return function(F){var $=[],J=function(Y){$.push(CZ.innerFrom(D[Y]).subscribe(Ui.createOperatorSubscriber(F,function(B){if($){for(var X=0;X<$.length;X++)X!==Y&&$[X].unsubscribe();$=null}F.next(B)})))};for(var Q=0;$&&!F.closed&&Q<D.length;Q++)J(Q)}}wZ.raceInit=OZ});var IZ=z((TZ)=>{Object.defineProperty(TZ,"__esModule",{value:!0});TZ.range=void 0;var Mi=v0(),Ni=S1();function Ri(D,F,$){if(F==null)F=D,D=0;if(F<=0)return Ni.EMPTY;var J=F+D;return new Mi.Observable($?function(Q){var Y=D;return $.schedule(function(){if(Y<J)Q.next(Y++),this.schedule();else Q.complete()})}:function(Q){var Y=D;while(Y<J&&!Q.closed)Q.next(Y++);Q.complete()})}TZ.range=Ri});var vZ=z((SZ)=>{Object.defineProperty(SZ,"__esModule",{value:!0});SZ.using=void 0;var Ci=v0(),Oi=Y0(),wi=S1();function ji(D,F){return new Ci.Observable(function($){var J=D(),Q=F(J),Y=Q?Oi.innerFrom(Q):wi.EMPTY;return Y.subscribe($),function(){if(J)J.unsubscribe()}})}SZ.using=ji});var V7=z((H6)=>{var Ti=H6&&H6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},Pi=H6&&H6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(H6,"__esModule",{value:!0});H6.zip=void 0;var Ii=v0(),Si=Y0(),ki=Z3(),vi=S1(),yi=p(),xi=cD();function _i(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=xi.popResultSelector(D),J=ki.argsOrArgArray(D);return J.length?new Ii.Observable(function(Q){var Y=J.map(function(){return[]}),B=J.map(function(){return!1});Q.add(function(){Y=B=null});var X=function(H){Si.innerFrom(J[H]).subscribe(yi.createOperatorSubscriber(Q,function(q){if(Y[H].push(q),Y.every(function(V){return V.length})){var K=Y.map(function(V){return V.shift()});if(Q.next($?$.apply(void 0,Pi([],Ti(K))):K),Y.some(function(V,E){return!V.length&&B[E]}))Q.complete()}},function(){B[H]=!0,!Y[H].length&&Q.complete()}))};for(var G=0;!Q.closed&&G<J.length;G++)X(G);return function(){Y=B=null}}):vi.EMPTY}H6.zip=_i});var xZ=z((yZ)=>{Object.defineProperty(yZ,"__esModule",{value:!0})});var _Y=z((fZ)=>{Object.defineProperty(fZ,"__esModule",{value:!0});fZ.audit=void 0;var fi=x(),gi=Y0(),_Z=p();function hi(D){return fi.operate(function(F,$){var J=!1,Q=null,Y=null,B=!1,X=function(){if(Y===null||Y===void 0||Y.unsubscribe(),Y=null,J){J=!1;var H=Q;Q=null,$.next(H)}B&&$.complete()},G=function(){Y=null,B&&$.complete()};F.subscribe(_Z.createOperatorSubscriber($,function(H){if(J=!0,Q=H,!Y)gi.innerFrom(D(H)).subscribe(Y=_Z.createOperatorSubscriber($,X,G))},function(){B=!0,(!J||!Y||Y.closed)&&$.complete()}))})}fZ.audit=hi});var uZ=z((hZ)=>{Object.defineProperty(hZ,"__esModule",{value:!0});hZ.auditTime=void 0;var bi=dD(),ui=_Y(),mi=W6();function li(D,F){if(F===void 0)F=bi.asyncScheduler;return ui.audit(function(){return mi.timer(D,F)})}hZ.auditTime=li});var dZ=z((lZ)=>{Object.defineProperty(lZ,"__esModule",{value:!0});lZ.buffer=void 0;var pi=x(),di=zD(),mZ=p(),ci=Y0();function ni(D){return pi.operate(function(F,$){var J=[];return F.subscribe(mZ.createOperatorSubscriber($,function(Q){return J.push(Q)},function(){$.next(J),$.complete()})),ci.innerFrom(D).subscribe(mZ.createOperatorSubscriber($,function(){var Q=J;J=[],$.next(Q)},di.noop)),function(){J=null}})}lZ.buffer=ni});var cZ=z((U3)=>{var fY=U3&&U3.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(U3,"__esModule",{value:!0});U3.bufferCount=void 0;var ii=x(),ai=p(),oi=P8();function si(D,F){if(F===void 0)F=null;return F=F!==null&&F!==void 0?F:D,ii.operate(function($,J){var Q=[],Y=0;$.subscribe(ai.createOperatorSubscriber(J,function(B){var X,G,H,q,K=null;if(Y++%F===0)Q.push([]);try{for(var V=fY(Q),E=V.next();!E.done;E=V.next()){var Z=E.value;if(Z.push(B),D<=Z.length)K=K!==null&&K!==void 0?K:[],K.push(Z)}}catch(A){X={error:A}}finally{try{if(E&&!E.done&&(G=V.return))G.call(V)}finally{if(X)throw X.error}}if(K)try{for(var L=fY(K),M=L.next();!M.done;M=L.next()){var Z=M.value;oi.arrRemove(Q,Z),J.next(Z)}}catch(A){H={error:A}}finally{try{if(M&&!M.done&&(q=L.return))q.call(L)}finally{if(H)throw H.error}}},function(){var B,X;try{for(var G=fY(Q),H=G.next();!H.done;H=G.next()){var q=H.value;J.next(q)}}catch(K){B={error:K}}finally{try{if(H&&!H.done&&(X=G.return))X.call(G)}finally{if(B)throw B.error}}J.complete()},void 0,function(){Q=null}))})}U3.bufferCount=si});var iZ=z((L3)=>{var ri=L3&&L3.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(L3,"__esModule",{value:!0});L3.bufferTime=void 0;var ti=F1(),ei=x(),Da=p(),Fa=P8(),$a=dD(),Ja=cD(),nZ=I8();function Qa(D){var F,$,J=[];for(var Q=1;Q<arguments.length;Q++)J[Q-1]=arguments[Q];var Y=(F=Ja.popScheduler(J))!==null&&F!==void 0?F:$a.asyncScheduler,B=($=J[0])!==null&&$!==void 0?$:null,X=J[1]||1/0;return ei.operate(function(G,H){var q=[],K=!1,V=function(L){var{buffer:M,subs:A}=L;A.unsubscribe(),Fa.arrRemove(q,L),H.next(M),K&&E()},E=function(){if(q){var L=new ti.Subscription;H.add(L);var M=[],A={buffer:M,subs:L};q.push(A),nZ.executeSchedule(L,Y,function(){return V(A)},D)}};if(B!==null&&B>=0)nZ.executeSchedule(H,Y,E,B,!0);else K=!0;E();var Z=Da.createOperatorSubscriber(H,function(L){var M,A,N=q.slice();try{for(var w=ri(N),P=w.next();!P.done;P=w.next()){var C=P.value,T=C.buffer;T.push(L),X<=T.length&&V(C)}}catch(y){M={error:y}}finally{try{if(P&&!P.done&&(A=w.return))A.call(w)}finally{if(M)throw M.error}}},function(){while(q===null||q===void 0?void 0:q.length)H.next(q.shift().buffer);Z===null||Z===void 0||Z.unsubscribe(),H.complete(),H.unsubscribe()},void 0,function(){return q=null});G.subscribe(Z)})}L3.bufferTime=Qa});var sZ=z((A3)=>{var Ya=A3&&A3.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(A3,"__esModule",{value:!0});A3.bufferToggle=void 0;var Ba=F1(),Xa=x(),aZ=Y0(),gY=p(),oZ=zD(),Ga=P8();function Wa(D,F){return Xa.operate(function($,J){var Q=[];aZ.innerFrom(D).subscribe(gY.createOperatorSubscriber(J,function(Y){var B=[];Q.push(B);var X=new Ba.Subscription,G=function(){Ga.arrRemove(Q,B),J.next(B),X.unsubscribe()};X.add(aZ.innerFrom(F(Y)).subscribe(gY.createOperatorSubscriber(J,G,oZ.noop)))},oZ.noop)),$.subscribe(gY.createOperatorSubscriber(J,function(Y){var B,X;try{for(var G=Ya(Q),H=G.next();!H.done;H=G.next()){var q=H.value;q.push(Y)}}catch(K){B={error:K}}finally{try{if(H&&!H.done&&(X=G.return))X.call(G)}finally{if(B)throw B.error}}},function(){while(Q.length>0)J.next(Q.shift());J.complete()}))})}A3.bufferToggle=Wa});var DU=z((tZ)=>{Object.defineProperty(tZ,"__esModule",{value:!0});tZ.bufferWhen=void 0;var Ha=x(),qa=zD(),rZ=p(),Ka=Y0();function za(D){return Ha.operate(function(F,$){var J=null,Q=null,Y=function(){Q===null||Q===void 0||Q.unsubscribe();var B=J;J=[],B&&$.next(B),Ka.innerFrom(D()).subscribe(Q=rZ.createOperatorSubscriber($,Y,qa.noop))};Y(),F.subscribe(rZ.createOperatorSubscriber($,function(B){return J===null||J===void 0?void 0:J.push(B)},function(){J&&$.next(J),$.complete()},void 0,function(){return J=Q=null}))})}tZ.bufferWhen=za});var QU=z(($U)=>{Object.defineProperty($U,"__esModule",{value:!0});$U.catchError=void 0;var Ea=Y0(),Va=p(),Za=x();function FU(D){return Za.operate(function(F,$){var J=null,Q=!1,Y;if(J=F.subscribe(Va.createOperatorSubscriber($,void 0,void 0,function(B){if(Y=Ea.innerFrom(D(B,FU(D)(F))),J)J.unsubscribe(),J=null,Y.subscribe($);else Q=!0})),Q)J.unsubscribe(),J=null,Y.subscribe($)})}$U.catchError=FU});var hY=z((YU)=>{Object.defineProperty(YU,"__esModule",{value:!0});YU.scanInternals=void 0;var Ua=p();function La(D,F,$,J,Q){return function(Y,B){var X=$,G=F,H=0;Y.subscribe(Ua.createOperatorSubscriber(B,function(q){var K=H++;G=X?D(G,q,K):(X=!0,q),J&&B.next(G)},Q&&function(){X&&B.next(G),B.complete()}))}}YU.scanInternals=La});var M3=z((XU)=>{Object.defineProperty(XU,"__esModule",{value:!0});XU.reduce=void 0;var Aa=hY(),Ma=x();function Na(D,F){return Ma.operate(Aa.scanInternals(D,F,arguments.length>=2,!1,!0))}XU.reduce=Na});var bY=z((WU)=>{Object.defineProperty(WU,"__esModule",{value:!0});WU.toArray=void 0;var Ra=M3(),Ca=x(),Oa=function(D,F){return D.push(F),D};function wa(){return Ca.operate(function(D,F){Ra.reduce(Oa,[])(D).subscribe(F)})}WU.toArray=wa});var uY=z((qU)=>{Object.defineProperty(qU,"__esModule",{value:!0});qU.joinAllInternals=void 0;var ja=ED(),Ta=X6(),Pa=dF(),Ia=k8(),Sa=bY();function ka(D,F){return Pa.pipe(Sa.toArray(),Ia.mergeMap(function($){return D($)}),F?Ta.mapOneOrManyArgs(F):ja.identity)}qU.joinAllInternals=ka});var mY=z((zU)=>{Object.defineProperty(zU,"__esModule",{value:!0});zU.combineLatestAll=void 0;var va=K7(),ya=uY();function xa(D){return ya.joinAllInternals(va.combineLatest,D)}zU.combineLatestAll=xa});var UU=z((VU)=>{Object.defineProperty(VU,"__esModule",{value:!0});VU.combineAll=void 0;var _a=mY();VU.combineAll=_a.combineLatestAll});var NU=z((q6)=>{var LU=q6&&q6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},AU=q6&&q6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(q6,"__esModule",{value:!0});q6.combineLatest=void 0;var fa=K7(),ga=x(),ha=Z3(),ba=X6(),ua=dF(),ma=cD();function MU(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=ma.popResultSelector(D);return $?ua.pipe(MU.apply(void 0,AU([],LU(D))),ba.mapOneOrManyArgs($)):ga.operate(function(J,Q){fa.combineLatestInit(AU([J],LU(ha.argsOrArgArray(D))))(Q)})}q6.combineLatest=MU});var RU=z((K6)=>{var la=K6&&K6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},pa=K6&&K6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(K6,"__esModule",{value:!0});K6.combineLatestWith=void 0;var da=NU();function ca(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return da.combineLatest.apply(void 0,pa([],la(D)))}K6.combineLatestWith=ca});var lY=z((OU)=>{Object.defineProperty(OU,"__esModule",{value:!0});OU.concatMap=void 0;var CU=k8(),na=S0();function ia(D,F){return na.isFunction(F)?CU.mergeMap(D,F,1):CU.mergeMap(D,1)}OU.concatMap=ia});var IU=z((TU)=>{Object.defineProperty(TU,"__esModule",{value:!0});TU.concatMapTo=void 0;var jU=lY(),aa=S0();function oa(D,F){return aa.isFunction(F)?jU.concatMap(function(){return D},F):jU.concatMap(function(){return D})}TU.concatMapTo=oa});var SU=z((z6)=>{var sa=z6&&z6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},ra=z6&&z6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(z6,"__esModule",{value:!0});z6.concat=void 0;var ta=x(),ea=E7(),Do=cD(),Fo=S8();function $o(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=Do.popScheduler(D);return ta.operate(function(J,Q){ea.concatAll()(Fo.from(ra([J],sa(D)),$)).subscribe(Q)})}z6.concat=$o});var kU=z((E6)=>{var Jo=E6&&E6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},Qo=E6&&E6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(E6,"__esModule",{value:!0});E6.concatWith=void 0;var Yo=SU();function Bo(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return Yo.concat.apply(void 0,Qo([],Jo(D)))}E6.concatWith=Bo});var xU=z((vU)=>{Object.defineProperty(vU,"__esModule",{value:!0});vU.fromSubscribable=void 0;var Xo=v0();function Go(D){return new Xo.Observable(function(F){return D.subscribe(F)})}vU.fromSubscribable=Go});var Z7=z((_U)=>{Object.defineProperty(_U,"__esModule",{value:!0});_U.connect=void 0;var Wo=VD(),Ho=Y0(),qo=x(),Ko=xU(),zo={connector:function(){return new Wo.Subject}};function Eo(D,F){if(F===void 0)F=zo;var $=F.connector;return qo.operate(function(J,Q){var Y=$();Ho.innerFrom(D(Ko.fromSubscribable(Y))).subscribe(Q),Q.add(J.subscribe(Y))})}_U.connect=Eo});var bU=z((gU)=>{Object.defineProperty(gU,"__esModule",{value:!0});gU.count=void 0;var Vo=M3();function Zo(D){return Vo.reduce(function(F,$,J){return!D||D($,J)?F+1:F},0)}gU.count=Zo});var pU=z((mU)=>{Object.defineProperty(mU,"__esModule",{value:!0});mU.debounce=void 0;var Uo=x(),Lo=zD(),uU=p(),Ao=Y0();function Mo(D){return Uo.operate(function(F,$){var J=!1,Q=null,Y=null,B=function(){if(Y===null||Y===void 0||Y.unsubscribe(),Y=null,J){J=!1;var X=Q;Q=null,$.next(X)}};F.subscribe(uU.createOperatorSubscriber($,function(X){Y===null||Y===void 0||Y.unsubscribe(),J=!0,Q=X,Y=uU.createOperatorSubscriber($,B,Lo.noop),Ao.innerFrom(D(X)).subscribe(Y)},function(){B(),$.complete()},void 0,function(){Q=Y=null}))})}mU.debounce=Mo});var nU=z((dU)=>{Object.defineProperty(dU,"__esModule",{value:!0});dU.debounceTime=void 0;var No=dD(),Ro=x(),Co=p();function Oo(D,F){if(F===void 0)F=No.asyncScheduler;return Ro.operate(function($,J){var Q=null,Y=null,B=null,X=function(){if(Q){Q.unsubscribe(),Q=null;var H=Y;Y=null,J.next(H)}};function G(){var H=B+D,q=F.now();if(q<H){Q=this.schedule(void 0,H-q),J.add(Q);return}X()}$.subscribe(Co.createOperatorSubscriber(J,function(H){if(Y=H,B=F.now(),!Q)Q=F.schedule(G,D),J.add(Q)},function(){X(),J.complete()},void 0,function(){Y=Q=null}))})}dU.debounceTime=Oo});var tF=z((iU)=>{Object.defineProperty(iU,"__esModule",{value:!0});iU.defaultIfEmpty=void 0;var wo=x(),jo=p();function To(D){return wo.operate(function(F,$){var J=!1;F.subscribe(jo.createOperatorSubscriber($,function(Q){J=!0,$.next(Q)},function(){if(!J)$.next(D);$.complete()}))})}iU.defaultIfEmpty=To});var eF=z((oU)=>{Object.defineProperty(oU,"__esModule",{value:!0});oU.take=void 0;var Po=S1(),Io=x(),So=p();function ko(D){return D<=0?function(){return Po.EMPTY}:Io.operate(function(F,$){var J=0;F.subscribe(So.createOperatorSubscriber($,function(Q){if(++J<=D){if($.next(Q),D<=J)$.complete()}}))})}oU.take=ko});var pY=z((rU)=>{Object.defineProperty(rU,"__esModule",{value:!0});rU.ignoreElements=void 0;var vo=x(),yo=p(),xo=zD();function _o(){return vo.operate(function(D,F){D.subscribe(yo.createOperatorSubscriber(F,xo.noop))})}rU.ignoreElements=_o});var dY=z((eU)=>{Object.defineProperty(eU,"__esModule",{value:!0});eU.mapTo=void 0;var fo=Y6();function go(D){return fo.map(function(){return D})}eU.mapTo=go});var cY=z((JL)=>{Object.defineProperty(JL,"__esModule",{value:!0});JL.delayWhen=void 0;var ho=sF(),FL=eF(),bo=pY(),uo=dY(),mo=k8(),lo=Y0();function $L(D,F){if(F)return function($){return ho.concat(F.pipe(FL.take(1),bo.ignoreElements()),$.pipe($L(D)))};return mo.mergeMap(function($,J){return lo.innerFrom(D($,J)).pipe(FL.take(1),uo.mapTo($))})}JL.delayWhen=$L});var XL=z((YL)=>{Object.defineProperty(YL,"__esModule",{value:!0});YL.delay=void 0;var po=dD(),co=cY(),no=W6();function io(D,F){if(F===void 0)F=po.asyncScheduler;var $=no.timer(D,F);return co.delayWhen(function(){return $})}YL.delay=io});var HL=z((GL)=>{Object.defineProperty(GL,"__esModule",{value:!0});GL.dematerialize=void 0;var ao=W7(),oo=x(),so=p();function ro(){return oo.operate(function(D,F){D.subscribe(so.createOperatorSubscriber(F,function($){return ao.observeNotification($,F)}))})}GL.dematerialize=ro});var EL=z((KL)=>{Object.defineProperty(KL,"__esModule",{value:!0});KL.distinct=void 0;var to=x(),qL=p(),eo=zD(),Ds=Y0();function Fs(D,F){return to.operate(function($,J){var Q=new Set;$.subscribe(qL.createOperatorSubscriber(J,function(Y){var B=D?D(Y):Y;if(!Q.has(B))Q.add(B),J.next(Y)})),F&&Ds.innerFrom(F).subscribe(qL.createOperatorSubscriber(J,function(){return Q.clear()},eo.noop))})}KL.distinct=Fs});var nY=z((VL)=>{Object.defineProperty(VL,"__esModule",{value:!0});VL.distinctUntilChanged=void 0;var $s=ED(),Js=x(),Qs=p();function Ys(D,F){if(F===void 0)F=$s.identity;return D=D!==null&&D!==void 0?D:Bs,Js.operate(function($,J){var Q,Y=!0;$.subscribe(Qs.createOperatorSubscriber(J,function(B){var X=F(B);if(Y||!D(Q,X))Y=!1,Q=X,J.next(B)}))})}VL.distinctUntilChanged=Ys;function Bs(D,F){return D===F}});var AL=z((UL)=>{Object.defineProperty(UL,"__esModule",{value:!0});UL.distinctUntilKeyChanged=void 0;var Xs=nY();function Gs(D,F){return Xs.distinctUntilChanged(function($,J){return F?F($[D],J[D]):$[D]===J[D]})}UL.distinctUntilKeyChanged=Gs});var D5=z((ML)=>{Object.defineProperty(ML,"__esModule",{value:!0});ML.throwIfEmpty=void 0;var Ws=Q6(),Hs=x(),qs=p();function Ks(D){if(D===void 0)D=zs;return Hs.operate(function(F,$){var J=!1;F.subscribe(qs.createOperatorSubscriber($,function(Q){J=!0,$.next(Q)},function(){return J?$.complete():$.error(D())}))})}ML.throwIfEmpty=Ks;function zs(){return new Ws.EmptyError}});var wL=z((CL)=>{Object.defineProperty(CL,"__esModule",{value:!0});CL.elementAt=void 0;var RL=CY(),Es=D4(),Vs=D5(),Zs=tF(),Us=eF();function Ls(D,F){if(D<0)throw new RL.ArgumentOutOfRangeError;var $=arguments.length>=2;return function(J){return J.pipe(Es.filter(function(Q,Y){return Y===D}),Us.take(1),$?Zs.defaultIfEmpty(F):Vs.throwIfEmpty(function(){return new RL.ArgumentOutOfRangeError}))}}CL.elementAt=Ls});var jL=z((V6)=>{var As=V6&&V6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},Ms=V6&&V6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(V6,"__esModule",{value:!0});V6.endWith=void 0;var Ns=sF(),Rs=G7();function Cs(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return function($){return Ns.concat($,Rs.of.apply(void 0,Ms([],As(D))))}}V6.endWith=Cs});var IL=z((TL)=>{Object.defineProperty(TL,"__esModule",{value:!0});TL.every=void 0;var Os=x(),ws=p();function js(D,F){return Os.operate(function($,J){var Q=0;$.subscribe(ws.createOperatorSubscriber(J,function(Y){if(!D.call(F,Y,Q++,$))J.next(!1),J.complete()},function(){J.next(!0),J.complete()}))})}TL.every=js});var iY=z((yL)=>{Object.defineProperty(yL,"__esModule",{value:!0});yL.exhaustMap=void 0;var Ts=Y6(),SL=Y0(),Ps=x(),kL=p();function vL(D,F){if(F)return function($){return $.pipe(vL(function(J,Q){return SL.innerFrom(D(J,Q)).pipe(Ts.map(function(Y,B){return F(J,Y,Q,B)}))}))};return Ps.operate(function($,J){var Q=0,Y=null,B=!1;$.subscribe(kL.createOperatorSubscriber(J,function(X){if(!Y)Y=kL.createOperatorSubscriber(J,void 0,function(){Y=null,B&&J.complete()}),SL.innerFrom(D(X,Q++)).subscribe(Y)},function(){B=!0,!Y&&J.complete()}))})}yL.exhaustMap=vL});var aY=z((_L)=>{Object.defineProperty(_L,"__esModule",{value:!0});_L.exhaustAll=void 0;var Is=iY(),Ss=ED();function ks(){return Is.exhaustMap(Ss.identity)}_L.exhaustAll=ks});var bL=z((gL)=>{Object.defineProperty(gL,"__esModule",{value:!0});gL.exhaust=void 0;var vs=aY();gL.exhaust=vs.exhaustAll});var lL=z((uL)=>{Object.defineProperty(uL,"__esModule",{value:!0});uL.expand=void 0;var ys=x(),xs=z7();function _s(D,F,$){if(F===void 0)F=1/0;return F=(F||0)<1?1/0:F,ys.operate(function(J,Q){return xs.mergeInternals(J,Q,D,F,void 0,!0,$)})}uL.expand=_s});var cL=z((pL)=>{Object.defineProperty(pL,"__esModule",{value:!0});pL.finalize=void 0;var fs=x();function gs(D){return fs.operate(function(F,$){try{F.subscribe($)}finally{$.add(D)}})}pL.finalize=gs});var oY=z((iL)=>{Object.defineProperty(iL,"__esModule",{value:!0});iL.createFind=iL.find=void 0;var hs=x(),bs=p();function us(D,F){return hs.operate(nL(D,F,"value"))}iL.find=us;function nL(D,F,$){var J=$==="index";return function(Q,Y){var B=0;Q.subscribe(bs.createOperatorSubscriber(Y,function(X){var G=B++;if(D.call(F,X,G,Q))Y.next(J?G:X),Y.complete()},function(){Y.next(J?-1:void 0),Y.complete()}))}}iL.createFind=nL});var rL=z((oL)=>{Object.defineProperty(oL,"__esModule",{value:!0});oL.findIndex=void 0;var ls=x(),ps=oY();function ds(D,F){return ls.operate(ps.createFind(D,F,"index"))}oL.findIndex=ds});var DA=z((tL)=>{Object.defineProperty(tL,"__esModule",{value:!0});tL.first=void 0;var cs=Q6(),ns=D4(),is=eF(),as=tF(),os=D5(),ss=ED();function rs(D,F){var $=arguments.length>=2;return function(J){return J.pipe(D?ns.filter(function(Q,Y){return D(Q,Y,J)}):ss.identity,is.take(1),$?as.defaultIfEmpty(F):os.throwIfEmpty(function(){return new cs.EmptyError}))}}tL.first=rs});var QA=z(($A)=>{Object.defineProperty($A,"__esModule",{value:!0});$A.groupBy=void 0;var ts=v0(),es=Y0(),Dr=VD(),Fr=x(),FA=p();function $r(D,F,$,J){return Fr.operate(function(Q,Y){var B;if(!F||typeof F==="function")B=F;else $=F.duration,B=F.element,J=F.connector;var X=new Map,G=function(Z){X.forEach(Z),Z(Y)},H=function(Z){return G(function(L){return L.error(Z)})},q=0,K=!1,V=new FA.OperatorSubscriber(Y,function(Z){try{var L=D(Z),M=X.get(L);if(!M){X.set(L,M=J?J():new Dr.Subject);var A=E(L,M);if(Y.next(A),$){var N=FA.createOperatorSubscriber(M,function(){M.complete(),N===null||N===void 0||N.unsubscribe()},void 0,void 0,function(){return X.delete(L)});V.add(es.innerFrom($(A)).subscribe(N))}}M.next(B?B(Z):Z)}catch(w){H(w)}},function(){return G(function(Z){return Z.complete()})},H,function(){return X.clear()},function(){return K=!0,q===0});Q.subscribe(V);function E(Z,L){var M=new ts.Observable(function(A){q++;var N=L.subscribe(A);return function(){N.unsubscribe(),--q===0&&K&&V.unsubscribe()}});return M.key=Z,M}})}$A.groupBy=$r});var XA=z((YA)=>{Object.defineProperty(YA,"__esModule",{value:!0});YA.isEmpty=void 0;var Jr=x(),Qr=p();function Yr(){return Jr.operate(function(D,F){D.subscribe(Qr.createOperatorSubscriber(F,function(){F.next(!1),F.complete()},function(){F.next(!0),F.complete()}))})}YA.isEmpty=Yr});var sY=z((N3)=>{var Br=N3&&N3.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(N3,"__esModule",{value:!0});N3.takeLast=void 0;var Xr=S1(),Gr=x(),Wr=p();function Hr(D){return D<=0?function(){return Xr.EMPTY}:Gr.operate(function(F,$){var J=[];F.subscribe(Wr.createOperatorSubscriber($,function(Q){J.push(Q),D<J.length&&J.shift()},function(){var Q,Y;try{for(var B=Br(J),X=B.next();!X.done;X=B.next()){var G=X.value;$.next(G)}}catch(H){Q={error:H}}finally{try{if(X&&!X.done&&(Y=B.return))Y.call(B)}finally{if(Q)throw Q.error}}$.complete()},void 0,function(){J=null}))})}N3.takeLast=Hr});var HA=z((GA)=>{Object.defineProperty(GA,"__esModule",{value:!0});GA.last=void 0;var qr=Q6(),Kr=D4(),zr=sY(),Er=D5(),Vr=tF(),Zr=ED();function Ur(D,F){var $=arguments.length>=2;return function(J){return J.pipe(D?Kr.filter(function(Q,Y){return D(Q,Y,J)}):Zr.identity,zr.takeLast(1),$?Vr.defaultIfEmpty(F):Er.throwIfEmpty(function(){return new qr.EmptyError}))}}GA.last=Ur});var zA=z((qA)=>{Object.defineProperty(qA,"__esModule",{value:!0});qA.materialize=void 0;var rY=W7(),Lr=x(),Ar=p();function Mr(){return Lr.operate(function(D,F){D.subscribe(Ar.createOperatorSubscriber(F,function($){F.next(rY.Notification.createNext($))},function(){F.next(rY.Notification.createComplete()),F.complete()},function($){F.next(rY.Notification.createError($)),F.complete()}))})}qA.materialize=Mr});var ZA=z((EA)=>{Object.defineProperty(EA,"__esModule",{value:!0});EA.max=void 0;var Nr=M3(),Rr=S0();function Cr(D){return Nr.reduce(Rr.isFunction(D)?function(F,$){return D(F,$)>0?F:$}:function(F,$){return F>$?F:$})}EA.max=Cr});var AA=z((UA)=>{Object.defineProperty(UA,"__esModule",{value:!0});UA.flatMap=void 0;var Or=k8();UA.flatMap=Or.mergeMap});var CA=z((NA)=>{Object.defineProperty(NA,"__esModule",{value:!0});NA.mergeMapTo=void 0;var MA=k8(),wr=S0();function jr(D,F,$){if($===void 0)$=1/0;if(wr.isFunction(F))return MA.mergeMap(function(){return D},F,$);if(typeof F==="number")$=F;return MA.mergeMap(function(){return D},$)}NA.mergeMapTo=jr});var jA=z((OA)=>{Object.defineProperty(OA,"__esModule",{value:!0});OA.mergeScan=void 0;var Tr=x(),Pr=z7();function Ir(D,F,$){if($===void 0)$=1/0;return Tr.operate(function(J,Q){var Y=F;return Pr.mergeInternals(J,Q,function(B,X){return D(Y,B,X)},$,function(B){Y=B},!1,void 0,function(){return Y=null})})}OA.mergeScan=Ir});var PA=z((Z6)=>{var Sr=Z6&&Z6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},kr=Z6&&Z6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(Z6,"__esModule",{value:!0});Z6.merge=void 0;var vr=x(),yr=oF(),TA=cD(),xr=S8();function _r(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=TA.popScheduler(D),J=TA.popNumber(D,1/0);return vr.operate(function(Q,Y){yr.mergeAll(J)(xr.from(kr([Q],Sr(D)),$)).subscribe(Y)})}Z6.merge=_r});var IA=z((U6)=>{var fr=U6&&U6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},gr=U6&&U6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(U6,"__esModule",{value:!0});U6.mergeWith=void 0;var hr=PA();function br(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return hr.merge.apply(void 0,gr([],fr(D)))}U6.mergeWith=br});var vA=z((SA)=>{Object.defineProperty(SA,"__esModule",{value:!0});SA.min=void 0;var ur=M3(),mr=S0();function lr(D){return ur.reduce(mr.isFunction(D)?function(F,$){return D(F,$)<0?F:$}:function(F,$){return F<$?F:$})}SA.min=lr});var U7=z((xA)=>{Object.defineProperty(xA,"__esModule",{value:!0});xA.multicast=void 0;var pr=cF(),yA=S0(),dr=Z7();function cr(D,F){var $=yA.isFunction(D)?D:function(){return D};if(yA.isFunction(F))return dr.connect(F,{connector:$});return function(J){return new pr.ConnectableObservable(J,$)}}xA.multicast=cr});var gA=z((Y8)=>{var nr=Y8&&Y8.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},ir=Y8&&Y8.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(Y8,"__esModule",{value:!0});Y8.onErrorResumeNext=Y8.onErrorResumeNextWith=void 0;var ar=Z3(),or=yY();function fA(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=ar.argsOrArgArray(D);return function(J){return or.onErrorResumeNext.apply(void 0,ir([J],nr($)))}}Y8.onErrorResumeNextWith=fA;Y8.onErrorResumeNext=fA});var uA=z((hA)=>{Object.defineProperty(hA,"__esModule",{value:!0});hA.pairwise=void 0;var sr=x(),rr=p();function tr(){return sr.operate(function(D,F){var $,J=!1;D.subscribe(rr.createOperatorSubscriber(F,function(Q){var Y=$;$=Q,J&&F.next([Y,Q]),J=!0}))})}hA.pairwise=tr});var pA=z((mA)=>{Object.defineProperty(mA,"__esModule",{value:!0});mA.pluck=void 0;var er=Y6();function Dt(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=D.length;if($===0)throw Error("list of properties cannot be empty.");return er.map(function(J){var Q=J;for(var Y=0;Y<$;Y++){var B=Q===null||Q===void 0?void 0:Q[D[Y]];if(typeof B<"u")Q=B;else return}return Q})}mA.pluck=Dt});var nA=z((dA)=>{Object.defineProperty(dA,"__esModule",{value:!0});dA.publish=void 0;var Ft=VD(),$t=U7(),Jt=Z7();function Qt(D){return D?function(F){return Jt.connect(D)(F)}:function(F){return $t.multicast(new Ft.Subject)(F)}}dA.publish=Qt});var oA=z((iA)=>{Object.defineProperty(iA,"__esModule",{value:!0});iA.publishBehavior=void 0;var Yt=YY(),Bt=cF();function Xt(D){return function(F){var $=new Yt.BehaviorSubject(D);return new Bt.ConnectableObservable(F,function(){return $})}}iA.publishBehavior=Xt});var tA=z((sA)=>{Object.defineProperty(sA,"__esModule",{value:!0});sA.publishLast=void 0;var Gt=Q7(),Wt=cF();function Ht(){return function(D){var F=new Gt.AsyncSubject;return new Wt.ConnectableObservable(D,function(){return F})}}sA.publishLast=Ht});var $M=z((DM)=>{Object.defineProperty(DM,"__esModule",{value:!0});DM.publishReplay=void 0;var qt=J7(),Kt=U7(),eA=S0();function zt(D,F,$,J){if($&&!eA.isFunction($))J=$;var Q=eA.isFunction($)?$:void 0;return function(Y){return Kt.multicast(new qt.ReplaySubject(D,F,J),Q)(Y)}}DM.publishReplay=zt});var JM=z((L6)=>{var Et=L6&&L6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},Vt=L6&&L6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(L6,"__esModule",{value:!0});L6.raceWith=void 0;var Zt=xY(),Ut=x(),Lt=ED();function At(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return!D.length?Lt.identity:Ut.operate(function($,J){Zt.raceInit(Vt([$],Et(D)))(J)})}L6.raceWith=At});var XM=z((YM)=>{Object.defineProperty(YM,"__esModule",{value:!0});YM.repeat=void 0;var Mt=S1(),Nt=x(),QM=p(),Rt=Y0(),Ct=W6();function Ot(D){var F,$=1/0,J;if(D!=null)if(typeof D==="object")F=D.count,$=F===void 0?1/0:F,J=D.delay;else $=D;return $<=0?function(){return Mt.EMPTY}:Nt.operate(function(Q,Y){var B=0,X,G=function(){if(X===null||X===void 0||X.unsubscribe(),X=null,J!=null){var q=typeof J==="number"?Ct.timer(J):Rt.innerFrom(J(B)),K=QM.createOperatorSubscriber(Y,function(){K.unsubscribe(),H()});q.subscribe(K)}else H()},H=function(){var q=!1;if(X=Q.subscribe(QM.createOperatorSubscriber(Y,void 0,function(){if(++B<$)if(X)G();else q=!0;else Y.complete()})),q)G()};H()})}YM.repeat=Ot});var qM=z((WM)=>{Object.defineProperty(WM,"__esModule",{value:!0});WM.repeatWhen=void 0;var wt=Y0(),jt=VD(),Tt=x(),GM=p();function Pt(D){return Tt.operate(function(F,$){var J,Q=!1,Y,B=!1,X=!1,G=function(){return X&&B&&($.complete(),!0)},H=function(){if(!Y)Y=new jt.Subject,wt.innerFrom(D(Y)).subscribe(GM.createOperatorSubscriber($,function(){if(J)q();else Q=!0},function(){B=!0,G()}));return Y},q=function(){if(X=!1,J=F.subscribe(GM.createOperatorSubscriber($,void 0,function(){X=!0,!G()&&H().next()})),Q)J.unsubscribe(),J=null,Q=!1,q()};q()})}WM.repeatWhen=Pt});var VM=z((zM)=>{Object.defineProperty(zM,"__esModule",{value:!0});zM.retry=void 0;var It=x(),KM=p(),St=ED(),kt=W6(),vt=Y0();function yt(D){if(D===void 0)D=1/0;var F;if(D&&typeof D==="object")F=D;else F={count:D};var $=F.count,J=$===void 0?1/0:$,Q=F.delay,Y=F.resetOnSuccess,B=Y===void 0?!1:Y;return J<=0?St.identity:It.operate(function(X,G){var H=0,q,K=function(){var V=!1;if(q=X.subscribe(KM.createOperatorSubscriber(G,function(E){if(B)H=0;G.next(E)},void 0,function(E){if(H++<J){var Z=function(){if(q)q.unsubscribe(),q=null,K();else V=!0};if(Q!=null){var L=typeof Q==="number"?kt.timer(Q):vt.innerFrom(Q(E,H)),M=KM.createOperatorSubscriber(G,function(){M.unsubscribe(),Z()},function(){G.complete()});L.subscribe(M)}else Z()}else G.error(E)})),V)q.unsubscribe(),q=null,K()};K()})}zM.retry=yt});var AM=z((UM)=>{Object.defineProperty(UM,"__esModule",{value:!0});UM.retryWhen=void 0;var xt=Y0(),_t=VD(),ft=x(),ZM=p();function gt(D){return ft.operate(function(F,$){var J,Q=!1,Y,B=function(){if(J=F.subscribe(ZM.createOperatorSubscriber($,void 0,void 0,function(X){if(!Y)Y=new _t.Subject,xt.innerFrom(D(Y)).subscribe(ZM.createOperatorSubscriber($,function(){return J?B():Q=!0}));if(Y)Y.next(X)})),Q)J.unsubscribe(),J=null,Q=!1,B()};B()})}UM.retryWhen=gt});var tY=z((NM)=>{Object.defineProperty(NM,"__esModule",{value:!0});NM.sample=void 0;var ht=Y0(),bt=x(),ut=zD(),MM=p();function mt(D){return bt.operate(function(F,$){var J=!1,Q=null;F.subscribe(MM.createOperatorSubscriber($,function(Y){J=!0,Q=Y})),ht.innerFrom(D).subscribe(MM.createOperatorSubscriber($,function(){if(J){J=!1;var Y=Q;Q=null,$.next(Y)}},ut.noop))})}NM.sample=mt});var wM=z((CM)=>{Object.defineProperty(CM,"__esModule",{value:!0});CM.sampleTime=void 0;var lt=dD(),pt=tY(),dt=kY();function ct(D,F){if(F===void 0)F=lt.asyncScheduler;return pt.sample(dt.interval(D,F))}CM.sampleTime=ct});var PM=z((jM)=>{Object.defineProperty(jM,"__esModule",{value:!0});jM.scan=void 0;var nt=x(),it=hY();function at(D,F){return nt.operate(it.scanInternals(D,F,arguments.length>=2,!0))}jM.scan=at});var vM=z((SM)=>{Object.defineProperty(SM,"__esModule",{value:!0});SM.sequenceEqual=void 0;var ot=x(),st=p(),rt=Y0();function tt(D,F){if(F===void 0)F=function($,J){return $===J};return ot.operate(function($,J){var Q=IM(),Y=IM(),B=function(G){J.next(G),J.complete()},X=function(G,H){var q=st.createOperatorSubscriber(J,function(K){var{buffer:V,complete:E}=H;if(V.length===0)E?B(!1):G.buffer.push(K);else!F(K,V.shift())&&B(!1)},function(){G.complete=!0;var{complete:K,buffer:V}=H;K&&B(V.length===0),q===null||q===void 0||q.unsubscribe()});return q};$.subscribe(X(Q,Y)),rt.innerFrom(D).subscribe(X(Y,Q))})}SM.sequenceEqual=tt;function IM(){return{buffer:[],complete:!1}}});var DB=z((A6)=>{var et=A6&&A6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},De=A6&&A6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(A6,"__esModule",{value:!0});A6.share=void 0;var yM=Y0(),Fe=VD(),xM=s4(),$e=x();function Je(D){if(D===void 0)D={};var F=D.connector,$=F===void 0?function(){return new Fe.Subject}:F,J=D.resetOnError,Q=J===void 0?!0:J,Y=D.resetOnComplete,B=Y===void 0?!0:Y,X=D.resetOnRefCountZero,G=X===void 0?!0:X;return function(H){var q,K,V,E=0,Z=!1,L=!1,M=function(){K===null||K===void 0||K.unsubscribe(),K=void 0},A=function(){M(),q=V=void 0,Z=L=!1},N=function(){var w=q;A(),w===null||w===void 0||w.unsubscribe()};return $e.operate(function(w,P){if(E++,!L&&!Z)M();var C=V=V!==null&&V!==void 0?V:$();if(P.add(function(){if(E--,E===0&&!L&&!Z)K=eY(N,G)}),C.subscribe(P),!q&&E>0)q=new xM.SafeSubscriber({next:function(T){return C.next(T)},error:function(T){L=!0,M(),K=eY(A,Q,T),C.error(T)},complete:function(){Z=!0,M(),K=eY(A,B),C.complete()}}),yM.innerFrom(w).subscribe(q)})(H)}}A6.share=Je;function eY(D,F){var $=[];for(var J=2;J<arguments.length;J++)$[J-2]=arguments[J];if(F===!0){D();return}if(F===!1)return;var Q=new xM.SafeSubscriber({next:function(){Q.unsubscribe(),D()}});return yM.innerFrom(F.apply(void 0,De([],et($)))).subscribe(Q)}});var gM=z((_M)=>{Object.defineProperty(_M,"__esModule",{value:!0});_M.shareReplay=void 0;var Qe=J7(),Ye=DB();function Be(D,F,$){var J,Q,Y,B,X=!1;if(D&&typeof D==="object")J=D.bufferSize,B=J===void 0?1/0:J,Q=D.windowTime,F=Q===void 0?1/0:Q,Y=D.refCount,X=Y===void 0?!1:Y,$=D.scheduler;else B=D!==null&&D!==void 0?D:1/0;return Ye.share({connector:function(){return new Qe.ReplaySubject(B,F,$)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:X})}_M.shareReplay=Be});var uM=z((hM)=>{Object.defineProperty(hM,"__esModule",{value:!0});hM.single=void 0;var Xe=Q6(),Ge=wY(),We=OY(),He=x(),qe=p();function Ke(D){return He.operate(function(F,$){var J=!1,Q,Y=!1,B=0;F.subscribe(qe.createOperatorSubscriber($,function(X){if(Y=!0,!D||D(X,B++,F))J&&$.error(new Ge.SequenceError("Too many matching values")),J=!0,Q=X},function(){if(J)$.next(Q),$.complete();else $.error(Y?new We.NotFoundError("No matching values"):new Xe.EmptyError)}))})}hM.single=Ke});var pM=z((mM)=>{Object.defineProperty(mM,"__esModule",{value:!0});mM.skip=void 0;var ze=D4();function Ee(D){return ze.filter(function(F,$){return D<=$})}mM.skip=Ee});var nM=z((dM)=>{Object.defineProperty(dM,"__esModule",{value:!0});dM.skipLast=void 0;var Ve=ED(),Ze=x(),Ue=p();function Le(D){return D<=0?Ve.identity:Ze.operate(function(F,$){var J=Array(D),Q=0;return F.subscribe(Ue.createOperatorSubscriber($,function(Y){var B=Q++;if(B<D)J[B]=Y;else{var X=B%D,G=J[X];J[X]=Y,$.next(G)}})),function(){J=null}})}dM.skipLast=Le});var sM=z((aM)=>{Object.defineProperty(aM,"__esModule",{value:!0});aM.skipUntil=void 0;var Ae=x(),iM=p(),Me=Y0(),Ne=zD();function Re(D){return Ae.operate(function(F,$){var J=!1,Q=iM.createOperatorSubscriber($,function(){Q===null||Q===void 0||Q.unsubscribe(),J=!0},Ne.noop);Me.innerFrom(D).subscribe(Q),F.subscribe(iM.createOperatorSubscriber($,function(Y){return J&&$.next(Y)}))})}aM.skipUntil=Re});var eM=z((rM)=>{Object.defineProperty(rM,"__esModule",{value:!0});rM.skipWhile=void 0;var Ce=x(),Oe=p();function we(D){return Ce.operate(function(F,$){var J=!1,Q=0;F.subscribe(Oe.createOperatorSubscriber($,function(Y){return(J||(J=!D(Y,Q++)))&&$.next(Y)}))})}rM.skipWhile=we});var JN=z((FN)=>{Object.defineProperty(FN,"__esModule",{value:!0});FN.startWith=void 0;var DN=sF(),je=cD(),Te=x();function Pe(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=je.popScheduler(D);return Te.operate(function(J,Q){($?DN.concat(D,J,$):DN.concat(D,J)).subscribe(Q)})}FN.startWith=Pe});var F5=z((YN)=>{Object.defineProperty(YN,"__esModule",{value:!0});YN.switchMap=void 0;var Ie=Y0(),Se=x(),QN=p();function ke(D,F){return Se.operate(function($,J){var Q=null,Y=0,B=!1,X=function(){return B&&!Q&&J.complete()};$.subscribe(QN.createOperatorSubscriber(J,function(G){Q===null||Q===void 0||Q.unsubscribe();var H=0,q=Y++;Ie.innerFrom(D(G,q)).subscribe(Q=QN.createOperatorSubscriber(J,function(K){return J.next(F?F(G,K,q,H++):K)},function(){Q=null,X()}))},function(){B=!0,X()}))})}YN.switchMap=ke});var WN=z((XN)=>{Object.defineProperty(XN,"__esModule",{value:!0});XN.switchAll=void 0;var ve=F5(),ye=ED();function xe(){return ve.switchMap(ye.identity)}XN.switchAll=xe});var zN=z((qN)=>{Object.defineProperty(qN,"__esModule",{value:!0});qN.switchMapTo=void 0;var HN=F5(),_e=S0();function fe(D,F){return _e.isFunction(F)?HN.switchMap(function(){return D},F):HN.switchMap(function(){return D})}qN.switchMapTo=fe});var ZN=z((EN)=>{Object.defineProperty(EN,"__esModule",{value:!0});EN.switchScan=void 0;var ge=F5(),he=x();function be(D,F){return he.operate(function($,J){var Q=F;return ge.switchMap(function(Y,B){return D(Q,Y,B)},function(Y,B){return Q=B,B})($).subscribe(J),function(){Q=null}})}EN.switchScan=be});var AN=z((UN)=>{Object.defineProperty(UN,"__esModule",{value:!0});UN.takeUntil=void 0;var ue=x(),me=p(),le=Y0(),pe=zD();function de(D){return ue.operate(function(F,$){le.innerFrom(D).subscribe(me.createOperatorSubscriber($,function(){return $.complete()},pe.noop)),!$.closed&&F.subscribe($)})}UN.takeUntil=de});var RN=z((MN)=>{Object.defineProperty(MN,"__esModule",{value:!0});MN.takeWhile=void 0;var ce=x(),ne=p();function ie(D,F){if(F===void 0)F=!1;return ce.operate(function($,J){var Q=0;$.subscribe(ne.createOperatorSubscriber(J,function(Y){var B=D(Y,Q++);(B||F)&&J.next(Y),!B&&J.complete()}))})}MN.takeWhile=ie});var wN=z((CN)=>{Object.defineProperty(CN,"__esModule",{value:!0});CN.tap=void 0;var ae=S0(),oe=x(),se=p(),re=ED();function te(D,F,$){var J=ae.isFunction(D)||F||$?{next:D,error:F,complete:$}:D;return J?oe.operate(function(Q,Y){var B;(B=J.subscribe)===null||B===void 0||B.call(J);var X=!0;Q.subscribe(se.createOperatorSubscriber(Y,function(G){var H;(H=J.next)===null||H===void 0||H.call(J,G),Y.next(G)},function(){var G;X=!1,(G=J.complete)===null||G===void 0||G.call(J),Y.complete()},function(G){var H;X=!1,(H=J.error)===null||H===void 0||H.call(J,G),Y.error(G)},function(){var G,H;if(X)(G=J.unsubscribe)===null||G===void 0||G.call(J);(H=J.finalize)===null||H===void 0||H.call(J)}))}):re.identity}CN.tap=te});var FB=z((TN)=>{Object.defineProperty(TN,"__esModule",{value:!0});TN.throttle=void 0;var ee=x(),jN=p(),D00=Y0();function F00(D,F){return ee.operate(function($,J){var Q=F!==null&&F!==void 0?F:{},Y=Q.leading,B=Y===void 0?!0:Y,X=Q.trailing,G=X===void 0?!1:X,H=!1,q=null,K=null,V=!1,E=function(){if(K===null||K===void 0||K.unsubscribe(),K=null,G)M(),V&&J.complete()},Z=function(){K=null,V&&J.complete()},L=function(A){return K=D00.innerFrom(D(A)).subscribe(jN.createOperatorSubscriber(J,E,Z))},M=function(){if(H){H=!1;var A=q;q=null,J.next(A),!V&&L(A)}};$.subscribe(jN.createOperatorSubscriber(J,function(A){H=!0,q=A,!(K&&!K.closed)&&(B?M():L(A))},function(){V=!0,!(G&&H&&K&&!K.closed)&&J.complete()}))})}TN.throttle=F00});var kN=z((IN)=>{Object.defineProperty(IN,"__esModule",{value:!0});IN.throttleTime=void 0;var $00=dD(),J00=FB(),Q00=W6();function Y00(D,F,$){if(F===void 0)F=$00.asyncScheduler;var J=Q00.timer(D,F);return J00.throttle(function(){return J},$)}IN.throttleTime=Y00});var _N=z((yN)=>{Object.defineProperty(yN,"__esModule",{value:!0});yN.TimeInterval=yN.timeInterval=void 0;var B00=dD(),X00=x(),G00=p();function W00(D){if(D===void 0)D=B00.asyncScheduler;return X00.operate(function(F,$){var J=D.now();F.subscribe(G00.createOperatorSubscriber($,function(Q){var Y=D.now(),B=Y-J;J=Y,$.next(new vN(Q,B))}))})}yN.timeInterval=W00;var vN=function(){function D(F,$){this.value=F,this.interval=$}return D}();yN.TimeInterval=vN});var hN=z((fN)=>{Object.defineProperty(fN,"__esModule",{value:!0});fN.timeoutWith=void 0;var q00=dD(),K00=H7(),z00=q7();function E00(D,F,$){var J,Q,Y;if($=$!==null&&$!==void 0?$:q00.async,K00.isValidDate(D))J=D;else if(typeof D==="number")Q=D;if(F)Y=function(){return F};else throw TypeError("No observable provided to switch to");if(J==null&&Q==null)throw TypeError("No timeout provided.");return z00.timeout({first:J,each:Q,scheduler:$,with:Y})}fN.timeoutWith=E00});var mN=z((bN)=>{Object.defineProperty(bN,"__esModule",{value:!0});bN.timestamp=void 0;var V00=$7(),Z00=Y6();function U00(D){if(D===void 0)D=V00.dateTimestampProvider;return Z00.map(function(F){return{value:F,timestamp:D.now()}})}bN.timestamp=U00});var nN=z((dN)=>{Object.defineProperty(dN,"__esModule",{value:!0});dN.window=void 0;var lN=VD(),L00=x(),pN=p(),A00=zD(),M00=Y0();function N00(D){return L00.operate(function(F,$){var J=new lN.Subject;$.next(J.asObservable());var Q=function(Y){J.error(Y),$.error(Y)};return F.subscribe(pN.createOperatorSubscriber($,function(Y){return J===null||J===void 0?void 0:J.next(Y)},function(){J.complete(),$.complete()},Q)),M00.innerFrom(D).subscribe(pN.createOperatorSubscriber($,function(){J.complete(),$.next(J=new lN.Subject)},A00.noop,Q)),function(){J===null||J===void 0||J.unsubscribe(),J=null}})}dN.window=N00});var aN=z((R3)=>{var R00=R3&&R3.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(R3,"__esModule",{value:!0});R3.windowCount=void 0;var iN=VD(),C00=x(),O00=p();function w00(D,F){if(F===void 0)F=0;var $=F>0?F:D;return C00.operate(function(J,Q){var Y=[new iN.Subject],B=[],X=0;Q.next(Y[0].asObservable()),J.subscribe(O00.createOperatorSubscriber(Q,function(G){var H,q;try{for(var K=R00(Y),V=K.next();!V.done;V=K.next()){var E=V.value;E.next(G)}}catch(M){H={error:M}}finally{try{if(V&&!V.done&&(q=K.return))q.call(K)}finally{if(H)throw H.error}}var Z=X-D+1;if(Z>=0&&Z%$===0)Y.shift().complete();if(++X%$===0){var L=new iN.Subject;Y.push(L),Q.next(L.asObservable())}},function(){while(Y.length>0)Y.shift().complete();Q.complete()},function(G){while(Y.length>0)Y.shift().error(G);Q.error(G)},function(){B=null,Y=null}))})}R3.windowCount=w00});var tN=z((sN)=>{Object.defineProperty(sN,"__esModule",{value:!0});sN.windowTime=void 0;var j00=VD(),T00=dD(),P00=F1(),I00=x(),S00=p(),k00=P8(),v00=cD(),oN=I8();function y00(D){var F,$,J=[];for(var Q=1;Q<arguments.length;Q++)J[Q-1]=arguments[Q];var Y=(F=v00.popScheduler(J))!==null&&F!==void 0?F:T00.asyncScheduler,B=($=J[0])!==null&&$!==void 0?$:null,X=J[1]||1/0;return I00.operate(function(G,H){var q=[],K=!1,V=function(M){var{window:A,subs:N}=M;A.complete(),N.unsubscribe(),k00.arrRemove(q,M),K&&E()},E=function(){if(q){var M=new P00.Subscription;H.add(M);var A=new j00.Subject,N={window:A,subs:M,seen:0};q.push(N),H.next(A.asObservable()),oN.executeSchedule(M,Y,function(){return V(N)},D)}};if(B!==null&&B>=0)oN.executeSchedule(H,Y,E,B,!0);else K=!0;E();var Z=function(M){return q.slice().forEach(M)},L=function(M){Z(function(A){var N=A.window;return M(N)}),M(H),H.unsubscribe()};return G.subscribe(S00.createOperatorSubscriber(H,function(M){Z(function(A){A.window.next(M),X<=++A.seen&&V(A)})},function(){return L(function(M){return M.complete()})},function(M){return L(function(A){return A.error(M)})})),function(){q=null}})}sN.windowTime=y00});var FR=z((C3)=>{var x00=C3&&C3.__values||function(D){var F=typeof Symbol==="function"&&Symbol.iterator,$=F&&D[F],J=0;if($)return $.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&J>=D.length)D=void 0;return{value:D&&D[J++],done:!D}}};throw TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(C3,"__esModule",{value:!0});C3.windowToggle=void 0;var _00=VD(),f00=F1(),g00=x(),eN=Y0(),$B=p(),DR=zD(),h00=P8();function b00(D,F){return g00.operate(function($,J){var Q=[],Y=function(B){while(0<Q.length)Q.shift().error(B);J.error(B)};eN.innerFrom(D).subscribe($B.createOperatorSubscriber(J,function(B){var X=new _00.Subject;Q.push(X);var G=new f00.Subscription,H=function(){h00.arrRemove(Q,X),X.complete(),G.unsubscribe()},q;try{q=eN.innerFrom(F(B))}catch(K){Y(K);return}J.next(X.asObservable()),G.add(q.subscribe($B.createOperatorSubscriber(J,H,DR.noop,Y)))},DR.noop)),$.subscribe($B.createOperatorSubscriber(J,function(B){var X,G,H=Q.slice();try{for(var q=x00(H),K=q.next();!K.done;K=q.next()){var V=K.value;V.next(B)}}catch(E){X={error:E}}finally{try{if(K&&!K.done&&(G=q.return))G.call(q)}finally{if(X)throw X.error}}},function(){while(0<Q.length)Q.shift().complete();J.complete()},Y,function(){while(0<Q.length)Q.shift().unsubscribe()}))})}C3.windowToggle=b00});var YR=z((JR)=>{Object.defineProperty(JR,"__esModule",{value:!0});JR.windowWhen=void 0;var u00=VD(),m00=x(),$R=p(),l00=Y0();function p00(D){return m00.operate(function(F,$){var J,Q,Y=function(X){J.error(X),$.error(X)},B=function(){Q===null||Q===void 0||Q.unsubscribe(),J===null||J===void 0||J.complete(),J=new u00.Subject,$.next(J.asObservable());var X;try{X=l00.innerFrom(D())}catch(G){Y(G);return}X.subscribe(Q=$R.createOperatorSubscriber($,B,B,Y))};B(),F.subscribe($R.createOperatorSubscriber($,function(X){return J.next(X)},function(){J.complete(),$.complete()},Y,function(){Q===null||Q===void 0||Q.unsubscribe(),J=null}))})}JR.windowWhen=p00});var WR=z((M6)=>{var BR=M6&&M6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},XR=M6&&M6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(M6,"__esModule",{value:!0});M6.withLatestFrom=void 0;var d00=x(),GR=p(),c00=Y0(),n00=ED(),i00=zD(),a00=cD();function o00(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];var $=a00.popResultSelector(D);return d00.operate(function(J,Q){var Y=D.length,B=Array(Y),X=D.map(function(){return!1}),G=!1,H=function(K){c00.innerFrom(D[K]).subscribe(GR.createOperatorSubscriber(Q,function(V){if(B[K]=V,!G&&!X[K])X[K]=!0,(G=X.every(n00.identity))&&(X=null)},i00.noop))};for(var q=0;q<Y;q++)H(q);J.subscribe(GR.createOperatorSubscriber(Q,function(K){if(G){var V=XR([K],BR(B));Q.next($?$.apply(void 0,XR([],BR(V))):V)}}))})}M6.withLatestFrom=o00});var KR=z((HR)=>{Object.defineProperty(HR,"__esModule",{value:!0});HR.zipAll=void 0;var s00=V7(),r00=uY();function t00(D){return r00.joinAllInternals(s00.zip,D)}HR.zipAll=t00});var zR=z((N6)=>{var e00=N6&&N6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},DD0=N6&&N6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(N6,"__esModule",{value:!0});N6.zip=void 0;var FD0=V7(),$D0=x();function JD0(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return $D0.operate(function($,J){FD0.zip.apply(void 0,DD0([$],e00(D))).subscribe(J)})}N6.zip=JD0});var ER=z((R6)=>{var QD0=R6&&R6.__read||function(D,F){var $=typeof Symbol==="function"&&D[Symbol.iterator];if(!$)return D;var J=$.call(D),Q,Y=[],B;try{while((F===void 0||F-- >0)&&!(Q=J.next()).done)Y.push(Q.value)}catch(X){B={error:X}}finally{try{if(Q&&!Q.done&&($=J.return))$.call(J)}finally{if(B)throw B.error}}return Y},YD0=R6&&R6.__spreadArray||function(D,F){for(var $=0,J=F.length,Q=D.length;$<J;$++,Q++)D[Q]=F[$];return D};Object.defineProperty(R6,"__esModule",{value:!0});R6.zipWith=void 0;var BD0=zR();function XD0(){var D=[];for(var F=0;F<arguments.length;F++)D[F]=arguments[F];return BD0.zip.apply(void 0,YD0([],QD0(D)))}R6.zipWith=XD0});var $1=z((U)=>{var GD0=U&&U.__createBinding||(Object.create?function(D,F,$,J){if(J===void 0)J=$;Object.defineProperty(D,J,{enumerable:!0,get:function(){return F[$]}})}:function(D,F,$,J){if(J===void 0)J=$;D[J]=F[$]}),WD0=U&&U.__exportStar||function(D,F){for(var $ in D)if($!=="default"&&!Object.prototype.hasOwnProperty.call(F,$))GD0(F,D,$)};Object.defineProperty(U,"__esModule",{value:!0});U.interval=U.iif=U.generate=U.fromEventPattern=U.fromEvent=U.from=U.forkJoin=U.empty=U.defer=U.connectable=U.concat=U.combineLatest=U.bindNodeCallback=U.bindCallback=U.UnsubscriptionError=U.TimeoutError=U.SequenceError=U.ObjectUnsubscribedError=U.NotFoundError=U.EmptyError=U.ArgumentOutOfRangeError=U.firstValueFrom=U.lastValueFrom=U.isObservable=U.identity=U.noop=U.pipe=U.NotificationKind=U.Notification=U.Subscriber=U.Subscription=U.Scheduler=U.VirtualAction=U.VirtualTimeScheduler=U.animationFrameScheduler=U.animationFrame=U.queueScheduler=U.queue=U.asyncScheduler=U.async=U.asapScheduler=U.asap=U.AsyncSubject=U.ReplaySubject=U.BehaviorSubject=U.Subject=U.animationFrames=U.observable=U.ConnectableObservable=U.Observable=void 0;U.filter=U.expand=U.exhaustMap=U.exhaustAll=U.exhaust=U.every=U.endWith=U.elementAt=U.distinctUntilKeyChanged=U.distinctUntilChanged=U.distinct=U.dematerialize=U.delayWhen=U.delay=U.defaultIfEmpty=U.debounceTime=U.debounce=U.count=U.connect=U.concatWith=U.concatMapTo=U.concatMap=U.concatAll=U.combineLatestWith=U.combineLatestAll=U.combineAll=U.catchError=U.bufferWhen=U.bufferToggle=U.bufferTime=U.bufferCount=U.buffer=U.auditTime=U.audit=U.config=U.NEVER=U.EMPTY=U.scheduled=U.zip=U.using=U.timer=U.throwError=U.range=U.race=U.partition=U.pairs=U.onErrorResumeNext=U.of=U.never=U.merge=void 0;U.switchMap=U.switchAll=U.subscribeOn=U.startWith=U.skipWhile=U.skipUntil=U.skipLast=U.skip=U.single=U.shareReplay=U.share=U.sequenceEqual=U.scan=U.sampleTime=U.sample=U.refCount=U.retryWhen=U.retry=U.repeatWhen=U.repeat=U.reduce=U.raceWith=U.publishReplay=U.publishLast=U.publishBehavior=U.publish=U.pluck=U.pairwise=U.onErrorResumeNextWith=U.observeOn=U.multicast=U.min=U.mergeWith=U.mergeScan=U.mergeMapTo=U.mergeMap=U.flatMap=U.mergeAll=U.max=U.materialize=U.mapTo=U.map=U.last=U.isEmpty=U.ignoreElements=U.groupBy=U.first=U.findIndex=U.find=U.finalize=void 0;U.zipWith=U.zipAll=U.withLatestFrom=U.windowWhen=U.windowToggle=U.windowTime=U.windowCount=U.window=U.toArray=U.timestamp=U.timeoutWith=U.timeout=U.timeInterval=U.throwIfEmpty=U.throttleTime=U.throttle=U.tap=U.takeWhile=U.takeUntil=U.takeLast=U.take=U.switchScan=U.switchMapTo=void 0;var HD0=v0();Object.defineProperty(U,"Observable",{enumerable:!0,get:function(){return HD0.Observable}});var qD0=cF();Object.defineProperty(U,"ConnectableObservable",{enumerable:!0,get:function(){return qD0.ConnectableObservable}});var KD0=pF();Object.defineProperty(U,"observable",{enumerable:!0,get:function(){return KD0.observable}});var zD0=OK();Object.defineProperty(U,"animationFrames",{enumerable:!0,get:function(){return zD0.animationFrames}});var ED0=VD();Object.defineProperty(U,"Subject",{enumerable:!0,get:function(){return ED0.Subject}});var VD0=YY();Object.defineProperty(U,"BehaviorSubject",{enumerable:!0,get:function(){return VD0.BehaviorSubject}});var ZD0=J7();Object.defineProperty(U,"ReplaySubject",{enumerable:!0,get:function(){return ZD0.ReplaySubject}});var UD0=Q7();Object.defineProperty(U,"AsyncSubject",{enumerable:!0,get:function(){return UD0.AsyncSubject}});var VR=rK();Object.defineProperty(U,"asap",{enumerable:!0,get:function(){return VR.asap}});Object.defineProperty(U,"asapScheduler",{enumerable:!0,get:function(){return VR.asapScheduler}});var ZR=dD();Object.defineProperty(U,"async",{enumerable:!0,get:function(){return ZR.async}});Object.defineProperty(U,"asyncScheduler",{enumerable:!0,get:function(){return ZR.asyncScheduler}});var UR=Bz();Object.defineProperty(U,"queue",{enumerable:!0,get:function(){return UR.queue}});Object.defineProperty(U,"queueScheduler",{enumerable:!0,get:function(){return UR.queueScheduler}});var LR=zz();Object.defineProperty(U,"animationFrame",{enumerable:!0,get:function(){return LR.animationFrame}});Object.defineProperty(U,"animationFrameScheduler",{enumerable:!0,get:function(){return LR.animationFrameScheduler}});var AR=Zz();Object.defineProperty(U,"VirtualTimeScheduler",{enumerable:!0,get:function(){return AR.VirtualTimeScheduler}});Object.defineProperty(U,"VirtualAction",{enumerable:!0,get:function(){return AR.VirtualAction}});var LD0=GY();Object.defineProperty(U,"Scheduler",{enumerable:!0,get:function(){return LD0.Scheduler}});var AD0=F1();Object.defineProperty(U,"Subscription",{enumerable:!0,get:function(){return AD0.Subscription}});var MD0=s4();Object.defineProperty(U,"Subscriber",{enumerable:!0,get:function(){return MD0.Subscriber}});var MR=W7();Object.defineProperty(U,"Notification",{enumerable:!0,get:function(){return MR.Notification}});Object.defineProperty(U,"NotificationKind",{enumerable:!0,get:function(){return MR.NotificationKind}});var ND0=dF();Object.defineProperty(U,"pipe",{enumerable:!0,get:function(){return ND0.pipe}});var RD0=zD();Object.defineProperty(U,"noop",{enumerable:!0,get:function(){return RD0.noop}});var CD0=ED();Object.defineProperty(U,"identity",{enumerable:!0,get:function(){return CD0.identity}});var OD0=kE();Object.defineProperty(U,"isObservable",{enumerable:!0,get:function(){return OD0.isObservable}});var wD0=fE();Object.defineProperty(U,"lastValueFrom",{enumerable:!0,get:function(){return wD0.lastValueFrom}});var jD0=bE();Object.defineProperty(U,"firstValueFrom",{enumerable:!0,get:function(){return jD0.firstValueFrom}});var TD0=CY();Object.defineProperty(U,"ArgumentOutOfRangeError",{enumerable:!0,get:function(){return TD0.ArgumentOutOfRangeError}});var PD0=Q6();Object.defineProperty(U,"EmptyError",{enumerable:!0,get:function(){return PD0.EmptyError}});var ID0=OY();Object.defineProperty(U,"NotFoundError",{enumerable:!0,get:function(){return ID0.NotFoundError}});var SD0=FY();Object.defineProperty(U,"ObjectUnsubscribedError",{enumerable:!0,get:function(){return SD0.ObjectUnsubscribedError}});var kD0=wY();Object.defineProperty(U,"SequenceError",{enumerable:!0,get:function(){return kD0.SequenceError}});var vD0=q7();Object.defineProperty(U,"TimeoutError",{enumerable:!0,get:function(){return vD0.TimeoutError}});var yD0=mQ();Object.defineProperty(U,"UnsubscriptionError",{enumerable:!0,get:function(){return yD0.UnsubscriptionError}});var xD0=$V();Object.defineProperty(U,"bindCallback",{enumerable:!0,get:function(){return xD0.bindCallback}});var _D0=YV();Object.defineProperty(U,"bindNodeCallback",{enumerable:!0,get:function(){return _D0.bindNodeCallback}});var fD0=K7();Object.defineProperty(U,"combineLatest",{enumerable:!0,get:function(){return fD0.combineLatest}});var gD0=sF();Object.defineProperty(U,"concat",{enumerable:!0,get:function(){return gD0.concat}});var hD0=yV();Object.defineProperty(U,"connectable",{enumerable:!0,get:function(){return hD0.connectable}});var bD0=rF();Object.defineProperty(U,"defer",{enumerable:!0,get:function(){return bD0.defer}});var uD0=S1();Object.defineProperty(U,"empty",{enumerable:!0,get:function(){return uD0.empty}});var mD0=fV();Object.defineProperty(U,"forkJoin",{enumerable:!0,get:function(){return mD0.forkJoin}});var lD0=S8();Object.defineProperty(U,"from",{enumerable:!0,get:function(){return lD0.from}});var pD0=hV();Object.defineProperty(U,"fromEvent",{enumerable:!0,get:function(){return pD0.fromEvent}});var dD0=lV();Object.defineProperty(U,"fromEventPattern",{enumerable:!0,get:function(){return dD0.fromEventPattern}});var cD0=dV();Object.defineProperty(U,"generate",{enumerable:!0,get:function(){return cD0.generate}});var nD0=iV();Object.defineProperty(U,"iif",{enumerable:!0,get:function(){return nD0.iif}});var iD0=kY();Object.defineProperty(U,"interval",{enumerable:!0,get:function(){return iD0.interval}});var aD0=FZ();Object.defineProperty(U,"merge",{enumerable:!0,get:function(){return aD0.merge}});var oD0=vY();Object.defineProperty(U,"never",{enumerable:!0,get:function(){return oD0.never}});var sD0=G7();Object.defineProperty(U,"of",{enumerable:!0,get:function(){return sD0.of}});var rD0=yY();Object.defineProperty(U,"onErrorResumeNext",{enumerable:!0,get:function(){return rD0.onErrorResumeNext}});var tD0=KZ();Object.defineProperty(U,"pairs",{enumerable:!0,get:function(){return tD0.pairs}});var eD0=RZ();Object.defineProperty(U,"partition",{enumerable:!0,get:function(){return eD0.partition}});var D10=xY();Object.defineProperty(U,"race",{enumerable:!0,get:function(){return D10.race}});var F10=IZ();Object.defineProperty(U,"range",{enumerable:!0,get:function(){return F10.range}});var $10=RY();Object.defineProperty(U,"throwError",{enumerable:!0,get:function(){return $10.throwError}});var J10=W6();Object.defineProperty(U,"timer",{enumerable:!0,get:function(){return J10.timer}});var Q10=vZ();Object.defineProperty(U,"using",{enumerable:!0,get:function(){return Q10.using}});var Y10=V7();Object.defineProperty(U,"zip",{enumerable:!0,get:function(){return Y10.zip}});var B10=NY();Object.defineProperty(U,"scheduled",{enumerable:!0,get:function(){return B10.scheduled}});var X10=S1();Object.defineProperty(U,"EMPTY",{enumerable:!0,get:function(){return X10.EMPTY}});var G10=vY();Object.defineProperty(U,"NEVER",{enumerable:!0,get:function(){return G10.NEVER}});WD0(xZ(),U);var W10=o4();Object.defineProperty(U,"config",{enumerable:!0,get:function(){return W10.config}});var H10=_Y();Object.defineProperty(U,"audit",{enumerable:!0,get:function(){return H10.audit}});var q10=uZ();Object.defineProperty(U,"auditTime",{enumerable:!0,get:function(){return q10.auditTime}});var K10=dZ();Object.defineProperty(U,"buffer",{enumerable:!0,get:function(){return K10.buffer}});var z10=cZ();Object.defineProperty(U,"bufferCount",{enumerable:!0,get:function(){return z10.bufferCount}});var E10=iZ();Object.defineProperty(U,"bufferTime",{enumerable:!0,get:function(){return E10.bufferTime}});var V10=sZ();Object.defineProperty(U,"bufferToggle",{enumerable:!0,get:function(){return V10.bufferToggle}});var Z10=DU();Object.defineProperty(U,"bufferWhen",{enumerable:!0,get:function(){return Z10.bufferWhen}});var U10=QU();Object.defineProperty(U,"catchError",{enumerable:!0,get:function(){return U10.catchError}});var L10=UU();Object.defineProperty(U,"combineAll",{enumerable:!0,get:function(){return L10.combineAll}});var A10=mY();Object.defineProperty(U,"combineLatestAll",{enumerable:!0,get:function(){return A10.combineLatestAll}});var M10=RU();Object.defineProperty(U,"combineLatestWith",{enumerable:!0,get:function(){return M10.combineLatestWith}});var N10=E7();Object.defineProperty(U,"concatAll",{enumerable:!0,get:function(){return N10.concatAll}});var R10=lY();Object.defineProperty(U,"concatMap",{enumerable:!0,get:function(){return R10.concatMap}});var C10=IU();Object.defineProperty(U,"concatMapTo",{enumerable:!0,get:function(){return C10.concatMapTo}});var O10=kU();Object.defineProperty(U,"concatWith",{enumerable:!0,get:function(){return O10.concatWith}});var w10=Z7();Object.defineProperty(U,"connect",{enumerable:!0,get:function(){return w10.connect}});var j10=bU();Object.defineProperty(U,"count",{enumerable:!0,get:function(){return j10.count}});var T10=pU();Object.defineProperty(U,"debounce",{enumerable:!0,get:function(){return T10.debounce}});var P10=nU();Object.defineProperty(U,"debounceTime",{enumerable:!0,get:function(){return P10.debounceTime}});var I10=tF();Object.defineProperty(U,"defaultIfEmpty",{enumerable:!0,get:function(){return I10.defaultIfEmpty}});var S10=XL();Object.defineProperty(U,"delay",{enumerable:!0,get:function(){return S10.delay}});var k10=cY();Object.defineProperty(U,"delayWhen",{enumerable:!0,get:function(){return k10.delayWhen}});var v10=HL();Object.defineProperty(U,"dematerialize",{enumerable:!0,get:function(){return v10.dematerialize}});var y10=EL();Object.defineProperty(U,"distinct",{enumerable:!0,get:function(){return y10.distinct}});var x10=nY();Object.defineProperty(U,"distinctUntilChanged",{enumerable:!0,get:function(){return x10.distinctUntilChanged}});var _10=AL();Object.defineProperty(U,"distinctUntilKeyChanged",{enumerable:!0,get:function(){return _10.distinctUntilKeyChanged}});var f10=wL();Object.defineProperty(U,"elementAt",{enumerable:!0,get:function(){return f10.elementAt}});var g10=jL();Object.defineProperty(U,"endWith",{enumerable:!0,get:function(){return g10.endWith}});var h10=IL();Object.defineProperty(U,"every",{enumerable:!0,get:function(){return h10.every}});var b10=bL();Object.defineProperty(U,"exhaust",{enumerable:!0,get:function(){return b10.exhaust}});var u10=aY();Object.defineProperty(U,"exhaustAll",{enumerable:!0,get:function(){return u10.exhaustAll}});var m10=iY();Object.defineProperty(U,"exhaustMap",{enumerable:!0,get:function(){return m10.exhaustMap}});var l10=lL();Object.defineProperty(U,"expand",{enumerable:!0,get:function(){return l10.expand}});var p10=D4();Object.defineProperty(U,"filter",{enumerable:!0,get:function(){return p10.filter}});var d10=cL();Object.defineProperty(U,"finalize",{enumerable:!0,get:function(){return d10.finalize}});var c10=oY();Object.defineProperty(U,"find",{enumerable:!0,get:function(){return c10.find}});var n10=rL();Object.defineProperty(U,"findIndex",{enumerable:!0,get:function(){return n10.findIndex}});var i10=DA();Object.defineProperty(U,"first",{enumerable:!0,get:function(){return i10.first}});var a10=QA();Object.defineProperty(U,"groupBy",{enumerable:!0,get:function(){return a10.groupBy}});var o10=pY();Object.defineProperty(U,"ignoreElements",{enumerable:!0,get:function(){return o10.ignoreElements}});var s10=XA();Object.defineProperty(U,"isEmpty",{enumerable:!0,get:function(){return s10.isEmpty}});var r10=HA();Object.defineProperty(U,"last",{enumerable:!0,get:function(){return r10.last}});var t10=Y6();Object.defineProperty(U,"map",{enumerable:!0,get:function(){return t10.map}});var e10=dY();Object.defineProperty(U,"mapTo",{enumerable:!0,get:function(){return e10.mapTo}});var D80=zA();Object.defineProperty(U,"materialize",{enumerable:!0,get:function(){return D80.materialize}});var F80=ZA();Object.defineProperty(U,"max",{enumerable:!0,get:function(){return F80.max}});var $80=oF();Object.defineProperty(U,"mergeAll",{enumerable:!0,get:function(){return $80.mergeAll}});var J80=AA();Object.defineProperty(U,"flatMap",{enumerable:!0,get:function(){return J80.flatMap}});var Q80=k8();Object.defineProperty(U,"mergeMap",{enumerable:!0,get:function(){return Q80.mergeMap}});var Y80=CA();Object.defineProperty(U,"mergeMapTo",{enumerable:!0,get:function(){return Y80.mergeMapTo}});var B80=jA();Object.defineProperty(U,"mergeScan",{enumerable:!0,get:function(){return B80.mergeScan}});var X80=IA();Object.defineProperty(U,"mergeWith",{enumerable:!0,get:function(){return X80.mergeWith}});var G80=vA();Object.defineProperty(U,"min",{enumerable:!0,get:function(){return G80.min}});var W80=U7();Object.defineProperty(U,"multicast",{enumerable:!0,get:function(){return W80.multicast}});var H80=iF();Object.defineProperty(U,"observeOn",{enumerable:!0,get:function(){return H80.observeOn}});var q80=gA();Object.defineProperty(U,"onErrorResumeNextWith",{enumerable:!0,get:function(){return q80.onErrorResumeNextWith}});var K80=uA();Object.defineProperty(U,"pairwise",{enumerable:!0,get:function(){return K80.pairwise}});var z80=pA();Object.defineProperty(U,"pluck",{enumerable:!0,get:function(){return z80.pluck}});var E80=nA();Object.defineProperty(U,"publish",{enumerable:!0,get:function(){return E80.publish}});var V80=oA();Object.defineProperty(U,"publishBehavior",{enumerable:!0,get:function(){return V80.publishBehavior}});var Z80=tA();Object.defineProperty(U,"publishLast",{enumerable:!0,get:function(){return Z80.publishLast}});var U80=$M();Object.defineProperty(U,"publishReplay",{enumerable:!0,get:function(){return U80.publishReplay}});var L80=JM();Object.defineProperty(U,"raceWith",{enumerable:!0,get:function(){return L80.raceWith}});var A80=M3();Object.defineProperty(U,"reduce",{enumerable:!0,get:function(){return A80.reduce}});var M80=XM();Object.defineProperty(U,"repeat",{enumerable:!0,get:function(){return M80.repeat}});var N80=qM();Object.defineProperty(U,"repeatWhen",{enumerable:!0,get:function(){return N80.repeatWhen}});var R80=VM();Object.defineProperty(U,"retry",{enumerable:!0,get:function(){return R80.retry}});var C80=AM();Object.defineProperty(U,"retryWhen",{enumerable:!0,get:function(){return C80.retryWhen}});var O80=tQ();Object.defineProperty(U,"refCount",{enumerable:!0,get:function(){return O80.refCount}});var w80=tY();Object.defineProperty(U,"sample",{enumerable:!0,get:function(){return w80.sample}});var j80=wM();Object.defineProperty(U,"sampleTime",{enumerable:!0,get:function(){return j80.sampleTime}});var T80=PM();Object.defineProperty(U,"scan",{enumerable:!0,get:function(){return T80.scan}});var P80=vM();Object.defineProperty(U,"sequenceEqual",{enumerable:!0,get:function(){return P80.sequenceEqual}});var I80=DB();Object.defineProperty(U,"share",{enumerable:!0,get:function(){return I80.share}});var S80=gM();Object.defineProperty(U,"shareReplay",{enumerable:!0,get:function(){return S80.shareReplay}});var k80=uM();Object.defineProperty(U,"single",{enumerable:!0,get:function(){return k80.single}});var v80=pM();Object.defineProperty(U,"skip",{enumerable:!0,get:function(){return v80.skip}});var y80=nM();Object.defineProperty(U,"skipLast",{enumerable:!0,get:function(){return y80.skipLast}});var x80=sM();Object.defineProperty(U,"skipUntil",{enumerable:!0,get:function(){return x80.skipUntil}});var _80=eM();Object.defineProperty(U,"skipWhile",{enumerable:!0,get:function(){return _80.skipWhile}});var f80=JN();Object.defineProperty(U,"startWith",{enumerable:!0,get:function(){return f80.startWith}});var g80=aF();Object.defineProperty(U,"subscribeOn",{enumerable:!0,get:function(){return g80.subscribeOn}});var h80=WN();Object.defineProperty(U,"switchAll",{enumerable:!0,get:function(){return h80.switchAll}});var b80=F5();Object.defineProperty(U,"switchMap",{enumerable:!0,get:function(){return b80.switchMap}});var u80=zN();Object.defineProperty(U,"switchMapTo",{enumerable:!0,get:function(){return u80.switchMapTo}});var m80=ZN();Object.defineProperty(U,"switchScan",{enumerable:!0,get:function(){return m80.switchScan}});var l80=eF();Object.defineProperty(U,"take",{enumerable:!0,get:function(){return l80.take}});var p80=sY();Object.defineProperty(U,"takeLast",{enumerable:!0,get:function(){return p80.takeLast}});var d80=AN();Object.defineProperty(U,"takeUntil",{enumerable:!0,get:function(){return d80.takeUntil}});var c80=RN();Object.defineProperty(U,"takeWhile",{enumerable:!0,get:function(){return c80.takeWhile}});var n80=wN();Object.defineProperty(U,"tap",{enumerable:!0,get:function(){return n80.tap}});var i80=FB();Object.defineProperty(U,"throttle",{enumerable:!0,get:function(){return i80.throttle}});var a80=kN();Object.defineProperty(U,"throttleTime",{enumerable:!0,get:function(){return a80.throttleTime}});var o80=D5();Object.defineProperty(U,"throwIfEmpty",{enumerable:!0,get:function(){return o80.throwIfEmpty}});var s80=_N();Object.defineProperty(U,"timeInterval",{enumerable:!0,get:function(){return s80.timeInterval}});var r80=q7();Object.defineProperty(U,"timeout",{enumerable:!0,get:function(){return r80.timeout}});var t80=hN();Object.defineProperty(U,"timeoutWith",{enumerable:!0,get:function(){return t80.timeoutWith}});var e80=mN();Object.defineProperty(U,"timestamp",{enumerable:!0,get:function(){return e80.timestamp}});var D60=bY();Object.defineProperty(U,"toArray",{enumerable:!0,get:function(){return D60.toArray}});var F60=nN();Object.defineProperty(U,"window",{enumerable:!0,get:function(){return F60.window}});var $60=aN();Object.defineProperty(U,"windowCount",{enumerable:!0,get:function(){return $60.windowCount}});var J60=tN();Object.defineProperty(U,"windowTime",{enumerable:!0,get:function(){return J60.windowTime}});var Q60=FR();Object.defineProperty(U,"windowToggle",{enumerable:!0,get:function(){return Q60.windowToggle}});var Y60=YR();Object.defineProperty(U,"windowWhen",{enumerable:!0,get:function(){return Y60.windowWhen}});var B60=WR();Object.defineProperty(U,"withLatestFrom",{enumerable:!0,get:function(){return B60.withLatestFrom}});var X60=KR();Object.defineProperty(U,"zipAll",{enumerable:!0,get:function(){return X60.zipAll}});var G60=ER();Object.defineProperty(U,"zipWith",{enumerable:!0,get:function(){return G60.zipWith}})});function W60(D,F){return{value:D,key:F||{}}}function ZD(D){let F=a0.fromEvent(D.input,"keypress",W60).pipe(a0.takeUntil(a0.fromEvent(D,"close"))).pipe(a0.filter(({key:$})=>$.name!=="enter"&&$.name!=="return"));return{line:a0.fromEvent(D,"line"),keypress:F,normalizedUpKey:F.pipe(a0.filter(({key:$})=>$.name==="up"||$.name==="k"||$.name==="p"&&$.ctrl),a0.share()),normalizedDownKey:F.pipe(a0.filter(({key:$})=>$.name==="down"||$.name==="j"||$.name==="n"&&$.ctrl),a0.share()),numberKey:F.pipe(a0.filter(($)=>$.value&&"123456789".includes($.value)),a0.map(($)=>Number($.value)),a0.share()),spaceKey:F.pipe(a0.filter(({key:$})=>$&&$.name==="space"),a0.share()),aKey:F.pipe(a0.filter(({key:$})=>$&&$.name==="a"),a0.share()),iKey:F.pipe(a0.filter(({key:$})=>$&&$.name==="i"),a0.share())}}var a0;var v8=I(()=>{a0=s($1(),1)});class B8{constructor(D,F={}){let{isInfinite:$=!0}=F;this.lastIndex=0,this.screen=D,this.isInfinite=$}paginate(D,F,$){$||=7;let J=D.split(`
32
32
  `);if(this.screen)J=this.screen.breakLines(J),F=J.map((Y)=>Y.length).splice(0,F).reduce((Y,B)=>Y+B,0),J=J.flat();if(J.length<=$)return D;let Q=this.isInfinite?this.getInfiniteLines(J,F,$):this.getFiniteLines(J,F,$);return this.lastIndex=F,Q.join(`
33
33
  `)+`
34
34
  `+NR.default.dim("(Move up and down to reveal more choices)")}getInfiniteLines(D,F,$){if(this.pointer===void 0)this.pointer=0;let J=Math.floor($/2);if(this.pointer<J&&this.lastIndex<F&&F-this.lastIndex<$)this.pointer=Math.min(J,this.pointer+F-this.lastIndex);let Q=[D,D,D].flat(),Y=Math.max(0,F+D.length-this.pointer);return Q.splice(Y,$)}getFiniteLines(D,F,$){let J=F-$/2;if(J<0)J=0;else if(J+$>D.length)J=D.length-$;return D.splice(J,$)}}var NR;var $5=I(()=>{NR=s(q1(),1)});function y8(D,F,$){let J=$.choices.realLength,Q="loop"in $?Boolean($.loop):!0;if(F==="up"){if(D>0)return D-1;return Q?J-1:D}if(F==="down"){if(D<J-1)return D+1;return Q?0:D}throw Error("dir must be up or down")}class J1{constructor(D){this.type="separator",this.line=RR.default.dim(D||Array.from({length:15}).join(D6.line))}static exclude(D){return D.type!=="separator"}toString(){return this.line}}var RR;var J5=I(()=>{t9();RR=s(q1(),1)});class O3{constructor(D,F){if(D instanceof O3||D.type==="separator")return D;if(typeof D==="string"||typeof D==="number")this.name=String(D),this.value=D,this.short=String(D);else Object.assign(this,D,{name:D.name||D.value,value:"value"in D?D.value:D.name,short:D.short||D.name||D.value});this.disabled=typeof D.disabled==="function"?D.disabled(F):D.disabled}}import CR from"assert";var L7;var OR=I(()=>{J5();L7=class L7{constructor(D,F){this.choices=D.map(($)=>{if($.type==="separator"){if(!($ instanceof J1))$=new J1($.line);return $}return new O3($,F)}),this.realChoices=this.choices.filter(J1.exclude).filter(($)=>!$.disabled),Object.defineProperty(this,"length",{get(){return this.choices.length},set($){this.choices.length=$}}),Object.defineProperty(this,"realLength",{get(){return this.realChoices.length},set(){throw Error("Cannot set `realLength` of a Choices collection")}})}[Symbol.iterator](){let D=this.choices,F=-1;return{next:()=>({value:D[++F],done:!(F in D)})}}getChoice(D){return CR(typeof D==="number"),this.realChoices[D]}get(D){return CR(typeof D==="number"),this.choices[D]}where(D){let F;if(typeof D==="function")F=D;else{let[$,J]=Object.entries(D)[0];F=(Q)=>Q[$]===J}return this.realChoices.filter(F)}pluck(D){return this.realChoices.map((F)=>F[D])}indexOf(...D){return this.choices.indexOf(...D)}forEach(...D){return this.choices.forEach(...D)}filter(...D){return this.choices.filter(...D)}reduce(...D){return this.choices.reduce(...D)}find(D){return this.choices.find(D)}some(D){return this.choices.some(D)}push(...D){let F=D.map(($)=>new O3($));return this.choices.push(...F),this.realChoices=this.choices.filter(J1.exclude).filter(($)=>!$.disabled),this.choices}}});var jR=z((LN0,wR)=>{wR.exports=q60;function H60(D){let F={defaultWidth:0,output:process.stdout,tty:K0("tty")};if(!D)return F;return Object.keys(F).forEach(function($){if(!D[$])D[$]=F[$]}),D}function q60(D){let F=H60(D);if(F.output.getWindowSize)return F.output.getWindowSize()[0]||F.defaultWidth;if(F.tty.getWindowSize)return F.tty.getWindowSize()[1]||F.defaultWidth;if(F.output.columns)return F.output.columns;if(process.env.CLI_WIDTH){let $=parseInt(process.env.CLI_WIDTH,10);if(!isNaN($)&&$!==0)return $}return F.defaultWidth}});var PR=z((AN0,TR)=>{TR.exports=({onlyFirst:D=!1}={})=>{let F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(F,D?void 0:"g")}});var Q5=z((MN0,IR)=>{var K60=PR();IR.exports=(D)=>typeof D==="string"?D.replace(K60(),""):D});var kR=z((NN0,JB)=>{var SR=(D)=>{if(Number.isNaN(D))return!1;if(D>=4352&&(D<=4447||D===9001||D===9002||11904<=D&&D<=12871&&D!==12351||12880<=D&&D<=19903||19968<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65131||65281<=D&&D<=65376||65504<=D&&D<=65510||110592<=D&&D<=110593||127488<=D&&D<=127569||131072<=D&&D<=262141))return!0;return!1};JB.exports=SR;JB.exports.default=SR});var yR=z((RN0,vR)=>{vR.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var YB=z((CN0,QB)=>{var z60=Q5(),E60=kR(),V60=yR(),xR=(D)=>{if(typeof D!=="string"||D.length===0)return 0;if(D=z60(D),D.length===0)return 0;D=D.replace(V60()," ");let F=0;for(let $=0;$<D.length;$++){let J=D.codePointAt($);if(J<=31||J>=127&&J<=159)continue;if(J>=768&&J<=879)continue;if(J>65535)$++;F+=E60(J)?2:1}return F};QB.exports=xR;QB.exports.default=xR});var fR=z((ON0,_R)=>{_R.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var BB=z((wN0,hR)=>{var Y5=fR(),gR={};for(let D of Object.keys(Y5))gR[Y5[D]]=D;var m={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};hR.exports=m;for(let D of Object.keys(m)){if(!("channels"in m[D]))throw Error("missing channels property: "+D);if(!("labels"in m[D]))throw Error("missing channel labels property: "+D);if(m[D].labels.length!==m[D].channels)throw Error("channel and label counts mismatch: "+D);let{channels:F,labels:$}=m[D];delete m[D].channels,delete m[D].labels,Object.defineProperty(m[D],"channels",{value:F}),Object.defineProperty(m[D],"labels",{value:$})}m.rgb.hsl=function(D){let F=D[0]/255,$=D[1]/255,J=D[2]/255,Q=Math.min(F,$,J),Y=Math.max(F,$,J),B=Y-Q,X,G;if(Y===Q)X=0;else if(F===Y)X=($-J)/B;else if($===Y)X=2+(J-F)/B;else if(J===Y)X=4+(F-$)/B;if(X=Math.min(X*60,360),X<0)X+=360;let H=(Q+Y)/2;if(Y===Q)G=0;else if(H<=0.5)G=B/(Y+Q);else G=B/(2-Y-Q);return[X,G*100,H*100]};m.rgb.hsv=function(D){let F,$,J,Q,Y,B=D[0]/255,X=D[1]/255,G=D[2]/255,H=Math.max(B,X,G),q=H-Math.min(B,X,G),K=function(V){return(H-V)/6/q+0.5};if(q===0)Q=0,Y=0;else{if(Y=q/H,F=K(B),$=K(X),J=K(G),B===H)Q=J-$;else if(X===H)Q=0.3333333333333333+F-J;else if(G===H)Q=0.6666666666666666+$-F;if(Q<0)Q+=1;else if(Q>1)Q-=1}return[Q*360,Y*100,H*100]};m.rgb.hwb=function(D){let F=D[0],$=D[1],J=D[2],Q=m.rgb.hsl(D)[0],Y=0.00392156862745098*Math.min(F,Math.min($,J));return J=1-0.00392156862745098*Math.max(F,Math.max($,J)),[Q,Y*100,J*100]};m.rgb.cmyk=function(D){let F=D[0]/255,$=D[1]/255,J=D[2]/255,Q=Math.min(1-F,1-$,1-J),Y=(1-F-Q)/(1-Q)||0,B=(1-$-Q)/(1-Q)||0,X=(1-J-Q)/(1-Q)||0;return[Y*100,B*100,X*100,Q*100]};function Z60(D,F){return(D[0]-F[0])**2+(D[1]-F[1])**2+(D[2]-F[2])**2}m.rgb.keyword=function(D){let F=gR[D];if(F)return F;let $=1/0,J;for(let Q of Object.keys(Y5)){let Y=Y5[Q],B=Z60(D,Y);if(B<$)$=B,J=Q}return J};m.keyword.rgb=function(D){return Y5[D]};m.rgb.xyz=function(D){let F=D[0]/255,$=D[1]/255,J=D[2]/255;F=F>0.04045?((F+0.055)/1.055)**2.4:F/12.92,$=$>0.04045?(($+0.055)/1.055)**2.4:$/12.92,J=J>0.04045?((J+0.055)/1.055)**2.4:J/12.92;let Q=F*0.4124+$*0.3576+J*0.1805,Y=F*0.2126+$*0.7152+J*0.0722,B=F*0.0193+$*0.1192+J*0.9505;return[Q*100,Y*100,B*100]};m.rgb.lab=function(D){let F=m.rgb.xyz(D),$=F[0],J=F[1],Q=F[2];$/=95.047,J/=100,Q/=108.883,$=$>0.008856?$**0.3333333333333333:7.787*$+0.13793103448275862,J=J>0.008856?J**0.3333333333333333:7.787*J+0.13793103448275862,Q=Q>0.008856?Q**0.3333333333333333:7.787*Q+0.13793103448275862;let Y=116*J-16,B=500*($-J),X=200*(J-Q);return[Y,B,X]};m.hsl.rgb=function(D){let F=D[0]/360,$=D[1]/100,J=D[2]/100,Q,Y,B;if($===0)return B=J*255,[B,B,B];if(J<0.5)Q=J*(1+$);else Q=J+$-J*$;let X=2*J-Q,G=[0,0,0];for(let H=0;H<3;H++){if(Y=F+0.3333333333333333*-(H-1),Y<0)Y++;if(Y>1)Y--;if(6*Y<1)B=X+(Q-X)*6*Y;else if(2*Y<1)B=Q;else if(3*Y<2)B=X+(Q-X)*(0.6666666666666666-Y)*6;else B=X;G[H]=B*255}return G};m.hsl.hsv=function(D){let F=D[0],$=D[1]/100,J=D[2]/100,Q=$,Y=Math.max(J,0.01);J*=2,$*=J<=1?J:2-J,Q*=Y<=1?Y:2-Y;let B=(J+$)/2,X=J===0?2*Q/(Y+Q):2*$/(J+$);return[F,X*100,B*100]};m.hsv.rgb=function(D){let F=D[0]/60,$=D[1]/100,J=D[2]/100,Q=Math.floor(F)%6,Y=F-Math.floor(F),B=255*J*(1-$),X=255*J*(1-$*Y),G=255*J*(1-$*(1-Y));switch(J*=255,Q){case 0:return[J,G,B];case 1:return[X,J,B];case 2:return[B,J,G];case 3:return[B,X,J];case 4:return[G,B,J];case 5:return[J,B,X]}};m.hsv.hsl=function(D){let F=D[0],$=D[1]/100,J=D[2]/100,Q=Math.max(J,0.01),Y,B;B=(2-$)*J;let X=(2-$)*Q;return Y=$*Q,Y/=X<=1?X:2-X,Y=Y||0,B/=2,[F,Y*100,B*100]};m.hwb.rgb=function(D){let F=D[0]/360,$=D[1]/100,J=D[2]/100,Q=$+J,Y;if(Q>1)$/=Q,J/=Q;let B=Math.floor(6*F),X=1-J;if(Y=6*F-B,(B&1)!==0)Y=1-Y;let G=$+Y*(X-$),H,q,K;switch(B){default:case 6:case 0:H=X,q=G,K=$;break;case 1:H=G,q=X,K=$;break;case 2:H=$,q=X,K=G;break;case 3:H=$,q=G,K=X;break;case 4:H=G,q=$,K=X;break;case 5:H=X,q=$,K=G;break}return[H*255,q*255,K*255]};m.cmyk.rgb=function(D){let F=D[0]/100,$=D[1]/100,J=D[2]/100,Q=D[3]/100,Y=1-Math.min(1,F*(1-Q)+Q),B=1-Math.min(1,$*(1-Q)+Q),X=1-Math.min(1,J*(1-Q)+Q);return[Y*255,B*255,X*255]};m.xyz.rgb=function(D){let F=D[0]/100,$=D[1]/100,J=D[2]/100,Q,Y,B;return Q=F*3.2406+$*-1.5372+J*-0.4986,Y=F*-0.9689+$*1.8758+J*0.0415,B=F*0.0557+$*-0.204+J*1.057,Q=Q>0.0031308?1.055*Q**0.4166666666666667-0.055:Q*12.92,Y=Y>0.0031308?1.055*Y**0.4166666666666667-0.055:Y*12.92,B=B>0.0031308?1.055*B**0.4166666666666667-0.055:B*12.92,Q=Math.min(Math.max(0,Q),1),Y=Math.min(Math.max(0,Y),1),B=Math.min(Math.max(0,B),1),[Q*255,Y*255,B*255]};m.xyz.lab=function(D){let F=D[0],$=D[1],J=D[2];F/=95.047,$/=100,J/=108.883,F=F>0.008856?F**0.3333333333333333:7.787*F+0.13793103448275862,$=$>0.008856?$**0.3333333333333333:7.787*$+0.13793103448275862,J=J>0.008856?J**0.3333333333333333:7.787*J+0.13793103448275862;let Q=116*$-16,Y=500*(F-$),B=200*($-J);return[Q,Y,B]};m.lab.xyz=function(D){let F=D[0],$=D[1],J=D[2],Q,Y,B;Y=(F+16)/116,Q=$/500+Y,B=Y-J/200;let X=Y**3,G=Q**3,H=B**3;return Y=X>0.008856?X:(Y-0.13793103448275862)/7.787,Q=G>0.008856?G:(Q-0.13793103448275862)/7.787,B=H>0.008856?H:(B-0.13793103448275862)/7.787,Q*=95.047,Y*=100,B*=108.883,[Q,Y,B]};m.lab.lch=function(D){let F=D[0],$=D[1],J=D[2],Q;if(Q=Math.atan2(J,$)*360/2/Math.PI,Q<0)Q+=360;let B=Math.sqrt($*$+J*J);return[F,B,Q]};m.lch.lab=function(D){let F=D[0],$=D[1],Q=D[2]/360*2*Math.PI,Y=$*Math.cos(Q),B=$*Math.sin(Q);return[F,Y,B]};m.rgb.ansi16=function(D,F=null){let[$,J,Q]=D,Y=F===null?m.rgb.hsv(D)[2]:F;if(Y=Math.round(Y/50),Y===0)return 30;let B=30+(Math.round(Q/255)<<2|Math.round(J/255)<<1|Math.round($/255));if(Y===2)B+=60;return B};m.hsv.ansi16=function(D){return m.rgb.ansi16(m.hsv.rgb(D),D[2])};m.rgb.ansi256=function(D){let F=D[0],$=D[1],J=D[2];if(F===$&&$===J){if(F<8)return 16;if(F>248)return 231;return Math.round((F-8)/247*24)+232}return 16+36*Math.round(F/255*5)+6*Math.round($/255*5)+Math.round(J/255*5)};m.ansi16.rgb=function(D){let F=D%10;if(F===0||F===7){if(D>50)F+=3.5;return F=F/10.5*255,[F,F,F]}let $=(~~(D>50)+1)*0.5,J=(F&1)*$*255,Q=(F>>1&1)*$*255,Y=(F>>2&1)*$*255;return[J,Q,Y]};m.ansi256.rgb=function(D){if(D>=232){let Y=(D-232)*10+8;return[Y,Y,Y]}D-=16;let F,$=Math.floor(D/36)/5*255,J=Math.floor((F=D%36)/6)/5*255,Q=F%6/5*255;return[$,J,Q]};m.rgb.hex=function(D){let $=(((Math.round(D[0])&255)<<16)+((Math.round(D[1])&255)<<8)+(Math.round(D[2])&255)).toString(16).toUpperCase();return"000000".substring($.length)+$};m.hex.rgb=function(D){let F=D.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!F)return[0,0,0];let $=F[0];if(F[0].length===3)$=$.split("").map((X)=>{return X+X}).join("");let J=parseInt($,16),Q=J>>16&255,Y=J>>8&255,B=J&255;return[Q,Y,B]};m.rgb.hcg=function(D){let F=D[0]/255,$=D[1]/255,J=D[2]/255,Q=Math.max(Math.max(F,$),J),Y=Math.min(Math.min(F,$),J),B=Q-Y,X,G;if(B<1)X=Y/(1-B);else X=0;if(B<=0)G=0;else if(Q===F)G=($-J)/B%6;else if(Q===$)G=2+(J-F)/B;else G=4+(F-$)/B;return G/=6,G%=1,[G*360,B*100,X*100]};m.hsl.hcg=function(D){let F=D[1]/100,$=D[2]/100,J=$<0.5?2*F*$:2*F*(1-$),Q=0;if(J<1)Q=($-0.5*J)/(1-J);return[D[0],J*100,Q*100]};m.hsv.hcg=function(D){let F=D[1]/100,$=D[2]/100,J=F*$,Q=0;if(J<1)Q=($-J)/(1-J);return[D[0],J*100,Q*100]};m.hcg.rgb=function(D){let F=D[0]/360,$=D[1]/100,J=D[2]/100;if($===0)return[J*255,J*255,J*255];let Q=[0,0,0],Y=F%1*6,B=Y%1,X=1-B,G=0;switch(Math.floor(Y)){case 0:Q[0]=1,Q[1]=B,Q[2]=0;break;case 1:Q[0]=X,Q[1]=1,Q[2]=0;break;case 2:Q[0]=0,Q[1]=1,Q[2]=B;break;case 3:Q[0]=0,Q[1]=X,Q[2]=1;break;case 4:Q[0]=B,Q[1]=0,Q[2]=1;break;default:Q[0]=1,Q[1]=0,Q[2]=X}return G=(1-$)*J,[($*Q[0]+G)*255,($*Q[1]+G)*255,($*Q[2]+G)*255]};m.hcg.hsv=function(D){let F=D[1]/100,$=D[2]/100,J=F+$*(1-F),Q=0;if(J>0)Q=F/J;return[D[0],Q*100,J*100]};m.hcg.hsl=function(D){let F=D[1]/100,J=D[2]/100*(1-F)+0.5*F,Q=0;if(J>0&&J<0.5)Q=F/(2*J);else if(J>=0.5&&J<1)Q=F/(2*(1-J));return[D[0],Q*100,J*100]};m.hcg.hwb=function(D){let F=D[1]/100,$=D[2]/100,J=F+$*(1-F);return[D[0],(J-F)*100,(1-J)*100]};m.hwb.hcg=function(D){let F=D[1]/100,J=1-D[2]/100,Q=J-F,Y=0;if(Q<1)Y=(J-Q)/(1-Q);return[D[0],Q*100,Y*100]};m.apple.rgb=function(D){return[D[0]/65535*255,D[1]/65535*255,D[2]/65535*255]};m.rgb.apple=function(D){return[D[0]/255*65535,D[1]/255*65535,D[2]/255*65535]};m.gray.rgb=function(D){return[D[0]/100*255,D[0]/100*255,D[0]/100*255]};m.gray.hsl=function(D){return[0,0,D[0]]};m.gray.hsv=m.gray.hsl;m.gray.hwb=function(D){return[0,100,D[0]]};m.gray.cmyk=function(D){return[0,0,0,D[0]]};m.gray.lab=function(D){return[D[0],0,0]};m.gray.hex=function(D){let F=Math.round(D[0]/100*255)&255,J=((F<<16)+(F<<8)+F).toString(16).toUpperCase();return"000000".substring(J.length)+J};m.rgb.gray=function(D){return[(D[0]+D[1]+D[2])/3/255*100]}});var uR=z((jN0,bR)=>{var A7=BB();function U60(){let D={},F=Object.keys(A7);for(let $=F.length,J=0;J<$;J++)D[F[J]]={distance:-1,parent:null};return D}function L60(D){let F=U60(),$=[D];F[D].distance=0;while($.length){let J=$.pop(),Q=Object.keys(A7[J]);for(let Y=Q.length,B=0;B<Y;B++){let X=Q[B],G=F[X];if(G.distance===-1)G.distance=F[J].distance+1,G.parent=J,$.unshift(X)}}return F}function A60(D,F){return function($){return F(D($))}}function M60(D,F){let $=[F[D].parent,D],J=A7[F[D].parent][D],Q=F[D].parent;while(F[Q].parent)$.unshift(F[Q].parent),J=A60(A7[F[Q].parent][Q],J),Q=F[Q].parent;return J.conversion=$,J}bR.exports=function(D){let F=L60(D),$={},J=Object.keys(F);for(let Q=J.length,Y=0;Y<Q;Y++){let B=J[Y];if(F[B].parent===null)continue;$[B]=M60(B,F)}return $}});var lR=z((TN0,mR)=>{var XB=BB(),N60=uR(),w3={},R60=Object.keys(XB);function C60(D){let F=function(...$){let J=$[0];if(J===void 0||J===null)return J;if(J.length>1)$=J;return D($)};if("conversion"in D)F.conversion=D.conversion;return F}function O60(D){let F=function(...$){let J=$[0];if(J===void 0||J===null)return J;if(J.length>1)$=J;let Q=D($);if(typeof Q==="object")for(let Y=Q.length,B=0;B<Y;B++)Q[B]=Math.round(Q[B]);return Q};if("conversion"in D)F.conversion=D.conversion;return F}R60.forEach((D)=>{w3[D]={},Object.defineProperty(w3[D],"channels",{value:XB[D].channels}),Object.defineProperty(w3[D],"labels",{value:XB[D].labels});let F=N60(D);Object.keys(F).forEach((J)=>{let Q=F[J];w3[D][J]=O60(Q),w3[D][J].raw=C60(Q)})});mR.exports=w3});var WB=z((PN0,iR)=>{var pR=(D,F)=>(...$)=>{return`\x1B[${D(...$)+F}m`},dR=(D,F)=>(...$)=>{let J=D(...$);return`\x1B[${38+F};5;${J}m`},cR=(D,F)=>(...$)=>{let J=D(...$);return`\x1B[${38+F};2;${J[0]};${J[1]};${J[2]}m`},M7=(D)=>D,nR=(D,F,$)=>[D,F,$],j3=(D,F,$)=>{Object.defineProperty(D,F,{get:()=>{let J=$();return Object.defineProperty(D,F,{value:J,enumerable:!0,configurable:!0}),J},enumerable:!0,configurable:!0})},GB,T3=(D,F,$,J)=>{if(GB===void 0)GB=lR();let Q=J?10:0,Y={};for(let[B,X]of Object.entries(GB)){let G=B==="ansi16"?"ansi":B;if(B===F)Y[G]=D($,Q);else if(typeof X==="object")Y[G]=D(X[F],Q)}return Y};function w60(){let D=new Map,F={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};F.color.gray=F.color.blackBright,F.bgColor.bgGray=F.bgColor.bgBlackBright,F.color.grey=F.color.blackBright,F.bgColor.bgGrey=F.bgColor.bgBlackBright;for(let[$,J]of Object.entries(F)){for(let[Q,Y]of Object.entries(J))F[Q]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},J[Q]=F[Q],D.set(Y[0],Y[1]);Object.defineProperty(F,$,{value:J,enumerable:!1})}return Object.defineProperty(F,"codes",{value:D,enumerable:!1}),F.color.close="\x1B[39m",F.bgColor.close="\x1B[49m",j3(F.color,"ansi",()=>T3(pR,"ansi16",M7,!1)),j3(F.color,"ansi256",()=>T3(dR,"ansi256",M7,!1)),j3(F.color,"ansi16m",()=>T3(cR,"rgb",nR,!1)),j3(F.bgColor,"ansi",()=>T3(pR,"ansi16",M7,!0)),j3(F.bgColor,"ansi256",()=>T3(dR,"ansi256",M7,!0)),j3(F.bgColor,"ansi16m",()=>T3(cR,"rgb",nR,!0)),F}Object.defineProperty(iR,"exports",{enumerable:!0,get:w60})});var sR=z((IN0,oR)=>{var B5=YB(),j60=Q5(),T60=WB(),qB=new Set(["\x1B","\x9B"]),aR=(D)=>`${qB.values().next().value}[${D}m`,P60=(D)=>D.split(" ").map((F)=>B5(F)),HB=(D,F,$)=>{let J=[...F],Q=!1,Y=B5(j60(D[D.length-1]));for(let[B,X]of J.entries()){let G=B5(X);if(Y+G<=$)D[D.length-1]+=X;else D.push(X),Y=0;if(qB.has(X))Q=!0;else if(Q&&X==="m"){Q=!1;continue}if(Q)continue;if(Y+=G,Y===$&&B<J.length-1)D.push(""),Y=0}if(!Y&&D[D.length-1].length>0&&D.length>1)D[D.length-2]+=D.pop()},I60=(D)=>{let F=D.split(" "),$=F.length;while($>0){if(B5(F[$-1])>0)break;$--}if($===F.length)return D;return F.slice(0,$).join(" ")+F.slice($).join("")},S60=(D,F,$={})=>{if($.trim!==!1&&D.trim()==="")return"";let J="",Q="",Y,B=P60(D),X=[""];for(let[G,H]of D.split(" ").entries()){if($.trim!==!1)X[X.length-1]=X[X.length-1].trimLeft();let q=B5(X[X.length-1]);if(G!==0){if(q>=F&&($.wordWrap===!1||$.trim===!1))X.push(""),q=0;if(q>0||$.trim===!1)X[X.length-1]+=" ",q++}if($.hard&&B[G]>F){let K=F-q,V=1+Math.floor((B[G]-K-1)/F);if(Math.floor((B[G]-1)/F)<V)X.push("");HB(X,H,F);continue}if(q+B[G]>F&&q>0&&B[G]>0){if($.wordWrap===!1&&q<F){HB(X,H,F);continue}X.push("")}if(q+B[G]>F&&$.wordWrap===!1){HB(X,H,F);continue}X[X.length-1]+=H}if($.trim!==!1)X=X.map(I60);J=X.join(`
@@ -42,7 +42,7 @@ Calls to async() callback can have unexpected results.`);return V=!0,function(N,
42
42
  `)+$,Q=J+1,J=D.indexOf(`
43
43
  `,Q)}while(J!==-1);return Y+=D.substr(Q),Y};$C.exports={stringReplaceAll:y60,stringEncaseCRLFWithFirstIndex:x60}});var GC=z((yN0,XC)=>{var _60=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,QC=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,f60=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,g60=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,h60=new Map([["n",`
44
44
  `],["r","\r"],["t","\t"],["b","\b"],["f","\f"],["v","\v"],["0","\x00"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function BC(D){let F=D[0]==="u",$=D[1]==="{";if(F&&!$&&D.length===5||D[0]==="x"&&D.length===3)return String.fromCharCode(parseInt(D.slice(1),16));if(F&&$)return String.fromCodePoint(parseInt(D.slice(2,-1),16));return h60.get(D)||D}function b60(D,F){let $=[],J=F.trim().split(/\s*,\s*/g),Q;for(let Y of J){let B=Number(Y);if(!Number.isNaN(B))$.push(B);else if(Q=Y.match(f60))$.push(Q[2].replace(g60,(X,G,H)=>G?BC(G):H));else throw Error(`Invalid Chalk template style argument: ${Y} (in style '${D}')`)}return $}function u60(D){QC.lastIndex=0;let F=[],$;while(($=QC.exec(D))!==null){let J=$[1];if($[2]){let Q=b60(J,$[2]);F.push([J].concat(Q))}else F.push([J])}return F}function YC(D,F){let $={};for(let Q of F)for(let Y of Q.styles)$[Y[0]]=Q.inverse?null:Y.slice(1);let J=D;for(let[Q,Y]of Object.entries($)){if(!Array.isArray(Y))continue;if(!(Q in J))throw Error(`Unknown Chalk style: ${Q}`);J=Y.length>0?J[Q](...Y):J[Q]}return J}XC.exports=(D,F)=>{let $=[],J=[],Q=[];if(F.replace(_60,(Y,B,X,G,H,q)=>{if(B)Q.push(BC(B));else if(G){let K=Q.join("");Q=[],J.push($.length===0?K:YC(D,$)(K)),$.push({inverse:X,styles:u60(G)})}else if(H){if($.length===0)throw Error("Found extraneous } in Chalk template literal");J.push(YC(D,$)(Q.join(""))),Q=[],$.pop()}else Q.push(q)}),J.push(Q.join("")),$.length>0){let Y=`Chalk template literal is missing ${$.length} closing bracket${$.length===1?"":"s"} (\`}\`)`;throw Error(Y)}return J.join("")}});var LB=z((xN0,VC)=>{var X5=WB(),{stdout:VB,stderr:ZB}=FC(),{stringReplaceAll:m60,stringEncaseCRLFWithFirstIndex:l60}=JC(),{isArray:N7}=Array,HC=["ansi","ansi","ansi256","ansi16m"],P3=Object.create(null),p60=(D,F={})=>{if(F.level&&!(Number.isInteger(F.level)&&F.level>=0&&F.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let $=VB?VB.level:0;D.level=F.level===void 0?$:F.level};class qC{constructor(D){return KC(D)}}var KC=(D)=>{let F={};return p60(F,D),F.template=(...$)=>EC(F.template,...$),Object.setPrototypeOf(F,R7.prototype),Object.setPrototypeOf(F.template,F),F.template.constructor=()=>{throw Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.")},F.template.Instance=qC,F.template};function R7(D){return KC(D)}for(let[D,F]of Object.entries(X5))P3[D]={get(){let $=C7(this,UB(F.open,F.close,this._styler),this._isEmpty);return Object.defineProperty(this,D,{value:$}),$}};P3.visible={get(){let D=C7(this,this._styler,!0);return Object.defineProperty(this,"visible",{value:D}),D}};var zC=["rgb","hex","keyword","hsl","hsv","hwb","ansi","ansi256"];for(let D of zC)P3[D]={get(){let{level:F}=this;return function(...$){let J=UB(X5.color[HC[F]][D](...$),X5.color.close,this._styler);return C7(this,J,this._isEmpty)}}};for(let D of zC){let F="bg"+D[0].toUpperCase()+D.slice(1);P3[F]={get(){let{level:$}=this;return function(...J){let Q=UB(X5.bgColor[HC[$]][D](...J),X5.bgColor.close,this._styler);return C7(this,Q,this._isEmpty)}}}}var d60=Object.defineProperties(()=>{},{...P3,level:{enumerable:!0,get(){return this._generator.level},set(D){this._generator.level=D}}}),UB=(D,F,$)=>{let J,Q;if($===void 0)J=D,Q=F;else J=$.openAll+D,Q=F+$.closeAll;return{open:D,close:F,openAll:J,closeAll:Q,parent:$}},C7=(D,F,$)=>{let J=(...Q)=>{if(N7(Q[0])&&N7(Q[0].raw))return WC(J,EC(J,...Q));return WC(J,Q.length===1?""+Q[0]:Q.join(" "))};return Object.setPrototypeOf(J,d60),J._generator=D,J._styler=F,J._isEmpty=$,J},WC=(D,F)=>{if(D.level<=0||!F)return D._isEmpty?"":F;let $=D._styler;if($===void 0)return F;let{openAll:J,closeAll:Q}=$;if(F.indexOf("\x1B")!==-1)while($!==void 0)F=m60(F,$.close,$.open),$=$.parent;let Y=F.indexOf(`
45
- `);if(Y!==-1)F=l60(F,Q,J,Y);return J+F+Q},EB,EC=(D,...F)=>{let[$]=F;if(!N7($)||!N7($.raw))return F.join(" ");let J=F.slice(1),Q=[$.raw[0]];for(let Y=1;Y<$.length;Y++)Q.push(String(J[Y-1]).replace(/[{}\\]/g,"\\$&"),String($.raw[Y]));if(EB===void 0)EB=GC();return EB(D,Q.join(""))};Object.defineProperties(R7.prototype,P3);var O7=R7();O7.supportsColor=VB;O7.stderr=R7({level:ZB?ZB.level:0});O7.stderr.supportsColor=ZB;VC.exports=O7});var UC=z((_N0,AB)=>{var ZC=(D,F)=>{for(let $ of Reflect.ownKeys(F))Object.defineProperty(D,$,Object.getOwnPropertyDescriptor(F,$));return D};AB.exports=ZC;AB.exports.default=ZC});var AC=z((fN0,j7)=>{var c60=UC(),w7=new WeakMap,LC=(D,F={})=>{if(typeof D!=="function")throw TypeError("Expected a function");let $,J=0,Q=D.displayName||D.name||"<anonymous>",Y=function(...B){if(w7.set(Y,++J),J===1)$=D.apply(this,B),D=null;else if(F.throw===!0)throw Error(`Function \`${Q}\` can only be called once`);return $};return c60(Y,D),w7.set(Y,J),Y};j7.exports=LC;j7.exports.default=LC;j7.exports.callCount=(D)=>{if(!w7.has(D))throw Error(`The given function \`${D.name}\` is not wrapped by the \`onetime\` package`);return w7.get(D)}});var MC=z((gN0,T7)=>{T7.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")T7.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")T7.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var NC=z((hN0,S3)=>{var c0=global.process,F4=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!F4(c0))S3.exports=function(){return function(){}};else{if(MB=K0("assert"),$4=MC(),NB=/^win/i.test(c0.platform),I3=K0("events"),typeof I3!=="function")I3=I3.EventEmitter;if(c0.__signal_exit_emitter__)WD=c0.__signal_exit_emitter__;else WD=c0.__signal_exit_emitter__=new I3,WD.count=0,WD.emitted={};if(!WD.infinite)WD.setMaxListeners(1/0),WD.infinite=!0;S3.exports=function(D,F){if(!F4(global.process))return function(){};if(MB.equal(typeof D,"function","a callback must be provided for exit handler"),J4===!1)P7();var $="exit";if(F&&F.alwaysLast)$="afterexit";var J=function(){if(WD.removeListener($,D),WD.listeners("exit").length===0&&WD.listeners("afterexit").length===0)G5()};return WD.on($,D),J},G5=function(){if(!J4||!F4(global.process))return;J4=!1,$4.forEach(function(F){try{c0.removeListener(F,W5[F])}catch($){}}),c0.emit=H5,c0.reallyExit=I7,WD.count-=1},S3.exports.unload=G5,O6=function(F,$,J){if(WD.emitted[F])return;WD.emitted[F]=!0,WD.emit(F,$,J)},W5={},$4.forEach(function(D){W5[D]=function(){if(!F4(global.process))return;var $=c0.listeners(D);if($.length===WD.count){if(G5(),O6("exit",null,D),O6("afterexit",null,D),NB&&D==="SIGHUP")D="SIGINT";c0.kill(c0.pid,D)}}}),S3.exports.signals=function(){return $4},J4=!1,P7=function(){if(J4||!F4(global.process))return;J4=!0,WD.count+=1,$4=$4.filter(function(F){try{return c0.on(F,W5[F]),!0}catch($){return!1}}),c0.emit=CB,c0.reallyExit=RB},S3.exports.load=P7,I7=c0.reallyExit,RB=function(F){if(!F4(global.process))return;c0.exitCode=F||0,O6("exit",c0.exitCode,null),O6("afterexit",c0.exitCode,null),I7.call(c0,c0.exitCode)},H5=c0.emit,CB=function(F,$){if(F==="exit"&&F4(global.process)){if($!==void 0)c0.exitCode=$;var J=H5.apply(this,arguments);return O6("exit",c0.exitCode,null),O6("afterexit",c0.exitCode,null),J}else return H5.apply(this,arguments)}}var MB,$4,NB,I3,WD,G5,O6,W5,J4,P7,I7,RB,H5,CB});var CC=z((bN0,RC)=>{var n60=AC(),i60=NC();RC.exports=n60(()=>{i60(()=>{process.stderr.write("\x1B[?25h")},{alwaysLast:!0})})});var jC=z((o60)=>{var a60=CC(),S7=!1;o60.show=(D=process.stderr)=>{if(!D.isTTY)return;S7=!1,D.write("\x1B[?25h")};o60.hide=(D=process.stderr)=>{if(!D.isTTY)return;a60(),S7=!0,D.write("\x1B[?25l")};o60.toggle=(D,F)=>{if(D!==void 0)S7=D;if(S7)o60.show(F);else o60.hide(F)}});var TC=z((mN0,r60)=>{r60.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\uD83D\uDE04 ","\uD83D\uDE1D "]},monkey:{interval:300,frames:["\uD83D\uDE48 ","\uD83D\uDE48 ","\uD83D\uDE49 ","\uD83D\uDE4A "]},hearts:{interval:100,frames:["\uD83D\uDC9B ","\uD83D\uDC99 ","\uD83D\uDC9C ","\uD83D\uDC9A ","\u2764\uFE0F "]},clock:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD50 ","\uD83D\uDD51 ","\uD83D\uDD52 ","\uD83D\uDD53 ","\uD83D\uDD54 ","\uD83D\uDD55 ","\uD83D\uDD56 ","\uD83D\uDD57 ","\uD83D\uDD58 ","\uD83D\uDD59 ","\uD83D\uDD5A "]},earth:{interval:180,frames:["\uD83C\uDF0D ","\uD83C\uDF0E ","\uD83C\uDF0F "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\uD83C\uDF11 ","\uD83C\uDF12 ","\uD83C\uDF13 ","\uD83C\uDF14 ","\uD83C\uDF15 ","\uD83C\uDF16 ","\uD83C\uDF17 ","\uD83C\uDF18 "]},runner:{interval:140,frames:["\uD83D\uDEB6 ","\uD83C\uDFC3 "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\uD83C\uDF24 ","\u26C5\uFE0F ","\uD83C\uDF25 ","\u2601\uFE0F ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u26C8 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u2601\uFE0F ","\uD83C\uDF25 ","\u26C5\uFE0F ","\uD83C\uDF24 ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\uD83C\uDF32","\uD83C\uDF84"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\uD83E\uDD18 ","\uD83E\uDD1F ","\uD83D\uDD96 ","\u270B ","\uD83E\uDD1A ","\uD83D\uDC46 "]},fistBump:{interval:80,frames:["\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\u3000\uD83E\uDD1C\u3000\u3000\uD83E\uDD1B\u3000 ","\u3000\u3000\uD83E\uDD1C\uD83E\uDD1B\u3000\u3000 ","\u3000\uD83E\uDD1C\u2728\uD83E\uDD1B\u3000\u3000 ","\uD83E\uDD1C\u3000\u2728\u3000\uD83E\uDD1B\u3000 "]},soccerHeader:{interval:80,frames:[" \uD83E\uDDD1\u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F\uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 "]},mindblown:{interval:160,frames:["\uD83D\uDE10 ","\uD83D\uDE10 ","\uD83D\uDE2E ","\uD83D\uDE2E ","\uD83D\uDE26 ","\uD83D\uDE26 ","\uD83D\uDE27 ","\uD83D\uDE27 ","\uD83E\uDD2F ","\uD83D\uDCA5 ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\uD83D\uDD08 ","\uD83D\uDD09 ","\uD83D\uDD0A ","\uD83D\uDD09 "]},orangePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 "]},bluePulse:{interval:100,frames:["\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},orangeBluePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 ","\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},timeTravel:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD5A ","\uD83D\uDD59 ","\uD83D\uDD58 ","\uD83D\uDD57 ","\uD83D\uDD56 ","\uD83D\uDD55 ","\uD83D\uDD54 ","\uD83D\uDD53 ","\uD83D\uDD52 ","\uD83D\uDD51 ","\uD83D\uDD50 "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}}});var v7=z((lN0,IC)=>{var k7=Object.assign({},TC()),PC=Object.keys(k7);Object.defineProperty(k7,"random",{get(){let D=Math.floor(Math.random()*PC.length),F=PC[D];return k7[F]}});IC.exports=k7});var OB=z((pN0,SC)=>{SC.exports=()=>{if(process.platform!=="win32")return!0;return Boolean(process.env.CI)||Boolean(process.env.WT_SESSION)||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color"||process.env.TERM==="alacritty"}});var vC=z((dN0,kC)=>{var w6=LB(),t60=OB(),e60={info:w6.blue("\u2139"),success:w6.green("\u2714"),warning:w6.yellow("\u26A0"),error:w6.red("\u2716")},D40={info:w6.blue("i"),success:w6.green("\u221A"),warning:w6.yellow("\u203C"),error:w6.red("\xD7")};kC.exports=t60()?e60:D40});var yC=z((cN0,y7)=>{var F40=function(){function D(B,X,G,H){var q;if(typeof X==="object")G=X.depth,H=X.prototype,q=X.filter,X=X.circular;var K=[],V=[],E=typeof Buffer<"u";if(typeof X>"u")X=!0;if(typeof G>"u")G=1/0;function Z(L,A){if(L===null)return null;if(A==0)return L;var M,N;if(typeof L!="object")return L;if(D.__isArray(L))M=[];else if(D.__isRegExp(L)){if(M=new RegExp(L.source,Y(L)),L.lastIndex)M.lastIndex=L.lastIndex}else if(D.__isDate(L))M=new Date(L.getTime());else if(E&&Buffer.isBuffer(L)){if(Buffer.allocUnsafe)M=Buffer.allocUnsafe(L.length);else M=new Buffer(L.length);return L.copy(M),M}else if(typeof H>"u")N=Object.getPrototypeOf(L),M=Object.create(N);else M=Object.create(H),N=H;if(X){var w=K.indexOf(L);if(w!=-1)return V[w];K.push(L),V.push(M)}for(var P in L){var C;if(N)C=Object.getOwnPropertyDescriptor(N,P);if(C&&C.set==null)continue;M[P]=Z(L[P],A-1)}return M}return Z(B,G)}D.clonePrototype=function(X){if(X===null)return null;var G=function(){};return G.prototype=X,new G};function F(B){return Object.prototype.toString.call(B)}D.__objToStr=F;function $(B){return typeof B==="object"&&F(B)==="[object Date]"}D.__isDate=$;function J(B){return typeof B==="object"&&F(B)==="[object Array]"}D.__isArray=J;function Q(B){return typeof B==="object"&&F(B)==="[object RegExp]"}D.__isRegExp=Q;function Y(B){var X="";if(B.global)X+="g";if(B.ignoreCase)X+="i";if(B.multiline)X+="m";return X}return D.__getRegExpFlags=Y,D}();if(typeof y7==="object"&&y7.exports)y7.exports=F40});var _C=z((nN0,xC)=>{var $40=yC();xC.exports=function(D,F){return D=D||{},Object.keys(F).forEach(function($){if(typeof D[$]>"u")D[$]=$40(F[$])}),D}});var gC=z((iN0,fC)=>{fC.exports=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]]});var mC=z((aN0,wB)=>{var J40=_C(),q5=gC(),bC={nul:0,control:0};wB.exports=function(F){return uC(F,bC)};wB.exports.config=function(D){return D=J40(D||{},bC),function($){return uC($,D)}};function uC(D,F){if(typeof D!=="string")return hC(D,F);var $=0;for(var J=0;J<D.length;J++){var Q=hC(D.charCodeAt(J),F);if(Q<0)return-1;$+=Q}return $}function hC(D,F){if(D===0)return F.nul;if(D<32||D>=127&&D<160)return F.control;if(Q40(D))return 0;return 1+(D>=4352&&(D<=4447||D==9001||D==9002||D>=11904&&D<=42191&&D!=12351||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65135||D>=65280&&D<=65376||D>=65504&&D<=65510||D>=131072&&D<=196605||D>=196608&&D<=262141))}function Q40(D){var F=0,$=q5.length-1,J;if(D<q5[0][0]||D>q5[$][1])return!1;while($>=F)if(J=Math.floor((F+$)/2),D>q5[J][1])F=J+1;else if(D<q5[J][0])$=J-1;else return!0;return!1}});var pC=z((oN0,lC)=>{lC.exports=({stream:D=process.stdout}={})=>{return Boolean(D&&D.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}});var oC=z((sN0,aC)=>{function dC(D,F){var $=Object.keys(D);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(D);F&&(J=J.filter(function(Q){return Object.getOwnPropertyDescriptor(D,Q).enumerable})),$.push.apply($,J)}return $}function cC(D){for(var F=1;F<arguments.length;F++){var $=arguments[F]!=null?arguments[F]:{};F%2?dC(Object($),!0).forEach(function(J){Y40(D,J,$[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors($)):dC(Object($)).forEach(function(J){Object.defineProperty(D,J,Object.getOwnPropertyDescriptor($,J))})}return D}function Y40(D,F,$){if(F=iC(F),F in D)Object.defineProperty(D,F,{value:$,enumerable:!0,configurable:!0,writable:!0});else D[F]=$;return D}function B40(D,F){if(!(D instanceof F))throw TypeError("Cannot call a class as a function")}function nC(D,F){for(var $=0;$<F.length;$++){var J=F[$];if(J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J)J.writable=!0;Object.defineProperty(D,iC(J.key),J)}}function X40(D,F,$){if(F)nC(D.prototype,F);if($)nC(D,$);return Object.defineProperty(D,"prototype",{writable:!1}),D}function iC(D){var F=G40(D,"string");return typeof F==="symbol"?F:String(F)}function G40(D,F){if(typeof D!=="object"||D===null)return D;var $=D[Symbol.toPrimitive];if($!==void 0){var J=$.call(D,F||"default");if(typeof J!=="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(F==="string"?String:Number)(D)}var W40=K0("buffer"),x7=W40.Buffer,H40=K0("util"),jB=H40.inspect,q40=jB&&jB.custom||"inspect";function K40(D,F,$){x7.prototype.copy.call(D,F,$)}aC.exports=function(){function D(){B40(this,D),this.head=null,this.tail=null,this.length=0}return X40(D,[{key:"push",value:function($){var J={data:$,next:null};if(this.length>0)this.tail.next=J;else this.head=J;this.tail=J,++this.length}},{key:"unshift",value:function($){var J={data:$,next:this.head};if(this.length===0)this.tail=J;this.head=J,++this.length}},{key:"shift",value:function(){if(this.length===0)return;var $=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,$}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function($){if(this.length===0)return"";var J=this.head,Q=""+J.data;while(J=J.next)Q+=$+J.data;return Q}},{key:"concat",value:function($){if(this.length===0)return x7.alloc(0);var J=x7.allocUnsafe($>>>0),Q=this.head,Y=0;while(Q)K40(Q.data,J,Y),Y+=Q.data.length,Q=Q.next;return J}},{key:"consume",value:function($,J){var Q;if($<this.head.data.length)Q=this.head.data.slice(0,$),this.head.data=this.head.data.slice($);else if($===this.head.data.length)Q=this.shift();else Q=J?this._getString($):this._getBuffer($);return Q}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function($){var J=this.head,Q=1,Y=J.data;$-=Y.length;while(J=J.next){var B=J.data,X=$>B.length?B.length:$;if(X===B.length)Y+=B;else Y+=B.slice(0,$);if($-=X,$===0){if(X===B.length)if(++Q,J.next)this.head=J.next;else this.head=this.tail=null;else this.head=J,J.data=B.slice(X);break}++Q}return this.length-=Q,Y}},{key:"_getBuffer",value:function($){var J=x7.allocUnsafe($),Q=this.head,Y=1;Q.data.copy(J),$-=Q.data.length;while(Q=Q.next){var B=Q.data,X=$>B.length?B.length:$;if(B.copy(J,J.length-$,0,X),$-=X,$===0){if(X===B.length)if(++Y,Q.next)this.head=Q.next;else this.head=this.tail=null;else this.head=Q,Q.data=B.slice(X);break}++Y}return this.length-=Y,J}},{key:q40,value:function($,J){return jB(this,cC(cC({},J),{},{depth:0,customInspect:!1}))}}]),D}()});var PB=z((rN0,rC)=>{function z40(D,F){var $=this,J=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(J||Q){if(F)F(D);else if(D){if(!this._writableState)process.nextTick(TB,this,D);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,process.nextTick(TB,this,D)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy(D||null,function(Y){if(!F&&Y)if(!$._writableState)process.nextTick(sC,$,Y);else if(!$._writableState.errorEmitted)$._writableState.errorEmitted=!0,process.nextTick(sC,$,Y);else process.nextTick(_7,$);else if(F)process.nextTick(_7,$),F(Y);else process.nextTick(_7,$)}),this}function sC(D,F){TB(D,F),_7(D)}function _7(D){if(D._writableState&&!D._writableState.emitClose)return;if(D._readableState&&!D._readableState.emitClose)return;D.emit("close")}function E40(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(this._writableState)this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1}function TB(D,F){D.emit("error",F)}function V40(D,F){var{_readableState:$,_writableState:J}=D;if($&&$.autoDestroy||J&&J.autoDestroy)D.destroy(F);else D.emit("error",F)}rC.exports={destroy:z40,undestroy:E40,errorOrDestroy:V40}});var j6=z((A40,DO)=>{var eC={};function E1(D,F,$){if(!$)$=Error;function J(Y,B,X){if(typeof F==="string")return F;else return F(Y,B,X)}class Q extends ${constructor(Y,B,X){super(J(Y,B,X))}}Q.prototype.name=$.name,Q.prototype.code=D,eC[D]=Q}function tC(D,F){if(Array.isArray(D)){let $=D.length;if(D=D.map((J)=>String(J)),$>2)return`one of ${F} ${D.slice(0,$-1).join(", ")}, or `+D[$-1];else if($===2)return`one of ${F} ${D[0]} or ${D[1]}`;else return`of ${F} ${D[0]}`}else return`of ${F} ${String(D)}`}function Z40(D,F,$){return D.substr(!$||$<0?0:+$,F.length)===F}function U40(D,F,$){if($===void 0||$>D.length)$=D.length;return D.substring($-F.length,$)===F}function L40(D,F,$){if(typeof $!=="number")$=0;if($+F.length>D.length)return!1;else return D.indexOf(F,$)!==-1}E1("ERR_INVALID_OPT_VALUE",function(D,F){return'The value "'+F+'" is invalid for option "'+D+'"'},TypeError);E1("ERR_INVALID_ARG_TYPE",function(D,F,$){let J;if(typeof F==="string"&&Z40(F,"not "))J="must not be",F=F.replace(/^not /,"");else J="must be";let Q;if(U40(D," argument"))Q=`The ${D} ${J} ${tC(F,"type")}`;else{let Y=L40(D,".")?"property":"argument";Q=`The "${D}" ${Y} ${J} ${tC(F,"type")}`}return Q+=`. Received type ${typeof $}`,Q},TypeError);E1("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");E1("ERR_METHOD_NOT_IMPLEMENTED",function(D){return"The "+D+" method is not implemented"});E1("ERR_STREAM_PREMATURE_CLOSE","Premature close");E1("ERR_STREAM_DESTROYED",function(D){return"Cannot call "+D+" after a stream was destroyed"});E1("ERR_MULTIPLE_CALLBACK","Callback called multiple times");E1("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");E1("ERR_STREAM_WRITE_AFTER_END","write after end");E1("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);E1("ERR_UNKNOWN_ENCODING",function(D){return"Unknown encoding: "+D},TypeError);E1("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");A40.codes=eC});var IB=z((tN0,FO)=>{var N40=j6().codes.ERR_INVALID_OPT_VALUE;function R40(D,F,$){return D.highWaterMark!=null?D.highWaterMark:F?D[$]:null}function C40(D,F,$,J){var Q=R40(F,J,$);if(Q!=null){if(!(isFinite(Q)&&Math.floor(Q)===Q)||Q<0){var Y=J?$:"highWaterMark";throw new N40(Y,Q)}return Math.floor(Q)}return D.objectMode?16:16384}FO.exports={getHighWaterMark:C40}});var $O=z((eN0,SB)=>{if(typeof Object.create==="function")SB.exports=function(F,$){if($)F.super_=$,F.prototype=Object.create($.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}})};else SB.exports=function(F,$){if($){F.super_=$;var J=function(){};J.prototype=$.prototype,F.prototype=new J,F.prototype.constructor=F}}});var Q4=z((DR0,kB)=>{try{if(f7=K0("util"),typeof f7.inherits!=="function")throw"";kB.exports=f7.inherits}catch(D){kB.exports=$O()}var f7});var QO=z((FR0,JO)=>{JO.exports=K0("util").deprecate});var xB=z(($R0,HO)=>{HO.exports=DD;function BO(D){var F=this;this.next=null,this.entry=null,this.finish=function(){s40(F,D)}}var k3;DD.WritableState=z5;var O40={deprecate:QO()},XO=K0("stream"),h7=K0("buffer").Buffer,w40=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function j40(D){return h7.from(D)}function T40(D){return h7.isBuffer(D)||D instanceof w40}var yB=PB(),P40=IB(),I40=P40.getHighWaterMark,T6=j6().codes,S40=T6.ERR_INVALID_ARG_TYPE,k40=T6.ERR_METHOD_NOT_IMPLEMENTED,v40=T6.ERR_MULTIPLE_CALLBACK,y40=T6.ERR_STREAM_CANNOT_PIPE,x40=T6.ERR_STREAM_DESTROYED,_40=T6.ERR_STREAM_NULL_VALUES,f40=T6.ERR_STREAM_WRITE_AFTER_END,g40=T6.ERR_UNKNOWN_ENCODING,v3=yB.errorOrDestroy;Q4()(DD,XO);function h40(){}function z5(D,F,$){if(k3=k3||Y4(),D=D||{},typeof $!=="boolean")$=F instanceof k3;if(this.objectMode=!!D.objectMode,$)this.objectMode=this.objectMode||!!D.writableObjectMode;this.highWaterMark=I40(this,D,"writableHighWaterMark",$),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var J=D.decodeStrings===!1;this.decodeStrings=!J,this.defaultEncoding=D.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Q){c40(F,Q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=D.emitClose!==!1,this.autoDestroy=!!D.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new BO(this)}z5.prototype.getBuffer=function(){var F=this.bufferedRequest,$=[];while(F)$.push(F),F=F.next;return $};(function(){try{Object.defineProperty(z5.prototype,"buffer",{get:O40.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(D){}})();var g7;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")g7=Function.prototype[Symbol.hasInstance],Object.defineProperty(DD,Symbol.hasInstance,{value:function(F){if(g7.call(this,F))return!0;if(this!==DD)return!1;return F&&F._writableState instanceof z5}});else g7=function(F){return F instanceof this};function DD(D){k3=k3||Y4();var F=this instanceof k3;if(!F&&!g7.call(DD,this))return new DD(D);if(this._writableState=new z5(D,this,F),this.writable=!0,D){if(typeof D.write==="function")this._write=D.write;if(typeof D.writev==="function")this._writev=D.writev;if(typeof D.destroy==="function")this._destroy=D.destroy;if(typeof D.final==="function")this._final=D.final}XO.call(this)}DD.prototype.pipe=function(){v3(this,new y40)};function b40(D,F){var $=new f40;v3(D,$),process.nextTick(F,$)}function u40(D,F,$,J){var Q;if($===null)Q=new _40;else if(typeof $!=="string"&&!F.objectMode)Q=new S40("chunk",["string","Buffer"],$);if(Q)return v3(D,Q),process.nextTick(J,Q),!1;return!0}DD.prototype.write=function(D,F,$){var J=this._writableState,Q=!1,Y=!J.objectMode&&T40(D);if(Y&&!h7.isBuffer(D))D=j40(D);if(typeof F==="function")$=F,F=null;if(Y)F="buffer";else if(!F)F=J.defaultEncoding;if(typeof $!=="function")$=h40;if(J.ending)b40(this,$);else if(Y||u40(this,J,D,$))J.pendingcb++,Q=l40(this,J,Y,D,F,$);return Q};DD.prototype.cork=function(){this._writableState.corked++};DD.prototype.uncork=function(){var D=this._writableState;if(D.corked){if(D.corked--,!D.writing&&!D.corked&&!D.bufferProcessing&&D.bufferedRequest)GO(this,D)}};DD.prototype.setDefaultEncoding=function(F){if(typeof F==="string")F=F.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((F+"").toLowerCase())>-1))throw new g40(F);return this._writableState.defaultEncoding=F,this};Object.defineProperty(DD.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function m40(D,F,$){if(!D.objectMode&&D.decodeStrings!==!1&&typeof F==="string")F=h7.from(F,$);return F}Object.defineProperty(DD.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function l40(D,F,$,J,Q,Y){if(!$){var B=m40(F,J,Q);if(J!==B)$=!0,Q="buffer",J=B}var X=F.objectMode?1:J.length;F.length+=X;var G=F.length<F.highWaterMark;if(!G)F.needDrain=!0;if(F.writing||F.corked){var H=F.lastBufferedRequest;if(F.lastBufferedRequest={chunk:J,encoding:Q,isBuf:$,callback:Y,next:null},H)H.next=F.lastBufferedRequest;else F.bufferedRequest=F.lastBufferedRequest;F.bufferedRequestCount+=1}else vB(D,F,!1,X,J,Q,Y);return G}function vB(D,F,$,J,Q,Y,B){if(F.writelen=J,F.writecb=B,F.writing=!0,F.sync=!0,F.destroyed)F.onwrite(new x40("write"));else if($)D._writev(Q,F.onwrite);else D._write(Q,Y,F.onwrite);F.sync=!1}function p40(D,F,$,J,Q){if(--F.pendingcb,$)process.nextTick(Q,J),process.nextTick(K5,D,F),D._writableState.errorEmitted=!0,v3(D,J);else Q(J),D._writableState.errorEmitted=!0,v3(D,J),K5(D,F)}function d40(D){D.writing=!1,D.writecb=null,D.length-=D.writelen,D.writelen=0}function c40(D,F){var $=D._writableState,J=$.sync,Q=$.writecb;if(typeof Q!=="function")throw new v40;if(d40($),F)p40(D,$,J,F,Q);else{var Y=WO($)||D.destroyed;if(!Y&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest)GO(D,$);if(J)process.nextTick(YO,D,$,Y,Q);else YO(D,$,Y,Q)}}function YO(D,F,$,J){if(!$)n40(D,F);F.pendingcb--,J(),K5(D,F)}function n40(D,F){if(F.length===0&&F.needDrain)F.needDrain=!1,D.emit("drain")}function GO(D,F){F.bufferProcessing=!0;var $=F.bufferedRequest;if(D._writev&&$&&$.next){var J=F.bufferedRequestCount,Q=Array(J),Y=F.corkedRequestsFree;Y.entry=$;var B=0,X=!0;while($){if(Q[B]=$,!$.isBuf)X=!1;$=$.next,B+=1}if(Q.allBuffers=X,vB(D,F,!0,F.length,Q,"",Y.finish),F.pendingcb++,F.lastBufferedRequest=null,Y.next)F.corkedRequestsFree=Y.next,Y.next=null;else F.corkedRequestsFree=new BO(F);F.bufferedRequestCount=0}else{while($){var{chunk:G,encoding:H,callback:q}=$,K=F.objectMode?1:G.length;if(vB(D,F,!1,K,G,H,q),$=$.next,F.bufferedRequestCount--,F.writing)break}if($===null)F.lastBufferedRequest=null}F.bufferedRequest=$,F.bufferProcessing=!1}DD.prototype._write=function(D,F,$){$(new k40("_write()"))};DD.prototype._writev=null;DD.prototype.end=function(D,F,$){var J=this._writableState;if(typeof D==="function")$=D,D=null,F=null;else if(typeof F==="function")$=F,F=null;if(D!==null&&D!==void 0)this.write(D,F);if(J.corked)J.corked=1,this.uncork();if(!J.ending)o40(this,J,$);return this};Object.defineProperty(DD.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function WO(D){return D.ending&&D.length===0&&D.bufferedRequest===null&&!D.finished&&!D.writing}function i40(D,F){D._final(function($){if(F.pendingcb--,$)v3(D,$);F.prefinished=!0,D.emit("prefinish"),K5(D,F)})}function a40(D,F){if(!F.prefinished&&!F.finalCalled)if(typeof D._final==="function"&&!F.destroyed)F.pendingcb++,F.finalCalled=!0,process.nextTick(i40,D,F);else F.prefinished=!0,D.emit("prefinish")}function K5(D,F){var $=WO(F);if($){if(a40(D,F),F.pendingcb===0){if(F.finished=!0,D.emit("finish"),F.autoDestroy){var J=D._readableState;if(!J||J.autoDestroy&&J.endEmitted)D.destroy()}}}return $}function o40(D,F,$){if(F.ending=!0,K5(D,F),$)if(F.finished)process.nextTick($);else D.once("finish",$);F.ended=!0,D.writable=!1}function s40(D,F,$){var J=D.entry;D.entry=null;while(J){var Q=J.callback;F.pendingcb--,Q($),J=J.next}F.corkedRequestsFree.next=D}Object.defineProperty(DD.prototype,"destroyed",{enumerable:!1,get:function(){if(this._writableState===void 0)return!1;return this._writableState.destroyed},set:function(F){if(!this._writableState)return;this._writableState.destroyed=F}});DD.prototype.destroy=yB.destroy;DD.prototype._undestroy=yB.undestroy;DD.prototype._destroy=function(D,F){F(D)}});var Y4=z((JR0,KO)=>{var r40=Object.keys||function(D){var F=[];for(var $ in D)F.push($);return F};KO.exports=X8;var qO=fB(),_B=xB();Q4()(X8,qO);{b7=r40(_B.prototype);for(E5=0;E5<b7.length;E5++)if(V5=b7[E5],!X8.prototype[V5])X8.prototype[V5]=_B.prototype[V5]}var b7,V5,E5;function X8(D){if(!(this instanceof X8))return new X8(D);if(qO.call(this,D),_B.call(this,D),this.allowHalfOpen=!0,D){if(D.readable===!1)this.readable=!1;if(D.writable===!1)this.writable=!1;if(D.allowHalfOpen===!1)this.allowHalfOpen=!1,this.once("end",t40)}}Object.defineProperty(X8.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(X8.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(X8.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function t40(){if(this._writableState.ended)return;process.nextTick(e40,this)}function e40(D){D.end()}Object.defineProperty(X8.prototype,"destroyed",{enumerable:!1,get:function(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set:function(F){if(this._readableState===void 0||this._writableState===void 0)return;this._readableState.destroyed=F,this._writableState.destroyed=F}})});var VO=z((gB,EO)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var u7=K0("buffer"),G8=u7.Buffer;function zO(D,F){for(var $ in D)F[$]=D[$]}if(G8.from&&G8.alloc&&G8.allocUnsafe&&G8.allocUnsafeSlow)EO.exports=u7;else zO(u7,gB),gB.Buffer=B4;function B4(D,F,$){return G8(D,F,$)}B4.prototype=Object.create(G8.prototype);zO(G8,B4);B4.from=function(D,F,$){if(typeof D==="number")throw TypeError("Argument must not be a number");return G8(D,F,$)};B4.alloc=function(D,F,$){if(typeof D!=="number")throw TypeError("Argument must be a number");var J=G8(D);if(F!==void 0)if(typeof $==="string")J.fill(F,$);else J.fill(F);else J.fill(0);return J};B4.allocUnsafe=function(D){if(typeof D!=="number")throw TypeError("Argument must be a number");return G8(D)};B4.allocUnsafeSlow=function(D){if(typeof D!=="number")throw TypeError("Argument must be a number");return u7.SlowBuffer(D)}});var uB=z((z30)=>{var bB=VO().Buffer,ZO=bB.isEncoding||function(D){switch(D=""+D,D&&D.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function D30(D){if(!D)return"utf8";var F;while(!0)switch(D){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return D;default:if(F)return;D=(""+D).toLowerCase(),F=!0}}function F30(D){var F=D30(D);if(typeof F!=="string"&&(bB.isEncoding===ZO||!ZO(D)))throw Error("Unknown encoding: "+D);return F||D}z30.StringDecoder=Z5;function Z5(D){this.encoding=F30(D);var F;switch(this.encoding){case"utf16le":this.text=X30,this.end=G30,F=4;break;case"utf8":this.fillLast=Q30,F=4;break;case"base64":this.text=W30,this.end=H30,F=3;break;default:this.write=q30,this.end=K30;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=bB.allocUnsafe(F)}Z5.prototype.write=function(D){if(D.length===0)return"";var F,$;if(this.lastNeed){if(F=this.fillLast(D),F===void 0)return"";$=this.lastNeed,this.lastNeed=0}else $=0;if($<D.length)return F?F+this.text(D,$):this.text(D,$);return F||""};Z5.prototype.end=B30;Z5.prototype.text=Y30;Z5.prototype.fillLast=function(D){if(this.lastNeed<=D.length)return D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,D.length),this.lastNeed-=D.length};function hB(D){if(D<=127)return 0;else if(D>>5===6)return 2;else if(D>>4===14)return 3;else if(D>>3===30)return 4;return D>>6===2?-1:-2}function $30(D,F,$){var J=F.length-1;if(J<$)return 0;var Q=hB(F[J]);if(Q>=0){if(Q>0)D.lastNeed=Q-1;return Q}if(--J<$||Q===-2)return 0;if(Q=hB(F[J]),Q>=0){if(Q>0)D.lastNeed=Q-2;return Q}if(--J<$||Q===-2)return 0;if(Q=hB(F[J]),Q>=0){if(Q>0)if(Q===2)Q=0;else D.lastNeed=Q-3;return Q}return 0}function J30(D,F,$){if((F[0]&192)!==128)return D.lastNeed=0,"\uFFFD";if(D.lastNeed>1&&F.length>1){if((F[1]&192)!==128)return D.lastNeed=1,"\uFFFD";if(D.lastNeed>2&&F.length>2){if((F[2]&192)!==128)return D.lastNeed=2,"\uFFFD"}}}function Q30(D){var F=this.lastTotal-this.lastNeed,$=J30(this,D,F);if($!==void 0)return $;if(this.lastNeed<=D.length)return D.copy(this.lastChar,F,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,F,0,D.length),this.lastNeed-=D.length}function Y30(D,F){var $=$30(this,D,F);if(!this.lastNeed)return D.toString("utf8",F);this.lastTotal=$;var J=D.length-($-this.lastNeed);return D.copy(this.lastChar,0,J),D.toString("utf8",F,J)}function B30(D){var F=D&&D.length?this.write(D):"";if(this.lastNeed)return F+"\uFFFD";return F}function X30(D,F){if((D.length-F)%2===0){var $=D.toString("utf16le",F);if($){var J=$.charCodeAt($.length-1);if(J>=55296&&J<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1],$.slice(0,-1)}return $}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",F,D.length-1)}function G30(D){var F=D&&D.length?this.write(D):"";if(this.lastNeed){var $=this.lastTotal-this.lastNeed;return F+this.lastChar.toString("utf16le",0,$)}return F}function W30(D,F){var $=(D.length-F)%3;if($===0)return D.toString("base64",F);if(this.lastNeed=3-$,this.lastTotal=3,$===1)this.lastChar[0]=D[D.length-1];else this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1];return D.toString("base64",F,D.length-$)}function H30(D){var F=D&&D.length?this.write(D):"";if(this.lastNeed)return F+this.lastChar.toString("base64",0,3-this.lastNeed);return F}function q30(D){return D.toString(this.encoding)}function K30(D){return D&&D.length?this.write(D):""}});var m7=z((YR0,AO)=>{var UO=j6().codes.ERR_STREAM_PREMATURE_CLOSE;function V30(D){var F=!1;return function(){if(F)return;F=!0;for(var $=arguments.length,J=Array($),Q=0;Q<$;Q++)J[Q]=arguments[Q];D.apply(this,J)}}function Z30(){}function U30(D){return D.setHeader&&typeof D.abort==="function"}function LO(D,F,$){if(typeof F==="function")return LO(D,null,F);if(!F)F={};$=V30($||Z30);var J=F.readable||F.readable!==!1&&D.readable,Q=F.writable||F.writable!==!1&&D.writable,Y=function(){if(!D.writable)X()},B=D._writableState&&D._writableState.finished,X=function(){if(Q=!1,B=!0,!J)$.call(D)},G=D._readableState&&D._readableState.endEmitted,H=function(){if(J=!1,G=!0,!Q)$.call(D)},q=function(Z){$.call(D,Z)},K=function(){var Z;if(J&&!G){if(!D._readableState||!D._readableState.ended)Z=new UO;return $.call(D,Z)}if(Q&&!B){if(!D._writableState||!D._writableState.ended)Z=new UO;return $.call(D,Z)}},V=function(){D.req.on("finish",X)};if(U30(D))if(D.on("complete",X),D.on("abort",K),D.req)V();else D.on("request",V);else if(Q&&!D._writableState)D.on("end",Y),D.on("close",Y);if(D.on("end",H),D.on("finish",X),F.error!==!1)D.on("error",q);return D.on("close",K),function(){if(D.removeListener("complete",X),D.removeListener("abort",K),D.removeListener("request",V),D.req)D.req.removeListener("finish",X);D.removeListener("end",Y),D.removeListener("close",Y),D.removeListener("finish",X),D.removeListener("end",H),D.removeListener("error",q),D.removeListener("close",K)}}AO.exports=LO});var NO=z((BR0,MO)=>{var l7;function P6(D,F,$){if(F=L30(F),F in D)Object.defineProperty(D,F,{value:$,enumerable:!0,configurable:!0,writable:!0});else D[F]=$;return D}function L30(D){var F=A30(D,"string");return typeof F==="symbol"?F:String(F)}function A30(D,F){if(typeof D!=="object"||D===null)return D;var $=D[Symbol.toPrimitive];if($!==void 0){var J=$.call(D,F||"default");if(typeof J!=="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(F==="string"?String:Number)(D)}var M30=m7(),I6=Symbol("lastResolve"),X4=Symbol("lastReject"),U5=Symbol("error"),p7=Symbol("ended"),G4=Symbol("lastPromise"),mB=Symbol("handlePromise"),W4=Symbol("stream");function S6(D,F){return{value:D,done:F}}function N30(D){var F=D[I6];if(F!==null){var $=D[W4].read();if($!==null)D[G4]=null,D[I6]=null,D[X4]=null,F(S6($,!1))}}function R30(D){process.nextTick(N30,D)}function C30(D,F){return function($,J){D.then(function(){if(F[p7]){$(S6(void 0,!0));return}F[mB]($,J)},J)}}var O30=Object.getPrototypeOf(function(){}),w30=Object.setPrototypeOf((l7={get stream(){return this[W4]},next:function(){var F=this,$=this[U5];if($!==null)return Promise.reject($);if(this[p7])return Promise.resolve(S6(void 0,!0));if(this[W4].destroyed)return new Promise(function(B,X){process.nextTick(function(){if(F[U5])X(F[U5]);else B(S6(void 0,!0))})});var J=this[G4],Q;if(J)Q=new Promise(C30(J,this));else{var Y=this[W4].read();if(Y!==null)return Promise.resolve(S6(Y,!1));Q=new Promise(this[mB])}return this[G4]=Q,Q}},P6(l7,Symbol.asyncIterator,function(){return this}),P6(l7,"return",function(){var F=this;return new Promise(function($,J){F[W4].destroy(null,function(Q){if(Q){J(Q);return}$(S6(void 0,!0))})})}),l7),O30),j30=function(F){var $,J=Object.create(w30,($={},P6($,W4,{value:F,writable:!0}),P6($,I6,{value:null,writable:!0}),P6($,X4,{value:null,writable:!0}),P6($,U5,{value:null,writable:!0}),P6($,p7,{value:F._readableState.endEmitted,writable:!0}),P6($,mB,{value:function(Y,B){var X=J[W4].read();if(X)J[G4]=null,J[I6]=null,J[X4]=null,Y(S6(X,!1));else J[I6]=Y,J[X4]=B},writable:!0}),$));return J[G4]=null,M30(F,function(Q){if(Q&&Q.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Y=J[X4];if(Y!==null)J[G4]=null,J[I6]=null,J[X4]=null,Y(Q);J[U5]=Q;return}var B=J[I6];if(B!==null)J[G4]=null,J[I6]=null,J[X4]=null,B(S6(void 0,!0));J[p7]=!0}),F.on("readable",R30.bind(null,J)),J};MO.exports=j30});var wO=z((XR0,OO)=>{function RO(D,F,$,J,Q,Y,B){try{var X=D[Y](B),G=X.value}catch(H){$(H);return}if(X.done)F(G);else Promise.resolve(G).then(J,Q)}function T30(D){return function(){var F=this,$=arguments;return new Promise(function(J,Q){var Y=D.apply(F,$);function B(G){RO(Y,J,Q,B,X,"next",G)}function X(G){RO(Y,J,Q,B,X,"throw",G)}B(void 0)})}}function CO(D,F){var $=Object.keys(D);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(D);F&&(J=J.filter(function(Q){return Object.getOwnPropertyDescriptor(D,Q).enumerable})),$.push.apply($,J)}return $}function P30(D){for(var F=1;F<arguments.length;F++){var $=arguments[F]!=null?arguments[F]:{};F%2?CO(Object($),!0).forEach(function(J){I30(D,J,$[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors($)):CO(Object($)).forEach(function(J){Object.defineProperty(D,J,Object.getOwnPropertyDescriptor($,J))})}return D}function I30(D,F,$){if(F=S30(F),F in D)Object.defineProperty(D,F,{value:$,enumerable:!0,configurable:!0,writable:!0});else D[F]=$;return D}function S30(D){var F=k30(D,"string");return typeof F==="symbol"?F:String(F)}function k30(D,F){if(typeof D!=="object"||D===null)return D;var $=D[Symbol.toPrimitive];if($!==void 0){var J=$.call(D,F||"default");if(typeof J!=="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(F==="string"?String:Number)(D)}var v30=j6().codes.ERR_INVALID_ARG_TYPE;function y30(D,F,$){var J;if(F&&typeof F.next==="function")J=F;else if(F&&F[Symbol.asyncIterator])J=F[Symbol.asyncIterator]();else if(F&&F[Symbol.iterator])J=F[Symbol.iterator]();else throw new v30("iterable",["Iterable"],F);var Q=new D(P30({objectMode:!0},$)),Y=!1;Q._read=function(){if(!Y)Y=!0,B()};function B(){return X.apply(this,arguments)}function X(){return X=T30(function*(){try{var G=yield J.next(),H=G.value,q=G.done;if(q)Q.push(null);else if(Q.push(yield H))B();else Y=!1}catch(K){Q.destroy(K)}}),X.apply(this,arguments)}return Q}OO.exports=y30});var fB=z((WR0,_O)=>{_O.exports=R0;var y3;R0.ReadableState=IO;var GR0=K0("events").EventEmitter,PO=function(F,$){return F.listeners($).length},A5=K0("stream"),d7=K0("buffer").Buffer,x30=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _30(D){return d7.from(D)}function f30(D){return d7.isBuffer(D)||D instanceof x30}var lB=K0("util"),q0;if(lB&&lB.debuglog)q0=lB.debuglog("stream");else q0=function(){};var g30=oC(),oB=PB(),h30=IB(),b30=h30.getHighWaterMark,c7=j6().codes,u30=c7.ERR_INVALID_ARG_TYPE,m30=c7.ERR_STREAM_PUSH_AFTER_EOF,l30=c7.ERR_METHOD_NOT_IMPLEMENTED,p30=c7.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,x3,pB,dB;Q4()(R0,A5);var L5=oB.errorOrDestroy,cB=["error","close","destroy","pause","resume"];function d30(D,F,$){if(typeof D.prependListener==="function")return D.prependListener(F,$);if(!D._events||!D._events[F])D.on(F,$);else if(Array.isArray(D._events[F]))D._events[F].unshift($);else D._events[F]=[$,D._events[F]]}function IO(D,F,$){if(y3=y3||Y4(),D=D||{},typeof $!=="boolean")$=F instanceof y3;if(this.objectMode=!!D.objectMode,$)this.objectMode=this.objectMode||!!D.readableObjectMode;if(this.highWaterMark=b30(this,D,"readableHighWaterMark",$),this.buffer=new g30,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=D.emitClose!==!1,this.autoDestroy=!!D.autoDestroy,this.destroyed=!1,this.defaultEncoding=D.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,D.encoding){if(!x3)x3=uB().StringDecoder;this.decoder=new x3(D.encoding),this.encoding=D.encoding}}function R0(D){if(y3=y3||Y4(),!(this instanceof R0))return new R0(D);var F=this instanceof y3;if(this._readableState=new IO(D,this,F),this.readable=!0,D){if(typeof D.read==="function")this._read=D.read;if(typeof D.destroy==="function")this._destroy=D.destroy}A5.call(this)}Object.defineProperty(R0.prototype,"destroyed",{enumerable:!1,get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function(F){if(!this._readableState)return;this._readableState.destroyed=F}});R0.prototype.destroy=oB.destroy;R0.prototype._undestroy=oB.undestroy;R0.prototype._destroy=function(D,F){F(D)};R0.prototype.push=function(D,F){var $=this._readableState,J;if(!$.objectMode){if(typeof D==="string"){if(F=F||$.defaultEncoding,F!==$.encoding)D=d7.from(D,F),F="";J=!0}}else J=!0;return SO(this,D,F,!1,J)};R0.prototype.unshift=function(D){return SO(this,D,null,!0,!1)};function SO(D,F,$,J,Q){q0("readableAddChunk",F);var Y=D._readableState;if(F===null)Y.reading=!1,i30(D,Y);else{var B;if(!Q)B=c30(Y,F);if(B)L5(D,B);else if(Y.objectMode||F&&F.length>0){if(typeof F!=="string"&&!Y.objectMode&&Object.getPrototypeOf(F)!==d7.prototype)F=_30(F);if(J)if(Y.endEmitted)L5(D,new p30);else nB(D,Y,F,!0);else if(Y.ended)L5(D,new m30);else if(Y.destroyed)return!1;else if(Y.reading=!1,Y.decoder&&!$)if(F=Y.decoder.write(F),Y.objectMode||F.length!==0)nB(D,Y,F,!1);else aB(D,Y);else nB(D,Y,F,!1)}else if(!J)Y.reading=!1,aB(D,Y)}return!Y.ended&&(Y.length<Y.highWaterMark||Y.length===0)}function nB(D,F,$,J){if(F.flowing&&F.length===0&&!F.sync)F.awaitDrain=0,D.emit("data",$);else{if(F.length+=F.objectMode?1:$.length,J)F.buffer.unshift($);else F.buffer.push($);if(F.needReadable)n7(D)}aB(D,F)}function c30(D,F){var $;if(!f30(F)&&typeof F!=="string"&&F!==void 0&&!D.objectMode)$=new u30("chunk",["string","Buffer","Uint8Array"],F);return $}R0.prototype.isPaused=function(){return this._readableState.flowing===!1};R0.prototype.setEncoding=function(D){if(!x3)x3=uB().StringDecoder;var F=new x3(D);this._readableState.decoder=F,this._readableState.encoding=this._readableState.decoder.encoding;var $=this._readableState.buffer.head,J="";while($!==null)J+=F.write($.data),$=$.next;if(this._readableState.buffer.clear(),J!=="")this._readableState.buffer.push(J);return this._readableState.length=J.length,this};var jO=1073741824;function n30(D){if(D>=jO)D=jO;else D--,D|=D>>>1,D|=D>>>2,D|=D>>>4,D|=D>>>8,D|=D>>>16,D++;return D}function TO(D,F){if(D<=0||F.length===0&&F.ended)return 0;if(F.objectMode)return 1;if(D!==D)if(F.flowing&&F.length)return F.buffer.head.data.length;else return F.length;if(D>F.highWaterMark)F.highWaterMark=n30(D);if(D<=F.length)return D;if(!F.ended)return F.needReadable=!0,0;return F.length}R0.prototype.read=function(D){q0("read",D),D=parseInt(D,10);var F=this._readableState,$=D;if(D!==0)F.emittedReadable=!1;if(D===0&&F.needReadable&&((F.highWaterMark!==0?F.length>=F.highWaterMark:F.length>0)||F.ended)){if(q0("read: emitReadable",F.length,F.ended),F.length===0&&F.ended)iB(this);else n7(this);return null}if(D=TO(D,F),D===0&&F.ended){if(F.length===0)iB(this);return null}var J=F.needReadable;if(q0("need readable",J),F.length===0||F.length-D<F.highWaterMark)J=!0,q0("length less than watermark",J);if(F.ended||F.reading)J=!1,q0("reading or ended",J);else if(J){if(q0("do read"),F.reading=!0,F.sync=!0,F.length===0)F.needReadable=!0;if(this._read(F.highWaterMark),F.sync=!1,!F.reading)D=TO($,F)}var Q;if(D>0)Q=yO(D,F);else Q=null;if(Q===null)F.needReadable=F.length<=F.highWaterMark,D=0;else F.length-=D,F.awaitDrain=0;if(F.length===0){if(!F.ended)F.needReadable=!0;if($!==D&&F.ended)iB(this)}if(Q!==null)this.emit("data",Q);return Q};function i30(D,F){if(q0("onEofChunk"),F.ended)return;if(F.decoder){var $=F.decoder.end();if($&&$.length)F.buffer.push($),F.length+=F.objectMode?1:$.length}if(F.ended=!0,F.sync)n7(D);else if(F.needReadable=!1,!F.emittedReadable)F.emittedReadable=!0,kO(D)}function n7(D){var F=D._readableState;if(q0("emitReadable",F.needReadable,F.emittedReadable),F.needReadable=!1,!F.emittedReadable)q0("emitReadable",F.flowing),F.emittedReadable=!0,process.nextTick(kO,D)}function kO(D){var F=D._readableState;if(q0("emitReadable_",F.destroyed,F.length,F.ended),!F.destroyed&&(F.length||F.ended))D.emit("readable"),F.emittedReadable=!1;F.needReadable=!F.flowing&&!F.ended&&F.length<=F.highWaterMark,sB(D)}function aB(D,F){if(!F.readingMore)F.readingMore=!0,process.nextTick(a30,D,F)}function a30(D,F){while(!F.reading&&!F.ended&&(F.length<F.highWaterMark||F.flowing&&F.length===0)){var $=F.length;if(q0("maybeReadMore read 0"),D.read(0),$===F.length)break}F.readingMore=!1}R0.prototype._read=function(D){L5(this,new l30("_read()"))};R0.prototype.pipe=function(D,F){var $=this,J=this._readableState;switch(J.pipesCount){case 0:J.pipes=D;break;case 1:J.pipes=[J.pipes,D];break;default:J.pipes.push(D);break}J.pipesCount+=1,q0("pipe count=%d opts=%j",J.pipesCount,F);var Q=(!F||F.end!==!1)&&D!==process.stdout&&D!==process.stderr,Y=Q?X:L;if(J.endEmitted)process.nextTick(Y);else $.once("end",Y);D.on("unpipe",B);function B(A,M){if(q0("onunpipe"),A===$){if(M&&M.hasUnpiped===!1)M.hasUnpiped=!0,q()}}function X(){q0("onend"),D.end()}var G=o30($);D.on("drain",G);var H=!1;function q(){if(q0("cleanup"),D.removeListener("close",E),D.removeListener("finish",Z),D.removeListener("drain",G),D.removeListener("error",V),D.removeListener("unpipe",B),$.removeListener("end",X),$.removeListener("end",L),$.removeListener("data",K),H=!0,J.awaitDrain&&(!D._writableState||D._writableState.needDrain))G()}$.on("data",K);function K(A){q0("ondata");var M=D.write(A);if(q0("dest.write",M),M===!1){if((J.pipesCount===1&&J.pipes===D||J.pipesCount>1&&xO(J.pipes,D)!==-1)&&!H)q0("false write response, pause",J.awaitDrain),J.awaitDrain++;$.pause()}}function V(A){if(q0("onerror",A),L(),D.removeListener("error",V),PO(D,"error")===0)L5(D,A)}d30(D,"error",V);function E(){D.removeListener("finish",Z),L()}D.once("close",E);function Z(){q0("onfinish"),D.removeListener("close",E),L()}D.once("finish",Z);function L(){q0("unpipe"),$.unpipe(D)}if(D.emit("pipe",$),!J.flowing)q0("pipe resume"),$.resume();return D};function o30(D){return function(){var $=D._readableState;if(q0("pipeOnDrain",$.awaitDrain),$.awaitDrain)$.awaitDrain--;if($.awaitDrain===0&&PO(D,"data"))$.flowing=!0,sB(D)}}R0.prototype.unpipe=function(D){var F=this._readableState,$={hasUnpiped:!1};if(F.pipesCount===0)return this;if(F.pipesCount===1){if(D&&D!==F.pipes)return this;if(!D)D=F.pipes;if(F.pipes=null,F.pipesCount=0,F.flowing=!1,D)D.emit("unpipe",this,$);return this}if(!D){var{pipes:J,pipesCount:Q}=F;F.pipes=null,F.pipesCount=0,F.flowing=!1;for(var Y=0;Y<Q;Y++)J[Y].emit("unpipe",this,{hasUnpiped:!1});return this}var B=xO(F.pipes,D);if(B===-1)return this;if(F.pipes.splice(B,1),F.pipesCount-=1,F.pipesCount===1)F.pipes=F.pipes[0];return D.emit("unpipe",this,$),this};R0.prototype.on=function(D,F){var $=A5.prototype.on.call(this,D,F),J=this._readableState;if(D==="data"){if(J.readableListening=this.listenerCount("readable")>0,J.flowing!==!1)this.resume()}else if(D==="readable"){if(!J.endEmitted&&!J.readableListening){if(J.readableListening=J.needReadable=!0,J.flowing=!1,J.emittedReadable=!1,q0("on readable",J.length,J.reading),J.length)n7(this);else if(!J.reading)process.nextTick(s30,this)}}return $};R0.prototype.addListener=R0.prototype.on;R0.prototype.removeListener=function(D,F){var $=A5.prototype.removeListener.call(this,D,F);if(D==="readable")process.nextTick(vO,this);return $};R0.prototype.removeAllListeners=function(D){var F=A5.prototype.removeAllListeners.apply(this,arguments);if(D==="readable"||D===void 0)process.nextTick(vO,this);return F};function vO(D){var F=D._readableState;if(F.readableListening=D.listenerCount("readable")>0,F.resumeScheduled&&!F.paused)F.flowing=!0;else if(D.listenerCount("data")>0)D.resume()}function s30(D){q0("readable nexttick read 0"),D.read(0)}R0.prototype.resume=function(){var D=this._readableState;if(!D.flowing)q0("resume"),D.flowing=!D.readableListening,r30(this,D);return D.paused=!1,this};function r30(D,F){if(!F.resumeScheduled)F.resumeScheduled=!0,process.nextTick(t30,D,F)}function t30(D,F){if(q0("resume",F.reading),!F.reading)D.read(0);if(F.resumeScheduled=!1,D.emit("resume"),sB(D),F.flowing&&!F.reading)D.read(0)}R0.prototype.pause=function(){if(q0("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)q0("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState.paused=!0,this};function sB(D){var F=D._readableState;q0("flow",F.flowing);while(F.flowing&&D.read()!==null);}R0.prototype.wrap=function(D){var F=this,$=this._readableState,J=!1;D.on("end",function(){if(q0("wrapped end"),$.decoder&&!$.ended){var B=$.decoder.end();if(B&&B.length)F.push(B)}F.push(null)}),D.on("data",function(B){if(q0("wrapped data"),$.decoder)B=$.decoder.write(B);if($.objectMode&&(B===null||B===void 0))return;else if(!$.objectMode&&(!B||!B.length))return;var X=F.push(B);if(!X)J=!0,D.pause()});for(var Q in D)if(this[Q]===void 0&&typeof D[Q]==="function")this[Q]=function(X){return function(){return D[X].apply(D,arguments)}}(Q);for(var Y=0;Y<cB.length;Y++)D.on(cB[Y],this.emit.bind(this,cB[Y]));return this._read=function(B){if(q0("wrapped _read",B),J)J=!1,D.resume()},this};if(typeof Symbol==="function")R0.prototype[Symbol.asyncIterator]=function(){if(pB===void 0)pB=NO();return pB(this)};Object.defineProperty(R0.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(R0.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(R0.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(F){if(this._readableState)this._readableState.flowing=F}});R0._fromList=yO;Object.defineProperty(R0.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function yO(D,F){if(F.length===0)return null;var $;if(F.objectMode)$=F.buffer.shift();else if(!D||D>=F.length){if(F.decoder)$=F.buffer.join("");else if(F.buffer.length===1)$=F.buffer.first();else $=F.buffer.concat(F.length);F.buffer.clear()}else $=F.buffer.consume(D,F.decoder);return $}function iB(D){var F=D._readableState;if(q0("endReadable",F.endEmitted),!F.endEmitted)F.ended=!0,process.nextTick(e30,F,D)}function e30(D,F){if(q0("endReadableNT",D.endEmitted,D.length),!D.endEmitted&&D.length===0){if(D.endEmitted=!0,F.readable=!1,F.emit("end"),D.autoDestroy){var $=F._writableState;if(!$||$.autoDestroy&&$.finished)F.destroy()}}}if(typeof Symbol==="function")R0.from=function(D,F){if(dB===void 0)dB=wO();return dB(R0,D,F)};function xO(D,F){for(var $=0,J=D.length;$<J;$++)if(D[$]===F)return $;return-1}});var rB=z((HR0,gO)=>{gO.exports=x8;var i7=j6().codes,DF0=i7.ERR_METHOD_NOT_IMPLEMENTED,FF0=i7.ERR_MULTIPLE_CALLBACK,$F0=i7.ERR_TRANSFORM_ALREADY_TRANSFORMING,JF0=i7.ERR_TRANSFORM_WITH_LENGTH_0,a7=Y4();Q4()(x8,a7);function QF0(D,F){var $=this._transformState;$.transforming=!1;var J=$.writecb;if(J===null)return this.emit("error",new FF0);if($.writechunk=null,$.writecb=null,F!=null)this.push(F);J(D);var Q=this._readableState;if(Q.reading=!1,Q.needReadable||Q.length<Q.highWaterMark)this._read(Q.highWaterMark)}function x8(D){if(!(this instanceof x8))return new x8(D);if(a7.call(this,D),this._transformState={afterTransform:QF0.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,D){if(typeof D.transform==="function")this._transform=D.transform;if(typeof D.flush==="function")this._flush=D.flush}this.on("prefinish",YF0)}function YF0(){var D=this;if(typeof this._flush==="function"&&!this._readableState.destroyed)this._flush(function(F,$){fO(D,F,$)});else fO(this,null,null)}x8.prototype.push=function(D,F){return this._transformState.needTransform=!1,a7.prototype.push.call(this,D,F)};x8.prototype._transform=function(D,F,$){$(new DF0("_transform()"))};x8.prototype._write=function(D,F,$){var J=this._transformState;if(J.writecb=$,J.writechunk=D,J.writeencoding=F,!J.transforming){var Q=this._readableState;if(J.needTransform||Q.needReadable||Q.length<Q.highWaterMark)this._read(Q.highWaterMark)}};x8.prototype._read=function(D){var F=this._transformState;if(F.writechunk!==null&&!F.transforming)F.transforming=!0,this._transform(F.writechunk,F.writeencoding,F.afterTransform);else F.needTransform=!0};x8.prototype._destroy=function(D,F){a7.prototype._destroy.call(this,D,function($){F($)})};function fO(D,F,$){if(F)return D.emit("error",F);if($!=null)D.push($);if(D._writableState.length)throw new JF0;if(D._transformState.transforming)throw new $F0;return D.push(null)}});var uO=z((qR0,bO)=>{bO.exports=M5;var hO=rB();Q4()(M5,hO);function M5(D){if(!(this instanceof M5))return new M5(D);hO.call(this,D)}M5.prototype._transform=function(D,F,$){$(null,D)}});var cO=z((KR0,dO)=>{var tB;function BF0(D){var F=!1;return function(){if(F)return;F=!0,D.apply(void 0,arguments)}}var pO=j6().codes,XF0=pO.ERR_MISSING_ARGS,GF0=pO.ERR_STREAM_DESTROYED;function mO(D){if(D)throw D}function WF0(D){return D.setHeader&&typeof D.abort==="function"}function HF0(D,F,$,J){J=BF0(J);var Q=!1;if(D.on("close",function(){Q=!0}),tB===void 0)tB=m7();tB(D,{readable:F,writable:$},function(B){if(B)return J(B);Q=!0,J()});var Y=!1;return function(B){if(Q)return;if(Y)return;if(Y=!0,WF0(D))return D.abort();if(typeof D.destroy==="function")return D.destroy();J(B||new GF0("pipe"))}}function lO(D){D()}function qF0(D,F){return D.pipe(F)}function KF0(D){if(!D.length)return mO;if(typeof D[D.length-1]!=="function")return mO;return D.pop()}function zF0(){for(var D=arguments.length,F=Array(D),$=0;$<D;$++)F[$]=arguments[$];var J=KF0(F);if(Array.isArray(F[0]))F=F[0];if(F.length<2)throw new XF0("streams");var Q,Y=F.map(function(B,X){var G=X<F.length-1,H=X>0;return HF0(B,G,H,function(q){if(!Q)Q=q;if(q)Y.forEach(lO);if(G)return;Y.forEach(lO),J(Q)})});return F.reduce(qF0)}dO.exports=zF0});var nO=z((V1,R5)=>{var N5=K0("stream");if(process.env.READABLE_STREAM==="disable"&&N5)R5.exports=N5.Readable,Object.assign(R5.exports,N5),R5.exports.Stream=N5;else V1=R5.exports=fB(),V1.Stream=N5||V1,V1.Readable=V1,V1.Writable=xB(),V1.Duplex=Y4(),V1.Transform=rB(),V1.PassThrough=uO(),V1.finished=m7(),V1.pipeline=cO()});var oO=z((zR0,aO)=>{var{Buffer:k1}=K0("buffer"),iO=Symbol.for("BufferList");function g0(D){if(!(this instanceof g0))return new g0(D);g0._init.call(this,D)}g0._init=function(F){if(Object.defineProperty(this,iO,{value:!0}),this._bufs=[],this.length=0,F)this.append(F)};g0.prototype._new=function(F){return new g0(F)};g0.prototype._offset=function(F){if(F===0)return[0,0];let $=0;for(let J=0;J<this._bufs.length;J++){let Q=$+this._bufs[J].length;if(F<Q||J===this._bufs.length-1)return[J,F-$];$=Q}};g0.prototype._reverseOffset=function(D){let F=D[0],$=D[1];for(let J=0;J<F;J++)$+=this._bufs[J].length;return $};g0.prototype.get=function(F){if(F>this.length||F<0)return;let $=this._offset(F);return this._bufs[$[0]][$[1]]};g0.prototype.slice=function(F,$){if(typeof F==="number"&&F<0)F+=this.length;if(typeof $==="number"&&$<0)$+=this.length;return this.copy(null,0,F,$)};g0.prototype.copy=function(F,$,J,Q){if(typeof J!=="number"||J<0)J=0;if(typeof Q!=="number"||Q>this.length)Q=this.length;if(J>=this.length)return F||k1.alloc(0);if(Q<=0)return F||k1.alloc(0);let Y=!!F,B=this._offset(J),X=Q-J,G=X,H=Y&&$||0,q=B[1];if(J===0&&Q===this.length){if(!Y)return this._bufs.length===1?this._bufs[0]:k1.concat(this._bufs,this.length);for(let K=0;K<this._bufs.length;K++)this._bufs[K].copy(F,H),H+=this._bufs[K].length;return F}if(G<=this._bufs[B[0]].length-q)return Y?this._bufs[B[0]].copy(F,$,q,q+G):this._bufs[B[0]].slice(q,q+G);if(!Y)F=k1.allocUnsafe(X);for(let K=B[0];K<this._bufs.length;K++){let V=this._bufs[K].length-q;if(G>V)this._bufs[K].copy(F,H,q),H+=V;else{this._bufs[K].copy(F,H,q,q+G),H+=V;break}if(G-=V,q)q=0}if(F.length>H)return F.slice(0,H);return F};g0.prototype.shallowSlice=function(F,$){if(F=F||0,$=typeof $!=="number"?this.length:$,F<0)F+=this.length;if($<0)$+=this.length;if(F===$)return this._new();let J=this._offset(F),Q=this._offset($),Y=this._bufs.slice(J[0],Q[0]+1);if(Q[1]===0)Y.pop();else Y[Y.length-1]=Y[Y.length-1].slice(0,Q[1]);if(J[1]!==0)Y[0]=Y[0].slice(J[1]);return this._new(Y)};g0.prototype.toString=function(F,$,J){return this.slice($,J).toString(F)};g0.prototype.consume=function(F){if(F=Math.trunc(F),Number.isNaN(F)||F<=0)return this;while(this._bufs.length)if(F>=this._bufs[0].length)F-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(F),this.length-=F;break}return this};g0.prototype.duplicate=function(){let F=this._new();for(let $=0;$<this._bufs.length;$++)F.append(this._bufs[$]);return F};g0.prototype.append=function(F){if(F==null)return this;if(F.buffer)this._appendBuffer(k1.from(F.buffer,F.byteOffset,F.byteLength));else if(Array.isArray(F))for(let $=0;$<F.length;$++)this.append(F[$]);else if(this._isBufferList(F))for(let $=0;$<F._bufs.length;$++)this.append(F._bufs[$]);else{if(typeof F==="number")F=F.toString();this._appendBuffer(k1.from(F))}return this};g0.prototype._appendBuffer=function(F){this._bufs.push(F),this.length+=F.length};g0.prototype.indexOf=function(D,F,$){if($===void 0&&typeof F==="string")$=F,F=void 0;if(typeof D==="function"||Array.isArray(D))throw TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');else if(typeof D==="number")D=k1.from([D]);else if(typeof D==="string")D=k1.from(D,$);else if(this._isBufferList(D))D=D.slice();else if(Array.isArray(D.buffer))D=k1.from(D.buffer,D.byteOffset,D.byteLength);else if(!k1.isBuffer(D))D=k1.from(D);if(F=Number(F||0),isNaN(F))F=0;if(F<0)F=this.length+F;if(F<0)F=0;if(D.length===0)return F>this.length?this.length:F;let J=this._offset(F),Q=J[0],Y=J[1];for(;Q<this._bufs.length;Q++){let B=this._bufs[Q];while(Y<B.length)if(B.length-Y>=D.length){let G=B.indexOf(D,Y);if(G!==-1)return this._reverseOffset([Q,G]);Y=B.length-D.length+1}else{let G=this._reverseOffset([Q,Y]);if(this._match(G,D))return G;Y++}Y=0}return-1};g0.prototype._match=function(D,F){if(this.length-D<F.length)return!1;for(let $=0;$<F.length;$++)if(this.get(D+$)!==F[$])return!1;return!0};(function(){let D={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let F in D)(function($){if(D[$]===null)g0.prototype[$]=function(J,Q){return this.slice(J,J+Q)[$](0,Q)};else g0.prototype[$]=function(J=0){return this.slice(J,J+D[$])[$](0)}})(F)})();g0.prototype._isBufferList=function(F){return F instanceof g0||g0.isBufferList(F)};g0.isBufferList=function(F){return F!=null&&F[iO]};aO.exports=g0});var sO=z((ER0,o7)=>{var eB=nO().Duplex,EF0=Q4(),C5=oO();function wD(D){if(!(this instanceof wD))return new wD(D);if(typeof D==="function"){this._callback=D;let F=function(J){if(this._callback)this._callback(J),this._callback=null}.bind(this);this.on("pipe",function(J){J.on("error",F)}),this.on("unpipe",function(J){J.removeListener("error",F)}),D=null}C5._init.call(this,D),eB.call(this)}EF0(wD,eB);Object.assign(wD.prototype,C5.prototype);wD.prototype._new=function(F){return new wD(F)};wD.prototype._write=function(F,$,J){if(this._appendBuffer(F),typeof J==="function")J()};wD.prototype._read=function(F){if(!this.length)return this.push(null);F=Math.min(F,this.length),this.push(this.slice(0,F)),this.consume(F)};wD.prototype.end=function(F){if(eB.prototype.end.call(this,F),this._callback)this._callback(null,this.slice()),this._callback=null};wD.prototype._destroy=function(F,$){this._bufs.length=0,this.length=0,$(F)};wD.prototype._isBufferList=function(F){return F instanceof wD||F instanceof C5||wD.isBufferList(F)};wD.isBufferList=C5.isBufferList;o7.exports=wD;o7.exports.BufferListStream=wD;o7.exports.BufferList=C5});var eO=z((VR0,J2)=>{var VF0=K0("readline"),ZF0=LB(),rO=jC(),s7=v7(),r7=vC(),UF0=Q5(),LF0=mC(),AF0=pC(),MF0=OB(),{BufferListStream:NF0}=sO(),D2=Symbol("text"),F2=Symbol("prefixText");class tO{constructor(){this.requests=0,this.mutedStream=new NF0,this.mutedStream.pipe(process.stdout);let D=this;this.ourEmit=function(F,$,...J){let{stdin:Q}=process;if(D.requests>0||Q.emit===D.ourEmit){if(F==="keypress")return;if(F==="data"&&$.includes(3))process.emit("SIGINT");Reflect.apply(D.oldEmit,this,[F,$,...J])}else Reflect.apply(process.stdin.emit,this,[F,$,...J])}}start(){if(this.requests++,this.requests===1)this.realStart()}stop(){if(this.requests<=0)throw Error("`stop` called more times than `start`");if(this.requests--,this.requests===0)this.realStop()}realStart(){if(process.platform==="win32")return;this.rl=VF0.createInterface({input:process.stdin,output:this.mutedStream}),this.rl.on("SIGINT",()=>{if(process.listenerCount("SIGINT")===0)process.emit("SIGINT");else this.rl.close(),process.kill(process.pid,"SIGINT")})}realStop(){if(process.platform==="win32")return;this.rl.close(),this.rl=void 0}}var t7;class $2{constructor(D){if(!t7)t7=new tO;if(typeof D==="string")D={text:D};this.options={text:"",color:"cyan",stream:process.stderr,discardStdin:!0,...D},this.spinner=this.options.spinner,this.color=this.options.color,this.hideCursor=this.options.hideCursor!==!1,this.interval=this.options.interval||this.spinner.interval||100,this.stream=this.options.stream,this.id=void 0,this.isEnabled=typeof this.options.isEnabled==="boolean"?this.options.isEnabled:AF0({stream:this.stream}),this.isSilent=typeof this.options.isSilent==="boolean"?this.options.isSilent:!1,this.text=this.options.text,this.prefixText=this.options.prefixText,this.linesToClear=0,this.indent=this.options.indent,this.discardStdin=this.options.discardStdin,this.isDiscardingStdin=!1}get indent(){return this._indent}set indent(D=0){if(!(D>=0&&Number.isInteger(D)))throw Error("The `indent` option must be an integer from 0 and up");this._indent=D}_updateInterval(D){if(D!==void 0)this.interval=D}get spinner(){return this._spinner}set spinner(D){if(this.frameIndex=0,typeof D==="object"){if(D.frames===void 0)throw Error("The given spinner must have a `frames` property");this._spinner=D}else if(!MF0())this._spinner=s7.line;else if(D===void 0)this._spinner=s7.dots;else if(D!=="default"&&s7[D])this._spinner=s7[D];else throw Error(`There is no built-in spinner named '${D}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);this._updateInterval(this._spinner.interval)}get text(){return this[D2]}set text(D){this[D2]=D,this.updateLineCount()}get prefixText(){return this[F2]}set prefixText(D){this[F2]=D,this.updateLineCount()}get isSpinning(){return this.id!==void 0}getFullPrefixText(D=this[F2],F=" "){if(typeof D==="string")return D+F;if(typeof D==="function")return D()+F;return""}updateLineCount(){let D=this.stream.columns||80,F=this.getFullPrefixText(this.prefixText,"-");this.lineCount=0;for(let $ of UF0(F+"--"+this[D2]).split(`
45
+ `);if(Y!==-1)F=l60(F,Q,J,Y);return J+F+Q},EB,EC=(D,...F)=>{let[$]=F;if(!N7($)||!N7($.raw))return F.join(" ");let J=F.slice(1),Q=[$.raw[0]];for(let Y=1;Y<$.length;Y++)Q.push(String(J[Y-1]).replace(/[{}\\]/g,"\\$&"),String($.raw[Y]));if(EB===void 0)EB=GC();return EB(D,Q.join(""))};Object.defineProperties(R7.prototype,P3);var O7=R7();O7.supportsColor=VB;O7.stderr=R7({level:ZB?ZB.level:0});O7.stderr.supportsColor=ZB;VC.exports=O7});var UC=z((_N0,AB)=>{var ZC=(D,F)=>{for(let $ of Reflect.ownKeys(F))Object.defineProperty(D,$,Object.getOwnPropertyDescriptor(F,$));return D};AB.exports=ZC;AB.exports.default=ZC});var AC=z((fN0,j7)=>{var c60=UC(),w7=new WeakMap,LC=(D,F={})=>{if(typeof D!=="function")throw TypeError("Expected a function");let $,J=0,Q=D.displayName||D.name||"<anonymous>",Y=function(...B){if(w7.set(Y,++J),J===1)$=D.apply(this,B),D=null;else if(F.throw===!0)throw Error(`Function \`${Q}\` can only be called once`);return $};return c60(Y,D),w7.set(Y,J),Y};j7.exports=LC;j7.exports.default=LC;j7.exports.callCount=(D)=>{if(!w7.has(D))throw Error(`The given function \`${D.name}\` is not wrapped by the \`onetime\` package`);return w7.get(D)}});var MC=z((gN0,T7)=>{T7.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")T7.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")T7.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var NC=z((hN0,S3)=>{var c0=global.process,F4=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!F4(c0))S3.exports=function(){return function(){}};else{if(MB=K0("assert"),$4=MC(),NB=/^win/i.test(c0.platform),I3=K0("events"),typeof I3!=="function")I3=I3.EventEmitter;if(c0.__signal_exit_emitter__)WD=c0.__signal_exit_emitter__;else WD=c0.__signal_exit_emitter__=new I3,WD.count=0,WD.emitted={};if(!WD.infinite)WD.setMaxListeners(1/0),WD.infinite=!0;S3.exports=function(D,F){if(!F4(global.process))return function(){};if(MB.equal(typeof D,"function","a callback must be provided for exit handler"),J4===!1)P7();var $="exit";if(F&&F.alwaysLast)$="afterexit";var J=function(){if(WD.removeListener($,D),WD.listeners("exit").length===0&&WD.listeners("afterexit").length===0)G5()};return WD.on($,D),J},G5=function(){if(!J4||!F4(global.process))return;J4=!1,$4.forEach(function(F){try{c0.removeListener(F,W5[F])}catch($){}}),c0.emit=H5,c0.reallyExit=I7,WD.count-=1},S3.exports.unload=G5,O6=function(F,$,J){if(WD.emitted[F])return;WD.emitted[F]=!0,WD.emit(F,$,J)},W5={},$4.forEach(function(D){W5[D]=function(){if(!F4(global.process))return;var $=c0.listeners(D);if($.length===WD.count){if(G5(),O6("exit",null,D),O6("afterexit",null,D),NB&&D==="SIGHUP")D="SIGINT";c0.kill(c0.pid,D)}}}),S3.exports.signals=function(){return $4},J4=!1,P7=function(){if(J4||!F4(global.process))return;J4=!0,WD.count+=1,$4=$4.filter(function(F){try{return c0.on(F,W5[F]),!0}catch($){return!1}}),c0.emit=CB,c0.reallyExit=RB},S3.exports.load=P7,I7=c0.reallyExit,RB=function(F){if(!F4(global.process))return;c0.exitCode=F||0,O6("exit",c0.exitCode,null),O6("afterexit",c0.exitCode,null),I7.call(c0,c0.exitCode)},H5=c0.emit,CB=function(F,$){if(F==="exit"&&F4(global.process)){if($!==void 0)c0.exitCode=$;var J=H5.apply(this,arguments);return O6("exit",c0.exitCode,null),O6("afterexit",c0.exitCode,null),J}else return H5.apply(this,arguments)}}var MB,$4,NB,I3,WD,G5,O6,W5,J4,P7,I7,RB,H5,CB});var CC=z((bN0,RC)=>{var n60=AC(),i60=NC();RC.exports=n60(()=>{i60(()=>{process.stderr.write("\x1B[?25h")},{alwaysLast:!0})})});var jC=z((o60)=>{var a60=CC(),S7=!1;o60.show=(D=process.stderr)=>{if(!D.isTTY)return;S7=!1,D.write("\x1B[?25h")};o60.hide=(D=process.stderr)=>{if(!D.isTTY)return;a60(),S7=!0,D.write("\x1B[?25l")};o60.toggle=(D,F)=>{if(D!==void 0)S7=D;if(S7)o60.show(F);else o60.hide(F)}});var TC=z((mN0,r60)=>{r60.exports={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\uD83D\uDE04 ","\uD83D\uDE1D "]},monkey:{interval:300,frames:["\uD83D\uDE48 ","\uD83D\uDE48 ","\uD83D\uDE49 ","\uD83D\uDE4A "]},hearts:{interval:100,frames:["\uD83D\uDC9B ","\uD83D\uDC99 ","\uD83D\uDC9C ","\uD83D\uDC9A ","\u2764\uFE0F "]},clock:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD50 ","\uD83D\uDD51 ","\uD83D\uDD52 ","\uD83D\uDD53 ","\uD83D\uDD54 ","\uD83D\uDD55 ","\uD83D\uDD56 ","\uD83D\uDD57 ","\uD83D\uDD58 ","\uD83D\uDD59 ","\uD83D\uDD5A "]},earth:{interval:180,frames:["\uD83C\uDF0D ","\uD83C\uDF0E ","\uD83C\uDF0F "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\uD83C\uDF11 ","\uD83C\uDF12 ","\uD83C\uDF13 ","\uD83C\uDF14 ","\uD83C\uDF15 ","\uD83C\uDF16 ","\uD83C\uDF17 ","\uD83C\uDF18 "]},runner:{interval:140,frames:["\uD83D\uDEB6 ","\uD83C\uDFC3 "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\uD83C\uDF24 ","\u26C5\uFE0F ","\uD83C\uDF25 ","\u2601\uFE0F ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u26C8 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\u2601\uFE0F ","\uD83C\uDF25 ","\u26C5\uFE0F ","\uD83C\uDF24 ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\uD83C\uDF32","\uD83C\uDF84"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\uD83E\uDD18 ","\uD83E\uDD1F ","\uD83D\uDD96 ","\u270B ","\uD83E\uDD1A ","\uD83D\uDC46 "]},fistBump:{interval:80,frames:["\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\uD83E\uDD1C\u3000\u3000\u3000\u3000\uD83E\uDD1B ","\u3000\uD83E\uDD1C\u3000\u3000\uD83E\uDD1B\u3000 ","\u3000\u3000\uD83E\uDD1C\uD83E\uDD1B\u3000\u3000 ","\u3000\uD83E\uDD1C\u2728\uD83E\uDD1B\u3000\u3000 ","\uD83E\uDD1C\u3000\u2728\u3000\uD83E\uDD1B\u3000 "]},soccerHeader:{interval:80,frames:[" \uD83E\uDDD1\u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F\uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 ","\uD83E\uDDD1 \u26BD\uFE0F \uD83E\uDDD1 "]},mindblown:{interval:160,frames:["\uD83D\uDE10 ","\uD83D\uDE10 ","\uD83D\uDE2E ","\uD83D\uDE2E ","\uD83D\uDE26 ","\uD83D\uDE26 ","\uD83D\uDE27 ","\uD83D\uDE27 ","\uD83E\uDD2F ","\uD83D\uDCA5 ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\uD83D\uDD08 ","\uD83D\uDD09 ","\uD83D\uDD0A ","\uD83D\uDD09 "]},orangePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 "]},bluePulse:{interval:100,frames:["\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},orangeBluePulse:{interval:100,frames:["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 ","\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},timeTravel:{interval:100,frames:["\uD83D\uDD5B ","\uD83D\uDD5A ","\uD83D\uDD59 ","\uD83D\uDD58 ","\uD83D\uDD57 ","\uD83D\uDD56 ","\uD83D\uDD55 ","\uD83D\uDD54 ","\uD83D\uDD53 ","\uD83D\uDD52 ","\uD83D\uDD51 ","\uD83D\uDD50 "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}}});var v7=z((lN0,IC)=>{var k7=Object.assign({},TC()),PC=Object.keys(k7);Object.defineProperty(k7,"random",{get(){let D=Math.floor(Math.random()*PC.length),F=PC[D];return k7[F]}});IC.exports=k7});var OB=z((pN0,SC)=>{SC.exports=()=>{if(process.platform!=="win32")return!0;return Boolean(process.env.CI)||Boolean(process.env.WT_SESSION)||process.env.TERM_PROGRAM==="vscode"||process.env.TERM==="xterm-256color"||process.env.TERM==="alacritty"}});var vC=z((dN0,kC)=>{var w6=LB(),t60=OB(),e60={info:w6.blue("\u2139"),success:w6.green("\u2714"),warning:w6.yellow("\u26A0"),error:w6.red("\u2716")},D40={info:w6.blue("i"),success:w6.green("\u221A"),warning:w6.yellow("\u203C"),error:w6.red("\xD7")};kC.exports=t60()?e60:D40});var yC=z((cN0,y7)=>{var F40=function(){function D(B,X,G,H){var q;if(typeof X==="object")G=X.depth,H=X.prototype,q=X.filter,X=X.circular;var K=[],V=[],E=typeof Buffer<"u";if(typeof X>"u")X=!0;if(typeof G>"u")G=1/0;function Z(L,M){if(L===null)return null;if(M==0)return L;var A,N;if(typeof L!="object")return L;if(D.__isArray(L))A=[];else if(D.__isRegExp(L)){if(A=new RegExp(L.source,Y(L)),L.lastIndex)A.lastIndex=L.lastIndex}else if(D.__isDate(L))A=new Date(L.getTime());else if(E&&Buffer.isBuffer(L)){if(Buffer.allocUnsafe)A=Buffer.allocUnsafe(L.length);else A=new Buffer(L.length);return L.copy(A),A}else if(typeof H>"u")N=Object.getPrototypeOf(L),A=Object.create(N);else A=Object.create(H),N=H;if(X){var w=K.indexOf(L);if(w!=-1)return V[w];K.push(L),V.push(A)}for(var P in L){var C;if(N)C=Object.getOwnPropertyDescriptor(N,P);if(C&&C.set==null)continue;A[P]=Z(L[P],M-1)}return A}return Z(B,G)}D.clonePrototype=function(X){if(X===null)return null;var G=function(){};return G.prototype=X,new G};function F(B){return Object.prototype.toString.call(B)}D.__objToStr=F;function $(B){return typeof B==="object"&&F(B)==="[object Date]"}D.__isDate=$;function J(B){return typeof B==="object"&&F(B)==="[object Array]"}D.__isArray=J;function Q(B){return typeof B==="object"&&F(B)==="[object RegExp]"}D.__isRegExp=Q;function Y(B){var X="";if(B.global)X+="g";if(B.ignoreCase)X+="i";if(B.multiline)X+="m";return X}return D.__getRegExpFlags=Y,D}();if(typeof y7==="object"&&y7.exports)y7.exports=F40});var _C=z((nN0,xC)=>{var $40=yC();xC.exports=function(D,F){return D=D||{},Object.keys(F).forEach(function($){if(typeof D[$]>"u")D[$]=$40(F[$])}),D}});var gC=z((iN0,fC)=>{fC.exports=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]]});var mC=z((aN0,wB)=>{var J40=_C(),q5=gC(),bC={nul:0,control:0};wB.exports=function(F){return uC(F,bC)};wB.exports.config=function(D){return D=J40(D||{},bC),function($){return uC($,D)}};function uC(D,F){if(typeof D!=="string")return hC(D,F);var $=0;for(var J=0;J<D.length;J++){var Q=hC(D.charCodeAt(J),F);if(Q<0)return-1;$+=Q}return $}function hC(D,F){if(D===0)return F.nul;if(D<32||D>=127&&D<160)return F.control;if(Q40(D))return 0;return 1+(D>=4352&&(D<=4447||D==9001||D==9002||D>=11904&&D<=42191&&D!=12351||D>=44032&&D<=55203||D>=63744&&D<=64255||D>=65040&&D<=65049||D>=65072&&D<=65135||D>=65280&&D<=65376||D>=65504&&D<=65510||D>=131072&&D<=196605||D>=196608&&D<=262141))}function Q40(D){var F=0,$=q5.length-1,J;if(D<q5[0][0]||D>q5[$][1])return!1;while($>=F)if(J=Math.floor((F+$)/2),D>q5[J][1])F=J+1;else if(D<q5[J][0])$=J-1;else return!0;return!1}});var pC=z((oN0,lC)=>{lC.exports=({stream:D=process.stdout}={})=>{return Boolean(D&&D.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}});var oC=z((sN0,aC)=>{function dC(D,F){var $=Object.keys(D);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(D);F&&(J=J.filter(function(Q){return Object.getOwnPropertyDescriptor(D,Q).enumerable})),$.push.apply($,J)}return $}function cC(D){for(var F=1;F<arguments.length;F++){var $=arguments[F]!=null?arguments[F]:{};F%2?dC(Object($),!0).forEach(function(J){Y40(D,J,$[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors($)):dC(Object($)).forEach(function(J){Object.defineProperty(D,J,Object.getOwnPropertyDescriptor($,J))})}return D}function Y40(D,F,$){if(F=iC(F),F in D)Object.defineProperty(D,F,{value:$,enumerable:!0,configurable:!0,writable:!0});else D[F]=$;return D}function B40(D,F){if(!(D instanceof F))throw TypeError("Cannot call a class as a function")}function nC(D,F){for(var $=0;$<F.length;$++){var J=F[$];if(J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J)J.writable=!0;Object.defineProperty(D,iC(J.key),J)}}function X40(D,F,$){if(F)nC(D.prototype,F);if($)nC(D,$);return Object.defineProperty(D,"prototype",{writable:!1}),D}function iC(D){var F=G40(D,"string");return typeof F==="symbol"?F:String(F)}function G40(D,F){if(typeof D!=="object"||D===null)return D;var $=D[Symbol.toPrimitive];if($!==void 0){var J=$.call(D,F||"default");if(typeof J!=="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(F==="string"?String:Number)(D)}var W40=K0("buffer"),x7=W40.Buffer,H40=K0("util"),jB=H40.inspect,q40=jB&&jB.custom||"inspect";function K40(D,F,$){x7.prototype.copy.call(D,F,$)}aC.exports=function(){function D(){B40(this,D),this.head=null,this.tail=null,this.length=0}return X40(D,[{key:"push",value:function($){var J={data:$,next:null};if(this.length>0)this.tail.next=J;else this.head=J;this.tail=J,++this.length}},{key:"unshift",value:function($){var J={data:$,next:this.head};if(this.length===0)this.tail=J;this.head=J,++this.length}},{key:"shift",value:function(){if(this.length===0)return;var $=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,$}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function($){if(this.length===0)return"";var J=this.head,Q=""+J.data;while(J=J.next)Q+=$+J.data;return Q}},{key:"concat",value:function($){if(this.length===0)return x7.alloc(0);var J=x7.allocUnsafe($>>>0),Q=this.head,Y=0;while(Q)K40(Q.data,J,Y),Y+=Q.data.length,Q=Q.next;return J}},{key:"consume",value:function($,J){var Q;if($<this.head.data.length)Q=this.head.data.slice(0,$),this.head.data=this.head.data.slice($);else if($===this.head.data.length)Q=this.shift();else Q=J?this._getString($):this._getBuffer($);return Q}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function($){var J=this.head,Q=1,Y=J.data;$-=Y.length;while(J=J.next){var B=J.data,X=$>B.length?B.length:$;if(X===B.length)Y+=B;else Y+=B.slice(0,$);if($-=X,$===0){if(X===B.length)if(++Q,J.next)this.head=J.next;else this.head=this.tail=null;else this.head=J,J.data=B.slice(X);break}++Q}return this.length-=Q,Y}},{key:"_getBuffer",value:function($){var J=x7.allocUnsafe($),Q=this.head,Y=1;Q.data.copy(J),$-=Q.data.length;while(Q=Q.next){var B=Q.data,X=$>B.length?B.length:$;if(B.copy(J,J.length-$,0,X),$-=X,$===0){if(X===B.length)if(++Y,Q.next)this.head=Q.next;else this.head=this.tail=null;else this.head=Q,Q.data=B.slice(X);break}++Y}return this.length-=Y,J}},{key:q40,value:function($,J){return jB(this,cC(cC({},J),{},{depth:0,customInspect:!1}))}}]),D}()});var PB=z((rN0,rC)=>{function z40(D,F){var $=this,J=this._readableState&&this._readableState.destroyed,Q=this._writableState&&this._writableState.destroyed;if(J||Q){if(F)F(D);else if(D){if(!this._writableState)process.nextTick(TB,this,D);else if(!this._writableState.errorEmitted)this._writableState.errorEmitted=!0,process.nextTick(TB,this,D)}return this}if(this._readableState)this._readableState.destroyed=!0;if(this._writableState)this._writableState.destroyed=!0;return this._destroy(D||null,function(Y){if(!F&&Y)if(!$._writableState)process.nextTick(sC,$,Y);else if(!$._writableState.errorEmitted)$._writableState.errorEmitted=!0,process.nextTick(sC,$,Y);else process.nextTick(_7,$);else if(F)process.nextTick(_7,$),F(Y);else process.nextTick(_7,$)}),this}function sC(D,F){TB(D,F),_7(D)}function _7(D){if(D._writableState&&!D._writableState.emitClose)return;if(D._readableState&&!D._readableState.emitClose)return;D.emit("close")}function E40(){if(this._readableState)this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1;if(this._writableState)this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1}function TB(D,F){D.emit("error",F)}function V40(D,F){var{_readableState:$,_writableState:J}=D;if($&&$.autoDestroy||J&&J.autoDestroy)D.destroy(F);else D.emit("error",F)}rC.exports={destroy:z40,undestroy:E40,errorOrDestroy:V40}});var j6=z((A40,DO)=>{var eC={};function E1(D,F,$){if(!$)$=Error;function J(Y,B,X){if(typeof F==="string")return F;else return F(Y,B,X)}class Q extends ${constructor(Y,B,X){super(J(Y,B,X))}}Q.prototype.name=$.name,Q.prototype.code=D,eC[D]=Q}function tC(D,F){if(Array.isArray(D)){let $=D.length;if(D=D.map((J)=>String(J)),$>2)return`one of ${F} ${D.slice(0,$-1).join(", ")}, or `+D[$-1];else if($===2)return`one of ${F} ${D[0]} or ${D[1]}`;else return`of ${F} ${D[0]}`}else return`of ${F} ${String(D)}`}function Z40(D,F,$){return D.substr(!$||$<0?0:+$,F.length)===F}function U40(D,F,$){if($===void 0||$>D.length)$=D.length;return D.substring($-F.length,$)===F}function L40(D,F,$){if(typeof $!=="number")$=0;if($+F.length>D.length)return!1;else return D.indexOf(F,$)!==-1}E1("ERR_INVALID_OPT_VALUE",function(D,F){return'The value "'+F+'" is invalid for option "'+D+'"'},TypeError);E1("ERR_INVALID_ARG_TYPE",function(D,F,$){let J;if(typeof F==="string"&&Z40(F,"not "))J="must not be",F=F.replace(/^not /,"");else J="must be";let Q;if(U40(D," argument"))Q=`The ${D} ${J} ${tC(F,"type")}`;else{let Y=L40(D,".")?"property":"argument";Q=`The "${D}" ${Y} ${J} ${tC(F,"type")}`}return Q+=`. Received type ${typeof $}`,Q},TypeError);E1("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");E1("ERR_METHOD_NOT_IMPLEMENTED",function(D){return"The "+D+" method is not implemented"});E1("ERR_STREAM_PREMATURE_CLOSE","Premature close");E1("ERR_STREAM_DESTROYED",function(D){return"Cannot call "+D+" after a stream was destroyed"});E1("ERR_MULTIPLE_CALLBACK","Callback called multiple times");E1("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");E1("ERR_STREAM_WRITE_AFTER_END","write after end");E1("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);E1("ERR_UNKNOWN_ENCODING",function(D){return"Unknown encoding: "+D},TypeError);E1("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");A40.codes=eC});var IB=z((tN0,FO)=>{var N40=j6().codes.ERR_INVALID_OPT_VALUE;function R40(D,F,$){return D.highWaterMark!=null?D.highWaterMark:F?D[$]:null}function C40(D,F,$,J){var Q=R40(F,J,$);if(Q!=null){if(!(isFinite(Q)&&Math.floor(Q)===Q)||Q<0){var Y=J?$:"highWaterMark";throw new N40(Y,Q)}return Math.floor(Q)}return D.objectMode?16:16384}FO.exports={getHighWaterMark:C40}});var $O=z((eN0,SB)=>{if(typeof Object.create==="function")SB.exports=function(F,$){if($)F.super_=$,F.prototype=Object.create($.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}})};else SB.exports=function(F,$){if($){F.super_=$;var J=function(){};J.prototype=$.prototype,F.prototype=new J,F.prototype.constructor=F}}});var Q4=z((DR0,kB)=>{try{if(f7=K0("util"),typeof f7.inherits!=="function")throw"";kB.exports=f7.inherits}catch(D){kB.exports=$O()}var f7});var QO=z((FR0,JO)=>{JO.exports=K0("util").deprecate});var xB=z(($R0,HO)=>{HO.exports=DD;function BO(D){var F=this;this.next=null,this.entry=null,this.finish=function(){s40(F,D)}}var k3;DD.WritableState=z5;var O40={deprecate:QO()},XO=K0("stream"),h7=K0("buffer").Buffer,w40=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function j40(D){return h7.from(D)}function T40(D){return h7.isBuffer(D)||D instanceof w40}var yB=PB(),P40=IB(),I40=P40.getHighWaterMark,T6=j6().codes,S40=T6.ERR_INVALID_ARG_TYPE,k40=T6.ERR_METHOD_NOT_IMPLEMENTED,v40=T6.ERR_MULTIPLE_CALLBACK,y40=T6.ERR_STREAM_CANNOT_PIPE,x40=T6.ERR_STREAM_DESTROYED,_40=T6.ERR_STREAM_NULL_VALUES,f40=T6.ERR_STREAM_WRITE_AFTER_END,g40=T6.ERR_UNKNOWN_ENCODING,v3=yB.errorOrDestroy;Q4()(DD,XO);function h40(){}function z5(D,F,$){if(k3=k3||Y4(),D=D||{},typeof $!=="boolean")$=F instanceof k3;if(this.objectMode=!!D.objectMode,$)this.objectMode=this.objectMode||!!D.writableObjectMode;this.highWaterMark=I40(this,D,"writableHighWaterMark",$),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var J=D.decodeStrings===!1;this.decodeStrings=!J,this.defaultEncoding=D.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Q){c40(F,Q)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=D.emitClose!==!1,this.autoDestroy=!!D.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new BO(this)}z5.prototype.getBuffer=function(){var F=this.bufferedRequest,$=[];while(F)$.push(F),F=F.next;return $};(function(){try{Object.defineProperty(z5.prototype,"buffer",{get:O40.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(D){}})();var g7;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function")g7=Function.prototype[Symbol.hasInstance],Object.defineProperty(DD,Symbol.hasInstance,{value:function(F){if(g7.call(this,F))return!0;if(this!==DD)return!1;return F&&F._writableState instanceof z5}});else g7=function(F){return F instanceof this};function DD(D){k3=k3||Y4();var F=this instanceof k3;if(!F&&!g7.call(DD,this))return new DD(D);if(this._writableState=new z5(D,this,F),this.writable=!0,D){if(typeof D.write==="function")this._write=D.write;if(typeof D.writev==="function")this._writev=D.writev;if(typeof D.destroy==="function")this._destroy=D.destroy;if(typeof D.final==="function")this._final=D.final}XO.call(this)}DD.prototype.pipe=function(){v3(this,new y40)};function b40(D,F){var $=new f40;v3(D,$),process.nextTick(F,$)}function u40(D,F,$,J){var Q;if($===null)Q=new _40;else if(typeof $!=="string"&&!F.objectMode)Q=new S40("chunk",["string","Buffer"],$);if(Q)return v3(D,Q),process.nextTick(J,Q),!1;return!0}DD.prototype.write=function(D,F,$){var J=this._writableState,Q=!1,Y=!J.objectMode&&T40(D);if(Y&&!h7.isBuffer(D))D=j40(D);if(typeof F==="function")$=F,F=null;if(Y)F="buffer";else if(!F)F=J.defaultEncoding;if(typeof $!=="function")$=h40;if(J.ending)b40(this,$);else if(Y||u40(this,J,D,$))J.pendingcb++,Q=l40(this,J,Y,D,F,$);return Q};DD.prototype.cork=function(){this._writableState.corked++};DD.prototype.uncork=function(){var D=this._writableState;if(D.corked){if(D.corked--,!D.writing&&!D.corked&&!D.bufferProcessing&&D.bufferedRequest)GO(this,D)}};DD.prototype.setDefaultEncoding=function(F){if(typeof F==="string")F=F.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((F+"").toLowerCase())>-1))throw new g40(F);return this._writableState.defaultEncoding=F,this};Object.defineProperty(DD.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function m40(D,F,$){if(!D.objectMode&&D.decodeStrings!==!1&&typeof F==="string")F=h7.from(F,$);return F}Object.defineProperty(DD.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function l40(D,F,$,J,Q,Y){if(!$){var B=m40(F,J,Q);if(J!==B)$=!0,Q="buffer",J=B}var X=F.objectMode?1:J.length;F.length+=X;var G=F.length<F.highWaterMark;if(!G)F.needDrain=!0;if(F.writing||F.corked){var H=F.lastBufferedRequest;if(F.lastBufferedRequest={chunk:J,encoding:Q,isBuf:$,callback:Y,next:null},H)H.next=F.lastBufferedRequest;else F.bufferedRequest=F.lastBufferedRequest;F.bufferedRequestCount+=1}else vB(D,F,!1,X,J,Q,Y);return G}function vB(D,F,$,J,Q,Y,B){if(F.writelen=J,F.writecb=B,F.writing=!0,F.sync=!0,F.destroyed)F.onwrite(new x40("write"));else if($)D._writev(Q,F.onwrite);else D._write(Q,Y,F.onwrite);F.sync=!1}function p40(D,F,$,J,Q){if(--F.pendingcb,$)process.nextTick(Q,J),process.nextTick(K5,D,F),D._writableState.errorEmitted=!0,v3(D,J);else Q(J),D._writableState.errorEmitted=!0,v3(D,J),K5(D,F)}function d40(D){D.writing=!1,D.writecb=null,D.length-=D.writelen,D.writelen=0}function c40(D,F){var $=D._writableState,J=$.sync,Q=$.writecb;if(typeof Q!=="function")throw new v40;if(d40($),F)p40(D,$,J,F,Q);else{var Y=WO($)||D.destroyed;if(!Y&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest)GO(D,$);if(J)process.nextTick(YO,D,$,Y,Q);else YO(D,$,Y,Q)}}function YO(D,F,$,J){if(!$)n40(D,F);F.pendingcb--,J(),K5(D,F)}function n40(D,F){if(F.length===0&&F.needDrain)F.needDrain=!1,D.emit("drain")}function GO(D,F){F.bufferProcessing=!0;var $=F.bufferedRequest;if(D._writev&&$&&$.next){var J=F.bufferedRequestCount,Q=Array(J),Y=F.corkedRequestsFree;Y.entry=$;var B=0,X=!0;while($){if(Q[B]=$,!$.isBuf)X=!1;$=$.next,B+=1}if(Q.allBuffers=X,vB(D,F,!0,F.length,Q,"",Y.finish),F.pendingcb++,F.lastBufferedRequest=null,Y.next)F.corkedRequestsFree=Y.next,Y.next=null;else F.corkedRequestsFree=new BO(F);F.bufferedRequestCount=0}else{while($){var{chunk:G,encoding:H,callback:q}=$,K=F.objectMode?1:G.length;if(vB(D,F,!1,K,G,H,q),$=$.next,F.bufferedRequestCount--,F.writing)break}if($===null)F.lastBufferedRequest=null}F.bufferedRequest=$,F.bufferProcessing=!1}DD.prototype._write=function(D,F,$){$(new k40("_write()"))};DD.prototype._writev=null;DD.prototype.end=function(D,F,$){var J=this._writableState;if(typeof D==="function")$=D,D=null,F=null;else if(typeof F==="function")$=F,F=null;if(D!==null&&D!==void 0)this.write(D,F);if(J.corked)J.corked=1,this.uncork();if(!J.ending)o40(this,J,$);return this};Object.defineProperty(DD.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function WO(D){return D.ending&&D.length===0&&D.bufferedRequest===null&&!D.finished&&!D.writing}function i40(D,F){D._final(function($){if(F.pendingcb--,$)v3(D,$);F.prefinished=!0,D.emit("prefinish"),K5(D,F)})}function a40(D,F){if(!F.prefinished&&!F.finalCalled)if(typeof D._final==="function"&&!F.destroyed)F.pendingcb++,F.finalCalled=!0,process.nextTick(i40,D,F);else F.prefinished=!0,D.emit("prefinish")}function K5(D,F){var $=WO(F);if($){if(a40(D,F),F.pendingcb===0){if(F.finished=!0,D.emit("finish"),F.autoDestroy){var J=D._readableState;if(!J||J.autoDestroy&&J.endEmitted)D.destroy()}}}return $}function o40(D,F,$){if(F.ending=!0,K5(D,F),$)if(F.finished)process.nextTick($);else D.once("finish",$);F.ended=!0,D.writable=!1}function s40(D,F,$){var J=D.entry;D.entry=null;while(J){var Q=J.callback;F.pendingcb--,Q($),J=J.next}F.corkedRequestsFree.next=D}Object.defineProperty(DD.prototype,"destroyed",{enumerable:!1,get:function(){if(this._writableState===void 0)return!1;return this._writableState.destroyed},set:function(F){if(!this._writableState)return;this._writableState.destroyed=F}});DD.prototype.destroy=yB.destroy;DD.prototype._undestroy=yB.undestroy;DD.prototype._destroy=function(D,F){F(D)}});var Y4=z((JR0,KO)=>{var r40=Object.keys||function(D){var F=[];for(var $ in D)F.push($);return F};KO.exports=X8;var qO=fB(),_B=xB();Q4()(X8,qO);{b7=r40(_B.prototype);for(E5=0;E5<b7.length;E5++)if(V5=b7[E5],!X8.prototype[V5])X8.prototype[V5]=_B.prototype[V5]}var b7,V5,E5;function X8(D){if(!(this instanceof X8))return new X8(D);if(qO.call(this,D),_B.call(this,D),this.allowHalfOpen=!0,D){if(D.readable===!1)this.readable=!1;if(D.writable===!1)this.writable=!1;if(D.allowHalfOpen===!1)this.allowHalfOpen=!1,this.once("end",t40)}}Object.defineProperty(X8.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(X8.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(X8.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function t40(){if(this._writableState.ended)return;process.nextTick(e40,this)}function e40(D){D.end()}Object.defineProperty(X8.prototype,"destroyed",{enumerable:!1,get:function(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set:function(F){if(this._readableState===void 0||this._writableState===void 0)return;this._readableState.destroyed=F,this._writableState.destroyed=F}})});var VO=z((gB,EO)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var u7=K0("buffer"),G8=u7.Buffer;function zO(D,F){for(var $ in D)F[$]=D[$]}if(G8.from&&G8.alloc&&G8.allocUnsafe&&G8.allocUnsafeSlow)EO.exports=u7;else zO(u7,gB),gB.Buffer=B4;function B4(D,F,$){return G8(D,F,$)}B4.prototype=Object.create(G8.prototype);zO(G8,B4);B4.from=function(D,F,$){if(typeof D==="number")throw TypeError("Argument must not be a number");return G8(D,F,$)};B4.alloc=function(D,F,$){if(typeof D!=="number")throw TypeError("Argument must be a number");var J=G8(D);if(F!==void 0)if(typeof $==="string")J.fill(F,$);else J.fill(F);else J.fill(0);return J};B4.allocUnsafe=function(D){if(typeof D!=="number")throw TypeError("Argument must be a number");return G8(D)};B4.allocUnsafeSlow=function(D){if(typeof D!=="number")throw TypeError("Argument must be a number");return u7.SlowBuffer(D)}});var uB=z((z30)=>{var bB=VO().Buffer,ZO=bB.isEncoding||function(D){switch(D=""+D,D&&D.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function D30(D){if(!D)return"utf8";var F;while(!0)switch(D){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return D;default:if(F)return;D=(""+D).toLowerCase(),F=!0}}function F30(D){var F=D30(D);if(typeof F!=="string"&&(bB.isEncoding===ZO||!ZO(D)))throw Error("Unknown encoding: "+D);return F||D}z30.StringDecoder=Z5;function Z5(D){this.encoding=F30(D);var F;switch(this.encoding){case"utf16le":this.text=X30,this.end=G30,F=4;break;case"utf8":this.fillLast=Q30,F=4;break;case"base64":this.text=W30,this.end=H30,F=3;break;default:this.write=q30,this.end=K30;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=bB.allocUnsafe(F)}Z5.prototype.write=function(D){if(D.length===0)return"";var F,$;if(this.lastNeed){if(F=this.fillLast(D),F===void 0)return"";$=this.lastNeed,this.lastNeed=0}else $=0;if($<D.length)return F?F+this.text(D,$):this.text(D,$);return F||""};Z5.prototype.end=B30;Z5.prototype.text=Y30;Z5.prototype.fillLast=function(D){if(this.lastNeed<=D.length)return D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,D.length),this.lastNeed-=D.length};function hB(D){if(D<=127)return 0;else if(D>>5===6)return 2;else if(D>>4===14)return 3;else if(D>>3===30)return 4;return D>>6===2?-1:-2}function $30(D,F,$){var J=F.length-1;if(J<$)return 0;var Q=hB(F[J]);if(Q>=0){if(Q>0)D.lastNeed=Q-1;return Q}if(--J<$||Q===-2)return 0;if(Q=hB(F[J]),Q>=0){if(Q>0)D.lastNeed=Q-2;return Q}if(--J<$||Q===-2)return 0;if(Q=hB(F[J]),Q>=0){if(Q>0)if(Q===2)Q=0;else D.lastNeed=Q-3;return Q}return 0}function J30(D,F,$){if((F[0]&192)!==128)return D.lastNeed=0,"\uFFFD";if(D.lastNeed>1&&F.length>1){if((F[1]&192)!==128)return D.lastNeed=1,"\uFFFD";if(D.lastNeed>2&&F.length>2){if((F[2]&192)!==128)return D.lastNeed=2,"\uFFFD"}}}function Q30(D){var F=this.lastTotal-this.lastNeed,$=J30(this,D,F);if($!==void 0)return $;if(this.lastNeed<=D.length)return D.copy(this.lastChar,F,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,F,0,D.length),this.lastNeed-=D.length}function Y30(D,F){var $=$30(this,D,F);if(!this.lastNeed)return D.toString("utf8",F);this.lastTotal=$;var J=D.length-($-this.lastNeed);return D.copy(this.lastChar,0,J),D.toString("utf8",F,J)}function B30(D){var F=D&&D.length?this.write(D):"";if(this.lastNeed)return F+"\uFFFD";return F}function X30(D,F){if((D.length-F)%2===0){var $=D.toString("utf16le",F);if($){var J=$.charCodeAt($.length-1);if(J>=55296&&J<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1],$.slice(0,-1)}return $}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",F,D.length-1)}function G30(D){var F=D&&D.length?this.write(D):"";if(this.lastNeed){var $=this.lastTotal-this.lastNeed;return F+this.lastChar.toString("utf16le",0,$)}return F}function W30(D,F){var $=(D.length-F)%3;if($===0)return D.toString("base64",F);if(this.lastNeed=3-$,this.lastTotal=3,$===1)this.lastChar[0]=D[D.length-1];else this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1];return D.toString("base64",F,D.length-$)}function H30(D){var F=D&&D.length?this.write(D):"";if(this.lastNeed)return F+this.lastChar.toString("base64",0,3-this.lastNeed);return F}function q30(D){return D.toString(this.encoding)}function K30(D){return D&&D.length?this.write(D):""}});var m7=z((YR0,AO)=>{var UO=j6().codes.ERR_STREAM_PREMATURE_CLOSE;function V30(D){var F=!1;return function(){if(F)return;F=!0;for(var $=arguments.length,J=Array($),Q=0;Q<$;Q++)J[Q]=arguments[Q];D.apply(this,J)}}function Z30(){}function U30(D){return D.setHeader&&typeof D.abort==="function"}function LO(D,F,$){if(typeof F==="function")return LO(D,null,F);if(!F)F={};$=V30($||Z30);var J=F.readable||F.readable!==!1&&D.readable,Q=F.writable||F.writable!==!1&&D.writable,Y=function(){if(!D.writable)X()},B=D._writableState&&D._writableState.finished,X=function(){if(Q=!1,B=!0,!J)$.call(D)},G=D._readableState&&D._readableState.endEmitted,H=function(){if(J=!1,G=!0,!Q)$.call(D)},q=function(Z){$.call(D,Z)},K=function(){var Z;if(J&&!G){if(!D._readableState||!D._readableState.ended)Z=new UO;return $.call(D,Z)}if(Q&&!B){if(!D._writableState||!D._writableState.ended)Z=new UO;return $.call(D,Z)}},V=function(){D.req.on("finish",X)};if(U30(D))if(D.on("complete",X),D.on("abort",K),D.req)V();else D.on("request",V);else if(Q&&!D._writableState)D.on("end",Y),D.on("close",Y);if(D.on("end",H),D.on("finish",X),F.error!==!1)D.on("error",q);return D.on("close",K),function(){if(D.removeListener("complete",X),D.removeListener("abort",K),D.removeListener("request",V),D.req)D.req.removeListener("finish",X);D.removeListener("end",Y),D.removeListener("close",Y),D.removeListener("finish",X),D.removeListener("end",H),D.removeListener("error",q),D.removeListener("close",K)}}AO.exports=LO});var NO=z((BR0,MO)=>{var l7;function P6(D,F,$){if(F=L30(F),F in D)Object.defineProperty(D,F,{value:$,enumerable:!0,configurable:!0,writable:!0});else D[F]=$;return D}function L30(D){var F=A30(D,"string");return typeof F==="symbol"?F:String(F)}function A30(D,F){if(typeof D!=="object"||D===null)return D;var $=D[Symbol.toPrimitive];if($!==void 0){var J=$.call(D,F||"default");if(typeof J!=="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(F==="string"?String:Number)(D)}var M30=m7(),I6=Symbol("lastResolve"),X4=Symbol("lastReject"),U5=Symbol("error"),p7=Symbol("ended"),G4=Symbol("lastPromise"),mB=Symbol("handlePromise"),W4=Symbol("stream");function S6(D,F){return{value:D,done:F}}function N30(D){var F=D[I6];if(F!==null){var $=D[W4].read();if($!==null)D[G4]=null,D[I6]=null,D[X4]=null,F(S6($,!1))}}function R30(D){process.nextTick(N30,D)}function C30(D,F){return function($,J){D.then(function(){if(F[p7]){$(S6(void 0,!0));return}F[mB]($,J)},J)}}var O30=Object.getPrototypeOf(function(){}),w30=Object.setPrototypeOf((l7={get stream(){return this[W4]},next:function(){var F=this,$=this[U5];if($!==null)return Promise.reject($);if(this[p7])return Promise.resolve(S6(void 0,!0));if(this[W4].destroyed)return new Promise(function(B,X){process.nextTick(function(){if(F[U5])X(F[U5]);else B(S6(void 0,!0))})});var J=this[G4],Q;if(J)Q=new Promise(C30(J,this));else{var Y=this[W4].read();if(Y!==null)return Promise.resolve(S6(Y,!1));Q=new Promise(this[mB])}return this[G4]=Q,Q}},P6(l7,Symbol.asyncIterator,function(){return this}),P6(l7,"return",function(){var F=this;return new Promise(function($,J){F[W4].destroy(null,function(Q){if(Q){J(Q);return}$(S6(void 0,!0))})})}),l7),O30),j30=function(F){var $,J=Object.create(w30,($={},P6($,W4,{value:F,writable:!0}),P6($,I6,{value:null,writable:!0}),P6($,X4,{value:null,writable:!0}),P6($,U5,{value:null,writable:!0}),P6($,p7,{value:F._readableState.endEmitted,writable:!0}),P6($,mB,{value:function(Y,B){var X=J[W4].read();if(X)J[G4]=null,J[I6]=null,J[X4]=null,Y(S6(X,!1));else J[I6]=Y,J[X4]=B},writable:!0}),$));return J[G4]=null,M30(F,function(Q){if(Q&&Q.code!=="ERR_STREAM_PREMATURE_CLOSE"){var Y=J[X4];if(Y!==null)J[G4]=null,J[I6]=null,J[X4]=null,Y(Q);J[U5]=Q;return}var B=J[I6];if(B!==null)J[G4]=null,J[I6]=null,J[X4]=null,B(S6(void 0,!0));J[p7]=!0}),F.on("readable",R30.bind(null,J)),J};MO.exports=j30});var wO=z((XR0,OO)=>{function RO(D,F,$,J,Q,Y,B){try{var X=D[Y](B),G=X.value}catch(H){$(H);return}if(X.done)F(G);else Promise.resolve(G).then(J,Q)}function T30(D){return function(){var F=this,$=arguments;return new Promise(function(J,Q){var Y=D.apply(F,$);function B(G){RO(Y,J,Q,B,X,"next",G)}function X(G){RO(Y,J,Q,B,X,"throw",G)}B(void 0)})}}function CO(D,F){var $=Object.keys(D);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(D);F&&(J=J.filter(function(Q){return Object.getOwnPropertyDescriptor(D,Q).enumerable})),$.push.apply($,J)}return $}function P30(D){for(var F=1;F<arguments.length;F++){var $=arguments[F]!=null?arguments[F]:{};F%2?CO(Object($),!0).forEach(function(J){I30(D,J,$[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors($)):CO(Object($)).forEach(function(J){Object.defineProperty(D,J,Object.getOwnPropertyDescriptor($,J))})}return D}function I30(D,F,$){if(F=S30(F),F in D)Object.defineProperty(D,F,{value:$,enumerable:!0,configurable:!0,writable:!0});else D[F]=$;return D}function S30(D){var F=k30(D,"string");return typeof F==="symbol"?F:String(F)}function k30(D,F){if(typeof D!=="object"||D===null)return D;var $=D[Symbol.toPrimitive];if($!==void 0){var J=$.call(D,F||"default");if(typeof J!=="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return(F==="string"?String:Number)(D)}var v30=j6().codes.ERR_INVALID_ARG_TYPE;function y30(D,F,$){var J;if(F&&typeof F.next==="function")J=F;else if(F&&F[Symbol.asyncIterator])J=F[Symbol.asyncIterator]();else if(F&&F[Symbol.iterator])J=F[Symbol.iterator]();else throw new v30("iterable",["Iterable"],F);var Q=new D(P30({objectMode:!0},$)),Y=!1;Q._read=function(){if(!Y)Y=!0,B()};function B(){return X.apply(this,arguments)}function X(){return X=T30(function*(){try{var G=yield J.next(),H=G.value,q=G.done;if(q)Q.push(null);else if(Q.push(yield H))B();else Y=!1}catch(K){Q.destroy(K)}}),X.apply(this,arguments)}return Q}OO.exports=y30});var fB=z((WR0,_O)=>{_O.exports=R0;var y3;R0.ReadableState=IO;var GR0=K0("events").EventEmitter,PO=function(F,$){return F.listeners($).length},A5=K0("stream"),d7=K0("buffer").Buffer,x30=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function _30(D){return d7.from(D)}function f30(D){return d7.isBuffer(D)||D instanceof x30}var lB=K0("util"),q0;if(lB&&lB.debuglog)q0=lB.debuglog("stream");else q0=function(){};var g30=oC(),oB=PB(),h30=IB(),b30=h30.getHighWaterMark,c7=j6().codes,u30=c7.ERR_INVALID_ARG_TYPE,m30=c7.ERR_STREAM_PUSH_AFTER_EOF,l30=c7.ERR_METHOD_NOT_IMPLEMENTED,p30=c7.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,x3,pB,dB;Q4()(R0,A5);var L5=oB.errorOrDestroy,cB=["error","close","destroy","pause","resume"];function d30(D,F,$){if(typeof D.prependListener==="function")return D.prependListener(F,$);if(!D._events||!D._events[F])D.on(F,$);else if(Array.isArray(D._events[F]))D._events[F].unshift($);else D._events[F]=[$,D._events[F]]}function IO(D,F,$){if(y3=y3||Y4(),D=D||{},typeof $!=="boolean")$=F instanceof y3;if(this.objectMode=!!D.objectMode,$)this.objectMode=this.objectMode||!!D.readableObjectMode;if(this.highWaterMark=b30(this,D,"readableHighWaterMark",$),this.buffer=new g30,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=D.emitClose!==!1,this.autoDestroy=!!D.autoDestroy,this.destroyed=!1,this.defaultEncoding=D.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,D.encoding){if(!x3)x3=uB().StringDecoder;this.decoder=new x3(D.encoding),this.encoding=D.encoding}}function R0(D){if(y3=y3||Y4(),!(this instanceof R0))return new R0(D);var F=this instanceof y3;if(this._readableState=new IO(D,this,F),this.readable=!0,D){if(typeof D.read==="function")this._read=D.read;if(typeof D.destroy==="function")this._destroy=D.destroy}A5.call(this)}Object.defineProperty(R0.prototype,"destroyed",{enumerable:!1,get:function(){if(this._readableState===void 0)return!1;return this._readableState.destroyed},set:function(F){if(!this._readableState)return;this._readableState.destroyed=F}});R0.prototype.destroy=oB.destroy;R0.prototype._undestroy=oB.undestroy;R0.prototype._destroy=function(D,F){F(D)};R0.prototype.push=function(D,F){var $=this._readableState,J;if(!$.objectMode){if(typeof D==="string"){if(F=F||$.defaultEncoding,F!==$.encoding)D=d7.from(D,F),F="";J=!0}}else J=!0;return SO(this,D,F,!1,J)};R0.prototype.unshift=function(D){return SO(this,D,null,!0,!1)};function SO(D,F,$,J,Q){q0("readableAddChunk",F);var Y=D._readableState;if(F===null)Y.reading=!1,i30(D,Y);else{var B;if(!Q)B=c30(Y,F);if(B)L5(D,B);else if(Y.objectMode||F&&F.length>0){if(typeof F!=="string"&&!Y.objectMode&&Object.getPrototypeOf(F)!==d7.prototype)F=_30(F);if(J)if(Y.endEmitted)L5(D,new p30);else nB(D,Y,F,!0);else if(Y.ended)L5(D,new m30);else if(Y.destroyed)return!1;else if(Y.reading=!1,Y.decoder&&!$)if(F=Y.decoder.write(F),Y.objectMode||F.length!==0)nB(D,Y,F,!1);else aB(D,Y);else nB(D,Y,F,!1)}else if(!J)Y.reading=!1,aB(D,Y)}return!Y.ended&&(Y.length<Y.highWaterMark||Y.length===0)}function nB(D,F,$,J){if(F.flowing&&F.length===0&&!F.sync)F.awaitDrain=0,D.emit("data",$);else{if(F.length+=F.objectMode?1:$.length,J)F.buffer.unshift($);else F.buffer.push($);if(F.needReadable)n7(D)}aB(D,F)}function c30(D,F){var $;if(!f30(F)&&typeof F!=="string"&&F!==void 0&&!D.objectMode)$=new u30("chunk",["string","Buffer","Uint8Array"],F);return $}R0.prototype.isPaused=function(){return this._readableState.flowing===!1};R0.prototype.setEncoding=function(D){if(!x3)x3=uB().StringDecoder;var F=new x3(D);this._readableState.decoder=F,this._readableState.encoding=this._readableState.decoder.encoding;var $=this._readableState.buffer.head,J="";while($!==null)J+=F.write($.data),$=$.next;if(this._readableState.buffer.clear(),J!=="")this._readableState.buffer.push(J);return this._readableState.length=J.length,this};var jO=1073741824;function n30(D){if(D>=jO)D=jO;else D--,D|=D>>>1,D|=D>>>2,D|=D>>>4,D|=D>>>8,D|=D>>>16,D++;return D}function TO(D,F){if(D<=0||F.length===0&&F.ended)return 0;if(F.objectMode)return 1;if(D!==D)if(F.flowing&&F.length)return F.buffer.head.data.length;else return F.length;if(D>F.highWaterMark)F.highWaterMark=n30(D);if(D<=F.length)return D;if(!F.ended)return F.needReadable=!0,0;return F.length}R0.prototype.read=function(D){q0("read",D),D=parseInt(D,10);var F=this._readableState,$=D;if(D!==0)F.emittedReadable=!1;if(D===0&&F.needReadable&&((F.highWaterMark!==0?F.length>=F.highWaterMark:F.length>0)||F.ended)){if(q0("read: emitReadable",F.length,F.ended),F.length===0&&F.ended)iB(this);else n7(this);return null}if(D=TO(D,F),D===0&&F.ended){if(F.length===0)iB(this);return null}var J=F.needReadable;if(q0("need readable",J),F.length===0||F.length-D<F.highWaterMark)J=!0,q0("length less than watermark",J);if(F.ended||F.reading)J=!1,q0("reading or ended",J);else if(J){if(q0("do read"),F.reading=!0,F.sync=!0,F.length===0)F.needReadable=!0;if(this._read(F.highWaterMark),F.sync=!1,!F.reading)D=TO($,F)}var Q;if(D>0)Q=yO(D,F);else Q=null;if(Q===null)F.needReadable=F.length<=F.highWaterMark,D=0;else F.length-=D,F.awaitDrain=0;if(F.length===0){if(!F.ended)F.needReadable=!0;if($!==D&&F.ended)iB(this)}if(Q!==null)this.emit("data",Q);return Q};function i30(D,F){if(q0("onEofChunk"),F.ended)return;if(F.decoder){var $=F.decoder.end();if($&&$.length)F.buffer.push($),F.length+=F.objectMode?1:$.length}if(F.ended=!0,F.sync)n7(D);else if(F.needReadable=!1,!F.emittedReadable)F.emittedReadable=!0,kO(D)}function n7(D){var F=D._readableState;if(q0("emitReadable",F.needReadable,F.emittedReadable),F.needReadable=!1,!F.emittedReadable)q0("emitReadable",F.flowing),F.emittedReadable=!0,process.nextTick(kO,D)}function kO(D){var F=D._readableState;if(q0("emitReadable_",F.destroyed,F.length,F.ended),!F.destroyed&&(F.length||F.ended))D.emit("readable"),F.emittedReadable=!1;F.needReadable=!F.flowing&&!F.ended&&F.length<=F.highWaterMark,sB(D)}function aB(D,F){if(!F.readingMore)F.readingMore=!0,process.nextTick(a30,D,F)}function a30(D,F){while(!F.reading&&!F.ended&&(F.length<F.highWaterMark||F.flowing&&F.length===0)){var $=F.length;if(q0("maybeReadMore read 0"),D.read(0),$===F.length)break}F.readingMore=!1}R0.prototype._read=function(D){L5(this,new l30("_read()"))};R0.prototype.pipe=function(D,F){var $=this,J=this._readableState;switch(J.pipesCount){case 0:J.pipes=D;break;case 1:J.pipes=[J.pipes,D];break;default:J.pipes.push(D);break}J.pipesCount+=1,q0("pipe count=%d opts=%j",J.pipesCount,F);var Q=(!F||F.end!==!1)&&D!==process.stdout&&D!==process.stderr,Y=Q?X:L;if(J.endEmitted)process.nextTick(Y);else $.once("end",Y);D.on("unpipe",B);function B(M,A){if(q0("onunpipe"),M===$){if(A&&A.hasUnpiped===!1)A.hasUnpiped=!0,q()}}function X(){q0("onend"),D.end()}var G=o30($);D.on("drain",G);var H=!1;function q(){if(q0("cleanup"),D.removeListener("close",E),D.removeListener("finish",Z),D.removeListener("drain",G),D.removeListener("error",V),D.removeListener("unpipe",B),$.removeListener("end",X),$.removeListener("end",L),$.removeListener("data",K),H=!0,J.awaitDrain&&(!D._writableState||D._writableState.needDrain))G()}$.on("data",K);function K(M){q0("ondata");var A=D.write(M);if(q0("dest.write",A),A===!1){if((J.pipesCount===1&&J.pipes===D||J.pipesCount>1&&xO(J.pipes,D)!==-1)&&!H)q0("false write response, pause",J.awaitDrain),J.awaitDrain++;$.pause()}}function V(M){if(q0("onerror",M),L(),D.removeListener("error",V),PO(D,"error")===0)L5(D,M)}d30(D,"error",V);function E(){D.removeListener("finish",Z),L()}D.once("close",E);function Z(){q0("onfinish"),D.removeListener("close",E),L()}D.once("finish",Z);function L(){q0("unpipe"),$.unpipe(D)}if(D.emit("pipe",$),!J.flowing)q0("pipe resume"),$.resume();return D};function o30(D){return function(){var $=D._readableState;if(q0("pipeOnDrain",$.awaitDrain),$.awaitDrain)$.awaitDrain--;if($.awaitDrain===0&&PO(D,"data"))$.flowing=!0,sB(D)}}R0.prototype.unpipe=function(D){var F=this._readableState,$={hasUnpiped:!1};if(F.pipesCount===0)return this;if(F.pipesCount===1){if(D&&D!==F.pipes)return this;if(!D)D=F.pipes;if(F.pipes=null,F.pipesCount=0,F.flowing=!1,D)D.emit("unpipe",this,$);return this}if(!D){var{pipes:J,pipesCount:Q}=F;F.pipes=null,F.pipesCount=0,F.flowing=!1;for(var Y=0;Y<Q;Y++)J[Y].emit("unpipe",this,{hasUnpiped:!1});return this}var B=xO(F.pipes,D);if(B===-1)return this;if(F.pipes.splice(B,1),F.pipesCount-=1,F.pipesCount===1)F.pipes=F.pipes[0];return D.emit("unpipe",this,$),this};R0.prototype.on=function(D,F){var $=A5.prototype.on.call(this,D,F),J=this._readableState;if(D==="data"){if(J.readableListening=this.listenerCount("readable")>0,J.flowing!==!1)this.resume()}else if(D==="readable"){if(!J.endEmitted&&!J.readableListening){if(J.readableListening=J.needReadable=!0,J.flowing=!1,J.emittedReadable=!1,q0("on readable",J.length,J.reading),J.length)n7(this);else if(!J.reading)process.nextTick(s30,this)}}return $};R0.prototype.addListener=R0.prototype.on;R0.prototype.removeListener=function(D,F){var $=A5.prototype.removeListener.call(this,D,F);if(D==="readable")process.nextTick(vO,this);return $};R0.prototype.removeAllListeners=function(D){var F=A5.prototype.removeAllListeners.apply(this,arguments);if(D==="readable"||D===void 0)process.nextTick(vO,this);return F};function vO(D){var F=D._readableState;if(F.readableListening=D.listenerCount("readable")>0,F.resumeScheduled&&!F.paused)F.flowing=!0;else if(D.listenerCount("data")>0)D.resume()}function s30(D){q0("readable nexttick read 0"),D.read(0)}R0.prototype.resume=function(){var D=this._readableState;if(!D.flowing)q0("resume"),D.flowing=!D.readableListening,r30(this,D);return D.paused=!1,this};function r30(D,F){if(!F.resumeScheduled)F.resumeScheduled=!0,process.nextTick(t30,D,F)}function t30(D,F){if(q0("resume",F.reading),!F.reading)D.read(0);if(F.resumeScheduled=!1,D.emit("resume"),sB(D),F.flowing&&!F.reading)D.read(0)}R0.prototype.pause=function(){if(q0("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)q0("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState.paused=!0,this};function sB(D){var F=D._readableState;q0("flow",F.flowing);while(F.flowing&&D.read()!==null);}R0.prototype.wrap=function(D){var F=this,$=this._readableState,J=!1;D.on("end",function(){if(q0("wrapped end"),$.decoder&&!$.ended){var B=$.decoder.end();if(B&&B.length)F.push(B)}F.push(null)}),D.on("data",function(B){if(q0("wrapped data"),$.decoder)B=$.decoder.write(B);if($.objectMode&&(B===null||B===void 0))return;else if(!$.objectMode&&(!B||!B.length))return;var X=F.push(B);if(!X)J=!0,D.pause()});for(var Q in D)if(this[Q]===void 0&&typeof D[Q]==="function")this[Q]=function(X){return function(){return D[X].apply(D,arguments)}}(Q);for(var Y=0;Y<cB.length;Y++)D.on(cB[Y],this.emit.bind(this,cB[Y]));return this._read=function(B){if(q0("wrapped _read",B),J)J=!1,D.resume()},this};if(typeof Symbol==="function")R0.prototype[Symbol.asyncIterator]=function(){if(pB===void 0)pB=NO();return pB(this)};Object.defineProperty(R0.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(R0.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(R0.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(F){if(this._readableState)this._readableState.flowing=F}});R0._fromList=yO;Object.defineProperty(R0.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function yO(D,F){if(F.length===0)return null;var $;if(F.objectMode)$=F.buffer.shift();else if(!D||D>=F.length){if(F.decoder)$=F.buffer.join("");else if(F.buffer.length===1)$=F.buffer.first();else $=F.buffer.concat(F.length);F.buffer.clear()}else $=F.buffer.consume(D,F.decoder);return $}function iB(D){var F=D._readableState;if(q0("endReadable",F.endEmitted),!F.endEmitted)F.ended=!0,process.nextTick(e30,F,D)}function e30(D,F){if(q0("endReadableNT",D.endEmitted,D.length),!D.endEmitted&&D.length===0){if(D.endEmitted=!0,F.readable=!1,F.emit("end"),D.autoDestroy){var $=F._writableState;if(!$||$.autoDestroy&&$.finished)F.destroy()}}}if(typeof Symbol==="function")R0.from=function(D,F){if(dB===void 0)dB=wO();return dB(R0,D,F)};function xO(D,F){for(var $=0,J=D.length;$<J;$++)if(D[$]===F)return $;return-1}});var rB=z((HR0,gO)=>{gO.exports=x8;var i7=j6().codes,DF0=i7.ERR_METHOD_NOT_IMPLEMENTED,FF0=i7.ERR_MULTIPLE_CALLBACK,$F0=i7.ERR_TRANSFORM_ALREADY_TRANSFORMING,JF0=i7.ERR_TRANSFORM_WITH_LENGTH_0,a7=Y4();Q4()(x8,a7);function QF0(D,F){var $=this._transformState;$.transforming=!1;var J=$.writecb;if(J===null)return this.emit("error",new FF0);if($.writechunk=null,$.writecb=null,F!=null)this.push(F);J(D);var Q=this._readableState;if(Q.reading=!1,Q.needReadable||Q.length<Q.highWaterMark)this._read(Q.highWaterMark)}function x8(D){if(!(this instanceof x8))return new x8(D);if(a7.call(this,D),this._transformState={afterTransform:QF0.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,D){if(typeof D.transform==="function")this._transform=D.transform;if(typeof D.flush==="function")this._flush=D.flush}this.on("prefinish",YF0)}function YF0(){var D=this;if(typeof this._flush==="function"&&!this._readableState.destroyed)this._flush(function(F,$){fO(D,F,$)});else fO(this,null,null)}x8.prototype.push=function(D,F){return this._transformState.needTransform=!1,a7.prototype.push.call(this,D,F)};x8.prototype._transform=function(D,F,$){$(new DF0("_transform()"))};x8.prototype._write=function(D,F,$){var J=this._transformState;if(J.writecb=$,J.writechunk=D,J.writeencoding=F,!J.transforming){var Q=this._readableState;if(J.needTransform||Q.needReadable||Q.length<Q.highWaterMark)this._read(Q.highWaterMark)}};x8.prototype._read=function(D){var F=this._transformState;if(F.writechunk!==null&&!F.transforming)F.transforming=!0,this._transform(F.writechunk,F.writeencoding,F.afterTransform);else F.needTransform=!0};x8.prototype._destroy=function(D,F){a7.prototype._destroy.call(this,D,function($){F($)})};function fO(D,F,$){if(F)return D.emit("error",F);if($!=null)D.push($);if(D._writableState.length)throw new JF0;if(D._transformState.transforming)throw new $F0;return D.push(null)}});var uO=z((qR0,bO)=>{bO.exports=M5;var hO=rB();Q4()(M5,hO);function M5(D){if(!(this instanceof M5))return new M5(D);hO.call(this,D)}M5.prototype._transform=function(D,F,$){$(null,D)}});var cO=z((KR0,dO)=>{var tB;function BF0(D){var F=!1;return function(){if(F)return;F=!0,D.apply(void 0,arguments)}}var pO=j6().codes,XF0=pO.ERR_MISSING_ARGS,GF0=pO.ERR_STREAM_DESTROYED;function mO(D){if(D)throw D}function WF0(D){return D.setHeader&&typeof D.abort==="function"}function HF0(D,F,$,J){J=BF0(J);var Q=!1;if(D.on("close",function(){Q=!0}),tB===void 0)tB=m7();tB(D,{readable:F,writable:$},function(B){if(B)return J(B);Q=!0,J()});var Y=!1;return function(B){if(Q)return;if(Y)return;if(Y=!0,WF0(D))return D.abort();if(typeof D.destroy==="function")return D.destroy();J(B||new GF0("pipe"))}}function lO(D){D()}function qF0(D,F){return D.pipe(F)}function KF0(D){if(!D.length)return mO;if(typeof D[D.length-1]!=="function")return mO;return D.pop()}function zF0(){for(var D=arguments.length,F=Array(D),$=0;$<D;$++)F[$]=arguments[$];var J=KF0(F);if(Array.isArray(F[0]))F=F[0];if(F.length<2)throw new XF0("streams");var Q,Y=F.map(function(B,X){var G=X<F.length-1,H=X>0;return HF0(B,G,H,function(q){if(!Q)Q=q;if(q)Y.forEach(lO);if(G)return;Y.forEach(lO),J(Q)})});return F.reduce(qF0)}dO.exports=zF0});var nO=z((V1,R5)=>{var N5=K0("stream");if(process.env.READABLE_STREAM==="disable"&&N5)R5.exports=N5.Readable,Object.assign(R5.exports,N5),R5.exports.Stream=N5;else V1=R5.exports=fB(),V1.Stream=N5||V1,V1.Readable=V1,V1.Writable=xB(),V1.Duplex=Y4(),V1.Transform=rB(),V1.PassThrough=uO(),V1.finished=m7(),V1.pipeline=cO()});var oO=z((zR0,aO)=>{var{Buffer:k1}=K0("buffer"),iO=Symbol.for("BufferList");function g0(D){if(!(this instanceof g0))return new g0(D);g0._init.call(this,D)}g0._init=function(F){if(Object.defineProperty(this,iO,{value:!0}),this._bufs=[],this.length=0,F)this.append(F)};g0.prototype._new=function(F){return new g0(F)};g0.prototype._offset=function(F){if(F===0)return[0,0];let $=0;for(let J=0;J<this._bufs.length;J++){let Q=$+this._bufs[J].length;if(F<Q||J===this._bufs.length-1)return[J,F-$];$=Q}};g0.prototype._reverseOffset=function(D){let F=D[0],$=D[1];for(let J=0;J<F;J++)$+=this._bufs[J].length;return $};g0.prototype.get=function(F){if(F>this.length||F<0)return;let $=this._offset(F);return this._bufs[$[0]][$[1]]};g0.prototype.slice=function(F,$){if(typeof F==="number"&&F<0)F+=this.length;if(typeof $==="number"&&$<0)$+=this.length;return this.copy(null,0,F,$)};g0.prototype.copy=function(F,$,J,Q){if(typeof J!=="number"||J<0)J=0;if(typeof Q!=="number"||Q>this.length)Q=this.length;if(J>=this.length)return F||k1.alloc(0);if(Q<=0)return F||k1.alloc(0);let Y=!!F,B=this._offset(J),X=Q-J,G=X,H=Y&&$||0,q=B[1];if(J===0&&Q===this.length){if(!Y)return this._bufs.length===1?this._bufs[0]:k1.concat(this._bufs,this.length);for(let K=0;K<this._bufs.length;K++)this._bufs[K].copy(F,H),H+=this._bufs[K].length;return F}if(G<=this._bufs[B[0]].length-q)return Y?this._bufs[B[0]].copy(F,$,q,q+G):this._bufs[B[0]].slice(q,q+G);if(!Y)F=k1.allocUnsafe(X);for(let K=B[0];K<this._bufs.length;K++){let V=this._bufs[K].length-q;if(G>V)this._bufs[K].copy(F,H,q),H+=V;else{this._bufs[K].copy(F,H,q,q+G),H+=V;break}if(G-=V,q)q=0}if(F.length>H)return F.slice(0,H);return F};g0.prototype.shallowSlice=function(F,$){if(F=F||0,$=typeof $!=="number"?this.length:$,F<0)F+=this.length;if($<0)$+=this.length;if(F===$)return this._new();let J=this._offset(F),Q=this._offset($),Y=this._bufs.slice(J[0],Q[0]+1);if(Q[1]===0)Y.pop();else Y[Y.length-1]=Y[Y.length-1].slice(0,Q[1]);if(J[1]!==0)Y[0]=Y[0].slice(J[1]);return this._new(Y)};g0.prototype.toString=function(F,$,J){return this.slice($,J).toString(F)};g0.prototype.consume=function(F){if(F=Math.trunc(F),Number.isNaN(F)||F<=0)return this;while(this._bufs.length)if(F>=this._bufs[0].length)F-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(F),this.length-=F;break}return this};g0.prototype.duplicate=function(){let F=this._new();for(let $=0;$<this._bufs.length;$++)F.append(this._bufs[$]);return F};g0.prototype.append=function(F){if(F==null)return this;if(F.buffer)this._appendBuffer(k1.from(F.buffer,F.byteOffset,F.byteLength));else if(Array.isArray(F))for(let $=0;$<F.length;$++)this.append(F[$]);else if(this._isBufferList(F))for(let $=0;$<F._bufs.length;$++)this.append(F._bufs[$]);else{if(typeof F==="number")F=F.toString();this._appendBuffer(k1.from(F))}return this};g0.prototype._appendBuffer=function(F){this._bufs.push(F),this.length+=F.length};g0.prototype.indexOf=function(D,F,$){if($===void 0&&typeof F==="string")$=F,F=void 0;if(typeof D==="function"||Array.isArray(D))throw TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');else if(typeof D==="number")D=k1.from([D]);else if(typeof D==="string")D=k1.from(D,$);else if(this._isBufferList(D))D=D.slice();else if(Array.isArray(D.buffer))D=k1.from(D.buffer,D.byteOffset,D.byteLength);else if(!k1.isBuffer(D))D=k1.from(D);if(F=Number(F||0),isNaN(F))F=0;if(F<0)F=this.length+F;if(F<0)F=0;if(D.length===0)return F>this.length?this.length:F;let J=this._offset(F),Q=J[0],Y=J[1];for(;Q<this._bufs.length;Q++){let B=this._bufs[Q];while(Y<B.length)if(B.length-Y>=D.length){let G=B.indexOf(D,Y);if(G!==-1)return this._reverseOffset([Q,G]);Y=B.length-D.length+1}else{let G=this._reverseOffset([Q,Y]);if(this._match(G,D))return G;Y++}Y=0}return-1};g0.prototype._match=function(D,F){if(this.length-D<F.length)return!1;for(let $=0;$<F.length;$++)if(this.get(D+$)!==F[$])return!1;return!0};(function(){let D={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let F in D)(function($){if(D[$]===null)g0.prototype[$]=function(J,Q){return this.slice(J,J+Q)[$](0,Q)};else g0.prototype[$]=function(J=0){return this.slice(J,J+D[$])[$](0)}})(F)})();g0.prototype._isBufferList=function(F){return F instanceof g0||g0.isBufferList(F)};g0.isBufferList=function(F){return F!=null&&F[iO]};aO.exports=g0});var sO=z((ER0,o7)=>{var eB=nO().Duplex,EF0=Q4(),C5=oO();function wD(D){if(!(this instanceof wD))return new wD(D);if(typeof D==="function"){this._callback=D;let F=function(J){if(this._callback)this._callback(J),this._callback=null}.bind(this);this.on("pipe",function(J){J.on("error",F)}),this.on("unpipe",function(J){J.removeListener("error",F)}),D=null}C5._init.call(this,D),eB.call(this)}EF0(wD,eB);Object.assign(wD.prototype,C5.prototype);wD.prototype._new=function(F){return new wD(F)};wD.prototype._write=function(F,$,J){if(this._appendBuffer(F),typeof J==="function")J()};wD.prototype._read=function(F){if(!this.length)return this.push(null);F=Math.min(F,this.length),this.push(this.slice(0,F)),this.consume(F)};wD.prototype.end=function(F){if(eB.prototype.end.call(this,F),this._callback)this._callback(null,this.slice()),this._callback=null};wD.prototype._destroy=function(F,$){this._bufs.length=0,this.length=0,$(F)};wD.prototype._isBufferList=function(F){return F instanceof wD||F instanceof C5||wD.isBufferList(F)};wD.isBufferList=C5.isBufferList;o7.exports=wD;o7.exports.BufferListStream=wD;o7.exports.BufferList=C5});var eO=z((VR0,J2)=>{var VF0=K0("readline"),ZF0=LB(),rO=jC(),s7=v7(),r7=vC(),UF0=Q5(),LF0=mC(),AF0=pC(),MF0=OB(),{BufferListStream:NF0}=sO(),D2=Symbol("text"),F2=Symbol("prefixText");class tO{constructor(){this.requests=0,this.mutedStream=new NF0,this.mutedStream.pipe(process.stdout);let D=this;this.ourEmit=function(F,$,...J){let{stdin:Q}=process;if(D.requests>0||Q.emit===D.ourEmit){if(F==="keypress")return;if(F==="data"&&$.includes(3))process.emit("SIGINT");Reflect.apply(D.oldEmit,this,[F,$,...J])}else Reflect.apply(process.stdin.emit,this,[F,$,...J])}}start(){if(this.requests++,this.requests===1)this.realStart()}stop(){if(this.requests<=0)throw Error("`stop` called more times than `start`");if(this.requests--,this.requests===0)this.realStop()}realStart(){if(process.platform==="win32")return;this.rl=VF0.createInterface({input:process.stdin,output:this.mutedStream}),this.rl.on("SIGINT",()=>{if(process.listenerCount("SIGINT")===0)process.emit("SIGINT");else this.rl.close(),process.kill(process.pid,"SIGINT")})}realStop(){if(process.platform==="win32")return;this.rl.close(),this.rl=void 0}}var t7;class $2{constructor(D){if(!t7)t7=new tO;if(typeof D==="string")D={text:D};this.options={text:"",color:"cyan",stream:process.stderr,discardStdin:!0,...D},this.spinner=this.options.spinner,this.color=this.options.color,this.hideCursor=this.options.hideCursor!==!1,this.interval=this.options.interval||this.spinner.interval||100,this.stream=this.options.stream,this.id=void 0,this.isEnabled=typeof this.options.isEnabled==="boolean"?this.options.isEnabled:AF0({stream:this.stream}),this.isSilent=typeof this.options.isSilent==="boolean"?this.options.isSilent:!1,this.text=this.options.text,this.prefixText=this.options.prefixText,this.linesToClear=0,this.indent=this.options.indent,this.discardStdin=this.options.discardStdin,this.isDiscardingStdin=!1}get indent(){return this._indent}set indent(D=0){if(!(D>=0&&Number.isInteger(D)))throw Error("The `indent` option must be an integer from 0 and up");this._indent=D}_updateInterval(D){if(D!==void 0)this.interval=D}get spinner(){return this._spinner}set spinner(D){if(this.frameIndex=0,typeof D==="object"){if(D.frames===void 0)throw Error("The given spinner must have a `frames` property");this._spinner=D}else if(!MF0())this._spinner=s7.line;else if(D===void 0)this._spinner=s7.dots;else if(D!=="default"&&s7[D])this._spinner=s7[D];else throw Error(`There is no built-in spinner named '${D}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);this._updateInterval(this._spinner.interval)}get text(){return this[D2]}set text(D){this[D2]=D,this.updateLineCount()}get prefixText(){return this[F2]}set prefixText(D){this[F2]=D,this.updateLineCount()}get isSpinning(){return this.id!==void 0}getFullPrefixText(D=this[F2],F=" "){if(typeof D==="string")return D+F;if(typeof D==="function")return D()+F;return""}updateLineCount(){let D=this.stream.columns||80,F=this.getFullPrefixText(this.prefixText,"-");this.lineCount=0;for(let $ of UF0(F+"--"+this[D2]).split(`
46
46
  `))this.lineCount+=Math.max(1,Math.ceil(LF0($)/D))}get isEnabled(){return this._isEnabled&&!this.isSilent}set isEnabled(D){if(typeof D!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this._isEnabled=D}get isSilent(){return this._isSilent}set isSilent(D){if(typeof D!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this._isSilent=D}frame(){let{frames:D}=this.spinner,F=D[this.frameIndex];if(this.color)F=ZF0[this.color](F);this.frameIndex=++this.frameIndex%D.length;let $=typeof this.prefixText==="string"&&this.prefixText!==""?this.prefixText+" ":"",J=typeof this.text==="string"?" "+this.text:"";return $+F+J}clear(){if(!this.isEnabled||!this.stream.isTTY)return this;for(let D=0;D<this.linesToClear;D++){if(D>0)this.stream.moveCursor(0,-1);this.stream.clearLine(),this.stream.cursorTo(this.indent)}return this.linesToClear=0,this}render(){if(this.isSilent)return this;return this.clear(),this.stream.write(this.frame()),this.linesToClear=this.lineCount,this}start(D){if(D)this.text=D;if(this.isSilent)return this;if(!this.isEnabled){if(this.text)this.stream.write(`- ${this.text}
47
47
  `);return this}if(this.isSpinning)return this;if(this.hideCursor)rO.hide(this.stream);if(this.discardStdin&&process.stdin.isTTY)this.isDiscardingStdin=!0,t7.start();return this.render(),this.id=setInterval(this.render.bind(this),this.interval),this}stop(){if(!this.isEnabled)return this;if(clearInterval(this.id),this.id=void 0,this.frameIndex=0,this.clear(),this.hideCursor)rO.show(this.stream);if(this.discardStdin&&process.stdin.isTTY&&this.isDiscardingStdin)t7.stop(),this.isDiscardingStdin=!1;return this}succeed(D){return this.stopAndPersist({symbol:r7.success,text:D})}fail(D){return this.stopAndPersist({symbol:r7.error,text:D})}warn(D){return this.stopAndPersist({symbol:r7.warning,text:D})}info(D){return this.stopAndPersist({symbol:r7.info,text:D})}stopAndPersist(D={}){if(this.isSilent)return this;let F=D.prefixText||this.prefixText,$=D.text||this.text,J=typeof $==="string"?" "+$:"";return this.stop(),this.stream.write(`${this.getFullPrefixText(F," ")}${D.symbol||" "}${J}
48
48
  `),this}}var RF0=function(D){return new $2(D)};J2.exports=RF0;J2.exports.promise=(D,F)=>{if(typeof D.then!=="function")throw TypeError("Parameter `action` must be a Promise");let $=new $2(F);return $.start(),(async()=>{try{await D,$.succeed()}catch{$.fail()}})(),$}});var _3,e7=function(D,F){D.output.write(_3.default.cursorBackward(F))},Dw=function(D,F){D.output.write(_3.default.cursorForward(F))},Fw=function(D,F){D.output.write(_3.default.cursorUp(F))},Q2=function(D,F){D.output.write(_3.default.cursorDown(F))},O5=function(D,F){D.output.write(_3.default.eraseLines(F))};var Y2=I(()=>{_3=s(uF(),1)});function Jw(D){return D.split(`
@@ -85,17 +85,17 @@ ${F}`,Z90,U90,L90=(D,F,$)=>{let J=$===""?"":`with ${$.trim()}() `,Q=V90.bind(nul
85
85
  `:""},this._extScope=D,this._scope=new g1.Scope({parent:D}),this._nodes=[new iP]}toString(){return this._root.render(this.opts)}name(D){return this._scope.name(D)}scopeName(D){return this._extScope.name(D)}scopeValue(D,F){let $=this._extScope.value(D,F);return(this._values[$.prefix]||(this._values[$.prefix]=new Set)).add($),$}getScopeValue(D,F){return this._extScope.getValue(D,F)}scopeRefs(D){return this._extScope.scopeRefs(D,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(D,F,$,J){let Q=this._scope.toName(F);if($!==void 0&&J)this._constants[Q.str]=$;return this._leafNode(new mP(D,Q,$)),Q}const(D,F,$){return this._def(g1.varKinds.const,D,F,$)}let(D,F,$){return this._def(g1.varKinds.let,D,F,$)}var(D,F,$){return this._def(g1.varKinds.var,D,F,$)}assign(D,F,$){return this._leafNode(new dX(D,F,$))}add(D,F){return this._leafNode(new lP(D,oD.operators.ADD,F))}code(D){if(typeof D=="function")D();else if(D!==U0.nil)this._leafNode(new nP(D));return this}object(...D){let F=["{"];for(let[$,J]of D){if(F.length>1)F.push(",");if(F.push($),$!==J||this.opts.es5)F.push(":"),(0,U0.addCodeArg)(F,J)}return F.push("}"),new U0._Code(F)}if(D,F,$){if(this._blockNode(new u8(D)),F&&$)this.code(F).else().code($).endIf();else if(F)this.code(F).endIf();else if($)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(D){return this._elseNode(new u8(D))}else(){return this._elseNode(new p5)}endIf(){return this._endBlockNode(u8,p5)}_for(D,F){if(this._blockNode(D),F)this.code(F).endFor();return this}for(D,F){return this._for(new aP(D),F)}forRange(D,F,$,J,Q=this.opts.es5?g1.varKinds.var:g1.varKinds.let){let Y=this._scope.toName(D);return this._for(new oP(Q,Y,F,$),()=>J(Y))}forOf(D,F,$,J=g1.varKinds.const){let Q=this._scope.toName(D);if(this.opts.es5){let Y=F instanceof U0.Name?F:this.var("_arr",F);return this.forRange("_i",0,U0._`${Y}.length`,(B)=>{this.var(Q,U0._`${Y}[${B}]`),$(Q)})}return this._for(new lX("of",J,Q,F),()=>$(Q))}forIn(D,F,$,J=this.opts.es5?g1.varKinds.var:g1.varKinds.const){if(this.opts.ownProperties)return this.forOf(D,U0._`Object.keys(${F})`,$);let Q=this._scope.toName(D);return this._for(new lX("in",J,Q,F),()=>$(Q))}endFor(){return this._endBlockNode(s3)}label(D){return this._leafNode(new pP(D))}break(D){return this._leafNode(new dP(D))}return(D){let F=new n$;if(this._blockNode(F),this.code(D),F.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(n$)}try(D,F,$){if(!F&&!$)throw Error('CodeGen: "try" without "catch" and "finally"');let J=new sP;if(this._blockNode(J),this.code(D),F){let Q=this.name("e");this._currNode=J.catch=new i$(Q),F(Q)}if($)this._currNode=J.finally=new a$,this.code($);return this._endBlockNode(i$,a$)}throw(D){return this._leafNode(new cP(D))}block(D,F){if(this._blockStarts.push(this._nodes.length),D)this.code(D).endBlock(F);return this}endBlock(D){let F=this._blockStarts.pop();if(F===void 0)throw Error("CodeGen: not in self-balancing block");let $=this._nodes.length-F;if($<0||D!==void 0&&$!==D)throw Error(`CodeGen: wrong number of nodes: ${$} vs ${D} expected`);return this._nodes.length=F,this}func(D,F=U0.nil,$,J){if(this._blockNode(new c$(D,F,$)),J)this.code(J).endFunc();return this}endFunc(){return this._endBlockNode(c$)}optimize(D=1){while(D-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(D){return this._currNode.nodes.push(D),this}_blockNode(D){this._currNode.nodes.push(D),this._nodes.push(D)}_endBlockNode(D,F){let $=this._currNode;if($ instanceof D||F&&$ instanceof F)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${F?`${D.kind}/${F.kind}`:D.kind}"`)}_elseNode(D){let F=this._currNode;if(!(F instanceof u8))throw Error('CodeGen: "else" without "if"');return this._currNode=F.else=D,this}get _root(){return this._nodes[0]}get _currNode(){let D=this._nodes;return D[D.length-1]}set _currNode(D){let F=this._nodes;F[F.length-1]=D}}oD.CodeGen=rP;function U4(D,F){for(let $ in F)D[$]=(D[$]||0)+(F[$]||0);return D}function o$(D,F){return F instanceof U0._CodeOrName?U4(D,F.names):D}function r3(D,F,$){if(D instanceof U0.Name)return J(D);if(!Q(D))return D;return new U0._Code(D._items.reduce((Y,B)=>{if(B instanceof U0.Name)B=J(B);if(B instanceof U0._Code)Y.push(...B._items);else Y.push(B);return Y},[]));function J(Y){let B=$[Y.str];if(B===void 0||F[Y.str]!==1)return Y;return delete F[Y.str],B}function Q(Y){return Y instanceof U0._Code&&Y._items.some((B)=>B instanceof U0.Name&&F[B.str]===1&&$[B.str]!==void 0)}}function E70(D,F){for(let $ in F)D[$]=(D[$]||0)-(F[$]||0)}function tP(D){return typeof D=="boolean"||typeof D=="number"||D===null?!D:U0._`!${pX(D)}`}oD.not=tP;var V70=eP(oD.operators.AND);function Z70(...D){return D.reduce(V70)}oD.and=Z70;var U70=eP(oD.operators.OR);function L70(...D){return D.reduce(U70)}oD.or=L70;function eP(D){return(F,$)=>F===U0.nil?$:$===U0.nil?F:U0._`${pX(F)} ${D} ${pX($)}`}function pX(D){return D instanceof U0.Name?D:U0._`(${D})`}});var z0=z((GI)=>{Object.defineProperty(GI,"__esModule",{value:!0});GI.checkStrictMode=GI.getErrorPath=GI.Type=GI.useFunc=GI.setEvaluated=GI.evaluatedPropsToName=GI.mergeEvaluated=GI.eachItem=GI.unescapeJsonPointer=GI.escapeJsonPointer=GI.escapeFragment=GI.unescapeFragment=GI.schemaRefOrVal=GI.schemaHasRulesButRef=GI.schemaHasRules=GI.checkUnknownRules=GI.alwaysValidSchema=GI.toHash=void 0;var _0=t(),R70=l5();function C70(D){let F={};for(let $ of D)F[$]=!0;return F}GI.toHash=C70;function O70(D,F){if(typeof F=="boolean")return F;if(Object.keys(F).length===0)return!0;return JI(D,F),!QI(F,D.self.RULES.all)}GI.alwaysValidSchema=O70;function JI(D,F=D.schema){let{opts:$,self:J}=D;if(!$.strictSchema)return;if(typeof F==="boolean")return;let Q=J.RULES.keywords;for(let Y in F)if(!Q[Y])XI(D,`unknown keyword: "${Y}"`)}GI.checkUnknownRules=JI;function QI(D,F){if(typeof D=="boolean")return!D;for(let $ in D)if(F[$])return!0;return!1}GI.schemaHasRules=QI;function w70(D,F){if(typeof D=="boolean")return!D;for(let $ in D)if($!=="$ref"&&F.all[$])return!0;return!1}GI.schemaHasRulesButRef=w70;function j70({topSchemaRef:D,schemaPath:F},$,J,Q){if(!Q){if(typeof $=="number"||typeof $=="boolean")return $;if(typeof $=="string")return _0._`${$}`}return _0._`${D}${F}${(0,_0.getProperty)(J)}`}GI.schemaRefOrVal=j70;function T70(D){return YI(decodeURIComponent(D))}GI.unescapeFragment=T70;function P70(D){return encodeURIComponent(nX(D))}GI.escapeFragment=P70;function nX(D){if(typeof D=="number")return`${D}`;return D.replace(/~/g,"~0").replace(/\//g,"~1")}GI.escapeJsonPointer=nX;function YI(D){return D.replace(/~1/g,"/").replace(/~0/g,"~")}GI.unescapeJsonPointer=YI;function I70(D,F){if(Array.isArray(D))for(let $ of D)F($);else F(D)}GI.eachItem=I70;function FI({mergeNames:D,mergeToName:F,mergeValues:$,resultToName:J}){return(Q,Y,B,X)=>{let G=B===void 0?Y:B instanceof _0.Name?(Y instanceof _0.Name?D(Q,Y,B):F(Q,Y,B),B):Y instanceof _0.Name?(F(Q,B,Y),Y):$(Y,B);return X===_0.Name&&!(G instanceof _0.Name)?J(Q,G):G}}GI.mergeEvaluated={props:FI({mergeNames:(D,F,$)=>D.if(_0._`${$} !== true && ${F} !== undefined`,()=>{D.if(_0._`${F} === true`,()=>D.assign($,!0),()=>D.assign($,_0._`${$} || {}`).code(_0._`Object.assign(${$}, ${F})`))}),mergeToName:(D,F,$)=>D.if(_0._`${$} !== true`,()=>{if(F===!0)D.assign($,!0);else D.assign($,_0._`${$} || {}`),iX(D,$,F)}),mergeValues:(D,F)=>D===!0?!0:{...D,...F},resultToName:BI}),items:FI({mergeNames:(D,F,$)=>D.if(_0._`${$} !== true && ${F} !== undefined`,()=>D.assign($,_0._`${F} === true ? true : ${$} > ${F} ? ${$} : ${F}`)),mergeToName:(D,F,$)=>D.if(_0._`${$} !== true`,()=>D.assign($,F===!0?!0:_0._`${$} > ${F} ? ${$} : ${F}`)),mergeValues:(D,F)=>D===!0?!0:Math.max(D,F),resultToName:(D,F)=>D.var("items",F)})};function BI(D,F){if(F===!0)return D.var("props",!0);let $=D.var("props",_0._`{}`);if(F!==void 0)iX(D,$,F);return $}GI.evaluatedPropsToName=BI;function iX(D,F,$){Object.keys($).forEach((J)=>D.assign(_0._`${F}${(0,_0.getProperty)(J)}`,!0))}GI.setEvaluated=iX;var $I={};function S70(D,F){return D.scopeValue("func",{ref:F,code:$I[F.code]||($I[F.code]=new R70._Code(F.code))})}GI.useFunc=S70;var cX;(function(D){D[D.Num=0]="Num",D[D.Str=1]="Str"})(cX||(GI.Type=cX={}));function k70(D,F,$){if(D instanceof _0.Name){let J=F===cX.Num;return $?J?_0._`"[" + ${D} + "]"`:_0._`"['" + ${D} + "']"`:J?_0._`"/" + ${D}`:_0._`"/" + ${D}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return $?(0,_0.getProperty)(D).toString():"/"+nX(D)}GI.getErrorPath=k70;function XI(D,F,$=D.opts.strictSchema){if(!$)return;if(F=`strict mode: ${F}`,$===!0)throw Error(F);D.self.logger.warn(F)}GI.checkStrictMode=XI});var M1=z((HI)=>{Object.defineProperty(HI,"__esModule",{value:!0});var TD=t(),o70={data:new TD.Name("data"),valCxt:new TD.Name("valCxt"),instancePath:new TD.Name("instancePath"),parentData:new TD.Name("parentData"),parentDataProperty:new TD.Name("parentDataProperty"),rootData:new TD.Name("rootData"),dynamicAnchors:new TD.Name("dynamicAnchors"),vErrors:new TD.Name("vErrors"),errors:new TD.Name("errors"),this:new TD.Name("this"),self:new TD.Name("self"),scope:new TD.Name("scope"),json:new TD.Name("json"),jsonPos:new TD.Name("jsonPos"),jsonLen:new TD.Name("jsonLen"),jsonPart:new TD.Name("jsonPart")};HI.default=o70});var d5=z((EI)=>{Object.defineProperty(EI,"__esModule",{value:!0});EI.extendErrors=EI.resetErrorsCount=EI.reportExtraError=EI.reportError=EI.keyword$DataError=EI.keywordError=void 0;var M0=t(),e$=z0(),fD=M1();EI.keywordError={message:({keyword:D})=>M0.str`must pass "${D}" keyword validation`};EI.keyword$DataError={message:({keyword:D,schemaType:F})=>F?M0.str`"${D}" keyword must be ${F} ($data)`:M0.str`"${D}" keyword is invalid ($data)`};function r70(D,F=EI.keywordError,$,J){let{it:Q}=D,{gen:Y,compositeRule:B,allErrors:X}=Q,G=zI(D,F,$);if(J!==null&&J!==void 0?J:B||X)qI(Y,G);else KI(Q,M0._`[${G}]`)}EI.reportError=r70;function t70(D,F=EI.keywordError,$){let{it:J}=D,{gen:Q,compositeRule:Y,allErrors:B}=J,X=zI(D,F,$);if(qI(Q,X),!(Y||B))KI(J,fD.default.vErrors)}EI.reportExtraError=t70;function e70(D,F){D.assign(fD.default.errors,F),D.if(M0._`${fD.default.vErrors} !== null`,()=>D.if(F,()=>D.assign(M0._`${fD.default.vErrors}.length`,F),()=>D.assign(fD.default.vErrors,null)))}EI.resetErrorsCount=e70;function D$0({gen:D,keyword:F,schemaValue:$,data:J,errsCount:Q,it:Y}){if(Q===void 0)throw Error("ajv implementation error");let B=D.name("err");D.forRange("i",Q,fD.default.errors,(X)=>{if(D.const(B,M0._`${fD.default.vErrors}[${X}]`),D.if(M0._`${B}.instancePath === undefined`,()=>D.assign(M0._`${B}.instancePath`,(0,M0.strConcat)(fD.default.instancePath,Y.errorPath))),D.assign(M0._`${B}.schemaPath`,M0.str`${Y.errSchemaPath}/${F}`),Y.opts.verbose)D.assign(M0._`${B}.schema`,$),D.assign(M0._`${B}.data`,J)})}EI.extendErrors=D$0;function qI(D,F){let $=D.const("err",F);D.if(M0._`${fD.default.vErrors} === null`,()=>D.assign(fD.default.vErrors,M0._`[${$}]`),M0._`${fD.default.vErrors}.push(${$})`),D.code(M0._`${fD.default.errors}++`)}function KI(D,F){let{gen:$,validateName:J,schemaEnv:Q}=D;if(Q.$async)$.throw(M0._`new ${D.ValidationError}(${F})`);else $.assign(M0._`${J}.errors`,F),$.return(!1)}var L4={keyword:new M0.Name("keyword"),schemaPath:new M0.Name("schemaPath"),params:new M0.Name("params"),propertyName:new M0.Name("propertyName"),message:new M0.Name("message"),schema:new M0.Name("schema"),parentSchema:new M0.Name("parentSchema")};function zI(D,F,$){let{createErrors:J}=D.it;if(J===!1)return M0._`{}`;return F$0(D,F,$)}function F$0(D,F,$={}){let{gen:J,it:Q}=D,Y=[$$0(Q,$),J$0(D,$)];return Q$0(D,F,Y),J.object(...Y)}function $$0({errorPath:D},{instancePath:F}){let $=F?M0.str`${D}${(0,e$.getErrorPath)(F,e$.Type.Str)}`:D;return[fD.default.instancePath,(0,M0.strConcat)(fD.default.instancePath,$)]}function J$0({keyword:D,it:{errSchemaPath:F}},{schemaPath:$,parentSchema:J}){let Q=J?F:M0.str`${F}/${D}`;if($)Q=M0.str`${Q}${(0,e$.getErrorPath)($,e$.Type.Str)}`;return[L4.schemaPath,Q]}function Q$0(D,{params:F,message:$},J){let{keyword:Q,data:Y,schemaValue:B,it:X}=D,{opts:G,propertyName:H,topSchemaRef:q,schemaPath:K}=X;if(J.push([L4.keyword,Q],[L4.params,typeof F=="function"?F(D):F||M0._`{}`]),G.messages)J.push([L4.message,typeof $=="function"?$(D):$]);if(G.verbose)J.push([L4.schema,B],[L4.parentSchema,M0._`${q}${K}`],[fD.default.data,Y]);if(H)J.push([L4.propertyName,H])}});var AI=z((UI)=>{Object.defineProperty(UI,"__esModule",{value:!0});UI.boolOrEmptySchema=UI.topBoolOrEmptySchema=void 0;var W$0=d5(),H$0=t(),q$0=M1(),K$0={message:"boolean schema is false"};function z$0(D){let{gen:F,schema:$,validateName:J}=D;if($===!1)ZI(D,!1);else if(typeof $=="object"&&$.$async===!0)F.return(q$0.default.data);else F.assign(H$0._`${J}.errors`,null),F.return(!0)}UI.topBoolOrEmptySchema=z$0;function E$0(D,F){let{gen:$,schema:J}=D;if(J===!1)$.var(F,!1),ZI(D);else $.var(F,!0)}UI.boolOrEmptySchema=E$0;function ZI(D,F){let{gen:$,data:J}=D,Q={gen:$,keyword:"false schema",data:J,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:D};(0,W$0.reportError)(Q,K$0,void 0,F)}});var oX=z((MI)=>{Object.defineProperty(MI,"__esModule",{value:!0});MI.getRules=MI.isJSONType=void 0;var Z$0=["string","number","integer","boolean","null","object","array"],U$0=new Set(Z$0);function L$0(D){return typeof D=="string"&&U$0.has(D)}MI.isJSONType=L$0;function A$0(){let D={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...D,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},D.number,D.string,D.array,D.object],post:{rules:[]},all:{},keywords:{}}}MI.getRules=A$0});var sX=z((OI)=>{Object.defineProperty(OI,"__esModule",{value:!0});OI.shouldUseRule=OI.shouldUseGroup=OI.schemaHasRulesForType=void 0;function N$0({schema:D,self:F},$){let J=F.RULES.types[$];return J&&J!==!0&&RI(D,J)}OI.schemaHasRulesForType=N$0;function RI(D,F){return F.rules.some(($)=>CI(D,$))}OI.shouldUseGroup=RI;function CI(D,F){var $;return D[F.keyword]!==void 0||(($=F.definition.implements)===null||$===void 0?void 0:$.some((J)=>D[J]!==void 0))}OI.shouldUseRule=CI});var c5=z((II)=>{Object.defineProperty(II,"__esModule",{value:!0});II.reportTypeError=II.checkDataTypes=II.checkDataType=II.coerceAndCheckDataType=II.getJSONTypes=II.getSchemaTypes=II.DataType=void 0;var O$0=oX(),w$0=sX(),j$0=d5(),G0=t(),jI=z0(),t3;(function(D){D[D.Correct=0]="Correct",D[D.Wrong=1]="Wrong"})(t3||(II.DataType=t3={}));function T$0(D){let F=TI(D.type);if(F.includes("null")){if(D.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!F.length&&D.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(D.nullable===!0)F.push("null")}return F}II.getSchemaTypes=T$0;function TI(D){let F=Array.isArray(D)?D:D?[D]:[];if(F.every(O$0.isJSONType))return F;throw Error("type must be JSONType or JSONType[]: "+F.join(","))}II.getJSONTypes=TI;function P$0(D,F){let{gen:$,data:J,opts:Q}=D,Y=I$0(F,Q.coerceTypes),B=F.length>0&&!(Y.length===0&&F.length===1&&(0,w$0.schemaHasRulesForType)(D,F[0]));if(B){let X=tX(F,J,Q.strictNumbers,t3.Wrong);$.if(X,()=>{if(Y.length)S$0(D,F,Y);else eX(D)})}return B}II.coerceAndCheckDataType=P$0;var PI=new Set(["string","number","integer","boolean","null"]);function I$0(D,F){return F?D.filter(($)=>PI.has($)||F==="array"&&$==="array"):[]}function S$0(D,F,$){let{gen:J,data:Q,opts:Y}=D,B=J.let("dataType",G0._`typeof ${Q}`),X=J.let("coerced",G0._`undefined`);if(Y.coerceTypes==="array")J.if(G0._`${B} == 'object' && Array.isArray(${Q}) && ${Q}.length == 1`,()=>J.assign(Q,G0._`${Q}[0]`).assign(B,G0._`typeof ${Q}`).if(tX(F,Q,Y.strictNumbers),()=>J.assign(X,Q)));J.if(G0._`${X} !== undefined`);for(let H of $)if(PI.has(H)||H==="array"&&Y.coerceTypes==="array")G(H);J.else(),eX(D),J.endIf(),J.if(G0._`${X} !== undefined`,()=>{J.assign(Q,X),k$0(D,X)});function G(H){switch(H){case"string":J.elseIf(G0._`${B} == "number" || ${B} == "boolean"`).assign(X,G0._`"" + ${Q}`).elseIf(G0._`${Q} === null`).assign(X,G0._`""`);return;case"number":J.elseIf(G0._`${B} == "boolean" || ${Q} === null
86
86
  || (${B} == "string" && ${Q} && ${Q} == +${Q})`).assign(X,G0._`+${Q}`);return;case"integer":J.elseIf(G0._`${B} === "boolean" || ${Q} === null
87
87
  || (${B} === "string" && ${Q} && ${Q} == +${Q} && !(${Q} % 1))`).assign(X,G0._`+${Q}`);return;case"boolean":J.elseIf(G0._`${Q} === "false" || ${Q} === 0 || ${Q} === null`).assign(X,!1).elseIf(G0._`${Q} === "true" || ${Q} === 1`).assign(X,!0);return;case"null":J.elseIf(G0._`${Q} === "" || ${Q} === 0 || ${Q} === false`),J.assign(X,null);return;case"array":J.elseIf(G0._`${B} === "string" || ${B} === "number"
88
- || ${B} === "boolean" || ${Q} === null`).assign(X,G0._`[${Q}]`)}}}function k$0({gen:D,parentData:F,parentDataProperty:$},J){D.if(G0._`${F} !== undefined`,()=>D.assign(G0._`${F}[${$}]`,J))}function rX(D,F,$,J=t3.Correct){let Q=J===t3.Correct?G0.operators.EQ:G0.operators.NEQ,Y;switch(D){case"null":return G0._`${F} ${Q} null`;case"array":Y=G0._`Array.isArray(${F})`;break;case"object":Y=G0._`${F} && typeof ${F} == "object" && !Array.isArray(${F})`;break;case"integer":Y=B(G0._`!(${F} % 1) && !isNaN(${F})`);break;case"number":Y=B();break;default:return G0._`typeof ${F} ${Q} ${D}`}return J===t3.Correct?Y:(0,G0.not)(Y);function B(X=G0.nil){return(0,G0.and)(G0._`typeof ${F} == "number"`,X,$?G0._`isFinite(${F})`:G0.nil)}}II.checkDataType=rX;function tX(D,F,$,J){if(D.length===1)return rX(D[0],F,$,J);let Q,Y=(0,jI.toHash)(D);if(Y.array&&Y.object){let B=G0._`typeof ${F} != "object"`;Q=Y.null?B:G0._`!${F} || ${B}`,delete Y.null,delete Y.array,delete Y.object}else Q=G0.nil;if(Y.number)delete Y.integer;for(let B in Y)Q=(0,G0.and)(Q,rX(B,F,$,J));return Q}II.checkDataTypes=tX;var v$0={message:({schema:D})=>`must be ${D}`,params:({schema:D,schemaValue:F})=>typeof D=="string"?G0._`{type: ${D}}`:G0._`{type: ${F}}`};function eX(D){let F=y$0(D);(0,j$0.reportError)(F,v$0)}II.reportTypeError=eX;function y$0(D){let{gen:F,data:$,schema:J}=D,Q=(0,jI.schemaRefOrVal)(D,J,"type");return{gen:F,keyword:"type",data:$,schema:J.type,schemaCode:Q,schemaValue:Q,parentSchema:J,params:{},it:D}}});var xI=z((vI)=>{Object.defineProperty(vI,"__esModule",{value:!0});vI.assignDefaults=void 0;var e3=t(),u$0=z0();function m$0(D,F){let{properties:$,items:J}=D.schema;if(F==="object"&&$)for(let Q in $)kI(D,Q,$[Q].default);else if(F==="array"&&Array.isArray(J))J.forEach((Q,Y)=>kI(D,Y,Q.default))}vI.assignDefaults=m$0;function kI(D,F,$){let{gen:J,compositeRule:Q,data:Y,opts:B}=D;if($===void 0)return;let X=e3._`${Y}${(0,e3.getProperty)(F)}`;if(Q){(0,u$0.checkStrictMode)(D,`default is ignored for: ${X}`);return}let G=e3._`${X} === undefined`;if(B.useDefaults==="empty")G=e3._`${G} || ${X} === null || ${X} === ""`;J.if(G,e3._`${X} = ${(0,e3.stringify)($)}`)}});var N1=z((gI)=>{Object.defineProperty(gI,"__esModule",{value:!0});gI.validateUnion=gI.validateArray=gI.usePattern=gI.callValidateCode=gI.schemaProperties=gI.allSchemaProperties=gI.noPropertyInData=gI.propertyInData=gI.isOwnProperty=gI.hasPropFunc=gI.reportMissingProp=gI.checkMissingProp=gI.checkReportMissingProp=void 0;var u0=t(),DG=z0(),f6=M1(),l$0=z0();function p$0(D,F){let{gen:$,data:J,it:Q}=D;$.if($G($,J,F,Q.opts.ownProperties),()=>{D.setParams({missingProperty:u0._`${F}`},!0),D.error()})}gI.checkReportMissingProp=p$0;function d$0({gen:D,data:F,it:{opts:$}},J,Q){return(0,u0.or)(...J.map((Y)=>(0,u0.and)($G(D,F,Y,$.ownProperties),u0._`${Q} = ${Y}`)))}gI.checkMissingProp=d$0;function c$0(D,F){D.setParams({missingProperty:F},!0),D.error()}gI.reportMissingProp=c$0;function _I(D){return D.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:u0._`Object.prototype.hasOwnProperty`})}gI.hasPropFunc=_I;function FG(D,F,$){return u0._`${_I(D)}.call(${F}, ${$})`}gI.isOwnProperty=FG;function n$0(D,F,$,J){let Q=u0._`${F}${(0,u0.getProperty)($)} !== undefined`;return J?u0._`${Q} && ${FG(D,F,$)}`:Q}gI.propertyInData=n$0;function $G(D,F,$,J){let Q=u0._`${F}${(0,u0.getProperty)($)} === undefined`;return J?(0,u0.or)(Q,(0,u0.not)(FG(D,F,$))):Q}gI.noPropertyInData=$G;function fI(D){return D?Object.keys(D).filter((F)=>F!=="__proto__"):[]}gI.allSchemaProperties=fI;function i$0(D,F){return fI(F).filter(($)=>!(0,DG.alwaysValidSchema)(D,F[$]))}gI.schemaProperties=i$0;function a$0({schemaCode:D,data:F,it:{gen:$,topSchemaRef:J,schemaPath:Q,errorPath:Y},it:B},X,G,H){let q=H?u0._`${D}, ${F}, ${J}${Q}`:F,K=[[f6.default.instancePath,(0,u0.strConcat)(f6.default.instancePath,Y)],[f6.default.parentData,B.parentData],[f6.default.parentDataProperty,B.parentDataProperty],[f6.default.rootData,f6.default.rootData]];if(B.opts.dynamicRef)K.push([f6.default.dynamicAnchors,f6.default.dynamicAnchors]);let V=u0._`${q}, ${$.object(...K)}`;return G!==u0.nil?u0._`${X}.call(${G}, ${V})`:u0._`${X}(${V})`}gI.callValidateCode=a$0;var o$0=u0._`new RegExp`;function s$0({gen:D,it:{opts:F}},$){let J=F.unicodeRegExp?"u":"",{regExp:Q}=F.code,Y=Q($,J);return D.scopeValue("pattern",{key:Y.toString(),ref:Y,code:u0._`${Q.code==="new RegExp"?o$0:(0,l$0.useFunc)(D,Q)}(${$}, ${J})`})}gI.usePattern=s$0;function r$0(D){let{gen:F,data:$,keyword:J,it:Q}=D,Y=F.name("valid");if(Q.allErrors){let X=F.let("valid",!0);return B(()=>F.assign(X,!1)),X}return F.var(Y,!0),B(()=>F.break()),Y;function B(X){let G=F.const("len",u0._`${$}.length`);F.forRange("i",0,G,(H)=>{D.subschema({keyword:J,dataProp:H,dataPropType:DG.Type.Num},Y),F.if((0,u0.not)(Y),X)})}}gI.validateArray=r$0;function t$0(D){let{gen:F,schema:$,keyword:J,it:Q}=D;if(!Array.isArray($))throw Error("ajv implementation error");if($.some((G)=>(0,DG.alwaysValidSchema)(Q,G))&&!Q.opts.unevaluated)return;let B=F.let("valid",!1),X=F.name("_valid");F.block(()=>$.forEach((G,H)=>{let q=D.subschema({keyword:J,schemaProp:H,compositeRule:!0},X);if(F.assign(B,u0._`${B} || ${X}`),!D.mergeValidEvaluated(q,X))F.if((0,u0.not)(B))})),D.result(B,()=>D.reset(),()=>D.error(!0))}gI.validateUnion=t$0});var pI=z((mI)=>{Object.defineProperty(mI,"__esModule",{value:!0});mI.validateKeywordUsage=mI.validSchemaType=mI.funcKeywordCode=mI.macroKeywordCode=void 0;var gD=t(),A4=M1(),qJ0=N1(),KJ0=d5();function zJ0(D,F){let{gen:$,keyword:J,schema:Q,parentSchema:Y,it:B}=D,X=F.macro.call(B.self,Q,Y,B),G=uI($,J,X);if(B.opts.validateSchema!==!1)B.self.validateSchema(X,!0);let H=$.name("valid");D.subschema({schema:X,schemaPath:gD.nil,errSchemaPath:`${B.errSchemaPath}/${J}`,topSchemaRef:G,compositeRule:!0},H),D.pass(H,()=>D.error(!0))}mI.macroKeywordCode=zJ0;function EJ0(D,F){var $;let{gen:J,keyword:Q,schema:Y,parentSchema:B,$data:X,it:G}=D;ZJ0(G,F);let H=!X&&F.compile?F.compile.call(G.self,Y,B,G):F.validate,q=uI(J,Q,H),K=J.let("valid");D.block$data(K,V),D.ok(($=F.valid)!==null&&$!==void 0?$:K);function V(){if(F.errors===!1){if(L(),F.modifying)bI(D);A(()=>D.error())}else{let M=F.async?E():Z();if(F.modifying)bI(D);A(()=>VJ0(D,M))}}function E(){let M=J.let("ruleErrs",null);return J.try(()=>L(gD._`await `),(N)=>J.assign(K,!1).if(gD._`${N} instanceof ${G.ValidationError}`,()=>J.assign(M,gD._`${N}.errors`),()=>J.throw(N))),M}function Z(){let M=gD._`${q}.errors`;return J.assign(M,null),L(gD.nil),M}function L(M=F.async?gD._`await `:gD.nil){let N=G.opts.passContext?A4.default.this:A4.default.self,w=!(("compile"in F)&&!X||F.schema===!1);J.assign(K,gD._`${M}${(0,qJ0.callValidateCode)(D,q,N,w)}`,F.modifying)}function A(M){var N;J.if((0,gD.not)((N=F.valid)!==null&&N!==void 0?N:K),M)}}mI.funcKeywordCode=EJ0;function bI(D){let{gen:F,data:$,it:J}=D;F.if(J.parentData,()=>F.assign($,gD._`${J.parentData}[${J.parentDataProperty}]`))}function VJ0(D,F){let{gen:$}=D;$.if(gD._`Array.isArray(${F})`,()=>{$.assign(A4.default.vErrors,gD._`${A4.default.vErrors} === null ? ${F} : ${A4.default.vErrors}.concat(${F})`).assign(A4.default.errors,gD._`${A4.default.vErrors}.length`),(0,KJ0.extendErrors)(D)},()=>D.error())}function ZJ0({schemaEnv:D},F){if(F.async&&!D.$async)throw Error("async keyword in sync schema")}function uI(D,F,$){if($===void 0)throw Error(`keyword "${F}" failed to compile`);return D.scopeValue("keyword",typeof $=="function"?{ref:$}:{ref:$,code:(0,gD.stringify)($)})}function UJ0(D,F,$=!1){return!F.length||F.some((J)=>J==="array"?Array.isArray(D):J==="object"?D&&typeof D=="object"&&!Array.isArray(D):typeof D==J||$&&typeof D>"u")}mI.validSchemaType=UJ0;function LJ0({schema:D,opts:F,self:$,errSchemaPath:J},Q,Y){if(Array.isArray(Q.keyword)?!Q.keyword.includes(Y):Q.keyword!==Y)throw Error("ajv implementation error");let B=Q.dependencies;if(B===null||B===void 0?void 0:B.some((X)=>!Object.prototype.hasOwnProperty.call(D,X)))throw Error(`parent schema must have dependencies of ${Y}: ${B.join(",")}`);if(Q.validateSchema){if(!Q.validateSchema(D[Y])){let G=`keyword "${Y}" value is invalid at path "${J}": `+$.errorsText(Q.validateSchema.errors);if(F.validateSchema==="log")$.logger.error(G);else throw Error(G)}}}mI.validateKeywordUsage=LJ0});var iI=z((cI)=>{Object.defineProperty(cI,"__esModule",{value:!0});cI.extendSubschemaMode=cI.extendSubschemaData=cI.getSubschema=void 0;var U8=t(),dI=z0();function RJ0(D,{keyword:F,schemaProp:$,schema:J,schemaPath:Q,errSchemaPath:Y,topSchemaRef:B}){if(F!==void 0&&J!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(F!==void 0){let X=D.schema[F];return $===void 0?{schema:X,schemaPath:U8._`${D.schemaPath}${(0,U8.getProperty)(F)}`,errSchemaPath:`${D.errSchemaPath}/${F}`}:{schema:X[$],schemaPath:U8._`${D.schemaPath}${(0,U8.getProperty)(F)}${(0,U8.getProperty)($)}`,errSchemaPath:`${D.errSchemaPath}/${F}/${(0,dI.escapeFragment)($)}`}}if(J!==void 0){if(Q===void 0||Y===void 0||B===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:J,schemaPath:Q,topSchemaRef:B,errSchemaPath:Y}}throw Error('either "keyword" or "schema" must be passed')}cI.getSubschema=RJ0;function CJ0(D,F,{dataProp:$,dataPropType:J,data:Q,dataTypes:Y,propertyName:B}){if(Q!==void 0&&$!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:X}=F;if($!==void 0){let{errorPath:H,dataPathArr:q,opts:K}=F,V=X.let("data",U8._`${F.data}${(0,U8.getProperty)($)}`,!0);G(V),D.errorPath=U8.str`${H}${(0,dI.getErrorPath)($,J,K.jsPropertySyntax)}`,D.parentDataProperty=U8._`${$}`,D.dataPathArr=[...q,D.parentDataProperty]}if(Q!==void 0){let H=Q instanceof U8.Name?Q:X.let("data",Q,!0);if(G(H),B!==void 0)D.propertyName=B}if(Y)D.dataTypes=Y;function G(H){D.data=H,D.dataLevel=F.dataLevel+1,D.dataTypes=[],F.definedProperties=new Set,D.parentData=F.data,D.dataNames=[...F.dataNames,H]}}cI.extendSubschemaData=CJ0;function OJ0(D,{jtdDiscriminator:F,jtdMetadata:$,compositeRule:J,createErrors:Q,allErrors:Y}){if(J!==void 0)D.compositeRule=J;if(Q!==void 0)D.createErrors=Q;if(Y!==void 0)D.allErrors=Y;D.jtdDiscriminator=F,D.jtdMetadata=$}cI.extendSubschemaMode=OJ0});var JG=z((hj0,aI)=>{aI.exports=function D(F,$){if(F===$)return!0;if(F&&$&&typeof F=="object"&&typeof $=="object"){if(F.constructor!==$.constructor)return!1;var J,Q,Y;if(Array.isArray(F)){if(J=F.length,J!=$.length)return!1;for(Q=J;Q--!==0;)if(!D(F[Q],$[Q]))return!1;return!0}if(F.constructor===RegExp)return F.source===$.source&&F.flags===$.flags;if(F.valueOf!==Object.prototype.valueOf)return F.valueOf()===$.valueOf();if(F.toString!==Object.prototype.toString)return F.toString()===$.toString();if(Y=Object.keys(F),J=Y.length,J!==Object.keys($).length)return!1;for(Q=J;Q--!==0;)if(!Object.prototype.hasOwnProperty.call($,Y[Q]))return!1;for(Q=J;Q--!==0;){var B=Y[Q];if(!D(F[B],$[B]))return!1}return!0}return F!==F&&$!==$}});var sI=z((bj0,oI)=>{var g6=oI.exports=function(D,F,$){if(typeof F=="function")$=F,F={};$=F.cb||$;var J=typeof $=="function"?$:$.pre||function(){},Q=$.post||function(){};DJ(F,J,Q,D,"",D)};g6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};g6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};g6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};g6.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 DJ(D,F,$,J,Q,Y,B,X,G,H){if(J&&typeof J=="object"&&!Array.isArray(J)){F(J,Q,Y,B,X,G,H);for(var q in J){var K=J[q];if(Array.isArray(K)){if(q in g6.arrayKeywords)for(var V=0;V<K.length;V++)DJ(D,F,$,K[V],Q+"/"+q+"/"+V,Y,Q,q,J,V)}else if(q in g6.propsKeywords){if(K&&typeof K=="object")for(var E in K)DJ(D,F,$,K[E],Q+"/"+q+"/"+TJ0(E),Y,Q,q,J,E)}else if(q in g6.keywords||D.allKeys&&!(q in g6.skipKeywords))DJ(D,F,$,K,Q+"/"+q,Y,Q,q,J)}$(J,Q,Y,B,X,G,H)}}function TJ0(D){return D.replace(/~/g,"~0").replace(/\//g,"~1")}});var n5=z((DS)=>{Object.defineProperty(DS,"__esModule",{value:!0});DS.getSchemaRefs=DS.resolveUrl=DS.normalizeId=DS._getFullPath=DS.getFullPath=DS.inlineRef=void 0;var PJ0=z0(),IJ0=JG(),SJ0=sI(),kJ0=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function vJ0(D,F=!0){if(typeof D=="boolean")return!0;if(F===!0)return!QG(D);if(!F)return!1;return rI(D)<=F}DS.inlineRef=vJ0;var yJ0=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function QG(D){for(let F in D){if(yJ0.has(F))return!0;let $=D[F];if(Array.isArray($)&&$.some(QG))return!0;if(typeof $=="object"&&QG($))return!0}return!1}function rI(D){let F=0;for(let $ in D){if($==="$ref")return 1/0;if(F++,kJ0.has($))continue;if(typeof D[$]=="object")(0,PJ0.eachItem)(D[$],(J)=>F+=rI(J));if(F===1/0)return 1/0}return F}function tI(D,F="",$){if($!==!1)F=DF(F);let J=D.parse(F);return eI(D,J)}DS.getFullPath=tI;function eI(D,F){return D.serialize(F).split("#")[0]+"#"}DS._getFullPath=eI;var xJ0=/#\/?$/;function DF(D){return D?D.replace(xJ0,""):""}DS.normalizeId=DF;function _J0(D,F,$){return $=DF($),D.resolve(F,$)}DS.resolveUrl=_J0;var fJ0=/^[a-z_][-a-z0-9._]*$/i;function gJ0(D,F){if(typeof D=="boolean")return{};let{schemaId:$,uriResolver:J}=this.opts,Q=DF(D[$]||F),Y={"":Q},B=tI(J,Q,!1),X={},G=new Set;return SJ0(D,{allKeys:!0},(K,V,E,Z)=>{if(Z===void 0)return;let L=B+V,A=Y[Z];if(typeof K[$]=="string")A=M.call(this,K[$]);N.call(this,K.$anchor),N.call(this,K.$dynamicAnchor),Y[V]=A;function M(w){let P=this.opts.uriResolver.resolve;if(w=DF(A?P(A,w):w),G.has(w))throw q(w);G.add(w);let C=this.refs[w];if(typeof C=="string")C=this.refs[C];if(typeof C=="object")H(K,C.schema,w);else if(w!==DF(L))if(w[0]==="#")H(K,X[w],w),X[w]=K;else this.refs[w]=L;return w}function N(w){if(typeof w=="string"){if(!fJ0.test(w))throw Error(`invalid anchor "${w}"`);M.call(this,`#${w}`)}}}),X;function H(K,V,E){if(V!==void 0&&!IJ0(K,V))throw q(E)}function q(K){return Error(`reference "${K}" resolves to more than one schema`)}}DS.getSchemaRefs=gJ0});var FF=z((ZS)=>{Object.defineProperty(ZS,"__esModule",{value:!0});ZS.getData=ZS.KeywordCxt=ZS.validateFunctionCode=void 0;var BS=AI(),$S=c5(),BG=sX(),FJ=c5(),pJ0=xI(),a5=pI(),YG=iI(),c=t(),o=M1(),dJ0=n5(),m8=z0(),i5=d5();function cJ0(D){if(WS(D)){if(HS(D),GS(D)){aJ0(D);return}}XS(D,()=>(0,BS.topBoolOrEmptySchema)(D))}ZS.validateFunctionCode=cJ0;function XS({gen:D,validateName:F,schema:$,schemaEnv:J,opts:Q},Y){if(Q.code.es5)D.func(F,c._`${o.default.data}, ${o.default.valCxt}`,J.$async,()=>{D.code(c._`"use strict"; ${JS($,Q)}`),iJ0(D,Q),D.code(Y)});else D.func(F,c._`${o.default.data}, ${nJ0(Q)}`,J.$async,()=>D.code(JS($,Q)).code(Y))}function nJ0(D){return c._`{${o.default.instancePath}="", ${o.default.parentData}, ${o.default.parentDataProperty}, ${o.default.rootData}=${o.default.data}${D.dynamicRef?c._`, ${o.default.dynamicAnchors}={}`:c.nil}}={}`}function iJ0(D,F){D.if(o.default.valCxt,()=>{if(D.var(o.default.instancePath,c._`${o.default.valCxt}.${o.default.instancePath}`),D.var(o.default.parentData,c._`${o.default.valCxt}.${o.default.parentData}`),D.var(o.default.parentDataProperty,c._`${o.default.valCxt}.${o.default.parentDataProperty}`),D.var(o.default.rootData,c._`${o.default.valCxt}.${o.default.rootData}`),F.dynamicRef)D.var(o.default.dynamicAnchors,c._`${o.default.valCxt}.${o.default.dynamicAnchors}`)},()=>{if(D.var(o.default.instancePath,c._`""`),D.var(o.default.parentData,c._`undefined`),D.var(o.default.parentDataProperty,c._`undefined`),D.var(o.default.rootData,o.default.data),F.dynamicRef)D.var(o.default.dynamicAnchors,c._`{}`)})}function aJ0(D){let{schema:F,opts:$,gen:J}=D;XS(D,()=>{if($.$comment&&F.$comment)KS(D);if(eJ0(D),J.let(o.default.vErrors,null),J.let(o.default.errors,0),$.unevaluated)oJ0(D);qS(D),$Q0(D)});return}function oJ0(D){let{gen:F,validateName:$}=D;D.evaluated=F.const("evaluated",c._`${$}.evaluated`),F.if(c._`${D.evaluated}.dynamicProps`,()=>F.assign(c._`${D.evaluated}.props`,c._`undefined`)),F.if(c._`${D.evaluated}.dynamicItems`,()=>F.assign(c._`${D.evaluated}.items`,c._`undefined`))}function JS(D,F){let $=typeof D=="object"&&D[F.schemaId];return $&&(F.code.source||F.code.process)?c._`/*# sourceURL=${$} */`:c.nil}function sJ0(D,F){if(WS(D)){if(HS(D),GS(D)){rJ0(D,F);return}}(0,BS.boolOrEmptySchema)(D,F)}function GS({schema:D,self:F}){if(typeof D=="boolean")return!D;for(let $ in D)if(F.RULES.all[$])return!0;return!1}function WS(D){return typeof D.schema!="boolean"}function rJ0(D,F){let{schema:$,gen:J,opts:Q}=D;if(Q.$comment&&$.$comment)KS(D);DQ0(D),FQ0(D);let Y=J.const("_errs",o.default.errors);qS(D,Y),J.var(F,c._`${Y} === ${o.default.errors}`)}function HS(D){(0,m8.checkUnknownRules)(D),tJ0(D)}function qS(D,F){if(D.opts.jtd)return QS(D,[],!1,F);let $=(0,$S.getSchemaTypes)(D.schema),J=(0,$S.coerceAndCheckDataType)(D,$);QS(D,$,!J,F)}function tJ0(D){let{schema:F,errSchemaPath:$,opts:J,self:Q}=D;if(F.$ref&&J.ignoreKeywordsWithRef&&(0,m8.schemaHasRulesButRef)(F,Q.RULES))Q.logger.warn(`$ref: keywords ignored in schema at path "${$}"`)}function eJ0(D){let{schema:F,opts:$}=D;if(F.default!==void 0&&$.useDefaults&&$.strictSchema)(0,m8.checkStrictMode)(D,"default is ignored in the schema root")}function DQ0(D){let F=D.schema[D.opts.schemaId];if(F)D.baseId=(0,dJ0.resolveUrl)(D.opts.uriResolver,D.baseId,F)}function FQ0(D){if(D.schema.$async&&!D.schemaEnv.$async)throw Error("async schema in sync schema")}function KS({gen:D,schemaEnv:F,schema:$,errSchemaPath:J,opts:Q}){let Y=$.$comment;if(Q.$comment===!0)D.code(c._`${o.default.self}.logger.log(${Y})`);else if(typeof Q.$comment=="function"){let B=c.str`${J}/$comment`,X=D.scopeValue("root",{ref:F.root});D.code(c._`${o.default.self}.opts.$comment(${Y}, ${B}, ${X}.schema)`)}}function $Q0(D){let{gen:F,schemaEnv:$,validateName:J,ValidationError:Q,opts:Y}=D;if($.$async)F.if(c._`${o.default.errors} === 0`,()=>F.return(o.default.data),()=>F.throw(c._`new ${Q}(${o.default.vErrors})`));else{if(F.assign(c._`${J}.errors`,o.default.vErrors),Y.unevaluated)JQ0(D);F.return(c._`${o.default.errors} === 0`)}}function JQ0({gen:D,evaluated:F,props:$,items:J}){if($ instanceof c.Name)D.assign(c._`${F}.props`,$);if(J instanceof c.Name)D.assign(c._`${F}.items`,J)}function QS(D,F,$,J){let{gen:Q,schema:Y,data:B,allErrors:X,opts:G,self:H}=D,{RULES:q}=H;if(Y.$ref&&(G.ignoreKeywordsWithRef||!(0,m8.schemaHasRulesButRef)(Y,q))){Q.block(()=>ES(D,"$ref",q.all.$ref.definition));return}if(!G.jtd)QQ0(D,F);Q.block(()=>{for(let V of q.rules)K(V);K(q.post)});function K(V){if(!(0,BG.shouldUseGroup)(Y,V))return;if(V.type){if(Q.if((0,FJ.checkDataType)(V.type,B,G.strictNumbers)),YS(D,V),F.length===1&&F[0]===V.type&&$)Q.else(),(0,FJ.reportTypeError)(D);Q.endIf()}else YS(D,V);if(!X)Q.if(c._`${o.default.errors} === ${J||0}`)}}function YS(D,F){let{gen:$,schema:J,opts:{useDefaults:Q}}=D;if(Q)(0,pJ0.assignDefaults)(D,F.type);$.block(()=>{for(let Y of F.rules)if((0,BG.shouldUseRule)(J,Y))ES(D,Y.keyword,Y.definition,F.type)})}function QQ0(D,F){if(D.schemaEnv.meta||!D.opts.strictTypes)return;if(YQ0(D,F),!D.opts.allowUnionTypes)BQ0(D,F);XQ0(D,D.dataTypes)}function YQ0(D,F){if(!F.length)return;if(!D.dataTypes.length){D.dataTypes=F;return}F.forEach(($)=>{if(!zS(D.dataTypes,$))XG(D,`type "${$}" not allowed by context "${D.dataTypes.join(",")}"`)}),WQ0(D,F)}function BQ0(D,F){if(F.length>1&&!(F.length===2&&F.includes("null")))XG(D,"use allowUnionTypes to allow union type keyword")}function XQ0(D,F){let $=D.self.RULES.all;for(let J in $){let Q=$[J];if(typeof Q=="object"&&(0,BG.shouldUseRule)(D.schema,Q)){let{type:Y}=Q.definition;if(Y.length&&!Y.some((B)=>GQ0(F,B)))XG(D,`missing type "${Y.join(",")}" for keyword "${J}"`)}}}function GQ0(D,F){return D.includes(F)||F==="number"&&D.includes("integer")}function zS(D,F){return D.includes(F)||F==="integer"&&D.includes("number")}function WQ0(D,F){let $=[];for(let J of D.dataTypes)if(zS(F,J))$.push(J);else if(F.includes("integer")&&J==="number")$.push("integer");D.dataTypes=$}function XG(D,F){let $=D.schemaEnv.baseId+D.errSchemaPath;F+=` at "${$}" (strictTypes)`,(0,m8.checkStrictMode)(D,F,D.opts.strictTypes)}class GG{constructor(D,F,$){if((0,a5.validateKeywordUsage)(D,F,$),this.gen=D.gen,this.allErrors=D.allErrors,this.keyword=$,this.data=D.data,this.schema=D.schema[$],this.$data=F.$data&&D.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m8.schemaRefOrVal)(D,this.schema,$,this.$data),this.schemaType=F.schemaType,this.parentSchema=D.schema,this.params={},this.it=D,this.def=F,this.$data)this.schemaCode=D.gen.const("vSchema",VS(this.$data,D));else if(this.schemaCode=this.schemaValue,!(0,a5.validSchemaType)(this.schema,F.schemaType,F.allowUndefined))throw Error(`${$} value must be ${JSON.stringify(F.schemaType)}`);if("code"in F?F.trackErrors:F.errors!==!1)this.errsCount=D.gen.const("_errs",o.default.errors)}result(D,F,$){this.failResult((0,c.not)(D),F,$)}failResult(D,F,$){if(this.gen.if(D),$)$();else this.error();if(F){if(this.gen.else(),F(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(D,F){this.failResult((0,c.not)(D),void 0,F)}fail(D){if(D===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(D),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(D){if(!this.$data)return this.fail(D);let{schemaCode:F}=this;this.fail(c._`${F} !== undefined && (${(0,c.or)(this.invalid$data(),D)})`)}error(D,F,$){if(F){this.setParams(F),this._error(D,$),this.setParams({});return}this._error(D,$)}_error(D,F){(D?i5.reportExtraError:i5.reportError)(this,this.def.error,F)}$dataError(){(0,i5.reportError)(this,this.def.$dataError||i5.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,i5.resetErrorsCount)(this.gen,this.errsCount)}ok(D){if(!this.allErrors)this.gen.if(D)}setParams(D,F){if(F)Object.assign(this.params,D);else this.params=D}block$data(D,F,$=c.nil){this.gen.block(()=>{this.check$data(D,$),F()})}check$data(D=c.nil,F=c.nil){if(!this.$data)return;let{gen:$,schemaCode:J,schemaType:Q,def:Y}=this;if($.if((0,c.or)(c._`${J} === undefined`,F)),D!==c.nil)$.assign(D,!0);if(Q.length||Y.validateSchema){if($.elseIf(this.invalid$data()),this.$dataError(),D!==c.nil)$.assign(D,!1)}$.else()}invalid$data(){let{gen:D,schemaCode:F,schemaType:$,def:J,it:Q}=this;return(0,c.or)(Y(),B());function Y(){if($.length){if(!(F instanceof c.Name))throw Error("ajv implementation error");let X=Array.isArray($)?$:[$];return c._`${(0,FJ.checkDataTypes)(X,F,Q.opts.strictNumbers,FJ.DataType.Wrong)}`}return c.nil}function B(){if(J.validateSchema){let X=D.scopeValue("validate$data",{ref:J.validateSchema});return c._`!${X}(${F})`}return c.nil}}subschema(D,F){let $=(0,YG.getSubschema)(this.it,D);(0,YG.extendSubschemaData)($,this.it,D),(0,YG.extendSubschemaMode)($,D);let J={...this.it,...$,items:void 0,props:void 0};return sJ0(J,F),J}mergeEvaluated(D,F){let{it:$,gen:J}=this;if(!$.opts.unevaluated)return;if($.props!==!0&&D.props!==void 0)$.props=m8.mergeEvaluated.props(J,D.props,$.props,F);if($.items!==!0&&D.items!==void 0)$.items=m8.mergeEvaluated.items(J,D.items,$.items,F)}mergeValidEvaluated(D,F){let{it:$,gen:J}=this;if($.opts.unevaluated&&($.props!==!0||$.items!==!0))return J.if(F,()=>this.mergeEvaluated(D,c.Name)),!0}}ZS.KeywordCxt=GG;function ES(D,F,$,J){let Q=new GG(D,$,F);if("code"in $)$.code(Q,J);else if(Q.$data&&$.validate)(0,a5.funcKeywordCode)(Q,$);else if("macro"in $)(0,a5.macroKeywordCode)(Q,$);else if($.compile||$.validate)(0,a5.funcKeywordCode)(Q,$)}var HQ0=/^\/(?:[^~]|~0|~1)*$/,qQ0=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function VS(D,{dataLevel:F,dataNames:$,dataPathArr:J}){let Q,Y;if(D==="")return o.default.rootData;if(D[0]==="/"){if(!HQ0.test(D))throw Error(`Invalid JSON-pointer: ${D}`);Q=D,Y=o.default.rootData}else{let H=qQ0.exec(D);if(!H)throw Error(`Invalid JSON-pointer: ${D}`);let q=+H[1];if(Q=H[2],Q==="#"){if(q>=F)throw Error(G("property/index",q));return J[F-q]}if(q>F)throw Error(G("data",q));if(Y=$[F-q],!Q)return Y}let B=Y,X=Q.split("/");for(let H of X)if(H)Y=c._`${Y}${(0,c.getProperty)((0,m8.unescapeJsonPointer)(H))}`,B=c._`${B} && ${Y}`;return B;function G(H,q){return`Cannot access ${H} ${q} levels up, current level is ${F}`}}ZS.getData=VS});var o5=z((AS)=>{Object.defineProperty(AS,"__esModule",{value:!0});class LS extends Error{constructor(D){super("validation failed");this.errors=D,this.ajv=this.validation=!0}}AS.default=LS});var $F=z((NS)=>{Object.defineProperty(NS,"__esModule",{value:!0});var WG=n5();class MS extends Error{constructor(D,F,$,J){super(J||`can't resolve reference ${$} from id ${F}`);this.missingRef=(0,WG.resolveUrl)(D,F,$),this.missingSchema=(0,WG.normalizeId)((0,WG.getFullPath)(D,this.missingRef))}}NS.default=MS});var r5=z((OS)=>{Object.defineProperty(OS,"__esModule",{value:!0});OS.resolveSchema=OS.getCompilingSchema=OS.resolveRef=OS.compileSchema=OS.SchemaEnv=void 0;var h1=t(),ZQ0=o5(),M4=M1(),b1=n5(),RS=z0(),UQ0=FF();class s5{constructor(D){var F;this.refs={},this.dynamicAnchors={};let $;if(typeof D.schema=="object")$=D.schema;this.schema=D.schema,this.schemaId=D.schemaId,this.root=D.root||this,this.baseId=(F=D.baseId)!==null&&F!==void 0?F:(0,b1.normalizeId)($===null||$===void 0?void 0:$[D.schemaId||"$id"]),this.schemaPath=D.schemaPath,this.localRefs=D.localRefs,this.meta=D.meta,this.$async=$===null||$===void 0?void 0:$.$async,this.refs={}}}OS.SchemaEnv=s5;function qG(D){let F=CS.call(this,D);if(F)return F;let $=(0,b1.getFullPath)(this.opts.uriResolver,D.root.baseId),{es5:J,lines:Q}=this.opts.code,{ownProperties:Y}=this.opts,B=new h1.CodeGen(this.scope,{es5:J,lines:Q,ownProperties:Y}),X;if(D.$async)X=B.scopeValue("Error",{ref:ZQ0.default,code:h1._`require("ajv/dist/runtime/validation_error").default`});let G=B.scopeName("validate");D.validateName=G;let H={gen:B,allErrors:this.opts.allErrors,data:M4.default.data,parentData:M4.default.parentData,parentDataProperty:M4.default.parentDataProperty,dataNames:[M4.default.data],dataPathArr:[h1.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:B.scopeValue("schema",this.opts.code.source===!0?{ref:D.schema,code:(0,h1.stringify)(D.schema)}:{ref:D.schema}),validateName:G,ValidationError:X,schema:D.schema,schemaEnv:D,rootId:$,baseId:D.baseId||$,schemaPath:h1.nil,errSchemaPath:D.schemaPath||(this.opts.jtd?"":"#"),errorPath:h1._`""`,opts:this.opts,self:this},q;try{this._compilations.add(D),(0,UQ0.validateFunctionCode)(H),B.optimize(this.opts.code.optimize);let K=B.toString();if(q=`${B.scopeRefs(M4.default.scope)}return ${K}`,this.opts.code.process)q=this.opts.code.process(q,D);let E=Function(`${M4.default.self}`,`${M4.default.scope}`,q)(this,this.scope.get());if(this.scope.value(G,{ref:E}),E.errors=null,E.schema=D.schema,E.schemaEnv=D,D.$async)E.$async=!0;if(this.opts.code.source===!0)E.source={validateName:G,validateCode:K,scopeValues:B._values};if(this.opts.unevaluated){let{props:Z,items:L}=H;if(E.evaluated={props:Z instanceof h1.Name?void 0:Z,items:L instanceof h1.Name?void 0:L,dynamicProps:Z instanceof h1.Name,dynamicItems:L instanceof h1.Name},E.source)E.source.evaluated=(0,h1.stringify)(E.evaluated)}return D.validate=E,D}catch(K){if(delete D.validate,delete D.validateName,q)this.logger.error("Error compiling schema, function code:",q);throw K}finally{this._compilations.delete(D)}}OS.compileSchema=qG;function LQ0(D,F,$){var J;$=(0,b1.resolveUrl)(this.opts.uriResolver,F,$);let Q=D.refs[$];if(Q)return Q;let Y=NQ0.call(this,D,$);if(Y===void 0){let B=(J=D.localRefs)===null||J===void 0?void 0:J[$],{schemaId:X}=this.opts;if(B)Y=new s5({schema:B,schemaId:X,root:D,baseId:F})}if(Y===void 0)return;return D.refs[$]=AQ0.call(this,Y)}OS.resolveRef=LQ0;function AQ0(D){if((0,b1.inlineRef)(D.schema,this.opts.inlineRefs))return D.schema;return D.validate?D:qG.call(this,D)}function CS(D){for(let F of this._compilations)if(MQ0(F,D))return F}OS.getCompilingSchema=CS;function MQ0(D,F){return D.schema===F.schema&&D.root===F.root&&D.baseId===F.baseId}function NQ0(D,F){let $;while(typeof($=this.refs[F])=="string")F=$;return $||this.schemas[F]||$J.call(this,D,F)}function $J(D,F){let $=this.opts.uriResolver.parse(F),J=(0,b1._getFullPath)(this.opts.uriResolver,$),Q=(0,b1.getFullPath)(this.opts.uriResolver,D.baseId,void 0);if(Object.keys(D.schema).length>0&&J===Q)return HG.call(this,$,D);let Y=(0,b1.normalizeId)(J),B=this.refs[Y]||this.schemas[Y];if(typeof B=="string"){let X=$J.call(this,D,B);if(typeof(X===null||X===void 0?void 0:X.schema)!=="object")return;return HG.call(this,$,X)}if(typeof(B===null||B===void 0?void 0:B.schema)!=="object")return;if(!B.validate)qG.call(this,B);if(Y===(0,b1.normalizeId)(F)){let{schema:X}=B,{schemaId:G}=this.opts,H=X[G];if(H)Q=(0,b1.resolveUrl)(this.opts.uriResolver,Q,H);return new s5({schema:X,schemaId:G,root:D,baseId:Q})}return HG.call(this,$,B)}OS.resolveSchema=$J;var RQ0=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function HG(D,{baseId:F,schema:$,root:J}){var Q;if(((Q=D.fragment)===null||Q===void 0?void 0:Q[0])!=="/")return;for(let X of D.fragment.slice(1).split("/")){if(typeof $==="boolean")return;let G=$[(0,RS.unescapeFragment)(X)];if(G===void 0)return;$=G;let H=typeof $==="object"&&$[this.opts.schemaId];if(!RQ0.has(X)&&H)F=(0,b1.resolveUrl)(this.opts.uriResolver,F,H)}let Y;if(typeof $!="boolean"&&$.$ref&&!(0,RS.schemaHasRulesButRef)($,this.RULES)){let X=(0,b1.resolveUrl)(this.opts.uriResolver,F,$.$ref);Y=$J.call(this,J,X)}let{schemaId:B}=this.opts;if(Y=Y||new s5({schema:$,schemaId:B,root:J,baseId:F}),Y.schema!==Y.root.schema)return Y;return}});var jS=z((cj0,TQ0)=>{TQ0.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 zG=z((nj0,SS)=>{var PQ0=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),PS=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 KG(D){let F="",$=0,J=0;for(J=0;J<D.length;J++){if($=D[J].charCodeAt(0),$===48)continue;if(!($>=48&&$<=57||$>=65&&$<=70||$>=97&&$<=102))return"";F+=D[J];break}for(J+=1;J<D.length;J++){if($=D[J].charCodeAt(0),!($>=48&&$<=57||$>=65&&$<=70||$>=97&&$<=102))return"";F+=D[J]}return F}var IQ0=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function TS(D){return D.length=0,!0}function SQ0(D,F,$){if(D.length){let J=KG(D);if(J!=="")F.push(J);else return $.error=!0,!1;D.length=0}return!0}function kQ0(D){let F=0,$={error:!1,address:"",zone:""},J=[],Q=[],Y=!1,B=!1,X=SQ0;for(let G=0;G<D.length;G++){let H=D[G];if(H==="["||H==="]")continue;if(H===":"){if(Y===!0)B=!0;if(!X(Q,J,$))break;if(++F>7){$.error=!0;break}if(G>0&&D[G-1]===":")Y=!0;J.push(":");continue}else if(H==="%"){if(!X(Q,J,$))break;X=TS}else{Q.push(H);continue}}if(Q.length)if(X===TS)$.zone=Q.join("");else if(B)J.push(Q.join(""));else J.push(KG(Q));return $.address=J.join(""),$}function IS(D){if(vQ0(D,":")<2)return{host:D,isIPV6:!1};let F=kQ0(D);if(!F.error){let{address:$,address:J}=F;if(F.zone)$+="%"+F.zone,J+="%25"+F.zone;return{host:$,isIPV6:!0,escapedHost:J}}else return{host:D,isIPV6:!1}}function vQ0(D,F){let $=0;for(let J=0;J<D.length;J++)if(D[J]===F)$++;return $}function yQ0(D){let F=D,$=[],J=-1,Q=0;while(Q=F.length){if(Q===1)if(F===".")break;else if(F==="/"){$.push("/");break}else{$.push(F);break}else if(Q===2){if(F[0]==="."){if(F[1]===".")break;else if(F[1]==="/"){F=F.slice(2);continue}}else if(F[0]==="/"){if(F[1]==="."||F[1]==="/"){$.push("/");break}}}else if(Q===3){if(F==="/.."){if($.length!==0)$.pop();$.push("/");break}}if(F[0]==="."){if(F[1]==="."){if(F[2]==="/"){F=F.slice(3);continue}}else if(F[1]==="/"){F=F.slice(2);continue}}else if(F[0]==="/"){if(F[1]==="."){if(F[2]==="/"){F=F.slice(2);continue}else if(F[2]==="."){if(F[3]==="/"){if(F=F.slice(3),$.length!==0)$.pop();continue}}}}if((J=F.indexOf("/",1))===-1){$.push(F);break}else $.push(F.slice(0,J)),F=F.slice(J)}return $.join("")}function xQ0(D,F){let $=F!==!0?escape:unescape;if(D.scheme!==void 0)D.scheme=$(D.scheme);if(D.userinfo!==void 0)D.userinfo=$(D.userinfo);if(D.host!==void 0)D.host=$(D.host);if(D.path!==void 0)D.path=$(D.path);if(D.query!==void 0)D.query=$(D.query);if(D.fragment!==void 0)D.fragment=$(D.fragment);return D}function _Q0(D){let F=[];if(D.userinfo!==void 0)F.push(D.userinfo),F.push("@");if(D.host!==void 0){let $=unescape(D.host);if(!PS($)){let J=IS($);if(J.isIPV6===!0)$=`[${J.escapedHost}]`;else $=D.host}F.push($)}if(typeof D.port==="number"||typeof D.port==="string")F.push(":"),F.push(String(D.port));return F.length?F.join(""):void 0}SS.exports={nonSimpleDomain:IQ0,recomposeAuthority:_Q0,normalizeComponentEncoding:xQ0,removeDotSegments:yQ0,isIPv4:PS,isUUID:PQ0,normalizeIPv6:IS,stringArrayToHexStripped:KG}});var _S=z((ij0,xS)=>{var{isUUID:fQ0}=zG(),gQ0=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,hQ0=["http","https","ws","wss","urn","urn:uuid"];function bQ0(D){return hQ0.indexOf(D)!==-1}function EG(D){if(D.secure===!0)return!0;else if(D.secure===!1)return!1;else if(D.scheme)return D.scheme.length===3&&(D.scheme[0]==="w"||D.scheme[0]==="W")&&(D.scheme[1]==="s"||D.scheme[1]==="S")&&(D.scheme[2]==="s"||D.scheme[2]==="S");else return!1}function kS(D){if(!D.host)D.error=D.error||"HTTP URIs must have a host.";return D}function vS(D){let F=String(D.scheme).toLowerCase()==="https";if(D.port===(F?443:80)||D.port==="")D.port=void 0;if(!D.path)D.path="/";return D}function uQ0(D){return D.secure=EG(D),D.resourceName=(D.path||"/")+(D.query?"?"+D.query:""),D.path=void 0,D.query=void 0,D}function mQ0(D){if(D.port===(EG(D)?443:80)||D.port==="")D.port=void 0;if(typeof D.secure==="boolean")D.scheme=D.secure?"wss":"ws",D.secure=void 0;if(D.resourceName){let[F,$]=D.resourceName.split("?");D.path=F&&F!=="/"?F:void 0,D.query=$,D.resourceName=void 0}return D.fragment=void 0,D}function lQ0(D,F){if(!D.path)return D.error="URN can not be parsed",D;let $=D.path.match(gQ0);if($){let J=F.scheme||D.scheme||"urn";D.nid=$[1].toLowerCase(),D.nss=$[2];let Q=`${J}:${F.nid||D.nid}`,Y=VG(Q);if(D.path=void 0,Y)D=Y.parse(D,F)}else D.error=D.error||"URN can not be parsed.";return D}function pQ0(D,F){if(D.nid===void 0)throw Error("URN without nid cannot be serialized");let $=F.scheme||D.scheme||"urn",J=D.nid.toLowerCase(),Q=`${$}:${F.nid||J}`,Y=VG(Q);if(Y)D=Y.serialize(D,F);let B=D,X=D.nss;return B.path=`${J||F.nid}:${X}`,F.skipEscape=!0,B}function dQ0(D,F){let $=D;if($.uuid=$.nss,$.nss=void 0,!F.tolerant&&(!$.uuid||!fQ0($.uuid)))$.error=$.error||"UUID is not valid.";return $}function cQ0(D){let F=D;return F.nss=(D.uuid||"").toLowerCase(),F}var yS={scheme:"http",domainHost:!0,parse:kS,serialize:vS},nQ0={scheme:"https",domainHost:yS.domainHost,parse:kS,serialize:vS},JJ={scheme:"ws",domainHost:!0,parse:uQ0,serialize:mQ0},iQ0={scheme:"wss",domainHost:JJ.domainHost,parse:JJ.parse,serialize:JJ.serialize},aQ0={scheme:"urn",parse:lQ0,serialize:pQ0,skipNormalize:!0},oQ0={scheme:"urn:uuid",parse:dQ0,serialize:cQ0,skipNormalize:!0},QJ={http:yS,https:nQ0,ws:JJ,wss:iQ0,urn:aQ0,"urn:uuid":oQ0};Object.setPrototypeOf(QJ,null);function VG(D){return D&&(QJ[D]||QJ[D.toLowerCase()])||void 0}xS.exports={wsIsSecure:EG,SCHEMES:QJ,isValidSchemeName:bQ0,getSchemeHandler:VG}});var hS=z((aj0,BJ)=>{var{normalizeIPv6:sQ0,removeDotSegments:t5,recomposeAuthority:rQ0,normalizeComponentEncoding:YJ,isIPv4:tQ0,nonSimpleDomain:eQ0}=zG(),{SCHEMES:DY0,getSchemeHandler:fS}=_S();function FY0(D,F){if(typeof D==="string")D=L8(l8(D,F),F);else if(typeof D==="object")D=l8(L8(D,F),F);return D}function $Y0(D,F,$){let J=$?Object.assign({scheme:"null"},$):{scheme:"null"},Q=gS(l8(D,J),l8(F,J),J,!0);return J.skipEscape=!0,L8(Q,J)}function gS(D,F,$,J){let Q={};if(!J)D=l8(L8(D,$),$),F=l8(L8(F,$),$);if($=$||{},!$.tolerant&&F.scheme)Q.scheme=F.scheme,Q.userinfo=F.userinfo,Q.host=F.host,Q.port=F.port,Q.path=t5(F.path||""),Q.query=F.query;else{if(F.userinfo!==void 0||F.host!==void 0||F.port!==void 0)Q.userinfo=F.userinfo,Q.host=F.host,Q.port=F.port,Q.path=t5(F.path||""),Q.query=F.query;else{if(!F.path)if(Q.path=D.path,F.query!==void 0)Q.query=F.query;else Q.query=D.query;else{if(F.path[0]==="/")Q.path=t5(F.path);else{if((D.userinfo!==void 0||D.host!==void 0||D.port!==void 0)&&!D.path)Q.path="/"+F.path;else if(!D.path)Q.path=F.path;else Q.path=D.path.slice(0,D.path.lastIndexOf("/")+1)+F.path;Q.path=t5(Q.path)}Q.query=F.query}Q.userinfo=D.userinfo,Q.host=D.host,Q.port=D.port}Q.scheme=D.scheme}return Q.fragment=F.fragment,Q}function JY0(D,F,$){if(typeof D==="string")D=unescape(D),D=L8(YJ(l8(D,$),!0),{...$,skipEscape:!0});else if(typeof D==="object")D=L8(YJ(D,!0),{...$,skipEscape:!0});if(typeof F==="string")F=unescape(F),F=L8(YJ(l8(F,$),!0),{...$,skipEscape:!0});else if(typeof F==="object")F=L8(YJ(F,!0),{...$,skipEscape:!0});return D.toLowerCase()===F.toLowerCase()}function L8(D,F){let $={host:D.host,scheme:D.scheme,userinfo:D.userinfo,port:D.port,path:D.path,query:D.query,nid:D.nid,nss:D.nss,uuid:D.uuid,fragment:D.fragment,reference:D.reference,resourceName:D.resourceName,secure:D.secure,error:""},J=Object.assign({},F),Q=[],Y=fS(J.scheme||$.scheme);if(Y&&Y.serialize)Y.serialize($,J);if($.path!==void 0)if(!J.skipEscape){if($.path=escape($.path),$.scheme!==void 0)$.path=$.path.split("%3A").join(":")}else $.path=unescape($.path);if(J.reference!=="suffix"&&$.scheme)Q.push($.scheme,":");let B=rQ0($);if(B!==void 0){if(J.reference!=="suffix")Q.push("//");if(Q.push(B),$.path&&$.path[0]!=="/")Q.push("/")}if($.path!==void 0){let X=$.path;if(!J.absolutePath&&(!Y||!Y.absolutePath))X=t5(X);if(B===void 0&&X[0]==="/"&&X[1]==="/")X="/%2F"+X.slice(2);Q.push(X)}if($.query!==void 0)Q.push("?",$.query);if($.fragment!==void 0)Q.push("#",$.fragment);return Q.join("")}var QY0=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function l8(D,F){let $=Object.assign({},F),J={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},Q=!1;if($.reference==="suffix")if($.scheme)D=$.scheme+":"+D;else D="//"+D;let Y=D.match(QY0);if(Y){if(J.scheme=Y[1],J.userinfo=Y[3],J.host=Y[4],J.port=parseInt(Y[5],10),J.path=Y[6]||"",J.query=Y[7],J.fragment=Y[8],isNaN(J.port))J.port=Y[5];if(J.host)if(tQ0(J.host)===!1){let G=sQ0(J.host);J.host=G.host.toLowerCase(),Q=G.isIPV6}else Q=!0;if(J.scheme===void 0&&J.userinfo===void 0&&J.host===void 0&&J.port===void 0&&J.query===void 0&&!J.path)J.reference="same-document";else if(J.scheme===void 0)J.reference="relative";else if(J.fragment===void 0)J.reference="absolute";else J.reference="uri";if($.reference&&$.reference!=="suffix"&&$.reference!==J.reference)J.error=J.error||"URI is not a "+$.reference+" reference.";let B=fS($.scheme||J.scheme);if(!$.unicodeSupport&&(!B||!B.unicodeSupport)){if(J.host&&($.domainHost||B&&B.domainHost)&&Q===!1&&eQ0(J.host))try{J.host=URL.domainToASCII(J.host.toLowerCase())}catch(X){J.error=J.error||"Host's domain name can not be converted to ASCII: "+X}}if(!B||B&&!B.skipNormalize){if(D.indexOf("%")!==-1){if(J.scheme!==void 0)J.scheme=unescape(J.scheme);if(J.host!==void 0)J.host=unescape(J.host)}if(J.path)J.path=escape(unescape(J.path));if(J.fragment)J.fragment=encodeURI(decodeURIComponent(J.fragment))}if(B&&B.parse)B.parse(J,$)}else J.error=J.error||"URI can not be parsed.";return J}var ZG={SCHEMES:DY0,normalize:FY0,resolve:$Y0,resolveComponent:gS,equal:JY0,serialize:L8,parse:l8};BJ.exports=ZG;BJ.exports.default=ZG;BJ.exports.fastUri=ZG});var mS=z((uS)=>{Object.defineProperty(uS,"__esModule",{value:!0});var bS=hS();bS.code='require("ajv/dist/runtime/uri").default';uS.default=bS});var AG=z((p8)=>{Object.defineProperty(p8,"__esModule",{value:!0});p8.CodeGen=p8.Name=p8.nil=p8.stringify=p8.str=p8._=p8.KeywordCxt=void 0;var BY0=FF();Object.defineProperty(p8,"KeywordCxt",{enumerable:!0,get:function(){return BY0.KeywordCxt}});var JF=t();Object.defineProperty(p8,"_",{enumerable:!0,get:function(){return JF._}});Object.defineProperty(p8,"str",{enumerable:!0,get:function(){return JF.str}});Object.defineProperty(p8,"stringify",{enumerable:!0,get:function(){return JF.stringify}});Object.defineProperty(p8,"nil",{enumerable:!0,get:function(){return JF.nil}});Object.defineProperty(p8,"Name",{enumerable:!0,get:function(){return JF.Name}});Object.defineProperty(p8,"CodeGen",{enumerable:!0,get:function(){return JF.CodeGen}});var XY0=o5(),nS=$F(),GY0=oX(),e5=r5(),WY0=t(),D9=n5(),XJ=c5(),LG=z0(),lS=jS(),HY0=mS(),iS=(D,F)=>new RegExp(D,F);iS.code="new RegExp";var qY0=["removeAdditional","useDefaults","coerceTypes"],KY0=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),zY0={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."},EY0={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},pS=200;function VY0(D){var F,$,J,Q,Y,B,X,G,H,q,K,V,E,Z,L,A,M,N,w,P,C,T,y,d,W0;let F0=D.strict,O0=(F=D.code)===null||F===void 0?void 0:F.optimize,e=O0===!0||O0===void 0?1:O0||0,N0=(J=($=D.code)===null||$===void 0?void 0:$.regExp)!==null&&J!==void 0?J:iS,GD=(Q=D.uriResolver)!==null&&Q!==void 0?Q:HY0.default;return{strictSchema:(B=(Y=D.strictSchema)!==null&&Y!==void 0?Y:F0)!==null&&B!==void 0?B:!0,strictNumbers:(G=(X=D.strictNumbers)!==null&&X!==void 0?X:F0)!==null&&G!==void 0?G:!0,strictTypes:(q=(H=D.strictTypes)!==null&&H!==void 0?H:F0)!==null&&q!==void 0?q:"log",strictTuples:(V=(K=D.strictTuples)!==null&&K!==void 0?K:F0)!==null&&V!==void 0?V:"log",strictRequired:(Z=(E=D.strictRequired)!==null&&E!==void 0?E:F0)!==null&&Z!==void 0?Z:!1,code:D.code?{...D.code,optimize:e,regExp:N0}:{optimize:e,regExp:N0},loopRequired:(L=D.loopRequired)!==null&&L!==void 0?L:pS,loopEnum:(A=D.loopEnum)!==null&&A!==void 0?A:pS,meta:(M=D.meta)!==null&&M!==void 0?M:!0,messages:(N=D.messages)!==null&&N!==void 0?N:!0,inlineRefs:(w=D.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(P=D.schemaId)!==null&&P!==void 0?P:"$id",addUsedSchema:(C=D.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(T=D.validateSchema)!==null&&T!==void 0?T:!0,validateFormats:(y=D.validateFormats)!==null&&y!==void 0?y:!0,unicodeRegExp:(d=D.unicodeRegExp)!==null&&d!==void 0?d:!0,int32range:(W0=D.int32range)!==null&&W0!==void 0?W0:!0,uriResolver:GD}}class GJ{constructor(D={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,D=this.opts={...D,...VY0(D)};let{es5:F,lines:$}=this.opts.code;this.scope=new WY0.ValueScope({scope:{},prefixes:KY0,es5:F,lines:$}),this.logger=NY0(D.logger);let J=D.validateFormats;if(D.validateFormats=!1,this.RULES=(0,GY0.getRules)(),dS.call(this,zY0,D,"NOT SUPPORTED"),dS.call(this,EY0,D,"DEPRECATED","warn"),this._metaOpts=AY0.call(this),D.formats)UY0.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),D.keywords)LY0.call(this,D.keywords);if(typeof D.meta=="object")this.addMetaSchema(D.meta);ZY0.call(this),D.validateFormats=J}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:D,meta:F,schemaId:$}=this.opts,J=lS;if($==="id")J={...lS},J.id=J.$id,delete J.$id;if(F&&D)this.addMetaSchema(J,J[$],!1)}defaultMeta(){let{meta:D,schemaId:F}=this.opts;return this.opts.defaultMeta=typeof D=="object"?D[F]||D:void 0}validate(D,F){let $;if(typeof D=="string"){if($=this.getSchema(D),!$)throw Error(`no schema with key or ref "${D}"`)}else $=this.compile(D);let J=$(F);if(!("$async"in $))this.errors=$.errors;return J}compile(D,F){let $=this._addSchema(D,F);return $.validate||this._compileSchemaEnv($)}compileAsync(D,F){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:$}=this.opts;return J.call(this,D,F);async function J(H,q){await Q.call(this,H.$schema);let K=this._addSchema(H,q);return K.validate||Y.call(this,K)}async function Q(H){if(H&&!this.getSchema(H))await J.call(this,{$ref:H},!0)}async function Y(H){try{return this._compileSchemaEnv(H)}catch(q){if(!(q instanceof nS.default))throw q;return B.call(this,q),await X.call(this,q.missingSchema),Y.call(this,H)}}function B({missingSchema:H,missingRef:q}){if(this.refs[H])throw Error(`AnySchema ${H} is loaded but ${q} cannot be resolved`)}async function X(H){let q=await G.call(this,H);if(!this.refs[H])await Q.call(this,q.$schema);if(!this.refs[H])this.addSchema(q,H,F)}async function G(H){let q=this._loading[H];if(q)return q;try{return await(this._loading[H]=$(H))}finally{delete this._loading[H]}}}addSchema(D,F,$,J=this.opts.validateSchema){if(Array.isArray(D)){for(let Y of D)this.addSchema(Y,void 0,$,J);return this}let Q;if(typeof D==="object"){let{schemaId:Y}=this.opts;if(Q=D[Y],Q!==void 0&&typeof Q!="string")throw Error(`schema ${Y} must be string`)}return F=(0,D9.normalizeId)(F||Q),this._checkUnique(F),this.schemas[F]=this._addSchema(D,$,F,J,!0),this}addMetaSchema(D,F,$=this.opts.validateSchema){return this.addSchema(D,F,!0,$),this}validateSchema(D,F){if(typeof D=="boolean")return!0;let $;if($=D.$schema,$!==void 0&&typeof $!="string")throw Error("$schema must be a string");if($=$||this.opts.defaultMeta||this.defaultMeta(),!$)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let J=this.validate($,D);if(!J&&F){let Q="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(Q);else throw Error(Q)}return J}getSchema(D){let F;while(typeof(F=cS.call(this,D))=="string")D=F;if(F===void 0){let{schemaId:$}=this.opts,J=new e5.SchemaEnv({schema:{},schemaId:$});if(F=e5.resolveSchema.call(this,J,D),!F)return;this.refs[D]=F}return F.validate||this._compileSchemaEnv(F)}removeSchema(D){if(D instanceof RegExp)return this._removeAllSchemas(this.schemas,D),this._removeAllSchemas(this.refs,D),this;switch(typeof D){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let F=cS.call(this,D);if(typeof F=="object")this._cache.delete(F.schema);return delete this.schemas[D],delete this.refs[D],this}case"object":{let F=D;this._cache.delete(F);let $=D[this.opts.schemaId];if($)$=(0,D9.normalizeId)($),delete this.schemas[$],delete this.refs[$];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(D){for(let F of D)this.addKeyword(F);return this}addKeyword(D,F){let $;if(typeof D=="string"){if($=D,typeof F=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),F.keyword=$}else if(typeof D=="object"&&F===void 0){if(F=D,$=F.keyword,Array.isArray($)&&!$.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(CY0.call(this,$,F),!F)return(0,LG.eachItem)($,(Q)=>UG.call(this,Q)),this;wY0.call(this,F);let J={...F,type:(0,XJ.getJSONTypes)(F.type),schemaType:(0,XJ.getJSONTypes)(F.schemaType)};return(0,LG.eachItem)($,J.type.length===0?(Q)=>UG.call(this,Q,J):(Q)=>J.type.forEach((Y)=>UG.call(this,Q,J,Y))),this}getKeyword(D){let F=this.RULES.all[D];return typeof F=="object"?F.definition:!!F}removeKeyword(D){let{RULES:F}=this;delete F.keywords[D],delete F.all[D];for(let $ of F.rules){let J=$.rules.findIndex((Q)=>Q.keyword===D);if(J>=0)$.rules.splice(J,1)}return this}addFormat(D,F){if(typeof F=="string")F=new RegExp(F);return this.formats[D]=F,this}errorsText(D=this.errors,{separator:F=", ",dataVar:$="data"}={}){if(!D||D.length===0)return"No errors";return D.map((J)=>`${$}${J.instancePath} ${J.message}`).reduce((J,Q)=>J+F+Q)}$dataMetaSchema(D,F){let $=this.RULES.all;D=JSON.parse(JSON.stringify(D));for(let J of F){let Q=J.split("/").slice(1),Y=D;for(let B of Q)Y=Y[B];for(let B in $){let X=$[B];if(typeof X!="object")continue;let{$data:G}=X.definition,H=Y[B];if(G&&H)Y[B]=aS(H)}}return D}_removeAllSchemas(D,F){for(let $ in D){let J=D[$];if(!F||F.test($)){if(typeof J=="string")delete D[$];else if(J&&!J.meta)this._cache.delete(J.schema),delete D[$]}}}_addSchema(D,F,$,J=this.opts.validateSchema,Q=this.opts.addUsedSchema){let Y,{schemaId:B}=this.opts;if(typeof D=="object")Y=D[B];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof D!="boolean")throw Error("schema must be object or boolean");let X=this._cache.get(D);if(X!==void 0)return X;$=(0,D9.normalizeId)(Y||$);let G=D9.getSchemaRefs.call(this,D,$);if(X=new e5.SchemaEnv({schema:D,schemaId:B,meta:F,baseId:$,localRefs:G}),this._cache.set(X.schema,X),Q&&!$.startsWith("#")){if($)this._checkUnique($);this.refs[$]=X}if(J)this.validateSchema(D,!0);return X}_checkUnique(D){if(this.schemas[D]||this.refs[D])throw Error(`schema with key or id "${D}" already exists`)}_compileSchemaEnv(D){if(D.meta)this._compileMetaSchema(D);else e5.compileSchema.call(this,D);if(!D.validate)throw Error("ajv implementation error");return D.validate}_compileMetaSchema(D){let F=this.opts;this.opts=this._metaOpts;try{e5.compileSchema.call(this,D)}finally{this.opts=F}}}GJ.ValidationError=XY0.default;GJ.MissingRefError=nS.default;p8.default=GJ;function dS(D,F,$,J="error"){for(let Q in D){let Y=Q;if(Y in F)this.logger[J](`${$}: option ${Q}. ${D[Y]}`)}}function cS(D){return D=(0,D9.normalizeId)(D),this.schemas[D]||this.refs[D]}function ZY0(){let D=this.opts.schemas;if(!D)return;if(Array.isArray(D))this.addSchema(D);else for(let F in D)this.addSchema(D[F],F)}function UY0(){for(let D in this.opts.formats){let F=this.opts.formats[D];if(F)this.addFormat(D,F)}}function LY0(D){if(Array.isArray(D)){this.addVocabulary(D);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let F in D){let $=D[F];if(!$.keyword)$.keyword=F;this.addKeyword($)}}function AY0(){let D={...this.opts};for(let F of qY0)delete D[F];return D}var MY0={log(){},warn(){},error(){}};function NY0(D){if(D===!1)return MY0;if(D===void 0)return console;if(D.log&&D.warn&&D.error)return D;throw Error("logger must implement log, warn and error methods")}var RY0=/^[a-z_$][a-z0-9_$:-]*$/i;function CY0(D,F){let{RULES:$}=this;if((0,LG.eachItem)(D,(J)=>{if($.keywords[J])throw Error(`Keyword ${J} is already defined`);if(!RY0.test(J))throw Error(`Keyword ${J} has invalid name`)}),!F)return;if(F.$data&&!(("code"in F)||("validate"in F)))throw Error('$data keyword must have "code" or "validate" function')}function UG(D,F,$){var J;let Q=F===null||F===void 0?void 0:F.post;if($&&Q)throw Error('keyword with "post" flag cannot have "type"');let{RULES:Y}=this,B=Q?Y.post:Y.rules.find(({type:G})=>G===$);if(!B)B={type:$,rules:[]},Y.rules.push(B);if(Y.keywords[D]=!0,!F)return;let X={keyword:D,definition:{...F,type:(0,XJ.getJSONTypes)(F.type),schemaType:(0,XJ.getJSONTypes)(F.schemaType)}};if(F.before)OY0.call(this,B,X,F.before);else B.rules.push(X);Y.all[D]=X,(J=F.implements)===null||J===void 0||J.forEach((G)=>this.addKeyword(G))}function OY0(D,F,$){let J=D.rules.findIndex((Q)=>Q.keyword===$);if(J>=0)D.rules.splice(J,0,F);else D.rules.push(F),this.logger.warn(`rule ${$} is not defined`)}function wY0(D){let{metaSchema:F}=D;if(F===void 0)return;if(D.$data&&this.opts.$data)F=aS(F);D.validateSchema=this.compile(F,!0)}var jY0={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function aS(D){return{anyOf:[D,jY0]}}});var sS=z((oS)=>{Object.defineProperty(oS,"__esModule",{value:!0});var IY0={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};oS.default=IY0});var qJ=z((Dk)=>{Object.defineProperty(Dk,"__esModule",{value:!0});Dk.callRef=Dk.getValidate=void 0;var kY0=$F(),rS=N1(),sD=t(),QF=M1(),tS=r5(),WJ=z0(),vY0={keyword:"$ref",schemaType:"string",code(D){let{gen:F,schema:$,it:J}=D,{baseId:Q,schemaEnv:Y,validateName:B,opts:X,self:G}=J,{root:H}=Y;if(($==="#"||$==="#/")&&Q===H.baseId)return K();let q=tS.resolveRef.call(G,H,Q,$);if(q===void 0)throw new kY0.default(J.opts.uriResolver,Q,$);if(q instanceof tS.SchemaEnv)return V(q);return E(q);function K(){if(Y===H)return HJ(D,B,Y,Y.$async);let Z=F.scopeValue("root",{ref:H});return HJ(D,sD._`${Z}.validate`,H,H.$async)}function V(Z){let L=eS(D,Z);HJ(D,L,Z,Z.$async)}function E(Z){let L=F.scopeValue("schema",X.code.source===!0?{ref:Z,code:(0,sD.stringify)(Z)}:{ref:Z}),A=F.name("valid"),M=D.subschema({schema:Z,dataTypes:[],schemaPath:sD.nil,topSchemaRef:L,errSchemaPath:$},A);D.mergeEvaluated(M),D.ok(A)}}};function eS(D,F){let{gen:$}=D;return F.validate?$.scopeValue("validate",{ref:F.validate}):sD._`${$.scopeValue("wrapper",{ref:F})}.validate`}Dk.getValidate=eS;function HJ(D,F,$,J){let{gen:Q,it:Y}=D,{allErrors:B,schemaEnv:X,opts:G}=Y,H=G.passContext?QF.default.this:sD.nil;if(J)q();else K();function q(){if(!X.$async)throw Error("async schema referenced by sync schema");let Z=Q.let("valid");Q.try(()=>{if(Q.code(sD._`await ${(0,rS.callValidateCode)(D,F,H)}`),E(F),!B)Q.assign(Z,!0)},(L)=>{if(Q.if(sD._`!(${L} instanceof ${Y.ValidationError})`,()=>Q.throw(L)),V(L),!B)Q.assign(Z,!1)}),D.ok(Z)}function K(){D.result((0,rS.callValidateCode)(D,F,H),()=>E(F),()=>V(F))}function V(Z){let L=sD._`${Z}.errors`;Q.assign(QF.default.vErrors,sD._`${QF.default.vErrors} === null ? ${L} : ${QF.default.vErrors}.concat(${L})`),Q.assign(QF.default.errors,sD._`${QF.default.vErrors}.length`)}function E(Z){var L;if(!Y.opts.unevaluated)return;let A=(L=$===null||$===void 0?void 0:$.validate)===null||L===void 0?void 0:L.evaluated;if(Y.props!==!0)if(A&&!A.dynamicProps){if(A.props!==void 0)Y.props=WJ.mergeEvaluated.props(Q,A.props,Y.props)}else{let M=Q.var("props",sD._`${Z}.evaluated.props`);Y.props=WJ.mergeEvaluated.props(Q,M,Y.props,sD.Name)}if(Y.items!==!0)if(A&&!A.dynamicItems){if(A.items!==void 0)Y.items=WJ.mergeEvaluated.items(Q,A.items,Y.items)}else{let M=Q.var("items",sD._`${Z}.evaluated.items`);Y.items=WJ.mergeEvaluated.items(Q,M,Y.items,sD.Name)}}}Dk.callRef=HJ;Dk.default=vY0});var MG=z(($k)=>{Object.defineProperty($k,"__esModule",{value:!0});var _Y0=sS(),fY0=qJ(),gY0=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",_Y0.default,fY0.default];$k.default=gY0});var Qk=z((Jk)=>{Object.defineProperty(Jk,"__esModule",{value:!0});var KJ=t(),h6=KJ.operators,zJ={maximum:{okStr:"<=",ok:h6.LTE,fail:h6.GT},minimum:{okStr:">=",ok:h6.GTE,fail:h6.LT},exclusiveMaximum:{okStr:"<",ok:h6.LT,fail:h6.GTE},exclusiveMinimum:{okStr:">",ok:h6.GT,fail:h6.LTE}},bY0={message:({keyword:D,schemaCode:F})=>KJ.str`must be ${zJ[D].okStr} ${F}`,params:({keyword:D,schemaCode:F})=>KJ._`{comparison: ${zJ[D].okStr}, limit: ${F}}`},uY0={keyword:Object.keys(zJ),type:"number",schemaType:"number",$data:!0,error:bY0,code(D){let{keyword:F,data:$,schemaCode:J}=D;D.fail$data(KJ._`${$} ${zJ[F].fail} ${J} || isNaN(${$})`)}};Jk.default=uY0});var Bk=z((Yk)=>{Object.defineProperty(Yk,"__esModule",{value:!0});var F9=t(),lY0={message:({schemaCode:D})=>F9.str`must be multiple of ${D}`,params:({schemaCode:D})=>F9._`{multipleOf: ${D}}`},pY0={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:lY0,code(D){let{gen:F,data:$,schemaCode:J,it:Q}=D,Y=Q.opts.multipleOfPrecision,B=F.let("res"),X=Y?F9._`Math.abs(Math.round(${B}) - ${B}) > 1e-${Y}`:F9._`${B} !== parseInt(${B})`;D.fail$data(F9._`(${J} === 0 || (${B} = ${$}/${J}, ${X}))`)}};Yk.default=pY0});var Wk=z((Gk)=>{Object.defineProperty(Gk,"__esModule",{value:!0});function Xk(D){let F=D.length,$=0,J=0,Q;while(J<F)if($++,Q=D.charCodeAt(J++),Q>=55296&&Q<=56319&&J<F){if(Q=D.charCodeAt(J),(Q&64512)===56320)J++}return $}Gk.default=Xk;Xk.code='require("ajv/dist/runtime/ucs2length").default'});var qk=z((Hk)=>{Object.defineProperty(Hk,"__esModule",{value:!0});var N4=t(),nY0=z0(),iY0=Wk(),aY0={message({keyword:D,schemaCode:F}){let $=D==="maxLength"?"more":"fewer";return N4.str`must NOT have ${$} than ${F} characters`},params:({schemaCode:D})=>N4._`{limit: ${D}}`},oY0={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:aY0,code(D){let{keyword:F,data:$,schemaCode:J,it:Q}=D,Y=F==="maxLength"?N4.operators.GT:N4.operators.LT,B=Q.opts.unicode===!1?N4._`${$}.length`:N4._`${(0,nY0.useFunc)(D.gen,iY0.default)}(${$})`;D.fail$data(N4._`${B} ${Y} ${J}`)}};Hk.default=oY0});var zk=z((Kk)=>{Object.defineProperty(Kk,"__esModule",{value:!0});var rY0=N1(),EJ=t(),tY0={message:({schemaCode:D})=>EJ.str`must match pattern "${D}"`,params:({schemaCode:D})=>EJ._`{pattern: ${D}}`},eY0={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:tY0,code(D){let{data:F,$data:$,schema:J,schemaCode:Q,it:Y}=D,B=Y.opts.unicodeRegExp?"u":"",X=$?EJ._`(new RegExp(${Q}, ${B}))`:(0,rY0.usePattern)(D,J);D.fail$data(EJ._`!${X}.test(${F})`)}};Kk.default=eY0});var Vk=z((Ek)=>{Object.defineProperty(Ek,"__esModule",{value:!0});var $9=t(),FB0={message({keyword:D,schemaCode:F}){let $=D==="maxProperties"?"more":"fewer";return $9.str`must NOT have ${$} than ${F} properties`},params:({schemaCode:D})=>$9._`{limit: ${D}}`},$B0={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:FB0,code(D){let{keyword:F,data:$,schemaCode:J}=D,Q=F==="maxProperties"?$9.operators.GT:$9.operators.LT;D.fail$data($9._`Object.keys(${$}).length ${Q} ${J}`)}};Ek.default=$B0});var Uk=z((Zk)=>{Object.defineProperty(Zk,"__esModule",{value:!0});var J9=N1(),Q9=t(),QB0=z0(),YB0={message:({params:{missingProperty:D}})=>Q9.str`must have required property '${D}'`,params:({params:{missingProperty:D}})=>Q9._`{missingProperty: ${D}}`},BB0={keyword:"required",type:"object",schemaType:"array",$data:!0,error:YB0,code(D){let{gen:F,schema:$,schemaCode:J,data:Q,$data:Y,it:B}=D,{opts:X}=B;if(!Y&&$.length===0)return;let G=$.length>=X.loopRequired;if(B.allErrors)H();else q();if(X.strictRequired){let E=D.parentSchema.properties,{definedProperties:Z}=D.it;for(let L of $)if((E===null||E===void 0?void 0:E[L])===void 0&&!Z.has(L)){let A=B.schemaEnv.baseId+B.errSchemaPath,M=`required property "${L}" is not defined at "${A}" (strictRequired)`;(0,QB0.checkStrictMode)(B,M,B.opts.strictRequired)}}function H(){if(G||Y)D.block$data(Q9.nil,K);else for(let E of $)(0,J9.checkReportMissingProp)(D,E)}function q(){let E=F.let("missing");if(G||Y){let Z=F.let("valid",!0);D.block$data(Z,()=>V(E,Z)),D.ok(Z)}else F.if((0,J9.checkMissingProp)(D,$,E)),(0,J9.reportMissingProp)(D,E),F.else()}function K(){F.forOf("prop",J,(E)=>{D.setParams({missingProperty:E}),F.if((0,J9.noPropertyInData)(F,Q,E,X.ownProperties),()=>D.error())})}function V(E,Z){D.setParams({missingProperty:E}),F.forOf(E,J,()=>{F.assign(Z,(0,J9.propertyInData)(F,Q,E,X.ownProperties)),F.if((0,Q9.not)(Z),()=>{D.error(),F.break()})},Q9.nil)}}};Zk.default=BB0});var Ak=z((Lk)=>{Object.defineProperty(Lk,"__esModule",{value:!0});var Y9=t(),GB0={message({keyword:D,schemaCode:F}){let $=D==="maxItems"?"more":"fewer";return Y9.str`must NOT have ${$} than ${F} items`},params:({schemaCode:D})=>Y9._`{limit: ${D}}`},WB0={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:GB0,code(D){let{keyword:F,data:$,schemaCode:J}=D,Q=F==="maxItems"?Y9.operators.GT:Y9.operators.LT;D.fail$data(Y9._`${$}.length ${Q} ${J}`)}};Lk.default=WB0});var VJ=z((Nk)=>{Object.defineProperty(Nk,"__esModule",{value:!0});var Mk=JG();Mk.code='require("ajv/dist/runtime/equal").default';Nk.default=Mk});var Ck=z((Rk)=>{Object.defineProperty(Rk,"__esModule",{value:!0});var NG=c5(),MD=t(),KB0=z0(),zB0=VJ(),EB0={message:({params:{i:D,j:F}})=>MD.str`must NOT have duplicate items (items ## ${F} and ${D} are identical)`,params:({params:{i:D,j:F}})=>MD._`{i: ${D}, j: ${F}}`},VB0={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:EB0,code(D){let{gen:F,data:$,$data:J,schema:Q,parentSchema:Y,schemaCode:B,it:X}=D;if(!J&&!Q)return;let G=F.let("valid"),H=Y.items?(0,NG.getSchemaTypes)(Y.items):[];D.block$data(G,q,MD._`${B} === false`),D.ok(G);function q(){let Z=F.let("i",MD._`${$}.length`),L=F.let("j");D.setParams({i:Z,j:L}),F.assign(G,!0),F.if(MD._`${Z} > 1`,()=>(K()?V:E)(Z,L))}function K(){return H.length>0&&!H.some((Z)=>Z==="object"||Z==="array")}function V(Z,L){let A=F.name("item"),M=(0,NG.checkDataTypes)(H,A,X.opts.strictNumbers,NG.DataType.Wrong),N=F.const("indices",MD._`{}`);F.for(MD._`;${Z}--;`,()=>{if(F.let(A,MD._`${$}[${Z}]`),F.if(M,MD._`continue`),H.length>1)F.if(MD._`typeof ${A} == "string"`,MD._`${A} += "_"`);F.if(MD._`typeof ${N}[${A}] == "number"`,()=>{F.assign(L,MD._`${N}[${A}]`),D.error(),F.assign(G,!1).break()}).code(MD._`${N}[${A}] = ${Z}`)})}function E(Z,L){let A=(0,KB0.useFunc)(F,zB0.default),M=F.name("outer");F.label(M).for(MD._`;${Z}--;`,()=>F.for(MD._`${L} = ${Z}; ${L}--;`,()=>F.if(MD._`${A}(${$}[${Z}], ${$}[${L}])`,()=>{D.error(),F.assign(G,!1).break(M)})))}}};Rk.default=VB0});var wk=z((Ok)=>{Object.defineProperty(Ok,"__esModule",{value:!0});var RG=t(),UB0=z0(),LB0=VJ(),AB0={message:"must be equal to constant",params:({schemaCode:D})=>RG._`{allowedValue: ${D}}`},MB0={keyword:"const",$data:!0,error:AB0,code(D){let{gen:F,data:$,$data:J,schemaCode:Q,schema:Y}=D;if(J||Y&&typeof Y=="object")D.fail$data(RG._`!${(0,UB0.useFunc)(F,LB0.default)}(${$}, ${Q})`);else D.fail(RG._`${Y} !== ${$}`)}};Ok.default=MB0});var Tk=z((jk)=>{Object.defineProperty(jk,"__esModule",{value:!0});var B9=t(),RB0=z0(),CB0=VJ(),OB0={message:"must be equal to one of the allowed values",params:({schemaCode:D})=>B9._`{allowedValues: ${D}}`},wB0={keyword:"enum",schemaType:"array",$data:!0,error:OB0,code(D){let{gen:F,data:$,$data:J,schema:Q,schemaCode:Y,it:B}=D;if(!J&&Q.length===0)throw Error("enum must have non-empty array");let X=Q.length>=B.opts.loopEnum,G,H=()=>G!==null&&G!==void 0?G:G=(0,RB0.useFunc)(F,CB0.default),q;if(X||J)q=F.let("valid"),D.block$data(q,K);else{if(!Array.isArray(Q))throw Error("ajv implementation error");let E=F.const("vSchema",Y);q=(0,B9.or)(...Q.map((Z,L)=>V(E,L)))}D.pass(q);function K(){F.assign(q,!1),F.forOf("v",Y,(E)=>F.if(B9._`${H()}(${$}, ${E})`,()=>F.assign(q,!0).break()))}function V(E,Z){let L=Q[Z];return typeof L==="object"&&L!==null?B9._`${H()}(${$}, ${E}[${Z}])`:B9._`${$} === ${L}`}}};jk.default=wB0});var CG=z((Pk)=>{Object.defineProperty(Pk,"__esModule",{value:!0});var TB0=Qk(),PB0=Bk(),IB0=qk(),SB0=zk(),kB0=Vk(),vB0=Uk(),yB0=Ak(),xB0=Ck(),_B0=wk(),fB0=Tk(),gB0=[TB0.default,PB0.default,IB0.default,SB0.default,kB0.default,vB0.default,yB0.default,xB0.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},_B0.default,fB0.default];Pk.default=gB0});var wG=z((Sk)=>{Object.defineProperty(Sk,"__esModule",{value:!0});Sk.validateAdditionalItems=void 0;var R4=t(),OG=z0(),bB0={message:({params:{len:D}})=>R4.str`must NOT have more than ${D} items`,params:({params:{len:D}})=>R4._`{limit: ${D}}`},uB0={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:bB0,code(D){let{parentSchema:F,it:$}=D,{items:J}=F;if(!Array.isArray(J)){(0,OG.checkStrictMode)($,'"additionalItems" is ignored when "items" is not an array of schemas');return}Ik(D,J)}};function Ik(D,F){let{gen:$,schema:J,data:Q,keyword:Y,it:B}=D;B.items=!0;let X=$.const("len",R4._`${Q}.length`);if(J===!1)D.setParams({len:F.length}),D.pass(R4._`${X} <= ${F.length}`);else if(typeof J=="object"&&!(0,OG.alwaysValidSchema)(B,J)){let H=$.var("valid",R4._`${X} <= ${F.length}`);$.if((0,R4.not)(H),()=>G(H)),D.ok(H)}function G(H){$.forRange("i",F.length,X,(q)=>{if(D.subschema({keyword:Y,dataProp:q,dataPropType:OG.Type.Num},H),!B.allErrors)$.if((0,R4.not)(H),()=>$.break())})}}Sk.validateAdditionalItems=Ik;Sk.default=uB0});var jG=z((xk)=>{Object.defineProperty(xk,"__esModule",{value:!0});xk.validateTuple=void 0;var vk=t(),ZJ=z0(),lB0=N1(),pB0={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(D){let{schema:F,it:$}=D;if(Array.isArray(F))return yk(D,"additionalItems",F);if($.items=!0,(0,ZJ.alwaysValidSchema)($,F))return;D.ok((0,lB0.validateArray)(D))}};function yk(D,F,$=D.schema){let{gen:J,parentSchema:Q,data:Y,keyword:B,it:X}=D;if(q(Q),X.opts.unevaluated&&$.length&&X.items!==!0)X.items=ZJ.mergeEvaluated.items(J,$.length,X.items);let G=J.name("valid"),H=J.const("len",vk._`${Y}.length`);$.forEach((K,V)=>{if((0,ZJ.alwaysValidSchema)(X,K))return;J.if(vk._`${H} > ${V}`,()=>D.subschema({keyword:B,schemaProp:V,dataProp:V},G)),D.ok(G)});function q(K){let{opts:V,errSchemaPath:E}=X,Z=$.length,L=Z===K.minItems&&(Z===K.maxItems||K[F]===!1);if(V.strictTuples&&!L){let A=`"${B}" is ${Z}-tuple, but minItems or maxItems/${F} are not specified or different at path "${E}"`;(0,ZJ.checkStrictMode)(X,A,V.strictTuples)}}}xk.validateTuple=yk;xk.default=pB0});var gk=z((fk)=>{Object.defineProperty(fk,"__esModule",{value:!0});var cB0=jG(),nB0={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(D)=>(0,cB0.validateTuple)(D,"items")};fk.default=nB0});var uk=z((bk)=>{Object.defineProperty(bk,"__esModule",{value:!0});var hk=t(),aB0=z0(),oB0=N1(),sB0=wG(),rB0={message:({params:{len:D}})=>hk.str`must NOT have more than ${D} items`,params:({params:{len:D}})=>hk._`{limit: ${D}}`},tB0={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:rB0,code(D){let{schema:F,parentSchema:$,it:J}=D,{prefixItems:Q}=$;if(J.items=!0,(0,aB0.alwaysValidSchema)(J,F))return;if(Q)(0,sB0.validateAdditionalItems)(D,Q);else D.ok((0,oB0.validateArray)(D))}};bk.default=tB0});var lk=z((mk)=>{Object.defineProperty(mk,"__esModule",{value:!0});var R1=t(),UJ=z0(),D20={message:({params:{min:D,max:F}})=>F===void 0?R1.str`must contain at least ${D} valid item(s)`:R1.str`must contain at least ${D} and no more than ${F} valid item(s)`,params:({params:{min:D,max:F}})=>F===void 0?R1._`{minContains: ${D}}`:R1._`{minContains: ${D}, maxContains: ${F}}`},F20={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:D20,code(D){let{gen:F,schema:$,parentSchema:J,data:Q,it:Y}=D,B,X,{minContains:G,maxContains:H}=J;if(Y.opts.next)B=G===void 0?1:G,X=H;else B=1;let q=F.const("len",R1._`${Q}.length`);if(D.setParams({min:B,max:X}),X===void 0&&B===0){(0,UJ.checkStrictMode)(Y,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(X!==void 0&&B>X){(0,UJ.checkStrictMode)(Y,'"minContains" > "maxContains" is always invalid'),D.fail();return}if((0,UJ.alwaysValidSchema)(Y,$)){let L=R1._`${q} >= ${B}`;if(X!==void 0)L=R1._`${L} && ${q} <= ${X}`;D.pass(L);return}Y.items=!0;let K=F.name("valid");if(X===void 0&&B===1)E(K,()=>F.if(K,()=>F.break()));else if(B===0){if(F.let(K,!0),X!==void 0)F.if(R1._`${Q}.length > 0`,V)}else F.let(K,!1),V();D.result(K,()=>D.reset());function V(){let L=F.name("_valid"),A=F.let("count",0);E(L,()=>F.if(L,()=>Z(A)))}function E(L,A){F.forRange("i",0,q,(M)=>{D.subschema({keyword:"contains",dataProp:M,dataPropType:UJ.Type.Num,compositeRule:!0},L),A()})}function Z(L){if(F.code(R1._`${L}++`),X===void 0)F.if(R1._`${L} >= ${B}`,()=>F.assign(K,!0).break());else if(F.if(R1._`${L} > ${X}`,()=>F.assign(K,!1).break()),B===1)F.assign(K,!0);else F.if(R1._`${L} >= ${B}`,()=>F.assign(K,!0))}}};mk.default=F20});var LJ=z((ck)=>{Object.defineProperty(ck,"__esModule",{value:!0});ck.validateSchemaDeps=ck.validatePropertyDeps=ck.error=void 0;var TG=t(),J20=z0(),X9=N1();ck.error={message:({params:{property:D,depsCount:F,deps:$}})=>{let J=F===1?"property":"properties";return TG.str`must have ${J} ${$} when property ${D} is present`},params:({params:{property:D,depsCount:F,deps:$,missingProperty:J}})=>TG._`{property: ${D},
88
+ || ${B} === "boolean" || ${Q} === null`).assign(X,G0._`[${Q}]`)}}}function k$0({gen:D,parentData:F,parentDataProperty:$},J){D.if(G0._`${F} !== undefined`,()=>D.assign(G0._`${F}[${$}]`,J))}function rX(D,F,$,J=t3.Correct){let Q=J===t3.Correct?G0.operators.EQ:G0.operators.NEQ,Y;switch(D){case"null":return G0._`${F} ${Q} null`;case"array":Y=G0._`Array.isArray(${F})`;break;case"object":Y=G0._`${F} && typeof ${F} == "object" && !Array.isArray(${F})`;break;case"integer":Y=B(G0._`!(${F} % 1) && !isNaN(${F})`);break;case"number":Y=B();break;default:return G0._`typeof ${F} ${Q} ${D}`}return J===t3.Correct?Y:(0,G0.not)(Y);function B(X=G0.nil){return(0,G0.and)(G0._`typeof ${F} == "number"`,X,$?G0._`isFinite(${F})`:G0.nil)}}II.checkDataType=rX;function tX(D,F,$,J){if(D.length===1)return rX(D[0],F,$,J);let Q,Y=(0,jI.toHash)(D);if(Y.array&&Y.object){let B=G0._`typeof ${F} != "object"`;Q=Y.null?B:G0._`!${F} || ${B}`,delete Y.null,delete Y.array,delete Y.object}else Q=G0.nil;if(Y.number)delete Y.integer;for(let B in Y)Q=(0,G0.and)(Q,rX(B,F,$,J));return Q}II.checkDataTypes=tX;var v$0={message:({schema:D})=>`must be ${D}`,params:({schema:D,schemaValue:F})=>typeof D=="string"?G0._`{type: ${D}}`:G0._`{type: ${F}}`};function eX(D){let F=y$0(D);(0,j$0.reportError)(F,v$0)}II.reportTypeError=eX;function y$0(D){let{gen:F,data:$,schema:J}=D,Q=(0,jI.schemaRefOrVal)(D,J,"type");return{gen:F,keyword:"type",data:$,schema:J.type,schemaCode:Q,schemaValue:Q,parentSchema:J,params:{},it:D}}});var xI=z((vI)=>{Object.defineProperty(vI,"__esModule",{value:!0});vI.assignDefaults=void 0;var e3=t(),u$0=z0();function m$0(D,F){let{properties:$,items:J}=D.schema;if(F==="object"&&$)for(let Q in $)kI(D,Q,$[Q].default);else if(F==="array"&&Array.isArray(J))J.forEach((Q,Y)=>kI(D,Y,Q.default))}vI.assignDefaults=m$0;function kI(D,F,$){let{gen:J,compositeRule:Q,data:Y,opts:B}=D;if($===void 0)return;let X=e3._`${Y}${(0,e3.getProperty)(F)}`;if(Q){(0,u$0.checkStrictMode)(D,`default is ignored for: ${X}`);return}let G=e3._`${X} === undefined`;if(B.useDefaults==="empty")G=e3._`${G} || ${X} === null || ${X} === ""`;J.if(G,e3._`${X} = ${(0,e3.stringify)($)}`)}});var N1=z((gI)=>{Object.defineProperty(gI,"__esModule",{value:!0});gI.validateUnion=gI.validateArray=gI.usePattern=gI.callValidateCode=gI.schemaProperties=gI.allSchemaProperties=gI.noPropertyInData=gI.propertyInData=gI.isOwnProperty=gI.hasPropFunc=gI.reportMissingProp=gI.checkMissingProp=gI.checkReportMissingProp=void 0;var u0=t(),DG=z0(),f6=M1(),l$0=z0();function p$0(D,F){let{gen:$,data:J,it:Q}=D;$.if($G($,J,F,Q.opts.ownProperties),()=>{D.setParams({missingProperty:u0._`${F}`},!0),D.error()})}gI.checkReportMissingProp=p$0;function d$0({gen:D,data:F,it:{opts:$}},J,Q){return(0,u0.or)(...J.map((Y)=>(0,u0.and)($G(D,F,Y,$.ownProperties),u0._`${Q} = ${Y}`)))}gI.checkMissingProp=d$0;function c$0(D,F){D.setParams({missingProperty:F},!0),D.error()}gI.reportMissingProp=c$0;function _I(D){return D.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:u0._`Object.prototype.hasOwnProperty`})}gI.hasPropFunc=_I;function FG(D,F,$){return u0._`${_I(D)}.call(${F}, ${$})`}gI.isOwnProperty=FG;function n$0(D,F,$,J){let Q=u0._`${F}${(0,u0.getProperty)($)} !== undefined`;return J?u0._`${Q} && ${FG(D,F,$)}`:Q}gI.propertyInData=n$0;function $G(D,F,$,J){let Q=u0._`${F}${(0,u0.getProperty)($)} === undefined`;return J?(0,u0.or)(Q,(0,u0.not)(FG(D,F,$))):Q}gI.noPropertyInData=$G;function fI(D){return D?Object.keys(D).filter((F)=>F!=="__proto__"):[]}gI.allSchemaProperties=fI;function i$0(D,F){return fI(F).filter(($)=>!(0,DG.alwaysValidSchema)(D,F[$]))}gI.schemaProperties=i$0;function a$0({schemaCode:D,data:F,it:{gen:$,topSchemaRef:J,schemaPath:Q,errorPath:Y},it:B},X,G,H){let q=H?u0._`${D}, ${F}, ${J}${Q}`:F,K=[[f6.default.instancePath,(0,u0.strConcat)(f6.default.instancePath,Y)],[f6.default.parentData,B.parentData],[f6.default.parentDataProperty,B.parentDataProperty],[f6.default.rootData,f6.default.rootData]];if(B.opts.dynamicRef)K.push([f6.default.dynamicAnchors,f6.default.dynamicAnchors]);let V=u0._`${q}, ${$.object(...K)}`;return G!==u0.nil?u0._`${X}.call(${G}, ${V})`:u0._`${X}(${V})`}gI.callValidateCode=a$0;var o$0=u0._`new RegExp`;function s$0({gen:D,it:{opts:F}},$){let J=F.unicodeRegExp?"u":"",{regExp:Q}=F.code,Y=Q($,J);return D.scopeValue("pattern",{key:Y.toString(),ref:Y,code:u0._`${Q.code==="new RegExp"?o$0:(0,l$0.useFunc)(D,Q)}(${$}, ${J})`})}gI.usePattern=s$0;function r$0(D){let{gen:F,data:$,keyword:J,it:Q}=D,Y=F.name("valid");if(Q.allErrors){let X=F.let("valid",!0);return B(()=>F.assign(X,!1)),X}return F.var(Y,!0),B(()=>F.break()),Y;function B(X){let G=F.const("len",u0._`${$}.length`);F.forRange("i",0,G,(H)=>{D.subschema({keyword:J,dataProp:H,dataPropType:DG.Type.Num},Y),F.if((0,u0.not)(Y),X)})}}gI.validateArray=r$0;function t$0(D){let{gen:F,schema:$,keyword:J,it:Q}=D;if(!Array.isArray($))throw Error("ajv implementation error");if($.some((G)=>(0,DG.alwaysValidSchema)(Q,G))&&!Q.opts.unevaluated)return;let B=F.let("valid",!1),X=F.name("_valid");F.block(()=>$.forEach((G,H)=>{let q=D.subschema({keyword:J,schemaProp:H,compositeRule:!0},X);if(F.assign(B,u0._`${B} || ${X}`),!D.mergeValidEvaluated(q,X))F.if((0,u0.not)(B))})),D.result(B,()=>D.reset(),()=>D.error(!0))}gI.validateUnion=t$0});var pI=z((mI)=>{Object.defineProperty(mI,"__esModule",{value:!0});mI.validateKeywordUsage=mI.validSchemaType=mI.funcKeywordCode=mI.macroKeywordCode=void 0;var gD=t(),A4=M1(),qJ0=N1(),KJ0=d5();function zJ0(D,F){let{gen:$,keyword:J,schema:Q,parentSchema:Y,it:B}=D,X=F.macro.call(B.self,Q,Y,B),G=uI($,J,X);if(B.opts.validateSchema!==!1)B.self.validateSchema(X,!0);let H=$.name("valid");D.subschema({schema:X,schemaPath:gD.nil,errSchemaPath:`${B.errSchemaPath}/${J}`,topSchemaRef:G,compositeRule:!0},H),D.pass(H,()=>D.error(!0))}mI.macroKeywordCode=zJ0;function EJ0(D,F){var $;let{gen:J,keyword:Q,schema:Y,parentSchema:B,$data:X,it:G}=D;ZJ0(G,F);let H=!X&&F.compile?F.compile.call(G.self,Y,B,G):F.validate,q=uI(J,Q,H),K=J.let("valid");D.block$data(K,V),D.ok(($=F.valid)!==null&&$!==void 0?$:K);function V(){if(F.errors===!1){if(L(),F.modifying)bI(D);M(()=>D.error())}else{let A=F.async?E():Z();if(F.modifying)bI(D);M(()=>VJ0(D,A))}}function E(){let A=J.let("ruleErrs",null);return J.try(()=>L(gD._`await `),(N)=>J.assign(K,!1).if(gD._`${N} instanceof ${G.ValidationError}`,()=>J.assign(A,gD._`${N}.errors`),()=>J.throw(N))),A}function Z(){let A=gD._`${q}.errors`;return J.assign(A,null),L(gD.nil),A}function L(A=F.async?gD._`await `:gD.nil){let N=G.opts.passContext?A4.default.this:A4.default.self,w=!(("compile"in F)&&!X||F.schema===!1);J.assign(K,gD._`${A}${(0,qJ0.callValidateCode)(D,q,N,w)}`,F.modifying)}function M(A){var N;J.if((0,gD.not)((N=F.valid)!==null&&N!==void 0?N:K),A)}}mI.funcKeywordCode=EJ0;function bI(D){let{gen:F,data:$,it:J}=D;F.if(J.parentData,()=>F.assign($,gD._`${J.parentData}[${J.parentDataProperty}]`))}function VJ0(D,F){let{gen:$}=D;$.if(gD._`Array.isArray(${F})`,()=>{$.assign(A4.default.vErrors,gD._`${A4.default.vErrors} === null ? ${F} : ${A4.default.vErrors}.concat(${F})`).assign(A4.default.errors,gD._`${A4.default.vErrors}.length`),(0,KJ0.extendErrors)(D)},()=>D.error())}function ZJ0({schemaEnv:D},F){if(F.async&&!D.$async)throw Error("async keyword in sync schema")}function uI(D,F,$){if($===void 0)throw Error(`keyword "${F}" failed to compile`);return D.scopeValue("keyword",typeof $=="function"?{ref:$}:{ref:$,code:(0,gD.stringify)($)})}function UJ0(D,F,$=!1){return!F.length||F.some((J)=>J==="array"?Array.isArray(D):J==="object"?D&&typeof D=="object"&&!Array.isArray(D):typeof D==J||$&&typeof D>"u")}mI.validSchemaType=UJ0;function LJ0({schema:D,opts:F,self:$,errSchemaPath:J},Q,Y){if(Array.isArray(Q.keyword)?!Q.keyword.includes(Y):Q.keyword!==Y)throw Error("ajv implementation error");let B=Q.dependencies;if(B===null||B===void 0?void 0:B.some((X)=>!Object.prototype.hasOwnProperty.call(D,X)))throw Error(`parent schema must have dependencies of ${Y}: ${B.join(",")}`);if(Q.validateSchema){if(!Q.validateSchema(D[Y])){let G=`keyword "${Y}" value is invalid at path "${J}": `+$.errorsText(Q.validateSchema.errors);if(F.validateSchema==="log")$.logger.error(G);else throw Error(G)}}}mI.validateKeywordUsage=LJ0});var iI=z((cI)=>{Object.defineProperty(cI,"__esModule",{value:!0});cI.extendSubschemaMode=cI.extendSubschemaData=cI.getSubschema=void 0;var U8=t(),dI=z0();function RJ0(D,{keyword:F,schemaProp:$,schema:J,schemaPath:Q,errSchemaPath:Y,topSchemaRef:B}){if(F!==void 0&&J!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(F!==void 0){let X=D.schema[F];return $===void 0?{schema:X,schemaPath:U8._`${D.schemaPath}${(0,U8.getProperty)(F)}`,errSchemaPath:`${D.errSchemaPath}/${F}`}:{schema:X[$],schemaPath:U8._`${D.schemaPath}${(0,U8.getProperty)(F)}${(0,U8.getProperty)($)}`,errSchemaPath:`${D.errSchemaPath}/${F}/${(0,dI.escapeFragment)($)}`}}if(J!==void 0){if(Q===void 0||Y===void 0||B===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:J,schemaPath:Q,topSchemaRef:B,errSchemaPath:Y}}throw Error('either "keyword" or "schema" must be passed')}cI.getSubschema=RJ0;function CJ0(D,F,{dataProp:$,dataPropType:J,data:Q,dataTypes:Y,propertyName:B}){if(Q!==void 0&&$!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:X}=F;if($!==void 0){let{errorPath:H,dataPathArr:q,opts:K}=F,V=X.let("data",U8._`${F.data}${(0,U8.getProperty)($)}`,!0);G(V),D.errorPath=U8.str`${H}${(0,dI.getErrorPath)($,J,K.jsPropertySyntax)}`,D.parentDataProperty=U8._`${$}`,D.dataPathArr=[...q,D.parentDataProperty]}if(Q!==void 0){let H=Q instanceof U8.Name?Q:X.let("data",Q,!0);if(G(H),B!==void 0)D.propertyName=B}if(Y)D.dataTypes=Y;function G(H){D.data=H,D.dataLevel=F.dataLevel+1,D.dataTypes=[],F.definedProperties=new Set,D.parentData=F.data,D.dataNames=[...F.dataNames,H]}}cI.extendSubschemaData=CJ0;function OJ0(D,{jtdDiscriminator:F,jtdMetadata:$,compositeRule:J,createErrors:Q,allErrors:Y}){if(J!==void 0)D.compositeRule=J;if(Q!==void 0)D.createErrors=Q;if(Y!==void 0)D.allErrors=Y;D.jtdDiscriminator=F,D.jtdMetadata=$}cI.extendSubschemaMode=OJ0});var JG=z((hj0,aI)=>{aI.exports=function D(F,$){if(F===$)return!0;if(F&&$&&typeof F=="object"&&typeof $=="object"){if(F.constructor!==$.constructor)return!1;var J,Q,Y;if(Array.isArray(F)){if(J=F.length,J!=$.length)return!1;for(Q=J;Q--!==0;)if(!D(F[Q],$[Q]))return!1;return!0}if(F.constructor===RegExp)return F.source===$.source&&F.flags===$.flags;if(F.valueOf!==Object.prototype.valueOf)return F.valueOf()===$.valueOf();if(F.toString!==Object.prototype.toString)return F.toString()===$.toString();if(Y=Object.keys(F),J=Y.length,J!==Object.keys($).length)return!1;for(Q=J;Q--!==0;)if(!Object.prototype.hasOwnProperty.call($,Y[Q]))return!1;for(Q=J;Q--!==0;){var B=Y[Q];if(!D(F[B],$[B]))return!1}return!0}return F!==F&&$!==$}});var sI=z((bj0,oI)=>{var g6=oI.exports=function(D,F,$){if(typeof F=="function")$=F,F={};$=F.cb||$;var J=typeof $=="function"?$:$.pre||function(){},Q=$.post||function(){};DJ(F,J,Q,D,"",D)};g6.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};g6.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};g6.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};g6.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 DJ(D,F,$,J,Q,Y,B,X,G,H){if(J&&typeof J=="object"&&!Array.isArray(J)){F(J,Q,Y,B,X,G,H);for(var q in J){var K=J[q];if(Array.isArray(K)){if(q in g6.arrayKeywords)for(var V=0;V<K.length;V++)DJ(D,F,$,K[V],Q+"/"+q+"/"+V,Y,Q,q,J,V)}else if(q in g6.propsKeywords){if(K&&typeof K=="object")for(var E in K)DJ(D,F,$,K[E],Q+"/"+q+"/"+TJ0(E),Y,Q,q,J,E)}else if(q in g6.keywords||D.allKeys&&!(q in g6.skipKeywords))DJ(D,F,$,K,Q+"/"+q,Y,Q,q,J)}$(J,Q,Y,B,X,G,H)}}function TJ0(D){return D.replace(/~/g,"~0").replace(/\//g,"~1")}});var n5=z((DS)=>{Object.defineProperty(DS,"__esModule",{value:!0});DS.getSchemaRefs=DS.resolveUrl=DS.normalizeId=DS._getFullPath=DS.getFullPath=DS.inlineRef=void 0;var PJ0=z0(),IJ0=JG(),SJ0=sI(),kJ0=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function vJ0(D,F=!0){if(typeof D=="boolean")return!0;if(F===!0)return!QG(D);if(!F)return!1;return rI(D)<=F}DS.inlineRef=vJ0;var yJ0=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function QG(D){for(let F in D){if(yJ0.has(F))return!0;let $=D[F];if(Array.isArray($)&&$.some(QG))return!0;if(typeof $=="object"&&QG($))return!0}return!1}function rI(D){let F=0;for(let $ in D){if($==="$ref")return 1/0;if(F++,kJ0.has($))continue;if(typeof D[$]=="object")(0,PJ0.eachItem)(D[$],(J)=>F+=rI(J));if(F===1/0)return 1/0}return F}function tI(D,F="",$){if($!==!1)F=DF(F);let J=D.parse(F);return eI(D,J)}DS.getFullPath=tI;function eI(D,F){return D.serialize(F).split("#")[0]+"#"}DS._getFullPath=eI;var xJ0=/#\/?$/;function DF(D){return D?D.replace(xJ0,""):""}DS.normalizeId=DF;function _J0(D,F,$){return $=DF($),D.resolve(F,$)}DS.resolveUrl=_J0;var fJ0=/^[a-z_][-a-z0-9._]*$/i;function gJ0(D,F){if(typeof D=="boolean")return{};let{schemaId:$,uriResolver:J}=this.opts,Q=DF(D[$]||F),Y={"":Q},B=tI(J,Q,!1),X={},G=new Set;return SJ0(D,{allKeys:!0},(K,V,E,Z)=>{if(Z===void 0)return;let L=B+V,M=Y[Z];if(typeof K[$]=="string")M=A.call(this,K[$]);N.call(this,K.$anchor),N.call(this,K.$dynamicAnchor),Y[V]=M;function A(w){let P=this.opts.uriResolver.resolve;if(w=DF(M?P(M,w):w),G.has(w))throw q(w);G.add(w);let C=this.refs[w];if(typeof C=="string")C=this.refs[C];if(typeof C=="object")H(K,C.schema,w);else if(w!==DF(L))if(w[0]==="#")H(K,X[w],w),X[w]=K;else this.refs[w]=L;return w}function N(w){if(typeof w=="string"){if(!fJ0.test(w))throw Error(`invalid anchor "${w}"`);A.call(this,`#${w}`)}}}),X;function H(K,V,E){if(V!==void 0&&!IJ0(K,V))throw q(E)}function q(K){return Error(`reference "${K}" resolves to more than one schema`)}}DS.getSchemaRefs=gJ0});var FF=z((ZS)=>{Object.defineProperty(ZS,"__esModule",{value:!0});ZS.getData=ZS.KeywordCxt=ZS.validateFunctionCode=void 0;var BS=AI(),$S=c5(),BG=sX(),FJ=c5(),pJ0=xI(),a5=pI(),YG=iI(),c=t(),o=M1(),dJ0=n5(),m8=z0(),i5=d5();function cJ0(D){if(WS(D)){if(HS(D),GS(D)){aJ0(D);return}}XS(D,()=>(0,BS.topBoolOrEmptySchema)(D))}ZS.validateFunctionCode=cJ0;function XS({gen:D,validateName:F,schema:$,schemaEnv:J,opts:Q},Y){if(Q.code.es5)D.func(F,c._`${o.default.data}, ${o.default.valCxt}`,J.$async,()=>{D.code(c._`"use strict"; ${JS($,Q)}`),iJ0(D,Q),D.code(Y)});else D.func(F,c._`${o.default.data}, ${nJ0(Q)}`,J.$async,()=>D.code(JS($,Q)).code(Y))}function nJ0(D){return c._`{${o.default.instancePath}="", ${o.default.parentData}, ${o.default.parentDataProperty}, ${o.default.rootData}=${o.default.data}${D.dynamicRef?c._`, ${o.default.dynamicAnchors}={}`:c.nil}}={}`}function iJ0(D,F){D.if(o.default.valCxt,()=>{if(D.var(o.default.instancePath,c._`${o.default.valCxt}.${o.default.instancePath}`),D.var(o.default.parentData,c._`${o.default.valCxt}.${o.default.parentData}`),D.var(o.default.parentDataProperty,c._`${o.default.valCxt}.${o.default.parentDataProperty}`),D.var(o.default.rootData,c._`${o.default.valCxt}.${o.default.rootData}`),F.dynamicRef)D.var(o.default.dynamicAnchors,c._`${o.default.valCxt}.${o.default.dynamicAnchors}`)},()=>{if(D.var(o.default.instancePath,c._`""`),D.var(o.default.parentData,c._`undefined`),D.var(o.default.parentDataProperty,c._`undefined`),D.var(o.default.rootData,o.default.data),F.dynamicRef)D.var(o.default.dynamicAnchors,c._`{}`)})}function aJ0(D){let{schema:F,opts:$,gen:J}=D;XS(D,()=>{if($.$comment&&F.$comment)KS(D);if(eJ0(D),J.let(o.default.vErrors,null),J.let(o.default.errors,0),$.unevaluated)oJ0(D);qS(D),$Q0(D)});return}function oJ0(D){let{gen:F,validateName:$}=D;D.evaluated=F.const("evaluated",c._`${$}.evaluated`),F.if(c._`${D.evaluated}.dynamicProps`,()=>F.assign(c._`${D.evaluated}.props`,c._`undefined`)),F.if(c._`${D.evaluated}.dynamicItems`,()=>F.assign(c._`${D.evaluated}.items`,c._`undefined`))}function JS(D,F){let $=typeof D=="object"&&D[F.schemaId];return $&&(F.code.source||F.code.process)?c._`/*# sourceURL=${$} */`:c.nil}function sJ0(D,F){if(WS(D)){if(HS(D),GS(D)){rJ0(D,F);return}}(0,BS.boolOrEmptySchema)(D,F)}function GS({schema:D,self:F}){if(typeof D=="boolean")return!D;for(let $ in D)if(F.RULES.all[$])return!0;return!1}function WS(D){return typeof D.schema!="boolean"}function rJ0(D,F){let{schema:$,gen:J,opts:Q}=D;if(Q.$comment&&$.$comment)KS(D);DQ0(D),FQ0(D);let Y=J.const("_errs",o.default.errors);qS(D,Y),J.var(F,c._`${Y} === ${o.default.errors}`)}function HS(D){(0,m8.checkUnknownRules)(D),tJ0(D)}function qS(D,F){if(D.opts.jtd)return QS(D,[],!1,F);let $=(0,$S.getSchemaTypes)(D.schema),J=(0,$S.coerceAndCheckDataType)(D,$);QS(D,$,!J,F)}function tJ0(D){let{schema:F,errSchemaPath:$,opts:J,self:Q}=D;if(F.$ref&&J.ignoreKeywordsWithRef&&(0,m8.schemaHasRulesButRef)(F,Q.RULES))Q.logger.warn(`$ref: keywords ignored in schema at path "${$}"`)}function eJ0(D){let{schema:F,opts:$}=D;if(F.default!==void 0&&$.useDefaults&&$.strictSchema)(0,m8.checkStrictMode)(D,"default is ignored in the schema root")}function DQ0(D){let F=D.schema[D.opts.schemaId];if(F)D.baseId=(0,dJ0.resolveUrl)(D.opts.uriResolver,D.baseId,F)}function FQ0(D){if(D.schema.$async&&!D.schemaEnv.$async)throw Error("async schema in sync schema")}function KS({gen:D,schemaEnv:F,schema:$,errSchemaPath:J,opts:Q}){let Y=$.$comment;if(Q.$comment===!0)D.code(c._`${o.default.self}.logger.log(${Y})`);else if(typeof Q.$comment=="function"){let B=c.str`${J}/$comment`,X=D.scopeValue("root",{ref:F.root});D.code(c._`${o.default.self}.opts.$comment(${Y}, ${B}, ${X}.schema)`)}}function $Q0(D){let{gen:F,schemaEnv:$,validateName:J,ValidationError:Q,opts:Y}=D;if($.$async)F.if(c._`${o.default.errors} === 0`,()=>F.return(o.default.data),()=>F.throw(c._`new ${Q}(${o.default.vErrors})`));else{if(F.assign(c._`${J}.errors`,o.default.vErrors),Y.unevaluated)JQ0(D);F.return(c._`${o.default.errors} === 0`)}}function JQ0({gen:D,evaluated:F,props:$,items:J}){if($ instanceof c.Name)D.assign(c._`${F}.props`,$);if(J instanceof c.Name)D.assign(c._`${F}.items`,J)}function QS(D,F,$,J){let{gen:Q,schema:Y,data:B,allErrors:X,opts:G,self:H}=D,{RULES:q}=H;if(Y.$ref&&(G.ignoreKeywordsWithRef||!(0,m8.schemaHasRulesButRef)(Y,q))){Q.block(()=>ES(D,"$ref",q.all.$ref.definition));return}if(!G.jtd)QQ0(D,F);Q.block(()=>{for(let V of q.rules)K(V);K(q.post)});function K(V){if(!(0,BG.shouldUseGroup)(Y,V))return;if(V.type){if(Q.if((0,FJ.checkDataType)(V.type,B,G.strictNumbers)),YS(D,V),F.length===1&&F[0]===V.type&&$)Q.else(),(0,FJ.reportTypeError)(D);Q.endIf()}else YS(D,V);if(!X)Q.if(c._`${o.default.errors} === ${J||0}`)}}function YS(D,F){let{gen:$,schema:J,opts:{useDefaults:Q}}=D;if(Q)(0,pJ0.assignDefaults)(D,F.type);$.block(()=>{for(let Y of F.rules)if((0,BG.shouldUseRule)(J,Y))ES(D,Y.keyword,Y.definition,F.type)})}function QQ0(D,F){if(D.schemaEnv.meta||!D.opts.strictTypes)return;if(YQ0(D,F),!D.opts.allowUnionTypes)BQ0(D,F);XQ0(D,D.dataTypes)}function YQ0(D,F){if(!F.length)return;if(!D.dataTypes.length){D.dataTypes=F;return}F.forEach(($)=>{if(!zS(D.dataTypes,$))XG(D,`type "${$}" not allowed by context "${D.dataTypes.join(",")}"`)}),WQ0(D,F)}function BQ0(D,F){if(F.length>1&&!(F.length===2&&F.includes("null")))XG(D,"use allowUnionTypes to allow union type keyword")}function XQ0(D,F){let $=D.self.RULES.all;for(let J in $){let Q=$[J];if(typeof Q=="object"&&(0,BG.shouldUseRule)(D.schema,Q)){let{type:Y}=Q.definition;if(Y.length&&!Y.some((B)=>GQ0(F,B)))XG(D,`missing type "${Y.join(",")}" for keyword "${J}"`)}}}function GQ0(D,F){return D.includes(F)||F==="number"&&D.includes("integer")}function zS(D,F){return D.includes(F)||F==="integer"&&D.includes("number")}function WQ0(D,F){let $=[];for(let J of D.dataTypes)if(zS(F,J))$.push(J);else if(F.includes("integer")&&J==="number")$.push("integer");D.dataTypes=$}function XG(D,F){let $=D.schemaEnv.baseId+D.errSchemaPath;F+=` at "${$}" (strictTypes)`,(0,m8.checkStrictMode)(D,F,D.opts.strictTypes)}class GG{constructor(D,F,$){if((0,a5.validateKeywordUsage)(D,F,$),this.gen=D.gen,this.allErrors=D.allErrors,this.keyword=$,this.data=D.data,this.schema=D.schema[$],this.$data=F.$data&&D.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m8.schemaRefOrVal)(D,this.schema,$,this.$data),this.schemaType=F.schemaType,this.parentSchema=D.schema,this.params={},this.it=D,this.def=F,this.$data)this.schemaCode=D.gen.const("vSchema",VS(this.$data,D));else if(this.schemaCode=this.schemaValue,!(0,a5.validSchemaType)(this.schema,F.schemaType,F.allowUndefined))throw Error(`${$} value must be ${JSON.stringify(F.schemaType)}`);if("code"in F?F.trackErrors:F.errors!==!1)this.errsCount=D.gen.const("_errs",o.default.errors)}result(D,F,$){this.failResult((0,c.not)(D),F,$)}failResult(D,F,$){if(this.gen.if(D),$)$();else this.error();if(F){if(this.gen.else(),F(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(D,F){this.failResult((0,c.not)(D),void 0,F)}fail(D){if(D===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(D),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(D){if(!this.$data)return this.fail(D);let{schemaCode:F}=this;this.fail(c._`${F} !== undefined && (${(0,c.or)(this.invalid$data(),D)})`)}error(D,F,$){if(F){this.setParams(F),this._error(D,$),this.setParams({});return}this._error(D,$)}_error(D,F){(D?i5.reportExtraError:i5.reportError)(this,this.def.error,F)}$dataError(){(0,i5.reportError)(this,this.def.$dataError||i5.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,i5.resetErrorsCount)(this.gen,this.errsCount)}ok(D){if(!this.allErrors)this.gen.if(D)}setParams(D,F){if(F)Object.assign(this.params,D);else this.params=D}block$data(D,F,$=c.nil){this.gen.block(()=>{this.check$data(D,$),F()})}check$data(D=c.nil,F=c.nil){if(!this.$data)return;let{gen:$,schemaCode:J,schemaType:Q,def:Y}=this;if($.if((0,c.or)(c._`${J} === undefined`,F)),D!==c.nil)$.assign(D,!0);if(Q.length||Y.validateSchema){if($.elseIf(this.invalid$data()),this.$dataError(),D!==c.nil)$.assign(D,!1)}$.else()}invalid$data(){let{gen:D,schemaCode:F,schemaType:$,def:J,it:Q}=this;return(0,c.or)(Y(),B());function Y(){if($.length){if(!(F instanceof c.Name))throw Error("ajv implementation error");let X=Array.isArray($)?$:[$];return c._`${(0,FJ.checkDataTypes)(X,F,Q.opts.strictNumbers,FJ.DataType.Wrong)}`}return c.nil}function B(){if(J.validateSchema){let X=D.scopeValue("validate$data",{ref:J.validateSchema});return c._`!${X}(${F})`}return c.nil}}subschema(D,F){let $=(0,YG.getSubschema)(this.it,D);(0,YG.extendSubschemaData)($,this.it,D),(0,YG.extendSubschemaMode)($,D);let J={...this.it,...$,items:void 0,props:void 0};return sJ0(J,F),J}mergeEvaluated(D,F){let{it:$,gen:J}=this;if(!$.opts.unevaluated)return;if($.props!==!0&&D.props!==void 0)$.props=m8.mergeEvaluated.props(J,D.props,$.props,F);if($.items!==!0&&D.items!==void 0)$.items=m8.mergeEvaluated.items(J,D.items,$.items,F)}mergeValidEvaluated(D,F){let{it:$,gen:J}=this;if($.opts.unevaluated&&($.props!==!0||$.items!==!0))return J.if(F,()=>this.mergeEvaluated(D,c.Name)),!0}}ZS.KeywordCxt=GG;function ES(D,F,$,J){let Q=new GG(D,$,F);if("code"in $)$.code(Q,J);else if(Q.$data&&$.validate)(0,a5.funcKeywordCode)(Q,$);else if("macro"in $)(0,a5.macroKeywordCode)(Q,$);else if($.compile||$.validate)(0,a5.funcKeywordCode)(Q,$)}var HQ0=/^\/(?:[^~]|~0|~1)*$/,qQ0=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function VS(D,{dataLevel:F,dataNames:$,dataPathArr:J}){let Q,Y;if(D==="")return o.default.rootData;if(D[0]==="/"){if(!HQ0.test(D))throw Error(`Invalid JSON-pointer: ${D}`);Q=D,Y=o.default.rootData}else{let H=qQ0.exec(D);if(!H)throw Error(`Invalid JSON-pointer: ${D}`);let q=+H[1];if(Q=H[2],Q==="#"){if(q>=F)throw Error(G("property/index",q));return J[F-q]}if(q>F)throw Error(G("data",q));if(Y=$[F-q],!Q)return Y}let B=Y,X=Q.split("/");for(let H of X)if(H)Y=c._`${Y}${(0,c.getProperty)((0,m8.unescapeJsonPointer)(H))}`,B=c._`${B} && ${Y}`;return B;function G(H,q){return`Cannot access ${H} ${q} levels up, current level is ${F}`}}ZS.getData=VS});var o5=z((AS)=>{Object.defineProperty(AS,"__esModule",{value:!0});class LS extends Error{constructor(D){super("validation failed");this.errors=D,this.ajv=this.validation=!0}}AS.default=LS});var $F=z((NS)=>{Object.defineProperty(NS,"__esModule",{value:!0});var WG=n5();class MS extends Error{constructor(D,F,$,J){super(J||`can't resolve reference ${$} from id ${F}`);this.missingRef=(0,WG.resolveUrl)(D,F,$),this.missingSchema=(0,WG.normalizeId)((0,WG.getFullPath)(D,this.missingRef))}}NS.default=MS});var r5=z((OS)=>{Object.defineProperty(OS,"__esModule",{value:!0});OS.resolveSchema=OS.getCompilingSchema=OS.resolveRef=OS.compileSchema=OS.SchemaEnv=void 0;var h1=t(),ZQ0=o5(),M4=M1(),b1=n5(),RS=z0(),UQ0=FF();class s5{constructor(D){var F;this.refs={},this.dynamicAnchors={};let $;if(typeof D.schema=="object")$=D.schema;this.schema=D.schema,this.schemaId=D.schemaId,this.root=D.root||this,this.baseId=(F=D.baseId)!==null&&F!==void 0?F:(0,b1.normalizeId)($===null||$===void 0?void 0:$[D.schemaId||"$id"]),this.schemaPath=D.schemaPath,this.localRefs=D.localRefs,this.meta=D.meta,this.$async=$===null||$===void 0?void 0:$.$async,this.refs={}}}OS.SchemaEnv=s5;function qG(D){let F=CS.call(this,D);if(F)return F;let $=(0,b1.getFullPath)(this.opts.uriResolver,D.root.baseId),{es5:J,lines:Q}=this.opts.code,{ownProperties:Y}=this.opts,B=new h1.CodeGen(this.scope,{es5:J,lines:Q,ownProperties:Y}),X;if(D.$async)X=B.scopeValue("Error",{ref:ZQ0.default,code:h1._`require("ajv/dist/runtime/validation_error").default`});let G=B.scopeName("validate");D.validateName=G;let H={gen:B,allErrors:this.opts.allErrors,data:M4.default.data,parentData:M4.default.parentData,parentDataProperty:M4.default.parentDataProperty,dataNames:[M4.default.data],dataPathArr:[h1.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:B.scopeValue("schema",this.opts.code.source===!0?{ref:D.schema,code:(0,h1.stringify)(D.schema)}:{ref:D.schema}),validateName:G,ValidationError:X,schema:D.schema,schemaEnv:D,rootId:$,baseId:D.baseId||$,schemaPath:h1.nil,errSchemaPath:D.schemaPath||(this.opts.jtd?"":"#"),errorPath:h1._`""`,opts:this.opts,self:this},q;try{this._compilations.add(D),(0,UQ0.validateFunctionCode)(H),B.optimize(this.opts.code.optimize);let K=B.toString();if(q=`${B.scopeRefs(M4.default.scope)}return ${K}`,this.opts.code.process)q=this.opts.code.process(q,D);let E=Function(`${M4.default.self}`,`${M4.default.scope}`,q)(this,this.scope.get());if(this.scope.value(G,{ref:E}),E.errors=null,E.schema=D.schema,E.schemaEnv=D,D.$async)E.$async=!0;if(this.opts.code.source===!0)E.source={validateName:G,validateCode:K,scopeValues:B._values};if(this.opts.unevaluated){let{props:Z,items:L}=H;if(E.evaluated={props:Z instanceof h1.Name?void 0:Z,items:L instanceof h1.Name?void 0:L,dynamicProps:Z instanceof h1.Name,dynamicItems:L instanceof h1.Name},E.source)E.source.evaluated=(0,h1.stringify)(E.evaluated)}return D.validate=E,D}catch(K){if(delete D.validate,delete D.validateName,q)this.logger.error("Error compiling schema, function code:",q);throw K}finally{this._compilations.delete(D)}}OS.compileSchema=qG;function LQ0(D,F,$){var J;$=(0,b1.resolveUrl)(this.opts.uriResolver,F,$);let Q=D.refs[$];if(Q)return Q;let Y=NQ0.call(this,D,$);if(Y===void 0){let B=(J=D.localRefs)===null||J===void 0?void 0:J[$],{schemaId:X}=this.opts;if(B)Y=new s5({schema:B,schemaId:X,root:D,baseId:F})}if(Y===void 0)return;return D.refs[$]=AQ0.call(this,Y)}OS.resolveRef=LQ0;function AQ0(D){if((0,b1.inlineRef)(D.schema,this.opts.inlineRefs))return D.schema;return D.validate?D:qG.call(this,D)}function CS(D){for(let F of this._compilations)if(MQ0(F,D))return F}OS.getCompilingSchema=CS;function MQ0(D,F){return D.schema===F.schema&&D.root===F.root&&D.baseId===F.baseId}function NQ0(D,F){let $;while(typeof($=this.refs[F])=="string")F=$;return $||this.schemas[F]||$J.call(this,D,F)}function $J(D,F){let $=this.opts.uriResolver.parse(F),J=(0,b1._getFullPath)(this.opts.uriResolver,$),Q=(0,b1.getFullPath)(this.opts.uriResolver,D.baseId,void 0);if(Object.keys(D.schema).length>0&&J===Q)return HG.call(this,$,D);let Y=(0,b1.normalizeId)(J),B=this.refs[Y]||this.schemas[Y];if(typeof B=="string"){let X=$J.call(this,D,B);if(typeof(X===null||X===void 0?void 0:X.schema)!=="object")return;return HG.call(this,$,X)}if(typeof(B===null||B===void 0?void 0:B.schema)!=="object")return;if(!B.validate)qG.call(this,B);if(Y===(0,b1.normalizeId)(F)){let{schema:X}=B,{schemaId:G}=this.opts,H=X[G];if(H)Q=(0,b1.resolveUrl)(this.opts.uriResolver,Q,H);return new s5({schema:X,schemaId:G,root:D,baseId:Q})}return HG.call(this,$,B)}OS.resolveSchema=$J;var RQ0=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function HG(D,{baseId:F,schema:$,root:J}){var Q;if(((Q=D.fragment)===null||Q===void 0?void 0:Q[0])!=="/")return;for(let X of D.fragment.slice(1).split("/")){if(typeof $==="boolean")return;let G=$[(0,RS.unescapeFragment)(X)];if(G===void 0)return;$=G;let H=typeof $==="object"&&$[this.opts.schemaId];if(!RQ0.has(X)&&H)F=(0,b1.resolveUrl)(this.opts.uriResolver,F,H)}let Y;if(typeof $!="boolean"&&$.$ref&&!(0,RS.schemaHasRulesButRef)($,this.RULES)){let X=(0,b1.resolveUrl)(this.opts.uriResolver,F,$.$ref);Y=$J.call(this,J,X)}let{schemaId:B}=this.opts;if(Y=Y||new s5({schema:$,schemaId:B,root:J,baseId:F}),Y.schema!==Y.root.schema)return Y;return}});var jS=z((cj0,TQ0)=>{TQ0.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 zG=z((nj0,SS)=>{var PQ0=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),PS=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 KG(D){let F="",$=0,J=0;for(J=0;J<D.length;J++){if($=D[J].charCodeAt(0),$===48)continue;if(!($>=48&&$<=57||$>=65&&$<=70||$>=97&&$<=102))return"";F+=D[J];break}for(J+=1;J<D.length;J++){if($=D[J].charCodeAt(0),!($>=48&&$<=57||$>=65&&$<=70||$>=97&&$<=102))return"";F+=D[J]}return F}var IQ0=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function TS(D){return D.length=0,!0}function SQ0(D,F,$){if(D.length){let J=KG(D);if(J!=="")F.push(J);else return $.error=!0,!1;D.length=0}return!0}function kQ0(D){let F=0,$={error:!1,address:"",zone:""},J=[],Q=[],Y=!1,B=!1,X=SQ0;for(let G=0;G<D.length;G++){let H=D[G];if(H==="["||H==="]")continue;if(H===":"){if(Y===!0)B=!0;if(!X(Q,J,$))break;if(++F>7){$.error=!0;break}if(G>0&&D[G-1]===":")Y=!0;J.push(":");continue}else if(H==="%"){if(!X(Q,J,$))break;X=TS}else{Q.push(H);continue}}if(Q.length)if(X===TS)$.zone=Q.join("");else if(B)J.push(Q.join(""));else J.push(KG(Q));return $.address=J.join(""),$}function IS(D){if(vQ0(D,":")<2)return{host:D,isIPV6:!1};let F=kQ0(D);if(!F.error){let{address:$,address:J}=F;if(F.zone)$+="%"+F.zone,J+="%25"+F.zone;return{host:$,isIPV6:!0,escapedHost:J}}else return{host:D,isIPV6:!1}}function vQ0(D,F){let $=0;for(let J=0;J<D.length;J++)if(D[J]===F)$++;return $}function yQ0(D){let F=D,$=[],J=-1,Q=0;while(Q=F.length){if(Q===1)if(F===".")break;else if(F==="/"){$.push("/");break}else{$.push(F);break}else if(Q===2){if(F[0]==="."){if(F[1]===".")break;else if(F[1]==="/"){F=F.slice(2);continue}}else if(F[0]==="/"){if(F[1]==="."||F[1]==="/"){$.push("/");break}}}else if(Q===3){if(F==="/.."){if($.length!==0)$.pop();$.push("/");break}}if(F[0]==="."){if(F[1]==="."){if(F[2]==="/"){F=F.slice(3);continue}}else if(F[1]==="/"){F=F.slice(2);continue}}else if(F[0]==="/"){if(F[1]==="."){if(F[2]==="/"){F=F.slice(2);continue}else if(F[2]==="."){if(F[3]==="/"){if(F=F.slice(3),$.length!==0)$.pop();continue}}}}if((J=F.indexOf("/",1))===-1){$.push(F);break}else $.push(F.slice(0,J)),F=F.slice(J)}return $.join("")}function xQ0(D,F){let $=F!==!0?escape:unescape;if(D.scheme!==void 0)D.scheme=$(D.scheme);if(D.userinfo!==void 0)D.userinfo=$(D.userinfo);if(D.host!==void 0)D.host=$(D.host);if(D.path!==void 0)D.path=$(D.path);if(D.query!==void 0)D.query=$(D.query);if(D.fragment!==void 0)D.fragment=$(D.fragment);return D}function _Q0(D){let F=[];if(D.userinfo!==void 0)F.push(D.userinfo),F.push("@");if(D.host!==void 0){let $=unescape(D.host);if(!PS($)){let J=IS($);if(J.isIPV6===!0)$=`[${J.escapedHost}]`;else $=D.host}F.push($)}if(typeof D.port==="number"||typeof D.port==="string")F.push(":"),F.push(String(D.port));return F.length?F.join(""):void 0}SS.exports={nonSimpleDomain:IQ0,recomposeAuthority:_Q0,normalizeComponentEncoding:xQ0,removeDotSegments:yQ0,isIPv4:PS,isUUID:PQ0,normalizeIPv6:IS,stringArrayToHexStripped:KG}});var _S=z((ij0,xS)=>{var{isUUID:fQ0}=zG(),gQ0=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,hQ0=["http","https","ws","wss","urn","urn:uuid"];function bQ0(D){return hQ0.indexOf(D)!==-1}function EG(D){if(D.secure===!0)return!0;else if(D.secure===!1)return!1;else if(D.scheme)return D.scheme.length===3&&(D.scheme[0]==="w"||D.scheme[0]==="W")&&(D.scheme[1]==="s"||D.scheme[1]==="S")&&(D.scheme[2]==="s"||D.scheme[2]==="S");else return!1}function kS(D){if(!D.host)D.error=D.error||"HTTP URIs must have a host.";return D}function vS(D){let F=String(D.scheme).toLowerCase()==="https";if(D.port===(F?443:80)||D.port==="")D.port=void 0;if(!D.path)D.path="/";return D}function uQ0(D){return D.secure=EG(D),D.resourceName=(D.path||"/")+(D.query?"?"+D.query:""),D.path=void 0,D.query=void 0,D}function mQ0(D){if(D.port===(EG(D)?443:80)||D.port==="")D.port=void 0;if(typeof D.secure==="boolean")D.scheme=D.secure?"wss":"ws",D.secure=void 0;if(D.resourceName){let[F,$]=D.resourceName.split("?");D.path=F&&F!=="/"?F:void 0,D.query=$,D.resourceName=void 0}return D.fragment=void 0,D}function lQ0(D,F){if(!D.path)return D.error="URN can not be parsed",D;let $=D.path.match(gQ0);if($){let J=F.scheme||D.scheme||"urn";D.nid=$[1].toLowerCase(),D.nss=$[2];let Q=`${J}:${F.nid||D.nid}`,Y=VG(Q);if(D.path=void 0,Y)D=Y.parse(D,F)}else D.error=D.error||"URN can not be parsed.";return D}function pQ0(D,F){if(D.nid===void 0)throw Error("URN without nid cannot be serialized");let $=F.scheme||D.scheme||"urn",J=D.nid.toLowerCase(),Q=`${$}:${F.nid||J}`,Y=VG(Q);if(Y)D=Y.serialize(D,F);let B=D,X=D.nss;return B.path=`${J||F.nid}:${X}`,F.skipEscape=!0,B}function dQ0(D,F){let $=D;if($.uuid=$.nss,$.nss=void 0,!F.tolerant&&(!$.uuid||!fQ0($.uuid)))$.error=$.error||"UUID is not valid.";return $}function cQ0(D){let F=D;return F.nss=(D.uuid||"").toLowerCase(),F}var yS={scheme:"http",domainHost:!0,parse:kS,serialize:vS},nQ0={scheme:"https",domainHost:yS.domainHost,parse:kS,serialize:vS},JJ={scheme:"ws",domainHost:!0,parse:uQ0,serialize:mQ0},iQ0={scheme:"wss",domainHost:JJ.domainHost,parse:JJ.parse,serialize:JJ.serialize},aQ0={scheme:"urn",parse:lQ0,serialize:pQ0,skipNormalize:!0},oQ0={scheme:"urn:uuid",parse:dQ0,serialize:cQ0,skipNormalize:!0},QJ={http:yS,https:nQ0,ws:JJ,wss:iQ0,urn:aQ0,"urn:uuid":oQ0};Object.setPrototypeOf(QJ,null);function VG(D){return D&&(QJ[D]||QJ[D.toLowerCase()])||void 0}xS.exports={wsIsSecure:EG,SCHEMES:QJ,isValidSchemeName:bQ0,getSchemeHandler:VG}});var hS=z((aj0,BJ)=>{var{normalizeIPv6:sQ0,removeDotSegments:t5,recomposeAuthority:rQ0,normalizeComponentEncoding:YJ,isIPv4:tQ0,nonSimpleDomain:eQ0}=zG(),{SCHEMES:DY0,getSchemeHandler:fS}=_S();function FY0(D,F){if(typeof D==="string")D=L8(l8(D,F),F);else if(typeof D==="object")D=l8(L8(D,F),F);return D}function $Y0(D,F,$){let J=$?Object.assign({scheme:"null"},$):{scheme:"null"},Q=gS(l8(D,J),l8(F,J),J,!0);return J.skipEscape=!0,L8(Q,J)}function gS(D,F,$,J){let Q={};if(!J)D=l8(L8(D,$),$),F=l8(L8(F,$),$);if($=$||{},!$.tolerant&&F.scheme)Q.scheme=F.scheme,Q.userinfo=F.userinfo,Q.host=F.host,Q.port=F.port,Q.path=t5(F.path||""),Q.query=F.query;else{if(F.userinfo!==void 0||F.host!==void 0||F.port!==void 0)Q.userinfo=F.userinfo,Q.host=F.host,Q.port=F.port,Q.path=t5(F.path||""),Q.query=F.query;else{if(!F.path)if(Q.path=D.path,F.query!==void 0)Q.query=F.query;else Q.query=D.query;else{if(F.path[0]==="/")Q.path=t5(F.path);else{if((D.userinfo!==void 0||D.host!==void 0||D.port!==void 0)&&!D.path)Q.path="/"+F.path;else if(!D.path)Q.path=F.path;else Q.path=D.path.slice(0,D.path.lastIndexOf("/")+1)+F.path;Q.path=t5(Q.path)}Q.query=F.query}Q.userinfo=D.userinfo,Q.host=D.host,Q.port=D.port}Q.scheme=D.scheme}return Q.fragment=F.fragment,Q}function JY0(D,F,$){if(typeof D==="string")D=unescape(D),D=L8(YJ(l8(D,$),!0),{...$,skipEscape:!0});else if(typeof D==="object")D=L8(YJ(D,!0),{...$,skipEscape:!0});if(typeof F==="string")F=unescape(F),F=L8(YJ(l8(F,$),!0),{...$,skipEscape:!0});else if(typeof F==="object")F=L8(YJ(F,!0),{...$,skipEscape:!0});return D.toLowerCase()===F.toLowerCase()}function L8(D,F){let $={host:D.host,scheme:D.scheme,userinfo:D.userinfo,port:D.port,path:D.path,query:D.query,nid:D.nid,nss:D.nss,uuid:D.uuid,fragment:D.fragment,reference:D.reference,resourceName:D.resourceName,secure:D.secure,error:""},J=Object.assign({},F),Q=[],Y=fS(J.scheme||$.scheme);if(Y&&Y.serialize)Y.serialize($,J);if($.path!==void 0)if(!J.skipEscape){if($.path=escape($.path),$.scheme!==void 0)$.path=$.path.split("%3A").join(":")}else $.path=unescape($.path);if(J.reference!=="suffix"&&$.scheme)Q.push($.scheme,":");let B=rQ0($);if(B!==void 0){if(J.reference!=="suffix")Q.push("//");if(Q.push(B),$.path&&$.path[0]!=="/")Q.push("/")}if($.path!==void 0){let X=$.path;if(!J.absolutePath&&(!Y||!Y.absolutePath))X=t5(X);if(B===void 0&&X[0]==="/"&&X[1]==="/")X="/%2F"+X.slice(2);Q.push(X)}if($.query!==void 0)Q.push("?",$.query);if($.fragment!==void 0)Q.push("#",$.fragment);return Q.join("")}var QY0=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function l8(D,F){let $=Object.assign({},F),J={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},Q=!1;if($.reference==="suffix")if($.scheme)D=$.scheme+":"+D;else D="//"+D;let Y=D.match(QY0);if(Y){if(J.scheme=Y[1],J.userinfo=Y[3],J.host=Y[4],J.port=parseInt(Y[5],10),J.path=Y[6]||"",J.query=Y[7],J.fragment=Y[8],isNaN(J.port))J.port=Y[5];if(J.host)if(tQ0(J.host)===!1){let G=sQ0(J.host);J.host=G.host.toLowerCase(),Q=G.isIPV6}else Q=!0;if(J.scheme===void 0&&J.userinfo===void 0&&J.host===void 0&&J.port===void 0&&J.query===void 0&&!J.path)J.reference="same-document";else if(J.scheme===void 0)J.reference="relative";else if(J.fragment===void 0)J.reference="absolute";else J.reference="uri";if($.reference&&$.reference!=="suffix"&&$.reference!==J.reference)J.error=J.error||"URI is not a "+$.reference+" reference.";let B=fS($.scheme||J.scheme);if(!$.unicodeSupport&&(!B||!B.unicodeSupport)){if(J.host&&($.domainHost||B&&B.domainHost)&&Q===!1&&eQ0(J.host))try{J.host=URL.domainToASCII(J.host.toLowerCase())}catch(X){J.error=J.error||"Host's domain name can not be converted to ASCII: "+X}}if(!B||B&&!B.skipNormalize){if(D.indexOf("%")!==-1){if(J.scheme!==void 0)J.scheme=unescape(J.scheme);if(J.host!==void 0)J.host=unescape(J.host)}if(J.path)J.path=escape(unescape(J.path));if(J.fragment)J.fragment=encodeURI(decodeURIComponent(J.fragment))}if(B&&B.parse)B.parse(J,$)}else J.error=J.error||"URI can not be parsed.";return J}var ZG={SCHEMES:DY0,normalize:FY0,resolve:$Y0,resolveComponent:gS,equal:JY0,serialize:L8,parse:l8};BJ.exports=ZG;BJ.exports.default=ZG;BJ.exports.fastUri=ZG});var mS=z((uS)=>{Object.defineProperty(uS,"__esModule",{value:!0});var bS=hS();bS.code='require("ajv/dist/runtime/uri").default';uS.default=bS});var AG=z((p8)=>{Object.defineProperty(p8,"__esModule",{value:!0});p8.CodeGen=p8.Name=p8.nil=p8.stringify=p8.str=p8._=p8.KeywordCxt=void 0;var BY0=FF();Object.defineProperty(p8,"KeywordCxt",{enumerable:!0,get:function(){return BY0.KeywordCxt}});var JF=t();Object.defineProperty(p8,"_",{enumerable:!0,get:function(){return JF._}});Object.defineProperty(p8,"str",{enumerable:!0,get:function(){return JF.str}});Object.defineProperty(p8,"stringify",{enumerable:!0,get:function(){return JF.stringify}});Object.defineProperty(p8,"nil",{enumerable:!0,get:function(){return JF.nil}});Object.defineProperty(p8,"Name",{enumerable:!0,get:function(){return JF.Name}});Object.defineProperty(p8,"CodeGen",{enumerable:!0,get:function(){return JF.CodeGen}});var XY0=o5(),nS=$F(),GY0=oX(),e5=r5(),WY0=t(),D9=n5(),XJ=c5(),LG=z0(),lS=jS(),HY0=mS(),iS=(D,F)=>new RegExp(D,F);iS.code="new RegExp";var qY0=["removeAdditional","useDefaults","coerceTypes"],KY0=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),zY0={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."},EY0={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},pS=200;function VY0(D){var F,$,J,Q,Y,B,X,G,H,q,K,V,E,Z,L,M,A,N,w,P,C,T,y,d,W0;let F0=D.strict,O0=(F=D.code)===null||F===void 0?void 0:F.optimize,e=O0===!0||O0===void 0?1:O0||0,N0=(J=($=D.code)===null||$===void 0?void 0:$.regExp)!==null&&J!==void 0?J:iS,GD=(Q=D.uriResolver)!==null&&Q!==void 0?Q:HY0.default;return{strictSchema:(B=(Y=D.strictSchema)!==null&&Y!==void 0?Y:F0)!==null&&B!==void 0?B:!0,strictNumbers:(G=(X=D.strictNumbers)!==null&&X!==void 0?X:F0)!==null&&G!==void 0?G:!0,strictTypes:(q=(H=D.strictTypes)!==null&&H!==void 0?H:F0)!==null&&q!==void 0?q:"log",strictTuples:(V=(K=D.strictTuples)!==null&&K!==void 0?K:F0)!==null&&V!==void 0?V:"log",strictRequired:(Z=(E=D.strictRequired)!==null&&E!==void 0?E:F0)!==null&&Z!==void 0?Z:!1,code:D.code?{...D.code,optimize:e,regExp:N0}:{optimize:e,regExp:N0},loopRequired:(L=D.loopRequired)!==null&&L!==void 0?L:pS,loopEnum:(M=D.loopEnum)!==null&&M!==void 0?M:pS,meta:(A=D.meta)!==null&&A!==void 0?A:!0,messages:(N=D.messages)!==null&&N!==void 0?N:!0,inlineRefs:(w=D.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(P=D.schemaId)!==null&&P!==void 0?P:"$id",addUsedSchema:(C=D.addUsedSchema)!==null&&C!==void 0?C:!0,validateSchema:(T=D.validateSchema)!==null&&T!==void 0?T:!0,validateFormats:(y=D.validateFormats)!==null&&y!==void 0?y:!0,unicodeRegExp:(d=D.unicodeRegExp)!==null&&d!==void 0?d:!0,int32range:(W0=D.int32range)!==null&&W0!==void 0?W0:!0,uriResolver:GD}}class GJ{constructor(D={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,D=this.opts={...D,...VY0(D)};let{es5:F,lines:$}=this.opts.code;this.scope=new WY0.ValueScope({scope:{},prefixes:KY0,es5:F,lines:$}),this.logger=NY0(D.logger);let J=D.validateFormats;if(D.validateFormats=!1,this.RULES=(0,GY0.getRules)(),dS.call(this,zY0,D,"NOT SUPPORTED"),dS.call(this,EY0,D,"DEPRECATED","warn"),this._metaOpts=AY0.call(this),D.formats)UY0.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),D.keywords)LY0.call(this,D.keywords);if(typeof D.meta=="object")this.addMetaSchema(D.meta);ZY0.call(this),D.validateFormats=J}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:D,meta:F,schemaId:$}=this.opts,J=lS;if($==="id")J={...lS},J.id=J.$id,delete J.$id;if(F&&D)this.addMetaSchema(J,J[$],!1)}defaultMeta(){let{meta:D,schemaId:F}=this.opts;return this.opts.defaultMeta=typeof D=="object"?D[F]||D:void 0}validate(D,F){let $;if(typeof D=="string"){if($=this.getSchema(D),!$)throw Error(`no schema with key or ref "${D}"`)}else $=this.compile(D);let J=$(F);if(!("$async"in $))this.errors=$.errors;return J}compile(D,F){let $=this._addSchema(D,F);return $.validate||this._compileSchemaEnv($)}compileAsync(D,F){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:$}=this.opts;return J.call(this,D,F);async function J(H,q){await Q.call(this,H.$schema);let K=this._addSchema(H,q);return K.validate||Y.call(this,K)}async function Q(H){if(H&&!this.getSchema(H))await J.call(this,{$ref:H},!0)}async function Y(H){try{return this._compileSchemaEnv(H)}catch(q){if(!(q instanceof nS.default))throw q;return B.call(this,q),await X.call(this,q.missingSchema),Y.call(this,H)}}function B({missingSchema:H,missingRef:q}){if(this.refs[H])throw Error(`AnySchema ${H} is loaded but ${q} cannot be resolved`)}async function X(H){let q=await G.call(this,H);if(!this.refs[H])await Q.call(this,q.$schema);if(!this.refs[H])this.addSchema(q,H,F)}async function G(H){let q=this._loading[H];if(q)return q;try{return await(this._loading[H]=$(H))}finally{delete this._loading[H]}}}addSchema(D,F,$,J=this.opts.validateSchema){if(Array.isArray(D)){for(let Y of D)this.addSchema(Y,void 0,$,J);return this}let Q;if(typeof D==="object"){let{schemaId:Y}=this.opts;if(Q=D[Y],Q!==void 0&&typeof Q!="string")throw Error(`schema ${Y} must be string`)}return F=(0,D9.normalizeId)(F||Q),this._checkUnique(F),this.schemas[F]=this._addSchema(D,$,F,J,!0),this}addMetaSchema(D,F,$=this.opts.validateSchema){return this.addSchema(D,F,!0,$),this}validateSchema(D,F){if(typeof D=="boolean")return!0;let $;if($=D.$schema,$!==void 0&&typeof $!="string")throw Error("$schema must be a string");if($=$||this.opts.defaultMeta||this.defaultMeta(),!$)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let J=this.validate($,D);if(!J&&F){let Q="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(Q);else throw Error(Q)}return J}getSchema(D){let F;while(typeof(F=cS.call(this,D))=="string")D=F;if(F===void 0){let{schemaId:$}=this.opts,J=new e5.SchemaEnv({schema:{},schemaId:$});if(F=e5.resolveSchema.call(this,J,D),!F)return;this.refs[D]=F}return F.validate||this._compileSchemaEnv(F)}removeSchema(D){if(D instanceof RegExp)return this._removeAllSchemas(this.schemas,D),this._removeAllSchemas(this.refs,D),this;switch(typeof D){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let F=cS.call(this,D);if(typeof F=="object")this._cache.delete(F.schema);return delete this.schemas[D],delete this.refs[D],this}case"object":{let F=D;this._cache.delete(F);let $=D[this.opts.schemaId];if($)$=(0,D9.normalizeId)($),delete this.schemas[$],delete this.refs[$];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(D){for(let F of D)this.addKeyword(F);return this}addKeyword(D,F){let $;if(typeof D=="string"){if($=D,typeof F=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),F.keyword=$}else if(typeof D=="object"&&F===void 0){if(F=D,$=F.keyword,Array.isArray($)&&!$.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(CY0.call(this,$,F),!F)return(0,LG.eachItem)($,(Q)=>UG.call(this,Q)),this;wY0.call(this,F);let J={...F,type:(0,XJ.getJSONTypes)(F.type),schemaType:(0,XJ.getJSONTypes)(F.schemaType)};return(0,LG.eachItem)($,J.type.length===0?(Q)=>UG.call(this,Q,J):(Q)=>J.type.forEach((Y)=>UG.call(this,Q,J,Y))),this}getKeyword(D){let F=this.RULES.all[D];return typeof F=="object"?F.definition:!!F}removeKeyword(D){let{RULES:F}=this;delete F.keywords[D],delete F.all[D];for(let $ of F.rules){let J=$.rules.findIndex((Q)=>Q.keyword===D);if(J>=0)$.rules.splice(J,1)}return this}addFormat(D,F){if(typeof F=="string")F=new RegExp(F);return this.formats[D]=F,this}errorsText(D=this.errors,{separator:F=", ",dataVar:$="data"}={}){if(!D||D.length===0)return"No errors";return D.map((J)=>`${$}${J.instancePath} ${J.message}`).reduce((J,Q)=>J+F+Q)}$dataMetaSchema(D,F){let $=this.RULES.all;D=JSON.parse(JSON.stringify(D));for(let J of F){let Q=J.split("/").slice(1),Y=D;for(let B of Q)Y=Y[B];for(let B in $){let X=$[B];if(typeof X!="object")continue;let{$data:G}=X.definition,H=Y[B];if(G&&H)Y[B]=aS(H)}}return D}_removeAllSchemas(D,F){for(let $ in D){let J=D[$];if(!F||F.test($)){if(typeof J=="string")delete D[$];else if(J&&!J.meta)this._cache.delete(J.schema),delete D[$]}}}_addSchema(D,F,$,J=this.opts.validateSchema,Q=this.opts.addUsedSchema){let Y,{schemaId:B}=this.opts;if(typeof D=="object")Y=D[B];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof D!="boolean")throw Error("schema must be object or boolean");let X=this._cache.get(D);if(X!==void 0)return X;$=(0,D9.normalizeId)(Y||$);let G=D9.getSchemaRefs.call(this,D,$);if(X=new e5.SchemaEnv({schema:D,schemaId:B,meta:F,baseId:$,localRefs:G}),this._cache.set(X.schema,X),Q&&!$.startsWith("#")){if($)this._checkUnique($);this.refs[$]=X}if(J)this.validateSchema(D,!0);return X}_checkUnique(D){if(this.schemas[D]||this.refs[D])throw Error(`schema with key or id "${D}" already exists`)}_compileSchemaEnv(D){if(D.meta)this._compileMetaSchema(D);else e5.compileSchema.call(this,D);if(!D.validate)throw Error("ajv implementation error");return D.validate}_compileMetaSchema(D){let F=this.opts;this.opts=this._metaOpts;try{e5.compileSchema.call(this,D)}finally{this.opts=F}}}GJ.ValidationError=XY0.default;GJ.MissingRefError=nS.default;p8.default=GJ;function dS(D,F,$,J="error"){for(let Q in D){let Y=Q;if(Y in F)this.logger[J](`${$}: option ${Q}. ${D[Y]}`)}}function cS(D){return D=(0,D9.normalizeId)(D),this.schemas[D]||this.refs[D]}function ZY0(){let D=this.opts.schemas;if(!D)return;if(Array.isArray(D))this.addSchema(D);else for(let F in D)this.addSchema(D[F],F)}function UY0(){for(let D in this.opts.formats){let F=this.opts.formats[D];if(F)this.addFormat(D,F)}}function LY0(D){if(Array.isArray(D)){this.addVocabulary(D);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let F in D){let $=D[F];if(!$.keyword)$.keyword=F;this.addKeyword($)}}function AY0(){let D={...this.opts};for(let F of qY0)delete D[F];return D}var MY0={log(){},warn(){},error(){}};function NY0(D){if(D===!1)return MY0;if(D===void 0)return console;if(D.log&&D.warn&&D.error)return D;throw Error("logger must implement log, warn and error methods")}var RY0=/^[a-z_$][a-z0-9_$:-]*$/i;function CY0(D,F){let{RULES:$}=this;if((0,LG.eachItem)(D,(J)=>{if($.keywords[J])throw Error(`Keyword ${J} is already defined`);if(!RY0.test(J))throw Error(`Keyword ${J} has invalid name`)}),!F)return;if(F.$data&&!(("code"in F)||("validate"in F)))throw Error('$data keyword must have "code" or "validate" function')}function UG(D,F,$){var J;let Q=F===null||F===void 0?void 0:F.post;if($&&Q)throw Error('keyword with "post" flag cannot have "type"');let{RULES:Y}=this,B=Q?Y.post:Y.rules.find(({type:G})=>G===$);if(!B)B={type:$,rules:[]},Y.rules.push(B);if(Y.keywords[D]=!0,!F)return;let X={keyword:D,definition:{...F,type:(0,XJ.getJSONTypes)(F.type),schemaType:(0,XJ.getJSONTypes)(F.schemaType)}};if(F.before)OY0.call(this,B,X,F.before);else B.rules.push(X);Y.all[D]=X,(J=F.implements)===null||J===void 0||J.forEach((G)=>this.addKeyword(G))}function OY0(D,F,$){let J=D.rules.findIndex((Q)=>Q.keyword===$);if(J>=0)D.rules.splice(J,0,F);else D.rules.push(F),this.logger.warn(`rule ${$} is not defined`)}function wY0(D){let{metaSchema:F}=D;if(F===void 0)return;if(D.$data&&this.opts.$data)F=aS(F);D.validateSchema=this.compile(F,!0)}var jY0={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function aS(D){return{anyOf:[D,jY0]}}});var sS=z((oS)=>{Object.defineProperty(oS,"__esModule",{value:!0});var IY0={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};oS.default=IY0});var qJ=z((Dk)=>{Object.defineProperty(Dk,"__esModule",{value:!0});Dk.callRef=Dk.getValidate=void 0;var kY0=$F(),rS=N1(),sD=t(),QF=M1(),tS=r5(),WJ=z0(),vY0={keyword:"$ref",schemaType:"string",code(D){let{gen:F,schema:$,it:J}=D,{baseId:Q,schemaEnv:Y,validateName:B,opts:X,self:G}=J,{root:H}=Y;if(($==="#"||$==="#/")&&Q===H.baseId)return K();let q=tS.resolveRef.call(G,H,Q,$);if(q===void 0)throw new kY0.default(J.opts.uriResolver,Q,$);if(q instanceof tS.SchemaEnv)return V(q);return E(q);function K(){if(Y===H)return HJ(D,B,Y,Y.$async);let Z=F.scopeValue("root",{ref:H});return HJ(D,sD._`${Z}.validate`,H,H.$async)}function V(Z){let L=eS(D,Z);HJ(D,L,Z,Z.$async)}function E(Z){let L=F.scopeValue("schema",X.code.source===!0?{ref:Z,code:(0,sD.stringify)(Z)}:{ref:Z}),M=F.name("valid"),A=D.subschema({schema:Z,dataTypes:[],schemaPath:sD.nil,topSchemaRef:L,errSchemaPath:$},M);D.mergeEvaluated(A),D.ok(M)}}};function eS(D,F){let{gen:$}=D;return F.validate?$.scopeValue("validate",{ref:F.validate}):sD._`${$.scopeValue("wrapper",{ref:F})}.validate`}Dk.getValidate=eS;function HJ(D,F,$,J){let{gen:Q,it:Y}=D,{allErrors:B,schemaEnv:X,opts:G}=Y,H=G.passContext?QF.default.this:sD.nil;if(J)q();else K();function q(){if(!X.$async)throw Error("async schema referenced by sync schema");let Z=Q.let("valid");Q.try(()=>{if(Q.code(sD._`await ${(0,rS.callValidateCode)(D,F,H)}`),E(F),!B)Q.assign(Z,!0)},(L)=>{if(Q.if(sD._`!(${L} instanceof ${Y.ValidationError})`,()=>Q.throw(L)),V(L),!B)Q.assign(Z,!1)}),D.ok(Z)}function K(){D.result((0,rS.callValidateCode)(D,F,H),()=>E(F),()=>V(F))}function V(Z){let L=sD._`${Z}.errors`;Q.assign(QF.default.vErrors,sD._`${QF.default.vErrors} === null ? ${L} : ${QF.default.vErrors}.concat(${L})`),Q.assign(QF.default.errors,sD._`${QF.default.vErrors}.length`)}function E(Z){var L;if(!Y.opts.unevaluated)return;let M=(L=$===null||$===void 0?void 0:$.validate)===null||L===void 0?void 0:L.evaluated;if(Y.props!==!0)if(M&&!M.dynamicProps){if(M.props!==void 0)Y.props=WJ.mergeEvaluated.props(Q,M.props,Y.props)}else{let A=Q.var("props",sD._`${Z}.evaluated.props`);Y.props=WJ.mergeEvaluated.props(Q,A,Y.props,sD.Name)}if(Y.items!==!0)if(M&&!M.dynamicItems){if(M.items!==void 0)Y.items=WJ.mergeEvaluated.items(Q,M.items,Y.items)}else{let A=Q.var("items",sD._`${Z}.evaluated.items`);Y.items=WJ.mergeEvaluated.items(Q,A,Y.items,sD.Name)}}}Dk.callRef=HJ;Dk.default=vY0});var MG=z(($k)=>{Object.defineProperty($k,"__esModule",{value:!0});var _Y0=sS(),fY0=qJ(),gY0=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",_Y0.default,fY0.default];$k.default=gY0});var Qk=z((Jk)=>{Object.defineProperty(Jk,"__esModule",{value:!0});var KJ=t(),h6=KJ.operators,zJ={maximum:{okStr:"<=",ok:h6.LTE,fail:h6.GT},minimum:{okStr:">=",ok:h6.GTE,fail:h6.LT},exclusiveMaximum:{okStr:"<",ok:h6.LT,fail:h6.GTE},exclusiveMinimum:{okStr:">",ok:h6.GT,fail:h6.LTE}},bY0={message:({keyword:D,schemaCode:F})=>KJ.str`must be ${zJ[D].okStr} ${F}`,params:({keyword:D,schemaCode:F})=>KJ._`{comparison: ${zJ[D].okStr}, limit: ${F}}`},uY0={keyword:Object.keys(zJ),type:"number",schemaType:"number",$data:!0,error:bY0,code(D){let{keyword:F,data:$,schemaCode:J}=D;D.fail$data(KJ._`${$} ${zJ[F].fail} ${J} || isNaN(${$})`)}};Jk.default=uY0});var Bk=z((Yk)=>{Object.defineProperty(Yk,"__esModule",{value:!0});var F9=t(),lY0={message:({schemaCode:D})=>F9.str`must be multiple of ${D}`,params:({schemaCode:D})=>F9._`{multipleOf: ${D}}`},pY0={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:lY0,code(D){let{gen:F,data:$,schemaCode:J,it:Q}=D,Y=Q.opts.multipleOfPrecision,B=F.let("res"),X=Y?F9._`Math.abs(Math.round(${B}) - ${B}) > 1e-${Y}`:F9._`${B} !== parseInt(${B})`;D.fail$data(F9._`(${J} === 0 || (${B} = ${$}/${J}, ${X}))`)}};Yk.default=pY0});var Wk=z((Gk)=>{Object.defineProperty(Gk,"__esModule",{value:!0});function Xk(D){let F=D.length,$=0,J=0,Q;while(J<F)if($++,Q=D.charCodeAt(J++),Q>=55296&&Q<=56319&&J<F){if(Q=D.charCodeAt(J),(Q&64512)===56320)J++}return $}Gk.default=Xk;Xk.code='require("ajv/dist/runtime/ucs2length").default'});var qk=z((Hk)=>{Object.defineProperty(Hk,"__esModule",{value:!0});var N4=t(),nY0=z0(),iY0=Wk(),aY0={message({keyword:D,schemaCode:F}){let $=D==="maxLength"?"more":"fewer";return N4.str`must NOT have ${$} than ${F} characters`},params:({schemaCode:D})=>N4._`{limit: ${D}}`},oY0={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:aY0,code(D){let{keyword:F,data:$,schemaCode:J,it:Q}=D,Y=F==="maxLength"?N4.operators.GT:N4.operators.LT,B=Q.opts.unicode===!1?N4._`${$}.length`:N4._`${(0,nY0.useFunc)(D.gen,iY0.default)}(${$})`;D.fail$data(N4._`${B} ${Y} ${J}`)}};Hk.default=oY0});var zk=z((Kk)=>{Object.defineProperty(Kk,"__esModule",{value:!0});var rY0=N1(),EJ=t(),tY0={message:({schemaCode:D})=>EJ.str`must match pattern "${D}"`,params:({schemaCode:D})=>EJ._`{pattern: ${D}}`},eY0={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:tY0,code(D){let{data:F,$data:$,schema:J,schemaCode:Q,it:Y}=D,B=Y.opts.unicodeRegExp?"u":"",X=$?EJ._`(new RegExp(${Q}, ${B}))`:(0,rY0.usePattern)(D,J);D.fail$data(EJ._`!${X}.test(${F})`)}};Kk.default=eY0});var Vk=z((Ek)=>{Object.defineProperty(Ek,"__esModule",{value:!0});var $9=t(),FB0={message({keyword:D,schemaCode:F}){let $=D==="maxProperties"?"more":"fewer";return $9.str`must NOT have ${$} than ${F} properties`},params:({schemaCode:D})=>$9._`{limit: ${D}}`},$B0={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:FB0,code(D){let{keyword:F,data:$,schemaCode:J}=D,Q=F==="maxProperties"?$9.operators.GT:$9.operators.LT;D.fail$data($9._`Object.keys(${$}).length ${Q} ${J}`)}};Ek.default=$B0});var Uk=z((Zk)=>{Object.defineProperty(Zk,"__esModule",{value:!0});var J9=N1(),Q9=t(),QB0=z0(),YB0={message:({params:{missingProperty:D}})=>Q9.str`must have required property '${D}'`,params:({params:{missingProperty:D}})=>Q9._`{missingProperty: ${D}}`},BB0={keyword:"required",type:"object",schemaType:"array",$data:!0,error:YB0,code(D){let{gen:F,schema:$,schemaCode:J,data:Q,$data:Y,it:B}=D,{opts:X}=B;if(!Y&&$.length===0)return;let G=$.length>=X.loopRequired;if(B.allErrors)H();else q();if(X.strictRequired){let E=D.parentSchema.properties,{definedProperties:Z}=D.it;for(let L of $)if((E===null||E===void 0?void 0:E[L])===void 0&&!Z.has(L)){let M=B.schemaEnv.baseId+B.errSchemaPath,A=`required property "${L}" is not defined at "${M}" (strictRequired)`;(0,QB0.checkStrictMode)(B,A,B.opts.strictRequired)}}function H(){if(G||Y)D.block$data(Q9.nil,K);else for(let E of $)(0,J9.checkReportMissingProp)(D,E)}function q(){let E=F.let("missing");if(G||Y){let Z=F.let("valid",!0);D.block$data(Z,()=>V(E,Z)),D.ok(Z)}else F.if((0,J9.checkMissingProp)(D,$,E)),(0,J9.reportMissingProp)(D,E),F.else()}function K(){F.forOf("prop",J,(E)=>{D.setParams({missingProperty:E}),F.if((0,J9.noPropertyInData)(F,Q,E,X.ownProperties),()=>D.error())})}function V(E,Z){D.setParams({missingProperty:E}),F.forOf(E,J,()=>{F.assign(Z,(0,J9.propertyInData)(F,Q,E,X.ownProperties)),F.if((0,Q9.not)(Z),()=>{D.error(),F.break()})},Q9.nil)}}};Zk.default=BB0});var Ak=z((Lk)=>{Object.defineProperty(Lk,"__esModule",{value:!0});var Y9=t(),GB0={message({keyword:D,schemaCode:F}){let $=D==="maxItems"?"more":"fewer";return Y9.str`must NOT have ${$} than ${F} items`},params:({schemaCode:D})=>Y9._`{limit: ${D}}`},WB0={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:GB0,code(D){let{keyword:F,data:$,schemaCode:J}=D,Q=F==="maxItems"?Y9.operators.GT:Y9.operators.LT;D.fail$data(Y9._`${$}.length ${Q} ${J}`)}};Lk.default=WB0});var VJ=z((Nk)=>{Object.defineProperty(Nk,"__esModule",{value:!0});var Mk=JG();Mk.code='require("ajv/dist/runtime/equal").default';Nk.default=Mk});var Ck=z((Rk)=>{Object.defineProperty(Rk,"__esModule",{value:!0});var NG=c5(),MD=t(),KB0=z0(),zB0=VJ(),EB0={message:({params:{i:D,j:F}})=>MD.str`must NOT have duplicate items (items ## ${F} and ${D} are identical)`,params:({params:{i:D,j:F}})=>MD._`{i: ${D}, j: ${F}}`},VB0={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:EB0,code(D){let{gen:F,data:$,$data:J,schema:Q,parentSchema:Y,schemaCode:B,it:X}=D;if(!J&&!Q)return;let G=F.let("valid"),H=Y.items?(0,NG.getSchemaTypes)(Y.items):[];D.block$data(G,q,MD._`${B} === false`),D.ok(G);function q(){let Z=F.let("i",MD._`${$}.length`),L=F.let("j");D.setParams({i:Z,j:L}),F.assign(G,!0),F.if(MD._`${Z} > 1`,()=>(K()?V:E)(Z,L))}function K(){return H.length>0&&!H.some((Z)=>Z==="object"||Z==="array")}function V(Z,L){let M=F.name("item"),A=(0,NG.checkDataTypes)(H,M,X.opts.strictNumbers,NG.DataType.Wrong),N=F.const("indices",MD._`{}`);F.for(MD._`;${Z}--;`,()=>{if(F.let(M,MD._`${$}[${Z}]`),F.if(A,MD._`continue`),H.length>1)F.if(MD._`typeof ${M} == "string"`,MD._`${M} += "_"`);F.if(MD._`typeof ${N}[${M}] == "number"`,()=>{F.assign(L,MD._`${N}[${M}]`),D.error(),F.assign(G,!1).break()}).code(MD._`${N}[${M}] = ${Z}`)})}function E(Z,L){let M=(0,KB0.useFunc)(F,zB0.default),A=F.name("outer");F.label(A).for(MD._`;${Z}--;`,()=>F.for(MD._`${L} = ${Z}; ${L}--;`,()=>F.if(MD._`${M}(${$}[${Z}], ${$}[${L}])`,()=>{D.error(),F.assign(G,!1).break(A)})))}}};Rk.default=VB0});var wk=z((Ok)=>{Object.defineProperty(Ok,"__esModule",{value:!0});var RG=t(),UB0=z0(),LB0=VJ(),AB0={message:"must be equal to constant",params:({schemaCode:D})=>RG._`{allowedValue: ${D}}`},MB0={keyword:"const",$data:!0,error:AB0,code(D){let{gen:F,data:$,$data:J,schemaCode:Q,schema:Y}=D;if(J||Y&&typeof Y=="object")D.fail$data(RG._`!${(0,UB0.useFunc)(F,LB0.default)}(${$}, ${Q})`);else D.fail(RG._`${Y} !== ${$}`)}};Ok.default=MB0});var Tk=z((jk)=>{Object.defineProperty(jk,"__esModule",{value:!0});var B9=t(),RB0=z0(),CB0=VJ(),OB0={message:"must be equal to one of the allowed values",params:({schemaCode:D})=>B9._`{allowedValues: ${D}}`},wB0={keyword:"enum",schemaType:"array",$data:!0,error:OB0,code(D){let{gen:F,data:$,$data:J,schema:Q,schemaCode:Y,it:B}=D;if(!J&&Q.length===0)throw Error("enum must have non-empty array");let X=Q.length>=B.opts.loopEnum,G,H=()=>G!==null&&G!==void 0?G:G=(0,RB0.useFunc)(F,CB0.default),q;if(X||J)q=F.let("valid"),D.block$data(q,K);else{if(!Array.isArray(Q))throw Error("ajv implementation error");let E=F.const("vSchema",Y);q=(0,B9.or)(...Q.map((Z,L)=>V(E,L)))}D.pass(q);function K(){F.assign(q,!1),F.forOf("v",Y,(E)=>F.if(B9._`${H()}(${$}, ${E})`,()=>F.assign(q,!0).break()))}function V(E,Z){let L=Q[Z];return typeof L==="object"&&L!==null?B9._`${H()}(${$}, ${E}[${Z}])`:B9._`${$} === ${L}`}}};jk.default=wB0});var CG=z((Pk)=>{Object.defineProperty(Pk,"__esModule",{value:!0});var TB0=Qk(),PB0=Bk(),IB0=qk(),SB0=zk(),kB0=Vk(),vB0=Uk(),yB0=Ak(),xB0=Ck(),_B0=wk(),fB0=Tk(),gB0=[TB0.default,PB0.default,IB0.default,SB0.default,kB0.default,vB0.default,yB0.default,xB0.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},_B0.default,fB0.default];Pk.default=gB0});var wG=z((Sk)=>{Object.defineProperty(Sk,"__esModule",{value:!0});Sk.validateAdditionalItems=void 0;var R4=t(),OG=z0(),bB0={message:({params:{len:D}})=>R4.str`must NOT have more than ${D} items`,params:({params:{len:D}})=>R4._`{limit: ${D}}`},uB0={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:bB0,code(D){let{parentSchema:F,it:$}=D,{items:J}=F;if(!Array.isArray(J)){(0,OG.checkStrictMode)($,'"additionalItems" is ignored when "items" is not an array of schemas');return}Ik(D,J)}};function Ik(D,F){let{gen:$,schema:J,data:Q,keyword:Y,it:B}=D;B.items=!0;let X=$.const("len",R4._`${Q}.length`);if(J===!1)D.setParams({len:F.length}),D.pass(R4._`${X} <= ${F.length}`);else if(typeof J=="object"&&!(0,OG.alwaysValidSchema)(B,J)){let H=$.var("valid",R4._`${X} <= ${F.length}`);$.if((0,R4.not)(H),()=>G(H)),D.ok(H)}function G(H){$.forRange("i",F.length,X,(q)=>{if(D.subschema({keyword:Y,dataProp:q,dataPropType:OG.Type.Num},H),!B.allErrors)$.if((0,R4.not)(H),()=>$.break())})}}Sk.validateAdditionalItems=Ik;Sk.default=uB0});var jG=z((xk)=>{Object.defineProperty(xk,"__esModule",{value:!0});xk.validateTuple=void 0;var vk=t(),ZJ=z0(),lB0=N1(),pB0={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(D){let{schema:F,it:$}=D;if(Array.isArray(F))return yk(D,"additionalItems",F);if($.items=!0,(0,ZJ.alwaysValidSchema)($,F))return;D.ok((0,lB0.validateArray)(D))}};function yk(D,F,$=D.schema){let{gen:J,parentSchema:Q,data:Y,keyword:B,it:X}=D;if(q(Q),X.opts.unevaluated&&$.length&&X.items!==!0)X.items=ZJ.mergeEvaluated.items(J,$.length,X.items);let G=J.name("valid"),H=J.const("len",vk._`${Y}.length`);$.forEach((K,V)=>{if((0,ZJ.alwaysValidSchema)(X,K))return;J.if(vk._`${H} > ${V}`,()=>D.subschema({keyword:B,schemaProp:V,dataProp:V},G)),D.ok(G)});function q(K){let{opts:V,errSchemaPath:E}=X,Z=$.length,L=Z===K.minItems&&(Z===K.maxItems||K[F]===!1);if(V.strictTuples&&!L){let M=`"${B}" is ${Z}-tuple, but minItems or maxItems/${F} are not specified or different at path "${E}"`;(0,ZJ.checkStrictMode)(X,M,V.strictTuples)}}}xk.validateTuple=yk;xk.default=pB0});var gk=z((fk)=>{Object.defineProperty(fk,"__esModule",{value:!0});var cB0=jG(),nB0={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(D)=>(0,cB0.validateTuple)(D,"items")};fk.default=nB0});var uk=z((bk)=>{Object.defineProperty(bk,"__esModule",{value:!0});var hk=t(),aB0=z0(),oB0=N1(),sB0=wG(),rB0={message:({params:{len:D}})=>hk.str`must NOT have more than ${D} items`,params:({params:{len:D}})=>hk._`{limit: ${D}}`},tB0={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:rB0,code(D){let{schema:F,parentSchema:$,it:J}=D,{prefixItems:Q}=$;if(J.items=!0,(0,aB0.alwaysValidSchema)(J,F))return;if(Q)(0,sB0.validateAdditionalItems)(D,Q);else D.ok((0,oB0.validateArray)(D))}};bk.default=tB0});var lk=z((mk)=>{Object.defineProperty(mk,"__esModule",{value:!0});var R1=t(),UJ=z0(),D20={message:({params:{min:D,max:F}})=>F===void 0?R1.str`must contain at least ${D} valid item(s)`:R1.str`must contain at least ${D} and no more than ${F} valid item(s)`,params:({params:{min:D,max:F}})=>F===void 0?R1._`{minContains: ${D}}`:R1._`{minContains: ${D}, maxContains: ${F}}`},F20={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:D20,code(D){let{gen:F,schema:$,parentSchema:J,data:Q,it:Y}=D,B,X,{minContains:G,maxContains:H}=J;if(Y.opts.next)B=G===void 0?1:G,X=H;else B=1;let q=F.const("len",R1._`${Q}.length`);if(D.setParams({min:B,max:X}),X===void 0&&B===0){(0,UJ.checkStrictMode)(Y,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(X!==void 0&&B>X){(0,UJ.checkStrictMode)(Y,'"minContains" > "maxContains" is always invalid'),D.fail();return}if((0,UJ.alwaysValidSchema)(Y,$)){let L=R1._`${q} >= ${B}`;if(X!==void 0)L=R1._`${L} && ${q} <= ${X}`;D.pass(L);return}Y.items=!0;let K=F.name("valid");if(X===void 0&&B===1)E(K,()=>F.if(K,()=>F.break()));else if(B===0){if(F.let(K,!0),X!==void 0)F.if(R1._`${Q}.length > 0`,V)}else F.let(K,!1),V();D.result(K,()=>D.reset());function V(){let L=F.name("_valid"),M=F.let("count",0);E(L,()=>F.if(L,()=>Z(M)))}function E(L,M){F.forRange("i",0,q,(A)=>{D.subschema({keyword:"contains",dataProp:A,dataPropType:UJ.Type.Num,compositeRule:!0},L),M()})}function Z(L){if(F.code(R1._`${L}++`),X===void 0)F.if(R1._`${L} >= ${B}`,()=>F.assign(K,!0).break());else if(F.if(R1._`${L} > ${X}`,()=>F.assign(K,!1).break()),B===1)F.assign(K,!0);else F.if(R1._`${L} >= ${B}`,()=>F.assign(K,!0))}}};mk.default=F20});var LJ=z((ck)=>{Object.defineProperty(ck,"__esModule",{value:!0});ck.validateSchemaDeps=ck.validatePropertyDeps=ck.error=void 0;var TG=t(),J20=z0(),X9=N1();ck.error={message:({params:{property:D,depsCount:F,deps:$}})=>{let J=F===1?"property":"properties";return TG.str`must have ${J} ${$} when property ${D} is present`},params:({params:{property:D,depsCount:F,deps:$,missingProperty:J}})=>TG._`{property: ${D},
89
89
  missingProperty: ${J},
90
90
  depsCount: ${F},
91
- deps: ${$}}`};var Q20={keyword:"dependencies",type:"object",schemaType:"object",error:ck.error,code(D){let[F,$]=Y20(D);pk(D,F),dk(D,$)}};function Y20({schema:D}){let F={},$={};for(let J in D){if(J==="__proto__")continue;let Q=Array.isArray(D[J])?F:$;Q[J]=D[J]}return[F,$]}function pk(D,F=D.schema){let{gen:$,data:J,it:Q}=D;if(Object.keys(F).length===0)return;let Y=$.let("missing");for(let B in F){let X=F[B];if(X.length===0)continue;let G=(0,X9.propertyInData)($,J,B,Q.opts.ownProperties);if(D.setParams({property:B,depsCount:X.length,deps:X.join(", ")}),Q.allErrors)$.if(G,()=>{for(let H of X)(0,X9.checkReportMissingProp)(D,H)});else $.if(TG._`${G} && (${(0,X9.checkMissingProp)(D,X,Y)})`),(0,X9.reportMissingProp)(D,Y),$.else()}}ck.validatePropertyDeps=pk;function dk(D,F=D.schema){let{gen:$,data:J,keyword:Q,it:Y}=D,B=$.name("valid");for(let X in F){if((0,J20.alwaysValidSchema)(Y,F[X]))continue;$.if((0,X9.propertyInData)($,J,X,Y.opts.ownProperties),()=>{let G=D.subschema({keyword:Q,schemaProp:X},B);D.mergeValidEvaluated(G,B)},()=>$.var(B,!0)),D.ok(B)}}ck.validateSchemaDeps=dk;ck.default=Q20});var sk=z((ok)=>{Object.defineProperty(ok,"__esModule",{value:!0});var ak=t(),G20=z0(),W20={message:"property name must be valid",params:({params:D})=>ak._`{propertyName: ${D.propertyName}}`},H20={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:W20,code(D){let{gen:F,schema:$,data:J,it:Q}=D;if((0,G20.alwaysValidSchema)(Q,$))return;let Y=F.name("valid");F.forIn("key",J,(B)=>{D.setParams({propertyName:B}),D.subschema({keyword:"propertyNames",data:B,dataTypes:["string"],propertyName:B,compositeRule:!0},Y),F.if((0,ak.not)(Y),()=>{if(D.error(!0),!Q.allErrors)F.break()})}),D.ok(Y)}};ok.default=H20});var PG=z((rk)=>{Object.defineProperty(rk,"__esModule",{value:!0});var AJ=N1(),u1=t(),K20=M1(),MJ=z0(),z20={message:"must NOT have additional properties",params:({params:D})=>u1._`{additionalProperty: ${D.additionalProperty}}`},E20={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:z20,code(D){let{gen:F,schema:$,parentSchema:J,data:Q,errsCount:Y,it:B}=D;if(!Y)throw Error("ajv implementation error");let{allErrors:X,opts:G}=B;if(B.props=!0,G.removeAdditional!=="all"&&(0,MJ.alwaysValidSchema)(B,$))return;let H=(0,AJ.allSchemaProperties)(J.properties),q=(0,AJ.allSchemaProperties)(J.patternProperties);K(),D.ok(u1._`${Y} === ${K20.default.errors}`);function K(){F.forIn("key",Q,(A)=>{if(!H.length&&!q.length)Z(A);else F.if(V(A),()=>Z(A))})}function V(A){let M;if(H.length>8){let N=(0,MJ.schemaRefOrVal)(B,J.properties,"properties");M=(0,AJ.isOwnProperty)(F,N,A)}else if(H.length)M=(0,u1.or)(...H.map((N)=>u1._`${A} === ${N}`));else M=u1.nil;if(q.length)M=(0,u1.or)(M,...q.map((N)=>u1._`${(0,AJ.usePattern)(D,N)}.test(${A})`));return(0,u1.not)(M)}function E(A){F.code(u1._`delete ${Q}[${A}]`)}function Z(A){if(G.removeAdditional==="all"||G.removeAdditional&&$===!1){E(A);return}if($===!1){if(D.setParams({additionalProperty:A}),D.error(),!X)F.break();return}if(typeof $=="object"&&!(0,MJ.alwaysValidSchema)(B,$)){let M=F.name("valid");if(G.removeAdditional==="failing")L(A,M,!1),F.if((0,u1.not)(M),()=>{D.reset(),E(A)});else if(L(A,M),!X)F.if((0,u1.not)(M),()=>F.break())}}function L(A,M,N){let w={keyword:"additionalProperties",dataProp:A,dataPropType:MJ.Type.Str};if(N===!1)Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1});D.subschema(w,M)}}};rk.default=E20});var Fv=z((Dv)=>{Object.defineProperty(Dv,"__esModule",{value:!0});var Z20=FF(),tk=N1(),IG=z0(),ek=PG(),U20={keyword:"properties",type:"object",schemaType:"object",code(D){let{gen:F,schema:$,parentSchema:J,data:Q,it:Y}=D;if(Y.opts.removeAdditional==="all"&&J.additionalProperties===void 0)ek.default.code(new Z20.KeywordCxt(Y,ek.default,"additionalProperties"));let B=(0,tk.allSchemaProperties)($);for(let K of B)Y.definedProperties.add(K);if(Y.opts.unevaluated&&B.length&&Y.props!==!0)Y.props=IG.mergeEvaluated.props(F,(0,IG.toHash)(B),Y.props);let X=B.filter((K)=>!(0,IG.alwaysValidSchema)(Y,$[K]));if(X.length===0)return;let G=F.name("valid");for(let K of X){if(H(K))q(K);else{if(F.if((0,tk.propertyInData)(F,Q,K,Y.opts.ownProperties)),q(K),!Y.allErrors)F.else().var(G,!0);F.endIf()}D.it.definedProperties.add(K),D.ok(G)}function H(K){return Y.opts.useDefaults&&!Y.compositeRule&&$[K].default!==void 0}function q(K){D.subschema({keyword:"properties",schemaProp:K,dataProp:K},G)}}};Dv.default=U20});var Bv=z((Yv)=>{Object.defineProperty(Yv,"__esModule",{value:!0});var $v=N1(),NJ=t(),Jv=z0(),Qv=z0(),A20={keyword:"patternProperties",type:"object",schemaType:"object",code(D){let{gen:F,schema:$,data:J,parentSchema:Q,it:Y}=D,{opts:B}=Y,X=(0,$v.allSchemaProperties)($),G=X.filter((L)=>(0,Jv.alwaysValidSchema)(Y,$[L]));if(X.length===0||G.length===X.length&&(!Y.opts.unevaluated||Y.props===!0))return;let H=B.strictSchema&&!B.allowMatchingProperties&&Q.properties,q=F.name("valid");if(Y.props!==!0&&!(Y.props instanceof NJ.Name))Y.props=(0,Qv.evaluatedPropsToName)(F,Y.props);let{props:K}=Y;V();function V(){for(let L of X){if(H)E(L);if(Y.allErrors)Z(L);else F.var(q,!0),Z(L),F.if(q)}}function E(L){for(let A in H)if(new RegExp(L).test(A))(0,Jv.checkStrictMode)(Y,`property ${A} matches pattern ${L} (use allowMatchingProperties)`)}function Z(L){F.forIn("key",J,(A)=>{F.if(NJ._`${(0,$v.usePattern)(D,L)}.test(${A})`,()=>{let M=G.includes(L);if(!M)D.subschema({keyword:"patternProperties",schemaProp:L,dataProp:A,dataPropType:Qv.Type.Str},q);if(Y.opts.unevaluated&&K!==!0)F.assign(NJ._`${K}[${A}]`,!0);else if(!M&&!Y.allErrors)F.if((0,NJ.not)(q),()=>F.break())})})}}};Yv.default=A20});var Gv=z((Xv)=>{Object.defineProperty(Xv,"__esModule",{value:!0});var N20=z0(),R20={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(D){let{gen:F,schema:$,it:J}=D;if((0,N20.alwaysValidSchema)(J,$)){D.fail();return}let Q=F.name("valid");D.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},Q),D.failResult(Q,()=>D.reset(),()=>D.error())},error:{message:"must NOT be valid"}};Xv.default=R20});var Hv=z((Wv)=>{Object.defineProperty(Wv,"__esModule",{value:!0});var O20=N1(),w20={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:O20.validateUnion,error:{message:"must match a schema in anyOf"}};Wv.default=w20});var Kv=z((qv)=>{Object.defineProperty(qv,"__esModule",{value:!0});var RJ=t(),T20=z0(),P20={message:"must match exactly one schema in oneOf",params:({params:D})=>RJ._`{passingSchemas: ${D.passing}}`},I20={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:P20,code(D){let{gen:F,schema:$,parentSchema:J,it:Q}=D;if(!Array.isArray($))throw Error("ajv implementation error");if(Q.opts.discriminator&&J.discriminator)return;let Y=$,B=F.let("valid",!1),X=F.let("passing",null),G=F.name("_valid");D.setParams({passing:X}),F.block(H),D.result(B,()=>D.reset(),()=>D.error(!0));function H(){Y.forEach((q,K)=>{let V;if((0,T20.alwaysValidSchema)(Q,q))F.var(G,!0);else V=D.subschema({keyword:"oneOf",schemaProp:K,compositeRule:!0},G);if(K>0)F.if(RJ._`${G} && ${B}`).assign(B,!1).assign(X,RJ._`[${X}, ${K}]`).else();F.if(G,()=>{if(F.assign(B,!0),F.assign(X,K),V)D.mergeEvaluated(V,RJ.Name)})})}}};qv.default=I20});var Ev=z((zv)=>{Object.defineProperty(zv,"__esModule",{value:!0});var k20=z0(),v20={keyword:"allOf",schemaType:"array",code(D){let{gen:F,schema:$,it:J}=D;if(!Array.isArray($))throw Error("ajv implementation error");let Q=F.name("valid");$.forEach((Y,B)=>{if((0,k20.alwaysValidSchema)(J,Y))return;let X=D.subschema({keyword:"allOf",schemaProp:B},Q);D.ok(Q),D.mergeEvaluated(X)})}};zv.default=v20});var Lv=z((Uv)=>{Object.defineProperty(Uv,"__esModule",{value:!0});var CJ=t(),Zv=z0(),x20={message:({params:D})=>CJ.str`must match "${D.ifClause}" schema`,params:({params:D})=>CJ._`{failingKeyword: ${D.ifClause}}`},_20={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:x20,code(D){let{gen:F,parentSchema:$,it:J}=D;if($.then===void 0&&$.else===void 0)(0,Zv.checkStrictMode)(J,'"if" without "then" and "else" is ignored');let Q=Vv(J,"then"),Y=Vv(J,"else");if(!Q&&!Y)return;let B=F.let("valid",!0),X=F.name("_valid");if(G(),D.reset(),Q&&Y){let q=F.let("ifClause");D.setParams({ifClause:q}),F.if(X,H("then",q),H("else",q))}else if(Q)F.if(X,H("then"));else F.if((0,CJ.not)(X),H("else"));D.pass(B,()=>D.error(!0));function G(){let q=D.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},X);D.mergeEvaluated(q)}function H(q,K){return()=>{let V=D.subschema({keyword:q},X);if(F.assign(B,X),D.mergeValidEvaluated(V,B),K)F.assign(K,CJ._`${q}`);else D.setParams({ifClause:q})}}}};function Vv(D,F){let $=D.schema[F];return $!==void 0&&!(0,Zv.alwaysValidSchema)(D,$)}Uv.default=_20});var Mv=z((Av)=>{Object.defineProperty(Av,"__esModule",{value:!0});var g20=z0(),h20={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:D,parentSchema:F,it:$}){if(F.if===void 0)(0,g20.checkStrictMode)($,`"${D}" without "if" is ignored`)}};Av.default=h20});var SG=z((Nv)=>{Object.defineProperty(Nv,"__esModule",{value:!0});var u20=wG(),m20=gk(),l20=jG(),p20=uk(),d20=lk(),c20=LJ(),n20=sk(),i20=PG(),a20=Fv(),o20=Bv(),s20=Gv(),r20=Hv(),t20=Kv(),e20=Ev(),DX0=Lv(),FX0=Mv();function $X0(D=!1){let F=[s20.default,r20.default,t20.default,e20.default,DX0.default,FX0.default,n20.default,i20.default,c20.default,a20.default,o20.default];if(D)F.push(m20.default,p20.default);else F.push(u20.default,l20.default);return F.push(d20.default),F}Nv.default=$X0});var vG=z((Ov)=>{Object.defineProperty(Ov,"__esModule",{value:!0});Ov.dynamicAnchor=void 0;var kG=t(),QX0=M1(),Rv=r5(),YX0=qJ(),BX0={keyword:"$dynamicAnchor",schemaType:"string",code:(D)=>Cv(D,D.schema)};function Cv(D,F){let{gen:$,it:J}=D;J.schemaEnv.root.dynamicAnchors[F]=!0;let Q=kG._`${QX0.default.dynamicAnchors}${(0,kG.getProperty)(F)}`,Y=J.errSchemaPath==="#"?J.validateName:XX0(D);$.if(kG._`!${Q}`,()=>$.assign(Q,Y))}Ov.dynamicAnchor=Cv;function XX0(D){let{schemaEnv:F,schema:$,self:J}=D.it,{root:Q,baseId:Y,localRefs:B,meta:X}=F.root,{schemaId:G}=J.opts,H=new Rv.SchemaEnv({schema:$,schemaId:G,root:Q,baseId:Y,localRefs:B,meta:X});return Rv.compileSchema.call(J,H),(0,YX0.getValidate)(D,H)}Ov.default=BX0});var yG=z((Iv)=>{Object.defineProperty(Iv,"__esModule",{value:!0});Iv.dynamicRef=void 0;var jv=t(),WX0=M1(),Tv=qJ(),HX0={keyword:"$dynamicRef",schemaType:"string",code:(D)=>Pv(D,D.schema)};function Pv(D,F){let{gen:$,keyword:J,it:Q}=D;if(F[0]!=="#")throw Error(`"${J}" only supports hash fragment reference`);let Y=F.slice(1);if(Q.allErrors)B();else{let G=$.let("valid",!1);B(G),D.ok(G)}function B(G){if(Q.schemaEnv.root.dynamicAnchors[Y]){let H=$.let("_v",jv._`${WX0.default.dynamicAnchors}${(0,jv.getProperty)(Y)}`);$.if(H,X(H,G),X(Q.validateName,G))}else X(Q.validateName,G)()}function X(G,H){return H?()=>$.block(()=>{(0,Tv.callRef)(D,G),$.let(H,!0)}):()=>(0,Tv.callRef)(D,G)}}Iv.dynamicRef=Pv;Iv.default=HX0});var vv=z((kv)=>{Object.defineProperty(kv,"__esModule",{value:!0});var KX0=vG(),zX0=z0(),EX0={keyword:"$recursiveAnchor",schemaType:"boolean",code(D){if(D.schema)(0,KX0.dynamicAnchor)(D,"");else(0,zX0.checkStrictMode)(D.it,"$recursiveAnchor: false is ignored")}};kv.default=EX0});var xv=z((yv)=>{Object.defineProperty(yv,"__esModule",{value:!0});var ZX0=yG(),UX0={keyword:"$recursiveRef",schemaType:"string",code:(D)=>(0,ZX0.dynamicRef)(D,D.schema)};yv.default=UX0});var fv=z((_v)=>{Object.defineProperty(_v,"__esModule",{value:!0});var AX0=vG(),MX0=yG(),NX0=vv(),RX0=xv(),CX0=[AX0.default,MX0.default,NX0.default,RX0.default];_v.default=CX0});var bv=z((hv)=>{Object.defineProperty(hv,"__esModule",{value:!0});var gv=LJ(),wX0={keyword:"dependentRequired",type:"object",schemaType:"object",error:gv.error,code:(D)=>(0,gv.validatePropertyDeps)(D)};hv.default=wX0});var mv=z((uv)=>{Object.defineProperty(uv,"__esModule",{value:!0});var TX0=LJ(),PX0={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(D)=>(0,TX0.validateSchemaDeps)(D)};uv.default=PX0});var pv=z((lv)=>{Object.defineProperty(lv,"__esModule",{value:!0});var SX0=z0(),kX0={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:D,parentSchema:F,it:$}){if(F.contains===void 0)(0,SX0.checkStrictMode)($,`"${D}" without "contains" is ignored`)}};lv.default=kX0});var cv=z((dv)=>{Object.defineProperty(dv,"__esModule",{value:!0});var yX0=bv(),xX0=mv(),_X0=pv(),fX0=[yX0.default,xX0.default,_X0.default];dv.default=fX0});var av=z((iv)=>{Object.defineProperty(iv,"__esModule",{value:!0});var b6=t(),nv=z0(),hX0=M1(),bX0={message:"must NOT have unevaluated properties",params:({params:D})=>b6._`{unevaluatedProperty: ${D.unevaluatedProperty}}`},uX0={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:bX0,code(D){let{gen:F,schema:$,data:J,errsCount:Q,it:Y}=D;if(!Q)throw Error("ajv implementation error");let{allErrors:B,props:X}=Y;if(X instanceof b6.Name)F.if(b6._`${X} !== true`,()=>F.forIn("key",J,(K)=>F.if(H(X,K),()=>G(K))));else if(X!==!0)F.forIn("key",J,(K)=>X===void 0?G(K):F.if(q(X,K),()=>G(K)));Y.props=!0,D.ok(b6._`${Q} === ${hX0.default.errors}`);function G(K){if($===!1){if(D.setParams({unevaluatedProperty:K}),D.error(),!B)F.break();return}if(!(0,nv.alwaysValidSchema)(Y,$)){let V=F.name("valid");if(D.subschema({keyword:"unevaluatedProperties",dataProp:K,dataPropType:nv.Type.Str},V),!B)F.if((0,b6.not)(V),()=>F.break())}}function H(K,V){return b6._`!${K} || !${K}[${V}]`}function q(K,V){let E=[];for(let Z in K)if(K[Z]===!0)E.push(b6._`${V} !== ${Z}`);return(0,b6.and)(...E)}}};iv.default=uX0});var rv=z((sv)=>{Object.defineProperty(sv,"__esModule",{value:!0});var C4=t(),ov=z0(),lX0={message:({params:{len:D}})=>C4.str`must NOT have more than ${D} items`,params:({params:{len:D}})=>C4._`{limit: ${D}}`},pX0={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:lX0,code(D){let{gen:F,schema:$,data:J,it:Q}=D,Y=Q.items||0;if(Y===!0)return;let B=F.const("len",C4._`${J}.length`);if($===!1)D.setParams({len:Y}),D.fail(C4._`${B} > ${Y}`);else if(typeof $=="object"&&!(0,ov.alwaysValidSchema)(Q,$)){let G=F.var("valid",C4._`${B} <= ${Y}`);F.if((0,C4.not)(G),()=>X(G,Y)),D.ok(G)}Q.items=!0;function X(G,H){F.forRange("i",H,B,(q)=>{if(D.subschema({keyword:"unevaluatedItems",dataProp:q,dataPropType:ov.Type.Num},G),!Q.allErrors)F.if((0,C4.not)(G),()=>F.break())})}}};sv.default=pX0});var ev=z((tv)=>{Object.defineProperty(tv,"__esModule",{value:!0});var cX0=av(),nX0=rv(),iX0=[cX0.default,nX0.default];tv.default=iX0});var Fy=z((Dy)=>{Object.defineProperty(Dy,"__esModule",{value:!0});var $D=t(),oX0={message:({schemaCode:D})=>$D.str`must match format "${D}"`,params:({schemaCode:D})=>$D._`{format: ${D}}`},sX0={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:oX0,code(D,F){let{gen:$,data:J,$data:Q,schema:Y,schemaCode:B,it:X}=D,{opts:G,errSchemaPath:H,schemaEnv:q,self:K}=X;if(!G.validateFormats)return;if(Q)V();else E();function V(){let Z=$.scopeValue("formats",{ref:K.formats,code:G.code.formats}),L=$.const("fDef",$D._`${Z}[${B}]`),A=$.let("fType"),M=$.let("format");$.if($D._`typeof ${L} == "object" && !(${L} instanceof RegExp)`,()=>$.assign(A,$D._`${L}.type || "string"`).assign(M,$D._`${L}.validate`),()=>$.assign(A,$D._`"string"`).assign(M,L)),D.fail$data((0,$D.or)(N(),w()));function N(){if(G.strictSchema===!1)return $D.nil;return $D._`${B} && !${M}`}function w(){let P=q.$async?$D._`(${L}.async ? await ${M}(${J}) : ${M}(${J}))`:$D._`${M}(${J})`,C=$D._`(typeof ${M} == "function" ? ${P} : ${M}.test(${J}))`;return $D._`${M} && ${M} !== true && ${A} === ${F} && !${C}`}}function E(){let Z=K.formats[Y];if(!Z){N();return}if(Z===!0)return;let[L,A,M]=w(Z);if(L===F)D.pass(P());function N(){if(G.strictSchema===!1){K.logger.warn(C());return}throw Error(C());function C(){return`unknown format "${Y}" ignored in schema at path "${H}"`}}function w(C){let T=C instanceof RegExp?(0,$D.regexpCode)(C):G.code.formats?$D._`${G.code.formats}${(0,$D.getProperty)(Y)}`:void 0,y=$.scopeValue("formats",{key:Y,ref:C,code:T});if(typeof C=="object"&&!(C instanceof RegExp))return[C.type||"string",C.validate,$D._`${y}.validate`];return["string",C,y]}function P(){if(typeof Z=="object"&&!(Z instanceof RegExp)&&Z.async){if(!q.$async)throw Error("async format in sync schema");return $D._`await ${M}(${J})`}return typeof A=="function"?$D._`${M}(${J})`:$D._`${M}.test(${J})`}}}};Dy.default=sX0});var xG=z(($y)=>{Object.defineProperty($y,"__esModule",{value:!0});var tX0=Fy(),eX0=[tX0.default];$y.default=eX0});var _G=z((Jy)=>{Object.defineProperty(Jy,"__esModule",{value:!0});Jy.contentVocabulary=Jy.metadataVocabulary=void 0;Jy.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Jy.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Xy=z((By)=>{Object.defineProperty(By,"__esModule",{value:!0});var $G0=MG(),JG0=CG(),QG0=SG(),YG0=fv(),BG0=cv(),XG0=ev(),GG0=xG(),Yy=_G(),WG0=[YG0.default,$G0.default,JG0.default,(0,QG0.default)(!0),GG0.default,Yy.metadataVocabulary,Yy.contentVocabulary,BG0.default,XG0.default];By.default=WG0});var qy=z((Wy)=>{Object.defineProperty(Wy,"__esModule",{value:!0});Wy.DiscrError=void 0;var Gy;(function(D){D.Tag="tag",D.Mapping="mapping"})(Gy||(Wy.DiscrError=Gy={}))});var gG=z((zy)=>{Object.defineProperty(zy,"__esModule",{value:!0});var YF=t(),fG=qy(),Ky=r5(),qG0=$F(),KG0=z0(),zG0={message:({params:{discrError:D,tagName:F}})=>D===fG.DiscrError.Tag?`tag "${F}" must be string`:`value of tag "${F}" must be in oneOf`,params:({params:{discrError:D,tag:F,tagName:$}})=>YF._`{error: ${D}, tag: ${$}, tagValue: ${F}}`},EG0={keyword:"discriminator",type:"object",schemaType:"object",error:zG0,code(D){let{gen:F,data:$,schema:J,parentSchema:Q,it:Y}=D,{oneOf:B}=Q;if(!Y.opts.discriminator)throw Error("discriminator: requires discriminator option");let X=J.propertyName;if(typeof X!="string")throw Error("discriminator: requires propertyName");if(J.mapping)throw Error("discriminator: mapping is not supported");if(!B)throw Error("discriminator: requires oneOf keyword");let G=F.let("valid",!1),H=F.const("tag",YF._`${$}${(0,YF.getProperty)(X)}`);F.if(YF._`typeof ${H} == "string"`,()=>q(),()=>D.error(!1,{discrError:fG.DiscrError.Tag,tag:H,tagName:X})),D.ok(G);function q(){let E=V();F.if(!1);for(let Z in E)F.elseIf(YF._`${H} === ${Z}`),F.assign(G,K(E[Z]));F.else(),D.error(!1,{discrError:fG.DiscrError.Mapping,tag:H,tagName:X}),F.endIf()}function K(E){let Z=F.name("valid"),L=D.subschema({keyword:"oneOf",schemaProp:E},Z);return D.mergeEvaluated(L,YF.Name),Z}function V(){var E;let Z={},L=M(Q),A=!0;for(let P=0;P<B.length;P++){let C=B[P];if((C===null||C===void 0?void 0:C.$ref)&&!(0,KG0.schemaHasRulesButRef)(C,Y.self.RULES)){let y=C.$ref;if(C=Ky.resolveRef.call(Y.self,Y.schemaEnv.root,Y.baseId,y),C instanceof Ky.SchemaEnv)C=C.schema;if(C===void 0)throw new qG0.default(Y.opts.uriResolver,Y.baseId,y)}let T=(E=C===null||C===void 0?void 0:C.properties)===null||E===void 0?void 0:E[X];if(typeof T!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${X}"`);A=A&&(L||M(C)),N(T,P)}if(!A)throw Error(`discriminator: "${X}" must be required`);return Z;function M({required:P}){return Array.isArray(P)&&P.includes(X)}function N(P,C){if(P.const)w(P.const,C);else if(P.enum)for(let T of P.enum)w(T,C);else throw Error(`discriminator: "properties/${X}" must have "const" or "enum"`)}function w(P,C){if(typeof P!="string"||P in Z)throw Error(`discriminator: "${X}" values must be unique strings`);Z[P]=C}}}};zy.default=EG0});var Ey=z((DP0,ZG0)=>{ZG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var Vy=z((FP0,UG0)=>{UG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var Zy=z(($P0,LG0)=>{LG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var Uy=z((JP0,AG0)=>{AG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var Ly=z((QP0,MG0)=>{MG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var Ay=z((YP0,NG0)=>{NG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var My=z((BP0,RG0)=>{RG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var Ny=z((XP0,CG0)=>{CG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var Cy=z((Ry)=>{Object.defineProperty(Ry,"__esModule",{value:!0});var OG0=Ey(),wG0=Vy(),jG0=Zy(),TG0=Uy(),PG0=Ly(),IG0=Ay(),SG0=My(),kG0=Ny(),vG0=["/properties"];function yG0(D){return[OG0,wG0,jG0,TG0,PG0,F(this,IG0),SG0,F(this,kG0)].forEach(($)=>this.addMetaSchema($,void 0,!1)),this;function F($,J){return D?$.$dataMetaSchema(J,vG0):J}}Ry.default=yG0});var Oy=z((rD,bG)=>{Object.defineProperty(rD,"__esModule",{value:!0});rD.MissingRefError=rD.ValidationError=rD.CodeGen=rD.Name=rD.nil=rD.stringify=rD.str=rD._=rD.KeywordCxt=rD.Ajv2020=void 0;var _G0=AG(),fG0=Xy(),gG0=gG(),hG0=Cy(),hG="https://json-schema.org/draft/2020-12/schema";class G9 extends _G0.default{constructor(D={}){super({...D,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),fG0.default.forEach((D)=>this.addVocabulary(D)),this.opts.discriminator)this.addKeyword(gG0.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:D,meta:F}=this.opts;if(!F)return;hG0.default.call(this,D),this.refs["http://json-schema.org/schema"]=hG}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(hG)?hG:void 0)}}rD.Ajv2020=G9;bG.exports=rD=G9;bG.exports.Ajv2020=G9;Object.defineProperty(rD,"__esModule",{value:!0});rD.default=G9;var bG0=FF();Object.defineProperty(rD,"KeywordCxt",{enumerable:!0,get:function(){return bG0.KeywordCxt}});var BF=t();Object.defineProperty(rD,"_",{enumerable:!0,get:function(){return BF._}});Object.defineProperty(rD,"str",{enumerable:!0,get:function(){return BF.str}});Object.defineProperty(rD,"stringify",{enumerable:!0,get:function(){return BF.stringify}});Object.defineProperty(rD,"nil",{enumerable:!0,get:function(){return BF.nil}});Object.defineProperty(rD,"Name",{enumerable:!0,get:function(){return BF.Name}});Object.defineProperty(rD,"CodeGen",{enumerable:!0,get:function(){return BF.CodeGen}});var uG0=o5();Object.defineProperty(rD,"ValidationError",{enumerable:!0,get:function(){return uG0.default}});var mG0=$F();Object.defineProperty(rD,"MissingRefError",{enumerable:!0,get:function(){return mG0.default}})});var xy=z((vy)=>{Object.defineProperty(vy,"__esModule",{value:!0});vy.formatNames=vy.fastFormats=vy.fullFormats=void 0;function A8(D,F){return{validate:D,compare:F}}vy.fullFormats={date:A8(Py,pG),time:A8(mG(!0),dG),"date-time":A8(wy(!0),Sy),"iso-time":A8(mG(),Iy),"iso-date-time":A8(wy(),ky),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:oG0,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:$W0,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:sG0,int32:{type:"number",validate:eG0},int64:{type:"number",validate:DW0},float:{type:"number",validate:Ty},double:{type:"number",validate:Ty},password:!0,binary:!0};vy.fastFormats={...vy.fullFormats,date:A8(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,pG),time:A8(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,dG),"date-time":A8(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Sy),"iso-time":A8(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Iy),"iso-date-time":A8(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ky),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};vy.formatNames=Object.keys(vy.fullFormats);function dG0(D){return D%4===0&&(D%100!==0||D%400===0)}var cG0=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,nG0=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Py(D){let F=cG0.exec(D);if(!F)return!1;let $=+F[1],J=+F[2],Q=+F[3];return J>=1&&J<=12&&Q>=1&&Q<=(J===2&&dG0($)?29:nG0[J])}function pG(D,F){if(!(D&&F))return;if(D>F)return 1;if(D<F)return-1;return 0}var uG=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function mG(D){return function($){let J=uG.exec($);if(!J)return!1;let Q=+J[1],Y=+J[2],B=+J[3],X=J[4],G=J[5]==="-"?-1:1,H=+(J[6]||0),q=+(J[7]||0);if(H>23||q>59||D&&!X)return!1;if(Q<=23&&Y<=59&&B<60)return!0;let K=Y-q*G,V=Q-H*G-(K<0?1:0);return(V===23||V===-1)&&(K===59||K===-1)&&B<61}}function dG(D,F){if(!(D&&F))return;let $=new Date("2020-01-01T"+D).valueOf(),J=new Date("2020-01-01T"+F).valueOf();if(!($&&J))return;return $-J}function Iy(D,F){if(!(D&&F))return;let $=uG.exec(D),J=uG.exec(F);if(!($&&J))return;if(D=$[1]+$[2]+$[3],F=J[1]+J[2]+J[3],D>F)return 1;if(D<F)return-1;return 0}var lG=/t|\s/i;function wy(D){let F=mG(D);return function(J){let Q=J.split(lG);return Q.length===2&&Py(Q[0])&&F(Q[1])}}function Sy(D,F){if(!(D&&F))return;let $=new Date(D).valueOf(),J=new Date(F).valueOf();if(!($&&J))return;return $-J}function ky(D,F){if(!(D&&F))return;let[$,J]=D.split(lG),[Q,Y]=F.split(lG),B=pG($,Q);if(B===void 0)return;return B||dG(J,Y)}var iG0=/\/|:/,aG0=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function oG0(D){return iG0.test(D)&&aG0.test(D)}var jy=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function sG0(D){return jy.lastIndex=0,jy.test(D)}var rG0=-2147483648,tG0=2147483647;function eG0(D){return Number.isInteger(D)&&D<=tG0&&D>=rG0}function DW0(D){return Number.isInteger(D)}function Ty(){return!0}var FW0=/[^\\]\\Z/;function $W0(D){if(FW0.test(D))return!1;try{return new RegExp(D),!0}catch(F){return!1}}});var gy=z((fy)=>{Object.defineProperty(fy,"__esModule",{value:!0});var QW0=MG(),YW0=CG(),BW0=SG(),XW0=xG(),_y=_G(),GW0=[QW0.default,YW0.default,(0,BW0.default)(),XW0.default,_y.metadataVocabulary,_y.contentVocabulary];fy.default=GW0});var hy=z((AP0,HW0)=>{HW0.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 uy=z((tD,nG)=>{Object.defineProperty(tD,"__esModule",{value:!0});tD.MissingRefError=tD.ValidationError=tD.CodeGen=tD.Name=tD.nil=tD.stringify=tD.str=tD._=tD.KeywordCxt=tD.Ajv=void 0;var qW0=AG(),KW0=gy(),zW0=gG(),by=hy(),EW0=["/properties"],OJ="http://json-schema.org/draft-07/schema";class W9 extends qW0.default{_addVocabularies(){if(super._addVocabularies(),KW0.default.forEach((D)=>this.addVocabulary(D)),this.opts.discriminator)this.addKeyword(zW0.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let D=this.opts.$data?this.$dataMetaSchema(by,EW0):by;this.addMetaSchema(D,OJ,!1),this.refs["http://json-schema.org/schema"]=OJ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(OJ)?OJ:void 0)}}tD.Ajv=W9;nG.exports=tD=W9;nG.exports.Ajv=W9;Object.defineProperty(tD,"__esModule",{value:!0});tD.default=W9;var VW0=FF();Object.defineProperty(tD,"KeywordCxt",{enumerable:!0,get:function(){return VW0.KeywordCxt}});var XF=t();Object.defineProperty(tD,"_",{enumerable:!0,get:function(){return XF._}});Object.defineProperty(tD,"str",{enumerable:!0,get:function(){return XF.str}});Object.defineProperty(tD,"stringify",{enumerable:!0,get:function(){return XF.stringify}});Object.defineProperty(tD,"nil",{enumerable:!0,get:function(){return XF.nil}});Object.defineProperty(tD,"Name",{enumerable:!0,get:function(){return XF.Name}});Object.defineProperty(tD,"CodeGen",{enumerable:!0,get:function(){return XF.CodeGen}});var ZW0=o5();Object.defineProperty(tD,"ValidationError",{enumerable:!0,get:function(){return ZW0.default}});var UW0=$F();Object.defineProperty(tD,"MissingRefError",{enumerable:!0,get:function(){return UW0.default}})});var ly=z((my)=>{Object.defineProperty(my,"__esModule",{value:!0});my.formatLimitDefinition=void 0;var MW0=uy(),m1=t(),u6=m1.operators,wJ={formatMaximum:{okStr:"<=",ok:u6.LTE,fail:u6.GT},formatMinimum:{okStr:">=",ok:u6.GTE,fail:u6.LT},formatExclusiveMaximum:{okStr:"<",ok:u6.LT,fail:u6.GTE},formatExclusiveMinimum:{okStr:">",ok:u6.GT,fail:u6.LTE}},NW0={message:({keyword:D,schemaCode:F})=>m1.str`should be ${wJ[D].okStr} ${F}`,params:({keyword:D,schemaCode:F})=>m1._`{comparison: ${wJ[D].okStr}, limit: ${F}}`};my.formatLimitDefinition={keyword:Object.keys(wJ),type:"string",schemaType:"string",$data:!0,error:NW0,code(D){let{gen:F,data:$,schemaCode:J,keyword:Q,it:Y}=D,{opts:B,self:X}=Y;if(!B.validateFormats)return;let G=new MW0.KeywordCxt(Y,X.RULES.all.format.definition,"format");if(G.$data)H();else q();function H(){let V=F.scopeValue("formats",{ref:X.formats,code:B.code.formats}),E=F.const("fmt",m1._`${V}[${G.schemaCode}]`);D.fail$data((0,m1.or)(m1._`typeof ${E} != "object"`,m1._`${E} instanceof RegExp`,m1._`typeof ${E}.compare != "function"`,K(E)))}function q(){let V=G.schema,E=X.formats[V];if(!E||E===!0)return;if(typeof E!="object"||E instanceof RegExp||typeof E.compare!="function")throw Error(`"${Q}": format "${V}" does not define "compare" function`);let Z=F.scopeValue("formats",{key:V,ref:E,code:B.code.formats?m1._`${B.code.formats}${(0,m1.getProperty)(V)}`:void 0});D.fail$data(K(Z))}function K(V){return m1._`${V}.compare(${$}, ${J}) ${wJ[Q].fail} 0`}},dependencies:["format"]};var RW0=(D)=>{return D.addKeyword(my.formatLimitDefinition),D};my.default=RW0});var ny=z((H9,cy)=>{Object.defineProperty(H9,"__esModule",{value:!0});var GF=xy(),OW0=ly(),aG=t(),py=new aG.Name("fullFormats"),wW0=new aG.Name("fastFormats"),oG=(D,F={keywords:!0})=>{if(Array.isArray(F))return dy(D,F,GF.fullFormats,py),D;let[$,J]=F.mode==="fast"?[GF.fastFormats,wW0]:[GF.fullFormats,py],Q=F.formats||GF.formatNames;if(dy(D,Q,$,J),F.keywords)(0,OW0.default)(D);return D};oG.get=(D,F="full")=>{let J=(F==="fast"?GF.fastFormats:GF.fullFormats)[D];if(!J)throw Error(`Unknown format "${D}"`);return J};function dy(D,F,$,J){var Q,Y;(Q=(Y=D.opts.code).formats)!==null&&Q!==void 0||(Y.formats=aG._`require("ajv-formats/dist/formats").${J}`);for(let B of F)D.addFormat(B,$[B])}cy.exports=H9=oG;Object.defineProperty(H9,"__esModule",{value:!0});H9.default=oG});var jW0=(D,F={})=>{if(typeof D!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof D}\``);let{wait:$=0,maxWait:J=Number.POSITIVE_INFINITY,before:Q=!1,after:Y=!0}=F;if($<0||J<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!Q&&!Y)throw Error("Both `before` and `after` are false, function wouldn't be called.");let B,X,G,H=function(...q){let K=this,V=()=>{if(B=void 0,X)clearTimeout(X),X=void 0;if(Y)G=D.apply(K,q)},E=()=>{if(X=void 0,B)clearTimeout(B),B=void 0;if(Y)G=D.apply(K,q)},Z=Q&&!B;if(clearTimeout(B),B=setTimeout(V,$),J>0&&J!==Number.POSITIVE_INFINITY&&!X)X=setTimeout(E,J);if(Z)G=D.apply(K,q);return G};return x5(H,D),H.cancel=()=>{if(B)clearTimeout(B),B=void 0;if(X)clearTimeout(X),X=void 0},H},sG;var iy=I(()=>{BX();sG=jW0});var q9=z((kP0,ay)=>{var TW0=Number.MAX_SAFE_INTEGER||9007199254740991,PW0=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ay.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:TW0,RELEASE_TYPES:PW0,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var K9=z((vP0,oy)=>{var IW0=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...D)=>console.error("SEMVER",...D):()=>{};oy.exports=IW0});var WF=z((M8,sy)=>{var{MAX_SAFE_COMPONENT_LENGTH:rG,MAX_SAFE_BUILD_LENGTH:SW0,MAX_LENGTH:kW0}=q9(),vW0=K9();M8=sy.exports={};var yW0=M8.re=[],xW0=M8.safeRe=[],_=M8.src=[],_W0=M8.safeSrc=[],f=M8.t={},fW0=0,tG="[a-zA-Z0-9-]",gW0=[["\\s",1],["\\d",kW0],[tG,SW0]],hW0=(D)=>{for(let[F,$]of gW0)D=D.split(`${F}*`).join(`${F}{0,${$}}`).split(`${F}+`).join(`${F}{1,${$}}`);return D},$0=(D,F,$)=>{let J=hW0(F),Q=fW0++;vW0(D,Q,F),f[D]=Q,_[Q]=F,_W0[Q]=J,yW0[Q]=new RegExp(F,$?"g":void 0),xW0[Q]=new RegExp(J,$?"g":void 0)};$0("NUMERICIDENTIFIER","0|[1-9]\\d*");$0("NUMERICIDENTIFIERLOOSE","\\d+");$0("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${tG}*`);$0("MAINVERSION",`(${_[f.NUMERICIDENTIFIER]})\\.(${_[f.NUMERICIDENTIFIER]})\\.(${_[f.NUMERICIDENTIFIER]})`);$0("MAINVERSIONLOOSE",`(${_[f.NUMERICIDENTIFIERLOOSE]})\\.(${_[f.NUMERICIDENTIFIERLOOSE]})\\.(${_[f.NUMERICIDENTIFIERLOOSE]})`);$0("PRERELEASEIDENTIFIER",`(?:${_[f.NONNUMERICIDENTIFIER]}|${_[f.NUMERICIDENTIFIER]})`);$0("PRERELEASEIDENTIFIERLOOSE",`(?:${_[f.NONNUMERICIDENTIFIER]}|${_[f.NUMERICIDENTIFIERLOOSE]})`);$0("PRERELEASE",`(?:-(${_[f.PRERELEASEIDENTIFIER]}(?:\\.${_[f.PRERELEASEIDENTIFIER]})*))`);$0("PRERELEASELOOSE",`(?:-?(${_[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${_[f.PRERELEASEIDENTIFIERLOOSE]})*))`);$0("BUILDIDENTIFIER",`${tG}+`);$0("BUILD",`(?:\\+(${_[f.BUILDIDENTIFIER]}(?:\\.${_[f.BUILDIDENTIFIER]})*))`);$0("FULLPLAIN",`v?${_[f.MAINVERSION]}${_[f.PRERELEASE]}?${_[f.BUILD]}?`);$0("FULL",`^${_[f.FULLPLAIN]}$`);$0("LOOSEPLAIN",`[v=\\s]*${_[f.MAINVERSIONLOOSE]}${_[f.PRERELEASELOOSE]}?${_[f.BUILD]}?`);$0("LOOSE",`^${_[f.LOOSEPLAIN]}$`);$0("GTLT","((?:<|>)?=?)");$0("XRANGEIDENTIFIERLOOSE",`${_[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);$0("XRANGEIDENTIFIER",`${_[f.NUMERICIDENTIFIER]}|x|X|\\*`);$0("XRANGEPLAIN",`[v=\\s]*(${_[f.XRANGEIDENTIFIER]})(?:\\.(${_[f.XRANGEIDENTIFIER]})(?:\\.(${_[f.XRANGEIDENTIFIER]})(?:${_[f.PRERELEASE]})?${_[f.BUILD]}?)?)?`);$0("XRANGEPLAINLOOSE",`[v=\\s]*(${_[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${_[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${_[f.XRANGEIDENTIFIERLOOSE]})(?:${_[f.PRERELEASELOOSE]})?${_[f.BUILD]}?)?)?`);$0("XRANGE",`^${_[f.GTLT]}\\s*${_[f.XRANGEPLAIN]}$`);$0("XRANGELOOSE",`^${_[f.GTLT]}\\s*${_[f.XRANGEPLAINLOOSE]}$`);$0("COERCEPLAIN",`(^|[^\\d])(\\d{1,${rG}})(?:\\.(\\d{1,${rG}}))?(?:\\.(\\d{1,${rG}}))?`);$0("COERCE",`${_[f.COERCEPLAIN]}(?:$|[^\\d])`);$0("COERCEFULL",_[f.COERCEPLAIN]+`(?:${_[f.PRERELEASE]})?(?:${_[f.BUILD]})?(?:$|[^\\d])`);$0("COERCERTL",_[f.COERCE],!0);$0("COERCERTLFULL",_[f.COERCEFULL],!0);$0("LONETILDE","(?:~>?)");$0("TILDETRIM",`(\\s*)${_[f.LONETILDE]}\\s+`,!0);M8.tildeTrimReplace="$1~";$0("TILDE",`^${_[f.LONETILDE]}${_[f.XRANGEPLAIN]}$`);$0("TILDELOOSE",`^${_[f.LONETILDE]}${_[f.XRANGEPLAINLOOSE]}$`);$0("LONECARET","(?:\\^)");$0("CARETTRIM",`(\\s*)${_[f.LONECARET]}\\s+`,!0);M8.caretTrimReplace="$1^";$0("CARET",`^${_[f.LONECARET]}${_[f.XRANGEPLAIN]}$`);$0("CARETLOOSE",`^${_[f.LONECARET]}${_[f.XRANGEPLAINLOOSE]}$`);$0("COMPARATORLOOSE",`^${_[f.GTLT]}\\s*(${_[f.LOOSEPLAIN]})$|^$`);$0("COMPARATOR",`^${_[f.GTLT]}\\s*(${_[f.FULLPLAIN]})$|^$`);$0("COMPARATORTRIM",`(\\s*)${_[f.GTLT]}\\s*(${_[f.LOOSEPLAIN]}|${_[f.XRANGEPLAIN]})`,!0);M8.comparatorTrimReplace="$1$2$3";$0("HYPHENRANGE",`^\\s*(${_[f.XRANGEPLAIN]})\\s+-\\s+(${_[f.XRANGEPLAIN]})\\s*$`);$0("HYPHENRANGELOOSE",`^\\s*(${_[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${_[f.XRANGEPLAINLOOSE]})\\s*$`);$0("STAR","(<|>)?=?\\s*\\*");$0("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");$0("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var jJ=z((yP0,ry)=>{var bW0=Object.freeze({loose:!0}),uW0=Object.freeze({}),mW0=(D)=>{if(!D)return uW0;if(typeof D!=="object")return bW0;return D};ry.exports=mW0});var eG=z((xP0,Dx)=>{var ty=/^[0-9]+$/,ey=(D,F)=>{if(typeof D==="number"&&typeof F==="number")return D===F?0:D<F?-1:1;let $=ty.test(D),J=ty.test(F);if($&&J)D=+D,F=+F;return D===F?0:$&&!J?-1:J&&!$?1:D<F?-1:1},lW0=(D,F)=>ey(F,D);Dx.exports={compareIdentifiers:ey,rcompareIdentifiers:lW0}});var PD=z((_P0,$x)=>{var TJ=K9(),{MAX_LENGTH:Fx,MAX_SAFE_INTEGER:PJ}=q9(),{safeRe:IJ,t:SJ}=WF(),pW0=jJ(),{compareIdentifiers:DW}=eG();class l1{constructor(D,F){if(F=pW0(F),D instanceof l1)if(D.loose===!!F.loose&&D.includePrerelease===!!F.includePrerelease)return D;else D=D.version;else if(typeof D!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof D}".`);if(D.length>Fx)throw TypeError(`version is longer than ${Fx} characters`);TJ("SemVer",D,F),this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease;let $=D.trim().match(F.loose?IJ[SJ.LOOSE]:IJ[SJ.FULL]);if(!$)throw TypeError(`Invalid Version: ${D}`);if(this.raw=D,this.major=+$[1],this.minor=+$[2],this.patch=+$[3],this.major>PJ||this.major<0)throw TypeError("Invalid major version");if(this.minor>PJ||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>PJ||this.patch<0)throw TypeError("Invalid patch version");if(!$[4])this.prerelease=[];else this.prerelease=$[4].split(".").map((J)=>{if(/^[0-9]+$/.test(J)){let Q=+J;if(Q>=0&&Q<PJ)return Q}return J});this.build=$[5]?$[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(D){if(TJ("SemVer.compare",this.version,this.options,D),!(D instanceof l1)){if(typeof D==="string"&&D===this.version)return 0;D=new l1(D,this.options)}if(D.version===this.version)return 0;return this.compareMain(D)||this.comparePre(D)}compareMain(D){if(!(D instanceof l1))D=new l1(D,this.options);if(this.major<D.major)return-1;if(this.major>D.major)return 1;if(this.minor<D.minor)return-1;if(this.minor>D.minor)return 1;if(this.patch<D.patch)return-1;if(this.patch>D.patch)return 1;return 0}comparePre(D){if(!(D instanceof l1))D=new l1(D,this.options);if(this.prerelease.length&&!D.prerelease.length)return-1;else if(!this.prerelease.length&&D.prerelease.length)return 1;else if(!this.prerelease.length&&!D.prerelease.length)return 0;let F=0;do{let $=this.prerelease[F],J=D.prerelease[F];if(TJ("prerelease compare",F,$,J),$===void 0&&J===void 0)return 0;else if(J===void 0)return 1;else if($===void 0)return-1;else if($===J)continue;else return DW($,J)}while(++F)}compareBuild(D){if(!(D instanceof l1))D=new l1(D,this.options);let F=0;do{let $=this.build[F],J=D.build[F];if(TJ("build compare",F,$,J),$===void 0&&J===void 0)return 0;else if(J===void 0)return 1;else if($===void 0)return-1;else if($===J)continue;else return DW($,J)}while(++F)}inc(D,F,$){if(D.startsWith("pre")){if(!F&&$===!1)throw Error("invalid increment argument: identifier is empty");if(F){let J=`-${F}`.match(this.options.loose?IJ[SJ.PRERELEASELOOSE]:IJ[SJ.PRERELEASE]);if(!J||J[1]!==F)throw Error(`invalid identifier: ${F}`)}}switch(D){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",F,$);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",F,$);break;case"prepatch":this.prerelease.length=0,this.inc("patch",F,$),this.inc("pre",F,$);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",F,$);this.inc("pre",F,$);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let J=Number($)?1:0;if(this.prerelease.length===0)this.prerelease=[J];else{let Q=this.prerelease.length;while(--Q>=0)if(typeof this.prerelease[Q]==="number")this.prerelease[Q]++,Q=-2;if(Q===-1){if(F===this.prerelease.join(".")&&$===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(J)}}if(F){let Q=[F,J];if($===!1)Q=[F];if(DW(this.prerelease[0],F)===0){if(isNaN(this.prerelease[1]))this.prerelease=Q}else this.prerelease=Q}break}default:throw Error(`invalid increment argument: ${D}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}$x.exports=l1});var O4=z((fP0,Qx)=>{var Jx=PD(),dW0=(D,F,$=!1)=>{if(D instanceof Jx)return D;try{return new Jx(D,F)}catch(J){if(!$)return null;throw J}};Qx.exports=dW0});var Bx=z((gP0,Yx)=>{var cW0=O4(),nW0=(D,F)=>{let $=cW0(D,F);return $?$.version:null};Yx.exports=nW0});var Gx=z((hP0,Xx)=>{var iW0=O4(),aW0=(D,F)=>{let $=iW0(D.trim().replace(/^[=v]+/,""),F);return $?$.version:null};Xx.exports=aW0});var qx=z((bP0,Hx)=>{var Wx=PD(),oW0=(D,F,$,J,Q)=>{if(typeof $==="string")Q=J,J=$,$=void 0;try{return new Wx(D instanceof Wx?D.version:D,$).inc(F,J,Q).version}catch(Y){return null}};Hx.exports=oW0});var Ex=z((uP0,zx)=>{var Kx=O4(),sW0=(D,F)=>{let $=Kx(D,null,!0),J=Kx(F,null,!0),Q=$.compare(J);if(Q===0)return null;let Y=Q>0,B=Y?$:J,X=Y?J:$,G=!!B.prerelease.length;if(!!X.prerelease.length&&!G){if(!X.patch&&!X.minor)return"major";if(X.compareMain(B)===0){if(X.minor&&!X.patch)return"minor";return"patch"}}let q=G?"pre":"";if($.major!==J.major)return q+"major";if($.minor!==J.minor)return q+"minor";if($.patch!==J.patch)return q+"patch";return"prerelease"};zx.exports=sW0});var Zx=z((mP0,Vx)=>{var rW0=PD(),tW0=(D,F)=>new rW0(D,F).major;Vx.exports=tW0});var Lx=z((lP0,Ux)=>{var eW0=PD(),DH0=(D,F)=>new eW0(D,F).minor;Ux.exports=DH0});var Mx=z((pP0,Ax)=>{var FH0=PD(),$H0=(D,F)=>new FH0(D,F).patch;Ax.exports=$H0});var Rx=z((dP0,Nx)=>{var JH0=O4(),QH0=(D,F)=>{let $=JH0(D,F);return $&&$.prerelease.length?$.prerelease:null};Nx.exports=QH0});var C1=z((cP0,Ox)=>{var Cx=PD(),YH0=(D,F,$)=>new Cx(D,$).compare(new Cx(F,$));Ox.exports=YH0});var jx=z((nP0,wx)=>{var BH0=C1(),XH0=(D,F,$)=>BH0(F,D,$);wx.exports=XH0});var Px=z((iP0,Tx)=>{var GH0=C1(),WH0=(D,F)=>GH0(D,F,!0);Tx.exports=WH0});var kJ=z((aP0,Sx)=>{var Ix=PD(),HH0=(D,F,$)=>{let J=new Ix(D,$),Q=new Ix(F,$);return J.compare(Q)||J.compareBuild(Q)};Sx.exports=HH0});var vx=z((oP0,kx)=>{var qH0=kJ(),KH0=(D,F)=>D.sort(($,J)=>qH0($,J,F));kx.exports=KH0});var xx=z((sP0,yx)=>{var zH0=kJ(),EH0=(D,F)=>D.sort(($,J)=>zH0(J,$,F));yx.exports=EH0});var z9=z((rP0,_x)=>{var VH0=C1(),ZH0=(D,F,$)=>VH0(D,F,$)>0;_x.exports=ZH0});var vJ=z((tP0,fx)=>{var UH0=C1(),LH0=(D,F,$)=>UH0(D,F,$)<0;fx.exports=LH0});var FW=z((eP0,gx)=>{var AH0=C1(),MH0=(D,F,$)=>AH0(D,F,$)===0;gx.exports=MH0});var $W=z((DI0,hx)=>{var NH0=C1(),RH0=(D,F,$)=>NH0(D,F,$)!==0;hx.exports=RH0});var yJ=z((FI0,bx)=>{var CH0=C1(),OH0=(D,F,$)=>CH0(D,F,$)>=0;bx.exports=OH0});var xJ=z(($I0,ux)=>{var wH0=C1(),jH0=(D,F,$)=>wH0(D,F,$)<=0;ux.exports=jH0});var JW=z((JI0,mx)=>{var TH0=FW(),PH0=$W(),IH0=z9(),SH0=yJ(),kH0=vJ(),vH0=xJ(),yH0=(D,F,$,J)=>{switch(F){case"===":if(typeof D==="object")D=D.version;if(typeof $==="object")$=$.version;return D===$;case"!==":if(typeof D==="object")D=D.version;if(typeof $==="object")$=$.version;return D!==$;case"":case"=":case"==":return TH0(D,$,J);case"!=":return PH0(D,$,J);case">":return IH0(D,$,J);case">=":return SH0(D,$,J);case"<":return kH0(D,$,J);case"<=":return vH0(D,$,J);default:throw TypeError(`Invalid operator: ${F}`)}};mx.exports=yH0});var px=z((QI0,lx)=>{var xH0=PD(),_H0=O4(),{safeRe:_J,t:fJ}=WF(),fH0=(D,F)=>{if(D instanceof xH0)return D;if(typeof D==="number")D=String(D);if(typeof D!=="string")return null;F=F||{};let $=null;if(!F.rtl)$=D.match(F.includePrerelease?_J[fJ.COERCEFULL]:_J[fJ.COERCE]);else{let G=F.includePrerelease?_J[fJ.COERCERTLFULL]:_J[fJ.COERCERTL],H;while((H=G.exec(D))&&(!$||$.index+$[0].length!==D.length)){if(!$||H.index+H[0].length!==$.index+$[0].length)$=H;G.lastIndex=H.index+H[1].length+H[2].length}G.lastIndex=-1}if($===null)return null;let J=$[2],Q=$[3]||"0",Y=$[4]||"0",B=F.includePrerelease&&$[5]?`-${$[5]}`:"",X=F.includePrerelease&&$[6]?`+${$[6]}`:"";return _H0(`${J}.${Q}.${Y}${B}${X}`,F)};lx.exports=fH0});var nx=z((YI0,cx)=>{class dx{constructor(){this.max=1000,this.map=new Map}get(D){let F=this.map.get(D);if(F===void 0)return;else return this.map.delete(D),this.map.set(D,F),F}delete(D){return this.map.delete(D)}set(D,F){if(!this.delete(D)&&F!==void 0){if(this.map.size>=this.max){let J=this.map.keys().next().value;this.delete(J)}this.map.set(D,F)}return this}}cx.exports=dx});var O1=z((BI0,sx)=>{var gH0=/\s+/g;class E9{constructor(D,F){if(F=bH0(F),D instanceof E9)if(D.loose===!!F.loose&&D.includePrerelease===!!F.includePrerelease)return D;else return new E9(D.raw,F);if(D instanceof QW)return this.raw=D.value,this.set=[[D]],this.formatted=void 0,this;if(this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease,this.raw=D.trim().replace(gH0," "),this.set=this.raw.split("||").map(($)=>this.parseRange($.trim())).filter(($)=>$.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let $=this.set[0];if(this.set=this.set.filter((J)=>!ax(J[0])),this.set.length===0)this.set=[$];else if(this.set.length>1){for(let J of this.set)if(J.length===1&&nH0(J[0])){this.set=[J];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let D=0;D<this.set.length;D++){if(D>0)this.formatted+="||";let F=this.set[D];for(let $=0;$<F.length;$++){if($>0)this.formatted+=" ";this.formatted+=F[$].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(D){let $=((this.options.includePrerelease&&dH0)|(this.options.loose&&cH0))+":"+D,J=ix.get($);if(J)return J;let Q=this.options.loose,Y=Q?hD[ID.HYPHENRANGELOOSE]:hD[ID.HYPHENRANGE];D=D.replace(Y,$q0(this.options.includePrerelease)),m0("hyphen replace",D),D=D.replace(hD[ID.COMPARATORTRIM],mH0),m0("comparator trim",D),D=D.replace(hD[ID.TILDETRIM],lH0),m0("tilde trim",D),D=D.replace(hD[ID.CARETTRIM],pH0),m0("caret trim",D);let B=D.split(" ").map((q)=>iH0(q,this.options)).join(" ").split(/\s+/).map((q)=>Fq0(q,this.options));if(Q)B=B.filter((q)=>{return m0("loose invalid filter",q,this.options),!!q.match(hD[ID.COMPARATORLOOSE])});m0("range list",B);let X=new Map,G=B.map((q)=>new QW(q,this.options));for(let q of G){if(ax(q))return[q];X.set(q.value,q)}if(X.size>1&&X.has(""))X.delete("");let H=[...X.values()];return ix.set($,H),H}intersects(D,F){if(!(D instanceof E9))throw TypeError("a Range is required");return this.set.some(($)=>{return ox($,F)&&D.set.some((J)=>{return ox(J,F)&&$.every((Q)=>{return J.every((Y)=>{return Q.intersects(Y,F)})})})})}test(D){if(!D)return!1;if(typeof D==="string")try{D=new uH0(D,this.options)}catch(F){return!1}for(let F=0;F<this.set.length;F++)if(Jq0(this.set[F],D,this.options))return!0;return!1}}sx.exports=E9;var hH0=nx(),ix=new hH0,bH0=jJ(),QW=V9(),m0=K9(),uH0=PD(),{safeRe:hD,t:ID,comparatorTrimReplace:mH0,tildeTrimReplace:lH0,caretTrimReplace:pH0}=WF(),{FLAG_INCLUDE_PRERELEASE:dH0,FLAG_LOOSE:cH0}=q9(),ax=(D)=>D.value==="<0.0.0-0",nH0=(D)=>D.value==="",ox=(D,F)=>{let $=!0,J=D.slice(),Q=J.pop();while($&&J.length)$=J.every((Y)=>{return Q.intersects(Y,F)}),Q=J.pop();return $},iH0=(D,F)=>{return D=D.replace(hD[ID.BUILD],""),m0("comp",D,F),D=sH0(D,F),m0("caret",D),D=aH0(D,F),m0("tildes",D),D=tH0(D,F),m0("xrange",D),D=Dq0(D,F),m0("stars",D),D},bD=(D)=>!D||D.toLowerCase()==="x"||D==="*",aH0=(D,F)=>{return D.trim().split(/\s+/).map(($)=>oH0($,F)).join(" ")},oH0=(D,F)=>{let $=F.loose?hD[ID.TILDELOOSE]:hD[ID.TILDE];return D.replace($,(J,Q,Y,B,X)=>{m0("tilde",D,J,Q,Y,B,X);let G;if(bD(Q))G="";else if(bD(Y))G=`>=${Q}.0.0 <${+Q+1}.0.0-0`;else if(bD(B))G=`>=${Q}.${Y}.0 <${Q}.${+Y+1}.0-0`;else if(X)m0("replaceTilde pr",X),G=`>=${Q}.${Y}.${B}-${X} <${Q}.${+Y+1}.0-0`;else G=`>=${Q}.${Y}.${B} <${Q}.${+Y+1}.0-0`;return m0("tilde return",G),G})},sH0=(D,F)=>{return D.trim().split(/\s+/).map(($)=>rH0($,F)).join(" ")},rH0=(D,F)=>{m0("caret",D,F);let $=F.loose?hD[ID.CARETLOOSE]:hD[ID.CARET],J=F.includePrerelease?"-0":"";return D.replace($,(Q,Y,B,X,G)=>{m0("caret",D,Q,Y,B,X,G);let H;if(bD(Y))H="";else if(bD(B))H=`>=${Y}.0.0${J} <${+Y+1}.0.0-0`;else if(bD(X))if(Y==="0")H=`>=${Y}.${B}.0${J} <${Y}.${+B+1}.0-0`;else H=`>=${Y}.${B}.0${J} <${+Y+1}.0.0-0`;else if(G)if(m0("replaceCaret pr",G),Y==="0")if(B==="0")H=`>=${Y}.${B}.${X}-${G} <${Y}.${B}.${+X+1}-0`;else H=`>=${Y}.${B}.${X}-${G} <${Y}.${+B+1}.0-0`;else H=`>=${Y}.${B}.${X}-${G} <${+Y+1}.0.0-0`;else if(m0("no pr"),Y==="0")if(B==="0")H=`>=${Y}.${B}.${X}${J} <${Y}.${B}.${+X+1}-0`;else H=`>=${Y}.${B}.${X}${J} <${Y}.${+B+1}.0-0`;else H=`>=${Y}.${B}.${X} <${+Y+1}.0.0-0`;return m0("caret return",H),H})},tH0=(D,F)=>{return m0("replaceXRanges",D,F),D.split(/\s+/).map(($)=>eH0($,F)).join(" ")},eH0=(D,F)=>{D=D.trim();let $=F.loose?hD[ID.XRANGELOOSE]:hD[ID.XRANGE];return D.replace($,(J,Q,Y,B,X,G)=>{m0("xRange",D,J,Q,Y,B,X,G);let H=bD(Y),q=H||bD(B),K=q||bD(X),V=K;if(Q==="="&&V)Q="";if(G=F.includePrerelease?"-0":"",H)if(Q===">"||Q==="<")J="<0.0.0-0";else J="*";else if(Q&&V){if(q)B=0;if(X=0,Q===">")if(Q=">=",q)Y=+Y+1,B=0,X=0;else B=+B+1,X=0;else if(Q==="<=")if(Q="<",q)Y=+Y+1;else B=+B+1;if(Q==="<")G="-0";J=`${Q+Y}.${B}.${X}${G}`}else if(q)J=`>=${Y}.0.0${G} <${+Y+1}.0.0-0`;else if(K)J=`>=${Y}.${B}.0${G} <${Y}.${+B+1}.0-0`;return m0("xRange return",J),J})},Dq0=(D,F)=>{return m0("replaceStars",D,F),D.trim().replace(hD[ID.STAR],"")},Fq0=(D,F)=>{return m0("replaceGTE0",D,F),D.trim().replace(hD[F.includePrerelease?ID.GTE0PRE:ID.GTE0],"")},$q0=(D)=>(F,$,J,Q,Y,B,X,G,H,q,K,V)=>{if(bD(J))$="";else if(bD(Q))$=`>=${J}.0.0${D?"-0":""}`;else if(bD(Y))$=`>=${J}.${Q}.0${D?"-0":""}`;else if(B)$=`>=${$}`;else $=`>=${$}${D?"-0":""}`;if(bD(H))G="";else if(bD(q))G=`<${+H+1}.0.0-0`;else if(bD(K))G=`<${H}.${+q+1}.0-0`;else if(V)G=`<=${H}.${q}.${K}-${V}`;else if(D)G=`<${H}.${q}.${+K+1}-0`;else G=`<=${G}`;return`${$} ${G}`.trim()},Jq0=(D,F,$)=>{for(let J=0;J<D.length;J++)if(!D[J].test(F))return!1;if(F.prerelease.length&&!$.includePrerelease){for(let J=0;J<D.length;J++){if(m0(D[J].semver),D[J].semver===QW.ANY)continue;if(D[J].semver.prerelease.length>0){let Q=D[J].semver;if(Q.major===F.major&&Q.minor===F.minor&&Q.patch===F.patch)return!0}}return!1}return!0}});var V9=z((XI0,$_)=>{var Z9=Symbol("SemVer ANY");class gJ{static get ANY(){return Z9}constructor(D,F){if(F=rx(F),D instanceof gJ)if(D.loose===!!F.loose)return D;else D=D.value;if(D=D.trim().split(/\s+/).join(" "),BW("comparator",D,F),this.options=F,this.loose=!!F.loose,this.parse(D),this.semver===Z9)this.value="";else this.value=this.operator+this.semver.version;BW("comp",this)}parse(D){let F=this.options.loose?tx[ex.COMPARATORLOOSE]:tx[ex.COMPARATOR],$=D.match(F);if(!$)throw TypeError(`Invalid comparator: ${D}`);if(this.operator=$[1]!==void 0?$[1]:"",this.operator==="=")this.operator="";if(!$[2])this.semver=Z9;else this.semver=new D_($[2],this.options.loose)}toString(){return this.value}test(D){if(BW("Comparator.test",D,this.options.loose),this.semver===Z9||D===Z9)return!0;if(typeof D==="string")try{D=new D_(D,this.options)}catch(F){return!1}return YW(D,this.operator,this.semver,this.options)}intersects(D,F){if(!(D instanceof gJ))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new F_(D.value,F).test(this.value)}else if(D.operator===""){if(D.value==="")return!0;return new F_(this.value,F).test(D.semver)}if(F=rx(F),F.includePrerelease&&(this.value==="<0.0.0-0"||D.value==="<0.0.0-0"))return!1;if(!F.includePrerelease&&(this.value.startsWith("<0.0.0")||D.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&D.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&D.operator.startsWith("<"))return!0;if(this.semver.version===D.semver.version&&this.operator.includes("=")&&D.operator.includes("="))return!0;if(YW(this.semver,"<",D.semver,F)&&this.operator.startsWith(">")&&D.operator.startsWith("<"))return!0;if(YW(this.semver,">",D.semver,F)&&this.operator.startsWith("<")&&D.operator.startsWith(">"))return!0;return!1}}$_.exports=gJ;var rx=jJ(),{safeRe:tx,t:ex}=WF(),YW=JW(),BW=K9(),D_=PD(),F_=O1()});var U9=z((GI0,J_)=>{var Qq0=O1(),Yq0=(D,F,$)=>{try{F=new Qq0(F,$)}catch(J){return!1}return F.test(D)};J_.exports=Yq0});var Y_=z((WI0,Q_)=>{var Bq0=O1(),Xq0=(D,F)=>new Bq0(D,F).set.map(($)=>$.map((J)=>J.value).join(" ").trim().split(" "));Q_.exports=Xq0});var X_=z((HI0,B_)=>{var Gq0=PD(),Wq0=O1(),Hq0=(D,F,$)=>{let J=null,Q=null,Y=null;try{Y=new Wq0(F,$)}catch(B){return null}return D.forEach((B)=>{if(Y.test(B)){if(!J||Q.compare(B)===-1)J=B,Q=new Gq0(J,$)}}),J};B_.exports=Hq0});var W_=z((qI0,G_)=>{var qq0=PD(),Kq0=O1(),zq0=(D,F,$)=>{let J=null,Q=null,Y=null;try{Y=new Kq0(F,$)}catch(B){return null}return D.forEach((B)=>{if(Y.test(B)){if(!J||Q.compare(B)===1)J=B,Q=new qq0(J,$)}}),J};G_.exports=zq0});var K_=z((KI0,q_)=>{var XW=PD(),Eq0=O1(),H_=z9(),Vq0=(D,F)=>{D=new Eq0(D,F);let $=new XW("0.0.0");if(D.test($))return $;if($=new XW("0.0.0-0"),D.test($))return $;$=null;for(let J=0;J<D.set.length;++J){let Q=D.set[J],Y=null;if(Q.forEach((B)=>{let X=new XW(B.semver.version);switch(B.operator){case">":if(X.prerelease.length===0)X.patch++;else X.prerelease.push(0);X.raw=X.format();case"":case">=":if(!Y||H_(X,Y))Y=X;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${B.operator}`)}}),Y&&(!$||H_($,Y)))$=Y}if($&&D.test($))return $;return null};q_.exports=Vq0});var E_=z((zI0,z_)=>{var Zq0=O1(),Uq0=(D,F)=>{try{return new Zq0(D,F).range||"*"}catch($){return null}};z_.exports=Uq0});var hJ=z((EI0,L_)=>{var Lq0=PD(),U_=V9(),{ANY:Aq0}=U_,Mq0=O1(),Nq0=U9(),V_=z9(),Z_=vJ(),Rq0=xJ(),Cq0=yJ(),Oq0=(D,F,$,J)=>{D=new Lq0(D,J),F=new Mq0(F,J);let Q,Y,B,X,G;switch($){case">":Q=V_,Y=Rq0,B=Z_,X=">",G=">=";break;case"<":Q=Z_,Y=Cq0,B=V_,X="<",G="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Nq0(D,F,J))return!1;for(let H=0;H<F.set.length;++H){let q=F.set[H],K=null,V=null;if(q.forEach((E)=>{if(E.semver===Aq0)E=new U_(">=0.0.0");if(K=K||E,V=V||E,Q(E.semver,K.semver,J))K=E;else if(B(E.semver,V.semver,J))V=E}),K.operator===X||K.operator===G)return!1;if((!V.operator||V.operator===X)&&Y(D,V.semver))return!1;else if(V.operator===G&&B(D,V.semver))return!1}return!0};L_.exports=Oq0});var M_=z((VI0,A_)=>{var wq0=hJ(),jq0=(D,F,$)=>wq0(D,F,">",$);A_.exports=jq0});var R_=z((ZI0,N_)=>{var Tq0=hJ(),Pq0=(D,F,$)=>Tq0(D,F,"<",$);N_.exports=Pq0});var w_=z((UI0,O_)=>{var C_=O1(),Iq0=(D,F,$)=>{return D=new C_(D,$),F=new C_(F,$),D.intersects(F,$)};O_.exports=Iq0});var T_=z((LI0,j_)=>{var Sq0=U9(),kq0=C1();j_.exports=(D,F,$)=>{let J=[],Q=null,Y=null,B=D.sort((q,K)=>kq0(q,K,$));for(let q of B)if(Sq0(q,F,$)){if(Y=q,!Q)Q=q}else{if(Y)J.push([Q,Y]);Y=null,Q=null}if(Q)J.push([Q,null]);let X=[];for(let[q,K]of J)if(q===K)X.push(q);else if(!K&&q===B[0])X.push("*");else if(!K)X.push(`>=${q}`);else if(q===B[0])X.push(`<=${K}`);else X.push(`${q} - ${K}`);let G=X.join(" || "),H=typeof F.raw==="string"?F.raw:String(F);return G.length<H.length?G:F}});var y_=z((AI0,v_)=>{var P_=O1(),WW=V9(),{ANY:GW}=WW,L9=U9(),HW=C1(),vq0=(D,F,$={})=>{if(D===F)return!0;D=new P_(D,$),F=new P_(F,$);let J=!1;D:for(let Q of D.set){for(let Y of F.set){let B=xq0(Q,Y,$);if(J=J||B!==null,B)continue D}if(J)return!1}return!0},yq0=[new WW(">=0.0.0-0")],I_=[new WW(">=0.0.0")],xq0=(D,F,$)=>{if(D===F)return!0;if(D.length===1&&D[0].semver===GW)if(F.length===1&&F[0].semver===GW)return!0;else if($.includePrerelease)D=yq0;else D=I_;if(F.length===1&&F[0].semver===GW)if($.includePrerelease)return!0;else F=I_;let J=new Set,Q,Y;for(let E of D)if(E.operator===">"||E.operator===">=")Q=S_(Q,E,$);else if(E.operator==="<"||E.operator==="<=")Y=k_(Y,E,$);else J.add(E.semver);if(J.size>1)return null;let B;if(Q&&Y){if(B=HW(Q.semver,Y.semver,$),B>0)return null;else if(B===0&&(Q.operator!==">="||Y.operator!=="<="))return null}for(let E of J){if(Q&&!L9(E,String(Q),$))return null;if(Y&&!L9(E,String(Y),$))return null;for(let Z of F)if(!L9(E,String(Z),$))return!1;return!0}let X,G,H,q,K=Y&&!$.includePrerelease&&Y.semver.prerelease.length?Y.semver:!1,V=Q&&!$.includePrerelease&&Q.semver.prerelease.length?Q.semver:!1;if(K&&K.prerelease.length===1&&Y.operator==="<"&&K.prerelease[0]===0)K=!1;for(let E of F){if(q=q||E.operator===">"||E.operator===">=",H=H||E.operator==="<"||E.operator==="<=",Q){if(V){if(E.semver.prerelease&&E.semver.prerelease.length&&E.semver.major===V.major&&E.semver.minor===V.minor&&E.semver.patch===V.patch)V=!1}if(E.operator===">"||E.operator===">="){if(X=S_(Q,E,$),X===E&&X!==Q)return!1}else if(Q.operator===">="&&!L9(Q.semver,String(E),$))return!1}if(Y){if(K){if(E.semver.prerelease&&E.semver.prerelease.length&&E.semver.major===K.major&&E.semver.minor===K.minor&&E.semver.patch===K.patch)K=!1}if(E.operator==="<"||E.operator==="<="){if(G=k_(Y,E,$),G===E&&G!==Y)return!1}else if(Y.operator==="<="&&!L9(Y.semver,String(E),$))return!1}if(!E.operator&&(Y||Q)&&B!==0)return!1}if(Q&&H&&!Y&&B!==0)return!1;if(Y&&q&&!Q&&B!==0)return!1;if(V||K)return!1;return!0},S_=(D,F,$)=>{if(!D)return F;let J=HW(D.semver,F.semver,$);return J>0?D:J<0?F:F.operator===">"&&D.operator===">="?F:D},k_=(D,F,$)=>{if(!D)return F;let J=HW(D.semver,F.semver,$);return J<0?D:J>0?F:F.operator==="<"&&D.operator==="<="?F:D};v_.exports=vq0});var g_=z((MI0,f_)=>{var qW=WF(),x_=q9(),_q0=PD(),__=eG(),fq0=O4(),gq0=Bx(),hq0=Gx(),bq0=qx(),uq0=Ex(),mq0=Zx(),lq0=Lx(),pq0=Mx(),dq0=Rx(),cq0=C1(),nq0=jx(),iq0=Px(),aq0=kJ(),oq0=vx(),sq0=xx(),rq0=z9(),tq0=vJ(),eq0=FW(),DK0=$W(),FK0=yJ(),$K0=xJ(),JK0=JW(),QK0=px(),YK0=V9(),BK0=O1(),XK0=U9(),GK0=Y_(),WK0=X_(),HK0=W_(),qK0=K_(),KK0=E_(),zK0=hJ(),EK0=M_(),VK0=R_(),ZK0=w_(),UK0=T_(),LK0=y_();f_.exports={parse:fq0,valid:gq0,clean:hq0,inc:bq0,diff:uq0,major:mq0,minor:lq0,patch:pq0,prerelease:dq0,compare:cq0,rcompare:nq0,compareLoose:iq0,compareBuild:aq0,sort:oq0,rsort:sq0,gt:rq0,lt:tq0,eq:eq0,neq:DK0,gte:FK0,lte:$K0,cmp:JK0,coerce:QK0,Comparator:YK0,Range:BK0,satisfies:XK0,toComparators:GK0,maxSatisfying:WK0,minSatisfying:HK0,minVersion:qK0,validRange:KK0,outside:zK0,gtr:EK0,ltr:VK0,intersects:ZK0,simplifyRange:UK0,subset:LK0,SemVer:_q0,re:qW.re,src:qW.src,tokens:qW.t,SEMVER_SPEC_VERSION:x_.SEMVER_SPEC_VERSION,RELEASE_TYPES:x_.RELEASE_TYPES,compareIdentifiers:__.compareIdentifiers,rcompareIdentifiers:__.rcompareIdentifiers}});function b_(D,F,$){if(!D)return!1;if(D.constructor===F)return!0;return AK0.call(D)===$}function u_(D){return b_(D,Uint8Array,"[object Uint8Array]")}function MK0(D){return b_(D,ArrayBuffer,"[object ArrayBuffer]")}function NK0(D){return u_(D)||MK0(D)}function RK0(D){if(!u_(D))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof D}\``)}function CK0(D){if(!NK0(D))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof D}\``)}function KW(D,F){if(D.length===0)return new Uint8Array(0);F??=D.reduce((Q,Y)=>Q+Y.length,0);let $=new Uint8Array(F),J=0;for(let Q of D)RK0(Q),$.set(Q,J),J+=Q.length;return $}function zW(D,F="utf8"){return CK0(D),h_[F]??=new globalThis.TextDecoder(F),h_[F].decode(D)}function OK0(D){if(typeof D!=="string")throw TypeError(`Expected \`string\`, got \`${typeof D}\``)}function bJ(D){return OK0(D),wK0.encode(D)}var AK0,h_,wK0,NI0;var m_=I(()=>{AK0=Object.prototype.toString;h_={utf8:new globalThis.TextDecoder("utf8")};wK0=new globalThis.TextEncoder;NI0=Array.from({length:256},(D,F)=>F.toString(16).padStart(2,"0"))});import{isDeepStrictEqual as jK0}from"util";import l_ from"process";import w4 from"fs";import p_ from"path";import A9 from"crypto";import TK0 from"assert";var c_,n_,j4,PK0,d_="aes-256-cbc",HF=()=>Object.create(null),IK0=(D)=>D!==void 0&&D!==null,SK0=(D,F)=>{let $=new Set(["undefined","symbol","function"]),J=typeof F;if($.has(J))throw TypeError(`Setting a value of type \`${J}\` for key \`${D}\` is not allowed as it's not supported by JSON`)},uJ="__internal__",EW,mJ;var i_=I(()=>{DP();$P();vP();iy();m_();c_=s(Oy(),1),n_=s(ny(),1),j4=s(g_(),1),PK0=n_.default.default,EW=`${uJ}.migrations.version`;mJ=class mJ{path;events;#$;#F;#D;#Q={};constructor(D={}){let F={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...D};if(!F.cwd){if(!F.projectName)throw Error("Please specify the `projectName` option.");F.cwd=OX(F.projectName,{suffix:F.projectSuffix}).config}if(this.#D=F,F.schema??F.ajvOptions??F.rootSchema){if(F.schema&&typeof F.schema!=="object")throw TypeError("The `schema` option must be an object.");let Y=new c_.Ajv2020({allErrors:!0,useDefaults:!0,...F.ajvOptions});PK0(Y);let B={...F.rootSchema,type:"object",properties:F.schema};this.#$=Y.compile(B);for(let[X,G]of Object.entries(F.schema??{}))if(G?.default)this.#Q[X]=G.default}if(F.defaults)this.#Q={...this.#Q,...F.defaults};if(F.serialize)this._serialize=F.serialize;if(F.deserialize)this._deserialize=F.deserialize;this.events=new EventTarget,this.#F=F.encryptionKey;let $=F.fileExtension?`.${F.fileExtension}`:"";this.path=p_.resolve(F.cwd,`${F.configName??"config"}${$}`);let J=this.store,Q=Object.assign(HF(),F.defaults,J);if(F.migrations){if(!F.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(F.migrations,F.projectVersion,F.beforeEachMigration)}this._validate(Q);try{TK0.deepEqual(J,Q)}catch{this.store=Q}if(F.watch)this._watch()}get(D,F){if(this.#D.accessPropertiesByDotNotation)return this._get(D,F);let{store:$}=this;return D in $?$[D]:F}set(D,F){if(typeof D!=="string"&&typeof D!=="object")throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof D}`);if(typeof D!=="object"&&F===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(D))throw TypeError(`Please don't use the ${uJ} key, as it's used to manage this module internal operations.`);let{store:$}=this,J=(Q,Y)=>{if(SK0(Q,Y),this.#D.accessPropertiesByDotNotation)NX($,Q,Y);else $[Q]=Y};if(typeof D==="object"){let Q=D;for(let[Y,B]of Object.entries(Q))J(Y,B)}else J(D,F);this.store=$}has(D){if(this.#D.accessPropertiesByDotNotation)return eT(this.store,D);return D in this.store}reset(...D){for(let F of D)if(IK0(this.#Q[F]))this.set(F,this.#Q[F])}delete(D){let{store:F}=this;if(this.#D.accessPropertiesByDotNotation)tT(F,D);else delete F[D];this.store=F}clear(){this.store=HF();for(let D of Object.keys(this.#Q))this.reset(D)}onDidChange(D,F){if(typeof D!=="string")throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof D}`);if(typeof F!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof F}`);return this._handleChange(()=>this.get(D),F)}onDidAnyChange(D){if(typeof D!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof D}`);return this._handleChange(()=>this.store,D)}get size(){return Object.keys(this.store).length}get store(){try{let D=w4.readFileSync(this.path,this.#F?null:"utf8"),F=this._encryptData(D),$=this._deserialize(F);return this._validate($),Object.assign(HF(),$)}catch(D){if(D?.code==="ENOENT")return this._ensureDirectory(),HF();if(this.#D.clearInvalidConfig&&D.name==="SyntaxError")return HF();throw D}}set store(D){this._ensureDirectory(),this._validate(D),this._write(D),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[D,F]of Object.entries(this.store))yield[D,F]}_encryptData(D){if(!this.#F)return typeof D==="string"?D:zW(D);try{let F=D.slice(0,16),$=A9.pbkdf2Sync(this.#F,F.toString(),1e4,32,"sha512"),J=A9.createDecipheriv(d_,$,F),Q=D.slice(17),Y=typeof Q==="string"?bJ(Q):Q;return zW(KW([J.update(Y),J.final()]))}catch{}return D.toString()}_handleChange(D,F){let $=D(),J=()=>{let Q=$,Y=D();if(jK0(Y,Q))return;$=Y,F.call(this,Y,Q)};return this.events.addEventListener("change",J),()=>{this.events.removeEventListener("change",J)}}_deserialize=(D)=>JSON.parse(D);_serialize=(D)=>JSON.stringify(D,void 0,"\t");_validate(D){if(!this.#$)return;if(this.#$(D)||!this.#$.errors)return;let $=this.#$.errors.map(({instancePath:J,message:Q=""})=>`\`${J.slice(1)}\` ${Q}`);throw Error("Config schema violation: "+$.join("; "))}_ensureDirectory(){w4.mkdirSync(p_.dirname(this.path),{recursive:!0})}_write(D){let F=this._serialize(D);if(this.#F){let $=A9.randomBytes(16),J=A9.pbkdf2Sync(this.#F,$.toString(),1e4,32,"sha512"),Q=A9.createCipheriv(d_,J,$);F=KW([$,bJ(":"),Q.update(bJ(F)),Q.final()])}if(l_.env.SNAP)w4.writeFileSync(this.path,F,{mode:this.#D.configFileMode});else try{_X(this.path,F,{mode:this.#D.configFileMode})}catch($){if($?.code==="EXDEV"){w4.writeFileSync(this.path,F,{mode:this.#D.configFileMode});return}throw $}}_watch(){if(this._ensureDirectory(),!w4.existsSync(this.path))this._write(HF());if(l_.platform==="win32")w4.watch(this.path,{persistent:!1},sG(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else w4.watchFile(this.path,{persistent:!1},sG(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(D,F,$){let J=this._get(EW,"0.0.0"),Q=Object.keys(D).filter((B)=>this._shouldPerformMigration(B,J,F)),Y={...this.store};for(let B of Q)try{if($)$(this,{fromVersion:J,toVersion:B,finalVersion:F,versions:Q});let X=D[B];X?.(this),this._set(EW,B),J=B,Y={...this.store}}catch(X){throw this.store=Y,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${X}`)}if(this._isVersionInRangeFormat(J)||!j4.default.eq(J,F))this._set(EW,F)}_containsReservedKey(D){if(typeof D==="object"){if(Object.keys(D)[0]===uJ)return!0}if(typeof D!=="string")return!1;if(this.#D.accessPropertiesByDotNotation){if(D.startsWith(`${uJ}.`))return!0;return!1}return!1}_isVersionInRangeFormat(D){return j4.default.clean(D)===null}_shouldPerformMigration(D,F,$){if(this._isVersionInRangeFormat(D)){if(F!=="0.0.0"&&j4.default.satisfies(F,D))return!1;return j4.default.satisfies($,D)}if(j4.default.lte(D,F))return!1;if(j4.default.gt(D,$))return!1;return!0}_get(D,F){return rT(this.store,D,F)}_set(D,F){let{store:$}=this;NX($,D,F),this.store=$}}});var E0,VW,k,N8=(D)=>{switch(typeof D){case"undefined":return k.undefined;case"string":return k.string;case"number":return Number.isNaN(D)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":if(Array.isArray(D))return k.array;if(D===null)return k.null;if(D.then&&typeof D.then==="function"&&D.catch&&typeof D.catch==="function")return k.promise;if(typeof Map<"u"&&D instanceof Map)return k.map;if(typeof Set<"u"&&D instanceof Set)return k.set;if(typeof Date<"u"&&D instanceof Date)return k.date;return k.object;default:return k.unknown}};var M9=I(()=>{(function(D){D.assertEqual=(Q)=>{};function F(Q){}D.assertIs=F;function $(Q){throw Error()}D.assertNever=$,D.arrayToEnum=(Q)=>{let Y={};for(let B of Q)Y[B]=B;return Y},D.getValidEnumValues=(Q)=>{let Y=D.objectKeys(Q).filter((X)=>typeof Q[Q[X]]!=="number"),B={};for(let X of Y)B[X]=Q[X];return D.objectValues(B)},D.objectValues=(Q)=>{return D.objectKeys(Q).map(function(Y){return Q[Y]})},D.objectKeys=typeof Object.keys==="function"?(Q)=>Object.keys(Q):(Q)=>{let Y=[];for(let B in Q)if(Object.prototype.hasOwnProperty.call(Q,B))Y.push(B);return Y},D.find=(Q,Y)=>{for(let B of Q)if(Y(B))return B;return},D.isInteger=typeof Number.isInteger==="function"?(Q)=>Number.isInteger(Q):(Q)=>typeof Q==="number"&&Number.isFinite(Q)&&Math.floor(Q)===Q;function J(Q,Y=" | "){return Q.map((B)=>typeof B==="string"?`'${B}'`:B).join(Y)}D.joinValues=J,D.jsonStringifyReplacer=(Q,Y)=>{if(typeof Y==="bigint")return Y.toString();return Y}})(E0||(E0={}));(function(D){D.mergeShapes=(F,$)=>{return{...F,...$}}})(VW||(VW={}));k=E0.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var j,kK0=(D)=>{return JSON.stringify(D,null,2).replace(/"([^"]+)":/g,"$1:")},eD;var lJ=I(()=>{M9();j=E0.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);eD=class eD extends Error{get errors(){return this.issues}constructor(D){super();this.issues=[],this.addIssue=($)=>{this.issues=[...this.issues,$]},this.addIssues=($=[])=>{this.issues=[...this.issues,...$]};let F=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,F);else this.__proto__=F;this.name="ZodError",this.issues=D}format(D){let F=D||function(Q){return Q.message},$={_errors:[]},J=(Q)=>{for(let Y of Q.issues)if(Y.code==="invalid_union")Y.unionErrors.map(J);else if(Y.code==="invalid_return_type")J(Y.returnTypeError);else if(Y.code==="invalid_arguments")J(Y.argumentsError);else if(Y.path.length===0)$._errors.push(F(Y));else{let B=$,X=0;while(X<Y.path.length){let G=Y.path[X];if(X!==Y.path.length-1)B[G]=B[G]||{_errors:[]};else B[G]=B[G]||{_errors:[]},B[G]._errors.push(F(Y));B=B[G],X++}}};return J(this),$}static assert(D){if(!(D instanceof eD))throw Error(`Not a ZodError: ${D}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,E0.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(D=(F)=>F.message){let F={},$=[];for(let J of this.issues)if(J.path.length>0){let Q=J.path[0];F[Q]=F[Q]||[],F[Q].push(D(J))}else $.push(D(J));return{formErrors:$,fieldErrors:F}}get formErrors(){return this.flatten()}};eD.create=(D)=>{return new eD(D)}});var vK0=(D,F)=>{let $;switch(D.code){case j.invalid_type:if(D.received===k.undefined)$="Required";else $=`Expected ${D.expected}, received ${D.received}`;break;case j.invalid_literal:$=`Invalid literal value, expected ${JSON.stringify(D.expected,E0.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:$=`Unrecognized key(s) in object: ${E0.joinValues(D.keys,", ")}`;break;case j.invalid_union:$="Invalid input";break;case j.invalid_union_discriminator:$=`Invalid discriminator value. Expected ${E0.joinValues(D.options)}`;break;case j.invalid_enum_value:$=`Invalid enum value. Expected ${E0.joinValues(D.options)}, received '${D.received}'`;break;case j.invalid_arguments:$="Invalid function arguments";break;case j.invalid_return_type:$="Invalid function return type";break;case j.invalid_date:$="Invalid date";break;case j.invalid_string:if(typeof D.validation==="object")if("includes"in D.validation){if($=`Invalid input: must include "${D.validation.includes}"`,typeof D.validation.position==="number")$=`${$} at one or more positions greater than or equal to ${D.validation.position}`}else if("startsWith"in D.validation)$=`Invalid input: must start with "${D.validation.startsWith}"`;else if("endsWith"in D.validation)$=`Invalid input: must end with "${D.validation.endsWith}"`;else E0.assertNever(D.validation);else if(D.validation!=="regex")$=`Invalid ${D.validation}`;else $="Invalid";break;case j.too_small:if(D.type==="array")$=`Array must contain ${D.exact?"exactly":D.inclusive?"at least":"more than"} ${D.minimum} element(s)`;else if(D.type==="string")$=`String must contain ${D.exact?"exactly":D.inclusive?"at least":"over"} ${D.minimum} character(s)`;else if(D.type==="number")$=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="bigint")$=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="date")$=`Date must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(D.minimum))}`;else $="Invalid input";break;case j.too_big:if(D.type==="array")$=`Array must contain ${D.exact?"exactly":D.inclusive?"at most":"less than"} ${D.maximum} element(s)`;else if(D.type==="string")$=`String must contain ${D.exact?"exactly":D.inclusive?"at most":"under"} ${D.maximum} character(s)`;else if(D.type==="number")$=`Number must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="bigint")$=`BigInt must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="date")$=`Date must be ${D.exact?"exactly":D.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(D.maximum))}`;else $="Invalid input";break;case j.custom:$="Invalid input";break;case j.invalid_intersection_types:$="Intersection results could not be merged";break;case j.not_multiple_of:$=`Number must be a multiple of ${D.multipleOf}`;break;case j.not_finite:$="Number must be finite";break;default:$=F.defaultError,E0.assertNever(D)}return{message:$}},d8;var ZW=I(()=>{lJ();M9();d8=vK0});function yK0(D){a_=D}function qF(){return a_}var a_;var pJ=I(()=>{ZW();a_=d8});function v(D,F){let $=qF(),J=N9({issueData:F,data:D.data,path:D.path,errorMaps:[D.common.contextualErrorMap,D.schemaErrorMap,$,$===d8?void 0:d8].filter((Q)=>!!Q)});D.common.issues.push(J)}class ND{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(D,F){let $=[];for(let J of F){if(J.status==="aborted")return i;if(J.status==="dirty")D.dirty();$.push(J.value)}return{status:D.value,value:$}}static async mergeObjectAsync(D,F){let $=[];for(let J of F){let Q=await J.key,Y=await J.value;$.push({key:Q,value:Y})}return ND.mergeObjectSync(D,$)}static mergeObjectSync(D,F){let $={};for(let J of F){let{key:Q,value:Y}=J;if(Q.status==="aborted")return i;if(Y.status==="aborted")return i;if(Q.status==="dirty")D.dirty();if(Y.status==="dirty")D.dirty();if(Q.value!=="__proto__"&&(typeof Y.value<"u"||J.alwaysSet))$[Q.value]=Y.value}return{status:D.value,value:$}}}var N9=(D)=>{let{data:F,path:$,errorMaps:J,issueData:Q}=D,Y=[...$,...Q.path||[]],B={...Q,path:Y};if(Q.message!==void 0)return{...Q,path:Y,message:Q.message};let X="",G=J.filter((H)=>!!H).slice().reverse();for(let H of G)X=H(B,{data:F,defaultError:X}).message;return{...Q,path:Y,message:X}},xK0,i,T4=(D)=>({status:"dirty",value:D}),SD=(D)=>({status:"valid",value:D}),dJ=(D)=>D.status==="aborted",cJ=(D)=>D.status==="dirty",m6=(D)=>D.status==="valid",KF=(D)=>typeof Promise<"u"&&D instanceof Promise;var UW=I(()=>{pJ();ZW();xK0=[];i=Object.freeze({status:"aborted"})});var o_=()=>{};var l;var s_=I(()=>{(function(D){D.errToObj=(F)=>typeof F==="string"?{message:F}:F||{},D.toString=(F)=>typeof F==="string"?F:F?.message})(l||(l={}))});class n1{constructor(D,F,$,J){this._cachedPath=[],this.parent=D,this.data=F,this._path=$,this._key=J}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function B0(D){if(!D)return{};let{errorMap:F,invalid_type_error:$,required_error:J,description:Q}=D;if(F&&($||J))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(F)return{errorMap:F,description:Q};return{errorMap:(B,X)=>{let{message:G}=D;if(B.code==="invalid_enum_value")return{message:G??X.defaultError};if(typeof X.data>"u")return{message:G??J??X.defaultError};if(B.code!=="invalid_type")return{message:X.defaultError};return{message:G??$??X.defaultError}},description:Q}}class H0{get description(){return this._def.description}_getType(D){return N8(D.data)}_getOrReturnCtx(D,F){return F||{common:D.parent.common,data:D.data,parsedType:N8(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}_processInputParams(D){return{status:new ND,ctx:{common:D.parent.common,data:D.data,parsedType:N8(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}}_parseSync(D){let F=this._parse(D);if(KF(F))throw Error("Synchronous parse encountered promise.");return F}_parseAsync(D){let F=this._parse(D);return Promise.resolve(F)}parse(D,F){let $=this.safeParse(D,F);if($.success)return $.data;throw $.error}safeParse(D,F){let $={common:{issues:[],async:F?.async??!1,contextualErrorMap:F?.errorMap},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:N8(D)},J=this._parseSync({data:D,path:$.path,parent:$});return r_($,J)}"~validate"(D){let F={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:N8(D)};if(!this["~standard"].async)try{let $=this._parseSync({data:D,path:[],parent:F});return m6($)?{value:$.value}:{issues:F.common.issues}}catch($){if($?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;F.common={issues:[],async:!0}}return this._parseAsync({data:D,path:[],parent:F}).then(($)=>m6($)?{value:$.value}:{issues:F.common.issues})}async parseAsync(D,F){let $=await this.safeParseAsync(D,F);if($.success)return $.data;throw $.error}async safeParseAsync(D,F){let $={common:{issues:[],contextualErrorMap:F?.errorMap,async:!0},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:N8(D)},J=this._parse({data:D,path:$.path,parent:$}),Q=await(KF(J)?J:Promise.resolve(J));return r_($,Q)}refine(D,F){let $=(J)=>{if(typeof F==="string"||typeof F>"u")return{message:F};else if(typeof F==="function")return F(J);else return F};return this._refinement((J,Q)=>{let Y=D(J),B=()=>Q.addIssue({code:j.custom,...$(J)});if(typeof Promise<"u"&&Y instanceof Promise)return Y.then((X)=>{if(!X)return B(),!1;else return!0});if(!Y)return B(),!1;else return!0})}refinement(D,F){return this._refinement(($,J)=>{if(!D($))return J.addIssue(typeof F==="function"?F($,J):F),!1;else return!0})}_refinement(D){return new i1({schema:this,typeName:a.ZodEffects,effect:{type:"refinement",refinement:D}})}superRefine(D){return this._refinement(D)}constructor(D){this.spa=this.safeParseAsync,this._def=D,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(F)=>this["~validate"](F)}}optional(){return c1.create(this,this._def)}nullable(){return n8.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return d1.create(this)}promise(){return k4.create(this,this._def)}or(D){return LF.create([this,D],this._def)}and(D){return AF.create(this,D,this._def)}transform(D){return new i1({...B0(this._def),schema:this,typeName:a.ZodEffects,effect:{type:"transform",transform:D}})}default(D){let F=typeof D==="function"?D:()=>D;return new CF({...B0(this._def),innerType:this,defaultValue:F,typeName:a.ZodDefault})}brand(){return new iJ({typeName:a.ZodBranded,type:this,...B0(this._def)})}catch(D){let F=typeof D==="function"?D:()=>D;return new OF({...B0(this._def),innerType:this,catchValue:F,typeName:a.ZodCatch})}describe(D){return new this.constructor({...this._def,description:D})}pipe(D){return T9.create(this,D)}readonly(){return wF.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Df(D){let F="[0-5]\\d";if(D.precision)F=`${F}\\.\\d{${D.precision}}`;else if(D.precision==null)F=`${F}(\\.\\d+)?`;let $=D.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${F})${$}`}function rK0(D){return new RegExp(`^${Df(D)}$`)}function Ff(D){let F=`${e_}T${Df(D)}`,$=[];if($.push(D.local?"Z?":"Z"),D.offset)$.push("([+-]\\d{2}:?\\d{2})");return F=`${F}(${$.join("|")})`,new RegExp(`^${F}$`)}function tK0(D,F){if((F==="v4"||!F)&&dK0.test(D))return!0;if((F==="v6"||!F)&&nK0.test(D))return!0;return!1}function eK0(D,F){if(!uK0.test(D))return!1;try{let[$]=D.split(".");if(!$)return!1;let J=$.replace(/-/g,"+").replace(/_/g,"/").padEnd($.length+(4-$.length%4)%4,"="),Q=JSON.parse(atob(J));if(typeof Q!=="object"||Q===null)return!1;if("typ"in Q&&Q?.typ!=="JWT")return!1;if(!Q.alg)return!1;if(F&&Q.alg!==F)return!1;return!0}catch{return!1}}function Dz0(D,F){if((F==="v4"||!F)&&cK0.test(D))return!0;if((F==="v6"||!F)&&iK0.test(D))return!0;return!1}function Fz0(D,F){let $=(D.toString().split(".")[1]||"").length,J=(F.toString().split(".")[1]||"").length,Q=$>J?$:J,Y=Number.parseInt(D.toFixed(Q).replace(".","")),B=Number.parseInt(F.toFixed(Q).replace(".",""));return Y%B/10**Q}function zF(D){if(D instanceof s0){let F={};for(let $ in D.shape){let J=D.shape[$];F[$]=c1.create(zF(J))}return new s0({...D._def,shape:()=>F})}else if(D instanceof d1)return new d1({...D._def,type:zF(D.element)});else if(D instanceof c1)return c1.create(zF(D.unwrap()));else if(D instanceof n8)return n8.create(zF(D.unwrap()));else if(D instanceof C8)return C8.create(D.items.map((F)=>zF(F)));else return D}function AW(D,F){let $=N8(D),J=N8(F);if(D===F)return{valid:!0,data:D};else if($===k.object&&J===k.object){let Q=E0.objectKeys(F),Y=E0.objectKeys(D).filter((X)=>Q.indexOf(X)!==-1),B={...D,...F};for(let X of Y){let G=AW(D[X],F[X]);if(!G.valid)return{valid:!1};B[X]=G.data}return{valid:!0,data:B}}else if($===k.array&&J===k.array){if(D.length!==F.length)return{valid:!1};let Q=[];for(let Y=0;Y<D.length;Y++){let B=D[Y],X=F[Y],G=AW(B,X);if(!G.valid)return{valid:!1};Q.push(G.data)}return{valid:!0,data:Q}}else if($===k.date&&J===k.date&&+D===+F)return{valid:!0,data:D};else return{valid:!1}}function $f(D,F){return new c6({values:D,typeName:a.ZodEnum,...B0(F)})}function t_(D,F){let $=typeof D==="function"?D(F):typeof D==="string"?{message:D}:D;return typeof $==="string"?{message:$}:$}function Jf(D,F={},$){if(D)return I4.create().superRefine((J,Q)=>{let Y=D(J);if(Y instanceof Promise)return Y.then((B)=>{if(!B){let X=t_(F,J),G=X.fatal??$??!0;Q.addIssue({code:"custom",...X,fatal:G})}});if(!Y){let B=t_(F,J),X=B.fatal??$??!0;Q.addIssue({code:"custom",...B,fatal:X})}return});return I4.create()}var r_=(D,F)=>{if(m6(F))return{success:!0,data:F.value};else{if(!D.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let $=new eD(D.common.issues);return this._error=$,this._error}}}},_K0,fK0,gK0,hK0,bK0,uK0,mK0,lK0,pK0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",LW,dK0,cK0,nK0,iK0,aK0,oK0,e_="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",sK0,p1,p6,d6,VF,P4,R9,ZF,UF,I4,l6,R8,C9,d1,s0,LF,c8=(D)=>{if(D instanceof MF)return c8(D.schema);else if(D instanceof i1)return c8(D.innerType());else if(D instanceof NF)return[D.value];else if(D instanceof c6)return D.options;else if(D instanceof RF)return E0.objectValues(D.enum);else if(D instanceof CF)return c8(D._def.innerType);else if(D instanceof ZF)return[void 0];else if(D instanceof UF)return[null];else if(D instanceof c1)return[void 0,...c8(D.unwrap())];else if(D instanceof n8)return[null,...c8(D.unwrap())];else if(D instanceof iJ)return c8(D.unwrap());else if(D instanceof wF)return c8(D.unwrap());else if(D instanceof OF)return c8(D._def.innerType);else return[]},nJ,AF,C8,O9,w9,S4,EF,MF,NF,c6,RF,k4,i1,c1,n8,CF,OF,j9,$z0,iJ,T9,wF,Jz0,a,Qz0=(D,F={message:`Input not instance of ${D.name}`})=>Jf(($)=>$ instanceof D,F),Qf,Yf,Yz0,Bz0,Bf,Xz0,Gz0,Wz0,Hz0,qz0,Kz0,zz0,Ez0,Vz0,Zz0,Uz0,Lz0,Az0,Mz0,Nz0,Rz0,Cz0,Oz0,wz0,jz0,Tz0,Pz0,Iz0,Sz0,kz0,vz0,yz0,xz0,_z0,fz0=()=>Qf().optional(),gz0=()=>Yf().optional(),hz0=()=>Bf().optional(),bz0,uz0;var Xf=I(()=>{lJ();pJ();s_();UW();M9();_K0=/^c[^\s-]{8,}$/i,fK0=/^[0-9a-z]+$/,gK0=/^[0-9A-HJKMNP-TV-Z]{26}$/i,hK0=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,bK0=/^[a-z0-9_-]{21}$/i,uK0=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,mK0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,lK0=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,dK0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cK0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,nK0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,iK0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,aK0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,oK0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,sK0=new RegExp(`^${e_}$`);p1=class p1 extends H0{_parse(D){if(this._def.coerce)D.data=String(D.data);if(this._getType(D)!==k.string){let Q=this._getOrReturnCtx(D);return v(Q,{code:j.invalid_type,expected:k.string,received:Q.parsedType}),i}let $=new ND,J=void 0;for(let Q of this._def.checks)if(Q.kind==="min"){if(D.data.length<Q.value)J=this._getOrReturnCtx(D,J),v(J,{code:j.too_small,minimum:Q.value,type:"string",inclusive:!0,exact:!1,message:Q.message}),$.dirty()}else if(Q.kind==="max"){if(D.data.length>Q.value)J=this._getOrReturnCtx(D,J),v(J,{code:j.too_big,maximum:Q.value,type:"string",inclusive:!0,exact:!1,message:Q.message}),$.dirty()}else if(Q.kind==="length"){let Y=D.data.length>Q.value,B=D.data.length<Q.value;if(Y||B){if(J=this._getOrReturnCtx(D,J),Y)v(J,{code:j.too_big,maximum:Q.value,type:"string",inclusive:!0,exact:!0,message:Q.message});else if(B)v(J,{code:j.too_small,minimum:Q.value,type:"string",inclusive:!0,exact:!0,message:Q.message});$.dirty()}}else if(Q.kind==="email"){if(!lK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"email",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="emoji"){if(!LW)LW=new RegExp(pK0,"u");if(!LW.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"emoji",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="uuid"){if(!hK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"uuid",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="nanoid"){if(!bK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"nanoid",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="cuid"){if(!_K0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"cuid",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="cuid2"){if(!fK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"cuid2",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="ulid"){if(!gK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"ulid",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="url")try{new URL(D.data)}catch{J=this._getOrReturnCtx(D,J),v(J,{validation:"url",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="regex"){if(Q.regex.lastIndex=0,!Q.regex.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"regex",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="trim")D.data=D.data.trim();else if(Q.kind==="includes"){if(!D.data.includes(Q.value,Q.position))J=this._getOrReturnCtx(D,J),v(J,{code:j.invalid_string,validation:{includes:Q.value,position:Q.position},message:Q.message}),$.dirty()}else if(Q.kind==="toLowerCase")D.data=D.data.toLowerCase();else if(Q.kind==="toUpperCase")D.data=D.data.toUpperCase();else if(Q.kind==="startsWith"){if(!D.data.startsWith(Q.value))J=this._getOrReturnCtx(D,J),v(J,{code:j.invalid_string,validation:{startsWith:Q.value},message:Q.message}),$.dirty()}else if(Q.kind==="endsWith"){if(!D.data.endsWith(Q.value))J=this._getOrReturnCtx(D,J),v(J,{code:j.invalid_string,validation:{endsWith:Q.value},message:Q.message}),$.dirty()}else if(Q.kind==="datetime"){if(!Ff(Q).test(D.data))J=this._getOrReturnCtx(D,J),v(J,{code:j.invalid_string,validation:"datetime",message:Q.message}),$.dirty()}else if(Q.kind==="date"){if(!sK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{code:j.invalid_string,validation:"date",message:Q.message}),$.dirty()}else if(Q.kind==="time"){if(!rK0(Q).test(D.data))J=this._getOrReturnCtx(D,J),v(J,{code:j.invalid_string,validation:"time",message:Q.message}),$.dirty()}else if(Q.kind==="duration"){if(!mK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"duration",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="ip"){if(!tK0(D.data,Q.version))J=this._getOrReturnCtx(D,J),v(J,{validation:"ip",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="jwt"){if(!eK0(D.data,Q.alg))J=this._getOrReturnCtx(D,J),v(J,{validation:"jwt",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="cidr"){if(!Dz0(D.data,Q.version))J=this._getOrReturnCtx(D,J),v(J,{validation:"cidr",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="base64"){if(!aK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"base64",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="base64url"){if(!oK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"base64url",code:j.invalid_string,message:Q.message}),$.dirty()}else E0.assertNever(Q);return{status:$.value,value:D.data}}_regex(D,F,$){return this.refinement((J)=>D.test(J),{validation:F,code:j.invalid_string,...l.errToObj($)})}_addCheck(D){return new p1({...this._def,checks:[...this._def.checks,D]})}email(D){return this._addCheck({kind:"email",...l.errToObj(D)})}url(D){return this._addCheck({kind:"url",...l.errToObj(D)})}emoji(D){return this._addCheck({kind:"emoji",...l.errToObj(D)})}uuid(D){return this._addCheck({kind:"uuid",...l.errToObj(D)})}nanoid(D){return this._addCheck({kind:"nanoid",...l.errToObj(D)})}cuid(D){return this._addCheck({kind:"cuid",...l.errToObj(D)})}cuid2(D){return this._addCheck({kind:"cuid2",...l.errToObj(D)})}ulid(D){return this._addCheck({kind:"ulid",...l.errToObj(D)})}base64(D){return this._addCheck({kind:"base64",...l.errToObj(D)})}base64url(D){return this._addCheck({kind:"base64url",...l.errToObj(D)})}jwt(D){return this._addCheck({kind:"jwt",...l.errToObj(D)})}ip(D){return this._addCheck({kind:"ip",...l.errToObj(D)})}cidr(D){return this._addCheck({kind:"cidr",...l.errToObj(D)})}datetime(D){if(typeof D==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:D});return this._addCheck({kind:"datetime",precision:typeof D?.precision>"u"?null:D?.precision,offset:D?.offset??!1,local:D?.local??!1,...l.errToObj(D?.message)})}date(D){return this._addCheck({kind:"date",message:D})}time(D){if(typeof D==="string")return this._addCheck({kind:"time",precision:null,message:D});return this._addCheck({kind:"time",precision:typeof D?.precision>"u"?null:D?.precision,...l.errToObj(D?.message)})}duration(D){return this._addCheck({kind:"duration",...l.errToObj(D)})}regex(D,F){return this._addCheck({kind:"regex",regex:D,...l.errToObj(F)})}includes(D,F){return this._addCheck({kind:"includes",value:D,position:F?.position,...l.errToObj(F?.message)})}startsWith(D,F){return this._addCheck({kind:"startsWith",value:D,...l.errToObj(F)})}endsWith(D,F){return this._addCheck({kind:"endsWith",value:D,...l.errToObj(F)})}min(D,F){return this._addCheck({kind:"min",value:D,...l.errToObj(F)})}max(D,F){return this._addCheck({kind:"max",value:D,...l.errToObj(F)})}length(D,F){return this._addCheck({kind:"length",value:D,...l.errToObj(F)})}nonempty(D){return this.min(1,l.errToObj(D))}trim(){return new p1({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new p1({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new p1({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((D)=>D.kind==="datetime")}get isDate(){return!!this._def.checks.find((D)=>D.kind==="date")}get isTime(){return!!this._def.checks.find((D)=>D.kind==="time")}get isDuration(){return!!this._def.checks.find((D)=>D.kind==="duration")}get isEmail(){return!!this._def.checks.find((D)=>D.kind==="email")}get isURL(){return!!this._def.checks.find((D)=>D.kind==="url")}get isEmoji(){return!!this._def.checks.find((D)=>D.kind==="emoji")}get isUUID(){return!!this._def.checks.find((D)=>D.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((D)=>D.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((D)=>D.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((D)=>D.kind==="cuid2")}get isULID(){return!!this._def.checks.find((D)=>D.kind==="ulid")}get isIP(){return!!this._def.checks.find((D)=>D.kind==="ip")}get isCIDR(){return!!this._def.checks.find((D)=>D.kind==="cidr")}get isBase64(){return!!this._def.checks.find((D)=>D.kind==="base64")}get isBase64url(){return!!this._def.checks.find((D)=>D.kind==="base64url")}get minLength(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxLength(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}};p1.create=(D)=>{return new p1({checks:[],typeName:a.ZodString,coerce:D?.coerce??!1,...B0(D)})};p6=class p6 extends H0{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(D){if(this._def.coerce)D.data=Number(D.data);if(this._getType(D)!==k.number){let Q=this._getOrReturnCtx(D);return v(Q,{code:j.invalid_type,expected:k.number,received:Q.parsedType}),i}let $=void 0,J=new ND;for(let Q of this._def.checks)if(Q.kind==="int"){if(!E0.isInteger(D.data))$=this._getOrReturnCtx(D,$),v($,{code:j.invalid_type,expected:"integer",received:"float",message:Q.message}),J.dirty()}else if(Q.kind==="min"){if(Q.inclusive?D.data<Q.value:D.data<=Q.value)$=this._getOrReturnCtx(D,$),v($,{code:j.too_small,minimum:Q.value,type:"number",inclusive:Q.inclusive,exact:!1,message:Q.message}),J.dirty()}else if(Q.kind==="max"){if(Q.inclusive?D.data>Q.value:D.data>=Q.value)$=this._getOrReturnCtx(D,$),v($,{code:j.too_big,maximum:Q.value,type:"number",inclusive:Q.inclusive,exact:!1,message:Q.message}),J.dirty()}else if(Q.kind==="multipleOf"){if(Fz0(D.data,Q.value)!==0)$=this._getOrReturnCtx(D,$),v($,{code:j.not_multiple_of,multipleOf:Q.value,message:Q.message}),J.dirty()}else if(Q.kind==="finite"){if(!Number.isFinite(D.data))$=this._getOrReturnCtx(D,$),v($,{code:j.not_finite,message:Q.message}),J.dirty()}else E0.assertNever(Q);return{status:J.value,value:D.data}}gte(D,F){return this.setLimit("min",D,!0,l.toString(F))}gt(D,F){return this.setLimit("min",D,!1,l.toString(F))}lte(D,F){return this.setLimit("max",D,!0,l.toString(F))}lt(D,F){return this.setLimit("max",D,!1,l.toString(F))}setLimit(D,F,$,J){return new p6({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:$,message:l.toString(J)}]})}_addCheck(D){return new p6({...this._def,checks:[...this._def.checks,D]})}int(D){return this._addCheck({kind:"int",message:l.toString(D)})}positive(D){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.toString(D)})}negative(D){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:l.toString(F)})}finite(D){return this._addCheck({kind:"finite",message:l.toString(D)})}safe(D){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.toString(D)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.toString(D)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}get isInt(){return!!this._def.checks.find((D)=>D.kind==="int"||D.kind==="multipleOf"&&E0.isInteger(D.value))}get isFinite(){let D=null,F=null;for(let $ of this._def.checks)if($.kind==="finite"||$.kind==="int"||$.kind==="multipleOf")return!0;else if($.kind==="min"){if(F===null||$.value>F)F=$.value}else if($.kind==="max"){if(D===null||$.value<D)D=$.value}return Number.isFinite(F)&&Number.isFinite(D)}};p6.create=(D)=>{return new p6({checks:[],typeName:a.ZodNumber,coerce:D?.coerce||!1,...B0(D)})};d6=class d6 extends H0{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(D){if(this._def.coerce)try{D.data=BigInt(D.data)}catch{return this._getInvalidInput(D)}if(this._getType(D)!==k.bigint)return this._getInvalidInput(D);let $=void 0,J=new ND;for(let Q of this._def.checks)if(Q.kind==="min"){if(Q.inclusive?D.data<Q.value:D.data<=Q.value)$=this._getOrReturnCtx(D,$),v($,{code:j.too_small,type:"bigint",minimum:Q.value,inclusive:Q.inclusive,message:Q.message}),J.dirty()}else if(Q.kind==="max"){if(Q.inclusive?D.data>Q.value:D.data>=Q.value)$=this._getOrReturnCtx(D,$),v($,{code:j.too_big,type:"bigint",maximum:Q.value,inclusive:Q.inclusive,message:Q.message}),J.dirty()}else if(Q.kind==="multipleOf"){if(D.data%Q.value!==BigInt(0))$=this._getOrReturnCtx(D,$),v($,{code:j.not_multiple_of,multipleOf:Q.value,message:Q.message}),J.dirty()}else E0.assertNever(Q);return{status:J.value,value:D.data}}_getInvalidInput(D){let F=this._getOrReturnCtx(D);return v(F,{code:j.invalid_type,expected:k.bigint,received:F.parsedType}),i}gte(D,F){return this.setLimit("min",D,!0,l.toString(F))}gt(D,F){return this.setLimit("min",D,!1,l.toString(F))}lte(D,F){return this.setLimit("max",D,!0,l.toString(F))}lt(D,F){return this.setLimit("max",D,!1,l.toString(F))}setLimit(D,F,$,J){return new d6({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:$,message:l.toString(J)}]})}_addCheck(D){return new d6({...this._def,checks:[...this._def.checks,D]})}positive(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.toString(D)})}negative(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:l.toString(F)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}};d6.create=(D)=>{return new d6({checks:[],typeName:a.ZodBigInt,coerce:D?.coerce??!1,...B0(D)})};VF=class VF extends H0{_parse(D){if(this._def.coerce)D.data=Boolean(D.data);if(this._getType(D)!==k.boolean){let $=this._getOrReturnCtx(D);return v($,{code:j.invalid_type,expected:k.boolean,received:$.parsedType}),i}return SD(D.data)}};VF.create=(D)=>{return new VF({typeName:a.ZodBoolean,coerce:D?.coerce||!1,...B0(D)})};P4=class P4 extends H0{_parse(D){if(this._def.coerce)D.data=new Date(D.data);if(this._getType(D)!==k.date){let Q=this._getOrReturnCtx(D);return v(Q,{code:j.invalid_type,expected:k.date,received:Q.parsedType}),i}if(Number.isNaN(D.data.getTime())){let Q=this._getOrReturnCtx(D);return v(Q,{code:j.invalid_date}),i}let $=new ND,J=void 0;for(let Q of this._def.checks)if(Q.kind==="min"){if(D.data.getTime()<Q.value)J=this._getOrReturnCtx(D,J),v(J,{code:j.too_small,message:Q.message,inclusive:!0,exact:!1,minimum:Q.value,type:"date"}),$.dirty()}else if(Q.kind==="max"){if(D.data.getTime()>Q.value)J=this._getOrReturnCtx(D,J),v(J,{code:j.too_big,message:Q.message,inclusive:!0,exact:!1,maximum:Q.value,type:"date"}),$.dirty()}else E0.assertNever(Q);return{status:$.value,value:new Date(D.data.getTime())}}_addCheck(D){return new P4({...this._def,checks:[...this._def.checks,D]})}min(D,F){return this._addCheck({kind:"min",value:D.getTime(),message:l.toString(F)})}max(D,F){return this._addCheck({kind:"max",value:D.getTime(),message:l.toString(F)})}get minDate(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D!=null?new Date(D):null}get maxDate(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D!=null?new Date(D):null}};P4.create=(D)=>{return new P4({checks:[],coerce:D?.coerce||!1,typeName:a.ZodDate,...B0(D)})};R9=class R9 extends H0{_parse(D){if(this._getType(D)!==k.symbol){let $=this._getOrReturnCtx(D);return v($,{code:j.invalid_type,expected:k.symbol,received:$.parsedType}),i}return SD(D.data)}};R9.create=(D)=>{return new R9({typeName:a.ZodSymbol,...B0(D)})};ZF=class ZF extends H0{_parse(D){if(this._getType(D)!==k.undefined){let $=this._getOrReturnCtx(D);return v($,{code:j.invalid_type,expected:k.undefined,received:$.parsedType}),i}return SD(D.data)}};ZF.create=(D)=>{return new ZF({typeName:a.ZodUndefined,...B0(D)})};UF=class UF extends H0{_parse(D){if(this._getType(D)!==k.null){let $=this._getOrReturnCtx(D);return v($,{code:j.invalid_type,expected:k.null,received:$.parsedType}),i}return SD(D.data)}};UF.create=(D)=>{return new UF({typeName:a.ZodNull,...B0(D)})};I4=class I4 extends H0{constructor(){super(...arguments);this._any=!0}_parse(D){return SD(D.data)}};I4.create=(D)=>{return new I4({typeName:a.ZodAny,...B0(D)})};l6=class l6 extends H0{constructor(){super(...arguments);this._unknown=!0}_parse(D){return SD(D.data)}};l6.create=(D)=>{return new l6({typeName:a.ZodUnknown,...B0(D)})};R8=class R8 extends H0{_parse(D){let F=this._getOrReturnCtx(D);return v(F,{code:j.invalid_type,expected:k.never,received:F.parsedType}),i}};R8.create=(D)=>{return new R8({typeName:a.ZodNever,...B0(D)})};C9=class C9 extends H0{_parse(D){if(this._getType(D)!==k.undefined){let $=this._getOrReturnCtx(D);return v($,{code:j.invalid_type,expected:k.void,received:$.parsedType}),i}return SD(D.data)}};C9.create=(D)=>{return new C9({typeName:a.ZodVoid,...B0(D)})};d1=class d1 extends H0{_parse(D){let{ctx:F,status:$}=this._processInputParams(D),J=this._def;if(F.parsedType!==k.array)return v(F,{code:j.invalid_type,expected:k.array,received:F.parsedType}),i;if(J.exactLength!==null){let Y=F.data.length>J.exactLength.value,B=F.data.length<J.exactLength.value;if(Y||B)v(F,{code:Y?j.too_big:j.too_small,minimum:B?J.exactLength.value:void 0,maximum:Y?J.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:J.exactLength.message}),$.dirty()}if(J.minLength!==null){if(F.data.length<J.minLength.value)v(F,{code:j.too_small,minimum:J.minLength.value,type:"array",inclusive:!0,exact:!1,message:J.minLength.message}),$.dirty()}if(J.maxLength!==null){if(F.data.length>J.maxLength.value)v(F,{code:j.too_big,maximum:J.maxLength.value,type:"array",inclusive:!0,exact:!1,message:J.maxLength.message}),$.dirty()}if(F.common.async)return Promise.all([...F.data].map((Y,B)=>{return J.type._parseAsync(new n1(F,Y,F.path,B))})).then((Y)=>{return ND.mergeArray($,Y)});let Q=[...F.data].map((Y,B)=>{return J.type._parseSync(new n1(F,Y,F.path,B))});return ND.mergeArray($,Q)}get element(){return this._def.type}min(D,F){return new d1({...this._def,minLength:{value:D,message:l.toString(F)}})}max(D,F){return new d1({...this._def,maxLength:{value:D,message:l.toString(F)}})}length(D,F){return new d1({...this._def,exactLength:{value:D,message:l.toString(F)}})}nonempty(D){return this.min(1,D)}};d1.create=(D,F)=>{return new d1({type:D,minLength:null,maxLength:null,exactLength:null,typeName:a.ZodArray,...B0(F)})};s0=class s0 extends H0{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let D=this._def.shape(),F=E0.objectKeys(D);return this._cached={shape:D,keys:F},this._cached}_parse(D){if(this._getType(D)!==k.object){let G=this._getOrReturnCtx(D);return v(G,{code:j.invalid_type,expected:k.object,received:G.parsedType}),i}let{status:$,ctx:J}=this._processInputParams(D),{shape:Q,keys:Y}=this._getCached(),B=[];if(!(this._def.catchall instanceof R8&&this._def.unknownKeys==="strip")){for(let G in J.data)if(!Y.includes(G))B.push(G)}let X=[];for(let G of Y){let H=Q[G],q=J.data[G];X.push({key:{status:"valid",value:G},value:H._parse(new n1(J,q,J.path,G)),alwaysSet:G in J.data})}if(this._def.catchall instanceof R8){let G=this._def.unknownKeys;if(G==="passthrough")for(let H of B)X.push({key:{status:"valid",value:H},value:{status:"valid",value:J.data[H]}});else if(G==="strict"){if(B.length>0)v(J,{code:j.unrecognized_keys,keys:B}),$.dirty()}else if(G==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let G=this._def.catchall;for(let H of B){let q=J.data[H];X.push({key:{status:"valid",value:H},value:G._parse(new n1(J,q,J.path,H)),alwaysSet:H in J.data})}}if(J.common.async)return Promise.resolve().then(async()=>{let G=[];for(let H of X){let q=await H.key,K=await H.value;G.push({key:q,value:K,alwaysSet:H.alwaysSet})}return G}).then((G)=>{return ND.mergeObjectSync($,G)});else return ND.mergeObjectSync($,X)}get shape(){return this._def.shape()}strict(D){return l.errToObj,new s0({...this._def,unknownKeys:"strict",...D!==void 0?{errorMap:(F,$)=>{let J=this._def.errorMap?.(F,$).message??$.defaultError;if(F.code==="unrecognized_keys")return{message:l.errToObj(D).message??J};return{message:J}}}:{}})}strip(){return new s0({...this._def,unknownKeys:"strip"})}passthrough(){return new s0({...this._def,unknownKeys:"passthrough"})}extend(D){return new s0({...this._def,shape:()=>({...this._def.shape(),...D})})}merge(D){return new s0({unknownKeys:D._def.unknownKeys,catchall:D._def.catchall,shape:()=>({...this._def.shape(),...D._def.shape()}),typeName:a.ZodObject})}setKey(D,F){return this.augment({[D]:F})}catchall(D){return new s0({...this._def,catchall:D})}pick(D){let F={};for(let $ of E0.objectKeys(D))if(D[$]&&this.shape[$])F[$]=this.shape[$];return new s0({...this._def,shape:()=>F})}omit(D){let F={};for(let $ of E0.objectKeys(this.shape))if(!D[$])F[$]=this.shape[$];return new s0({...this._def,shape:()=>F})}deepPartial(){return zF(this)}partial(D){let F={};for(let $ of E0.objectKeys(this.shape)){let J=this.shape[$];if(D&&!D[$])F[$]=J;else F[$]=J.optional()}return new s0({...this._def,shape:()=>F})}required(D){let F={};for(let $ of E0.objectKeys(this.shape))if(D&&!D[$])F[$]=this.shape[$];else{let Q=this.shape[$];while(Q instanceof c1)Q=Q._def.innerType;F[$]=Q}return new s0({...this._def,shape:()=>F})}keyof(){return $f(E0.objectKeys(this.shape))}};s0.create=(D,F)=>{return new s0({shape:()=>D,unknownKeys:"strip",catchall:R8.create(),typeName:a.ZodObject,...B0(F)})};s0.strictCreate=(D,F)=>{return new s0({shape:()=>D,unknownKeys:"strict",catchall:R8.create(),typeName:a.ZodObject,...B0(F)})};s0.lazycreate=(D,F)=>{return new s0({shape:D,unknownKeys:"strip",catchall:R8.create(),typeName:a.ZodObject,...B0(F)})};LF=class LF extends H0{_parse(D){let{ctx:F}=this._processInputParams(D),$=this._def.options;function J(Q){for(let B of Q)if(B.result.status==="valid")return B.result;for(let B of Q)if(B.result.status==="dirty")return F.common.issues.push(...B.ctx.common.issues),B.result;let Y=Q.map((B)=>new eD(B.ctx.common.issues));return v(F,{code:j.invalid_union,unionErrors:Y}),i}if(F.common.async)return Promise.all($.map(async(Q)=>{let Y={...F,common:{...F.common,issues:[]},parent:null};return{result:await Q._parseAsync({data:F.data,path:F.path,parent:Y}),ctx:Y}})).then(J);else{let Q=void 0,Y=[];for(let X of $){let G={...F,common:{...F.common,issues:[]},parent:null},H=X._parseSync({data:F.data,path:F.path,parent:G});if(H.status==="valid")return H;else if(H.status==="dirty"&&!Q)Q={result:H,ctx:G};if(G.common.issues.length)Y.push(G.common.issues)}if(Q)return F.common.issues.push(...Q.ctx.common.issues),Q.result;let B=Y.map((X)=>new eD(X));return v(F,{code:j.invalid_union,unionErrors:B}),i}}get options(){return this._def.options}};LF.create=(D,F)=>{return new LF({options:D,typeName:a.ZodUnion,...B0(F)})};nJ=class nJ extends H0{_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==k.object)return v(F,{code:j.invalid_type,expected:k.object,received:F.parsedType}),i;let $=this.discriminator,J=F.data[$],Q=this.optionsMap.get(J);if(!Q)return v(F,{code:j.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[$]}),i;if(F.common.async)return Q._parseAsync({data:F.data,path:F.path,parent:F});else return Q._parseSync({data:F.data,path:F.path,parent:F})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(D,F,$){let J=new Map;for(let Q of F){let Y=c8(Q.shape[D]);if(!Y.length)throw Error(`A discriminator value for key \`${D}\` could not be extracted from all schema options`);for(let B of Y){if(J.has(B))throw Error(`Discriminator property ${String(D)} has duplicate value ${String(B)}`);J.set(B,Q)}}return new nJ({typeName:a.ZodDiscriminatedUnion,discriminator:D,options:F,optionsMap:J,...B0($)})}};AF=class AF extends H0{_parse(D){let{status:F,ctx:$}=this._processInputParams(D),J=(Q,Y)=>{if(dJ(Q)||dJ(Y))return i;let B=AW(Q.value,Y.value);if(!B.valid)return v($,{code:j.invalid_intersection_types}),i;if(cJ(Q)||cJ(Y))F.dirty();return{status:F.value,value:B.data}};if($.common.async)return Promise.all([this._def.left._parseAsync({data:$.data,path:$.path,parent:$}),this._def.right._parseAsync({data:$.data,path:$.path,parent:$})]).then(([Q,Y])=>J(Q,Y));else return J(this._def.left._parseSync({data:$.data,path:$.path,parent:$}),this._def.right._parseSync({data:$.data,path:$.path,parent:$}))}};AF.create=(D,F,$)=>{return new AF({left:D,right:F,typeName:a.ZodIntersection,...B0($)})};C8=class C8 extends H0{_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==k.array)return v($,{code:j.invalid_type,expected:k.array,received:$.parsedType}),i;if($.data.length<this._def.items.length)return v($,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i;if(!this._def.rest&&$.data.length>this._def.items.length)v($,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F.dirty();let Q=[...$.data].map((Y,B)=>{let X=this._def.items[B]||this._def.rest;if(!X)return null;return X._parse(new n1($,Y,$.path,B))}).filter((Y)=>!!Y);if($.common.async)return Promise.all(Q).then((Y)=>{return ND.mergeArray(F,Y)});else return ND.mergeArray(F,Q)}get items(){return this._def.items}rest(D){return new C8({...this._def,rest:D})}};C8.create=(D,F)=>{if(!Array.isArray(D))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new C8({items:D,typeName:a.ZodTuple,rest:null,...B0(F)})};O9=class O9 extends H0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==k.object)return v($,{code:j.invalid_type,expected:k.object,received:$.parsedType}),i;let J=[],Q=this._def.keyType,Y=this._def.valueType;for(let B in $.data)J.push({key:Q._parse(new n1($,B,$.path,B)),value:Y._parse(new n1($,$.data[B],$.path,B)),alwaysSet:B in $.data});if($.common.async)return ND.mergeObjectAsync(F,J);else return ND.mergeObjectSync(F,J)}get element(){return this._def.valueType}static create(D,F,$){if(F instanceof H0)return new O9({keyType:D,valueType:F,typeName:a.ZodRecord,...B0($)});return new O9({keyType:p1.create(),valueType:D,typeName:a.ZodRecord,...B0(F)})}};w9=class w9 extends H0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==k.map)return v($,{code:j.invalid_type,expected:k.map,received:$.parsedType}),i;let J=this._def.keyType,Q=this._def.valueType,Y=[...$.data.entries()].map(([B,X],G)=>{return{key:J._parse(new n1($,B,$.path,[G,"key"])),value:Q._parse(new n1($,X,$.path,[G,"value"]))}});if($.common.async){let B=new Map;return Promise.resolve().then(async()=>{for(let X of Y){let G=await X.key,H=await X.value;if(G.status==="aborted"||H.status==="aborted")return i;if(G.status==="dirty"||H.status==="dirty")F.dirty();B.set(G.value,H.value)}return{status:F.value,value:B}})}else{let B=new Map;for(let X of Y){let{key:G,value:H}=X;if(G.status==="aborted"||H.status==="aborted")return i;if(G.status==="dirty"||H.status==="dirty")F.dirty();B.set(G.value,H.value)}return{status:F.value,value:B}}}};w9.create=(D,F,$)=>{return new w9({valueType:F,keyType:D,typeName:a.ZodMap,...B0($)})};S4=class S4 extends H0{_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==k.set)return v($,{code:j.invalid_type,expected:k.set,received:$.parsedType}),i;let J=this._def;if(J.minSize!==null){if($.data.size<J.minSize.value)v($,{code:j.too_small,minimum:J.minSize.value,type:"set",inclusive:!0,exact:!1,message:J.minSize.message}),F.dirty()}if(J.maxSize!==null){if($.data.size>J.maxSize.value)v($,{code:j.too_big,maximum:J.maxSize.value,type:"set",inclusive:!0,exact:!1,message:J.maxSize.message}),F.dirty()}let Q=this._def.valueType;function Y(X){let G=new Set;for(let H of X){if(H.status==="aborted")return i;if(H.status==="dirty")F.dirty();G.add(H.value)}return{status:F.value,value:G}}let B=[...$.data.values()].map((X,G)=>Q._parse(new n1($,X,$.path,G)));if($.common.async)return Promise.all(B).then((X)=>Y(X));else return Y(B)}min(D,F){return new S4({...this._def,minSize:{value:D,message:l.toString(F)}})}max(D,F){return new S4({...this._def,maxSize:{value:D,message:l.toString(F)}})}size(D,F){return this.min(D,F).max(D,F)}nonempty(D){return this.min(1,D)}};S4.create=(D,F)=>{return new S4({valueType:D,minSize:null,maxSize:null,typeName:a.ZodSet,...B0(F)})};EF=class EF extends H0{constructor(){super(...arguments);this.validate=this.implement}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==k.function)return v(F,{code:j.invalid_type,expected:k.function,received:F.parsedType}),i;function $(B,X){return N9({data:B,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,qF(),d8].filter((G)=>!!G),issueData:{code:j.invalid_arguments,argumentsError:X}})}function J(B,X){return N9({data:B,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,qF(),d8].filter((G)=>!!G),issueData:{code:j.invalid_return_type,returnTypeError:X}})}let Q={errorMap:F.common.contextualErrorMap},Y=F.data;if(this._def.returns instanceof k4){let B=this;return SD(async function(...X){let G=new eD([]),H=await B._def.args.parseAsync(X,Q).catch((V)=>{throw G.addIssue($(X,V)),G}),q=await Reflect.apply(Y,this,H);return await B._def.returns._def.type.parseAsync(q,Q).catch((V)=>{throw G.addIssue(J(q,V)),G})})}else{let B=this;return SD(function(...X){let G=B._def.args.safeParse(X,Q);if(!G.success)throw new eD([$(X,G.error)]);let H=Reflect.apply(Y,this,G.data),q=B._def.returns.safeParse(H,Q);if(!q.success)throw new eD([J(H,q.error)]);return q.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...D){return new EF({...this._def,args:C8.create(D).rest(l6.create())})}returns(D){return new EF({...this._def,returns:D})}implement(D){return this.parse(D)}strictImplement(D){return this.parse(D)}static create(D,F,$){return new EF({args:D?D:C8.create([]).rest(l6.create()),returns:F||l6.create(),typeName:a.ZodFunction,...B0($)})}};MF=class MF extends H0{get schema(){return this._def.getter()}_parse(D){let{ctx:F}=this._processInputParams(D);return this._def.getter()._parse({data:F.data,path:F.path,parent:F})}};MF.create=(D,F)=>{return new MF({getter:D,typeName:a.ZodLazy,...B0(F)})};NF=class NF extends H0{_parse(D){if(D.data!==this._def.value){let F=this._getOrReturnCtx(D);return v(F,{received:F.data,code:j.invalid_literal,expected:this._def.value}),i}return{status:"valid",value:D.data}}get value(){return this._def.value}};NF.create=(D,F)=>{return new NF({value:D,typeName:a.ZodLiteral,...B0(F)})};c6=class c6 extends H0{_parse(D){if(typeof D.data!=="string"){let F=this._getOrReturnCtx(D),$=this._def.values;return v(F,{expected:E0.joinValues($),received:F.parsedType,code:j.invalid_type}),i}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(D.data)){let F=this._getOrReturnCtx(D),$=this._def.values;return v(F,{received:F.data,code:j.invalid_enum_value,options:$}),i}return SD(D.data)}get options(){return this._def.values}get enum(){let D={};for(let F of this._def.values)D[F]=F;return D}get Values(){let D={};for(let F of this._def.values)D[F]=F;return D}get Enum(){let D={};for(let F of this._def.values)D[F]=F;return D}extract(D,F=this._def){return c6.create(D,{...this._def,...F})}exclude(D,F=this._def){return c6.create(this.options.filter(($)=>!D.includes($)),{...this._def,...F})}};c6.create=$f;RF=class RF extends H0{_parse(D){let F=E0.getValidEnumValues(this._def.values),$=this._getOrReturnCtx(D);if($.parsedType!==k.string&&$.parsedType!==k.number){let J=E0.objectValues(F);return v($,{expected:E0.joinValues(J),received:$.parsedType,code:j.invalid_type}),i}if(!this._cache)this._cache=new Set(E0.getValidEnumValues(this._def.values));if(!this._cache.has(D.data)){let J=E0.objectValues(F);return v($,{received:$.data,code:j.invalid_enum_value,options:J}),i}return SD(D.data)}get enum(){return this._def.values}};RF.create=(D,F)=>{return new RF({values:D,typeName:a.ZodNativeEnum,...B0(F)})};k4=class k4 extends H0{unwrap(){return this._def.type}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==k.promise&&F.common.async===!1)return v(F,{code:j.invalid_type,expected:k.promise,received:F.parsedType}),i;let $=F.parsedType===k.promise?F.data:Promise.resolve(F.data);return SD($.then((J)=>{return this._def.type.parseAsync(J,{path:F.path,errorMap:F.common.contextualErrorMap})}))}};k4.create=(D,F)=>{return new k4({type:D,typeName:a.ZodPromise,...B0(F)})};i1=class i1 extends H0{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===a.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(D){let{status:F,ctx:$}=this._processInputParams(D),J=this._def.effect||null,Q={addIssue:(Y)=>{if(v($,Y),Y.fatal)F.abort();else F.dirty()},get path(){return $.path}};if(Q.addIssue=Q.addIssue.bind(Q),J.type==="preprocess"){let Y=J.transform($.data,Q);if($.common.async)return Promise.resolve(Y).then(async(B)=>{if(F.value==="aborted")return i;let X=await this._def.schema._parseAsync({data:B,path:$.path,parent:$});if(X.status==="aborted")return i;if(X.status==="dirty")return T4(X.value);if(F.value==="dirty")return T4(X.value);return X});else{if(F.value==="aborted")return i;let B=this._def.schema._parseSync({data:Y,path:$.path,parent:$});if(B.status==="aborted")return i;if(B.status==="dirty")return T4(B.value);if(F.value==="dirty")return T4(B.value);return B}}if(J.type==="refinement"){let Y=(B)=>{let X=J.refinement(B,Q);if($.common.async)return Promise.resolve(X);if(X instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return B};if($.common.async===!1){let B=this._def.schema._parseSync({data:$.data,path:$.path,parent:$});if(B.status==="aborted")return i;if(B.status==="dirty")F.dirty();return Y(B.value),{status:F.value,value:B.value}}else return this._def.schema._parseAsync({data:$.data,path:$.path,parent:$}).then((B)=>{if(B.status==="aborted")return i;if(B.status==="dirty")F.dirty();return Y(B.value).then(()=>{return{status:F.value,value:B.value}})})}if(J.type==="transform")if($.common.async===!1){let Y=this._def.schema._parseSync({data:$.data,path:$.path,parent:$});if(!m6(Y))return i;let B=J.transform(Y.value,Q);if(B instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:F.value,value:B}}else return this._def.schema._parseAsync({data:$.data,path:$.path,parent:$}).then((Y)=>{if(!m6(Y))return i;return Promise.resolve(J.transform(Y.value,Q)).then((B)=>({status:F.value,value:B}))});E0.assertNever(J)}};i1.create=(D,F,$)=>{return new i1({schema:D,typeName:a.ZodEffects,effect:F,...B0($)})};i1.createWithPreprocess=(D,F,$)=>{return new i1({schema:F,effect:{type:"preprocess",transform:D},typeName:a.ZodEffects,...B0($)})};c1=class c1 extends H0{_parse(D){if(this._getType(D)===k.undefined)return SD(void 0);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}};c1.create=(D,F)=>{return new c1({innerType:D,typeName:a.ZodOptional,...B0(F)})};n8=class n8 extends H0{_parse(D){if(this._getType(D)===k.null)return SD(null);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}};n8.create=(D,F)=>{return new n8({innerType:D,typeName:a.ZodNullable,...B0(F)})};CF=class CF extends H0{_parse(D){let{ctx:F}=this._processInputParams(D),$=F.data;if(F.parsedType===k.undefined)$=this._def.defaultValue();return this._def.innerType._parse({data:$,path:F.path,parent:F})}removeDefault(){return this._def.innerType}};CF.create=(D,F)=>{return new CF({innerType:D,typeName:a.ZodDefault,defaultValue:typeof F.default==="function"?F.default:()=>F.default,...B0(F)})};OF=class OF extends H0{_parse(D){let{ctx:F}=this._processInputParams(D),$={...F,common:{...F.common,issues:[]}},J=this._def.innerType._parse({data:$.data,path:$.path,parent:{...$}});if(KF(J))return J.then((Q)=>{return{status:"valid",value:Q.status==="valid"?Q.value:this._def.catchValue({get error(){return new eD($.common.issues)},input:$.data})}});else return{status:"valid",value:J.status==="valid"?J.value:this._def.catchValue({get error(){return new eD($.common.issues)},input:$.data})}}removeCatch(){return this._def.innerType}};OF.create=(D,F)=>{return new OF({innerType:D,typeName:a.ZodCatch,catchValue:typeof F.catch==="function"?F.catch:()=>F.catch,...B0(F)})};j9=class j9 extends H0{_parse(D){if(this._getType(D)!==k.nan){let $=this._getOrReturnCtx(D);return v($,{code:j.invalid_type,expected:k.nan,received:$.parsedType}),i}return{status:"valid",value:D.data}}};j9.create=(D)=>{return new j9({typeName:a.ZodNaN,...B0(D)})};$z0=Symbol("zod_brand");iJ=class iJ extends H0{_parse(D){let{ctx:F}=this._processInputParams(D),$=F.data;return this._def.type._parse({data:$,path:F.path,parent:F})}unwrap(){return this._def.type}};T9=class T9 extends H0{_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.common.async)return(async()=>{let Q=await this._def.in._parseAsync({data:$.data,path:$.path,parent:$});if(Q.status==="aborted")return i;if(Q.status==="dirty")return F.dirty(),T4(Q.value);else return this._def.out._parseAsync({data:Q.value,path:$.path,parent:$})})();else{let J=this._def.in._parseSync({data:$.data,path:$.path,parent:$});if(J.status==="aborted")return i;if(J.status==="dirty")return F.dirty(),{status:"dirty",value:J.value};else return this._def.out._parseSync({data:J.value,path:$.path,parent:$})}}static create(D,F){return new T9({in:D,out:F,typeName:a.ZodPipeline})}};wF=class wF extends H0{_parse(D){let F=this._def.innerType._parse(D),$=(J)=>{if(m6(J))J.value=Object.freeze(J.value);return J};return KF(F)?F.then((J)=>$(J)):$(F)}unwrap(){return this._def.innerType}};wF.create=(D,F)=>{return new wF({innerType:D,typeName:a.ZodReadonly,...B0(F)})};Jz0={object:s0.lazycreate};(function(D){D.ZodString="ZodString",D.ZodNumber="ZodNumber",D.ZodNaN="ZodNaN",D.ZodBigInt="ZodBigInt",D.ZodBoolean="ZodBoolean",D.ZodDate="ZodDate",D.ZodSymbol="ZodSymbol",D.ZodUndefined="ZodUndefined",D.ZodNull="ZodNull",D.ZodAny="ZodAny",D.ZodUnknown="ZodUnknown",D.ZodNever="ZodNever",D.ZodVoid="ZodVoid",D.ZodArray="ZodArray",D.ZodObject="ZodObject",D.ZodUnion="ZodUnion",D.ZodDiscriminatedUnion="ZodDiscriminatedUnion",D.ZodIntersection="ZodIntersection",D.ZodTuple="ZodTuple",D.ZodRecord="ZodRecord",D.ZodMap="ZodMap",D.ZodSet="ZodSet",D.ZodFunction="ZodFunction",D.ZodLazy="ZodLazy",D.ZodLiteral="ZodLiteral",D.ZodEnum="ZodEnum",D.ZodEffects="ZodEffects",D.ZodNativeEnum="ZodNativeEnum",D.ZodOptional="ZodOptional",D.ZodNullable="ZodNullable",D.ZodDefault="ZodDefault",D.ZodCatch="ZodCatch",D.ZodPromise="ZodPromise",D.ZodBranded="ZodBranded",D.ZodPipeline="ZodPipeline",D.ZodReadonly="ZodReadonly"})(a||(a={}));Qf=p1.create,Yf=p6.create,Yz0=j9.create,Bz0=d6.create,Bf=VF.create,Xz0=P4.create,Gz0=R9.create,Wz0=ZF.create,Hz0=UF.create,qz0=I4.create,Kz0=l6.create,zz0=R8.create,Ez0=C9.create,Vz0=d1.create,Zz0=s0.create,Uz0=s0.strictCreate,Lz0=LF.create,Az0=nJ.create,Mz0=AF.create,Nz0=C8.create,Rz0=O9.create,Cz0=w9.create,Oz0=S4.create,wz0=EF.create,jz0=MF.create,Tz0=NF.create,Pz0=c6.create,Iz0=RF.create,Sz0=k4.create,kz0=i1.create,vz0=c1.create,yz0=n8.create,xz0=i1.createWithPreprocess,_z0=T9.create,bz0={string:(D)=>p1.create({...D,coerce:!0}),number:(D)=>p6.create({...D,coerce:!0}),boolean:(D)=>VF.create({...D,coerce:!0}),bigint:(D)=>d6.create({...D,coerce:!0}),date:(D)=>P4.create({...D,coerce:!0})},uz0=i});var B1={};c4(B1,{void:()=>Ez0,util:()=>E0,unknown:()=>Kz0,union:()=>Lz0,undefined:()=>Wz0,tuple:()=>Nz0,transformer:()=>kz0,symbol:()=>Gz0,string:()=>Qf,strictObject:()=>Uz0,setErrorMap:()=>yK0,set:()=>Oz0,record:()=>Rz0,quotelessJson:()=>kK0,promise:()=>Sz0,preprocess:()=>xz0,pipeline:()=>_z0,ostring:()=>fz0,optional:()=>vz0,onumber:()=>gz0,oboolean:()=>hz0,objectUtil:()=>VW,object:()=>Zz0,number:()=>Yf,nullable:()=>yz0,null:()=>Hz0,never:()=>zz0,nativeEnum:()=>Iz0,nan:()=>Yz0,map:()=>Cz0,makeIssue:()=>N9,literal:()=>Tz0,lazy:()=>jz0,late:()=>Jz0,isValid:()=>m6,isDirty:()=>cJ,isAsync:()=>KF,isAborted:()=>dJ,intersection:()=>Mz0,instanceof:()=>Qz0,getParsedType:()=>N8,getErrorMap:()=>qF,function:()=>wz0,enum:()=>Pz0,effect:()=>kz0,discriminatedUnion:()=>Az0,defaultErrorMap:()=>d8,datetimeRegex:()=>Ff,date:()=>Xz0,custom:()=>Jf,coerce:()=>bz0,boolean:()=>Bf,bigint:()=>Bz0,array:()=>Vz0,any:()=>qz0,addIssueToContext:()=>v,ZodVoid:()=>C9,ZodUnknown:()=>l6,ZodUnion:()=>LF,ZodUndefined:()=>ZF,ZodType:()=>H0,ZodTuple:()=>C8,ZodTransformer:()=>i1,ZodSymbol:()=>R9,ZodString:()=>p1,ZodSet:()=>S4,ZodSchema:()=>H0,ZodRecord:()=>O9,ZodReadonly:()=>wF,ZodPromise:()=>k4,ZodPipeline:()=>T9,ZodParsedType:()=>k,ZodOptional:()=>c1,ZodObject:()=>s0,ZodNumber:()=>p6,ZodNullable:()=>n8,ZodNull:()=>UF,ZodNever:()=>R8,ZodNativeEnum:()=>RF,ZodNaN:()=>j9,ZodMap:()=>w9,ZodLiteral:()=>NF,ZodLazy:()=>MF,ZodIssueCode:()=>j,ZodIntersection:()=>AF,ZodFunction:()=>EF,ZodFirstPartyTypeKind:()=>a,ZodError:()=>eD,ZodEnum:()=>c6,ZodEffects:()=>i1,ZodDiscriminatedUnion:()=>nJ,ZodDefault:()=>CF,ZodDate:()=>P4,ZodCatch:()=>OF,ZodBranded:()=>iJ,ZodBoolean:()=>VF,ZodBigInt:()=>d6,ZodArray:()=>d1,ZodAny:()=>I4,Schema:()=>H0,ParseStatus:()=>ND,OK:()=>SD,NEVER:()=>uz0,INVALID:()=>i,EMPTY_PATH:()=>xK0,DIRTY:()=>T4,BRAND:()=>$z0});var MW=I(()=>{pJ();UW();o_();M9();Xf();lJ()});var Gf=I(()=>{MW();MW()});import{copyFileSync as mz0,existsSync as Wf,mkdirSync as lz0}from"fs";import{homedir as aJ}from"os";import{join as jF}from"path";function dz0(D){let F=D.trim().replace(/\/+$/,"");try{let $=new URL(F);return $.protocol=$.protocol.toLowerCase(),$.host=$.host.toLowerCase(),$.toString().replace(/\/+$/,"")}catch{return console.error(`[nemar] could not parse stored apiUrl ${JSON.stringify(D)}; leaving as-is`),F}}function cz0(){if(process.env.NEMAR_CONFIG_DIR)return;let D=jF(NW,"config.json");if(Wf(D))return;let F=[];if(process.platform==="darwin")F.push(jF(aJ(),"Library","Preferences","nemar-nodejs","config.json"));if(process.platform==="win32"){let $=process.env.APPDATA||jF(aJ(),"AppData","Roaming");F.push(jF($,"nemar-nodejs","config.json"))}F.push(jF(aJ(),".config","nemar-nodejs","config.json"));for(let $ of F)if(Wf($))try{lz0(NW,{recursive:!0}),mz0($,D),console.error(`[nemar] Config migrated from ${$} to ${D}
91
+ deps: ${$}}`};var Q20={keyword:"dependencies",type:"object",schemaType:"object",error:ck.error,code(D){let[F,$]=Y20(D);pk(D,F),dk(D,$)}};function Y20({schema:D}){let F={},$={};for(let J in D){if(J==="__proto__")continue;let Q=Array.isArray(D[J])?F:$;Q[J]=D[J]}return[F,$]}function pk(D,F=D.schema){let{gen:$,data:J,it:Q}=D;if(Object.keys(F).length===0)return;let Y=$.let("missing");for(let B in F){let X=F[B];if(X.length===0)continue;let G=(0,X9.propertyInData)($,J,B,Q.opts.ownProperties);if(D.setParams({property:B,depsCount:X.length,deps:X.join(", ")}),Q.allErrors)$.if(G,()=>{for(let H of X)(0,X9.checkReportMissingProp)(D,H)});else $.if(TG._`${G} && (${(0,X9.checkMissingProp)(D,X,Y)})`),(0,X9.reportMissingProp)(D,Y),$.else()}}ck.validatePropertyDeps=pk;function dk(D,F=D.schema){let{gen:$,data:J,keyword:Q,it:Y}=D,B=$.name("valid");for(let X in F){if((0,J20.alwaysValidSchema)(Y,F[X]))continue;$.if((0,X9.propertyInData)($,J,X,Y.opts.ownProperties),()=>{let G=D.subschema({keyword:Q,schemaProp:X},B);D.mergeValidEvaluated(G,B)},()=>$.var(B,!0)),D.ok(B)}}ck.validateSchemaDeps=dk;ck.default=Q20});var sk=z((ok)=>{Object.defineProperty(ok,"__esModule",{value:!0});var ak=t(),G20=z0(),W20={message:"property name must be valid",params:({params:D})=>ak._`{propertyName: ${D.propertyName}}`},H20={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:W20,code(D){let{gen:F,schema:$,data:J,it:Q}=D;if((0,G20.alwaysValidSchema)(Q,$))return;let Y=F.name("valid");F.forIn("key",J,(B)=>{D.setParams({propertyName:B}),D.subschema({keyword:"propertyNames",data:B,dataTypes:["string"],propertyName:B,compositeRule:!0},Y),F.if((0,ak.not)(Y),()=>{if(D.error(!0),!Q.allErrors)F.break()})}),D.ok(Y)}};ok.default=H20});var PG=z((rk)=>{Object.defineProperty(rk,"__esModule",{value:!0});var AJ=N1(),u1=t(),K20=M1(),MJ=z0(),z20={message:"must NOT have additional properties",params:({params:D})=>u1._`{additionalProperty: ${D.additionalProperty}}`},E20={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:z20,code(D){let{gen:F,schema:$,parentSchema:J,data:Q,errsCount:Y,it:B}=D;if(!Y)throw Error("ajv implementation error");let{allErrors:X,opts:G}=B;if(B.props=!0,G.removeAdditional!=="all"&&(0,MJ.alwaysValidSchema)(B,$))return;let H=(0,AJ.allSchemaProperties)(J.properties),q=(0,AJ.allSchemaProperties)(J.patternProperties);K(),D.ok(u1._`${Y} === ${K20.default.errors}`);function K(){F.forIn("key",Q,(M)=>{if(!H.length&&!q.length)Z(M);else F.if(V(M),()=>Z(M))})}function V(M){let A;if(H.length>8){let N=(0,MJ.schemaRefOrVal)(B,J.properties,"properties");A=(0,AJ.isOwnProperty)(F,N,M)}else if(H.length)A=(0,u1.or)(...H.map((N)=>u1._`${M} === ${N}`));else A=u1.nil;if(q.length)A=(0,u1.or)(A,...q.map((N)=>u1._`${(0,AJ.usePattern)(D,N)}.test(${M})`));return(0,u1.not)(A)}function E(M){F.code(u1._`delete ${Q}[${M}]`)}function Z(M){if(G.removeAdditional==="all"||G.removeAdditional&&$===!1){E(M);return}if($===!1){if(D.setParams({additionalProperty:M}),D.error(),!X)F.break();return}if(typeof $=="object"&&!(0,MJ.alwaysValidSchema)(B,$)){let A=F.name("valid");if(G.removeAdditional==="failing")L(M,A,!1),F.if((0,u1.not)(A),()=>{D.reset(),E(M)});else if(L(M,A),!X)F.if((0,u1.not)(A),()=>F.break())}}function L(M,A,N){let w={keyword:"additionalProperties",dataProp:M,dataPropType:MJ.Type.Str};if(N===!1)Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1});D.subschema(w,A)}}};rk.default=E20});var Fv=z((Dv)=>{Object.defineProperty(Dv,"__esModule",{value:!0});var Z20=FF(),tk=N1(),IG=z0(),ek=PG(),U20={keyword:"properties",type:"object",schemaType:"object",code(D){let{gen:F,schema:$,parentSchema:J,data:Q,it:Y}=D;if(Y.opts.removeAdditional==="all"&&J.additionalProperties===void 0)ek.default.code(new Z20.KeywordCxt(Y,ek.default,"additionalProperties"));let B=(0,tk.allSchemaProperties)($);for(let K of B)Y.definedProperties.add(K);if(Y.opts.unevaluated&&B.length&&Y.props!==!0)Y.props=IG.mergeEvaluated.props(F,(0,IG.toHash)(B),Y.props);let X=B.filter((K)=>!(0,IG.alwaysValidSchema)(Y,$[K]));if(X.length===0)return;let G=F.name("valid");for(let K of X){if(H(K))q(K);else{if(F.if((0,tk.propertyInData)(F,Q,K,Y.opts.ownProperties)),q(K),!Y.allErrors)F.else().var(G,!0);F.endIf()}D.it.definedProperties.add(K),D.ok(G)}function H(K){return Y.opts.useDefaults&&!Y.compositeRule&&$[K].default!==void 0}function q(K){D.subschema({keyword:"properties",schemaProp:K,dataProp:K},G)}}};Dv.default=U20});var Bv=z((Yv)=>{Object.defineProperty(Yv,"__esModule",{value:!0});var $v=N1(),NJ=t(),Jv=z0(),Qv=z0(),A20={keyword:"patternProperties",type:"object",schemaType:"object",code(D){let{gen:F,schema:$,data:J,parentSchema:Q,it:Y}=D,{opts:B}=Y,X=(0,$v.allSchemaProperties)($),G=X.filter((L)=>(0,Jv.alwaysValidSchema)(Y,$[L]));if(X.length===0||G.length===X.length&&(!Y.opts.unevaluated||Y.props===!0))return;let H=B.strictSchema&&!B.allowMatchingProperties&&Q.properties,q=F.name("valid");if(Y.props!==!0&&!(Y.props instanceof NJ.Name))Y.props=(0,Qv.evaluatedPropsToName)(F,Y.props);let{props:K}=Y;V();function V(){for(let L of X){if(H)E(L);if(Y.allErrors)Z(L);else F.var(q,!0),Z(L),F.if(q)}}function E(L){for(let M in H)if(new RegExp(L).test(M))(0,Jv.checkStrictMode)(Y,`property ${M} matches pattern ${L} (use allowMatchingProperties)`)}function Z(L){F.forIn("key",J,(M)=>{F.if(NJ._`${(0,$v.usePattern)(D,L)}.test(${M})`,()=>{let A=G.includes(L);if(!A)D.subschema({keyword:"patternProperties",schemaProp:L,dataProp:M,dataPropType:Qv.Type.Str},q);if(Y.opts.unevaluated&&K!==!0)F.assign(NJ._`${K}[${M}]`,!0);else if(!A&&!Y.allErrors)F.if((0,NJ.not)(q),()=>F.break())})})}}};Yv.default=A20});var Gv=z((Xv)=>{Object.defineProperty(Xv,"__esModule",{value:!0});var N20=z0(),R20={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(D){let{gen:F,schema:$,it:J}=D;if((0,N20.alwaysValidSchema)(J,$)){D.fail();return}let Q=F.name("valid");D.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},Q),D.failResult(Q,()=>D.reset(),()=>D.error())},error:{message:"must NOT be valid"}};Xv.default=R20});var Hv=z((Wv)=>{Object.defineProperty(Wv,"__esModule",{value:!0});var O20=N1(),w20={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:O20.validateUnion,error:{message:"must match a schema in anyOf"}};Wv.default=w20});var Kv=z((qv)=>{Object.defineProperty(qv,"__esModule",{value:!0});var RJ=t(),T20=z0(),P20={message:"must match exactly one schema in oneOf",params:({params:D})=>RJ._`{passingSchemas: ${D.passing}}`},I20={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:P20,code(D){let{gen:F,schema:$,parentSchema:J,it:Q}=D;if(!Array.isArray($))throw Error("ajv implementation error");if(Q.opts.discriminator&&J.discriminator)return;let Y=$,B=F.let("valid",!1),X=F.let("passing",null),G=F.name("_valid");D.setParams({passing:X}),F.block(H),D.result(B,()=>D.reset(),()=>D.error(!0));function H(){Y.forEach((q,K)=>{let V;if((0,T20.alwaysValidSchema)(Q,q))F.var(G,!0);else V=D.subschema({keyword:"oneOf",schemaProp:K,compositeRule:!0},G);if(K>0)F.if(RJ._`${G} && ${B}`).assign(B,!1).assign(X,RJ._`[${X}, ${K}]`).else();F.if(G,()=>{if(F.assign(B,!0),F.assign(X,K),V)D.mergeEvaluated(V,RJ.Name)})})}}};qv.default=I20});var Ev=z((zv)=>{Object.defineProperty(zv,"__esModule",{value:!0});var k20=z0(),v20={keyword:"allOf",schemaType:"array",code(D){let{gen:F,schema:$,it:J}=D;if(!Array.isArray($))throw Error("ajv implementation error");let Q=F.name("valid");$.forEach((Y,B)=>{if((0,k20.alwaysValidSchema)(J,Y))return;let X=D.subschema({keyword:"allOf",schemaProp:B},Q);D.ok(Q),D.mergeEvaluated(X)})}};zv.default=v20});var Lv=z((Uv)=>{Object.defineProperty(Uv,"__esModule",{value:!0});var CJ=t(),Zv=z0(),x20={message:({params:D})=>CJ.str`must match "${D.ifClause}" schema`,params:({params:D})=>CJ._`{failingKeyword: ${D.ifClause}}`},_20={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:x20,code(D){let{gen:F,parentSchema:$,it:J}=D;if($.then===void 0&&$.else===void 0)(0,Zv.checkStrictMode)(J,'"if" without "then" and "else" is ignored');let Q=Vv(J,"then"),Y=Vv(J,"else");if(!Q&&!Y)return;let B=F.let("valid",!0),X=F.name("_valid");if(G(),D.reset(),Q&&Y){let q=F.let("ifClause");D.setParams({ifClause:q}),F.if(X,H("then",q),H("else",q))}else if(Q)F.if(X,H("then"));else F.if((0,CJ.not)(X),H("else"));D.pass(B,()=>D.error(!0));function G(){let q=D.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},X);D.mergeEvaluated(q)}function H(q,K){return()=>{let V=D.subschema({keyword:q},X);if(F.assign(B,X),D.mergeValidEvaluated(V,B),K)F.assign(K,CJ._`${q}`);else D.setParams({ifClause:q})}}}};function Vv(D,F){let $=D.schema[F];return $!==void 0&&!(0,Zv.alwaysValidSchema)(D,$)}Uv.default=_20});var Mv=z((Av)=>{Object.defineProperty(Av,"__esModule",{value:!0});var g20=z0(),h20={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:D,parentSchema:F,it:$}){if(F.if===void 0)(0,g20.checkStrictMode)($,`"${D}" without "if" is ignored`)}};Av.default=h20});var SG=z((Nv)=>{Object.defineProperty(Nv,"__esModule",{value:!0});var u20=wG(),m20=gk(),l20=jG(),p20=uk(),d20=lk(),c20=LJ(),n20=sk(),i20=PG(),a20=Fv(),o20=Bv(),s20=Gv(),r20=Hv(),t20=Kv(),e20=Ev(),DX0=Lv(),FX0=Mv();function $X0(D=!1){let F=[s20.default,r20.default,t20.default,e20.default,DX0.default,FX0.default,n20.default,i20.default,c20.default,a20.default,o20.default];if(D)F.push(m20.default,p20.default);else F.push(u20.default,l20.default);return F.push(d20.default),F}Nv.default=$X0});var vG=z((Ov)=>{Object.defineProperty(Ov,"__esModule",{value:!0});Ov.dynamicAnchor=void 0;var kG=t(),QX0=M1(),Rv=r5(),YX0=qJ(),BX0={keyword:"$dynamicAnchor",schemaType:"string",code:(D)=>Cv(D,D.schema)};function Cv(D,F){let{gen:$,it:J}=D;J.schemaEnv.root.dynamicAnchors[F]=!0;let Q=kG._`${QX0.default.dynamicAnchors}${(0,kG.getProperty)(F)}`,Y=J.errSchemaPath==="#"?J.validateName:XX0(D);$.if(kG._`!${Q}`,()=>$.assign(Q,Y))}Ov.dynamicAnchor=Cv;function XX0(D){let{schemaEnv:F,schema:$,self:J}=D.it,{root:Q,baseId:Y,localRefs:B,meta:X}=F.root,{schemaId:G}=J.opts,H=new Rv.SchemaEnv({schema:$,schemaId:G,root:Q,baseId:Y,localRefs:B,meta:X});return Rv.compileSchema.call(J,H),(0,YX0.getValidate)(D,H)}Ov.default=BX0});var yG=z((Iv)=>{Object.defineProperty(Iv,"__esModule",{value:!0});Iv.dynamicRef=void 0;var jv=t(),WX0=M1(),Tv=qJ(),HX0={keyword:"$dynamicRef",schemaType:"string",code:(D)=>Pv(D,D.schema)};function Pv(D,F){let{gen:$,keyword:J,it:Q}=D;if(F[0]!=="#")throw Error(`"${J}" only supports hash fragment reference`);let Y=F.slice(1);if(Q.allErrors)B();else{let G=$.let("valid",!1);B(G),D.ok(G)}function B(G){if(Q.schemaEnv.root.dynamicAnchors[Y]){let H=$.let("_v",jv._`${WX0.default.dynamicAnchors}${(0,jv.getProperty)(Y)}`);$.if(H,X(H,G),X(Q.validateName,G))}else X(Q.validateName,G)()}function X(G,H){return H?()=>$.block(()=>{(0,Tv.callRef)(D,G),$.let(H,!0)}):()=>(0,Tv.callRef)(D,G)}}Iv.dynamicRef=Pv;Iv.default=HX0});var vv=z((kv)=>{Object.defineProperty(kv,"__esModule",{value:!0});var KX0=vG(),zX0=z0(),EX0={keyword:"$recursiveAnchor",schemaType:"boolean",code(D){if(D.schema)(0,KX0.dynamicAnchor)(D,"");else(0,zX0.checkStrictMode)(D.it,"$recursiveAnchor: false is ignored")}};kv.default=EX0});var xv=z((yv)=>{Object.defineProperty(yv,"__esModule",{value:!0});var ZX0=yG(),UX0={keyword:"$recursiveRef",schemaType:"string",code:(D)=>(0,ZX0.dynamicRef)(D,D.schema)};yv.default=UX0});var fv=z((_v)=>{Object.defineProperty(_v,"__esModule",{value:!0});var AX0=vG(),MX0=yG(),NX0=vv(),RX0=xv(),CX0=[AX0.default,MX0.default,NX0.default,RX0.default];_v.default=CX0});var bv=z((hv)=>{Object.defineProperty(hv,"__esModule",{value:!0});var gv=LJ(),wX0={keyword:"dependentRequired",type:"object",schemaType:"object",error:gv.error,code:(D)=>(0,gv.validatePropertyDeps)(D)};hv.default=wX0});var mv=z((uv)=>{Object.defineProperty(uv,"__esModule",{value:!0});var TX0=LJ(),PX0={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(D)=>(0,TX0.validateSchemaDeps)(D)};uv.default=PX0});var pv=z((lv)=>{Object.defineProperty(lv,"__esModule",{value:!0});var SX0=z0(),kX0={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:D,parentSchema:F,it:$}){if(F.contains===void 0)(0,SX0.checkStrictMode)($,`"${D}" without "contains" is ignored`)}};lv.default=kX0});var cv=z((dv)=>{Object.defineProperty(dv,"__esModule",{value:!0});var yX0=bv(),xX0=mv(),_X0=pv(),fX0=[yX0.default,xX0.default,_X0.default];dv.default=fX0});var av=z((iv)=>{Object.defineProperty(iv,"__esModule",{value:!0});var b6=t(),nv=z0(),hX0=M1(),bX0={message:"must NOT have unevaluated properties",params:({params:D})=>b6._`{unevaluatedProperty: ${D.unevaluatedProperty}}`},uX0={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:bX0,code(D){let{gen:F,schema:$,data:J,errsCount:Q,it:Y}=D;if(!Q)throw Error("ajv implementation error");let{allErrors:B,props:X}=Y;if(X instanceof b6.Name)F.if(b6._`${X} !== true`,()=>F.forIn("key",J,(K)=>F.if(H(X,K),()=>G(K))));else if(X!==!0)F.forIn("key",J,(K)=>X===void 0?G(K):F.if(q(X,K),()=>G(K)));Y.props=!0,D.ok(b6._`${Q} === ${hX0.default.errors}`);function G(K){if($===!1){if(D.setParams({unevaluatedProperty:K}),D.error(),!B)F.break();return}if(!(0,nv.alwaysValidSchema)(Y,$)){let V=F.name("valid");if(D.subschema({keyword:"unevaluatedProperties",dataProp:K,dataPropType:nv.Type.Str},V),!B)F.if((0,b6.not)(V),()=>F.break())}}function H(K,V){return b6._`!${K} || !${K}[${V}]`}function q(K,V){let E=[];for(let Z in K)if(K[Z]===!0)E.push(b6._`${V} !== ${Z}`);return(0,b6.and)(...E)}}};iv.default=uX0});var rv=z((sv)=>{Object.defineProperty(sv,"__esModule",{value:!0});var C4=t(),ov=z0(),lX0={message:({params:{len:D}})=>C4.str`must NOT have more than ${D} items`,params:({params:{len:D}})=>C4._`{limit: ${D}}`},pX0={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:lX0,code(D){let{gen:F,schema:$,data:J,it:Q}=D,Y=Q.items||0;if(Y===!0)return;let B=F.const("len",C4._`${J}.length`);if($===!1)D.setParams({len:Y}),D.fail(C4._`${B} > ${Y}`);else if(typeof $=="object"&&!(0,ov.alwaysValidSchema)(Q,$)){let G=F.var("valid",C4._`${B} <= ${Y}`);F.if((0,C4.not)(G),()=>X(G,Y)),D.ok(G)}Q.items=!0;function X(G,H){F.forRange("i",H,B,(q)=>{if(D.subschema({keyword:"unevaluatedItems",dataProp:q,dataPropType:ov.Type.Num},G),!Q.allErrors)F.if((0,C4.not)(G),()=>F.break())})}}};sv.default=pX0});var ev=z((tv)=>{Object.defineProperty(tv,"__esModule",{value:!0});var cX0=av(),nX0=rv(),iX0=[cX0.default,nX0.default];tv.default=iX0});var Fy=z((Dy)=>{Object.defineProperty(Dy,"__esModule",{value:!0});var $D=t(),oX0={message:({schemaCode:D})=>$D.str`must match format "${D}"`,params:({schemaCode:D})=>$D._`{format: ${D}}`},sX0={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:oX0,code(D,F){let{gen:$,data:J,$data:Q,schema:Y,schemaCode:B,it:X}=D,{opts:G,errSchemaPath:H,schemaEnv:q,self:K}=X;if(!G.validateFormats)return;if(Q)V();else E();function V(){let Z=$.scopeValue("formats",{ref:K.formats,code:G.code.formats}),L=$.const("fDef",$D._`${Z}[${B}]`),M=$.let("fType"),A=$.let("format");$.if($D._`typeof ${L} == "object" && !(${L} instanceof RegExp)`,()=>$.assign(M,$D._`${L}.type || "string"`).assign(A,$D._`${L}.validate`),()=>$.assign(M,$D._`"string"`).assign(A,L)),D.fail$data((0,$D.or)(N(),w()));function N(){if(G.strictSchema===!1)return $D.nil;return $D._`${B} && !${A}`}function w(){let P=q.$async?$D._`(${L}.async ? await ${A}(${J}) : ${A}(${J}))`:$D._`${A}(${J})`,C=$D._`(typeof ${A} == "function" ? ${P} : ${A}.test(${J}))`;return $D._`${A} && ${A} !== true && ${M} === ${F} && !${C}`}}function E(){let Z=K.formats[Y];if(!Z){N();return}if(Z===!0)return;let[L,M,A]=w(Z);if(L===F)D.pass(P());function N(){if(G.strictSchema===!1){K.logger.warn(C());return}throw Error(C());function C(){return`unknown format "${Y}" ignored in schema at path "${H}"`}}function w(C){let T=C instanceof RegExp?(0,$D.regexpCode)(C):G.code.formats?$D._`${G.code.formats}${(0,$D.getProperty)(Y)}`:void 0,y=$.scopeValue("formats",{key:Y,ref:C,code:T});if(typeof C=="object"&&!(C instanceof RegExp))return[C.type||"string",C.validate,$D._`${y}.validate`];return["string",C,y]}function P(){if(typeof Z=="object"&&!(Z instanceof RegExp)&&Z.async){if(!q.$async)throw Error("async format in sync schema");return $D._`await ${A}(${J})`}return typeof M=="function"?$D._`${A}(${J})`:$D._`${A}.test(${J})`}}}};Dy.default=sX0});var xG=z(($y)=>{Object.defineProperty($y,"__esModule",{value:!0});var tX0=Fy(),eX0=[tX0.default];$y.default=eX0});var _G=z((Jy)=>{Object.defineProperty(Jy,"__esModule",{value:!0});Jy.contentVocabulary=Jy.metadataVocabulary=void 0;Jy.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Jy.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Xy=z((By)=>{Object.defineProperty(By,"__esModule",{value:!0});var $G0=MG(),JG0=CG(),QG0=SG(),YG0=fv(),BG0=cv(),XG0=ev(),GG0=xG(),Yy=_G(),WG0=[YG0.default,$G0.default,JG0.default,(0,QG0.default)(!0),GG0.default,Yy.metadataVocabulary,Yy.contentVocabulary,BG0.default,XG0.default];By.default=WG0});var qy=z((Wy)=>{Object.defineProperty(Wy,"__esModule",{value:!0});Wy.DiscrError=void 0;var Gy;(function(D){D.Tag="tag",D.Mapping="mapping"})(Gy||(Wy.DiscrError=Gy={}))});var gG=z((zy)=>{Object.defineProperty(zy,"__esModule",{value:!0});var YF=t(),fG=qy(),Ky=r5(),qG0=$F(),KG0=z0(),zG0={message:({params:{discrError:D,tagName:F}})=>D===fG.DiscrError.Tag?`tag "${F}" must be string`:`value of tag "${F}" must be in oneOf`,params:({params:{discrError:D,tag:F,tagName:$}})=>YF._`{error: ${D}, tag: ${$}, tagValue: ${F}}`},EG0={keyword:"discriminator",type:"object",schemaType:"object",error:zG0,code(D){let{gen:F,data:$,schema:J,parentSchema:Q,it:Y}=D,{oneOf:B}=Q;if(!Y.opts.discriminator)throw Error("discriminator: requires discriminator option");let X=J.propertyName;if(typeof X!="string")throw Error("discriminator: requires propertyName");if(J.mapping)throw Error("discriminator: mapping is not supported");if(!B)throw Error("discriminator: requires oneOf keyword");let G=F.let("valid",!1),H=F.const("tag",YF._`${$}${(0,YF.getProperty)(X)}`);F.if(YF._`typeof ${H} == "string"`,()=>q(),()=>D.error(!1,{discrError:fG.DiscrError.Tag,tag:H,tagName:X})),D.ok(G);function q(){let E=V();F.if(!1);for(let Z in E)F.elseIf(YF._`${H} === ${Z}`),F.assign(G,K(E[Z]));F.else(),D.error(!1,{discrError:fG.DiscrError.Mapping,tag:H,tagName:X}),F.endIf()}function K(E){let Z=F.name("valid"),L=D.subschema({keyword:"oneOf",schemaProp:E},Z);return D.mergeEvaluated(L,YF.Name),Z}function V(){var E;let Z={},L=A(Q),M=!0;for(let P=0;P<B.length;P++){let C=B[P];if((C===null||C===void 0?void 0:C.$ref)&&!(0,KG0.schemaHasRulesButRef)(C,Y.self.RULES)){let y=C.$ref;if(C=Ky.resolveRef.call(Y.self,Y.schemaEnv.root,Y.baseId,y),C instanceof Ky.SchemaEnv)C=C.schema;if(C===void 0)throw new qG0.default(Y.opts.uriResolver,Y.baseId,y)}let T=(E=C===null||C===void 0?void 0:C.properties)===null||E===void 0?void 0:E[X];if(typeof T!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${X}"`);M=M&&(L||A(C)),N(T,P)}if(!M)throw Error(`discriminator: "${X}" must be required`);return Z;function A({required:P}){return Array.isArray(P)&&P.includes(X)}function N(P,C){if(P.const)w(P.const,C);else if(P.enum)for(let T of P.enum)w(T,C);else throw Error(`discriminator: "properties/${X}" must have "const" or "enum"`)}function w(P,C){if(typeof P!="string"||P in Z)throw Error(`discriminator: "${X}" values must be unique strings`);Z[P]=C}}}};zy.default=EG0});var Ey=z((DP0,ZG0)=>{ZG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var Vy=z((FP0,UG0)=>{UG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var Zy=z(($P0,LG0)=>{LG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var Uy=z((JP0,AG0)=>{AG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var Ly=z((QP0,MG0)=>{MG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var Ay=z((YP0,NG0)=>{NG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var My=z((BP0,RG0)=>{RG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var Ny=z((XP0,CG0)=>{CG0.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var Cy=z((Ry)=>{Object.defineProperty(Ry,"__esModule",{value:!0});var OG0=Ey(),wG0=Vy(),jG0=Zy(),TG0=Uy(),PG0=Ly(),IG0=Ay(),SG0=My(),kG0=Ny(),vG0=["/properties"];function yG0(D){return[OG0,wG0,jG0,TG0,PG0,F(this,IG0),SG0,F(this,kG0)].forEach(($)=>this.addMetaSchema($,void 0,!1)),this;function F($,J){return D?$.$dataMetaSchema(J,vG0):J}}Ry.default=yG0});var Oy=z((rD,bG)=>{Object.defineProperty(rD,"__esModule",{value:!0});rD.MissingRefError=rD.ValidationError=rD.CodeGen=rD.Name=rD.nil=rD.stringify=rD.str=rD._=rD.KeywordCxt=rD.Ajv2020=void 0;var _G0=AG(),fG0=Xy(),gG0=gG(),hG0=Cy(),hG="https://json-schema.org/draft/2020-12/schema";class G9 extends _G0.default{constructor(D={}){super({...D,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),fG0.default.forEach((D)=>this.addVocabulary(D)),this.opts.discriminator)this.addKeyword(gG0.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:D,meta:F}=this.opts;if(!F)return;hG0.default.call(this,D),this.refs["http://json-schema.org/schema"]=hG}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(hG)?hG:void 0)}}rD.Ajv2020=G9;bG.exports=rD=G9;bG.exports.Ajv2020=G9;Object.defineProperty(rD,"__esModule",{value:!0});rD.default=G9;var bG0=FF();Object.defineProperty(rD,"KeywordCxt",{enumerable:!0,get:function(){return bG0.KeywordCxt}});var BF=t();Object.defineProperty(rD,"_",{enumerable:!0,get:function(){return BF._}});Object.defineProperty(rD,"str",{enumerable:!0,get:function(){return BF.str}});Object.defineProperty(rD,"stringify",{enumerable:!0,get:function(){return BF.stringify}});Object.defineProperty(rD,"nil",{enumerable:!0,get:function(){return BF.nil}});Object.defineProperty(rD,"Name",{enumerable:!0,get:function(){return BF.Name}});Object.defineProperty(rD,"CodeGen",{enumerable:!0,get:function(){return BF.CodeGen}});var uG0=o5();Object.defineProperty(rD,"ValidationError",{enumerable:!0,get:function(){return uG0.default}});var mG0=$F();Object.defineProperty(rD,"MissingRefError",{enumerable:!0,get:function(){return mG0.default}})});var xy=z((vy)=>{Object.defineProperty(vy,"__esModule",{value:!0});vy.formatNames=vy.fastFormats=vy.fullFormats=void 0;function A8(D,F){return{validate:D,compare:F}}vy.fullFormats={date:A8(Py,pG),time:A8(mG(!0),dG),"date-time":A8(wy(!0),Sy),"iso-time":A8(mG(),Iy),"iso-date-time":A8(wy(),ky),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:oG0,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:$W0,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:sG0,int32:{type:"number",validate:eG0},int64:{type:"number",validate:DW0},float:{type:"number",validate:Ty},double:{type:"number",validate:Ty},password:!0,binary:!0};vy.fastFormats={...vy.fullFormats,date:A8(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,pG),time:A8(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,dG),"date-time":A8(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Sy),"iso-time":A8(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Iy),"iso-date-time":A8(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ky),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};vy.formatNames=Object.keys(vy.fullFormats);function dG0(D){return D%4===0&&(D%100!==0||D%400===0)}var cG0=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,nG0=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Py(D){let F=cG0.exec(D);if(!F)return!1;let $=+F[1],J=+F[2],Q=+F[3];return J>=1&&J<=12&&Q>=1&&Q<=(J===2&&dG0($)?29:nG0[J])}function pG(D,F){if(!(D&&F))return;if(D>F)return 1;if(D<F)return-1;return 0}var uG=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function mG(D){return function($){let J=uG.exec($);if(!J)return!1;let Q=+J[1],Y=+J[2],B=+J[3],X=J[4],G=J[5]==="-"?-1:1,H=+(J[6]||0),q=+(J[7]||0);if(H>23||q>59||D&&!X)return!1;if(Q<=23&&Y<=59&&B<60)return!0;let K=Y-q*G,V=Q-H*G-(K<0?1:0);return(V===23||V===-1)&&(K===59||K===-1)&&B<61}}function dG(D,F){if(!(D&&F))return;let $=new Date("2020-01-01T"+D).valueOf(),J=new Date("2020-01-01T"+F).valueOf();if(!($&&J))return;return $-J}function Iy(D,F){if(!(D&&F))return;let $=uG.exec(D),J=uG.exec(F);if(!($&&J))return;if(D=$[1]+$[2]+$[3],F=J[1]+J[2]+J[3],D>F)return 1;if(D<F)return-1;return 0}var lG=/t|\s/i;function wy(D){let F=mG(D);return function(J){let Q=J.split(lG);return Q.length===2&&Py(Q[0])&&F(Q[1])}}function Sy(D,F){if(!(D&&F))return;let $=new Date(D).valueOf(),J=new Date(F).valueOf();if(!($&&J))return;return $-J}function ky(D,F){if(!(D&&F))return;let[$,J]=D.split(lG),[Q,Y]=F.split(lG),B=pG($,Q);if(B===void 0)return;return B||dG(J,Y)}var iG0=/\/|:/,aG0=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function oG0(D){return iG0.test(D)&&aG0.test(D)}var jy=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function sG0(D){return jy.lastIndex=0,jy.test(D)}var rG0=-2147483648,tG0=2147483647;function eG0(D){return Number.isInteger(D)&&D<=tG0&&D>=rG0}function DW0(D){return Number.isInteger(D)}function Ty(){return!0}var FW0=/[^\\]\\Z/;function $W0(D){if(FW0.test(D))return!1;try{return new RegExp(D),!0}catch(F){return!1}}});var gy=z((fy)=>{Object.defineProperty(fy,"__esModule",{value:!0});var QW0=MG(),YW0=CG(),BW0=SG(),XW0=xG(),_y=_G(),GW0=[QW0.default,YW0.default,(0,BW0.default)(),XW0.default,_y.metadataVocabulary,_y.contentVocabulary];fy.default=GW0});var hy=z((AP0,HW0)=>{HW0.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 uy=z((tD,nG)=>{Object.defineProperty(tD,"__esModule",{value:!0});tD.MissingRefError=tD.ValidationError=tD.CodeGen=tD.Name=tD.nil=tD.stringify=tD.str=tD._=tD.KeywordCxt=tD.Ajv=void 0;var qW0=AG(),KW0=gy(),zW0=gG(),by=hy(),EW0=["/properties"],OJ="http://json-schema.org/draft-07/schema";class W9 extends qW0.default{_addVocabularies(){if(super._addVocabularies(),KW0.default.forEach((D)=>this.addVocabulary(D)),this.opts.discriminator)this.addKeyword(zW0.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let D=this.opts.$data?this.$dataMetaSchema(by,EW0):by;this.addMetaSchema(D,OJ,!1),this.refs["http://json-schema.org/schema"]=OJ}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(OJ)?OJ:void 0)}}tD.Ajv=W9;nG.exports=tD=W9;nG.exports.Ajv=W9;Object.defineProperty(tD,"__esModule",{value:!0});tD.default=W9;var VW0=FF();Object.defineProperty(tD,"KeywordCxt",{enumerable:!0,get:function(){return VW0.KeywordCxt}});var XF=t();Object.defineProperty(tD,"_",{enumerable:!0,get:function(){return XF._}});Object.defineProperty(tD,"str",{enumerable:!0,get:function(){return XF.str}});Object.defineProperty(tD,"stringify",{enumerable:!0,get:function(){return XF.stringify}});Object.defineProperty(tD,"nil",{enumerable:!0,get:function(){return XF.nil}});Object.defineProperty(tD,"Name",{enumerable:!0,get:function(){return XF.Name}});Object.defineProperty(tD,"CodeGen",{enumerable:!0,get:function(){return XF.CodeGen}});var ZW0=o5();Object.defineProperty(tD,"ValidationError",{enumerable:!0,get:function(){return ZW0.default}});var UW0=$F();Object.defineProperty(tD,"MissingRefError",{enumerable:!0,get:function(){return UW0.default}})});var ly=z((my)=>{Object.defineProperty(my,"__esModule",{value:!0});my.formatLimitDefinition=void 0;var MW0=uy(),m1=t(),u6=m1.operators,wJ={formatMaximum:{okStr:"<=",ok:u6.LTE,fail:u6.GT},formatMinimum:{okStr:">=",ok:u6.GTE,fail:u6.LT},formatExclusiveMaximum:{okStr:"<",ok:u6.LT,fail:u6.GTE},formatExclusiveMinimum:{okStr:">",ok:u6.GT,fail:u6.LTE}},NW0={message:({keyword:D,schemaCode:F})=>m1.str`should be ${wJ[D].okStr} ${F}`,params:({keyword:D,schemaCode:F})=>m1._`{comparison: ${wJ[D].okStr}, limit: ${F}}`};my.formatLimitDefinition={keyword:Object.keys(wJ),type:"string",schemaType:"string",$data:!0,error:NW0,code(D){let{gen:F,data:$,schemaCode:J,keyword:Q,it:Y}=D,{opts:B,self:X}=Y;if(!B.validateFormats)return;let G=new MW0.KeywordCxt(Y,X.RULES.all.format.definition,"format");if(G.$data)H();else q();function H(){let V=F.scopeValue("formats",{ref:X.formats,code:B.code.formats}),E=F.const("fmt",m1._`${V}[${G.schemaCode}]`);D.fail$data((0,m1.or)(m1._`typeof ${E} != "object"`,m1._`${E} instanceof RegExp`,m1._`typeof ${E}.compare != "function"`,K(E)))}function q(){let V=G.schema,E=X.formats[V];if(!E||E===!0)return;if(typeof E!="object"||E instanceof RegExp||typeof E.compare!="function")throw Error(`"${Q}": format "${V}" does not define "compare" function`);let Z=F.scopeValue("formats",{key:V,ref:E,code:B.code.formats?m1._`${B.code.formats}${(0,m1.getProperty)(V)}`:void 0});D.fail$data(K(Z))}function K(V){return m1._`${V}.compare(${$}, ${J}) ${wJ[Q].fail} 0`}},dependencies:["format"]};var RW0=(D)=>{return D.addKeyword(my.formatLimitDefinition),D};my.default=RW0});var ny=z((H9,cy)=>{Object.defineProperty(H9,"__esModule",{value:!0});var GF=xy(),OW0=ly(),aG=t(),py=new aG.Name("fullFormats"),wW0=new aG.Name("fastFormats"),oG=(D,F={keywords:!0})=>{if(Array.isArray(F))return dy(D,F,GF.fullFormats,py),D;let[$,J]=F.mode==="fast"?[GF.fastFormats,wW0]:[GF.fullFormats,py],Q=F.formats||GF.formatNames;if(dy(D,Q,$,J),F.keywords)(0,OW0.default)(D);return D};oG.get=(D,F="full")=>{let J=(F==="fast"?GF.fastFormats:GF.fullFormats)[D];if(!J)throw Error(`Unknown format "${D}"`);return J};function dy(D,F,$,J){var Q,Y;(Q=(Y=D.opts.code).formats)!==null&&Q!==void 0||(Y.formats=aG._`require("ajv-formats/dist/formats").${J}`);for(let B of F)D.addFormat(B,$[B])}cy.exports=H9=oG;Object.defineProperty(H9,"__esModule",{value:!0});H9.default=oG});var jW0=(D,F={})=>{if(typeof D!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof D}\``);let{wait:$=0,maxWait:J=Number.POSITIVE_INFINITY,before:Q=!1,after:Y=!0}=F;if($<0||J<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!Q&&!Y)throw Error("Both `before` and `after` are false, function wouldn't be called.");let B,X,G,H=function(...q){let K=this,V=()=>{if(B=void 0,X)clearTimeout(X),X=void 0;if(Y)G=D.apply(K,q)},E=()=>{if(X=void 0,B)clearTimeout(B),B=void 0;if(Y)G=D.apply(K,q)},Z=Q&&!B;if(clearTimeout(B),B=setTimeout(V,$),J>0&&J!==Number.POSITIVE_INFINITY&&!X)X=setTimeout(E,J);if(Z)G=D.apply(K,q);return G};return x5(H,D),H.cancel=()=>{if(B)clearTimeout(B),B=void 0;if(X)clearTimeout(X),X=void 0},H},sG;var iy=I(()=>{BX();sG=jW0});var q9=z((kP0,ay)=>{var TW0=Number.MAX_SAFE_INTEGER||9007199254740991,PW0=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ay.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:TW0,RELEASE_TYPES:PW0,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var K9=z((vP0,oy)=>{var IW0=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...D)=>console.error("SEMVER",...D):()=>{};oy.exports=IW0});var WF=z((M8,sy)=>{var{MAX_SAFE_COMPONENT_LENGTH:rG,MAX_SAFE_BUILD_LENGTH:SW0,MAX_LENGTH:kW0}=q9(),vW0=K9();M8=sy.exports={};var yW0=M8.re=[],xW0=M8.safeRe=[],_=M8.src=[],_W0=M8.safeSrc=[],f=M8.t={},fW0=0,tG="[a-zA-Z0-9-]",gW0=[["\\s",1],["\\d",kW0],[tG,SW0]],hW0=(D)=>{for(let[F,$]of gW0)D=D.split(`${F}*`).join(`${F}{0,${$}}`).split(`${F}+`).join(`${F}{1,${$}}`);return D},$0=(D,F,$)=>{let J=hW0(F),Q=fW0++;vW0(D,Q,F),f[D]=Q,_[Q]=F,_W0[Q]=J,yW0[Q]=new RegExp(F,$?"g":void 0),xW0[Q]=new RegExp(J,$?"g":void 0)};$0("NUMERICIDENTIFIER","0|[1-9]\\d*");$0("NUMERICIDENTIFIERLOOSE","\\d+");$0("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${tG}*`);$0("MAINVERSION",`(${_[f.NUMERICIDENTIFIER]})\\.(${_[f.NUMERICIDENTIFIER]})\\.(${_[f.NUMERICIDENTIFIER]})`);$0("MAINVERSIONLOOSE",`(${_[f.NUMERICIDENTIFIERLOOSE]})\\.(${_[f.NUMERICIDENTIFIERLOOSE]})\\.(${_[f.NUMERICIDENTIFIERLOOSE]})`);$0("PRERELEASEIDENTIFIER",`(?:${_[f.NONNUMERICIDENTIFIER]}|${_[f.NUMERICIDENTIFIER]})`);$0("PRERELEASEIDENTIFIERLOOSE",`(?:${_[f.NONNUMERICIDENTIFIER]}|${_[f.NUMERICIDENTIFIERLOOSE]})`);$0("PRERELEASE",`(?:-(${_[f.PRERELEASEIDENTIFIER]}(?:\\.${_[f.PRERELEASEIDENTIFIER]})*))`);$0("PRERELEASELOOSE",`(?:-?(${_[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${_[f.PRERELEASEIDENTIFIERLOOSE]})*))`);$0("BUILDIDENTIFIER",`${tG}+`);$0("BUILD",`(?:\\+(${_[f.BUILDIDENTIFIER]}(?:\\.${_[f.BUILDIDENTIFIER]})*))`);$0("FULLPLAIN",`v?${_[f.MAINVERSION]}${_[f.PRERELEASE]}?${_[f.BUILD]}?`);$0("FULL",`^${_[f.FULLPLAIN]}$`);$0("LOOSEPLAIN",`[v=\\s]*${_[f.MAINVERSIONLOOSE]}${_[f.PRERELEASELOOSE]}?${_[f.BUILD]}?`);$0("LOOSE",`^${_[f.LOOSEPLAIN]}$`);$0("GTLT","((?:<|>)?=?)");$0("XRANGEIDENTIFIERLOOSE",`${_[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);$0("XRANGEIDENTIFIER",`${_[f.NUMERICIDENTIFIER]}|x|X|\\*`);$0("XRANGEPLAIN",`[v=\\s]*(${_[f.XRANGEIDENTIFIER]})(?:\\.(${_[f.XRANGEIDENTIFIER]})(?:\\.(${_[f.XRANGEIDENTIFIER]})(?:${_[f.PRERELEASE]})?${_[f.BUILD]}?)?)?`);$0("XRANGEPLAINLOOSE",`[v=\\s]*(${_[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${_[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${_[f.XRANGEIDENTIFIERLOOSE]})(?:${_[f.PRERELEASELOOSE]})?${_[f.BUILD]}?)?)?`);$0("XRANGE",`^${_[f.GTLT]}\\s*${_[f.XRANGEPLAIN]}$`);$0("XRANGELOOSE",`^${_[f.GTLT]}\\s*${_[f.XRANGEPLAINLOOSE]}$`);$0("COERCEPLAIN",`(^|[^\\d])(\\d{1,${rG}})(?:\\.(\\d{1,${rG}}))?(?:\\.(\\d{1,${rG}}))?`);$0("COERCE",`${_[f.COERCEPLAIN]}(?:$|[^\\d])`);$0("COERCEFULL",_[f.COERCEPLAIN]+`(?:${_[f.PRERELEASE]})?(?:${_[f.BUILD]})?(?:$|[^\\d])`);$0("COERCERTL",_[f.COERCE],!0);$0("COERCERTLFULL",_[f.COERCEFULL],!0);$0("LONETILDE","(?:~>?)");$0("TILDETRIM",`(\\s*)${_[f.LONETILDE]}\\s+`,!0);M8.tildeTrimReplace="$1~";$0("TILDE",`^${_[f.LONETILDE]}${_[f.XRANGEPLAIN]}$`);$0("TILDELOOSE",`^${_[f.LONETILDE]}${_[f.XRANGEPLAINLOOSE]}$`);$0("LONECARET","(?:\\^)");$0("CARETTRIM",`(\\s*)${_[f.LONECARET]}\\s+`,!0);M8.caretTrimReplace="$1^";$0("CARET",`^${_[f.LONECARET]}${_[f.XRANGEPLAIN]}$`);$0("CARETLOOSE",`^${_[f.LONECARET]}${_[f.XRANGEPLAINLOOSE]}$`);$0("COMPARATORLOOSE",`^${_[f.GTLT]}\\s*(${_[f.LOOSEPLAIN]})$|^$`);$0("COMPARATOR",`^${_[f.GTLT]}\\s*(${_[f.FULLPLAIN]})$|^$`);$0("COMPARATORTRIM",`(\\s*)${_[f.GTLT]}\\s*(${_[f.LOOSEPLAIN]}|${_[f.XRANGEPLAIN]})`,!0);M8.comparatorTrimReplace="$1$2$3";$0("HYPHENRANGE",`^\\s*(${_[f.XRANGEPLAIN]})\\s+-\\s+(${_[f.XRANGEPLAIN]})\\s*$`);$0("HYPHENRANGELOOSE",`^\\s*(${_[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${_[f.XRANGEPLAINLOOSE]})\\s*$`);$0("STAR","(<|>)?=?\\s*\\*");$0("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");$0("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var jJ=z((yP0,ry)=>{var bW0=Object.freeze({loose:!0}),uW0=Object.freeze({}),mW0=(D)=>{if(!D)return uW0;if(typeof D!=="object")return bW0;return D};ry.exports=mW0});var eG=z((xP0,Dx)=>{var ty=/^[0-9]+$/,ey=(D,F)=>{if(typeof D==="number"&&typeof F==="number")return D===F?0:D<F?-1:1;let $=ty.test(D),J=ty.test(F);if($&&J)D=+D,F=+F;return D===F?0:$&&!J?-1:J&&!$?1:D<F?-1:1},lW0=(D,F)=>ey(F,D);Dx.exports={compareIdentifiers:ey,rcompareIdentifiers:lW0}});var PD=z((_P0,$x)=>{var TJ=K9(),{MAX_LENGTH:Fx,MAX_SAFE_INTEGER:PJ}=q9(),{safeRe:IJ,t:SJ}=WF(),pW0=jJ(),{compareIdentifiers:DW}=eG();class l1{constructor(D,F){if(F=pW0(F),D instanceof l1)if(D.loose===!!F.loose&&D.includePrerelease===!!F.includePrerelease)return D;else D=D.version;else if(typeof D!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof D}".`);if(D.length>Fx)throw TypeError(`version is longer than ${Fx} characters`);TJ("SemVer",D,F),this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease;let $=D.trim().match(F.loose?IJ[SJ.LOOSE]:IJ[SJ.FULL]);if(!$)throw TypeError(`Invalid Version: ${D}`);if(this.raw=D,this.major=+$[1],this.minor=+$[2],this.patch=+$[3],this.major>PJ||this.major<0)throw TypeError("Invalid major version");if(this.minor>PJ||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>PJ||this.patch<0)throw TypeError("Invalid patch version");if(!$[4])this.prerelease=[];else this.prerelease=$[4].split(".").map((J)=>{if(/^[0-9]+$/.test(J)){let Q=+J;if(Q>=0&&Q<PJ)return Q}return J});this.build=$[5]?$[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(D){if(TJ("SemVer.compare",this.version,this.options,D),!(D instanceof l1)){if(typeof D==="string"&&D===this.version)return 0;D=new l1(D,this.options)}if(D.version===this.version)return 0;return this.compareMain(D)||this.comparePre(D)}compareMain(D){if(!(D instanceof l1))D=new l1(D,this.options);if(this.major<D.major)return-1;if(this.major>D.major)return 1;if(this.minor<D.minor)return-1;if(this.minor>D.minor)return 1;if(this.patch<D.patch)return-1;if(this.patch>D.patch)return 1;return 0}comparePre(D){if(!(D instanceof l1))D=new l1(D,this.options);if(this.prerelease.length&&!D.prerelease.length)return-1;else if(!this.prerelease.length&&D.prerelease.length)return 1;else if(!this.prerelease.length&&!D.prerelease.length)return 0;let F=0;do{let $=this.prerelease[F],J=D.prerelease[F];if(TJ("prerelease compare",F,$,J),$===void 0&&J===void 0)return 0;else if(J===void 0)return 1;else if($===void 0)return-1;else if($===J)continue;else return DW($,J)}while(++F)}compareBuild(D){if(!(D instanceof l1))D=new l1(D,this.options);let F=0;do{let $=this.build[F],J=D.build[F];if(TJ("build compare",F,$,J),$===void 0&&J===void 0)return 0;else if(J===void 0)return 1;else if($===void 0)return-1;else if($===J)continue;else return DW($,J)}while(++F)}inc(D,F,$){if(D.startsWith("pre")){if(!F&&$===!1)throw Error("invalid increment argument: identifier is empty");if(F){let J=`-${F}`.match(this.options.loose?IJ[SJ.PRERELEASELOOSE]:IJ[SJ.PRERELEASE]);if(!J||J[1]!==F)throw Error(`invalid identifier: ${F}`)}}switch(D){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",F,$);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",F,$);break;case"prepatch":this.prerelease.length=0,this.inc("patch",F,$),this.inc("pre",F,$);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",F,$);this.inc("pre",F,$);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let J=Number($)?1:0;if(this.prerelease.length===0)this.prerelease=[J];else{let Q=this.prerelease.length;while(--Q>=0)if(typeof this.prerelease[Q]==="number")this.prerelease[Q]++,Q=-2;if(Q===-1){if(F===this.prerelease.join(".")&&$===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(J)}}if(F){let Q=[F,J];if($===!1)Q=[F];if(DW(this.prerelease[0],F)===0){if(isNaN(this.prerelease[1]))this.prerelease=Q}else this.prerelease=Q}break}default:throw Error(`invalid increment argument: ${D}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}$x.exports=l1});var O4=z((fP0,Qx)=>{var Jx=PD(),dW0=(D,F,$=!1)=>{if(D instanceof Jx)return D;try{return new Jx(D,F)}catch(J){if(!$)return null;throw J}};Qx.exports=dW0});var Bx=z((gP0,Yx)=>{var cW0=O4(),nW0=(D,F)=>{let $=cW0(D,F);return $?$.version:null};Yx.exports=nW0});var Gx=z((hP0,Xx)=>{var iW0=O4(),aW0=(D,F)=>{let $=iW0(D.trim().replace(/^[=v]+/,""),F);return $?$.version:null};Xx.exports=aW0});var qx=z((bP0,Hx)=>{var Wx=PD(),oW0=(D,F,$,J,Q)=>{if(typeof $==="string")Q=J,J=$,$=void 0;try{return new Wx(D instanceof Wx?D.version:D,$).inc(F,J,Q).version}catch(Y){return null}};Hx.exports=oW0});var Ex=z((uP0,zx)=>{var Kx=O4(),sW0=(D,F)=>{let $=Kx(D,null,!0),J=Kx(F,null,!0),Q=$.compare(J);if(Q===0)return null;let Y=Q>0,B=Y?$:J,X=Y?J:$,G=!!B.prerelease.length;if(!!X.prerelease.length&&!G){if(!X.patch&&!X.minor)return"major";if(X.compareMain(B)===0){if(X.minor&&!X.patch)return"minor";return"patch"}}let q=G?"pre":"";if($.major!==J.major)return q+"major";if($.minor!==J.minor)return q+"minor";if($.patch!==J.patch)return q+"patch";return"prerelease"};zx.exports=sW0});var Zx=z((mP0,Vx)=>{var rW0=PD(),tW0=(D,F)=>new rW0(D,F).major;Vx.exports=tW0});var Lx=z((lP0,Ux)=>{var eW0=PD(),DH0=(D,F)=>new eW0(D,F).minor;Ux.exports=DH0});var Mx=z((pP0,Ax)=>{var FH0=PD(),$H0=(D,F)=>new FH0(D,F).patch;Ax.exports=$H0});var Rx=z((dP0,Nx)=>{var JH0=O4(),QH0=(D,F)=>{let $=JH0(D,F);return $&&$.prerelease.length?$.prerelease:null};Nx.exports=QH0});var C1=z((cP0,Ox)=>{var Cx=PD(),YH0=(D,F,$)=>new Cx(D,$).compare(new Cx(F,$));Ox.exports=YH0});var jx=z((nP0,wx)=>{var BH0=C1(),XH0=(D,F,$)=>BH0(F,D,$);wx.exports=XH0});var Px=z((iP0,Tx)=>{var GH0=C1(),WH0=(D,F)=>GH0(D,F,!0);Tx.exports=WH0});var kJ=z((aP0,Sx)=>{var Ix=PD(),HH0=(D,F,$)=>{let J=new Ix(D,$),Q=new Ix(F,$);return J.compare(Q)||J.compareBuild(Q)};Sx.exports=HH0});var vx=z((oP0,kx)=>{var qH0=kJ(),KH0=(D,F)=>D.sort(($,J)=>qH0($,J,F));kx.exports=KH0});var xx=z((sP0,yx)=>{var zH0=kJ(),EH0=(D,F)=>D.sort(($,J)=>zH0(J,$,F));yx.exports=EH0});var z9=z((rP0,_x)=>{var VH0=C1(),ZH0=(D,F,$)=>VH0(D,F,$)>0;_x.exports=ZH0});var vJ=z((tP0,fx)=>{var UH0=C1(),LH0=(D,F,$)=>UH0(D,F,$)<0;fx.exports=LH0});var FW=z((eP0,gx)=>{var AH0=C1(),MH0=(D,F,$)=>AH0(D,F,$)===0;gx.exports=MH0});var $W=z((DI0,hx)=>{var NH0=C1(),RH0=(D,F,$)=>NH0(D,F,$)!==0;hx.exports=RH0});var yJ=z((FI0,bx)=>{var CH0=C1(),OH0=(D,F,$)=>CH0(D,F,$)>=0;bx.exports=OH0});var xJ=z(($I0,ux)=>{var wH0=C1(),jH0=(D,F,$)=>wH0(D,F,$)<=0;ux.exports=jH0});var JW=z((JI0,mx)=>{var TH0=FW(),PH0=$W(),IH0=z9(),SH0=yJ(),kH0=vJ(),vH0=xJ(),yH0=(D,F,$,J)=>{switch(F){case"===":if(typeof D==="object")D=D.version;if(typeof $==="object")$=$.version;return D===$;case"!==":if(typeof D==="object")D=D.version;if(typeof $==="object")$=$.version;return D!==$;case"":case"=":case"==":return TH0(D,$,J);case"!=":return PH0(D,$,J);case">":return IH0(D,$,J);case">=":return SH0(D,$,J);case"<":return kH0(D,$,J);case"<=":return vH0(D,$,J);default:throw TypeError(`Invalid operator: ${F}`)}};mx.exports=yH0});var px=z((QI0,lx)=>{var xH0=PD(),_H0=O4(),{safeRe:_J,t:fJ}=WF(),fH0=(D,F)=>{if(D instanceof xH0)return D;if(typeof D==="number")D=String(D);if(typeof D!=="string")return null;F=F||{};let $=null;if(!F.rtl)$=D.match(F.includePrerelease?_J[fJ.COERCEFULL]:_J[fJ.COERCE]);else{let G=F.includePrerelease?_J[fJ.COERCERTLFULL]:_J[fJ.COERCERTL],H;while((H=G.exec(D))&&(!$||$.index+$[0].length!==D.length)){if(!$||H.index+H[0].length!==$.index+$[0].length)$=H;G.lastIndex=H.index+H[1].length+H[2].length}G.lastIndex=-1}if($===null)return null;let J=$[2],Q=$[3]||"0",Y=$[4]||"0",B=F.includePrerelease&&$[5]?`-${$[5]}`:"",X=F.includePrerelease&&$[6]?`+${$[6]}`:"";return _H0(`${J}.${Q}.${Y}${B}${X}`,F)};lx.exports=fH0});var nx=z((YI0,cx)=>{class dx{constructor(){this.max=1000,this.map=new Map}get(D){let F=this.map.get(D);if(F===void 0)return;else return this.map.delete(D),this.map.set(D,F),F}delete(D){return this.map.delete(D)}set(D,F){if(!this.delete(D)&&F!==void 0){if(this.map.size>=this.max){let J=this.map.keys().next().value;this.delete(J)}this.map.set(D,F)}return this}}cx.exports=dx});var O1=z((BI0,sx)=>{var gH0=/\s+/g;class E9{constructor(D,F){if(F=bH0(F),D instanceof E9)if(D.loose===!!F.loose&&D.includePrerelease===!!F.includePrerelease)return D;else return new E9(D.raw,F);if(D instanceof QW)return this.raw=D.value,this.set=[[D]],this.formatted=void 0,this;if(this.options=F,this.loose=!!F.loose,this.includePrerelease=!!F.includePrerelease,this.raw=D.trim().replace(gH0," "),this.set=this.raw.split("||").map(($)=>this.parseRange($.trim())).filter(($)=>$.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let $=this.set[0];if(this.set=this.set.filter((J)=>!ax(J[0])),this.set.length===0)this.set=[$];else if(this.set.length>1){for(let J of this.set)if(J.length===1&&nH0(J[0])){this.set=[J];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let D=0;D<this.set.length;D++){if(D>0)this.formatted+="||";let F=this.set[D];for(let $=0;$<F.length;$++){if($>0)this.formatted+=" ";this.formatted+=F[$].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(D){let $=((this.options.includePrerelease&&dH0)|(this.options.loose&&cH0))+":"+D,J=ix.get($);if(J)return J;let Q=this.options.loose,Y=Q?hD[ID.HYPHENRANGELOOSE]:hD[ID.HYPHENRANGE];D=D.replace(Y,$q0(this.options.includePrerelease)),m0("hyphen replace",D),D=D.replace(hD[ID.COMPARATORTRIM],mH0),m0("comparator trim",D),D=D.replace(hD[ID.TILDETRIM],lH0),m0("tilde trim",D),D=D.replace(hD[ID.CARETTRIM],pH0),m0("caret trim",D);let B=D.split(" ").map((q)=>iH0(q,this.options)).join(" ").split(/\s+/).map((q)=>Fq0(q,this.options));if(Q)B=B.filter((q)=>{return m0("loose invalid filter",q,this.options),!!q.match(hD[ID.COMPARATORLOOSE])});m0("range list",B);let X=new Map,G=B.map((q)=>new QW(q,this.options));for(let q of G){if(ax(q))return[q];X.set(q.value,q)}if(X.size>1&&X.has(""))X.delete("");let H=[...X.values()];return ix.set($,H),H}intersects(D,F){if(!(D instanceof E9))throw TypeError("a Range is required");return this.set.some(($)=>{return ox($,F)&&D.set.some((J)=>{return ox(J,F)&&$.every((Q)=>{return J.every((Y)=>{return Q.intersects(Y,F)})})})})}test(D){if(!D)return!1;if(typeof D==="string")try{D=new uH0(D,this.options)}catch(F){return!1}for(let F=0;F<this.set.length;F++)if(Jq0(this.set[F],D,this.options))return!0;return!1}}sx.exports=E9;var hH0=nx(),ix=new hH0,bH0=jJ(),QW=V9(),m0=K9(),uH0=PD(),{safeRe:hD,t:ID,comparatorTrimReplace:mH0,tildeTrimReplace:lH0,caretTrimReplace:pH0}=WF(),{FLAG_INCLUDE_PRERELEASE:dH0,FLAG_LOOSE:cH0}=q9(),ax=(D)=>D.value==="<0.0.0-0",nH0=(D)=>D.value==="",ox=(D,F)=>{let $=!0,J=D.slice(),Q=J.pop();while($&&J.length)$=J.every((Y)=>{return Q.intersects(Y,F)}),Q=J.pop();return $},iH0=(D,F)=>{return D=D.replace(hD[ID.BUILD],""),m0("comp",D,F),D=sH0(D,F),m0("caret",D),D=aH0(D,F),m0("tildes",D),D=tH0(D,F),m0("xrange",D),D=Dq0(D,F),m0("stars",D),D},bD=(D)=>!D||D.toLowerCase()==="x"||D==="*",aH0=(D,F)=>{return D.trim().split(/\s+/).map(($)=>oH0($,F)).join(" ")},oH0=(D,F)=>{let $=F.loose?hD[ID.TILDELOOSE]:hD[ID.TILDE];return D.replace($,(J,Q,Y,B,X)=>{m0("tilde",D,J,Q,Y,B,X);let G;if(bD(Q))G="";else if(bD(Y))G=`>=${Q}.0.0 <${+Q+1}.0.0-0`;else if(bD(B))G=`>=${Q}.${Y}.0 <${Q}.${+Y+1}.0-0`;else if(X)m0("replaceTilde pr",X),G=`>=${Q}.${Y}.${B}-${X} <${Q}.${+Y+1}.0-0`;else G=`>=${Q}.${Y}.${B} <${Q}.${+Y+1}.0-0`;return m0("tilde return",G),G})},sH0=(D,F)=>{return D.trim().split(/\s+/).map(($)=>rH0($,F)).join(" ")},rH0=(D,F)=>{m0("caret",D,F);let $=F.loose?hD[ID.CARETLOOSE]:hD[ID.CARET],J=F.includePrerelease?"-0":"";return D.replace($,(Q,Y,B,X,G)=>{m0("caret",D,Q,Y,B,X,G);let H;if(bD(Y))H="";else if(bD(B))H=`>=${Y}.0.0${J} <${+Y+1}.0.0-0`;else if(bD(X))if(Y==="0")H=`>=${Y}.${B}.0${J} <${Y}.${+B+1}.0-0`;else H=`>=${Y}.${B}.0${J} <${+Y+1}.0.0-0`;else if(G)if(m0("replaceCaret pr",G),Y==="0")if(B==="0")H=`>=${Y}.${B}.${X}-${G} <${Y}.${B}.${+X+1}-0`;else H=`>=${Y}.${B}.${X}-${G} <${Y}.${+B+1}.0-0`;else H=`>=${Y}.${B}.${X}-${G} <${+Y+1}.0.0-0`;else if(m0("no pr"),Y==="0")if(B==="0")H=`>=${Y}.${B}.${X}${J} <${Y}.${B}.${+X+1}-0`;else H=`>=${Y}.${B}.${X}${J} <${Y}.${+B+1}.0-0`;else H=`>=${Y}.${B}.${X} <${+Y+1}.0.0-0`;return m0("caret return",H),H})},tH0=(D,F)=>{return m0("replaceXRanges",D,F),D.split(/\s+/).map(($)=>eH0($,F)).join(" ")},eH0=(D,F)=>{D=D.trim();let $=F.loose?hD[ID.XRANGELOOSE]:hD[ID.XRANGE];return D.replace($,(J,Q,Y,B,X,G)=>{m0("xRange",D,J,Q,Y,B,X,G);let H=bD(Y),q=H||bD(B),K=q||bD(X),V=K;if(Q==="="&&V)Q="";if(G=F.includePrerelease?"-0":"",H)if(Q===">"||Q==="<")J="<0.0.0-0";else J="*";else if(Q&&V){if(q)B=0;if(X=0,Q===">")if(Q=">=",q)Y=+Y+1,B=0,X=0;else B=+B+1,X=0;else if(Q==="<=")if(Q="<",q)Y=+Y+1;else B=+B+1;if(Q==="<")G="-0";J=`${Q+Y}.${B}.${X}${G}`}else if(q)J=`>=${Y}.0.0${G} <${+Y+1}.0.0-0`;else if(K)J=`>=${Y}.${B}.0${G} <${Y}.${+B+1}.0-0`;return m0("xRange return",J),J})},Dq0=(D,F)=>{return m0("replaceStars",D,F),D.trim().replace(hD[ID.STAR],"")},Fq0=(D,F)=>{return m0("replaceGTE0",D,F),D.trim().replace(hD[F.includePrerelease?ID.GTE0PRE:ID.GTE0],"")},$q0=(D)=>(F,$,J,Q,Y,B,X,G,H,q,K,V)=>{if(bD(J))$="";else if(bD(Q))$=`>=${J}.0.0${D?"-0":""}`;else if(bD(Y))$=`>=${J}.${Q}.0${D?"-0":""}`;else if(B)$=`>=${$}`;else $=`>=${$}${D?"-0":""}`;if(bD(H))G="";else if(bD(q))G=`<${+H+1}.0.0-0`;else if(bD(K))G=`<${H}.${+q+1}.0-0`;else if(V)G=`<=${H}.${q}.${K}-${V}`;else if(D)G=`<${H}.${q}.${+K+1}-0`;else G=`<=${G}`;return`${$} ${G}`.trim()},Jq0=(D,F,$)=>{for(let J=0;J<D.length;J++)if(!D[J].test(F))return!1;if(F.prerelease.length&&!$.includePrerelease){for(let J=0;J<D.length;J++){if(m0(D[J].semver),D[J].semver===QW.ANY)continue;if(D[J].semver.prerelease.length>0){let Q=D[J].semver;if(Q.major===F.major&&Q.minor===F.minor&&Q.patch===F.patch)return!0}}return!1}return!0}});var V9=z((XI0,$_)=>{var Z9=Symbol("SemVer ANY");class gJ{static get ANY(){return Z9}constructor(D,F){if(F=rx(F),D instanceof gJ)if(D.loose===!!F.loose)return D;else D=D.value;if(D=D.trim().split(/\s+/).join(" "),BW("comparator",D,F),this.options=F,this.loose=!!F.loose,this.parse(D),this.semver===Z9)this.value="";else this.value=this.operator+this.semver.version;BW("comp",this)}parse(D){let F=this.options.loose?tx[ex.COMPARATORLOOSE]:tx[ex.COMPARATOR],$=D.match(F);if(!$)throw TypeError(`Invalid comparator: ${D}`);if(this.operator=$[1]!==void 0?$[1]:"",this.operator==="=")this.operator="";if(!$[2])this.semver=Z9;else this.semver=new D_($[2],this.options.loose)}toString(){return this.value}test(D){if(BW("Comparator.test",D,this.options.loose),this.semver===Z9||D===Z9)return!0;if(typeof D==="string")try{D=new D_(D,this.options)}catch(F){return!1}return YW(D,this.operator,this.semver,this.options)}intersects(D,F){if(!(D instanceof gJ))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new F_(D.value,F).test(this.value)}else if(D.operator===""){if(D.value==="")return!0;return new F_(this.value,F).test(D.semver)}if(F=rx(F),F.includePrerelease&&(this.value==="<0.0.0-0"||D.value==="<0.0.0-0"))return!1;if(!F.includePrerelease&&(this.value.startsWith("<0.0.0")||D.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&D.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&D.operator.startsWith("<"))return!0;if(this.semver.version===D.semver.version&&this.operator.includes("=")&&D.operator.includes("="))return!0;if(YW(this.semver,"<",D.semver,F)&&this.operator.startsWith(">")&&D.operator.startsWith("<"))return!0;if(YW(this.semver,">",D.semver,F)&&this.operator.startsWith("<")&&D.operator.startsWith(">"))return!0;return!1}}$_.exports=gJ;var rx=jJ(),{safeRe:tx,t:ex}=WF(),YW=JW(),BW=K9(),D_=PD(),F_=O1()});var U9=z((GI0,J_)=>{var Qq0=O1(),Yq0=(D,F,$)=>{try{F=new Qq0(F,$)}catch(J){return!1}return F.test(D)};J_.exports=Yq0});var Y_=z((WI0,Q_)=>{var Bq0=O1(),Xq0=(D,F)=>new Bq0(D,F).set.map(($)=>$.map((J)=>J.value).join(" ").trim().split(" "));Q_.exports=Xq0});var X_=z((HI0,B_)=>{var Gq0=PD(),Wq0=O1(),Hq0=(D,F,$)=>{let J=null,Q=null,Y=null;try{Y=new Wq0(F,$)}catch(B){return null}return D.forEach((B)=>{if(Y.test(B)){if(!J||Q.compare(B)===-1)J=B,Q=new Gq0(J,$)}}),J};B_.exports=Hq0});var W_=z((qI0,G_)=>{var qq0=PD(),Kq0=O1(),zq0=(D,F,$)=>{let J=null,Q=null,Y=null;try{Y=new Kq0(F,$)}catch(B){return null}return D.forEach((B)=>{if(Y.test(B)){if(!J||Q.compare(B)===1)J=B,Q=new qq0(J,$)}}),J};G_.exports=zq0});var K_=z((KI0,q_)=>{var XW=PD(),Eq0=O1(),H_=z9(),Vq0=(D,F)=>{D=new Eq0(D,F);let $=new XW("0.0.0");if(D.test($))return $;if($=new XW("0.0.0-0"),D.test($))return $;$=null;for(let J=0;J<D.set.length;++J){let Q=D.set[J],Y=null;if(Q.forEach((B)=>{let X=new XW(B.semver.version);switch(B.operator){case">":if(X.prerelease.length===0)X.patch++;else X.prerelease.push(0);X.raw=X.format();case"":case">=":if(!Y||H_(X,Y))Y=X;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${B.operator}`)}}),Y&&(!$||H_($,Y)))$=Y}if($&&D.test($))return $;return null};q_.exports=Vq0});var E_=z((zI0,z_)=>{var Zq0=O1(),Uq0=(D,F)=>{try{return new Zq0(D,F).range||"*"}catch($){return null}};z_.exports=Uq0});var hJ=z((EI0,L_)=>{var Lq0=PD(),U_=V9(),{ANY:Aq0}=U_,Mq0=O1(),Nq0=U9(),V_=z9(),Z_=vJ(),Rq0=xJ(),Cq0=yJ(),Oq0=(D,F,$,J)=>{D=new Lq0(D,J),F=new Mq0(F,J);let Q,Y,B,X,G;switch($){case">":Q=V_,Y=Rq0,B=Z_,X=">",G=">=";break;case"<":Q=Z_,Y=Cq0,B=V_,X="<",G="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Nq0(D,F,J))return!1;for(let H=0;H<F.set.length;++H){let q=F.set[H],K=null,V=null;if(q.forEach((E)=>{if(E.semver===Aq0)E=new U_(">=0.0.0");if(K=K||E,V=V||E,Q(E.semver,K.semver,J))K=E;else if(B(E.semver,V.semver,J))V=E}),K.operator===X||K.operator===G)return!1;if((!V.operator||V.operator===X)&&Y(D,V.semver))return!1;else if(V.operator===G&&B(D,V.semver))return!1}return!0};L_.exports=Oq0});var M_=z((VI0,A_)=>{var wq0=hJ(),jq0=(D,F,$)=>wq0(D,F,">",$);A_.exports=jq0});var R_=z((ZI0,N_)=>{var Tq0=hJ(),Pq0=(D,F,$)=>Tq0(D,F,"<",$);N_.exports=Pq0});var w_=z((UI0,O_)=>{var C_=O1(),Iq0=(D,F,$)=>{return D=new C_(D,$),F=new C_(F,$),D.intersects(F,$)};O_.exports=Iq0});var T_=z((LI0,j_)=>{var Sq0=U9(),kq0=C1();j_.exports=(D,F,$)=>{let J=[],Q=null,Y=null,B=D.sort((q,K)=>kq0(q,K,$));for(let q of B)if(Sq0(q,F,$)){if(Y=q,!Q)Q=q}else{if(Y)J.push([Q,Y]);Y=null,Q=null}if(Q)J.push([Q,null]);let X=[];for(let[q,K]of J)if(q===K)X.push(q);else if(!K&&q===B[0])X.push("*");else if(!K)X.push(`>=${q}`);else if(q===B[0])X.push(`<=${K}`);else X.push(`${q} - ${K}`);let G=X.join(" || "),H=typeof F.raw==="string"?F.raw:String(F);return G.length<H.length?G:F}});var y_=z((AI0,v_)=>{var P_=O1(),WW=V9(),{ANY:GW}=WW,L9=U9(),HW=C1(),vq0=(D,F,$={})=>{if(D===F)return!0;D=new P_(D,$),F=new P_(F,$);let J=!1;D:for(let Q of D.set){for(let Y of F.set){let B=xq0(Q,Y,$);if(J=J||B!==null,B)continue D}if(J)return!1}return!0},yq0=[new WW(">=0.0.0-0")],I_=[new WW(">=0.0.0")],xq0=(D,F,$)=>{if(D===F)return!0;if(D.length===1&&D[0].semver===GW)if(F.length===1&&F[0].semver===GW)return!0;else if($.includePrerelease)D=yq0;else D=I_;if(F.length===1&&F[0].semver===GW)if($.includePrerelease)return!0;else F=I_;let J=new Set,Q,Y;for(let E of D)if(E.operator===">"||E.operator===">=")Q=S_(Q,E,$);else if(E.operator==="<"||E.operator==="<=")Y=k_(Y,E,$);else J.add(E.semver);if(J.size>1)return null;let B;if(Q&&Y){if(B=HW(Q.semver,Y.semver,$),B>0)return null;else if(B===0&&(Q.operator!==">="||Y.operator!=="<="))return null}for(let E of J){if(Q&&!L9(E,String(Q),$))return null;if(Y&&!L9(E,String(Y),$))return null;for(let Z of F)if(!L9(E,String(Z),$))return!1;return!0}let X,G,H,q,K=Y&&!$.includePrerelease&&Y.semver.prerelease.length?Y.semver:!1,V=Q&&!$.includePrerelease&&Q.semver.prerelease.length?Q.semver:!1;if(K&&K.prerelease.length===1&&Y.operator==="<"&&K.prerelease[0]===0)K=!1;for(let E of F){if(q=q||E.operator===">"||E.operator===">=",H=H||E.operator==="<"||E.operator==="<=",Q){if(V){if(E.semver.prerelease&&E.semver.prerelease.length&&E.semver.major===V.major&&E.semver.minor===V.minor&&E.semver.patch===V.patch)V=!1}if(E.operator===">"||E.operator===">="){if(X=S_(Q,E,$),X===E&&X!==Q)return!1}else if(Q.operator===">="&&!L9(Q.semver,String(E),$))return!1}if(Y){if(K){if(E.semver.prerelease&&E.semver.prerelease.length&&E.semver.major===K.major&&E.semver.minor===K.minor&&E.semver.patch===K.patch)K=!1}if(E.operator==="<"||E.operator==="<="){if(G=k_(Y,E,$),G===E&&G!==Y)return!1}else if(Y.operator==="<="&&!L9(Y.semver,String(E),$))return!1}if(!E.operator&&(Y||Q)&&B!==0)return!1}if(Q&&H&&!Y&&B!==0)return!1;if(Y&&q&&!Q&&B!==0)return!1;if(V||K)return!1;return!0},S_=(D,F,$)=>{if(!D)return F;let J=HW(D.semver,F.semver,$);return J>0?D:J<0?F:F.operator===">"&&D.operator===">="?F:D},k_=(D,F,$)=>{if(!D)return F;let J=HW(D.semver,F.semver,$);return J<0?D:J>0?F:F.operator==="<"&&D.operator==="<="?F:D};v_.exports=vq0});var g_=z((MI0,f_)=>{var qW=WF(),x_=q9(),_q0=PD(),__=eG(),fq0=O4(),gq0=Bx(),hq0=Gx(),bq0=qx(),uq0=Ex(),mq0=Zx(),lq0=Lx(),pq0=Mx(),dq0=Rx(),cq0=C1(),nq0=jx(),iq0=Px(),aq0=kJ(),oq0=vx(),sq0=xx(),rq0=z9(),tq0=vJ(),eq0=FW(),DK0=$W(),FK0=yJ(),$K0=xJ(),JK0=JW(),QK0=px(),YK0=V9(),BK0=O1(),XK0=U9(),GK0=Y_(),WK0=X_(),HK0=W_(),qK0=K_(),KK0=E_(),zK0=hJ(),EK0=M_(),VK0=R_(),ZK0=w_(),UK0=T_(),LK0=y_();f_.exports={parse:fq0,valid:gq0,clean:hq0,inc:bq0,diff:uq0,major:mq0,minor:lq0,patch:pq0,prerelease:dq0,compare:cq0,rcompare:nq0,compareLoose:iq0,compareBuild:aq0,sort:oq0,rsort:sq0,gt:rq0,lt:tq0,eq:eq0,neq:DK0,gte:FK0,lte:$K0,cmp:JK0,coerce:QK0,Comparator:YK0,Range:BK0,satisfies:XK0,toComparators:GK0,maxSatisfying:WK0,minSatisfying:HK0,minVersion:qK0,validRange:KK0,outside:zK0,gtr:EK0,ltr:VK0,intersects:ZK0,simplifyRange:UK0,subset:LK0,SemVer:_q0,re:qW.re,src:qW.src,tokens:qW.t,SEMVER_SPEC_VERSION:x_.SEMVER_SPEC_VERSION,RELEASE_TYPES:x_.RELEASE_TYPES,compareIdentifiers:__.compareIdentifiers,rcompareIdentifiers:__.rcompareIdentifiers}});function b_(D,F,$){if(!D)return!1;if(D.constructor===F)return!0;return AK0.call(D)===$}function u_(D){return b_(D,Uint8Array,"[object Uint8Array]")}function MK0(D){return b_(D,ArrayBuffer,"[object ArrayBuffer]")}function NK0(D){return u_(D)||MK0(D)}function RK0(D){if(!u_(D))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof D}\``)}function CK0(D){if(!NK0(D))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof D}\``)}function KW(D,F){if(D.length===0)return new Uint8Array(0);F??=D.reduce((Q,Y)=>Q+Y.length,0);let $=new Uint8Array(F),J=0;for(let Q of D)RK0(Q),$.set(Q,J),J+=Q.length;return $}function zW(D,F="utf8"){return CK0(D),h_[F]??=new globalThis.TextDecoder(F),h_[F].decode(D)}function OK0(D){if(typeof D!=="string")throw TypeError(`Expected \`string\`, got \`${typeof D}\``)}function bJ(D){return OK0(D),wK0.encode(D)}var AK0,h_,wK0,NI0;var m_=I(()=>{AK0=Object.prototype.toString;h_={utf8:new globalThis.TextDecoder("utf8")};wK0=new globalThis.TextEncoder;NI0=Array.from({length:256},(D,F)=>F.toString(16).padStart(2,"0"))});import{isDeepStrictEqual as jK0}from"util";import l_ from"process";import w4 from"fs";import p_ from"path";import A9 from"crypto";import TK0 from"assert";var c_,n_,j4,PK0,d_="aes-256-cbc",HF=()=>Object.create(null),IK0=(D)=>D!==void 0&&D!==null,SK0=(D,F)=>{let $=new Set(["undefined","symbol","function"]),J=typeof F;if($.has(J))throw TypeError(`Setting a value of type \`${J}\` for key \`${D}\` is not allowed as it's not supported by JSON`)},uJ="__internal__",EW,mJ;var i_=I(()=>{DP();$P();vP();iy();m_();c_=s(Oy(),1),n_=s(ny(),1),j4=s(g_(),1),PK0=n_.default.default,EW=`${uJ}.migrations.version`;mJ=class mJ{path;events;#$;#F;#D;#Q={};constructor(D={}){let F={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...D};if(!F.cwd){if(!F.projectName)throw Error("Please specify the `projectName` option.");F.cwd=OX(F.projectName,{suffix:F.projectSuffix}).config}if(this.#D=F,F.schema??F.ajvOptions??F.rootSchema){if(F.schema&&typeof F.schema!=="object")throw TypeError("The `schema` option must be an object.");let Y=new c_.Ajv2020({allErrors:!0,useDefaults:!0,...F.ajvOptions});PK0(Y);let B={...F.rootSchema,type:"object",properties:F.schema};this.#$=Y.compile(B);for(let[X,G]of Object.entries(F.schema??{}))if(G?.default)this.#Q[X]=G.default}if(F.defaults)this.#Q={...this.#Q,...F.defaults};if(F.serialize)this._serialize=F.serialize;if(F.deserialize)this._deserialize=F.deserialize;this.events=new EventTarget,this.#F=F.encryptionKey;let $=F.fileExtension?`.${F.fileExtension}`:"";this.path=p_.resolve(F.cwd,`${F.configName??"config"}${$}`);let J=this.store,Q=Object.assign(HF(),F.defaults,J);if(F.migrations){if(!F.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(F.migrations,F.projectVersion,F.beforeEachMigration)}this._validate(Q);try{TK0.deepEqual(J,Q)}catch{this.store=Q}if(F.watch)this._watch()}get(D,F){if(this.#D.accessPropertiesByDotNotation)return this._get(D,F);let{store:$}=this;return D in $?$[D]:F}set(D,F){if(typeof D!=="string"&&typeof D!=="object")throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof D}`);if(typeof D!=="object"&&F===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(D))throw TypeError(`Please don't use the ${uJ} key, as it's used to manage this module internal operations.`);let{store:$}=this,J=(Q,Y)=>{if(SK0(Q,Y),this.#D.accessPropertiesByDotNotation)NX($,Q,Y);else $[Q]=Y};if(typeof D==="object"){let Q=D;for(let[Y,B]of Object.entries(Q))J(Y,B)}else J(D,F);this.store=$}has(D){if(this.#D.accessPropertiesByDotNotation)return eT(this.store,D);return D in this.store}reset(...D){for(let F of D)if(IK0(this.#Q[F]))this.set(F,this.#Q[F])}delete(D){let{store:F}=this;if(this.#D.accessPropertiesByDotNotation)tT(F,D);else delete F[D];this.store=F}clear(){this.store=HF();for(let D of Object.keys(this.#Q))this.reset(D)}onDidChange(D,F){if(typeof D!=="string")throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof D}`);if(typeof F!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof F}`);return this._handleChange(()=>this.get(D),F)}onDidAnyChange(D){if(typeof D!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof D}`);return this._handleChange(()=>this.store,D)}get size(){return Object.keys(this.store).length}get store(){try{let D=w4.readFileSync(this.path,this.#F?null:"utf8"),F=this._encryptData(D),$=this._deserialize(F);return this._validate($),Object.assign(HF(),$)}catch(D){if(D?.code==="ENOENT")return this._ensureDirectory(),HF();if(this.#D.clearInvalidConfig&&D.name==="SyntaxError")return HF();throw D}}set store(D){this._ensureDirectory(),this._validate(D),this._write(D),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[D,F]of Object.entries(this.store))yield[D,F]}_encryptData(D){if(!this.#F)return typeof D==="string"?D:zW(D);try{let F=D.slice(0,16),$=A9.pbkdf2Sync(this.#F,F.toString(),1e4,32,"sha512"),J=A9.createDecipheriv(d_,$,F),Q=D.slice(17),Y=typeof Q==="string"?bJ(Q):Q;return zW(KW([J.update(Y),J.final()]))}catch{}return D.toString()}_handleChange(D,F){let $=D(),J=()=>{let Q=$,Y=D();if(jK0(Y,Q))return;$=Y,F.call(this,Y,Q)};return this.events.addEventListener("change",J),()=>{this.events.removeEventListener("change",J)}}_deserialize=(D)=>JSON.parse(D);_serialize=(D)=>JSON.stringify(D,void 0,"\t");_validate(D){if(!this.#$)return;if(this.#$(D)||!this.#$.errors)return;let $=this.#$.errors.map(({instancePath:J,message:Q=""})=>`\`${J.slice(1)}\` ${Q}`);throw Error("Config schema violation: "+$.join("; "))}_ensureDirectory(){w4.mkdirSync(p_.dirname(this.path),{recursive:!0})}_write(D){let F=this._serialize(D);if(this.#F){let $=A9.randomBytes(16),J=A9.pbkdf2Sync(this.#F,$.toString(),1e4,32,"sha512"),Q=A9.createCipheriv(d_,J,$);F=KW([$,bJ(":"),Q.update(bJ(F)),Q.final()])}if(l_.env.SNAP)w4.writeFileSync(this.path,F,{mode:this.#D.configFileMode});else try{_X(this.path,F,{mode:this.#D.configFileMode})}catch($){if($?.code==="EXDEV"){w4.writeFileSync(this.path,F,{mode:this.#D.configFileMode});return}throw $}}_watch(){if(this._ensureDirectory(),!w4.existsSync(this.path))this._write(HF());if(l_.platform==="win32")w4.watch(this.path,{persistent:!1},sG(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else w4.watchFile(this.path,{persistent:!1},sG(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(D,F,$){let J=this._get(EW,"0.0.0"),Q=Object.keys(D).filter((B)=>this._shouldPerformMigration(B,J,F)),Y={...this.store};for(let B of Q)try{if($)$(this,{fromVersion:J,toVersion:B,finalVersion:F,versions:Q});let X=D[B];X?.(this),this._set(EW,B),J=B,Y={...this.store}}catch(X){throw this.store=Y,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${X}`)}if(this._isVersionInRangeFormat(J)||!j4.default.eq(J,F))this._set(EW,F)}_containsReservedKey(D){if(typeof D==="object"){if(Object.keys(D)[0]===uJ)return!0}if(typeof D!=="string")return!1;if(this.#D.accessPropertiesByDotNotation){if(D.startsWith(`${uJ}.`))return!0;return!1}return!1}_isVersionInRangeFormat(D){return j4.default.clean(D)===null}_shouldPerformMigration(D,F,$){if(this._isVersionInRangeFormat(D)){if(F!=="0.0.0"&&j4.default.satisfies(F,D))return!1;return j4.default.satisfies($,D)}if(j4.default.lte(D,F))return!1;if(j4.default.gt(D,$))return!1;return!0}_get(D,F){return rT(this.store,D,F)}_set(D,F){let{store:$}=this;NX($,D,F),this.store=$}}});var E0,VW,k,N8=(D)=>{switch(typeof D){case"undefined":return k.undefined;case"string":return k.string;case"number":return Number.isNaN(D)?k.nan:k.number;case"boolean":return k.boolean;case"function":return k.function;case"bigint":return k.bigint;case"symbol":return k.symbol;case"object":if(Array.isArray(D))return k.array;if(D===null)return k.null;if(D.then&&typeof D.then==="function"&&D.catch&&typeof D.catch==="function")return k.promise;if(typeof Map<"u"&&D instanceof Map)return k.map;if(typeof Set<"u"&&D instanceof Set)return k.set;if(typeof Date<"u"&&D instanceof Date)return k.date;return k.object;default:return k.unknown}};var M9=I(()=>{(function(D){D.assertEqual=(Q)=>{};function F(Q){}D.assertIs=F;function $(Q){throw Error()}D.assertNever=$,D.arrayToEnum=(Q)=>{let Y={};for(let B of Q)Y[B]=B;return Y},D.getValidEnumValues=(Q)=>{let Y=D.objectKeys(Q).filter((X)=>typeof Q[Q[X]]!=="number"),B={};for(let X of Y)B[X]=Q[X];return D.objectValues(B)},D.objectValues=(Q)=>{return D.objectKeys(Q).map(function(Y){return Q[Y]})},D.objectKeys=typeof Object.keys==="function"?(Q)=>Object.keys(Q):(Q)=>{let Y=[];for(let B in Q)if(Object.prototype.hasOwnProperty.call(Q,B))Y.push(B);return Y},D.find=(Q,Y)=>{for(let B of Q)if(Y(B))return B;return},D.isInteger=typeof Number.isInteger==="function"?(Q)=>Number.isInteger(Q):(Q)=>typeof Q==="number"&&Number.isFinite(Q)&&Math.floor(Q)===Q;function J(Q,Y=" | "){return Q.map((B)=>typeof B==="string"?`'${B}'`:B).join(Y)}D.joinValues=J,D.jsonStringifyReplacer=(Q,Y)=>{if(typeof Y==="bigint")return Y.toString();return Y}})(E0||(E0={}));(function(D){D.mergeShapes=(F,$)=>{return{...F,...$}}})(VW||(VW={}));k=E0.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var j,kK0=(D)=>{return JSON.stringify(D,null,2).replace(/"([^"]+)":/g,"$1:")},eD;var lJ=I(()=>{M9();j=E0.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);eD=class eD extends Error{get errors(){return this.issues}constructor(D){super();this.issues=[],this.addIssue=($)=>{this.issues=[...this.issues,$]},this.addIssues=($=[])=>{this.issues=[...this.issues,...$]};let F=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,F);else this.__proto__=F;this.name="ZodError",this.issues=D}format(D){let F=D||function(Q){return Q.message},$={_errors:[]},J=(Q)=>{for(let Y of Q.issues)if(Y.code==="invalid_union")Y.unionErrors.map(J);else if(Y.code==="invalid_return_type")J(Y.returnTypeError);else if(Y.code==="invalid_arguments")J(Y.argumentsError);else if(Y.path.length===0)$._errors.push(F(Y));else{let B=$,X=0;while(X<Y.path.length){let G=Y.path[X];if(X!==Y.path.length-1)B[G]=B[G]||{_errors:[]};else B[G]=B[G]||{_errors:[]},B[G]._errors.push(F(Y));B=B[G],X++}}};return J(this),$}static assert(D){if(!(D instanceof eD))throw Error(`Not a ZodError: ${D}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,E0.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(D=(F)=>F.message){let F={},$=[];for(let J of this.issues)if(J.path.length>0){let Q=J.path[0];F[Q]=F[Q]||[],F[Q].push(D(J))}else $.push(D(J));return{formErrors:$,fieldErrors:F}}get formErrors(){return this.flatten()}};eD.create=(D)=>{return new eD(D)}});var vK0=(D,F)=>{let $;switch(D.code){case j.invalid_type:if(D.received===k.undefined)$="Required";else $=`Expected ${D.expected}, received ${D.received}`;break;case j.invalid_literal:$=`Invalid literal value, expected ${JSON.stringify(D.expected,E0.jsonStringifyReplacer)}`;break;case j.unrecognized_keys:$=`Unrecognized key(s) in object: ${E0.joinValues(D.keys,", ")}`;break;case j.invalid_union:$="Invalid input";break;case j.invalid_union_discriminator:$=`Invalid discriminator value. Expected ${E0.joinValues(D.options)}`;break;case j.invalid_enum_value:$=`Invalid enum value. Expected ${E0.joinValues(D.options)}, received '${D.received}'`;break;case j.invalid_arguments:$="Invalid function arguments";break;case j.invalid_return_type:$="Invalid function return type";break;case j.invalid_date:$="Invalid date";break;case j.invalid_string:if(typeof D.validation==="object")if("includes"in D.validation){if($=`Invalid input: must include "${D.validation.includes}"`,typeof D.validation.position==="number")$=`${$} at one or more positions greater than or equal to ${D.validation.position}`}else if("startsWith"in D.validation)$=`Invalid input: must start with "${D.validation.startsWith}"`;else if("endsWith"in D.validation)$=`Invalid input: must end with "${D.validation.endsWith}"`;else E0.assertNever(D.validation);else if(D.validation!=="regex")$=`Invalid ${D.validation}`;else $="Invalid";break;case j.too_small:if(D.type==="array")$=`Array must contain ${D.exact?"exactly":D.inclusive?"at least":"more than"} ${D.minimum} element(s)`;else if(D.type==="string")$=`String must contain ${D.exact?"exactly":D.inclusive?"at least":"over"} ${D.minimum} character(s)`;else if(D.type==="number")$=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="bigint")$=`Number must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${D.minimum}`;else if(D.type==="date")$=`Date must be ${D.exact?"exactly equal to ":D.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(D.minimum))}`;else $="Invalid input";break;case j.too_big:if(D.type==="array")$=`Array must contain ${D.exact?"exactly":D.inclusive?"at most":"less than"} ${D.maximum} element(s)`;else if(D.type==="string")$=`String must contain ${D.exact?"exactly":D.inclusive?"at most":"under"} ${D.maximum} character(s)`;else if(D.type==="number")$=`Number must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="bigint")$=`BigInt must be ${D.exact?"exactly":D.inclusive?"less than or equal to":"less than"} ${D.maximum}`;else if(D.type==="date")$=`Date must be ${D.exact?"exactly":D.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(D.maximum))}`;else $="Invalid input";break;case j.custom:$="Invalid input";break;case j.invalid_intersection_types:$="Intersection results could not be merged";break;case j.not_multiple_of:$=`Number must be a multiple of ${D.multipleOf}`;break;case j.not_finite:$="Number must be finite";break;default:$=F.defaultError,E0.assertNever(D)}return{message:$}},d8;var ZW=I(()=>{lJ();M9();d8=vK0});function yK0(D){a_=D}function qF(){return a_}var a_;var pJ=I(()=>{ZW();a_=d8});function v(D,F){let $=qF(),J=N9({issueData:F,data:D.data,path:D.path,errorMaps:[D.common.contextualErrorMap,D.schemaErrorMap,$,$===d8?void 0:d8].filter((Q)=>!!Q)});D.common.issues.push(J)}class ND{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(D,F){let $=[];for(let J of F){if(J.status==="aborted")return i;if(J.status==="dirty")D.dirty();$.push(J.value)}return{status:D.value,value:$}}static async mergeObjectAsync(D,F){let $=[];for(let J of F){let Q=await J.key,Y=await J.value;$.push({key:Q,value:Y})}return ND.mergeObjectSync(D,$)}static mergeObjectSync(D,F){let $={};for(let J of F){let{key:Q,value:Y}=J;if(Q.status==="aborted")return i;if(Y.status==="aborted")return i;if(Q.status==="dirty")D.dirty();if(Y.status==="dirty")D.dirty();if(Q.value!=="__proto__"&&(typeof Y.value<"u"||J.alwaysSet))$[Q.value]=Y.value}return{status:D.value,value:$}}}var N9=(D)=>{let{data:F,path:$,errorMaps:J,issueData:Q}=D,Y=[...$,...Q.path||[]],B={...Q,path:Y};if(Q.message!==void 0)return{...Q,path:Y,message:Q.message};let X="",G=J.filter((H)=>!!H).slice().reverse();for(let H of G)X=H(B,{data:F,defaultError:X}).message;return{...Q,path:Y,message:X}},xK0,i,T4=(D)=>({status:"dirty",value:D}),SD=(D)=>({status:"valid",value:D}),dJ=(D)=>D.status==="aborted",cJ=(D)=>D.status==="dirty",m6=(D)=>D.status==="valid",KF=(D)=>typeof Promise<"u"&&D instanceof Promise;var UW=I(()=>{pJ();ZW();xK0=[];i=Object.freeze({status:"aborted"})});var o_=()=>{};var l;var s_=I(()=>{(function(D){D.errToObj=(F)=>typeof F==="string"?{message:F}:F||{},D.toString=(F)=>typeof F==="string"?F:F?.message})(l||(l={}))});class n1{constructor(D,F,$,J){this._cachedPath=[],this.parent=D,this.data=F,this._path=$,this._key=J}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function B0(D){if(!D)return{};let{errorMap:F,invalid_type_error:$,required_error:J,description:Q}=D;if(F&&($||J))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(F)return{errorMap:F,description:Q};return{errorMap:(B,X)=>{let{message:G}=D;if(B.code==="invalid_enum_value")return{message:G??X.defaultError};if(typeof X.data>"u")return{message:G??J??X.defaultError};if(B.code!=="invalid_type")return{message:X.defaultError};return{message:G??$??X.defaultError}},description:Q}}class H0{get description(){return this._def.description}_getType(D){return N8(D.data)}_getOrReturnCtx(D,F){return F||{common:D.parent.common,data:D.data,parsedType:N8(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}_processInputParams(D){return{status:new ND,ctx:{common:D.parent.common,data:D.data,parsedType:N8(D.data),schemaErrorMap:this._def.errorMap,path:D.path,parent:D.parent}}}_parseSync(D){let F=this._parse(D);if(KF(F))throw Error("Synchronous parse encountered promise.");return F}_parseAsync(D){let F=this._parse(D);return Promise.resolve(F)}parse(D,F){let $=this.safeParse(D,F);if($.success)return $.data;throw $.error}safeParse(D,F){let $={common:{issues:[],async:F?.async??!1,contextualErrorMap:F?.errorMap},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:N8(D)},J=this._parseSync({data:D,path:$.path,parent:$});return r_($,J)}"~validate"(D){let F={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:N8(D)};if(!this["~standard"].async)try{let $=this._parseSync({data:D,path:[],parent:F});return m6($)?{value:$.value}:{issues:F.common.issues}}catch($){if($?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;F.common={issues:[],async:!0}}return this._parseAsync({data:D,path:[],parent:F}).then(($)=>m6($)?{value:$.value}:{issues:F.common.issues})}async parseAsync(D,F){let $=await this.safeParseAsync(D,F);if($.success)return $.data;throw $.error}async safeParseAsync(D,F){let $={common:{issues:[],contextualErrorMap:F?.errorMap,async:!0},path:F?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:D,parsedType:N8(D)},J=this._parse({data:D,path:$.path,parent:$}),Q=await(KF(J)?J:Promise.resolve(J));return r_($,Q)}refine(D,F){let $=(J)=>{if(typeof F==="string"||typeof F>"u")return{message:F};else if(typeof F==="function")return F(J);else return F};return this._refinement((J,Q)=>{let Y=D(J),B=()=>Q.addIssue({code:j.custom,...$(J)});if(typeof Promise<"u"&&Y instanceof Promise)return Y.then((X)=>{if(!X)return B(),!1;else return!0});if(!Y)return B(),!1;else return!0})}refinement(D,F){return this._refinement(($,J)=>{if(!D($))return J.addIssue(typeof F==="function"?F($,J):F),!1;else return!0})}_refinement(D){return new i1({schema:this,typeName:a.ZodEffects,effect:{type:"refinement",refinement:D}})}superRefine(D){return this._refinement(D)}constructor(D){this.spa=this.safeParseAsync,this._def=D,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(F)=>this["~validate"](F)}}optional(){return c1.create(this,this._def)}nullable(){return n8.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return d1.create(this)}promise(){return k4.create(this,this._def)}or(D){return LF.create([this,D],this._def)}and(D){return AF.create(this,D,this._def)}transform(D){return new i1({...B0(this._def),schema:this,typeName:a.ZodEffects,effect:{type:"transform",transform:D}})}default(D){let F=typeof D==="function"?D:()=>D;return new CF({...B0(this._def),innerType:this,defaultValue:F,typeName:a.ZodDefault})}brand(){return new iJ({typeName:a.ZodBranded,type:this,...B0(this._def)})}catch(D){let F=typeof D==="function"?D:()=>D;return new OF({...B0(this._def),innerType:this,catchValue:F,typeName:a.ZodCatch})}describe(D){return new this.constructor({...this._def,description:D})}pipe(D){return T9.create(this,D)}readonly(){return wF.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Df(D){let F="[0-5]\\d";if(D.precision)F=`${F}\\.\\d{${D.precision}}`;else if(D.precision==null)F=`${F}(\\.\\d+)?`;let $=D.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${F})${$}`}function rK0(D){return new RegExp(`^${Df(D)}$`)}function Ff(D){let F=`${e_}T${Df(D)}`,$=[];if($.push(D.local?"Z?":"Z"),D.offset)$.push("([+-]\\d{2}:?\\d{2})");return F=`${F}(${$.join("|")})`,new RegExp(`^${F}$`)}function tK0(D,F){if((F==="v4"||!F)&&dK0.test(D))return!0;if((F==="v6"||!F)&&nK0.test(D))return!0;return!1}function eK0(D,F){if(!uK0.test(D))return!1;try{let[$]=D.split(".");if(!$)return!1;let J=$.replace(/-/g,"+").replace(/_/g,"/").padEnd($.length+(4-$.length%4)%4,"="),Q=JSON.parse(atob(J));if(typeof Q!=="object"||Q===null)return!1;if("typ"in Q&&Q?.typ!=="JWT")return!1;if(!Q.alg)return!1;if(F&&Q.alg!==F)return!1;return!0}catch{return!1}}function Dz0(D,F){if((F==="v4"||!F)&&cK0.test(D))return!0;if((F==="v6"||!F)&&iK0.test(D))return!0;return!1}function Fz0(D,F){let $=(D.toString().split(".")[1]||"").length,J=(F.toString().split(".")[1]||"").length,Q=$>J?$:J,Y=Number.parseInt(D.toFixed(Q).replace(".","")),B=Number.parseInt(F.toFixed(Q).replace(".",""));return Y%B/10**Q}function zF(D){if(D instanceof s0){let F={};for(let $ in D.shape){let J=D.shape[$];F[$]=c1.create(zF(J))}return new s0({...D._def,shape:()=>F})}else if(D instanceof d1)return new d1({...D._def,type:zF(D.element)});else if(D instanceof c1)return c1.create(zF(D.unwrap()));else if(D instanceof n8)return n8.create(zF(D.unwrap()));else if(D instanceof C8)return C8.create(D.items.map((F)=>zF(F)));else return D}function AW(D,F){let $=N8(D),J=N8(F);if(D===F)return{valid:!0,data:D};else if($===k.object&&J===k.object){let Q=E0.objectKeys(F),Y=E0.objectKeys(D).filter((X)=>Q.indexOf(X)!==-1),B={...D,...F};for(let X of Y){let G=AW(D[X],F[X]);if(!G.valid)return{valid:!1};B[X]=G.data}return{valid:!0,data:B}}else if($===k.array&&J===k.array){if(D.length!==F.length)return{valid:!1};let Q=[];for(let Y=0;Y<D.length;Y++){let B=D[Y],X=F[Y],G=AW(B,X);if(!G.valid)return{valid:!1};Q.push(G.data)}return{valid:!0,data:Q}}else if($===k.date&&J===k.date&&+D===+F)return{valid:!0,data:D};else return{valid:!1}}function $f(D,F){return new c6({values:D,typeName:a.ZodEnum,...B0(F)})}function t_(D,F){let $=typeof D==="function"?D(F):typeof D==="string"?{message:D}:D;return typeof $==="string"?{message:$}:$}function Jf(D,F={},$){if(D)return I4.create().superRefine((J,Q)=>{let Y=D(J);if(Y instanceof Promise)return Y.then((B)=>{if(!B){let X=t_(F,J),G=X.fatal??$??!0;Q.addIssue({code:"custom",...X,fatal:G})}});if(!Y){let B=t_(F,J),X=B.fatal??$??!0;Q.addIssue({code:"custom",...B,fatal:X})}return});return I4.create()}var r_=(D,F)=>{if(m6(F))return{success:!0,data:F.value};else{if(!D.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let $=new eD(D.common.issues);return this._error=$,this._error}}}},_K0,fK0,gK0,hK0,bK0,uK0,mK0,lK0,pK0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",LW,dK0,cK0,nK0,iK0,aK0,oK0,e_="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",sK0,p1,p6,d6,VF,P4,R9,ZF,UF,I4,l6,R8,C9,d1,s0,LF,c8=(D)=>{if(D instanceof MF)return c8(D.schema);else if(D instanceof i1)return c8(D.innerType());else if(D instanceof NF)return[D.value];else if(D instanceof c6)return D.options;else if(D instanceof RF)return E0.objectValues(D.enum);else if(D instanceof CF)return c8(D._def.innerType);else if(D instanceof ZF)return[void 0];else if(D instanceof UF)return[null];else if(D instanceof c1)return[void 0,...c8(D.unwrap())];else if(D instanceof n8)return[null,...c8(D.unwrap())];else if(D instanceof iJ)return c8(D.unwrap());else if(D instanceof wF)return c8(D.unwrap());else if(D instanceof OF)return c8(D._def.innerType);else return[]},nJ,AF,C8,O9,w9,S4,EF,MF,NF,c6,RF,k4,i1,c1,n8,CF,OF,j9,$z0,iJ,T9,wF,Jz0,a,Qz0=(D,F={message:`Input not instance of ${D.name}`})=>Jf(($)=>$ instanceof D,F),Qf,Yf,Yz0,Bz0,Bf,Xz0,Gz0,Wz0,Hz0,qz0,Kz0,zz0,Ez0,Vz0,Zz0,Uz0,Lz0,Az0,Mz0,Nz0,Rz0,Cz0,Oz0,wz0,jz0,Tz0,Pz0,Iz0,Sz0,kz0,vz0,yz0,xz0,_z0,fz0=()=>Qf().optional(),gz0=()=>Yf().optional(),hz0=()=>Bf().optional(),bz0,uz0;var Xf=I(()=>{lJ();pJ();s_();UW();M9();_K0=/^c[^\s-]{8,}$/i,fK0=/^[0-9a-z]+$/,gK0=/^[0-9A-HJKMNP-TV-Z]{26}$/i,hK0=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,bK0=/^[a-z0-9_-]{21}$/i,uK0=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,mK0=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,lK0=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,dK0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cK0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,nK0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,iK0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,aK0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,oK0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,sK0=new RegExp(`^${e_}$`);p1=class p1 extends H0{_parse(D){if(this._def.coerce)D.data=String(D.data);if(this._getType(D)!==k.string){let Q=this._getOrReturnCtx(D);return v(Q,{code:j.invalid_type,expected:k.string,received:Q.parsedType}),i}let $=new ND,J=void 0;for(let Q of this._def.checks)if(Q.kind==="min"){if(D.data.length<Q.value)J=this._getOrReturnCtx(D,J),v(J,{code:j.too_small,minimum:Q.value,type:"string",inclusive:!0,exact:!1,message:Q.message}),$.dirty()}else if(Q.kind==="max"){if(D.data.length>Q.value)J=this._getOrReturnCtx(D,J),v(J,{code:j.too_big,maximum:Q.value,type:"string",inclusive:!0,exact:!1,message:Q.message}),$.dirty()}else if(Q.kind==="length"){let Y=D.data.length>Q.value,B=D.data.length<Q.value;if(Y||B){if(J=this._getOrReturnCtx(D,J),Y)v(J,{code:j.too_big,maximum:Q.value,type:"string",inclusive:!0,exact:!0,message:Q.message});else if(B)v(J,{code:j.too_small,minimum:Q.value,type:"string",inclusive:!0,exact:!0,message:Q.message});$.dirty()}}else if(Q.kind==="email"){if(!lK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"email",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="emoji"){if(!LW)LW=new RegExp(pK0,"u");if(!LW.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"emoji",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="uuid"){if(!hK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"uuid",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="nanoid"){if(!bK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"nanoid",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="cuid"){if(!_K0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"cuid",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="cuid2"){if(!fK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"cuid2",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="ulid"){if(!gK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"ulid",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="url")try{new URL(D.data)}catch{J=this._getOrReturnCtx(D,J),v(J,{validation:"url",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="regex"){if(Q.regex.lastIndex=0,!Q.regex.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"regex",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="trim")D.data=D.data.trim();else if(Q.kind==="includes"){if(!D.data.includes(Q.value,Q.position))J=this._getOrReturnCtx(D,J),v(J,{code:j.invalid_string,validation:{includes:Q.value,position:Q.position},message:Q.message}),$.dirty()}else if(Q.kind==="toLowerCase")D.data=D.data.toLowerCase();else if(Q.kind==="toUpperCase")D.data=D.data.toUpperCase();else if(Q.kind==="startsWith"){if(!D.data.startsWith(Q.value))J=this._getOrReturnCtx(D,J),v(J,{code:j.invalid_string,validation:{startsWith:Q.value},message:Q.message}),$.dirty()}else if(Q.kind==="endsWith"){if(!D.data.endsWith(Q.value))J=this._getOrReturnCtx(D,J),v(J,{code:j.invalid_string,validation:{endsWith:Q.value},message:Q.message}),$.dirty()}else if(Q.kind==="datetime"){if(!Ff(Q).test(D.data))J=this._getOrReturnCtx(D,J),v(J,{code:j.invalid_string,validation:"datetime",message:Q.message}),$.dirty()}else if(Q.kind==="date"){if(!sK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{code:j.invalid_string,validation:"date",message:Q.message}),$.dirty()}else if(Q.kind==="time"){if(!rK0(Q).test(D.data))J=this._getOrReturnCtx(D,J),v(J,{code:j.invalid_string,validation:"time",message:Q.message}),$.dirty()}else if(Q.kind==="duration"){if(!mK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"duration",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="ip"){if(!tK0(D.data,Q.version))J=this._getOrReturnCtx(D,J),v(J,{validation:"ip",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="jwt"){if(!eK0(D.data,Q.alg))J=this._getOrReturnCtx(D,J),v(J,{validation:"jwt",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="cidr"){if(!Dz0(D.data,Q.version))J=this._getOrReturnCtx(D,J),v(J,{validation:"cidr",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="base64"){if(!aK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"base64",code:j.invalid_string,message:Q.message}),$.dirty()}else if(Q.kind==="base64url"){if(!oK0.test(D.data))J=this._getOrReturnCtx(D,J),v(J,{validation:"base64url",code:j.invalid_string,message:Q.message}),$.dirty()}else E0.assertNever(Q);return{status:$.value,value:D.data}}_regex(D,F,$){return this.refinement((J)=>D.test(J),{validation:F,code:j.invalid_string,...l.errToObj($)})}_addCheck(D){return new p1({...this._def,checks:[...this._def.checks,D]})}email(D){return this._addCheck({kind:"email",...l.errToObj(D)})}url(D){return this._addCheck({kind:"url",...l.errToObj(D)})}emoji(D){return this._addCheck({kind:"emoji",...l.errToObj(D)})}uuid(D){return this._addCheck({kind:"uuid",...l.errToObj(D)})}nanoid(D){return this._addCheck({kind:"nanoid",...l.errToObj(D)})}cuid(D){return this._addCheck({kind:"cuid",...l.errToObj(D)})}cuid2(D){return this._addCheck({kind:"cuid2",...l.errToObj(D)})}ulid(D){return this._addCheck({kind:"ulid",...l.errToObj(D)})}base64(D){return this._addCheck({kind:"base64",...l.errToObj(D)})}base64url(D){return this._addCheck({kind:"base64url",...l.errToObj(D)})}jwt(D){return this._addCheck({kind:"jwt",...l.errToObj(D)})}ip(D){return this._addCheck({kind:"ip",...l.errToObj(D)})}cidr(D){return this._addCheck({kind:"cidr",...l.errToObj(D)})}datetime(D){if(typeof D==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:D});return this._addCheck({kind:"datetime",precision:typeof D?.precision>"u"?null:D?.precision,offset:D?.offset??!1,local:D?.local??!1,...l.errToObj(D?.message)})}date(D){return this._addCheck({kind:"date",message:D})}time(D){if(typeof D==="string")return this._addCheck({kind:"time",precision:null,message:D});return this._addCheck({kind:"time",precision:typeof D?.precision>"u"?null:D?.precision,...l.errToObj(D?.message)})}duration(D){return this._addCheck({kind:"duration",...l.errToObj(D)})}regex(D,F){return this._addCheck({kind:"regex",regex:D,...l.errToObj(F)})}includes(D,F){return this._addCheck({kind:"includes",value:D,position:F?.position,...l.errToObj(F?.message)})}startsWith(D,F){return this._addCheck({kind:"startsWith",value:D,...l.errToObj(F)})}endsWith(D,F){return this._addCheck({kind:"endsWith",value:D,...l.errToObj(F)})}min(D,F){return this._addCheck({kind:"min",value:D,...l.errToObj(F)})}max(D,F){return this._addCheck({kind:"max",value:D,...l.errToObj(F)})}length(D,F){return this._addCheck({kind:"length",value:D,...l.errToObj(F)})}nonempty(D){return this.min(1,l.errToObj(D))}trim(){return new p1({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new p1({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new p1({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((D)=>D.kind==="datetime")}get isDate(){return!!this._def.checks.find((D)=>D.kind==="date")}get isTime(){return!!this._def.checks.find((D)=>D.kind==="time")}get isDuration(){return!!this._def.checks.find((D)=>D.kind==="duration")}get isEmail(){return!!this._def.checks.find((D)=>D.kind==="email")}get isURL(){return!!this._def.checks.find((D)=>D.kind==="url")}get isEmoji(){return!!this._def.checks.find((D)=>D.kind==="emoji")}get isUUID(){return!!this._def.checks.find((D)=>D.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((D)=>D.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((D)=>D.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((D)=>D.kind==="cuid2")}get isULID(){return!!this._def.checks.find((D)=>D.kind==="ulid")}get isIP(){return!!this._def.checks.find((D)=>D.kind==="ip")}get isCIDR(){return!!this._def.checks.find((D)=>D.kind==="cidr")}get isBase64(){return!!this._def.checks.find((D)=>D.kind==="base64")}get isBase64url(){return!!this._def.checks.find((D)=>D.kind==="base64url")}get minLength(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxLength(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}};p1.create=(D)=>{return new p1({checks:[],typeName:a.ZodString,coerce:D?.coerce??!1,...B0(D)})};p6=class p6 extends H0{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(D){if(this._def.coerce)D.data=Number(D.data);if(this._getType(D)!==k.number){let Q=this._getOrReturnCtx(D);return v(Q,{code:j.invalid_type,expected:k.number,received:Q.parsedType}),i}let $=void 0,J=new ND;for(let Q of this._def.checks)if(Q.kind==="int"){if(!E0.isInteger(D.data))$=this._getOrReturnCtx(D,$),v($,{code:j.invalid_type,expected:"integer",received:"float",message:Q.message}),J.dirty()}else if(Q.kind==="min"){if(Q.inclusive?D.data<Q.value:D.data<=Q.value)$=this._getOrReturnCtx(D,$),v($,{code:j.too_small,minimum:Q.value,type:"number",inclusive:Q.inclusive,exact:!1,message:Q.message}),J.dirty()}else if(Q.kind==="max"){if(Q.inclusive?D.data>Q.value:D.data>=Q.value)$=this._getOrReturnCtx(D,$),v($,{code:j.too_big,maximum:Q.value,type:"number",inclusive:Q.inclusive,exact:!1,message:Q.message}),J.dirty()}else if(Q.kind==="multipleOf"){if(Fz0(D.data,Q.value)!==0)$=this._getOrReturnCtx(D,$),v($,{code:j.not_multiple_of,multipleOf:Q.value,message:Q.message}),J.dirty()}else if(Q.kind==="finite"){if(!Number.isFinite(D.data))$=this._getOrReturnCtx(D,$),v($,{code:j.not_finite,message:Q.message}),J.dirty()}else E0.assertNever(Q);return{status:J.value,value:D.data}}gte(D,F){return this.setLimit("min",D,!0,l.toString(F))}gt(D,F){return this.setLimit("min",D,!1,l.toString(F))}lte(D,F){return this.setLimit("max",D,!0,l.toString(F))}lt(D,F){return this.setLimit("max",D,!1,l.toString(F))}setLimit(D,F,$,J){return new p6({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:$,message:l.toString(J)}]})}_addCheck(D){return new p6({...this._def,checks:[...this._def.checks,D]})}int(D){return this._addCheck({kind:"int",message:l.toString(D)})}positive(D){return this._addCheck({kind:"min",value:0,inclusive:!1,message:l.toString(D)})}negative(D){return this._addCheck({kind:"max",value:0,inclusive:!1,message:l.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:0,inclusive:!0,message:l.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:0,inclusive:!0,message:l.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:l.toString(F)})}finite(D){return this._addCheck({kind:"finite",message:l.toString(D)})}safe(D){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:l.toString(D)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:l.toString(D)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}get isInt(){return!!this._def.checks.find((D)=>D.kind==="int"||D.kind==="multipleOf"&&E0.isInteger(D.value))}get isFinite(){let D=null,F=null;for(let $ of this._def.checks)if($.kind==="finite"||$.kind==="int"||$.kind==="multipleOf")return!0;else if($.kind==="min"){if(F===null||$.value>F)F=$.value}else if($.kind==="max"){if(D===null||$.value<D)D=$.value}return Number.isFinite(F)&&Number.isFinite(D)}};p6.create=(D)=>{return new p6({checks:[],typeName:a.ZodNumber,coerce:D?.coerce||!1,...B0(D)})};d6=class d6 extends H0{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(D){if(this._def.coerce)try{D.data=BigInt(D.data)}catch{return this._getInvalidInput(D)}if(this._getType(D)!==k.bigint)return this._getInvalidInput(D);let $=void 0,J=new ND;for(let Q of this._def.checks)if(Q.kind==="min"){if(Q.inclusive?D.data<Q.value:D.data<=Q.value)$=this._getOrReturnCtx(D,$),v($,{code:j.too_small,type:"bigint",minimum:Q.value,inclusive:Q.inclusive,message:Q.message}),J.dirty()}else if(Q.kind==="max"){if(Q.inclusive?D.data>Q.value:D.data>=Q.value)$=this._getOrReturnCtx(D,$),v($,{code:j.too_big,type:"bigint",maximum:Q.value,inclusive:Q.inclusive,message:Q.message}),J.dirty()}else if(Q.kind==="multipleOf"){if(D.data%Q.value!==BigInt(0))$=this._getOrReturnCtx(D,$),v($,{code:j.not_multiple_of,multipleOf:Q.value,message:Q.message}),J.dirty()}else E0.assertNever(Q);return{status:J.value,value:D.data}}_getInvalidInput(D){let F=this._getOrReturnCtx(D);return v(F,{code:j.invalid_type,expected:k.bigint,received:F.parsedType}),i}gte(D,F){return this.setLimit("min",D,!0,l.toString(F))}gt(D,F){return this.setLimit("min",D,!1,l.toString(F))}lte(D,F){return this.setLimit("max",D,!0,l.toString(F))}lt(D,F){return this.setLimit("max",D,!1,l.toString(F))}setLimit(D,F,$,J){return new d6({...this._def,checks:[...this._def.checks,{kind:D,value:F,inclusive:$,message:l.toString(J)}]})}_addCheck(D){return new d6({...this._def,checks:[...this._def.checks,D]})}positive(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:l.toString(D)})}negative(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:l.toString(D)})}nonpositive(D){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:l.toString(D)})}nonnegative(D){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:l.toString(D)})}multipleOf(D,F){return this._addCheck({kind:"multipleOf",value:D,message:l.toString(F)})}get minValue(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D}get maxValue(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D}};d6.create=(D)=>{return new d6({checks:[],typeName:a.ZodBigInt,coerce:D?.coerce??!1,...B0(D)})};VF=class VF extends H0{_parse(D){if(this._def.coerce)D.data=Boolean(D.data);if(this._getType(D)!==k.boolean){let $=this._getOrReturnCtx(D);return v($,{code:j.invalid_type,expected:k.boolean,received:$.parsedType}),i}return SD(D.data)}};VF.create=(D)=>{return new VF({typeName:a.ZodBoolean,coerce:D?.coerce||!1,...B0(D)})};P4=class P4 extends H0{_parse(D){if(this._def.coerce)D.data=new Date(D.data);if(this._getType(D)!==k.date){let Q=this._getOrReturnCtx(D);return v(Q,{code:j.invalid_type,expected:k.date,received:Q.parsedType}),i}if(Number.isNaN(D.data.getTime())){let Q=this._getOrReturnCtx(D);return v(Q,{code:j.invalid_date}),i}let $=new ND,J=void 0;for(let Q of this._def.checks)if(Q.kind==="min"){if(D.data.getTime()<Q.value)J=this._getOrReturnCtx(D,J),v(J,{code:j.too_small,message:Q.message,inclusive:!0,exact:!1,minimum:Q.value,type:"date"}),$.dirty()}else if(Q.kind==="max"){if(D.data.getTime()>Q.value)J=this._getOrReturnCtx(D,J),v(J,{code:j.too_big,message:Q.message,inclusive:!0,exact:!1,maximum:Q.value,type:"date"}),$.dirty()}else E0.assertNever(Q);return{status:$.value,value:new Date(D.data.getTime())}}_addCheck(D){return new P4({...this._def,checks:[...this._def.checks,D]})}min(D,F){return this._addCheck({kind:"min",value:D.getTime(),message:l.toString(F)})}max(D,F){return this._addCheck({kind:"max",value:D.getTime(),message:l.toString(F)})}get minDate(){let D=null;for(let F of this._def.checks)if(F.kind==="min"){if(D===null||F.value>D)D=F.value}return D!=null?new Date(D):null}get maxDate(){let D=null;for(let F of this._def.checks)if(F.kind==="max"){if(D===null||F.value<D)D=F.value}return D!=null?new Date(D):null}};P4.create=(D)=>{return new P4({checks:[],coerce:D?.coerce||!1,typeName:a.ZodDate,...B0(D)})};R9=class R9 extends H0{_parse(D){if(this._getType(D)!==k.symbol){let $=this._getOrReturnCtx(D);return v($,{code:j.invalid_type,expected:k.symbol,received:$.parsedType}),i}return SD(D.data)}};R9.create=(D)=>{return new R9({typeName:a.ZodSymbol,...B0(D)})};ZF=class ZF extends H0{_parse(D){if(this._getType(D)!==k.undefined){let $=this._getOrReturnCtx(D);return v($,{code:j.invalid_type,expected:k.undefined,received:$.parsedType}),i}return SD(D.data)}};ZF.create=(D)=>{return new ZF({typeName:a.ZodUndefined,...B0(D)})};UF=class UF extends H0{_parse(D){if(this._getType(D)!==k.null){let $=this._getOrReturnCtx(D);return v($,{code:j.invalid_type,expected:k.null,received:$.parsedType}),i}return SD(D.data)}};UF.create=(D)=>{return new UF({typeName:a.ZodNull,...B0(D)})};I4=class I4 extends H0{constructor(){super(...arguments);this._any=!0}_parse(D){return SD(D.data)}};I4.create=(D)=>{return new I4({typeName:a.ZodAny,...B0(D)})};l6=class l6 extends H0{constructor(){super(...arguments);this._unknown=!0}_parse(D){return SD(D.data)}};l6.create=(D)=>{return new l6({typeName:a.ZodUnknown,...B0(D)})};R8=class R8 extends H0{_parse(D){let F=this._getOrReturnCtx(D);return v(F,{code:j.invalid_type,expected:k.never,received:F.parsedType}),i}};R8.create=(D)=>{return new R8({typeName:a.ZodNever,...B0(D)})};C9=class C9 extends H0{_parse(D){if(this._getType(D)!==k.undefined){let $=this._getOrReturnCtx(D);return v($,{code:j.invalid_type,expected:k.void,received:$.parsedType}),i}return SD(D.data)}};C9.create=(D)=>{return new C9({typeName:a.ZodVoid,...B0(D)})};d1=class d1 extends H0{_parse(D){let{ctx:F,status:$}=this._processInputParams(D),J=this._def;if(F.parsedType!==k.array)return v(F,{code:j.invalid_type,expected:k.array,received:F.parsedType}),i;if(J.exactLength!==null){let Y=F.data.length>J.exactLength.value,B=F.data.length<J.exactLength.value;if(Y||B)v(F,{code:Y?j.too_big:j.too_small,minimum:B?J.exactLength.value:void 0,maximum:Y?J.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:J.exactLength.message}),$.dirty()}if(J.minLength!==null){if(F.data.length<J.minLength.value)v(F,{code:j.too_small,minimum:J.minLength.value,type:"array",inclusive:!0,exact:!1,message:J.minLength.message}),$.dirty()}if(J.maxLength!==null){if(F.data.length>J.maxLength.value)v(F,{code:j.too_big,maximum:J.maxLength.value,type:"array",inclusive:!0,exact:!1,message:J.maxLength.message}),$.dirty()}if(F.common.async)return Promise.all([...F.data].map((Y,B)=>{return J.type._parseAsync(new n1(F,Y,F.path,B))})).then((Y)=>{return ND.mergeArray($,Y)});let Q=[...F.data].map((Y,B)=>{return J.type._parseSync(new n1(F,Y,F.path,B))});return ND.mergeArray($,Q)}get element(){return this._def.type}min(D,F){return new d1({...this._def,minLength:{value:D,message:l.toString(F)}})}max(D,F){return new d1({...this._def,maxLength:{value:D,message:l.toString(F)}})}length(D,F){return new d1({...this._def,exactLength:{value:D,message:l.toString(F)}})}nonempty(D){return this.min(1,D)}};d1.create=(D,F)=>{return new d1({type:D,minLength:null,maxLength:null,exactLength:null,typeName:a.ZodArray,...B0(F)})};s0=class s0 extends H0{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let D=this._def.shape(),F=E0.objectKeys(D);return this._cached={shape:D,keys:F},this._cached}_parse(D){if(this._getType(D)!==k.object){let G=this._getOrReturnCtx(D);return v(G,{code:j.invalid_type,expected:k.object,received:G.parsedType}),i}let{status:$,ctx:J}=this._processInputParams(D),{shape:Q,keys:Y}=this._getCached(),B=[];if(!(this._def.catchall instanceof R8&&this._def.unknownKeys==="strip")){for(let G in J.data)if(!Y.includes(G))B.push(G)}let X=[];for(let G of Y){let H=Q[G],q=J.data[G];X.push({key:{status:"valid",value:G},value:H._parse(new n1(J,q,J.path,G)),alwaysSet:G in J.data})}if(this._def.catchall instanceof R8){let G=this._def.unknownKeys;if(G==="passthrough")for(let H of B)X.push({key:{status:"valid",value:H},value:{status:"valid",value:J.data[H]}});else if(G==="strict"){if(B.length>0)v(J,{code:j.unrecognized_keys,keys:B}),$.dirty()}else if(G==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let G=this._def.catchall;for(let H of B){let q=J.data[H];X.push({key:{status:"valid",value:H},value:G._parse(new n1(J,q,J.path,H)),alwaysSet:H in J.data})}}if(J.common.async)return Promise.resolve().then(async()=>{let G=[];for(let H of X){let q=await H.key,K=await H.value;G.push({key:q,value:K,alwaysSet:H.alwaysSet})}return G}).then((G)=>{return ND.mergeObjectSync($,G)});else return ND.mergeObjectSync($,X)}get shape(){return this._def.shape()}strict(D){return l.errToObj,new s0({...this._def,unknownKeys:"strict",...D!==void 0?{errorMap:(F,$)=>{let J=this._def.errorMap?.(F,$).message??$.defaultError;if(F.code==="unrecognized_keys")return{message:l.errToObj(D).message??J};return{message:J}}}:{}})}strip(){return new s0({...this._def,unknownKeys:"strip"})}passthrough(){return new s0({...this._def,unknownKeys:"passthrough"})}extend(D){return new s0({...this._def,shape:()=>({...this._def.shape(),...D})})}merge(D){return new s0({unknownKeys:D._def.unknownKeys,catchall:D._def.catchall,shape:()=>({...this._def.shape(),...D._def.shape()}),typeName:a.ZodObject})}setKey(D,F){return this.augment({[D]:F})}catchall(D){return new s0({...this._def,catchall:D})}pick(D){let F={};for(let $ of E0.objectKeys(D))if(D[$]&&this.shape[$])F[$]=this.shape[$];return new s0({...this._def,shape:()=>F})}omit(D){let F={};for(let $ of E0.objectKeys(this.shape))if(!D[$])F[$]=this.shape[$];return new s0({...this._def,shape:()=>F})}deepPartial(){return zF(this)}partial(D){let F={};for(let $ of E0.objectKeys(this.shape)){let J=this.shape[$];if(D&&!D[$])F[$]=J;else F[$]=J.optional()}return new s0({...this._def,shape:()=>F})}required(D){let F={};for(let $ of E0.objectKeys(this.shape))if(D&&!D[$])F[$]=this.shape[$];else{let Q=this.shape[$];while(Q instanceof c1)Q=Q._def.innerType;F[$]=Q}return new s0({...this._def,shape:()=>F})}keyof(){return $f(E0.objectKeys(this.shape))}};s0.create=(D,F)=>{return new s0({shape:()=>D,unknownKeys:"strip",catchall:R8.create(),typeName:a.ZodObject,...B0(F)})};s0.strictCreate=(D,F)=>{return new s0({shape:()=>D,unknownKeys:"strict",catchall:R8.create(),typeName:a.ZodObject,...B0(F)})};s0.lazycreate=(D,F)=>{return new s0({shape:D,unknownKeys:"strip",catchall:R8.create(),typeName:a.ZodObject,...B0(F)})};LF=class LF extends H0{_parse(D){let{ctx:F}=this._processInputParams(D),$=this._def.options;function J(Q){for(let B of Q)if(B.result.status==="valid")return B.result;for(let B of Q)if(B.result.status==="dirty")return F.common.issues.push(...B.ctx.common.issues),B.result;let Y=Q.map((B)=>new eD(B.ctx.common.issues));return v(F,{code:j.invalid_union,unionErrors:Y}),i}if(F.common.async)return Promise.all($.map(async(Q)=>{let Y={...F,common:{...F.common,issues:[]},parent:null};return{result:await Q._parseAsync({data:F.data,path:F.path,parent:Y}),ctx:Y}})).then(J);else{let Q=void 0,Y=[];for(let X of $){let G={...F,common:{...F.common,issues:[]},parent:null},H=X._parseSync({data:F.data,path:F.path,parent:G});if(H.status==="valid")return H;else if(H.status==="dirty"&&!Q)Q={result:H,ctx:G};if(G.common.issues.length)Y.push(G.common.issues)}if(Q)return F.common.issues.push(...Q.ctx.common.issues),Q.result;let B=Y.map((X)=>new eD(X));return v(F,{code:j.invalid_union,unionErrors:B}),i}}get options(){return this._def.options}};LF.create=(D,F)=>{return new LF({options:D,typeName:a.ZodUnion,...B0(F)})};nJ=class nJ extends H0{_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==k.object)return v(F,{code:j.invalid_type,expected:k.object,received:F.parsedType}),i;let $=this.discriminator,J=F.data[$],Q=this.optionsMap.get(J);if(!Q)return v(F,{code:j.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[$]}),i;if(F.common.async)return Q._parseAsync({data:F.data,path:F.path,parent:F});else return Q._parseSync({data:F.data,path:F.path,parent:F})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(D,F,$){let J=new Map;for(let Q of F){let Y=c8(Q.shape[D]);if(!Y.length)throw Error(`A discriminator value for key \`${D}\` could not be extracted from all schema options`);for(let B of Y){if(J.has(B))throw Error(`Discriminator property ${String(D)} has duplicate value ${String(B)}`);J.set(B,Q)}}return new nJ({typeName:a.ZodDiscriminatedUnion,discriminator:D,options:F,optionsMap:J,...B0($)})}};AF=class AF extends H0{_parse(D){let{status:F,ctx:$}=this._processInputParams(D),J=(Q,Y)=>{if(dJ(Q)||dJ(Y))return i;let B=AW(Q.value,Y.value);if(!B.valid)return v($,{code:j.invalid_intersection_types}),i;if(cJ(Q)||cJ(Y))F.dirty();return{status:F.value,value:B.data}};if($.common.async)return Promise.all([this._def.left._parseAsync({data:$.data,path:$.path,parent:$}),this._def.right._parseAsync({data:$.data,path:$.path,parent:$})]).then(([Q,Y])=>J(Q,Y));else return J(this._def.left._parseSync({data:$.data,path:$.path,parent:$}),this._def.right._parseSync({data:$.data,path:$.path,parent:$}))}};AF.create=(D,F,$)=>{return new AF({left:D,right:F,typeName:a.ZodIntersection,...B0($)})};C8=class C8 extends H0{_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==k.array)return v($,{code:j.invalid_type,expected:k.array,received:$.parsedType}),i;if($.data.length<this._def.items.length)return v($,{code:j.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i;if(!this._def.rest&&$.data.length>this._def.items.length)v($,{code:j.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F.dirty();let Q=[...$.data].map((Y,B)=>{let X=this._def.items[B]||this._def.rest;if(!X)return null;return X._parse(new n1($,Y,$.path,B))}).filter((Y)=>!!Y);if($.common.async)return Promise.all(Q).then((Y)=>{return ND.mergeArray(F,Y)});else return ND.mergeArray(F,Q)}get items(){return this._def.items}rest(D){return new C8({...this._def,rest:D})}};C8.create=(D,F)=>{if(!Array.isArray(D))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new C8({items:D,typeName:a.ZodTuple,rest:null,...B0(F)})};O9=class O9 extends H0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==k.object)return v($,{code:j.invalid_type,expected:k.object,received:$.parsedType}),i;let J=[],Q=this._def.keyType,Y=this._def.valueType;for(let B in $.data)J.push({key:Q._parse(new n1($,B,$.path,B)),value:Y._parse(new n1($,$.data[B],$.path,B)),alwaysSet:B in $.data});if($.common.async)return ND.mergeObjectAsync(F,J);else return ND.mergeObjectSync(F,J)}get element(){return this._def.valueType}static create(D,F,$){if(F instanceof H0)return new O9({keyType:D,valueType:F,typeName:a.ZodRecord,...B0($)});return new O9({keyType:p1.create(),valueType:D,typeName:a.ZodRecord,...B0(F)})}};w9=class w9 extends H0{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==k.map)return v($,{code:j.invalid_type,expected:k.map,received:$.parsedType}),i;let J=this._def.keyType,Q=this._def.valueType,Y=[...$.data.entries()].map(([B,X],G)=>{return{key:J._parse(new n1($,B,$.path,[G,"key"])),value:Q._parse(new n1($,X,$.path,[G,"value"]))}});if($.common.async){let B=new Map;return Promise.resolve().then(async()=>{for(let X of Y){let G=await X.key,H=await X.value;if(G.status==="aborted"||H.status==="aborted")return i;if(G.status==="dirty"||H.status==="dirty")F.dirty();B.set(G.value,H.value)}return{status:F.value,value:B}})}else{let B=new Map;for(let X of Y){let{key:G,value:H}=X;if(G.status==="aborted"||H.status==="aborted")return i;if(G.status==="dirty"||H.status==="dirty")F.dirty();B.set(G.value,H.value)}return{status:F.value,value:B}}}};w9.create=(D,F,$)=>{return new w9({valueType:F,keyType:D,typeName:a.ZodMap,...B0($)})};S4=class S4 extends H0{_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.parsedType!==k.set)return v($,{code:j.invalid_type,expected:k.set,received:$.parsedType}),i;let J=this._def;if(J.minSize!==null){if($.data.size<J.minSize.value)v($,{code:j.too_small,minimum:J.minSize.value,type:"set",inclusive:!0,exact:!1,message:J.minSize.message}),F.dirty()}if(J.maxSize!==null){if($.data.size>J.maxSize.value)v($,{code:j.too_big,maximum:J.maxSize.value,type:"set",inclusive:!0,exact:!1,message:J.maxSize.message}),F.dirty()}let Q=this._def.valueType;function Y(X){let G=new Set;for(let H of X){if(H.status==="aborted")return i;if(H.status==="dirty")F.dirty();G.add(H.value)}return{status:F.value,value:G}}let B=[...$.data.values()].map((X,G)=>Q._parse(new n1($,X,$.path,G)));if($.common.async)return Promise.all(B).then((X)=>Y(X));else return Y(B)}min(D,F){return new S4({...this._def,minSize:{value:D,message:l.toString(F)}})}max(D,F){return new S4({...this._def,maxSize:{value:D,message:l.toString(F)}})}size(D,F){return this.min(D,F).max(D,F)}nonempty(D){return this.min(1,D)}};S4.create=(D,F)=>{return new S4({valueType:D,minSize:null,maxSize:null,typeName:a.ZodSet,...B0(F)})};EF=class EF extends H0{constructor(){super(...arguments);this.validate=this.implement}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==k.function)return v(F,{code:j.invalid_type,expected:k.function,received:F.parsedType}),i;function $(B,X){return N9({data:B,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,qF(),d8].filter((G)=>!!G),issueData:{code:j.invalid_arguments,argumentsError:X}})}function J(B,X){return N9({data:B,path:F.path,errorMaps:[F.common.contextualErrorMap,F.schemaErrorMap,qF(),d8].filter((G)=>!!G),issueData:{code:j.invalid_return_type,returnTypeError:X}})}let Q={errorMap:F.common.contextualErrorMap},Y=F.data;if(this._def.returns instanceof k4){let B=this;return SD(async function(...X){let G=new eD([]),H=await B._def.args.parseAsync(X,Q).catch((V)=>{throw G.addIssue($(X,V)),G}),q=await Reflect.apply(Y,this,H);return await B._def.returns._def.type.parseAsync(q,Q).catch((V)=>{throw G.addIssue(J(q,V)),G})})}else{let B=this;return SD(function(...X){let G=B._def.args.safeParse(X,Q);if(!G.success)throw new eD([$(X,G.error)]);let H=Reflect.apply(Y,this,G.data),q=B._def.returns.safeParse(H,Q);if(!q.success)throw new eD([J(H,q.error)]);return q.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...D){return new EF({...this._def,args:C8.create(D).rest(l6.create())})}returns(D){return new EF({...this._def,returns:D})}implement(D){return this.parse(D)}strictImplement(D){return this.parse(D)}static create(D,F,$){return new EF({args:D?D:C8.create([]).rest(l6.create()),returns:F||l6.create(),typeName:a.ZodFunction,...B0($)})}};MF=class MF extends H0{get schema(){return this._def.getter()}_parse(D){let{ctx:F}=this._processInputParams(D);return this._def.getter()._parse({data:F.data,path:F.path,parent:F})}};MF.create=(D,F)=>{return new MF({getter:D,typeName:a.ZodLazy,...B0(F)})};NF=class NF extends H0{_parse(D){if(D.data!==this._def.value){let F=this._getOrReturnCtx(D);return v(F,{received:F.data,code:j.invalid_literal,expected:this._def.value}),i}return{status:"valid",value:D.data}}get value(){return this._def.value}};NF.create=(D,F)=>{return new NF({value:D,typeName:a.ZodLiteral,...B0(F)})};c6=class c6 extends H0{_parse(D){if(typeof D.data!=="string"){let F=this._getOrReturnCtx(D),$=this._def.values;return v(F,{expected:E0.joinValues($),received:F.parsedType,code:j.invalid_type}),i}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(D.data)){let F=this._getOrReturnCtx(D),$=this._def.values;return v(F,{received:F.data,code:j.invalid_enum_value,options:$}),i}return SD(D.data)}get options(){return this._def.values}get enum(){let D={};for(let F of this._def.values)D[F]=F;return D}get Values(){let D={};for(let F of this._def.values)D[F]=F;return D}get Enum(){let D={};for(let F of this._def.values)D[F]=F;return D}extract(D,F=this._def){return c6.create(D,{...this._def,...F})}exclude(D,F=this._def){return c6.create(this.options.filter(($)=>!D.includes($)),{...this._def,...F})}};c6.create=$f;RF=class RF extends H0{_parse(D){let F=E0.getValidEnumValues(this._def.values),$=this._getOrReturnCtx(D);if($.parsedType!==k.string&&$.parsedType!==k.number){let J=E0.objectValues(F);return v($,{expected:E0.joinValues(J),received:$.parsedType,code:j.invalid_type}),i}if(!this._cache)this._cache=new Set(E0.getValidEnumValues(this._def.values));if(!this._cache.has(D.data)){let J=E0.objectValues(F);return v($,{received:$.data,code:j.invalid_enum_value,options:J}),i}return SD(D.data)}get enum(){return this._def.values}};RF.create=(D,F)=>{return new RF({values:D,typeName:a.ZodNativeEnum,...B0(F)})};k4=class k4 extends H0{unwrap(){return this._def.type}_parse(D){let{ctx:F}=this._processInputParams(D);if(F.parsedType!==k.promise&&F.common.async===!1)return v(F,{code:j.invalid_type,expected:k.promise,received:F.parsedType}),i;let $=F.parsedType===k.promise?F.data:Promise.resolve(F.data);return SD($.then((J)=>{return this._def.type.parseAsync(J,{path:F.path,errorMap:F.common.contextualErrorMap})}))}};k4.create=(D,F)=>{return new k4({type:D,typeName:a.ZodPromise,...B0(F)})};i1=class i1 extends H0{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===a.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(D){let{status:F,ctx:$}=this._processInputParams(D),J=this._def.effect||null,Q={addIssue:(Y)=>{if(v($,Y),Y.fatal)F.abort();else F.dirty()},get path(){return $.path}};if(Q.addIssue=Q.addIssue.bind(Q),J.type==="preprocess"){let Y=J.transform($.data,Q);if($.common.async)return Promise.resolve(Y).then(async(B)=>{if(F.value==="aborted")return i;let X=await this._def.schema._parseAsync({data:B,path:$.path,parent:$});if(X.status==="aborted")return i;if(X.status==="dirty")return T4(X.value);if(F.value==="dirty")return T4(X.value);return X});else{if(F.value==="aborted")return i;let B=this._def.schema._parseSync({data:Y,path:$.path,parent:$});if(B.status==="aborted")return i;if(B.status==="dirty")return T4(B.value);if(F.value==="dirty")return T4(B.value);return B}}if(J.type==="refinement"){let Y=(B)=>{let X=J.refinement(B,Q);if($.common.async)return Promise.resolve(X);if(X instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return B};if($.common.async===!1){let B=this._def.schema._parseSync({data:$.data,path:$.path,parent:$});if(B.status==="aborted")return i;if(B.status==="dirty")F.dirty();return Y(B.value),{status:F.value,value:B.value}}else return this._def.schema._parseAsync({data:$.data,path:$.path,parent:$}).then((B)=>{if(B.status==="aborted")return i;if(B.status==="dirty")F.dirty();return Y(B.value).then(()=>{return{status:F.value,value:B.value}})})}if(J.type==="transform")if($.common.async===!1){let Y=this._def.schema._parseSync({data:$.data,path:$.path,parent:$});if(!m6(Y))return i;let B=J.transform(Y.value,Q);if(B instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:F.value,value:B}}else return this._def.schema._parseAsync({data:$.data,path:$.path,parent:$}).then((Y)=>{if(!m6(Y))return i;return Promise.resolve(J.transform(Y.value,Q)).then((B)=>({status:F.value,value:B}))});E0.assertNever(J)}};i1.create=(D,F,$)=>{return new i1({schema:D,typeName:a.ZodEffects,effect:F,...B0($)})};i1.createWithPreprocess=(D,F,$)=>{return new i1({schema:F,effect:{type:"preprocess",transform:D},typeName:a.ZodEffects,...B0($)})};c1=class c1 extends H0{_parse(D){if(this._getType(D)===k.undefined)return SD(void 0);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}};c1.create=(D,F)=>{return new c1({innerType:D,typeName:a.ZodOptional,...B0(F)})};n8=class n8 extends H0{_parse(D){if(this._getType(D)===k.null)return SD(null);return this._def.innerType._parse(D)}unwrap(){return this._def.innerType}};n8.create=(D,F)=>{return new n8({innerType:D,typeName:a.ZodNullable,...B0(F)})};CF=class CF extends H0{_parse(D){let{ctx:F}=this._processInputParams(D),$=F.data;if(F.parsedType===k.undefined)$=this._def.defaultValue();return this._def.innerType._parse({data:$,path:F.path,parent:F})}removeDefault(){return this._def.innerType}};CF.create=(D,F)=>{return new CF({innerType:D,typeName:a.ZodDefault,defaultValue:typeof F.default==="function"?F.default:()=>F.default,...B0(F)})};OF=class OF extends H0{_parse(D){let{ctx:F}=this._processInputParams(D),$={...F,common:{...F.common,issues:[]}},J=this._def.innerType._parse({data:$.data,path:$.path,parent:{...$}});if(KF(J))return J.then((Q)=>{return{status:"valid",value:Q.status==="valid"?Q.value:this._def.catchValue({get error(){return new eD($.common.issues)},input:$.data})}});else return{status:"valid",value:J.status==="valid"?J.value:this._def.catchValue({get error(){return new eD($.common.issues)},input:$.data})}}removeCatch(){return this._def.innerType}};OF.create=(D,F)=>{return new OF({innerType:D,typeName:a.ZodCatch,catchValue:typeof F.catch==="function"?F.catch:()=>F.catch,...B0(F)})};j9=class j9 extends H0{_parse(D){if(this._getType(D)!==k.nan){let $=this._getOrReturnCtx(D);return v($,{code:j.invalid_type,expected:k.nan,received:$.parsedType}),i}return{status:"valid",value:D.data}}};j9.create=(D)=>{return new j9({typeName:a.ZodNaN,...B0(D)})};$z0=Symbol("zod_brand");iJ=class iJ extends H0{_parse(D){let{ctx:F}=this._processInputParams(D),$=F.data;return this._def.type._parse({data:$,path:F.path,parent:F})}unwrap(){return this._def.type}};T9=class T9 extends H0{_parse(D){let{status:F,ctx:$}=this._processInputParams(D);if($.common.async)return(async()=>{let Q=await this._def.in._parseAsync({data:$.data,path:$.path,parent:$});if(Q.status==="aborted")return i;if(Q.status==="dirty")return F.dirty(),T4(Q.value);else return this._def.out._parseAsync({data:Q.value,path:$.path,parent:$})})();else{let J=this._def.in._parseSync({data:$.data,path:$.path,parent:$});if(J.status==="aborted")return i;if(J.status==="dirty")return F.dirty(),{status:"dirty",value:J.value};else return this._def.out._parseSync({data:J.value,path:$.path,parent:$})}}static create(D,F){return new T9({in:D,out:F,typeName:a.ZodPipeline})}};wF=class wF extends H0{_parse(D){let F=this._def.innerType._parse(D),$=(J)=>{if(m6(J))J.value=Object.freeze(J.value);return J};return KF(F)?F.then((J)=>$(J)):$(F)}unwrap(){return this._def.innerType}};wF.create=(D,F)=>{return new wF({innerType:D,typeName:a.ZodReadonly,...B0(F)})};Jz0={object:s0.lazycreate};(function(D){D.ZodString="ZodString",D.ZodNumber="ZodNumber",D.ZodNaN="ZodNaN",D.ZodBigInt="ZodBigInt",D.ZodBoolean="ZodBoolean",D.ZodDate="ZodDate",D.ZodSymbol="ZodSymbol",D.ZodUndefined="ZodUndefined",D.ZodNull="ZodNull",D.ZodAny="ZodAny",D.ZodUnknown="ZodUnknown",D.ZodNever="ZodNever",D.ZodVoid="ZodVoid",D.ZodArray="ZodArray",D.ZodObject="ZodObject",D.ZodUnion="ZodUnion",D.ZodDiscriminatedUnion="ZodDiscriminatedUnion",D.ZodIntersection="ZodIntersection",D.ZodTuple="ZodTuple",D.ZodRecord="ZodRecord",D.ZodMap="ZodMap",D.ZodSet="ZodSet",D.ZodFunction="ZodFunction",D.ZodLazy="ZodLazy",D.ZodLiteral="ZodLiteral",D.ZodEnum="ZodEnum",D.ZodEffects="ZodEffects",D.ZodNativeEnum="ZodNativeEnum",D.ZodOptional="ZodOptional",D.ZodNullable="ZodNullable",D.ZodDefault="ZodDefault",D.ZodCatch="ZodCatch",D.ZodPromise="ZodPromise",D.ZodBranded="ZodBranded",D.ZodPipeline="ZodPipeline",D.ZodReadonly="ZodReadonly"})(a||(a={}));Qf=p1.create,Yf=p6.create,Yz0=j9.create,Bz0=d6.create,Bf=VF.create,Xz0=P4.create,Gz0=R9.create,Wz0=ZF.create,Hz0=UF.create,qz0=I4.create,Kz0=l6.create,zz0=R8.create,Ez0=C9.create,Vz0=d1.create,Zz0=s0.create,Uz0=s0.strictCreate,Lz0=LF.create,Az0=nJ.create,Mz0=AF.create,Nz0=C8.create,Rz0=O9.create,Cz0=w9.create,Oz0=S4.create,wz0=EF.create,jz0=MF.create,Tz0=NF.create,Pz0=c6.create,Iz0=RF.create,Sz0=k4.create,kz0=i1.create,vz0=c1.create,yz0=n8.create,xz0=i1.createWithPreprocess,_z0=T9.create,bz0={string:(D)=>p1.create({...D,coerce:!0}),number:(D)=>p6.create({...D,coerce:!0}),boolean:(D)=>VF.create({...D,coerce:!0}),bigint:(D)=>d6.create({...D,coerce:!0}),date:(D)=>P4.create({...D,coerce:!0})},uz0=i});var B1={};c4(B1,{void:()=>Ez0,util:()=>E0,unknown:()=>Kz0,union:()=>Lz0,undefined:()=>Wz0,tuple:()=>Nz0,transformer:()=>kz0,symbol:()=>Gz0,string:()=>Qf,strictObject:()=>Uz0,setErrorMap:()=>yK0,set:()=>Oz0,record:()=>Rz0,quotelessJson:()=>kK0,promise:()=>Sz0,preprocess:()=>xz0,pipeline:()=>_z0,ostring:()=>fz0,optional:()=>vz0,onumber:()=>gz0,oboolean:()=>hz0,objectUtil:()=>VW,object:()=>Zz0,number:()=>Yf,nullable:()=>yz0,null:()=>Hz0,never:()=>zz0,nativeEnum:()=>Iz0,nan:()=>Yz0,map:()=>Cz0,makeIssue:()=>N9,literal:()=>Tz0,lazy:()=>jz0,late:()=>Jz0,isValid:()=>m6,isDirty:()=>cJ,isAsync:()=>KF,isAborted:()=>dJ,intersection:()=>Mz0,instanceof:()=>Qz0,getParsedType:()=>N8,getErrorMap:()=>qF,function:()=>wz0,enum:()=>Pz0,effect:()=>kz0,discriminatedUnion:()=>Az0,defaultErrorMap:()=>d8,datetimeRegex:()=>Ff,date:()=>Xz0,custom:()=>Jf,coerce:()=>bz0,boolean:()=>Bf,bigint:()=>Bz0,array:()=>Vz0,any:()=>qz0,addIssueToContext:()=>v,ZodVoid:()=>C9,ZodUnknown:()=>l6,ZodUnion:()=>LF,ZodUndefined:()=>ZF,ZodType:()=>H0,ZodTuple:()=>C8,ZodTransformer:()=>i1,ZodSymbol:()=>R9,ZodString:()=>p1,ZodSet:()=>S4,ZodSchema:()=>H0,ZodRecord:()=>O9,ZodReadonly:()=>wF,ZodPromise:()=>k4,ZodPipeline:()=>T9,ZodParsedType:()=>k,ZodOptional:()=>c1,ZodObject:()=>s0,ZodNumber:()=>p6,ZodNullable:()=>n8,ZodNull:()=>UF,ZodNever:()=>R8,ZodNativeEnum:()=>RF,ZodNaN:()=>j9,ZodMap:()=>w9,ZodLiteral:()=>NF,ZodLazy:()=>MF,ZodIssueCode:()=>j,ZodIntersection:()=>AF,ZodFunction:()=>EF,ZodFirstPartyTypeKind:()=>a,ZodError:()=>eD,ZodEnum:()=>c6,ZodEffects:()=>i1,ZodDiscriminatedUnion:()=>nJ,ZodDefault:()=>CF,ZodDate:()=>P4,ZodCatch:()=>OF,ZodBranded:()=>iJ,ZodBoolean:()=>VF,ZodBigInt:()=>d6,ZodArray:()=>d1,ZodAny:()=>I4,Schema:()=>H0,ParseStatus:()=>ND,OK:()=>SD,NEVER:()=>uz0,INVALID:()=>i,EMPTY_PATH:()=>xK0,DIRTY:()=>T4,BRAND:()=>$z0});var MW=I(()=>{pJ();UW();o_();M9();Xf();lJ()});var Gf=I(()=>{MW();MW()});import{copyFileSync as mz0,existsSync as Wf,mkdirSync as lz0}from"fs";import{homedir as aJ}from"os";import{join as jF}from"path";function dz0(D){let F=D.trim().replace(/\/+$/,"");try{let $=new URL(F);return $.protocol=$.protocol.toLowerCase(),$.host=$.host.toLowerCase(),$.toString().replace(/\/+$/,"")}catch{return console.error(`[nemar] could not parse stored apiUrl ${JSON.stringify(D)}; leaving as-is`),F}}function cz0(){if(process.env.NEMAR_CONFIG_DIR)return;let D=jF(NW,"config.json");if(Wf(D))return;let F=[];if(process.platform==="darwin")F.push(jF(aJ(),"Library","Preferences","nemar-nodejs","config.json"));if(process.platform==="win32"){let $=process.env.APPDATA||jF(aJ(),"AppData","Roaming");F.push(jF($,"nemar-nodejs","config.json"))}F.push(jF(aJ(),".config","nemar-nodejs","config.json"));for(let $ of F)if(Wf($))try{lz0(NW,{recursive:!0}),mz0($,D),console.error(`[nemar] Config migrated from ${$} to ${D}
92
92
  [nemar] You can safely remove the old file.`);return}catch(J){console.error(`[nemar] Failed to migrate config from ${$}:`,J,`
93
93
  [nemar] You can manually copy ${$} to ${D}`)}}function iz0(){let D=h0.get("accounts");if(D&&Object.keys(D).length>0)return;let F=h0.get("apiKey"),$=h0.get("username");if(!F&&!$)return;try{let J=$||"default",Q={};for(let Y of nz0){let B=h0.get(Y);if(B!==void 0)Q[Y]=B}h0.store={activeAccount:J,accounts:{[J]:Q}}}catch(J){console.error("Config migration failed (legacy config preserved):",J)}}function az0(){let D=h0.store,F=D.accounts,$=!1;if(F)for(let[Q,Y]of Object.entries(F)){let B=Y?.apiUrl;if(!B)continue;if(pz0.has(dz0(B)))F[Q]={...Y,apiUrl:v4},console.error(`[nemar] migrated stored apiUrl for account "${Q}": ${B} -> ${v4}`),$=!0}let J=D.apiUrl;if(F&&Object.keys(F).length>0&&J!==void 0){let{apiUrl:Q,...Y}=D;try{h0.store=Y,console.error(`[nemar] removed stale top-level apiUrl from config (was: ${J})`),$=!1}catch(B){console.error("API URL cleanup failed (config file unchanged):",B)}}if($)try{h0.store={...h0.store,accounts:F}}catch(Q){console.error("API URL migration failed (config file unchanged):",Q)}}function P9(){return h0.get("activeAccount")}function y4(){return h0.get("accounts")||{}}function JD(){let D={apiUrl:v4},F=P9();if(!F)return D;return y4()[F]||D}function Hf(){return!!JD().sandboxCompleted}function a1(D,F){let $=P9()||"default",J=y4();if(!J[$])J[$]={apiUrl:v4};J[$][D]=F,h0.store={...h0.store,accounts:J,activeAccount:$}}function RW(D){let F=P9();if(!F)return;let $=y4();if($[F])delete $[F][D],h0.set("accounts",$)}function qf(){let D=P9();if(!D){h0.clear();return}let F=y4();delete F[D];let $=Object.keys(F);if($.length>0)h0.store={...h0.store,accounts:F,activeAccount:$[0]};else h0.clear()}function Kf(){h0.clear()}function L0(){return!!JD().apiKey}function zf(){return h0.path}function I9(){let D=y4(),F=P9();return Object.entries(D).map(([$,J])=>({username:J.username||$,email:J.email,githubUsername:J.githubUsername,active:$===F}))}function Ef(D,F){let $=y4();$[D]=F,h0.store={...h0.store,accounts:$,activeAccount:D}}function Vf(D){let F=y4();if(F[D])return h0.store={...h0.store,activeAccount:D},F[D];for(let[$,J]of Object.entries(F))if(J.githubUsername===D)return h0.store={...h0.store,activeAccount:$},J;return null}var v4="https://nemar-api-dev.sccn-org.workers.dev",pz0,NW,KS0,h0,nz0;var x4=I(()=>{i_();Gf();pz0=new Set(["https://api.osc.earth/nemar","https://nemar-api.neuromechanist.workers.dev","https://nemar-api-dev.shirazi-10f.workers.dev"]);NW=process.env.NEMAR_CONFIG_DIR||jF(aJ(),".config","nemar"),KS0=B1.object({apiKey:B1.string().optional(),apiUrl:B1.string().url().default(v4),username:B1.string().optional(),email:B1.string().email().optional(),githubUsername:B1.string().optional(),sandboxCompleted:B1.boolean().optional(),sandboxDatasetId:B1.string().optional(),dismissedNoticeIds:B1.array(B1.number()).optional()});cz0();h0=new mJ({projectName:"nemar",schema:{activeAccount:{type:"string"},accounts:{type:"object"},apiKey:{type:"string"},apiUrl:{type:"string"},username:{type:"string"},email:{type:"string"},githubUsername:{type:"string"},sandboxCompleted:{type:"boolean"},sandboxDatasetId:{type:"string"}},cwd:NW}),nz0=["apiKey","apiUrl","username","email","githubUsername","sandboxCompleted","sandboxDatasetId","dismissedNoticeIds"];iz0();az0()});function oJ(D){if(Zf)return;Zf=!0;let F=W.yellow("\u2500".repeat(60)),$=W.yellow.bold("[MAINTENANCE]"),J=W.dim(`mode: ${D.mode}`),Q=D.eta?`
94
94
  ${W.dim(`eta: ${D.eta}`)}`:"";process.stderr.write(`${F}
95
95
  ${$} ${D.message}
96
96
  ${J}${Q}
97
97
  ${F}
98
- `)}var Zf=!1;var CW=I(()=>{xD()});var Lf;var Uf=I(()=>{Lf={name:"nemar-cli",version:"0.8.14-dev.857",description:"CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",type:"module",main:"dist/index.js",bin:{nemar:"dist/index.js"},scripts:{dev:"bun run src/index.ts",build:"bun build src/index.ts --outdir dist --target bun --minify && sed '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js",test:"bun test",lint:"biome check src/","lint:fix":"biome check --fix src/",format:"biome format --write src/",typecheck:"tsc --noEmit",prepublishOnly:"bun run build","docs:generate":"bun run scripts/generate-docs.ts","docs:serve":"mkdocs serve","docs:build":"mkdocs build",prepare:"husky",deploy:"wrangler deploy",preview:"wrangler dev"},keywords:["nemar","bids","neuroimaging","eeg","emg","datalad","cli"],author:"NEMAR Team",license:"CC-BY-NC-ND-4.0",repository:{type:"git",url:"git+https://github.com/nemarOrg/nemar-cli.git"},bugs:{url:"https://github.com/nemarOrg/nemar-cli/issues"},homepage:"https://nemar-cli.pages.dev",engines:{bun:">=1.0.0"},files:["dist","README.md","LICENSE"],dependencies:{chalk:"^5.3.0",commander:"^12.1.0",conf:"^13.0.1","fuse.js":"^7.1.0",inquirer:"^9.2.15",ora:"^8.0.1",zod:"^3.23.8"},"lint-staged":{"src/**/*.{ts,tsx}":["biome check --fix"],"backend/src/**/*.{ts,tsx}":["biome check --fix"]},devDependencies:{"@biomejs/biome":"1.9.4","@types/bcryptjs":"^3.0.0","@types/bun":"latest","@types/inquirer":"^9.0.7",bcryptjs:"^3.0.3",husky:"^9.1.7","lint-staged":"^16.3.2",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var _4;var sJ=I(()=>{Uf();_4=Lf.version});function w0(D){if(D instanceof Error)return D.message;return String(D)}function Af(){if(process.env.TEST_API_URL)return process.env.TEST_API_URL;if(wW)return OW;return JD().apiUrl||OW}async function u(D,F={},$=!1){let J=`${Af()}${D}`,Q={"Content-Type":"application/json","X-CLI-Version":_4,...F.headers};if($){let X=JD();if(!X.apiKey&&$===!0)throw new b(401,"Not authenticated. Run 'nemar auth login' first.");if(X.apiKey)Q.Authorization=`Bearer ${X.apiKey}`}let Y;try{Y=await fetch(J,{...F,headers:Q})}catch(X){throw new b(0,`Network error: Could not connect to ${Af()}`,{originalError:X instanceof Error?X.message:String(X)})}let B;try{B=await Y.json()}catch{throw new b(Y.status,`Invalid response from server (status ${Y.status})`)}if(!Y.ok){if(Y.status===503&&(B.mode==="read-only"||B.mode==="full")){let X=typeof B.message==="string"?B.message:"NEMAR is in maintenance mode. Please retry shortly.",G=typeof B.eta==="string"?B.eta:null,H=new tJ(B.mode,X,G,B.details);throw oJ(H),H}throw new b(Y.status,B.error||B.message||"Request failed",B.details,typeof B.step==="string"?B.step:void 0)}return B}async function Nf(D){return u(`/auth/check-username?username=${encodeURIComponent(D)}`)}async function Rf(D){return u(`/auth/check-github?username=${encodeURIComponent(D)}`)}async function Cf(D){return u("/auth/signup",{method:"POST",body:JSON.stringify(D)})}async function Of(D){return u("/auth/login",{method:"POST",body:JSON.stringify({api_key:D})})}async function wf(D){return u("/auth/resend-verification",{method:"POST",body:JSON.stringify({email:D})})}async function jf(D,F){return u("/auth/retrieve-key",{method:"POST",body:JSON.stringify({email:D,password:F})})}async function Tf(D){return u("/auth/request-key-regeneration",{method:"POST",body:JSON.stringify({email:D})})}async function eJ(){return u("/users/me",{},!0)}async function Pf(D,F){let $=new URLSearchParams;if(D)$.set("status",D);if(F)$.set("role",F);let J=$.toString()?`?${$.toString()}`:"";return u(`/admin/users${J}`,{},!0)}async function If(D){return u(`/admin/approve/${D}`,{method:"POST"},!0)}async function Sf(D){return u(`/admin/revoke/${D}`,{method:"POST"},!0)}async function kf(D,F){return u(`/admin/users/${D}/role`,{method:"POST",body:JSON.stringify({role:F})},!0)}async function jW(D,F){return u(`/admin/datasets/${D}/visibility`,{method:"PATCH",body:JSON.stringify({visibility:F})},!0)}async function vf(D){return u(`/datasets/${D}/publish`,{method:"POST"},!0)}async function yf(D){return u(`/admin/datasets/${D}/ci`,{},!0)}async function f4(D,F){let $=F?.validate===!1?"?validate=false":"";return u(`/admin/datasets/${D}/ci${$}`,{method:"POST"},!0)}async function TW(D){return u(`/admin/datasets/${D}/ci/sync`,{method:"POST"},!0)}async function DQ(D){return u(`/datasets/${D}/ci/status`,{},!0)}async function xf(D){return u(`/datasets/${D}/manifest`,{},!0)}async function FQ(D,F){return u(`/datasets/${D}/manifest/${F}`,{},!0)}function _f(D){let F=D;if(!F.status)F.status="active";else if(!["active","archived","deleted"].includes(F.status))throw Error(`Invalid dataset status: ${F.status}`);if(!F.visibility)F.visibility="private";else if(!["public","private"].includes(F.visibility))throw Error(`Invalid dataset visibility: ${F.visibility}`);return F}async function k9(D={}){let F=new URLSearchParams;if(D.mine)F.set("mine","true");if(D.search)F.set("search",D.search);if(D.modality)F.set("modality",D.modality);if(D.author)F.set("author",D.author);if(D.task)F.set("task",D.task);if(D.hasDoi)F.set("has_doi","true");if(D.recent)F.set("recent",String(D.recent));if(D.sort)F.set("sort",D.sort);if(D.limit!=null)F.set("limit",String(D.limit));if(D.offset!=null)F.set("offset",String(D.offset));if(D.owner)F.set("owner",D.owner);let $=F.toString()?`?${F.toString()}`:"",J=await u(`/datasets${$}`,{},D.mine?!0:"optional");return J.datasets=J.datasets.map(_f),J}async function ff(D){return u(`/datasets/resolve/${D}`,{},"optional")}async function gf(D,F={}){let $=new URLSearchParams({q:D});if(F.modality)$.set("modality",F.modality);if(F.limit)$.set("limit",String(F.limit));return u(`/datasets/search?${$.toString()}`,{},"optional")}async function uD(D){let F=await u(`/datasets/${D}`,{},"optional");return _f(F.dataset)}async function hf(D){return u(`/datasets/${D}/versions`,{},!0)}async function $Q(D){return u("/datasets",{method:"POST",body:JSON.stringify(D)},!0)}async function JQ(D){return u(`/datasets/${D}/finalize`,{method:"POST"},!0)}async function O8(D,F){return u(`/datasets/${D}/upload-credentials`,{method:"POST",body:JSON.stringify({duration_seconds:F})},!0)}async function QQ(D,F){return u(`/datasets/${D}/download-credentials`,{method:"POST",body:JSON.stringify({duration_seconds:F})},!0)}async function bf(D,F){return u(`/admin/datasets/${D}/doi/concept`,{method:"POST",body:JSON.stringify(F)},!0)}async function v9(D){return u(`/admin/datasets/${D}/doi`,{},!0)}async function PW(D,F){return u(`/admin/datasets/${D}/doi/update`,{method:"POST",body:JSON.stringify(F)},!0)}async function IW(D){return u(`/datasets/${D}/request-access`,{method:"POST"},!0)}async function uf(D,F){return u(`/datasets/${D}/invite`,{method:"POST",body:JSON.stringify({username:F})},!0)}async function mf(D){return u(`/datasets/${D}/collaborators`,{},!0)}async function lf(D){return u("/sandbox/complete",{method:"POST",body:JSON.stringify({dataset_id:D})},!0)}async function pf(){return u("/sandbox/reset",{method:"POST"},!0)}async function df(){return u("/sandbox/status",{},!0)}async function YQ(D){return u(`/datasets/${D}/publish/request`,{method:"POST"},!0)}async function cf(D){return u(`/datasets/${D}/publish/status`,{},!0)}async function nf(D){return u(`/datasets/${D}/publish/resend`,{method:"POST"},!0)}async function af(D){let F=D?`?status=${D}`:"";return u(`/admin/publish/requests${F}`,{},!0)}async function of(D,F){return u(`/admin/publish/${D}/deny`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:F})},!0)}function sz0(D,F=[]){if(D){let $=S9.indexOf(D);if($>=0)return $+1}return Math.min(F.length+1,S9.length)}function rz0(D){if(!(D instanceof b))return!1;if(D.statusCode===0)return!0;if(D.statusCode===429)return!0;if(D.statusCode>=500&&D.statusCode<600)return!0;if(D.statusCode===403&&/repository has been locked/i.test(D.message))return!0;return!1}async function BQ(D,F=!1,$=!1,J=!1,Q,Y){let G,H,q=0,K=!1,V,E=F,Z=[],L;function A(M,N,w,P){if(!Y)return;Y({step:M,stepIndex:sz0(M,N),stepTotal:S9.length,s3LockLocked:w,s3LockTotal:P,s3LockResumed:M==="s3_lock"&&K?!0:void 0})}for(let M=1;M<=5;M++)try{let N,w=!0;do{if(N=await u(`/admin/publish/${D}/approve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({resume:w?E:!0,sandbox:$,s3_lock_continuation_token:G,s3_lock_total:H,skip_ci_check:J})},!0),w=!1,N.step_results)Z.push(...N.step_results);if(N.s3_lock_total!==void 0)H=N.s3_lock_total;if(N.s3_lock_batch_count!==void 0)q+=N.s3_lock_batch_count;let P=N.step??N.step_results?.[N.step_results.length-1]?.step;if(P&&(P!==V||P==="s3_lock"))A(P,N.steps_completed??[],P==="s3_lock"?q:void 0,P==="s3_lock"?H:void 0),V=P;if(N.hasMore&&N.s3_lock_continuation_token!==void 0)G=N.s3_lock_continuation_token;else break}while(N.hasMore);if(Z.length>0)N.step_results=Mf(Z);return N}catch(N){if(L=N,M===5||!rz0(N)){if(N instanceof b&&Z.length>0)N.stepResults=Mf(Z);throw N}let P=N;if(Q?.({attempt:M,maxAttempts:5,delayMs:1e4,step:P.step,error:P.message}),await new Promise((C)=>setTimeout(C,1e4)),E=!0,G!==void 0)K=!0}throw L}function Mf(D){let F=new Map;for(let $ of D)F.set($.step,$);return Array.from(F.values())}async function sf(D,F){return u(`/admin/datasets/${D}/enrichment`,{method:"POST",body:JSON.stringify(F)},!0)}async function rf(D){return u(`/admin/datasets/${D}/files`,{},!0)}async function tf(D){let F,$=0,J=[],Q=!0;while(Q){let Y=await u(`/admin/datasets/${D}/s3-lock`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({continuation_token:F})},!0);if($+=Y.locked,Y.failed?.length)J.push(...Y.failed);if(Q=Y.hasMore,F=Y.continuation_token,Q&&!F)throw new b(500,"S3 lock paginated response missing continuation_token; aborting to avoid infinite loop")}return{locked:$,failed:J}}async function ef(D){return u(`/admin/datasets/${D}/reset`,{method:"POST"},!0)}async function Dg(D,F=!1){return u(`/admin/datasets/${D}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({force:F})},!0)}async function Fg(D){return u("/admin/datasets/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataset_ids:D})},!0)}async function $g(D){return u("/admin/datasets/import",{method:"POST",body:JSON.stringify(D)},!0)}async function Jg(D){return u(`/admin/datasets/${D}/sync`,{method:"POST"},!0)}async function Qg(){return u("/admin/sync/status",{},!0)}async function Yg(D,F){return u(`/admin/datasets/${D}/reindex`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F??{})},!0)}async function Bg(D,F){return u("/admin/datasets/reindex/bulk",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filter:D,...F??{}})},!0)}async function Xg(){return u("/admin/email-preferences",{},!0)}async function Gg(D){return u("/admin/email-preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)},!0)}async function Wg(){return u("/notices",{},"optional")}async function Hg(){return u("/admin/notices",{},!0)}async function qg(D){return u("/admin/notices",{method:"POST",body:JSON.stringify(D)},!0)}async function Kg(D){return u(`/admin/notices/${D}`,{method:"DELETE"},!0)}async function SW(D){return u("/admin/notify",{method:"POST",body:JSON.stringify(D)},!0)}var OW="https://nemar-api-dev.sccn-org.workers.dev",rJ,b,tJ,wW,S9;var i8=I(()=>{x4();CW();sJ();rJ=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/;b=class b extends Error{statusCode;details;step;constructor(D,F,$,J){super(F);this.statusCode=D;this.details=$;this.step=J;this.name="ApiError"}};tJ=class tJ extends b{mode;eta;constructor(D,F,$,J){super(503,F,J);this.mode=D;this.eta=$;this.name="MaintenanceError"}};wW=OW.includes("workers.dev");S9=["ci_check","enrichment_check","repo_public","s3_public_read","tag_protect","doi_create","update_metadata","update_readme","create_tag","create_release","upload_to_zenodo","publish_doi","version_doi","s3_lock","generate_archive","sync_nemar","notify_user"]});function Eg(D){kW=D}function vW(){return kW}function y9(D){if(kW)process.stderr.write(`${D}
98
+ `)}var Zf=!1;var CW=I(()=>{xD()});var Lf;var Uf=I(()=>{Lf={name:"nemar-cli",version:"0.8.14-dev.858",description:"CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",type:"module",main:"dist/index.js",bin:{nemar:"dist/index.js"},scripts:{dev:"bun run src/index.ts",build:"bun build src/index.ts --outdir dist --target bun --minify && sed '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js",test:"bun test",lint:"biome check src/","lint:fix":"biome check --fix src/",format:"biome format --write src/",typecheck:"tsc --noEmit",prepublishOnly:"bun run build","docs:generate":"bun run scripts/generate-docs.ts","docs:serve":"mkdocs serve","docs:build":"mkdocs build",prepare:"husky",deploy:"wrangler deploy",preview:"wrangler dev"},keywords:["nemar","bids","neuroimaging","eeg","emg","datalad","cli"],author:"NEMAR Team",license:"CC-BY-NC-ND-4.0",repository:{type:"git",url:"git+https://github.com/nemarOrg/nemar-cli.git"},bugs:{url:"https://github.com/nemarOrg/nemar-cli/issues"},homepage:"https://nemar-cli.pages.dev",engines:{bun:">=1.0.0"},files:["dist","README.md","LICENSE"],dependencies:{chalk:"^5.3.0",commander:"^12.1.0",conf:"^13.0.1","fuse.js":"^7.1.0",inquirer:"^9.2.15",ora:"^8.0.1",zod:"^3.23.8"},"lint-staged":{"src/**/*.{ts,tsx}":["biome check --fix"],"backend/src/**/*.{ts,tsx}":["biome check --fix"]},devDependencies:{"@biomejs/biome":"1.9.4","@types/bcryptjs":"^3.0.0","@types/bun":"latest","@types/inquirer":"^9.0.7",bcryptjs:"^3.0.3",husky:"^9.1.7","lint-staged":"^16.3.2",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var _4;var sJ=I(()=>{Uf();_4=Lf.version});function w0(D){if(D instanceof Error)return D.message;return String(D)}function Af(){if(process.env.TEST_API_URL)return process.env.TEST_API_URL;if(wW)return OW;return JD().apiUrl||OW}async function u(D,F={},$=!1){let J=`${Af()}${D}`,Q={"Content-Type":"application/json","X-CLI-Version":_4,...F.headers};if($){let X=JD();if(!X.apiKey&&$===!0)throw new h(401,"Not authenticated. Run 'nemar auth login' first.");if(X.apiKey)Q.Authorization=`Bearer ${X.apiKey}`}let Y;try{Y=await fetch(J,{...F,headers:Q})}catch(X){throw new h(0,`Network error: Could not connect to ${Af()}`,{originalError:X instanceof Error?X.message:String(X)})}let B;try{B=await Y.json()}catch{throw new h(Y.status,`Invalid response from server (status ${Y.status})`)}if(!Y.ok){if(Y.status===503&&(B.mode==="read-only"||B.mode==="full")){let X=typeof B.message==="string"?B.message:"NEMAR is in maintenance mode. Please retry shortly.",G=typeof B.eta==="string"?B.eta:null,H=new tJ(B.mode,X,G,B.details);throw oJ(H),H}throw new h(Y.status,B.error||B.message||"Request failed",B.details,typeof B.step==="string"?B.step:void 0)}return B}async function Nf(D){return u(`/auth/check-username?username=${encodeURIComponent(D)}`)}async function Rf(D){return u(`/auth/check-github?username=${encodeURIComponent(D)}`)}async function Cf(D){return u("/auth/signup",{method:"POST",body:JSON.stringify(D)})}async function Of(D){return u("/auth/login",{method:"POST",body:JSON.stringify({api_key:D})})}async function wf(D){return u("/auth/resend-verification",{method:"POST",body:JSON.stringify({email:D})})}async function jf(D,F){return u("/auth/retrieve-key",{method:"POST",body:JSON.stringify({email:D,password:F})})}async function Tf(D){return u("/auth/request-key-regeneration",{method:"POST",body:JSON.stringify({email:D})})}async function eJ(){return u("/users/me",{},!0)}async function Pf(D,F){let $=new URLSearchParams;if(D)$.set("status",D);if(F)$.set("role",F);let J=$.toString()?`?${$.toString()}`:"";return u(`/admin/users${J}`,{},!0)}async function If(D){return u(`/admin/approve/${D}`,{method:"POST"},!0)}async function Sf(D){return u(`/admin/revoke/${D}`,{method:"POST"},!0)}async function kf(D,F){return u(`/admin/users/${D}/role`,{method:"POST",body:JSON.stringify({role:F})},!0)}async function jW(D,F){return u(`/admin/datasets/${D}/visibility`,{method:"PATCH",body:JSON.stringify({visibility:F})},!0)}async function vf(D){return u(`/datasets/${D}/publish`,{method:"POST"},!0)}async function yf(D){return u(`/admin/datasets/${D}/ci`,{},!0)}async function f4(D,F){let $=F?.validate===!1?"?validate=false":"";return u(`/admin/datasets/${D}/ci${$}`,{method:"POST"},!0)}async function TW(D){return u(`/admin/datasets/${D}/ci/sync`,{method:"POST"},!0)}async function DQ(D){return u(`/datasets/${D}/ci/status`,{},!0)}async function xf(D){return u(`/datasets/${D}/manifest`,{},!0)}async function FQ(D,F){return u(`/datasets/${D}/manifest/${F}`,{},!0)}function _f(D){let F=D;if(!F.status)F.status="active";else if(!["active","archived","deleted"].includes(F.status))throw Error(`Invalid dataset status: ${F.status}`);if(!F.visibility)F.visibility="private";else if(!["public","private"].includes(F.visibility))throw Error(`Invalid dataset visibility: ${F.visibility}`);return F}async function k9(D={}){let F=new URLSearchParams;if(D.mine)F.set("mine","true");if(D.search)F.set("search",D.search);if(D.modality)F.set("modality",D.modality);if(D.author)F.set("author",D.author);if(D.task)F.set("task",D.task);if(D.hasDoi)F.set("has_doi","true");if(D.recent)F.set("recent",String(D.recent));if(D.sort)F.set("sort",D.sort);if(D.limit!=null)F.set("limit",String(D.limit));if(D.offset!=null)F.set("offset",String(D.offset));if(D.owner)F.set("owner",D.owner);let $=F.toString()?`?${F.toString()}`:"",J=await u(`/datasets${$}`,{},D.mine?!0:"optional");return J.datasets=J.datasets.map(_f),J}async function ff(D){return u(`/datasets/resolve/${D}`,{},"optional")}async function gf(D,F={}){let $=new URLSearchParams({q:D});if(F.modality)$.set("modality",F.modality);if(F.limit)$.set("limit",String(F.limit));return u(`/datasets/search?${$.toString()}`,{},"optional")}async function uD(D){let F=await u(`/datasets/${D}`,{},"optional");return _f(F.dataset)}async function hf(D){return u(`/datasets/${D}/versions`,{},!0)}async function $Q(D){return u("/datasets",{method:"POST",body:JSON.stringify(D)},!0)}async function JQ(D){return u(`/datasets/${D}/finalize`,{method:"POST"},!0)}async function O8(D,F){return u(`/datasets/${D}/upload-credentials`,{method:"POST",body:JSON.stringify({duration_seconds:F})},!0)}async function QQ(D,F){return u(`/datasets/${D}/download-credentials`,{method:"POST",body:JSON.stringify({duration_seconds:F})},!0)}async function bf(D,F){return u(`/admin/datasets/${D}/doi/concept`,{method:"POST",body:JSON.stringify(F)},!0)}async function v9(D){return u(`/admin/datasets/${D}/doi`,{},!0)}async function PW(D,F){return u(`/admin/datasets/${D}/doi/update`,{method:"POST",body:JSON.stringify(F)},!0)}async function IW(D){return u(`/datasets/${D}/request-access`,{method:"POST"},!0)}async function uf(D,F){return u(`/datasets/${D}/invite`,{method:"POST",body:JSON.stringify({username:F})},!0)}async function mf(D){return u(`/datasets/${D}/collaborators`,{},!0)}async function lf(D){return u("/sandbox/complete",{method:"POST",body:JSON.stringify({dataset_id:D})},!0)}async function pf(){return u("/sandbox/reset",{method:"POST"},!0)}async function df(){return u("/sandbox/status",{},!0)}async function YQ(D){return u(`/datasets/${D}/publish/request`,{method:"POST"},!0)}async function cf(D){return u(`/datasets/${D}/publish/status`,{},!0)}async function nf(D){return u(`/datasets/${D}/publish/resend`,{method:"POST"},!0)}async function af(D){let F=D?`?status=${D}`:"";return u(`/admin/publish/requests${F}`,{},!0)}async function of(D,F){return u(`/admin/publish/${D}/deny`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:F})},!0)}function sz0(D,F=[]){if(D){let $=S9.indexOf(D);if($>=0)return $+1}return Math.min(F.length+1,S9.length)}function rz0(D){if(!(D instanceof h))return!1;if(D.statusCode===0)return!0;if(D.statusCode===429)return!0;if(D.statusCode>=500&&D.statusCode<600)return!0;if(D.statusCode===403&&/repository has been locked/i.test(D.message))return!0;return!1}async function BQ(D,F=!1,$=!1,J=!1,Q,Y){let G,H,q=0,K=!1,V,E=F,Z=[],L;function M(A,N,w,P){if(!Y)return;Y({step:A,stepIndex:sz0(A,N),stepTotal:S9.length,s3LockLocked:w,s3LockTotal:P,s3LockResumed:A==="s3_lock"&&K?!0:void 0})}for(let A=1;A<=5;A++)try{let N,w=!0;do{if(N=await u(`/admin/publish/${D}/approve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({resume:w?E:!0,sandbox:$,s3_lock_continuation_token:G,s3_lock_total:H,skip_ci_check:J})},!0),w=!1,N.step_results)Z.push(...N.step_results);if(N.s3_lock_total!==void 0)H=N.s3_lock_total;if(N.s3_lock_batch_count!==void 0)q+=N.s3_lock_batch_count;let P=N.step??N.step_results?.[N.step_results.length-1]?.step;if(P&&(P!==V||P==="s3_lock"))M(P,N.steps_completed??[],P==="s3_lock"?q:void 0,P==="s3_lock"?H:void 0),V=P;if(N.hasMore&&N.s3_lock_continuation_token!==void 0)G=N.s3_lock_continuation_token;else break}while(N.hasMore);if(Z.length>0)N.step_results=Mf(Z);return N}catch(N){if(L=N,A===5||!rz0(N)){if(N instanceof h&&Z.length>0)N.stepResults=Mf(Z);throw N}let P=N;if(Q?.({attempt:A,maxAttempts:5,delayMs:1e4,step:P.step,error:P.message}),await new Promise((C)=>setTimeout(C,1e4)),E=!0,G!==void 0)K=!0}throw L}function Mf(D){let F=new Map;for(let $ of D)F.set($.step,$);return Array.from(F.values())}async function sf(D,F){return u(`/admin/datasets/${D}/enrichment`,{method:"POST",body:JSON.stringify(F)},!0)}async function rf(D){return u(`/admin/datasets/${D}/files`,{},!0)}async function tf(D){let F,$=0,J=[],Q=!0;while(Q){let Y=await u(`/admin/datasets/${D}/s3-lock`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({continuation_token:F})},!0);if($+=Y.locked,Y.failed?.length)J.push(...Y.failed);if(Q=Y.hasMore,F=Y.continuation_token,Q&&!F)throw new h(500,"S3 lock paginated response missing continuation_token; aborting to avoid infinite loop")}return{locked:$,failed:J}}async function ef(D){return u(`/admin/datasets/${D}/reset`,{method:"POST"},!0)}async function Dg(D,F=!1){return u(`/admin/datasets/${D}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({force:F})},!0)}async function Fg(D){return u("/admin/datasets/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({dataset_ids:D})},!0)}async function $g(D){return u("/admin/datasets/import",{method:"POST",body:JSON.stringify(D)},!0)}async function Jg(D){return u(`/admin/datasets/${D}/sync`,{method:"POST"},!0)}async function Qg(){return u("/admin/sync/status",{},!0)}async function Yg(D,F){return u(`/admin/datasets/${D}/reindex`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(F??{})},!0)}async function Bg(D,F){return u("/admin/datasets/reindex/bulk",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({filter:D,...F??{}})},!0)}async function Xg(){return u("/admin/email-preferences",{},!0)}async function Gg(D){return u("/admin/email-preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(D)},!0)}async function Wg(){return u("/notices",{},"optional")}async function Hg(){return u("/admin/notices",{},!0)}async function qg(D){return u("/admin/notices",{method:"POST",body:JSON.stringify(D)},!0)}async function Kg(D){return u(`/admin/notices/${D}`,{method:"DELETE"},!0)}async function SW(D){return u("/admin/notify",{method:"POST",body:JSON.stringify(D)},!0)}var OW="https://nemar-api-dev.sccn-org.workers.dev",rJ,h,tJ,wW,S9;var i8=I(()=>{x4();CW();sJ();rJ=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/;h=class h extends Error{statusCode;details;step;constructor(D,F,$,J){super(F);this.statusCode=D;this.details=$;this.step=J;this.name="ApiError"}};tJ=class tJ extends h{mode;eta;constructor(D,F,$,J){super(503,F,J);this.mode=D;this.eta=$;this.name="MaintenanceError"}};wW=OW.includes("workers.dev");S9=["ci_check","enrichment_check","repo_public","s3_public_read","tag_protect","doi_create","update_metadata","update_readme","create_tag","create_release","upload_to_zenodo","publish_doi","version_doi","s3_lock","generate_archive","sync_nemar","notify_user"]});function Eg(D){kW=D}function vW(){return kW}function y9(D){if(kW)process.stderr.write(`${D}
99
99
  `)}var kW=!1;function XD(D){if(D===0)return"0 B";let F=["B","KB","MB","GB","TB"],$=Math.min(Math.floor(Math.log(D)/Math.log(1024)),F.length-1);return`${(D/1024**$).toFixed($===0?0:1)} ${F[$]}`}function Vg(D){return`${XD(D)}/s`}function tz0(D){if(D<60)return`${Math.round(D)}s`;if(D<3600)return`${Math.floor(D/60)}m ${Math.round(D%60)}s`;return`${Math.floor(D/3600)}h ${Math.floor(D%3600/60)}m`}function ez0(D,F=20){let $=Math.round(D/100*F),J=F-$;return`[${"=".repeat($)}${" ".repeat(J)}]`}class XQ{filesCompleted=0;filesTotal;bytesTotal=0;inFlight=new Map;currentFile="";startTime;lastUpdateTime;lastBytesTransferred=0;totalBytesTransferred=0;speedSamples=[];lastRenderedLine="";constructor(D=0,F=0){this.filesTotal=D,this.bytesTotal=F,this.startTime=Date.now(),this.lastUpdateTime=this.startTime}inFlightBytes(){let D=0;for(let F of this.inFlight.values())D+=F.transferred;return D}processLine(D){let F=D.file??D.action?.file;if(D.ok===!0||D.success===!0){this.filesCompleted++;let $=F??this.currentFile,J=$?this.inFlight.get($):void 0,Q=J?J.total||J.transferred:0;if(this.totalBytesTransferred+=Q,$)this.inFlight.delete($);this.render();return}if(D["byte-progress"]!==void 0){let $=F??this.currentFile;if(!$)return;this.currentFile=$;let J=this.inFlight.get($)??{transferred:0,total:0};if(J.transferred=D["byte-progress"]??J.transferred,D["total-size"]!==void 0)J.total=D["total-size"];this.inFlight.set($,J);let Q=Date.now(),Y=(Q-this.lastUpdateTime)/1000;if(Y>0.5){let B=this.totalBytesTransferred+this.inFlightBytes(),G=(B-this.lastBytesTransferred)/Y;if(G>0){if(this.speedSamples.push(G),this.speedSamples.length>5)this.speedSamples.shift()}this.lastBytesTransferred=B,this.lastUpdateTime=Q}this.render()}}incrementFilesCompleted(){this.filesCompleted++}setFilesTotal(D){this.filesTotal=D}setBytesTotal(D){this.bytesTotal=D}getPercent(){let D=this.totalBytesTransferred+this.inFlightBytes();if(this.bytesTotal>0)return Math.min(100,Math.round(D/this.bytesTotal*100));if(this.filesTotal>0)return Math.min(100,Math.round(this.filesCompleted/this.filesTotal*100));return null}getProgress(){return{filesCompleted:this.filesCompleted,filesTotal:this.filesTotal,bytesTransferred:this.totalBytesTransferred+this.inFlightBytes(),bytesTotal:this.bytesTotal,currentFile:this.currentFile||void 0}}render(){let D=this.speedSamples.length>0?this.speedSamples.reduce((B,X)=>B+X,0)/this.speedSamples.length:0,F=this.totalBytesTransferred+this.inFlightBytes(),$=0,J=!1;if(this.bytesTotal>0)$=Math.min(100,Math.round(F/this.bytesTotal*100)),J=!0;else if(this.filesTotal>0)$=Math.min(100,Math.round(this.filesCompleted/this.filesTotal*100)),J=!0;let Q=this.filesTotal>0?`${this.filesCompleted}/${this.filesTotal} files`:`${this.filesCompleted} files`,Y;if(J)Y=`${ez0($)} ${$}% ${Q}`;else Y=Q;if(F>0){let B=this.bytesTotal>0?`${XD(F)}/${XD(this.bytesTotal)}`:XD(F);Y+=` | ${B}`}if(D>0)Y+=` | ${Vg(D)}`;if(D>0){let B=0;if(this.bytesTotal>0)B=Math.max(0,this.bytesTotal-F);else for(let X of this.inFlight.values())if(X.total>X.transferred)B+=X.total-X.transferred;if(B>0){let X=B/D;if(X>0)Y+=` | ETA ${tz0(X)}`}}if(Y!==this.lastRenderedLine)process.stderr.write(`\r${W.cyan(Y)}${" ".repeat(10)}`),this.lastRenderedLine=Y}finish(D){let F=(Date.now()-this.startTime)/1000;if(process.stderr.write(`\r${" ".repeat(this.lastRenderedLine.length+15)}\r`),D>0){let $=F>0?`${Vg(this.totalBytesTransferred/F)}`:"",J=[`${D} file${D!==1?"s":""} downloaded`,this.totalBytesTransferred>0?XD(this.totalBytesTransferred):"",$].filter(Boolean).join(" | ");process.stderr.write(`${W.green(J)}
100
100
  `)}}}var yW=I(()=>{xD()});var Pg={};c4(Pg,{verifyGitHubAuth:()=>_9,toS3Credentials:()=>RD,switchBranch:()=>WE0,setKeyPresent:()=>Tg,selectAnnexS3Remote:()=>mW,saveDataset:()=>o8,runCommand:()=>S,resolveUpstreamRef:()=>oW,readRemoteHeadDatasetVersion:()=>aW,readLocalDatasetVersion:()=>iW,pushToGitHub:()=>o1,pushBranch:()=>PF,markInheritedOpenNeuroRemotesIgnored:()=>uW,listDatasetVersions:()=>pW,isWorkingTreeDirty:()=>sW,isGitAnnexDataset:()=>w1,isDataladDataset:()=>EE0,initOrEnableSpecialRemote:()=>Og,initDataset:()=>n6,gitMergeFastForward:()=>tW,gitFetchOrigin:()=>rW,gitAnnexAdd:()=>i6,getVersionCommit:()=>dW,getRemoteUuid:()=>$H,getLocalDatasetInfo:()=>lW,getKeyHashDirs:()=>KE0,getKeyHashDir:()=>jg,getDatasetStats:()=>BE0,getDatasetIdFromRemote:()=>r8,getDatasetData:()=>qQ,getCurrentBranch:()=>s8,getAnnexWhereisAll:()=>FH,getAnnexS3Remotes:()=>g9,formatBytes:()=>XD,ensureLocalMainBranch:()=>h9,ensureGitAnnexInitialized:()=>hW,enableS3Remote:()=>h4,dropUnusedAnnexObjects:()=>eW,dropFiles:()=>bW,detectImportMarker:()=>HQ,createRevertBranch:()=>cW,createDataladDataset:()=>zE0,countPendingDownload:()=>WQ,copyToAnnexRemote:()=>j8,configureS3Remote:()=>w8,configureLargefiles:()=>g4,configureGitHubRemote:()=>a8,commitRevert:()=>nW,collectFileManifest:()=>DH,cloneDataset:()=>s1,clearAnnexCredentials:()=>kD,checkPrerequisites:()=>x9,checkGitHubSSH:()=>Mg,checkGitAnnexInstalled:()=>gW,checkDownloadPrerequisites:()=>TF,checkAWSCredentials:()=>JE0,batchSetKeysPresent:()=>JH,annexRemoteExists:()=>Cg,acceptGitHubInvitation:()=>f9,NEMAR_S3_REMOTE_NAME:()=>GQ,ANNEX_REMOTE_EXISTS_RE:()=>Rg});import{existsSync as _W,readFileSync as DE0,statSync as FE0}from"fs";import{join as fW}from"path";var{spawn:Ag}=globalThis.Bun;async function S(D,F={}){let $=Ag({cmd:D,cwd:F.cwd,stdout:"pipe",stderr:"pipe",env:{...process.env,GIT_TERMINAL_PROMPT:"0",...F.env}}),J=!1,Q;if(F.timeout)Q=setTimeout(()=>{J=!0,$.kill()},F.timeout);if(vW()){let G=F.cwd?` (cwd=${F.cwd})`:"";y9(W.dim(`$ ${D.join(" ")}${G}`))}let Y=await new Response($.stdout).text(),B=await new Response($.stderr).text(),X=await $.exited;if(Q)clearTimeout(Q);if(vW()){if(Y.trim())y9(W.dim(Y.trimEnd()));if(B.trim())y9(W.yellow(B.trimEnd()));y9(W.dim(`(exit ${X})`))}if(J)return{stdout:Y,stderr:B||`Command timed out after ${Math.round(F.timeout/1000)}s`,exitCode:X??1};return{stdout:Y,stderr:B,exitCode:X}}function Zg(D){return D.split(".").map((F)=>{let $=Number.parseInt(F.replace(/[^0-9]/g,""),10);return Number.isNaN($)?0:$})}function $E0(D,F){let $=Zg(D),J=Zg(F);for(let Q=0;Q<Math.max($.length,J.length);Q++){let Y=$[Q]||0,B=J[Q]||0;if(Y>B)return!0;if(Y<B)return!1}return!0}async function gW(){try{let{stdout:F,exitCode:$,stderr:J}=await S(["git-annex","version"]);if($!==0)return console.warn("git-annex version returned non-zero exit code:",$),console.warn("stderr:",J),{installed:!1,minVersion:"10.0",error:`Version check failed: ${J.trim()}`};let Q=F.match(/version:\s*(\d+\.\d+)/),Y=Q?Q[1]:void 0;if(!Y)console.warn("Could not parse git-annex version from output:",F);return{installed:!0,version:Y,minVersion:"10.0",compatible:Y?$E0(Y,"10.0"):void 0}}catch(F){let $=F instanceof Error?F.message:String(F);if($.includes("ENOENT")||$.includes("not found"))return console.info("git-annex not found in PATH"),{installed:!1,minVersion:"10.0"};return console.error("Error checking git-annex installation:",$),{installed:!1,minVersion:"10.0",error:$}}}async function Mg(){if(process.env.GH_TOKEN)return{accessible:!0,username:"token-auth",useHttps:!0};try{let{stdout:D,stderr:F}=await S(["ssh","-T","-o","BatchMode=yes","-o","StrictHostKeyChecking=accept-new","-o","ConnectTimeout=10","git@github.com"]),$=D+F,J=$.match(/Hi ([^!]+)!/);if(J)return{accessible:!0,username:J[1]};if($.includes("Permission denied"))return{accessible:!1};return{accessible:$.includes("successfully authenticated")}}catch(D){let F=D instanceof Error?D.message:String(D);if(F.includes("ENOENT")||F.includes("not found"))console.info("SSH command not found");else console.error("Error checking GitHub SSH access:",F);return{accessible:!1}}}async function JE0(){if(process.env.AWS_ACCESS_KEY_ID&&process.env.AWS_SECRET_ACCESS_KEY)return{configured:!0,source:"environment"};try{let{stdout:D,exitCode:F}=await S(["aws","configure","get","aws_access_key_id"]);if(F===0&&D.trim())return{configured:!0,source:"aws-cli"}}catch(D){let F=D instanceof Error?D.message:String(D);if(F.includes("ENOENT")||F.includes("not found"))console.info("AWS CLI not found in PATH");else console.error("Error checking AWS credentials:",F)}return{configured:!1}}function Ng(){let D=process.platform;if(D==="darwin")return"brew install git-annex";if(D==="linux")return"apt install git-annex (Debian/Ubuntu)";return"See https://git-annex.branchable.com/install/"}async function x9(){let[D,F]=await Promise.all([gW(),Mg()]),$=[];if(!D.installed)$.push(`git-annex is not installed. Install: ${Ng()}`);else if(D.compatible===!1)$.push(`git-annex version ${D.version} is too old. Required: >= ${D.minVersion}`);if(!F.accessible){if(!(await wg()).token)$.push("GitHub authentication not configured. Run 'gh auth login' to authenticate.")}return{gitAnnex:D,githubSSH:F,allPassed:$.length===0,errors:$}}async function w1(D){if(!_W(fW(D,".git")))return!1;try{let{exitCode:F}=await S(["git","annex","info"],{cwd:D});return F===0}catch(F){let $=F instanceof Error?F.message:String(F);if(!$.includes("ENOENT")&&!$.includes("not found"))console.error(`Error checking if ${D} is a git-annex dataset:`,$);return!1}}async function n6(D,F={}){if(!F.force&&await w1(D))return{success:!0};try{let $={};if(F.author)$.GIT_AUTHOR_NAME=F.author.name,$.GIT_AUTHOR_EMAIL=F.author.email,$.GIT_COMMITTER_NAME=F.author.name,$.GIT_COMMITTER_EMAIL=F.author.email;let{stderr:J,exitCode:Q}=await S(["git","init","-b","main",D],{...Object.keys($).length>0?{env:$}:{}});if(Q!==0)return{success:!1,error:J.trim()||"Failed to initialize git repository"};let Y=Object.keys($).length>0?{env:$}:{},{stderr:B,exitCode:X}=await S(["git","annex","init"],{cwd:D,...Y});if(X!==0)return{success:!1,error:B.trim()||"Failed to initialize git-annex"};let{stderr:G,exitCode:H}=await S(["git","commit","--allow-empty","-m","Initialize dataset"],{cwd:D,...Y});if(H!==0)return{success:!1,error:G.trim()||"Failed to create initial commit"};let{stderr:q,exitCode:K}=await S(["git","annex","adjust","--unlock"],{cwd:D,...Y});if(K!==0)return{success:!1,error:q.trim()||"Failed to switch to unlocked mode"};return{success:!0}}catch($){return{success:!1,error:$.message}}}async function hW(D){try{let{exitCode:F,stderr:$}=await S(["git","annex","info"],{cwd:D});if(F===0)return{success:!0};if($.includes("First run: git-annex init")){let{stderr:J,exitCode:Q}=await S(["git","annex","init"],{cwd:D});if(Q!==0)return{success:!1,error:J.trim()||"Failed to initialize git-annex"};return{success:!0}}return{success:!1,error:$.trim()||"Failed to check git-annex status"}}catch(F){return{success:!1,error:F.message}}}async function g4(D,F){let $=["*.edf","*.bdf","*.set","*.fif","*.vhdr","*.eeg","*.cnt","*.fdt"],J=["*.tsv","*.json","*.md","*.txt","*.yml","*.yaml","README*","LICENSE*","CHANGES*",".bidsignore",".gitignore"],Q=$.map((G)=>`include=${G}`).join(" or "),Y=J.map((G)=>`exclude=${G}`).join(" and "),B=`(${Q} or largerthan=100kb) and ${Y}`,X=F||B;try{let{stderr:G,exitCode:H}=await S(["git","annex","config","--set","annex.largefiles",X],{cwd:D});if(H!==0)return{success:!1,error:G.trim()||"Failed to configure largefiles"};return{success:!0}}catch(G){return{success:!1,error:G.message}}}async function i6(D,F="."){try{let{stderr:$,exitCode:J}=await S(["git","annex","add",F],{cwd:D});if(J!==0)return{success:!1,error:$.trim()||"Failed to add files to git-annex"};return{success:!0}}catch($){return{success:!1,error:$.message}}}function RD(D){return{accessKeyId:D.access_key_id,secretAccessKey:D.secret_access_key,sessionToken:D.session_token}}function xW(D){let F=[/^\(merging .* into .*\.\.\.\)$/,/^\(recording state in git\.\.\.\)$/,/^\(scanning for /,/^\(checking /];return D.split(`
101
101
  `).filter(($)=>{let J=$.trim();if(!J)return!1;if(J.includes("setting annex-ignore"))return!1;if(F.some((Q)=>Q.test(J)))return!1;return!0}).join(`
@@ -113,8 +113,8 @@ Fix one of these:
113
113
  Add the public key to https://github.com/settings/keys
114
114
  Test with: ssh -T git@github.com`}}}try{let{stdout:Q}=await S(["git","remote","get-url",$],{cwd:D});if(Q.trim()){let{stderr:Y,exitCode:B}=await S(["git","remote","set-url",$,J],{cwd:D});if(B!==0)return{success:!1,error:Y.trim()}}else{let{stderr:Y,exitCode:B}=await S(["git","remote","add",$,J],{cwd:D});if(B!==0)return{success:!1,error:Y.trim()}}return{success:!0}}catch(Q){return{success:!1,error:Q.message}}}async function o8(D,F,$){try{let J={};if($)J.GIT_AUTHOR_NAME=$.name,J.GIT_AUTHOR_EMAIL=$.email,J.GIT_COMMITTER_NAME=$.name,J.GIT_COMMITTER_EMAIL=$.email;let{stderr:Q,exitCode:Y}=await S(["git","add","-A"],{cwd:D,...Object.keys(J).length>0?{env:J}:{}});if(Y!==0)return{success:!1,error:Q.trim()||"Failed to stage changes"};let{stdout:B,exitCode:X,stderr:G}=await S(["git","status","--porcelain"],{cwd:D});if(X!==0)return{success:!1,error:G.trim()||"Failed to check git status"};if(!B.trim())return{success:!0};let{stderr:H,exitCode:q}=await S(["git","commit","-m",F],{cwd:D,...Object.keys(J).length>0?{env:J}:{}});if(q!==0){if(H.includes("nothing to commit"))return{success:!0};return{success:!1,error:H.trim()||"Failed to commit changes"}}return{success:!0}}catch(J){return{success:!1,error:J.message}}}async function o1(D,F="origin",$){try{let J=$;if(!J){let G=await s8(D);if(!G||G==="HEAD"){let{exitCode:H}=await S(["git","log","-1","--oneline"],{cwd:D});if(H!==0)return{success:!1,error:"No commits found. The repository may not have been initialized correctly, or no changes were saved before pushing."};if(G==="HEAD")J="HEAD:main";else return{success:!1,error:"Could not detect current branch"}}else if(G.startsWith("adjusted/")){let H=G.replace(/^adjusted\//,"").replace(/\(.*\)$/,"");J=`${G}:${H}`}else J=G}let{stderr:Q,exitCode:Y}=await S(["git","push","-u",F,J],{cwd:D});if(Y!==0)return{success:!1,error:Q.trim()||"Failed to push to GitHub"};let{stderr:B,exitCode:X}=await S(["git","push",F,"git-annex"],{cwd:D});if(X!==0)return{success:!0,warning:`Main branch pushed, but git-annex branch failed: ${B.trim()}. Clone operations may have issues.`};return{success:!0}}catch(J){return{success:!1,error:J.message}}}async function BE0(D){try{let{stdout:J,exitCode:Q}=await S(["git","annex","info","--json"],{cwd:D});if(Q===0){let Y=JSON.parse(J);return{totalFiles:Y["local annex keys"]||0,totalSize:Y["local annex size"]||0,annexedFiles:Y["local annex keys"]||0,annexedSize:Y["local annex size"]||0}}}catch(J){let Q=J instanceof Error?J.message:String(J);console.warn("git annex info failed, falling back to manual counting:",Q)}let{stdout:F}=await S(["find",D,"-type","f"],{cwd:D});return{totalFiles:F.trim().split(`
115
115
  `).filter(Boolean).length,totalSize:0,annexedFiles:0,annexedSize:0}}async function TF(){let D=await gW(),F=[];if(!D.installed)F.push(`git-annex is not installed. Install: ${Ng()}`);else if(D.compatible===!1)F.push(`git-annex version ${D.version} is too old. Required: >= ${D.minVersion}`);return{gitAnnex:D,allPassed:F.length===0,errors:F}}async function s1(D,F){try{let{stderr:$,exitCode:J}=await S(["git","clone",D,F]);if(J!==0)return{success:!1,error:$.trim()||"Failed to clone dataset"};let{stderr:Q,exitCode:Y}=await S(["git","annex","init"],{cwd:F});if(Y!==0){let{exitCode:B}=await S(["git","annex","info"],{cwd:F});if(B!==0)return{success:!1,error:`Cloned repository but git-annex initialization failed: ${Q.trim()}`};console.warn("git annex init returned non-zero but annex is initialized")}return{success:!0}}catch($){return{success:!1,error:$.message}}}async function WQ(D,F,$){let J=F&&F.length>0?F:["."],Q=$&&$.length>0?$:[];try{let{stdout:Y,stderr:B,exitCode:X}=await S(["git","annex","find","--not","--in=here",...Q,"--json",...J],{cwd:D});if(X!==0){if(process.env.VERBOSE&&B.trim())console.warn(`countPendingDownload: git annex find failed: ${B.trim()}`);return null}let G=0,H=0,q=!1,K=!1;for(let V of Y.split(`
116
- `)){let E=V.trim();if(!E)continue;if(K=!0,!E.startsWith("{")){q=!0;continue}try{let Z=JSON.parse(E);if(G++,Z.bytesize){let L=Number.parseInt(Z.bytesize,10);if(Number.isFinite(L))H+=L}}catch{q=!0}}if(G===0&&K&&q)return null;return{fileCount:G,totalBytes:H}}catch(Y){if(process.env.VERBOSE)console.warn(`countPendingDownload: ${Y.message}`);return null}}async function HQ(D){try{let{stdout:F,exitCode:$}=await S(["git","log","-1","--format=%H","--",".nemar/metadata.json"],{cwd:D});if($!==0)return"unknown";return F.trim().length>0?"present":"absent"}catch{return"unknown"}}async function qQ(D,F={}){let $=F.jobs||4,J=F.paths&&F.paths.length>0?F.paths:["."],Q=F.extraArgs??[],Y=Boolean(F.onProgress),B={};if(F.credentials){if(B.AWS_ACCESS_KEY_ID=F.credentials.accessKeyId,B.AWS_SECRET_ACCESS_KEY=F.credentials.secretAccessKey,F.credentials.sessionToken)B.AWS_SESSION_TOKEN=F.credentials.sessionToken}let X=Object.fromEntries(Object.entries({...process.env,...B}).filter((G)=>G[1]!=null));try{if(Y){let Z=["git","annex","get","--json","--json-progress","-J",$.toString(),...Q,...J],L=Ag({cmd:Z,cwd:D,stdout:"pipe",stderr:"pipe",env:X}),A=0,M="",N=[],w=(async()=>{let d=L.stderr.getReader(),W0=new TextDecoder;for(;;){let{done:F0,value:O0}=await d.read();if(F0)break;N.push(O0)}M=W0.decode(N.reduce((F0,O0)=>{let e=new Uint8Array(F0.length+O0.length);return e.set(F0),e.set(O0,F0.length),e},new Uint8Array))})(),P=L.stdout.getReader(),C=new TextDecoder,T="";for(;;){let{done:d,value:W0}=await P.read();if(d)break;T+=C.decode(W0,{stream:!0});let F0=T.split(`
117
- `);T=F0.pop()??"";for(let O0 of F0){let e=O0.trim();if(!e||!e.startsWith("{"))continue;try{let N0=JSON.parse(e);if(F.onProgress?.(N0),N0.ok===!0||N0.success===!0)A++}catch{}}}if(T.trim().startsWith("{"))try{let d=JSON.parse(T.trim());if(F.onProgress?.(d),d.ok===!0||d.success===!0)A++}catch{}if(await w,await L.exited!==0)return{success:!1,error:M.trim()||"Failed to get dataset data"};return{success:!0,filesDownloaded:A}}let G=["git","annex","get","-J",$.toString(),...Q,...J],{stdout:H,stderr:q,exitCode:K}=await S(G,{cwd:D,...Object.keys(B).length>0&&{env:X}});if(K!==0)return{success:!1,error:q.trim()||"Failed to get dataset data"};let V=H.match(/^get .+ ok$/gm);return{success:!0,filesDownloaded:V?V.length:0}}catch(G){return{success:!1,error:G.message}}}async function bW(D,F){let $=F&&F.length>0?F:["."];try{let J=["git","annex","drop",...$],{stdout:Q,stderr:Y,exitCode:B}=await S(J,{cwd:D});if(B!==0){let H=[];for(let V of Y.split(`
116
+ `)){let E=V.trim();if(!E)continue;if(K=!0,!E.startsWith("{")){q=!0;continue}try{let Z=JSON.parse(E);if(G++,Z.bytesize){let L=Number.parseInt(Z.bytesize,10);if(Number.isFinite(L))H+=L}}catch{q=!0}}if(G===0&&K&&q)return null;return{fileCount:G,totalBytes:H}}catch(Y){if(process.env.VERBOSE)console.warn(`countPendingDownload: ${Y.message}`);return null}}async function HQ(D){try{let{stdout:F,exitCode:$}=await S(["git","log","-1","--format=%H","--",".nemar/metadata.json"],{cwd:D});if($!==0)return"unknown";return F.trim().length>0?"present":"absent"}catch{return"unknown"}}async function qQ(D,F={}){let $=F.jobs||4,J=F.paths&&F.paths.length>0?F.paths:["."],Q=F.extraArgs??[],Y=Boolean(F.onProgress),B={};if(F.credentials){if(B.AWS_ACCESS_KEY_ID=F.credentials.accessKeyId,B.AWS_SECRET_ACCESS_KEY=F.credentials.secretAccessKey,F.credentials.sessionToken)B.AWS_SESSION_TOKEN=F.credentials.sessionToken}let X=Object.fromEntries(Object.entries({...process.env,...B}).filter((G)=>G[1]!=null));try{if(Y){let Z=["git","annex","get","--json","--json-progress","-J",$.toString(),...Q,...J],L=Ag({cmd:Z,cwd:D,stdout:"pipe",stderr:"pipe",env:X}),M=0,A="",N=[],w=(async()=>{let d=L.stderr.getReader(),W0=new TextDecoder;for(;;){let{done:F0,value:O0}=await d.read();if(F0)break;N.push(O0)}A=W0.decode(N.reduce((F0,O0)=>{let e=new Uint8Array(F0.length+O0.length);return e.set(F0),e.set(O0,F0.length),e},new Uint8Array))})(),P=L.stdout.getReader(),C=new TextDecoder,T="";for(;;){let{done:d,value:W0}=await P.read();if(d)break;T+=C.decode(W0,{stream:!0});let F0=T.split(`
117
+ `);T=F0.pop()??"";for(let O0 of F0){let e=O0.trim();if(!e||!e.startsWith("{"))continue;try{let N0=JSON.parse(e);if(F.onProgress?.(N0),N0.ok===!0||N0.success===!0)M++}catch{}}}if(T.trim().startsWith("{"))try{let d=JSON.parse(T.trim());if(F.onProgress?.(d),d.ok===!0||d.success===!0)M++}catch{}if(await w,await L.exited!==0)return{success:!1,error:A.trim()||"Failed to get dataset data"};return{success:!0,filesDownloaded:M}}let G=["git","annex","get","-J",$.toString(),...Q,...J],{stdout:H,stderr:q,exitCode:K}=await S(G,{cwd:D,...Object.keys(B).length>0&&{env:X}});if(K!==0)return{success:!1,error:q.trim()||"Failed to get dataset data"};let V=H.match(/^get .+ ok$/gm);return{success:!0,filesDownloaded:V?V.length:0}}catch(G){return{success:!1,error:G.message}}}async function bW(D,F){let $=F&&F.length>0?F:["."];try{let J=["git","annex","drop",...$],{stdout:Q,stderr:Y,exitCode:B}=await S(J,{cwd:D});if(B!==0){let H=[];for(let V of Y.split(`
118
118
  `)){let E=V.match(/^drop (.+) \(unsafe\)/);if(E)H.push(E[1])}let q=Q.match(/^drop .+ ok$/gm),K=q?q.length:0;return{success:!1,error:Y.trim(),dropped:K,kept:H}}let X=Q.match(/^drop .+ ok$/gm);return{success:!0,dropped:X?X.length:0,kept:[]}}catch(J){return{success:!1,error:(J instanceof Error?J.message:String(J))||"Unknown error during drop",dropped:0,kept:[]}}}async function XE0(D,F){let{stdout:$,exitCode:J}=await S(["git","config",`remote.${F}.annex-ignore`],{cwd:D});if(J!==0)return!1;return $.trim().toLowerCase()==="true"}async function g9(D){let F=[],{stdout:$,exitCode:J}=await S(["git","config","--get-regexp","^remote\\..*\\.annex-s3"],{cwd:D});if(J===0&&$.trim())for(let B of $.trim().split(`
119
119
  `)){let X=B.match(/^remote\.(.+?)\.annex-/);if(X&&Lg.test(X[1]))F.push(X[1])}if(F.length===0){let{stdout:B,exitCode:X,stderr:G}=await S(["git","annex","info","--json"],{cwd:D});if(X!==0){if(G.trim())console.error(`git annex info failed: ${G.trim()}`);return[]}if(!B.trim())return[];let H;try{H=JSON.parse(B)}catch(K){let V=K instanceof Error?K.message:String(K);return console.error(`Failed to parse git-annex info JSON: ${V}`),[]}let q=[...Array.isArray(H["trusted repositories"])?H["trusted repositories"]:[],...Array.isArray(H["semitrusted repositories"])?H["semitrusted repositories"]:[],...Array.isArray(H["untrusted repositories"])?H["untrusted repositories"]:[]];for(let K of q){if(!K?.description?.includes("["))continue;let V=K.description.match(/\[(.+?)\]/);if(!V)continue;let E=V[1];if(!Lg.test(E))continue;let{stdout:Z}=await S(["git","config",`remote.${E}.annex-s3`],{cwd:D});if(Z.trim())F.push(E)}}let Q=[...new Set(F)],Y=[];for(let B of Q){if(await XE0(D,B))continue;Y.push(B)}return Y}async function uW(D,F){let $=[];for(let J of["s3-PUBLIC","s3-PRIVATE"]){let Q=await S(["git","config",`remote.${J}.annex-uuid`],{cwd:D});if(Q.exitCode!==0||!Q.stdout.trim())continue;let Y=await S(["git","config",`remote.${J}.annex-ignore`,"true"],{cwd:D});if(Y.exitCode!==0){F?.(J,Y.stderr.trim()||"unknown error");continue}$.push(J)}return $}async function mW(D,F){if(F.length===0)return null;if(F.length===1)return F[0];if(F.includes(GQ))return GQ;let{stdout:$,exitCode:J}=await S(["git","annex","info","--json"],{cwd:D});if(J===0&&$.trim())try{let Q=JSON.parse($),Y=[...Array.isArray(Q["trusted repositories"])?Q["trusted repositories"]:[],...Array.isArray(Q["semitrusted repositories"])?Q["semitrusted repositories"]:[],...Array.isArray(Q["untrusted repositories"])?Q["untrusted repositories"]:[]];for(let B of Y){if(B?.description!==`[${GQ}]`)continue;let X=typeof B.uuid==="string"?B.uuid:null;if(!X)continue;for(let G of F){let{stdout:H}=await S(["git","config",`remote.${G}.annex-uuid`],{cwd:D});if(H.trim()===X)return G}}}catch(Q){let Y=Q instanceof Error?Q.message:String(Q);console.warn(`Could not parse git annex info JSON for remote selection: ${Y}`)}return F[0]}async function j8(D,F,$=4,J){try{let Q=["git","annex","copy","--to",F,"-J",$.toString(),"."],Y=J?{AWS_ACCESS_KEY_ID:J.accessKeyId,AWS_SECRET_ACCESS_KEY:J.secretAccessKey,...J.sessionToken?{AWS_SESSION_TOKEN:J.sessionToken}:{}}:void 0,{stdout:B,stderr:X,exitCode:G}=await S(Q,{cwd:D,env:Y});if(G!==0)return{success:!1,error:X.trim()||"Failed to copy to remote",filesCopied:0};let H=B.match(/^copy .+ ok$/gm);return{success:!0,filesCopied:H?H.length:0}}catch(Q){return{success:!1,error:(Q instanceof Error?Q.message:String(Q))||"Unknown error during copy",filesCopied:0}}}async function lW(D){if(!_W(D))return null;try{let{stdout:F,exitCode:$}=await S(["git","annex","info","--json"],{cwd:D});if($===0){let J=JSON.parse(F),Q=0,Y=J["local annex size"]||"0 bytes",B=Y.match(/([\d.]+)\s*(bytes?|KB|MB|GB|TB)/i);if(B){let H=Number.parseFloat(B[1]),q=B[2].toLowerCase();Q=H*({byte:1,bytes:1,kb:1024,mb:1048576,gb:1073741824,tb:1099511627776}[q]||1)}let X=J["annexed files in working tree"]||0,G=J["local annex keys"]||0;return{files:X,size:Y,sizeBytes:Q,annexedFiles:X,presentFiles:G,missingFiles:X-G}}}catch(F){let $=F instanceof Error?F.message:String(F);console.warn(`Failed to get git-annex info for ${D}: ${$}`)}try{let{stdout:F}=await S(["find",".","-type","f","-not","-path","./.git/*"],{cwd:D}),$=F.trim().split(`
120
120
  `).filter(Boolean).length;return{files:$,size:"unknown",sizeBytes:0,annexedFiles:0,presentFiles:$,missingFiles:0}}catch(F){let $=F instanceof Error?F.message:String(F);return console.warn(`Failed to count files in ${D}: ${$}`),null}}async function pW(D){try{let{stdout:F,exitCode:$}=await S(["git","tag","-l","--sort=-version:refname","--format=%(refname:short)|%(creatordate:short)|%(objectname:short)"],{cwd:D});if($!==0||!F.trim())return[];return F.trim().split(`
@@ -125,15 +125,15 @@ Fix one of these:
125
125
  `)){if(!J.trim())continue;try{let Q=JSON.parse(J),Y=Q.key;if(!Y)continue;let B=[...Q.whereis||[],...Q.untrusted||[]];for(let X of B){if(!Array.isArray(X.urls))continue;for(let G of X.urls)if(typeof G==="string"&&(G.startsWith("http")||G.startsWith("s3://"))){$.set(Y,G);break}if($.has(Y))break}}catch(Q){if(Q instanceof SyntaxError)continue;console.error(`Warning: failed to process whereis entry: ${Q instanceof Error?Q.message:String(Q)}`)}}return $}async function jg(D,F){let $=await S(["git","annex","examinekey","--format=${hashdirlower}",F],{cwd:D});if($.exitCode!==0)throw Error(`git annex examinekey failed for ${F}: ${$.stderr.trim()}`);return $.stdout.trim()}async function KE0(D,F){let $=new Map,J=50;for(let Q=0;Q<F.length;Q+=50){let Y=F.slice(Q,Q+50),B=await Promise.allSettled(Y.map(async(X)=>{let G=await jg(D,X);return{key:X,hashDir:G}}));for(let X of B)if(X.status==="fulfilled")$.set(X.value.key,X.value.hashDir);else console.error(`Warning: failed to resolve hash dir: ${X.reason?.message||"unknown"}`)}return $}async function $H(D,F){let $=await S(["git","config",`remote.${F}.annex-uuid`],{cwd:D});if($.exitCode!==0)return null;return $.stdout.trim()||null}async function Tg(D,F,$){return(await S(["git","annex","setpresentkey",F,$,"1"],{cwd:D})).exitCode===0}async function JH(D,F,$){let J=0,Q=0,Y=50;for(let B=0;B<F.length;B+=Y){let X=F.slice(B,B+Y),G=await Promise.all(X.map((H)=>Tg(D,H,$)));for(let H of G)if(H)J++;else Q++}return{success:J,failed:Q}}var Rg,Lg,GQ="nemar-s3",HE0=102400,qE0,zE0,EE0;var a6=I(()=>{xD();yW();Rg=/There is already a special remote named "[^"]+"/;Lg=/^[a-zA-Z0-9._-]+$/;qE0=new Set([".edf",".bdf",".eeg",".vhdr",".vmrk",".set",".fdt",".cnt",".mff",".fif",".nii",".nii.gz",".mat",".bin"]);zE0=n6,EE0=w1});var yg={};c4(yg,{importOpenNeuro:()=>IE0,decideSkipCiCheck:()=>vg});import{existsSync as kg,mkdirSync as VE0,mkdtempSync as ZE0,readFileSync as UE0,writeFileSync as LE0}from"fs";import{tmpdir as AE0}from"os";import{join as b9}from"path";async function NE0(D,F,$=120000,J=5000){let Q=Date.now()+$,Y,B=!1;while(Date.now()<Q){try{let G=await DQ(D);if(B=!0,G.bids_validation.present&&G.bids_validation.status!=="no_runs")return{kind:"found"}}catch(G){Y=G}let X=Math.max(0,Q-Date.now());F.text=`Waiting for BIDS validation run to register... (${Math.ceil(X/1000)}s left)`,await new Promise((G)=>setTimeout(G,Math.min(J,X)))}if(!B&&Y!==void 0)return{kind:"error",lastError:Y};return{kind:"timeout"}}function vg(D){if(!D.ciDeployed)return{skipCiCheck:!1,abortReason:"CI workflows did not deploy. Aborting before approval: --trust-upstream bypasses validation lookup, not workflow deployment. Re-run after fixing the deploy failure, or run `nemar admin ci add <id>` manually before approving."};let F=D.poll;if(F===null||F.kind==="found")return{skipCiCheck:!1};if(F.kind==="error")return{skipCiCheck:!1,abortReason:`Every BIDS validation poll attempt failed (last error: ${F.lastError instanceof Error?F.lastError.message:String(F.lastError)}). Refusing to bypass under --trust-upstream because validation state was never actually observed. Investigate API/auth health and re-run.`};if(D.trustUpstream)return{skipCiCheck:!0};return{skipCiCheck:!1,abortReason:"BIDS validation run did not register within the bounded poll window. Re-run with --trust-upstream to bypass (OpenNeuro datasets are pre-validated upstream), or investigate why the deployed CI did not trigger."}}function RE0(D){let F=D.match(/^ds(\d{6})$/);if(!F)throw Error(`Invalid OpenNeuro ID "${D}". Expected format: ds###### (e.g., ds007262)`);return`on${F[1]}`}function CE0(D){let F=b9(D,"dataset_description.json");if(!kg(F))throw Error(`dataset_description.json not found at ${F}`);try{return JSON.parse(UE0(F,"utf-8"))}catch($){throw Error(`Failed to parse dataset_description.json at ${F}: ${$ instanceof Error?$.message:String($)}`)}}function OE0(){let D=process.env.AWS_ACCESS_KEY_ID,F=process.env.AWS_SECRET_ACCESS_KEY;if(!D||!F)throw Error("AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY must be set in environment for S3 operations");return{accessKeyId:D,secretAccessKey:F,sessionToken:process.env.AWS_SESSION_TOKEN}}function wE0(D){return typeof D.DatasetDOI==="string"?D.DatasetDOI.replace(/^doi:/,""):null}function jE0(D,F,$,J,Q){let Y=b9(D,".nemar");if(!kg(Y))VE0(Y,{recursive:!0});let B=Q?[{identifier:Q,identifier_type:"DOI",relation_type:"IsIdenticalTo"}]:[],X={version:"2.0",dataset_id:F,source:"openneuro",source_id:$,title:J.Name||F,authors:Array.isArray(J.Authors)?Object.fromEntries(J.Authors.map((G)=>[G,{}])):{},license:J.License||"CC0",dataset_type:J.DatasetType||"raw",related_identifiers:B,pipeline_stage:"seeded"};LE0(b9(Y,"metadata.json"),`${JSON.stringify(X,null,2)}
126
126
  `)}async function TE0(D,F,$){let J=await S(["bash","-c",`curl -sfL '${D}' | aws s3 cp - '${F}' --region '${$}'`],{});if(J.exitCode!==0)return{success:!1,error:J.stderr.trim()};return{success:!0}}async function PE0(D,F,$,J){let Q=0,Y=[];for(let B=0;B<D.length;B+=$){let X=D.slice(B,B+$),G=await Promise.allSettled(X.map(async(H)=>{let q=await TE0(H.sourceUrl,H.destUri,F);if(!q.success)throw Error(q.error||"Unknown S3 copy error");return H.key}));for(let H=0;H<G.length;H++){let q=G[H];if(q.status==="fulfilled")Q++;else Y.push({key:X[H].key,error:q.reason?.message||"Unknown error"})}J?.(Q,D.length,X[X.length-1].key)}return{copied:Q,failed:Y}}async function IE0(D,F={}){let $=RE0(D),J=F.workDir||ZE0(b9(AE0(),`nemar-import-${$}-`)),Q=b9(J,$);console.log(W.cyan(`
127
127
  Importing OpenNeuro dataset ${D} -> ${$}
128
- `)),console.log(W.dim(`Working directory: ${J}`));let Y=O("Cloning OpenNeuro dataset...").start(),B=`https://github.com/${ME0}/${D}.git`,X=await s1(B,Q);if(!X.success)Y.fail(`Failed to clone: ${X.error}`),process.exit(1);if(Y.succeed(`Cloned ${D}`),!await h9(Q,{yes:!0}))console.error(W.red("Cannot proceed with import: branch must be named 'main'.")),process.exit(1);let H=CE0(Q),q=H.Name||D,K=wE0(H);if(console.log(W.dim(` Dataset: ${q}`)),K)console.log(W.dim(` OpenNeuro DOI: ${K}`));let V=O("Creating NEMAR dataset record...").start();try{let g=await $g({dataset_id:$,name:q,description:`Imported from OpenNeuro ${D}`,source:"openneuro",source_id:D});V.succeed(`Created ${g.dataset_id} (${g.github_repo})`)}catch(g){let J0=g instanceof Error?g.message:String(g);if(J0.includes("already exists")||J0.includes("409"))V.warn(`Dataset ${$} already exists, continuing...`);else V.fail(`Failed to create dataset: ${J0}`),process.exit(1)}let E=new Map;if(!F.skipData){let g=O("Mapping annexed files from OpenNeuro S3...").start(),J0=await S(["git","annex","enableremote","s3-PUBLIC"],{cwd:Q});if(J0.exitCode!==0)g.fail(`Failed to enable s3-PUBLIC remote: ${J0.stderr.trim()}`),process.exit(1);if(E=await FH(Q),E.size===0)g.warn("No annexed files found, skipping data copy");else g.succeed(`Found ${E.size} annexed files`)}await uW(Q,(g,J0)=>{console.log(W.yellow(` Warning: could not mark ${g} as annex-ignore (${J0}). Future pushes may try to upload to ${g}; run 'git config remote.${g}.annex-ignore true' manually.`))});let Z=O("Configuring NEMAR remote...").start(),L=await S(["git","remote","remove","origin"],{cwd:Q});if(L.exitCode!==0&&!L.stderr.includes("No such remote"))Z.fail(`Failed to remove OpenNeuro remote: ${L.stderr.trim()}`),process.exit(1);let A=`git@github.com:nemarDatasets/${$}.git`,M=await a8(Q,A,"origin");if(!M.success)Z.fail(`Failed to configure remote: ${M.error}`),process.exit(1);if(Z.succeed("Configured NEMAR remote"),!F.skipData&&E.size>0){let g=O("Setting up NEMAR S3 remote...").start(),J0=OE0(),V0=await w8(Q,{name:"nemar-s3",bucket:Ig,prefix:`${$}/objects`,region:Sg},J0);if(!V0.success)g.fail(`Failed to configure S3 remote: ${V0.error}`),process.exit(1);let BD=await $H(Q,"nemar-s3");if(!BD)g.fail("Failed to get NEMAR S3 remote UUID"),process.exit(1);g.succeed("Configured NEMAR S3 remote");let yD=O("Preparing S3-to-S3 copy...").start(),W1=[],xF=[];for(let[lD,n9]of E){if(!n9.startsWith("http")){xF.push(lD);continue}let Kb=`s3://${Ig}/${$}/objects/${lD}`;W1.push({key:lD,sourceUrl:n9,destUri:Kb})}if(xF.length>0)console.log(W.yellow(` Skipped ${xF.length} keys (no source URL)`));yD.succeed(`Prepared ${W1.length} files for S3-to-S3 copy`);let e8=O(`Copying ${W1.length} files to NEMAR S3...`).start(),OD=await PE0(W1,Sg,8,(lD,n9)=>{e8.text=`Copying files to NEMAR S3... ${lD}/${n9}`});if(OD.failed.length>0){console.error(W.red(`
129
- Failed to copy ${OD.failed.length} files:`));for(let lD of OD.failed.slice(0,5))console.error(W.red(` ${lD.key}: ${lD.error}`));if(OD.failed.length>5)console.error(W.red(` ... and ${OD.failed.length-5} more`));e8.fail(`${OD.failed.length} of ${W1.length} files failed to copy. Re-run to retry.`),process.exit(1)}e8.succeed(`Copied ${OD.copied} files to NEMAR S3`);let Wb=O("Registering files in git-annex...").start(),Hb=new Set(OD.failed.map((lD)=>lD.key)),qb=W1.filter((lD)=>!Hb.has(lD.key)).map((lD)=>lD.key),jQ=await JH(Q,qb,BD);if(jQ.failed>0)console.log(W.yellow(` ${jQ.failed} keys failed to register (non-fatal)`));Wb.succeed(`Registered ${jQ.success} files in git-annex`)}let N=O("Seeding metadata...").start();try{jE0(Q,$,D,H,K)}catch(g){N.fail(`Failed to seed metadata: ${g instanceof Error?g.message:String(g)}`),process.exit(1)}let w=await S(["git","add",".nemar/metadata.json"],{cwd:Q});if(w.exitCode!==0)N.fail(`Failed to stage metadata: ${w.stderr.trim()}`),process.exit(1);let P=await S(["git","commit","-m",`Add NEMAR metadata (imported from OpenNeuro ${D})`],{cwd:Q});if(P.exitCode!==0&&!P.stdout.includes("nothing to commit"))N.fail(`Failed to commit metadata: ${P.stderr.trim()}`),process.exit(1);N.succeed("Seeded .nemar/metadata.json");let C=O("Pushing to nemarDatasets...").start(),T=await o1(Q,"origin");if(!T.success)C.fail(`Failed to push: ${T.error}`),process.exit(1);if(T.warning)C.fail(`Pushed main but git-annex branch failed: ${T.warning}. Aborting \u2014 published dataset would be uncloneable. Investigate the git-annex push failure and re-run.`),process.exit(1);C.succeed("Pushed to nemarDatasets");let y=!1,d=O("Deploying CI workflows...").start();try{await f4($),d.succeed("CI workflows deployed (BIDS validation, LLM enrichment, archive generation)"),y=!0}catch(g){let J0=g instanceof Error?g.message:String(g);d.fail(`CI deployment failed: ${J0}`),console.log(W.dim(` After fixing the deploy failure, run 'nemar admin ci add ${$}' and 'nemar admin publish request/approve ${$}' to resume.`))}let W0=null;if(y){let g=O("Waiting for BIDS validation run to register...").start();if(W0=await NE0($,g),W0.kind==="found")g.succeed("BIDS validation run registered; deferring to ci_check at approval");else if(W0.kind==="timeout"){let J0=F.trustUpstream?"trusting upstream OpenNeuro validation (--trust-upstream)":"no --trust-upstream \u2014 aborting";g.warn(`BIDS validation run did not register within 120s; ${J0}`)}else{let J0=W0.lastError instanceof Error?W0.lastError.message:String(W0.lastError);g.fail(`All BIDS validation polls failed (last error: ${J0})`)}}let F0=vg({ciDeployed:y,poll:W0,trustUpstream:F.trustUpstream??!1});if(F0.abortReason)console.error(W.red(F0.abortReason)),process.exit(1);let O0=F0.skipCiCheck,e=5,N0=300000,GD=O("Requesting publication...").start(),R=!1;for(let g=1;g<=e;g++)try{await YQ($),R=!0;break}catch(J0){let V0=J0 instanceof Error?J0.message:String(J0);if(!V0.includes("BIDS validation is currently running"))GD.fail(`Failed to request publication: ${V0}`),process.exit(1);if(g===e)GD.fail(`BIDS validation still in progress after ${e} attempts (~${Math.round(e*N0/60000)}min). Re-run 'nemar admin publish request/approve ${$}' once validation completes.`),process.exit(1);GD.text=`Waiting for BIDS validation to complete... (attempt ${g}/${e}, next retry in 5min)`,await new Promise((yD)=>setTimeout(yD,N0))}if(R)GD.succeed("Publication requested");let n=O("Approving publication...").start(),h=10,P0=!1;for(let g=1;g<=h;g++)try{await BQ($,g>1,!1,O0),P0=!0;break}catch(J0){let V0=J0 instanceof Error?J0.message:String(J0);if(g<h)n.text=`Approving publication... (attempt ${g+1}/${h})`,await new Promise((BD)=>setTimeout(BD,3000));else n.fail(`Failed to approve publication after ${h} attempts: ${V0}`),process.exit(1)}if(P0)n.succeed("Publication approved");console.log(W.green(`
128
+ `)),console.log(W.dim(`Working directory: ${J}`));let Y=O("Cloning OpenNeuro dataset...").start(),B=`https://github.com/${ME0}/${D}.git`,X=await s1(B,Q);if(!X.success)Y.fail(`Failed to clone: ${X.error}`),process.exit(1);if(Y.succeed(`Cloned ${D}`),!await h9(Q,{yes:!0}))console.error(W.red("Cannot proceed with import: branch must be named 'main'.")),process.exit(1);let H=CE0(Q),q=H.Name||D,K=wE0(H);if(console.log(W.dim(` Dataset: ${q}`)),K)console.log(W.dim(` OpenNeuro DOI: ${K}`));let V=O("Creating NEMAR dataset record...").start();try{let g=await $g({dataset_id:$,name:q,description:`Imported from OpenNeuro ${D}`,source:"openneuro",source_id:D});V.succeed(`Created ${g.dataset_id} (${g.github_repo})`)}catch(g){let J0=g instanceof Error?g.message:String(g);if(J0.includes("already exists")||J0.includes("409"))V.warn(`Dataset ${$} already exists, continuing...`);else V.fail(`Failed to create dataset: ${J0}`),process.exit(1)}let E=new Map;if(!F.skipData){let g=O("Mapping annexed files from OpenNeuro S3...").start(),J0=await S(["git","annex","enableremote","s3-PUBLIC"],{cwd:Q});if(J0.exitCode!==0)g.fail(`Failed to enable s3-PUBLIC remote: ${J0.stderr.trim()}`),process.exit(1);if(E=await FH(Q),E.size===0)g.warn("No annexed files found, skipping data copy");else g.succeed(`Found ${E.size} annexed files`)}await uW(Q,(g,J0)=>{console.log(W.yellow(` Warning: could not mark ${g} as annex-ignore (${J0}). Future pushes may try to upload to ${g}; run 'git config remote.${g}.annex-ignore true' manually.`))});let Z=O("Configuring NEMAR remote...").start(),L=await S(["git","remote","remove","origin"],{cwd:Q});if(L.exitCode!==0&&!L.stderr.includes("No such remote"))Z.fail(`Failed to remove OpenNeuro remote: ${L.stderr.trim()}`),process.exit(1);let M=`git@github.com:nemarDatasets/${$}.git`,A=await a8(Q,M,"origin");if(!A.success)Z.fail(`Failed to configure remote: ${A.error}`),process.exit(1);if(Z.succeed("Configured NEMAR remote"),!F.skipData&&E.size>0){let g=O("Setting up NEMAR S3 remote...").start(),J0=OE0(),V0=await w8(Q,{name:"nemar-s3",bucket:Ig,prefix:`${$}/objects`,region:Sg},J0);if(!V0.success)g.fail(`Failed to configure S3 remote: ${V0.error}`),process.exit(1);let BD=await $H(Q,"nemar-s3");if(!BD)g.fail("Failed to get NEMAR S3 remote UUID"),process.exit(1);g.succeed("Configured NEMAR S3 remote");let yD=O("Preparing S3-to-S3 copy...").start(),W1=[],xF=[];for(let[lD,n9]of E){if(!n9.startsWith("http")){xF.push(lD);continue}let Kb=`s3://${Ig}/${$}/objects/${lD}`;W1.push({key:lD,sourceUrl:n9,destUri:Kb})}if(xF.length>0)console.log(W.yellow(` Skipped ${xF.length} keys (no source URL)`));yD.succeed(`Prepared ${W1.length} files for S3-to-S3 copy`);let e8=O(`Copying ${W1.length} files to NEMAR S3...`).start(),OD=await PE0(W1,Sg,8,(lD,n9)=>{e8.text=`Copying files to NEMAR S3... ${lD}/${n9}`});if(OD.failed.length>0){console.error(W.red(`
129
+ Failed to copy ${OD.failed.length} files:`));for(let lD of OD.failed.slice(0,5))console.error(W.red(` ${lD.key}: ${lD.error}`));if(OD.failed.length>5)console.error(W.red(` ... and ${OD.failed.length-5} more`));e8.fail(`${OD.failed.length} of ${W1.length} files failed to copy. Re-run to retry.`),process.exit(1)}e8.succeed(`Copied ${OD.copied} files to NEMAR S3`);let Wb=O("Registering files in git-annex...").start(),Hb=new Set(OD.failed.map((lD)=>lD.key)),qb=W1.filter((lD)=>!Hb.has(lD.key)).map((lD)=>lD.key),jQ=await JH(Q,qb,BD);if(jQ.failed>0)console.log(W.yellow(` ${jQ.failed} keys failed to register (non-fatal)`));Wb.succeed(`Registered ${jQ.success} files in git-annex`)}let N=O("Seeding metadata...").start();try{jE0(Q,$,D,H,K)}catch(g){N.fail(`Failed to seed metadata: ${g instanceof Error?g.message:String(g)}`),process.exit(1)}let w=await S(["git","add",".nemar/metadata.json"],{cwd:Q});if(w.exitCode!==0)N.fail(`Failed to stage metadata: ${w.stderr.trim()}`),process.exit(1);let P=await S(["git","commit","-m",`Add NEMAR metadata (imported from OpenNeuro ${D})`],{cwd:Q});if(P.exitCode!==0&&!P.stdout.includes("nothing to commit"))N.fail(`Failed to commit metadata: ${P.stderr.trim()}`),process.exit(1);N.succeed("Seeded .nemar/metadata.json");let C=O("Pushing to nemarDatasets...").start(),T=await o1(Q,"origin");if(!T.success)C.fail(`Failed to push: ${T.error}`),process.exit(1);if(T.warning)C.fail(`Pushed main but git-annex branch failed: ${T.warning}. Aborting \u2014 published dataset would be uncloneable. Investigate the git-annex push failure and re-run.`),process.exit(1);C.succeed("Pushed to nemarDatasets");let y=!1,d=O("Deploying CI workflows...").start();try{await f4($),d.succeed("CI workflows deployed (BIDS validation, LLM enrichment, archive generation)"),y=!0}catch(g){let J0=g instanceof Error?g.message:String(g);d.fail(`CI deployment failed: ${J0}`),console.log(W.dim(` After fixing the deploy failure, run 'nemar admin ci add ${$}' and 'nemar admin publish request/approve ${$}' to resume.`))}let W0=null;if(y){let g=O("Waiting for BIDS validation run to register...").start();if(W0=await NE0($,g),W0.kind==="found")g.succeed("BIDS validation run registered; deferring to ci_check at approval");else if(W0.kind==="timeout"){let J0=F.trustUpstream?"trusting upstream OpenNeuro validation (--trust-upstream)":"no --trust-upstream \u2014 aborting";g.warn(`BIDS validation run did not register within 120s; ${J0}`)}else{let J0=W0.lastError instanceof Error?W0.lastError.message:String(W0.lastError);g.fail(`All BIDS validation polls failed (last error: ${J0})`)}}let F0=vg({ciDeployed:y,poll:W0,trustUpstream:F.trustUpstream??!1});if(F0.abortReason)console.error(W.red(F0.abortReason)),process.exit(1);let O0=F0.skipCiCheck,e=5,N0=300000,GD=O("Requesting publication...").start(),R=!1;for(let g=1;g<=e;g++)try{await YQ($),R=!0;break}catch(J0){let V0=J0 instanceof Error?J0.message:String(J0);if(!V0.includes("BIDS validation is currently running"))GD.fail(`Failed to request publication: ${V0}`),process.exit(1);if(g===e)GD.fail(`BIDS validation still in progress after ${e} attempts (~${Math.round(e*N0/60000)}min). Re-run 'nemar admin publish request/approve ${$}' once validation completes.`),process.exit(1);GD.text=`Waiting for BIDS validation to complete... (attempt ${g}/${e}, next retry in 5min)`,await new Promise((yD)=>setTimeout(yD,N0))}if(R)GD.succeed("Publication requested");let n=O("Approving publication...").start(),b=10,P0=!1;for(let g=1;g<=b;g++)try{await BQ($,g>1,!1,O0),P0=!0;break}catch(J0){let V0=J0 instanceof Error?J0.message:String(J0);if(g<b)n.text=`Approving publication... (attempt ${g+1}/${b})`,await new Promise((BD)=>setTimeout(BD,3000));else n.fail(`Failed to approve publication after ${b} attempts: ${V0}`),process.exit(1)}if(P0)n.succeed("Publication approved");console.log(W.green(`
130
130
  Import and publish complete: ${D} -> ${$}`)),console.log(W.dim(` GitHub: https://github.com/nemarDatasets/${$}`)),console.log(W.dim(` Working dir: ${Q}`))}var ME0="OpenNeuroDatasets",Ig="nemar",Sg="us-east-2";var xg=I(()=>{xD();n3();i8();a6()});var bg={};c4(bg,{runE2ETest:()=>fE0});import{cpSync as SE0,existsSync as XH,mkdirSync as kE0,mkdtempSync as _g,readFileSync as vE0,rmSync as QH,writeFileSync as YH}from"fs";import{tmpdir as fg}from"os";import{join as t8,resolve as BH}from"path";var{spawn:yE0}=globalThis.Bun;function vD(D,...F){if(D.verbose)console.log(" ",...F)}async function hg(D,F){let $=performance.now();try{return await F(),{name:D,passed:!0,duration_ms:Math.round(performance.now()-$)}}catch(J){let Q=J instanceof Error?J.message:String(J);return{name:D,passed:!1,duration_ms:Math.round(performance.now()-$),error:Q}}}async function xE0(D){let F=[];for(let{name:$,fn:J}of D){let Q=await hg($,J);if(F.push(Q),!Q.passed)break}return F}async function IF(D,F={}){let $=yE0({cmd:D,cwd:F.cwd,stdout:"pipe",stderr:"pipe",env:{...process.env,...F.env}}),J=await new Response($.stdout).text(),Q=await new Response($.stderr).text(),Y=await $.exited;return{stdout:J,stderr:Q,exitCode:Y}}function X1(D,F){if(!D.success)throw Error(`${F}: ${D.error}`)}function gg(D){if(!D.creds)throw Error("credentials not yet fetched");return D.creds}function _E0(){let D=[BH(__dirname,"../../test/fixtures/bids-minimal"),BH(__dirname,"../test/fixtures/bids-minimal"),BH(process.cwd(),"test/fixtures/bids-minimal")];for(let F of D)if(XH(F))return F;throw Error("Could not find test/fixtures/bids-minimal. Run from the nemar-cli root directory.")}async function fE0(D){let F=D.verbose??!1,$=performance.now(),J=_g(t8(fg(),"nemar-e2e-upload-")),Q=_g(t8(fg(),"nemar-e2e-clone-")),Y={uploadDir:J,cloneDir:Q,verbose:F},B=[];if(!D.skipReset)B.push({name:"Reset nm099999",fn:async()=>{let G=await ef(b4);if(vD(Y,`S3 objects deleted: ${G.steps.s3_deleted}`),vD(Y,`GitHub recreated: ${G.steps.github_recreated}`),vD(Y,`D1 cleaned: ${G.steps.d1_cleaned}`),!G.success){let H=[];if(!G.steps.github_recreated)H.push("GitHub");if(!G.steps.d1_cleaned)H.push("D1");throw Error(`Reset partially failed: ${H.join(", ")}`)}}});B.push({name:"Prepare upload",fn:async()=>{let G=_E0();SE0(G,J,{recursive:!0});for(let H of[".git",".nemar",".gitattributes"]){let q=t8(J,H);if(XH(q)){let K=await IF(["chmod","-R","u+w",q]);if(K.exitCode!==0)console.warn(`chmod failed for ${q} (exit ${K.exitCode}): ${K.stderr}`);QH(q,{recursive:!0,force:!0})}}vD(Y,`Copied fixtures to ${J}`)}},{name:"Init git + annex",fn:async()=>{X1(await n6(J,{force:!0}),"initDataset"),X1(await g4(J),"configureLargefiles"),vD(Y,"Git + git-annex initialized")}},{name:"Configure remotes",fn:async()=>{Y.creds=await O8(b4),vD(Y,`S3 prefix: ${Y.creds.s3.prefix}`),X1(await w8(J,{name:"nemar-s3",bucket:Y.creds.s3.bucket,prefix:`${b4}/objects`,region:Y.creds.s3.region,publicUrl:`https://${Y.creds.s3.bucket}.s3.${Y.creds.s3.region}.amazonaws.com/${b4}/objects`},RD(Y.creds.credentials)),"configureS3Remote");let G=`git@github.com:nemarDatasets/${b4}.git`;X1(await a8(J,G),"configureGitHubRemote"),vD(Y,"S3 + GitHub remotes configured")}},{name:"Upload to S3",fn:async()=>{X1(await i6(J),"gitAnnexAdd"),X1(await o8(J,"Initial BIDS dataset"),"saveDataset");let G=await j8(J,"nemar-s3",4,RD(gg(Y).credentials));X1(G,"copyToAnnexRemote"),vD(Y,`Files copied to S3: ${G.filesCopied}`),await kD(J)}},{name:"Push to GitHub",fn:async()=>{let G=await o1(J);if(X1(G,"pushToGitHub"),G.warning)vD(Y,`Warning: ${G.warning}`);vD(Y,"Pushed to GitHub (main + git-annex branches)")}},{name:"Clone fresh",fn:async()=>{let G=`git@github.com:nemarDatasets/${b4}.git`;X1(await s1(G,Q),"cloneDataset");let H=await h4(Q,"nemar-s3");if(!H.success)throw Error(`enableS3Remote: ${H.error}`);vD(Y,`Clone at ${Q}, S3 remote enabled: ${H.enabled}`)}},{name:"Download + verify",fn:async()=>{let G=RD(gg(Y).credentials),H={AWS_ACCESS_KEY_ID:G.accessKeyId,AWS_SECRET_ACCESS_KEY:G.secretAccessKey};if(G.sessionToken)H.AWS_SESSION_TOKEN=G.sessionToken;let{stdout:q,stderr:K,exitCode:V}=await IF(["git","annex","get","."],{cwd:Q,env:H});if(V!==0)throw Error(`getDatasetData: ${K.trim()}`);let E=q.match(/^get .+ ok$/gm);vD(Y,`Files downloaded: ${E?E.length:0}`);let Z=t8(Q,"sub-01/eeg/sub-01_task-rest_eeg.edf");if(!XH(Z))throw Error("EDF file not found after download");let{size:L}=Bun.file(Z);if(L<512)throw Error(`EDF file too small: ${L} bytes`);vD(Y,`EDF file verified: ${L} bytes`)}},{name:"Update cycle",fn:async()=>{let G=t8(Q,"sub-02/eeg");kE0(G,{recursive:!0});let H=Buffer.alloc(1024);H.write("0".padEnd(8),0,"ascii"),YH(t8(G,"sub-02_task-rest_eeg.edf"),H),YH(t8(G,"sub-02_task-rest_eeg.json"),JSON.stringify({TaskName:"rest",SamplingFrequency:256}));let q=vE0(t8(Q,"participants.tsv"),"utf-8");YH(t8(Q,"participants.tsv"),`${q.trimEnd()}
131
131
  sub-02 30 F
132
- `);let K=`e2e-update-${Date.now()}`,{exitCode:V}=await IF(["git","checkout","-b",K],{cwd:Q});if(V!==0)throw Error("Failed to create update branch");X1(await i6(Q),"gitAnnexAdd (update)"),X1(await o8(Q,"Add sub-02"),"saveDataset (update)"),Y.creds=await O8(b4);let E=await j8(Q,"nemar-s3",4,RD(Y.creds.credentials));X1(E,"copyToAnnexRemote (update)"),vD(Y,`Update files copied to S3: ${E.filesCopied}`),await kD(Q);let Z=await o1(Q,"origin",K);X1(Z,"pushToGitHub (update branch)");let{exitCode:L,stderr:A}=await IF(["git","push","origin","git-annex"],{cwd:Q});if(L!==0)throw Error(`Failed to push git-annex branch: ${A.trim()}`);vD(Y,`Update pushed to branch: ${K}`)}});let X=await xE0(B);if(!D.skipCleanup&&X.every((G)=>G.passed))X.push(await hg("Cleanup",async()=>{await IF(["chmod","-R","u+w",J]),await IF(["chmod","-R","u+w",Q]),QH(J,{recursive:!0,force:!0}),QH(Q,{recursive:!0,force:!0}),vD(Y,"Temp directories cleaned up")}));return gE0(X,$,J,Q,D.skipCleanup)}function gE0(D,F,$,J,Q){let Y={passed:D.every((B)=>B.passed),steps:D,total_duration_ms:Math.round(performance.now()-F)};if(Q)Y.upload_dir=$,Y.clone_dir=J;return Y}var __dirname="/home/runner/work/nemar-cli/nemar-cli/src/lib",b4="nm099999";var ug=I(()=>{i8();a6()});var xh,ak0;var _h=I(()=>{xh=["IsCitedBy","Cites","IsSupplementTo","IsSupplementedBy","IsContinuedBy","Continues","IsDescribedBy","Describes","HasMetadata","IsMetadataFor","HasVersion","IsVersionOf","IsNewVersionOf","IsPreviousVersionOf","IsPartOf","HasPart","IsReferencedBy","References","IsDocumentedBy","Documents","IsCompiledBy","Compiles","IsVariantFormOf","IsOriginalFormOf","IsIdenticalTo","IsCollectedBy","Collects","IsRequiredBy","Requires","IsObsoletedBy","Obsoletes","IsDerivedFrom","IsSourceOf","IsReviewedBy","Reviews","IsPublishedIn","HasTranslation","IsTranslationOf"],ak0=new Set(xh)});function vH(D){return D.replace(/^(doi:|https?:\/\/(dx\.)?doi\.org\/)/i,"").trim()}function fh(D){let F=D.split(",").map(($)=>$.trim());if(F.length>=2)return{name:D,familyName:F[0],givenName:F.slice(1).join(", ")};return{name:D}}var gh=I(()=>{_h()});var nh={};c4(nh,{queryDataCiteDoi:()=>ph,queryCrossrefDoi:()=>dh,mergeOrcidDiscoveries:()=>gV0,matchCreatorsToAuthors:()=>ch,extractDoisFromRelatedIdentifiers:()=>xV0,extractDoisFromBids:()=>mh,discoverOrcidsFromReferencedDois:()=>hV0});function mh(D){let F=[],$=new Set,J=(Q,Y)=>{let B=vH(Q).trim();if(uh.test(B)&&!$.has(B))$.add(B),F.push({doi:B,source:Y})};if(Array.isArray(D.SourceDatasets))for(let Q of D.SourceDatasets){if(!Q||typeof Q!=="object")continue;let Y=Q;if(typeof Y.DOI==="string")J(Y.DOI,"SourceDatasets");else if(typeof Y.URL==="string"){let B=Y.URL.match(/(?:doi\.org\/|doi:)(10\.\d{4,}\/.+)/);if(B)J(B[1],"SourceDatasets")}}if(Array.isArray(D.ReferencesAndLinks))for(let Q of D.ReferencesAndLinks){if(typeof Q!=="string"||!Q)continue;let Y=Q.match(/(?:doi\.org\/|^)(10\.\d{4,}\/[^\s]+)/);if(Y)J(Y[1],"ReferencesAndLinks")}if(typeof D.HowToAcknowledge==="string"){let Y=D.HowToAcknowledge.matchAll(/(?:doi\.org\/|(?<=\s|^))(10\.\d{4,}\/[^\s,)]+)/g);for(let B of Y)J(B[1].replace(/[.;:]+$/,""),"HowToAcknowledge")}return F}function xV0(D,F){let $=[];for(let J of D){if(!J||typeof J.identifier!=="string")continue;if(J.identifier_type!=="DOI")continue;let Q=vH(J.identifier).trim();if(uh.test(Q)&&!F.has(Q))F.add(Q),$.push({doi:Q,source:"RelatedIdentifiers"})}return $}function lh(D,F,$){let J=$ instanceof Error?$.message:String($);if(J.includes("AbortError")||J.includes("timeout")||J.includes("fetch"))console.warn(`[orcid-discovery] ${D} query failed for ${F}: ${J}`);else console.error(`[orcid-discovery] Unexpected error querying ${D} for ${F}:`,$)}async function ph(D){try{let F=await fetch(`${_V0}/${encodeURIComponent(D)}`,{headers:{Accept:"application/vnd.datacite.datacite+json"},signal:AbortSignal.timeout(1e4)});if(!F.ok){if(F.status!==404)console.warn(`[orcid-discovery] DataCite returned HTTP ${F.status} for ${D}`);return null}let $=await F.json();return{doi:D,creators:Array.isArray($.creators)?$.creators:[]}}catch(F){return lh("DataCite",D,F),null}}async function dh(D){try{let F=await fetch(`https://api.crossref.org/works/${encodeURIComponent(D)}`,{headers:{Accept:"application/json","User-Agent":"NEMAR/1.0 (https://nemar.org; mailto:nemar@ucsd.edu)"},signal:AbortSignal.timeout(1e4)});if(!F.ok){if(F.status!==404)console.warn(`[orcid-discovery] Crossref returned HTTP ${F.status} for ${D}`);return null}let J=(await F.json()).message?.author;if(!Array.isArray(J)||J.length===0)return null;let Q=J.map((Y)=>{let B=[];if(Y.ORCID)B.push({nameIdentifier:Y.ORCID,nameIdentifierScheme:"ORCID"});return{name:Y.family&&Y.given?`${Y.family}, ${Y.given}`:Y.name||Y.family||"",givenName:Y.given,familyName:Y.family,nameIdentifiers:B,affiliation:(Y.affiliation||[]).filter((X)=>X.name)}}).filter((Y)=>Y.name.trim()!=="");return{doi:D,creators:Q}}catch(F){return lh("Crossref",D,F),null}}async function fV0(D){let F=await ph(D),$=await dh(D);if(!F)return $;if(!$)return F;for(let J of F.creators){if(J.nameIdentifiers?.some((X)=>X.nameIdentifierScheme==="ORCID")||!J.familyName)continue;let B=$.creators.find((X)=>X.familyName&&j1(X.familyName)===j1(J.familyName))?.nameIdentifiers?.find((X)=>X.nameIdentifierScheme==="ORCID");if(B)J.nameIdentifiers=[...J.nameIdentifiers??[],B]}return F}function j1(D){return D.normalize("NFD").replace(/\p{Diacritic}/gu,"").replace(/\./g,"").toLowerCase().trim()}function hh(D){if(!D)return"";return j1(D).charAt(0)}function ch(D,F){let $=[],J=new Set,Q=new Set,Y=F.map((B)=>({original:B,parsed:fh(B)}));for(let B=0;B<D.length;B++){if(Q.has(B))continue;let X=D[B],G=j1(X.name);for(let H of Y){if(J.has(H.original))continue;if(j1(H.original)===G){$.push({bidsAuthor:H.original,matchedCreator:X,confidence:"exact"}),J.add(H.original),Q.add(B);break}if(H.parsed.familyName&&H.parsed.givenName){if(j1(`${H.parsed.givenName} ${H.parsed.familyName}`)===G){$.push({bidsAuthor:H.original,matchedCreator:X,confidence:"exact"}),J.add(H.original),Q.add(B);break}}if(X.givenName&&X.familyName){let q=j1(`${X.givenName} ${X.familyName}`);if(j1(H.original)===q){$.push({bidsAuthor:H.original,matchedCreator:X,confidence:"exact"}),J.add(H.original),Q.add(B);break}}}}for(let B=0;B<D.length;B++){if(Q.has(B))continue;let X=D[B];if(!X.familyName)continue;let G=j1(X.familyName),H=hh(X.givenName);for(let q of Y){if(J.has(q.original))continue;if(!q.parsed.familyName)continue;if(j1(q.parsed.familyName)!==G)continue;let V=hh(q.parsed.givenName);if(V&&H&&V===H){$.push({bidsAuthor:q.original,matchedCreator:X,confidence:"high"}),J.add(q.original),Q.add(B);break}}}for(let B=0;B<D.length;B++){if(Q.has(B))continue;let X=D[B];if(!X.familyName)continue;let G=j1(X.familyName);for(let H of Y){if(J.has(H.original))continue;if(!H.parsed.familyName)continue;if(j1(H.parsed.familyName)===G){$.push({bidsAuthor:H.original,matchedCreator:X,confidence:"medium"}),J.add(H.original),Q.add(B);break}}}return $}function gV0(D,F){let $={...D};for(let[J,Q]of Object.entries(F))$[J]={...$[J],orcid:Q.orcid,affiliations:Q.affiliations??$[J]?.affiliations};return $}async function hV0(D,F,$){let J=mh(D);if($?.length)J.push(...$);if(J.length===0)return{discoveries:{},unresolvedDois:[],totalDoisQueried:0};let Q=Array.isArray(D.Authors)?D.Authors.filter((q)=>typeof q==="string"):[];if(Q.length===0)return{discoveries:{},unresolvedDois:[],totalDoisQueried:J.length};let Y=new Set;if(F){for(let[q,K]of Object.entries(F))if(K.orcid)Y.add(q)}let B=Q.filter((q)=>!Y.has(q));if(B.length===0)return{discoveries:{},unresolvedDois:[],totalDoisQueried:J.length};let X=[],G=new Map;for(let q=0;q<J.length;q+=bh){let K=J.slice(q,q+bh),V=await Promise.all(K.map((E)=>fV0(E.doi)));for(let E=0;E<K.length;E++)if(V[E])G.set(K[E].doi,V[E]?.creators??[]);else X.push(K[E].doi)}let H={};for(let[q,K]of G){let V=K.filter((Z)=>Z.nameIdentifiers?.some((L)=>L.nameIdentifierScheme==="ORCID"));if(V.length===0)continue;let E=ch(V,B);for(let Z of E){if(H[Z.bidsAuthor])continue;let L=Z.matchedCreator.nameIdentifiers.find((N)=>N.nameIdentifierScheme==="ORCID");if(!L)continue;let A=L.nameIdentifier.replace(/^https?:\/\/orcid\.org\//i,"").trim();if(!yV0.test(A))continue;let M=Z.matchedCreator.affiliation?.filter((N)=>N.name).map((N)=>({name:N.name,...N.affiliationIdentifier&&{identifier:N.affiliationIdentifier},...N.affiliationIdentifierScheme&&{scheme:N.affiliationIdentifierScheme}}));H[Z.bidsAuthor]={orcid:A,affiliations:M?.length?M:void 0,sourceDoi:q,confidence:Z.confidence}}}return{discoveries:H,unresolvedDois:X,totalDoisQueried:J.length}}var uh,yV0,_V0="https://api.datacite.org/application/vnd.datacite.datacite+json",bh=5;var ih=I(()=>{gh();uh=/^10\.\d{4,}\/[^\s]+$/,yV0=/^\d{4}-\d{4}-\d{4}-[\dX]{4}$/});xD();var Gq=s(Xq(),1),{program:fZ0,createCommand:gZ0,createArgument:hZ0,createOption:bZ0,CommanderError:uZ0,InvalidArgumentError:mZ0,InvalidOptionArgumentError:lZ0,Command:i0,Argument:pZ0,Option:dZ0,Help:cZ0}=Gq.default;var Hq=process.argv.includes("--help-all");if(process.argv.includes("--no-color"))W.level=0;var Wq=process.argv.indexOf("--help-all");if(Wq!==-1)process.argv[Wq]="--help";var hF=i0.prototype.addHelpText,qq=`
132
+ `);let K=`e2e-update-${Date.now()}`,{exitCode:V}=await IF(["git","checkout","-b",K],{cwd:Q});if(V!==0)throw Error("Failed to create update branch");X1(await i6(Q),"gitAnnexAdd (update)"),X1(await o8(Q,"Add sub-02"),"saveDataset (update)"),Y.creds=await O8(b4);let E=await j8(Q,"nemar-s3",4,RD(Y.creds.credentials));X1(E,"copyToAnnexRemote (update)"),vD(Y,`Update files copied to S3: ${E.filesCopied}`),await kD(Q);let Z=await o1(Q,"origin",K);X1(Z,"pushToGitHub (update branch)");let{exitCode:L,stderr:M}=await IF(["git","push","origin","git-annex"],{cwd:Q});if(L!==0)throw Error(`Failed to push git-annex branch: ${M.trim()}`);vD(Y,`Update pushed to branch: ${K}`)}});let X=await xE0(B);if(!D.skipCleanup&&X.every((G)=>G.passed))X.push(await hg("Cleanup",async()=>{await IF(["chmod","-R","u+w",J]),await IF(["chmod","-R","u+w",Q]),QH(J,{recursive:!0,force:!0}),QH(Q,{recursive:!0,force:!0}),vD(Y,"Temp directories cleaned up")}));return gE0(X,$,J,Q,D.skipCleanup)}function gE0(D,F,$,J,Q){let Y={passed:D.every((B)=>B.passed),steps:D,total_duration_ms:Math.round(performance.now()-F)};if(Q)Y.upload_dir=$,Y.clone_dir=J;return Y}var __dirname="/home/runner/work/nemar-cli/nemar-cli/src/lib",b4="nm099999";var ug=I(()=>{i8();a6()});var xh,ak0;var _h=I(()=>{xh=["IsCitedBy","Cites","IsSupplementTo","IsSupplementedBy","IsContinuedBy","Continues","IsDescribedBy","Describes","HasMetadata","IsMetadataFor","HasVersion","IsVersionOf","IsNewVersionOf","IsPreviousVersionOf","IsPartOf","HasPart","IsReferencedBy","References","IsDocumentedBy","Documents","IsCompiledBy","Compiles","IsVariantFormOf","IsOriginalFormOf","IsIdenticalTo","IsCollectedBy","Collects","IsRequiredBy","Requires","IsObsoletedBy","Obsoletes","IsDerivedFrom","IsSourceOf","IsReviewedBy","Reviews","IsPublishedIn","HasTranslation","IsTranslationOf"],ak0=new Set(xh)});function vH(D){return D.replace(/^(doi:|https?:\/\/(dx\.)?doi\.org\/)/i,"").trim()}function fh(D){let F=D.split(",").map(($)=>$.trim());if(F.length>=2)return{name:D,familyName:F[0],givenName:F.slice(1).join(", ")};return{name:D}}var gh=I(()=>{_h()});var nh={};c4(nh,{queryDataCiteDoi:()=>ph,queryCrossrefDoi:()=>dh,mergeOrcidDiscoveries:()=>gV0,matchCreatorsToAuthors:()=>ch,extractDoisFromRelatedIdentifiers:()=>xV0,extractDoisFromBids:()=>mh,discoverOrcidsFromReferencedDois:()=>hV0});function mh(D){let F=[],$=new Set,J=(Q,Y)=>{let B=vH(Q).trim();if(uh.test(B)&&!$.has(B))$.add(B),F.push({doi:B,source:Y})};if(Array.isArray(D.SourceDatasets))for(let Q of D.SourceDatasets){if(!Q||typeof Q!=="object")continue;let Y=Q;if(typeof Y.DOI==="string")J(Y.DOI,"SourceDatasets");else if(typeof Y.URL==="string"){let B=Y.URL.match(/(?:doi\.org\/|doi:)(10\.\d{4,}\/.+)/);if(B)J(B[1],"SourceDatasets")}}if(Array.isArray(D.ReferencesAndLinks))for(let Q of D.ReferencesAndLinks){if(typeof Q!=="string"||!Q)continue;let Y=Q.match(/(?:doi\.org\/|^)(10\.\d{4,}\/[^\s]+)/);if(Y)J(Y[1],"ReferencesAndLinks")}if(typeof D.HowToAcknowledge==="string"){let Y=D.HowToAcknowledge.matchAll(/(?:doi\.org\/|(?<=\s|^))(10\.\d{4,}\/[^\s,)]+)/g);for(let B of Y)J(B[1].replace(/[.;:]+$/,""),"HowToAcknowledge")}return F}function xV0(D,F){let $=[];for(let J of D){if(!J||typeof J.identifier!=="string")continue;if(J.identifier_type!=="DOI")continue;let Q=vH(J.identifier).trim();if(uh.test(Q)&&!F.has(Q))F.add(Q),$.push({doi:Q,source:"RelatedIdentifiers"})}return $}function lh(D,F,$){let J=$ instanceof Error?$.message:String($);if(J.includes("AbortError")||J.includes("timeout")||J.includes("fetch"))console.warn(`[orcid-discovery] ${D} query failed for ${F}: ${J}`);else console.error(`[orcid-discovery] Unexpected error querying ${D} for ${F}:`,$)}async function ph(D){try{let F=await fetch(`${_V0}/${encodeURIComponent(D)}`,{headers:{Accept:"application/vnd.datacite.datacite+json"},signal:AbortSignal.timeout(1e4)});if(!F.ok){if(F.status!==404)console.warn(`[orcid-discovery] DataCite returned HTTP ${F.status} for ${D}`);return null}let $=await F.json();return{doi:D,creators:Array.isArray($.creators)?$.creators:[]}}catch(F){return lh("DataCite",D,F),null}}async function dh(D){try{let F=await fetch(`https://api.crossref.org/works/${encodeURIComponent(D)}`,{headers:{Accept:"application/json","User-Agent":"NEMAR/1.0 (https://nemar.org; mailto:nemar@ucsd.edu)"},signal:AbortSignal.timeout(1e4)});if(!F.ok){if(F.status!==404)console.warn(`[orcid-discovery] Crossref returned HTTP ${F.status} for ${D}`);return null}let J=(await F.json()).message?.author;if(!Array.isArray(J)||J.length===0)return null;let Q=J.map((Y)=>{let B=[];if(Y.ORCID)B.push({nameIdentifier:Y.ORCID,nameIdentifierScheme:"ORCID"});return{name:Y.family&&Y.given?`${Y.family}, ${Y.given}`:Y.name||Y.family||"",givenName:Y.given,familyName:Y.family,nameIdentifiers:B,affiliation:(Y.affiliation||[]).filter((X)=>X.name)}}).filter((Y)=>Y.name.trim()!=="");return{doi:D,creators:Q}}catch(F){return lh("Crossref",D,F),null}}async function fV0(D){let F=await ph(D),$=await dh(D);if(!F)return $;if(!$)return F;for(let J of F.creators){if(J.nameIdentifiers?.some((X)=>X.nameIdentifierScheme==="ORCID")||!J.familyName)continue;let B=$.creators.find((X)=>X.familyName&&j1(X.familyName)===j1(J.familyName))?.nameIdentifiers?.find((X)=>X.nameIdentifierScheme==="ORCID");if(B)J.nameIdentifiers=[...J.nameIdentifiers??[],B]}return F}function j1(D){return D.normalize("NFD").replace(/\p{Diacritic}/gu,"").replace(/\./g,"").toLowerCase().trim()}function hh(D){if(!D)return"";return j1(D).charAt(0)}function ch(D,F){let $=[],J=new Set,Q=new Set,Y=F.map((B)=>({original:B,parsed:fh(B)}));for(let B=0;B<D.length;B++){if(Q.has(B))continue;let X=D[B],G=j1(X.name);for(let H of Y){if(J.has(H.original))continue;if(j1(H.original)===G){$.push({bidsAuthor:H.original,matchedCreator:X,confidence:"exact"}),J.add(H.original),Q.add(B);break}if(H.parsed.familyName&&H.parsed.givenName){if(j1(`${H.parsed.givenName} ${H.parsed.familyName}`)===G){$.push({bidsAuthor:H.original,matchedCreator:X,confidence:"exact"}),J.add(H.original),Q.add(B);break}}if(X.givenName&&X.familyName){let q=j1(`${X.givenName} ${X.familyName}`);if(j1(H.original)===q){$.push({bidsAuthor:H.original,matchedCreator:X,confidence:"exact"}),J.add(H.original),Q.add(B);break}}}}for(let B=0;B<D.length;B++){if(Q.has(B))continue;let X=D[B];if(!X.familyName)continue;let G=j1(X.familyName),H=hh(X.givenName);for(let q of Y){if(J.has(q.original))continue;if(!q.parsed.familyName)continue;if(j1(q.parsed.familyName)!==G)continue;let V=hh(q.parsed.givenName);if(V&&H&&V===H){$.push({bidsAuthor:q.original,matchedCreator:X,confidence:"high"}),J.add(q.original),Q.add(B);break}}}for(let B=0;B<D.length;B++){if(Q.has(B))continue;let X=D[B];if(!X.familyName)continue;let G=j1(X.familyName);for(let H of Y){if(J.has(H.original))continue;if(!H.parsed.familyName)continue;if(j1(H.parsed.familyName)===G){$.push({bidsAuthor:H.original,matchedCreator:X,confidence:"medium"}),J.add(H.original),Q.add(B);break}}}return $}function gV0(D,F){let $={...D};for(let[J,Q]of Object.entries(F))$[J]={...$[J],orcid:Q.orcid,affiliations:Q.affiliations??$[J]?.affiliations};return $}async function hV0(D,F,$){let J=mh(D);if($?.length)J.push(...$);if(J.length===0)return{discoveries:{},unresolvedDois:[],totalDoisQueried:0};let Q=Array.isArray(D.Authors)?D.Authors.filter((q)=>typeof q==="string"):[];if(Q.length===0)return{discoveries:{},unresolvedDois:[],totalDoisQueried:J.length};let Y=new Set;if(F){for(let[q,K]of Object.entries(F))if(K.orcid)Y.add(q)}let B=Q.filter((q)=>!Y.has(q));if(B.length===0)return{discoveries:{},unresolvedDois:[],totalDoisQueried:J.length};let X=[],G=new Map;for(let q=0;q<J.length;q+=bh){let K=J.slice(q,q+bh),V=await Promise.all(K.map((E)=>fV0(E.doi)));for(let E=0;E<K.length;E++)if(V[E])G.set(K[E].doi,V[E]?.creators??[]);else X.push(K[E].doi)}let H={};for(let[q,K]of G){let V=K.filter((Z)=>Z.nameIdentifiers?.some((L)=>L.nameIdentifierScheme==="ORCID"));if(V.length===0)continue;let E=ch(V,B);for(let Z of E){if(H[Z.bidsAuthor])continue;let L=Z.matchedCreator.nameIdentifiers.find((N)=>N.nameIdentifierScheme==="ORCID");if(!L)continue;let M=L.nameIdentifier.replace(/^https?:\/\/orcid\.org\//i,"").trim();if(!yV0.test(M))continue;let A=Z.matchedCreator.affiliation?.filter((N)=>N.name).map((N)=>({name:N.name,...N.affiliationIdentifier&&{identifier:N.affiliationIdentifier},...N.affiliationIdentifierScheme&&{scheme:N.affiliationIdentifierScheme}}));H[Z.bidsAuthor]={orcid:M,affiliations:A?.length?A:void 0,sourceDoi:q,confidence:Z.confidence}}}return{discoveries:H,unresolvedDois:X,totalDoisQueried:J.length}}var uh,yV0,_V0="https://api.datacite.org/application/vnd.datacite.datacite+json",bh=5;var ih=I(()=>{gh();uh=/^10\.\d{4,}\/[^\s]+$/,yV0=/^\d{4}-\d{4}-\d{4}-[\dX]{4}$/});xD();var Gq=s(Xq(),1),{program:fZ0,createCommand:gZ0,createArgument:hZ0,createOption:bZ0,CommanderError:uZ0,InvalidArgumentError:mZ0,InvalidOptionArgumentError:lZ0,Command:i0,Argument:pZ0,Option:dZ0,Help:cZ0}=Gq.default;var Hq=process.argv.includes("--help-all");if(process.argv.includes("--no-color"))W.level=0;var Wq=process.argv.indexOf("--help-all");if(Wq!==-1)process.argv[Wq]="--help";var hF=i0.prototype.addHelpText,qq=`
133
133
  Run with --help-all for examples and detailed descriptions.
134
- `,s9=new WeakSet;i0.prototype.addHelpText=function(D,F){if(D==="after"||D==="afterAll"){if(Hq)return hF.call(this,D,F);if(!s9.has(this))return s9.add(this),hF.call(this,D,qq);return this}return hF.call(this,D,F)};var wu={formatHelp(D,F){let $=F.padWidth(D,F),J=F.helpWidth??80,Q=2,Y=2;function B(Z,L,A){if(A){let M=" ".repeat(Math.max(0,$+2-Z.length)),N=`${L}${M}${A}`;return F.wrap(N,J-2,$+2)}return L}function X(Z){return Z.join(`
134
+ `,s9=new WeakSet;i0.prototype.addHelpText=function(D,F){if(D==="after"||D==="afterAll"){if(Hq)return hF.call(this,D,F);if(!s9.has(this))return s9.add(this),hF.call(this,D,qq);return this}return hF.call(this,D,F)};var wu={formatHelp(D,F){let $=F.padWidth(D,F),J=F.helpWidth??80,Q=2,Y=2;function B(Z,L,M){if(M){let A=" ".repeat(Math.max(0,$+2-Z.length)),N=`${L}${A}${M}`;return F.wrap(N,J-2,$+2)}return L}function X(Z){return Z.join(`
135
135
  `).replace(/^/gm," ".repeat(2))}let G=[];G.push(`Usage: ${F.commandUsage(D)}`,"");let H=F.commandDescription(D);if(H.length>0)G.push(F.wrap(H,J,0),"");let q=F.visibleArguments(D).map((Z)=>{let L=F.argumentTerm(Z);return B(L,W.blue(L),F.argumentDescription(Z))});if(q.length>0)G.push(W.bold("Arguments:"),X(q),"");let K=F.visibleOptions(D).map((Z)=>{let L=F.optionTerm(Z);return B(L,W.cyan(L),F.optionDescription(Z))});if(K.length>0)G.push(W.bold("Options:"),X(K),"");let E=F.visibleCommands(D).sort((Z,L)=>Z.name().localeCompare(L.name())).map((Z)=>{let L=F.subcommandTerm(Z);return B(L,W.bold.cyan(L),F.subcommandDescription(Z))});if(E.length>0)G.push(W.bold("Commands:"),X(E),"");return G.join(`
136
- `)}};function Kq(D){zq(D)}function zq(D){D.configureHelp(wu);for(let F of D.commands)zq(F)}function r6(D,F){if(Hq)hF.call(D,"after",F);else if(!s9.has(D))s9.add(D),hF.call(D,"after",qq)}xD();xD();import{existsSync as pg,readFileSync as hE0}from"fs";import{join as bE0}from"path";k6();n3();i8();x4();k6();async function k0(D,F,$=!1){if(F.no)return"declined";if(F.yes)return"confirmed";try{let{confirmed:J}=await D0.prompt([{type:"confirm",name:"confirmed",message:D,default:$}]);return J?"confirmed":"cancelled"}catch(J){let Q=J instanceof Error?J.message:String(J);if(Q.includes("closed")||Q.includes("TTY")||Q.includes("SIGINT")||Q.includes("readline"))console.error("Interactive prompt unavailable (non-interactive terminal or interrupted)"),console.error(" Use --yes or --no flags for non-interactive mode");else console.error("Prompt error:",Q);return"cancelled"}}async function zg(D,F,$){if($.no)return"declined";if($.yes)return"confirmed";try{let{input:J}=await D0.prompt([{type:"input",name:"input",message:D,validate:(Q)=>{if(Q!==F)return`Input does not match. Expected: ${F}`;return!0}}]);return J===F?"confirmed":"cancelled"}catch(J){let Q=J instanceof Error?J.message:String(J);if(Q.includes("closed")||Q.includes("TTY")||Q.includes("SIGINT")||Q.includes("readline"))console.error("Interactive prompt unavailable (non-interactive terminal or interrupted)"),console.error(" Use --yes or --no flags for non-interactive mode");else console.error("Prompt error:",Q);return"cancelled"}}var j0="-y, --yes",b0="-n, --no",T0="Skip confirmation and proceed",y0="Skip confirmation and decline";a6();function QD(D,F,$,J){if(D instanceof b){F.fail(D.message);let Q=J?.[D.statusCode];if(Q)console.log(W.dim(` ${Q}`));else if(D.statusCode===403)console.log(W.dim(" This command requires admin privileges"))}else F.fail($),console.log(W.dim(` Error details: ${w0(D)}`))}async function mg(D,F){let{spawn:$}=awaitPromise.resolve(globalThis.Bun),J=F==="README"?`repos/${D}/readme`:`repos/${D}/contents/${F}`,Q=$({cmd:["gh","api",J,"--jq",".content"],stdout:"pipe",stderr:"pipe"}),Y=await new Response(Q.stdout).text(),B=await new Response(Q.stderr).text();if(await Q.exited!==0){if(B.trim()&&!B.includes("404"))console.warn(`[fetchGitHubFileContent] Error fetching ${F}: ${B.trim()}`);return null}if(!Y.trim())return null;return Buffer.from(Y.trim(),"base64").toString("utf-8")}var r0=new i0("admin").description("Admin commands (requires admin privileges)").addHelpText("after",`
136
+ `)}};function Kq(D){zq(D)}function zq(D){D.configureHelp(wu);for(let F of D.commands)zq(F)}function r6(D,F){if(Hq)hF.call(D,"after",F);else if(!s9.has(D))s9.add(D),hF.call(D,"after",qq)}xD();xD();import{existsSync as pg,readFileSync as hE0}from"fs";import{join as bE0}from"path";k6();n3();i8();x4();k6();async function k0(D,F,$=!1){if(F.no)return"declined";if(F.yes)return"confirmed";try{let{confirmed:J}=await D0.prompt([{type:"confirm",name:"confirmed",message:D,default:$}]);return J?"confirmed":"cancelled"}catch(J){let Q=J instanceof Error?J.message:String(J);if(Q.includes("closed")||Q.includes("TTY")||Q.includes("SIGINT")||Q.includes("readline"))console.error("Interactive prompt unavailable (non-interactive terminal or interrupted)"),console.error(" Use --yes or --no flags for non-interactive mode");else console.error("Prompt error:",Q);return"cancelled"}}async function zg(D,F,$){if($.no)return"declined";if($.yes)return"confirmed";try{let{input:J}=await D0.prompt([{type:"input",name:"input",message:D,validate:(Q)=>{if(Q!==F)return`Input does not match. Expected: ${F}`;return!0}}]);return J===F?"confirmed":"cancelled"}catch(J){let Q=J instanceof Error?J.message:String(J);if(Q.includes("closed")||Q.includes("TTY")||Q.includes("SIGINT")||Q.includes("readline"))console.error("Interactive prompt unavailable (non-interactive terminal or interrupted)"),console.error(" Use --yes or --no flags for non-interactive mode");else console.error("Prompt error:",Q);return"cancelled"}}var j0="-y, --yes",b0="-n, --no",T0="Skip confirmation and proceed",y0="Skip confirmation and decline";a6();function QD(D,F,$,J){if(D instanceof h){F.fail(D.message);let Q=J?.[D.statusCode];if(Q)console.log(W.dim(` ${Q}`));else if(D.statusCode===403)console.log(W.dim(" This command requires admin privileges"))}else F.fail($),console.log(W.dim(` Error details: ${w0(D)}`))}async function mg(D,F){let{spawn:$}=awaitPromise.resolve(globalThis.Bun),J=F==="README"?`repos/${D}/readme`:`repos/${D}/contents/${F}`,Q=$({cmd:["gh","api",J,"--jq",".content"],stdout:"pipe",stderr:"pipe"}),Y=await new Response(Q.stdout).text(),B=await new Response(Q.stderr).text();if(await Q.exited!==0){if(B.trim()&&!B.includes("404"))console.warn(`[fetchGitHubFileContent] Error fetching ${F}: ${B.trim()}`);return null}if(!Y.trim())return null;return Buffer.from(Y.trim(),"base64").toString("utf-8")}var r0=new i0("admin").description("Admin commands (requires admin privileges)").addHelpText("after",`
137
137
  Description:
138
138
  Administrative commands for managing NEMAR users and datasets.
139
139
  These commands require admin privileges.
@@ -203,12 +203,12 @@ Making repository private: ${D}
203
203
  ${W.cyan("CI Status:")} ${D}
204
204
  `);let J=$.bids_validation.present,Q=J?W.green("[x]"):W.red("[ ]");if(console.log(` ${Q} BIDS Validation`),J){let X=$.bids_validation.status==="success"?W.green:$.bids_validation.status==="failure"?W.red:W.yellow;if(console.log(` Status: ${X($.bids_validation.status)}`),$.bids_validation.url)console.log(` URL: ${W.dim($.bids_validation.url)}`)}else console.log(` ${W.dim("Not deployed. Use 'nemar admin ci add' to deploy.")}`);let Y=$.version_check.present,B=Y?W.green("[x]"):W.red("[ ]");if(console.log(` ${B} Version Check`),!Y)console.log(` ${W.dim("Not deployed. Use 'nemar admin ci add' to deploy.")}`);console.log()}catch($){QD($,F,"Failed to check CI status",{404:"Dataset not found"})}});KQ.command("add").description("Deploy CI workflows to a dataset repository (or all with --all)").argument("[dataset-id]","Dataset ID (e.g., nm000104)").option("--all","Deploy to all dataset repositories").option("--no-validate","Skip post-deploy parseability check (saves ~2.5 s per dataset; use for fleet deploys with --all)").option(j0,T0).option(b0,y0).action(async(D,F)=>{if(!f0())return;let $=F.validate===!1;if(F.all){let Y=O("Fetching dataset list...").start(),B;try{if(B=(await k9({limit:1000})).datasets,Y.succeed(`Found ${B.length} datasets`),B.length>=1000)console.log(W.yellow("Warning: reached 1000 dataset limit; some datasets may be skipped"))}catch(q){QD(q,Y,"Failed to fetch datasets");return}if(console.log(W.cyan(`
205
205
  Deploy CI workflows to ${B.length} datasets
206
- `)),console.log("This will add/update the following workflows on each:"),console.log(" 1. BIDS Validation (runs on PRs)"),console.log(" 2. Version Check (ensures version bump on PRs)"),console.log(" 3. PR Merge Handler (creates releases, publishes DOIs)"),$)console.log(W.dim(" (post-deploy parseability check disabled via --no-validate)"));console.log();let X=await k0(`Deploy CI workflows to all ${B.length} datasets?`,F);if(X!=="confirmed"){console.log(W.dim(X==="declined"?"Skipped":"Cancelled"));return}let G=0,H=0;for(let q of B){let K=O(`Deploying to ${q.dataset_id}...`).start();try{let V=await f4(q.dataset_id,{validate:!$});if(V.validation_warnings&&V.validation_warnings.length>0){K.warn(`${q.dataset_id}: deployed (with warnings)`);for(let E of V.validation_warnings)console.log(` ${W.yellow("!")} ${E}`)}else K.succeed(`${q.dataset_id}: deployed`);G++}catch(V){let E=V instanceof b?V.message:String(V);K.fail(`${q.dataset_id}: ${E}`),H++}}console.log(),console.log(W.cyan(`Done: ${G} succeeded, ${H} failed out of ${B.length}`));return}if(!D){console.error(W.red("Error: dataset-id is required (or use --all)"));return}if(console.log(W.cyan(`
206
+ `)),console.log("This will add/update the following workflows on each:"),console.log(" 1. BIDS Validation (runs on PRs)"),console.log(" 2. Version Check (ensures version bump on PRs)"),console.log(" 3. PR Merge Handler (creates releases, publishes DOIs)"),$)console.log(W.dim(" (post-deploy parseability check disabled via --no-validate)"));console.log();let X=await k0(`Deploy CI workflows to all ${B.length} datasets?`,F);if(X!=="confirmed"){console.log(W.dim(X==="declined"?"Skipped":"Cancelled"));return}let G=0,H=0;for(let q of B){let K=O(`Deploying to ${q.dataset_id}...`).start();try{let V=await f4(q.dataset_id,{validate:!$});if(V.validation_warnings&&V.validation_warnings.length>0){K.warn(`${q.dataset_id}: deployed (with warnings)`);for(let E of V.validation_warnings)console.log(` ${W.yellow("!")} ${E}`)}else K.succeed(`${q.dataset_id}: deployed`);G++}catch(V){let E=V instanceof h?V.message:String(V);K.fail(`${q.dataset_id}: ${E}`),H++}}console.log(),console.log(W.cyan(`Done: ${G} succeeded, ${H} failed out of ${B.length}`));return}if(!D){console.error(W.red("Error: dataset-id is required (or use --all)"));return}if(console.log(W.cyan(`
207
207
  Deploy CI workflows to: ${D}
208
208
  `)),console.log("This will add the following workflows:"),console.log(" 1. BIDS Validation (runs on PRs)"),console.log(" 2. Version Check (ensures version bump on PRs)"),console.log(" 3. PR Merge Handler (creates releases, publishes DOIs)"),$)console.log(W.dim(" (post-deploy parseability check disabled via --no-validate)"));console.log();let J=await k0(`Deploy CI workflows to ${D}?`,F);if(J!=="confirmed"){console.log(W.dim(J==="declined"?"Skipped":"Cancelled"));return}let Q=O(`Deploying CI workflows to ${D}...`).start();try{let Y=await f4(D,{validate:!$});Q.succeed("CI workflows deployed"),console.log();for(let B of Y.workflows_deployed)console.log(` ${W.green("[x]")} ${B}`);if(Y.validation_warnings&&Y.validation_warnings.length>0){console.log(),console.log(W.yellow("Validation warnings (best-effort; deploy succeeded):"));for(let B of Y.validation_warnings)console.log(` ${W.yellow("!")} ${B}`)}console.log()}catch(Y){QD(Y,Q,"Failed to deploy CI workflows",{404:"Dataset not found"})}});KQ.command("sync").description("Sync deployed CI workflows to current templates (only writes drifted/missing files)").argument("[dataset-id]","Dataset ID (e.g., nm000104)").option("--all","Sync across all dataset repositories").option(j0,T0).option(b0,y0).action(async(D,F)=>{if(!f0())return;if(F.all){let J=O("Fetching dataset list...").start(),Q;try{if(Q=(await k9({limit:1000})).datasets,J.succeed(`Found ${Q.length} datasets`),Q.length>=1000)console.log(W.yellow("Warning: reached 1000 dataset limit; some datasets may be skipped"))}catch(H){QD(H,J,"Failed to fetch datasets");return}console.log(W.cyan(`
209
209
  Sync CI templates across ${Q.length} datasets (writes only diffs)
210
- `));let Y=await k0(`Sync templates on all ${Q.length} datasets?`,F);if(Y!=="confirmed"){console.log(W.dim(Y==="declined"?"Skipped":"Cancelled"));return}let B=0,X=0,G=0;for(let H of Q){let q=O(`Syncing ${H.dataset_id}...`).start();try{let K=await TW(H.dataset_id),V=K.changed.length+K.added.length;if(K.errors.length>0)q.warn(`${H.dataset_id}: ${V} updated, ${K.errors.length} error(s)`),G++;else if(V===0)q.succeed(`${H.dataset_id}: up to date`),B++;else{let E=[];if(K.added.length>0)E.push(`+${K.added.length} added`);if(K.changed.length>0)E.push(`~${K.changed.length} updated`);q.succeed(`${H.dataset_id}: ${E.join(", ")}`),X++}}catch(K){let V=K instanceof b?K.message:String(K);q.fail(`${H.dataset_id}: ${V}`),G++}}console.log(),console.log(W.cyan(`Done: ${B} up-to-date, ${X} updated, ${G} with errors`));return}if(!D){console.error(W.red("Error: dataset-id is required (or use --all)"));return}let $=O(`Syncing CI templates for ${D}...`).start();try{let J=await TW(D),Q=J.changed.length+J.added.length;if(J.errors.length>0)$.warn(`${D}: ${J.errors.length} error(s)`);else if(Q===0)$.succeed(`${D}: already up to date`);else $.succeed(`${D}: synced`);if(console.log(),console.log(` ${W.dim("Checked:")} ${J.checked.join(", ")}`),J.added.length>0)console.log(` ${W.green("Added:")} ${J.added.join(", ")}`);if(J.changed.length>0)console.log(` ${W.yellow("Updated:")} ${J.changed.join(", ")}`);if(!J.committed&&Q>0&&J.errors.length===0)console.log(` ${W.yellow("Note:")} listed changes were not committed`);if(J.list_failed)console.log(` ${W.red("Warning:")} workflow directory listing failed; presence is unknown`);if(J.errors.length>0){console.log(` ${W.red("Errors:")}`);for(let Y of J.errors)console.log(` - ${Y}`)}console.log()}catch(J){QD(J,$,"Failed to sync CI templates",{404:"Dataset not found"})}});r0.addCommand(KQ);var u9=new i0("doi").description("DOI management");u9.command("create").description("Create concept DOI for a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("--title <title>","DOI title (defaults to dataset name)").option("--description <desc>","DOI description").option("--provider <provider>","DOI provider: ezid (default) or zenodo","ezid").option("--sandbox","Use sandbox/test DOI").option(j0,T0).option(b0,y0).action(async(D,F)=>{if(!f0())return;let $=O("Fetching dataset info...").start(),J;try{J=await uD(D),$.succeed(`Found dataset: ${J.name}`)}catch(G){if(G instanceof b){if($.fail(G.message),G.statusCode===404)console.log(W.dim(" Dataset not found"))}else $.fail("Failed to fetch dataset");return}try{let G=await v9(D);if(G.concept_doi){if(console.log(W.yellow(`
211
- Dataset already has a concept DOI:`)),console.log(` Concept DOI: ${W.cyan(G.concept_doi)}`),G.zenodo_concept_url)console.log(` Zenodo URL: ${G.zenodo_concept_url}`);return}}catch(G){if(process.env.DEBUG)console.error("[debug] DOI info fetch:",G)}if(console.log(),console.log(W.cyan("Dataset Information:")),console.log(` ID: ${J.dataset_id}`),console.log(` Name: ${J.name}`),J.github_repo)console.log(` GitHub: ${J.github_repo}`);if(F.sandbox)console.log(` Mode: ${W.yellow("SANDBOX (test DOI)")}`);console.log();let Q=F.provider==="zenodo"?"zenodo":"ezid";if(F.sandbox){if(console.log(W.yellow("\u2501".repeat(60))),console.log(W.yellow.bold(" SANDBOX MODE ENABLED")),console.log(W.yellow("\u2501".repeat(60))),Q==="zenodo")console.log(W.yellow(" \u2022 Using Zenodo sandbox (sandbox.zenodo.org)"));else console.log(W.yellow(" \u2022 Using EZID test shoulder (doi:10.5072/FK2)")),console.log(W.yellow(" \u2022 Test DOIs auto-delete after 2 weeks"));console.log(W.yellow(" \u2022 DOI will NOT be indexed by DataCite")),console.log(W.yellow(" \u2022 DOI will NOT resolve in production")),console.log(W.yellow(" \u2022 Use this for testing workflows only")),console.log(W.yellow("\u2501".repeat(60))),console.log()}console.log(W.red("WARNING: DOIs are PERMANENT and cannot be deleted!")),console.log(W.dim("The DOI will be pre-reserved but not published until the first version release.")),console.log(` Provider: ${W.cyan(Q.toUpperCase())}`),console.log();let Y=F.sandbox?`Create TEST concept DOI via ${Q.toUpperCase()} SANDBOX?`:`Create PERMANENT concept DOI via ${Q.toUpperCase()} PRODUCTION?`,B=await k0(Y,F);if(B!=="confirmed"){console.log(W.dim(B==="declined"?"Skipped":"Cancelled"));return}let X=O(`Creating concept DOI via ${Q.toUpperCase()}...`).start();try{let G=await bf(D,{title:F.title,description:F.description,sandbox:F.sandbox,provider:Q});X.succeed("Concept DOI created successfully");let H=O("Applying branch protection...").start();try{let q=await JQ(D);if(q.warnings&&q.warnings.length>0){H.warn("Branch protection applied with warnings");for(let K of q.warnings)console.log(W.yellow(` Warning: ${K}`))}else H.succeed("Branch protection applied")}catch(q){if(H.warn("Could not apply branch protection"),q instanceof b){if(console.log(W.dim(` ${q.message}`)),q.statusCode===403)console.log(W.dim(" Check admin credentials and permissions"))}else console.log(W.dim(` ${q instanceof Error?q.message:"Unknown error"}`));console.log(W.dim(" Manual setup: Go to GitHub repo Settings > Branches > Add rule"))}if(console.log(),console.log(W.green("DOI Information:")),console.log(` Concept DOI: ${W.cyan(G.concept_doi)}`),console.log(` Provider: ${G.provider.toUpperCase()}`),G.provider==="ezid")console.log(` DOI URL: ${G.doi_url}`),console.log(` EZID ID: ${G.ezid_identifier}`);else console.log(` Zenodo URL: ${G.zenodo_url}`);if(G.metadata_warning)console.log(W.yellow(` Warning: ${G.metadata_warning}`));if(console.log(),console.log(W.yellow("Next steps:")),console.log(" 1. Update dataset_description.json with DatasetDOI field"),console.log(" 2. Create a PR and merge it to trigger version DOI publication"),console.log(),F.sandbox)console.log(W.dim("Note: This is a sandbox DOI and will not resolve in production."))}catch(G){if(G instanceof b){if(X.fail(G.message),G.statusCode===403)console.log(W.dim(" This command requires admin privileges"))}else X.fail("Failed to create concept DOI"),console.log(W.dim(` ${w0(G)}`))}});u9.command("info").description("Get DOI info for a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").action(async(D)=>{if(!f0())return;let F=O("Fetching DOI info...").start();try{let $=await v9(D);if(F.stop(),console.log(),console.log(W.cyan(`DOI Information for ${D}:`)),console.log(` Dataset Name: ${$.name}`),console.log(),$.concept_doi){if(console.log(W.green("Concept DOI:")),console.log(` DOI: ${$.concept_doi}`),console.log(` URL: https://doi.org/${$.concept_doi}`),console.log(` Provider: ${($.doi_provider||"zenodo").toUpperCase()}`),$.doi_provider==="ezid"){if($.ezid_identifier)console.log(` EZID ID: ${$.ezid_identifier}`);if($.ezid_status){let J=$.ezid_status==="public"?W.green:W.yellow;console.log(` Status: ${J($.ezid_status)}`)}}if($.zenodo_concept_url){if(console.log(` Zenodo: ${$.zenodo_concept_url}`),$.zenodo_concept_url.includes("sandbox.zenodo.org"))console.log(),console.log(W.yellow("Mode: SANDBOX (test DOI)")),console.log(W.yellow(" This DOI is not indexed by DataCite and will not resolve in production"))}}else console.log(W.yellow("No concept DOI created yet")),console.log(W.dim(" Use 'nemar admin doi create' to create one"));if(console.log(),$.latest_version_doi){if(console.log(W.green("Latest Version DOI:")),console.log(` DOI: ${$.latest_version_doi}`),console.log(` URL: https://doi.org/${$.latest_version_doi}`),$.zenodo_latest_version_url)console.log(` Zenodo: ${$.zenodo_latest_version_url}`)}else if($.concept_doi)console.log(W.yellow("No version DOI published yet")),console.log(W.dim(" Version DOIs are created automatically on PR merge"))}catch($){if($ instanceof b){if(F.fail($.message),$.statusCode===404)console.log(W.dim(" Dataset not found"));else if($.statusCode===403)console.log(W.dim(" This command requires admin privileges"))}else F.fail("Failed to fetch DOI info")}});u9.command("update").description("Update EZID DOI metadata or status").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("--make-public","Transition DOI from reserved to public (permanent)").option("--refresh","Refresh metadata from dataset_description.json and .nemar/metadata.json").option(j0,T0).option(b0,y0).action(async(D,F)=>{if(!f0())return;if(!F.makePublic&&!F.refresh){console.log(W.yellow("No action specified. Use --make-public and/or --refresh."));return}if(F.makePublic){console.log(W.red("WARNING: Making a DOI public is PERMANENT!")),console.log(W.dim(" The DOI will be findable in DataCite and cannot be reverted.")),console.log();let J=await k0(`Make DOI for ${D} PUBLIC and permanent?`,F);if(J!=="confirmed"){console.log(W.dim(J==="declined"?"Skipped":"Cancelled"));return}}let $=O("Updating DOI...").start();try{let J=await PW(D,{status:F.makePublic?"public":void 0,refresh_metadata:F.refresh});$.succeed("DOI updated successfully"),console.log(),console.log(` EZID ID: ${W.cyan(J.ezid_identifier)}`),console.log(` Status: ${J.status==="public"?W.green(J.status):W.yellow(J.status)}`),console.log(` URL: ${J.doi_url}`)}catch(J){if(J instanceof b){if($.fail(J.message),J.statusCode===400)console.log(W.dim(" DOI update is only supported for EZID-managed DOIs"))}else $.fail("Failed to update DOI"),console.log(W.dim(` ${w0(J)}`))}});u9.command("enrich").description("Enrich DOI metadata with ORCIDs, descriptions, funding, and more").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("--no-llm","Skip LLM-based enrichment from README").option("--sandbox","Use sandbox DOI").option(j0,T0).option(b0,y0).action(async(D,F)=>{if(!f0())return;let $=O("Fetching dataset and existing enrichment...").start(),J;try{J=await uD(D),$.succeed(`Dataset: ${J.name}`)}catch(E){if(E instanceof b)$.fail(E.message);else $.fail("Failed to fetch dataset");return}let Q,Y=!1;try{Q=await v9(D)}catch(E){if(E instanceof b&&E.statusCode===404);else Y=!0,console.log(W.yellow(` Warning: Could not fetch DOI info: ${w0(E)}`))}if(Q?.concept_doi)console.log(` DOI: ${W.cyan(Q.concept_doi)}`);let B={version:"2.0"};if(J.github_repo){let E=O("Reading existing metadata...").start(),Z=await mg(J.github_repo,".nemar/metadata.json");if(Z)try{let L=JSON.parse(Z);if(L&&typeof L==="object"&&L.version==="2.0")B=L,E.succeed(`Loaded existing metadata (stage: ${L.pipeline_stage||"unknown"})`);else E.warn("Existing metadata has unsupported version, starting fresh")}catch(L){E.warn(`Could not parse existing metadata (${L instanceof Error?L.message:String(L)}), starting fresh`)}else E.info("No existing .nemar/metadata.json found, starting fresh")}if(F.llm!==!1&&J.github_repo){console.log(),console.log(W.cyan("--- Running LLM enrichment pipeline (CI workflow) ---"));let E=O("Triggering llm-enrichment workflow...").start();try{let{spawn:Z}=awaitPromise.resolve(globalThis.Bun),L=J.github_repo,A=Z({cmd:["gh","workflow","run","llm-enrichment.yml","--repo",L,"--ref","main"],stdout:"pipe",stderr:"pipe"}),M=await new Response(A.stderr).text();if(await A.exited!==0)throw Error(`Failed to trigger workflow: ${M.trim()}`);E.text="Waiting for workflow to register...",await new Promise((y)=>setTimeout(y,3000)),E.text="Polling workflow status...";let w=60,P="",C=0;for(let y=0;y<w;y++){let d=Z({cmd:["gh","run","list","--repo",L,"--workflow","llm-enrichment.yml","-L","1","--json","databaseId,status,conclusion"],stdout:"pipe",stderr:"pipe"}),W0=await new Response(d.stdout).text(),F0=await new Response(d.stderr).text();if(await d.exited!==0){if(C++,C>=3){E.warn(`gh CLI error: ${F0.trim()}`);break}await new Promise((e)=>setTimeout(e,5000));continue}try{let e=JSON.parse(W0.trim());if(C=0,e.length>0){let N0=e[0];if(N0.status==="completed"){P=N0.conclusion||"unknown";break}E.text=`Workflow ${N0.status}... (${y*5}s)`}}catch(e){if(C++,C>=3){E.warn(`Unable to parse workflow status: ${e instanceof Error?e.message:String(e)} (raw: ${W0.trim().slice(0,200)})`);break}}await new Promise((e)=>setTimeout(e,5000))}let T=!1;if(!P)E.warn("Workflow timed out after 5 minutes (may still be running)");else if(P==="success"){E.succeed("LLM enrichment workflow completed successfully");let y=await mg(L,".nemar/metadata.json");if(y)try{let d=JSON.parse(y);if(d&&typeof d==="object"&&d.version==="2.0"){Object.assign(B,d),T=!0;let W0=d.pipeline_stage||"unknown";if(console.log(W.dim(` Pipeline stage: ${W0}`)),B.authors){let F0=Object.keys(B.authors).length;console.log(W.dim(` Authors: ${F0}`))}}}catch(d){console.log(W.yellow(` Warning: Could not parse updated metadata: ${d instanceof Error?d.message:String(d)}`)),console.log(W.dim(" Using pre-workflow enrichment data"))}else console.log(W.yellow(" Warning: Could not fetch updated metadata after successful workflow.")),console.log(W.dim(" Author data below may be from a previous run."))}else E.fail(`LLM enrichment workflow failed (conclusion: ${P})`);if(!T)console.log(W.yellow(" ORCID discovery did not complete. Authors below may be from previous metadata."))}catch(Z){E.fail("LLM enrichment pipeline failed"),console.log(W.dim(` ${w0(Z)}`)),console.log(W.yellow(" ORCID discovery did not run. You will need to enter ORCIDs manually."))}}console.log(),console.log(W.cyan("--- Author ORCIDs ---"));let X=B.authors||{},G=Object.keys(X);if(G.length>0){let E=G.filter((L)=>X[L]?.orcid),Z=G.filter((L)=>!X[L]?.orcid);console.log(W.dim(` Discovered ${G.length} authors from pipeline:`));for(let L of E)console.log(W.green(` [x] ${L}: ${X[L]?.orcid}`));for(let L of Z)console.log(W.yellow(` [ ] ${L}: no ORCID found`));if(Z.length>0)console.log(W.dim(` ${Z.length} author(s) missing ORCIDs.`))}let{updateAuthors:H}=await D0.prompt([{type:"confirm",name:"updateAuthors",message:G.length>0?"Add or correct author ORCIDs?":"Add author ORCIDs manually?",default:!1}]);if(H){let E={},Z=!0;while(Z){let{authorName:L}=await D0.prompt([{type:"input",name:"authorName",message:'Author name (as in BIDS, e.g., "Shirazi, Yahya"):'}]);if(!L)break;let A=X[L];if(A?.orcid)console.log(W.dim(` Current ORCID: ${A.orcid}`));let{orcid:M}=await D0.prompt([{type:"input",name:"orcid",message:`ORCID for "${L}" (Enter to ${A?.orcid?"keep current":"skip"}):`,validate:(C)=>{if(!C)return!0;return rJ.test(C)||"Invalid ORCID format (XXXX-XXXX-XXXX-XXXX)"}}]),N={};if(M)N.orcid=M;let{affiliation:w}=await D0.prompt([{type:"input",name:"affiliation",message:`Affiliation for "${L}" (optional):`}]);if(w)N.affiliations=[{name:w}];if(N.orcid||N.affiliations)E[L]=N;let{more:P}=await D0.prompt([{type:"confirm",name:"more",message:"Add another author?",default:!0}]);Z=P}if(Object.keys(E).length>0){let L={...B.authors||{}};for(let[A,M]of Object.entries(E)){let N=L[A]||{};L[A]={...N,...M,orcid:M.orcid||N.orcid}}B.authors=L}}console.log(),console.log(W.cyan("--- Dataset stats ---"));let q=O("Computing dataset sizes and formats...").start();try{let E=await rf(D),Z=XD(E.total_size);B.sizes=[`${Z} (${E.file_count} files)`],B.formats=E.extensions,q.succeed(`Sizes: ${Z} (${E.file_count} files), Formats: ${E.extensions.join(", ")}`)}catch(E){q.warn("Could not compute dataset stats"),console.log(W.dim(` ${w0(E)}`))}console.log(),console.log(W.cyan("--- Review ---")),console.log(JSON.stringify(B,null,2)),console.log();let K=await k0("Commit to repo and refresh DOI?",F,!0);if(K!=="confirmed"){console.log(W.dim(K==="declined"?"Skipped":"Cancelled"));return}let V=O("Saving enrichment...").start();try{let E=await sf(D,B);if(V.succeed(E.message),E.bidsignore_updated)console.log(W.dim(" .bidsignore updated to include .nemar/"));if(!Q&&Y)try{Q=await v9(D)}catch(Z){if(process.env.DEBUG)console.error("[debug] DOI info re-fetch:",Z)}if(Q?.ezid_identifier){let Z=O("Refreshing DOI metadata...").start();try{await PW(D,{refresh_metadata:!0}),Z.succeed("DOI metadata refreshed")}catch(L){Z.warn("Could not refresh DOI metadata"),console.log(W.dim(` ${w0(L)}`))}}else if(Y)console.log(W.yellow(" DOI refresh skipped: could not verify DOI exists. Run 'nemar admin doi update --refresh' manually."))}catch(E){if(E instanceof b)V.fail(E.message);else V.fail("Failed to save enrichment"),console.log(W.dim(` ${w0(E)}`))}});r0.addCommand(u9);var zQ=new i0("publish").description("Publication workflow management");zQ.command("list").description("List publication requests").option("-s, --status <status>","Filter by status (requested, approving, published, denied)").addHelpText("after",`
210
+ `));let Y=await k0(`Sync templates on all ${Q.length} datasets?`,F);if(Y!=="confirmed"){console.log(W.dim(Y==="declined"?"Skipped":"Cancelled"));return}let B=0,X=0,G=0;for(let H of Q){let q=O(`Syncing ${H.dataset_id}...`).start();try{let K=await TW(H.dataset_id),V=K.changed.length+K.added.length;if(K.errors.length>0)q.warn(`${H.dataset_id}: ${V} updated, ${K.errors.length} error(s)`),G++;else if(V===0)q.succeed(`${H.dataset_id}: up to date`),B++;else{let E=[];if(K.added.length>0)E.push(`+${K.added.length} added`);if(K.changed.length>0)E.push(`~${K.changed.length} updated`);q.succeed(`${H.dataset_id}: ${E.join(", ")}`),X++}}catch(K){let V=K instanceof h?K.message:String(K);q.fail(`${H.dataset_id}: ${V}`),G++}}console.log(),console.log(W.cyan(`Done: ${B} up-to-date, ${X} updated, ${G} with errors`));return}if(!D){console.error(W.red("Error: dataset-id is required (or use --all)"));return}let $=O(`Syncing CI templates for ${D}...`).start();try{let J=await TW(D),Q=J.changed.length+J.added.length;if(J.errors.length>0)$.warn(`${D}: ${J.errors.length} error(s)`);else if(Q===0)$.succeed(`${D}: already up to date`);else $.succeed(`${D}: synced`);if(console.log(),console.log(` ${W.dim("Checked:")} ${J.checked.join(", ")}`),J.added.length>0)console.log(` ${W.green("Added:")} ${J.added.join(", ")}`);if(J.changed.length>0)console.log(` ${W.yellow("Updated:")} ${J.changed.join(", ")}`);if(!J.committed&&Q>0&&J.errors.length===0)console.log(` ${W.yellow("Note:")} listed changes were not committed`);if(J.list_failed)console.log(` ${W.red("Warning:")} workflow directory listing failed; presence is unknown`);if(J.errors.length>0){console.log(` ${W.red("Errors:")}`);for(let Y of J.errors)console.log(` - ${Y}`)}console.log()}catch(J){QD(J,$,"Failed to sync CI templates",{404:"Dataset not found"})}});r0.addCommand(KQ);var u9=new i0("doi").description("DOI management");u9.command("create").description("Create concept DOI for a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("--title <title>","DOI title (defaults to dataset name)").option("--description <desc>","DOI description").option("--provider <provider>","DOI provider: ezid (default) or zenodo","ezid").option("--sandbox","Use sandbox/test DOI").option(j0,T0).option(b0,y0).action(async(D,F)=>{if(!f0())return;let $=O("Fetching dataset info...").start(),J;try{J=await uD(D),$.succeed(`Found dataset: ${J.name}`)}catch(G){if(G instanceof h){if($.fail(G.message),G.statusCode===404)console.log(W.dim(" Dataset not found"))}else $.fail("Failed to fetch dataset");return}try{let G=await v9(D);if(G.concept_doi){if(console.log(W.yellow(`
211
+ Dataset already has a concept DOI:`)),console.log(` Concept DOI: ${W.cyan(G.concept_doi)}`),G.zenodo_concept_url)console.log(` Zenodo URL: ${G.zenodo_concept_url}`);return}}catch(G){if(process.env.DEBUG)console.error("[debug] DOI info fetch:",G)}if(console.log(),console.log(W.cyan("Dataset Information:")),console.log(` ID: ${J.dataset_id}`),console.log(` Name: ${J.name}`),J.github_repo)console.log(` GitHub: ${J.github_repo}`);if(F.sandbox)console.log(` Mode: ${W.yellow("SANDBOX (test DOI)")}`);console.log();let Q=F.provider==="zenodo"?"zenodo":"ezid";if(F.sandbox){if(console.log(W.yellow("\u2501".repeat(60))),console.log(W.yellow.bold(" SANDBOX MODE ENABLED")),console.log(W.yellow("\u2501".repeat(60))),Q==="zenodo")console.log(W.yellow(" \u2022 Using Zenodo sandbox (sandbox.zenodo.org)"));else console.log(W.yellow(" \u2022 Using EZID test shoulder (doi:10.5072/FK2)")),console.log(W.yellow(" \u2022 Test DOIs auto-delete after 2 weeks"));console.log(W.yellow(" \u2022 DOI will NOT be indexed by DataCite")),console.log(W.yellow(" \u2022 DOI will NOT resolve in production")),console.log(W.yellow(" \u2022 Use this for testing workflows only")),console.log(W.yellow("\u2501".repeat(60))),console.log()}console.log(W.red("WARNING: DOIs are PERMANENT and cannot be deleted!")),console.log(W.dim("The DOI will be pre-reserved but not published until the first version release.")),console.log(` Provider: ${W.cyan(Q.toUpperCase())}`),console.log();let Y=F.sandbox?`Create TEST concept DOI via ${Q.toUpperCase()} SANDBOX?`:`Create PERMANENT concept DOI via ${Q.toUpperCase()} PRODUCTION?`,B=await k0(Y,F);if(B!=="confirmed"){console.log(W.dim(B==="declined"?"Skipped":"Cancelled"));return}let X=O(`Creating concept DOI via ${Q.toUpperCase()}...`).start();try{let G=await bf(D,{title:F.title,description:F.description,sandbox:F.sandbox,provider:Q});X.succeed("Concept DOI created successfully");let H=O("Applying branch protection...").start();try{let q=await JQ(D);if(q.warnings&&q.warnings.length>0){H.warn("Branch protection applied with warnings");for(let K of q.warnings)console.log(W.yellow(` Warning: ${K}`))}else H.succeed("Branch protection applied")}catch(q){if(H.warn("Could not apply branch protection"),q instanceof h){if(console.log(W.dim(` ${q.message}`)),q.statusCode===403)console.log(W.dim(" Check admin credentials and permissions"))}else console.log(W.dim(` ${q instanceof Error?q.message:"Unknown error"}`));console.log(W.dim(" Manual setup: Go to GitHub repo Settings > Branches > Add rule"))}if(console.log(),console.log(W.green("DOI Information:")),console.log(` Concept DOI: ${W.cyan(G.concept_doi)}`),console.log(` Provider: ${G.provider.toUpperCase()}`),G.provider==="ezid")console.log(` DOI URL: ${G.doi_url}`),console.log(` EZID ID: ${G.ezid_identifier}`);else console.log(` Zenodo URL: ${G.zenodo_url}`);if(G.metadata_warning)console.log(W.yellow(` Warning: ${G.metadata_warning}`));if(console.log(),console.log(W.yellow("Next steps:")),console.log(" 1. Update dataset_description.json with DatasetDOI field"),console.log(" 2. Create a PR and merge it to trigger version DOI publication"),console.log(),F.sandbox)console.log(W.dim("Note: This is a sandbox DOI and will not resolve in production."))}catch(G){if(G instanceof h){if(X.fail(G.message),G.statusCode===403)console.log(W.dim(" This command requires admin privileges"))}else X.fail("Failed to create concept DOI"),console.log(W.dim(` ${w0(G)}`))}});u9.command("info").description("Get DOI info for a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").action(async(D)=>{if(!f0())return;let F=O("Fetching DOI info...").start();try{let $=await v9(D);if(F.stop(),console.log(),console.log(W.cyan(`DOI Information for ${D}:`)),console.log(` Dataset Name: ${$.name}`),console.log(),$.concept_doi){if(console.log(W.green("Concept DOI:")),console.log(` DOI: ${$.concept_doi}`),console.log(` URL: https://doi.org/${$.concept_doi}`),console.log(` Provider: ${($.doi_provider||"zenodo").toUpperCase()}`),$.doi_provider==="ezid"){if($.ezid_identifier)console.log(` EZID ID: ${$.ezid_identifier}`);if($.ezid_status){let J=$.ezid_status==="public"?W.green:W.yellow;console.log(` Status: ${J($.ezid_status)}`)}}if($.zenodo_concept_url){if(console.log(` Zenodo: ${$.zenodo_concept_url}`),$.zenodo_concept_url.includes("sandbox.zenodo.org"))console.log(),console.log(W.yellow("Mode: SANDBOX (test DOI)")),console.log(W.yellow(" This DOI is not indexed by DataCite and will not resolve in production"))}}else console.log(W.yellow("No concept DOI created yet")),console.log(W.dim(" Use 'nemar admin doi create' to create one"));if(console.log(),$.latest_version_doi){if(console.log(W.green("Latest Version DOI:")),console.log(` DOI: ${$.latest_version_doi}`),console.log(` URL: https://doi.org/${$.latest_version_doi}`),$.zenodo_latest_version_url)console.log(` Zenodo: ${$.zenodo_latest_version_url}`)}else if($.concept_doi)console.log(W.yellow("No version DOI published yet")),console.log(W.dim(" Version DOIs are created automatically on PR merge"))}catch($){if($ instanceof h){if(F.fail($.message),$.statusCode===404)console.log(W.dim(" Dataset not found"));else if($.statusCode===403)console.log(W.dim(" This command requires admin privileges"))}else F.fail("Failed to fetch DOI info")}});u9.command("update").description("Update EZID DOI metadata or status").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("--make-public","Transition DOI from reserved to public (permanent)").option("--refresh","Refresh metadata from dataset_description.json and .nemar/metadata.json").option(j0,T0).option(b0,y0).action(async(D,F)=>{if(!f0())return;if(!F.makePublic&&!F.refresh){console.log(W.yellow("No action specified. Use --make-public and/or --refresh."));return}if(F.makePublic){console.log(W.red("WARNING: Making a DOI public is PERMANENT!")),console.log(W.dim(" The DOI will be findable in DataCite and cannot be reverted.")),console.log();let J=await k0(`Make DOI for ${D} PUBLIC and permanent?`,F);if(J!=="confirmed"){console.log(W.dim(J==="declined"?"Skipped":"Cancelled"));return}}let $=O("Updating DOI...").start();try{let J=await PW(D,{status:F.makePublic?"public":void 0,refresh_metadata:F.refresh});$.succeed("DOI updated successfully"),console.log(),console.log(` EZID ID: ${W.cyan(J.ezid_identifier)}`),console.log(` Status: ${J.status==="public"?W.green(J.status):W.yellow(J.status)}`),console.log(` URL: ${J.doi_url}`)}catch(J){if(J instanceof h){if($.fail(J.message),J.statusCode===400)console.log(W.dim(" DOI update is only supported for EZID-managed DOIs"))}else $.fail("Failed to update DOI"),console.log(W.dim(` ${w0(J)}`))}});u9.command("enrich").description("Enrich DOI metadata with ORCIDs, descriptions, funding, and more").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("--no-llm","Skip LLM-based enrichment from README").option("--sandbox","Use sandbox DOI").option(j0,T0).option(b0,y0).action(async(D,F)=>{if(!f0())return;let $=O("Fetching dataset and existing enrichment...").start(),J;try{J=await uD(D),$.succeed(`Dataset: ${J.name}`)}catch(E){if(E instanceof h)$.fail(E.message);else $.fail("Failed to fetch dataset");return}let Q,Y=!1;try{Q=await v9(D)}catch(E){if(E instanceof h&&E.statusCode===404);else Y=!0,console.log(W.yellow(` Warning: Could not fetch DOI info: ${w0(E)}`))}if(Q?.concept_doi)console.log(` DOI: ${W.cyan(Q.concept_doi)}`);let B={version:"2.0"};if(J.github_repo){let E=O("Reading existing metadata...").start(),Z=await mg(J.github_repo,".nemar/metadata.json");if(Z)try{let L=JSON.parse(Z);if(L&&typeof L==="object"&&L.version==="2.0")B=L,E.succeed(`Loaded existing metadata (stage: ${L.pipeline_stage||"unknown"})`);else E.warn("Existing metadata has unsupported version, starting fresh")}catch(L){E.warn(`Could not parse existing metadata (${L instanceof Error?L.message:String(L)}), starting fresh`)}else E.info("No existing .nemar/metadata.json found, starting fresh")}if(F.llm!==!1&&J.github_repo){console.log(),console.log(W.cyan("--- Running LLM enrichment pipeline (CI workflow) ---"));let E=O("Triggering llm-enrichment workflow...").start();try{let{spawn:Z}=awaitPromise.resolve(globalThis.Bun),L=J.github_repo,M=Z({cmd:["gh","workflow","run","llm-enrichment.yml","--repo",L,"--ref","main"],stdout:"pipe",stderr:"pipe"}),A=await new Response(M.stderr).text();if(await M.exited!==0)throw Error(`Failed to trigger workflow: ${A.trim()}`);E.text="Waiting for workflow to register...",await new Promise((y)=>setTimeout(y,3000)),E.text="Polling workflow status...";let w=60,P="",C=0;for(let y=0;y<w;y++){let d=Z({cmd:["gh","run","list","--repo",L,"--workflow","llm-enrichment.yml","-L","1","--json","databaseId,status,conclusion"],stdout:"pipe",stderr:"pipe"}),W0=await new Response(d.stdout).text(),F0=await new Response(d.stderr).text();if(await d.exited!==0){if(C++,C>=3){E.warn(`gh CLI error: ${F0.trim()}`);break}await new Promise((e)=>setTimeout(e,5000));continue}try{let e=JSON.parse(W0.trim());if(C=0,e.length>0){let N0=e[0];if(N0.status==="completed"){P=N0.conclusion||"unknown";break}E.text=`Workflow ${N0.status}... (${y*5}s)`}}catch(e){if(C++,C>=3){E.warn(`Unable to parse workflow status: ${e instanceof Error?e.message:String(e)} (raw: ${W0.trim().slice(0,200)})`);break}}await new Promise((e)=>setTimeout(e,5000))}let T=!1;if(!P)E.warn("Workflow timed out after 5 minutes (may still be running)");else if(P==="success"){E.succeed("LLM enrichment workflow completed successfully");let y=await mg(L,".nemar/metadata.json");if(y)try{let d=JSON.parse(y);if(d&&typeof d==="object"&&d.version==="2.0"){Object.assign(B,d),T=!0;let W0=d.pipeline_stage||"unknown";if(console.log(W.dim(` Pipeline stage: ${W0}`)),B.authors){let F0=Object.keys(B.authors).length;console.log(W.dim(` Authors: ${F0}`))}}}catch(d){console.log(W.yellow(` Warning: Could not parse updated metadata: ${d instanceof Error?d.message:String(d)}`)),console.log(W.dim(" Using pre-workflow enrichment data"))}else console.log(W.yellow(" Warning: Could not fetch updated metadata after successful workflow.")),console.log(W.dim(" Author data below may be from a previous run."))}else E.fail(`LLM enrichment workflow failed (conclusion: ${P})`);if(!T)console.log(W.yellow(" ORCID discovery did not complete. Authors below may be from previous metadata."))}catch(Z){E.fail("LLM enrichment pipeline failed"),console.log(W.dim(` ${w0(Z)}`)),console.log(W.yellow(" ORCID discovery did not run. You will need to enter ORCIDs manually."))}}console.log(),console.log(W.cyan("--- Author ORCIDs ---"));let X=B.authors||{},G=Object.keys(X);if(G.length>0){let E=G.filter((L)=>X[L]?.orcid),Z=G.filter((L)=>!X[L]?.orcid);console.log(W.dim(` Discovered ${G.length} authors from pipeline:`));for(let L of E)console.log(W.green(` [x] ${L}: ${X[L]?.orcid}`));for(let L of Z)console.log(W.yellow(` [ ] ${L}: no ORCID found`));if(Z.length>0)console.log(W.dim(` ${Z.length} author(s) missing ORCIDs.`))}let{updateAuthors:H}=await D0.prompt([{type:"confirm",name:"updateAuthors",message:G.length>0?"Add or correct author ORCIDs?":"Add author ORCIDs manually?",default:!1}]);if(H){let E={},Z=!0;while(Z){let{authorName:L}=await D0.prompt([{type:"input",name:"authorName",message:'Author name (as in BIDS, e.g., "Shirazi, Yahya"):'}]);if(!L)break;let M=X[L];if(M?.orcid)console.log(W.dim(` Current ORCID: ${M.orcid}`));let{orcid:A}=await D0.prompt([{type:"input",name:"orcid",message:`ORCID for "${L}" (Enter to ${M?.orcid?"keep current":"skip"}):`,validate:(C)=>{if(!C)return!0;return rJ.test(C)||"Invalid ORCID format (XXXX-XXXX-XXXX-XXXX)"}}]),N={};if(A)N.orcid=A;let{affiliation:w}=await D0.prompt([{type:"input",name:"affiliation",message:`Affiliation for "${L}" (optional):`}]);if(w)N.affiliations=[{name:w}];if(N.orcid||N.affiliations)E[L]=N;let{more:P}=await D0.prompt([{type:"confirm",name:"more",message:"Add another author?",default:!0}]);Z=P}if(Object.keys(E).length>0){let L={...B.authors||{}};for(let[M,A]of Object.entries(E)){let N=L[M]||{};L[M]={...N,...A,orcid:A.orcid||N.orcid}}B.authors=L}}console.log(),console.log(W.cyan("--- Dataset stats ---"));let q=O("Computing dataset sizes and formats...").start();try{let E=await rf(D),Z=XD(E.total_size);B.sizes=[`${Z} (${E.file_count} files)`],B.formats=E.extensions,q.succeed(`Sizes: ${Z} (${E.file_count} files), Formats: ${E.extensions.join(", ")}`)}catch(E){q.warn("Could not compute dataset stats"),console.log(W.dim(` ${w0(E)}`))}console.log(),console.log(W.cyan("--- Review ---")),console.log(JSON.stringify(B,null,2)),console.log();let K=await k0("Commit to repo and refresh DOI?",F,!0);if(K!=="confirmed"){console.log(W.dim(K==="declined"?"Skipped":"Cancelled"));return}let V=O("Saving enrichment...").start();try{let E=await sf(D,B);if(V.succeed(E.message),E.bidsignore_updated)console.log(W.dim(" .bidsignore updated to include .nemar/"));if(!Q&&Y)try{Q=await v9(D)}catch(Z){if(process.env.DEBUG)console.error("[debug] DOI info re-fetch:",Z)}if(Q?.ezid_identifier){let Z=O("Refreshing DOI metadata...").start();try{await PW(D,{refresh_metadata:!0}),Z.succeed("DOI metadata refreshed")}catch(L){Z.warn("Could not refresh DOI metadata"),console.log(W.dim(` ${w0(L)}`))}}else if(Y)console.log(W.yellow(" DOI refresh skipped: could not verify DOI exists. Run 'nemar admin doi update --refresh' manually."))}catch(E){if(E instanceof h)V.fail(E.message);else V.fail("Failed to save enrichment"),console.log(W.dim(` ${w0(E)}`))}});r0.addCommand(u9);var zQ=new i0("publish").description("Publication workflow management");zQ.command("list").description("List publication requests").option("-s, --status <status>","Filter by status (requested, approving, published, denied)").addHelpText("after",`
212
212
  Description:
213
213
  List all publication requests from users, with optional filtering by status.
214
214
  Shows dataset ID, status, requesting user, and current progress.
@@ -287,11 +287,11 @@ After Approval:
287
287
  - Tags are protected (prevents version manipulation)
288
288
  - Data is protected by S3 Object Lock`).action(async(D,F)=>{if(!f0())return;let $=F.resume?`Resume publication of ${D}`:`Approve and publish ${D}`;if(console.log(W.cyan(`
289
289
  ${$}
290
- `)),console.log("This will run the following 15-step orchestrator:"),console.log(" 1. Check CI 9. Create version tag"),console.log(" 2. Enrichment check 10. Create GitHub release"),console.log(" 3. Make repo public 11. Upload to Zenodo"),console.log(" 4. S3 public read 12. Publish DOI (irreversible)"),console.log(" 5. Tag protection 13. S3 Object Lock"),console.log(F.sandbox?" 6. Create DOI (SANDBOX) 14. Generate archive":" 6. Create DOI 14. Generate archive"),console.log(" 7. Update metadata 15. Notify user"),console.log(" 8. Update README"),console.log(),F.sandbox)console.log(W.yellow("\u2501".repeat(60))),console.log(W.yellow.bold(" SANDBOX MODE ENABLED")),console.log(W.yellow("\u2501".repeat(60))),console.log(W.yellow(" \u2022 DOI will be created in sandbox mode (EZID test shoulder)")),console.log(W.yellow(" \u2022 DOI will NOT be indexed by DataCite")),console.log(W.yellow(" \u2022 DOI will NOT resolve in production")),console.log(W.yellow(" \u2022 Use this for testing workflows only")),console.log(W.yellow("\u2501".repeat(60))),console.log();let J=await k0(`${$}?`,F);if(J!=="confirmed"){console.log(W.dim(J==="declined"?"Skipped":"Cancelled"));return}let Q="Running publication workflow (this may take a few minutes)...",Y=O(Q).start(),B=Q;function X(G){let H=G.step.replace(/_/g," "),q=`Step ${G.stepIndex}/${G.stepTotal}: ${H}`;if(G.step==="s3_lock"&&G.s3LockLocked!==void 0&&G.s3LockTotal!==void 0&&G.s3LockTotal>0){let K=(G.s3LockLocked/G.s3LockTotal*100).toFixed(1),V=G.s3LockResumed?" (resumed)":"";return`${q} | Locking S3 objects: ${G.s3LockLocked}/${G.s3LockTotal} (${K}%)${V}`}if(G.step==="s3_lock"&&G.s3LockLocked!==void 0){let K=G.s3LockResumed?" (resumed)":"";return`${q} | Locking S3 objects: ${G.s3LockLocked}${K}`}return q}try{let G=await BQ(D,!!F.resume,!!F.sandbox,!!F.skipCiCheck,(H)=>{Y.stop();let q=H.step?H.step.replace(/_/g," "):"step";console.log(W.yellow(` [!] ${q} failed: ${H.error}`)),console.log(W.dim(` Retrying in ${Math.round(H.delayMs/1000)}s (attempt ${H.attempt+1}/${H.maxAttempts})...`)),Y.start(B)},(H)=>{B=X(H),Y.text=B});if(Y.succeed(G.message),G.step_results&&G.step_results.length>0){console.log();let H=G.step_results,q=H.length;H.forEach((K,V)=>{let E=`[${String(V+1).padStart(2," ")}/${q}]`,Z=K.step.replace(/_/g," ");if(K.status==="completed"){let L=(K.duration_ms/1000).toFixed(1),A=K.attempts>1?` (attempt ${K.attempts})`:"";console.log(` ${W.green("[x]")} ${W.dim(E)} ${Z} ${W.dim(`(${L}s${A})`)}`)}else if(K.status==="failed")console.log(` ${W.red("[!]")} ${W.dim(E)} ${Z}${K.error?`: ${W.red(K.error)}`:""}`);else console.log(` ${W.dim("[-]")} ${W.dim(E)} ${W.dim(Z)} ${W.dim("(skipped)")}`)}),console.log()}else if(G.steps_completed){console.log();for(let H of G.steps_completed)console.log(` ${W.green("[x]")} ${H.replace(/_/g," ")}`);console.log()}}catch(G){QD(G,Y,"Failed to approve publication",{422:"Fix the CI issues and retry with --resume"});let H=G.stepResults;if(H&&H.length>0){console.log(),console.log(W.dim("Step timeline (last attempt):"));let q=H.length;H.forEach((K,V)=>{let E=`[${String(V+1).padStart(2," ")}/${q}]`,Z=K.step.replace(/_/g," "),L=(K.duration_ms/1000).toFixed(1),A=K.attempts>1?` (attempt ${K.attempts})`:"";if(K.status==="completed")console.log(` ${W.green("[x]")} ${W.dim(E)} ${Z} ${W.dim(`(${L}s${A})`)}`);else if(K.status==="failed")console.log(` ${W.red("[!]")} ${W.dim(E)} ${Z}${K.error?`: ${W.red(K.error)}`:""}`);else console.log(` ${W.dim("[-]")} ${W.dim(E)} ${W.dim(Z)} ${W.dim("(skipped)")}`)}),console.log()}}});r0.addCommand(zQ);r0.command("revert").description("Revert a dataset to a previous version (creates PR for review)").argument("<dataset-id>","Dataset ID (e.g., nm000104)").argument("[version]","Target version to revert to (e.g., 1.0.0)").option("--list","List available versions without reverting").option("--force","Direct push to main without PR (emergency only)").option("--message <msg>","Custom revert commit message").option("--dir <path>","Use existing local clone instead of cloning fresh").option(j0,T0).option(b0,y0).action(async(D,F,$)=>{if(!f0())return;let J=await TF();if(!J.allPassed){console.log(W.red("Error: Missing prerequisites"));for(let C of J.errors)console.log(W.dim(` - ${C}`));return}let Q,Y=!0;if($.dir){if(!pg($.dir)){console.log(W.red(`Error: Directory not found: ${$.dir}`));return}Q=$.dir,Y=!1}else Q=bE0(process.cwd(),`${D}-revert-${Date.now()}`);let B=O("Fetching dataset info...").start(),X;try{X=await uD(D),B.succeed(`Found dataset: ${X.name}`)}catch(C){if(C instanceof b)if(B.fail(C.message),C.statusCode===404||C.statusCode===400)console.log(W.red(`Error: Dataset ${D} not found`)),console.log(W.dim(` ${C.message}`));else console.log(W.red(`Error: ${C.message}`));else{B.fail("Failed to fetch dataset");let T=C instanceof Error?C.message:String(C);console.log(W.red(`Error: Could not load dataset ${D}: ${T}`))}return}if(!X.github_repo){console.log(W.red("Error: Dataset has no GitHub repository"));return}if(Y){let C=O(`Cloning ${D}...`).start(),T=`https://github.com/${X.github_repo}.git`,y=await s1(T,Q);if(!y.success){C.fail(`Clone failed: ${y.error}`);return}C.succeed(`Cloned to ${Q}`)}let G=await pW(Q);if(G.length===0){console.log(W.yellow("No versions found for this dataset")),console.log(W.dim(" Dataset may not have any tagged releases yet"));return}if($.list){console.log(`
290
+ `)),console.log("This will run the following 15-step orchestrator:"),console.log(" 1. Check CI 9. Create version tag"),console.log(" 2. Enrichment check 10. Create GitHub release"),console.log(" 3. Make repo public 11. Upload to Zenodo"),console.log(" 4. S3 public read 12. Publish DOI (irreversible)"),console.log(" 5. Tag protection 13. S3 Object Lock"),console.log(F.sandbox?" 6. Create DOI (SANDBOX) 14. Generate archive":" 6. Create DOI 14. Generate archive"),console.log(" 7. Update metadata 15. Notify user"),console.log(" 8. Update README"),console.log(),F.sandbox)console.log(W.yellow("\u2501".repeat(60))),console.log(W.yellow.bold(" SANDBOX MODE ENABLED")),console.log(W.yellow("\u2501".repeat(60))),console.log(W.yellow(" \u2022 DOI will be created in sandbox mode (EZID test shoulder)")),console.log(W.yellow(" \u2022 DOI will NOT be indexed by DataCite")),console.log(W.yellow(" \u2022 DOI will NOT resolve in production")),console.log(W.yellow(" \u2022 Use this for testing workflows only")),console.log(W.yellow("\u2501".repeat(60))),console.log();let J=await k0(`${$}?`,F);if(J!=="confirmed"){console.log(W.dim(J==="declined"?"Skipped":"Cancelled"));return}let Q="Running publication workflow (this may take a few minutes)...",Y=O(Q).start(),B=Q;function X(G){let H=G.step.replace(/_/g," "),q=`Step ${G.stepIndex}/${G.stepTotal}: ${H}`;if(G.step==="s3_lock"&&G.s3LockLocked!==void 0&&G.s3LockTotal!==void 0&&G.s3LockTotal>0){let K=(G.s3LockLocked/G.s3LockTotal*100).toFixed(1),V=G.s3LockResumed?" (resumed)":"";return`${q} | Locking S3 objects: ${G.s3LockLocked}/${G.s3LockTotal} (${K}%)${V}`}if(G.step==="s3_lock"&&G.s3LockLocked!==void 0){let K=G.s3LockResumed?" (resumed)":"";return`${q} | Locking S3 objects: ${G.s3LockLocked}${K}`}return q}try{let G=await BQ(D,!!F.resume,!!F.sandbox,!!F.skipCiCheck,(H)=>{Y.stop();let q=H.step?H.step.replace(/_/g," "):"step";console.log(W.yellow(` [!] ${q} failed: ${H.error}`)),console.log(W.dim(` Retrying in ${Math.round(H.delayMs/1000)}s (attempt ${H.attempt+1}/${H.maxAttempts})...`)),Y.start(B)},(H)=>{B=X(H),Y.text=B});if(Y.succeed(G.message),G.step_results&&G.step_results.length>0){console.log();let H=G.step_results,q=H.length;H.forEach((K,V)=>{let E=`[${String(V+1).padStart(2," ")}/${q}]`,Z=K.step.replace(/_/g," ");if(K.status==="completed"){let L=(K.duration_ms/1000).toFixed(1),M=K.attempts>1?` (attempt ${K.attempts})`:"";console.log(` ${W.green("[x]")} ${W.dim(E)} ${Z} ${W.dim(`(${L}s${M})`)}`)}else if(K.status==="failed")console.log(` ${W.red("[!]")} ${W.dim(E)} ${Z}${K.error?`: ${W.red(K.error)}`:""}`);else console.log(` ${W.dim("[-]")} ${W.dim(E)} ${W.dim(Z)} ${W.dim("(skipped)")}`)}),console.log()}else if(G.steps_completed){console.log();for(let H of G.steps_completed)console.log(` ${W.green("[x]")} ${H.replace(/_/g," ")}`);console.log()}}catch(G){QD(G,Y,"Failed to approve publication",{422:"Fix the CI issues and retry with --resume"});let H=G.stepResults;if(H&&H.length>0){console.log(),console.log(W.dim("Step timeline (last attempt):"));let q=H.length;H.forEach((K,V)=>{let E=`[${String(V+1).padStart(2," ")}/${q}]`,Z=K.step.replace(/_/g," "),L=(K.duration_ms/1000).toFixed(1),M=K.attempts>1?` (attempt ${K.attempts})`:"";if(K.status==="completed")console.log(` ${W.green("[x]")} ${W.dim(E)} ${Z} ${W.dim(`(${L}s${M})`)}`);else if(K.status==="failed")console.log(` ${W.red("[!]")} ${W.dim(E)} ${Z}${K.error?`: ${W.red(K.error)}`:""}`);else console.log(` ${W.dim("[-]")} ${W.dim(E)} ${W.dim(Z)} ${W.dim("(skipped)")}`)}),console.log()}}});r0.addCommand(zQ);r0.command("revert").description("Revert a dataset to a previous version (creates PR for review)").argument("<dataset-id>","Dataset ID (e.g., nm000104)").argument("[version]","Target version to revert to (e.g., 1.0.0)").option("--list","List available versions without reverting").option("--force","Direct push to main without PR (emergency only)").option("--message <msg>","Custom revert commit message").option("--dir <path>","Use existing local clone instead of cloning fresh").option(j0,T0).option(b0,y0).action(async(D,F,$)=>{if(!f0())return;let J=await TF();if(!J.allPassed){console.log(W.red("Error: Missing prerequisites"));for(let C of J.errors)console.log(W.dim(` - ${C}`));return}let Q,Y=!0;if($.dir){if(!pg($.dir)){console.log(W.red(`Error: Directory not found: ${$.dir}`));return}Q=$.dir,Y=!1}else Q=bE0(process.cwd(),`${D}-revert-${Date.now()}`);let B=O("Fetching dataset info...").start(),X;try{X=await uD(D),B.succeed(`Found dataset: ${X.name}`)}catch(C){if(C instanceof h)if(B.fail(C.message),C.statusCode===404||C.statusCode===400)console.log(W.red(`Error: Dataset ${D} not found`)),console.log(W.dim(` ${C.message}`));else console.log(W.red(`Error: ${C.message}`));else{B.fail("Failed to fetch dataset");let T=C instanceof Error?C.message:String(C);console.log(W.red(`Error: Could not load dataset ${D}: ${T}`))}return}if(!X.github_repo){console.log(W.red("Error: Dataset has no GitHub repository"));return}if(Y){let C=O(`Cloning ${D}...`).start(),T=`https://github.com/${X.github_repo}.git`,y=await s1(T,Q);if(!y.success){C.fail(`Clone failed: ${y.error}`);return}C.succeed(`Cloned to ${Q}`)}let G=await pW(Q);if(G.length===0){console.log(W.yellow("No versions found for this dataset")),console.log(W.dim(" Dataset may not have any tagged releases yet"));return}if($.list){console.log(`
291
291
  ${W.cyan("Available Versions:")}
292
292
  `);for(let C of G)console.log(` ${W.green(C.version)} ${W.dim(C.date)} ${W.dim(C.commit)}`);return}let H=F;if(!H){console.log(`
293
293
  ${W.cyan("Available Versions:")}
294
- `);for(let T of G)console.log(` ${W.green(T.version)} ${W.dim(T.date)}`);console.log();let{version:C}=await D0.prompt([{type:"list",name:"version",message:"Select version to revert to:",choices:G.map((T)=>({name:`${T.version} (${T.date})`,value:T.version}))}]);H=C}let q=await dW(Q,H);if(!q){console.log(W.red(`Error: Version ${H} not found`)),console.log(W.dim(" Use --list to see available versions"));return}if(console.log(),console.log(W.yellow("Revert Summary:")),console.log(` Dataset: ${W.cyan(D)}`),console.log(` Target version: ${W.green(H)}`),console.log(` Commit: ${W.dim(q)}`),$.force)console.log(` Mode: ${W.red("DIRECT PUSH (--force)")}`);else console.log(` Mode: ${W.green("Pull Request")}`);if(console.log(),$.force)console.log(W.red("WARNING: --force will push directly to main without PR review!")),console.log(W.red("This should only be used in emergencies.")),console.log();let K=$.force?`Directly push revert to ${H}?`:`Create PR to revert to ${H}?`,V=await k0(K,$);if(V!=="confirmed"){console.log(W.dim(V==="declined"?"Skipped":"Cancelled"));return}let E=`revert-to-${H.replace(/\./g,"-")}-${Date.now()}`,Z=O("Creating revert branch...").start(),L=await cW(Q,H,E);if(!L.success){Z.fail(`Failed to create branch: ${L.error}`);return}Z.succeed(`Created branch: ${E}`);let A=O("Committing revert...").start(),M=$.message||`Revert to version ${H}`,N=await nW(Q,H,M);if(!N.success){A.fail(`Failed to commit: ${N.error}`);return}A.succeed("Committed revert changes");let w=O("Pushing branch...").start(),P=await PF(Q,E);if(!P.success){w.fail(`Failed to push: ${P.error}`);return}if(w.succeed("Pushed branch to GitHub"),!$.force){let C=O("Creating pull request...").start();try{let{spawn:T}=await import("child_process"),y=`Revert to version ${H}`,d=`## Revert Request
294
+ `);for(let T of G)console.log(` ${W.green(T.version)} ${W.dim(T.date)}`);console.log();let{version:C}=await D0.prompt([{type:"list",name:"version",message:"Select version to revert to:",choices:G.map((T)=>({name:`${T.version} (${T.date})`,value:T.version}))}]);H=C}let q=await dW(Q,H);if(!q){console.log(W.red(`Error: Version ${H} not found`)),console.log(W.dim(" Use --list to see available versions"));return}if(console.log(),console.log(W.yellow("Revert Summary:")),console.log(` Dataset: ${W.cyan(D)}`),console.log(` Target version: ${W.green(H)}`),console.log(` Commit: ${W.dim(q)}`),$.force)console.log(` Mode: ${W.red("DIRECT PUSH (--force)")}`);else console.log(` Mode: ${W.green("Pull Request")}`);if(console.log(),$.force)console.log(W.red("WARNING: --force will push directly to main without PR review!")),console.log(W.red("This should only be used in emergencies.")),console.log();let K=$.force?`Directly push revert to ${H}?`:`Create PR to revert to ${H}?`,V=await k0(K,$);if(V!=="confirmed"){console.log(W.dim(V==="declined"?"Skipped":"Cancelled"));return}let E=`revert-to-${H.replace(/\./g,"-")}-${Date.now()}`,Z=O("Creating revert branch...").start(),L=await cW(Q,H,E);if(!L.success){Z.fail(`Failed to create branch: ${L.error}`);return}Z.succeed(`Created branch: ${E}`);let M=O("Committing revert...").start(),A=$.message||`Revert to version ${H}`,N=await nW(Q,H,A);if(!N.success){M.fail(`Failed to commit: ${N.error}`);return}M.succeed("Committed revert changes");let w=O("Pushing branch...").start(),P=await PF(Q,E);if(!P.success){w.fail(`Failed to push: ${P.error}`);return}if(w.succeed("Pushed branch to GitHub"),!$.force){let C=O("Creating pull request...").start();try{let{spawn:T}=await import("child_process"),y=`Revert to version ${H}`,d=`## Revert Request
295
295
 
296
296
  This PR reverts the dataset to version ${H}.
297
297
 
@@ -328,11 +328,11 @@ Examples:
328
328
 
329
329
  This will prompt for confirmation by requiring you to type
330
330
  the dataset ID to confirm the permanent action.
331
- `).action(async(D)=>{if(!f0())return;let F=D.trim(),$;try{$=await uD(F)}catch(Y){if(Y instanceof b&&Y.statusCode===404)console.error(W.red(`Dataset '${F}' not found`));else console.error(W.red(`Failed to fetch dataset: ${Y instanceof Error?Y.message:String(Y)}`));process.exit(1)}if(console.log(W.yellow(`
331
+ `).action(async(D)=>{if(!f0())return;let F=D.trim(),$;try{$=await uD(F)}catch(Y){if(Y instanceof h&&Y.statusCode===404)console.error(W.red(`Dataset '${F}' not found`));else console.error(W.red(`Failed to fetch dataset: ${Y instanceof Error?Y.message:String(Y)}`));process.exit(1)}if(console.log(W.yellow(`
332
332
  WARNING: Publishing is PERMANENT and IRREVERSIBLE
333
333
  `)),console.log("This will:"),console.log(" 1. Make the GitHub repository PUBLIC"),console.log(" 2. Allow public S3 access to all dataset files"),console.log(` 3. Update git-annex configuration for web access
334
334
  `),console.log(`Dataset: ${W.cyan($.dataset_id)} - ${$.name}`),$.owner_username)console.log(`Owner: ${$.owner_username}`);if($.github_repo)console.log(`Repository: ${$.github_repo}`);if(console.log(),(await D0.prompt([{type:"input",name:"datasetId",message:`Type '${F}' to confirm:`,validate:(Y)=>{if(Y.trim()===F)return!0;return`Please type exactly '${F}' to confirm`}}])).datasetId!==F)console.log(W.dim("Cancelled.")),process.exit(0);let Q=O("Publishing dataset...").start();try{let Y=await vf(F);Q.succeed(W.green("Dataset published successfully")),console.log(`
335
- GitHub: ${W.cyan(Y.github_url)}`),console.log(`S3: ${W.cyan(Y.s3_url)}`)}catch(Y){if(Q.fail(W.red("Failed to publish dataset")),Y instanceof b){if(console.error(W.red(`
335
+ GitHub: ${W.cyan(Y.github_url)}`),console.log(`S3: ${W.cyan(Y.s3_url)}`)}catch(Y){if(Q.fail(W.red("Failed to publish dataset")),Y instanceof h){if(console.error(W.red(`
336
336
  ${Y.message}`)),Y.details)console.error(W.dim(JSON.stringify(Y.details,null,2)));if(Y.statusCode===403)console.log(W.dim(" You must be the dataset owner or an admin to publish"));else if(Y.statusCode===400&&Y.message.includes("sandbox"))console.log(W.dim(" Sandbox datasets cannot be published"))}else console.error(W.red(`
337
337
  ${Y instanceof Error?Y.message:String(Y)}`));process.exit(1)}});r0.command("delete-dataset").description("Delete a dataset and all associated resources (GitHub, S3, D1)").argument("<dataset-id>","Dataset ID (e.g., nm000108)").option("--force","Force deletion of published datasets with DOIs (owner only)").action(async(D,F)=>{if(!f0())return;let $=O("Looking up dataset...").start();try{let J=await uD(D);if($.stop(),console.log(W.bold(`
338
338
  Dataset: ${J.dataset_id}`)),console.log(` Name: ${J.name||"(unnamed)"}`),console.log(` Visibility: ${J.visibility}`),J.concept_doi){if(console.log(` DOI: ${J.concept_doi}`),console.log(W.yellow(`
@@ -401,7 +401,7 @@ Examples:
401
401
  $ nemar auth whoami # Alias for status
402
402
  $ nemar auth switch # Switch between accounts
403
403
  $ nemar auth logout # Clear active account
404
- $ nemar auth logout --all # Clear all accounts`);async function zH(D){if(L0()){let J=JD();if(console.log(W.yellow(`Already logged in as ${J.username||"unknown"}`)),console.log(W.dim(" This will add another account (use 'nemar auth switch' to switch)")),await k0("Log in with a different account?",D)!=="confirmed")return}let F=D.key||process.env.NEMAR_API_KEY;if(!F)F=(await D0.prompt([{type:"password",name:"apiKey",message:"Enter your API key:",mask:"*",validate:(Q)=>{if(!Q||Q.length<32)return"Please enter a valid API key";return!0}}])).apiKey;if(!F){console.log(W.red("No API key provided"));return}let $=O("Validating API key...").start();try{let J=await Of(F);if(!J.valid){$.fail("Invalid API key");return}if(Ef(J.user.username,{apiKey:F,apiUrl:v4,username:J.user.username,email:J.user.email,githubUsername:J.user.github_username,sandboxCompleted:J.user.sandbox_completed,...J.user.sandbox_dataset_id?{sandboxDatasetId:J.user.sandbox_dataset_id}:{}}),$.succeed("Login successful"),console.log(),console.log(` Welcome back, ${W.cyan(J.user.username)}!`),J.user.role==="owner")console.log(` ${W.red("Owner access enabled")}`);else if(J.user.role==="admin")console.log(` ${W.magenta("Admin access enabled")}`);if(!J.user.sandbox_completed)console.log(),console.log(W.yellow(" Note: Sandbox training required before uploading datasets")),console.log(W.dim(" Run 'nemar sandbox' to complete training"))}catch(J){if(J instanceof b){if($.fail(J.message),J.statusCode===401)console.log(W.dim(" Check that your API key is correct"));else if(J.statusCode===403)console.log(W.dim(" Your account may not be approved yet"))}else $.fail("Connection failed"),console.log(W.dim(" Check your internet connection"))}}var dE0=G1.command("login").description("Authenticate with your NEMAR API key").option("-k, --key <key>","API key (alternative: set NEMAR_API_KEY env var)").option(j0,T0).option(b0,y0).action(zH);r6(dE0,`
404
+ $ nemar auth logout --all # Clear all accounts`);async function zH(D){if(L0()){let J=JD();if(console.log(W.yellow(`Already logged in as ${J.username||"unknown"}`)),console.log(W.dim(" This will add another account (use 'nemar auth switch' to switch)")),await k0("Log in with a different account?",D)!=="confirmed")return}let F=D.key||process.env.NEMAR_API_KEY;if(!F)F=(await D0.prompt([{type:"password",name:"apiKey",message:"Enter your API key:",mask:"*",validate:(Q)=>{if(!Q||Q.length<32)return"Please enter a valid API key";return!0}}])).apiKey;if(!F){console.log(W.red("No API key provided"));return}let $=O("Validating API key...").start();try{let J=await Of(F);if(!J.valid){$.fail("Invalid API key");return}if(Ef(J.user.username,{apiKey:F,apiUrl:v4,username:J.user.username,email:J.user.email,githubUsername:J.user.github_username,sandboxCompleted:J.user.sandbox_completed,...J.user.sandbox_dataset_id?{sandboxDatasetId:J.user.sandbox_dataset_id}:{}}),$.succeed("Login successful"),console.log(),console.log(` Welcome back, ${W.cyan(J.user.username)}!`),J.user.role==="owner")console.log(` ${W.red("Owner access enabled")}`);else if(J.user.role==="admin")console.log(` ${W.magenta("Admin access enabled")}`);if(!J.user.sandbox_completed)console.log(),console.log(W.yellow(" Note: Sandbox training required before uploading datasets")),console.log(W.dim(" Run 'nemar sandbox' to complete training"))}catch(J){if(J instanceof h){if($.fail(J.message),J.statusCode===401)console.log(W.dim(" Check that your API key is correct"));else if(J.statusCode===403)console.log(W.dim(" Your account may not be approved yet"))}else $.fail("Connection failed"),console.log(W.dim(" Check your internet connection"))}}var dE0=G1.command("login").description("Authenticate with your NEMAR API key").option("-k, --key <key>","API key (alternative: set NEMAR_API_KEY env var)").option(j0,T0).option(b0,y0).action(zH);r6(dE0,`
405
405
  Environment Variables:
406
406
  NEMAR_API_KEY Your API key (alternative to -k flag)
407
407
 
@@ -409,7 +409,7 @@ Examples:
409
409
  $ nemar auth login # Interactive prompt
410
410
  $ nemar auth login -k nemar_abc123... # Provide key directly
411
411
  $ NEMAR_API_KEY=nemar_abc... nemar auth login`);async function UQ(){console.log(W.cyan("NEMAR Account Registration")),console.log(W.dim(`Create an account to upload and manage datasets
412
- `));let D=await D0.prompt([{type:"input",name:"username",message:"Choose a username:",validate:async($)=>{if(!$||$.length<3)return"Username must be at least 3 characters";if($.length>30)return"Username must be at most 30 characters";if(!/^[a-zA-Z0-9_-]+$/.test($))return"Username can only contain letters, numbers, underscores, and hyphens";try{let J=await Nf($);if(!J.available)return J.reason||`Username "${$}" is already taken`}catch(J){if(J instanceof b&&J.statusCode===0)return!0;return!0}return!0}},{type:"input",name:"email",message:"Email address:",validate:($)=>{if(!$||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test($))return"Please enter a valid email address";return!0}},{type:"password",name:"password",message:"Password (min 12 characters):",mask:"*",validate:($)=>{if(!$||$.length<12)return"Password must be at least 12 characters";if($.length>128)return"Password must be at most 128 characters";return!0}},{type:"password",name:"confirmPassword",message:"Confirm password:",mask:"*",validate:($,J)=>{if($!==J?.password)return"Passwords do not match";return!0}},{type:"input",name:"github_username",message:"GitHub username (for PR collaboration):",validate:async($)=>{if(!$||$.length<1)return"GitHub username is required for PR collaboration";if($.length>39)return"GitHub username is too long";try{if(!(await Rf($)).valid)return`GitHub user "${$}" not found. Please check the username.`}catch(J){if(J instanceof b&&J.statusCode===0)return!0;return!0}return!0}},{type:"input",name:"orcid",message:"ORCID iD (optional, e.g. 0000-0002-1825-0097):",validate:($)=>{if(!$||$.trim()==="")return!0;if(!/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/.test($.trim()))return"ORCID must be in format 0000-0000-0000-000X";return!0}},{type:"input",name:"description",message:"Why do you need access to NEMAR? (1-2 sentences):",validate:($)=>{let J=$?.trim();if(!J||J.length<20)return"Please provide at least 20 characters describing why you need NEMAR access";if(J.length>500)return"Description must be at most 500 characters";return!0}}]),F=O("Creating account...").start();try{let $=await Cf({username:D.username,email:D.email,password:D.password,github_username:D.github_username,description:D.description.trim(),orcid:D.orcid?.trim()||void 0});F.succeed("Account created"),console.log(),console.log(W.green("Registration successful!")),console.log(),console.log("Next steps:"),$.next_steps.forEach((J,Q)=>{console.log(` ${Q+1}. ${J}`)}),console.log(),console.log(W.dim("Once approved, use 'nemar auth retrieve-key' to get your API key"))}catch($){if($ instanceof b){if(F.fail($.message),$.details&&Array.isArray($.details))$.details.forEach((J)=>{console.log(W.dim(` - ${J}`))});if($.message.includes("already taken"))console.log(W.dim(" Try a different username"));else if($.message.includes("already registered"))console.log(W.dim(" Use 'nemar auth resend-verification' if you need a new verification link"))}else F.fail("Registration failed"),console.log(W.dim(` ${$ instanceof Error?$.message:"Unknown error"}`))}}G1.command("signup").description("Register for a new NEMAR account").action(UQ);async function LQ(D){if(!L0()){console.log(W.yellow("Not authenticated")),console.log(),console.log(" Run 'nemar auth login' to authenticate"),console.log(" Run 'nemar auth signup' to create an account");return}let F;if(D.refresh){let Y=O("Fetching user info...").start();try{let B=await eJ();a1("username",B.username),a1("email",B.email),a1("githubUsername",B.github_username),F=B.role,Y.stop()}catch(B){if(Y.fail("Could not refresh user info"),B instanceof b&&B.statusCode===401)console.log(W.dim(" Your session may have expired. Try logging in again."))}}let $=JD();if(console.log(W.green("Authenticated")),console.log(),$.username)console.log(` Username: ${W.cyan($.username)}`);if($.email)console.log(` Email: ${$.email}`);if($.githubUsername)console.log(` GitHub: @${$.githubUsername}`);if(F){let Y=F==="owner"?W.red("Owner"):F==="admin"?W.magenta("Admin"):W.white("Member");console.log(` Role: ${Y}`)}console.log(` Config: ${W.dim(zf())}`);let Q=I9().filter((Y)=>!Y.active);if(Q.length>0)console.log(),console.log(` Other accounts: ${Q.map((Y)=>W.dim(Y.username)).join(", ")}`),console.log(W.dim(" Run 'nemar auth switch' to switch accounts"))}G1.command("status").description("Check current authentication status").option("--refresh","Refresh user info from server").action(LQ);G1.command("whoami").description("Show current user (alias for status)").option("--refresh","Refresh user info from server").action(LQ);async function cE0(D){try{let F=Bun.which("gh");if(!F){console.log(W.dim(" GitHub CLI (gh) not found in PATH, skipping"));return}let $=Bun.spawn({cmd:[F,"auth","switch","--user",D],stdout:"pipe",stderr:"pipe"}),J=await new Response($.stderr).text(),Q=await $.exited;if(Q===0)console.log(` GitHub CLI switched to ${W.cyan(`@${D}`)}`);else{let Y=J.trim();if(Y.includes("not found")||Y.includes("no accounts"))console.log(W.dim(` GitHub CLI: @${D} not logged in (run 'gh auth login')`));else console.log(W.dim(` GitHub CLI switch failed: ${Y||`exit code ${Q}`}`))}}catch(F){let $=F instanceof Error?F.message:String(F);console.log(W.dim(` GitHub CLI switch skipped: ${$}`))}}async function EH(D){let F=I9();if(F.length===0){console.log(W.yellow("No stored accounts")),console.log(" Run 'nemar auth login' to add an account");return}if(F.length===1){let Y=F[0];if(Y.active){console.log(W.yellow(`Only one account stored: ${Y.username}`)),console.log(" Run 'nemar auth login' to add another account");return}}let $;if(D)$=D;else{let Y=F.map((X)=>({name:`${X.username}${X.githubUsername?` (@${X.githubUsername})`:""}${X.active?W.green(" (active)"):""}`,value:X.username,short:X.username})),{selected:B}=await D0.prompt([{type:"list",name:"selected",message:"Switch to account:",choices:Y,default:F.find((X)=>X.active)?.username}]);$=B}let J=F.find((Y)=>Y.active);if(J&&J.username===$){console.log(W.yellow(`Already using account ${$}`));return}let Q=Vf($);if(!Q){console.log(W.red(`Account not found: ${$}`)),console.log(W.dim(" Provide a NEMAR username or GitHub username")),console.log(W.dim(` Available: ${F.map((Y)=>Y.username).join(", ")}`));return}if(console.log(W.green(`Switched to ${W.cyan(Q.username||$)}`)),Q.githubUsername)await cE0(Q.githubUsername)}var nE0=G1.command("switch [username]").description("Switch between stored accounts").action(EH);r6(nE0,`
412
+ `));let D=await D0.prompt([{type:"input",name:"username",message:"Choose a username:",validate:async($)=>{if(!$||$.length<3)return"Username must be at least 3 characters";if($.length>30)return"Username must be at most 30 characters";if(!/^[a-zA-Z0-9_-]+$/.test($))return"Username can only contain letters, numbers, underscores, and hyphens";try{let J=await Nf($);if(!J.available)return J.reason||`Username "${$}" is already taken`}catch(J){if(J instanceof h&&J.statusCode===0)return!0;return!0}return!0}},{type:"input",name:"email",message:"Email address:",validate:($)=>{if(!$||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test($))return"Please enter a valid email address";return!0}},{type:"password",name:"password",message:"Password (min 12 characters):",mask:"*",validate:($)=>{if(!$||$.length<12)return"Password must be at least 12 characters";if($.length>128)return"Password must be at most 128 characters";return!0}},{type:"password",name:"confirmPassword",message:"Confirm password:",mask:"*",validate:($,J)=>{if($!==J?.password)return"Passwords do not match";return!0}},{type:"input",name:"github_username",message:"GitHub username (for PR collaboration):",validate:async($)=>{if(!$||$.length<1)return"GitHub username is required for PR collaboration";if($.length>39)return"GitHub username is too long";try{if(!(await Rf($)).valid)return`GitHub user "${$}" not found. Please check the username.`}catch(J){if(J instanceof h&&J.statusCode===0)return!0;return!0}return!0}},{type:"input",name:"orcid",message:"ORCID iD (optional, e.g. 0000-0002-1825-0097):",validate:($)=>{if(!$||$.trim()==="")return!0;if(!/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/.test($.trim()))return"ORCID must be in format 0000-0000-0000-000X";return!0}},{type:"input",name:"description",message:"Why do you need access to NEMAR? (1-2 sentences):",validate:($)=>{let J=$?.trim();if(!J||J.length<20)return"Please provide at least 20 characters describing why you need NEMAR access";if(J.length>500)return"Description must be at most 500 characters";return!0}}]),F=O("Creating account...").start();try{let $=await Cf({username:D.username,email:D.email,password:D.password,github_username:D.github_username,description:D.description.trim(),orcid:D.orcid?.trim()||void 0});F.succeed("Account created"),console.log(),console.log(W.green("Registration successful!")),console.log(),console.log("Next steps:"),$.next_steps.forEach((J,Q)=>{console.log(` ${Q+1}. ${J}`)}),console.log(),console.log(W.dim("Once approved, use 'nemar auth retrieve-key' to get your API key"))}catch($){if($ instanceof h){if(F.fail($.message),$.details&&Array.isArray($.details))$.details.forEach((J)=>{console.log(W.dim(` - ${J}`))});if($.message.includes("already taken"))console.log(W.dim(" Try a different username"));else if($.message.includes("already registered"))console.log(W.dim(" Use 'nemar auth resend-verification' if you need a new verification link"))}else F.fail("Registration failed"),console.log(W.dim(` ${$ instanceof Error?$.message:"Unknown error"}`))}}G1.command("signup").description("Register for a new NEMAR account").action(UQ);async function LQ(D){if(!L0()){console.log(W.yellow("Not authenticated")),console.log(),console.log(" Run 'nemar auth login' to authenticate"),console.log(" Run 'nemar auth signup' to create an account");return}let F;if(D.refresh){let Y=O("Fetching user info...").start();try{let B=await eJ();a1("username",B.username),a1("email",B.email),a1("githubUsername",B.github_username),F=B.role,Y.stop()}catch(B){if(Y.fail("Could not refresh user info"),B instanceof h&&B.statusCode===401)console.log(W.dim(" Your session may have expired. Try logging in again."))}}let $=JD();if(console.log(W.green("Authenticated")),console.log(),$.username)console.log(` Username: ${W.cyan($.username)}`);if($.email)console.log(` Email: ${$.email}`);if($.githubUsername)console.log(` GitHub: @${$.githubUsername}`);if(F){let Y=F==="owner"?W.red("Owner"):F==="admin"?W.magenta("Admin"):W.white("Member");console.log(` Role: ${Y}`)}console.log(` Config: ${W.dim(zf())}`);let Q=I9().filter((Y)=>!Y.active);if(Q.length>0)console.log(),console.log(` Other accounts: ${Q.map((Y)=>W.dim(Y.username)).join(", ")}`),console.log(W.dim(" Run 'nemar auth switch' to switch accounts"))}G1.command("status").description("Check current authentication status").option("--refresh","Refresh user info from server").action(LQ);G1.command("whoami").description("Show current user (alias for status)").option("--refresh","Refresh user info from server").action(LQ);async function cE0(D){try{let F=Bun.which("gh");if(!F){console.log(W.dim(" GitHub CLI (gh) not found in PATH, skipping"));return}let $=Bun.spawn({cmd:[F,"auth","switch","--user",D],stdout:"pipe",stderr:"pipe"}),J=await new Response($.stderr).text(),Q=await $.exited;if(Q===0)console.log(` GitHub CLI switched to ${W.cyan(`@${D}`)}`);else{let Y=J.trim();if(Y.includes("not found")||Y.includes("no accounts"))console.log(W.dim(` GitHub CLI: @${D} not logged in (run 'gh auth login')`));else console.log(W.dim(` GitHub CLI switch failed: ${Y||`exit code ${Q}`}`))}}catch(F){let $=F instanceof Error?F.message:String(F);console.log(W.dim(` GitHub CLI switch skipped: ${$}`))}}async function EH(D){let F=I9();if(F.length===0){console.log(W.yellow("No stored accounts")),console.log(" Run 'nemar auth login' to add an account");return}if(F.length===1){let Y=F[0];if(Y.active){console.log(W.yellow(`Only one account stored: ${Y.username}`)),console.log(" Run 'nemar auth login' to add another account");return}}let $;if(D)$=D;else{let Y=F.map((X)=>({name:`${X.username}${X.githubUsername?` (@${X.githubUsername})`:""}${X.active?W.green(" (active)"):""}`,value:X.username,short:X.username})),{selected:B}=await D0.prompt([{type:"list",name:"selected",message:"Switch to account:",choices:Y,default:F.find((X)=>X.active)?.username}]);$=B}let J=F.find((Y)=>Y.active);if(J&&J.username===$){console.log(W.yellow(`Already using account ${$}`));return}let Q=Vf($);if(!Q){console.log(W.red(`Account not found: ${$}`)),console.log(W.dim(" Provide a NEMAR username or GitHub username")),console.log(W.dim(` Available: ${F.map((Y)=>Y.username).join(", ")}`));return}if(console.log(W.green(`Switched to ${W.cyan(Q.username||$)}`)),Q.githubUsername)await cE0(Q.githubUsername)}var nE0=G1.command("switch [username]").description("Switch between stored accounts").action(EH);r6(nE0,`
413
413
  Description:
414
414
  Switch the active NEMAR account. You can specify a NEMAR username or
415
415
  GitHub username. If no username is given, an interactive picker is shown.
@@ -419,7 +419,7 @@ Description:
419
419
  Examples:
420
420
  $ nemar auth switch # Interactive picker
421
421
  $ nemar auth switch yahya # Switch by NEMAR username
422
- $ nemar auth switch cool-vibers # Switch by GitHub username`);async function VH(D){if(!L0()){console.log(W.yellow("Not currently authenticated"));return}if(D.all){let Q=I9();if(await k0(`Log out all ${Q.length} stored account(s)?`,D)!=="confirmed")return;Kf(),console.log(W.green("All accounts removed"));return}let F=JD();if(await k0(`Log out ${F.username||"current user"}?`,D)!=="confirmed")return;qf(),console.log(W.green("Logged out successfully"));let J=I9();if(J.length>0){let Q=J.find((Y)=>Y.active);if(Q)console.log(` Switched to ${W.cyan(Q.username)}`)}}G1.command("logout").description("Remove the active account (use --all to remove all)").option(j0,T0).option(b0,y0).option("--all","Remove all stored accounts").action(VH);G1.command("resend-verification").description("Resend email verification link").action(async()=>{let{email:D}=await D0.prompt([{type:"input",name:"email",message:"Enter your email address:",validate:($)=>{if(!$||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test($))return"Please enter a valid email address";return!0}}]),F=O("Sending verification email...").start();try{let $=await wf(D);F.succeed($.message)}catch($){if($ instanceof b){if(F.fail($.message),$.statusCode===0)console.log(W.dim(" Check your internet connection"))}else F.fail(`Failed to send verification email: ${$ instanceof Error?$.message:"Unknown error"}`),console.log(W.dim(" Check your internet connection"))}});async function iE0(D){if(!L0()){console.log(W.yellow("Not authenticated")),console.log(),console.log(" Run 'nemar auth login' first to authenticate");return}let F=JD();if(!D.force){let G=O("Checking existing SSH access...").start(),H=await KH();if(H.success){if(G.succeed("SSH access to GitHub already configured"),H.username)console.log(` GitHub user: ${W.cyan(H.username)}`);console.log(),console.log(W.dim("Use --force to regenerate SSH key anyway"));return}G.info("SSH access to GitHub not configured")}console.log(),console.log(W.cyan("Setting up SSH access for GitHub")),console.log(W.dim(`This will generate a dedicated SSH key for NEMAR uploads
422
+ $ nemar auth switch cool-vibers # Switch by GitHub username`);async function VH(D){if(!L0()){console.log(W.yellow("Not currently authenticated"));return}if(D.all){let Q=I9();if(await k0(`Log out all ${Q.length} stored account(s)?`,D)!=="confirmed")return;Kf(),console.log(W.green("All accounts removed"));return}let F=JD();if(await k0(`Log out ${F.username||"current user"}?`,D)!=="confirmed")return;qf(),console.log(W.green("Logged out successfully"));let J=I9();if(J.length>0){let Q=J.find((Y)=>Y.active);if(Q)console.log(` Switched to ${W.cyan(Q.username)}`)}}G1.command("logout").description("Remove the active account (use --all to remove all)").option(j0,T0).option(b0,y0).option("--all","Remove all stored accounts").action(VH);G1.command("resend-verification").description("Resend email verification link").action(async()=>{let{email:D}=await D0.prompt([{type:"input",name:"email",message:"Enter your email address:",validate:($)=>{if(!$||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test($))return"Please enter a valid email address";return!0}}]),F=O("Sending verification email...").start();try{let $=await wf(D);F.succeed($.message)}catch($){if($ instanceof h){if(F.fail($.message),$.statusCode===0)console.log(W.dim(" Check your internet connection"))}else F.fail(`Failed to send verification email: ${$ instanceof Error?$.message:"Unknown error"}`),console.log(W.dim(" Check your internet connection"))}});async function iE0(D){if(!L0()){console.log(W.yellow("Not authenticated")),console.log(),console.log(" Run 'nemar auth login' first to authenticate");return}let F=JD();if(!D.force){let G=O("Checking existing SSH access...").start(),H=await KH();if(H.success){if(G.succeed("SSH access to GitHub already configured"),H.username)console.log(` GitHub user: ${W.cyan(H.username)}`);console.log(),console.log(W.dim("Use --force to regenerate SSH key anyway"));return}G.info("SSH access to GitHub not configured")}console.log(),console.log(W.cyan("Setting up SSH access for GitHub")),console.log(W.dim(`This will generate a dedicated SSH key for NEMAR uploads
423
423
  `));let $=null,J=u4();if(ag()&&!D.force)console.log(W.dim(` Using existing key: ${J.privateKey}`)),$=sg();else{let G=O("Generating SSH key...").start(),H=await og(F.email||"nemar-user");if(!H.success){G.fail("Failed to generate SSH key"),console.log(W.dim(` ${H.error}`));return}G.succeed("SSH key generated"),console.log(W.dim(` Private key: ${J.privateKey}`)),console.log(W.dim(` Public key: ${J.publicKey}`)),$=H.publicKey||null}if(!$){console.log(W.red("Could not read public key"));return}let Q=O("Configuring SSH...").start(),Y=rg();if(!Y.success){Q.fail("Failed to configure SSH"),console.log(W.dim(` ${Y.error}`));return}Q.succeed("SSH configured for GitHub"),console.log();let B=O("Testing SSH connection to GitHub...").start(),X=await KH();if(X.success){if(B.succeed("SSH connection verified"),X.username)console.log(` GitHub user: ${W.cyan(X.username)}`);console.log(),console.log(W.green("SSH setup complete! You can now upload datasets."));return}B.info("SSH key generated but not yet added to GitHub"),console.log(),console.log(W.yellow("To complete setup, add this SSH key to your GitHub account:")),console.log(),console.log(W.cyan(` ${$}`)),console.log(),console.log("Steps:"),console.log(" 1. Copy the key above"),console.log(` 2. Go to: ${W.underline("https://github.com/settings/ssh/new")}`),console.log(` 3. Title: ${W.dim("NEMAR CLI")}`),console.log(" 4. Paste the key and click 'Add SSH key'"),console.log(),console.log(W.dim("After adding the key, run 'nemar auth setup-ssh' again to verify."))}var aE0=G1.command("setup-ssh").description("Configure SSH access for GitHub (optional, gh CLI preferred)").option("-f, --force","Regenerate SSH key even if one exists").action(iE0);r6(aE0,`
424
424
  Description:
425
425
  Configures SSH access for GitHub as an alternative to gh CLI (HTTPS).
@@ -432,7 +432,7 @@ Description:
432
432
 
433
433
  Examples:
434
434
  $ nemar auth setup-ssh # Set up SSH access
435
- $ nemar auth setup-ssh --force # Regenerate key even if exists`);var oE0=G1.command("retrieve-key").description("Retrieve your API key after account approval (requires email and password)").action(async()=>{let D=await D0.prompt([{type:"input",name:"email",message:"Email address:",validate:($)=>{if(!$||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test($))return"Please enter a valid email address";return!0}},{type:"password",name:"password",message:"Password:",mask:"*",validate:($)=>{if(!$)return"Password is required";return!0}}]),F=O("Retrieving API key...").start();try{let $=await jf(D.email,D.password);F.succeed("API key retrieved"),console.log(),console.log(W.yellow("Your API Key (store this securely):")),console.log(W.dim(` ${$.api_key}`)),console.log(),console.log("Next step:"),console.log(` Run ${W.cyan("nemar auth login")} and paste your API key`)}catch($){if($ instanceof b){if($.statusCode===409){let J=$.details;if(F.info("API key already issued"),J?.api_key_prefix)console.log(),console.log(` Key prefix: ${W.dim(J.api_key_prefix)}`);console.log(),console.log(" If you lost your API key, regenerate it:"),console.log(` ${W.cyan("nemar auth regenerate-key")}`)}else if(F.fail($.message),$.statusCode===401)console.log(W.dim(" Check your email and password"));else if($.statusCode===403)console.log(W.dim(" Your account may not be approved yet"))}else{let J=$ instanceof Error?$.message:"Unknown error";F.fail(`Failed to retrieve API key: ${J}`)}}});r6(oE0,`
435
+ $ nemar auth setup-ssh --force # Regenerate key even if exists`);var oE0=G1.command("retrieve-key").description("Retrieve your API key after account approval (requires email and password)").action(async()=>{let D=await D0.prompt([{type:"input",name:"email",message:"Email address:",validate:($)=>{if(!$||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test($))return"Please enter a valid email address";return!0}},{type:"password",name:"password",message:"Password:",mask:"*",validate:($)=>{if(!$)return"Password is required";return!0}}]),F=O("Retrieving API key...").start();try{let $=await jf(D.email,D.password);F.succeed("API key retrieved"),console.log(),console.log(W.yellow("Your API Key (store this securely):")),console.log(W.dim(` ${$.api_key}`)),console.log(),console.log("Next step:"),console.log(` Run ${W.cyan("nemar auth login")} and paste your API key`)}catch($){if($ instanceof h){if($.statusCode===409){let J=$.details;if(F.info("API key already issued"),J?.api_key_prefix)console.log(),console.log(` Key prefix: ${W.dim(J.api_key_prefix)}`);console.log(),console.log(" If you lost your API key, regenerate it:"),console.log(` ${W.cyan("nemar auth regenerate-key")}`)}else if(F.fail($.message),$.statusCode===401)console.log(W.dim(" Check your email and password"));else if($.statusCode===403)console.log(W.dim(" Your account may not be approved yet"))}else{let J=$ instanceof Error?$.message:"Unknown error";F.fail(`Failed to retrieve API key: ${J}`)}}});r6(oE0,`
436
436
  Description:
437
437
  After an admin approves your account, use this command to securely
438
438
  retrieve your API key. You will need the email and password you used
@@ -443,7 +443,7 @@ Description:
443
443
 
444
444
  Examples:
445
445
  $ nemar auth retrieve-key`);var sE0=G1.command("regenerate-key").description("Request a new API key (revokes current key, requires email verification)").action(async()=>{console.log(W.yellow("API Key Regeneration")),console.log(W.dim(`This will revoke your current key and generate a new one
446
- `));let{email:D}=await D0.prompt([{type:"input",name:"email",message:"Email address associated with your account:",validate:($)=>{if(!$||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test($))return"Please enter a valid email address";return!0}}]),F=O("Sending verification email...").start();try{let $=await Tf(D);F.succeed("Verification email sent"),console.log(),console.log("Next steps:"),console.log(" 1. Check your email for a verification link"),console.log(" 2. Click the link to generate your new API key"),console.log(" 3. Copy the new key and run 'nemar auth login'"),console.log(),console.log(W.dim("The link expires in 1 hour"))}catch($){if($ instanceof b)F.fail($.message);else F.fail("Failed to send verification email"),console.log(W.dim(" Check your internet connection"))}});r6(sE0,`
446
+ `));let{email:D}=await D0.prompt([{type:"input",name:"email",message:"Email address associated with your account:",validate:($)=>{if(!$||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test($))return"Please enter a valid email address";return!0}}]),F=O("Sending verification email...").start();try{let $=await Tf(D);F.succeed("Verification email sent"),console.log(),console.log("Next steps:"),console.log(" 1. Check your email for a verification link"),console.log(" 2. Click the link to generate your new API key"),console.log(" 3. Copy the new key and run 'nemar auth login'"),console.log(),console.log(W.dim("The link expires in 1 hour"))}catch($){if($ instanceof h)F.fail($.message);else F.fail("Failed to send verification email"),console.log(W.dim(" Check your internet connection"))}});r6(sE0,`
447
447
  Description:
448
448
  If you lost your API key or it was compromised, use this command to
449
449
  request a new one. A verification email will be sent to confirm the
@@ -469,9 +469,9 @@ See the URL above for the full license text.
469
469
 
470
470
  Please see https://spdx.org/licenses/${D}.html for the full license text.
471
471
  `}function Kh(D,F){let $=RQ(D,"LICENSE");if(NQ($))return!1;return Wh($,zV0(F)),!0}function zh(D,F){let $=RQ(D,"dataset_description.json");if(!NQ($))return;let J=JSON.parse(CH($,"utf-8"));J.License=F,Wh($,`${JSON.stringify(J,null,2)}
472
- `)}function Eh(D,F){let $=D.files??{},J=F.files??{},Q=[],Y=[],B=[];for(let[X,G]of Object.entries(J)){let H=$[X];if(!H)Q.push(X);else if(H.key!==G.key)Y.push(X)}for(let X of Object.keys($))if(!(X in J))B.push(X);return Q.sort(),Y.sort(),B.sort(),{added:Q,changed:Y,removed:B}}import{existsSync as jH,mkdirSync as Uh,statSync as EV0}from"fs";import{dirname as VV0,join as ZV0,resolve as Vh}from"path";var{spawn:Lh}=globalThis.Bun;var TH="openneuro.org",Ah="us-east-1",PH=`https://s3.amazonaws.com/${TH}`,UV0=/^ds\d{6}$/;function Mh(D){return UV0.test(D)}function Zh(D){return D.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&apos;/g,"'").replace(/&quot;/g,'"')}async function Nh(D,F){if(F??await AQ())try{let B=Lh({cmd:["aws","s3","ls","--no-sign-request","--region",Ah,`s3://${TH}/${D}/`],stdout:"pipe",stderr:"pipe"}),X=await new Response(B.stdout).text();if(await B.exited!==0)return!1;return X.trim().length>0}catch{}let J=`${PH}?list-type=2&prefix=${D}/&max-keys=1`,Q=await fetch(J);if(!Q.ok)return!1;return(await Q.text()).includes("<Key>")}async function Rh(D){let F=[],$;do{let J=`${PH}?list-type=2&prefix=${D}/`;if($)J+=`&continuation-token=${encodeURIComponent($)}`;let Q=await fetch(J);if(!Q.ok)throw Error(`Failed to list OpenNeuro dataset: HTTP ${Q.status}`);let Y=await Q.text(),B=Y.match(/<Contents>[\s\S]*?<\/Contents>/g)||[];for(let G of B){let H=G.match(/<Key>([^<]+)<\/Key>/),q=G.match(/<Size>(\d+)<\/Size>/);if(H&&q){let K=Zh(H[1]),V=Number.parseInt(q[1],10);if(K.endsWith("/")&&V===0)continue;F.push({key:K,size:V})}}if(Y.includes("<IsTruncated>true</IsTruncated>")){let G=Y.match(/<NextContinuationToken>([^<]+)<\/NextContinuationToken>/);if(!G)throw Error(`S3 listing indicated more results but no continuation token was provided. Got ${F.length} objects so far.`);$=Zh(G[1])}else $=void 0}while($);return F}async function Ch(D,F,$){let J=`s3://${TH}/${D}/`,Q=["aws","s3","sync","--no-sign-request","--region",Ah,J,F],Y;try{Y=Lh({cmd:Q,stdout:"pipe",stderr:"pipe"})}catch(V){return{success:!1,filesDownloaded:0,totalBytes:0,method:"aws-cli",error:`Failed to start AWS CLI: ${V.message}`}}let B=0,X=[],G=/^download:\s+s3:\/\/[^\s]+\/(.*?)\s+to\s+/;function H(V,E){if(V.startsWith("download:")){B++;let Z=V.match(G);$?.(B,Z?.[1]||"")}else if(E)X.push(V)}async function q(V,E){let Z=V.getReader(),L=new TextDecoder,A="";try{while(!0){let{done:N,value:w}=await Z.read();if(N)break;A+=L.decode(w,{stream:!0});let P=A.split(`
473
- `);A=P.pop()||"";for(let C of P){let T=C.trim();if(T)H(T,E)}}let M=A.trim();if(M)H(M,E)}finally{Z.releaseLock()}}await Promise.all([q(Y.stdout,!1),q(Y.stderr,!0)]);let K=await Y.exited;if(K!==0)return{success:!1,filesDownloaded:B,totalBytes:0,method:"aws-cli",error:X.join(`
474
- `)||`aws s3 sync exited with code ${K}`};return{success:!0,filesDownloaded:B,totalBytes:0,method:"aws-cli"}}async function LV0(D,F,$,J){let Q=D.substring(J.length+1),Y=ZV0($,Q);if(!Vh(Y).startsWith(`${Vh($)}/`))throw Error(`Path traversal detected in key: ${D}`);if(jH(Y))try{if(EV0(Y).size===F)return F}catch{}let X=VV0(Y);if(!jH(X))Uh(X,{recursive:!0});let G=D.split("/").map((K)=>encodeURIComponent(K)).join("/"),H=`${PH}/${G}`,q=await fetch(H);if(!q.ok)throw Error(`Failed to download ${Q}: HTTP ${q.status}`);return await Bun.write(Y,q),F}async function Oh(D,F,$,J={}){let{concurrency:Q=8,onProgress:Y}=J,B=$.length,X=$.reduce((L,A)=>L+A.size,0),G=0,H=0,q=0,K=[];if(!jH(F))Uh(F,{recursive:!0});let V=[...$],E=Math.min(Q,B),Z=Array.from({length:E},async()=>{while(V.length>0){let L=V.shift();if(!L)break;try{let A=await LV0(L.key,L.size,F,D);H++,q+=A}catch(A){K.push(A.message)}G++,Y?.(G,B,q,X)}});return await Promise.all(Z),{success:K.length===0,filesDownloaded:H,totalBytes:q,method:"https",error:K.length>0?`${K.length} file(s) failed:
472
+ `)}function Eh(D,F){let $=D.files??{},J=F.files??{},Q=[],Y=[],B=[];for(let[X,G]of Object.entries(J)){let H=$[X];if(!H)Q.push(X);else if(H.key!==G.key)Y.push(X)}for(let X of Object.keys($))if(!(X in J))B.push(X);return Q.sort(),Y.sort(),B.sort(),{added:Q,changed:Y,removed:B}}import{existsSync as jH,mkdirSync as Uh,statSync as EV0}from"fs";import{dirname as VV0,join as ZV0,resolve as Vh}from"path";var{spawn:Lh}=globalThis.Bun;var TH="openneuro.org",Ah="us-east-1",PH=`https://s3.amazonaws.com/${TH}`,UV0=/^ds\d{6}$/;function Mh(D){return UV0.test(D)}function Zh(D){return D.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&apos;/g,"'").replace(/&quot;/g,'"')}async function Nh(D,F){if(F??await AQ())try{let B=Lh({cmd:["aws","s3","ls","--no-sign-request","--region",Ah,`s3://${TH}/${D}/`],stdout:"pipe",stderr:"pipe"}),X=await new Response(B.stdout).text();if(await B.exited!==0)return!1;return X.trim().length>0}catch{}let J=`${PH}?list-type=2&prefix=${D}/&max-keys=1`,Q=await fetch(J);if(!Q.ok)return!1;return(await Q.text()).includes("<Key>")}async function Rh(D){let F=[],$;do{let J=`${PH}?list-type=2&prefix=${D}/`;if($)J+=`&continuation-token=${encodeURIComponent($)}`;let Q=await fetch(J);if(!Q.ok)throw Error(`Failed to list OpenNeuro dataset: HTTP ${Q.status}`);let Y=await Q.text(),B=Y.match(/<Contents>[\s\S]*?<\/Contents>/g)||[];for(let G of B){let H=G.match(/<Key>([^<]+)<\/Key>/),q=G.match(/<Size>(\d+)<\/Size>/);if(H&&q){let K=Zh(H[1]),V=Number.parseInt(q[1],10);if(K.endsWith("/")&&V===0)continue;F.push({key:K,size:V})}}if(Y.includes("<IsTruncated>true</IsTruncated>")){let G=Y.match(/<NextContinuationToken>([^<]+)<\/NextContinuationToken>/);if(!G)throw Error(`S3 listing indicated more results but no continuation token was provided. Got ${F.length} objects so far.`);$=Zh(G[1])}else $=void 0}while($);return F}async function Ch(D,F,$){let J=`s3://${TH}/${D}/`,Q=["aws","s3","sync","--no-sign-request","--region",Ah,J,F],Y;try{Y=Lh({cmd:Q,stdout:"pipe",stderr:"pipe"})}catch(V){return{success:!1,filesDownloaded:0,totalBytes:0,method:"aws-cli",error:`Failed to start AWS CLI: ${V.message}`}}let B=0,X=[],G=/^download:\s+s3:\/\/[^\s]+\/(.*?)\s+to\s+/;function H(V,E){if(V.startsWith("download:")){B++;let Z=V.match(G);$?.(B,Z?.[1]||"")}else if(E)X.push(V)}async function q(V,E){let Z=V.getReader(),L=new TextDecoder,M="";try{while(!0){let{done:N,value:w}=await Z.read();if(N)break;M+=L.decode(w,{stream:!0});let P=M.split(`
473
+ `);M=P.pop()||"";for(let C of P){let T=C.trim();if(T)H(T,E)}}let A=M.trim();if(A)H(A,E)}finally{Z.releaseLock()}}await Promise.all([q(Y.stdout,!1),q(Y.stderr,!0)]);let K=await Y.exited;if(K!==0)return{success:!1,filesDownloaded:B,totalBytes:0,method:"aws-cli",error:X.join(`
474
+ `)||`aws s3 sync exited with code ${K}`};return{success:!0,filesDownloaded:B,totalBytes:0,method:"aws-cli"}}async function LV0(D,F,$,J){let Q=D.substring(J.length+1),Y=ZV0($,Q);if(!Vh(Y).startsWith(`${Vh($)}/`))throw Error(`Path traversal detected in key: ${D}`);if(jH(Y))try{if(EV0(Y).size===F)return F}catch{}let X=VV0(Y);if(!jH(X))Uh(X,{recursive:!0});let G=D.split("/").map((K)=>encodeURIComponent(K)).join("/"),H=`${PH}/${G}`,q=await fetch(H);if(!q.ok)throw Error(`Failed to download ${Q}: HTTP ${q.status}`);return await Bun.write(Y,q),F}async function Oh(D,F,$,J={}){let{concurrency:Q=8,onProgress:Y}=J,B=$.length,X=$.reduce((L,M)=>L+M.size,0),G=0,H=0,q=0,K=[];if(!jH(F))Uh(F,{recursive:!0});let V=[...$],E=Math.min(Q,B),Z=Array.from({length:E},async()=>{while(V.length>0){let L=V.shift();if(!L)break;try{let M=await LV0(L.key,L.size,F,D);H++,q+=M}catch(M){K.push(M.message)}G++,Y?.(G,B,q,X)}});return await Promise.all(Z),{success:K.length===0,filesDownloaded:H,totalBytes:q,method:"https",error:K.length>0?`${K.length} file(s) failed:
475
475
  ${K.slice(0,10).join(`
476
476
  `)}${K.length>10?`
477
477
  ... and ${K.length-10} more`:""}`:void 0}}a6();var AV0={"git-annex":{name:"git-annex",cmd:["git-annex","version"],required:!0,installInstructions:{macos:"brew install git-annex",linux:"sudo apt-get install git-annex OR sudo dnf install git-annex"}},gh:{name:"GitHub CLI (gh)",cmd:["gh","--version"],required:!0,installInstructions:{macos:"brew install gh",linux:"See https://cli.github.com/manual/installation"}},aws:{name:"AWS CLI",cmd:["aws","--version"],required:!0,installInstructions:{macos:"brew install awscli",linux:"pip install awscli OR sudo snap install aws-cli --classic"}},git:{name:"git",cmd:["git","--version"],required:!0,installInstructions:{macos:"brew install git (or install Xcode Command Line Tools)",linux:"sudo apt-get install git"}}},MV0={upload:["git-annex","gh","aws"],download:["gh"],clone:["git","gh"],push:["git-annex","gh"],publish:["gh","aws"],update:["git","gh"],release:["git","gh"]};function NV0(D){if(process.platform==="darwin")return D.installInstructions.macos;return D.installInstructions.linux}async function RV0(D){try{let{exitCode:F}=await S(D.cmd);return F===0}catch(F){let $=F instanceof Error?F.message:String(F);if(!$.includes("ENOENT")&&!$.includes("not found"))console.error(` Warning: ${D.name} check failed unexpectedly: ${$}`);return!1}}async function l4(D){let $=MV0[D].map((B)=>AV0[B]).filter(Boolean),Q=(await Promise.all($.map(async(B)=>({check:B,available:await RV0(B)})))).filter((B)=>!B.available&&B.check.required).map((B)=>({tool:B.check.name,installInstruction:NV0(B.check)}));if(Q.length===0)return;let Y=[`
@@ -557,14 +557,14 @@ Examples:
557
557
  $ nemar dataset upload ./my-eeg-dataset
558
558
  $ nemar dataset upload ./ds -n "My EEG Study" -d "64-channel EEG data"
559
559
  $ nemar dataset upload ./ds --dry-run # Preview without uploading
560
- $ nemar dataset upload ./ds -j 16 # More parallel streams`).action(async(D,F)=>{let $=JD();if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);if(!Hf())console.log(W.yellow("Sandbox training required")),console.log(),console.log("You must complete sandbox training before uploading real datasets."),console.log("This verifies your setup and familiarizes you with the workflow."),console.log(),console.log("Run sandbox training with:"),console.log(W.cyan(" nemar sandbox")),process.exit(1);let J=YD(D);if(!t0(J))console.log(W.red(`Error: Path does not exist: ${J}`)),process.exit(1);await l4("upload");let Q=O("Checking prerequisites...").start(),Y=await x9();if(!Y.allPassed){Q.fail("Prerequisites check failed"),console.log();for(let R of Y.errors)console.log(W.red(` - ${R}`));process.exit(1)}if(Q.succeed("Prerequisites check passed"),console.log(W.dim(` git-annex ${Y.gitAnnex.version}`)),Y.githubSSH.username)console.log(W.dim(` GitHub: ${Y.githubSSH.username}`));console.log(),Q=O("Verifying GitHub CLI authentication...").start();let B=await _9($.githubUsername);if(!B.authenticated)Q.fail("GitHub CLI not authenticated"),console.log(W.red(` ${B.error}`)),console.log(),console.log("GitHub CLI is required for dataset uploads. Install and authenticate:"),console.log(W.cyan(" brew install gh # or visit https://cli.github.com/")),console.log(W.cyan(" gh auth login")),process.exit(1);if($.githubUsername&&!B.matches)Q.warn("GitHub CLI user mismatch"),console.log(W.yellow(` ${B.error}`)),console.log(),console.log("Your gh CLI is authenticated as a different GitHub account than your NEMAR account."),console.log("This may cause issues with repository access. To fix:"),console.log(W.cyan(` gh auth login # Login as ${$.githubUsername}`)),console.log(),console.log(W.yellow("WARNING: If upload fails with permission errors, this mismatch is the likely cause.")),console.log();else Q.succeed(`GitHub CLI authenticated as ${B.username}`);if(!F.skipValidation){Q=O("Validating BIDS dataset...").start();let R=YD(J,"dataset_description.json");if(!t0(R))Q.fail("Not a valid BIDS dataset"),console.log(W.red("Missing required file: dataset_description.json")),process.exit(1);if(!(await d9()).installed)Q.fail("Deno is required for BIDS validation"),console.log(),console.log(W.red("Error: Deno is not installed")),console.log(),console.log("The BIDS validator requires Deno runtime to run."),console.log("Install Deno with one of these commands:"),console.log(),console.log(W.cyan(" # macOS/Linux (curl)")),console.log(" curl -fsSL https://deno.land/install.sh | sh"),console.log(),console.log(W.cyan(" # macOS (Homebrew)")),console.log(" brew install deno"),console.log(),console.log(W.cyan(" # Windows (PowerShell)")),console.log(" irm https://deno.land/install.ps1 | iex"),console.log(),console.log("Learn more: https://docs.deno.com/runtime/getting_started/installation/"),console.log(),console.log(W.dim("To skip validation (not recommended): nemar dataset upload --skip-validation")),process.exit(1);try{let h=await Fh(J,{prune:!0});if(!h.valid)Q.fail("Dataset has validation errors"),console.log(),console.log(Jh(h)),console.log(),console.log(W.yellow("Fix the errors above before uploading.")),console.log(W.dim("Or use --skip-validation to upload anyway (not recommended).")),process.exit(1);Q.succeed(`Dataset is valid BIDS (${h.warningCount} warnings)`)}catch(h){Q.fail("Validation failed"),console.log(W.red(h.message)),process.exit(1)}console.log()}Q=O("Analyzing dataset files...").start();let X={};try{let R=YD(J,"dataset_description.json");X=JSON.parse(t1(R,"utf-8"))}catch(R){if(R.code!=="ENOENT")console.log(W.yellow(`Warning: Could not read dataset_description.json: ${R.message}`))}let G=F.name||(typeof X.Name==="string"?X.Name:null)||mV0(J),H=await DH(J);Q.succeed(`Found ${H.files.length} files (${H.dataFiles} data, ${H.metadataFiles} metadata)`);let q,K=YD(J,".nemar","metadata.json"),V=YD(J,"nemar_metadata.json");if(t0(K))try{q=JSON.parse(t1(K,"utf-8")),console.log(W.dim(" Using existing .nemar/metadata.json (author ORCIDs from prior run)"))}catch(R){console.log(W.yellow(` Warning: Could not read .nemar/metadata.json: ${R instanceof Error?R.message:R}. Will re-collect author information.`))}else if(t0(V))try{q=JSON.parse(t1(V,"utf-8")),console.log(W.dim(" Using existing nemar_metadata.json (author ORCIDs from prior run)"))}catch(R){console.log(W.yellow(` Warning: Could not read nemar_metadata.json: ${R instanceof Error?R.message:R}. Will re-collect author information.`))}if(!q&&!F.skipOrcid&&process.stdin.isTTY){let R=X.Authors,n=Array.isArray(R)?R.filter((h)=>typeof h==="string"):[];if(n.length>0)try{let h,P0;try{let V0=await eJ();h=V0.orcid||void 0,P0=V0.username}catch(V0){console.log(W.dim(` Could not fetch profile: ${w0(V0)}`))}console.log(),console.log(W.cyan("Authors found:"),n.join(" | "));let g={},J0;if(h&&P0){let V0=P0.toLowerCase(),BD=n.find((yD)=>yD.toLowerCase().includes(V0));if(BD)g[BD]={orcid:h},J0=BD,console.log(` Your ORCID (from profile): ${W.green(h)} (matched to "${BD}")`)}try{let{discoverOrcidsFromReferencedDois:V0}=await Promise.resolve().then(() => (ih(),nh)),BD=O("Looking up author ORCIDs from referenced publications...").start(),yD=await V0(X,g),W1=Object.keys(yD.discoveries).length;if(W1>0){BD.succeed(`Found ${W1} ORCID(s) from referenced DOIs`);for(let[e8,OD]of Object.entries(yD.discoveries))console.log(` ${W.green(OD.orcid)} -> "${e8}" (from ${OD.sourceDoi}, ${OD.confidence} match)`);let{confirmOrcids:xF}=await D0.prompt([{type:"confirm",name:"confirmOrcids",message:"Accept these auto-discovered ORCIDs?",default:!0}]);if(xF)for(let[e8,OD]of Object.entries(yD.discoveries))g[e8]={...g[e8],orcid:OD.orcid,...OD.affiliations&&{affiliations:OD.affiliations}}}else BD.info("No ORCIDs found from referenced DOIs")}catch(V0){console.log(W.yellow(` Could not auto-discover ORCIDs: ${w0(V0)}`))}for(let V0 of n){if(V0===J0)continue;if(g[V0]?.orcid)continue;let{orcid:BD}=await D0.prompt([{type:"input",name:"orcid",message:`ORCID for "${V0}" (Enter to skip):`,validate:(yD)=>{if(!yD)return!0;return rJ.test(yD)||"Invalid ORCID format (XXXX-XXXX-XXXX-XXXX)"}}]);if(BD){let yD={orcid:BD},{affiliation:W1}=await D0.prompt([{type:"input",name:"affiliation",message:` Affiliation for "${V0}" (optional):`}]);if(W1)yD.affiliations=[{name:W1}];g[V0]=yD}}if(Object.keys(g).length>0){q={version:"2.0",authors:g};try{let V0=YD(J,".nemar");if(!t0(V0))ah(V0,{recursive:!0});let BD=YD(V0,"metadata.json");d4(BD,JSON.stringify(q,null,2)),console.log(W.dim(" Saved .nemar/metadata.json with author ORCIDs"))}catch(V0){console.log(W.yellow(` Warning: Could not save .nemar/metadata.json: ${w0(V0)}`))}}console.log()}catch(h){if(h instanceof b)console.log(W.yellow(` Could not fetch profile: ${h.message}`));else console.log(W.yellow(` Could not collect ORCIDs: ${w0(h)}`));console.log(W.dim(" Continuing without author enrichment."))}}let E;if(process.stdin.isTTY&&!F.skipValidation){let R=Hh(J);if(R.spdxId){if(console.log(),console.log(W.cyan("License detected:"),W.bold(R.spdxId),W.dim(`(from ${R.source==="dataset_description"?"dataset_description.json":"LICENSE file"})`)),!qh(R.spdxId))console.log(W.yellow(` Warning: "${R.spdxId}" is not in the list of known research-compatible licenses.`));let{keepLicense:h}=await D0.prompt([{type:"confirm",name:"keepLicense",message:`Use "${R.spdxId}" as the dataset license?`,default:!0}]);if(h)E=R.spdxId;else E=await wH(R.spdxId)}else{if(console.log(),R.source==="license_file")console.log(W.yellow("A LICENSE file was found but the license could not be identified automatically."));else console.log(W.yellow("No license found in this dataset."));console.log(W.dim("A license is required to publish on NEMAR.")),E=await wH()}try{let h=YD(J,"dataset_description.json");if(t0(h)){if(JSON.parse(t1(h,"utf-8")).License!==E)zh(J,E),console.log(W.dim(` Updated dataset_description.json License -> ${E}`))}}catch(h){console.log(W.yellow(` Warning: Could not update license in dataset_description.json: ${w0(h)}`))}if(Kh(J,E))console.log(W.dim(` Created LICENSE file (${E})`));console.log()}if(process.stdin.isTTY&&!F.skipValidation&&E){let R=await wh(E);if(R.isDerived&&R.sourceDatasets&&R.sourceDatasets.length>0){try{let n=YD(J,"dataset_description.json");if(t0(n)){let h=JSON.parse(t1(n,"utf-8")),P0=Array.isArray(h.SourceDatasets)?h.SourceDatasets:[],g=R.sourceDatasets.map((V0)=>V0.identifier),J0=Array.from(new Set([...P0,...g]));h.SourceDatasets=J0,d4(n,`${JSON.stringify(h,null,2)}
561
- `),console.log(W.dim(` Updated dataset_description.json SourceDatasets (${J0.length} source(s))`))}}catch(n){console.log(W.yellow(` Warning: Could not update SourceDatasets: ${w0(n)}`))}console.log()}}let Z=NH(J);if(console.log(),Z)console.log(W.bold.yellow("Resume Upload:")),console.log(` Dataset ID: ${W.cyan(Z.dataset_id)}`),console.log(` Last attempt: ${Z.last_upload_at||Z.created_at}`);else console.log(W.bold("Upload Plan:"));if(console.log(` Name: ${G}`),console.log(` Path: ${J}`),console.log(` Files: ${H.files.length}`),console.log(` Size: ${XD(H.totalSize)}`),console.log(` Data files: ${H.dataFiles} (will be uploaded to S3)`),console.log(` Metadata files: ${H.metadataFiles} (will be stored in git)`),console.log(` Parallel jobs: ${F.jobs}`),console.log(),F.dryRun){console.log(W.yellow("Dry run mode - no changes made"));return}let L=await k0("Proceed with upload?",{yes:F.yes,no:F.no},!0);if(L!=="confirmed"){console.log(L==="declined"?"Upload skipped.":"Upload cancelled.");return}console.log();let A=H.files.filter((R)=>R.type==="data");if(F.restart)CQ(J),console.log(W.dim(" Upload progress cleared (--restart)")),console.log();let M=F.restart?null:Sh(J);if(M){let R=yh(M);if(console.log(W.bold.cyan("Upload Progress:")),console.log(` Files: ${R.uploaded}/${R.total} uploaded, ${R.failed} failed, ${R.pending} pending`),R.completedSteps.length>0)console.log(` Completed steps: ${R.completedSteps.join(", ")}`);console.log()}let N=M?vh(M,A):A,w;if(Z!==null){Q=O(`Resuming upload for ${Z.dataset_id}...`).start();try{await uD(Z.dataset_id),w={dataset_id:Z.dataset_id,ssh_url:Z.ssh_url,s3_prefix:Z.s3_prefix,github_url:Z.github_url,upload_urls:{},s3_config:Z.s3_config},Q.succeed(`Resuming upload: ${w.dataset_id}`)}catch(R){if(Q.fail("Failed to resume upload"),R instanceof b){if(console.log(W.red(` ${R.message}`)),R.statusCode===404)console.log(W.yellow(" The dataset may have been deleted. Try uploading as a new dataset.")),console.log(W.dim(` Remove ${J}/.nemar to start fresh.`))}else console.log(W.red(` ${R.message}`));process.exit(1)}}else{Q=O("Creating dataset in NEMAR...").start();try{let R=await $Q({name:G,description:F.description,files:A.map((h)=>({path:h.path,size:h.size,type:h.type}))});w={dataset_id:R.dataset.dataset_id,ssh_url:R.dataset.ssh_url,s3_prefix:R.dataset.s3_prefix,github_url:R.dataset.github_url,upload_urls:R.upload_urls||{},s3_config:R.s3_config};let n={dataset_id:w.dataset_id,github_url:w.github_url,ssh_url:w.ssh_url,s3_prefix:w.s3_prefix,s3_config:w.s3_config,created_at:new Date().toISOString()};if(RH(J,n),R.resumed)Q.succeed(`Resumed existing dataset: ${w.dataset_id}`);else Q.succeed(`Dataset created: ${w.dataset_id}`),await new Promise((h)=>setTimeout(h,1e4))}catch(R){if(Q.fail("Failed to create dataset"),R instanceof b)console.log(W.red(` ${R.message}`));else console.log(W.red(` ${R.message}`));process.exit(1)}}if(M&&M.dataset_id!==w.dataset_id)console.log(W.yellow(" Progress file is for a different dataset; starting fresh.")),CQ(J),M=null;Q=O("Accepting GitHub repository invitation...").start();let C=w.github_url?.match(/github\.com\/([a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+)/),T=C?C[1].replace(/\.git$/,""):null;if(!T)Q.fail("Invalid GitHub repository URL from backend"),console.log(W.red(` Received: ${w.github_url||"(empty)"}`)),console.log(W.red(" Expected format: https://github.com/owner/repo")),console.log(),console.log("This may indicate a backend issue. Please contact support."),process.exit(1);let y=await f9(T);if(y.accepted)if(y.alreadyCollaborator)Q.succeed("Already a collaborator on this repository");else Q.succeed("GitHub invitation accepted");else Q.warn("Could not auto-accept invitation"),console.log(W.yellow(` ${y.error}`)),console.log(),console.log("You may need to accept the invitation manually:"),console.log(W.cyan(` https://github.com/${T}/invitations`)),console.log();Q=O("Initializing git-annex dataset...").start();let d=$.username&&$.email?{name:$.username,email:$.email}:void 0;if(!await w1(J)){let R=await n6(J,{author:d});if(!R.success)Q.fail("Failed to initialize git-annex dataset"),console.log(W.red(` ${R.error}`)),process.exit(1)}let F0=await hW(J);if(!F0.success)Q.fail("Failed to initialize git-annex"),console.log(W.red(` ${F0.error}`)),process.exit(1);let O0=await g4(J);if(!O0.success)Q.warn("Could not configure largefiles pattern"),console.log(W.dim(` ${O0.error}`));Q.succeed("git-annex dataset initialized");let e=await s8(J);if(e?.startsWith("adjusted/"))console.log(W.dim(` Note: Your local branch is "${e}".`)),console.log(W.dim(" This is normal; it keeps files unlocked so you can work with them directly.")),console.log(W.dim(' Pushes will go to the "main" branch on GitHub automatically.'));try{let R=YD(J,".gitignore"),n="";if(t0(R))n=t1(R,"utf-8");if(!n.includes(".nemar/")){let h=n?`${n.trimEnd()}
560
+ $ nemar dataset upload ./ds -j 16 # More parallel streams`).action(async(D,F)=>{let $=JD();if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);if(!Hf())console.log(W.yellow("Sandbox training required")),console.log(),console.log("You must complete sandbox training before uploading real datasets."),console.log("This verifies your setup and familiarizes you with the workflow."),console.log(),console.log("Run sandbox training with:"),console.log(W.cyan(" nemar sandbox")),process.exit(1);let J=YD(D);if(!t0(J))console.log(W.red(`Error: Path does not exist: ${J}`)),process.exit(1);await l4("upload");let Q=O("Checking prerequisites...").start(),Y=await x9();if(!Y.allPassed){Q.fail("Prerequisites check failed"),console.log();for(let R of Y.errors)console.log(W.red(` - ${R}`));process.exit(1)}if(Q.succeed("Prerequisites check passed"),console.log(W.dim(` git-annex ${Y.gitAnnex.version}`)),Y.githubSSH.username)console.log(W.dim(` GitHub: ${Y.githubSSH.username}`));console.log(),Q=O("Verifying GitHub CLI authentication...").start();let B=await _9($.githubUsername);if(!B.authenticated)Q.fail("GitHub CLI not authenticated"),console.log(W.red(` ${B.error}`)),console.log(),console.log("GitHub CLI is required for dataset uploads. Install and authenticate:"),console.log(W.cyan(" brew install gh # or visit https://cli.github.com/")),console.log(W.cyan(" gh auth login")),process.exit(1);if($.githubUsername&&!B.matches)Q.warn("GitHub CLI user mismatch"),console.log(W.yellow(` ${B.error}`)),console.log(),console.log("Your gh CLI is authenticated as a different GitHub account than your NEMAR account."),console.log("This may cause issues with repository access. To fix:"),console.log(W.cyan(` gh auth login # Login as ${$.githubUsername}`)),console.log(),console.log(W.yellow("WARNING: If upload fails with permission errors, this mismatch is the likely cause.")),console.log();else Q.succeed(`GitHub CLI authenticated as ${B.username}`);if(!F.skipValidation){Q=O("Validating BIDS dataset...").start();let R=YD(J,"dataset_description.json");if(!t0(R))Q.fail("Not a valid BIDS dataset"),console.log(W.red("Missing required file: dataset_description.json")),process.exit(1);if(!(await d9()).installed)Q.fail("Deno is required for BIDS validation"),console.log(),console.log(W.red("Error: Deno is not installed")),console.log(),console.log("The BIDS validator requires Deno runtime to run."),console.log("Install Deno with one of these commands:"),console.log(),console.log(W.cyan(" # macOS/Linux (curl)")),console.log(" curl -fsSL https://deno.land/install.sh | sh"),console.log(),console.log(W.cyan(" # macOS (Homebrew)")),console.log(" brew install deno"),console.log(),console.log(W.cyan(" # Windows (PowerShell)")),console.log(" irm https://deno.land/install.ps1 | iex"),console.log(),console.log("Learn more: https://docs.deno.com/runtime/getting_started/installation/"),console.log(),console.log(W.dim("To skip validation (not recommended): nemar dataset upload --skip-validation")),process.exit(1);try{let b=await Fh(J,{prune:!0});if(!b.valid)Q.fail("Dataset has validation errors"),console.log(),console.log(Jh(b)),console.log(),console.log(W.yellow("Fix the errors above before uploading.")),console.log(W.dim("Or use --skip-validation to upload anyway (not recommended).")),process.exit(1);Q.succeed(`Dataset is valid BIDS (${b.warningCount} warnings)`)}catch(b){Q.fail("Validation failed"),console.log(W.red(b.message)),process.exit(1)}console.log()}Q=O("Analyzing dataset files...").start();let X={};try{let R=YD(J,"dataset_description.json");X=JSON.parse(t1(R,"utf-8"))}catch(R){if(R.code!=="ENOENT")console.log(W.yellow(`Warning: Could not read dataset_description.json: ${R.message}`))}let G=F.name||(typeof X.Name==="string"?X.Name:null)||mV0(J),H=await DH(J);Q.succeed(`Found ${H.files.length} files (${H.dataFiles} data, ${H.metadataFiles} metadata)`);let q,K=YD(J,".nemar","metadata.json"),V=YD(J,"nemar_metadata.json");if(t0(K))try{q=JSON.parse(t1(K,"utf-8")),console.log(W.dim(" Using existing .nemar/metadata.json (author ORCIDs from prior run)"))}catch(R){console.log(W.yellow(` Warning: Could not read .nemar/metadata.json: ${R instanceof Error?R.message:R}. Will re-collect author information.`))}else if(t0(V))try{q=JSON.parse(t1(V,"utf-8")),console.log(W.dim(" Using existing nemar_metadata.json (author ORCIDs from prior run)"))}catch(R){console.log(W.yellow(` Warning: Could not read nemar_metadata.json: ${R instanceof Error?R.message:R}. Will re-collect author information.`))}if(!q&&!F.skipOrcid&&process.stdin.isTTY){let R=X.Authors,n=Array.isArray(R)?R.filter((b)=>typeof b==="string"):[];if(n.length>0)try{let b,P0;try{let V0=await eJ();b=V0.orcid||void 0,P0=V0.username}catch(V0){console.log(W.dim(` Could not fetch profile: ${w0(V0)}`))}console.log(),console.log(W.cyan("Authors found:"),n.join(" | "));let g={},J0;if(b&&P0){let V0=P0.toLowerCase(),BD=n.find((yD)=>yD.toLowerCase().includes(V0));if(BD)g[BD]={orcid:b},J0=BD,console.log(` Your ORCID (from profile): ${W.green(b)} (matched to "${BD}")`)}try{let{discoverOrcidsFromReferencedDois:V0}=await Promise.resolve().then(() => (ih(),nh)),BD=O("Looking up author ORCIDs from referenced publications...").start(),yD=await V0(X,g),W1=Object.keys(yD.discoveries).length;if(W1>0){BD.succeed(`Found ${W1} ORCID(s) from referenced DOIs`);for(let[e8,OD]of Object.entries(yD.discoveries))console.log(` ${W.green(OD.orcid)} -> "${e8}" (from ${OD.sourceDoi}, ${OD.confidence} match)`);let{confirmOrcids:xF}=await D0.prompt([{type:"confirm",name:"confirmOrcids",message:"Accept these auto-discovered ORCIDs?",default:!0}]);if(xF)for(let[e8,OD]of Object.entries(yD.discoveries))g[e8]={...g[e8],orcid:OD.orcid,...OD.affiliations&&{affiliations:OD.affiliations}}}else BD.info("No ORCIDs found from referenced DOIs")}catch(V0){console.log(W.yellow(` Could not auto-discover ORCIDs: ${w0(V0)}`))}for(let V0 of n){if(V0===J0)continue;if(g[V0]?.orcid)continue;let{orcid:BD}=await D0.prompt([{type:"input",name:"orcid",message:`ORCID for "${V0}" (Enter to skip):`,validate:(yD)=>{if(!yD)return!0;return rJ.test(yD)||"Invalid ORCID format (XXXX-XXXX-XXXX-XXXX)"}}]);if(BD){let yD={orcid:BD},{affiliation:W1}=await D0.prompt([{type:"input",name:"affiliation",message:` Affiliation for "${V0}" (optional):`}]);if(W1)yD.affiliations=[{name:W1}];g[V0]=yD}}if(Object.keys(g).length>0){q={version:"2.0",authors:g};try{let V0=YD(J,".nemar");if(!t0(V0))ah(V0,{recursive:!0});let BD=YD(V0,"metadata.json");d4(BD,JSON.stringify(q,null,2)),console.log(W.dim(" Saved .nemar/metadata.json with author ORCIDs"))}catch(V0){console.log(W.yellow(` Warning: Could not save .nemar/metadata.json: ${w0(V0)}`))}}console.log()}catch(b){if(b instanceof h)console.log(W.yellow(` Could not fetch profile: ${b.message}`));else console.log(W.yellow(` Could not collect ORCIDs: ${w0(b)}`));console.log(W.dim(" Continuing without author enrichment."))}}let E;if(process.stdin.isTTY&&!F.skipValidation){let R=Hh(J);if(R.spdxId){if(console.log(),console.log(W.cyan("License detected:"),W.bold(R.spdxId),W.dim(`(from ${R.source==="dataset_description"?"dataset_description.json":"LICENSE file"})`)),!qh(R.spdxId))console.log(W.yellow(` Warning: "${R.spdxId}" is not in the list of known research-compatible licenses.`));let{keepLicense:b}=await D0.prompt([{type:"confirm",name:"keepLicense",message:`Use "${R.spdxId}" as the dataset license?`,default:!0}]);if(b)E=R.spdxId;else E=await wH(R.spdxId)}else{if(console.log(),R.source==="license_file")console.log(W.yellow("A LICENSE file was found but the license could not be identified automatically."));else console.log(W.yellow("No license found in this dataset."));console.log(W.dim("A license is required to publish on NEMAR.")),E=await wH()}try{let b=YD(J,"dataset_description.json");if(t0(b)){if(JSON.parse(t1(b,"utf-8")).License!==E)zh(J,E),console.log(W.dim(` Updated dataset_description.json License -> ${E}`))}}catch(b){console.log(W.yellow(` Warning: Could not update license in dataset_description.json: ${w0(b)}`))}if(Kh(J,E))console.log(W.dim(` Created LICENSE file (${E})`));console.log()}if(process.stdin.isTTY&&!F.skipValidation&&E){let R=await wh(E);if(R.isDerived&&R.sourceDatasets&&R.sourceDatasets.length>0){try{let n=YD(J,"dataset_description.json");if(t0(n)){let b=JSON.parse(t1(n,"utf-8")),P0=Array.isArray(b.SourceDatasets)?b.SourceDatasets:[],g=R.sourceDatasets.map((V0)=>V0.identifier),J0=Array.from(new Set([...P0,...g]));b.SourceDatasets=J0,d4(n,`${JSON.stringify(b,null,2)}
561
+ `),console.log(W.dim(` Updated dataset_description.json SourceDatasets (${J0.length} source(s))`))}}catch(n){console.log(W.yellow(` Warning: Could not update SourceDatasets: ${w0(n)}`))}console.log()}}let Z=NH(J);if(console.log(),Z)console.log(W.bold.yellow("Resume Upload:")),console.log(` Dataset ID: ${W.cyan(Z.dataset_id)}`),console.log(` Last attempt: ${Z.last_upload_at||Z.created_at}`);else console.log(W.bold("Upload Plan:"));if(console.log(` Name: ${G}`),console.log(` Path: ${J}`),console.log(` Files: ${H.files.length}`),console.log(` Size: ${XD(H.totalSize)}`),console.log(` Data files: ${H.dataFiles} (will be uploaded to S3)`),console.log(` Metadata files: ${H.metadataFiles} (will be stored in git)`),console.log(` Parallel jobs: ${F.jobs}`),console.log(),F.dryRun){console.log(W.yellow("Dry run mode - no changes made"));return}let L=await k0("Proceed with upload?",{yes:F.yes,no:F.no},!0);if(L!=="confirmed"){console.log(L==="declined"?"Upload skipped.":"Upload cancelled.");return}console.log();let M=H.files.filter((R)=>R.type==="data");if(F.restart)CQ(J),console.log(W.dim(" Upload progress cleared (--restart)")),console.log();let A=F.restart?null:Sh(J);if(A){let R=yh(A);if(console.log(W.bold.cyan("Upload Progress:")),console.log(` Files: ${R.uploaded}/${R.total} uploaded, ${R.failed} failed, ${R.pending} pending`),R.completedSteps.length>0)console.log(` Completed steps: ${R.completedSteps.join(", ")}`);console.log()}let N=A?vh(A,M):M,w;if(Z!==null){Q=O(`Resuming upload for ${Z.dataset_id}...`).start();try{await uD(Z.dataset_id),w={dataset_id:Z.dataset_id,ssh_url:Z.ssh_url,s3_prefix:Z.s3_prefix,github_url:Z.github_url,upload_urls:{},s3_config:Z.s3_config},Q.succeed(`Resuming upload: ${w.dataset_id}`)}catch(R){if(Q.fail("Failed to resume upload"),R instanceof h){if(console.log(W.red(` ${R.message}`)),R.statusCode===404)console.log(W.yellow(" The dataset may have been deleted. Try uploading as a new dataset.")),console.log(W.dim(` Remove ${J}/.nemar to start fresh.`))}else console.log(W.red(` ${R.message}`));process.exit(1)}}else{Q=O("Creating dataset in NEMAR...").start();try{let R=await $Q({name:G,description:F.description,files:M.map((b)=>({path:b.path,size:b.size,type:b.type}))});w={dataset_id:R.dataset.dataset_id,ssh_url:R.dataset.ssh_url,s3_prefix:R.dataset.s3_prefix,github_url:R.dataset.github_url,upload_urls:R.upload_urls||{},s3_config:R.s3_config};let n={dataset_id:w.dataset_id,github_url:w.github_url,ssh_url:w.ssh_url,s3_prefix:w.s3_prefix,s3_config:w.s3_config,created_at:new Date().toISOString()};if(RH(J,n),R.resumed)Q.succeed(`Resumed existing dataset: ${w.dataset_id}`);else Q.succeed(`Dataset created: ${w.dataset_id}`),await new Promise((b)=>setTimeout(b,1e4))}catch(R){if(Q.fail("Failed to create dataset"),R instanceof h)console.log(W.red(` ${R.message}`));else console.log(W.red(` ${R.message}`));process.exit(1)}}if(A&&A.dataset_id!==w.dataset_id)console.log(W.yellow(" Progress file is for a different dataset; starting fresh.")),CQ(J),A=null;Q=O("Accepting GitHub repository invitation...").start();let C=w.github_url?.match(/github\.com\/([a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+)/),T=C?C[1].replace(/\.git$/,""):null;if(!T)Q.fail("Invalid GitHub repository URL from backend"),console.log(W.red(` Received: ${w.github_url||"(empty)"}`)),console.log(W.red(" Expected format: https://github.com/owner/repo")),console.log(),console.log("This may indicate a backend issue. Please contact support."),process.exit(1);let y=await f9(T);if(y.accepted)if(y.alreadyCollaborator)Q.succeed("Already a collaborator on this repository");else Q.succeed("GitHub invitation accepted");else Q.warn("Could not auto-accept invitation"),console.log(W.yellow(` ${y.error}`)),console.log(),console.log("You may need to accept the invitation manually:"),console.log(W.cyan(` https://github.com/${T}/invitations`)),console.log();Q=O("Initializing git-annex dataset...").start();let d=$.username&&$.email?{name:$.username,email:$.email}:void 0;if(!await w1(J)){let R=await n6(J,{author:d});if(!R.success)Q.fail("Failed to initialize git-annex dataset"),console.log(W.red(` ${R.error}`)),process.exit(1)}let F0=await hW(J);if(!F0.success)Q.fail("Failed to initialize git-annex"),console.log(W.red(` ${F0.error}`)),process.exit(1);let O0=await g4(J);if(!O0.success)Q.warn("Could not configure largefiles pattern"),console.log(W.dim(` ${O0.error}`));Q.succeed("git-annex dataset initialized");let e=await s8(J);if(e?.startsWith("adjusted/"))console.log(W.dim(` Note: Your local branch is "${e}".`)),console.log(W.dim(" This is normal; it keeps files unlocked so you can work with them directly.")),console.log(W.dim(' Pushes will go to the "main" branch on GitHub automatically.'));try{let R=YD(J,".gitignore"),n="";if(t0(R))n=t1(R,"utf-8");if(!n.includes(".nemar/")){let b=n?`${n.trimEnd()}
562
562
  .nemar/
563
563
  `:`.nemar/
564
- `;d4(R,h)}}catch(R){console.log(W.yellow(` Warning: Could not update .gitignore: ${w0(R)}`))}Q=O("Configuring GitHub remote...").start();let N0=await a8(J,w.ssh_url);if(!N0.success)Q.fail("Failed to configure GitHub remote"),console.log(W.red(` ${N0.error}`)),process.exit(1);if(Q.succeed("GitHub remote configured"),!await h9(J,{yes:F.yes}))process.exit(1);if(!M)M=Ih(J,w.dataset_id,A);else{for(let R of A)if(!M.files[R.path])M.files[R.path]={status:"pending",size:R.size,updated_at:new Date().toISOString()};r1(J,M)}if(!vF(M,"s3_upload")){if(N.length>0){Q=O("Requesting upload credentials...").start();let R;try{R=await O8(w.dataset_id),Q.succeed("Upload credentials received (2h expiry)")}catch(g){Q.fail(`Could not get upload credentials: ${w0(g)}`),console.log(W.red(" Upload credentials are required for S3 access.")),console.log(W.dim(" Re-run the command to retry.")),process.exit(1)}Q=O("Configuring S3 remote...").start();let n=await w8(J,{name:"nemar-s3",bucket:R.s3.bucket,prefix:`${w.dataset_id}/objects`,region:R.s3.region,publicUrl:w.s3_config.public_url},RD(R.credentials));if(!n.success)Q.fail(`Failed to configure S3 remote: ${n.error}`),console.log(W.dim(" Re-run the command to retry.")),process.exit(1);Q.succeed("S3 remote configured"),Q=O("Tracking data files with git-annex...").start();let h=await i6(J);if(!h.success)Q.fail(`Failed to track data files: ${h.error}`),process.exit(1);Q.succeed("Data files tracked by git-annex"),Q=O(`Uploading ${N.length} data files to S3...`).start();let P0=await j8(J,"nemar-s3",Number.parseInt(F.jobs,10),RD(R.credentials));if(await kD(J),!P0.success)Q.fail(`S3 upload failed: ${P0.error}`),console.log(W.yellow("Re-run the same command to resume uploading.")),process.exit(1);for(let g of N)kh(M,g.path);r1(J,M),Q.succeed(`Uploaded ${P0.filesCopied} data files to S3`)}else console.log(W.dim("No data files to upload to S3"));kF(M,"s3_upload"),r1(J,M)}else console.log(W.dim(" S3 upload already completed (skipping)"));if(!vF(M,"metadata_write")){if(q)try{let R=YD(J,".nemar"),n=YD(R,"metadata.json");if(!t0(n)){if(!t0(R))ah(R,{recursive:!0});d4(n,JSON.stringify(q,null,2))}let h=YD(J,".bidsignore"),P0="";if(t0(h))P0=t1(h,"utf-8");if(!P0.includes(".nemar/")){let g=P0?`${P0.trimEnd()}
564
+ `;d4(R,b)}}catch(R){console.log(W.yellow(` Warning: Could not update .gitignore: ${w0(R)}`))}Q=O("Configuring GitHub remote...").start();let N0=await a8(J,w.ssh_url);if(!N0.success)Q.fail("Failed to configure GitHub remote"),console.log(W.red(` ${N0.error}`)),process.exit(1);if(Q.succeed("GitHub remote configured"),!await h9(J,{yes:F.yes}))process.exit(1);if(!A)A=Ih(J,w.dataset_id,M);else{for(let R of M)if(!A.files[R.path])A.files[R.path]={status:"pending",size:R.size,updated_at:new Date().toISOString()};r1(J,A)}if(!vF(A,"s3_upload")){if(N.length>0){Q=O("Requesting upload credentials...").start();let R;try{R=await O8(w.dataset_id),Q.succeed("Upload credentials received (2h expiry)")}catch(g){Q.fail(`Could not get upload credentials: ${w0(g)}`),console.log(W.red(" Upload credentials are required for S3 access.")),console.log(W.dim(" Re-run the command to retry.")),process.exit(1)}Q=O("Configuring S3 remote...").start();let n=await w8(J,{name:"nemar-s3",bucket:R.s3.bucket,prefix:`${w.dataset_id}/objects`,region:R.s3.region,publicUrl:w.s3_config.public_url},RD(R.credentials));if(!n.success)Q.fail(`Failed to configure S3 remote: ${n.error}`),console.log(W.dim(" Re-run the command to retry.")),process.exit(1);Q.succeed("S3 remote configured"),Q=O("Tracking data files with git-annex...").start();let b=await i6(J);if(!b.success)Q.fail(`Failed to track data files: ${b.error}`),process.exit(1);Q.succeed("Data files tracked by git-annex"),Q=O(`Uploading ${N.length} data files to S3...`).start();let P0=await j8(J,"nemar-s3",Number.parseInt(F.jobs,10),RD(R.credentials));if(await kD(J),!P0.success)Q.fail(`S3 upload failed: ${P0.error}`),console.log(W.yellow("Re-run the same command to resume uploading.")),process.exit(1);for(let g of N)kh(A,g.path);r1(J,A),Q.succeed(`Uploaded ${P0.filesCopied} data files to S3`)}else console.log(W.dim("No data files to upload to S3"));kF(A,"s3_upload"),r1(J,A)}else console.log(W.dim(" S3 upload already completed (skipping)"));if(!vF(A,"metadata_write")){if(q)try{let R=YD(J,".nemar"),n=YD(R,"metadata.json");if(!t0(n)){if(!t0(R))ah(R,{recursive:!0});d4(n,JSON.stringify(q,null,2))}let b=YD(J,".bidsignore"),P0="";if(t0(b))P0=t1(b,"utf-8");if(!P0.includes(".nemar/")){let g=P0?`${P0.trimEnd()}
565
565
  .nemar/
566
566
  `:`.nemar/
567
- `;d4(h,g)}console.log(W.dim(" Updated .bidsignore for NEMAR metadata"))}catch(R){console.log(W.yellow(` Warning: Could not update .bidsignore: ${w0(R)}`)),console.log(W.dim(" Upload will continue without author enrichment."))}kF(M,"metadata_write"),r1(J,M)}else console.log(W.dim(" Metadata write already completed (skipping)"));if(!vF(M,"dataset_save")){Q=O("Saving dataset changes...").start();let R=await o8(J,"Initial NEMAR dataset upload",d);if(!R.success)r1(J,M),Q.fail("Failed to save dataset"),console.log(W.red(` ${R.error}`)),console.log(),console.log(W.yellow("Re-run the same command to resume from this step.")),process.exit(1);Q.succeed("Dataset changes saved"),kF(M,"dataset_save"),r1(J,M)}else console.log(W.dim(" Dataset save already completed (skipping)"));if(!vF(M,"github_push")){Q=O("Pushing metadata to GitHub...").start();let R=await o1(J);if(!R.success)r1(J,M),Q.fail("Failed to push to GitHub"),console.log(W.red(` ${R.error}`)),console.log(),console.log(W.yellow("Re-run the same command to resume from this step.")),process.exit(1);if(R.warning)Q.warn("Metadata pushed to GitHub (with warning)"),console.log(W.yellow(` ${R.warning}`));else Q.succeed("Metadata pushed to GitHub");kF(M,"github_push"),r1(J,M)}else console.log(W.dim(" GitHub push already completed (skipping)"));if(!vF(M,"ci_deploy")){Q=O("Setting up BIDS validation CI...").start();try{await f4(w.dataset_id),Q.succeed("BIDS validation CI configured")}catch(R){if(R instanceof b&&R.statusCode===403)Q.info("CI workflow will be configured by an admin");else{let n=R instanceof Error?R.message:String(R);Q.warn(`Could not configure CI: ${n}`),console.log(W.dim(` An admin can add it later with: nemar admin ci add ${w.dataset_id}`))}}kF(M,"ci_deploy"),r1(J,M)}else console.log(W.dim(" CI deploy already completed (skipping)"));CQ(J),Xh(J),console.log(),console.log(W.green.bold("Upload complete!")),console.log(),console.log(` Dataset ID: ${W.cyan(w.dataset_id)}`),console.log(` GitHub: ${W.cyan(w.github_url)}`),console.log(),console.log(W.dim("To download this dataset:")),console.log(W.dim(` nemar dataset download ${w.dataset_id}`)),console.log(),console.log(W.yellow("Note: This dataset is private. Only the owner and designated collaborators can")),console.log(W.yellow("download it, and only through the NEMAR CLI (not direct git-annex commands).")),console.log(W.yellow("After publishing, the data will be publicly available for everyone."))});function pV0(D,F,$,J){let Q=Math.round(D/F*100),Y=20,B=Math.round(Q/100*20);return`${`[${"=".repeat(B)}${" ".repeat(20-B)}]`} ${Q}% | ${D}/${F} files | ${XD($)} / ${XD(J)}`}async function dV0(D,F){if(console.log(),console.log(W.yellow("OpenNeuro Dataset")),console.log(W.yellow("This dataset will be downloaded as plain files from OpenNeuro's public S3 bucket.")),console.log(W.yellow("Unlike NEMAR datasets, there is no git-annex version tracking or selective file download.")),console.log(W.dim("For full version control, use DataLad directly:")),console.log(W.dim(` datalad install https://github.com/OpenNeuroDatasets/${D}`)),console.log(),F.data===!1)console.log(W.yellow("Note: --no-data is not supported for OpenNeuro downloads. Downloading all files.")),console.log();let $=F.output||D,J=YD($);if(t0(J))console.log(W.red(`Error: Output path already exists: ${J}`)),console.log("Remove or rename the existing directory and try again."),process.exit(1);let Q=await AQ(),Y=O(`Checking OpenNeuro for ${D}...`).start(),B;try{B=await Nh(D,Q)}catch(X){Y.fail(`Could not reach OpenNeuro: ${X.message}`),process.exit(1)}if(!B)Y.fail(`Dataset ${D} not found on OpenNeuro`),process.exit(1);if(Y.succeed(`Found ${D} on OpenNeuro`),Q){console.log(),console.log(W.bold("Download Plan:")),console.log(` Dataset: ${D} (OpenNeuro)`),console.log(` Output: ${J}`),console.log(" Method: AWS CLI (aws s3 sync)"),console.log(),console.log(W.bold("Downloading data files..."));let X=await Ch(D,J,(G)=>{process.stderr.write(`\r${W.cyan(` ${G} files downloaded`)}`)});if(process.stderr.write(`\r${" ".repeat(40)}\r`),!X.success)console.log(W.red(`Download failed: ${X.error}`)),process.exit(1);console.log(W.green(`Downloaded ${X.filesDownloaded} files`))}else{console.log(),console.log(W.yellow("AWS CLI not found. Using direct HTTPS download.")),console.log(W.yellow("This will be slower than AWS CLI. To install it:")),console.log(W.dim(" https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html")),console.log();let X=O("Listing dataset files...").start(),G;try{G=await Rh(D)}catch(V){X.fail(`Failed to list files: ${V.message}`),process.exit(1)}if(G.length===0)X.fail("No files found in dataset"),process.exit(1);let H=G.reduce((V,E)=>V+E.size,0);X.succeed(`${G.length} files (${XD(H)})`),console.log(W.bold("Download Plan:")),console.log(` Dataset: ${D} (OpenNeuro)`),console.log(` Output: ${J}`),console.log(" Method: HTTPS (direct download)"),console.log(` Files: ${G.length} (${XD(H)})`),console.log(),console.log(W.bold("Downloading data files..."));let q=Number.parseInt(F.jobs||"8",10),K=await Oh(D,J,G,{concurrency:q,onProgress:(V,E,Z,L)=>{process.stderr.write(`\r${W.cyan(pV0(V,E,Z,L))}`)}});if(process.stderr.write(`\r${" ".repeat(80)}\r`),!K.success){if(console.log(W.red(`
567
+ `;d4(b,g)}console.log(W.dim(" Updated .bidsignore for NEMAR metadata"))}catch(R){console.log(W.yellow(` Warning: Could not update .bidsignore: ${w0(R)}`)),console.log(W.dim(" Upload will continue without author enrichment."))}kF(A,"metadata_write"),r1(J,A)}else console.log(W.dim(" Metadata write already completed (skipping)"));if(!vF(A,"dataset_save")){Q=O("Saving dataset changes...").start();let R=await o8(J,"Initial NEMAR dataset upload",d);if(!R.success)r1(J,A),Q.fail("Failed to save dataset"),console.log(W.red(` ${R.error}`)),console.log(),console.log(W.yellow("Re-run the same command to resume from this step.")),process.exit(1);Q.succeed("Dataset changes saved"),kF(A,"dataset_save"),r1(J,A)}else console.log(W.dim(" Dataset save already completed (skipping)"));if(!vF(A,"github_push")){Q=O("Pushing metadata to GitHub...").start();let R=await o1(J);if(!R.success)r1(J,A),Q.fail("Failed to push to GitHub"),console.log(W.red(` ${R.error}`)),console.log(),console.log(W.yellow("Re-run the same command to resume from this step.")),process.exit(1);if(R.warning)Q.warn("Metadata pushed to GitHub (with warning)"),console.log(W.yellow(` ${R.warning}`));else Q.succeed("Metadata pushed to GitHub");kF(A,"github_push"),r1(J,A)}else console.log(W.dim(" GitHub push already completed (skipping)"));if(!vF(A,"ci_deploy")){Q=O("Setting up BIDS validation CI...").start();try{await f4(w.dataset_id),Q.succeed("BIDS validation CI configured")}catch(R){if(R instanceof h&&R.statusCode===403)Q.info("CI workflow will be configured by an admin");else{let n=R instanceof Error?R.message:String(R);Q.warn(`Could not configure CI: ${n}`),console.log(W.dim(` An admin can add it later with: nemar admin ci add ${w.dataset_id}`))}}kF(A,"ci_deploy"),r1(J,A)}else console.log(W.dim(" CI deploy already completed (skipping)"));CQ(J),Xh(J),console.log(),console.log(W.green.bold("Upload complete!")),console.log(),console.log(` Dataset ID: ${W.cyan(w.dataset_id)}`),console.log(` GitHub: ${W.cyan(w.github_url)}`),console.log(),console.log(W.dim("To download this dataset:")),console.log(W.dim(` nemar dataset download ${w.dataset_id}`)),console.log(),console.log(W.yellow("Note: This dataset is private. Only the owner and designated collaborators can")),console.log(W.yellow("download it, and only through the NEMAR CLI (not direct git-annex commands).")),console.log(W.yellow("After publishing, the data will be publicly available for everyone."))});function pV0(D,F,$,J){let Q=Math.round(D/F*100),Y=20,B=Math.round(Q/100*20);return`${`[${"=".repeat(B)}${" ".repeat(20-B)}]`} ${Q}% | ${D}/${F} files | ${XD($)} / ${XD(J)}`}async function dV0(D,F){if(console.log(),console.log(W.yellow("OpenNeuro Dataset")),console.log(W.yellow("This dataset will be downloaded as plain files from OpenNeuro's public S3 bucket.")),console.log(W.yellow("Unlike NEMAR datasets, there is no git-annex version tracking or selective file download.")),console.log(W.dim("For full version control, use DataLad directly:")),console.log(W.dim(` datalad install https://github.com/OpenNeuroDatasets/${D}`)),console.log(),F.data===!1)console.log(W.yellow("Note: --no-data is not supported for OpenNeuro downloads. Downloading all files.")),console.log();let $=F.output||D,J=YD($);if(t0(J))console.log(W.red(`Error: Output path already exists: ${J}`)),console.log("Remove or rename the existing directory and try again."),process.exit(1);let Q=await AQ(),Y=O(`Checking OpenNeuro for ${D}...`).start(),B;try{B=await Nh(D,Q)}catch(X){Y.fail(`Could not reach OpenNeuro: ${X.message}`),process.exit(1)}if(!B)Y.fail(`Dataset ${D} not found on OpenNeuro`),process.exit(1);if(Y.succeed(`Found ${D} on OpenNeuro`),Q){console.log(),console.log(W.bold("Download Plan:")),console.log(` Dataset: ${D} (OpenNeuro)`),console.log(` Output: ${J}`),console.log(" Method: AWS CLI (aws s3 sync)"),console.log(),console.log(W.bold("Downloading data files..."));let X=await Ch(D,J,(G)=>{process.stderr.write(`\r${W.cyan(` ${G} files downloaded`)}`)});if(process.stderr.write(`\r${" ".repeat(40)}\r`),!X.success)console.log(W.red(`Download failed: ${X.error}`)),process.exit(1);console.log(W.green(`Downloaded ${X.filesDownloaded} files`))}else{console.log(),console.log(W.yellow("AWS CLI not found. Using direct HTTPS download.")),console.log(W.yellow("This will be slower than AWS CLI. To install it:")),console.log(W.dim(" https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html")),console.log();let X=O("Listing dataset files...").start(),G;try{G=await Rh(D)}catch(V){X.fail(`Failed to list files: ${V.message}`),process.exit(1)}if(G.length===0)X.fail("No files found in dataset"),process.exit(1);let H=G.reduce((V,E)=>V+E.size,0);X.succeed(`${G.length} files (${XD(H)})`),console.log(W.bold("Download Plan:")),console.log(` Dataset: ${D} (OpenNeuro)`),console.log(` Output: ${J}`),console.log(" Method: HTTPS (direct download)"),console.log(` Files: ${G.length} (${XD(H)})`),console.log(),console.log(W.bold("Downloading data files..."));let q=Number.parseInt(F.jobs||"8",10),K=await Oh(D,J,G,{concurrency:q,onProgress:(V,E,Z,L)=>{process.stderr.write(`\r${W.cyan(pV0(V,E,Z,L))}`)}});if(process.stderr.write(`\r${" ".repeat(80)}\r`),!K.success){if(console.log(W.red(`
568
568
  Download incomplete: ${K.error}`)),K.filesDownloaded>0)console.log(W.yellow(`${K.filesDownloaded} files succeeded. Re-run to retry failed files (resume support).`));console.log(`
569
569
  Location: ${W.cyan(J)}`),process.exit(1)}console.log(W.green(`Downloaded ${K.filesDownloaded} files (${XD(K.totalBytes)})`))}console.log(),console.log(W.green.bold("Download complete!")),console.log(),console.log(` Location: ${W.cyan(J)}`),console.log()}FD.command("download").description("Download a dataset from NEMAR or OpenNeuro").argument("<dataset-id>","Dataset ID (e.g., nm000104 or OpenNeuro ds000248)").option("-o, --output <path>","Output directory (default: ./<dataset-id>)").option("-j, --jobs <number>","Parallel download streams (default: 4)","4").option("--no-data","Download metadata only (skip large data files)").option("--resume","Resume a partial download into an existing clone").option("--update","Pull only the version diff into an existing clone").option("--prune","With --update, drop annex objects that no longer exist upstream").option("--subjects <list>","Comma-separated subjects (e.g. sub-01,02)").option("--sessions <list>","Comma-separated sessions (e.g. ses-pre,post)").option("--tasks <list>","Comma-separated tasks (e.g. rest,nback)").option("--runs <list>","Comma-separated runs (e.g. 1,2 \u2014 matches run-1 and run-01)").option("--datatypes <list>","Comma-separated BIDS datatypes (e.g. eeg,emg)").option("--include <globs>","Comma-separated extra include globs").option("--exclude <globs>","Comma-separated exclude globs (e.g. sourcedata/**)").option("--stimuli","Include stimuli/ content (skipped by default; can be large)").option("--derivatives","Include derivatives/ content (skipped by default; can be large)").option("--skip-port-check","Skip the porting-in-progress check (use if falsely blocked on an OpenNeuro-sourced dataset)").addHelpText("after",`
570
570
  Description:
@@ -600,14 +600,14 @@ Examples:
600
600
  $ nemar dataset download nm000104 --tasks rest --datatypes eeg # Subset
601
601
  $ nemar dataset download nm000104 --stimuli # Also download stimuli/
602
602
  $ nemar dataset download nm000104 --stimuli --derivatives # Download everything
603
- $ nemar dataset download ds000248 # Download from OpenNeuro`).action(async(D,F)=>{let $=await cV0(D);if(!$){await dV0(D,F);return}if(F.resume&&F.update)console.log(W.red("Error: --resume and --update are mutually exclusive.")),process.exit(1);if(F.prune&&!F.update)console.log(W.red("Error: --prune requires --update.")),process.exit(1);let J=MQ({subjects:F.subjects,sessions:F.sessions,tasks:F.tasks,runs:F.runs,datatypes:F.datatypes,include:F.include,exclude:F.exclude,excludeStimuli:F.stimuli!==!0,excludeDerivatives:F.derivatives!==!0});if(J.active&&F.data===!1)console.log(W.red("Error: --no-data cannot be combined with BIDS filters (--subjects, --tasks, etc.). Filters imply data download.")),process.exit(1);await l4("download");let Q=O("Checking git-annex...").start(),Y=await TF();if(!Y.allPassed){Q.fail("Prerequisites check failed"),console.log();for(let N of Y.errors)console.log(W.red(` - ${N}`));process.exit(1)}Q.succeed(`git-annex ${Y.gitAnnex.version}`),Q=O(`Fetching dataset info for ${$}...`).start();let B;try{B=await uD($),Q.succeed(`Found dataset: ${B.name}`)}catch(N){if(Q.fail("Dataset not found"),N instanceof b)console.log(W.red(` ${N.message}`));else console.log(W.red(` ${N.message}`));process.exit(1)}if(!B.github_repo)console.log(W.red("Error: Dataset repository not available")),process.exit(1);let X=F.output||$,G=YD(X),H,q=F.resume?"resume":F.update?"update":null;if(q){if(!t0(G))console.log(W.red(`Error: --${q} target does not exist: ${G}`)),console.log(W.dim(`Drop --${q} to perform a fresh clone.`)),process.exit(1);if(Q=O(`Validating ${q} target...`).start(),!await w1(G))Q.fail("Not a git-annex dataset"),console.log(W.red(` ${G} is not a git-annex repository.`)),console.log(W.dim(`--${q} requires a previous clone of the same dataset.`)),process.exit(1);let N=await r8(G);if(N!==$)Q.fail("Dataset ID mismatch"),console.log(W.red(` Expected ${$}, but ${G} is a clone of ${N??"an unknown repo"}.`)),process.exit(1);let w=await sW(G);if(w.error)Q.fail("Could not check working tree status"),console.log(W.red(` ${w.error}`)),process.exit(1);if(w.dirty)Q.fail("Working tree is dirty"),console.log(W.red(` Refusing to ${q} with uncommitted local changes.`)),console.log(W.dim(" Commit, stash, or discard them first.")),process.exit(1);let P=await rW(G);if(!P.success)Q.fail("Failed to fetch remote refs"),console.log(W.red(` ${P.error}`)),process.exit(1);let C=iW(G);if(C.error)console.log(W.yellow(` Warning: ${C.error}`));let T=await aW(G);for(let W0 of T.warnings)console.log(W.yellow(` Warning: ${W0}`));let y=C.version,d=T.version;if(F.resume){if(y&&d&&y!==d)Q.fail("Local clone is behind upstream"),console.log(W.red(` Local version: ${y} | Remote HEAD: ${d}`)),console.log(W.dim(" Run `nemar dataset download <id> --update` to pull the version diff.")),process.exit(1);Q.succeed(`Resume target verified: ${$}`)}else{if(y&&d&&y===d)Q.succeed(`Already up to date (${y})`),process.exit(0);if(Q.succeed(`Update plan: ${y??"unknown"} \u2192 ${d??"HEAD"}`),y&&d){Q=O("Computing version diff from manifests...").start();try{let[e,N0]=await Promise.all([FQ($,y),FQ($,d)]),GD=Eh(e,N0);if(Q.succeed(`Diff: +${GD.added.length} added, ~${GD.changed.length} changed, -${GD.removed.length} removed`),H=[...GD.added,...GD.changed],H.length===0)console.log(W.dim(" No annex content changes between versions; metadata-only update."))}catch(e){let N0=e.message;if(Q.warn(`Manifest diff unavailable: ${N0}`),/401|403|unauthor/i.test(N0))console.log(W.yellow(" Looks like an auth issue. Run `nemar auth status` to verify."));else if(!/404|not found/i.test(N0))console.log(W.yellow(" Unexpected manifest error. Please report if this recurs."));console.log(W.dim(" Falling back to full git annex get (skips already-present files).")),H=void 0}}let W0=await s8(G);if(W0?.startsWith("adjusted/"))console.log(W.red(` --update is not supported on git-annex adjusted branches (${W0}).`)),console.log(W.dim(" Run `git -C <clone> annex sync` to bring the clone onto a normal branch first.")),process.exit(1);Q=O("Resolving remote tracking branch...").start();let F0=await oW(G);if(!F0.ref)Q.fail("Cannot resolve remote tracking branch"),console.log(W.red(` ${F0.error??"no upstream ref found"}`)),process.exit(1);Q.text=`Fast-forwarding to ${F0.ref}...`;let O0=await tW(G,F0.ref);if(!O0.success)Q.fail("Cannot fast-forward (local has diverging commits)"),console.log(W.red(` ${O0.error}`)),console.log(W.dim(" Use `nemar dataset update` (PR workflow) to push local changes first.")),process.exit(1);Q.succeed(`Merged ${F0.ref}`)}}else if(t0(G))console.log(W.red(`Error: Output path already exists: ${G}`)),console.log("Remove or rename the existing directory, or pass --resume / --update to reuse it."),process.exit(1);console.log();let K=F.update?"Update Plan:":F.resume?"Resume Plan:":"Download Plan:";if(console.log(W.bold(K)),console.log(` Dataset: ${B.name} (${$})`),console.log(` Output: ${G}`),console.log(` Data files: ${F.data===!1?"metadata only":"included"}`),F.data!==!1)console.log(` Parallel jobs: ${F.jobs}`);if(F.update&&H&&H.length>0)console.log(` Files to fetch: ${H.length}`);if(J.active)for(let N of J.summary)console.log(` Filter ${N}`);if(console.log(),!q){let N=`https://github.com/${B.github_repo}.git`;Q=O("Cloning metadata from GitHub...").start();let w=await s1(N,G);if(!w.success)Q.fail("Failed to clone dataset"),console.log(W.red(` ${w.error}`)),process.exit(1);Q.succeed("Metadata cloned")}if(!F.skipPortCheck&&B.source==="openneuro"&&F.data!==!1){if(await HQ(G)==="absent")console.log(),console.log(W.yellow("Porting still in progress.")),console.log(W.dim(" This dataset is being imported from OpenNeuro. Data files are not yet available.")),console.log(W.dim(" The metadata-only clone is already at the path above.")),console.log(W.dim(" Wait 5\u201330 minutes (depending on dataset size), then run:")),console.log(W.dim(` cd ${G} && nemar dataset get`)),console.log(W.dim(" Run 'nemar dataset status <id>' to track porting progress.")),console.log(W.dim(" Pass --skip-port-check to bypass this check if you are certain porting is complete.")),process.exit(1)}let V=null;if(B.visibility!=="public"){Q=O("Requesting download credentials...").start();try{V=await QQ($),Q.succeed("Download credentials received (2h expiry)")}catch(N){Q.fail("Failed to get download credentials"),console.log(W.red(` ${N.message}`)),console.log(W.dim("Private datasets require authentication. Run 'nemar auth login' first.")),process.exit(1)}}let E=V?RD(V.credentials):void 0,Z=await h4(G,"nemar-s3",E);if(Z.enabled)console.log(W.dim(" S3 remote enabled for data downloads"));else if(!Z.success)console.log(W.yellow(` Warning: Could not enable S3 remote: ${Z.error}`));if(F.data===!1||F.update&&H&&H.length===0){if(F.data===!1)console.log(W.dim("Skipping data files (--no-data flag)"))}else{for(let T of J.summary)console.log(W.dim(` ${T}`));console.log(W.bold(`Downloading data files (${F.jobs} parallel streams)...`));let N=J.args.length>0?J.args:void 0,w=await WQ(G,void 0,N),P=new XQ(w?.fileCount??0,w?.totalBytes??0),C=await qQ(G,{jobs:Number.parseInt(F.jobs,10),credentials:E,paths:H,extraArgs:N,onProgress:(T)=>P.processLine(T)});if(!C.success){if(P.finish(0),console.log(W.red(`Failed to download data files: ${C.error}`)),console.log(W.dim("The dataset was cloned but data files are not available locally.")),console.log(W.dim(`You can try again with: cd ${G} && nemar dataset get`)),V)await kD(G);process.exit(1)}P.finish(C.filesDownloaded||0),console.log(W.green(`Data downloaded (${C.filesDownloaded||0} files)`))}if(F.update&&F.prune){Q=O("Pruning orphan annex objects...").start();let N=await eW(G);if(N.success)Q.succeed(`Pruned ${N.dropped??0} unused annex objects`);else Q.warn(`Prune skipped: ${N.error}`)}if(V)await kD(G);let A=await lW(G);console.log();let M=F.update?"Update complete!":F.resume?"Resume complete!":"Download complete!";if(console.log(W.green.bold(M)),console.log(),console.log(` Location: ${W.cyan(G)}`),A){if(console.log(` Files: ${A.files}`),A.size!=="unknown")console.log(` Size: ${A.size}`);if(A.missingFiles>0)console.log(W.dim(` Missing files: ${A.missingFiles} (use 'git annex get' to download)`))}if(console.log(),F.update)console.log(W.dim("Note: --update fetches only the version diff. If a prior version was")),console.log(W.dim("partially downloaded, run with --resume to fill any pre-existing gaps.")),console.log();console.log(W.dim("To get additional data:")),console.log(W.dim(` cd ${G} && git annex get <path>`))});FD.command("status").description("Check status of a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("--json","Output as JSON for scripting").addHelpText("after",`
603
+ $ nemar dataset download ds000248 # Download from OpenNeuro`).action(async(D,F)=>{let $=await cV0(D);if(!$){await dV0(D,F);return}if(F.resume&&F.update)console.log(W.red("Error: --resume and --update are mutually exclusive.")),process.exit(1);if(F.prune&&!F.update)console.log(W.red("Error: --prune requires --update.")),process.exit(1);let J=MQ({subjects:F.subjects,sessions:F.sessions,tasks:F.tasks,runs:F.runs,datatypes:F.datatypes,include:F.include,exclude:F.exclude,excludeStimuli:F.stimuli!==!0,excludeDerivatives:F.derivatives!==!0});if(J.active&&F.data===!1)console.log(W.red("Error: --no-data cannot be combined with BIDS filters (--subjects, --tasks, etc.). Filters imply data download.")),process.exit(1);await l4("download");let Q=O("Checking git-annex...").start(),Y=await TF();if(!Y.allPassed){Q.fail("Prerequisites check failed"),console.log();for(let N of Y.errors)console.log(W.red(` - ${N}`));process.exit(1)}Q.succeed(`git-annex ${Y.gitAnnex.version}`),Q=O(`Fetching dataset info for ${$}...`).start();let B;try{B=await uD($),Q.succeed(`Found dataset: ${B.name}`)}catch(N){if(Q.fail("Dataset not found"),N instanceof h)console.log(W.red(` ${N.message}`));else console.log(W.red(` ${N.message}`));process.exit(1)}if(!B.github_repo)console.log(W.red("Error: Dataset repository not available")),process.exit(1);let X=F.output||$,G=YD(X),H,q=F.resume?"resume":F.update?"update":null;if(q){if(!t0(G))console.log(W.red(`Error: --${q} target does not exist: ${G}`)),console.log(W.dim(`Drop --${q} to perform a fresh clone.`)),process.exit(1);if(Q=O(`Validating ${q} target...`).start(),!await w1(G))Q.fail("Not a git-annex dataset"),console.log(W.red(` ${G} is not a git-annex repository.`)),console.log(W.dim(`--${q} requires a previous clone of the same dataset.`)),process.exit(1);let N=await r8(G);if(N!==$)Q.fail("Dataset ID mismatch"),console.log(W.red(` Expected ${$}, but ${G} is a clone of ${N??"an unknown repo"}.`)),process.exit(1);let w=await sW(G);if(w.error)Q.fail("Could not check working tree status"),console.log(W.red(` ${w.error}`)),process.exit(1);if(w.dirty)Q.fail("Working tree is dirty"),console.log(W.red(` Refusing to ${q} with uncommitted local changes.`)),console.log(W.dim(" Commit, stash, or discard them first.")),process.exit(1);let P=await rW(G);if(!P.success)Q.fail("Failed to fetch remote refs"),console.log(W.red(` ${P.error}`)),process.exit(1);let C=iW(G);if(C.error)console.log(W.yellow(` Warning: ${C.error}`));let T=await aW(G);for(let W0 of T.warnings)console.log(W.yellow(` Warning: ${W0}`));let y=C.version,d=T.version;if(F.resume){if(y&&d&&y!==d)Q.fail("Local clone is behind upstream"),console.log(W.red(` Local version: ${y} | Remote HEAD: ${d}`)),console.log(W.dim(" Run `nemar dataset download <id> --update` to pull the version diff.")),process.exit(1);Q.succeed(`Resume target verified: ${$}`)}else{if(y&&d&&y===d)Q.succeed(`Already up to date (${y})`),process.exit(0);if(Q.succeed(`Update plan: ${y??"unknown"} \u2192 ${d??"HEAD"}`),y&&d){Q=O("Computing version diff from manifests...").start();try{let[e,N0]=await Promise.all([FQ($,y),FQ($,d)]),GD=Eh(e,N0);if(Q.succeed(`Diff: +${GD.added.length} added, ~${GD.changed.length} changed, -${GD.removed.length} removed`),H=[...GD.added,...GD.changed],H.length===0)console.log(W.dim(" No annex content changes between versions; metadata-only update."))}catch(e){let N0=e.message;if(Q.warn(`Manifest diff unavailable: ${N0}`),/401|403|unauthor/i.test(N0))console.log(W.yellow(" Looks like an auth issue. Run `nemar auth status` to verify."));else if(!/404|not found/i.test(N0))console.log(W.yellow(" Unexpected manifest error. Please report if this recurs."));console.log(W.dim(" Falling back to full git annex get (skips already-present files).")),H=void 0}}let W0=await s8(G);if(W0?.startsWith("adjusted/"))console.log(W.red(` --update is not supported on git-annex adjusted branches (${W0}).`)),console.log(W.dim(" Run `git -C <clone> annex sync` to bring the clone onto a normal branch first.")),process.exit(1);Q=O("Resolving remote tracking branch...").start();let F0=await oW(G);if(!F0.ref)Q.fail("Cannot resolve remote tracking branch"),console.log(W.red(` ${F0.error??"no upstream ref found"}`)),process.exit(1);Q.text=`Fast-forwarding to ${F0.ref}...`;let O0=await tW(G,F0.ref);if(!O0.success)Q.fail("Cannot fast-forward (local has diverging commits)"),console.log(W.red(` ${O0.error}`)),console.log(W.dim(" Use `nemar dataset update` (PR workflow) to push local changes first.")),process.exit(1);Q.succeed(`Merged ${F0.ref}`)}}else if(t0(G))console.log(W.red(`Error: Output path already exists: ${G}`)),console.log("Remove or rename the existing directory, or pass --resume / --update to reuse it."),process.exit(1);console.log();let K=F.update?"Update Plan:":F.resume?"Resume Plan:":"Download Plan:";if(console.log(W.bold(K)),console.log(` Dataset: ${B.name} (${$})`),console.log(` Output: ${G}`),console.log(` Data files: ${F.data===!1?"metadata only":"included"}`),F.data!==!1)console.log(` Parallel jobs: ${F.jobs}`);if(F.update&&H&&H.length>0)console.log(` Files to fetch: ${H.length}`);if(J.active)for(let N of J.summary)console.log(` Filter ${N}`);if(console.log(),!q){let N=`https://github.com/${B.github_repo}.git`;Q=O("Cloning metadata from GitHub...").start();let w=await s1(N,G);if(!w.success)Q.fail("Failed to clone dataset"),console.log(W.red(` ${w.error}`)),process.exit(1);Q.succeed("Metadata cloned")}if(!F.skipPortCheck&&B.source==="openneuro"&&F.data!==!1){if(await HQ(G)==="absent")console.log(),console.log(W.yellow("Porting still in progress.")),console.log(W.dim(" This dataset is being imported from OpenNeuro. Data files are not yet available.")),console.log(W.dim(" The metadata-only clone is already at the path above.")),console.log(W.dim(" Wait 5\u201330 minutes (depending on dataset size), then run:")),console.log(W.dim(` cd ${G} && nemar dataset get`)),console.log(W.dim(" Run 'nemar dataset status <id>' to track porting progress.")),console.log(W.dim(" Pass --skip-port-check to bypass this check if you are certain porting is complete.")),process.exit(1)}let V=null;if(B.visibility!=="public"){Q=O("Requesting download credentials...").start();try{V=await QQ($),Q.succeed("Download credentials received (2h expiry)")}catch(N){Q.fail("Failed to get download credentials"),console.log(W.red(` ${N.message}`)),console.log(W.dim("Private datasets require authentication. Run 'nemar auth login' first.")),process.exit(1)}}let E=V?RD(V.credentials):void 0,Z=await h4(G,"nemar-s3",E);if(Z.enabled)console.log(W.dim(" S3 remote enabled for data downloads"));else if(!Z.success)console.log(W.yellow(` Warning: Could not enable S3 remote: ${Z.error}`));if(F.data===!1||F.update&&H&&H.length===0){if(F.data===!1)console.log(W.dim("Skipping data files (--no-data flag)"))}else{for(let T of J.summary)console.log(W.dim(` ${T}`));console.log(W.bold(`Downloading data files (${F.jobs} parallel streams)...`));let N=J.args.length>0?J.args:void 0,w=await WQ(G,void 0,N),P=new XQ(w?.fileCount??0,w?.totalBytes??0),C=await qQ(G,{jobs:Number.parseInt(F.jobs,10),credentials:E,paths:H,extraArgs:N,onProgress:(T)=>P.processLine(T)});if(!C.success){if(P.finish(0),console.log(W.red(`Failed to download data files: ${C.error}`)),console.log(W.dim("The dataset was cloned but data files are not available locally.")),console.log(W.dim(`You can try again with: cd ${G} && nemar dataset get`)),V)await kD(G);process.exit(1)}P.finish(C.filesDownloaded||0),console.log(W.green(`Data downloaded (${C.filesDownloaded||0} files)`))}if(F.update&&F.prune){Q=O("Pruning orphan annex objects...").start();let N=await eW(G);if(N.success)Q.succeed(`Pruned ${N.dropped??0} unused annex objects`);else Q.warn(`Prune skipped: ${N.error}`)}if(V)await kD(G);let M=await lW(G);console.log();let A=F.update?"Update complete!":F.resume?"Resume complete!":"Download complete!";if(console.log(W.green.bold(A)),console.log(),console.log(` Location: ${W.cyan(G)}`),M){if(console.log(` Files: ${M.files}`),M.size!=="unknown")console.log(` Size: ${M.size}`);if(M.missingFiles>0)console.log(W.dim(` Missing files: ${M.missingFiles} (use 'git annex get' to download)`))}if(console.log(),F.update)console.log(W.dim("Note: --update fetches only the version diff. If a prior version was")),console.log(W.dim("partially downloaded, run with --resume to fill any pre-existing gaps.")),console.log();console.log(W.dim("To get additional data:")),console.log(W.dim(` cd ${G} && git annex get <path>`))});FD.command("status").description("Check status of a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("--json","Output as JSON for scripting").addHelpText("after",`
604
604
  Description:
605
605
  Show detailed information about a NEMAR dataset including owner,
606
606
  creation date, GitHub repository, and DOI information.
607
607
 
608
608
  Examples:
609
609
  $ nemar dataset status nm000104
610
- $ nemar dataset status nm000104 --json | jq '.concept_doi'`).action(async(D,F)=>{let $=O(`Fetching dataset info for ${D}...`).start(),J;try{J=await uD(D),$.stop()}catch(Q){if($.fail("Dataset not found"),Q instanceof b)console.log(W.red(` ${Q.message}`));else console.log(W.red(` ${Q.message}`));process.exit(1)}if(F.json){console.log(JSON.stringify(J,null,2));return}if(console.log(),console.log(W.bold(`Dataset: ${J.dataset_id}`)),console.log(),console.log(` Name: ${J.name}`),console.log(` Owner: ${J.owner_username}`),console.log(` Status: ${nV0(J.status)}`),console.log(` Created: ${new Date(J.created_at).toLocaleDateString()}`),J.description)console.log(` Description: ${J.description}`);if(J.github_repo)console.log(` GitHub: https://github.com/${J.github_repo}`);if(J.concept_doi)console.log(` DOI: https://doi.org/${J.concept_doi}`);console.log(),console.log(W.dim("To download this dataset:")),console.log(W.dim(` nemar dataset download ${D}`))});async function cV0(D){if(!Mh(D))return D;let F=null;try{F=await ff(D)}catch(J){return console.log(W.dim(`Could not check NEMAR availability: ${J.message}`)),null}if(!F?.found||!F.dataset_id)return null;console.log(),console.log(W.green(`This dataset is available on NEMAR as ${W.bold(F.dataset_id)}`)),console.log(W.dim("NEMAR provides git-annex version tracking and selective file download."));let{useNemarBackend:$}=await D0.prompt([{type:"confirm",name:"useNemarBackend",message:`Download from NEMAR (${F.dataset_id}) instead of OpenNeuro?`,default:!0}]);return $?F.dataset_id:null}function nV0(D){switch(D.toLowerCase()){case"published":return W.green(D);case"active":return W.blue(D);case"archived":return W.dim(D);case"pending":return W.yellow(D);default:return D}}function iV0(D,F){let{offset:$,totalCount:J}=F,Q=$+1,Y=$+D.length,B=J>D.length?`${Q}-${Y} of ${J}`:`${J}`;console.log(),console.log(W.bold(`Datasets (${B}):`)),console.log();let X=(Z)=>Z.dataset_id||Z.id||"",G=Math.max(10,...D.map((Z)=>X(Z).length)),H=Math.min(30,Math.max(10,...D.map((Z)=>Z.name.length))),q=10,K=8,V=Math.max(8,...D.map((Z)=>(Z.owner_username||"-").length)),E=["ID".padEnd(G),"Name".padEnd(H),"Modality".padEnd(q),"Subj".padEnd(K),"Owner".padEnd(V),"Status"].join(" ");console.log(W.dim(E)),console.log(W.dim("-".repeat(E.length)));for(let Z of D){let L=X(Z),A=Z.name.length>H?`${Z.name.substring(0,H-3)}...`:Z.name,M=(Z.modalities||"").substring(0,q),N=Z.participants?String(Z.participants):"-",w=Z.owner_username||"-",P="";if(Z.source_type==="managed"&&!Z.nemar_sync_status)P=W.yellow("*");else if(Z.source_type==="managed"&&Z.nemar_sync_status==="failed")P=W.red("!");let C=Z.visibility==="public"?W.green("pub"):W.yellow("prv"),T;if(Z.source_type==="catalog")T=W.dim(L.padEnd(G));else T=W.cyan(L.padEnd(G));let y=Z.source_type==="catalog"?W.dim(A):A,d=[T,y.padEnd(H+(Z.source_type==="catalog"?W.dim("").length:0)),M.padEnd(q),N.padEnd(K),w.padEnd(V),`${C} ${P}`.trim()].join(" ");console.log(d)}if(console.log(),J>Y){let Z=Math.floor($/F.limit)+1,L=Math.ceil(J/F.limit);console.log(W.dim(`Page ${Z}/${L}. Next: nemar dataset list --page ${Z+1}`))}console.log(W.dim(` * = not synced to nemar.org ${W.dim("dim")} = catalog-only (not on GitHub)`)),console.log(W.dim("For details: nemar dataset status <dataset-id>")),console.log(W.dim("Search: nemar dataset search <query>"))}FD.command("list").description("List datasets on NEMAR (full catalog)").option("--mine","List only your datasets (both private and public)").option("--owner <username>","List datasets owned by a specific user").option("--search <query>","Search by name, description, authors, or tasks").option("--modality <type>","Filter by modality (eeg, emg, meg, etc.)").option("--author <name>","Filter by author name").option("--task <name>","Filter by task name").option("--doi","Show only datasets with DOIs").option("--recent [days]","Show recently published datasets").option("--sort <order>","Sort: newest, oldest, name, participants, size","newest").option("--json","Output as JSON for scripting").option("-n, --limit <n>","Results per page (default: 20, max: 200)","20").option("--page <n>","Page number (starts at 1)").option("--offset <n>","Skip this many results (alternative to --page)").option("--all","Show all results (up to 200)").addHelpText("after",`
610
+ $ nemar dataset status nm000104 --json | jq '.concept_doi'`).action(async(D,F)=>{let $=O(`Fetching dataset info for ${D}...`).start(),J;try{J=await uD(D),$.stop()}catch(Q){if($.fail("Dataset not found"),Q instanceof h)console.log(W.red(` ${Q.message}`));else console.log(W.red(` ${Q.message}`));process.exit(1)}if(F.json){console.log(JSON.stringify(J,null,2));return}if(console.log(),console.log(W.bold(`Dataset: ${J.dataset_id}`)),console.log(),console.log(` Name: ${J.name}`),console.log(` Owner: ${J.owner_username}`),console.log(` Status: ${nV0(J.status)}`),console.log(` Created: ${new Date(J.created_at).toLocaleDateString()}`),J.description)console.log(` Description: ${J.description}`);if(J.github_repo)console.log(` GitHub: https://github.com/${J.github_repo}`);if(J.concept_doi)console.log(` DOI: https://doi.org/${J.concept_doi}`);console.log(),console.log(W.dim("To download this dataset:")),console.log(W.dim(` nemar dataset download ${D}`))});async function cV0(D){if(!Mh(D))return D;let F=null;try{F=await ff(D)}catch(J){return console.log(W.dim(`Could not check NEMAR availability: ${J.message}`)),null}if(!F?.found||!F.dataset_id)return null;console.log(),console.log(W.green(`This dataset is available on NEMAR as ${W.bold(F.dataset_id)}`)),console.log(W.dim("NEMAR provides git-annex version tracking and selective file download."));let{useNemarBackend:$}=await D0.prompt([{type:"confirm",name:"useNemarBackend",message:`Download from NEMAR (${F.dataset_id}) instead of OpenNeuro?`,default:!0}]);return $?F.dataset_id:null}function nV0(D){switch(D.toLowerCase()){case"published":return W.green(D);case"active":return W.blue(D);case"archived":return W.dim(D);case"pending":return W.yellow(D);default:return D}}function iV0(D,F){let{offset:$,totalCount:J}=F,Q=$+1,Y=$+D.length,B=J>D.length?`${Q}-${Y} of ${J}`:`${J}`;console.log(),console.log(W.bold(`Datasets (${B}):`)),console.log();let X=(Z)=>Z.dataset_id||Z.id||"",G=Math.max(10,...D.map((Z)=>X(Z).length)),H=Math.min(30,Math.max(10,...D.map((Z)=>Z.name.length))),q=10,K=8,V=Math.max(8,...D.map((Z)=>(Z.owner_username||"-").length)),E=["ID".padEnd(G),"Name".padEnd(H),"Modality".padEnd(q),"Subj".padEnd(K),"Owner".padEnd(V),"Status"].join(" ");console.log(W.dim(E)),console.log(W.dim("-".repeat(E.length)));for(let Z of D){let L=X(Z),M=Z.name.length>H?`${Z.name.substring(0,H-3)}...`:Z.name,A=(Z.modalities||"").substring(0,q),N=Z.participants?String(Z.participants):"-",w=Z.owner_username||"-",P="";if(Z.source_type==="managed"&&!Z.nemar_sync_status)P=W.yellow("*");else if(Z.source_type==="managed"&&Z.nemar_sync_status==="failed")P=W.red("!");let C=Z.visibility==="public"?W.green("pub"):W.yellow("prv"),T;if(Z.source_type==="catalog")T=W.dim(L.padEnd(G));else T=W.cyan(L.padEnd(G));let y=Z.source_type==="catalog"?W.dim(M):M,d=[T,y.padEnd(H+(Z.source_type==="catalog"?W.dim("").length:0)),A.padEnd(q),N.padEnd(K),w.padEnd(V),`${C} ${P}`.trim()].join(" ");console.log(d)}if(console.log(),J>Y){let Z=Math.floor($/F.limit)+1,L=Math.ceil(J/F.limit);console.log(W.dim(`Page ${Z}/${L}. Next: nemar dataset list --page ${Z+1}`))}console.log(W.dim(` * = not synced to nemar.org ${W.dim("dim")} = catalog-only (not on GitHub)`)),console.log(W.dim("For details: nemar dataset status <dataset-id>")),console.log(W.dim("Search: nemar dataset search <query>"))}FD.command("list").description("List datasets on NEMAR (full catalog)").option("--mine","List only your datasets (both private and public)").option("--owner <username>","List datasets owned by a specific user").option("--search <query>","Search by name, description, authors, or tasks").option("--modality <type>","Filter by modality (eeg, emg, meg, etc.)").option("--author <name>","Filter by author name").option("--task <name>","Filter by task name").option("--doi","Show only datasets with DOIs").option("--recent [days]","Show recently published datasets").option("--sort <order>","Sort: newest, oldest, name, participants, size","newest").option("--json","Output as JSON for scripting").option("-n, --limit <n>","Results per page (default: 20, max: 200)","20").option("--page <n>","Page number (starts at 1)").option("--offset <n>","Skip this many results (alternative to --page)").option("--all","Show all results (up to 200)").addHelpText("after",`
611
611
  Description:
612
612
  Lists the full NEMAR catalog, including legacy datasets from nemar.org
613
613
  and datasets managed via nemar-cli. Shows 20 results per page by default.
@@ -637,7 +637,7 @@ Examples:
637
637
  $ nemar dataset list --modality eeg # EEG datasets only
638
638
  $ nemar dataset list --search "motor" # Search by keyword
639
639
  $ nemar dataset list --doi --sort size # Published, by size
640
- $ nemar dataset search "resting state EEG" # Semantic search`).action(async(D)=>{if(D.mine&&D.owner)console.log(W.red("Error: --mine and --owner cannot be used together")),console.log("Use --mine for your datasets, or --owner <username> for another user's."),process.exit(1);if(D.mine&&!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' to see your datasets"),process.exit(1);let F=D.all?200:Math.min(Number.parseInt(D.limit,10)||20,200),$=0;if(D.page)$=(Math.max(Number.parseInt(D.page,10)||1,1)-1)*F;else if(D.offset)$=Math.max(Number.parseInt(D.offset,10)||0,0);let J=O("Fetching datasets...").start(),Q;try{Q=await k9({mine:!!D.mine,search:D.search,modality:D.modality,author:D.author,task:D.task,hasDoi:!!D.doi,recent:D.recent?Number.parseInt(D.recent,10)||30:void 0,sort:D.sort,limit:F,offset:$,owner:D.owner}),J.stop()}catch(X){if(J.fail("Failed to fetch datasets"),X instanceof b)console.log(W.red(` ${X.message}`));else console.log(W.red(` ${X.message}`));process.exit(1)}let Y=Q.datasets,B=Q.total_count??Q.count;if(D.json){console.log(JSON.stringify({datasets:Y,total_count:B,limit:F,offset:$},null,2));return}if(Y.length===0){if(console.log(),D.mine)console.log(W.yellow("You don't have any datasets yet.")),console.log(W.dim("Create one with: nemar dataset upload <path>"));else if(D.owner)console.log(W.yellow(`No datasets found for user '${D.owner}'.`));else if(D.search||D.modality||D.author)console.log(W.yellow("No datasets match your filters.")),console.log(W.dim("Try broader search terms or remove filters."));else console.log(W.yellow("No datasets found."));return}iV0(Y,{limit:F,offset:$,totalCount:B})});FD.command("search <query>").description("Search datasets using semantic matching").option("--modality <type>","Filter by modality (eeg, emg, meg, etc.)").option("--json","Output as JSON for scripting").option("--limit <n>","Limit results (default: 20)","20").addHelpText("after",`
640
+ $ nemar dataset search "resting state EEG" # Semantic search`).action(async(D)=>{if(D.mine&&D.owner)console.log(W.red("Error: --mine and --owner cannot be used together")),console.log("Use --mine for your datasets, or --owner <username> for another user's."),process.exit(1);if(D.mine&&!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' to see your datasets"),process.exit(1);let F=D.all?200:Math.min(Number.parseInt(D.limit,10)||20,200),$=0;if(D.page)$=(Math.max(Number.parseInt(D.page,10)||1,1)-1)*F;else if(D.offset)$=Math.max(Number.parseInt(D.offset,10)||0,0);let J=O("Fetching datasets...").start(),Q;try{Q=await k9({mine:!!D.mine,search:D.search,modality:D.modality,author:D.author,task:D.task,hasDoi:!!D.doi,recent:D.recent?Number.parseInt(D.recent,10)||30:void 0,sort:D.sort,limit:F,offset:$,owner:D.owner}),J.stop()}catch(X){if(J.fail("Failed to fetch datasets"),X instanceof h)console.log(W.red(` ${X.message}`));else console.log(W.red(` ${X.message}`));process.exit(1)}let Y=Q.datasets,B=Q.total_count??Q.count;if(D.json){console.log(JSON.stringify({datasets:Y,total_count:B,limit:F,offset:$},null,2));return}if(Y.length===0){if(console.log(),D.mine)console.log(W.yellow("You don't have any datasets yet.")),console.log(W.dim("Create one with: nemar dataset upload <path>"));else if(D.owner)console.log(W.yellow(`No datasets found for user '${D.owner}'.`));else if(D.search||D.modality||D.author)console.log(W.yellow("No datasets match your filters.")),console.log(W.dim("Try broader search terms or remove filters."));else console.log(W.yellow("No datasets found."));return}iV0(Y,{limit:F,offset:$,totalCount:B})});FD.command("search <query>").description("Search datasets using semantic matching").option("--modality <type>","Filter by modality (eeg, emg, meg, etc.)").option("--json","Output as JSON for scripting").option("--limit <n>","Limit results (default: 20)","20").addHelpText("after",`
641
641
  Description:
642
642
  Performs semantic search across the NEMAR dataset catalog. Unlike
643
643
  --search on the list command (which uses exact text matching), this
@@ -649,7 +649,7 @@ Description:
649
649
  Examples:
650
650
  $ nemar dataset search "motor imagery EEG"
651
651
  $ nemar dataset search "resting state" --modality eeg
652
- $ nemar dataset search "sleep spindles" --json`).action(async(D,F)=>{let $=O("Searching datasets...").start();try{let J=await gf(D,{modality:F.modality,limit:Number.parseInt(F.limit,10)});if($.stop(),F.json){console.log(JSON.stringify(J,null,2));return}if(J.results.length===0){console.log(),console.log(W.yellow("No datasets match your search.")),console.log(W.dim("Try different search terms or use 'nemar dataset list' for browsing."));return}console.log(),console.log(W.bold(`Search results for "${D}" (${J.results.length} found, ${J.method}):`)),console.log();let Q=Math.max(10,...J.results.map((H)=>H.id.length)),Y=Math.min(35,Math.max(10,...J.results.map((H)=>H.name.length))),B=10,X=6,G=["Score".padEnd(5),"ID".padEnd(Q),"Name".padEnd(Y),"Modality".padEnd(B),"Subj".padEnd(X)].join(" ");console.log(W.dim(G)),console.log(W.dim("-".repeat(G.length)));for(let H of J.results){let q=H.name.length>Y?`${H.name.substring(0,Y-3)}...`:H.name,V=[(H.score>=0.8?W.green:H.score>=0.5?W.yellow:W.dim)(String(H.score).padEnd(5)),W.cyan(H.id.padEnd(Q)),q.padEnd(Y),(H.modalities||"-").substring(0,B).padEnd(B),(H.participants?String(H.participants):"-").padEnd(X)].join(" ");console.log(V)}console.log(),console.log(W.dim("For details: nemar dataset status <dataset-id>"))}catch(J){if($.fail("Search failed"),J instanceof b)console.log(W.red(` ${J.message}`));else console.log(W.red(` ${J.message}`));process.exit(1)}});FD.command("release").description("Create a version bump PR for a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("--type <type>","Bump type: patch, minor, or major").option("--version <version>","Explicit version (e.g., 2.0.0)").option("--dir <path>","Use existing local clone instead of cloning").option("--monitor","Watch CI checks and offer to merge").option(j0,T0).addHelpText("after",`
652
+ $ nemar dataset search "sleep spindles" --json`).action(async(D,F)=>{let $=O("Searching datasets...").start();try{let J=await gf(D,{modality:F.modality,limit:Number.parseInt(F.limit,10)});if($.stop(),F.json){console.log(JSON.stringify(J,null,2));return}if(J.results.length===0){console.log(),console.log(W.yellow("No datasets match your search.")),console.log(W.dim("Try different search terms or use 'nemar dataset list' for browsing."));return}console.log(),console.log(W.bold(`Search results for "${D}" (${J.results.length} found, ${J.method}):`)),console.log();let Q=Math.max(10,...J.results.map((H)=>H.id.length)),Y=Math.min(35,Math.max(10,...J.results.map((H)=>H.name.length))),B=10,X=6,G=["Score".padEnd(5),"ID".padEnd(Q),"Name".padEnd(Y),"Modality".padEnd(B),"Subj".padEnd(X)].join(" ");console.log(W.dim(G)),console.log(W.dim("-".repeat(G.length)));for(let H of J.results){let q=H.name.length>Y?`${H.name.substring(0,Y-3)}...`:H.name,V=[(H.score>=0.8?W.green:H.score>=0.5?W.yellow:W.dim)(String(H.score).padEnd(5)),W.cyan(H.id.padEnd(Q)),q.padEnd(Y),(H.modalities||"-").substring(0,B).padEnd(B),(H.participants?String(H.participants):"-").padEnd(X)].join(" ");console.log(V)}console.log(),console.log(W.dim("For details: nemar dataset status <dataset-id>"))}catch(J){if($.fail("Search failed"),J instanceof h)console.log(W.red(` ${J.message}`));else console.log(W.red(` ${J.message}`));process.exit(1)}});FD.command("release").description("Create a version bump PR for a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("--type <type>","Bump type: patch, minor, or major").option("--version <version>","Explicit version (e.g., 2.0.0)").option("--dir <path>","Use existing local clone instead of cloning").option("--monitor","Watch CI checks and offer to merge").option(j0,T0).addHelpText("after",`
653
653
  Description:
654
654
  Create a pull request that bumps the dataset version in
655
655
  dataset_description.json. The PR triggers CI checks (BIDS validation,
@@ -659,8 +659,8 @@ Description:
659
659
  Examples:
660
660
  $ nemar dataset release nm000104 --type patch
661
661
  $ nemar dataset release nm000104 --version 2.0.0
662
- $ nemar dataset release nm000104 # interactive prompt`).action(async(D,F)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);await l4("release");let $=O("Fetching dataset info...").start(),J;try{J=await uD(D),$.succeed(`Dataset: ${J.name||D}`)}catch(C){if(C instanceof b)$.fail(C.message);else $.fail("Failed to fetch dataset");process.exit(1)}if(!J.github_repo)console.log(W.red("Error: Dataset has no GitHub repository")),process.exit(1);let Q;try{let C=await hf(D);if(Q=C.current_version,console.log(` Current version: ${W.cyan(Q)}`),C.versions.length>0){console.log(` Version DOIs: ${C.versions.length}`);for(let T of C.versions.slice(0,3))console.log(` ${T.version} - ${W.dim(T.doi)}`);if(C.versions.length>3)console.log(W.dim(` ... and ${C.versions.length-3} more`))}}catch(C){let T=C instanceof b?`${C.statusCode}: ${C.message}`:String(C);console.log(W.red(`Error: Could not fetch version history (${T})`)),console.log(" Cannot determine current version. Ensure the backend is reachable."),process.exit(1)}let Y;if(F.version){if(!IH(F.version))console.log(W.red(`Error: Invalid version: ${F.version}`)),console.log(" Expected format: X.Y.Z (e.g., 2.0.0)"),process.exit(1);Y=F.version.replace(/^v/,"")}else if(F.type){let C=F.type;if(!["patch","minor","major"].includes(C))console.log(W.red(`Error: Invalid bump type: ${F.type}`)),console.log(" Expected: patch, minor, or major"),process.exit(1);Y=p4(Q,C)}else{if(!SF(Q))console.log(W.red(`Error: Cannot parse current version: ${Q}`)),process.exit(1);let T=[{name:`patch ${Q} -> ${p4(Q,"patch")}`,value:"patch"},{name:`minor ${Q} -> ${p4(Q,"minor")}`,value:"minor"},{name:`major ${Q} -> ${p4(Q,"major")}`,value:"major"},{name:"custom version",value:"custom"}],{bumpType:y}=await D0.prompt([{type:"list",name:"bumpType",message:"Select version bump type:",choices:T}]);if(y==="custom"){let{customVersion:d}=await D0.prompt([{type:"input",name:"customVersion",message:"Enter version (X.Y.Z):",validate:(W0)=>IH(W0)||"Invalid format. Use X.Y.Z (e.g., 2.0.0)"}]);Y=d.replace(/^v/,"")}else Y=p4(Q,y)}if(console.log(),console.log(` ${W.bold("Version bump:")} ${Q} -> ${W.green(Y)}`),await k0(`Create release PR for ${D} v${Y}?`,{yes:F.yes})!=="confirmed"){console.log("Cancelled.");return}let X,G=!0;if(F.dir){if(!t0(F.dir))console.log(W.red(`Error: Directory not found: ${F.dir}`)),process.exit(1);X=YD(F.dir),G=!1}else X=bV0(yF(uV0(),`nemar-release-${D}-`));if(G){let C=`https://github.com/${J.github_repo}.git`,T=O("Cloning dataset...").start(),y=await s1(C,X);if(!y.success)T.fail(`Clone failed: ${y.error}`),process.exit(1);T.succeed("Cloned dataset")}let H=`release/v${Y}`,q=O("Creating release branch...").start(),K=CD({cmd:["git","checkout","-b",H],cwd:X,stdout:"pipe",stderr:"pipe"});if(await K.exited!==0){let C=await new Response(K.stderr).text();q.fail(`Failed to create branch: ${C.trim()}`),process.exit(1)}q.succeed(`Created branch: ${H}`);let V=yF(X,"dataset_description.json");if(!t0(V))console.log(W.red("Error: dataset_description.json not found in repo")),process.exit(1);let E;try{E=JSON.parse(t1(V,"utf-8"))}catch(C){if(C instanceof SyntaxError)console.log(W.red("Error: dataset_description.json contains invalid JSON"));else console.log(W.red(`Error: Could not read dataset_description.json: ${C}`));process.exit(1)}E.Version=Y,d4(V,`${JSON.stringify(E,null,2)}
663
- `);let Z=O("Committing version bump...").start(),L=CD({cmd:["git","add","dataset_description.json"],cwd:X,stdout:"pipe",stderr:"pipe"});if(await L.exited!==0){let C=await new Response(L.stderr).text();Z.fail(`Failed to stage changes: ${C.trim()}`),process.exit(1)}let A=CD({cmd:["git","commit","-m",`Bump version to ${Y}`],cwd:X,stdout:"pipe",stderr:"pipe"});if(await A.exited!==0){let C=await new Response(A.stderr).text();Z.fail(`Commit failed: ${C.trim()}`),process.exit(1)}Z.succeed("Committed version bump");let M=O("Pushing branch...").start(),N=await PF(X,H);if(!N.success)M.fail(`Push failed: ${N.error}`),process.exit(1);M.succeed("Pushed branch");let w=!1,P=O("Creating pull request...").start();try{let C=`Release v${Y}`,T=`## Version Bump
662
+ $ nemar dataset release nm000104 # interactive prompt`).action(async(D,F)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);await l4("release");let $=O("Fetching dataset info...").start(),J;try{J=await uD(D),$.succeed(`Dataset: ${J.name||D}`)}catch(C){if(C instanceof h)$.fail(C.message);else $.fail("Failed to fetch dataset");process.exit(1)}if(!J.github_repo)console.log(W.red("Error: Dataset has no GitHub repository")),process.exit(1);let Q;try{let C=await hf(D);if(Q=C.current_version,console.log(` Current version: ${W.cyan(Q)}`),C.versions.length>0){console.log(` Version DOIs: ${C.versions.length}`);for(let T of C.versions.slice(0,3))console.log(` ${T.version} - ${W.dim(T.doi)}`);if(C.versions.length>3)console.log(W.dim(` ... and ${C.versions.length-3} more`))}}catch(C){let T=C instanceof h?`${C.statusCode}: ${C.message}`:String(C);console.log(W.red(`Error: Could not fetch version history (${T})`)),console.log(" Cannot determine current version. Ensure the backend is reachable."),process.exit(1)}let Y;if(F.version){if(!IH(F.version))console.log(W.red(`Error: Invalid version: ${F.version}`)),console.log(" Expected format: X.Y.Z (e.g., 2.0.0)"),process.exit(1);Y=F.version.replace(/^v/,"")}else if(F.type){let C=F.type;if(!["patch","minor","major"].includes(C))console.log(W.red(`Error: Invalid bump type: ${F.type}`)),console.log(" Expected: patch, minor, or major"),process.exit(1);Y=p4(Q,C)}else{if(!SF(Q))console.log(W.red(`Error: Cannot parse current version: ${Q}`)),process.exit(1);let T=[{name:`patch ${Q} -> ${p4(Q,"patch")}`,value:"patch"},{name:`minor ${Q} -> ${p4(Q,"minor")}`,value:"minor"},{name:`major ${Q} -> ${p4(Q,"major")}`,value:"major"},{name:"custom version",value:"custom"}],{bumpType:y}=await D0.prompt([{type:"list",name:"bumpType",message:"Select version bump type:",choices:T}]);if(y==="custom"){let{customVersion:d}=await D0.prompt([{type:"input",name:"customVersion",message:"Enter version (X.Y.Z):",validate:(W0)=>IH(W0)||"Invalid format. Use X.Y.Z (e.g., 2.0.0)"}]);Y=d.replace(/^v/,"")}else Y=p4(Q,y)}if(console.log(),console.log(` ${W.bold("Version bump:")} ${Q} -> ${W.green(Y)}`),await k0(`Create release PR for ${D} v${Y}?`,{yes:F.yes})!=="confirmed"){console.log("Cancelled.");return}let X,G=!0;if(F.dir){if(!t0(F.dir))console.log(W.red(`Error: Directory not found: ${F.dir}`)),process.exit(1);X=YD(F.dir),G=!1}else X=bV0(yF(uV0(),`nemar-release-${D}-`));if(G){let C=`https://github.com/${J.github_repo}.git`,T=O("Cloning dataset...").start(),y=await s1(C,X);if(!y.success)T.fail(`Clone failed: ${y.error}`),process.exit(1);T.succeed("Cloned dataset")}let H=`release/v${Y}`,q=O("Creating release branch...").start(),K=CD({cmd:["git","checkout","-b",H],cwd:X,stdout:"pipe",stderr:"pipe"});if(await K.exited!==0){let C=await new Response(K.stderr).text();q.fail(`Failed to create branch: ${C.trim()}`),process.exit(1)}q.succeed(`Created branch: ${H}`);let V=yF(X,"dataset_description.json");if(!t0(V))console.log(W.red("Error: dataset_description.json not found in repo")),process.exit(1);let E;try{E=JSON.parse(t1(V,"utf-8"))}catch(C){if(C instanceof SyntaxError)console.log(W.red("Error: dataset_description.json contains invalid JSON"));else console.log(W.red(`Error: Could not read dataset_description.json: ${C}`));process.exit(1)}E.Version=Y,d4(V,`${JSON.stringify(E,null,2)}
663
+ `);let Z=O("Committing version bump...").start(),L=CD({cmd:["git","add","dataset_description.json"],cwd:X,stdout:"pipe",stderr:"pipe"});if(await L.exited!==0){let C=await new Response(L.stderr).text();Z.fail(`Failed to stage changes: ${C.trim()}`),process.exit(1)}let M=CD({cmd:["git","commit","-m",`Bump version to ${Y}`],cwd:X,stdout:"pipe",stderr:"pipe"});if(await M.exited!==0){let C=await new Response(M.stderr).text();Z.fail(`Commit failed: ${C.trim()}`),process.exit(1)}Z.succeed("Committed version bump");let A=O("Pushing branch...").start(),N=await PF(X,H);if(!N.success)A.fail(`Push failed: ${N.error}`),process.exit(1);A.succeed("Pushed branch");let w=!1,P=O("Creating pull request...").start();try{let C=`Release v${Y}`,T=`## Version Bump
664
664
 
665
665
  Bumps ${D} from ${Q} to ${Y}.
666
666
 
@@ -684,15 +684,15 @@ Examples:
684
684
  $ cd nm000104 && nemar dataset update
685
685
  $ nemar dataset update ./nm000104 --bump minor -m "Add new subjects"
686
686
  $ nemar dataset update --branch fix/metadata -m "Fix participant ages"`).action(async(D,F)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);await l4("update");let $=YD(D||".");if(!t0(yF($,".git")))console.log(W.red("Error: Not a git repository")),console.log(" Run this from inside a dataset clone, or pass the path."),process.exit(1);let J=await r8($);if(!J)console.log(W.red("Error: Could not detect dataset ID from git remote")),process.exit(1);console.log(` Dataset: ${W.cyan(J)}`);let Q=await s8($);if(Q!=="main"){if(console.log(W.yellow(`Warning: Currently on branch '${Q}', expected 'main'`)),await k0("Continue anyway?",{yes:F.yes})!=="confirmed"){console.log("Cancelled.");return}}let Y=CD({cmd:["git","status","--porcelain"],cwd:$,stdout:"pipe",stderr:"pipe"}),B=(await new Response(Y.stdout).text()).trim();if(await Y.exited!==0)console.log(W.red("Error: Failed to check git status")),process.exit(1);if(!B){console.log(W.yellow("No changes detected.")),console.log(" Make changes to the dataset files, then run this command again.");return}let X=B.split(`
687
- `),G=[],H=[];for(let R of X){let n=R.substring(3).trim();if(/\.(edf|bdf|set|fdt|nwb|eeg|vhdr|vmrk|cnt|mff|gz)$/i.test(n))G.push(n);else H.push(n)}if(console.log(),H.length>0){console.log(` ${W.bold("Metadata files:")} ${H.length}`);for(let R of H.slice(0,5))console.log(` ${R}`);if(H.length>5)console.log(W.dim(` ... and ${H.length-5} more`))}if(G.length>0){console.log(` ${W.bold("Data files:")} ${G.length}`);for(let R of G.slice(0,5))console.log(` ${R}`);if(G.length>5)console.log(W.dim(` ... and ${G.length-5} more`))}let q=O("Fetching dataset info...").start(),K;try{K=await uD(J),q.succeed()}catch(R){if(R instanceof b)q.fail(R.message);else q.fail("Failed to fetch dataset");process.exit(1)}if(!K.github_repo)console.log(W.red("Error: Dataset has no GitHub repository")),process.exit(1);let V,E=yF($,"dataset_description.json");if(!t0(E))console.log(W.red("Error: dataset_description.json not found")),console.log(" This file is required for BIDS datasets."),process.exit(1);try{let R=JSON.parse(t1(E,"utf-8"));if(typeof R.Version!=="string"||!R.Version)console.log(W.red("Error: No Version field in dataset_description.json")),console.log(' Set the Version field before updating (e.g., "Version": "1.0.0").'),process.exit(1);V=R.Version}catch(R){if(R instanceof SyntaxError)console.log(W.red("Error: dataset_description.json contains invalid JSON"));else console.log(W.red(`Error: Could not read dataset_description.json: ${R}`));process.exit(1)}let Z=F.bump;if(!["patch","minor","major"].includes(Z))console.log(W.red(`Error: Invalid bump type: ${F.bump}`)),process.exit(1);let L=p4(V,Z);if(console.log(` ${W.bold("Version bump:")} ${V} -> ${W.green(L)}`),await k0(`Create update PR for ${J}?`,{yes:F.yes})!=="confirmed"){console.log("Cancelled.");return}let M=Date.now().toString(36),N=F.branch||`update/${J}-${M}`,w=O("Creating update branch...").start(),P=CD({cmd:["git","checkout","-b",N],cwd:$,stdout:"pipe",stderr:"pipe"});if(await P.exited!==0){let R=await new Response(P.stderr).text();w.fail(`Failed to create branch: ${R.trim()}`),process.exit(1)}w.succeed(`Created branch: ${N}`);let C=yF($,"dataset_description.json"),T;try{T=JSON.parse(t1(C,"utf-8"))}catch(R){if(R instanceof SyntaxError)console.log(W.red("Error: dataset_description.json contains invalid JSON"));else console.log(W.red(`Error: Could not read dataset_description.json: ${R}`));process.exit(1)}T.Version=L,d4(C,`${JSON.stringify(T,null,2)}
688
- `);let y=O("Committing changes...").start(),d=CD({cmd:["git","add","-A"],cwd:$,stdout:"pipe",stderr:"pipe"});if(await d.exited!==0){let R=await new Response(d.stderr).text();y.fail(`Failed to stage changes: ${R.trim()}`),process.exit(1)}let W0=F.message||`Update ${J} to ${L}`,F0=CD({cmd:["git","commit","-m",W0],cwd:$,stdout:"pipe",stderr:"pipe"});if(await F0.exited!==0){let R=await new Response(F0.stderr).text();y.fail(`Commit failed: ${R.trim()}`),process.exit(1)}if(y.succeed("Committed changes"),G.length>0)if(await CD({cmd:["git","annex","version"],cwd:$,stdout:"pipe",stderr:"pipe"}).exited===0){let n=O("Requesting upload credentials...").start(),h=null;try{h=await O8(J),n.succeed("Upload credentials received")}catch(P0){n.fail(`Could not get upload credentials: ${w0(P0)}`),console.log(W.yellow(" Data files will not be uploaded. Push manually after PR."))}if(h){if((await g9($)).length===0){n=O("Configuring S3 remote...").start();let J0=await w8($,{name:"nemar-s3",bucket:h.s3.bucket,prefix:`${J}/objects`,region:h.s3.region,publicUrl:`https://${h.s3.bucket}.s3.${h.s3.region}.amazonaws.com`},RD(h.credentials));if(!J0.success)n.warn(`Failed to configure S3 remote: ${J0.error}`),console.log(W.yellow(" Data files will not be uploaded. Push manually after PR."));else n.succeed("S3 remote configured")}if((await g9($)).includes("nemar-s3")){n=O("Uploading data files to S3...").start();let J0=await j8($,"nemar-s3",4,RD(h.credentials));if(await kD($),!J0.success)n.warn(`S3 upload issue: ${J0.error}`),console.log(W.yellow(" Data files may need manual upload after PR creation."));else n.succeed(`Uploaded ${J0.filesCopied} data files to S3`)}}}else console.log(W.yellow(" git-annex not available; data files will be committed to git."));let O0=O("Pushing branch...").start(),e=await PF($,N);if(!e.success)O0.fail(`Push failed: ${e.error}`),process.exit(1);if(G.length>0){if(await CD({cmd:["git","push","origin","git-annex"],cwd:$,stdout:"pipe",stderr:"pipe"}).exited!==0)console.log(W.yellow(" Warning: Failed to push git-annex branch"))}O0.succeed("Pushed branch");let N0=!1,GD=O("Creating pull request...").start();try{let R=F.message?`${F.message} (v${L})`:`Update ${J} to v${L}`,n=[...H,...G].slice(0,10).join(`
689
- - `),h=`## Dataset Update
687
+ `),G=[],H=[];for(let R of X){let n=R.substring(3).trim();if(/\.(edf|bdf|set|fdt|nwb|eeg|vhdr|vmrk|cnt|mff|gz)$/i.test(n))G.push(n);else H.push(n)}if(console.log(),H.length>0){console.log(` ${W.bold("Metadata files:")} ${H.length}`);for(let R of H.slice(0,5))console.log(` ${R}`);if(H.length>5)console.log(W.dim(` ... and ${H.length-5} more`))}if(G.length>0){console.log(` ${W.bold("Data files:")} ${G.length}`);for(let R of G.slice(0,5))console.log(` ${R}`);if(G.length>5)console.log(W.dim(` ... and ${G.length-5} more`))}let q=O("Fetching dataset info...").start(),K;try{K=await uD(J),q.succeed()}catch(R){if(R instanceof h)q.fail(R.message);else q.fail("Failed to fetch dataset");process.exit(1)}if(!K.github_repo)console.log(W.red("Error: Dataset has no GitHub repository")),process.exit(1);let V,E=yF($,"dataset_description.json");if(!t0(E))console.log(W.red("Error: dataset_description.json not found")),console.log(" This file is required for BIDS datasets."),process.exit(1);try{let R=JSON.parse(t1(E,"utf-8"));if(typeof R.Version!=="string"||!R.Version)console.log(W.red("Error: No Version field in dataset_description.json")),console.log(' Set the Version field before updating (e.g., "Version": "1.0.0").'),process.exit(1);V=R.Version}catch(R){if(R instanceof SyntaxError)console.log(W.red("Error: dataset_description.json contains invalid JSON"));else console.log(W.red(`Error: Could not read dataset_description.json: ${R}`));process.exit(1)}let Z=F.bump;if(!["patch","minor","major"].includes(Z))console.log(W.red(`Error: Invalid bump type: ${F.bump}`)),process.exit(1);let L=p4(V,Z);if(console.log(` ${W.bold("Version bump:")} ${V} -> ${W.green(L)}`),await k0(`Create update PR for ${J}?`,{yes:F.yes})!=="confirmed"){console.log("Cancelled.");return}let A=Date.now().toString(36),N=F.branch||`update/${J}-${A}`,w=O("Creating update branch...").start(),P=CD({cmd:["git","checkout","-b",N],cwd:$,stdout:"pipe",stderr:"pipe"});if(await P.exited!==0){let R=await new Response(P.stderr).text();w.fail(`Failed to create branch: ${R.trim()}`),process.exit(1)}w.succeed(`Created branch: ${N}`);let C=yF($,"dataset_description.json"),T;try{T=JSON.parse(t1(C,"utf-8"))}catch(R){if(R instanceof SyntaxError)console.log(W.red("Error: dataset_description.json contains invalid JSON"));else console.log(W.red(`Error: Could not read dataset_description.json: ${R}`));process.exit(1)}T.Version=L,d4(C,`${JSON.stringify(T,null,2)}
688
+ `);let y=O("Committing changes...").start(),d=CD({cmd:["git","add","-A"],cwd:$,stdout:"pipe",stderr:"pipe"});if(await d.exited!==0){let R=await new Response(d.stderr).text();y.fail(`Failed to stage changes: ${R.trim()}`),process.exit(1)}let W0=F.message||`Update ${J} to ${L}`,F0=CD({cmd:["git","commit","-m",W0],cwd:$,stdout:"pipe",stderr:"pipe"});if(await F0.exited!==0){let R=await new Response(F0.stderr).text();y.fail(`Commit failed: ${R.trim()}`),process.exit(1)}if(y.succeed("Committed changes"),G.length>0)if(await CD({cmd:["git","annex","version"],cwd:$,stdout:"pipe",stderr:"pipe"}).exited===0){let n=O("Requesting upload credentials...").start(),b=null;try{b=await O8(J),n.succeed("Upload credentials received")}catch(P0){n.fail(`Could not get upload credentials: ${w0(P0)}`),console.log(W.yellow(" Data files will not be uploaded. Push manually after PR."))}if(b){if((await g9($)).length===0){n=O("Configuring S3 remote...").start();let J0=await w8($,{name:"nemar-s3",bucket:b.s3.bucket,prefix:`${J}/objects`,region:b.s3.region,publicUrl:`https://${b.s3.bucket}.s3.${b.s3.region}.amazonaws.com`},RD(b.credentials));if(!J0.success)n.warn(`Failed to configure S3 remote: ${J0.error}`),console.log(W.yellow(" Data files will not be uploaded. Push manually after PR."));else n.succeed("S3 remote configured")}if((await g9($)).includes("nemar-s3")){n=O("Uploading data files to S3...").start();let J0=await j8($,"nemar-s3",4,RD(b.credentials));if(await kD($),!J0.success)n.warn(`S3 upload issue: ${J0.error}`),console.log(W.yellow(" Data files may need manual upload after PR creation."));else n.succeed(`Uploaded ${J0.filesCopied} data files to S3`)}}}else console.log(W.yellow(" git-annex not available; data files will be committed to git."));let O0=O("Pushing branch...").start(),e=await PF($,N);if(!e.success)O0.fail(`Push failed: ${e.error}`),process.exit(1);if(G.length>0){if(await CD({cmd:["git","push","origin","git-annex"],cwd:$,stdout:"pipe",stderr:"pipe"}).exited!==0)console.log(W.yellow(" Warning: Failed to push git-annex branch"))}O0.succeed("Pushed branch");let N0=!1,GD=O("Creating pull request...").start();try{let R=F.message?`${F.message} (v${L})`:`Update ${J} to v${L}`,n=[...H,...G].slice(0,10).join(`
689
+ - `),b=`## Dataset Update
690
690
 
691
691
  Bumps ${J} from ${V} to ${L}.
692
692
 
693
693
  ### Changed files
694
694
  - ${n}${X.length>10?`
695
- - ... and ${X.length-10} more`:""}`,P0=CD({cmd:["gh","pr","create","--repo",K.github_repo,"--head",N,"--base","main","--title",R,"--body",h],cwd:$,stdout:"pipe",stderr:"pipe"}),g=(await new Response(P0.stdout).text()).trim();if(await P0.exited!==0){let J0=await new Response(P0.stderr).text();throw Error(J0.trim()||"gh pr create failed")}N0=!0,GD.succeed("Created pull request"),console.log(),console.log(` ${W.cyan("PR:")} ${g}`)}catch(R){GD.fail("Failed to create PR");let n=R instanceof Error?R.message:String(R);console.log(W.red(` ${n}`)),console.log(W.dim(` Branch ${N} has been pushed. Create the PR manually.`))}if(F.monitor&&N0){console.log(),console.log(W.dim("Monitoring CI checks..."));let R=0,n=60;while(R<n){await new Promise((J0)=>setTimeout(J0,1e4)),R++;let h=CD({cmd:["gh","pr","checks","--repo",K.github_repo,N],cwd:$,stdout:"pipe",stderr:"pipe"}),P0=await new Response(h.stdout).text();if(await h.exited===0){if(console.log(W.green(" All checks passed!")),await k0("Merge the PR?",{yes:F.yes})==="confirmed"){let V0=CD({cmd:["gh","pr","merge","--repo",K.github_repo,N,"--squash","--delete-branch"],cwd:$,stdout:"pipe",stderr:"pipe"});if(await V0.exited===0)console.log(W.green(" PR merged successfully!"));else{let BD=await new Response(V0.stderr).text();console.log(W.red(` Merge failed: ${BD.trim()}`))}}break}if(P0.includes("fail")||P0.includes("X")){console.log(W.red(" Some checks failed:")),console.log(P0);break}process.stdout.write(W.dim("."))}if(R>=n)console.log(W.yellow(`
695
+ - ... and ${X.length-10} more`:""}`,P0=CD({cmd:["gh","pr","create","--repo",K.github_repo,"--head",N,"--base","main","--title",R,"--body",b],cwd:$,stdout:"pipe",stderr:"pipe"}),g=(await new Response(P0.stdout).text()).trim();if(await P0.exited!==0){let J0=await new Response(P0.stderr).text();throw Error(J0.trim()||"gh pr create failed")}N0=!0,GD.succeed("Created pull request"),console.log(),console.log(` ${W.cyan("PR:")} ${g}`)}catch(R){GD.fail("Failed to create PR");let n=R instanceof Error?R.message:String(R);console.log(W.red(` ${n}`)),console.log(W.dim(` Branch ${N} has been pushed. Create the PR manually.`))}if(F.monitor&&N0){console.log(),console.log(W.dim("Monitoring CI checks..."));let R=0,n=60;while(R<n){await new Promise((J0)=>setTimeout(J0,1e4)),R++;let b=CD({cmd:["gh","pr","checks","--repo",K.github_repo,N],cwd:$,stdout:"pipe",stderr:"pipe"}),P0=await new Response(b.stdout).text();if(await b.exited===0){if(console.log(W.green(" All checks passed!")),await k0("Merge the PR?",{yes:F.yes})==="confirmed"){let V0=CD({cmd:["gh","pr","merge","--repo",K.github_repo,N,"--squash","--delete-branch"],cwd:$,stdout:"pipe",stderr:"pipe"});if(await V0.exited===0)console.log(W.green(" PR merged successfully!"));else{let BD=await new Response(V0.stderr).text();console.log(W.red(` Merge failed: ${BD.trim()}`))}}break}if(P0.includes("fail")||P0.includes("X")){console.log(W.red(" Some checks failed:")),console.log(P0);break}process.stdout.write(W.dim("."))}if(R>=n)console.log(W.yellow(`
696
696
  Timed out waiting for checks.`))}});FD.command("request-access").description("Request collaborator access to a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").addHelpText("after",`
697
697
  Description:
698
698
  Request access to a NEMAR dataset to push data via git-annex.
@@ -706,7 +706,7 @@ Requirements:
706
706
  - Approved user status
707
707
 
708
708
  Examples:
709
- $ nemar dataset request-access nm000104`).action(async(D)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let F=O(`Requesting access to ${D}...`).start();try{let $=await IW(D);F.succeed($.message),console.log(),console.log(` GitHub: https://github.com/${$.github_repo}`),console.log(),console.log(W.dim("You can now push data to this dataset via git-annex."))}catch($){if($ instanceof b)F.fail($.message);else F.fail("Failed to request access"),console.log(W.red(` ${$.message}`));process.exit(1)}});FD.command("invite").description("Invite a user as collaborator to your dataset").argument("<username>","Username to invite").argument("<dataset-id>","Dataset ID (e.g., nm000104)").addHelpText("after",`
709
+ $ nemar dataset request-access nm000104`).action(async(D)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let F=O(`Requesting access to ${D}...`).start();try{let $=await IW(D);F.succeed($.message),console.log(),console.log(` GitHub: https://github.com/${$.github_repo}`),console.log(),console.log(W.dim("You can now push data to this dataset via git-annex."))}catch($){if($ instanceof h)F.fail($.message);else F.fail("Failed to request access"),console.log(W.red(` ${$.message}`));process.exit(1)}});FD.command("invite").description("Invite a user as collaborator to your dataset").argument("<username>","Username to invite").argument("<dataset-id>","Dataset ID (e.g., nm000104)").addHelpText("after",`
710
710
  Description:
711
711
  Invite a NEMAR user as a collaborator to your dataset.
712
712
  Only dataset owners and admins can invite collaborators.
@@ -718,14 +718,14 @@ Requirements:
718
718
  - Dataset ownership or admin status
719
719
 
720
720
  Examples:
721
- $ nemar dataset invite johndoe nm000104`).action(async(D,F)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let $=O(`Inviting ${D} to ${F}...`).start();try{let J=await uf(F,D);$.succeed(J.message)}catch(J){if(J instanceof b)$.fail(J.message);else $.fail("Failed to invite user"),console.log(W.red(` ${J.message}`));process.exit(1)}});FD.command("collaborators").description("List collaborators for a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("--json","Output as JSON for scripting").addHelpText("after",`
721
+ $ nemar dataset invite johndoe nm000104`).action(async(D,F)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let $=O(`Inviting ${D} to ${F}...`).start();try{let J=await uf(F,D);$.succeed(J.message)}catch(J){if(J instanceof h)$.fail(J.message);else $.fail("Failed to invite user"),console.log(W.red(` ${J.message}`));process.exit(1)}});FD.command("collaborators").description("List collaborators for a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("--json","Output as JSON for scripting").addHelpText("after",`
722
722
  Description:
723
723
  List all collaborators who have access to a dataset.
724
724
  Only dataset owners and admins can view collaborators.
725
725
 
726
726
  Examples:
727
727
  $ nemar dataset collaborators nm000104
728
- $ nemar dataset collaborators nm000104 --json`).action(async(D,F)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let $=O(`Fetching collaborators for ${D}...`).start();try{let J=await mf(D);if($.stop(),F.json){console.log(JSON.stringify(J,null,2));return}if(console.log(),console.log(W.bold(`Collaborators for ${D} (${J.count}):`)),console.log(),J.collaborators.length===0){console.log(W.dim(" No collaborators yet.")),console.log(),console.log(W.dim(`Invite users with: nemar dataset invite <username> ${D}`));return}let Q=["Username","GitHub","Access","Granted"].join(" ");console.log(W.dim(` ${Q}`)),console.log(W.dim(` ${"-".repeat(Q.length)}`));for(let Y of J.collaborators){let B=new Date(Y.granted_at).toLocaleDateString(),X=Y.access_type==="invited"?"invited":"requested",G=[Y.username.padEnd(10),`@${Y.github_username}`.padEnd(15),X.padEnd(10),B].join(" ");console.log(` ${G}`)}console.log()}catch(J){if(J instanceof b)$.fail(J.message);else $.fail("Failed to fetch collaborators"),console.log(W.red(` ${J.message}`));process.exit(1)}});var OQ=new i0("publish").description("Publication workflow management");OQ.command("request").description("Request publication of a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").addHelpText("after",`
728
+ $ nemar dataset collaborators nm000104 --json`).action(async(D,F)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let $=O(`Fetching collaborators for ${D}...`).start();try{let J=await mf(D);if($.stop(),F.json){console.log(JSON.stringify(J,null,2));return}if(console.log(),console.log(W.bold(`Collaborators for ${D} (${J.count}):`)),console.log(),J.collaborators.length===0){console.log(W.dim(" No collaborators yet.")),console.log(),console.log(W.dim(`Invite users with: nemar dataset invite <username> ${D}`));return}let Q=["Username","GitHub","Access","Granted"].join(" ");console.log(W.dim(` ${Q}`)),console.log(W.dim(` ${"-".repeat(Q.length)}`));for(let Y of J.collaborators){let B=new Date(Y.granted_at).toLocaleDateString(),X=Y.access_type==="invited"?"invited":"requested",G=[Y.username.padEnd(10),`@${Y.github_username}`.padEnd(15),X.padEnd(10),B].join(" ");console.log(` ${G}`)}console.log()}catch(J){if(J instanceof h)$.fail(J.message);else $.fail("Failed to fetch collaborators"),console.log(W.red(` ${J.message}`));process.exit(1)}});var OQ=new i0("publish").description("Publication workflow management");OQ.command("request").description("Request publication of a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").addHelpText("after",`
729
729
  Description:
730
730
  Submit a publication request to make your private dataset publicly accessible.
731
731
  NEMAR admins will be notified and can approve or deny your request.
@@ -744,7 +744,7 @@ Status Flow:
744
744
  Examples:
745
745
  $ nemar dataset publish request nm000104
746
746
  $ nemar dataset publish status nm000104 # Check request status`).action(async(D)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let F=O(`Requesting publication for ${D}...`).start();try{let $=await YQ(D);F.succeed($.message),console.log(W.dim(`
747
- Admins have been notified. Use 'nemar dataset publish status' to check progress.`))}catch($){if($ instanceof b){if(F.fail($.message),console.log(W.dim(` ${$.message}`)),$.statusCode===409)console.log(W.dim(" Use 'nemar dataset publish resend' to remind admins."));else if($.statusCode===403)console.log(W.dim(" Only the dataset owner can request publication."))}else{F.fail("Failed to request publication");let J=$ instanceof Error?$.message:String($);console.log(W.dim(` Error details: ${J}`))}process.exit(1)}});OQ.command("status").description("Check publication status of a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").addHelpText("after",`
747
+ Admins have been notified. Use 'nemar dataset publish status' to check progress.`))}catch($){if($ instanceof h){if(F.fail($.message),console.log(W.dim(` ${$.message}`)),$.statusCode===409)console.log(W.dim(" Use 'nemar dataset publish resend' to remind admins."));else if($.statusCode===403)console.log(W.dim(" Only the dataset owner can request publication."))}else{F.fail("Failed to request publication");let J=$ instanceof Error?$.message:String($);console.log(W.dim(` Error details: ${J}`))}process.exit(1)}});OQ.command("status").description("Check publication status of a dataset").argument("<dataset-id>","Dataset ID (e.g., nm000104)").addHelpText("after",`
748
748
  Description:
749
749
  Check the status of your publication request and see progress through
750
750
  the approval workflow.
@@ -776,7 +776,7 @@ Examples:
776
776
  ${W.cyan("Publication Status:")} ${D}
777
777
  `);let Q={published:W.green,denied:W.red,approving:W.yellow}[$.status]||W.dim;if(console.log(` Status: ${Q($.status)}`),$.requested_at)console.log(` Requested: ${W.dim($.requested_at)}`);if($.requested_by)console.log(` Requested by: ${W.dim($.requested_by)}`);if($.status==="denied"&&$.denied_reason)console.log(`
778
778
  ${W.red("Reason:")} ${$.denied_reason}`);if($.status==="approving"){let Y=S9,B=$.steps_completed||[],X=Y.length;console.log(`
779
- Steps:`),Y.forEach((G,H)=>{let q=B.includes(G),K=$.current_step===G,V=q?W.green("[x]"):K?W.yellow("[>]"):W.dim("[ ]"),E=G.replace(/_/g," "),Z=`[${String(H+1).padStart(2," ")}/${X}]`;console.log(` ${V} ${W.dim(Z)} ${E}${K&&$.last_error?W.red(` (error: ${$.last_error})`):""}`)})}if($.status==="published"&&$.approved_at)console.log(` Published: ${W.dim($.approved_at)}`);console.log()}catch($){if($ instanceof b)F.fail($.message),console.log(W.dim(` ${$.message}`));else{F.fail("Failed to check publication status");let J=$ instanceof Error?$.message:String($);console.log(W.dim(` Error details: ${J}`))}process.exit(1)}});OQ.command("resend").description("Resend publication request notification to admins").argument("<dataset-id>","Dataset ID (e.g., nm000104)").addHelpText("after",`
779
+ Steps:`),Y.forEach((G,H)=>{let q=B.includes(G),K=$.current_step===G,V=q?W.green("[x]"):K?W.yellow("[>]"):W.dim("[ ]"),E=G.replace(/_/g," "),Z=`[${String(H+1).padStart(2," ")}/${X}]`;console.log(` ${V} ${W.dim(Z)} ${E}${K&&$.last_error?W.red(` (error: ${$.last_error})`):""}`)})}if($.status==="published"&&$.approved_at)console.log(` Published: ${W.dim($.approved_at)}`);console.log()}catch($){if($ instanceof h)F.fail($.message),console.log(W.dim(` ${$.message}`));else{F.fail("Failed to check publication status");let J=$ instanceof Error?$.message:String($);console.log(W.dim(` Error details: ${J}`))}process.exit(1)}});OQ.command("resend").description("Resend publication request notification to admins").argument("<dataset-id>","Dataset ID (e.g., nm000104)").addHelpText("after",`
780
780
  Description:
781
781
  Resend the publication request notification email to all NEMAR admins.
782
782
  Use this if admins haven't responded to your original request.
@@ -790,7 +790,7 @@ When to Use:
790
790
  - Your request status is still "requested"
791
791
 
792
792
  Examples:
793
- $ nemar dataset publish resend nm000104`).action(async(D)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let F=O(`Resending notification for ${D}...`).start();try{let $=await nf(D);F.succeed($.message)}catch($){if($ instanceof b){if(F.fail($.message),console.log(W.dim(` ${$.message}`)),$.statusCode===404)console.log(W.dim(" Publication request not found for this dataset."))}else{F.fail("Failed to resend notification");let J=$ instanceof Error?$.message:String($);console.log(W.dim(` Error details: ${J}`))}process.exit(1)}});FD.addCommand(OQ);FD.command("clone").description("Clone a dataset from NEMAR").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("-o, --output <path>","Output directory (default: ./<dataset-id>)").addHelpText("after",`
793
+ $ nemar dataset publish resend nm000104`).action(async(D)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let F=O(`Resending notification for ${D}...`).start();try{let $=await nf(D);F.succeed($.message)}catch($){if($ instanceof h){if(F.fail($.message),console.log(W.dim(` ${$.message}`)),$.statusCode===404)console.log(W.dim(" Publication request not found for this dataset."))}else{F.fail("Failed to resend notification");let J=$ instanceof Error?$.message:String($);console.log(W.dim(` Error details: ${J}`))}process.exit(1)}});FD.addCommand(OQ);FD.command("clone").description("Clone a dataset from NEMAR").argument("<dataset-id>","Dataset ID (e.g., nm000104)").option("-o, --output <path>","Output directory (default: ./<dataset-id>)").addHelpText("after",`
794
794
  Description:
795
795
  Clone a NEMAR dataset repository with git-annex initialized.
796
796
  Data files are not downloaded; use 'nemar dataset get' afterward.
@@ -804,7 +804,7 @@ Requirements:
804
804
 
805
805
  Examples:
806
806
  $ nemar dataset clone nm000104
807
- $ nemar dataset clone nm000104 -o ./my-dataset`).action(async(D,F)=>{await l4("clone");let $=O("Checking prerequisites...").start(),J=await TF();if(!J.allPassed){$.fail("Prerequisites check failed");for(let K of J.errors)console.log(W.red(` - ${K}`));process.exit(1)}$.succeed("Prerequisites OK"),$=O(`Resolving dataset ${D}...`).start();let Q,Y;try{let K=await uD(D);if(!K.github_repo||!/^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+$/.test(K.github_repo))$.fail("Dataset has no valid GitHub repository"),console.log(W.red(` Received: ${K.github_repo||"(empty)"}`)),process.exit(1);Q=`https://github.com/${K.github_repo}.git`,Y=K.visibility,$.succeed(`Found: ${K.name}`)}catch(K){if(K instanceof b&&(K.statusCode===404||K.statusCode===400))$.fail(`Dataset ${D} not found`),console.log(W.red(`Error: Dataset ${D} not found`)),console.log(W.dim(` ${K.message}`));else if(K instanceof b&&(K.statusCode===401||K.statusCode===403))$.fail("Not authorized"),console.log(W.red(`Error: Not authorized to access dataset ${D}`)),console.log(W.dim(" Run 'nemar auth login' to authenticate."));else if(K instanceof b)$.fail("Failed to resolve dataset"),console.log(W.red(`Error: ${K.message}`));else{$.fail("Failed to resolve dataset");let V=K instanceof Error?K.message:String(K);console.log(W.red(`Error: ${V}`))}process.exit(1)}let B=YD(F.output||D);if(t0(B))console.log(W.red(`Error: Path already exists: ${B}`)),process.exit(1);let X=null;if(Y!=="public"){$=O("Requesting download credentials...").start();try{X=await QQ(D),$.succeed("Download credentials received (2h expiry)")}catch(K){$.fail("Failed to get download credentials"),console.log(W.red(` ${K.message}`)),console.log(W.dim("Private datasets require authentication. Run 'nemar auth login' first.")),process.exit(1)}}let G=X?RD(X.credentials):void 0;$=O("Cloning dataset...").start();let H=await s1(Q,B);if(!H.success)$.fail("Clone failed"),console.log(W.red(` ${H.error}`)),process.exit(1);$.succeed("Dataset cloned");let q=await h4(B,"nemar-s3",G);if(q.enabled)console.log(W.dim(" S3 remote enabled for data downloads"));else if(!q.success)console.log(W.yellow(` Warning: Could not enable S3 remote: ${q.error}`));if(X)await kD(B);console.log(),console.log(` Location: ${W.cyan(B)}`),console.log(),console.log(W.dim("Data files are not downloaded yet. To get them:")),console.log(W.dim(` cd ${B}`)),console.log(W.dim(" nemar dataset get"))});FD.command("get").description("Download annexed data files for the current dataset").argument("[files...]","Specific files/paths to get (default: all)").option("-j, --jobs <number>","Parallel download streams","4").option("--stimuli","Include stimuli/ content (skipped by default; can be large)").option("--derivatives","Include derivatives/ content (skipped by default; can be large)").option("--skip-port-check","Skip the porting-in-progress check (use if falsely blocked on an OpenNeuro-sourced dataset)").addHelpText("after",`
807
+ $ nemar dataset clone nm000104 -o ./my-dataset`).action(async(D,F)=>{await l4("clone");let $=O("Checking prerequisites...").start(),J=await TF();if(!J.allPassed){$.fail("Prerequisites check failed");for(let K of J.errors)console.log(W.red(` - ${K}`));process.exit(1)}$.succeed("Prerequisites OK"),$=O(`Resolving dataset ${D}...`).start();let Q,Y;try{let K=await uD(D);if(!K.github_repo||!/^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+$/.test(K.github_repo))$.fail("Dataset has no valid GitHub repository"),console.log(W.red(` Received: ${K.github_repo||"(empty)"}`)),process.exit(1);Q=`https://github.com/${K.github_repo}.git`,Y=K.visibility,$.succeed(`Found: ${K.name}`)}catch(K){if(K instanceof h&&(K.statusCode===404||K.statusCode===400))$.fail(`Dataset ${D} not found`),console.log(W.red(`Error: Dataset ${D} not found`)),console.log(W.dim(` ${K.message}`));else if(K instanceof h&&(K.statusCode===401||K.statusCode===403))$.fail("Not authorized"),console.log(W.red(`Error: Not authorized to access dataset ${D}`)),console.log(W.dim(" Run 'nemar auth login' to authenticate."));else if(K instanceof h)$.fail("Failed to resolve dataset"),console.log(W.red(`Error: ${K.message}`));else{$.fail("Failed to resolve dataset");let V=K instanceof Error?K.message:String(K);console.log(W.red(`Error: ${V}`))}process.exit(1)}let B=YD(F.output||D);if(t0(B))console.log(W.red(`Error: Path already exists: ${B}`)),process.exit(1);let X=null;if(Y!=="public"){$=O("Requesting download credentials...").start();try{X=await QQ(D),$.succeed("Download credentials received (2h expiry)")}catch(K){$.fail("Failed to get download credentials"),console.log(W.red(` ${K.message}`)),console.log(W.dim("Private datasets require authentication. Run 'nemar auth login' first.")),process.exit(1)}}let G=X?RD(X.credentials):void 0;$=O("Cloning dataset...").start();let H=await s1(Q,B);if(!H.success)$.fail("Clone failed"),console.log(W.red(` ${H.error}`)),process.exit(1);$.succeed("Dataset cloned");let q=await h4(B,"nemar-s3",G);if(q.enabled)console.log(W.dim(" S3 remote enabled for data downloads"));else if(!q.success)console.log(W.yellow(` Warning: Could not enable S3 remote: ${q.error}`));if(X)await kD(B);console.log(),console.log(` Location: ${W.cyan(B)}`),console.log(),console.log(W.dim("Data files are not downloaded yet. To get them:")),console.log(W.dim(` cd ${B}`)),console.log(W.dim(" nemar dataset get"))});FD.command("get").description("Download annexed data files for the current dataset").argument("[files...]","Specific files/paths to get (default: all)").option("-j, --jobs <number>","Parallel download streams","4").option("--stimuli","Include stimuli/ content (skipped by default; can be large)").option("--derivatives","Include derivatives/ content (skipped by default; can be large)").option("--skip-port-check","Skip the porting-in-progress check (use if falsely blocked on an OpenNeuro-sourced dataset)").addHelpText("after",`
808
808
  Description:
809
809
  Download data files from the remote for a cloned dataset.
810
810
  Must be run inside a git-annex dataset directory.
@@ -823,7 +823,7 @@ Examples:
823
823
  $ nemar dataset get --stimuli --derivatives # Get everything
824
824
  $ nemar dataset get sub-01/eeg/ # Get specific directory
825
825
  $ nemar dataset get stimuli/ # Explicit path: fetches stimuli/
826
- $ nemar dataset get *.edf -j 8 # Get EDF files with 8 streams`).action(async(D,F)=>{let $=process.cwd();if(!await w1($))console.log(W.red("Error: Not inside a git-annex dataset directory")),console.log(W.dim("Use 'nemar dataset clone <id>' first, then cd into the dataset.")),process.exit(1);let J=Number.parseInt(F.jobs,10);if(Number.isNaN(J)||J<1)console.log(W.red("Error: --jobs must be a positive integer")),process.exit(1);let Q=null,Y=await r8($);if(Y){let L=null,A=!0;try{L=await uD(Y)}catch{A=!1}if(!F.skipPortCheck){let M=L?.source==="openneuro";if(!A&&!M){let N=yF($,".nemar","metadata.json");if(t0(N))try{M=JSON.parse(t1(N,"utf-8")).source==="openneuro"}catch{}}if(M){if(await HQ($)==="absent")console.log(W.yellow("Porting still in progress.")),console.log(W.dim(" This dataset is being imported from OpenNeuro. Data files are not yet available.")),console.log(W.dim(" Wait 5\u201330 minutes (depending on dataset size), then retry.")),console.log(W.dim(" Run 'nemar dataset status <id>' to track progress.")),console.log(W.dim(" Pass --skip-port-check to bypass this check if you are certain porting is complete.")),process.exit(1)}}if(L&&L.visibility!=="public"){if(!L0())console.log(W.red("Error: This is a private dataset. Authentication required.")),console.log(W.dim("Run 'nemar auth login' first.")),process.exit(1);let M=O("Requesting download credentials...").start();try{Q=await QQ(Y),M.succeed("Download credentials received (2h expiry)")}catch(N){M.fail("Failed to get download credentials"),console.log(W.red(` ${N.message}`)),console.log(W.dim("Private datasets require authentication. Run 'nemar auth login' first.")),process.exit(1)}}}let B=Q?RD(Q.credentials):void 0,X=await h4($,"nemar-s3",B);if(!X.success&&!X.enabled)console.log(W.yellow(` Warning: Could not enable S3 remote: ${X.error}`));let G=D.length>0?D:void 0,H=eg(G,{stimuli:F.stimuli,derivatives:F.derivatives}),q=H.args.length>0?H.args:void 0;for(let L of H.summary)console.log(W.dim(` ${L}`));let K=await WQ($,G,q);if(K&&K.fileCount===0){if(console.log(W.green("All data files already present")),Q)await kD($);return}let V=G?`Getting ${G.length} path(s)${K?` (${K.fileCount} files, ${XD(K.totalBytes)})`:""}...`:`Getting all data files${K?` (${K.fileCount} files, ${XD(K.totalBytes)})`:""}...`;console.log(W.bold(V));let E=new XQ(K?.fileCount??0,K?.totalBytes??0),Z=await qQ($,{jobs:J,paths:G,credentials:B,extraArgs:q,onProgress:(L)=>E.processLine(L)});if(!Z.success){if(E.finish(0),console.log(W.red(` ${Z.error}`)),Q)await kD($);process.exit(1)}if(E.finish(Z.filesDownloaded||0),Q)await kD($);if(Z.filesDownloaded===0)console.log(W.green("All data files already present"));else console.log(W.green(`Downloaded ${Z.filesDownloaded} file(s)`))});async function rh(D){let F=process.cwd();if(!await w1(F))console.log(W.red("Error: Not inside a git-annex dataset directory")),process.exit(1);let $=O("Saving changes...").start(),J=await o8(F,D.message);if(!J.success)$.fail("Save failed"),console.log(W.red(` ${J.error}`)),process.exit(1);$.succeed("Changes saved")}FD.command("commit").description("Stage and commit changes in the current dataset").option("-m, --message <msg>","Commit message","Save changes").addHelpText("after",`
826
+ $ nemar dataset get *.edf -j 8 # Get EDF files with 8 streams`).action(async(D,F)=>{let $=process.cwd();if(!await w1($))console.log(W.red("Error: Not inside a git-annex dataset directory")),console.log(W.dim("Use 'nemar dataset clone <id>' first, then cd into the dataset.")),process.exit(1);let J=Number.parseInt(F.jobs,10);if(Number.isNaN(J)||J<1)console.log(W.red("Error: --jobs must be a positive integer")),process.exit(1);let Q=null,Y=await r8($);if(Y){let L=null,M=!0;try{L=await uD(Y)}catch(A){if(A instanceof h&&A.statusCode!==0){if(A.statusCode===401||A.statusCode===403)console.log(W.red(`\u2716 ${A.message}`)),console.log(W.dim(" Run 'nemar auth login' or 'nemar auth regenerate-key'.")),process.exit(1);throw A}M=!1}if(!F.skipPortCheck){let A=L?.source==="openneuro";if(!M&&!A){let N=yF($,".nemar","metadata.json");if(t0(N))try{A=JSON.parse(t1(N,"utf-8")).source==="openneuro"}catch{}}if(A){if(await HQ($)==="absent")console.log(W.yellow("Porting still in progress.")),console.log(W.dim(" This dataset is being imported from OpenNeuro. Data files are not yet available.")),console.log(W.dim(" Wait 5\u201330 minutes (depending on dataset size), then retry.")),console.log(W.dim(" Run 'nemar dataset status <id>' to track progress.")),console.log(W.dim(" Pass --skip-port-check to bypass this check if you are certain porting is complete.")),process.exit(1)}}if(L&&L.visibility!=="public"){if(!L0())console.log(W.red("Error: This is a private dataset. Authentication required.")),console.log(W.dim("Run 'nemar auth login' first.")),process.exit(1);let A=O("Requesting download credentials...").start();try{Q=await QQ(Y),A.succeed("Download credentials received (2h expiry)")}catch(N){A.fail("Failed to get download credentials"),console.log(W.red(` ${N.message}`)),console.log(W.dim("Private datasets require authentication. Run 'nemar auth login' first.")),process.exit(1)}}}let B=Q?RD(Q.credentials):void 0,X=await h4($,"nemar-s3",B);if(!X.success&&!X.enabled)console.log(W.yellow(` Warning: Could not enable S3 remote: ${X.error}`));let G=D.length>0?D:void 0,H=eg(G,{stimuli:F.stimuli,derivatives:F.derivatives}),q=H.args.length>0?H.args:void 0;for(let L of H.summary)console.log(W.dim(` ${L}`));let K=await WQ($,G,q);if(K&&K.fileCount===0){if(console.log(W.green("All data files already present")),Q)await kD($);return}let V=G?`Getting ${G.length} path(s)${K?` (${K.fileCount} files, ${XD(K.totalBytes)})`:""}...`:`Getting all data files${K?` (${K.fileCount} files, ${XD(K.totalBytes)})`:""}...`;console.log(W.bold(V));let E=new XQ(K?.fileCount??0,K?.totalBytes??0),Z=await qQ($,{jobs:J,paths:G,credentials:B,extraArgs:q,onProgress:(L)=>E.processLine(L)});if(!Z.success){if(E.finish(0),console.log(W.red(` ${Z.error}`)),Q)await kD($);process.exit(1)}if(E.finish(Z.filesDownloaded||0),Q)await kD($);if(Z.filesDownloaded===0)console.log(W.green("All data files already present"));else console.log(W.green(`Downloaded ${Z.filesDownloaded} file(s)`))});async function rh(D){let F=process.cwd();if(!await w1(F))console.log(W.red("Error: Not inside a git-annex dataset directory")),process.exit(1);let $=O("Saving changes...").start(),J=await o8(F,D.message);if(!J.success)$.fail("Save failed"),console.log(W.red(` ${J.error}`)),process.exit(1);$.succeed("Changes saved")}FD.command("commit").description("Stage and commit changes in the current dataset").option("-m, --message <msg>","Commit message","Save changes").addHelpText("after",`
827
827
  Description:
828
828
  Stage all changes (git add -A) and commit them. Large files are
829
829
  automatically handled by git-annex based on the dataset's largefiles config.
@@ -866,7 +866,7 @@ Examples:
866
866
  $ nemar dataset push
867
867
  $ nemar dataset push --no-s3 # Git only, skip S3
868
868
  $ nemar dataset push -j 8 # More parallel S3 streams
869
- $ nemar dataset push --pr -t "Add new recordings"`).action(async(D)=>{let F=process.cwd();if(await l4("push"),!await w1(F))console.log(W.red("Error: Not inside a git-annex dataset directory")),process.exit(1);let $=await s8(F);if(($==="main"||$==="master"||($?.startsWith("adjusted/main")??!1))&&!D.pr){let X=await r8(F);if(X&&L0())try{if((await uD(X)).visibility==="public")console.log(W.red("Error: This dataset is public with branch protection.")),console.log(W.red(" Direct push to main is not allowed.")),oh(),process.exit(1)}catch{}}let Q=O("Pushing to GitHub...").start(),Y=await o1(F);if(!Y.success){let X=Y.error||"";if(X.includes("protected branch")||X.includes("GH006"))Q.fail("Push rejected: branch protection is enabled"),console.log(),console.log(" Public datasets require changes via pull request."),oh();else if(X.includes("terminal prompts disabled"))Q.fail("Git push failed: authentication required"),console.log(),console.log(" Run 'nemar auth setup-ssh' to configure SSH authentication.");else Q.fail("Git push failed"),console.log(W.red(` ${X}`));process.exit(1)}if(Y.warning)Q.warn("Git pushed with warning"),console.log(W.yellow(` ${Y.warning}`));else Q.succeed("Pushed to GitHub");let B=!1;if(D.s3!==!1){let X=await g9(F),G=await mW(F,X);if(G){if(X.length>1){let E=X.filter((Z)=>Z!==G).join(", ");console.log(W.dim(` Multiple S3 remotes available; using ${G} (skipped: ${E})`))}let H=Number.parseInt(D.jobs,10);if(Number.isNaN(H)||H<1)console.log(W.red("Error: --jobs must be a positive integer")),process.exit(1);let q=await r8(F),K=null,V=!1;if(q&&L0()){Q=O("Requesting upload credentials...").start();try{K=await O8(q),Q.succeed("Upload credentials received")}catch(E){if(E instanceof b&&E.statusCode===403&&/collaborator/i.test(E.message)){Q.text="Requesting collaborator access...";try{await IW(q),K=await O8(q),Q.succeed("Granted collaborator access; upload credentials received")}catch(L){let A=L instanceof b&&L.statusCode>=400&&L.statusCode<500;if(Q.fail(`Could not get upload credentials: ${w0(E)}`),console.log(W.dim(` Tried request-access automatically: ${w0(L)}`)),A)V=!0,console.log(W.yellow(` Run 'nemar dataset request-access ${q}' and retry this push.`));else console.log(W.yellow(" The credentials service is unavailable; retry the push in a moment.")),B=!0}}else Q.warn(`Could not get upload credentials: ${w0(E)}. Falling back to environment credentials.`)}}if(V)B=!0;else{let E=K?RD(K.credentials):void 0;if(!K){let L=Boolean(process.env.AWS_ACCESS_KEY_ID),A=Boolean(process.env.AWS_SECRET_ACCESS_KEY);if(!L||!A)console.log(W.yellow(` No NEMAR credentials and AWS env vars are missing (AWS_ACCESS_KEY_ID=${L?"set":"unset"}, AWS_SECRET_ACCESS_KEY=${A?"set":"unset"}).`))}Q=O(`Copying data to S3 (${G})...`).start();let Z;try{Z=await j8(F,G,H,E)}finally{if(K)await kD(F)}if(!Z.success)Q.fail("S3 push failed"),console.log(W.red(` ${Z.error}`)),console.log(W.yellow(" Git changes were pushed successfully; data upload can be retried later with 'nemar dataset push --no-pr'.")),B=!0;else{Q.succeed(`Copied ${Z.filesCopied} file(s) to S3`);let L=O("Pushing git-annex branch...").start(),A=CD({cmd:["git","push","origin","git-annex"],cwd:F,stdout:"pipe",stderr:"pipe"}),M=await new Response(A.stderr).text();if(await A.exited!==0)L.warn(`Could not push git-annex branch: ${M.trim()||"unknown error"}`),console.log(W.yellow(" Run 'git push origin git-annex' manually so other clones can locate the new files.")),B=!0;else L.succeed("Pushed git-annex branch")}}}else console.log(W.dim(" No usable S3 remote configured; skipping data push."))}if(D.pr){let X=await s8(F);if(!X)console.log(W.red(" Could not determine current branch")),console.log(W.dim(" Ensure you are inside a valid git repository.")),process.exit(1);if(X==="main"||X==="master")console.log(W.yellow(" Skipping PR: already on main branch"));else{Q=O("Creating pull request...").start();let G=["gh","pr","create"];if(D.title)G.push("--title",D.title);else G.push("--title",`Update from branch ${X}`);if(D.body)G.push("--body",D.body);else G.push("--body","");try{let H=CD({cmd:G,cwd:F,env:process.env,stdout:"pipe",stderr:"pipe"}),q=await new Response(H.stdout).text(),K=await new Response(H.stderr).text();if(await H.exited!==0)Q.fail("Failed to create pull request"),console.log(W.red(` ${K.trim()||q.trim()}`)),process.exit(1);let E=q.trim();Q.succeed("Pull request created"),console.log(` ${W.cyan(E)}`)}catch(H){Q.fail("Failed to create pull request");let q=H instanceof Error?H.message:String(H);if(q.includes("ENOENT")||q.includes("not found"))console.log(W.red(" 'gh' CLI is not installed or not in PATH")),console.log(W.dim(" Install it: https://cli.github.com/"));else console.log(W.red(` ${q}`));process.exit(1)}}}if(B)process.exit(1)});FD.command("drop").description("Free local copies of annexed files (keeps remote copies)").argument("[files...]","Specific files to drop (default: all)").addHelpText("after",`
869
+ $ nemar dataset push --pr -t "Add new recordings"`).action(async(D)=>{let F=process.cwd();if(await l4("push"),!await w1(F))console.log(W.red("Error: Not inside a git-annex dataset directory")),process.exit(1);let $=await s8(F);if(($==="main"||$==="master"||($?.startsWith("adjusted/main")??!1))&&!D.pr){let X=await r8(F);if(X&&L0())try{if((await uD(X)).visibility==="public")console.log(W.red("Error: This dataset is public with branch protection.")),console.log(W.red(" Direct push to main is not allowed.")),oh(),process.exit(1)}catch{}}let Q=O("Pushing to GitHub...").start(),Y=await o1(F);if(!Y.success){let X=Y.error||"";if(X.includes("protected branch")||X.includes("GH006"))Q.fail("Push rejected: branch protection is enabled"),console.log(),console.log(" Public datasets require changes via pull request."),oh();else if(X.includes("terminal prompts disabled"))Q.fail("Git push failed: authentication required"),console.log(),console.log(" Run 'nemar auth setup-ssh' to configure SSH authentication.");else Q.fail("Git push failed"),console.log(W.red(` ${X}`));process.exit(1)}if(Y.warning)Q.warn("Git pushed with warning"),console.log(W.yellow(` ${Y.warning}`));else Q.succeed("Pushed to GitHub");let B=!1;if(D.s3!==!1){let X=await g9(F),G=await mW(F,X);if(G){if(X.length>1){let E=X.filter((Z)=>Z!==G).join(", ");console.log(W.dim(` Multiple S3 remotes available; using ${G} (skipped: ${E})`))}let H=Number.parseInt(D.jobs,10);if(Number.isNaN(H)||H<1)console.log(W.red("Error: --jobs must be a positive integer")),process.exit(1);let q=await r8(F),K=null,V=!1;if(q&&L0()){Q=O("Requesting upload credentials...").start();try{K=await O8(q),Q.succeed("Upload credentials received")}catch(E){if(E instanceof h&&E.statusCode===403&&/collaborator/i.test(E.message)){Q.text="Requesting collaborator access...";try{await IW(q),K=await O8(q),Q.succeed("Granted collaborator access; upload credentials received")}catch(L){let M=L instanceof h&&L.statusCode>=400&&L.statusCode<500;if(Q.fail(`Could not get upload credentials: ${w0(E)}`),console.log(W.dim(` Tried request-access automatically: ${w0(L)}`)),M)V=!0,console.log(W.yellow(` Run 'nemar dataset request-access ${q}' and retry this push.`));else console.log(W.yellow(" The credentials service is unavailable; retry the push in a moment.")),B=!0}}else Q.warn(`Could not get upload credentials: ${w0(E)}. Falling back to environment credentials.`)}}if(V)B=!0;else{let E=K?RD(K.credentials):void 0;if(!K){let L=Boolean(process.env.AWS_ACCESS_KEY_ID),M=Boolean(process.env.AWS_SECRET_ACCESS_KEY);if(!L||!M)console.log(W.yellow(` No NEMAR credentials and AWS env vars are missing (AWS_ACCESS_KEY_ID=${L?"set":"unset"}, AWS_SECRET_ACCESS_KEY=${M?"set":"unset"}).`))}Q=O(`Copying data to S3 (${G})...`).start();let Z;try{Z=await j8(F,G,H,E)}finally{if(K)await kD(F)}if(!Z.success)Q.fail("S3 push failed"),console.log(W.red(` ${Z.error}`)),console.log(W.yellow(" Git changes were pushed successfully; data upload can be retried later with 'nemar dataset push --no-pr'.")),B=!0;else{Q.succeed(`Copied ${Z.filesCopied} file(s) to S3`);let L=O("Pushing git-annex branch...").start(),M=CD({cmd:["git","push","origin","git-annex"],cwd:F,stdout:"pipe",stderr:"pipe"}),A=await new Response(M.stderr).text();if(await M.exited!==0)L.warn(`Could not push git-annex branch: ${A.trim()||"unknown error"}`),console.log(W.yellow(" Run 'git push origin git-annex' manually so other clones can locate the new files.")),B=!0;else L.succeed("Pushed git-annex branch")}}}else console.log(W.dim(" No usable S3 remote configured; skipping data push."))}if(D.pr){let X=await s8(F);if(!X)console.log(W.red(" Could not determine current branch")),console.log(W.dim(" Ensure you are inside a valid git repository.")),process.exit(1);if(X==="main"||X==="master")console.log(W.yellow(" Skipping PR: already on main branch"));else{Q=O("Creating pull request...").start();let G=["gh","pr","create"];if(D.title)G.push("--title",D.title);else G.push("--title",`Update from branch ${X}`);if(D.body)G.push("--body",D.body);else G.push("--body","");try{let H=CD({cmd:G,cwd:F,env:process.env,stdout:"pipe",stderr:"pipe"}),q=await new Response(H.stdout).text(),K=await new Response(H.stderr).text();if(await H.exited!==0)Q.fail("Failed to create pull request"),console.log(W.red(` ${K.trim()||q.trim()}`)),process.exit(1);let E=q.trim();Q.succeed("Pull request created"),console.log(` ${W.cyan(E)}`)}catch(H){Q.fail("Failed to create pull request");let q=H instanceof Error?H.message:String(H);if(q.includes("ENOENT")||q.includes("not found"))console.log(W.red(" 'gh' CLI is not installed or not in PATH")),console.log(W.dim(" Install it: https://cli.github.com/"));else console.log(W.red(` ${q}`));process.exit(1)}}}if(B)process.exit(1)});FD.command("drop").description("Free local copies of annexed files (keeps remote copies)").argument("[files...]","Specific files to drop (default: all)").addHelpText("after",`
870
870
  Description:
871
871
  Remove local copies of annexed data files. Git-annex verifies that
872
872
  remote copies exist before dropping. Use 'nemar dataset get' to
@@ -883,7 +883,7 @@ Description:
883
883
 
884
884
  Examples:
885
885
  $ nemar dataset ci # Auto-detect from CWD
886
- $ nemar dataset ci nm000104 # Explicit dataset ID`).action(async(D)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let F=D;if(!F){let J=process.cwd();if(await w1(J))F=await r8(J);if(!F)console.log(W.red("Error: Could not detect dataset ID from current directory")),console.log(W.dim("Provide dataset ID explicitly: nemar dataset ci <id>")),process.exit(1)}let $=O(`Checking CI status for ${F}...`).start();try{let J=await DQ(F);$.stop(),console.log(W.bold(`CI Status: ${F}`)),console.log();let{bids_validation:Q}=J;if(!Q.present)console.log(` BIDS Validation: ${W.dim("not configured")}`),console.log(W.dim(` Ask an admin to run: nemar admin ci add ${F}`));else{let Y=Q.status==="success"?W.green:Q.status==="failure"?W.red:W.yellow;if(console.log(` BIDS Validation: ${Y(Q.status)}`),Q.url)console.log(` Latest run: ${W.cyan(Q.url)}`)}console.log()}catch(J){if(J instanceof b)$.fail(J.message);else{$.fail("Failed to check CI status");let Q=J instanceof Error?J.message:String(J);console.log(W.dim(` ${Q}`))}process.exit(1)}});FD.command("manifest").description("View version manifests for a dataset").argument("[version]","Version to view (lists available if omitted)").option("-d, --dataset <id>","Dataset ID (auto-detected from git remote if omitted)").option("--json","Output raw JSON").addHelpText("after",`
886
+ $ nemar dataset ci nm000104 # Explicit dataset ID`).action(async(D)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let F=D;if(!F){let J=process.cwd();if(await w1(J))F=await r8(J);if(!F)console.log(W.red("Error: Could not detect dataset ID from current directory")),console.log(W.dim("Provide dataset ID explicitly: nemar dataset ci <id>")),process.exit(1)}let $=O(`Checking CI status for ${F}...`).start();try{let J=await DQ(F);$.stop(),console.log(W.bold(`CI Status: ${F}`)),console.log();let{bids_validation:Q}=J;if(!Q.present)console.log(` BIDS Validation: ${W.dim("not configured")}`),console.log(W.dim(` Ask an admin to run: nemar admin ci add ${F}`));else{let Y=Q.status==="success"?W.green:Q.status==="failure"?W.red:W.yellow;if(console.log(` BIDS Validation: ${Y(Q.status)}`),Q.url)console.log(` Latest run: ${W.cyan(Q.url)}`)}console.log()}catch(J){if(J instanceof h)$.fail(J.message);else{$.fail("Failed to check CI status");let Q=J instanceof Error?J.message:String(J);console.log(W.dim(` ${Q}`))}process.exit(1)}});FD.command("manifest").description("View version manifests for a dataset").argument("[version]","Version to view (lists available if omitted)").option("-d, --dataset <id>","Dataset ID (auto-detected from git remote if omitted)").option("--json","Output raw JSON").addHelpText("after",`
887
887
  Description:
888
888
  View version manifests that map file paths to S3 annex keys.
889
889
  Manifests are generated when a version DOI is published.
@@ -894,7 +894,7 @@ Examples:
894
894
  $ nemar dataset manifest # List available versions
895
895
  $ nemar dataset manifest v1.0.0 # View specific version
896
896
  $ nemar dataset manifest v1.0.0 --json # Raw JSON output
897
- $ nemar dataset manifest -d nm000104 # Explicit dataset ID`).action(async(D,F)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let $=F.dataset;if(!$){let Q=process.cwd();if(await w1(Q))$=await r8(Q);if(!$)console.log(W.red("Error: Could not detect dataset ID")),console.log(W.dim("Provide dataset ID: nemar dataset manifest -d <id>")),process.exit(1)}let J=O("Fetching manifest info...").start();try{if(!D){let Q=await xf($);if(J.stop(),console.log(W.bold(`Manifests: ${$}`)),console.log(),Q.versions.length===0)console.log(W.dim(" No manifests available yet.")),console.log(W.dim(" Manifests are generated when a version DOI is published."));else for(let Y of Q.versions)console.log(` ${W.cyan(Y)}`);console.log()}else{let Q=await FQ($,D);if(J.stop(),F.json)console.log(JSON.stringify(Q,null,2));else{if(console.log(W.bold(`Manifest: ${$} ${Q.version}`)),Q.doi)console.log(` DOI: ${W.cyan(Q.doi)}`);if(Q.concept_doi)console.log(` Concept DOI: ${W.dim(Q.concept_doi)}`);console.log(` Created: ${Q.created}`),console.log();let Y=Object.entries(Q.files),B=Y.filter(([,G])=>!G.key.startsWith("git:")),X=Y.filter(([,G])=>G.key.startsWith("git:"));if(B.length>0){console.log(W.bold(` Annexed files (${B.length}):`));for(let[G,H]of B){let q=sh(H.size);console.log(` ${G} ${W.dim(`(${q})`)}`)}}if(X.length>0){console.log(),console.log(W.bold(` Metadata files (${X.length}):`));for(let[G,H]of X){let q=sh(H.size);console.log(` ${G} ${W.dim(`(${q})`)}`)}}console.log()}}}catch(Q){if(Q instanceof b)J.fail(Q.message);else{J.fail("Failed to fetch manifest");let Y=Q instanceof Error?Q.message:String(Q);console.log(W.dim(` ${Y}`))}process.exit(1)}});function sh(D){if(D===0)return"0 B";let F=["B","KB","MB","GB","TB"],$=Math.floor(Math.log(D)/Math.log(1024));return`${(D/1024**$).toFixed($>0?1:0)} ${F[$]}`}xD();n3();i8();x4();a6();import{mkdirSync as aV0,rmSync as oV0,writeFileSync as c9}from"fs";import{tmpdir as sV0}from"os";import{join as s6}from"path";function rV0(D){let F=s6(D,"sub-01"),$=s6(F,"eeg");return{root:D,datasetDescription:s6(D,"dataset_description.json"),participants:s6(D,"participants.tsv"),readme:s6(D,"README"),subjectDir:F,eegDir:$,edfFile:s6($,"sub-01_task-rest_eeg.edf"),sidecarJson:s6($,"sub-01_task-rest_eeg.json")}}function th(D){let F=D||s6(sV0(),`nemar-sandbox-${Date.now()}`),$=rV0(F);aV0($.eegDir,{recursive:!0});let J={Name:"NEMAR Sandbox Training Dataset",BIDSVersion:"1.9.0",DatasetType:"raw",License:"CC0",Authors:["NEMAR CLI Training"],HowToAcknowledge:"This is a sandbox dataset for testing the NEMAR upload workflow.",DatasetDOI:"n/a"};c9($.datasetDescription,JSON.stringify(J,null,2));let Q=`participant_id age sex
897
+ $ nemar dataset manifest -d nm000104 # Explicit dataset ID`).action(async(D,F)=>{if(!L0())console.log(W.red("Error: Not authenticated")),console.log("Run 'nemar auth login' first"),process.exit(1);let $=F.dataset;if(!$){let Q=process.cwd();if(await w1(Q))$=await r8(Q);if(!$)console.log(W.red("Error: Could not detect dataset ID")),console.log(W.dim("Provide dataset ID: nemar dataset manifest -d <id>")),process.exit(1)}let J=O("Fetching manifest info...").start();try{if(!D){let Q=await xf($);if(J.stop(),console.log(W.bold(`Manifests: ${$}`)),console.log(),Q.versions.length===0)console.log(W.dim(" No manifests available yet.")),console.log(W.dim(" Manifests are generated when a version DOI is published."));else for(let Y of Q.versions)console.log(` ${W.cyan(Y)}`);console.log()}else{let Q=await FQ($,D);if(J.stop(),F.json)console.log(JSON.stringify(Q,null,2));else{if(console.log(W.bold(`Manifest: ${$} ${Q.version}`)),Q.doi)console.log(` DOI: ${W.cyan(Q.doi)}`);if(Q.concept_doi)console.log(` Concept DOI: ${W.dim(Q.concept_doi)}`);console.log(` Created: ${Q.created}`),console.log();let Y=Object.entries(Q.files),B=Y.filter(([,G])=>!G.key.startsWith("git:")),X=Y.filter(([,G])=>G.key.startsWith("git:"));if(B.length>0){console.log(W.bold(` Annexed files (${B.length}):`));for(let[G,H]of B){let q=sh(H.size);console.log(` ${G} ${W.dim(`(${q})`)}`)}}if(X.length>0){console.log(),console.log(W.bold(` Metadata files (${X.length}):`));for(let[G,H]of X){let q=sh(H.size);console.log(` ${G} ${W.dim(`(${q})`)}`)}}console.log()}}}catch(Q){if(Q instanceof h)J.fail(Q.message);else{J.fail("Failed to fetch manifest");let Y=Q instanceof Error?Q.message:String(Q);console.log(W.dim(` ${Y}`))}process.exit(1)}});function sh(D){if(D===0)return"0 B";let F=["B","KB","MB","GB","TB"],$=Math.floor(Math.log(D)/Math.log(1024));return`${(D/1024**$).toFixed($>0?1:0)} ${F[$]}`}xD();n3();i8();x4();a6();import{mkdirSync as aV0,rmSync as oV0,writeFileSync as c9}from"fs";import{tmpdir as sV0}from"os";import{join as s6}from"path";function rV0(D){let F=s6(D,"sub-01"),$=s6(F,"eeg");return{root:D,datasetDescription:s6(D,"dataset_description.json"),participants:s6(D,"participants.tsv"),readme:s6(D,"README"),subjectDir:F,eegDir:$,edfFile:s6($,"sub-01_task-rest_eeg.edf"),sidecarJson:s6($,"sub-01_task-rest_eeg.json")}}function th(D){let F=D||s6(sV0(),`nemar-sandbox-${Date.now()}`),$=rV0(F);aV0($.eegDir,{recursive:!0});let J={Name:"NEMAR Sandbox Training Dataset",BIDSVersion:"1.9.0",DatasetType:"raw",License:"CC0",Authors:["NEMAR CLI Training"],HowToAcknowledge:"This is a sandbox dataset for testing the NEMAR upload workflow.",DatasetDOI:"n/a"};c9($.datasetDescription,JSON.stringify(J,null,2));let Q=`participant_id age sex
898
898
  sub-01 25 M
899
899
  `;c9($.participants,Q);let Y=`# NEMAR Sandbox Training Dataset
900
900
 
@@ -917,7 +917,7 @@ This dataset is used to:
917
917
 
918
918
  This dataset contains randomly generated data and is not suitable for analysis.
919
919
  It will be automatically cleaned up from the sandbox environment.
920
- `;c9($.readme,Y),tV0($.edfFile,500);let B={TaskName:"rest",TaskDescription:"Resting state with eyes closed (sandbox test data)",SamplingFrequency:256,PowerLineFrequency:60,SoftwareFilters:"n/a",EEGChannelCount:4,EEGReference:"Cz",RecordingType:"continuous",RecordingDuration:60,Manufacturer:"NEMAR CLI Sandbox"};return c9($.sidecarJson,JSON.stringify(B,null,2)),$}function tV0(D,F=500){let Q=Math.floor(F*1024/2048),Y=Buffer.alloc(256," ");Y.write("0 ",0,8),Y.write("X X X NEMAR_Sandbox_Subject",8,80),Y.write("Startdate 01-JAN-2024 X NEMAR_CLI_Sandbox",88,80),Y.write("01.01.24",168,8),Y.write("00.00.00",176,8);let B=1280;Y.write(B.toString().padEnd(8),184,8),Y.write("EDF+C".padEnd(44),192,44),Y.write(Q.toString().padEnd(8),236,8),Y.write("1 ",244,8),Y.write(4 .toString().padEnd(4),252,4);let X=Buffer.alloc(1024," "),G=["Fp1","Fp2","C3","C4"],H=16,q=[{offset:0,size:16,values:G},{offset:64,size:80,values:Array(4).fill("EEG electrode")},{offset:384,size:8,values:Array(4).fill("uV")},{offset:416,size:8,values:Array(4).fill("-500")},{offset:448,size:8,values:Array(4).fill("500")},{offset:480,size:8,values:Array(4).fill("-32768")},{offset:512,size:8,values:Array(4).fill("32767")},{offset:544,size:80,values:Array(4).fill("")},{offset:864,size:8,values:Array(4).fill(256 .toString())},{offset:896,size:32,values:Array(4).fill("")}];for(let Z of q)for(let L=0;L<4;L++){let A=Z.values[L].padEnd(Z.size);X.write(A,Z.offset+L*Z.size,Z.size)}let K=2048,V=Buffer.alloc(Q*K);for(let Z=0;Z<V.length;Z+=2){let L=Math.floor(Math.random()*65536)-32768;V.writeInt16LE(L,Z)}let E=Buffer.concat([Y,X,V]);c9(D,E)}function e1(D){let{execSync:F}=K0("child_process");try{F(`chmod -R u+w "${D}" 2>/dev/null || true`,{stdio:"ignore"}),oV0(D,{recursive:!0,force:!0})}catch($){try{F(`rm -rf "${D}"`,{stdio:"ignore"})}catch(J){console.warn(`Warning: Could not remove sandbox directory ${D}: ${J instanceof Error?J.message:String(J)}`),console.warn("You may need to manually remove this directory.")}}}function eh(D){let{statSync:F}=K0("fs"),$=0,J=[D.datasetDescription,D.participants,D.readme,D.edfFile,D.sidecarJson];for(let Q of J)try{$+=F(Q).size}catch(Y){let B=Y;if(B.code!=="ENOENT")console.warn(`Warning: Could not stat ${Q}: ${B.message}`)}return $}var wQ=new i0("sandbox").description("Complete sandbox training before uploading datasets").option("-v, --verbose","Print full subprocess output (git, git-annex) for debugging").addHelpText("after",`
920
+ `;c9($.readme,Y),tV0($.edfFile,500);let B={TaskName:"rest",TaskDescription:"Resting state with eyes closed (sandbox test data)",SamplingFrequency:256,PowerLineFrequency:60,SoftwareFilters:"n/a",EEGChannelCount:4,EEGReference:"Cz",RecordingType:"continuous",RecordingDuration:60,Manufacturer:"NEMAR CLI Sandbox"};return c9($.sidecarJson,JSON.stringify(B,null,2)),$}function tV0(D,F=500){let Q=Math.floor(F*1024/2048),Y=Buffer.alloc(256," ");Y.write("0 ",0,8),Y.write("X X X NEMAR_Sandbox_Subject",8,80),Y.write("Startdate 01-JAN-2024 X NEMAR_CLI_Sandbox",88,80),Y.write("01.01.24",168,8),Y.write("00.00.00",176,8);let B=1280;Y.write(B.toString().padEnd(8),184,8),Y.write("EDF+C".padEnd(44),192,44),Y.write(Q.toString().padEnd(8),236,8),Y.write("1 ",244,8),Y.write(4 .toString().padEnd(4),252,4);let X=Buffer.alloc(1024," "),G=["Fp1","Fp2","C3","C4"],H=16,q=[{offset:0,size:16,values:G},{offset:64,size:80,values:Array(4).fill("EEG electrode")},{offset:384,size:8,values:Array(4).fill("uV")},{offset:416,size:8,values:Array(4).fill("-500")},{offset:448,size:8,values:Array(4).fill("500")},{offset:480,size:8,values:Array(4).fill("-32768")},{offset:512,size:8,values:Array(4).fill("32767")},{offset:544,size:80,values:Array(4).fill("")},{offset:864,size:8,values:Array(4).fill(256 .toString())},{offset:896,size:32,values:Array(4).fill("")}];for(let Z of q)for(let L=0;L<4;L++){let M=Z.values[L].padEnd(Z.size);X.write(M,Z.offset+L*Z.size,Z.size)}let K=2048,V=Buffer.alloc(Q*K);for(let Z=0;Z<V.length;Z+=2){let L=Math.floor(Math.random()*65536)-32768;V.writeInt16LE(L,Z)}let E=Buffer.concat([Y,X,V]);c9(D,E)}function e1(D){let{execSync:F}=K0("child_process");try{F(`chmod -R u+w "${D}" 2>/dev/null || true`,{stdio:"ignore"}),oV0(D,{recursive:!0,force:!0})}catch($){try{F(`rm -rf "${D}"`,{stdio:"ignore"})}catch(J){console.warn(`Warning: Could not remove sandbox directory ${D}: ${J instanceof Error?J.message:String(J)}`),console.warn("You may need to manually remove this directory.")}}}function eh(D){let{statSync:F}=K0("fs"),$=0,J=[D.datasetDescription,D.participants,D.readme,D.edfFile,D.sidecarJson];for(let Q of J)try{$+=F(Q).size}catch(Y){let B=Y;if(B.code!=="ENOENT")console.warn(`Warning: Could not stat ${Q}: ${B.message}`)}return $}var wQ=new i0("sandbox").description("Complete sandbox training before uploading datasets").option("-v, --verbose","Print full subprocess output (git, git-annex) for debugging").addHelpText("after",`
921
921
  Description:
922
922
  Sandbox training verifies your setup and familiarizes you with the upload
923
923
  workflow. You must complete sandbox training before uploading real datasets.
@@ -930,7 +930,7 @@ Examples:
930
930
  $ nemar sandbox --verbose # Run with full subprocess output (debug stuck runs)
931
931
  $ nemar sandbox status # Check if training is completed
932
932
  $ nemar sandbox reset # Reset for re-training
933
- `).action(eV0);async function eV0(D={}){if(D.verbose)Eg(!0);if(console.log(),console.log(W.bold("NEMAR Sandbox Training")),console.log(W.dim("Verify your setup and learn the upload workflow")),D.verbose)console.log(W.dim("Verbose mode: subprocess invocations will be printed"));if(console.log(),!L0()){console.log(W.red("Not authenticated")),console.log(W.dim("Run 'nemar auth login' first"));return}let F=JD();if(F.sandboxCompleted){console.log(W.green("Sandbox training already completed!")),console.log(W.dim(`Dataset ID: ${F.sandboxDatasetId}`)),console.log(),console.log("You can upload real datasets with:"),console.log(W.cyan(" nemar dataset upload ./your-dataset")),console.log(),console.log(W.dim("To re-run training, use: nemar sandbox reset"));return}console.log(W.bold("Step 1/6: Checking prerequisites..."));let $=O("Checking prerequisites...").start(),J=await x9();if(!J.allPassed){$.fail("Prerequisites check failed"),console.log(),console.log(W.red("Missing requirements:"));for(let R of J.errors)console.log(W.yellow(` - ${R}`));if(J.errors.some((R)=>R.includes("GitHub")))console.log(W.dim(" Run 'gh auth login' to authenticate with GitHub"));return}$.succeed("All prerequisites met");let Q=O("Verifying GitHub CLI authentication...").start(),Y=await _9(F.githubUsername);if(!Y.authenticated){Q.fail("GitHub CLI not authenticated"),console.log(W.red(` ${Y.error}`)),console.log(),console.log("GitHub CLI is required for sandbox training. Install and authenticate:"),console.log(W.cyan(" brew install gh # or visit https://cli.github.com/")),console.log(W.cyan(" gh auth login"));return}if(F.githubUsername&&!Y.matches)Q.warn("GitHub CLI user mismatch"),console.log(W.yellow(` ${Y.error}`)),console.log(),console.log("Your gh CLI is authenticated as a different GitHub account than your NEMAR account."),console.log("This may cause issues with repository access. To fix:"),console.log(W.cyan(` gh auth login # Login as ${F.githubUsername}`)),console.log(),console.log(W.yellow("WARNING: If upload fails with permission errors, this mismatch is the likely cause.")),console.log();else Q.succeed(`GitHub CLI authenticated as ${Y.username}`);console.log(),console.log(W.bold("Step 2/6: Generating test dataset..."));let B=O("Creating minimal BIDS structure...").start(),X;try{let R=th();X=R.root;let n=eh(R);B.succeed(`Test dataset created (${XD(n)})`),console.log(W.dim(` Location: ${X}`))}catch(R){B.fail("Failed to generate test dataset"),console.log(W.red(` ${R instanceof Error?R.message:"Unknown error"}`));return}console.log(),console.log(W.bold("Step 3/6: Registering sandbox dataset..."));let G=O("Creating dataset on NEMAR...").start(),H,q,K,V,E;try{let R=await $Q({name:"Sandbox Training Dataset",description:"Placeholder dataset for sandbox training",files:[{path:"sub-01/eeg/sub-01_task-rest_eeg.edf",size:512000,type:"data"},{path:"dataset_description.json",size:200,type:"metadata"},{path:"participants.tsv",size:50,type:"metadata"},{path:"README",size:500,type:"metadata"},{path:"sub-01/eeg/sub-01_task-rest_eeg.json",size:300,type:"metadata"}],sandbox:!0});H=R.dataset.dataset_id,q=R.dataset.ssh_url,K=R.dataset.github_url,V=R.s3_config,E=R.dataset.s3_prefix,G.succeed(`Sandbox dataset created: ${W.cyan(H)}`),console.log(W.dim(` GitHub: ${K}`)),await new Promise((n)=>setTimeout(n,1e4))}catch(R){if(G.fail("Failed to create sandbox dataset"),R instanceof b)console.log(W.red(` ${R.message}`));else console.log(W.red(` ${R instanceof Error?R.message:"Unknown error"}`));e1(X);return}let Z=O("Accepting GitHub repository invitation...").start(),L=K?.match(/github\.com\/([a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+)/),A=L?L[1].replace(/\.git$/,""):null;if(!A){Z.fail("Invalid GitHub repository URL from backend"),console.log(W.red(` Received: ${K||"(empty)"}`)),console.log(W.red(" Expected format: https://github.com/owner/repo")),console.log(),console.log("This may indicate a backend issue. Please contact support."),e1(X);return}let M=await f9(A);if(M.accepted)if(M.alreadyCollaborator)Z.succeed("Already a collaborator on this repository");else Z.succeed("GitHub invitation accepted");else Z.warn("Could not auto-accept invitation"),console.log(W.yellow(` ${M.error}`)),console.log(),console.log("You may need to accept the invitation manually:"),console.log(W.cyan(` https://github.com/${A}/invitations`)),console.log();console.log(),console.log(W.bold("Step 4/6: Initializing repository..."));let N=O("Setting up git-annex...").start(),w=F.username&&F.email?{name:F.username,email:F.email}:void 0;try{let R=await n6(X,{author:w});if(!R.success)throw Error(R.error||"Failed to initialize dataset");await g4(X),await a8(X,q),N.succeed("Repository initialized")}catch(R){N.fail("Failed to initialize repository"),console.log(W.red(` ${R instanceof Error?R.message:"Unknown error"}`)),e1(X);return}console.log(),console.log(W.bold("Step 5/6: Uploading to S3..."));let P=O("Requesting upload credentials...").start(),C;try{C=await O8(H),P.succeed("Upload credentials received")}catch(R){P.fail("Could not get upload credentials"),console.log(W.red(` ${R instanceof Error?R.message:"Unknown error"}`)),e1(X);return}let T=RD(C.credentials),y=O("Configuring S3 remote...").start(),d=await w8(X,{name:"nemar-s3",bucket:C.s3.bucket,prefix:`${E}/objects`,region:C.s3.region,publicUrl:V.public_url},T);if(!d.success){y.fail("Failed to configure S3 remote"),console.log(W.red(` ${d.error}`)),console.log(W.dim(" Re-run with --verbose to see git-annex output.")),e1(X);return}y.succeed("S3 remote configured");let W0=O("Tracking data files with git-annex...").start(),F0=await i6(X);if(!F0.success){W0.fail("Failed to track data files"),console.log(W.red(` ${F0.error}`)),console.log(W.dim(" Re-run with --verbose to see git-annex output.")),e1(X);return}W0.succeed("Data files tracked by git-annex");let O0=O("Uploading data files to S3...").start(),e=await j8(X,"nemar-s3",4,T);if(await kD(X),!e.success){O0.fail("S3 upload failed"),console.log(W.red(` ${e.error}`)),console.log(W.dim(" Re-run with --verbose to see git-annex output.")),e1(X);return}O0.succeed(`Uploaded ${e.filesCopied} data file(s) to S3`),console.log(),console.log(W.bold("Step 6/6: Pushing to GitHub..."));let N0=O("Saving and pushing...").start();try{await o8(X,"Initial sandbox training upload",w),await o1(X),N0.succeed("Pushed to GitHub")}catch(R){N0.fail("Failed to push to GitHub"),console.log(W.red(` ${R instanceof Error?R.message:"Unknown error"}`)),e1(X);return}let GD=O("Finalizing...").start();try{await JQ(H),await lf(H),a1("sandboxCompleted",!0),a1("sandboxDatasetId",H),GD.succeed("Sandbox training complete!")}catch(R){GD.fail("Failed to finalize"),console.log(W.red(` ${R instanceof Error?R.message:"Unknown error"}`)),e1(X);return}e1(X),console.log(),console.log(W.green.bold("Congratulations! Sandbox training completed successfully.")),console.log(),console.log("Your setup is verified and you're ready to upload real datasets:"),console.log(W.cyan(" nemar dataset upload ./your-dataset")),console.log(),console.log(W.dim(`Sandbox dataset: ${H}`))}wQ.command("status").description("Check sandbox training completion status").option("--refresh","Fetch latest status from server").action(async(D)=>{if(!L0()){console.log(W.red("Not authenticated")),console.log(W.dim("Run 'nemar auth login' first"));return}if(D.refresh){let F=O("Checking status...").start();try{let $=await df();if(a1("sandboxCompleted",$.sandbox_completed),$.sandbox_dataset_id)a1("sandboxDatasetId",$.sandbox_dataset_id);if(F.stop(),$.sandbox_completed){if(console.log(W.green("Sandbox training: Completed")),console.log(W.dim(` Dataset ID: ${$.sandbox_dataset_id}`)),$.sandbox_completed_at)console.log(W.dim(` Completed: ${$.sandbox_completed_at}`))}else console.log(W.yellow("Sandbox training: Not completed")),console.log(),console.log("Run sandbox training with:"),console.log(W.cyan(" nemar sandbox"))}catch($){if(F.fail("Failed to check status"),$ instanceof b)console.log(W.red(` ${$.message}`))}}else{let F=JD();if(F.sandboxCompleted)console.log(W.green("Sandbox training: Completed")),console.log(W.dim(` Dataset ID: ${F.sandboxDatasetId}`));else console.log(W.yellow("Sandbox training: Not completed")),console.log(),console.log("Run sandbox training with:"),console.log(W.cyan(" nemar sandbox"))}});wQ.command("reset").description("Reset sandbox training status for re-training").option(j0,T0).option(b0,y0).action(async(D)=>{if(!L0()){console.log(W.red("Not authenticated")),console.log(W.dim("Run 'nemar auth login' first"));return}if(!JD().sandboxCompleted){console.log(W.yellow("Sandbox training not yet completed")),console.log(W.dim("Nothing to reset"));return}let $=await k0("Reset sandbox training status? You will need to complete training again.",D);if($!=="confirmed"){console.log(W.dim($==="declined"?"Skipped":"Cancelled"));return}let J=O("Resetting sandbox status...").start();try{await pf(),RW("sandboxCompleted"),RW("sandboxDatasetId"),J.succeed("Sandbox status reset"),console.log(),console.log("Run sandbox training again with:"),console.log(W.cyan(" nemar sandbox"))}catch(Q){if(J.fail("Failed to reset"),Q instanceof b)console.log(W.red(` ${Q.message}`));else console.log(W.red(` ${Q instanceof Error?Q.message:"Unknown error"}`))}});i8();CW();xD();i8();x4();var Db=100;async function Fb(){try{let{notices:D}=await Wg();if(!D||D.length===0)return;let F=JD(),$=new Set(F.dismissedNoticeIds||[]),J=D.filter((Q)=>!$.has(Q.id));if(J.length===0)return;for(let Q of J)DZ0(Q);if(L0()){let Q=J.filter((Y)=>Y.level==="info").map((Y)=>Y.id);if(Q.length>0)FZ0(Q)}}catch(D){if(process.env.VERBOSE)process.stderr.write(`[notices] ${D instanceof Error?D.message:D}
933
+ `).action(eV0);async function eV0(D={}){if(D.verbose)Eg(!0);if(console.log(),console.log(W.bold("NEMAR Sandbox Training")),console.log(W.dim("Verify your setup and learn the upload workflow")),D.verbose)console.log(W.dim("Verbose mode: subprocess invocations will be printed"));if(console.log(),!L0()){console.log(W.red("Not authenticated")),console.log(W.dim("Run 'nemar auth login' first"));return}let F=JD();if(F.sandboxCompleted){console.log(W.green("Sandbox training already completed!")),console.log(W.dim(`Dataset ID: ${F.sandboxDatasetId}`)),console.log(),console.log("You can upload real datasets with:"),console.log(W.cyan(" nemar dataset upload ./your-dataset")),console.log(),console.log(W.dim("To re-run training, use: nemar sandbox reset"));return}console.log(W.bold("Step 1/6: Checking prerequisites..."));let $=O("Checking prerequisites...").start(),J=await x9();if(!J.allPassed){$.fail("Prerequisites check failed"),console.log(),console.log(W.red("Missing requirements:"));for(let R of J.errors)console.log(W.yellow(` - ${R}`));if(J.errors.some((R)=>R.includes("GitHub")))console.log(W.dim(" Run 'gh auth login' to authenticate with GitHub"));return}$.succeed("All prerequisites met");let Q=O("Verifying GitHub CLI authentication...").start(),Y=await _9(F.githubUsername);if(!Y.authenticated){Q.fail("GitHub CLI not authenticated"),console.log(W.red(` ${Y.error}`)),console.log(),console.log("GitHub CLI is required for sandbox training. Install and authenticate:"),console.log(W.cyan(" brew install gh # or visit https://cli.github.com/")),console.log(W.cyan(" gh auth login"));return}if(F.githubUsername&&!Y.matches)Q.warn("GitHub CLI user mismatch"),console.log(W.yellow(` ${Y.error}`)),console.log(),console.log("Your gh CLI is authenticated as a different GitHub account than your NEMAR account."),console.log("This may cause issues with repository access. To fix:"),console.log(W.cyan(` gh auth login # Login as ${F.githubUsername}`)),console.log(),console.log(W.yellow("WARNING: If upload fails with permission errors, this mismatch is the likely cause.")),console.log();else Q.succeed(`GitHub CLI authenticated as ${Y.username}`);console.log(),console.log(W.bold("Step 2/6: Generating test dataset..."));let B=O("Creating minimal BIDS structure...").start(),X;try{let R=th();X=R.root;let n=eh(R);B.succeed(`Test dataset created (${XD(n)})`),console.log(W.dim(` Location: ${X}`))}catch(R){B.fail("Failed to generate test dataset"),console.log(W.red(` ${R instanceof Error?R.message:"Unknown error"}`));return}console.log(),console.log(W.bold("Step 3/6: Registering sandbox dataset..."));let G=O("Creating dataset on NEMAR...").start(),H,q,K,V,E;try{let R=await $Q({name:"Sandbox Training Dataset",description:"Placeholder dataset for sandbox training",files:[{path:"sub-01/eeg/sub-01_task-rest_eeg.edf",size:512000,type:"data"},{path:"dataset_description.json",size:200,type:"metadata"},{path:"participants.tsv",size:50,type:"metadata"},{path:"README",size:500,type:"metadata"},{path:"sub-01/eeg/sub-01_task-rest_eeg.json",size:300,type:"metadata"}],sandbox:!0});H=R.dataset.dataset_id,q=R.dataset.ssh_url,K=R.dataset.github_url,V=R.s3_config,E=R.dataset.s3_prefix,G.succeed(`Sandbox dataset created: ${W.cyan(H)}`),console.log(W.dim(` GitHub: ${K}`)),await new Promise((n)=>setTimeout(n,1e4))}catch(R){if(G.fail("Failed to create sandbox dataset"),R instanceof h)console.log(W.red(` ${R.message}`));else console.log(W.red(` ${R instanceof Error?R.message:"Unknown error"}`));e1(X);return}let Z=O("Accepting GitHub repository invitation...").start(),L=K?.match(/github\.com\/([a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+)/),M=L?L[1].replace(/\.git$/,""):null;if(!M){Z.fail("Invalid GitHub repository URL from backend"),console.log(W.red(` Received: ${K||"(empty)"}`)),console.log(W.red(" Expected format: https://github.com/owner/repo")),console.log(),console.log("This may indicate a backend issue. Please contact support."),e1(X);return}let A=await f9(M);if(A.accepted)if(A.alreadyCollaborator)Z.succeed("Already a collaborator on this repository");else Z.succeed("GitHub invitation accepted");else Z.warn("Could not auto-accept invitation"),console.log(W.yellow(` ${A.error}`)),console.log(),console.log("You may need to accept the invitation manually:"),console.log(W.cyan(` https://github.com/${M}/invitations`)),console.log();console.log(),console.log(W.bold("Step 4/6: Initializing repository..."));let N=O("Setting up git-annex...").start(),w=F.username&&F.email?{name:F.username,email:F.email}:void 0;try{let R=await n6(X,{author:w});if(!R.success)throw Error(R.error||"Failed to initialize dataset");await g4(X),await a8(X,q),N.succeed("Repository initialized")}catch(R){N.fail("Failed to initialize repository"),console.log(W.red(` ${R instanceof Error?R.message:"Unknown error"}`)),e1(X);return}console.log(),console.log(W.bold("Step 5/6: Uploading to S3..."));let P=O("Requesting upload credentials...").start(),C;try{C=await O8(H),P.succeed("Upload credentials received")}catch(R){P.fail("Could not get upload credentials"),console.log(W.red(` ${R instanceof Error?R.message:"Unknown error"}`)),e1(X);return}let T=RD(C.credentials),y=O("Configuring S3 remote...").start(),d=await w8(X,{name:"nemar-s3",bucket:C.s3.bucket,prefix:`${E}/objects`,region:C.s3.region,publicUrl:V.public_url},T);if(!d.success){y.fail("Failed to configure S3 remote"),console.log(W.red(` ${d.error}`)),console.log(W.dim(" Re-run with --verbose to see git-annex output.")),e1(X);return}y.succeed("S3 remote configured");let W0=O("Tracking data files with git-annex...").start(),F0=await i6(X);if(!F0.success){W0.fail("Failed to track data files"),console.log(W.red(` ${F0.error}`)),console.log(W.dim(" Re-run with --verbose to see git-annex output.")),e1(X);return}W0.succeed("Data files tracked by git-annex");let O0=O("Uploading data files to S3...").start(),e=await j8(X,"nemar-s3",4,T);if(await kD(X),!e.success){O0.fail("S3 upload failed"),console.log(W.red(` ${e.error}`)),console.log(W.dim(" Re-run with --verbose to see git-annex output.")),e1(X);return}O0.succeed(`Uploaded ${e.filesCopied} data file(s) to S3`),console.log(),console.log(W.bold("Step 6/6: Pushing to GitHub..."));let N0=O("Saving and pushing...").start();try{await o8(X,"Initial sandbox training upload",w),await o1(X),N0.succeed("Pushed to GitHub")}catch(R){N0.fail("Failed to push to GitHub"),console.log(W.red(` ${R instanceof Error?R.message:"Unknown error"}`)),e1(X);return}let GD=O("Finalizing...").start();try{await JQ(H),await lf(H),a1("sandboxCompleted",!0),a1("sandboxDatasetId",H),GD.succeed("Sandbox training complete!")}catch(R){GD.fail("Failed to finalize"),console.log(W.red(` ${R instanceof Error?R.message:"Unknown error"}`)),e1(X);return}e1(X),console.log(),console.log(W.green.bold("Congratulations! Sandbox training completed successfully.")),console.log(),console.log("Your setup is verified and you're ready to upload real datasets:"),console.log(W.cyan(" nemar dataset upload ./your-dataset")),console.log(),console.log(W.dim(`Sandbox dataset: ${H}`))}wQ.command("status").description("Check sandbox training completion status").option("--refresh","Fetch latest status from server").action(async(D)=>{if(!L0()){console.log(W.red("Not authenticated")),console.log(W.dim("Run 'nemar auth login' first"));return}if(D.refresh){let F=O("Checking status...").start();try{let $=await df();if(a1("sandboxCompleted",$.sandbox_completed),$.sandbox_dataset_id)a1("sandboxDatasetId",$.sandbox_dataset_id);if(F.stop(),$.sandbox_completed){if(console.log(W.green("Sandbox training: Completed")),console.log(W.dim(` Dataset ID: ${$.sandbox_dataset_id}`)),$.sandbox_completed_at)console.log(W.dim(` Completed: ${$.sandbox_completed_at}`))}else console.log(W.yellow("Sandbox training: Not completed")),console.log(),console.log("Run sandbox training with:"),console.log(W.cyan(" nemar sandbox"))}catch($){if(F.fail("Failed to check status"),$ instanceof h)console.log(W.red(` ${$.message}`))}}else{let F=JD();if(F.sandboxCompleted)console.log(W.green("Sandbox training: Completed")),console.log(W.dim(` Dataset ID: ${F.sandboxDatasetId}`));else console.log(W.yellow("Sandbox training: Not completed")),console.log(),console.log("Run sandbox training with:"),console.log(W.cyan(" nemar sandbox"))}});wQ.command("reset").description("Reset sandbox training status for re-training").option(j0,T0).option(b0,y0).action(async(D)=>{if(!L0()){console.log(W.red("Not authenticated")),console.log(W.dim("Run 'nemar auth login' first"));return}if(!JD().sandboxCompleted){console.log(W.yellow("Sandbox training not yet completed")),console.log(W.dim("Nothing to reset"));return}let $=await k0("Reset sandbox training status? You will need to complete training again.",D);if($!=="confirmed"){console.log(W.dim($==="declined"?"Skipped":"Cancelled"));return}let J=O("Resetting sandbox status...").start();try{await pf(),RW("sandboxCompleted"),RW("sandboxDatasetId"),J.succeed("Sandbox status reset"),console.log(),console.log("Run sandbox training again with:"),console.log(W.cyan(" nemar sandbox"))}catch(Q){if(J.fail("Failed to reset"),Q instanceof h)console.log(W.red(` ${Q.message}`));else console.log(W.red(` ${Q instanceof Error?Q.message:"Unknown error"}`))}});i8();CW();xD();i8();x4();var Db=100;async function Fb(){try{let{notices:D}=await Wg();if(!D||D.length===0)return;let F=JD(),$=new Set(F.dismissedNoticeIds||[]),J=D.filter((Q)=>!$.has(Q.id));if(J.length===0)return;for(let Q of J)DZ0(Q);if(L0()){let Q=J.filter((Y)=>Y.level==="info").map((Y)=>Y.id);if(Q.length>0)FZ0(Q)}}catch(D){if(process.env.VERBOSE)process.stderr.write(`[notices] ${D instanceof Error?D.message:D}
934
934
  `)}}function DZ0(D){let F,$;switch(D.level){case"critical":F="CRITICAL",$=W.red.bold;break;case"warning":F="WARNING",$=W.yellow;break;default:F="NOTICE",$=W.blue}let J=$(`[${F}]`);if(D.level==="critical"){let Q=W.red("\u2500".repeat(50));process.stderr.write(`${Q}
935
935
  ${J} ${D.message}
936
936
  ${Q}